Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Loading a uml model with a profile (in an ATL transformation)
Loading a uml model with a profile (in an ATL transformation) [message #477510] Thu, 12 June 2008 12:20 Go to next message
Eclipse UserFriend
Originally posted by: karp.no-mail.com

Hi,

My question is about an ATL transformation but since it seems mostly
EMF/UML2 I ask it here.

I've got a simple transformation that take ModelA.uml in input and
ModelB.uml in output
ModelA.uml uses sterotypes from a profile 'Test.profile.uml'

Here is what I do in my program to register the resources. (ATL use the
EMF ResourceSet)

------------------------8<------------------------
ResourceSet resourceSet = ASMEMFModel.getResourceSet();
resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
UMLPackage.eINSTANCE);
// Profile registration
resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
UMLPackage.eINSTANCE);
URI uri =
URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
------------------------8<-------------------------

I've got a Java project from which I launch programatically the
transformation.
And I've got an ATL project where are located my models, profile, and my
transformation.

Now the problem is that when I launch (programmatically) my
transformation, I obtain this error :
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
23, 93)
EMF is looking for the profile in my Java project (LaunchAtlUml is my
Java project). If I put it there, it works fine.
But I would like to keep my profile in my Transformation project.
I suppose I can do that with the URIConverter or something like that.
Any idea ?
Re: Loading a uml model with a profile (in an ATL transformation) [message #477517 is a reply to message #477510] Fri, 13 June 2008 20:18 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi karp,

You may want to look at the following extension point:
org.eclipse.emf.ecore.uri_mapping


It can be used in the following way:



<extension

point="org.eclipse.emf.ecore.uri_mapping">

<mapping

source="pathmap://UML_LIBRARIES/"

target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">

</mapping>

</extension>



Cheers,

- James.

"karp" <karp@no-mail.com> wrote in message
news:g2r4b5$vnj$2@build.eclipse.org...
> Hi,
>
> My question is about an ATL transformation but since it seems mostly
> EMF/UML2 I ask it here.
>
> I've got a simple transformation that take ModelA.uml in input and
> ModelB.uml in output
> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>
> Here is what I do in my program to register the resources. (ATL use the
> EMF ResourceSet)
>
> ------------------------8<------------------------
> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
> UMLPackage.eINSTANCE);
> // Profile registration
> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
> UMLPackage.eINSTANCE);
> URI uri =
> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
> uri.appendSegment("metamodels").appendSegment(""));
> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
> uri.appendSegment("profiles").appendSegment(""));
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
> ------------------------8<-------------------------
>
> I've got a Java project from which I launch programatically the
> transformation.
> And I've got an ATL project where are located my models, profile, and my
> transformation.
>
> Now the problem is that when I launch (programmatically) my
> transformation, I obtain this error :
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
> 23, 93)
> EMF is looking for the profile in my Java project (LaunchAtlUml is my Java
> project). If I put it there, it works fine.
> But I would like to keep my profile in my Transformation project.
> I suppose I can do that with the URIConverter or something like that.
> Any idea ?
Re: Loading a uml model with a profile (in an ATL transformation) [message #477550 is a reply to message #477517] Tue, 24 June 2008 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: karp.no-mail.com

Thank for your answer,

The problem is I'm in a standalone app outside Eclipse.
And isn't your code sample a bit like what I did in the line below? (I
don't know, I know almost nothing about Eclipse plug-in and extension
point development).
uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));

James Bruck has written :
> Hi karp,
>
> You may want to look at the following extension point:
> org.eclipse.emf.ecore.uri_mapping
>
>
> It can be used in the following way:
>
>
>
> <extension
>
> point="org.eclipse.emf.ecore.uri_mapping">
>
> <mapping
>
> source="pathmap://UML_LIBRARIES/"
>
> target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
>
> </mapping>
>
> </extension>
>
>
>
> Cheers,
>
> - James.
>
> "karp" <karp@no-mail.com> wrote in message
> news:g2r4b5$vnj$2@build.eclipse.org...
>> Hi,
>>
>> My question is about an ATL transformation but since it seems mostly
>> EMF/UML2 I ask it here.
>>
>> I've got a simple transformation that take ModelA.uml in input and
>> ModelB.uml in output
>> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>>
>> Here is what I do in my program to register the resources. (ATL use the
>> EMF ResourceSet)
>>
>> ------------------------8<------------------------
>> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
>> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
>> UMLPackage.eINSTANCE);
>> // Profile registration
>> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
>> UMLPackage.eINSTANCE);
>> URI uri =
>> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
>> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
>> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
>> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
>> uri.appendSegment("libraries").appendSegment(""));
>> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
>> uri.appendSegment("metamodels").appendSegment(""));
>> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
>> uri.appendSegment("profiles").appendSegment(""));
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
>> UMLResource.Factory.INSTANCE);
>> ------------------------8<-------------------------
>>
>> I've got a Java project from which I launch programatically the
>> transformation.
>> And I've got an ATL project where are located my models, profile, and my
>> transformation.
>>
>> Now the problem is that when I launch (programmatically) my
>> transformation, I obtain this error :
>> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
>> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
>> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
>> 23, 93)
>> EMF is looking for the profile in my Java project (LaunchAtlUml is my Java
>> project). If I put it there, it works fine.
>> But I would like to keep my profile in my Transformation project.
>> I suppose I can do that with the URIConverter or something like that.
>> Any idea ?
>
>
Re: Loading a uml model with a profile (in an ATL transformation) [message #477557 is a reply to message #477550] Thu, 26 June 2008 17:56 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Have a look at
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
toward the bottom at the section entitled "programmatic migration".

That shows how to work with a stand-alone app.
Let us know if you still have issues.

Cheers,
- James.

"karp" <karp@no-mail.com> wrote in message
news:g3qar0$qe2$1@build.eclipse.org...
> Thank for your answer,
>
> The problem is I'm in a standalone app outside Eclipse.
> And isn't your code sample a bit like what I did in the line below? (I
> don't know, I know almost nothing about Eclipse plug-in and extension
> point development).
> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
>
> James Bruck has written :
>> Hi karp,
>>
>> You may want to look at the following extension point:
>> org.eclipse.emf.ecore.uri_mapping
>>
>>
>> It can be used in the following way:
>>
>>
>>
>> <extension
>>
>> point="org.eclipse.emf.ecore.uri_mapping">
>>
>> <mapping
>>
>> source="pathmap://UML_LIBRARIES/"
>>
>> target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
>>
>> </mapping>
>>
>> </extension>
>>
>>
>>
>> Cheers,
>>
>> - James.
>>
>> "karp" <karp@no-mail.com> wrote in message
>> news:g2r4b5$vnj$2@build.eclipse.org...
>>> Hi,
>>>
>>> My question is about an ATL transformation but since it seems mostly
>>> EMF/UML2 I ask it here.
>>>
>>> I've got a simple transformation that take ModelA.uml in input and
>>> ModelB.uml in output
>>> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>>>
>>> Here is what I do in my program to register the resources. (ATL use the
>>> EMF ResourceSet)
>>>
>>> ------------------------8<------------------------
>>> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
>>> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
>>> UMLPackage.eINSTANCE);
>>> // Profile registration
>>> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
>>> UMLPackage.eINSTANCE);
>>> URI uri =
>>> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
>>> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
>>> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
>>> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
>>> uri.appendSegment("libraries").appendSegment(""));
>>> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
>>> uri.appendSegment("metamodels").appendSegment(""));
>>> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
>>> uri.appendSegment("profiles").appendSegment(""));
>>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
>>> UMLResource.Factory.INSTANCE);
>>> ------------------------8<-------------------------
>>>
>>> I've got a Java project from which I launch programatically the
>>> transformation.
>>> And I've got an ATL project where are located my models, profile, and my
>>> transformation.
>>>
>>> Now the problem is that when I launch (programmatically) my
>>> transformation, I obtain this error :
>>> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
>>> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
>>> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
>>> 23, 93)
>>> EMF is looking for the profile in my Java project (LaunchAtlUml is my
>>> Java project). If I put it there, it works fine.
>>> But I would like to keep my profile in my Transformation project.
>>> I suppose I can do that with the URIConverter or something like that.
>>> Any idea ?
>>
Re: Loading a uml model with a profile (in an ATL transformation) [message #626707 is a reply to message #477510] Fri, 13 June 2008 20:18 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi karp,

You may want to look at the following extension point:
org.eclipse.emf.ecore.uri_mapping


It can be used in the following way:



<extension

point="org.eclipse.emf.ecore.uri_mapping">

<mapping

source="pathmap://UML_LIBRARIES/"

target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">

</mapping>

</extension>



Cheers,

- James.

"karp" <karp@no-mail.com> wrote in message
news:g2r4b5$vnj$2@build.eclipse.org...
> Hi,
>
> My question is about an ATL transformation but since it seems mostly
> EMF/UML2 I ask it here.
>
> I've got a simple transformation that take ModelA.uml in input and
> ModelB.uml in output
> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>
> Here is what I do in my program to register the resources. (ATL use the
> EMF ResourceSet)
>
> ------------------------8<------------------------
> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
> UMLPackage.eINSTANCE);
> // Profile registration
> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
> UMLPackage.eINSTANCE);
> URI uri =
> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
> uri.appendSegment("metamodels").appendSegment(""));
> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
> uri.appendSegment("profiles").appendSegment(""));
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
> ------------------------8<-------------------------
>
> I've got a Java project from which I launch programatically the
> transformation.
> And I've got an ATL project where are located my models, profile, and my
> transformation.
>
> Now the problem is that when I launch (programmatically) my
> transformation, I obtain this error :
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
> 23, 93)
> EMF is looking for the profile in my Java project (LaunchAtlUml is my Java
> project). If I put it there, it works fine.
> But I would like to keep my profile in my Transformation project.
> I suppose I can do that with the URIConverter or something like that.
> Any idea ?
Re: Loading a uml model with a profile (in an ATL transformation) [message #626740 is a reply to message #477517] Tue, 24 June 2008 08:21 Go to previous message
Eclipse UserFriend
Originally posted by: karp.no-mail.com

Thank for your answer,

The problem is I'm in a standalone app outside Eclipse.
And isn't your code sample a bit like what I did in the line below? (I
don't know, I know almost nothing about Eclipse plug-in and extension
point development).
uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));

James Bruck has written :
> Hi karp,
>
> You may want to look at the following extension point:
> org.eclipse.emf.ecore.uri_mapping
>
>
> It can be used in the following way:
>
>
>
> <extension
>
> point="org.eclipse.emf.ecore.uri_mapping">
>
> <mapping
>
> source="pathmap://UML_LIBRARIES/"
>
> target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
>
> </mapping>
>
> </extension>
>
>
>
> Cheers,
>
> - James.
>
> "karp" <karp@no-mail.com> wrote in message
> news:g2r4b5$vnj$2@build.eclipse.org...
>> Hi,
>>
>> My question is about an ATL transformation but since it seems mostly
>> EMF/UML2 I ask it here.
>>
>> I've got a simple transformation that take ModelA.uml in input and
>> ModelB.uml in output
>> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>>
>> Here is what I do in my program to register the resources. (ATL use the
>> EMF ResourceSet)
>>
>> ------------------------8<------------------------
>> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
>> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
>> UMLPackage.eINSTANCE);
>> // Profile registration
>> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
>> UMLPackage.eINSTANCE);
>> URI uri =
>> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
>> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
>> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
>> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
>> uri.appendSegment("libraries").appendSegment(""));
>> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
>> uri.appendSegment("metamodels").appendSegment(""));
>> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
>> uri.appendSegment("profiles").appendSegment(""));
>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
>> UMLResource.Factory.INSTANCE);
>> ------------------------8<-------------------------
>>
>> I've got a Java project from which I launch programatically the
>> transformation.
>> And I've got an ATL project where are located my models, profile, and my
>> transformation.
>>
>> Now the problem is that when I launch (programmatically) my
>> transformation, I obtain this error :
>> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
>> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
>> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
>> 23, 93)
>> EMF is looking for the profile in my Java project (LaunchAtlUml is my Java
>> project). If I put it there, it works fine.
>> But I would like to keep my profile in my Transformation project.
>> I suppose I can do that with the URIConverter or something like that.
>> Any idea ?
>
>
Re: Loading a uml model with a profile (in an ATL transformation) [message #626748 is a reply to message #477550] Thu, 26 June 2008 17:56 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Have a look at
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
toward the bottom at the section entitled "programmatic migration".

That shows how to work with a stand-alone app.
Let us know if you still have issues.

Cheers,
- James.

"karp" <karp@no-mail.com> wrote in message
news:g3qar0$qe2$1@build.eclipse.org...
> Thank for your answer,
>
> The problem is I'm in a standalone app outside Eclipse.
> And isn't your code sample a bit like what I did in the line below? (I
> don't know, I know almost nothing about Eclipse plug-in and extension
> point development).
> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
>
> James Bruck has written :
>> Hi karp,
>>
>> You may want to look at the following extension point:
>> org.eclipse.emf.ecore.uri_mapping
>>
>>
>> It can be used in the following way:
>>
>>
>>
>> <extension
>>
>> point="org.eclipse.emf.ecore.uri_mapping">
>>
>> <mapping
>>
>> source="pathmap://UML_LIBRARIES/"
>>
>> target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
>>
>> </mapping>
>>
>> </extension>
>>
>>
>>
>> Cheers,
>>
>> - James.
>>
>> "karp" <karp@no-mail.com> wrote in message
>> news:g2r4b5$vnj$2@build.eclipse.org...
>>> Hi,
>>>
>>> My question is about an ATL transformation but since it seems mostly
>>> EMF/UML2 I ask it here.
>>>
>>> I've got a simple transformation that take ModelA.uml in input and
>>> ModelB.uml in output
>>> ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
>>>
>>> Here is what I do in my program to register the resources. (ATL use the
>>> EMF ResourceSet)
>>>
>>> ------------------------8<------------------------
>>> ResourceSet resourceSet = ASMEMFModel.getResourceSet();
>>> resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
>>> UMLPackage.eINSTANCE);
>>> // Profile registration
>>> resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
>>> UMLPackage.eINSTANCE);
>>> URI uri =
>>> URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
>>> Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
>>> uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
>>> uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
>>> uri.appendSegment("libraries").appendSegment(""));
>>> uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
>>> uri.appendSegment("metamodels").appendSegment(""));
>>> uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
>>> uri.appendSegment("profiles").appendSegment(""));
>>> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
>>> UMLResource.Factory.INSTANCE);
>>> ------------------------8<-------------------------
>>>
>>> I've got a Java project from which I launch programatically the
>>> transformation.
>>> And I've got an ATL project where are located my models, profile, and my
>>> transformation.
>>>
>>> Now the problem is that when I launch (programmatically) my
>>> transformation, I obtain this error :
>>> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
>>> uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
>>> ( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
>>> 23, 93)
>>> EMF is looking for the profile in my Java project (LaunchAtlUml is my
>>> Java project). If I put it there, it works fine.
>>> But I would like to keep my profile in my Transformation project.
>>> I suppose I can do that with the URIConverter or something like that.
>>> Any idea ?
>>
Previous Topic:Use a UML model with a profile
Next Topic:How to access referenced models
Goto Forum:
  


Current Time: Fri Mar 29 05:46:21 GMT 2024

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

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

Back to the top