Class AgendaSessionController
- java.lang.Object
-
- org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
-
- org.silverpeas.core.web.tools.agenda.control.AgendaSessionController
-
- All Implemented Interfaces:
Serializable
,ComponentSessionController
,SessionCloseable
public class AgendaSessionController extends AbstractComponentSessionController
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description 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 org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
context
-
-
Constructor Summary
Constructors Constructor Description AgendaSessionController(MainSessionController mainSessionCtrl, ComponentContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 statusvoid
close()
The user session is being in close, close all resources relative to the session.Collection<SchedulableCount>
countMonthSchedulables()
Method declarationString
exportIcalAgenda()
String
exportIcalAgenda(String startDate, String endDate)
Export SilverpeasCalendar in Ical formatUserDetail
getAgendaUserDetail()
Get userDetail for this agendaString
getAgendaUserId()
Get userId for this agendaCollection<Category>
getAllCategories()
methods for categoriesCollection<JournalHeader>
getBusyTime(String userId, Date day)
Method declarationCategory
getCategory()
methods to manage current user stateCategory
getCategory(String categoryId)
Method declarationprotected String
getComponentInstName()
Collection<Attendee>
getCurrentAttendees()
Method declarationCollection<Category>
getCurrentCategories()
Method declarationDate
getCurrentDay()
Method declarationint
getCurrentDisplayType()
Method declarationAgendaHtmlView
getCurrentHtmlView()
Method declarationJournalHeader
getCurrentJournalHeader()
Method declarationString
getCurrentViewType()
Get view Type (by Day, Week, Month ou Year)Collection<JournalHeader>
getDaySchedulables()
Method declarationint
getEndDayInMonth()
Method declarationint
getEndMonth()
Method declarationint
getEndYear()
Method declarationList<String>
getHolidaysDates()
Get Holidays dates in personal agenda (YYYY/MM/JJ)List<String>
getHolidaysDatesInDb()
Get days off defined for this agenda userCalendarImportSettings
getImportSettings()
Get synchronisation user settingsCollection<Attendee>
getJournalAttendees(String journalId)
methods for attendeesCollection<Category>
getJournalCategories(String journalId)
Method declarationJournalHeader
getJournalHeader(String journalId)
Method declarationstatic Date
getMonthFirstDay(Date date)
Method declarationDate
getMonthLastDay(Date date)
Get the last day of the monthCollection<JournalHeader>
getMonthSchedulables(Date date)
Method declarationString
getMyAgendaUrl()
Get url access to my diaryList<Date>
getNonSelectableDays()
NotificationSender
getNotificationSender()
Method declarationParticipationStatus
getParticipationStatus()
Method declarationString
getRSSUrl()
UserDetail
getSelectedUser()
Get a UserDetail of selected user in UserPanelString
getServerURL()
SettingBundle
getSettings()
Method declarationint
getStartDayInMonth()
Method declarationint
getStartDayInWeek()
Method declarationint
getStartMonth()
Method declarationint
getStartYear()
Method declarationCollection<JournalHeader>
getTentativeSchedulables()
Method declarationUserDetail
getUserDetail(String userId)
Method declarationUserDetail[]
getUserList()
Method declarationCollection<Attendee>
getUserSelected()
Retourne une Collection de UserDetail des utilisateurs selectionnés via le userPanelDate
getWeekFirstDay(Date date)
Method declarationDate
getWeekLastDay(Date date)
Method declarationCollection<JournalHeader>
getWeekSchedulables()
Method declarationstatic Date
getYearFirstDay(Date date)
Method declarationboolean
hasTentativeSchedulables()
Method declarationString
importIcalAgenda(File fileCalendar)
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 notboolean
isHolidayDate(String agendaUserId, Date date)
Ask if a date is a day offboolean
isHolidayDate(Date date)
Ask if a date is a day offboolean
isOtherAgendaMode()
If current agenda is for another userboolean
isSameDaysAreHolidays(Calendar cal, int currentMonth)
Ask if the same days of the month are all holidaysvoid
next()
Method declarationvoid
nextDay()
Method declarationvoid
nextMonth()
Method declarationvoid
nextWeek()
Method declarationvoid
nextYear()
Method declarationprotected 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 declarationvoid
previousDay()
Method declarationvoid
previousMonth()
Method declarationvoid
previousWeek()
Method declarationvoid
previousYear()
Method declarationvoid
removeJournal(String id)
Method declarationvoid
saveUserSettings(CalendarImportSettings importSettings)
Save synchronisation user settingsvoid
selectDay(String day)
Method declarationvoid
setAgendaUserDetail(UserDetail userDetail)
Set userDetail for viewing his agendavoid
setCalendarVisible(boolean visible)
Method declarationvoid
setCategory(Category category)
Method declarationvoid
setCurrentAttendees(Collection<Attendee> attendees)
Method declarationvoid
setCurrentCategories(Collection<Category> categories)
Method declarationvoid
setCurrentDay(Date date)
Method declarationvoid
setCurrentJournalHeader(JournalHeader journalHeader)
Method declarationvoid
setHolidaysDates(List<String> list)
Set holidays dates of personal agendavoid
setJournalAttendees(String journalId, String[] userIds)
Method declarationvoid
setJournalCategories(String journalId, String[] categoryIds)
Method declarationvoid
setJournalParticipationStatus(String journalId, String userId, String status)
Method declarationvoid
setNonSelectableDays(List<Date> list)
String
synchroIcalAgenda(String urlICalendar)
Synchronize localResourceLocator agenda with URLIcalendarString
synchroIcalAgenda(String urlICalendar, String loginIcalendar, String pwdIcalendar)
Synchronize localResourceLocator agenda with URLIcalendarvoid
updateJournal(String id, String name, String description, String priority, String classification, Date startDay, String startHour, Date endDay, String endHour)
Method declarationvoid
updateUserSettings(CalendarImportSettings importSettings)
Update synchronisation user settingsvoid
viewByDay()
Method declarationvoid
viewByMonth()
Method declarationvoid
viewByWeek()
Method declarationvoid
viewByYear()
Method declarationvoid
viewChooseDays()
Method declaration-
Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
addClipboardSelection, clipboardPasteDone, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getSelection, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance
-
-
-
-
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 classAbstractComponentSessionController
-
getComponentInstName
protected String getComponentInstName()
-
addJournal
public String addJournal(String name, String description, String priority, String classification, Date startDay, String startHour, Date endDay, String endHour)
- 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)
Method declaration- Parameters:
id
-name
-description
-priority
-classification
-startDay
-startHour
-endDay
-endHour
-- Throws:
CalendarException
RemoteException
-
removeJournal
public void removeJournal(String id)
Method declaration- Parameters:
id
-- Throws:
CalendarException
RemoteException
-
getJournalHeader
public JournalHeader getJournalHeader(String journalId)
Method declaration- Parameters:
journalId
-- Returns:
- Throws:
RemoteException
-
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
-
setJournalParticipationStatus
public void setJournalParticipationStatus(String journalId, String userId, String status) throws AgendaException
Method declaration- Parameters:
journalId
-userId
-status
-- Throws:
AgendaException
-
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
-
getJournalCategories
public Collection<Category> getJournalCategories(String journalId) throws AgendaException
Method declaration- Parameters:
journalId
-- Returns:
- Throws:
AgendaException
-
setJournalCategories
public void setJournalCategories(String journalId, String[] categoryIds) throws AgendaException
Method declaration- Parameters:
journalId
-categoryIds
-- Throws:
AgendaException
-
getUserList
public UserDetail[] getUserList()
Method declaration- Returns:
-
getUserDetail
public UserDetail getUserDetail(String userId)
Method declaration- Overrides:
getUserDetail
in classAbstractComponentSessionController
- Parameters:
userId
-- Returns:
-
getCategory
public Category getCategory()
methods to manage current user state
-
setCategory
public void setCategory(Category category)
Method declaration- Parameters:
category
-
-
getCurrentJournalHeader
public JournalHeader getCurrentJournalHeader()
Method declaration- Returns:
-
setCurrentJournalHeader
public void setCurrentJournalHeader(JournalHeader journalHeader)
Method declaration- Parameters:
journalHeader
-
-
getCurrentAttendees
public Collection<Attendee> getCurrentAttendees()
Method declaration- Returns:
-
setCurrentAttendees
public void setCurrentAttendees(Collection<Attendee> attendees)
Method declaration- Parameters:
attendees
-
-
getCurrentCategories
public Collection<Category> getCurrentCategories()
Method declaration- Returns:
-
setCurrentCategories
public void setCurrentCategories(Collection<Category> categories)
Method declaration- Parameters:
categories
-
-
setCalendarVisible
public void setCalendarVisible(boolean visible)
Method declaration- Parameters:
visible
-
-
getParticipationStatus
public ParticipationStatus getParticipationStatus()
Method declaration- Returns:
-
getNotificationSender
public NotificationSender getNotificationSender()
Method declaration- Returns:
-
getServerURL
public String getServerURL()
- Returns:
-
getSettings
public SettingBundle getSettings()
Method declaration- Specified by:
getSettings
in interfaceComponentSessionController
- Overrides:
getSettings
in classAbstractComponentSessionController
- Returns:
-
viewByDay
public void viewByDay()
Method declaration
-
viewByWeek
public void viewByWeek()
Method declaration
-
viewByMonth
public void viewByMonth()
Method declaration
-
viewByYear
public void viewByYear()
Method declaration
-
viewChooseDays
public void viewChooseDays()
Method declaration
-
getCurrentDisplayType
public int getCurrentDisplayType()
Method declaration- Returns:
-
getCurrentHtmlView
public AgendaHtmlView getCurrentHtmlView() throws RemoteException
Method declaration- Returns:
- Throws:
RemoteException
-
getDaySchedulables
public Collection<JournalHeader> getDaySchedulables()
Method declaration- Returns:
- Throws:
RemoteException
-
getMonthSchedulables
public Collection<JournalHeader> getMonthSchedulables(Date date)
Method declaration- Returns:
- Throws:
RemoteException
-
getWeekSchedulables
public Collection<JournalHeader> getWeekSchedulables()
Method declaration- Returns:
- Throws:
RemoteException
-
countMonthSchedulables
public Collection<SchedulableCount> countMonthSchedulables()
Method declaration- Returns:
- Throws:
RemoteException
-
getBusyTime
public Collection<JournalHeader> getBusyTime(String userId, Date day) throws RemoteException
Method declaration- Parameters:
userId
-day
-- Returns:
- Throws:
RemoteException
-
isDayHasEvents
public boolean isDayHasEvents(String userId, Date day)
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
-
getTentativeSchedulables
public Collection<JournalHeader> getTentativeSchedulables() throws AgendaException
Method declaration- Returns:
- Throws:
AgendaException
-
getCurrentDay
public Date getCurrentDay()
Method declaration- Returns:
-
getStartDayInWeek
public int getStartDayInWeek()
Method declaration- Returns:
-
getStartDayInMonth
public int getStartDayInMonth()
Method declaration- Returns:
-
getEndDayInMonth
public int getEndDayInMonth()
Method declaration- Returns:
-
getStartMonth
public int getStartMonth()
Method declaration- Returns:
-
getEndMonth
public int getEndMonth()
Method declaration- Returns:
-
getStartYear
public int getStartYear()
Method declaration- Returns:
-
getEndYear
public int getEndYear()
Method declaration- Returns:
-
setCurrentDay
public void setCurrentDay(Date date)
Method declaration- Parameters:
date
-
-
selectDay
public void selectDay(String day)
Method declaration- Parameters:
day
-
-
next
public void next()
Method declaration
-
nextDay
public void nextDay()
Method declaration
-
nextWeek
public void nextWeek()
Method declaration
-
nextMonth
public void nextMonth()
Method declaration
-
nextYear
public void nextYear()
Method declaration
-
previous
public void previous()
Method declaration
-
previousDay
public void previousDay()
Method declaration
-
previousWeek
public void previousWeek()
Method declaration
-
previousMonth
public void previousMonth()
Method declaration
-
previousYear
public void previousYear()
Method declaration
-
getWeekFirstDay
public Date getWeekFirstDay(Date date)
Method declaration- Parameters:
date
-- Returns:
-
getWeekLastDay
public Date getWeekLastDay(Date date)
Method declaration- Parameters:
date
-- Returns:
-
getMonthFirstDay
public static Date getMonthFirstDay(Date date)
Method declaration- Parameters:
date
-- Returns:
-
getMonthLastDay
public Date getMonthLastDay(Date date)
Get the last day of the month- Parameters:
date
-- Returns:
- date
-
getYearFirstDay
public static Date getYearFirstDay(Date date)
Method declaration- Parameters:
date
-- Returns:
-
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- Returns:
- Throws:
AgendaException
-
close
public void close()
Description copied from interface:SessionCloseable
The user session is being in close, close all resources relative to the session.- Specified by:
close
in interfaceSessionCloseable
- Overrides:
close
in classAbstractComponentSessionController
-
getHolidaysDates
public List<String> getHolidaysDates()
Get Holidays dates in personal agenda (YYYY/MM/JJ)- Returns:
-
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:
-
getSelectedUser
public UserDetail getSelectedUser()
Get a UserDetail of selected user in UserPanel- 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
-
getAgendaUserId
public String getAgendaUserId()
Get userId for this agenda
-
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 AgendaException
Export SilverpeasCalendar in Ical format- Parameters:
startDate
-endDate
-- Returns:
- ReturnCode (0=ok, 1=Empty)
- Throws:
Exception
AgendaException
-
exportIcalAgenda
public String exportIcalAgenda() throws AgendaException
- Throws:
AgendaException
-
synchroIcalAgenda
public String synchroIcalAgenda(String urlICalendar, String loginIcalendar, String pwdIcalendar) throws MalformedURLException
Synchronize localResourceLocator agenda with URLIcalendar- Parameters:
urlICalendar
-loginIcalendar
-pwdIcalendar
-- Returns:
- ReturnCode
- Throws:
Exception
MalformedURLException
-
synchroIcalAgenda
public String synchroIcalAgenda(String urlICalendar) throws MalformedURLException
Synchronize localResourceLocator agenda with URLIcalendar- Parameters:
urlICalendar
-- Returns:
- ReturnCode
- Throws:
Exception
MalformedURLException
-
getHolidaysDatesInDb
public List<String> getHolidaysDatesInDb()
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
-currentMonth
- (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:
-
-