Class CalendarWorkspaceModule
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceModule
org.ametys.plugins.workspaces.calendars.CalendarWorkspaceModule
- All Implemented Interfaces:
Comparable<WorkspaceModule>,WorkspaceModule,LogEnabled,PluginAware,Configurable,Contextualizable,Serviceable
Helper component for managing calendars
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classCompares events on their starting date -
Field Summary
FieldsFields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceModule
__SIZE_ERROR, __SIZE_INACTIVE, _activityStream, _context, _currentUserProvider, _i18nUtils, _modulesEP, _observationManager, _pageDAO, _pluginName, _projectManager, _projectRightHelper, _resolver, _rightManager, _serviceEP, _skinsManager, _userHelper, _userManagerFields inherited from interface org.ametys.plugins.workspaces.project.modules.WorkspaceModule
GROUP_HEADER_ACTIVATED_ID, GROUP_HEADER_ELEMENTS_ID, GROUP_HEADER_LAST_ACTIVITY_ID, GROUP_HEADER_SIZE_ID, ORDER_ABOUT, ORDER_ALERTS, ORDER_CALENDAR, ORDER_DOCUMENTS, ORDER_FORUMS, ORDER_MEMBERS, ORDER_MINISITE, ORDER_NEWS, ORDER_TASKS, ORDER_WALLCONTENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_addAdditionalEventData(CalendarEvent event, Map<String, Object> eventData) Add additional information on project and parent calendarGet the headers of statistics_getInternalStatistics(Project project, boolean isActive) Get the internal statistics of the moduleprotected void_internalActivateModule(Project project, Map<String, Object> additionalValues) Internal process when module is activatedbooleanIndicates if the current user can view the calendarbooleancanView(CalendarEvent event) Indicates if the current user can view the eventvoidconfigure(Configuration configuration) createResourceCalendar(Project project, Map<String, Object> additionalValues) Create a calendar to store resources if neededGet the set of all event type for the moduleGet the set of allowed event type for the modulegetCalendarResourcesRoot(Project project, boolean create) Get the root for tasksgetCalendars(Project project) Get the calendars of a projectgetCalendarsRoot(Project project, boolean create) Get the root for tasksgetEventUri(Project project, String calendarId, String eventId) Get the URI of a thread in project'sitegetId()Get the module Idprotected StringGet the lang for this project, or fr if none foundGet the module titleGet the module nameprotected StringReturns the module page's nameprotected I18nizableTextReturns the module page's title as i18nGet the module titleintgetOrder()Get the module ordergetResourceCalendar(Project project) Get the calendars of a projectgetResourceCalendarRoot(Project project, boolean create) Get the root for tasksgetUpcomingEvents(int months, int maxResults, List<String> calendarIds, List<String> tagIds) Get the upcoming events of the calendars on which the user has a rightprotected voidinitializeModulePage(ModifiablePage calendarPage) Initialize the module pagevoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceModule
_createModulePage, _deleteActivities, _deletePages, _getAmetysObject, _getDefaultXslt, _getModuleLastActivity, _getModulePages, _getModuleSize, _internalDeactivateModule, _internalDeleteData, _setPagesVisibility, _showActivatedStatus, _showLastActivity, _showModuleSize, activateModule, contextualize, deactivateModule, deleteData, getModulePageTemplate, getModuleRoot, getModuleSizeKey, getModuleUrl, getStatisticModel, getStatistics, initializeSitemap, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.workspaces.project.modules.WorkspaceModule
compareTo, isUnactivatedByDefault
-
Field Details
-
CALENDAR_MODULE_ID
The id of calendar module
-
-
Constructor Details
-
CalendarWorkspaceModule
public CalendarWorkspaceModule()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractWorkspaceModule- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getId
Description copied from interface:WorkspaceModuleGet the module Id- Specified by:
getIdin interfaceWorkspaceModule- Returns:
- The module ID
-
getOrder
Description copied from interface:WorkspaceModuleGet the module order- Specified by:
getOrderin interfaceWorkspaceModule- Returns:
- the priority in menus
-
getModuleName
Description copied from interface:WorkspaceModuleGet the module name- Specified by:
getModuleNamein interfaceWorkspaceModule- Returns:
- the module name
-
getModulePageName
Description copied from class:AbstractWorkspaceModuleReturns the module page's name- Specified by:
getModulePageNamein classAbstractWorkspaceModule- Returns:
- The module page's name
-
getModuleTitle
Description copied from interface:WorkspaceModuleGet the module title- Specified by:
getModuleTitlein interfaceWorkspaceModule- Returns:
- The title
-
getModuleDescription
Description copied from interface:WorkspaceModuleGet the module title- Specified by:
getModuleDescriptionin interfaceWorkspaceModule- Returns:
- The title
-
getModulePageTitle
Description copied from class:AbstractWorkspaceModuleReturns the module page's title as i18n- Specified by:
getModulePageTitlein classAbstractWorkspaceModule- Returns:
- The module page's title
-
initializeModulePage
Description copied from class:AbstractWorkspaceModuleInitialize the module page- Specified by:
initializeModulePagein classAbstractWorkspaceModule- Parameters:
calendarPage- The module page
-
getCalendars
Get the calendars of a project- Parameters:
project- The project- Returns:
- The list of calendar
-
getEventUri
Get the URI of a thread in project'site- Parameters:
project- The projectcalendarId- The id of calendareventId- The id of event- Returns:
- The thread uri
-
_addAdditionalEventData
Add additional information on project and parent calendar- Parameters:
event- The eventeventData- The event data to complete
-
getUpcomingEvents
public List<Map<String,Object>> getUpcomingEvents(int months, int maxResults, List<String> calendarIds, List<String> tagIds) Get the upcoming events of the calendars on which the user has a right- Parameters:
months- the amount of months from today in which look for upcoming eventsmaxResults- the maximum results to displaycalendarIds- the ids of the calendars to gather events from, null for all calendarstagIds- the ids of the valid tags for the events, null for any tag- Returns:
- the upcoming events
-
canView
Indicates if the current user can view the calendar- Parameters:
calendar- The calendar to test- Returns:
- true if the calendar can be viewed
-
canView
Indicates if the current user can view the event- Parameters:
event- The event to test- Returns:
- true if the event can be viewed
-
getAllowedEventTypes
Description copied from interface:WorkspaceModuleGet the set of allowed event type for the module- Specified by:
getAllowedEventTypesin interfaceWorkspaceModule- Returns:
- The set of allowed event types
-
_internalActivateModule
Description copied from class:AbstractWorkspaceModuleInternal process when module is activated- Overrides:
_internalActivateModulein classAbstractWorkspaceModule- Parameters:
project- The projectadditionalValues- A list of optional additional values. Accepted values are : description, mailingList, inscriptionStatus, defaultProfile, tags, categoryTags, keywords and language
-
createResourceCalendar
Create a calendar to store resources if needed- Parameters:
project- the projectadditionalValues- A list of optional additional values. Accepted values are : description, mailingList, inscriptionStatus, defaultProfile, tags, categoryTags, keywords and language- Returns:
- The resource calendar
-
getLang
Get the lang for this project, or fr if none found- Parameters:
project- the project to check- Returns:
- a lang in this project
-
getResourceCalendar
Get the calendars of a project- Parameters:
project- The project- Returns:
- The list of calendar
-
getCalendarResourcesRoot
Get the root for tasks- Parameters:
project- The projectcreate- true to create root if not exists- Returns:
- The root for tasks
-
getCalendarsRoot
Get the root for tasks- Parameters:
project- The projectcreate- true to create root if not exists- Returns:
- The root for tasks
-
getResourceCalendarRoot
Get the root for tasks- Parameters:
project- The projectcreate- true to create root if not exists- Returns:
- The root for tasks
-
_getInternalStatistics
Description copied from class:AbstractWorkspaceModuleGet the internal statistics of the module- Overrides:
_getInternalStatisticsin classAbstractWorkspaceModule- Parameters:
project- The projectisActive- true if module is active- Returns:
- a map of internal statistics
-
_getInternalStatisticModel
Description copied from class:AbstractWorkspaceModuleGet the headers of statistics- Overrides:
_getInternalStatisticModelin classAbstractWorkspaceModule- Returns:
- a list of statistics headers
-
getAllEventTypes
Description copied from interface:WorkspaceModuleGet the set of all event type for the module- Specified by:
getAllEventTypesin interfaceWorkspaceModule- Overrides:
getAllEventTypesin classAbstractWorkspaceModule- Returns:
- The set of all event types
-