Example: UserProfileExtendedSample.java

/* -----------------------------------------------------------------
** Copyright 1997-99 IBM Corporation.  All rights reserved.
**
** -----------------------------------------------------------------
*/
package com.ibm.servlet.personalization.userprofile;


import com.ibm.servlet.personalization.userprofile.UserProfile;
import com.ibm.websphere.userprofile.UserProfileExtender;


//Extensions of UserProfile to add new Columns should implement UserProfileExtender
public class UserProfileExtendedSample 
   extends com.ibm.servlet.personalization.userprofile.UserProfile 
   implements UserProfileExtender {

   //New column that is being added by this
   //derived class.
   public String cellPhone;

   //Manager Class will call this  method to append new Column types.
   //If UserProfile class is extended to append new columns
   //TOTAL COLUMNS: Base Class columns + columns returned by this class

   public  String[]  getNewColumns() {
      //If variable name is "cellPhone," you need to 
      //return "cellPhone" in array format. JDBC equivalent will be
      //generated automatically. You can add muliple columns.
      //For multiple columns: String newCol={"fieldName1","fieldName2",...};
      String[] newCol={"cellPhone"};
      return newCol;
   }

   public String getCellPhone() {
      // Need to call this method to
      // get the things from persistence store.
      return(String)getByType("cellPhone");
   }
    
   public  void setCellPhone(String value) {
      cellPhone = value;
      //Call this method to store the
      //things in persistence store
      setByType("cellPhone", value); 
   }
}

Related tasks
Using user profiles
Related reference
User profile development options



Searchable topic ID:   UserProfileExtendedSample_java
Last updated: Jun 21, 2007 4:55:42 PM CDT    WebSphere Application Server Network Deployment, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rprs_user_profile_extended_sample_java.html

Library | Support | Terms of Use | Feedback