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 #627989] Fri, 16 October 2009 09: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 #627999 is a reply to message #627989] Mon, 19 October 2009 15: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:Loading programatically a model referring to a profile in a standalone application
Next Topic:Re: Ecore UML Profile, adding Ecore annotation
Goto Forum:
  


Current Time: Thu Apr 17 11:41:01 EDT 2014

Powered by FUDForum. Page generated in 0.02723 seconds