Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Use existing model implementation
Use existing model implementation [message #989948] Mon, 10 December 2012 08:36 Go to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Hi,

we want to create a graphical editor for our domain model.

1) we created an Ecore file, representing the meta-model
2) we generated the model implementation out of the Ecore. At this, we modified the generated code and adjusted the serialization. We serialize into a predefined xml schema format.
3) Now I can create a file of our model, using the "wizard" (i.e. myModel.eaxml). Everything works fine, I can create elements, add new childs, and it is serialized according to our XML schema.

4) Now I want to have a graphical editor. Therefore I used GMF. I created the gmftool, graph, mapping, generator files and generated the diagram code. The diagram editor works well, but now comes my problem:

When I create a diagram (e.g. default.myeditor_diagram), the wizards prompts me to create the domain model file (e.g. default.eaxml). From now on, the standard XMI serialization is used Sad
How can I tell GMF to use the file from 3) and to get my model serialized into the XML schema?

Thank you very much!
Matthias
Re: Use existing model implementation [message #989978 is a reply to message #989948] Mon, 10 December 2012 10:31 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

without knowing what you did override it is hard to tell yout what is wrong. GMF uses an own XMIResource implementation that could be your problem. Search plugin.xml and xxxDocumentProvider for GMFResource maybe this could help you. I hope that you use custom JET templates to modify your generated EMF code. This could prevent you some problems in future.

Ralph
Re: Use existing model implementation [message #989993 is a reply to message #989948] Mon, 10 December 2012 11:17 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Hi,
hm... we have a "EastADLXMLResourceImpl" which I think is responsible for the serialization.

Can I tell GMF to use the "EastADLXMLResourceImpl" ?!

thanks
Re: Use existing model implementation [message #990004 is a reply to message #989993] Mon, 10 December 2012 12:36 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I did take a look at the GMF code and found the following. In plugin.xml GMFResourceFactory is registered. This class has a method called createResource there a GMFResource is returned. I think this could be your problem. You could also take a look at the extension points description:

Quote:

Description: This extension point is used to define the resource factory that handles a specific file (or URI) extension. The global EMF resource factory registry, Resource.Factory.Registry.INSTANCE, is used to record the registration.


Quote:

Supplied Implementation: The org.eclipse.emf.ecore.xmi plug-in extends this extension point to make the default EMF registrations: "ecore" is handled by EcoreResourceFactoryImpl, "emof" by EMOFResourceFactoryImpl, and XMIResourceFactoryImpl is the default.



Maybe this could be a starting point. However, I never did it by myself.

Ralph

[Updated on: Mon, 10 December 2012 12:40]

Report message to a moderator

Previous Topic:Serialization Questions
Next Topic:Only a type can be imported.
Goto Forum:
  


Current Time: Tue Apr 16 17:25:43 GMT 2024

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

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

Back to the top