Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Saving in XML
Saving in XML [message #198858] Thu, 24 July 2008 21:50 Go to next message
Raphael is currently offline RaphaelFriend
Messages: 47
Registered: July 2009
Member
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] Fri, 25 July 2008 02: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 10:00 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
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: Sat Jun 06 12:13:45 GMT 2020

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

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

Back to the top