Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Modifying the generated XML (model) from diagram
Modifying the generated XML (model) from diagram [message #1005644] Mon, 28 January 2013 02:49 Go to next message
Jae Lee is currently offline Jae LeeFriend
Messages: 4
Registered: January 2013
Junior Member
Hi, so by using GMF, I made a diagram of software architecture. However, I want to modify the generated XML file so that it can comply to our model.. Currently, here is the file generated from the diagram:

<?xml version="1.0" encoding="UTF-8"?>
<caparch:ComponentDiagram xmlns:caparch="caparch">
<componentType ID="" name="DriveControllerType">
<interfaceInstances interfaceTypeLink="#//@interfaceType.0" interfaceRoleLink="#//@interfaceType.0/@interfaceRoles.0"/>
</componentType>
<connectorType>
<interfaceInstances interfaceTypeLink="#//@interfaceType.1" interfaceRoleLink="#//@interfaceType.1/@interfaceRoles.0"/>
</connectorType>
<componentInstance ID="IBTTYPE" name="DriveControllerInstance" componentTypeLink="#//@componentType.0">
<interfaceInstanceLinks interfaceInstanceLinking="#//@componentType.0/@interfaceInstances.0"/>
</componentInstance>
<connectorInstance connectorTypeLink="#//@connectorType.0">
<interfaceInstanceLinks interfaceInstanceLinking="#//@connectorType.0/@interfaceInstances.0"/>
</connectorInstance>
<domain name="DCritical" desc="The domain containing the critical components" componentInstanceLinking="#//@componentInstance.0" connectorInstanceLinking="#//@connectorInstance.0"/>
<link connector="#//@connectorInstance.0/@interfaceInstanceLinks.0" component="#//@componentInstance.0/@interfaceInstanceLinks.0"/>
</caparch:ComponentDiagram>

As you can see it seems that when this XML refers to some other element, it seems that it already has set the own unique id for each element and referring to it rather. However, I want it to refer to the element's ID for example. if <componentInstance ID="IBTTYPE" name="DriveControllerInstance" componentTypeLink="#//@componentType.0"> (the id is IBTTYPE) then when this part componentInstanceLinking="#//@componentInstance.0" connectorInstanceLinking="#//@connectorInstance.0"/> refers to #//@componentInstance.0. Rather, I want this refer to it by using IBTTYPE. Would this be possible by somehow?

Thank you very much.
Re: Modifying the generated XML (model) from diagram [message #1005678 is a reply to message #1005644] Mon, 28 January 2013 09:08 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 697
Registered: November 2009
Senior Member
Hi,

this is a EMF related question which could be better answered in the EMF forums. You can have a custom serialization of EMF models thats for sure.

Ralph
Re: Modifying the generated XML (model) from diagram [message #1005685 is a reply to message #1005644] Mon, 28 January 2013 09:18 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26226
Registered: July 2009
Senior Member
Jae,

Is the ID EAttribute marked with isID true in the Ecore model? If you
do that, it should be used for the reference. Also, if your references
can't ever be cross document and you don't want the "#" in the
reference, you should mark that EReference with isResolveProxies false.


On 28/01/2013 3:49 AM, Jae Lee wrote:
> Hi, so by using GMF, I made a diagram of software architecture.
> However, I want to modify the generated XML file so that it can comply
> to our model.. Currently, here is the file generated from the diagram:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <caparch:ComponentDiagram xmlns:caparch="caparch">
> <componentType ID="" name="DriveControllerType">
> <interfaceInstances interfaceTypeLink="#//@interfaceType.0"
> interfaceRoleLink="#//@interfaceType.0/@interfaceRoles.0"/>
> </componentType>
> <connectorType>
> <interfaceInstances interfaceTypeLink="#//@interfaceType.1"
> interfaceRoleLink="#//@interfaceType.1/@interfaceRoles.0"/>
> </connectorType>
> <componentInstance ID="IBTTYPE" name="DriveControllerInstance"
> componentTypeLink="#//@componentType.0">
> <interfaceInstanceLinks
> interfaceInstanceLinking="#//@componentType.0/@interfaceInstances.0"/>
> </componentInstance>
> <connectorInstance connectorTypeLink="#//@connectorType.0">
> <interfaceInstanceLinks
> interfaceInstanceLinking="#//@connectorType.0/@interfaceInstances.0"/>
> </connectorInstance>
> <domain name="DCritical" desc="The domain containing the critical
> components" componentInstanceLinking="#//@componentInstance.0"
> connectorInstanceLinking="#//@connectorInstance.0"/>
> <link connector="#//@connectorInstance.0/@interfaceInstanceLinks.0"
> component="#//@componentInstance.0/@interfaceInstanceLinks.0"/>
> </caparch:ComponentDiagram>
>
> As you can see it seems that when this XML refers to some other
> element, it seems that it already has set the own unique id for each
> element and referring to it rather. However, I want it to refer to the
> element's ID for example. if <componentInstance ID="IBTTYPE"
> name="DriveControllerInstance"
> componentTypeLink="#//@componentType.0"> (the id is IBTTYPE) then when
> this part componentInstanceLinking="#//@componentInstance.0"
> connectorInstanceLinking="#//@connectorInstance.0"/> refers to
> #//@componentInstance.0. Rather, I want this refer to it by using
> IBTTYPE. Would this be possible by somehow?
>
> Thank you very much.
Previous Topic:How to connect two editor.
Next Topic:How to implement drag and drop to customized figures?
Goto Forum:
  


Current Time: Thu Nov 27 00:29:09 GMT 2014

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

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