Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Serializing EMF objects to StringBuffer(How to serialize EMF objects to StringBuffer when file is not an option (in GWT App Engine))
Serializing EMF objects to StringBuffer [message #1716935] Wed, 09 December 2015 06:51 Go to next message
Bjorn Gustafsson is currently offline Bjorn GustafssonFriend
Messages: 9
Registered: July 2009
Junior Member
Hi,
I'm migrating an EMF-based RCP application to GWT, which I deploy to Google's App Engine.
In the GWT client, the user edits the EMF objects, which are then submitted to the server for processing in Google App Engine.
Part of the server processing is to email the EMF objects for offline validation and consultation (by subject matter experts using a different application).

In the old RCP implementation, the EMF XML file was emailed as attachment.
In GWT, however, a file-based solution is not an option since the App Engine does not allow writing of files to the server file system.

So, as transportation alternative, I would like to include the XML serialized EMF objects in-line in the email. I imagine a StringBuffer would be a suitable format for the XML serialization.

How should I go about implementing this?
How do I write the EMF objects' XML representation to a StringBuffer instead of to file? (and, deserialize on the receiving end)

Any input is much appreciated!

thanks,
Bjorn
Re: Serializing EMF objects to StringBuffer [message #1716943 is a reply to message #1716935] Wed, 09 December 2015 07:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Bjorn,

There is no port of org.eclipse.emf.ecore.xmi to GWT so creating a human
readable XML serialization is not supported the same way as you could
easily do in your RCP application. In fact there is nothing in the GWT
port to support this. However, all the EObject implementation classes
support com.google.gwt.user.client.rpc.IsSerializable so via that, you
should be able to create a string representation and consume a string
representation. Unfortunately it won't be human readable, which I
imagine defeats the purpose. Some utility would need to be written to
be to convert such a serialization back to EMF objects and from those
produce the XML serialization.


On 09/12/2015 7:51 AM, Bjorn Gustafsson wrote:
> Hi,
> I'm migrating an EMF-based RCP application to GWT, which I deploy to
> Google's App Engine.
> In the GWT client, the user edits the EMF objects, which are then
> submitted to the server for processing in Google App Engine.
> Part of the server processing is to email the EMF objects for offline
> validation and consultation (by subject matter experts using a
> different application).
>
> In the old RCP implementation, the EMF XML file was emailed as
> attachment.
> In GWT, however, a file-based solution is not an option since the App
> Engine does not allow writing of files to the server file system.
>
> So, as transportation alternative, I would like to include the XML
> serialized EMF objects in-line in the email. I imagine a StringBuffer
> would be a suitable format for the XML serialization.
>
> How should I go about implementing this?
> How do I write the EMF objects' XML representation to a StringBuffer
> instead of to file? (and, deserialize on the receiving end)
>
> Any input is much appreciated!
>
> thanks,
> Bjorn


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Serializing EMF objects to StringBuffer [message #1717071 is a reply to message #1716943] Wed, 09 December 2015 19:35 Go to previous message
Bjorn Gustafsson is currently offline Bjorn GustafssonFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for your quick response, Ed
I have already tried the binary serialization path (which worked), but as you are pointing out the result was not usable for our purposes.

Anyways, thanks for spending your valuable cycles on this!

Bjorn
Previous Topic:EObjectValidator Rationale
Next Topic:[CDO] Transaction Notification Issue
Goto Forum:
  


Current Time: Thu Apr 25 12:11:37 GMT 2024

Powered by FUDForum. Page generated in 0.03708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top