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
,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
_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
ORDER_ALERTS, ORDER_CALENDAR, ORDER_DOCUMENTS, ORDER_MEMBERS, ORDER_NEWS, ORDER_TASKS, ORDER_THREADS, ORDER_WALLCONTENT, ORDER_WIKI
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addAdditionalEventData
(CalendarEvent event, Map<String, Object> eventData) Add additional information on project and parent calendaraddCalendar
(String inputName, String description, String templateDesc, String color, String visibility, String workflowName, Boolean renameIfExists) Add a calendarboolean
Indicates if the current user can view the calendarboolean
canView
(CalendarEvent event) Indicates if the current user can view the eventGet the set of allowed event type for the modulegetCalendars
(Project project) Get the calendars of a projectGet the data of every available calendar of the applicationgetCalendarServiceRights
(List<String> calendarIds) Get the rights of the current user for the calendar servicegetEventUri
(Project project, String calendarId, String eventId) Get the URI of a thread in project'sitegetId()
Get the module IdRetrieves the set of general rights used in the calendar module for the current userGet 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 ordergetUpcomingEvents
(int months, int maxResults, List<String> calendarIds, List<String> tagIds) Get the upcoming events of the calendars on which the user has a rightGet 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, _getModulePages, _internalActivateModule, _internalDeactivateModule, _internalDeleteData, _setPagesVisibility, activateModule, contextualize, deactivateModule, deleteData, getModulePageTemplate, getModuleUrl, 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
-
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
-
getId
Description copied from interface:WorkspaceModule
Get the module Id- Returns:
- The module ID
-
getOrder
Description copied from interface:WorkspaceModule
Get the module order- Returns:
- the priority in menus
-
getModuleName
Description copied from interface:WorkspaceModule
Get the module name- 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- Returns:
- The title
-
getModuleDescription
Description copied from interface:WorkspaceModule
Get the module title- 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- 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
-
getModuleBaseRights
Retrieves the set of general rights used in the calendar module for the current user- Returns:
- The map of right data. Keys are the rights id, and values indicates whether the current user has the right or not.
-
getCalendarServiceRights
Get the rights of the current user for the calendar service- Parameters:
calendarIds
- The list of calendars- Returns:
- The rights
-
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
-
addCalendar
public Map<String,Object> addCalendar(String inputName, String description, String templateDesc, String color, String visibility, String workflowName, Boolean renameIfExists) throws IllegalAccessException Add a calendar- Parameters:
inputName
- The desired name for the calendardescription
- The calendar descriptiontemplateDesc
- The calendar template descriptioncolor
- The calendar colorvisibility
- The calendar visibilityworkflowName
- The calendar workflow namerenameIfExists
- True to rename if existing- Returns:
- The result map with id, parentId and name keys
- Throws:
IllegalAccessException
- If the user has no sufficient rights
-
_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(String months, String 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
-
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
-
getCalendarsData
Get the data of every available calendar of the application- Returns:
- the list of calendar data
-
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- Returns:
- The set of allowed event types
-