Class CalendarResourceDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO
org.ametys.plugins.workspaces.calendars.resources.CalendarResourceDAO
- All Implemented Interfaces:
- Component,- Contextualizable,- LogEnabled,- Serviceable
Calendar Resource DAO
- 
Field SummaryFieldsFields inherited from class org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO_calendarColors, _context, _currentUserProvider, _explorerResourcesDAO, _messagingConnectorCalendarManager, _observationManager, _projectManager, _projectTagsDAO, _resolver, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceModuleEP, 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_DELETE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ModifiableTraversableAmetysObject_getCalendarResourcesRoot(String projectName) Get the resources rootprotected List<CalendarEvent>_getEvents(ZonedDateTime startDate, ZonedDateTime endDate) Get the events between two datesaddResource(String title, String icon, String instructions, boolean renameIfExists) Add a calendardeleteResource(String id) Delete a calendareditResource(String id, String title, String icon, String instructions) Edit a resourcegetCalendarResourceData(CalendarResource calendarResource) Get calendar infogetProjectResources(Project project) Get all resources from given projetsGet the resources from projectloadResourcesWithAvailability(String eventId, String startDateAsStr, String endDateAsStr, String eventStartDateAsStr, String eventEndDateAsStr, String recurrenceType, boolean isFullDay, String originalOccurrenceStartAsStr, String zoneIdAsString) Get all available resources between two dates for a given idMethods inherited from class org.ametys.plugins.workspaces.calendars.AbstractCalendarDAO_getProject, _getProjectName, contextualize, serviceMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabledenableLogging, getLogger, setupLogger, setupLogger, setupLogger
- 
Field Details- 
ROLEAvalon Role
 
- 
- 
Constructor Details- 
CalendarResourceDAOpublic CalendarResourceDAO()
 
- 
- 
Method Details- 
deleteResourceDelete a calendar- Parameters:
- id- The id of the calendar
- Returns:
- The result map with id, parent id and message keys
- Throws:
- IllegalAccessException- If the user has no sufficient rights
 
- 
_getCalendarResourcesRootGet the resources root- Parameters:
- projectName- the project name
- Returns:
- the resources root
 
- 
getResourcesGet the resources from project- Returns:
- the list of resources
- Throws:
- IllegalAccessException- If an error occurs when checking the rights
 
- 
getProjectResourcesGet all resources from given projets- Parameters:
- project- the project
- Returns:
- All resources as JSON
 
- 
getCalendarResourceDataGet calendar info- Parameters:
- calendarResource- The calendar
- Returns:
- the calendar data in a map
 
- 
addResourcepublic Map<String,Object> addResource(String title, String icon, String instructions, boolean renameIfExists) throws IllegalAccessException Add a calendar- Parameters:
- title- The resource title
- icon- The resource icon
- instructions- The resource instructions
- renameIfExists- True to rename if existing
- Returns:
- The result map with id, parentId and name keys
- Throws:
- IllegalAccessException- If the user has no sufficient rights
 
- 
editResourcepublic Map<String,Object> editResource(String id, String title, String icon, String instructions) throws IllegalAccessException Edit a resource- Parameters:
- id- The id of the resource
- title- The resource title
- icon- The resource icon
- instructions- The resource instructions
- Returns:
- The result map with id, parentId and name keys
- Throws:
- IllegalAccessException- If the user has no sufficient rights
 
- 
loadResourcesWithAvailabilitypublic List<Map<String,Object>> loadResourcesWithAvailability(String eventId, String startDateAsStr, String endDateAsStr, String eventStartDateAsStr, String eventEndDateAsStr, String recurrenceType, boolean isFullDay, String originalOccurrenceStartAsStr, String zoneIdAsString) Get all available resources between two dates for a given id- Parameters:
- eventId- the event id
- startDateAsStr- The start date.
- endDateAsStr- The end date.
- eventStartDateAsStr- The start date.
- eventEndDateAsStr- The end date.
- recurrenceType- The recurrence type.
- isFullDay- Is the event full day
- originalOccurrenceStartAsStr- original occurrence start date
- zoneIdAsString- The zone ID used for the dates
- Returns:
- All available resources as JSON
 
- 
_getEventsGet the events between two dates- Parameters:
- startDate- Begin date
- endDate- End date
- Returns:
- the list of events
 
 
-