|
|
Get Hyperlink |
Returns the URL of a model element.
|
Applicable To |
All |
|
Menu
Entry |
Power
Pack Navigation Tools Get Hyperlink Clickable Power
Pack Navigation Tools Get Hyperlink HTML Power
Pack Navigation Tools Get Hyperlink Plain Power
Pack Navigation Tools Get Hyperlink Power Pack |
|
Demonstration |
When Rhapsody is installed, it registers itself as the handler for any web links that start with ‘rhapsody:’ (this is how navigation from Rhapsody Model Manager to Rhapsody works).
This helper takes advantage of that mechanism to generate navigable web links in several forms described below. Note however that any navigation using this mechanism fails if the model is stored on Rhapsody Model Manager (internally Rhapsody expects either a valid server id or 0 in the link. Sadly 0 does not work if the model is on Rhapsody Model Manager and there is no way to obtain the server id through the Rhapsody API). Also the link will only navigate to the ‘first’ running Rhapsody instances so multiple Rhapsody instances are not supported. The Power Pack link overcomes these limitations.
This generates the basic link which can be pasted directly into the address bar of a web browser, for example:
rhapsody://highlight?guid=GUID
052b8171-a32b-4f45-a829-5585f79f9deb&serverid=0
This generates a html link which may be pasted into a html document, for example:
<a
href="rhapsody://highlight?guid=GUID
052b8171-a32b-4f45-a829-5585f79f9deb&serverid=0">SysML</a>
This simple helper can be
run on any model element. The generated link is reported in the output window
and placed into the copy buffer (that is the Windows clipboard) to allow it to
be pasted elsewhere.
This generates a html link with spaces replaced by %20 which may be pasted into (for example) a chat, for example:
<a
href="rhapsody://highlight?guid=GUID%20052b8171-a32b-4f45-a829-5585f79f9deb&serverid=0">SysML</a>
This simple helper can be
run on any model element. The generated link is reported in the output window
and placed into the copy buffer (that is the Windows clipboard) to allow it to
be pasted elsewhere.
This generates a html link which may be pasted into a html document. Instead of the Windows rhapsody: link, this one sends a request to the Rhapsody Power Pack Web Link Listener and will work with any model whether it is on Rhapsody Model manager or not. The generated link displays the model element name.
<a
href="#" class="btn btn-primary"
onclick="fetch('http://localhost:7777/?navigate=GUID
7fc973c7-3bf9-471c-a2fa-b092774eedb3').then(response =>
response.text()).then(data => console.log('Navigate Response:
' + data)).catch(error => console.error('Error sending
navigate request:', error));">B1</a>
The port is taken from the property below:
RhapsodyPowerPack.WebLinkListener.Port