Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Load serialized XMI file after change in graphical representation(How do I update a serialized XMI file?)
Load serialized XMI file after change in graphical representation [message #672304] Fri, 20 May 2011 15:51 Go to next message
Dominic S. is currently offline Dominic S.Friend
Messages: 11
Registered: May 2011
Junior Member
Hello!

In my Eclipse plugin project, I added a new attribute to the ecore model and then changed some stuff in the graphical representation, i.e. added a new rectangle and a label representing the new attribute.

When I create new objects in my editor (in old as well as in new XMI files), everything works as expected, but when I try to change existing objects in XMI files serialized before I added the changes, the new label does not seem to exist at all. I can modify the new attribute in the "Core" properties tag an I'm able to save this, but it's not displayed in the box where the label should be. It seems that the "notation" node in the XMI file is not updated.

Is there an easy way to "refresh" those "notation" settings in the old XMI files? Else, I would have to write a script which does that job - that's clearly not the ideal way.

Thanks in advance for any help!
Best regards,
Dominic

[Updated on: Tue, 24 May 2011 09:18]

Report message to a moderator

Re: Load serialized XMI file after change in graphical representation [message #673619 is a reply to message #672304] Tue, 24 May 2011 09:16 Go to previous message
Dominic S. is currently offline Dominic S.Friend
Messages: 11
Registered: May 2011
Junior Member
Hey, it's me again Wink

Is it possible that no one here knows a solution to this problem? I'm slowly getting desperate...

Maybe I should get a little bit more concrete. My "old" serialized XMI file looks similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http: //www.omg.org/XMI" xmlns="http: //my.editor" xmlns:notation="http: //www.eclipse.org/gmf/runtime/1.0.2/notation">
  <ShapesDiagram xmi:id="_h5Bp0DXrEeCXj8onX0-7EA">
    <shapes xmi:type="Ensemble" xmi:id="_oOKm8DXrEeCXj8onX0-7EA" name="Layer2a">
      <targetConnections xmi:type="Outgoing" xmi:id="_uV72cDXrEeCXj8onX0-7EA" source="_oOKm8DXrEeCXj8onX0-7EA" target="_qf5ZADXrEeCXj8onX0-7EA"/>
    </shapes>
  </ShapesDiagram>
  <notation:Diagram xmi:id="_h5Bp0TXrEeCXj8onX0-7EA" type="Diagram" element="_h5Bp0DXrEeCXj8onX0-7EA" name="file.sed" measurementUnit="Pixel">
    <children xmi:type="notation:Shape" xmi:id="_oOL1EDXrEeCXj8onX0-7EA" type="3001" element="_oOKm8DXrEeCXj8onX0-7EA" fontName="Segoe UI">
      <children xmi:type="notation:DecorationNode" xmi:id="_oOL1EjXrEeCXj8onX0-7EA" type="5006"/>
      <children xmi:type="notation:BasicCompartment" xmi:id="_oOL1EzXrEeCXj8onX0-7EA" type="7002"/>
      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_oOL1ETXrEeCXj8onX0-7EA" x="20" y="26" width="181" height="156"/>
    </children>
  </notation:Diagram>
</xmi:XMI>


Now I add a few rectangles and a label, and when I create a digram and save it, it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http: //www.omg.org/XMI" xmlns="http: //my.editor" xmlns:notation="http: //www.eclipse.org/gmf/runtime/1.0.2/notation">
  <ShapesDiagram xmi:id="_h5Bp0DXrEeCXj8onX0-7EA">
    <shapes xmi:type="Ensemble" xmi:id="_oOKm8DXrEeCXj8onX0-7EA" name="Layer2a">
      <targetConnections xmi:type="Outgoing" xmi:id="_uV72cDXrEeCXj8onX0-7EA" source="_oOKm8DXrEeCXj8onX0-7EA" target="_qf5ZADXrEeCXj8onX0-7EA"/>
    </shapes>
  </ShapesDiagram>
  <notation:Diagram xmi:id="_h5Bp0TXrEeCXj8onX0-7EA" type="Diagram" element="_h5Bp0DXrEeCXj8onX0-7EA" name="file.sed" measurementUnit="Pixel">
    <children xmi:type="notation:Shape" xmi:id="_oOL1EDXrEeCXj8onX0-7EA" type="3001" element="_oOKm8DXrEeCXj8onX0-7EA" fontName="Segoe UI">
      <children xmi:type="notation:DecorationNode" xmi:id="_oOL1EzXrEeCXj8onX0" type="5006"/>      
      <children xmi:type="notation:DecorationNode" xmi:id="_oOL1EzXrEeCXj8onX0" type="5007"/>
      <children xmi:type="notation:BasicCompartment" xmi:id="_oOL1EzXrEeCXj8onX0" type="7002"/>
      <children xmi:type="notation:BasicCompartment" xmi:id="_oOL1EzXrEeCXj8onX0" type="7004" collapsed="true">
        <styles xmi:type="notation:SortingStyle" xmi:id="_oOL1EzXrEeCXj8onX0"/>
        <styles xmi:type="notation:FilteringStyle" xmi:id="_oOL1EzXrEeCXj8onX0"/>
      </children>
      <layoutConstraint xmi:type="notation:Bounds" xmi:id="_oOL1ETXrEeCXj8onX0-7EA" x="20" y="26" width="181" height="156"/>
    </children>
  </notation:Diagram>
</xmi:XMI>


Now I have to assure that if someone opens the old file, it gets updated so that it matches the pattern of the new file - which it doesn't. The "notation" part of the XMI file is not changed! I tried save-as and stuff, but that does not work.

Any suggestions?

Thanks in advance,
With best regards,
Dominic

P.S.: Yes I know about the wrong whitespace in the URI like 'xmlns="http: //my.editor"', I just had to do this here because I'm not allowed to post links in the forum because I'm a newbie...

[Updated on: Tue, 24 May 2011 09:17]

Report message to a moderator

Previous Topic:Customize a Tree Viewer
Next Topic:Programtically added Elements - How to place them?
Goto Forum:
  


Current Time: Fri Apr 26 12:36:36 GMT 2024

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

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

Back to the top