Server Variables

This article contains the following topics:
casm171
This article contains the following topics:
CA SDM information is included in the HTML template using variables beginning with a dollar sign ($). Each page is created with some variables that are documented in the template file. These variables can be put on the page or used in conditional statements:
  • Simple Variables
  • Property Variables
  • Environment Variables
  • Business Object Variables
  • List Variables
Simple Variables
Simple variables specify flags that are passed to the web page. To access a simple variable, use the variable name preceded by a dollar sign ($). This makes the value of the variable available. For example, two such variables are $CAisd and $cgi. Putting $CAisd in a template results in the substitution of the main CA SDM web server installation directory, whereas $cgi refers to the URL of the pdmweb.exe program. Simple variables are documented in the upper section of the HTMPL file that uses them.
The following shows a list of variables that can be used in all the HTMPL files:
  • $ACCESS.
    group
    The user access privilege object contains the privilege settings on the function group
    group
    for the current login user. For example, $ACCESS.admin holds the privilege value for the admin functional group. Valid privilege values are:
    • 0-NO ACCESS
    • 1-VIEW
    • 2-MODIFY
    This variable is not available in the login form.
  • $cgi
    The URL of the pdmweb.exe program.
  • $cst
    The data object of the current login user. This variable is not available in the login form. You can reference individual attributes of this object with the form $cst.
    attrname
    ; for example, $cst.first_name.
  • $CAisd
    The URL of main CA SDM web server installation directory.
  • $MachineName
    The MachineName defined in the web.cfg file.
     
  • $ProductName
    The product name defined in the NX.env file.
  • $SESSION
    The session object saves all session variables including session ID ($SESSION.SID) and all variables defined in the web.cfg file.
     
  • $USER_STATE
    User-defined state information.
Property Variables
Property variablesrepresent a property of the configuration file, web.cfg. You can access any entry in the web.cfg file (including user-defined entries) within an HTML template file by prefixing it with “$prop.”
For example, one of the lines in web.cfg, which specifies the number of entries displayed in a single page on a list form is as follows:
ListPageLength 10
You can refer to this variable in an HTML template with the specification:
$prop.ListPageLength
If you use the <PDM_INCLUDE> special tag to incorporate another file into a template file, you can specify additional properties as attributes of the <PDM_INCLUDE> tag. You can reference these properties in the included file in the same way as web.cfg properties. A property specified as a <PDM_INCLUDE> attribute that has the same name as a web.cfg property overrides the web.cfg property within the included file.
For example, the following <PDM_INCLUDE> tag creates a property called $prop.menubar that can be referenced within the std_body.htmpl file:
<PDM_INCLUDE FILE=std_body.htmpl menubar=no>
You can refer to configuration file property
xxx
in two ways: $prop.
xxx
or
$SESSION.xxx
. Both return the same value. However, the $prop.
xxx
syntax is preferred because it involves less server overhead.
In addition to properties from web.cfg, there are several predefined properties that can be accessed with $prop. These are:
  • $prop.browser
    A string identifying the browser in use. This will be “IE” for Internet Explorer.
  • $prop.combo_name
    A string containing the current user's name, in the form “last_name, first_name middle_name.”
  • $prop.factory
    A string containing the factory associated with the current form, such as “cr” for requests or “iss” for issues.
  • $prop.FID
    A string containing the numeric form ID of the current form.
  • $prop.form_name
    A string containing the name of the current HTML template, in the form
    xxx
    .htmpl.
  • $prop.form_name_1
    A string containing the substring of the form name before the first underscore. For example, for the form detail_chg_edit.htmpl, form_name_1 would be “detail.”
  • $prop.form_name_2
    A string containing the substring of the form name after the first underscore and before the last underscore (or dot). For example, for the form detail_chg_edit.htmpl, form_name_2 would be “chg.”
  • $prop.form_name_3
    A string containing the substring of the form name after the last underscore and before the dot. For example, for the form detail_chg_edit.htmpl, form_name_3 would be “edit.” For the combination detail form, which has a file name of the form detail_
    xxx
    .htmpl, $prop.form_name_3 is set to the current view, either “ro” or “edit”.
  • $prop.release
    A string containing the release level of the form. The PDM_PRAGMA statement contains more details on this property.
  • $prop.SID
    A string containing the numeric session ID of the current session.
  • $prop.sitemod
    A string containing the site-defined modification name of the form. The PDM_PRAGMA statement contains more details on this property.
  • $prop.user_type
    A string containing “analyst,” “customer,” “employee,” or “guest.”
  • $prop.version
    A string containing the version of the form. The PDM_PRAGMA statement contains more details on this property.
Environment Variables
Environment variablesrepresent an entry within the NX.env configuration file. You can reference any entry in NX.env within an HTMPL template file by prefixing it with “$env.”
For example, one of the lines in NX.env, which specifies the host name of the CA SDM server is as follows:
@NX_SERVER=hostname
You can refer to this variable within an HTMPL template file with the specification:
$env.NX_SERVER
Business Object Variables
Businessobject variablesrepresent a CA SDM object, such as an issue or a request. To access an object, you need to start with the variable name, followed by a period (.), followed by whatever attribute names you want to display. For example, on an issue where, by convention, the object is represented by the variable args, you can display the description, the open date, the assignee's phone number, the number of activities on the issue, and the description of the first activity, as shown by the following:
$args.description $args.open_date $args.assignee.phone_number $args.act_log.length $args.act_log.0.description
You can use braces to delimit the variable name if it is not surrounded by white space. For example, $foo bar and ${foo}bar are both valid. You can also use the variable args to access non-attribute values (for example, $args.KEEP.
name
as described in Supported Operations).
It is possible that a non-attribute variable may not be defined. For example, it may be possible to get to a form from two different places, only one of which provides a value for $args.KEEP.foo. You can provide a default value for a $args reference with the following syntax, where the string after the colon is substituted for the reference if
variable
is undefined:
${args.variable:default}
  • Time Zone Date Variables
    Time zone date variables are a special case of business object variables. They provide a means to convert universal dates (UTC) represented as integers to string dates adjusted for the time zone of the user's browser. The variable for representing integer dates is:
    $args.attr_name_INT_DATE
    Example:
    $args.open_date_INT_DATE
  • Factory Data Variables
    Factory data variables are a special case of business object variables. A factory data variable is replaced by information about a referenced object. There are seven such variables available:
    • $args.
      attr_name
      .COMMON_NAME
      The common name (externally readable string) of the table referenced by the attribute. For example, on the Request Detail form, the value of $args.assignee.COMMON_NAME is the assignee's combo name (“last, first, middle”).
    • $args.attr_name.COMMON_NAME_ATTR
      The attribute name of the common name in the table referenced by the attribute. For example, on the Request Detail form, the value of $args.assignee.COMMON_NAME_ATTR is “combo_name”.
    • $args.FACTORY_
      attr_name
      The name of the factory associated with the specified attribute. For example, on the Request Detail form, the value of $args.FACTORY_assignee is “agt”.
    • $args.LENGTH_
      attr_name
      The maximum length of the attribute. For example, on the Request Detail form, the value of $args.LENGTH_summary is 240.
    • $args.
      attr_name
      .REL_ATTR
      The rel attr (foreign key) of the attribute. For example, on the Request Detail form, the value of $args.assignee.REL_ATTR is the value of the assignee's ID field.
    • $args.
      attr_name
      .REL_ATTR_ATTR
      The attribute name of the rel_attr in the table referenced by the attribute. For example, on the Request Detail form, the value of $args.assignee.REL_ATTR_ATTR is “id”.
    • $args.REQUIRED_
      attr_name
      A string, either “0” or “1” indicating whether the referenced attribute is required.
    • $args.
      attr_name
      .SELECTIONS
      A list of valid selections for
      attr_name
      . This value is an empty string if
      attr_name
      is not a reference to another table, or if the size of table referenced by
      attr_name
      exceeds the value of the configuration file property SelListCacheMax. Otherwise, the SELECTIONS variable is a string containing the common name and rel attr of all the entries in the referenced table. Successive values are separated by the string “@,@”, so the variable's value has the form:
      "[email protected],@[email protected],@[email protected],@rel_attr2"
    • $args.
      factory
      _SEL_UNDER_LIMIT
      A string, either “0” or “1”, indicating whether the current number of rows in the table corresponding to
      factory
      is less than the value of the configuration file property SelListCacheMax. This variable is deprecated in favor of the SELECTIONS variable, which should be used in all new forms.
    Factory data variables containing a dotted reference (COMMON_NAME, REL_ATTR, and SELECTIONS) can be used with a dotted reference of any length. For example, on a Request Detail form $args.assignee.organization.COMMON_NAME is replaced by the external name of the assignee's organization.
List Variables
List variables are used to iterate through data. They are accessed using list tags as described in PDM_LIST: Format a List of Database Rows.