[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: GenModel and file extension

Comments below.

Ed Merks a écrit :
Cyril,

Comments below.

Cyril Faucher wrote:
Hi,

I am discovering a new (for me) parameter in the GenModel: file extension.
Firstly, this parameter has replaced prefix to calculate the file extension ?
Yes, this gives you explicit control over what file extension*s* will be used; you can specify several...

Where is it reused in the generated code by EMF: model, edit, editor ?
It's used in the model's plugin.xml; remember that plugin.xml doesn't regenerate. It's also used to register the editors and is needed in the wizard to make sure a good file extension is chosen. So again, it affects the plugin.xml and it affects the generated plugin.properties; the former of course doesn't regenerate, and the latter while supporting merging will not change the value of an existing property.
I wish to get it throw the model source code. In my application, I have not access from the genmodel and the edit or editor plugins are not generated.
I see.

So the question: is there a workaround for getting the file extension without the *.genmodel, edit and editor plugins, but only with the model plugins.
Hmmm. No. If you declare a content type, a constant for that is generated in the XyxFactory interface, and with content types, many different extensions could be supported at the same time, including extensions also used by other models...

Are you writing a generic application or can you just declare a constant for your model that you use elsewhere?

I am writing a generic application with a generic loader and saver for EMF models.
I need the file extension, XyzPackageImpl class and the XyzResourceFactoryImpl class (If it exists) too.


My problem is that I am not able to assum the provider of a metamodel has deployed the genmodel or the editor plugin.

So my entry points for getting these informations are the plugin extensions: org.eclipse.emf.ecore.generated_package and org.eclipse.emf.ecore.extension_parser. I am getting these extensions thanks to the uri.

Currently mostly information about EMF persistence are in the model plugin, maybe the extensions could be moved in this plugin... in the plugin.properties or in a Java Class.

Cyril.