com.sun.portal.wireless.taglibs.cal
Class CalContext

java.lang.Object
  extended bycom.sun.portal.wireless.taglibs.base.Context
      extended bycom.sun.portal.wireless.taglibs.cal.CalContext

public class CalContext
extends Context

Context class for tracking user state across multiple calendar requests.

See Also:
Context

Field Summary
static java.lang.String CONTEXT_CACHE_CLASS_NAME
          The calendar context class cache name.
static java.lang.String CONTEXT_CLASS_NAME
          The calendar context class name.
static java.lang.String CONTEXT_TYPE
          The calendar context type.
static java.lang.String SSO_CONFIG_TYPE
          The SSO configuration type.
 
Fields inherited from class com.sun.portal.wireless.taglibs.base.Context
charSetString, errorCode, parentContext, session, ssoAdapter, timezone
 
Constructor Summary
CalContext()
          Use the getContext method instead to obtain an instance of this class.
 
Method Summary
 ICalendar getCalendar()
          Gets the current calendar.
 java.lang.String getCalendarID()
          Gets the current calendar ID.
 CalendarStore getCalStore()
          Gets the calendar store.
static CalContext getContext(PageContext pageContext)
          Gets a CalContext for this session.
 EventBean getEvent(int index)
          Gets the specified event from the event list.
 int getEventCount()
          Gets the number of events in the current event list.
 EventBean[] getEvents()
          Gets the current event list.
 int getEventSize()
          Gets the size of the current event list.
 java.lang.String getServiceURL()
          Gets the JCAPI service URL.
 java.lang.String getSessionProperty(java.lang.String name)
          Gets a property from the CalSession.
 TaskBean getTask(int index)
          Gets the specified task from the task list.
 int getTaskCount()
          Gets the number of tasks in the current task list.
 TaskBean[] getTasks()
          Gets the current task list.
 void init(HttpServletRequest request, SSOToken session, SSOAdapter ssoAdapter)
          Initializes a context with the specified session.
 boolean isEventsEmpty()
          Determines whether or not the events list is empty.
 boolean isTasksEmpty()
          Determines whether or not the tasks list is empty.
 boolean isUserTheOwner()
          Checks if user is the Owner of this calendar
 void setCalendar(java.lang.String calendarID)
          Sets the specified calendar as the current calendar.
 void setEvents(EventBean[] evnts)
          Sets the current event list.
 void setTasks(TaskBean[] tsks)
          Sets the current task list.
 void ssoTokenChanged(SSOTokenEvent evt)
          Handle events from the Portal Session, and cleans up the context when the session goes invalid.
 EventBean toEventBean(VEvent event)
          Creates a provider/adapter dependent event invoked by FetchTag.
 TaskBean toTaskBean(VTodo task)
          Creates a provider/adapter dependent task invoked by FetchTag.
 
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

CONTEXT_CLASS_NAME

public static final java.lang.String CONTEXT_CLASS_NAME
The calendar context class name. The value of this field is: com.sun.portal.wireless.taglibs.cal.CalContext

See Also:
Constant Field Values

CONTEXT_CACHE_CLASS_NAME

public static final java.lang.String CONTEXT_CACHE_CLASS_NAME
The calendar context class cache name. The value of this field is: com.sun.portal.wireless.taglibs.cal.CalContextCache

See Also:
Constant Field Values

CONTEXT_TYPE

public static final java.lang.String CONTEXT_TYPE
The calendar context type. The value of this field is: calcontext.

See Also:
Constant Field Values

SSO_CONFIG_TYPE

public static final java.lang.String SSO_CONFIG_TYPE
The SSO configuration type. The value of this field is: CALENDAR-TYPE

See Also:
Constant Field Values
Constructor Detail

CalContext

public CalContext()
Use the getContext method instead to obtain an instance of this class.

See Also:
getContext(PageContext)
Method Detail

init

public void init(HttpServletRequest request,
                 SSOToken session,
                 SSOAdapter ssoAdapter)
          throws java.lang.Exception
Initializes a context with the specified session.

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

toEventBean

public EventBean toEventBean(VEvent event)
Creates a provider/adapter dependent event invoked by FetchTag. This method can be overridden by subclasses to create a more specific EventBean.

Parameters:
event - the JCAPI event
Returns:
an EventBean or its derived instance

toTaskBean

public TaskBean toTaskBean(VTodo task)
Creates a provider/adapter dependent task invoked by FetchTag. This method can be overridden by subclasses to create a more specific TaskBean

Parameters:
task - the JCAPI task
Returns:
a TaskBean or its derived instance

getContext

public static CalContext getContext(PageContext pageContext)
                             throws java.lang.Exception
Gets a CalContext for this session.

Parameters:
pageContext - the specified page context
Throws:
java.lang.Exception

setCalendar

public void setCalendar(java.lang.String calendarID)
                 throws JspException
Sets the specified calendar as the current calendar.

Parameters:
calendarID - the specified calendar ID
Throws:
JspException

getCalendar

public ICalendar getCalendar()
Gets the current calendar.

Returns:
the current calendar as an ICalendar object, or null if not available.

getCalStore

public CalendarStore getCalStore()
Gets the calendar store.

Returns:
the calendar store as a CalendarStore object, or null if not available

getCalendarID

public java.lang.String getCalendarID()
Gets the current calendar ID.

Returns:
the current calendar ID as a String, or null if not available

getEvents

public EventBean[] getEvents()
Gets the current event list.

Returns:
the current event list, or null if not available
See Also:
setEvents(EventBean[])

getTasks

public TaskBean[] getTasks()
Gets the current task list.

Returns:
the current task list, or null if not available
See Also:
setTasks(TaskBean[])

setEvents

public void setEvents(EventBean[] evnts)
Sets the current event list.

Returns:
the current event list, or null if not available
See Also:
getEvents()

setTasks

public void setTasks(TaskBean[] tsks)
Sets the current task list.

Returns:
the current task list, or null is not available
See Also:
getTasks()

getEvent

public EventBean getEvent(int index)
Gets the specified event from the event list.

Parameters:
index - the index of the event to get
Returns:
the selected event, or null if not found

getTask

public TaskBean getTask(int index)
Gets the specified task from the task list.

Parameters:
index - the index of the task to get
Returns:
the selected task, or null if not found

getEventCount

public int getEventCount()
Gets the number of events in the current event list.

Returns:
the event list count

getTaskCount

public int getTaskCount()
Gets the number of tasks in the current task list.

Returns:
the task list count

getEventSize

public int getEventSize()
Gets the size of the current event list.

Returns:
the event list size

isEventsEmpty

public boolean isEventsEmpty()
Determines whether or not the events list is empty.

Returns:
true if the event list is empty, false otherwise

isTasksEmpty

public boolean isTasksEmpty()
Determines whether or not the tasks list is empty.

Returns:
true if the tasks list is empty, false otherwise

getServiceURL

public java.lang.String getServiceURL()
Gets the JCAPI service URL.

Returns:
the service url

getSessionProperty

public java.lang.String getSessionProperty(java.lang.String name)
Gets a property from the CalSession. Ex: preferredtimezone - The CalStore after the connect, retrieves user values stored in the backend service and populates them in the Properties.

Parameters:
name - name of the property to look for in CalSession
Returns:
value of the property

isUserTheOwner

public boolean isUserTheOwner()
Checks if user is the Owner of this calendar

Returns:
true if the user can modify it, false otherwise

ssoTokenChanged

public void ssoTokenChanged(SSOTokenEvent evt)
Handle 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