Class CalendarEventDAO

All Implemented Interfaces:
LogEnabled, Component, Contextualizable, Serviceable

Calendar event DAO
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class AbstractCalendarDAO
      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 date
      endDate - 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 event
      occurrence - 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, IllegalAccessException
      Add 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 action
      calendarViewStartDateAsStr - 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
      IllegalAccessException - 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.WorkflowException
      Edit an event
      Parameters:
      parameters - The map of parameters to perform the action
      calendarViewStartDateAsStr - 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

      public void move(JCRCalendarEvent event, JCRCalendar parent) throws AmetysRepositoryException
      Move a event to another calendar
      Parameters:
      event - The event to move
      parent - 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