grass
Token

Token is a place holder for configuration value. In dynamic config file replaceable tokens are defined. These tokens have different value depending on their target environment. For example a token defined for database server will have different values in different environment like dev, qa and prod. Token value for different environment is defined in grass config XML file. Token is defined within the tokens element. 

A sample token definition in grass-app-cfg.gac is given below.

<tokens>
<token name="database">
<value form="simple" id="global" type="pre-install" use="mandatory">DevPrefDB</value>
</token>
</tokens>

Details of token definition in grass config

Attribute Description
name the unique token name
form the form of token, it can be simple or complex
id the target environment or group
type the type of token, it can be install or preinstall
use the use of token, it can be optional or mandatory
value the value of token

<token name="database">

A token is defined within the tokens element. A token has a unique name and it is specified in the name attribute of token element. 

<value form="simple" id="global" type="pre-install" use="mandatory">DevPrefDB</value>

The child value element is used to define token value for an environment or group. In the definition above the database token global value is defined of form simple and type as pre-install. 

Token Form

The form of token can be simple or complex. The simple token value is single line. The complex token value is multi line. It has to be enclosed within the CDATA section in the value element.

Token Type 

The config tokens can be of type install or preinstall. The install token value is defined by the user of the system. The user has to provide value for install token in the .grass file in his home directory. The pre-install tokens are not user specific and is purely dependent on the environment or group.

Token Use

The token use can be optional or mandatory. For mandatory token value is required for the generation of config files and value is not required for optional token.

Copyright © 2007, Saravana Aravind R