Class CalendarEventDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceDAO
org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
org.ametys.plugins.workspaces.calendars.events.CalendarEventDAO
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,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, _explorerResourcesDAO, _messagingConnectorCalendarManager, 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_DELETEFields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEvent(Map<String, Object> parameters, String calendarViewStartDateAsStr, String calendarViewEndDateAsStr) Add an event and return it.deleteEvent(String id, String occurrence, String choice) Delete an eventdoWorkflowEventAction(Map<String, Object> parameters) Do an event workflow actioneditEvent(Map<String, Object> parameters, String calendarViewStartDateAsStr, String calendarViewEndDateAsStr) Edit 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.AbstractWorkspaceDAO
_checkUserReadingRights, _checkUserRights, _getProject, _getProjectName, _getSitemapLanguage, _getSiteName, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, likeOrUnlikeCommentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
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, String calendarViewStartDateAsStr, String calendarViewEndDateAsStr) throws com.opensymphony.workflow.WorkflowException, IllegalAccessExceptionAdd an event and return it. Use the calendar view dates to compute occurrences between those dates.- Parameters:
parameters- The map of parameters to perform the actioncalendarViewStartDateAsStr- The calendar view start date, compute occurrences after this date.calendarViewEndDateAsStr- The calendar view end date, compute occurrences before this date.- 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, String calendarViewStartDateAsStr, String calendarViewEndDateAsStr) throws com.opensymphony.workflow.WorkflowExceptionEdit an event- Parameters:
parameters- The map of parameters to perform the actioncalendarViewStartDateAsStr- The calendar view start date, compute occurrences after this date.calendarViewEndDateAsStr- The calendar view end date, compute occurrences before this date.- 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
-