Class WorkspaceCalendarDAO

    • Method Detail

      • addEvent

        public Map<String,​ObjectaddEvent​(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 occurred
        IllegalAccessException - If the user does not have the right to add an event
      • editEvent

        public Map<String,​ObjecteditEvent​(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
      • getCalendarData

        public Map<String,​ObjectgetCalendarData​(Calendar calendar,
                                                        boolean recursive,
                                                        boolean includeEvents)
        Description copied from class: CalendarDAO
        Get calendar info
        Overrides:
        getCalendarData in class CalendarDAO
        Parameters:
        calendar - The calendar
        recursive - True to get data for sub calendars
        includeEvents - True to also include child events
        Returns:
        the calendar data in a map
      • getWorkflows

        public List<Map<String,​Object>> getWorkflows​(boolean withSteps)
        Retrieves the available workflows for the calendars
        Parameters:
        withSteps - true to include the list of steps and corresponding actions
        Returns:
        The list of workflow. Each entry is a map of data (id, label)
      • getWorkflowState

        public Map<String,​ObjectgetWorkflowState​(String eventId)
        Get the workflow state of an event
        Parameters:
        eventId - The id of the event
        Returns:
        A map containing information about the workflow state
      • getCalendarIcsToken

        public Map<String,​ObjectgetCalendarIcsToken​(String calendarId)
        Get the ICS token for the given calendar
        Parameters:
        calendarId - The calendar id
        Returns:
        The ICS token
      • getCalendarIcsToken

        public String getCalendarIcsToken​(Calendar calendar,
                                          boolean createIfNotExisting)
        Get or create the calendar ICS token
        Parameters:
        calendar - The calendar
        createIfNotExisting - Create the token if none exists for the given calendar
        Returns:
        The token
      • getCalendarFromIcsToken

        public Calendar getCalendarFromIcsToken​(String token)
        Retrieve the calendar for the matching ICS token
        Parameters:
        token - The ICS token
        Returns:
        The calendar, or null if not found
      • _getSteps

        protected List<Map<String,​Object>> _getSteps​(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
        Get the steps of a workflow
        Parameters:
        workflowDescriptor - workflow descriptor
        Returns:
        The list of steps
      • _getStep

        protected Map<String,​Object_getStep​(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor,
                                                    com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
        Get a map of data about a step
        Parameters:
        workflowDescriptor - workflow descriptor
        stepDescriptor - step descriptor
        Returns:
        The map of data
      • _getActions

        protected List<Map<String,​Object>> _getActions​(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
        Get the actions of a workflow
        Parameters:
        workflowDescriptor - workflow descriptor
        Returns:
        The list of steps
      • _getAction

        protected Map<String,​Object_getAction​(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor,
                                                      com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
        Get a map of data about an action
        Parameters:
        workflowDescriptor - workflow descriptor
        actionDescriptor - action descriptor
        Returns:
        The map of data
      • _extractEventRightData

        protected Map<String,​Object_extractEventRightData​(CalendarEvent event)
        Internal method to extract the data concerning the right of the current user for an event
        Parameters:
        event - The event
        Returns:
        The map of right data. Keys are the rights id, and values indicates whether the current user has the right or not.
      • _extractCalendarRightData

        protected Map<String,​Object_extractCalendarRightData​(Calendar calendar)
        Internal method to extract the data concerning the right of the current user for a calendar
        Parameters:
        calendar - The calendar
        Returns:
        The map of right data. Keys are the rights id, and values indicates whether the current user has the right or not.
      • _sanitizeEventLocationsInput

        protected String _sanitizeEventLocationsInput​(Collection<String> locations)
        Sanitize the locations parameters received as input
        Parameters:
        locations - collection of locations passed as an input
        Returns:
        The sanitized location, a single string that represent a comma-separated list of locations