Package org.ametys.web.tags.observers
Class TagUpdatedObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.indexing.observation.AbstractLiveSolrObserver
-
- org.ametys.web.tags.observers.AbstractTagObserver
-
- org.ametys.web.tags.observers.TagUpdatedObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
public class TagUpdatedObserver extends AbstractTagObserver
Tag addedObserver
: - Clear the cache. - Re-index contents tagged with this tag or a descendant tag.
-
-
Field Summary
-
Fields inherited from class org.ametys.web.tags.observers.AbstractTagObserver
_tagProviderEP
-
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 TagUpdatedObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_reindexContent(Content content)
Re-index the given contentprotected void
_reindexTaggedContents(Collection<String> descendantNames)
Re-index content tagged with at least of this tagsprotected void
observe(Site site, AmetysObject aoTag, String tagName, Event rawEvent)
Typed observe methodboolean
supports(Event event)
Checks if the event is supported.-
Methods inherited from class org.ametys.web.tags.observers.AbstractTagObserver
_clearCache, _getSite, _getTaggedContents, _updateIndex, service
-
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
-
-
-
-
Constructor Detail
-
TagUpdatedObserver
public TagUpdatedObserver()
-
-
Method Detail
-
supports
public boolean supports(Event event)
Description copied from interface:Observer
Checks if the event is supported. If true, the observe(Event) method will be called.- Parameters:
event
- the event.- Returns:
true
for observing this event,false
otherwise.
-
observe
protected void observe(Site site, AmetysObject aoTag, String tagName, Event rawEvent)
Description copied from class:AbstractTagObserver
Typed observe method- Specified by:
observe
in classAbstractTagObserver
- Parameters:
site
- the siteaoTag
- 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.
-
_reindexTaggedContents
protected void _reindexTaggedContents(Collection<String> descendantNames) throws Exception
Re-index content tagged with at least of this tags- Parameters:
descendantNames
- the descendant's name- Throws:
Exception
- if an error occurs
-
_reindexContent
protected void _reindexContent(Content content) throws Exception
Re-index the given content- Parameters:
content
- the content to re-index- Throws:
Exception
- if unable to create or update the index
-
-