Creating metadata value lists

Creating metadata value lists
To simplify the use of metadata in Composer, you can provide users with lists of metadata values. The lists are available when users set up conditions for rules and sample data for document preview.
From the value lists in Composer, users can select several values as conditions for rules, but only single values when previewing output documents.
You configure the metadata value lists in the metadataoptions.xml file. The file is available in the following directory:
<TOMCAT_HOME>\webapps\applications\WEB-INF\settings
Editing the metadata value file
To edit the metadataoptions.xml file, you must use an editor which supports UTF-8 encoding, for example, Windows Notepad. Either you enter the metadata value options, or use JavaScripts to produce the value lists.
If you enter metadata value options in the metadataoptions.xml file, you must specify:
Example 2
In this case, the name of the metadata definition configured in the resource set is Country code. The values to match with input data are IT, SE, NO and DK. Composer users can select Italy, Sweden, Norway and Denmark as condition values for the country code and as sample data when previewing output documents.
<metadata description="The country codes" name="Country code">
  <options>
    <option value="IT">Italy</option>
    <option value="SE">Sweden</option>
    <option value="NO">Norway</option>
    <option value="DK">Denmark</option>
  </options>
 
Example 3
In this case, java.util.Locale is used to produce a list of ISO Country Codes that can be selected in Composer.
<metadata description="The country codes" name="Country code">
   <javascript>
      var availablelanguages = java.util.Locale.getISOCountries();
      var languages = new Array();
      for (var j = 0; j < availablelanguages.length; j++) {
         var l = availablelanguages[j];
         languages.push({value: l.toString(), label:l.toString()});
      }
      metaDataField.options = languages;
   </javascript>
</metadata>
 
OpenText StreamServe 5.6 Updated: 2013-03-01