Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] XMI Serialization in/from multiple files
[Texo] XMI Serialization in/from multiple files [message #923921] Wed, 26 September 2012 10:03 Go to next message
Oliver Zhou is currently offline Oliver ZhouFriend
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 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
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
Re: [Texo] XMI Serialization in/from multiple files [message #925980 is a reply to message #923929] Fri, 28 September 2012 07:37 Go to previous message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi Martin,

Thanks, it's working well.
The converter is just cool
Previous Topic:Diagram Editor documentation
Next Topic:(later) undo "delete from diagram"
Goto Forum:
  


Current Time: Thu Dec 18 02:27:39 GMT 2014

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

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