Web Based Navigation Into Rhapsody
Overview
You may already know this but if your model is on the Rhapsody Model Manager server, you can browse from an element in the web client to the same element in the Rhapsody desktop client. What you may not know is you can employ this mechanism yourself on models which are not on the server - which is very useful if you create your own HTML based documents that reference a local model.
Note that this not not an officially supported feature !
Behind The Curtain ..
So how does it work ? Well when Rhapsody is installed, amongst the many things it does behind the scenes is register itself with the operating system as the handler for any 'Rhapsody' model elements accessed from a web browser.
If a http link starts with rhapsody: then the web browser asks the operating system to handle that Rhapsody artifact.
The installer also adds a registry entry as the handler for that web based request. If you want to go check it for yourself you will find it in the registry editor with this path:
Computer\HKEY_CLASSES_ROOT\rhapsody\shell\open\command
That entry is set to launch a Java based helper installed with Rhapsody, for example mine was:
"C:\IBM\Rhapsody\jdk\bin\javaw.exe" -Djava.library.path="C:\IBM\Rhapsody\Share\JavaAPI" -classpath "C:\IBM\Rhapsody\Share\JavaAPI\rhapsody.jar";"C:\IBM\Rhapsody\Share\Profiles\RhapsodyModelManager\RhpLauncher.jar" com.ibm.rhapsody.launcher.Lanucher "%1"
The %1 is supplied by the web based http link and the Java helper processes it and then calls an internal Rhapspody function to handle the link.
Adding Your Own Navigation Links
So how to create such a link so that Rhapsody interprets it as "Locate in Model" ?
Its actually very easy - all you need is the GUID of the model element to which you want to navigate. The link should then have the following format:
rhapsody:highlight?guid=[GUID]&serverid=0;
Replace [GUID] with your actual GUID, making sure to replace the space with %20.
The last part is necessary because even though the model is not on RMM, Rhapsody still checks that the server is legal. Adding &serverid=0 tells Rhapspody not to check that part (if you dont have this field then Rhapspody will always tell you the model element does not exist)
Here is a sample link:
<a href="rhapsody://highlight?guid=GUID%2034ca425b-9df5-4849-b9a0-e3a40280cd38&serverid=0">Locate in Rhapsody</a>
And - in case you want to do the same thing RMM does - here's an example of the call RMM makes for a model thats on the server (it includes the server and the configuration IDs)
rhapsody://highlight?guid=GUID%2034ca425b-9df5-4849-b9a0-e3a40280cd38&fileid=__ZN8cSt2Ee2SW_ciyhu_-Q&localconfigurationid=_5uLFMCt2Ee2SW_ciyhu_-Q&serverid=1448433