Class CalendarEventJSONHelper
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.CalendarEventJSONHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
Helper to convert events to JSON
-
Field Summary
Modifier and TypeFieldDescriptionprotected CalendarDAO
Calendar DAOstatic final String
Avalon 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_HANDLE_RESOURCE, RIGHTS_OWNED_EVENT_DELETE
Fields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_context, _currentUserProvider, _observationManager, _projectManager, _projectTagsDAO, _resolver, _richTextTransformer, _rightManager, _userManager, _workflowHelper, _workflowProvider, _workspaceHelper, _workspaceModuleEP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the event additional info (rights, parent id, etc...)Internal method to extract the data concerning the right of the current user for an event_getUserRights
(ExplorerNode node) Get the user rights on the resource collectioneventAsJson
(CalendarEvent event, boolean fullInfo, boolean useICSFormat) Get event infoeventAsJsonWithOccurrence
(CalendarEvent event, ZonedDateTime occurrenceDate, boolean fullInfo) Get event info for a specific occurrenceeventAsJsonWithOccurrences
(CalendarEvent event, boolean fullInfo, ZonedDateTime startDate, ZonedDateTime endDate) Get event infovoid
service
(ServiceManager manager) Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceDAO
_checkUserReadingRights, _checkUserRights, _getProject, _getProjectName, _getSitemapLanguage, _getSiteName, _handleTags, _hasAfterSubComments, _setAttachments, answerComment, contextualize, createComment, deleteComment, editComment, likeOrUnlikeComment
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_calendarDAO
Calendar DAO
-
-
Constructor Details
-
CalendarEventJSONHelper
public CalendarEventJSONHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractCalendarDAO
- Throws:
ServiceException
-
eventAsJsonWithOccurrence
public Map<String,Object> eventAsJsonWithOccurrence(CalendarEvent event, ZonedDateTime occurrenceDate, boolean fullInfo) Get event info for a specific occurrence- Parameters:
event
- The eventoccurrenceDate
- the occurrencefullInfo
- true to include full info (rights, parent id, etc...)- Returns:
- the event data in a map
-
eventAsJsonWithOccurrences
public Map<String,Object> eventAsJsonWithOccurrences(CalendarEvent event, boolean fullInfo, ZonedDateTime startDate, ZonedDateTime endDate) Get event info- Parameters:
event
- The eventfullInfo
- true to include full info (rights, parent id, etc...)startDate
- The start date.endDate
- The end date.- Returns:
- the event data in a map
-
eventAsJson
Get event info- Parameters:
event
- The eventfullInfo
- true to include full info (rights, parent id, etc...)useICSFormat
- true to use ICS Format for dates- Returns:
- the event data in a map
-
_eventAsJsonFullInfo
Retrieves the event additional info (rights, parent id, etc...)- Parameters:
event
- The event- Returns:
- the event additional info (rights, parent id, etc...) in a map
-
_extractEventRightData
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.
-
_getUserRights
Get the user rights on the resource collection- Parameters:
node
- The explorer node- Returns:
- The user's rights
-