com.stratelia.webactiv.agenda.control
Class AgendaSessionController

java.lang.Object
  extended by com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
      extended by com.stratelia.webactiv.agenda.control.AgendaSessionController
All Implemented Interfaces:
ComponentSessionController

public class AgendaSessionController
extends AbstractComponentSessionController


Field Summary
static String AGENDA_FILENAME_PREFIX
           
static String EXPORT_EMPTY
           
static String EXPORT_FAILED
           
static String EXPORT_SUCCEEDED
           
static int HOLIDAY_DAY
           
static String ICALENDAR_MIME_TYPE
           
static String IMPORT_FAILED
           
static String IMPORT_SUCCEEDED
           
static String SYNCHRO_FAILED
           
static String SYNCHRO_SUCCEEDED
           
static int WORKING_DAY
           
 
Fields inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
CHARACTER_ENCODING, context
 
Constructor Summary
AgendaSessionController(MainSessionController mainSessionCtrl, ComponentContext context)
           
 
Method Summary
 String addJournal(String name, String description, String priority, String classification, Date startDay, String startHour, Date endDay, String endHour)
           
 void changeDateStatus(String date, String nextStatus)
           
 void changeDayOfWeekStatus(String year, String month, String day)
          Change worked or non-worked days status
 void close()
           
 Collection<SchedulableCount> countMonthSchedulables()
          Method declaration
 String exportIcalAgenda()
           
 String exportIcalAgenda(String startDate, String endDate)
          Export SilverpeasCalendar in Ical format
 UserDetail getAgendaUserDetail()
          Get userDetail for this agenda
 String getAgendaUserId()
          Get userId for this agenda
 Collection<Category> getAllCategories()
          methods for categories
 Collection<JournalHeader> getBusyTime(String userId, Date day)
          Method declaration
 Category getCategory()
          methods to manage current user state
 Category getCategory(String categoryId)
          Method declaration
protected  String getComponentInstName()
           
 Collection<Attendee> getCurrentAttendees()
          Method declaration
 Collection<Category> getCurrentCategories()
          Method declaration
 Date getCurrentDay()
          Method declaration
 int getCurrentDisplayType()
          Method declaration
 AgendaHtmlView getCurrentHtmlView()
          Method declaration
 JournalHeader getCurrentJournalHeader()
          Method declaration
 String getCurrentViewType()
          Get view Type (by Day, Week, Month ou Year)
 Collection<JournalHeader> getDaySchedulables()
          Method declaration
 int getEndDayInMonth()
          Method declaration
 int getEndMonth()
          Method declaration
 int getEndYear()
          Method declaration
 List<String> getHolidaysDates()
          Get Holidays dates in personal agenda (YYYY/MM/JJ)
 List<String> getHolidaysDatesInDb()
          Get days off defined for this agenda user
 CalendarImportSettings getImportSettings()
          Get synchronisation user settings
 Collection<Attendee> getJournalAttendees(String journalId)
          methods for attendees
 Collection<Category> getJournalCategories(String journalId)
          Method declaration
 JournalHeader getJournalHeader(String journalId)
          Method declaration
static Date getMonthFirstDay(Date date)
          Method declaration
 Date getMonthLastDay(Date date)
          Get the last day of the month
 Collection<JournalHeader> getMonthSchedulables(Date date)
          Method declaration
 String getMyAgendaUrl()
          Get url access to my diary
 List<Date> getNonSelectableDays()
           
 NotificationSender getNotificationSender()
          Method declaration
 ParticipationStatus getParticipationStatus()
          Method declaration
 String getRSSUrl()
           
 UserDetail getSelectedUser()
          Get a UserDetail of selected user in UserPanel
 String getServerURL()
           
 ResourceLocator getSettings()
          Method declaration
 int getStartDayInMonth()
          Method declaration
 int getStartDayInWeek()
          Method declaration
 int getStartMonth()
          Method declaration
 int getStartYear()
          Method declaration
 Collection<JournalHeader> getTentativeSchedulables()
          Method declaration
 UserDetail getUserDetail(String userId)
          Method declaration
 UserDetail[] getUserList()
          Method declaration
 Collection<Attendee> getUserSelected()
          Retourne une Collection de UserDetail des utilisateurs selectionnés via le userPanel
 Date getWeekFirstDay(Date date)
          Method declaration
 Date getWeekLastDay(Date date)
          Method declaration
 Collection<JournalHeader> getWeekSchedulables()
          Method declaration
static Date getYearFirstDay(Date date)
          Method declaration
 boolean hasTentativeSchedulables()
          Method declaration
 String importIcalAgenda(File fileCalendar)
          Export SilverpeasCalendar in Ical format
 void indexAll()
          Method declaration
 String initSelectionPeas()
          Parametre le userPannel => tous les users, sélection des users participants.
 String initUserPanelOtherAgenda()
          Get user by the userPanel (for viewing another agenda)
 boolean isDayHasEvents(String userId, Date day)
          Return if day has events for the user or not
 boolean isHolidayDate(Date date)
          Ask if a date is a day off
 boolean isHolidayDate(String agendaUserId, Date date)
          Ask if a date is a day off
 boolean isOtherAgendaMode()
          If current agenda is for another user
 boolean isSameDaysAreHolidays(Calendar cal, int currentMonth)
          Ask if the same days of the month are all holidays
 void next()
          Method declaration
 void nextDay()
          Method declaration
 void nextMonth()
          Method declaration
 void nextWeek()
          Method declaration
 void nextYear()
          Method declaration
protected  void notifyAttendees(String id, NotifAction action)
          Notification from delagator to attendees.
protected  void notifyFromAttendee(String id, String attend)
          Notification from attendee to delegator.
 void previous()
          Method declaration
 void previousDay()
          Method declaration
 void previousMonth()
          Method declaration
 void previousWeek()
          Method declaration
 void previousYear()
          Method declaration
 void removeJournal(String id)
          Method declaration
 void saveUserSettings(CalendarImportSettings importSettings)
          Save synchronisation user settings
 void selectDay(String day)
          Method declaration
 void setAgendaUserDetail(UserDetail userDetail)
          Set userDetail for viewing his agenda
 void setCalendarVisible(boolean visible)
          Method declaration
 void setCategory(Category category)
          Method declaration
 void setCurrentAttendees(Collection<Attendee> attendees)
          Method declaration
 void setCurrentCategories(Collection<Category> categories)
          Method declaration
 void setCurrentDay(Date date)
          Method declaration
 void setCurrentJournalHeader(JournalHeader journalHeader)
          Method declaration
 void setHolidaysDates(List<String> list)
          Set holidays dates of personal agenda
 void setJournalAttendees(String journalId, String[] userIds)
          Method declaration
 void setJournalCategories(String journalId, String[] categoryIds)
          Method declaration
 void setJournalParticipationStatus(String journalId, String userId, String status)
          Method declaration
 void setNonSelectableDays(List<Date> list)
           
 String synchroIcalAgenda(String urlICalendar)
          Synchronize localResourceLocator agenda with URLIcalendar
 String synchroIcalAgenda(String urlICalendar, String loginIcalendar, String pwdIcalendar)
          Synchronize localResourceLocator agenda with URLIcalendar
 void updateJournal(String id, String name, String description, String priority, String classification, Date startDay, String startHour, Date endDay, String endHour)
          Method declaration
 void updateUserSettings(CalendarImportSettings importSettings)
          Update synchronisation user settings
 void viewByDay()
          Method declaration
 void viewByMonth()
          Method declaration
 void viewByWeek()
          Method declaration
 void viewByYear()
          Method declaration
 void viewChooseDays()
          Method declaration
 
Methods inherited from class com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, getAlertUser, getClipboardCount, getClipboardErrorMessage, getClipboardExceptionError, getClipboardName, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameters, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getFavoriteSpace, getGenericPanel, getHighestSilverpeasUserRole, getIcon, getLanguage, getLastResults, getLook, getMultilang, getOrganisationController, getPersonalization, getSelection, getServerNameAndPort, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserAvailSpaceIds, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoleLevel, getUserRoles, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardError, setClipboardSelectedElement, setComponentRootName, setFavoriteSpaceToMainSessionController, setGenericPanel, setIconFileName, setLastResults, setMultilangFileName, setResourceFileName, setSpaceModeMaintenance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICALENDAR_MIME_TYPE

public static final String ICALENDAR_MIME_TYPE
See Also:
Constant Field Values

EXPORT_SUCCEEDED

public static final String EXPORT_SUCCEEDED
See Also:
Constant Field Values

EXPORT_FAILED

public static final String EXPORT_FAILED
See Also:
Constant Field Values

EXPORT_EMPTY

public static final String EXPORT_EMPTY
See Also:
Constant Field Values

IMPORT_SUCCEEDED

public static final String IMPORT_SUCCEEDED
See Also:
Constant Field Values

IMPORT_FAILED

public static final String IMPORT_FAILED
See Also:
Constant Field Values

SYNCHRO_SUCCEEDED

public static final String SYNCHRO_SUCCEEDED
See Also:
Constant Field Values

SYNCHRO_FAILED

public static final String SYNCHRO_FAILED
See Also:
Constant Field Values

AGENDA_FILENAME_PREFIX

public static final String AGENDA_FILENAME_PREFIX
See Also:
Constant Field Values

WORKING_DAY

public static final int WORKING_DAY
See Also:
Constant Field Values

HOLIDAY_DAY

public static final int HOLIDAY_DAY
See Also:
Constant Field Values
Constructor Detail

AgendaSessionController

public AgendaSessionController(MainSessionController mainSessionCtrl,
                               ComponentContext context)
Method Detail

getRSSUrl

public String getRSSUrl()
Overrides:
getRSSUrl in class AbstractComponentSessionController

getComponentInstName

protected String getComponentInstName()

addJournal

public String addJournal(String name,
                         String description,
                         String priority,
                         String classification,
                         Date startDay,
                         String startHour,
                         Date endDay,
                         String endHour)
                  throws RemoteException
Parameters:
name -
description -
priority -
classification -
startDay -
startHour -
endDay -
endHour -
Returns:
Throws:
RemoteException

notifyAttendees

protected void notifyAttendees(String id,
                               NotifAction action)
Notification from delagator to attendees.

Parameters:
id -
action -

notifyFromAttendee

protected void notifyFromAttendee(String id,
                                  String attend)
Notification from attendee to delegator.

Parameters:
id -
attend -

updateJournal

public void updateJournal(String id,
                          String name,
                          String description,
                          String priority,
                          String classification,
                          Date startDay,
                          String startHour,
                          Date endDay,
                          String endHour)
                   throws RemoteException,
                          CalendarException
Method declaration

Parameters:
id -
name -
description -
priority -
classification -
startDay -
startHour -
endDay -
endHour -
Throws:
CalendarException
RemoteException
See Also:

removeJournal

public void removeJournal(String id)
                   throws RemoteException,
                          CalendarException
Method declaration

Parameters:
id -
Throws:
CalendarException
RemoteException
See Also:

getJournalHeader

public JournalHeader getJournalHeader(String journalId)
                               throws RemoteException
Method declaration

Parameters:
journalId -
Returns:
Throws:
RemoteException
See Also:

getJournalAttendees

public Collection<Attendee> getJournalAttendees(String journalId)
                                         throws AgendaException
methods for attendees

Throws:
AgendaException

setJournalAttendees

public void setJournalAttendees(String journalId,
                                String[] userIds)
                         throws AgendaException
Method declaration

Parameters:
journalId -
userIds -
Throws:
AgendaException
See Also:

setJournalParticipationStatus

public void setJournalParticipationStatus(String journalId,
                                          String userId,
                                          String status)
                                   throws AgendaException
Method declaration

Parameters:
journalId -
userId -
status -
Throws:
AgendaException
See Also:

getAllCategories

public Collection<Category> getAllCategories()
                                      throws AgendaException
methods for categories

Throws:
AgendaException

getCategory

public Category getCategory(String categoryId)
                     throws AgendaException
Method declaration

Parameters:
categoryId -
Returns:
Throws:
AgendaException
See Also:

getJournalCategories

public Collection<Category> getJournalCategories(String journalId)
                                          throws AgendaException
Method declaration

Parameters:
journalId -
Returns:
Throws:
AgendaException
See Also:

setJournalCategories

public void setJournalCategories(String journalId,
                                 String[] categoryIds)
                          throws AgendaException
Method declaration

Parameters:
journalId -
categoryIds -
Throws:
AgendaException
See Also:

indexAll

public void indexAll()
              throws RemoteException
Method declaration

Throws:
RemoteException
See Also:

getUserList

public UserDetail[] getUserList()
Method declaration

Returns:
See Also:

getUserDetail

public UserDetail getUserDetail(String userId)
Method declaration

Overrides:
getUserDetail in class AbstractComponentSessionController
Parameters:
userId -
Returns:
See Also:

getCategory

public Category getCategory()
methods to manage current user state


setCategory

public void setCategory(Category category)
Method declaration

Parameters:
category -
See Also:

getCurrentJournalHeader

public JournalHeader getCurrentJournalHeader()
Method declaration

Returns:
See Also:

setCurrentJournalHeader

public void setCurrentJournalHeader(JournalHeader journalHeader)
Method declaration

Parameters:
journalHeader -
See Also:

getCurrentAttendees

public Collection<Attendee> getCurrentAttendees()
Method declaration

Returns:
See Also:

setCurrentAttendees

public void setCurrentAttendees(Collection<Attendee> attendees)
Method declaration

Parameters:
attendees -
See Also:

getCurrentCategories

public Collection<Category> getCurrentCategories()
Method declaration

Returns:
See Also:

setCurrentCategories

public void setCurrentCategories(Collection<Category> categories)
Method declaration

Parameters:
categories -
See Also:

setCalendarVisible

public void setCalendarVisible(boolean visible)
Method declaration

Parameters:
visible -
See Also:

getParticipationStatus

public ParticipationStatus getParticipationStatus()
Method declaration

Returns:
See Also:

getNotificationSender

public NotificationSender getNotificationSender()
Method declaration

Returns:
See Also:

getServerURL

public String getServerURL()
Returns:

getSettings

public ResourceLocator getSettings()
Method declaration

Specified by:
getSettings in interface ComponentSessionController
Overrides:
getSettings in class AbstractComponentSessionController
Returns:
See Also:

viewByDay

public void viewByDay()
Method declaration

See Also:

viewByWeek

public void viewByWeek()
Method declaration

See Also:

viewByMonth

public void viewByMonth()
Method declaration

See Also:

viewByYear

public void viewByYear()
Method declaration

See Also:

viewChooseDays

public void viewChooseDays()
Method declaration

See Also:

getCurrentDisplayType

public int getCurrentDisplayType()
Method declaration

Returns:
See Also:

getCurrentHtmlView

public AgendaHtmlView getCurrentHtmlView()
                                  throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

getDaySchedulables

public Collection<JournalHeader> getDaySchedulables()
                                             throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

getMonthSchedulables

public Collection<JournalHeader> getMonthSchedulables(Date date)
                                               throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

getWeekSchedulables

public Collection<JournalHeader> getWeekSchedulables()
                                              throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

countMonthSchedulables

public Collection<SchedulableCount> countMonthSchedulables()
                                                    throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

getBusyTime

public Collection<JournalHeader> getBusyTime(String userId,
                                             Date day)
                                      throws RemoteException
Method declaration

Parameters:
userId -
day -
Returns:
Throws:
RemoteException
See Also:

isDayHasEvents

public boolean isDayHasEvents(String userId,
                              Date day)
                       throws RemoteException
Return if day has events for the user or not

Parameters:
userId -
day -
Returns:
isDayHasEvents
Throws:
RemoteException

hasTentativeSchedulables

public boolean hasTentativeSchedulables()
                                 throws RemoteException
Method declaration

Returns:
Throws:
RemoteException
See Also:

getTentativeSchedulables

public Collection<JournalHeader> getTentativeSchedulables()
                                                   throws AgendaException
Method declaration

Returns:
Throws:
AgendaException
See Also:

getCurrentDay

public Date getCurrentDay()
Method declaration

Returns:
See Also:

getStartDayInWeek

public int getStartDayInWeek()
Method declaration

Returns:
See Also:

getStartDayInMonth

public int getStartDayInMonth()
Method declaration

Returns:
See Also:

getEndDayInMonth

public int getEndDayInMonth()
Method declaration

Returns:
See Also:

getStartMonth

public int getStartMonth()
Method declaration

Returns:
See Also:

getEndMonth

public int getEndMonth()
Method declaration

Returns:
See Also:

getStartYear

public int getStartYear()
Method declaration

Returns:
See Also:

getEndYear

public int getEndYear()
Method declaration

Returns:
See Also:

setCurrentDay

public void setCurrentDay(Date date)
Method declaration

Parameters:
date -
See Also:

selectDay

public void selectDay(String day)
Method declaration

Parameters:
day -
See Also:

next

public void next()
          throws RemoteException
Method declaration

Throws:
RemoteException
See Also:

nextDay

public void nextDay()
             throws RemoteException
Method declaration

Throws:
RemoteException
See Also:

nextWeek

public void nextWeek()
Method declaration

See Also:

nextMonth

public void nextMonth()
Method declaration

See Also:

nextYear

public void nextYear()
Method declaration

See Also:

previous

public void previous()
Method declaration

See Also:

previousDay

public void previousDay()
Method declaration

See Also:

previousWeek

public void previousWeek()
Method declaration

See Also:

previousMonth

public void previousMonth()
Method declaration

See Also:

previousYear

public void previousYear()
Method declaration

See Also:

getWeekFirstDay

public Date getWeekFirstDay(Date date)
Method declaration

Parameters:
date -
Returns:
See Also:

getWeekLastDay

public Date getWeekLastDay(Date date)
Method declaration

Parameters:
date -
Returns:
See Also:

getMonthFirstDay

public static Date getMonthFirstDay(Date date)
Method declaration

Parameters:
date -
Returns:
See Also:

getMonthLastDay

public Date getMonthLastDay(Date date)
Get the last day of the month

Parameters:
date -
Returns:
date
See Also:

getYearFirstDay

public static Date getYearFirstDay(Date date)
Method declaration

Parameters:
date -
Returns:
See Also:

initSelectionPeas

public String initSelectionPeas()
Parametre le userPannel => tous les users, sélection des users participants.

Returns:

getUserSelected

public Collection<Attendee> getUserSelected()
                                     throws AgendaException
Retourne une Collection de UserDetail des utilisateurs selectionnés via le userPanel

Parameters:
-
Returns:
Throws:
AgendaException
See Also:

close

public void close()
Overrides:
close in class AbstractComponentSessionController

getNonSelectableDays

public List<Date> getNonSelectableDays()
Returns:

setNonSelectableDays

public void setNonSelectableDays(List<Date> list)
Parameters:
list -

getHolidaysDates

public List<String> getHolidaysDates()
                              throws RemoteException
Get Holidays dates in personal agenda (YYYY/MM/JJ)

Returns:
Throws:
RemoteException

setHolidaysDates

public void setHolidaysDates(List<String> list)
Set holidays dates of personal agenda

Parameters:
list -

initUserPanelOtherAgenda

public String initUserPanelOtherAgenda()
Get user by the userPanel (for viewing another agenda)

Returns:
Throws:
See Also:

getSelectedUser

public UserDetail getSelectedUser()
Get a UserDetail of selected user in UserPanel

Parameters:
-
Returns:
UserDetail

setAgendaUserDetail

public void setAgendaUserDetail(UserDetail userDetail)
Set userDetail for viewing his agenda

Parameters:
userDetail -

getAgendaUserDetail

public UserDetail getAgendaUserDetail()
Get userDetail for this agenda

Parameters:
userDetail -

getAgendaUserId

public String getAgendaUserId()
Get userId for this agenda

Parameters:
userDetail -

isOtherAgendaMode

public boolean isOtherAgendaMode()
If current agenda is for another user

Returns:
true or false

getImportSettings

public CalendarImportSettings getImportSettings()
Get synchronisation user settings

Returns:
CalendarImportSettings object containing user settings, null if no settings found

saveUserSettings

public void saveUserSettings(CalendarImportSettings importSettings)
                      throws AgendaException
Save synchronisation user settings

Parameters:
importSettings - CalendarImportSettings object containing user settings
Throws:
AgendaException
See Also:
CalendarImportSettings

updateUserSettings

public void updateUserSettings(CalendarImportSettings importSettings)
                        throws AgendaException
Update synchronisation user settings

Parameters:
importSettings - CalendarImportSettings object containing user settings
Throws:
AgendaException
See Also:
CalendarImportSettings

exportIcalAgenda

public String exportIcalAgenda(String startDate,
                               String endDate)
                        throws Exception
Export SilverpeasCalendar in Ical format

Parameters:
startDate -
endDate -
Returns:
ReturnCode (0=ok, 1=Empty)
Throws:
Exception

exportIcalAgenda

public String exportIcalAgenda()
                        throws Exception
Throws:
Exception

importIcalAgenda

public String importIcalAgenda(File fileCalendar)
                        throws Exception
Export SilverpeasCalendar in Ical format

Parameters:
startDate -
endDate -
Returns:
ReturnCode (See ReturnCodes)
Throws:
Exception

synchroIcalAgenda

public String synchroIcalAgenda(String urlICalendar,
                                String loginIcalendar,
                                String pwdIcalendar)
                         throws Exception
Synchronize localResourceLocator agenda with URLIcalendar

Parameters:
urlICalendar -
loginIcalendar -
pwdIcalendar -
Returns:
ReturnCode
Throws:
Exception

synchroIcalAgenda

public String synchroIcalAgenda(String urlICalendar)
                         throws Exception
Synchronize localResourceLocator agenda with URLIcalendar

Parameters:
urlICalendar -
Returns:
ReturnCode
Throws:
Exception

getHolidaysDatesInDb

public List<String> getHolidaysDatesInDb()
                                  throws RemoteException
Get days off defined for this agenda user

Returns:
List of HolidayDetail (yyyy/mm/dd, userId)
Throws:
RemoteException

changeDateStatus

public void changeDateStatus(String date,
                             String nextStatus)
                      throws RemoteException,
                             ParseException
Throws:
RemoteException
ParseException

changeDayOfWeekStatus

public void changeDayOfWeekStatus(String year,
                                  String month,
                                  String day)
                           throws RemoteException
Change worked or non-worked days status

Parameters:
year -
month -
day -
Throws:
RemoteException
ParseException

isHolidayDate

public boolean isHolidayDate(Date date)
Ask if a date is a day off

Parameters:
date -
Returns:

isHolidayDate

public boolean isHolidayDate(String agendaUserId,
                             Date date)
Ask if a date is a day off

Parameters:
date -
Returns:

isSameDaysAreHolidays

public boolean isSameDaysAreHolidays(Calendar cal,
                                     int currentMonth)
Ask if the same days of the month are all holidays

Parameters:
cal -
month - (0=january, etc...)
Returns:
true or false

getMyAgendaUrl

public String getMyAgendaUrl()
Get url access to my diary

Returns:
String

getCurrentViewType

public String getCurrentViewType()
Get view Type (by Day, Week, Month ou Year)

Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.