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 CalendarDAOThe calendar DAOprotected 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_EXPORT_ICS_LINK, RIGHTS_HANDLE_RESOURCE, RIGHTS_OWNED_EVENT_DELETEFields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectRightHelper, _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 eventgetCalenderEventById(String eventId) Get an event by idgetEventByID(String id) Get an event by idGet 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
_checkReadAccess, _checkUserReadingRights, _checkUserRights, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, getProjectName, getSitemapLanguage, getSiteName, likeOrUnlikeCommentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_calendarEventJSONHelper
The tasks list JSON helper -
_calendarDAO
The calendar DAO
-
-
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
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
-
addEvent
public Map<String,Object> addEvent(Map<String, Object> parameters, String calendarViewStartDateAsStr, String calendarViewEndDateAsStr) throws com.opensymphony.workflow.WorkflowExceptionAdd 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 occurred
-
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
-
getEventByID
Get an event by id- Parameters:
id- The id of the event- Returns:
- The event as a JSON map
-
getCalenderEventById
Get an event by id- Parameters:
eventId- The id of the event- Returns:
- The event
-