Class AbstractContentObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.userdirectory.observation.AbstractContentObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AbstractSolrContentObserver
,InvalidateCacheOnContentValidationObserver
,InvalidateZoneItemCacheOnContentModificationObserver
,InvalidateZoneItemCacheOnContentValidationObserver
,InvalidateZoneItemCacheOnMemberModificationObserver
,UserContentCacheObserver
public abstract class AbstractContentObserver
extends AbstractLogEnabled
implements Observer, Serviceable, Contextualizable
Abstract
Observer
for observing validation of User content.-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
Cocoon context.protected ContentTypesHelper
The content type helperprotected Context
The context.protected OrganisationChartPageResolver
The resolver for ud orgunits pagesprotected AmetysObjectResolver
Ametys object resolver.protected UserDirectoryPageResolver
The resolver for user directory pagesprotected PageElementCache
The page element cacheFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AmetysObjectIterable<Page>
Get the orgUnit root pagesprotected Content
_getTarget
(Event event) Retrieve the target of the observerprotected AmetysObjectIterable<Page>
Get the user root pagesprotected abstract void
_internalObserve
(Event event, Page rootUsersPage, Content userContent) Do the actual work.protected boolean
_isOrgUnitContent
(Content content) Return true if the content is a orgUnit contentprotected boolean
_isUserContent
(Content content) Return true if the content is a user contentprotected void
_removeZoneItemCache
(Page rootPage, Content content, String workspace) Remove zone item cachevoid
contextualize
(Context context) void
Observes an event.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.observation.Observer
getPriority, supports
-
Field Details
-
_context
The context. -
_cocoonContext
Cocoon context. -
_resolver
Ametys object resolver. -
_contentTypeHelper
The content type helper -
_zoneItemCache
The page element cache -
_userDirectoryPageResolver
The resolver for user directory pages -
_organisationChartPageResolver
The resolver for ud orgunits pages
-
-
Constructor Details
-
AbstractContentObserver
public AbstractContentObserver()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
observe
Description copied from interface:Observer
Observes an event. -
_internalObserve
Do the actual work.- Parameters:
event
- the observation event.rootUsersPage
- the page holding the virtual user pagesuserContent
- a list containing all impacted user contents.
-
_getUserRootPages
Get the user root pages- Returns:
- the user root pages
-
_getOrgUnitRootPages
Get the orgUnit root pages- Returns:
- the orgUnit root pages
-
_getTarget
Retrieve the target of the observer- Parameters:
event
- The event- Returns:
- The target
- Throws:
Exception
- if failed to get content
-
_isUserContent
Return true if the content is a user content- Parameters:
content
- the content- Returns:
- true if the content is a user content
-
_isOrgUnitContent
Return true if the content is a orgUnit content- Parameters:
content
- the content- Returns:
- true if the content is a orgUnit content
-
_removeZoneItemCache
Remove zone item cache- Parameters:
rootPage
- the root pagecontent
- the contentworkspace
- the workspace
-