Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UMLPrimitiveTyes
UMLPrimitiveTyes [message #473136] Sat, 09 June 2007 21:41 Go to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hi,

I'm trying to read a UML file and transform the UMLPrimitiveTypes into
other types defined by another profile. I can not figure out how to
compare an element to a UMLPrimitiveType (for example
UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get at.

I tried using the UMLProfile tutorial. I get the error
"java.net.MalformedURLException: unknown protocol: pathmap" when I try
to retrieve this.

Here is the code:

Model umlLibrary = (Model)
fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI));

Package load(URI uri)
{
Package package_ = null;
package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
UMLPackage.Literals.PACKAGE);
return package_;
}

Thanks,
Andrew.
Re: UMLPrimitiveTyes [message #473169 is a reply to message #473136] Mon, 11 June 2007 15:29 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Andrew,

It sounds like you are not registering your pathmaps with the URIConverter
correctly.
There is an example in the Migration Guide ( toward the bottom ), link from
UML wiki.
Have a look there and if you still have issues, please ask again.

- James.

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4f6p5$vnj$1@build.eclipse.org...
> Hi,
>
> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
> other types defined by another profile. I can not figure out how to
> compare an element to a UMLPrimitiveType (for example
> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get at.
>
> I tried using the UMLProfile tutorial. I get the error
> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
> to retrieve this.
>
> Here is the code:
>
> Model umlLibrary = (Model)
>
fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
;
>
> Package load(URI uri)
> {
> Package package_ = null;
> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
> return package_;
> }
>
> Thanks,
> Andrew.
Re: UMLPrimitiveTyes [message #473174 is a reply to message #473169] Mon, 11 June 2007 21:44 Go to previous messageGo to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Thanks James, that worked. I specified the URI explicitly with the
jar:file/path_to_uml_resources!/ etc but is there not another way of
doing this. I don't really like to hardcode a library path into my code..

Thanks very much again,

Andrew.


James Bruck wrote:
> Hi Andrew,
>
> It sounds like you are not registering your pathmaps with the URIConverter
> correctly.
> There is an example in the Migration Guide ( toward the bottom ), link from
> UML wiki.
> Have a look there and if you still have issues, please ask again.
>
> - James.
>
> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
> news:f4f6p5$vnj$1@build.eclipse.org...
>> Hi,
>>
>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>> other types defined by another profile. I can not figure out how to
>> compare an element to a UMLPrimitiveType (for example
>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get at.
>>
>> I tried using the UMLProfile tutorial. I get the error
>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>> to retrieve this.
>>
>> Here is the code:
>>
>> Model umlLibrary = (Model)
>>
> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
> ;
>> Package load(URI uri)
>> {
>> Package package_ = null;
>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>> UMLPackage.Literals.PACKAGE);
>> return package_;
>> }
>>
>> Thanks,
>> Andrew.
>
>
Re: UMLPrimitiveTyes [message #473176 is a reply to message #473174] Tue, 12 June 2007 00:29 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

When running in Eclipse, this is done automatically via an extension point.
If your application needs to run stand-alone, you can always pass the path
of the resources plug-in in as an argument...

Kenn

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4kfnn$sda$1@build.eclipse.org...
> Thanks James, that worked. I specified the URI explicitly with the
> jar:file/path_to_uml_resources!/ etc but is there not another way of doing
> this. I don't really like to hardcode a library path into my code..
>
> Thanks very much again,
>
> Andrew.
>
>
> James Bruck wrote:
>> Hi Andrew,
>>
>> It sounds like you are not registering your pathmaps with the
>> URIConverter
>> correctly.
>> There is an example in the Migration Guide ( toward the bottom ), link
>> from
>> UML wiki.
>> Have a look there and if you still have issues, please ask again.
>>
>> - James.
>>
>> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
>> news:f4f6p5$vnj$1@build.eclipse.org...
>>> Hi,
>>>
>>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>>> other types defined by another profile. I can not figure out how to
>>> compare an element to a UMLPrimitiveType (for example
>>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get
>>> at.
>>>
>>> I tried using the UMLProfile tutorial. I get the error
>>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>>> to retrieve this.
>>>
>>> Here is the code:
>>>
>>> Model umlLibrary = (Model)
>>>
>> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
>> ;
>>> Package load(URI uri)
>>> {
>>> Package package_ = null;
>>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>>> UMLPackage.Literals.PACKAGE);
>>> return package_;
>>> }
>>>
>>> Thanks,
>>> Andrew.
>>
Re: UMLPrimitiveTyes [message #473182 is a reply to message #473176] Tue, 12 June 2007 09:26 Go to previous messageGo to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hi Kenn,

Thanks for the response.

I'm currently using eclipse. Below is the piece of code I am using taken
from the UML2 Migration guide that is used to register the explicit
path. How would I register these with the URIConverter using the
extension points?

Thanks,
Andrew.

URI umlResourcePluginURI = URI

..createURI(" jar:file:/Users/cartona/eclipse/plugins/org.eclipse.uml2.uml .resources_2.1.0.v200705171545.jar!/ ");
URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
umlResourcePluginURI.appendSegment("libraries").appendSegment(
""));
URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
umlResourcePluginURI.appendSegment("metamodels").appendSegment(
""));
URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
umlResourcePluginURI.appendSegment("profiles")
.appendSegment(""));



Ar 12/06/2007 01:29, Scríobh Kenn Hussey:
> Andrew,
>
> When running in Eclipse, this is done automatically via an extension point.
> If your application needs to run stand-alone, you can always pass the path
> of the resources plug-in in as an argument...
>
> Kenn
>
> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
> news:f4kfnn$sda$1@build.eclipse.org...
>> Thanks James, that worked. I specified the URI explicitly with the
>> jar:file/path_to_uml_resources!/ etc but is there not another way of doing
>> this. I don't really like to hardcode a library path into my code..
>>
>> Thanks very much again,
>>
>> Andrew.
>>
>>
>> James Bruck wrote:
>>> Hi Andrew,
>>>
>>> It sounds like you are not registering your pathmaps with the
>>> URIConverter
>>> correctly.
>>> There is an example in the Migration Guide ( toward the bottom ), link
>>> from
>>> UML wiki.
>>> Have a look there and if you still have issues, please ask again.
>>>
>>> - James.
>>>
>>> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
>>> news:f4f6p5$vnj$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>>>> other types defined by another profile. I can not figure out how to
>>>> compare an element to a UMLPrimitiveType (for example
>>>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get
>>>> at.
>>>>
>>>> I tried using the UMLProfile tutorial. I get the error
>>>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>>>> to retrieve this.
>>>>
>>>> Here is the code:
>>>>
>>>> Model umlLibrary = (Model)
>>>>
>>> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
>>> ;
>>>> Package load(URI uri)
>>>> {
>>>> Package package_ = null;
>>>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>>>> UMLPackage.Literals.PACKAGE);
>>>> return package_;
>>>> }
>>>>
>>>> Thanks,
>>>> Andrew.
>
Re: UMLPrimitiveTyes [message #473184 is a reply to message #473182] Tue, 12 June 2007 13:25 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

This is already done for you by the resources plug-in - see
org.eclipse.uml2.uml.resources/plugin.xml:

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_LIBRARIES/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
</mapping>
</extension>

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_METAMODELS/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/metamodels/ ">
</mapping>
</extension>

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_PROFILES/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/profiles/ ">
</mapping>
</extension>

Kenn

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4losb$h5n$1@build.eclipse.org...
> Hi Kenn,
>
> Thanks for the response.
>
> I'm currently using eclipse. Below is the piece of code I am using taken
> from the UML2 Migration guide that is used to register the explicit path.
> How would I register these with the URIConverter using the extension
> points?
>
> Thanks,
> Andrew.
>
> URI umlResourcePluginURI = URI
>
> .createURI(" jar:file:/Users/cartona/eclipse/plugins/org.eclipse.uml2.uml .resources_2.1.0.v200705171545.jar!/ ");
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
> umlResourcePluginURI.appendSegment("libraries").appendSegment(
> ""));
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
> umlResourcePluginURI.appendSegment("metamodels").appendSegment(
> ""));
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
> umlResourcePluginURI.appendSegment("profiles")
> .appendSegment(""));
>
>
>
> Ar 12/06/2007 01:29, Scr
Re: UMLPrimitiveTyes [message #619974 is a reply to message #473136] Mon, 11 June 2007 15:29 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Andrew,

It sounds like you are not registering your pathmaps with the URIConverter
correctly.
There is an example in the Migration Guide ( toward the bottom ), link from
UML wiki.
Have a look there and if you still have issues, please ask again.

- James.

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4f6p5$vnj$1@build.eclipse.org...
> Hi,
>
> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
> other types defined by another profile. I can not figure out how to
> compare an element to a UMLPrimitiveType (for example
> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get at.
>
> I tried using the UMLProfile tutorial. I get the error
> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
> to retrieve this.
>
> Here is the code:
>
> Model umlLibrary = (Model)
>
fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
;
>
> Package load(URI uri)
> {
> Package package_ = null;
> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
> UMLPackage.Literals.PACKAGE);
> return package_;
> }
>
> Thanks,
> Andrew.
Re: UMLPrimitiveTyes [message #619988 is a reply to message #473169] Mon, 11 June 2007 21:44 Go to previous message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Thanks James, that worked. I specified the URI explicitly with the
jar:file/path_to_uml_resources!/ etc but is there not another way of
doing this. I don't really like to hardcode a library path into my code..

Thanks very much again,

Andrew.


James Bruck wrote:
> Hi Andrew,
>
> It sounds like you are not registering your pathmaps with the URIConverter
> correctly.
> There is an example in the Migration Guide ( toward the bottom ), link from
> UML wiki.
> Have a look there and if you still have issues, please ask again.
>
> - James.
>
> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
> news:f4f6p5$vnj$1@build.eclipse.org...
>> Hi,
>>
>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>> other types defined by another profile. I can not figure out how to
>> compare an element to a UMLPrimitiveType (for example
>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get at.
>>
>> I tried using the UMLProfile tutorial. I get the error
>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>> to retrieve this.
>>
>> Here is the code:
>>
>> Model umlLibrary = (Model)
>>
> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
> ;
>> Package load(URI uri)
>> {
>> Package package_ = null;
>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>> UMLPackage.Literals.PACKAGE);
>> return package_;
>> }
>>
>> Thanks,
>> Andrew.
>
>
Re: UMLPrimitiveTyes [message #619994 is a reply to message #473174] Tue, 12 June 2007 00:29 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

When running in Eclipse, this is done automatically via an extension point.
If your application needs to run stand-alone, you can always pass the path
of the resources plug-in in as an argument...

Kenn

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4kfnn$sda$1@build.eclipse.org...
> Thanks James, that worked. I specified the URI explicitly with the
> jar:file/path_to_uml_resources!/ etc but is there not another way of doing
> this. I don't really like to hardcode a library path into my code..
>
> Thanks very much again,
>
> Andrew.
>
>
> James Bruck wrote:
>> Hi Andrew,
>>
>> It sounds like you are not registering your pathmaps with the
>> URIConverter
>> correctly.
>> There is an example in the Migration Guide ( toward the bottom ), link
>> from
>> UML wiki.
>> Have a look there and if you still have issues, please ask again.
>>
>> - James.
>>
>> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
>> news:f4f6p5$vnj$1@build.eclipse.org...
>>> Hi,
>>>
>>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>>> other types defined by another profile. I can not figure out how to
>>> compare an element to a UMLPrimitiveType (for example
>>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get
>>> at.
>>>
>>> I tried using the UMLProfile tutorial. I get the error
>>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>>> to retrieve this.
>>>
>>> Here is the code:
>>>
>>> Model umlLibrary = (Model)
>>>
>> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
>> ;
>>> Package load(URI uri)
>>> {
>>> Package package_ = null;
>>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>>> UMLPackage.Literals.PACKAGE);
>>> return package_;
>>> }
>>>
>>> Thanks,
>>> Andrew.
>>
Re: UMLPrimitiveTyes [message #621536 is a reply to message #473176] Tue, 12 June 2007 09:26 Go to previous message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hi Kenn,

Thanks for the response.

I'm currently using eclipse. Below is the piece of code I am using taken
from the UML2 Migration guide that is used to register the explicit
path. How would I register these with the URIConverter using the
extension points?

Thanks,
Andrew.

URI umlResourcePluginURI = URI

..createURI(" jar:file:/Users/cartona/eclipse/plugins/org.eclipse.uml2.uml .resources_2.1.0.v200705171545.jar!/ ");
URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
umlResourcePluginURI.appendSegment("libraries").appendSegment(
""));
URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
umlResourcePluginURI.appendSegment("metamodels").appendSegment(
""));
URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
umlResourcePluginURI.appendSegment("profiles")
.appendSegment(""));



Ar 12/06/2007 01:29, Scríobh Kenn Hussey:
> Andrew,
>
> When running in Eclipse, this is done automatically via an extension point.
> If your application needs to run stand-alone, you can always pass the path
> of the resources plug-in in as an argument...
>
> Kenn
>
> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
> news:f4kfnn$sda$1@build.eclipse.org...
>> Thanks James, that worked. I specified the URI explicitly with the
>> jar:file/path_to_uml_resources!/ etc but is there not another way of doing
>> this. I don't really like to hardcode a library path into my code..
>>
>> Thanks very much again,
>>
>> Andrew.
>>
>>
>> James Bruck wrote:
>>> Hi Andrew,
>>>
>>> It sounds like you are not registering your pathmaps with the
>>> URIConverter
>>> correctly.
>>> There is an example in the Migration Guide ( toward the bottom ), link
>>> from
>>> UML wiki.
>>> Have a look there and if you still have issues, please ask again.
>>>
>>> - James.
>>>
>>> "Andrew Carton" <cartona@cs.tcd.ie> wrote in message
>>> news:f4f6p5$vnj$1@build.eclipse.org...
>>>> Hi,
>>>>
>>>> I'm trying to read a UML file and transform the UMLPrimitiveTypes into
>>>> other types defined by another profile. I can not figure out how to
>>>> compare an element to a UMLPrimitiveType (for example
>>>> UMLPrimitiveType::Boolean). There only seems to be a eProxyURI to get
>>>> at.
>>>>
>>>> I tried using the UMLProfile tutorial. I get the error
>>>> "java.net.MalformedURLException: unknown protocol: pathmap" when I try
>>>> to retrieve this.
>>>>
>>>> Here is the code:
>>>>
>>>> Model umlLibrary = (Model)
>>>>
>>> fileManager.load(URI.createURI(UMLResource.UML_PRIMITIVE_TYP ES_LIBRARY_URI))
>>> ;
>>>> Package load(URI uri)
>>>> {
>>>> Package package_ = null;
>>>> package_ = (Package) EcoreUtil.getObjectByType(resource.getContents(),
>>>> UMLPackage.Literals.PACKAGE);
>>>> return package_;
>>>> }
>>>>
>>>> Thanks,
>>>> Andrew.
>
Re: UMLPrimitiveTyes [message #621542 is a reply to message #473182] Tue, 12 June 2007 13:25 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

This is already done for you by the resources plug-in - see
org.eclipse.uml2.uml.resources/plugin.xml:

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_LIBRARIES/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/libraries/ ">
</mapping>
</extension>

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_METAMODELS/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/metamodels/ ">
</mapping>
</extension>

<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://UML_PROFILES/"
target="platform:/plugin/org.eclipse.uml2.uml.resources/profiles/ ">
</mapping>
</extension>

Kenn

"Andrew Carton" <cartona@cs.tcd.ie> wrote in message
news:f4losb$h5n$1@build.eclipse.org...
> Hi Kenn,
>
> Thanks for the response.
>
> I'm currently using eclipse. Below is the piece of code I am using taken
> from the UML2 Migration guide that is used to register the explicit path.
> How would I register these with the URIConverter using the extension
> points?
>
> Thanks,
> Andrew.
>
> URI umlResourcePluginURI = URI
>
> .createURI(" jar:file:/Users/cartona/eclipse/plugins/org.eclipse.uml2.uml .resources_2.1.0.v200705171545.jar!/ ");
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
> umlResourcePluginURI.appendSegment("libraries").appendSegment(
> ""));
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
> umlResourcePluginURI.appendSegment("metamodels").appendSegment(
> ""));
> URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
> umlResourcePluginURI.appendSegment("profiles")
> .appendSegment(""));
>
>
>
> Ar 12/06/2007 01:29, Scr
Previous Topic:How can I get XMI ID of model elements?
Next Topic:How to specify those operations to be run in a transition?
Goto Forum:
  


Current Time: Thu Mar 28 08:57:29 GMT 2024

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

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

Back to the top