Understanding Sun Master Index Configuration Options (Repository)

The Field Validation File (Repository)

By default, the Field Validation file defines one validation rule named validate-local-id. This rule defines certain validations that are performed against local ID and system fields before they are entered into the database. The local ID validator verifies that the system code is valid, the local ID format is correct, the local ID is the correct length, and that neither field is null.

The following topics provide information about working with the the Field Validation file:

Modifying the Field Validation File

You can modify the Field Validation file using the XML editor. The possible modifications to this file are restricted by the schema definition, so be sure to validate the file after making any changes. When you modify this file, you must regenerate the application and redeploy the project for the changes to take effect.

Field Validation File Structure

The Field Validation file consists primarily of a list of rules. Each rule is defined within the ValidationConfig element and is defined by attributes within a rules element. Table 13 describes the elements and attributes of the Field Validation file.

Table 13 Field Validation File Elements

Element or Attribute 

Description 

rules

The configuration information for the validation rules. 

rule

The configuration information for a specific validation rule in a rules list.

rule/name

A rule attribute that specifies a name for the validation rule.

rule/object-name

A rule attribute that specifies the name of the class that defines the object to which the validation rule is applied, such as SystemObject or ParentNameObject (where ParentName is the name of the parent object in the Object Definition).

rule/class

A rule attribute that specifies the complete path of the Java class containing the validation rule.

Field Validation File Example

Plug the custom validation classes you create into the master index application by specifying the name of the custom plug-in for the class in the Field Validation file, as shown below.


<ValidationConfig module-name="Validation" 
parser-class= "com.stc.eindex.configurator.impl.validation.ValidationConfiguration"
   <rules>
      <rule name="validate-auxiliary-id" object-name="PersonObject"
       class="com.stc.eindex.user.AuxiliaryId"/>
      <rule name="validate-birth-date" object-name="PersonObject"
       class="com.stc.eindex.user.BirthDate"/>
   </rules>
</ValidationConfig>