Page tree

MagicDraw 2021x Documentation


On this page

$bookmark contains utility functions for bookmarking. The functions of this module are accessible from templates through $bookmark.

Information

The default style of bookmarks depends on the editor used. For example, Microsoft Word 2003 displays hyperlinks in blue.


$bookmark.openURL(url, content)

Create a hyperlink to open a URL.


NameType Description 
Parameter(s)  url java.lang.String  A URL text.
content java.lang.Object The text content. 
 Return -com.nomagic.magicreport.LinkThe text content with a hyperlink. 

For example:

$bookmark.openURL("http://www.nomagicasia.com","NoMagic Asia")


$bookmark.openURL(url, content)

Create a hyperlink to open a URL.


Name Type Description 
Parameter(s)  url java.net.URL A URL instance. 
content java.lang.Object  The text content. 
 Return -com.nomagic.magicreport.Link 

The text content  with a hyperlink.

For example:

$bookmark.openURL($url, "NoMagic Asia")


$bookmark.openURL(uri, content)

Create a hyperlink to open a URI.


 NameType Description 
Parameter(s)  uri  java.net.URI A URI instance. 
content java.lang.ObjectThe text content.
 Returncom.nomagic.magicreport.LinkThe content with a hyperlink.

For example:

$bookmark.openURL($uri, "NoMagic Asia")


$bookmark.open(content)

Create a hyperlink for a bookmark. The bookmark ID will be automatically generated from the content.


Name Type Description 
Parameter(s)  contentjava.lang.Object The text content.
Returncom.nomagic.magicreport.Link  The text content with a hyperlink. 


$bookmark.open(bookmarkId, content)

Create a hyperlink for a bookmark. The bookmark ID value must match the parameter bookmark ID that passes onto the link.


Name Type Description 
Parameter(s) bookmarkId java.lang.StringThe bookmark ID.

content java.lang.Object The text content.
Return -com.nomagic.magicreport.LinkThe text content with a hyperlink.

For example:

Click this link to: $bookmark.open($element.elementID, "Click here to $element.name")

$bookmark.create(bookmarkObject)

Create a bookmark. The bookmark ID will be automatically generated from the bookmark object.


Name Type Description 
Parameter(s) bookmarkObject java.lang.Object A bookmark object or content. 
Returncom.nomagic.magicreport.Bookmark The content with a bookmark. 


$bookmark.create(bookmarkId, bookmarkObject)

Create a bookmark. The default element type for this function is "label".


Name Type Description 
Parameter(s)bookmarkId java.lang.String The bookmark ID.

 bookmarkObjectjava.lang.ObjectA bookmark object or content.
Return -com.nomagic.magicreport.Bookmark The content with a bookmark. 

For example:

$bookmark.create($element.elementID, $element.name)

$bookmark.create(bookmarkId, bookmarkObject, elementType)

Create a bookmark by specifying an element type.


Name Type Description 
Parameter(s) bookmarkIdjava.lang.StringThe bookmark ID.

 bookmarkObject java.lang.ObjectA bookmark object or content.

 elementType java.lang.String An element type name, e.g., html tag. 
Return  -com.nomagic.magicreport.BookmarkThe content with a bookmark.


$bookmark.getBookmarkId(id)

Return a bookmark ID from a given string.


Name Type Description 
Parameter(s) idjava.lang.String An original string value.
Return -com.nomagic.magicreport.BookmarkThe bookmark ID.


$bookmark.createRef(referenceID)

Create a reference bookmark of any Microsoft Word reference numbered items.


Name Type Description 
Parameter(s) referenceIDjava.lang.String A reference ID.
Return -com.nomagic.magicreport.TextReferenceThe content with a bookmark in the Microsoft Word format.


$bookmark.openRef(referenceID)

Create a hyperlink for a reference bookmark of any Microsoft Word reference numbered items.


Name Type Description 
Parameter(s) referenceIDjava.lang.StringA reference ID.
Return -com.nomagic.magicreport.TextReferenceThe content with a bookmark in the Microsoft Word format.

Note

You can press F9 to replace the text content shown as Refer with the updated numbered item that it refers to.


$bookmark.openRef(referenceID, referenceText)

Create a hyperlink for a reference bookmark of any Microsoft Word reference numbered items.


NameTypeDescription
Parameter(s)referenceIDjava.lang.StringA reference ID.

referenceTextjava.lang.StringThe text content.
Return-com.nomagic.magicreport.TextReferenceThe content with a bookmark in the Microsoft Word format.

Note

You can press F9 to replace the text content shown as Refer referenceText with the updated numbered item that it refers to.

  • No labels