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
public class TagDeletedObserver extends AbstractTagObserver
Tag addedObserver
: - Clear the cache. - Update contents tagged with this tag or a descendant tag and send the CONTENT_TAGGED event.
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user providerprotected ObservationManager
_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
Constructors Constructor Description TagDeletedObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
supports(Event event)
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 Detail
-
_observationManager
protected ObservationManager _observationManager
Observer manager.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
-
Constructor Detail
-
TagDeletedObserver
public TagDeletedObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractTagObserver
- Throws:
ServiceException
-
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 parent, String tagName, Event rawEvent)
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
protected void _updateTaggedContents(Collection<String> tagNames) throws Exception
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
protected void _updateTaggedContent(Content content, Collection<String> tagNames)
Update the tagged content. Remove deleted tags on the content and send the CONTENT_TAGGED event.- Parameters:
content
- the tagged contenttagNames
- the tags' name
-
-