Class CalendarEventDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
org.ametys.plugins.workspaces.calendars.events.CalendarEventDAO
- All Implemented Interfaces:
Component,Contextualizable,LogEnabled,Serviceable
Calendar event DAO
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CalendarEventJSONHelperThe tasks list JSON helperstatic final StringAvalon RoleFields inherited from class org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
_calendarColors, _context, _currentUserProvider, _explorerResourcesDAO, _messagingConnectorCalendarManager, _observationManager, _projectManager, _projectTagsDAO, _resolver, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceModuleEP, RIGHTS_BOOK_RESOURCE, RIGHTS_CALENDAR_ADD, RIGHTS_CALENDAR_DELETE, RIGHTS_CALENDAR_EDIT, RIGHTS_EVENT_ADD, RIGHTS_EVENT_DELETE, RIGHTS_EVENT_DELETE_OWN, RIGHTS_EVENT_EDIT, RIGHTS_HANDLE_RESOURCE, RIGHTS_OWNED_EVENT_DELETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd an eventdeleteEvent(String id, String occurrence, String choice) Delete an eventdoWorkflowEventAction(Map<String, Object> parameters) Do an event workflow actionEdit an eventGet the events between two datesgetEvents(ZonedDateTime startDate, ZonedDateTime endDate) Get the events between two datesvoidmove(JCRCalendarEvent event, JCRCalendar parent) Move a event to another calendarvoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
_getProject, _getProjectName, contextualizeMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon Role -
_calendarEventJSONHelper
The tasks list JSON helper
-
-
Constructor Details
-
CalendarEventDAO
public CalendarEventDAO()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractCalendarDAO- Throws:
ServiceException
-
getEvents
Get the events between two dates- Parameters:
startDateAsStr- The start date.endDateAsStr- The end date.- Returns:
- the events between two dates
-
getEvents
Get the events between two dates- Parameters:
startDate- Begin dateendDate- End date- Returns:
- the list of events
-
deleteEvent
public Map<String,Object> deleteEvent(String id, String occurrence, String choice) throws IllegalAccessException Delete an event- Parameters:
id- The id of the eventoccurrence- a string representing the occurrence date (ISO format).choice- The type of modification- Returns:
- The result map with id, parent id and message keys
- Throws:
IllegalAccessException- If the user has no sufficient rights
-
addEvent
public Map<String,Object> addEvent(Map<String, Object> parameters) throws com.opensymphony.workflow.WorkflowException, IllegalAccessExceptionAdd an event- Parameters:
parameters- The map of parameters to perform the action- Returns:
- The map of results populated by the underlying workflow action
- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurredIllegalAccessException- If the user does not have the right to add an event
-
editEvent
public Map<String,Object> editEvent(Map<String, Object> parameters) throws com.opensymphony.workflow.WorkflowExceptionEdit an event- Parameters:
parameters- The map of parameters to perform the action- Returns:
- The map of results populated by the underlying workflow action
- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurred
-
move
Move a event to another calendar- Parameters:
event- The event to moveparent- The new parent calendar- Throws:
AmetysRepositoryException- if an error occurred while moving
-
doWorkflowEventAction
public Map<String,Object> doWorkflowEventAction(Map<String, Object> parameters) throws com.opensymphony.workflow.WorkflowExceptionDo an event workflow action- Parameters:
parameters- The map of action parameters- Returns:
- The map of results populated by the workflow action
- Throws:
com.opensymphony.workflow.WorkflowException- if an error occurred
-