public class AddressBookDataBean extends AddressBookAccessBean implements com.ibm.commerce.user.beans.AddressBookInputDataBean, com.ibm.commerce.user.beans.AddressBookSmartDataBean, Delegator
The AddressBookAccessBean will automatically get userId from commandContext. Users can use the getAddressList() method to get a list of all the addresses that belong to this user. The getAddressBookProperties() method returns a hashtable containing the information in the AddressBook property file.
Usage:
For example:
AddressBookDataBean dbAddressBook = new AddressBookDataBean();
dbAddressBook.setCommandContext(commandContext);
// optional
dbAddressBook.setMemberId(strMemberId);
OR
dbAddressBook.setUserId(strUserId);
Note that the setMemberId()/setUserId() method will always override
the userId in the command context.
example: to get the list of AddressDataBeans for this member
AddressDataBean[] arrAddressBeans =
dbAddressBook.getAddressDataBeansList();
example: to get the list of addressId/nickname pairs
dbAddressBook.populate();
String[][] arrAddressList =
dbAddressBook.getAddressList();
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASSNAME
The fully qualified name of this class.
|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
emptyString| Constructor and Description |
|---|
AddressBookDataBean()
AddressBookDataBean default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Enumeration |
getAddressAccessBeans()
Gets an Enumeration of all AddressAccessBeans belonging to this
member.
|
AddressAccessBean[] |
getAddressAccessBeansList()
Returns an AddressAccessBean array which contains all
AddressAccessbeans belonging to this member.
|
AddressDataBean[] |
getAddressDataBeansList()
Returns an AddressDataBeanarray which contains all AddressDatabeans that
belong to this member.
|
java.lang.String[][] |
getAddressList()
Returns a two dimensional array which contains all addresses belonging
to this member.
First column of the array: Address Ids Second column of the array: Address Nicknames + address type + * (if this address is primary) |
CommandContext |
getCommandContext()
Returns the command's context within this bean.
|
Protectable |
getDelegate()
Returns the Protectable object whose access control policies will
indirectly control the access control for this object
|
int |
getNumberOfAddresses()
Returns the number of addresses in the address book
|
TypedProperty |
getRequestProperties()
Returns the request properties.
|
java.lang.String |
getStoreDirectory()
Gets the name of the store directory, which is used in the
getUserRegistrationProperties() method for the path to the property file.
|
void |
populate()
Fetches and populates information needed by the bean.
|
void |
setCommandContext(CommandContext acommandContext)
Sets the command context.
|
void |
setMemberId(java.lang.Long anMemberId)
Sets the MemberId.
|
void |
setMemberId(java.lang.String astrMemberId)
Sets the MemberId.
|
void |
setRequestProperties(TypedProperty requestProperties)
Sets the request properties.
|
void |
setStoreDirectory(java.lang.String astrStoreDirectory)
Sets the name of store directory, which is used as the path to
the find the property file in the getAddressBookProperties() method.
|
void |
setUserId(java.lang.Long anUserId)
Sets the UserId.
|
void |
setUserId(java.lang.String astrUserId)
Sets the UserId.
|
findByMemberId, getAddressBookId, getAddressBookIdInEntityType, getDescription, getDisplayName, getEntity, getMemberId, getMemberIdInEntityType, getType, instantiateEntity, setDescription, setDisplayName, setInitKey_addressBookId, setInitKey_addressBookId, setTypepublic static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public AddressBookDataBean()
public java.util.Enumeration getAddressAccessBeans()
getAddressAccessBeans in interface com.ibm.commerce.user.beans.AddressBookSmartDataBeanpublic java.lang.String[][] getAddressList()
getAddressList in interface com.ibm.commerce.user.beans.AddressBookSmartDataBeanpublic CommandContext getCommandContext()
getCommandContext in interface SmartDataBeanpublic Protectable getDelegate()
getDelegate in interface Delegatorjava.lang.Exceptionpublic TypedProperty getRequestProperties()
getRequestProperties in interface InputDataBeanpublic java.lang.String getStoreDirectory()
getStoreDirectory in interface com.ibm.commerce.user.beans.AddressBookSmartDataBeanpublic void populate()
populate in interface SmartDataBeanjava.lang.Exception - Any exception thrown during the populating
of the beanpublic void setCommandContext(CommandContext acommandContext)
setCommandContext in interface SmartDataBeanaCommandContext - The command context.public void setMemberId(java.lang.Long anMemberId)
setMemberId in class AddressBookAccessBeananMemberId - The member Idpublic void setMemberId(java.lang.String astrMemberId)
setMemberId in class AddressBookAccessBeanastrMemberId - The member Idpublic void setRequestProperties(TypedProperty requestProperties)
setRequestProperties in interface InputDataBeanrequestProperties - The request properties.public void setStoreDirectory(java.lang.String astrStoreDirectory)
setStoreDirectory in interface com.ibm.commerce.user.beans.AddressBookInputDataBeanastrStoreDirectory - The name of store directorypublic void setUserId(java.lang.Long anUserId)
setUserId in interface com.ibm.commerce.user.beans.AddressBookInputDataBeananUserId - The User Idpublic void setUserId(java.lang.String astrUserId)
setUserId in interface com.ibm.commerce.user.beans.AddressBookInputDataBeanastrUserId - The User Idpublic AddressAccessBean[] getAddressAccessBeansList()
getAddressAccessBeansList in interface com.ibm.commerce.user.beans.AddressBookSmartDataBeanpublic AddressDataBean[] getAddressDataBeansList()
public int getNumberOfAddresses()