Versions Compared

Key

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

...

PersonDirectory as API

The basic class for a uPotal user is an implementation of the IPerson object. The uPortal Person Directory Service is provided by the is used to populate and retrieve user attributes.  Person Directory is maintained as a separate source project PersonDirectory.  uPortal 3.2 provides the single class, PersonDirectory, to obtain an instance of IPersonAttributeDaoIPersonAttributeDao is configured by Spring to acquire attributes for a person.  Attributes can be acquired from multiple sources via LDAP, JDBC or other sources as required.

...

Code Block
IPersonAttributeDao dao = PersonDirectory.getPersonAttributeDaoInstance();
Map userAttributes = dao.getUserAttributes(UserID);
IPerson person = PersonFactory.createPerson();
person.setAttributes(userAttributes);

PersonDirectory as configurable facility

PersonDirectory is a uPortal customization point.

The standard Below is a description of the default Person Directory configuration.  See JDBC User Attribute Sources and LDAP User Attribute Sources for examples of setting additional attributes via JDBC and LDAP.

Configuring PersonDirectory

PersonDirectory is a uPortal customization point.

The standard recommended approach to customizing PersonDirectory is to modify the PersonDirectory Spring context.  It is also still possible to replace the name of the class in personDirectoryContext.xml and supply an entirely custom implementation.  If you have a legacy implementation from a previous version of uPortal, this may be an attractive option.

...

PersonDirectory is implemented using Spring. Currently a Spring beans.dtd-compliant XML file named personDirectoryContext.xml declares the configuration of an instance of IPersonAttributeDao. The class PersonDirectory delegates to this Spring-configured IPersonAttributeDao instance to actually implement the PersonDirectory behavior. PersonDirectory uses PortalApplicationContextFacade to access the the uPortal Spring application context.

JDBC Example

For examples, visit the page dedicated to JDBC User Attribute Sources.

LDAP example

In this example we implement IPersonAttributeDao using an LdapPersonAttributeDaoImpl.

Here we use the ILdapServer named "personLdap" managed by LdapServices. We configure the map from LDAP attribute names to uPortal attribute names and the query we'll use to look up the user. Advanced configuration allows mapping LDAP attribute names to multiple uPortal attribute names.

...

the the uPortal Spring application context.

JDBC Example

For examples, visit the page dedicated to JDBC User Attribute Sources.

LDAP example

Request Attribute Filter Example

...

Warning
titleNot Recommended

Although not recommended it is possible to change the class name in the personDirectory.xml beans declaration to be a custom class of your choice, so long as it implements IPersonAttributeDao. You could then write a custom implementation that does exactly the queries, caching, and any other behavior you need.
<beans>
<!-- notice that the bean's class has changed -->
<bean id="personAttributeDao">
<!-- if you're implementing all your configuration directly in the Java, you need not
add any properties here -->
</bean>
</beans>