Serializing EMF objects to StringBuffer [message #1716935] |
Wed, 09 December 2015 06:51 |
Bjorn Gustafsson 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 |
Ed Merks 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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03708 seconds