Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » statically initialized resource set in "Introduction to UML2 Profiles"(Where is the initialization of RESOURCE_SET?)
statically initialized resource set in "Introduction to UML2 Profiles" [message #493134] Fri, 23 October 2009 06:46 Go to next message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Hi,

I'm wondering how the RESOURCE_SET is statically initialized in this article:
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Intro duction_to_UML2_Profiles/article.html

Can this be found somewhere? Particularly, I'd like to know how the UML2 metamodel is added to the resource set, so that

resource.getContents()

is nonempty when resource is initialized that way:

URI uri = URI.createURI(UMLResource.UML_METAMODEL_URI);
Resource resource = RESOURCE_SET.getResource(uri, true);

Thanks in advance,
Thomas

[Updated on: Fri, 23 October 2009 06:46]

Report message to a moderator

Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #493361 is a reply to message #493134] Sun, 25 October 2009 04:15 Go to previous messageGo to next message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Noone knows? Then this is a bug in the article. I'm searching for some sources now, I found no hint in the documentation. It really makes my work stalling.

Please help!
Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #494198 is a reply to message #493361] Thu, 29 October 2009 10:48 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Pathmaps are used to locate the metamodel (see registerPathmaps). The
metamodel will get automatically loaded when references to it are resolved.

protected static void registerPathmaps(URI uri) {
URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
uri.appendSegment("libraries").appendSegment(""));

URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));

URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
}

- James.


"Thomas Neustupny" <thn-d@gmx.de> wrote in message
news:hc11fs$ho5$1@build.eclipse.org...
> Noone knows? Then this is a bug in the article. I'm searching for some
> sources now, I found no hint in the documentation. It really makes my work
> stalling.
>
> Please help!
Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #494588 is a reply to message #494198] Sat, 31 October 2009 14:12 Go to previous messageGo to next message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Thank you very much, James! Your answer helped me to understand what's needed to get the metamodel.

I had to fix two things: I accidently didn't use the resource set where I already added the correct factories and URI mappings, and I didn't added org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar to the run configuration.

Now it works fine. Smile
Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #628007 is a reply to message #493134] Sun, 25 October 2009 04:15 Go to previous messageGo to next message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Noone knows? Then this is a bug in the article. I'm searching for some sources now, I found no hint in the documentation. It really makes my work stalling.

Please help!
Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #628013 is a reply to message #628007] Thu, 29 October 2009 10:50 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Pathmaps are used to locate the metamodel (see registerPathmaps). The
metamodel will get automatically loaded when references to it are resolved.

protected static void registerPathmaps(URI uri) {
URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES _PATHMAP),
uri.appendSegment("libraries").appendSegment(""));

URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODEL S_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));

URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_ PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
}

- James.


"Thomas Neustupny" <thn-d@gmx.de> wrote in message
news:hc11fs$ho5$1@build.eclipse.org...
> Noone knows? Then this is a bug in the article. I'm searching for some
> sources now, I found no hint in the documentation. It really makes my work
> stalling.
>
> Please help!
Re: statically initialized resource set in "Introduction to UML2 Profiles" [message #628024 is a reply to message #628013] Sat, 31 October 2009 14:12 Go to previous message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Thank you very much, James! Your answer helped me to understand what's needed to get the metamodel.

I had to fix two things: I accidently didn't use the resource set where I already added the correct factories and URI mappings, and I didn't added org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar to the run configuration.

Now it works fine. :)
Previous Topic:(eObject instanceof Element) in destroy() method
Next Topic:UML2 genmodel properties for EClasses
Goto Forum:
  


Current Time: Fri Aug 22 21:42:29 EDT 2014

Powered by FUDForum. Page generated in 0.01838 seconds