Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » dynamic pathmap:// variable registration & opening, editing, creating models with pathmap URIs
dynamic pathmap:// variable registration & opening, editing, creating models with pathmap URIs [message #619685] Tue, 05 June 2007 17:54
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 157
Registered: July 2009
Senior Member
The GMF pathmap mechanism is great for UML profiles; I recently found a
way to dynamically register pathmap variables but I seem to be missing
some additional registration to use UML profiles according to to
dynamically-registered pathmap variables.

To dynamically register a pathmap variable, I came up with the following

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.emf.core.internal.resources.PathmapM anager;

private static String SHADDOCK_PROFILE_RESOURCES = "/Planete/Shaddock";

if (!PathmapManager.isRegisteredPathVariable(SHADDOCK_PROFILES) ) {
IWorkspaceRoot wksroot = ResourcesPlugin.getWorkspace().getRoot();
IResource profiles = wksroot.findMember(SHADDOCK_PROFILE_RESOURCES);
String location = profiles.getLocationURI().toString();
PathmapManager.setPathVariable(SHADDOCK_PROFILES, location);

// Now that the pathmap variable is registered,
// the shaddocks can begin pumping and pumping...

The kosher approach would instead use a plugin to register a pathmap
variable and profiles on the org.eclipse.gmf.runtime.emf.core.Pathmaps
extension point. However, this approach is fastedious because it
requires launching a new Eclipse runtime environment.

Since the shaddocks are an impatient bunch of people, I'm trying to be
responsive to their angst with dynamic scripting to register pathmap
variables and, hopefully, open, edit, create UML models using
dynamically-registered pathmap variables and profiles as if I had
launched a runtime Eclipse environment.

The criteria of success is that a SHADDOCK-profiled UML model should
always refer to the SHADDOCK profile using pathmap URIs and nothing
else, especially not file- or jar-based URIs. A SHADDOCK-profiled model
should therefore look like this:

xsi:schemaLocation="... http:///schemas/shaddock/..
pathmap://SHADDOCK_PROFILES/.. ..."
<uml:Model ...>
<packageImport .../>
<packagedElement ...>
<profileApplication xmi:id="..">

My solution seems incomplete and the shaddocks are unhappy.
Is there a kind soul who might have some words of wisdom to share
with me to solve this issue?

-- Nicolas.
Previous Topic:[Announce] MDT UML2 2.1.0 2.1RC2 is available
Next Topic:Re: proxy resolution problem
Goto Forum:

Current Time: Wed May 23 07:26:08 GMT 2018

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

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

Back to the top