[OCLinEcore] Import using metamodel URI [message #1008722] |
Wed, 13 February 2013 13:02  |
Eclipse User |
|
|
|
Hi!
I am currently working with the OCLinEcore-Editor and have a question how to reference other metamodels using the import-Statement.
Currently there are have two plugin-projects "ProjectA" and "ProjectB". Both projects have a metamodel, while ProjectB's metamodel references ProjectA's metamodel.
See the following example for ProjectB's metamodel:
import projecta : '../../ProjectA/model/projectAModel.ecore#/';
--does not work, when the model is not already registered:
-- import projecta : 'http://i.am.projecta/1.0';
import ecore_0 : 'http://www.eclipse.org/emf/2002/Ecore#/';
package b : b = 'http://i.am.projectb/1.0' {
class Foo {
property bar : projecta::Bar;
}
}
When working on the two plugins, both of the following scenarios are possible:
1) Both projects are in one workspace. To work on ProjectB's metamodel, I have to reference ProjectA's metamodel by its location/path (as shown in the code snippet above).
2) Plugin ProjectA is already loaded. To work on ProjectB's metamodel I have to change the import to reference the URI of ProjectA's metamodel.
Obviously, changing the imports depending on the workspace configuration is not what I want. I appreciate any kind of help or comments.
Thank you very much!
Kind Regards.
|
|
|
Re: [OCLinEcore] Import using metamodel URI [message #1008746 is a reply to message #1008722] |
Wed, 13 February 2013 14:06  |
Eclipse User |
|
|
|
Hi
You should find that platform:/resource/... paths preferentially use
files in open projects over files in installed plugins.
Regards
Ed Willink
On 13/02/2013 18:02, Missing name Mising name wrote:
> Hi!
>
> I am currently working with the OCLinEcore-Editor and have a question
> how to reference other metamodels using the import-Statement.
>
> Currently there are have two plugin-projects "ProjectA" and
> "ProjectB". Both projects have a metamodel, while ProjectB's metamodel
> references ProjectA's metamodel.
>
> See the following example for ProjectB's metamodel:
> import projecta : '../../ProjectA/model/projectAModel.ecore#/'; --does
> not work, when the model is not already registered:
> -- import projecta : 'http://i.am.projecta/1.0';
> import ecore_0 : 'http://www.eclipse.org/emf/2002/Ecore#/';
>
> package b : b = 'http://i.am.projectb/1.0' {
>
> class Foo {
> property bar : projecta::Bar;
> }
>
> }
> When working on the two plugins, both of the following scenarios are
> possible:
> 1) Both projects are in one workspace. To work on ProjectB's
> metamodel, I have to reference ProjectA's metamodel by its
> location/path (as shown in the code snippet above).
> 2) Plugin ProjectA is already loaded. To work on ProjectB's metamodel
> I have to change the import to reference the URI of ProjectA's metamodel.
>
> Obviously, changing the imports depending on the workspace
> configuration is not what I want. I appreciate any kind of help or
> comments.
>
> Thank you very much!
> Kind Regards.
|
|
|
Powered by
FUDForum. Page generated in 0.05155 seconds