Commons

Name: commons

This bundle is installed by default and provides the following services, available from <gendoc> tags:

Cleans special characters inside the given String. This method needs to be used if a string to be displayed can contain special characters such as: <, >, &, ‘, ”.

Format of the parameter string to display line break or carriage return characters as line breaks, and tabulation characters as tabulations in output document.

Split the specified String on the line separator and return a Set of each line to manage manually new lines in a text.

Link a value to a specific key. This variable can be used all over the document (including other gendoc parts) using gGet .

Get a value already stored in Gendoc (by gPut or defined in param tags).

Returns a generic String for the given model element.

Get a unique id associated to the given model element (to be used for bookmarks for example).

Load an image located in another plugin in order to generated it in the output document.
This method should be used inside <image> tag with the following syntax:

<image object='[getPluginImage('org.mycompany.myplugin.id', '/resources/images/myimage.png')/]' …>

</image>

9.1.1 Advanced services from bundle “commons”

Several services allow to load other models in order to be able to use their elements inside scripts.

Load a model located next to the model where the modelElement comes from.
For example, for a Package p contained in the file located at file://c:/test/file.uml, the call: p.load('notation') will load the file located at file://c:/test/file.notation

Load a model located with a relative path to the model where the modelElement comes from. For example, for a Package p contained in the file located at file://c:/test/file.uml, the call: p.load('../file2.notation') will load the file located at file://c:/file2.notation.

Load a model from its URI. For example, the call : p.load('file://c:/test/file.notation') will load the file located at file://c:/test/file.notation.

Loading another model in order to be able to use its elements in script.