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
Modifier and TypeClassDescriptionprotected static class
Compares events on their starting date -
Field Summary
Fields 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, _userManager
Fields 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_MEMBERS, ORDER_MINISITE, ORDER_NEWS, ORDER_TASKS, ORDER_THREADS, ORDER_WALLCONTENT
-
Constructor Summary
-
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 activatedboolean
Indicates if the current user can view the calendarboolean
canView
(CalendarEvent event) Indicates if the current user can view the eventvoid
configure
(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 String
Get the lang for this project, or fr if none foundGet the module titleGet the module nameprotected String
Returns the module page's nameprotected I18nizableText
Returns the module page's title as i18ngetModuleRoot
(Project project, boolean create) Get the module root node for the given projectGet the module titleint
getOrder()
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 void
initializeModulePage
(ModifiablePage calendarPage) Initialize the module pagevoid
service
(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceModule
_createModulePage, _deleteEvents, _deletePages, _getAmetysObject, _getDefaultXslt, _getModuleLastActivity, _getModulePages, _getModuleSize, _internalDeactivateModule, _internalDeleteData, _setPagesVisibility, _showActivatedStatus, _showLastActivity, _showModuleSize, activateModule, contextualize, deactivateModule, deleteData, getModulePageTemplate, getModuleSizeKey, getModuleUrl, getStatisticModel, getStatistics, initializeSitemap, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceModule
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getId
Description copied from interface:WorkspaceModule
Get the module Id- Specified by:
getId
in interfaceWorkspaceModule
- Returns:
- The module ID
-
getOrder
Description copied from interface:WorkspaceModule
Get the module order- Specified by:
getOrder
in interfaceWorkspaceModule
- Returns:
- the priority in menus
-
getModuleName
Description copied from interface:WorkspaceModule
Get the module name- Specified by:
getModuleName
in interfaceWorkspaceModule
- Returns:
- the module name
-
getModulePageName
Description copied from class:AbstractWorkspaceModule
Returns the module page's name- Specified by:
getModulePageName
in classAbstractWorkspaceModule
- Returns:
- The module page's name
-
getModuleTitle
Description copied from interface:WorkspaceModule
Get the module title- Specified by:
getModuleTitle
in interfaceWorkspaceModule
- Returns:
- The title
-
getModuleDescription
Description copied from interface:WorkspaceModule
Get the module title- Specified by:
getModuleDescription
in interfaceWorkspaceModule
- Returns:
- The title
-
getModulePageTitle
Description copied from class:AbstractWorkspaceModule
Returns the module page's title as i18n- Specified by:
getModulePageTitle
in classAbstractWorkspaceModule
- Returns:
- The module page's title
-
initializeModulePage
Description copied from class:AbstractWorkspaceModule
Initialize the module page- Specified by:
initializeModulePage
in classAbstractWorkspaceModule
- Parameters:
calendarPage
- The module page
-
getCalendars
Get the calendars of a project- Parameters:
project
- The project- Returns:
- The list of calendar
-
getModuleRoot
Description copied from interface:WorkspaceModule
Get the module root node for the given project- Specified by:
getModuleRoot
in interfaceWorkspaceModule
- Parameters:
project
- The project containing the modulecreate
- True to create the node if it does not exists- Returns:
- The root node, or null if it does not exists and was not created
-
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:WorkspaceModule
Get the set of allowed event type for the module- Specified by:
getAllowedEventTypes
in interfaceWorkspaceModule
- Returns:
- The set of allowed event types
-
_internalActivateModule
Description copied from class:AbstractWorkspaceModule
Internal process when module is activated- Overrides:
_internalActivateModule
in 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:AbstractWorkspaceModule
Get the internal statistics of the module- Overrides:
_getInternalStatistics
in classAbstractWorkspaceModule
- Parameters:
project
- The projectisActive
- true if module is active- Returns:
- a map of internal statistics
-
_getInternalStatisticModel
Description copied from class:AbstractWorkspaceModule
Get the headers of statistics- Overrides:
_getInternalStatisticModel
in classAbstractWorkspaceModule
- Returns:
- a list of statistics headers
-
getAllEventTypes
Description copied from interface:WorkspaceModule
Get the set of all event type for the module- Specified by:
getAllEventTypes
in interfaceWorkspaceModule
- Overrides:
getAllEventTypes
in classAbstractWorkspaceModule
- Returns:
- The set of all event types
-