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
public class CalendarEventDAO extends AbstractCalendarDAO
Calendar event DAO
-
-
Field Summary
Fields Modifier and Type Field Description protected CalendarEventJSONHelper
_calendarEventJSONHelper
The tasks list JSON helperstatic String
ROLE
Avalon Role-
Fields 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 Constructor Description CalendarEventDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
addEvent(Map<String,Object> parameters)
Add an eventMap<String,Object>
deleteEvent(String id, String occurrence, String choice)
Delete an eventMap<String,Object>
doWorkflowEventAction(Map<String,Object> parameters)
Do an event workflow actionMap<String,Object>
editEvent(Map<String,Object> parameters)
Edit an eventList<Map<String,Object>>
getEvents(String startDateAsStr, String endDateAsStr)
Get the events between two datesList<CalendarEvent>
getEvents(ZonedDateTime startDate, ZonedDateTime endDate)
Get the events between two datesvoid
move(JCRCalendarEvent event, JCRCalendar parent)
Move a event to another calendarvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
_getProject, _getProjectName, contextualize
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_calendarEventJSONHelper
protected CalendarEventJSONHelper _calendarEventJSONHelper
The tasks list JSON helper
-
-
Constructor Detail
-
CalendarEventDAO
public CalendarEventDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractCalendarDAO
- Throws:
ServiceException
-
getEvents
public List<Map<String,Object>> getEvents(String startDateAsStr, String endDateAsStr)
Get the events between two dates- Parameters:
startDateAsStr
- The start date.endDateAsStr
- The end date.- Returns:
- the events between two dates
-
getEvents
public List<CalendarEvent> getEvents(ZonedDateTime startDate, ZonedDateTime endDate)
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, IllegalAccessException
Add 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.WorkflowException
Edit 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
public void move(JCRCalendarEvent event, JCRCalendar parent) throws AmetysRepositoryException
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.WorkflowException
Do 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
-
-