[Texo] XMI Serialization in/from multiple files [message #923921] |
Wed, 26 September 2012 10:03 |
Oliver Zhou Messages: 41 Registered: February 2012 |
Member |
|
|
Hi Martin,
Currently I can use ModelXMLSaver/ModelXMLLoader to serialize a object graph in/from XML (via setConvertNonContainedReferencedObjects as true).
It works pretty well.
And now I want to save cross-reference objects to their own xml file according to their type.
Imagine I have a ecore meta model with Person, Address and Person has a cross reference to Address.
I want to serialize Persons and Addresses into their own xml file like "Persons.xml", "Addresses.xml" and still keep the cross reference between them so that I can load them back.
I'm familiar with EMF Resource/ResourceSet concept, but it seems a little bit different in the context of Texo.
Do you have any suggestion to achieve this goal in Texo?
Best wishes,
Oliver
[Updated on: Wed, 26 September 2012 10:04] Report message to a moderator
|
|
|
Re: [Texo] XMI Serialization in/from multiple files [message #923929 is a reply to message #923921] |
Wed, 26 September 2012 10:09 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Oliver,
I think in this case your best 'bet' is to first convert the Texo pojo's to EMF objects and then you can do what you
want using standard EMF. This is also done internally by the ModelXMLLoader and ModelXMLSaver.
For model to emf and back see this page:
http://wiki.eclipse.org/Texo/Convert_to_EMF
gr. Martin
On 09/26/2012 12:03 PM, Oliver Zhou wrote:
> Hi Martin,
>
> Currently I can use ModelXMLSaver/ModelXMLLoader to serialize a object graph in/from XML (via
> setConvertNonContainedReferencedObjects as true).
> It works pretty well.
> And now I want to save cross-reference objects to their own xml file according to their type.
> Imagine I have a ecore meta model with Person, Address.
> I want to serialize Persons and Addresses into their own xml file like "Persons.xml", "Addresses.xml" and still keep the
> cross reference between them so that I can load them back.
>
> I'm familiar with EMF Resource/ResourceSet concept, but it seems a little bit different in the context of Texo.
> Do you have any suggestion to achieve this goal in Texo?
>
> Best wishes,
> Oliver
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Powered by
FUDForum. Page generated in 0.02705 seconds