Dynamic Mapper
Overview
The dynamic mapper is used to dynamically add categories, keywords, and groups to an end user.s information. This can be useful when the designer of the site wants to programmatically add or append a list of categories, keywords, or groups to the user depending on the user.s information.
The dynamic mapper could potentially be extended to connect to connect to third party systems, such as an LDAP server to retrieve cateogory, keyword and group information.
The sample implementation can be found in...
<WCM Home>/samples/DynamicMapperThis implementation shows how to pull categories, keywords, and groups for a specific user from a properties file named attributemapping.properties. When a user logs in, the SampleWCMSessionListener is accessed. If a Portal User exists in the session, then the username is retrieved and the categories, keywords, and groups are retrieved by the keys <username>_CATEGORY, <username>_KEYWORD, and <username>_GROUP. To add multiple values, delimit the list with a comma. Once the lists are retrieved for the user from attributemappings.properties, the lists are added to the User.s information.
Setup
- Add the ilwwcm-sample-sessionlistener.jar to the WcmLib shared library:
- Copy the ilwwcm-sample-sessionlistener.jar from...
<WCM Home>/samples to <WCM Home>/shared/app- Access the WebSphere® Administrative Console
- Navigate to Environment->Shared Libraries.
- Select WcmLib
- Add an entry using the full path to the ilwwcm-sample-sessionlistener.jar
- Save and apply the changes
- Add the attributemappings.properties to the classpath
cp <WCM Home>/ samples/DynamicMapper/config <WCM Home>/shared/app- Update the WebSphere® Portal Enterprise Application by editing...
<WAS Home>/config/cells/<cell name>/applications/wps.ear/deployments/wps/wps.war/WEB-INF/web.xml- Add the following tag below the other listener tags and above the servlet tag.
<listener id="SampleWCMSessionListener"> <listener-class> com.ibm.workplace.wcm.sample.dynamicmapper.SampleWCMSessionListener </listener-class> </listener>- Save the web.xml
- Restart the Server
® WebSphere is a trademark of the IBM® Corporation in the United States, other countries, or both.
® IBM is a trademark of the IBM Corporation in the United States, other countries, or both.