LDAP 変換ファイルの適合

LDAP 変換 XSL ファイルを LDAP スキーマに適合させる方法について説明します。

デフォルトの LDAPTransformation.xsl ファイルは、WebSphere が前提とするデフォルトの LDAP スキーマのエレメントを使用する LDAP 照会に、事前定義のスタッフ動詞をマップします。 このスキーマでは、以下のことを前提にしています。
ご使用の LDAP スキーマに、異なるオブジェクト・クラスや属性名がある場合は、LDAP 変換ファイル内でこれらの設定を変更する必要があります。 デフォルトの LDAPTransformation.xsl ファイルの場合は、設定の変更を以下に示すファイルの変数宣言部分で実行できます。
  <xsl:variable name="DefaultGroupClass">groupOfNames</xsl:variable>
  <xsl:variable name="DefaultGroupClassMemberAttribute">member</xsl:variable>
  
  <xsl:variable name="DefaultPersonClass">inetOrgPerson</xsl:variable>
  <xsl:variable name="DefaultUserIDAttribute">uid</xsl:variable>
  <xsl:variable name="DefaultMailAttribute">mail</xsl:variable>  
  <xsl:variable name="DefaultManagerAttribute">manager</xsl:variable>

以下の例に示すように、個々のスタッフ動詞を変換する XSL テンプレート内で変更を適用できます。

例: DepartmentMembers

個人項目のオブジェクト・クラスを ePerson に変更、ログイン ID 属性を cn に変更
<sldap:StaffQueries>
  <xsl:attribute name="threshold">
    <xsl:value-of select="$Threshold">
  </xsl:attribute>

  <sldap:search>
...
    <sldap:attribute>
      <xsl:attribute name="name">cn</xsl:attribute>
      <xsl:attribute name="objectclass">ePerson</xsl:attribute>
      <xsl:attribute name="usage">simple</xsl:attribute>
    </sldap:attribute>

  </sldap:search>
</sldap:StaffQueries>

例: GroupMembers

グループ項目のオブジェクト・クラスを groupOfUniqueNames に変更、メンバーの DN リストを含むグループ項目属性を uniqueMember に変更、ログイン ID を含む個人項目属性を cn に変更
<sldap:usersOfGroup>
...

  <sldap:attribute>
    <xsl:attribute name="name">uniqueMember</xsl:attribute>
    <xsl:attribute name="objectclass">groupOfUniqueNames</xsl:attribute>
    <xsl:attribute name="usage">recursive</xsl:attribute>
  </sldap:attribute>

  ...
  <sldap:attribute>
    <xsl:attribute name="name">cn</xsl:attribute>
    <xsl:attribute name="objectclass">inetOrgPerson</xsl:attribute>
    <xsl:attribute name="usage">simple</xsl:attribute>
  </sldap:attribute>

</sldap:usersOfGroup>

例: GroupMembersWithoutFilteredUsers

LDAP フィルター演算子を >= に変更
<sldap:StaffQueries>
  <sldap:usersOfGroup>
    ...
  </sldap:usersOfGroup>

  <sldap:intermediateResult>
    <xsl:attribute name="name">filteredusers</xsl:attribute>
    <sldap:search>
      <xsl:attribute name="filter">
        <xsl:value-of select="staff:parameter[@id='FilterAttribute']"/>
         >=
        <xsl:value-of select="staff:parameter[@id='FilterValue']"/>
      </xsl:attribute>
     ...
    <sldap:search>
     ...
    
  </sldap:intermediateResult>
   ...
</sldap:StaffQueries>

例: GroupSearch

検索属性を MyType に変更、オブジェクト・クラスを mypersonclass に変更、ログイン ID を含む属性を myuid に変更
<sldap:StaffQueries>
 ...
  <sldap:search>
    <xsl:attribute name="filter">
      (&amp;
       ...
      <xsl:if test="staff:parameter[@id='MyType']!="">
       (<xsl:value-of select="$GS_Type"/>=
        <xsl:value-of select=staff:parameter[@id='Type']"/>)
      </xsl:if>
      )
       ...
    </xsl:attribute>

    <sldap:attribute>
      <xsl:attribute name="name">myuid</xsl:attribute>
      <xsl:attribute name="objectclass">mypersonclass</xsl:attribute>
      <xsl:attribute name="usage">simple</xsl:attribute>
    </sldap:attribute>
     ...
  <sldap:search>
</sldap:StaffQueries>

例: 従業員の管理者

管理者 DN を含む属性を managerentry に変更、管理者ログイン ID 属性のソースを name に変更
<sldap:StaffQueries>
 
  <sldap:intermediateResult>
   ...
    <sldap:user>
     ...
      <xsl:attribute name="name">managerentry</xsl:attribute>
       ...
     </sldap:user>
   </sldap:intermediateResult>

  <sldap:user>
   ...
    <xsl:attribute name="name">name</xsl:attribute>
     ...
  </sldap:user>
</sldap:StaffQueries>

例: PersonSearch

検索属性を MyAttribute に変更、オブジェクト・クラスを mypersonclass に変更、戻り属性のソースを myuid に変更
<sldap:StaffQueries>
 ...
  <sldap:search>
    <xsl:attribute name="filter">
      (&amp;
       ...
      <xsl:if test="staff:parameter[@id='MyAttribute']!="">
       (<xsl:value-of select="$PS_UserID"/>=
        <xsl:value-of select=staff:parameter[@id='UserID']"/>)
      )
      </xsl:if>
       ...
    </xsl:attribute>

    <sldap:attribute>
      <xsl:attribute name="name">myuid</xsl:attribute>
      <xsl:attribute name="objectclass">mypersonclass</xsl:attribute>
      <xsl:attribute name="usage">simple</xsl:attribute>
    </sldap:attribute>
     ...
  </sldap:search>
</sldap:StaffQueries>

例: Users

戻り属性のソースを myuid に変更、オブジェクト・クラスを mypersonclass に変更
<sldap:user>
 ...
  <xsl:attribute name="attribute">myuid</xsl:attribute>
  <xsl:attribute name="objectclass">mypersonclass</xsl:attribute>
</sldap:user>

(c) Copyright IBM Corporation 2005, 2006. All rights reserved.
(c) Copyright IBM Japan 2006
このインフォメーション・センターでは、Eclipse テクノロジー (http://www.eclipse.org) が採用されています。