com.sun.portal.wireless.taglibs.ab
Class ABContext

java.lang.Object
  extended bycom.sun.portal.wireless.taglibs.base.Context
      extended bycom.sun.portal.wireless.taglibs.ab.ABContext

public class ABContext
extends Context

Context class for tracking user state across multiple address book requests.

See Also:
Context, ContextCache, ABContextCache

Field Summary
static java.lang.String ASCENDING
          Represents the ascending sort order.
static java.lang.String CONTEXT_CACHE_CLASS_NAME
          The address book context cache class name.
static java.lang.String CONTEXT_CLASS_NAME
          The address book context class name.
static java.lang.String CONTEXT_TYPE
          The categorical type of this context.
static java.lang.String DESCENDING
          Represents the descending sort order.
static java.lang.String SSO_CONFIG_TYPE
           
 
Fields inherited from class com.sun.portal.wireless.taglibs.base.Context
charSetString, errorCode, parentContext, session, ssoAdapter, timezone
 
Constructor Summary
ABContext()
           
 
Method Summary
 Element getContact(int entryid)
          Gets a single contact at the specified index.
 java.util.List getContacts()
          Gets the contacts collection from this context.
static ABContext getContext(PageContext pageContext)
          Gets the address book context.
 java.util.List getEntries()
          Gets the entries collection from this context.
 Element getEntry(int entryid)
          Gets the address book entry at the specified index.
 Element getGroupmember(int entryid)
          Gets the group member at the specified index.
 java.util.List getGroupmembers()
          Gets the groupmembers collection from this context.
 Element getMemberchoice(int entryid)
          Gets the member choice at the specified index.
 java.util.List getMemberchoices()
          Gets the memberchoices collection from this context.
 int getNumContacts()
          Gets the number of elements in the contacts collection.
 int getNumEntries()
          Gets the number of elements in the entries collection.
 int getNumGroupmembers()
          Gets the number of elements in the groupmembers collection.
 int getNumMemberchoices()
          Gets the number of elements in the memberchoices collection.
 java.lang.String getPabLang()
          Gets the language for this personal address book.
 java.lang.String getSortBy()
          Gets the user-specified sort field for this context.
 java.lang.String getSortOrder()
          Gets the user-specified sort order for this context.
 void init(HttpServletRequest request, SSOToken session, SSOAdapter ssoAdapter)
          Initializes the Address Book context, given a specific SSOToken and SSOAdapter.
 boolean isContactsEmpty()
          Indicates whether or not the contacts collection is empty.
 boolean isEntriesEmpty()
          Indicates whether or not the entries collection is empty.
 boolean isGroupmembersEmpty()
          Indicates whether or not the groupmembers collection is empty.
 boolean isGroupSupported()
          Reports whether or not groups are supported bu this address book.
 boolean isMemberchoicesEmpty()
          Indicates whether or not the memberchoices collection is empty.
 void release()
          Releases resources used by this context.
 void setContacts(java.util.List res)
          Sets the contacts collection for this context.
 void setEntries(java.util.List res)
          Sets the entries collection for this context.
 void setGroupmembers(java.util.List res)
          Sets the groupmembers collection for this context.
 void setMemberchoices(java.util.List res)
          Sets the memberchoices collection for this context.
 void setNumContacts(int numContacts)
          Sets the number of elements in the contacts collection.
 void setNumEntries(int numEntries)
          Sets the number of elements in the entries collection.
 void setNumGroupmembers(int numGroupmembers)
          Sets the number of elements in the groupmembers collection.
 void setNumMemberchoices(int numMemberchoices)
          Sets the number of elements in the memberchoices collection.
 void ssoTokenChanged(SSOTokenEvent evt)
          Handles events from the Portal Session, and cleans up the context when the session goes invalid.
 
Methods inherited from class com.sun.portal.wireless.taglibs.base.Context
getAttributeSet, getAttributeString, getAttributeString, getCharset, getClientType, getConfigName, getContentType, getContext, getErrorCode, getLocale, getParentContext, getSession, getSessionID, getSSOAdapter, getTimeZone, getUserLocale, getUserLocaleString, init, setErrorCode, setParentContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCENDING

public static final java.lang.String DESCENDING
Represents the descending sort order.

See Also:
getSortOrder(), Constant Field Values

ASCENDING

public static final java.lang.String ASCENDING
Represents the ascending sort order.

See Also:
getSortOrder(), Constant Field Values

CONTEXT_CLASS_NAME

public static final java.lang.String CONTEXT_CLASS_NAME
The address book context class name. The value of this field is "com.sun.portal.wireless.taglibs.ab.ABContext"

See Also:
Constant Field Values

CONTEXT_CACHE_CLASS_NAME

public static final java.lang.String CONTEXT_CACHE_CLASS_NAME
The address book context cache class name. The value of this field is "com.sun.portal.wireless.taglibs.ab.ABContextCache"

See Also:
Constant Field Values

CONTEXT_TYPE

public static final java.lang.String CONTEXT_TYPE
The categorical type of this context. The value of this field is "abcontext".

See Also:
Constant Field Values

SSO_CONFIG_TYPE

public static final java.lang.String SSO_CONFIG_TYPE
See Also:
Constant Field Values

Constructor Detail

ABContext

public ABContext()
Method Detail

init

public void init(HttpServletRequest request,
                 SSOToken session,
                 SSOAdapter ssoAdapter)
          throws java.lang.Exception
Initializes the Address Book context, given a specific SSOToken and SSOAdapter. This method identifies and obtains the user's address book and corresponding ContactDB object.

Overrides:
init in class Context
Parameters:
request - the HTTP servlet request
session - the user's session
ssoAdapter - the SSOAdapter
Throws:
java.lang.Exception

getContext

public static ABContext getContext(PageContext pageContext)
                            throws java.lang.Exception
Gets the address book context.

Parameters:
pageContext - the current PageContext
Returns:
the address book context
Throws:
java.lang.Exception

getEntries

public java.util.List getEntries()
Gets the entries collection from this context. Each entry stored in this List is an Address Book API Element bean.

Returns:
the entries collection as a java.util.List
See Also:
getEntry(int), isEntriesEmpty(), setEntries(java.util.List)

setEntries

public void setEntries(java.util.List res)
Sets the entries collection for this context. Each entry stored in this List must be an Address Book API Element bean.

See Also:
getEntries(), getEntry(int), isEntriesEmpty()

getEntry

public Element getEntry(int entryid)
Gets the address book entry at the specified index.

Parameters:
entryid - the index of the entry to get
Returns:
the address book entry as an Address Book API Element bean, or null if the entries collection has not been set.
See Also:
getEntries(), setEntries(java.util.List), isEntriesEmpty()

isEntriesEmpty

public boolean isEntriesEmpty()
Indicates whether or not the entries collection is empty.

Returns:
true if empty, false if not

getNumEntries

public int getNumEntries()
Gets the number of elements in the entries collection.

Returns:
an int indicating the number of elements in the entries collection
See Also:
setNumEntries(int)

setNumEntries

public void setNumEntries(int numEntries)
Sets the number of elements in the entries collection.

Parameters:
numEntries - the number of entries
See Also:
getNumEntries()

getGroupmembers

public java.util.List getGroupmembers()
Gets the groupmembers collection from this context. Each entry stored in this List is an Address Book API Element bean.

Returns:
the groupmembers collection, as a java.util.List
See Also:
getGroupmember(int), setGroupmembers(java.util.List), getNumGroupmembers(), isGroupmembersEmpty()

setGroupmembers

public void setGroupmembers(java.util.List res)
Sets the groupmembers collection for this context. Each group member stored in this List must be an Address Book API Element bean.

See Also:
getGroupmembers(), getGroupmember(int), isGroupmembersEmpty()

getGroupmember

public Element getGroupmember(int entryid)
Gets the group member at the specified index.

Parameters:
entryid - the index of the group member to get
Returns:
the group member as an Address Book API Element bean, or null if the groupmembers collection has not been set.
See Also:
getGroupmembers(), setGroupmembers(java.util.List), isGroupmembersEmpty()

isGroupmembersEmpty

public boolean isGroupmembersEmpty()
Indicates whether or not the groupmembers collection is empty.

Returns:
true if empty, false if not

getNumGroupmembers

public int getNumGroupmembers()
Gets the number of elements in the groupmembers collection.

Returns:
an int indicating the number of elements in the groupmembers collection
See Also:
setNumGroupmembers(int)

setNumGroupmembers

public void setNumGroupmembers(int numGroupmembers)
Sets the number of elements in the groupmembers collection.

Parameters:
numGroupmembers - the number of members to set
See Also:
getNumGroupmembers()

getMemberchoices

public java.util.List getMemberchoices()
Gets the memberchoices collection from this context. Each member choice stored in this List is an Address Book API Element bean.

Returns:
the entire memberchoices collection, as a java.util.List
See Also:
getMemberchoice(int), setMemberchoices(java.util.List), getNumMemberchoices(), isMemberchoicesEmpty()

setMemberchoices

public void setMemberchoices(java.util.List res)
Sets the memberchoices collection for this context. Each member choice stored in this List must be an Address Book API Element bean.

Parameters:
res - the list to set
See Also:
getMemberchoices(), getMemberchoice(int), isMemberchoicesEmpty()

getMemberchoice

public Element getMemberchoice(int entryid)
Gets the member choice at the specified index.

Parameters:
entryid - the index of the member choice to get
Returns:
the member choice as an Address Book API Element bean, or null if the memberchoices collection has not been set.
See Also:
getMemberchoices(), setMemberchoices(java.util.List), isMemberchoicesEmpty()

isMemberchoicesEmpty

public boolean isMemberchoicesEmpty()
Indicates whether or not the memberchoices collection is empty.

Returns:
true if empty, false if not

getNumMemberchoices

public int getNumMemberchoices()
Gets the number of elements in the memberchoices collection.

Returns:
an int indicating the number of elements in the memberchoices collection
See Also:
setNumMemberchoices(int)

setNumMemberchoices

public void setNumMemberchoices(int numMemberchoices)
Sets the number of elements in the memberchoices collection.

Parameters:
numMemberchoices - the number of elements to set
See Also:
getNumMemberchoices()

getContacts

public java.util.List getContacts()
Gets the contacts collection from this context. Each contact stored in this List is an Address Book API Element bean.

Returns:
the contacts collection, as a java.util.List
See Also:
getContact(int), setContacts(java.util.List), getNumContacts(), isContactsEmpty()

setContacts

public void setContacts(java.util.List res)
Sets the contacts collection for this context. Each contact stored in this List must be an Address Book API Element bean.

See Also:
getContacts(), getContact(int), isContactsEmpty()

getContact

public Element getContact(int entryid)
Gets a single contact at the specified index.

Parameters:
entryid - the index of the contact to get
Returns:
the contact as an Address Book API Element bean, or null if the contact collection has not been set.
See Also:
getContacts(), setContacts(java.util.List), isContactsEmpty()

isContactsEmpty

public boolean isContactsEmpty()
Indicates whether or not the contacts collection is empty.

Returns:
true if empty, false if not

getNumContacts

public int getNumContacts()
Gets the number of elements in the contacts collection.

Returns:
an int indicating the number of elements in the contacts collection
See Also:
setNumContacts(int)

setNumContacts

public void setNumContacts(int numContacts)
Sets the number of elements in the contacts collection.

Parameters:
numContacts - the number of contacts
See Also:
getNumContacts()

getSortBy

public java.lang.String getSortBy()
Gets the user-specified sort field for this context.

Returns:
the sort by field

getSortOrder

public java.lang.String getSortOrder()
Gets the user-specified sort order for this context.

Returns:
the sort order

isGroupSupported

public boolean isGroupSupported()
Reports whether or not groups are supported bu this address book.

Returns:
true if supported, false if not

release

public void release()
Releases resources used by this context. This method calls release() on the underlying ContactDB object, then sets it, and the personal address book language, to null.


ssoTokenChanged

public void ssoTokenChanged(SSOTokenEvent evt)
Handles events from the Portal Session, and cleans up the context when the session goes invalid.

Overrides:
ssoTokenChanged in class Context
Parameters:
evt - the session event