When you create a component or plan, you can define variables to use when that component is deployed or the plan is executed. Many component types include common variables, such as installPath, which defines where to install the component. The value of the installPath variable is determined for a given host when the component is installed on that host.
Some common variables that you might see include the following:
installPath – Path to where the component, plug-in, or other resource file is installed
installUser – Login name of the user who installed the component, plug-in, or other resource file
pluginClasspath – Path to where the classes that apply to a specific plug-in are installed
A variable can refer to another variable, such as the variable of a container component. For example, the value of the installPath variable for a simple component could be the value of the installPath variable for its parent container component.
When defined, each variable must have a name and a default value attribute. The default value can be obtained from several places:
A literal string
The host, using the target keyword
Another component, using the component keyword
The user's session, using the session keyword
For detailed information about using these attributes, see Types of Variables Available for Substitution in N1 Grid Service Provisioning System 5.0 Plan and Component Developer’s Guide.
You can define a variable through the browser interface or directly in the XML file. Within the XML file, variables are defined using the <var> element and contained within a <varList> element.
The following XML fragment shows several variable definitions.
<varList> <var name='installPath' default=':[target:sys.raDataDir]:[/]systemcomps'> </var> <var name='pluginClasspath' default=':[installPath]:[/]plugin-core.jar'> </var> <var name='fileBrowser' default='com.sun.n1.sps.pluginimpl.system.browse.FilesystemBrowserFactory'> </var> <var name='directoryBrowser' default='com.sun.n1.sps.pluginimpl.system.browse.FilesystemBrowserFactory'> </var> <var name='symlinkBrowser' default='com.sun.n1.sps.pluginimpl.system.browse.FilesystemBrowserFactory'> </var> </varList>