org.sakaiproject.tool.calendar
Class CalendarAction

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sakaiproject.vm.ComponentServlet
              extended byorg.sakaiproject.vm.VmServlet
                  extended byorg.sakaiproject.cheftool.VmServlet
                      extended byorg.sakaiproject.cheftool.ToolServlet
                          extended byorg.sakaiproject.cheftool.VelocityPortletPaneledAction
                              extended byorg.sakaiproject.cheftool.VelocityPortletStateAction
                                  extended byorg.sakaiproject.tool.calendar.CalendarAction
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class CalendarAction
extends VelocityPortletStateAction

The schedule tool.

Version:
$Revision: 6541 $
Author:
University of Michigan, CHEF Software Development Team
See Also:
Serialized Form

Nested Class Summary
 class CalendarAction.CalendarFormattedText
          An inner class that can be initiated to perform text formatting
static class CalendarAction.CalendarPermissions
          Utility class to figure out permissions for a calendar object.
 class CalendarAction.CustomizeCalendarPage
          This class controls the page that allows the user to add arbitrary attributes to the attribute list for the primary calendar that corresponds to the current group.
 class CalendarAction.EventClass
           
 class CalendarAction.EventDisplayClass
           
 class CalendarAction.Helper
           
 class CalendarAction.MergePage
          This class controls the page that allows the user to customize which calendars will be merged with the current group.
 class CalendarAction.MyDate
           
 class CalendarAction.MyDay
           
 class CalendarAction.MyMonth
           
 class CalendarAction.MyWeek
           
 class CalendarAction.MyYear
           
 
Nested classes inherited from class org.sakaiproject.cheftool.VelocityPortletPaneledAction
VelocityPortletPaneledAction.MyLogger
 
Field Summary
protected static String STATE_INITED
           
 
Fields inherited from class org.sakaiproject.cheftool.VelocityPortletPaneledAction
ATTR_CONFIG, ATTR_CONTEXT, ATTR_FRAME_FOCUS, ATTR_FRAME_REFRESH, ATTR_PORTLET, ATTR_RUNDATA, ATTR_TOP_REFRESH, BUTTON, CONTEXT_SITE_COLLECTION_ID, CONTEXT_SITE_COLLECTION_URL, LAYOUT_MAIN, Log, MODE_OPTIONS, STATE_ACTION, STATE_FLOAT, STATE_HELPER, STATE_MESSAGE, STATE_MODE, STATE_OBSERVER, STATE_OBSERVER2, STATE_PRESENCE_OBSERVER, STATE_TOOL
 
Fields inherited from class org.sakaiproject.cheftool.ToolServlet
ALERT_ATTR, ALERT_STATE_INITED, MENU_ATTR, PARAM_ACTION, PARAM_ACTION_COMBO, TITLE_PANEL, TOOL_MODE_ATTR, TOOL_MODE_DEFAULT
 
Fields inherited from class org.sakaiproject.cheftool.VmServlet
m_validator
 
Fields inherited from class org.sakaiproject.vm.ComponentServlet
ATTR_PARAMS
 
Constructor Summary
CalendarAction()
           
 
Method Summary
protected  String arrayToString(String[] array, String separators)
          Takes an array of tokens and converts into separator-separated string.
protected  void buildDayContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing day view
protected  void buildDeleteContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing delete view
protected  void buildDescriptionContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing description for events
protected  void buildFrequencyContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for editing the frequency
protected  void buildListContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing list view
 String buildMainPanelContext(VelocityPortlet portlet, Context context, RunData runData, SessionState sstate)
           
protected  void buildMonthContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing month view
protected  void buildNewContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing New view
protected  void buildReviseContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing revise view
protected  void buildWeekContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing week view
protected  void buildYearContext(VelocityPortlet portlet, Context context, RunData runData, CalendarActionState state)
          Build the context for showing Year view
 String calendarUtilGetDay(int dayofweek)
          Get the name of the day.
 String calendarUtilGetMonth(int l_month)
          Access the current month as a string.
 CalendarAction.MyMonth calMonth(int month, CalendarUtil m_calObj, CalendarActionState state, CalendarEventVector CalendarEventVectorObj)
          calculate the days in the month and there events if any
 void doActivityday(RunData data, Context context)
          Action is requsted when the user select day from menu in Activityevent view.
 void doAdd(RunData runData, Context context)
          Action doAdd is requested when the user click on the add in the new view to add an event into a calendar.
 void doAddfield(RunData runData, Context context)
          Handle the button click to add a field to the list of optional attributes.
 void doAttachments(RunData rundata, Context context)
           
 void doBack(RunData data, Context context)
          Action is used when the doBack is called when the user click on the back on the EventActivity view
 void doCancel(RunData data, Context context)
          Action is used when the docancel is requested when the user click on cancel in the new view
 void doCancelImportWizard(RunData data, Context context)
          Called when the user cancels the import wizard.
 void doChangefrequency(RunData rundata, Context context)
          Action doChangefrequency is requested when the user changes the selected frequency at the frequency setting page
 void doConfirm(RunData data, Context context)
          Action is used when the doConfirm is called when the user click on confirm to delete event in the delete view.
 void doCustomDate(RunData data, Context context)
          Action doCustomDate is requested when the user specifies a start/end date to filter the list view.
 void doCustomize(RunData runData, Context context)
          Handle a request to set options.
 void doDay(RunData data, Context context)
          Action doDay is requested when the user click on the day item in the menue
 void doDelete(RunData data, Context context)
          Action is used when the doDelete is called when the user click on delete in menu
 void doDeletefield(RunData runData, Context context)
           
 void doDescription(RunData data, Context context)
          Action is used when doDescription is requested when the user click on an event
 void doDpagen(RunData runData, Context context)
          Action doDpagen is requested when the user click on the next arrow to move to the next page in day view.
 void doDpagep(RunData runData, Context context)
          Action doDpagep is requested when the user click on the upper arrow to move to the previous page in day view.
 void doEditfrequency(RunData rundata, Context context)
          Action doFrequency is requested when "set Frequency" button is clicked in new/revise page
 void doFilter(RunData data, Context context)
          Action doFilter is requested when the user clicks on the list box to select a filtering mode for the list view.
 void doGomonth(RunData data, Context context)
          Action is used when doGomonth requested in the year/list view
 void doGoyear(RunData data, Context context)
          Action is used when doGoyear requested in the list view
 void doImport(RunData data, Context context)
          Enter the schedule import wizard
 void doList(RunData data, Context context)
          Action doList is requested when the user click on the list in the toolbar
 void doMenueday(RunData data, Context context)
          Action is requestd when the user select day from the menu avilable in some views.
 void doMerge(RunData runData, Context context)
          Handle a request from the "merge" page to merge calendars from other groups into this group's Schedule display.
 void doMonth(RunData data, Context context)
          Action is used when doMonth requested in the menu
 void doNew(RunData data, Context context)
          Action doNew is requested when the user click on New in the menu
 void doNext_activity(RunData runData, Context context)
          Action doNext_activity is requested when the user navigates to the previous message in the detailed view.
 void doNext(RunData data, Context context)
          Action doNext is called when the user click on next button to move to next day, next week, next month or next year.
 void doNextday(RunData data, Context context)
          Action doNextday is called when the user click on "Tomorrow" link in day view
 void doNpagew(RunData runData, Context context)
          Action doNpagew is requested when the user click on the next arrow to move to the next page in the week view.
 void doOk(RunData data, Context context)
          Action is used when doOk is requested when user click on Back button
 void doParse(RunData data, Context context)
          Action is to parse the function calls
 void doPermissions(RunData data, Context context)
          Fire up the permissions editor
 void doPpagew(RunData runData, Context context)
          Action doPpagew is requested when the user click on the previous arrow to move to the previous page in week view.
 void doPreday(RunData data, Context context)
          Action doPreday is called when the user click on "Yesterday" link in day view
 void doPrev_activity(RunData runData, Context context)
          Action doPrev_activity is requested when the user navigates to the previous message in the detailed view.
 void doPrev(RunData data, Context context)
          Action doPrev is requested when the user click on the prev button to move into pre day, month, year, or week.
 void doRevise(RunData data, Context context)
          Action is used when the user click on the doRevise in the menu
 void doSavefrequency(RunData rundata, Context context)
          Action doSavefrequency is requested when the user click on the "Save" button in the frequency setting page
 void doScheduleBack(RunData data, Context context)
          Handle the back button on the schedule import wizard
 void doScheduleContinue(RunData data, Context context)
          Handle the "continue" button on the schedule import wizard.
 void doSort_by_date_toggle(RunData data, Context context)
          Action doSort_by_date_toggle is requested when the user click on the sorting icon in the list view
 void doToday(RunData data, Context context)
          Action doToday is requested when the user click on "Go to today" button
 void doUpdate(RunData runData, Context context)
          Action doUpdate is requested when the user click on the save button on the revise screen.
 void doView(RunData data, Context context)
           
 void doWeek(RunData data, Context context)
          Action doWeek is requested when the user click on the week item in then menu
 void doYear(RunData data, Context context)
          Action doYear is requested when the user click on Year on menu
protected  void enableObserver(SessionState sstate, boolean enable)
          Enable or disable the observer
 TimeRange getDayTimeRange(int year, int month, int day)
          Given a current date in the year, month, and day parameters, returns a TimeRange for the day.
 TimeRange getMonthTimeRange(CalendarUtil calendarUtil)
          Given a current date via the calendarUtil paramter, returns a TimeRange for the month.
protected  Vector getNewEvents(int year, int month, int day, CalendarActionState state, RunData rundata, int time, int numberofcycles, Context context, CalendarEventVector CalendarEventVectorObj)
           
protected  Class getStateClass()
           
 TimeRange getWeekTimeRange(CalendarUtil calendarUtil)
          Given a current date via the calendarUtil paramter, returns a TimeRange for the week.
protected  void initState(SessionState state, VelocityPortlet portlet, JetspeedRunData rundata)
          Populate the state object, if needed.
 
Methods inherited from class org.sakaiproject.cheftool.VelocityPortletStateAction
getState, getState, getState, releaseState, releaseState, releaseState
 
Methods inherited from class org.sakaiproject.cheftool.VelocityPortletPaneledAction
actionDispatch, addAlert, addOptionsMenu, cancelOptions, clientWindowId, disableObservers, doGet, doOptions, doReset, enableObservers, getContext, helperActionDispatch, initState, justDelivered, mainPanelUpdateId, processAction, resetTool, saveOptions, scheduleFocusRefresh, schedulePeerFrameRefresh, scheduleTopRefresh, setVmCourier, setVmStdRef, titlePanelUpdateId, toolModeDispatch, updateState
 
Methods inherited from class org.sakaiproject.cheftool.ToolServlet
doPost, getAlert, getAlert, getMenu, getPid, getState, getToolMode, prepState, setToolMode
 
Methods inherited from class org.sakaiproject.vm.VmServlet
getActionURL, getVmReference, includeVm, setVmReference
 
Methods inherited from class org.sakaiproject.vm.ComponentServlet
sendParentRedirect, service, setNoCacheHeaders
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_INITED

protected static final String STATE_INITED
See Also:
Constant Field Values
Constructor Detail

CalendarAction

public CalendarAction()
Method Detail

enableObserver

protected void enableObserver(SessionState sstate,
                              boolean enable)
Enable or disable the observer

Parameters:
enable - if true, the observer is enabled, if false, it is disabled

getWeekTimeRange

public TimeRange getWeekTimeRange(CalendarUtil calendarUtil)
Given a current date via the calendarUtil paramter, returns a TimeRange for the week.


getMonthTimeRange

public TimeRange getMonthTimeRange(CalendarUtil calendarUtil)
Given a current date via the calendarUtil paramter, returns a TimeRange for the month.


getDayTimeRange

public TimeRange getDayTimeRange(int year,
                                 int month,
                                 int day)
Given a current date in the year, month, and day parameters, returns a TimeRange for the day.


getStateClass

protected Class getStateClass()

buildMainPanelContext

public String buildMainPanelContext(VelocityPortlet portlet,
                                    Context context,
                                    RunData runData,
                                    SessionState sstate)

buildFrequencyContext

protected void buildFrequencyContext(VelocityPortlet portlet,
                                     Context context,
                                     RunData runData,
                                     CalendarActionState state)
Build the context for editing the frequency


buildReviseContext

protected void buildReviseContext(VelocityPortlet portlet,
                                  Context context,
                                  RunData runData,
                                  CalendarActionState state)
Build the context for showing revise view


buildDescriptionContext

protected void buildDescriptionContext(VelocityPortlet portlet,
                                       Context context,
                                       RunData runData,
                                       CalendarActionState state)
Build the context for showing description for events


buildYearContext

protected void buildYearContext(VelocityPortlet portlet,
                                Context context,
                                RunData runData,
                                CalendarActionState state)
Build the context for showing Year view


buildMonthContext

protected void buildMonthContext(VelocityPortlet portlet,
                                 Context context,
                                 RunData runData,
                                 CalendarActionState state)
Build the context for showing month view


getNewEvents

protected Vector getNewEvents(int year,
                              int month,
                              int day,
                              CalendarActionState state,
                              RunData rundata,
                              int time,
                              int numberofcycles,
                              Context context,
                              CalendarEventVector CalendarEventVectorObj)

buildDayContext

protected void buildDayContext(VelocityPortlet portlet,
                               Context context,
                               RunData runData,
                               CalendarActionState state)
Build the context for showing day view


buildWeekContext

protected void buildWeekContext(VelocityPortlet portlet,
                                Context context,
                                RunData runData,
                                CalendarActionState state)
Build the context for showing week view


buildNewContext

protected void buildNewContext(VelocityPortlet portlet,
                               Context context,
                               RunData runData,
                               CalendarActionState state)
Build the context for showing New view


buildDeleteContext

protected void buildDeleteContext(VelocityPortlet portlet,
                                  Context context,
                                  RunData runData,
                                  CalendarActionState state)
Build the context for showing delete view


calMonth

public CalendarAction.MyMonth calMonth(int month,
                                       CalendarUtil m_calObj,
                                       CalendarActionState state,
                                       CalendarEventVector CalendarEventVectorObj)
calculate the days in the month and there events if any

Parameters:
month - is int
m_calObj - is object of calendar

doAttachments

public void doAttachments(RunData rundata,
                          Context context)

doMonth

public void doMonth(RunData data,
                    Context context)
Action is used when doMonth requested in the menu


doDescription

public void doDescription(RunData data,
                          Context context)
Action is used when doDescription is requested when the user click on an event


doGomonth

public void doGomonth(RunData data,
                      Context context)
Action is used when doGomonth requested in the year/list view


doGoyear

public void doGoyear(RunData data,
                     Context context)
Action is used when doGoyear requested in the list view


doOk

public void doOk(RunData data,
                 Context context)
Action is used when doOk is requested when user click on Back button


doRevise

public void doRevise(RunData data,
                     Context context)
Action is used when the user click on the doRevise in the menu


doScheduleContinue

public void doScheduleContinue(RunData data,
                               Context context)
Handle the "continue" button on the schedule import wizard.


doScheduleBack

public void doScheduleBack(RunData data,
                           Context context)
Handle the back button on the schedule import wizard


doCancelImportWizard

public void doCancelImportWizard(RunData data,
                                 Context context)
Called when the user cancels the import wizard.


doCancel

public void doCancel(RunData data,
                     Context context)
Action is used when the docancel is requested when the user click on cancel in the new view


doBack

public void doBack(RunData data,
                   Context context)
Action is used when the doBack is called when the user click on the back on the EventActivity view


doDelete

public void doDelete(RunData data,
                     Context context)
Action is used when the doDelete is called when the user click on delete in menu


doConfirm

public void doConfirm(RunData data,
                      Context context)
Action is used when the doConfirm is called when the user click on confirm to delete event in the delete view.


doView

public void doView(RunData data,
                   Context context)

doYear

public void doYear(RunData data,
                   Context context)
Action doYear is requested when the user click on Year on menu


doWeek

public void doWeek(RunData data,
                   Context context)
Action doWeek is requested when the user click on the week item in then menu


doDay

public void doDay(RunData data,
                  Context context)
Action doDay is requested when the user click on the day item in the menue


doToday

public void doToday(RunData data,
                    Context context)
Action doToday is requested when the user click on "Go to today" button


doCustomDate

public void doCustomDate(RunData data,
                         Context context)
Action doCustomDate is requested when the user specifies a start/end date to filter the list view.


doFilter

public void doFilter(RunData data,
                     Context context)
Action doFilter is requested when the user clicks on the list box to select a filtering mode for the list view.


doMenueday

public void doMenueday(RunData data,
                       Context context)
Action is requestd when the user select day from the menu avilable in some views.


doActivityday

public void doActivityday(RunData data,
                          Context context)
Action is requsted when the user select day from menu in Activityevent view.


doNext

public void doNext(RunData data,
                   Context context)
Action doNext is called when the user click on next button to move to next day, next week, next month or next year.


doNextday

public void doNextday(RunData data,
                      Context context)
Action doNextday is called when the user click on "Tomorrow" link in day view


doPrev

public void doPrev(RunData data,
                   Context context)
Action doPrev is requested when the user click on the prev button to move into pre day, month, year, or week.


doPreday

public void doPreday(RunData data,
                     Context context)
Action doPreday is called when the user click on "Yesterday" link in day view


doImport

public void doImport(RunData data,
                     Context context)
Enter the schedule import wizard


doNew

public void doNew(RunData data,
                  Context context)
Action doNew is requested when the user click on New in the menu


doAdd

public void doAdd(RunData runData,
                  Context context)
Action doAdd is requested when the user click on the add in the new view to add an event into a calendar.


doUpdate

public void doUpdate(RunData runData,
                     Context context)
Action doUpdate is requested when the user click on the save button on the revise screen.


doDeletefield

public void doDeletefield(RunData runData,
                          Context context)

doAddfield

public void doAddfield(RunData runData,
                       Context context)
Handle the button click to add a field to the list of optional attributes.


doNpagew

public void doNpagew(RunData runData,
                     Context context)
Action doNpagew is requested when the user click on the next arrow to move to the next page in the week view.


doPpagew

public void doPpagew(RunData runData,
                     Context context)
Action doPpagew is requested when the user click on the previous arrow to move to the previous page in week view.


doDpagen

public void doDpagen(RunData runData,
                     Context context)
Action doDpagen is requested when the user click on the next arrow to move to the next page in day view.


doDpagep

public void doDpagep(RunData runData,
                     Context context)
Action doDpagep is requested when the user click on the upper arrow to move to the previous page in day view.


doPrev_activity

public void doPrev_activity(RunData runData,
                            Context context)
Action doPrev_activity is requested when the user navigates to the previous message in the detailed view.


doNext_activity

public void doNext_activity(RunData runData,
                            Context context)
Action doNext_activity is requested when the user navigates to the previous message in the detailed view.


doParse

public void doParse(RunData data,
                    Context context)
Action is to parse the function calls


doList

public void doList(RunData data,
                   Context context)
Action doList is requested when the user click on the list in the toolbar


doSort_by_date_toggle

public void doSort_by_date_toggle(RunData data,
                                  Context context)
Action doSort_by_date_toggle is requested when the user click on the sorting icon in the list view


doMerge

public void doMerge(RunData runData,
                    Context context)
Handle a request from the "merge" page to merge calendars from other groups into this group's Schedule display.


doCustomize

public void doCustomize(RunData runData,
                        Context context)
Handle a request to set options.


buildListContext

protected void buildListContext(VelocityPortlet portlet,
                                Context context,
                                RunData runData,
                                CalendarActionState state)
Build the context for showing list view


doPermissions

public void doPermissions(RunData data,
                          Context context)
Fire up the permissions editor


doEditfrequency

public void doEditfrequency(RunData rundata,
                            Context context)
Action doFrequency is requested when "set Frequency" button is clicked in new/revise page


doChangefrequency

public void doChangefrequency(RunData rundata,
                              Context context)
Action doChangefrequency is requested when the user changes the selected frequency at the frequency setting page


doSavefrequency

public void doSavefrequency(RunData rundata,
                            Context context)
Action doSavefrequency is requested when the user click on the "Save" button in the frequency setting page


initState

protected void initState(SessionState state,
                         VelocityPortlet portlet,
                         JetspeedRunData rundata)
Populate the state object, if needed.

Overrides:
initState in class VelocityPortletPaneledAction

arrayToString

protected String arrayToString(String[] array,
                               String separators)
Takes an array of tokens and converts into separator-separated string.

Returns:
String A string containing tokens separated by seperator.

calendarUtilGetMonth

public String calendarUtilGetMonth(int l_month)
Access the current month as a string.

Returns:
the current month as a string.

calendarUtilGetDay

public String calendarUtilGetDay(int dayofweek)
Get the name of the day.

Returns:
the name of the day.