Administer > Manage instances > WCS instance > Configure directory services (LDAP) with Commerce > Replication for LDAP


ldapentry.xml

To configure attributes that are synchronized between the LDAP server and the IBM WebSphere Commerce database, configure:

...which is configured to use an LDAP server as the master profile repository for users and organizations. Commerce interacts with the LDAP server using WebSphere Application Server's federated repository, implemented using Virtual Member Manager (VMM).

The ldapentry.xml file provides the mapping between commerce attributes and VMM attributes, to sychronize data between commerce database and LDAP. This mapping file provides a default mapping for the most commonly used attributes. The attributes can be customized.

Check wc-server.xml to verify which ldapentry file is being used:

Additional information can be found at the following resources:


Sample data in the ldapentry.xml file:

<?xml version="1.0"?> 
<!DOCTYPE ldapentry SYSTEM "ldapentry.dtd"> 
<ldapentry> 
    <entry entryName="User"> 
    <ldapsetting> 
        <ldaprdn rdnName="uid" 
                 keyAttrName="logonId" 
                 keyObjName="UserRegistry"/> 
    </ldapsetting> 
    <ldapmap> 
        <map> 
            <objectAttribute attrName="logonPassword"/>
            <ldapAttribute name="password" 
                           operation="replace" 
                           flow="wcsToLdap"/>
            </map> 
        <map> 
            <objectAttribute attrName="lastName"/> 
            <objectAttribute attrName="firstName"/> 
            <objectSeparator attrSeparator="/"/> 
            <ldapAttribute name="cn" 
                           operation="replace" 
                           flow="wcsToLdap"/> 
        </map> 
        <map> 
            <objectAttribute attrName="lastName"/> 
            <ldapAttribute name="sn" 
                           operation="replace" 
                           flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="firstName"/> 
            <ldapAttribute name="givenName" 
                           operation="replace" 
                           flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="phone1"/> 
            <ldapAttribute name="homePhone" 
                           operation="add" 
                           flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="email1"/> 
            <ldapAttribute name="mail" 
                           operation="replace" 
                           flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="zipCode"/> 
            <ldapAttribute name="postalCode" 
                           operation="replace" 
                           flow="bothDirections"/> 
            </map> 
        <map> 
            <objectAttribute attrName="address1" size="50"/> 
            <objectAttribute attrName="address2" size="50"/> 
            <objectAttribute attrName="address3" size="50"/> 
            <objectSeparator attrSeparator="/"/> 
            <ldapAttribute name="postalAddress" 
                           operation="replace" 
                           flow="bothDirections"/> 
        </map> 
    </ldapmap> 
</entry> 
<entry entryName="Organization"> 
    <ldapsetting> 
                 
    <ldaprdn rdnName="o" keyAttrName="orgEntityName" keyObjName="Organization"/> 
    </ldapsetting> 
    <ldapmap> 
        <map> 
            <objectAttribute attrName="businessCategory"/> 
            <ldapAttribute name="businessCategory" operation="replace" flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="description"/> 
            <ldapAttribute name="description" operation="replace" flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="address1" size="50"/> 
            <objectAttribute attrName="address2" size="50"/> 
            <objectAttribute attrName="address3" size="50"/> 
            <objectSeparator attrSeparator="/"/> 
            <ldapAttribute name="postalAddress" 
                           operation="replace" 
                           flow="bothDirections"/> 
        </map> 
        <map> 
            <objectAttribute attrName="phone1"/> 
            <ldapAttribute name="telephoneNumber"
                            operation="add"
                            flow="bothDirections"/> 
        </map> 
        </ldapmap> 
    </entry> 
<entry entryName="OrganizationalUnit"> 
<ldapsetting> 
             <ldaprdn rdnName="ou"
                      keyAttrName="orgEntityName"
                      keyObjName="Organization"/>
          </ldapsetting>
      <ldapmap>
         <map>
            <objectAttribute attrName="businessCategory"/>
            <ldapAttribute name="businessCategory"
                           operation="replace"
                           flow="bothDirections"/>
         </map>
         <map> 
<objectAttribute attrName="description"/> 
<ldapAttribute name="description"
               operation="replace" 
               flow="bothDirections"/> 
</map> 
<map> 
<objectAttribute attrName="address1" size="50"/> 
<objectAttribute attrName="address2" size="50"/> 
<objectAttribute attrName="address3" size="50"/> 
<objectSeparator attrSeparator="/"/> 
<ldapAttribute name="postalAddress"
               operation="replace"
               flow="bothDirections"/> 
</map> 
<map> 
<objectAttribute attrName="phone1"/> 
<ldapAttribute name="telephoneNumber"
               operation="add"
               flow="bothDirections"/> 
</map> 
</ldapmap> 
</entry> 
</ldapentry> 

The format of the ldapentry.xml is...


Synchronization of multi-valued LDAP attributes to the MBRATTRVAL table

The MBRATTRVAL table is used for storing custom member attributes. The table can store multiple values (rows) for a single attribute and user. LDAP can handle multivalued attributes.

For example:

<map>
     
<objectAttribute attrName="JobFunction_10001_r_n"/>
     
<ldapAttribute name="telephoneNumber" operation="replace" flow="bothDirections"/>

</map> 

Original mapping:

<!--
<map>
     
<objectAttribute attrName="phone1"/>
     
<ldapAttribute name="telephoneNumber" operation="add" flow="bothDirections"/>

</map>
 -->

The telephoneNumber VMM attribute maps to the JobFunction_10001_r_n commerce attribute. This commerce attribute, based on the naming convention, is a custom member attribute, whose values are stored in the MBRATTRVAL table. Note that the member attribute name ends with _n to indicate that it is multivalued.

If there are multiple values in the MBRATTRVAL table, they are synchronized over to multiple values in LDAP. Conversely, if there are multiple values in LDAP, they are synchronized to multiple rows in the MBRATTRVAL table.

The following URL is an example of how to add or update two JobFunction values for the current user:

https://localhost/webapp/wcs/stores/servlet/UserRegistrationUpdate?storeId=10101&catalogId=10101&langId=-1
&editRegistration=Y&JobFunction_10101_r_1=manager&JobFunction_10101_r_2=clerk&URL=UserRegistrationForm

Note the two occurrences of JobFunction updates in the URL string. The first being JobFunction_10101_r_1 for manager and the second being JobFunction_10101_r_2 for clerk.


+

Search Tips   |   Advanced Search