|
Re: loading a uml-profile [message #752874 is a reply to message #752664] |
Wed, 26 October 2011 10:52   |
Eclipse User |
|
|
|
Hi Stoehm!
> ...
> the profile i need is in a pathmap file and so i cannot access them,
because the workflow expect a platform...file.
Is there any error or warning message?
> so i put the profile.uml-file in my workspace and tried to load it
extra, but this does not work.
> so i need a way to load the profile from the pathmap, has anybody an idea
I think the problem is that the pathmaps are defined in an extension
point, since you'are colling this code programmatically EMF doesn't know
about the them. So you have to register the pathmaps programmatically.
The code like this should help:
void setupUML(ResourceSet resourceSet) {
....
URI uri = getUMLResourcesURI();
//Put pathmap paths to the registry
Map<URI, URI> uriMap = URIConverter.URI_MAP;
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
// load the resources
resourceSet.getResource(URI.createURI(UMLResource.UML_METAMODEL_URI), true);
resourceSet.getResource(URI.createURI(UMLResource.ECORE_PROFILE_URI), true);
resourceSet.getResource(URI.createURI(UMLResource.STANDARD_PROFILE_URI),
true);
}
protected URI getUMLResourcesURI() {
final String umlProfile = "metamodels/UML.metamodel.uml";
final URL url = MyClass.class.getClassLoader().getResource(
umlProfile);
String baseUrl = url.toString();
URI uri = URI.createURI(baseUrl.substring(0, baseUrl.length()
- umlProfile.length()));
return uri;
}
Best wishes,
--
Tatiana Fesenko
ModelSolv, Inc.
Model-Oriented Solutions for Service Integration
|
|
|
Re: loading a uml-profile [message #753426 is a reply to message #752874] |
Thu, 27 October 2011 04:27  |
Eclipse User |
|
|
|
hi tatiana
thanks for your reply.
i think that can help me, but i have just two questions:
>final String umlProfile = "metamodels/UML.metamodel.uml";
this uml is the profile? because you write metamodel in it?
>final URL url = MyClass.class.getClassLoader().getResource(umlProfile);
i am not sure which class i have to choose here, can you give me a hint, please?
regards
stoehm
|
|
|
Powered by
FUDForum. Page generated in 0.04102 seconds