An IPersonAttributeDao implementation that maps from column names in the result of SQL query to uPortal attribute names.
Advanced configuration example
Here's an example of getting the DataSource via JDNI and mapping a single ResultSet column to multiple uPortal attribute names.
<beans> <!-- this is the key bean, with the special id "personAttributeDao" that PersonDirectory is looking for. --> <bean id="personAttributeDao" class="org.jasig.portal.services.persondir.support.JdbcPersonAttributeDaoImpl"> <!-- the JDBC implementation takes two arguments in its constructor. the first is a DataSource --> <constructor-arg> <!-- get the DataSource via JNDI --> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"><value>java:comp/env/jdbc/myDatasource</value></property> </bean> </constructor-arg> <!-- the second constructor argument to the JDBC implementation is the SQL query that will yield a single row. The ? will be replaced with the userid about whom we are querying --> <constructor-arg> <value>SELECT first_name, last_name FROM someschema.sometable WHERE uid = ?</value> </constructor-arg> <!-- the JDBC implementation has one other requirement: a Map from column names in the ResultSet to uPortal IPerson attribute names. Here we demonstrate mapping a single column to several attribute names --> <property name="columnsToAttributes"> <map> <entry key="first_name"> <set> <bean class="java.lang.String"> <constructor-arg> <value>firstName</value> </constructor-arg> </bean> <bean class="java.lang.String"> <constructor-arg> <value>givenName</value> </constructor-arg> </bean> </set> </entry> <entry key="last_name"> <set> <bean class="java.lang.String"> <constructor-arg> <value>lastName</value> </constructor-arg> </bean> <bean class="java.lang.String"> <constructor-arg> <value>familyName</value> </constructor-arg> </bean> </set> </entry> </map> </property> </bean> </beans>