Updating an Enumeration File

<< Click to Display Table of Contents >>

EQuIS 7  >>  EDP > Customizability >

Updating an Enumeration File

Enumerations are a way to enforce vocabulary on fields that have no reference tables. Enumerations can also restrict the vocabulary of fields that do have existing reference tables. They are used in EDP and in EDGE to enforce specific lookup values for key fields.

 

The enumerations are defined in one of two places:

1.Format File – This is in the code of the format itself (.xse, .xsd) and is typically encrypted.

2.Enum File – This is an auxiliary enumeration file (e.g., EQEDD-enum.xml). This remains unencrypted and is editable.

 

For EQEDD, the enumerations are stored in an auxiliary file, C:\Program Files\EarthSoft\EQuIS\Formats\EarthSoft\EQEDD-enum.xml. These enumerations are editable. To update an enumeration file, find the enumeration name within the text file (generating an EDD Description can be used). The enumeration file can be opened in Microsoft Visual Studio (allows collapsing of enumerations and color coding) or Notepad.

 

To Add or Replace the Values in the Enumeration File

 

<xs:simpleType name="detect_flag">

 <xs:restriction base="xs:string">

  <xs:maxLength value="2" />

  <xs:enumeration value="Y" />

  <xs:enumeration value="N" />

   <xs:enumeration value="TR" />

 </xs:restriction>

</xs:simpleType>

 

To Create a New Enumeration File and then Use the File

 

Use an unencrypted format (.xsd) and then create the enumeration as show above. To add to the enumeration to the field, add an attribute "type" to the field declaration with the value equal to the enumeration name.

 

<xs:element name="detect_flag" type="detect_flag" nillable="false" default="Y">

 

If the type attribute is defined in the field declaration header, then it cannot have a simpleType sub node.

 

<xs:simpleType>

  <xs:restriction base="xs:string">

    <xs:maxLength value="40" />

  </xs:restriction>

</xs:simpleType>

 

Office Hour Video

 
The Office Hour video Understanding Enumeration Files on YouTube.