Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<beans>
    <bean id="personDirectory"
        class="org.jasig.portal.services.persondir.support.LdapPersonAttributeDaoImpl">
        <property name="ldapAttributesToPortalAttributes">
            <map>
                <entry key="name">
                    <value>name</value>
                </entry>
                <entry key="shirt_color">
                    <value>shirtColor</value>
                </entry>
            </map>
        </property>
        <property name="ldapServer">
            <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
                <property name="staticMethod">
                   <value>org.jasig.portal.ldap.LdapServices.getLdapServer</value>
                </property>
                <property name="arguments">
                    <list>
                        <value>personLdap</value>
                    </list>
                </property>
            </bean>
        </property>
        <property name="uidQuery">
            <value>(cn={0})</value>
        </property>
    </bean>
</beans>

Request Attribute Filter Example

This example shows a use of the RequestAttributeSourceFilter to retrieve the serverName attribute.  In a real life scenario you would want to retrieve person attributes provided in the request.

Code Block
langxml
    <!--
     | Servlet filter that creates an attribute for the serverName
     +-->
    <bean id="requestAttributeSourceFilter" class="org.jasig.services.persondir.support.web.RequestAttributeSourceFilter">
        <property name="additionalDescriptors" ref="requestAdditionalDescriptors" />
        <property name="serverNameAttribute" value="serverName" />
        <property name="processingPosition" value="BOTH" />
    </bean>

Merging example

This would get pretty boring if we could only ever have one source of user attributes at a time. MergingPersonAttributeDaoImpl merges attributes from multiple sources.

...