Class AbstractWorkspacesEventsObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.events.AbstractWorkspacesEventsObserver
-
- All Implemented Interfaces:
Observer,LogEnabled,Serviceable
- Direct Known Subclasses:
AddEventOnCalendarEventUpdatedObserver,AddEventOnMemberAddedObserver,AddEventOnMinisiteModificationObserver,AddEventOnNewsPublishedObserver,AddEventOnResourceUpdatedObserver,AddEventOnTaskUpdatedObserver,AddEventOnThreadUpdatedObserver,AddEventOnWallContentAddedObserver
public abstract class AbstractWorkspacesEventsObserver extends AbstractLogEnabled implements Observer, Serviceable
Observerimplementation for workspaces' events
-
-
Field Summary
Fields Modifier and Type Field Description protected EventTypeExtensionPoint_eventTypeExtensionPointEvent type extension pointstatic StringNODE_ID_EVENT_TRANSIENT_VARNode id stored as a transient var-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractWorkspacesEventsObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>getEventParameters(Event event, Project project)Get the event's parametersintgetPriority(Event event)Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.protected ProjectgetProject(AmetysObject ao)Get the parent projectvoidservice(ServiceManager serviceManager)protected voidstoreEvent(Event event, Project project, Map<String,Object> transientVars)Store the event-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
NODE_ID_EVENT_TRANSIENT_VAR
public static final String NODE_ID_EVENT_TRANSIENT_VAR
Node id stored as a transient var- See Also:
- Constant Field Values
-
_eventTypeExtensionPoint
protected EventTypeExtensionPoint _eventTypeExtensionPoint
Event type extension point
-
-
Constructor Detail
-
AbstractWorkspacesEventsObserver
public AbstractWorkspacesEventsObserver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getPriority
public int getPriority(Event event)
Description copied from interface:ObserverRetrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriorityin interfaceObserver- Parameters:
event- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
storeEvent
protected void storeEvent(Event event, Project project, Map<String,Object> transientVars) throws RepositoryException
Store the event- Parameters:
event- The eventproject- The project. Can be nulltransientVars- If future events needs the created node id, it is stored in the transientVars- Throws:
RepositoryException- if failed to store event
-
getEventParameters
protected Map<String,Object> getEventParameters(Event event, Project project)
Get the event's parameters- Parameters:
event- The eventproject- The project. Can not be null- Returns:
- The event's parameters
-
getProject
protected Project getProject(AmetysObject ao)
Get the parent project- Parameters:
ao- The ametys object- Returns:
- The parent project or
nullif not found
-
-