public abstract class AbstractContentObserver extends AbstractLogEnabled implements Observer, Serviceable, Contextualizable
Observer
for observing validation of User content.Modifier and Type | Field and Description |
---|---|
protected Context |
_cocoonContext
Cocoon context.
|
protected ContentTypesHelper |
_contentTypeHelper
The content type helper
|
protected Context |
_context
The context.
|
protected OrganisationChartPageResolver |
_organisationChartPageResolver
The resolver for ud orgunits pages
|
protected AmetysObjectResolver |
_resolver
Ametys object resolver.
|
protected UserDirectoryPageResolver |
_userDirectoryPageResolver
The resolver for user directory pages
|
protected PageElementCache |
_zoneItemCache
The page element cache
|
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
AbstractContentObserver() |
Modifier and Type | Method and Description |
---|---|
protected AmetysObjectIterable<Page> |
_getOrgUnitRootPages()
Get the orgUnit root pages
|
protected Content |
_getTarget(Event event)
Retrieve the target of the observer
|
protected AmetysObjectIterable<Page> |
_getUserRootPages()
Get the user root pages
|
protected 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 content
|
protected boolean |
_isUserContent(Content content)
Return true if the content is a user content
|
protected void |
_removeZoneItemCache(Page rootPage,
Content content,
String workspace)
Remove zone item cache
|
void |
contextualize(Context context) |
void |
observe(Event event,
Map<String,Object> transientVars)
Observes an event.
|
void |
service(ServiceManager manager) |
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPriority, supports
protected Context _cocoonContext
protected AmetysObjectResolver _resolver
protected ContentTypesHelper _contentTypeHelper
protected PageElementCache _zoneItemCache
protected UserDirectoryPageResolver _userDirectoryPageResolver
protected OrganisationChartPageResolver _organisationChartPageResolver
public AbstractContentObserver()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void observe(Event event, Map<String,Object> transientVars)
Observer
protected abstract void _internalObserve(Event event, Page rootUsersPage, Content userContent)
event
- the observation event.rootUsersPage
- the page holding the virtual user pagesuserContent
- a list containing all impacted user contents.protected AmetysObjectIterable<Page> _getUserRootPages()
protected AmetysObjectIterable<Page> _getOrgUnitRootPages()
protected Content _getTarget(Event event) throws Exception
event
- The eventException
- if failed to get contentprotected boolean _isUserContent(Content content)
content
- the contentprotected boolean _isOrgUnitContent(Content content)
content
- the contentprotected void _removeZoneItemCache(Page rootPage, Content content, String workspace)
rootPage
- the root pagecontent
- the contentworkspace
- the workspace