public class CalendarDAO extends AbstractLogEnabled implements Serviceable, Component
| Modifier and Type | Field and Description | 
|---|---|
protected CurrentUserProvider | 
_currentUserProvider
The current user provider. 
 | 
protected ExplorerResourcesDAO | 
_explorerResourcesDAO
Explorer resources DAO 
 | 
protected ObservationManager | 
_observationManager
Observer manager. 
 | 
protected AmetysObjectResolver | 
_resolver
Ametys resolver 
 | 
protected RightManager | 
_rightManager
The rights manager 
 | 
protected UserManager | 
_userManager
User manager 
 | 
protected WorkflowHelper | 
_workflowHelper
The workflow helper 
 | 
protected WorkflowProvider | 
_workflowProvider
The workflow provider 
 | 
static String | 
RIGHTS_CALENDAR_ADD
Right to add a calendar 
 | 
static String | 
RIGHTS_CALENDAR_DELETE
Right to delete a calendar 
 | 
static String | 
RIGHTS_CALENDAR_EDIT
Right to edit a calendar 
 | 
static String | 
RIGHTS_EVENT_ADD
Right to add a event 
 | 
static String | 
RIGHTS_EVENT_DELETE
Right to delete a event 
 | 
static String | 
RIGHTS_EVENT_DELETE_OWN
Right to delete_own a event 
 | 
static String | 
RIGHTS_EVENT_EDIT
Right to edit a event 
 | 
static String | 
RIGHTS_EVENT_PROPOSE
Right to propose a event 
 | 
static String | 
RIGHTS_EVENT_REFUSE
Right to refuse a event 
 | 
static String | 
RIGHTS_EVENT_VALIDATE
Right to validate a event 
 | 
static String | 
ROLE
Avalon Role 
 | 
| Constructor and Description | 
|---|
CalendarDAO()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected Map<String,Object> | 
_getEventDataFullInfo(CalendarEvent event)
Retrieves the event additional info (rights, parent id, etc...) 
 | 
protected Set<String> | 
_getUserRights(ExplorerNode node)
Get the user rights on the resource collection 
 | 
Map<String,Object> | 
addCalendar(String id,
           String inputName,
           String description,
           String templateDesc,
           String color,
           String visibility,
           String workflowName,
           Boolean renameIfExists)
Add a calendar 
 | 
Map<String,Object> | 
deleteCalendar(String id)
Delete a calendar 
 | 
Map<String,Object> | 
deleteEvent(String id,
           String occurrence,
           String choice)
Delete an event 
 | 
Map<String,Object> | 
doWorkflowEventAction(Map<String,Object> parameters)
Do an event workflow action 
 | 
Map<String,Object> | 
editCalendar(String id,
            String inputName,
            String description,
            String templateDesc,
            String color,
            String visibility,
            String workflowName,
            Boolean renameIfExists,
            Boolean fullEdit)
Edit a calendar 
 | 
Map<String,Object> | 
getCalendarData(Calendar calendar,
               boolean recursive,
               boolean includeEvents)
Get calendar info 
 | 
Map<String,Object> | 
getCalendarData(String id,
               boolean recursive,
               boolean includeEvents)
Get calendar info 
 | 
Map<String,Object> | 
getEventData(CalendarEvent event,
            boolean fullInfo)
Get event info 
 | 
Map<String,Object> | 
getEventData(CalendarEvent event,
            Date occurrenceDate,
            boolean fullInfo)
Get event info for a specific occurrence 
 | 
Map<String,Object> | 
getEventDataById(String id,
                boolean fullInfo)
Get event info 
 | 
Map<String,Object> | 
getEventDataById(String id,
                String occurrence,
                boolean fullInfo)
Get event info for a specific occurrence 
 | 
Map<String,Object> | 
getEventOccurrenceData(CalendarEvent event,
                      Date date)
Get info about the occurrence of an event 
 | 
List<Map<String,Object>> | 
getEventsData(List<CalendarEvent> events,
             boolean fullInfo)
Get event info 
 | 
List<Map<String,Object>> | 
getEventsDataByIds(List<String> ids,
                  boolean fullInfo)
Get event info 
 | 
String | 
getTemplateDescription(String calendarId)
Get the template description of a calendar 
 | 
void | 
move(JCRCalendarEvent event,
    JCRCalendar parent)
Move a event to another calendar 
 | 
void | 
service(ServiceManager manager)  | 
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic static final String RIGHTS_CALENDAR_ADD
public static final String RIGHTS_CALENDAR_EDIT
public static final String RIGHTS_CALENDAR_DELETE
public static final String RIGHTS_EVENT_ADD
public static final String RIGHTS_EVENT_EDIT
public static final String RIGHTS_EVENT_PROPOSE
public static final String RIGHTS_EVENT_VALIDATE
public static final String RIGHTS_EVENT_REFUSE
public static final String RIGHTS_EVENT_DELETE
public static final String RIGHTS_EVENT_DELETE_OWN
protected ExplorerResourcesDAO _explorerResourcesDAO
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
protected CurrentUserProvider _currentUserProvider
protected RightManager _rightManager
protected UserManager _userManager
protected WorkflowProvider _workflowProvider
protected WorkflowHelper _workflowHelper
public CalendarDAO()
public void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Map<String,Object> getCalendarData(String id, boolean recursive, boolean includeEvents)
id - The calendar idrecursive - True to get data for sub calendarsincludeEvents - True to also include child eventspublic Map<String,Object> getCalendarData(Calendar calendar, boolean recursive, boolean includeEvents)
calendar - The calendarrecursive - True to get data for sub calendarsincludeEvents - True to also include child eventspublic String getTemplateDescription(String calendarId)
calendarId - The identifier of the calendarpublic List<Map<String,Object>> getEventsDataByIds(List<String> ids, boolean fullInfo)
ids - The event idsfullInfo - true to include full info (rights, parent id, etc...)public List<Map<String,Object>> getEventsData(List<CalendarEvent> events, boolean fullInfo)
events - The eventsfullInfo - true to include full info (rights, parent id, etc...)public Map<String,Object> getEventDataById(String id, boolean fullInfo)
id - The event idfullInfo - true to include full info (rights, parent id, etc...)public Map<String,Object> getEventDataById(String id, String occurrence, boolean fullInfo)
id - The event idoccurrence - a string representing the occurrence date (ISO format).fullInfo - true to include full info (rights, parent id, etc...)public Map<String,Object> getEventData(CalendarEvent event, Date occurrenceDate, boolean fullInfo)
event - The eventoccurrenceDate - the occurrencefullInfo - true to include full info (rights, parent id, etc...)public Map<String,Object> getEventData(CalendarEvent event, boolean fullInfo)
event - The eventfullInfo - true to include full info (rights, parent id, etc...)protected Map<String,Object> _getEventDataFullInfo(CalendarEvent event)
event - The eventprotected Set<String> _getUserRights(ExplorerNode node)
node - The explorer nodepublic Map<String,Object> getEventOccurrenceData(CalendarEvent event, Date date)
event - The eventdate - The start date of the occurrence of the eventpublic Map<String,Object> addCalendar(String id, String inputName, String description, String templateDesc, String color, String visibility, String workflowName, Boolean renameIfExists) throws IllegalAccessException
id - The identifier of the parent in which the calendar will be addedinputName - The desired name for the calendardescription - The calendar descriptiontemplateDesc - The calendar template descriptioncolor - The calendar colorvisibility - The calendar visibilityworkflowName - The calendar workflow namerenameIfExists - True to rename if existingIllegalAccessException - If the user has no sufficient rightspublic Map<String,Object> editCalendar(String id, String inputName, String description, String templateDesc, String color, String visibility, String workflowName, Boolean renameIfExists, Boolean fullEdit) throws IllegalAccessException
id - The identifier of the calendarinputName - The new namedescription - The new descriptiontemplateDesc - The new calendar template descriptioncolor - The calendar colorvisibility - The calendar visibilityworkflowName - The calendar workflow namerenameIfExists - True to rename if existingfullEdit - true to allow full edition, otherwise only the name will be changedIllegalAccessException - If the user has no sufficient rightspublic void move(JCRCalendarEvent event, JCRCalendar parent) throws AmetysRepositoryException
event - The event to moveparent - The new parent calendarAmetysRepositoryException - if an error occurred while movingpublic Map<String,Object> deleteCalendar(String id) throws IllegalAccessException
id - The id of the calendarIllegalAccessException - If the user has no sufficient rightspublic Map<String,Object> doWorkflowEventAction(Map<String,Object> parameters) throws com.opensymphony.workflow.WorkflowException
parameters - The map of action parameterscom.opensymphony.workflow.WorkflowException - if an error occurredpublic Map<String,Object> deleteEvent(String id, String occurrence, String choice) throws IllegalAccessException
id - The id of the eventoccurrence - a string representing the occurrence date (ISO format).choice - The type of modificationIllegalAccessException - If the user has no sufficient rights