com.ibm.websphere.userprofile
Interface UserProfileExtender


public interface UserProfileExtender


For adding new columns by extending datawrapper com.ibm.servlet.personalization.userprofile.UserProfile should implement this interface. For Example, for adding two columns "cellPhone" and "bankAccount" code will be:

            public class UserProfileExtendedSample extends 
               com.ibm.servlet.personalization.userprofile.UserProfile implements
                UserProfileExtender {
                
                String cellPhone;
                String bankAccount; 

                public String[] getNewColumns(){
                    //return field names you want to add to base userprofile
                    //implementation.
                    //Manager class will retrospect the specified fields 
                    //in this class and maps to equivalent JDBC types.
                    String str = {"cellPhone","bankAccount"};
                     return str
               
                }

               public String getCellPhone() {
              
                  // Need to call this method in base class to
                  // get the things from persistence store.
                  return(String)getByType("cellPhone"); 
              }


              public  void setCellPhone(String value) {
                  cellPhone = value;

                  //Call this method in base class to store the
                  //things in persistence store
                  setByType("cellPhone", value); 
              }

            //Similarly for other field
               ......
                .
                .
                .
                .
              
    } 


Method Summary
 java.lang.String[] getNewColumns()
          For adding new columns by extending Userprofile, need to implement this method.
 

Method Detail

getNewColumns

public java.lang.String[] getNewColumns()
For adding new columns by extending Userprofile, need to implement this method. This method should return field names user wants to add to base userprofile implementation.
In addtion to implementing this method, any class extending com.ibm.servlet.personalization.userprofile.UserProfile should call the following methods in com.ibm.servlet.personalization.userprofile.UserProfile within the getters and setters of the columns that are added:
public void setByType(String name, Object value);
public Object getByType(String name);

db2 mapping of fields used is as follows:
java.lang.String - VARCHAR(64)
boolean - SMALLINT
short - SMALLINT
int - INTEGER
long - VARCHAR(22)
float - FLOAT
double - DOUBLE
byte - SMALLINT
char - CHAR(1)
java.lang.Boolean - SMALLINT
java.lang.Short - SMALLINT
java.lang.Integer - INTEGER
java.lang.Long - VARCHAR(22)
java.lang.Float - FLOAT
java.lang.Double - DOUBLE
java.lang.Character - CHAR(1)
java.lang.Byte - SMALLINT
java.lang.BigDecimal - NUMERIC
java.sql.Date - DATE
java.sql.Time - TIME
java.sql.Timestamp - TIMESTAMP
Others - BLOB(64k)

Returns:
Array of fields names to add to base userprofile fields.


 

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.