前のトピック: ディレクトリ レベル検証の設定方法次のトピック: 検証ルール セットと管理対象オブジェクト属性との関連付け


ディレクトリ レベル検証のCA Identity Manager との統合

directory.xml ファイルの ImsManagedObjectAttrValidation エレメントによって、CA Identity Manager への検証ルールおよびルール セットを定義します。

ImsManagedObjectAttrValidation エレメントのスキーマは以下のとおりです。

<xs:element name="ImsManagedObjectAttrValidation" minOccurs="0">
   <xs:complexType>
      <xs:sequence>
         <xs:element name="ValidationRule" minOccurs="0"
                                            maxOccurs="unbounded">
            <xs:complexType>
               <xs:choice>
                  <xs:element name="Java">
                     <xs:complexType>
                        <xs:attribute name="class" type="xs:string"
                                                  use="required"/>
                     </xs:complexType>
                            </xs:element>
                  <xs:element name="JavaScript">
                     <xs:complexType>
                        <xs:simpleContent>
                           <xs:extension base="xs:string"/>
                        </xs:simpleContent>
                     </xs:complexType>
                  </xs:element>
                  <xs:element name="JavaScriptFile">
                     <xs:complexType>
                   <xs:attribute name="file" type="xs:string"
                                                use="required"/>
                     </xs:complexType>
                  </xs:element>
                  <xs:element name="RegularExpression">
                     <xs:complexType>
                        <xs:simpleContent>
                           <xs:extension base="xs:string"/>
                        </xs:simpleContent>
                     </xs:complexType>
                  </xs:element>
               </xs:choice>
               <xs:attribute name="name" type="xs:string"
                                                  use="required"/>
               <xs:attribute name="description" type="xs:string"
                                                  use="optional"/>
               <xs:attribute name="messageid" type="xs:string"
                                                  use="required"/>
            </xs:complexType>
         </xs:element>
         <xs:element name="ValidationRuleSet" minOccurs="0"
                                            maxOccurs="unbounded">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="ValidationRule"
                                            maxOccurs="unbounded">
                     <xs:complexType>
                        <xs:attribute name="name" type="xs:string"
                                                  use="required"/>
                     </xs:complexType>
                  </xs:element>
               </xs:sequence>
               <xs:attribute name="name" type="xs:string"
                                                  use="required"/>
               <xs:attribute name="description" type="xs:string"
                                                  use="optional"/>
            </xs:complexType>
         </xs:element>
      </xs:sequence>
   </xs:complexType>
</xs:element>

以下のエレメントが定義されています。

ValidationRuleSet

1 つ以上の事前定義済み検証ルールまたはカスタム検証ルールで構成されます。 検証ルールは ValidationRule エレメントに指定されます。

事前定義済みルールおよびカスタム ルールは、同じルール セットに存在させることができます。 またルール セットには、Java、JavaScript および正規表現実装の組み合わせのいずれも含めることができます。

検証ルールは、ValidationRuleSet に表れる順序で実行されます。 これにより、1 つのルールからの出力を次のルールの入力として使用し、検証をカスケードできます。

ValidationRuleSet は、directory.xml ファイルの ImsManagedObjectAttr エレメントの管理対象オブジェクト属性と関連付けられます。

ValidationRule

ValidationRuleSet で使用される検証ルールを指定します。

ValidationRule に含まれるのは以下のいずれかのサブエレメントのみとする必要があります。

キー属性

これまでに記載されたエレメントの属性の大半は説明不要です。 ただし、以下の属性には説明が必要です。

例: インライン正規表現

以下の例では事前定義済み[電話]パターン検証ルールを示します。これはルール セット[電話]形式に含まれています。 ルールは  正規表現としてインラインで実装されます。

<ValidationRule name="Phone pattern" description="+nn nnn-nnn-nnnn"
                                                 messageid="4001">
   <RegularExpression>
      <![CDATA[ ((\+|\d)*+(\s*|\x2D))?\d\d\d-\d\d\d-\d\d\d\d]]>
   </RegularExpression>
</ValidationRule>
<ValidationRuleSet name="Phone format" description=
                                 "Verify format +nn nnn-nnn-nnnn">
   <ValidationRule name="Phone pattern" />
</ValidationRuleSet>

上記の例で、messageid="4001" は IMSExceptions.properties の以下の行にマッピングされます。

4001=属性の検証: {0} 値が正規表現と一致する必要があります。
                                                     nnn-nnn-nnnn.

例: JavaScript ファイルの参照

以下の例では、ルール EndWithZ_js が指定されます。 このルールは JavaScript で実装されます。また、スクリプトはファイル EndWithZ.js にあります。  ルールが含まれるルール セットは、例に示されていません。

<ValidationRule name="EndWithZ_js" messageid="custom-5001">
   <JavaScriptFile file="EndWithZ.js" />
</ValidationRule>

上記の例で、JavaScript ファイルは以下のデフォルトの場所にあると想定されます。

iam_im.ear\custom\validationscripts