Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Saving domain & pictogram models in my own format
Saving domain & pictogram models in my own format [message #756222] Fri, 11 November 2011 14:53 Go to next message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member
Hi,

we have a proprietary file format for our domain models, and I would like to be able to save the XSI Diagram/pictogram model directly in our file (not using EMF for domain model). Is there any way of doing this, subclassing the DiagramEditor and intercepting the save/load cycle?

Thanks,
Jakob

Re: Saving domain & pictogram models in my own format [message #756599 is a reply to message #756222] Mon, 14 November 2011 13:41 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi Jakob,

while it is not a problem to use your own file format
and modeling techniques for your domain objects (business objects)
the pictogram model is tightly bound to EMF and its resource API.
I think it is very hard to decouple the pictogram model serialization
from EMF. I would rather try to supply the framework with a specific EMF resource
implementation which writes/reads the format you need.

Maybe you find helpful information in this discussion:
http://www.eclipse.org/forums/index.php/t/240898/

Best, Tim
Re: Saving domain & pictogram models in my own format [message #756619 is a reply to message #756599] Mon, 14 November 2011 14:23 Go to previous messageGo to next message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member
Hi,

thanks for reply - my problem is slightly different though (sorry for not being clear enough):
I already have a file format for my business objects, and want to use EMF:s serialisation of the pictogram model, but I want to be in control of this serialisation. To be specific: I want the pictogram XMI to be saved in a specific tag in my proprietary business object XML like so:

<my-xml-tag-for-bo>
..non-EMF business objects go here
</my-xml-tag-for-bo>

<graphiti-design>
..EMF pictogram XMI goes here
</graphiti-design>

Hope this makes my use case clearer. The reason I want to do things this way is that we already have other tools that read and save models in our proprietary format and I want to be able to continue using that format, with an extra tag for the graphiti pictogram EMF model.


Thanks,
Jakob

Re: Saving domain & pictogram models in my own format [message #756814 is a reply to message #756619] Tue, 15 November 2011 09:09 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Thanks for clarifying. Still, i think my answer is valid. You can write your own resource implementation which operates as you described.
You would have to adapt DiagramEditorInput and the Matching Strategy as well.
Re: Saving domain & pictogram models in my own format [message #762096 is a reply to message #756814] Wed, 07 December 2011 14:39 Go to previous message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member
Thanks Tim,

I did what you suggested and used my own Resource for the combination of Pictogram and model objects. For the record: I did not need to adapt the DiagramEditorInput, only create a resource factory for my resource and register it for my file extension with the resource factory registry.

Thanks!
Jakob
Previous Topic:Zoom In / Zoom Out Actions
Next Topic:IPictogramElementDelegate & AdvancedPropertySection
Goto Forum:
  


Current Time: Fri Mar 29 07:46:07 GMT 2024

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

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

Back to the top