![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
User Management Guide
CHAPTER 7
This chapter describes how to manage user profiles. It contains the following sections:
The purpose of the User subsystem is the profiling of Web application users. User profiles are persistent collections of data associated with individual users of a Web application. Individual data items within a user profile are called attributes. Your exteNd Director application can obtain attributes and store the information in a profile. Later it can retrieve, act upon, and analyze the information.
For more information, see Accessing User Attributes.
Typically, profiles are used for two general purposes:
A portal application might rely on the information in the user profile to determine what content can or should be delivered to a given user or what operations can be performed.
In a retail business, for example, a profile for a customer could contain:
Account information such as shipping and billing address, e-mail address, age, gender, occupation, credit card information, and so on
User-specified areas of interest, such as product categories
Feature and page layout preferences other than those provided by the Portal subsystem
Login history, pages viewed, links and buttons clicked, and transactions made (items bought and processes started)
Profiles are stored differently depending on whether you are using a non-LDAP or an LDAP realm. Here are the main differences:
exteNd Director allows you to reconfigure an application to use a different authentication realm. If you need this kind of flexibility, you can write code that is general enough to work with both LDAP and non-LDAP realms.
To find out whether or not your application is configured for an LDAP realm, use:
EboUserHelper.getUserDataStore()
This method returns a string value indicating whether the User subsystem uses JNDI (LDAP directory) or JDBC (application database).
To find out whether or not your application is configured for a writable realm, use:
EboUserHelper.isReadOnlyUserSchema()
This method returns a boolean value indicating whether or not the User service schema is modifiable. A JDBC schema can be readable or writable, but a JNDI schema is not modifiable within exteNd Director.
The New User portlet is one of the core portlets used in the custom Web application. It allows anonymous users to add themselves to the writable realm and automatically creates a profile for each new user.
The New User portlet is provided as a template for your application. You can copy and customize it or design a new one:
The New User portlet does the following:
Adds a user name and password to the writable realm (if enabled)
Creates a user profile identified by the combination of the user's realm name and an automatically generated 32-bit UUID
The sources for this portlet are located in your exteNd installation directory at: Director/templates/TemplateResources/portal-core-resource.
The User API provides methods to create profiles, find profiles, and store and retrieve user-specific information. These are the key classes for user profiling:
Accessing profiles using the DAC You can also use the Director Administration Console (DAC) to access user attributes. For more information, see Using the Profiles Section of the DAC.
This code shows how the New User portlet adds a user profile:
// // Get a profile delegate from the user service. // EbiUserDelegate userDelegate = com.sssw.fw.usermgr.client.EboFactory.getUserDelegate(); // // Instantiate an empty profile object for this user. // EbiUserInfo userInfo = (EbiUserInfo)userDelegate.createUserInfo(); // // Add profile info (default attributes) for the user. // userInfo.setUserID(m_uid); userInfo.setUserFirstName(m_firstName); userInfo.setUserLastName(m_lastName); userInfo.setUserEmailAddress(m_email); userInfo.setUserAuthenticatedRealmName (dirService.getPrimaryRealmName()); // // Add the new profile. // boolean status = userDelegate.createUser(context, userInfo);
The User API includes user query and user metadata query classes that you can implement to retrieve a list of user profiles that meet certain criteria.
For more information, see EbiUserQuery and EbiJndiQuery in the API Reference.
This code shows how to obtain and display a user profile:
import com.sssw.fw.usermgr.api.*; import com.sssw.fw.usermgr.client.*; try { // // Get the user identifier. // String userUUID = EboUserHelper.getUserUUID(context); // // Get a user delegate object from the factory. // EbiUserDelegate userDelegate = EboFactory.getUserDelegate(); // // Get a user info object. // EbiUserInfo userInfo = (EbiUserInfo)userDelegate. getUserInfoByUserUUID(context,userUUID); // // Get the registration info and add to output buffer. // sb.append("UserID: " + userInfo.getUserID() + "<br>"); sb.append("UserUUID: " + userInfo.getUserUUID() + "<br>"); sb.append("UserFirstName: " + userInfo.getUserFirstName() + "<br>"); sb.append("UserLastName: " + userInfo.getUserLastName() + "<br>"); sb.append("UserEmailAddress: " + userInfo.getUserEmailAddress() + "<br>"); } catch (EboFactoryException e) { sb.append( e.getMessage() ); } catch (EboSecurityException e) { sb.append( e.getMessage() ); }
If you are developing an application that implements profiling extensively, you should consider using exteNd Director's Rule subsystem. The following scenario suggests how rules can be applied to user profiling.
Suppose you have a retail Web site where you want to track the total amounts of customers' Web purchases and specify a threshold amount that triggers a special discount. Here is how you could use rules to develop this application:
Add a user attribute to track the amount—AllPurchasesAmt, for example.
In the Rule Editor, create a rule using the built-in CheckWhiteboard condition that allows you to check user profiles (through the ^attributename syntax). Enter a threshold amount and give it a key value—such as ^threshold. For the action section you can return a boolean or appropriate content.
Conditions and actions are available in the exteNd Director rules engine to interact with the User and Content Management subsystems (through the Content Query Action). This means you can easily implement personalization rules like this:
If "UserAge" > 35 AND "PortfolioTotal" > 30,000 Then Select Investing Documents Level 3 AND set "FinanceLevel" to "Gold"
Through exteNd Director's easy-to-use API, custom tag library, and rules engine conditions and actions, you can quickly deliver personalization services to users.
For more information about rules, see the chapter on how to use rules in the Rules Guide.
Copyright © 2003 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...