Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Loading programatically a model referring to a profile in a standalone application
Loading programatically a model referring to a profile in a standalone application [message #491902] Fri, 16 October 2009 13:42 Go to next message
Federico Tomassetti is currently offline Federico Tomassetti
Messages: 186
Registered: July 2009
Location: Torino
Senior Member

Hi,
I have an UML 2 Class Diagram referring to a profile.
While opening it in eclipse I can see it correctly: my classes have the stereotypes defined in the profile that I applied. While loading it programmatically I don't get them using the method getAppliedStereotypes().

I have loaded the pathmaps according to the FAQ but I don't know if I have to specify also the uml profile in the resources set. Anyway I tried to do it in this way:

addMapping(URI.createURI("platform:/resource/abc/metamodel/uwe.profile.uml "), URI.createURI("file:/D:/thesis/").appendSegment("uwe") .appendFileExtension(UMLResource.PROFILE_FILE_EXTENSION));

The addMapping method is reported:

private void addMapping(URI src, URI dest){
Map uriMap = resourcesSet.getURIConverter().getURIMap();
uriMap.put(src, dest);
System.out.println("Uri Mapping '"+src+"' -> '"+dest+"'");
}

I used the URI "platform:/resource/abc/metamodel/uwe.profile.uml" because it is the URI i see openening the model in the Eclipse (I can see the platform URI for the model itself, the one for the profile and then the list of URI for the pathmaps).

Can someone explain me what I am missing?

Federico


Re: Loading programatically a model referring to a profile in a standalone application [message #492288 is a reply to message #491902] Mon, 19 October 2009 19:33 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
If the profile is loaded in the same resource set as the model, it should
work.

- James.

"Federico Tomassetti" <f.tomassetti@gmail.com> wrote in message
news:hb9t85$uup$1@build.eclipse.org...
> Hi,
> I have an UML 2 Class Diagram referring to a profile.
> While opening it in eclipse I can see it correctly: my classes have the
> stereotypes defined in the profile that I applied. While loading it
> programmatically I don't get them using the method
> getAppliedStereotypes().
>
> I have loaded the pathmaps according to the FAQ but I don't know if I have
> to specify also the uml profile in the resources set. Anyway I tried to do
> it in this way:
>
> addMapping(URI.createURI("platform:/resource/abc/metamodel/uwe.profile.uml
> "), URI.createURI("file:/D:/thesis/").appendSegment("uwe")
> .appendFileExtension(UMLResource.PROFILE_FILE_EXTENSION));
>
> The addMapping method is reported:
>
> private void addMapping(URI src, URI dest){
> Map uriMap = resourcesSet.getURIConverter().getURIMap();
> uriMap.put(src, dest);
> System.out.println("Uri Mapping '"+src+"' -> '"+dest+"'");
> }
>
> I used the URI "platform:/resource/abc/metamodel/uwe.profile.uml" because
> it is the URI i see openening the model in the Eclipse (I can see the
> platform URI for the model itself, the one for the profile and then the
> list of URI for the pathmaps).
>
> Can someone explain me what I am missing?
>
> Federico
Previous Topic:test an integer property
Next Topic:Loading programatically a model referring to a profile in a standalone application
Goto Forum:
  


Current Time: Sat Oct 25 00:44:51 GMT 2014

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

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