Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Graphiti and CDO integration(Build a Graphiti editor with CDO as 'back end' storage)
Graphiti and CDO integration [message #1064424] Wed, 19 June 2013 08:29 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hello,

I try to build a Graphiti editor with CDO as "back end" storage instead of a persistency based on files.

From Graphiti source code, I modified graphiti.genmodel to generate new CDO compliant classes in the org.eclipse.graphiti.mm_0.9.2.jar (also adding org.eclipse.emf.cdo as required bundle in the jar manifest).

I then managed to create and store an "empty" diagram in CDO along with my domain model (in the same resource for now...).

Now I would like to drag and drop a domain element from a tree viewer to its diagram editor (which is already opened).

Following the Graphiti tutorial, I provide an implementation for a add feature.
The canAdd method is Ok when I test it.
The add method differs from the tutorial in two points :
- added element and diagram are both CDOObjects.
- the added element is already stored in a CDO resource elsewhere so I guess I don't have to add it to the diagram one like the tutorial does.

Result is :
- the add method is executed.
- the editor tab is marked as modified when I drop my element.
- but nothing is displayed and I can't figure out why.

Any idea of what's wrong ?

Kind regards,

Laurent
Re: Graphiti and CDO integration [message #1064430 is a reply to message #1064424] Wed, 19 June 2013 08:47 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Laurent,

I'm not a CDO expert, but my first guess would be that the editor uses
another EMF resource that the one you are adding to?

Graphiti itself does not have an example on CDO integration, but the CDO
Dawn project has an example editor. Maybe it's worth to have a look into
that.

Michael
Re: Graphiti and CDO integration [message #1064454 is a reply to message #1064430] Wed, 19 June 2013 11:15 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi Michael,

Thanks for your answer. It sounds interesting... But I'm a complete newbie with Graphiti. Could you give me some more details on how to check what resource is actually used by the editor ? How can I investigate this point ?

Concerning Dawn/Graphiti/CDO integration, I had a quick look to the code.
Maybe I should study it further but it seems the approach is still "file oriented".
I mean the creation wizard is still based on file name and extension for both the model and the diagram. Even if behind the scene these "files" are stored in CDO.

I would like to completely get rid of this "file philosophy" and navigate in my tree viewer much more like in a data model.

Laurent
Re: Graphiti and CDO integration [message #1064600 is a reply to message #1064454] Thu, 20 June 2013 08:09 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Laurent,

DefaultUpdateBehavior.createEditingDomain() is the place where the editor
creates its editing domain. That editing domain is later used to load the
diagram and domain objects (DefaultPersistencyBehavior.loadDiagram). Saving
an editor with its resource set is done in
DefaultPersistencyBehavior.save().

These are the spots I would start with to investigate that.

Regarding the file philosophy I cannot really help. What I can say however
(and that is also true for Graphiti) is that the Eclipse 3.x editor in most
of the cases in the end will need some kind of file representation of
whatever you have in the backend.

Michael
Previous Topic:Text rotation on connection
Next Topic:Archive Updatesite 0.8.2 causes Fatal Errors
Goto Forum:
  


Current Time: Thu Apr 18 12:34:39 GMT 2024

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

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

Back to the top