Class CalendarEventCreatedOrUpdatedEventType
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.repository.events.DefaultEventType
-
- org.ametys.plugins.workspaces.events.WorkspacesEventType
-
- org.ametys.plugins.workspaces.events.calendars.CalendarsEventType
-
- org.ametys.plugins.workspaces.events.calendars.CalendarEventCreatedOrUpdatedEventType
-
- All Implemented Interfaces:
EventType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class CalendarEventCreatedOrUpdatedEventType extends CalendarsEventType
EventType
implementation for the creation of a calendar event
-
-
Field Summary
Fields Modifier and Type Field Description private CalendarWorkspaceModule
_calendarModule
static String
EVENT_CALENDAR_EVENT_ID_PROPERTY
Constant for calendar event's idstatic String
EVENT_CALENDAR_EVENT_TITLE_PROPERTY
Constant for calendar event's title-
Fields inherited from class org.ametys.plugins.workspaces.events.calendars.CalendarsEventType
EVENT_CALENDAR_ID_PROPERTY, EVENT_CALENDAR_TITLE_PROPERTY, EVENT_CATEGORY_CALENDARS
-
Fields inherited from class org.ametys.plugins.workspaces.events.WorkspacesEventType
_projectManager, _resolver, EVENT_PROJECT_CATEGORY_PROPERTY, EVENT_PROJECT_NAME_PROPERTY, EVENT_PROJECT_TITLE_PROPERTY
-
Fields inherited from class org.ametys.plugins.repository.events.DefaultEventType
_currentUserProvider, _userHelper
-
Fields inherited from interface org.ametys.plugins.repository.events.EventType
EVENT_AUTHOR, EVENT_DATE, EVENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description CalendarEventCreatedOrUpdatedEventType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
event2JSON(Node eventNode)
Format an event node to JSONboolean
isMergeable(Map<String,Object> event1, Map<String,Object> event2)
Determines if two events can be mergedMap<String,Object>
mergeEvents(List<Map<String,Object>> events)
Merge events into one event.void
service(ServiceManager serviceManager)
protected void
storeAdditionalEventData(Node eventNode, Map<String,Object> parameters)
Store additional data on event-
Methods inherited from class org.ametys.plugins.repository.events.DefaultEventType
_getAuthor, configure, getSupportedTypes, setPluginInfo, storeEvent
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
EVENT_CALENDAR_EVENT_TITLE_PROPERTY
public static final String EVENT_CALENDAR_EVENT_TITLE_PROPERTY
Constant for calendar event's title- See Also:
- Constant Field Values
-
EVENT_CALENDAR_EVENT_ID_PROPERTY
public static final String EVENT_CALENDAR_EVENT_ID_PROPERTY
Constant for calendar event's id- See Also:
- Constant Field Values
-
_calendarModule
private CalendarWorkspaceModule _calendarModule
-
-
Constructor Detail
-
CalendarEventCreatedOrUpdatedEventType
public CalendarEventCreatedOrUpdatedEventType()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classWorkspacesEventType
- Throws:
ServiceException
-
storeAdditionalEventData
protected void storeAdditionalEventData(Node eventNode, Map<String,Object> parameters) throws RepositoryException
Description copied from class:DefaultEventType
Store additional data on event- Overrides:
storeAdditionalEventData
in classCalendarsEventType
- Parameters:
eventNode
- The event nodeparameters
- The event's parameters- Throws:
RepositoryException
- if an error occurred
-
event2JSON
public Map<String,Object> event2JSON(Node eventNode) throws RepositoryException
Description copied from interface:EventType
Format an event node to JSON- Specified by:
event2JSON
in interfaceEventType
- Overrides:
event2JSON
in classWorkspacesEventType
- Parameters:
eventNode
- the node of an event- Returns:
- the JSON for the node
- Throws:
RepositoryException
- if an error occurs while manipulating the repository
-
isMergeable
public boolean isMergeable(Map<String,Object> event1, Map<String,Object> event2)
Description copied from interface:EventType
Determines if two events can be merged- Specified by:
isMergeable
in interfaceEventType
- Overrides:
isMergeable
in classWorkspacesEventType
- Parameters:
event1
- The first eventevent2
- The second event- Returns:
- true if the events can be merged
-
mergeEvents
public Map<String,Object> mergeEvents(List<Map<String,Object>> events)
Description copied from interface:EventType
Merge events into one event. Be careful : be sure that the events can be merged calling isMergeable method before- Specified by:
mergeEvents
in interfaceEventType
- Overrides:
mergeEvents
in classDefaultEventType
- Parameters:
events
- The events to merge- Returns:
- Merged event
-
-