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
Abstract tag
Observer
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
_tagProviderEP
The tag provider EP
-
-
Constructor Details
-
AbstractTagObserver
public AbstractTagObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractLiveSolrObserver
- Throws:
ServiceException
-
_updateIndex
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
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
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
-