Configuring Sun Master Indexes

ProcedureTo Implement a Validation Rule

  1. Create the custom validation rules  in the Source Package folder of the EJB project.

  2. In the Projects window, expand the Configuration node in the project you want to modify, and then double-click validation.xml.

    The file opens in the NetBeans XML editor.

  3. Create a new rule element in the rules element.

  4. In the new rule element, create the following attributes:

    • name – A unique name for the validation rule.

    • object-name – The name of the master index Java class that defines the object to which the validation rule is applied, such as SystemObject or Parent_NameObject (where Parent_Name is the name of the parent object in the object definition)

    • class – The complete path of the Java class to call for the validation rule.

      For example:


      <ValidationConfig module-name="Validation" parser-class= 
       "com.sun.mdm.index.configurator.impl.validation.ValidationConfiguration"
         <rules>
            <rule name="validate-auxiliary-id" object-name="PersonObject"
             class="com.sun.mdm.index.user.AuxiliaryId"/>
            <rule name="validate-birth-date" object-name="PersonObject"
             class="com.sun.mdm.index.user.BirthDate"/>
         </rules>
      </ValidationConfig>
  5. Save and close the file.