Package org.ametys.cms.indexing.solr
Class SolrWorkspaceIndexer
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.indexing.solr.SolrWorkspaceIndexer
- All Implemented Interfaces:
WorkspaceIndexer
,LogEnabled
,Component
,Contextualizable
,Serviceable
- Direct Known Subclasses:
SolrWebWorkspaceIndexer
public class SolrWorkspaceIndexer
extends AbstractLogEnabled
implements WorkspaceIndexer, Component, Serviceable, Contextualizable
Component indexing a workspace in a Solr server.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The component context.protected DocumentProviderExtensionPoint
Additional documents provider extension point.protected javax.jcr.Repository
The repository.protected SolrClientProvider
The Solr client providerprotected SolrIndexer
The solr indexer.protected WorkspaceSelector
The workspace selector.Fields inherited from interface org.ametys.cms.indexing.WorkspaceIndexer
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_createAdditionalDocumentsProgressionTrackerSteps
(ContainerProgressionTracker progressionTracker) Create the progression tracker steps for additional documentsprotected String[]
_sortWorkspacesNames
(String[] workspacesNames) Sort the workspaces names to place the default and archive workspaces at the endvoid
contextualize
(Context context) protected void
Index the given workspace.protected void
doIndex
(String workspaceName, ContainerProgressionTracker progressionTracker) Index the given workspace.String[]
Get the workspaces labelsvoid
Index a workspace.void
index
(String workspaceName, ContainerProgressionTracker progressionTracker) Index a workspace.protected void
indexAdditionalDocuments
(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Index additional documents provided by the extensions.protected void
indexAdditionalDocuments
(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, ContainerProgressionTracker progressionTracker) Index additional documents provided by the extensions.void
Index all the workspaces.void
indexAllWorkspaces
(ContainerProgressionTracker progressionTracker) Index all the workspaces.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_repository
The repository. -
_solrIndexer
The solr indexer. -
_workspaceSelector
The workspace selector. -
_docProviderEP
Additional documents provider extension point. -
_solrClientProvider
The Solr client provider -
_context
The component context.
-
-
Constructor Details
-
SolrWorkspaceIndexer
public SolrWorkspaceIndexer()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getWorkspacesNames
Description copied from interface:WorkspaceIndexer
Get the workspaces labels- Specified by:
getWorkspacesNames
in interfaceWorkspaceIndexer
- Returns:
- The list of labels
- Throws:
javax.jcr.RepositoryException
- If an error occurs
-
_sortWorkspacesNames
Sort the workspaces names to place the default and archive workspaces at the end- Parameters:
workspacesNames
- The workspaces names to sort- Returns:
- The workspacesNames sorted
-
indexAllWorkspaces
Description copied from interface:WorkspaceIndexer
Index all the workspaces.- Specified by:
indexAllWorkspaces
in interfaceWorkspaceIndexer
- Throws:
IndexingException
- If an error occurs while indexing.
-
indexAllWorkspaces
public void indexAllWorkspaces(ContainerProgressionTracker progressionTracker) throws IndexingException Description copied from interface:WorkspaceIndexer
Index all the workspaces.- Specified by:
indexAllWorkspaces
in interfaceWorkspaceIndexer
- Parameters:
progressionTracker
- The progression of the indexation- Throws:
IndexingException
- If an error occurs while indexing.
-
index
Description copied from interface:WorkspaceIndexer
Index a workspace.- Specified by:
index
in interfaceWorkspaceIndexer
- Parameters:
workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs while indexing the workspace.
-
index
public void index(String workspaceName, ContainerProgressionTracker progressionTracker) throws IndexingException Description copied from interface:WorkspaceIndexer
Index a workspace.- Specified by:
index
in interfaceWorkspaceIndexer
- Parameters:
workspaceName
- The workspace name.progressionTracker
- The progression tracker- Throws:
IndexingException
- If an error occurs while indexing the workspace.
-
doIndex
Index the given workspace.- Parameters:
workspaceName
- The workspace name.- Throws:
IndexingException
- If an error occurs indexing the workspace.
-
doIndex
protected void doIndex(String workspaceName, ContainerProgressionTracker progressionTracker) throws IndexingException Index the given workspace.- Parameters:
workspaceName
- The workspace name.progressionTracker
- The progression of the indexation- Throws:
IndexingException
- If an error occurs indexing the workspace.
-
indexAdditionalDocuments
protected void indexAdditionalDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws IndexingException Index additional documents provided by the extensions.- Parameters:
workspaceName
- The workspace name.solrClient
- The solr client to use- Throws:
IndexingException
- If an error occurs while indexing.
-
_createAdditionalDocumentsProgressionTrackerSteps
protected void _createAdditionalDocumentsProgressionTrackerSteps(ContainerProgressionTracker progressionTracker) Create the progression tracker steps for additional documents- Parameters:
progressionTracker
- The progression tracker
-
indexAdditionalDocuments
protected void indexAdditionalDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, ContainerProgressionTracker progressionTracker) throws IndexingException Index additional documents provided by the extensions.- Parameters:
workspaceName
- The workspace name.solrClient
- The solr client to useprogressionTracker
- The progression of the indexation- Throws:
IndexingException
- If an error occurs while indexing.
-