Class AbstractContentObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.ugc.observation.AbstractContentObserver
- All Implemented Interfaces:
 Observer,LogEnabled,Contextualizable,Serviceable
- Direct Known Subclasses:
 AbstractSolrContentObserver,InvalidateCacheOnContentValidationObserver,InvalidateZoneItemCacheOnContentModificationObserver,InvalidateZoneItemCacheOnContentValidationObserver
public abstract class AbstractContentObserver
extends AbstractLogEnabled
implements Observer, Serviceable, Contextualizable
Abstract 
Observer for observing validation of UGC content.- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextCocoon context.protected ContentTypesHelperThe content type helperprotected ContextThe context.protected AmetysObjectResolverAmetys object resolver.protected UGCPageHandlerThe UGC page handlerprotected PageElementCacheThe page element cacheFields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected Content_getTarget(Event event) Retrieve the target of the observerprotected AmetysObjectIterable<Page>Get the UGC root pagesprotected abstract void_internalObserve(Event event, Page rootPage, Content content) Do the actual work.protected boolean_isUGCContent(Content content, Page rootPage) Return true if the content is a UGC contentprotected void_removeZoneItemCache(Page rootPage, Content content, String workspace) Remove zone item cachevoidcontextualize(Context context) voidObserves an event.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.observation.Observer
getPriority, getTraits, supports 
- 
Field Details
- 
_context
The context. - 
_cocoonContext
Cocoon context. - 
_resolver
Ametys object resolver. - 
_contentTypeHelper
The content type helper - 
_zoneItemCache
The page element cache - 
_ugcPageHandler
The UGC page handler 
 - 
 - 
Constructor Details
- 
AbstractContentObserver
public AbstractContentObserver() 
 - 
 - 
Method Details
- 
contextualize
- Specified by:
 contextualizein interfaceContextualizable- Throws:
 ContextException
 - 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
observe
Description copied from interface:ObserverObserves an event. - 
_internalObserve
Do the actual work.- Parameters:
 event- the observation event.rootPage- the page holding the UGC content pagescontent- the UGC content.
 - 
_getUGCRootPages
Get the UGC root pages- Returns:
 - the UGC root pages
 
 - 
_getTarget
Retrieve the target of the observer- Parameters:
 event- The event- Returns:
 - The target
 - Throws:
 Exception- if failed to get content
 - 
_isUGCContent
Return true if the content is a UGC content- Parameters:
 content- the contentrootPage- the root page- Returns:
 - true if the content is a UGC content
 
 - 
_removeZoneItemCache
Remove zone item cache- Parameters:
 rootPage- the root pagecontent- the contentworkspace- the workspace
 
 -