Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The default personDirectoryContext.xml includes JDBC beans to retrieve attributes for local uPortal usres users such as fragment owners.  Below is a real example of merging in additional attributes via the PersonDb DataSource.  This is essentially the configuration used in production at Yale.  Note that this configuration uses the support for mapping a column to multiple uPortal attribute names.

Since we want to merge attributes from our JDBC source with other attributes we start by adding a reference to our new bean (myunivCachingPersonDbJdbcAttributeSource) to the merging DAOs section.

Code Block
langxml
    <!-- ********** Data source attribute DAOs **********-->
    <!--
     | Merging DAOs that define the order that the data providing DAOs are called, results are cached by the outer
     | caching DAO
     +-->
    <bean id="cachingMergedPersonAttributeDao" class="org.jasig.services.persondir.support.CachingPersonAttributeDaoImpl">
        <property name="usernameAttributeProvider" ref="usernameAttributeProvider" />
        <property name="cacheNullResults" value="true" />
        <property name="userInfoCache">
            <bean class="org.jasig.portal.utils.cache.MapCacheFactoryBean">
                <property name="cacheFactory" ref="cacheFactory" />
                <property name="cacheName" value="org.jasig.services.persondir.USER_INFO.merged" />
            </bean>
        </property>
        <property name="cacheKeyGenerator" ref="userAttributeCacheKeyGenerator" />
        <property name="cachedPersonAttributesDao" >
            <bean class="org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl">
                <property name="usernameAttributeProvider" ref="usernameAttributeProvider" />
                <property name="merger">
                    <bean class="org.jasig.services.persondir.support.merger.ReplacingAttributeAdder" />
                </property>
                <property name="personAttributeDaos">
                    <list>
                        <ref bean="cachinguPortalJdbcAttributeSource"/>
                        <ref bean="cachinguPortalJdbcUserSource"/>
                        <ref bean="myunivCachingPersonDbJdbcAttributeSource"/><!-- **** ADDED HERE **** -->
                    </list>
                </property>
            </bean>
        </property>
    </bean>

...