Generate URL to image stored on server

2012-06-06 Thread Gary
Hi,

my application has a mechanism allowing a user to upload an image. This 
image is then stored on the server's disk. The important point to note is 
that the image is *out-with* the deployed WAR file.

How do I generate a URL to access the image that has been uploaded? I want 
to return this URL after the upload is complete, so that I can construct an 
image widget around it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/DhqMlyoZpaIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



convert dom element to widget

2012-06-06 Thread Dennis Haupt
i am trying to write a function which generically collections dom elements
and adds them to complexpanels. i can get the dom elements, but how do i
add them to panels? panels need widgets. is there a way to convert them?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Firefox 13 DevMode Plugin

2012-06-06 Thread Dimitrijević Ivan
I did not have any dubt!

Thanks Alan


On Tuesday, June 5, 2012 9:44:44 PM UTC+2, Stefano Ciccarelli wrote:
>
>  Thanks. 
> I hope you could put it on the official download page because I'm still 
> stuck on Firefox 11. 
>
> -- 
> Sent with Sparrow 
>
> Il giorno martedì 5 giugno 2012, alle ore 20:05, Alan Leung ha scritto: 
>
> If anyone is wondering, I am aware and working on it.
>
> -Alan
>
>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>  
>  
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/h5kaJBZW5J0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: convert dom element to widget

2012-06-06 Thread Derek
If your dom elements are all of a particular type that has a GWT
analog, you can possibly wrap them using a convenience wrap() method.
For example, if they're all  elements, you can wrap them with
Anchor.wrap(element).

If you have a diverse (or unrepresented) group of elements, you should
just be able to run this code:

Widget w = new Widget();
w.setElement(element);


Derek

On Jun 6, 6:46 am, Dennis Haupt  wrote:
> i am trying to write a function which generically collections dom elements
> and adds them to complexpanels. i can get the dom elements, but how do i
> add them to panels? panels need widgets. is there a way to convert them?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Generate URL to image stored on server

2012-06-06 Thread Derek
Not sure what you mean by "out-with," but I'll assume you mean you
upload it to what would be the war folder in a GWT project. If that's
true, use GWT.getHostPageBaseURL()+"image.png" to get the URL.

Derek

On Jun 6, 5:09 am, Gary  wrote:
> Hi,
>
> my application has a mechanism allowing a user to upload an image. This
> image is then stored on the server's disk. The important point to note is
> that the image is *out-with* the deployed WAR file.
>
> How do I generate a URL to access the image that has been uploaded? I want
> to return this URL after the upload is complete, so that I can construct an
> image widget around it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How to send hashmap with a file using Servlet in GWT

2012-06-06 Thread learning coding
I want to know or some code sample which will help me to send the file
and the hashmap to the server.

To upload a file to GWt server i use formpanel and a HttpServlet. this
is working fine.

i have a hashmap

private static Map> docClass =
 new HashMap>();


which holds the property of document according to its classname.

I know how to do with RPC to send hashMap. but i want to do with
servlet.As i have to upload a file which i have done with servlet. And
every Hashmap is related to file .and this file with its property(in
HashMap) will send to external repository.

Please help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Generate URL to image stored on server

2012-06-06 Thread Gary
I mean it's being stored on the server's local disk, specifically the 
user's home directory (the user running the servlet container process, e.g. 
C:\Documents and Settings\garyk) I tried for days to use relative 
directories(i.e. creating Java 'File' objects without a full path, so that 
they were placed in the working directory) but this never worked. I need to 
pass these uploaded images to other serverside classes, which use them to 
generate more images, and this always failed: I figured it was because the 
servlet was creating and destroying temp directories.

I was also warned never to rely on a 'working directory' when programming a 
servlet. Is this true?

I'm basically having an all torrid time with serverside file management. I 
don't know if I'm misunderstanding something fundamental because what I'm 
trying to do is quite simple but I simply cannot get it to work. I'll break 
it down and perhaps someone can help me.

1. User uploads image. This is stored and the URL returned. An image widget 
is constructed around this URL.
*This part is functional as I use gwtupload, which has a clientside 
function to get the URL to the file just uploaded. I need to know how 
gwtupload generates this.*
*
*
2. If it qualifies, this image may be cropped. The crop interface simply 
sends a coordinate pair to the server. A new cropped image is made, and the 
old image deleted.
*I now need to return the URL of the new image. i.e. emulate what gwtupload 
does with Uploader.getFileUrl().*
*
*
3. User can preview their work: the generation of previews relies on 
knowing the locations of the previously uploaded images.
*The URL to the generated preview image must be returned so the browser can 
show  the image.*
*
*
It seems so simple yet I repeatedly fail. I hope someone can offer some 
help.

On Wednesday, June 6, 2012 2:30:23 PM UTC+1, Derek wrote:
>
> Not sure what you mean by "out-with," but I'll assume you mean you 
> upload it to what would be the war folder in a GWT project. If that's 
> true, use GWT.getHostPageBaseURL()+"image.png" to get the URL. 
>
> Derek 
>
> On Jun 6, 5:09 am, Gary  wrote: 
> > Hi, 
> > 
> > my application has a mechanism allowing a user to upload an image. This 
> > image is then stored on the server's disk. The important point to note 
> is 
> > that the image is *out-with* the deployed WAR file. 
> > 
> > How do I generate a URL to access the image that has been uploaded? I 
> want 
> > to return this URL after the upload is complete, so that I can construct 
> an 
> > image widget around it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3pKi8u1WRisJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Firefox 13 DevMode Plugin

2012-06-06 Thread Yuri C
Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/dXIrD_tJBPwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Generate URL to image stored on server

2012-06-06 Thread Piro
I don't think you can access files in this manner. If it would be possible it 
would mean you can access any file on server(no security). 

What you have to do is to store the file anywhere and generate some sort of ID 
for it. Then you need to implement HTTP GET request by servlet. Servlet will 
need to map ID to file location and write file to response (and set some things 
like content type).

Iam sure there are other ways (REST,...).
Piro

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/hldf-fpDy98J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Generate URL to image stored on server

2012-06-06 Thread Gary
That makes sense. I have changed the location of storage to be the working 
directory:

public static File dataDirectory = new File("card_designer");

I prepend this File to each new File I open. So now I just need to 
construct a URL to grab these images.

I have tried:

public static String accessURL = GWT.getModuleBaseURL();

On constructing an Image widget for my dynamic images, I append the 
relative filepath to this accessURL, as so:

Image example = accessURL + "card_designer/exampleImage.jpg";

However, I get a 404 file not found in my console on development mode:

404 - GET 
//http://127.0.0.1:/carddesigner/card_designer/exampleImage.jpg 
(127.0.0.1) 1444 bytes

I think I'm close, but I don't understand why the GET request fails. The 
images is right there on the disk.

On Wednesday, June 6, 2012 3:24:53 PM UTC+1, Piro wrote:
>
> I don't think you can access files in this manner. If it would be possible 
> it would mean you can access any file on server(no security). 
>
> What you have to do is to store the file anywhere and generate some sort 
> of ID for it. Then you need to implement HTTP GET request by servlet. 
> Servlet will need to map ID to file location and write file to response 
> (and set some things like content type).
>
> Iam sure there are other ways (REST,...).
> Piro
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/-34L4K1C8SwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Using the Frame class, and adding Elements to it directly - doesn't display?

2012-06-06 Thread King_V
Thomas,

Thanks.  I think I might be missing something very obvious, because
I'm looking at the APIs, and I have no idea how to do what you're
suggesting.

Code-wise, how do I get the document within the frame, so that I can
add the new Elements to it?

- Joe

On Jun 5, 6:24 pm, Thomas Broyer  wrote:
> You're adding your elements as children of the frame, which is used as a 
> fallback in case the browser does support frames. You should add them to the 
> document that's displayed within the frame.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Using the Frame class, and adding Elements to it directly - doesn't display?

2012-06-06 Thread Thomas Broyer


On Wednesday, June 6, 2012 6:13:04 PM UTC+2, King_V wrote:
>
> Thomas, 
>
> Thanks.  I think I might be missing something very obvious, because 
> I'm looking at the APIs, and I have no idea how to do what you're 
> suggesting. 
>
> Code-wise, how do I get the document within the frame, so that I can 
> add the new Elements to it?


Frame frame = ...;
FrameElement frameElt = frame.getElement().cast();
Document frameDoc = frameElt.getContentDocument();

You'll probably have to attach your Frame first, and possibly even wait for 
the LoadHandler to be called back (even for an about:blank)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/OwrGv_nxY3EJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Using the Frame class, and adding Elements to it directly - doesn't display?

2012-06-06 Thread King_V
Thanks, that helped a lot, works as expected now!

- Joe

On Jun 6, 12:46 pm, Thomas Broyer  wrote:
> On Wednesday, June 6, 2012 6:13:04 PM UTC+2, King_V wrote:
>
> > Thomas,
>
> > Thanks.  I think I might be missing something very obvious, because
> > I'm looking at the APIs, and I have no idea how to do what you're
> > suggesting.
>
> > Code-wise, how do I get the document within the frame, so that I can
> > add the new Elements to it?
>
> Frame frame = ...;
> FrameElement frameElt = frame.getElement().cast();
> Document frameDoc = frameElt.getContentDocument();
>
> You'll probably have to attach your Frame first, and possibly even wait for
> the LoadHandler to be called back (even for an about:blank)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Remove currency symbol and text

2012-06-06 Thread Antonio R. de Oliveira
I want to remove symbols and text from formatted String when using *
NumberFormat.getCurrencyFormat().format()* with internationalization.

Examples after remove:

Currency  - Formated  = Without 

US:US$100.15  = 100.15
BRL: 100,15R$= 100,15
Euro:100,15€ =  100,15

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/EskrnaGRjTMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to send hashmap with a file using Servlet in GWT

2012-06-06 Thread Thad
On Wednesday, June 6, 2012 9:47:32 AM UTC-4, learning coding wrote:
>
> I want to know or some code sample which will help me to send the file 
> and the hashmap to the server. 
>
> To upload a file to GWt server i use formpanel and a HttpServlet. this 
> is working fine. 
>
> i have a hashmap 
>
> private static Map> docClass = 
>  new HashMap>(); 
>
>
> which holds the property of document according to its classname. 
>
> I know how to do with RPC to send hashMap. but i want to do with 
> servlet.As i have to upload a file which i have done with servlet. And 
> every Hashmap is related to file .and this file with its property(in 
> HashMap) will send to external repository. 
>
> Please help.


First thought: Convert the map to an com.google.gwt.json.client.JSONObject 
on the client and send that as a String via POST to the servlet. On the 
server side turn that string into an org.json.JSONObject (
http://www.json.org/) and from that recreate the map.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/bTkmPFIfhcoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Remove currency symbol and text

2012-06-06 Thread Jens
Couldn't you just parse the string using getCurrencyFormat().parse() to get 
a double value for it and then format it again using 
getDecimalFormat().format() ?

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/HKOkJXrHOwoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Firefox 13 DevMode Plugin

2012-06-06 Thread Alan Leung
Ummm Bad news. There might be some serious issues with the new FF13. If you
really need devmode, please disable auto update.

-Alan

On Wed, Jun 6, 2012 at 6:52 AM, Yuri C  wrote:

> Thank you!
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/dXIrD_tJBPwJ.
>
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Firefox 13 DevMode Plugin

2012-06-06 Thread Thomas Broyer

On Wednesday, June 6, 2012 11:15:10 PM UTC+2, Alan Leung wrote:
>
> Ummm Bad news. There might be some serious issues with the new FF13. If 
> you really need devmode, please disable auto update.


It should be noted that SuperDevMode will be available in GWT 2.5 (as a 
"highly experimental" feature).
Given the update issues with Firefox, and the instability of DevMode in 
Chrome, this is something I think we should really invest on and stabilize 
and secure quickly (it leaves only IE as a DevMode-supporting browser, 
which mandates using Windows –or running Windows within a VM– and then 
there seem to be download issues recently; so as you say, the only usable 
platform for now is Firefox, by disabling auto-update)

BTW Alan, would you mind sharing what the issues are?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/IDNWja6jtIAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Firefox 13 DevMode Plugin

2012-06-06 Thread Alan Leung
>
> BTW Alan, would you mind sharing what the issues are?
>
>
Ah ah! I think we are safe. The root problem was that they changed the
layout of JSClass. At first I though it was something more serious. I feel
that most of the SpiderMonkey changes were not documented in this release.
:(

Anyways, I should make them available soon.

-Alan

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to send hashmap with a file using Servlet in GWT

2012-06-06 Thread Joseph Lust
Or, if possible, use GWT-RPC and send as many HashMaps through a basic 
Async interface as you like.

Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/zqttVYUJfRcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.