Use existing model implementation [message #989948] |
Mon, 10 December 2012 08:36 |
Matthias N 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
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 #990004 is a reply to message #989993] |
Mon, 10 December 2012 12:36 |
Ralph Gerbig 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
|
|
|
Powered by
FUDForum. Page generated in 0.03994 seconds