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
Tag added
Observer
:
- 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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 Details
-
TagUpdatedObserver
public TagUpdatedObserver()
-
-
Method Details
-
supports
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
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
Re-index content tagged with at least of this tags- Parameters:
descendantNames
- the descendant's name- Throws:
Exception
- if an error occurs
-
_reindexContent
Re-index the given content- Parameters:
content
- the content to re-index- Throws:
Exception
- if unable to create or update the index
-