Re: Place image in object, send object over rpc, use hibernate to update database

2010-11-29 Thread Gaurav Vaish
Sending image data over RPC... how do you plan to use this binary data
on the client side?
It's not possible... JavaScript does not have any image-processing
API.

You can do something like this:

- Create the image binary data on the server, and label it with some
unique ID (store in memory, filesystem, db wherever).
- Create a servlet, say ServeImageServlet that will do something like
this

   doGet(...) {
 String id = request.getParameter(imageID);
 InputStream input = huntForImageUsingID(id);
 response.setContentType(image/png); // or jpg, gif...

 OutputStream output = response.getOutputStream();
 //copy all data from input to output
   }

- In your RPC response, just send the URL.
Assuming that the servlet is mapped to /img, the URL can be
something like /img?imageID=abcd

- In the GWT app, use this URL to create a new Image(url)



--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.com


On Nov 29, 12:20 pm, Noor baken...@gmail.com wrote:
 Thus,the object will contain an image

-- 
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-tool...@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: Place image in object, send object over rpc, use hibernate to update database

2010-11-29 Thread ep
just wondering how u want to get image's raw data (binary) on the
client...actually not possible before html5, you have to upload the
image via browser form (and all the remnant data maybe as well to not
work with separate transactions)... take a look at gwtupload

On 29 Nov., 08:20, Noor baken...@gmail.com wrote:
 Thus,the object will contain an image

-- 
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-tool...@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: Place image in object, send object over rpc, use hibernate to update database

2010-11-29 Thread Noor
Ya this is not possible in client side javascript. I am finding this a
very great limitation because we should have been able to read file. I
think the file system should have been accessible via javascript  but
i think this can lead to security issues.

Still, thanks for your comments!!

-- 
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-tool...@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: Place image in object, send object over rpc, use hibernate to update database

2010-11-29 Thread David Chandler
Here's a recent article on how to do this with GWT + Google App Engine:

http://ikaisays.com/2010/09/08/gwt-blobstore-the-new-high-performance-image-serving-api-and-cute-dogs-on-office-chairs/

/dmc

On Mon, Nov 29, 2010 at 12:12 PM, Noor baken...@gmail.com wrote:
 Ya this is not possible in client side javascript. I am finding this a
 very great limitation because we should have been able to read file. I
 think the file system should have been accessible via javascript  but
 i think this can lead to security issues.

 Still, thanks for your comments!!

 --
 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-tool...@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.





-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
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-tool...@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.



Place image in object, send object over rpc, use hibernate to update database

2010-11-28 Thread Noor
Hi,
I have a scenario which if would solve many of my problems. I have an
object which needs to contain a member of type to hold a file which
will be an image.

What i need to do is to populate the object with its data such as
fields and the image, send the object over an rpc. Then at the server
implementation use hibernate to update database.

Does anyone of you have an idea of how to do this using gwt??

-- 
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-tool...@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: Place image in object, send object over rpc, use hibernate to update database

2010-11-28 Thread Noor


Thus,the object will contain an image

-- 
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-tool...@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.