Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Saving in XML
Saving in XML [message #198858] Thu, 24 July 2008 17:50 Go to next message
Eclipse UserFriend
Hello everybody!

I have two nodes in diagram and one link.

When I draw these two nodes and link them, my XML tree remains like:

<node name="a">
<link name="link"/>
</node>
<node name="b"/>

I would like to save the link in node b too. Like:


<node name="a">
<link name="link"/>
</node>
<node name="b">
<link name="link"/>
</node>

Is there some way to do this?!

Thanks,
Raphael
Re: Saving in XML [message #198875 is a reply to message #198858] Thu, 24 July 2008 22:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

Raphael wrote:
> Hello everybody!
>
> I have two nodes in diagram and one link.
>
> When I draw these two nodes and link them, my XML tree remains like:
>
> <node name="a">
> <link name="link"/>
> </node>
> <node name="b"/>
>
> I would like to save the link in node b too. Like:
>
>
> <node name="a">
> <link name="link"/>
> </node>
> <node name="b">
> <link name="link"/>
> </node>
>
> Is there some way to do this?!
>
> Thanks,
> Raphael
>
hi, just define a custom ResourceFactoryImpl which extends
ResourceFactoryImpl and overrite its createResource method, then
register it by extension point org.eclipse.emf.ecore.extension_parser.

The overrited method createResource must return a resource you must
define. Assume that the new defined resource is named FooResource,
overrite its key methods: doSave and doLoad, they are used to
*serialize* all EMF ojects in GMF editor into the custom XML file you
like and parse the custom XML to prepare EMF objects GMF editor need for
initialization respectively.

that's all, in addition, class XmlString is useful when do persistence.
Re: Saving in XML [message #198927 is a reply to message #198858] Fri, 25 July 2008 06:00 Go to previous message
Eclipse UserFriend
Hello Raphael,

You have to modify your meta-model and create reference from B to A + specify
this reference as an eOpposite for the one from A to B. Then corresponding
reference + line in XMI file will be created for you automatically bu EMF.

-----------------
Alex Shatalin
Previous Topic:non-rectangular bound
Next Topic:audit rule doesn't work
Goto Forum:
  


Current Time: Sun Jul 27 09:31:41 EDT 2025

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

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

Back to the top