Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Re: first time problem running workflow (mwe 0.7.0)
Re: first time problem running workflow (mwe 0.7.0) [message #54925] Thu, 02 July 2009 20:46 Go to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
I don't know how to do all the things right so I added TMF news group
and believe that somebody will help with the rest.

> What I meant was that my created DSL has ERefeferences to UML Class
> entity etc so that I may load UML classes from a .uml file into my DSL.
>
> As such I needed to put something like
>
> <RegisterEcoreFile value="./model/UML.ecore"/> in my workflow having
> put a copy of UML.ecore in local dir. I thought it better to register(?)
> this by pointing to the plugin containing the ecore directly. However, I
> don't know if this is possible?

Don't do that, some projects does include changes in code generated
from ecore models. AFAIK UML project is one of them so you should use
generated code not the dynamic version IMHO. Unfortunately UML need
different handling in most cases (its own metamodel, its own setup etc.)

What you need is to register the generated UML model by registering the
generated EPackage:

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
</bean>

You also need small change like that in your Xtext workflow:

<fragment
class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
genModels="platform:/plugins/org.eclipse.uml2.uml/model/UML.genmodel "
/>

But actually this will not work (I never liked uri), can somebody
correct that? Is the copying genmodel and using "platform:/resource/"
instead, the only solution? It works, but is pure evil IMO ;)

Regards,
Krzysztof Kowalczyk
Re: first time problem running workflow (mwe 0.7.0) [message #54952 is a reply to message #54925] Thu, 02 July 2009 21:09 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Krzystof,

see below.

Am 02.07.2009 22:46 Uhr, schrieb Krzysztof Kowalczyk:

> You also need small change like that in your Xtext workflow:
>
> <fragment
> class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
> genModels="platform:/plugins/org.eclipse.uml2.uml/model/UML.genmodel "
> />
>
> But actually this will not work (I never liked uri), can somebody
> correct that? Is the copying genmodel and using "platform:/resource/"
> instead, the only solution? It works, but is pure evil IMO ;)

Is it a typo in your post: the uri to installed plugins should be
platform:/plugin/org.eclipse.uml2.uml/...

instead of platform:/plugin_s_.

>
> Regards,
> Krzysztof Kowalczyk

Regards,
Sebastian
Re: first time problem running workflow (mwe 0.7.0) [message #54979 is a reply to message #54925] Thu, 02 July 2009 21:26 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Krzysztof,

my previous post has been submitted to fast. Actually a platform:/plugin
uri will not help you, because the workflow does not know about
registered plugins etc.

I didn't find another solution than you. It seems you really have to be
evil and copy the genmodel. Maybe somebody else knows the trick how to
avoid this?

Regards,
Sebastian

Am 02.07.2009 22:46 Uhr, schrieb Krzysztof Kowalczyk:
> I don't know how to do all the things right so I added TMF news group
> and believe that somebody will help with the rest.
>
> > What I meant was that my created DSL has ERefeferences to UML Class
> > entity etc so that I may load UML classes from a .uml file into my DSL.
> >
> > As such I needed to put something like
> >
> > <RegisterEcoreFile value="./model/UML.ecore"/> in my workflow having
> > put a copy of UML.ecore in local dir. I thought it better to register(?)
> > this by pointing to the plugin containing the ecore directly. However, I
> > don't know if this is possible?
>
> Don't do that, some projects does include changes in code generated
> from ecore models. AFAIK UML project is one of them so you should use
> generated code not the dynamic version IMHO. Unfortunately UML need
> different handling in most cases (its own metamodel, its own setup etc.)
>
> What you need is to register the generated UML model by registering the
> generated EPackage:
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
> <registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
> </bean>
>
> You also need small change like that in your Xtext workflow:
>
> <fragment
> class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
> genModels="platform:/plugins/org.eclipse.uml2.uml/model/UML.genmodel "
> />
>
> But actually this will not work (I never liked uri), can somebody
> correct that? Is the copying genmodel and using "platform:/resource/"
> instead, the only solution? It works, but is pure evil IMO ;)
>
> Regards,
> Krzysztof Kowalczyk
Re: first time problem running workflow (mwe 0.7.0) [message #55033 is a reply to message #54979] Thu, 02 July 2009 22:18 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
Sebastian Zarnekow pisze:
> Hi Krzysztof,
>
> my previous post has been submitted to fast. Actually a platform:/plugin
> uri will not help you, because the workflow does not know about
> registered plugins etc.
I know that unfortunately. In xtext we have:

import "http://www.eclipse.org/uml2/3.0.0/UML"

and in workflow we have:

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
platformUri="${runtimeProject}/.."
>
<registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
</bean>
....
<fragment
class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
genModels="platform:/resource/myproject/UML.genmodel"
/>

and I got a feeling that something is bad here :(

As I understand this is an osgi/ eclipse plugins stuff that workflow
ignores. In active workbench, uri:
"http://www.eclipse.org/uml2/3.0.0/UML" allow to find both the genmodel
and the epackage. Maybe there is a way to dump registered metamodels and
make them visible to the workflow? Or handle the "platform:/plugin" uri
somehow? Model and genmodel should be visible to workflow without
copying as they are already on classpath.

Regards,
Krzysztof Kowalczyk
Re: first time problem running workflow (mwe 0.7.0) [message #55167 is a reply to message #55033] Fri, 03 July 2009 08:55 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Don't copy the genmodel but use a file URI which points to the genmodel
in the jar.
Don't know the exact syntax, but I guess you'll find it by looking into
the code and JavaDocs of EMF's URI class.

It's something like this as I remember:

file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel

Sven

Krzysztof Kowalczyk schrieb:
> Sebastian Zarnekow pisze:
>> Hi Krzysztof,
>>
>> my previous post has been submitted to fast. Actually a
>> platform:/plugin uri will not help you, because the workflow does not
>> know about registered plugins etc.
> I know that unfortunately. In xtext we have:
>
> import "http://www.eclipse.org/uml2/3.0.0/UML"
>
> and in workflow we have:
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
> platformUri="${runtimeProject}/.."
> >
> <registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
> </bean>
> ...
> <fragment
> class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
> genModels="platform:/resource/myproject/UML.genmodel"
> />
>
> and I got a feeling that something is bad here :(
>
> As I understand this is an osgi/ eclipse plugins stuff that workflow
> ignores. In active workbench, uri:
> "http://www.eclipse.org/uml2/3.0.0/UML" allow to find both the genmodel
> and the epackage. Maybe there is a way to dump registered metamodels and
> make them visible to the workflow? Or handle the "platform:/plugin" uri
> somehow? Model and genmodel should be visible to workflow without
> copying as they are already on classpath.
>
> Regards,
> Krzysztof Kowalczyk
Re: first time problem running workflow (mwe 0.7.0) [message #55222 is a reply to message #55167] Fri, 03 July 2009 10:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33184
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010409080708050806070800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Sven,

EMF can even deal with accessing deeply nested jars:

A connection that can access an entry in an archive, and then
recursively an entry in that archive, and so on. For example, it can
be used just like jar: or zip:, only the archive paths can repeat,
e.g.,

archive:file:///c:/temp/example.zip!/org/example/nested.zip! /org/example/deeply-nested.html


The general recursive pattern is

archive:$nestedURL${/!$archivePath$}+


So the nested URL for the example above is

file:///c:/temp/example.zip


Since the nested URL may itself contain archive schemes, the
subsequence of the archive paths that should be associated with the
nested URL is determined by finding the nth archive separator, i.e.,
the nth !/, where n is the number of ":"s before the first "/" of
the nested URL, i.e., the number of nested schemes. For example, for
a more complex case where the nested URL is itself an archive-based
scheme, e.g.,

archive:jar:file:///c:/temp/example.zip!/org/example/nested. zip!/org/example/deeply-nested.html


the nested URL is correctly parsed to skip to the second archive
separator as jar:file:///c:/temp/example.zip!/org/example/nested.zip



Sven Efftinge wrote:
> Don't copy the genmodel but use a file URI which points to the
> genmodel in the jar.
> Don't know the exact syntax, but I guess you'll find it by looking
> into the code and JavaDocs of EMF's URI class.
>
> It's something like this as I remember:
>
> file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel
>
> Sven
>
> Krzysztof Kowalczyk schrieb:
>> Sebastian Zarnekow pisze:
>>> Hi Krzysztof,
>>>
>>> my previous post has been submitted to fast. Actually a
>>> platform:/plugin uri will not help you, because the workflow does
>>> not know about registered plugins etc.
>> I know that unfortunately. In xtext we have:
>>
>> import "http://www.eclipse.org/uml2/3.0.0/UML"
>>
>> and in workflow we have:
>>
>> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
>> platformUri="${runtimeProject}/.."
>> >
>> <registerGeneratedEPackage value="org.eclipse.uml2.uml.UMLPackage"/>
>> </bean>
>> ...
>> <fragment
>> class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
>> genModels="platform:/resource/myproject/UML.genmodel"
>> />
>>
>> and I got a feeling that something is bad here :(
>>
>> As I understand this is an osgi/ eclipse plugins stuff that workflow
>> ignores. In active workbench, uri:
>> "http://www.eclipse.org/uml2/3.0.0/UML" allow to find both the
>> genmodel and the epackage. Maybe there is a way to dump registered
>> metamodels and make them visible to the workflow? Or handle the
>> "platform:/plugin" uri somehow? Model and genmodel should be visible
>> to workflow without copying as they are already on classpath.
>>
>> Regards,
>> Krzysztof Kowalczyk

--------------010409080708050806070800
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sven,<br>
<br>
EMF can even deal with accessing deeply nested jars:<br>
<blockquote>
<p>A connection that can access an entry in an archive, and then
recursively an entry in that archive, and so on. For example, it can be
used just like jar: or zip:, only the archive paths can repeat, e.g., </p>
<pre> archive:<a class="moz-txt-link-freetext" href=" file:///c:/temp/example.zip!/org/example/nested.zip!/org/exa mple/deeply-nested.html"> file:///c:/temp/example.zip!/org/example/nested.zip!/org/exa mple/deeply-nested.html</a>
</pre>
The general recursive pattern is
<pre> archive:$nestedURL${/!$archivePath$}+
</pre>
So the nested URL for the example above is
<pre> <a class="moz-txt-link-freetext" href="file:///c:/temp/example.zip">file:///c:/temp/example.zip</a>
</pre>
<p>Since the nested URL may itself contain archive schemes, the
subsequence of the archive paths that should be associated with the
nested URL is determined by finding the nth archive separator, i.e.,
the nth !/, where n is the number of ":"s before the first "/" of the
nested URL, i.e., the number of nested schemes. For example, for a more
complex case where the nested URL is itself an archive-based scheme,
e.g., </p>
<pre> archive:<a class="moz-txt-link-freetext" href=" jar:file:///c:/temp/example.zip!/org/example/nested.zip!/org /example/deeply-nested.html"> jar:file:///c:/temp/example.zip!/org/example/nested.zip!/org /example/deeply-nested.html</a>
</pre>
the nested URL is correctly parsed to skip to the second archive
separator as <a class="moz-txt-link-freetext" href="jar:file:///c:/temp/example.zip!/org/example/nested.zip">jar:file:///c:/temp/example.zip!/org/example/nested.zip</a><br>
</blockquote>
<br>
<br>
Sven Efftinge wrote:
<blockquote cite="mid:h2kh2n$adb$1@build.eclipse.org" type="cite">Don't
copy the genmodel but use a file URI which points to the genmodel in
the jar.
<br>
Don't know the exact syntax, but I guess you'll find it by looking into
the code and JavaDocs of EMF's URI class.
<br>
<br>
It's something like this as I remember:
<br>
<br>
<a class="moz-txt-link-freetext" href=" file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel "> file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel </a>
<br>
<br>
Sven
<br>
<br>
Krzysztof Kowalczyk schrieb:
<br>
<blockquote type="cite">Sebastian Zarnekow pisze:
<br>
<blockquote type="cite">Hi Krzysztof,
<br>
<br>
my previous post has been submitted to fast. Actually a
platform:/plugin uri will not help you, because the workflow does not
know about registered plugins etc.
<br>
</blockquote>
I know that unfortunately. In xtext we have:
<br>
<br>
import <a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/uml2/3.0.0/UML">"http://www.eclipse.org/uml2/3.0.0/UML"</a>
<br>
<br>
and in workflow we have:
<br>
<br>
&lt;bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
<br>
&nbsp;platformUri="${runtimeProject}/.."
<br>
&nbsp;&gt;
<br>
&nbsp;&lt;registerGeneratedEPackage
value="org.eclipse.uml2.uml.UMLPackage"/&gt;
<br>
&lt;/bean&gt;
<br>
....
<br>
&lt;fragment
<br>
&nbsp;class="org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment "
<br>
&nbsp;genModels="platform:/resource/myproject/UML.genmodel "
<br>
/&gt;
<br>
<br>
and I got a feeling that something is bad here :(
<br>
<br>
As I understand this is an osgi/ eclipse plugins stuff that workflow
ignores. In active workbench, uri:
<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/uml2/3.0.0/UML">"http://www.eclipse.org/uml2/3.0.0/UML"</a> allow to find both the genmodel
and the epackage. Maybe there is a way to dump registered metamodels
and make them visible to the workflow? Or handle the "platform:/plugin"
uri somehow? Model and genmodel should be visible to workflow without
copying as they are already on classpath.
<br>
<br>
Regards,
<br>
Krzysztof Kowalczyk
<br>
</blockquote>
</blockquote>
</body>
</html>

--------------010409080708050806070800--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: first time problem running workflow (mwe 0.7.0) [message #55684 is a reply to message #55167] Fri, 03 July 2009 22:54 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
> file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel

absolute path would make a problem in team environment, is there any
${property} or a way to get the absolute path to a plugin on runtime?

I actually did not have time yet to play with Xtext (the end of
studies), but it look great :)
Re: first time problem running workflow (mwe 0.7.0) [message #55711 is a reply to message #55684] Sat, 04 July 2009 00:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33184
Registered: July 2009
Senior Member
Krzysztof,

Normally platform:/plugin/<bundle-id>/<path-in-bundle> does the trick,
at least in an Equinox runtime.


Krzysztof Kowalczyk wrote:
>
>> file:/my/absolute/path/org.eclipse.uml2.uml.jar!/model/UML.g enmodel
>
> absolute path would make a problem in team environment, is there any
> ${property} or a way to get the absolute path to a plugin on runtime?
>
> I actually did not have time yet to play with Xtext (the end of
> studies), but it look great :)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: first time problem running workflow (mwe 0.7.0) [message #55737 is a reply to message #55711] Sat, 04 July 2009 01:03 Go to previous message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
Ed Merks pisze:
> Normally platform:/plugin/<bundle-id>/<path-in-bundle> does the trick,
> at least in an Equinox runtime.

Yes, in previous post I've used it as
"platform:/plugin/org.eclipse.uml2.uml/model/UML.genmodel", but AFAIK
MWE does not use Equinox/OSGi runtime and "plugin" URIs are not recognized.

Regards,
Krzysztof Kowalczyk
Previous Topic:Deployment of generator plugins
Next Topic:[xText] syntax highlighting
Goto Forum:
  


Current Time: Thu Jul 18 19:20:29 GMT 2024

Powered by FUDForum. Page generated in 0.04887 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top