Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Graphiti and EMFStore
Graphiti and EMFStore [message #1277687] Wed, 26 March 2014 10:17 Go to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
Hi All,

I am newbie in Graphiti and modeling world.

I'm trying to store my Graphiti Diagram, with all objects that it contains, in EMFStore, through emfstore API.

Can I do this at all? And if I can, how?

I tried to do this in resourcesSaved method of DiagramTypeProvider, but i got "Commit cancelled by checksum error handler due to invalid checksum" error.

Here is part of my code

System.out.println("Client starting...");

ESWorkspace workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();

workspace.addServer(Application.localServer);

for (ESServer existingServer : workspace.getServers()) {
if (existingServer != Application.localServer) {
try {
workspace.removeServer(existingServer);
} catch (ESServerNotFoundException e) {
e.printStackTrace();
}
}
}

final ESLocalProject demoProject = workspace.createLocalProject("DemoProject");

for (ESLocalProject existingLocalProject : workspace.getLocalProjects()) {
if (existingLocalProject != demoProject) {
try {
existingLocalProject.delete(new ESSystemOutProgressMonitor());
} catch (IOException e) {
e.printStackTrace();
}
}
}

String username = "super";
String password = "super";
ESUsersession usersession = Application.localServer.login(username, password);

ESRemoteProject remoteDemoProject = demoProject.shareProject(usersession, new ESSystemOutProgressMonitor());

for (ESRemoteProject existingRemoteProject : Application.localServer.getRemoteProjects(usersession)) {
if (!existingRemoteProject.getGlobalProjectId().equals(remoteDemoProject.getGlobalProjectId())) {
existingRemoteProject.delete(usersession, new NullProgressMonitor());
}
}
TransactionalEditingDomain editingDomain =
TransactionUtil.getEditingDomain(diagram);
editingDomain.getCommandStack().execute(new
RecordingCommand(editingDomain) {

@Override
protected void doExecute() {
demoProject.getModelElements().add(diagram);
}
});

// Goal goal = GoalsFactory.eINSTANCE.createGoal();
demoProject.commit("Diagram commited", ESCommitCallback.NOCALLBACK, new ESSystemOutProgressMonitor());


Any help is appreciated

Djordje


Djordje Stanojevic
Re: Graphiti and EMFStore [message #1279088 is a reply to message #1277687] Fri, 28 March 2014 08:10 Go to previous messageGo to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
Guys, Anyone... Sad ?

Does anyone try to save Graphiti diagram to EMFStore? I would like to know if this is possible at all?

Any help is very appreciated Smile


Djordje Stanojevic
Re: Graphiti and EMFStore [message #1279124 is a reply to message #1277687] Fri, 28 March 2014 09:02 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Djorde,

I'm not familiar with EMF Store, so I don't know how they handle saving.

But I assume they have a special kind of resource they need to connect to
the workspace. So the easiest approach would be to create such a resource
instead of a standard EMF resource and add your new objects to that
everywhere you create EObjects (e.g. in create features).

The diagram itself (root object) needs to be created outside of the editor
in an EMFStore resource and the editor should be started with a URL that
should point to this object. The child diagram objects should then
automatically be stored in the same resource using the default Graphiti save
mechanism.

As I said I'm not familiar with EMFStore and I haven't tried that.

Michael
Re: Graphiti and EMFStore [message #1279377 is a reply to message #1277687] Fri, 28 March 2014 16:55 Go to previous messageGo to next message
Djordje Stanojevic is currently offline Djordje StanojevicFriend
Messages: 14
Registered: February 2014
Junior Member
Michael,

Thank you for your reply. I really appreciate that Smile.
I will try to resolve this problem following the solution you suggest.

In a meantime, if someone else, who has expirience with EMFStore and Graphiti integration, has any idea how to solve this problem, please share your idea here.

Djordje


Djordje Stanojevic
Re: Graphiti and EMFStore [message #1597632 is a reply to message #1279377] Mon, 02 February 2015 12:43 Go to previous message
Ruslan Didyk is currently offline Ruslan DidykFriend
Messages: 2
Registered: February 2015
Junior Member
Hi Djorde,

I have the same problem like yours. I need to display my emf models in diagram editor, and I also need to store Graphiti Digram file in EMFStore.
I would like to ask you, did you resolve this problem? Could you tell me please how?

Any help is appreciated

Best regards, Ruslan
Previous Topic:Move the Parent ContainerShape from its Children
Next Topic:Vertical Scrollbar Query
Goto Forum:
  


Current Time: Tue Apr 16 18:55:42 GMT 2024

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

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

Back to the top