5. Tying the ADMX and ADML Files Together
The
ADMX file is responsible for creating the category and policy structure
within the GPME, whereas the ADML file is responsible for the text for
the category, policy, and any other elements used. Any number of ADML files can be used with a single ADMX file to create language-specific interfaces.
The
policy section in the ADMX file creates each individual policy within
the GPME. Because the policy must have associated text, the ADMX file
must reference the ADML file to supply the correct text for the policy
wording. To do this, use the presentation element in the policy statement, as shown in the following snippet from an ADMX file:
<policy name="Sample_Checkbox" class="Machine"
displayName="$(string.Sample_Checkbox)"
explainText="$(string.Sample_Checkbox_Help)"
presentation="$(presentation.Sample_Checkbox)"
key="Software\Policies\Examples">
<parentCategory ref="CHECKBOX_CATEGORY"/>
<supportedOn ref="windows:SUPPORTED_ProductOnly"/>
<elements>
<boolean id="Checkbox" valueName="ExampleCheckbox">
<trueValue>
<decimal value="1"/>
</trueValue>
<falseValue>
<decimal value="0"/>
</falseValue>
</boolean>
...
Note that the presentation element references the presentation.Sample_Checkbox variable. This variable is defined in the ADML file, shown here:
<presentation id="Sample_Checkbox">
<checkBox refId="Checkbox">Check box text</checkBox>
</presentation>
Because
these two entries for presentation match and there are the same number
of entries in both the ADMX and ADML file, the display should correctly
show the check box with the “Check box text.”
Warning
If
the ADML file does not have the exact same name as the ADMX file, the
GPME will display an error, indicating that the ADML file is not
available. Also, the ADMX file and the ADML file must contain the same
number of elements for the text to appear in the GPME—if they do not,
an error will appear, indicating a mismatch. |
You
should also be aware of the data type that is used in the ADMX file and
how it matches with the parameter definition in the ADML file. The ADMX
file uses the boolean data type, which matches the checkBox parameter definition in the ADML file. Table 4 shows how to match the data types from the ADMX file to the associated parameter definitions in the ADML file.
Table 4. ADMX Data Type to ADML Parameter Definition Matrix
ADMX File Data Type | ADML File Parameter Definition |
---|
boolean Element | checkBox Element |
text Element | textBox Element |
decimal Element (elements) | decimalTextBox Element |
text Element | comboBox Element |
enum Element | dropdownList Element |
item Element | dropdownList Element |
list Element | listBox Element |