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
Observer
implementation for workspaces' events
-
-
Field Summary
Fields Modifier and Type Field Description protected EventTypeExtensionPoint
_eventTypeExtensionPoint
Event type extension pointstatic String
NODE_ID_EVENT_TRANSIENT_VAR
Node 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 parametersint
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.protected Project
getProject(AmetysObject ao)
Get the parent projectvoid
service(ServiceManager serviceManager)
protected void
storeEvent(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:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPriority
public int getPriority(Event event)
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Specified by:
getPriority
in 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
null
if not found
-
-