Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » change the serialization of the references, to use XMI IDs rather than paths(change the serialization of the references, to use XMI IDs rather than paths.)
change the serialization of the references, to use XMI IDs rather than paths [message #529546] Mon, 26 April 2010 10:36 Go to next message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
Hi ,

I have created models using EMF and GMF. After saving the models at run time i see that the saved file contains references like,

<customers customerID="1" orders="//@orders.0"/>
<orders comment="PO1" customer="//@customers.0"/>

In the book i read that using XMIResourceImpl we can, however, change the serialization of the two references, orders and customer, to use XMI IDs rather than paths.

<customers xmi:id="Customer_1" customerID="1" orders="Order_1"/>
<orders xmi:id="Order_1" comment="PO1" customer="Customer_1"/>

I am not clear what options we had to set in the XMIResourceImple to get this set automatically for all the models. I have around 100 models.

Please help me as this urgent!
Thanks!

Re: change the serialization of the references, to use XMI IDs rather than paths [message #529549 is a reply to message #529546] Mon, 26 April 2010 10:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
You'll need to a resource factory that creates a specialized
XMIResourceImpl that overrides useUUIDs to return true.

walnut23 wrote:
> Hi ,
> I have created models using EMF and GMF. After saving the models at
> run time i see that the saved file contains references like,
>
> <customers customerID="1" orders="//@orders.0"/>
> <orders comment="PO1" customer="//@customers.0"/>
>
> In the book i read that using XMIResourceImpl we can, however, change
> the serialization of the two references, orders and customer, to use
> XMI IDs rather than paths.
>
> <customers xmi:id="Customer_1" customerID="1" orders="Order_1"/>
> <orders xmi:id="Order_1" comment="PO1" customer="Customer_1"/>
>
> I am not clear what options we had to set in the XMIResourceImple to
> get this set automatically for all the models. I have around 100 models.
>
> Please help me as this urgent!
> Thanks!
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: change the serialization of the references, to use XMI IDs rather than paths [message #529822 is a reply to message #529549] Tue, 27 April 2010 11:20 Go to previous messageGo to next message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
Thankyou very much! I got it working without any problem Smile

Re: change the serialization of the references, to use XMI IDs rather than paths [message #532123 is a reply to message #529822] Fri, 07 May 2010 09:12 Go to previous messageGo to next message
walnut23  is currently offline walnut23 Friend
Messages: 23
Registered: March 2010
Junior Member
Hi ,
I changed the resource factory impl as mentioned in the previous thread and my reference is saved as follows (instead of the xpath format),

tariffSelectorLink="TariffSelectorID_52 TariffSelectorID_51"

This denotes two references. Is there a way that i can have the delimiter as '/' between the two references instead of the default ' ' ?

Please help!
Thanks!
Re: change the serialization of the references, to use XMI IDs rather than paths [message #532129 is a reply to message #532123] Fri, 07 May 2010 09:34 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
No, not without specializing XMLSaveImpl and XMLHandler to deal with that.


walnut23 wrote:
> Hi ,
> I changed the resource factory impl as mentioned in the previous
> thread and my reference is saved as follows (instead of the xpath
> format),
>
> tariffSelectorLink="TariffSelectorID_52 TariffSelectorID_51"
>
> This denotes two references. Is there a way that i can have the
> delimiter as '/' between the two references instead of the default ' ' ?
>
> Please help!
> Thanks!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Is there any Free Cobol Ecore Model?
Next Topic:Property "description" generated with attribute "multiline" to "yes"
Goto Forum:
  


Current Time: Thu Apr 25 06:31:19 GMT 2024

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

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

Back to the top