Package org.ametys.web.tags.observers
Class AbstractTagObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.indexing.observation.AbstractLiveSolrObserver
-
- org.ametys.web.tags.observers.AbstractTagObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
- Direct Known Subclasses:
TagAddedObserver
,TagDeletedObserver
,TagUpdatedObserver
public abstract class AbstractTagObserver extends AbstractLiveSolrObserver
Abstract tagObserver
-
-
Field Summary
Fields Modifier and Type Field Description protected TagProviderExtensionPoint
_tagProviderEP
The tag provider EP-
Fields inherited from class org.ametys.web.indexing.observation.AbstractLiveSolrObserver
_context, _resolver, _solrIndexer, _solrPageIndexer
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractTagObserver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
_clearCache(Site site)
Clear site cacheprotected Site
_getSite(AmetysObject tagOrParent)
Get the site of a jcr tag.protected AmetysObjectIterable<Content>
_getTaggedContents(Collection<String> descendantNames)
Re-index content tagged with at least of this tagsprotected void
_updateIndex(Event event, Map<String,Object> transientVars)
Update the index from the event observed.protected abstract void
observe(Site site, AmetysObject tagOrParent, String tagName, Event rawEvent)
Typed observe methodvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.web.indexing.observation.AbstractLiveSolrObserver
_deletePageDocumentsForContent, _getPageInLive, _updatePageDocument, _updatePageDocument, _updatePageDocumentsForContent, contextualize, getPriority, observe
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_tagProviderEP
protected TagProviderExtensionPoint _tagProviderEP
The tag provider EP
-
-
Constructor Detail
-
AbstractTagObserver
public AbstractTagObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractLiveSolrObserver
- Throws:
ServiceException
-
_updateIndex
protected void _updateIndex(Event event, Map<String,Object> transientVars) throws Exception
Description copied from class:AbstractLiveSolrObserver
Update the index from the event observed.- Specified by:
_updateIndex
in classAbstractLiveSolrObserver
- Parameters:
event
- the event.transientVars
- the transient vars passed from one Observer to another when processing a single Event.- Throws:
Exception
- if an error occurs.
-
observe
protected abstract void observe(Site site, AmetysObject tagOrParent, String tagName, Event rawEvent)
Typed observe method- Parameters:
site
- the sitetagOrParent
- the tag or its parenttagName
- the tag name corresponding the the object tagOrParent when applicable.rawEvent
- The raw event from which the previous arguments have been extracted.
-
_getSite
protected Site _getSite(AmetysObject tagOrParent)
Get the site of a jcr tag.- Parameters:
tagOrParent
- Ametys object which can be a tag or its parent depending on the event type.- Returns:
- The site
-
_clearCache
protected void _clearCache(Site site)
Clear site cache- Parameters:
site
- the site
-
_getTaggedContents
protected AmetysObjectIterable<Content> _getTaggedContents(Collection<String> descendantNames) throws Exception
Re-index content tagged with at least of this tags- Parameters:
descendantNames
- the descendant tags' name- Returns:
- iterable on contents
- Throws:
Exception
- if an error occurs
-
-