Page tree

Skip to end of metadata
Go to start of metadata

You can add custom fields to any of the default templates BMC Database Automation provides by editing the XML file in the Templates Repository. These custom fields appear in the relevant provisioning task in the Management Console.

Custom fields allow the following:

  • Ability to define custom fields as having a list of possible values that appear in a list box. Input is validated.
  • Ability to enable the selection of an ad-hoc value.

Custom field variables are assigned a GAC_ prefix. For example, a parameter named responsible_dba would appear in the environment of the pre-provisioning and post-provisioning scripts as GAC_responsible_dba.

This topic provides information and instructions on adding custom fields to a template:

To add a custom field to a template

  1. Follow the steps in Editing templates.
  2. Enter any of the custom fields found in the following example sections.
    The custom fields should be entered inside the root tag named defaults and outside of the editable and non-editable sections.
  3. Type the custom field name.
  4. Specify whether the field is required (true or false) and whether the field is editable or non-editable.
    Tags that are not specified appear as blank, optional and editable. You can require the user to enter information in any of these tags by marking it as required.

Example text input field

The following example shows a custom text input field.

Example

<custom_fields>
<field>
        <name>field_1</name>
        <value>field_1 value</value>
        <required>true</required>
</field>
<field>
        <name>field_2</name>
        <value>field_2 value</value>
        <required>false</required>
        <editable>false</editable>
</field>
</custom_fields>

To define a text area, instead of just a standard input field, use the type tag as follows:

<field>
         <name>comments</name>
                   <value></value>
                   <type>textarea</type>
</field>

Example list box field

The following example shows a custom field with a drop-down list of choices for a user to select from.
Adding the value _other results in a text box appearing after _other is chosen from the list box. If the field is required, a value must be specified in the _other field text box when chosen.

Example

<custom_fields>
  <field>
    <name>field_1</name>  
    <value>value_1</value>
    <required>true</required>
    <editable>false</editable>
  </field>
  <field>
    <name>field_2</name>    
    <value>value_1</value>
    <value>value_2</value>
    <value>value_3</value>
    <required>false</required>
  </field>
  <field>
    <name>field_3</name>
    <value>value_1</value>
    <value>value_2</value>
    <value>value_3</value>
    <value>_other</value>   
    <required>false</required>
  </field>
</custom_fields>

Example of a default value for a list box

You can specify a default value to be specified for a list box. It must be one of the choices in the value tags.

Example

<custom_fields>
   <field>
    <name>field_2</name>    
    <value>value_1</value>
    <value>value_2</value>
    <value>value_3</value>
    <required>false</required>
    <default>value_2</default>
  </field>
  </custom_fields>

Example custom hidden field

You can specify whether or not a field should be visible to the end-user. The following example shows how to create a custom hidden field.

Example

<custom_fields>
  <field>
    <name>field_1</name>  
    <value>value_1</value>
    <required>true</required>
    <editable>false</editable>
    <hidden>false</hidden>
  </field>
  <field>
    <name>field_2</name>    
    <value>value_1</value>
    <value>value_2</value>
    <value>value_3</value>
    <required>false</required>
    <hidden>true</hidden>
  </field>
  </custom_fields>

Example password field

The following example shows a password field.

Example

<field>
     <name>field_1</name>
     <password>true</password>
     <required>true</required>
</field>

Example custom variable to replace values

BMC Database Automation allows the use of custom variables in your templates to replace certain values. For example, if you specify a custom field in your template, such as the following, you can refer to your custom field anywhere in the template by surrounding it in curly brackets {CUSTOM_FIELD_NAME}.

Example

<custom_fields>
        <field>
                <name>ORA_BASE_DIR</name>
                <value> /app/oracle/foo</value>
                <required>true</required>
                <editable>true</editable>
                <hidden>false</hidden>
                <password>false</password>
        </field>
</custom_fields>

Example multiple custom fields pages in template

You can insert <page> and <title> tags into a template to have your custom fields provisioning distributed across multiple pages.

Example

<page>
      <title>custom_fields_page_1</title>
      <field>
        <name>A</name>
        <value>dba</value>
      </field>
      <field>
        <name>B</name>
        <value>oper</value>
      </field>
</page>
<page>
      <title>custom_fields_page_2</title>
      <field>
        <name>C</name>
        <value>dba</value>
      </field>
      <field>
        <name>D</name>
        <value>oper</value>
      </field>
</page>