Home » Archived » M2M (model-to-model transformation) » [ATL] Loading metamodel by uri programmatically
[ATL] Loading metamodel by uri programmatically [message #6115] |
Tue, 09 January 2007 04:02  |
Eclipse User |
|
|
|
Dear all,
This is a continuation of a thread on the Yahoo mailing list. A very
concise summary:
I wanted to launch an ATL transformation programmatically that uses an
already loaded metamodel, in most cases the uml2.
The method to load a 'normal metamodel' -- i.e. in a file is:
AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
InputStream themetamodel)
In order to use an already loaded metamodel, Frédéric told me to use the
following method:
AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, URI uri)
This is where I am now. Problem is that the latter method doesn't seem
to do what I expect. When I call:
atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
... I get a FileNotFoundException: http://www.eclipse.org/uml2/1.0.0/UML
Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
wasn't expecting loadModel to treat it as such.
What am I doing wrong?
Best wishes to you all,
Bert.
- Old thread --------------------------------------------------
Hi Bert,
Can you please post your question on the M2M newsgroup?
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00023.html
Please, do not forget to prefix the subject of your post with [ATL].
Also, please keep the history of the question in your post.
Thanks,
Frédéric
On 1/8/07, Bert Vanhooff <bert.vanhooff@cs.kuleuven.be> wrote:
> Hi Frédéric,
>
> I finally found the time to try you suggestion. Unfortunately I
> didn't succeed.
>
> The code that gets executed is equivalent to:
>
> atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
> URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
>
> .. and throws a FileNotFoundException:
> http://www.eclipse.org/uml2/1.0.0/UML on me
>
> Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
> wasn't expecting loadModel to see it as such.
>
> What am I doing wrong?
>
>
> Best wishes,
> Bert.
>
> --- In atl_discussion@yahoogroups.com, "Bert Vanhooff"
> <bert.vanhooff@...> wrote:
> >
> > Ok, I'll try this one.
> >
> > Many thanks,
> > Bert.
> >
> > --- In atl_discussion@yahoogroups.com, "Frédéric Jouault"
> > <f.jouault@> wrote:
> > >
> > > Hello Bert,
> > >
> > > The equivalent of "metamodel by uri" is not
getBuiltInMetaModels() but
> > > AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, URI
uri)
> > >
> > > You won't find this method in AtlModelHandler because it is
> > > EMF-specific (URI is
> > > org.eclipse.emf.common.util.URI).
> > >
> > >
> > > Regards,
> > >
> > > Frédéric Jouault
> > >
> > > On 9/26/06, Bert Vanhooff <bert.vanhooff@> wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > I'm writing my own atl launcher (based on ATLCommandLine) that
> > will be
> > > > used to execute transformations that use the uml2 metamodel.
> In the
> > > > atl eclipse plugin, this metamodel needs to be loaded with the
> > > > "metamodel by uri" option. I assumed that the equivalent to this
> > > > option in code is AtlModelHandler.getBuiltInMetaModel(String
name).
> > > > Now, I'm not shure what the parameter of that method should
> contain.
> > > > Passing the uml2 uri (http://www.eclipse.org/uml2/1.0.0/UML) as it
> > > > appears in the "metamodel by uri" dialog does not work.
> > > >
> > > > Does anyone have an idea?
> > > >
> > > > Thanks in advance,
> > > > Bert.
> > > >
> > > >
> > >
> >
>
>
>
|
|
|
Re: [ATL] Loading metamodel by uri programmatically [message #6145 is a reply to message #6115] |
Tue, 09 January 2007 04:16   |
Eclipse User |
|
|
|
Originally posted by: mikael.barbero.gmail.com
Dear Bert,
I think you should better use the
AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, String uri)
method. This method is looking into EMF Registry if you specify an "uri"
with "uri:" prefix (in your case, you will put
"uri:http://www.eclipse.org/uml2/1.0.0/UML").
The method AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
URI uri) is creating a new Resource(), that's why he told you such wrong
things !
Best Regards,
Mikael
Bert Vanhooff a écrit :
> Dear all,
>
> This is a continuation of a thread on the Yahoo mailing list. A very
> concise summary:
>
> I wanted to launch an ATL transformation programmatically that uses an
> already loaded metamodel, in most cases the uml2.
>
> The method to load a 'normal metamodel' -- i.e. in a file is:
> AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
> InputStream themetamodel)
>
> In order to use an already loaded metamodel, Frédéric told me to use the
> following method:
> AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, URI uri)
>
>
> This is where I am now. Problem is that the latter method doesn't seem
> to do what I expect. When I call:
>
> atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
> URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
>
> .. I get a FileNotFoundException: http://www.eclipse.org/uml2/1.0.0/UML
>
> Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
> wasn't expecting loadModel to treat it as such.
>
> What am I doing wrong?
>
>
> Best wishes to you all,
> Bert.
>
>
>
> - Old thread --------------------------------------------------
>
> Hi Bert,
>
> Can you please post your question on the M2M newsgroup?
> http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00023.html
>
> Please, do not forget to prefix the subject of your post with [ATL].
> Also, please keep the history of the question in your post.
>
>
> Thanks,
>
> Frédéric
>
> On 1/8/07, Bert Vanhooff <bert.vanhooff@cs.kuleuven.be> wrote:
> > Hi Frédéric,
> >
> > I finally found the time to try you suggestion. Unfortunately I
> > didn't succeed.
> >
> > The code that gets executed is equivalent to:
> >
> > atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
> > URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
> >
> > .. and throws a FileNotFoundException:
> > http://www.eclipse.org/uml2/1.0.0/UML on me
> >
> > Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
> > wasn't expecting loadModel to see it as such.
> >
> > What am I doing wrong?
> >
> >
> > Best wishes,
> > Bert.
> >
> > --- In atl_discussion@yahoogroups.com, "Bert Vanhooff"
> > <bert.vanhooff@...> wrote:
> > >
> > > Ok, I'll try this one.
> > >
> > > Many thanks,
> > > Bert.
> > >
> > > --- In atl_discussion@yahoogroups.com, "Frédéric Jouault"
> > > <f.jouault@> wrote:
> > > >
> > > > Hello Bert,
> > > >
> > > > The equivalent of "metamodel by uri" is not
> getBuiltInMetaModels() but
> > > > AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, URI
> uri)
> > > >
> > > > You won't find this method in AtlModelHandler because it is
> > > > EMF-specific (URI is
> > > > org.eclipse.emf.common.util.URI).
> > > >
> > > >
> > > > Regards,
> > > >
> > > > Frédéric Jouault
> > > >
> > > > On 9/26/06, Bert Vanhooff <bert.vanhooff@> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > I'm writing my own atl launcher (based on ATLCommandLine) that
> > > will be
> > > > > used to execute transformations that use the uml2 metamodel.
> > In the
> > > > > atl eclipse plugin, this metamodel needs to be loaded with the
> > > > > "metamodel by uri" option. I assumed that the equivalent to this
> > > > > option in code is AtlModelHandler.getBuiltInMetaModel(String
> name).
> > > > > Now, I'm not shure what the parameter of that method should
> > contain.
> > > > > Passing the uml2 uri (http://www.eclipse.org/uml2/1.0.0/UML)
> as it
> > > > > appears in the "metamodel by uri" dialog does not work.
> > > > >
> > > > > Does anyone have an idea?
> > > > >
> > > > > Thanks in advance,
> > > > > Bert.
> > > > >
> > > > >
> > > >
> > >
> >
> >
> >
--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
|
|
|
Re: [ATL] Loading metamodel by uri programmatically [message #6160 is a reply to message #6145] |
Tue, 09 January 2007 08:37  |
Eclipse User |
|
|
|
Ok, this seems to work. Thank you very much!
Bert.
Mikaël Barbero wrote:
> Dear Bert,
>
> I think you should better use the
> AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, String uri)
> method. This method is looking into EMF Registry if you specify an "uri"
> with "uri:" prefix (in your case, you will put
> "uri:http://www.eclipse.org/uml2/1.0.0/UML").
>
> The method AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
> URI uri) is creating a new Resource(), that's why he told you such wrong
> things !
>
> Best Regards,
> Mikael
>
> Bert Vanhooff a écrit :
>> Dear all,
>>
>> This is a continuation of a thread on the Yahoo mailing list. A very
>> concise summary:
>>
>> I wanted to launch an ATL transformation programmatically that uses an
>> already loaded metamodel, in most cases the uml2.
>>
>> The method to load a 'normal metamodel' -- i.e. in a file is:
>> AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
>> InputStream themetamodel)
>>
>> In order to use an already loaded metamodel, Frédéric told me to use
>> the following method:
>> AtlEMFModelHandler.loadModel(String name, ASMModel metamodel, URI uri)
>>
>>
>> This is where I am now. Problem is that the latter method doesn't
>> seem to do what I expect. When I call:
>>
>> atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
>> URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
>>
>> .. I get a FileNotFoundException: http://www.eclipse.org/uml2/1.0.0/UML
>>
>> Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
>> wasn't expecting loadModel to treat it as such.
>>
>> What am I doing wrong?
>>
>>
>> Best wishes to you all,
>> Bert.
>>
>>
>>
>> - Old thread --------------------------------------------------
>>
>> Hi Bert,
>>
>> Can you please post your question on the M2M newsgroup?
>> http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00023.html
>>
>> Please, do not forget to prefix the subject of your post with [ATL].
>> Also, please keep the history of the question in your post.
>>
>>
>> Thanks,
>>
>> Frédéric
>>
>> On 1/8/07, Bert Vanhooff <bert.vanhooff@cs.kuleuven.be> wrote:
>> > Hi Frédéric,
>> >
>> > I finally found the time to try you suggestion. Unfortunately I
>> > didn't succeed.
>> >
>> > The code that gets executed is equivalent to:
>> >
>> > atlEmfModelHandler.loadModel("UML", atlEmfModelHandler.getMof(),
>> > URI.createURI("http://www.eclipse.org/uml2/1.0.0/UML"));
>> >
>> > .. and throws a FileNotFoundException:
>> > http://www.eclipse.org/uml2/1.0.0/UML on me
>> >
>> > Of cource "http://www.eclipse.org/uml2/1.0.0/UML" isn't a file, but I
>> > wasn't expecting loadModel to see it as such.
>> >
>> > What am I doing wrong?
>> >
>> >
>> > Best wishes,
>> > Bert.
>> >
>> > --- In atl_discussion@yahoogroups.com, "Bert Vanhooff"
>> > <bert.vanhooff@...> wrote:
>> > >
>> > > Ok, I'll try this one.
>> > >
>> > > Many thanks,
>> > > Bert.
>> > >
>> > > --- In atl_discussion@yahoogroups.com, "Frédéric Jouault"
>> > > <f.jouault@> wrote:
>> > > >
>> > > > Hello Bert,
>> > > >
>> > > > The equivalent of "metamodel by uri" is not
>> getBuiltInMetaModels() but
>> > > > AtlEMFModelHandler.loadModel(String name, ASMModel metamodel,
>> URI uri)
>> > > >
>> > > > You won't find this method in AtlModelHandler because it is
>> > > > EMF-specific (URI is
>> > > > org.eclipse.emf.common.util.URI).
>> > > >
>> > > >
>> > > > Regards,
>> > > >
>> > > > Frédéric Jouault
>> > > >
>> > > > On 9/26/06, Bert Vanhooff <bert.vanhooff@> wrote:
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > Hello,
>> > > > >
>> > > > > I'm writing my own atl launcher (based on ATLCommandLine) that
>> > > will be
>> > > > > used to execute transformations that use the uml2 metamodel.
>> > In the
>> > > > > atl eclipse plugin, this metamodel needs to be loaded with the
>> > > > > "metamodel by uri" option. I assumed that the equivalent to
>> this
>> > > > > option in code is AtlModelHandler.getBuiltInMetaModel(String
>> name).
>> > > > > Now, I'm not shure what the parameter of that method should
>> > contain.
>> > > > > Passing the uml2 uri (http://www.eclipse.org/uml2/1.0.0/UML)
>> as it
>> > > > > appears in the "metamodel by uri" dialog does not work.
>> > > > >
>> > > > > Does anyone have an idea?
>> > > > >
>> > > > > Thanks in advance,
>> > > > > Bert.
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> >
>> >
>
>
>
|
|
|
Goto Forum:
Current Time: Sun Jun 01 15:33:58 EDT 2025
Powered by FUDForum. Page generated in 0.02550 seconds
|