importing subpackages of external ecore models [message #44086] |
Mon, 18 May 2009 10:28  |
Eclipse User |
|
|
|
hi all,
i am developing a dsl for (parts of) an existing ecore model with TMF
(0.7.0M7). this ecore model is very very large and has a complex package
structure.
i can import the whole model from the workspace with:
import " platform:/resource/org.my.projectname/model/externalmodel.ec ore "
as ExternalModel
however, when i try to reference a model element from inside the imported
model, i do not know how to "navigate" to the desired element inside the
package structure. for example:
Class :
'attribute'=[ExternalModel::Some::Packages::ExternalClass] ;
lets the editor return a "Cannot resolve reference to ExternalClass" error
message.
so question 1 is: if i import an external model as described above, how
can i make a reference to a class in a subpackage of that external model?
and question 2 is: if i do not want to import the entire external model,
how can i import only one specific subpackage inside it?
thanks in advance for you help!
|
|
|
Re: importing subpackages of external ecore models [message #44121 is a reply to message #44086] |
Mon, 18 May 2009 11:55   |
Eclipse User |
|
|
|
Hi Oliver,
please find my comments inline.
Am 18.05.2009 16:28 Uhr, schrieb Oliver:
> hi all,
>
> i am developing a dsl for (parts of) an existing ecore model with TMF
> (0.7.0M7). this ecore model is very very large and has a complex package
> structure.
>
> i can import the whole model from the workspace with:
> import " platform:/resource/org.my.projectname/model/externalmodel.ec ore "
> as ExternalModel
That is correct. This will import the root element from your ecore-resource.
>
> however, when i try to reference a model element from inside the
> imported model, i do not know how to "navigate" to the desired element
> inside the package structure. for example:
>
> Class :
> 'attribute'=[ExternalModel::Some::Packages::ExternalClass] ;
I'm afraid that navigating into subpackages is out of Xtext's scope.
The metamodel alias "ExternalModel" can be used to refer to exactly one
EPackage and provide access to all contained EClassifiers.
>
> lets the editor return a "Cannot resolve reference to ExternalClass"
> error message.
>
> so question 1 is: if i import an external model as described above, how
> can i make a reference to a class in a subpackage of that external model?
>
> and question 2 is: if i do not want to import the entire external model,
> how can i import only one specific subpackage inside it?
If you want to refer to elements from subpackages, you'll have to import
them in the same way as the toplevel package. This can either be done by
an URI that includes a fragment to point directly to the subpackage, or
by the ns-URI of the subpackage. I think the latter will only work in
the editor, if the subpackage has been registered in the EPackage
registry through a plugin.xml.
>
> thanks in advance for you help!
>
Hope that helps,
Sebastian
|
|
|
|
Re: importing subpackages of external ecore models [message #44183 is a reply to message #44152] |
Mon, 18 May 2009 13:11   |
Eclipse User |
|
|
|
Hi Oliver,
do you mean the grammar editor gets very slow? Or are you talking about
your specific DSL-Editor?
I assume you mean the latter :-)
If you really mean the editor for the Xtext grammar itself, I would be
glad to have a look into this performance issue. It would be very
helpful, if you can send me your metamodel and your xtext-file to
Sebastian(dot)Zarnekow(at)itemis(dot)de.
However, it is currently not possible to disable the on-keystroke
validator. This may be a serious problem with existing metamodels and
existing EValidators. Would you please be so kind and file a bug?
Regards,
Sebastian
Am 18.05.2009 18:24 Uhr, schrieb Oliver:
> hi sebastian,
>
> thanks for your answer. yes, i can now import only the needed subpackage
> with:
> import
> " platform:/resource/org.my.projectname/model/externalmodel.ec ore#//subpackage/subsubpackage "
> as ExternalModel
>
> i guess this is the first of your proposed solutions.
>
> another thing:
> because of the huge model, the editor gets very slow. after each and
> every key stroke the validator seems to validate the grammar. can this
> feature be disabled? in my case it would be sufficient to validate "on
> save" instead of while typing. this would be a nice feature of TMF.
>
|
|
|
|
|
Re: importing subpackages of external ecore models [message #44532 is a reply to message #44502] |
Tue, 19 May 2009 05:02   |
Eclipse User |
|
|
|
Hi Oliver,
6.7 Mb is quite impressive for a metamodel.
We are about to release a new Xtext build this afternoon. Please try to
use the grammar editor with this release candidate 1. As Sven already
mentioned, we made several changes that affect the editor's performance
significantly.
Regards,
Sebastian
Am 19.05.2009 10:44 Uhr, schrieb Oliver:
> Hi Sebastian and Sven,
>
> i am really talking about the grammar editor, not my DSL editor.
> when i import the existing meta-model as described in this thread
> (complete or just one subpackage) it gets slow on every key-stroke.
>
> unfortunatelly i cannot provide you the meta-model as is, due to the
> fact that it is part of an industrial project. just to mention some key
> data: the ecore meta-model has about 850 classes, 800 attributes, 1650
> references and a file size of about 6.7 Mb.
>
> Bye,
> Oliver.
>
|
|
|
Re: importing subpackages of external ecore models [message #44592 is a reply to message #44502] |
Wed, 20 May 2009 00:52   |
Eclipse User |
|
|
|
Oliver wrote:
> Hi Sebastian and Sven,
> i am really talking about the grammar editor, not my DSL editor.
> when i import the existing meta-model as described in this thread
> (complete or just one subpackage) it gets slow on every key-stroke.
> unfortunatelly i cannot provide you the meta-model as is, due to the fact
> that it is part of an industrial project. just to mention some key data:
> the ecore meta-model has about 850 classes, 800 attributes, 1650
> references and a file size of about 6.7 Mb.
> Bye,
> Oliver.
Hi Oliver,
You should probably split your huge domain model (of 850 classes) to
smaller sub-domain models and provide different DSL for each sub-domain
model you intend to provide a textual editor. I am using a similar domain
model (HL7 MIF2 with aprox. 850 classes, maybe is the same hehe), but I
never considered importing all classes at once into Xtext. I focus at one
aspect at the time and I use intermediate models to import in Xtext or to
apply other M2M/M2T transformations or graphical editors (using GMF).
Ioan
|
|
|
Re: importing subpackages of external ecore models [message #45187 is a reply to message #44532] |
Mon, 25 May 2009 03:55  |
Eclipse User |
|
|
|
Hi all,
I now installed the newest Xtext release and must say: good work! The
performance of the grammar editor improved significantly.
However, I also must consider Ioan's proposal of not to import (packages
of) the whole model, but to create a splitted small model of the parts of
interest.
Thank you all for your help.
Oliver.
> We are about to release a new Xtext build this afternoon. Please try to
> use the grammar editor with this release candidate 1. As Sven already
> mentioned, we made several changes that affect the editor's performance
> significantly.
> Regards,
> Sebastian
|
|
|
Powered by
FUDForum. Page generated in 0.05856 seconds