Package org.ametys.web.tags.observers
Class TagDeletedObserver
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.TagDeletedObserver
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
Tag added
Observer
:
- Clear the cache.
- Update contents tagged with this tag or a descendant tag and send the CONTENT_TAGGED event.-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected ObservationManager
Observer manager.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
_updateTaggedContent
(Content content, Collection<String> tagNames) Update the tagged content.protected void
_updateTaggedContents
(Collection<String> tagNames) Update content tagged with at least one of the tag names.protected void
observe
(Site site, AmetysObject parent, String tagName, Event rawEvent) Typed observe methodvoid
service
(ServiceManager manager) boolean
Checks if the event is supported.Methods inherited from class org.ametys.web.tags.observers.AbstractTagObserver
_clearCache, _getSite, _getTaggedContents, _updateIndex
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
-
_observationManager
Observer manager. -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
TagDeletedObserver
public TagDeletedObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractTagObserver
- Throws:
ServiceException
-
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 siteparent
- 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.
-
_updateTaggedContents
Update content tagged with at least one of the tag names. Removes theses tags on the content and send the CONTENT_TAGGED event.- Parameters:
tagNames
- the tags' name- Throws:
Exception
- if an error occurs
-
_updateTaggedContent
Update the tagged content. Remove deleted tags on the content and send the CONTENT_TAGGED event.- Parameters:
content
- the tagged contenttagNames
- the tags' name
-