Package org.ametys.web.attachments
Class PageAttachmentsSolrObserver
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
org.ametys.web.attachments.PageAttachmentsSolrObserver
- All Implemented Interfaces:
AsyncObserver
,Observer
,LogEnabled
,Contextualizable
,Serviceable
Listener on page attachments events
-
Field Summary
Fields inherited from class org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
_context, _resolver, _solrIndexer, DISABLE_INDEXING_KEY
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
Get the list of workspace to indexprotected boolean
isHandledResource
(AmetysObject object) Returns true if it is aResource
orResourceCollection
handled by this observerprotected void
onCollectionRenamedOrMoved
(ResourceCollection resourceCollection, String workspaceName) Method called when a resource collection handled by this observer is renamed or moved.protected void
onResourceCreated
(Resource resource, String workspaceName) Method called when a resource handled by this observer is created.protected void
onResourceUpdated
(Resource resource, String workspaceName) Method called when a resource handled by this observer is updated, moved or renamed.void
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.cms.indexing.explorer.AbstractSolrIndexResourceObserver
_index, contextualize, getPriority, observe, supports
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.observation.AsyncObserver
parallelizable
-
Field Details
-
_solrPageIndexer
The Solr page indexer
-
-
Constructor Details
-
PageAttachmentsSolrObserver
public PageAttachmentsSolrObserver()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSolrIndexResourceObserver
- Throws:
ServiceException
-
getWorkspacesToIndex
Description copied from class:AbstractSolrIndexResourceObserver
Get the list of workspace to index- Specified by:
getWorkspacesToIndex
in classAbstractSolrIndexResourceObserver
- Returns:
- An array of workspace names
-
isHandledResource
Description copied from class:AbstractSolrIndexResourceObserver
Returns true if it is aResource
orResourceCollection
handled by this observer- Specified by:
isHandledResource
in classAbstractSolrIndexResourceObserver
- Parameters:
object
- The resource or collection- Returns:
- true if it is handled by this observer
-
onResourceCreated
Description copied from class:AbstractSolrIndexResourceObserver
Method called when a resource handled by this observer is created. Typically for indexing the created resource.- Specified by:
onResourceCreated
in classAbstractSolrIndexResourceObserver
- Parameters:
resource
- The created resourceworkspaceName
- The workspace name- Throws:
Exception
- if an error occurs
-
onResourceUpdated
Description copied from class:AbstractSolrIndexResourceObserver
Method called when a resource handled by this observer is updated, moved or renamed. Typically for indexing the updated resource.- Specified by:
onResourceUpdated
in classAbstractSolrIndexResourceObserver
- Parameters:
resource
- The updated resourceworkspaceName
- The workspace name- Throws:
Exception
- if an error occurs
-
onCollectionRenamedOrMoved
protected void onCollectionRenamedOrMoved(ResourceCollection resourceCollection, String workspaceName) throws Exception Description copied from class:AbstractSolrIndexResourceObserver
Method called when a resource collection handled by this observer is renamed or moved. Typically for indexing the children of the resource collection.- Specified by:
onCollectionRenamedOrMoved
in classAbstractSolrIndexResourceObserver
- Parameters:
resourceCollection
- The resource collectionworkspaceName
- The workspace name- Throws:
Exception
- if an error occurs
-