Class SolrFormEntryIndexer
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.indexing.solr.SolrFormEntryIndexer
- All Implemented Interfaces:
SolrFieldNames,LogEnabled,SolrWebFieldNames,Component,Contextualizable,Serviceable
public class SolrFormEntryIndexer
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable, SolrWebFieldNames
Component for
FormEntry indexing into a Solr server.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextCocoon Contextprotected ContextThe avalon contextprotected FormDAOThe form DAOprotected FormEntryDAOThe form entry DAOprotected ServiceManagerThe service manager.protected AmetysObjectResolverThe ametys object resolver.protected SolrClientProviderThe Solr client providerprotected SolrIndexerThe solr indexer.protected SolrWorkflowIndexerThe solr workflow indexer.protected ThreadIndexerHelperThe thread indexer helperstatic final StringForm id field name.static final StringThe component role.static final StringDocument type for a form entryFields inherited from interface org.ametys.cms.content.indexing.solr.SolrFieldNames
ACL_INIT_VALUE_ALLOWED_GROUPS, ACL_INIT_VALUE_ALLOWED_USERS, ACL_INIT_VALUE_ANONYMOUS, ACL_INIT_VALUE_ANYCONNECTED, ACL_INIT_VALUE_DENIED_GROUPS, ACL_INIT_VALUE_DENIED_USERS, ATTACHMENT_CONTENT_ID, CONTENT_COMMENTS_NONVALIDATED, CONTENT_COMMENTS_VALIDATED, CONTENT_LANGUAGES, CONTENT_NAME, CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS, CONTENT_TITLES, CONTENT_TYPE_RESOURCE, CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS, DC_CONTRIBUTOR, DC_COVERAGE, DC_CREATOR, DC_DATE, DC_DESCRIPTION, DC_FORMAT, DC_IDENTIFIER, DC_LANGUAGE, DC_PUBLISHER, DC_RELATION, DC_RIGHTS, DC_SOURCE, DC_SUBJECT, DC_TITLE, DC_TYPE, DOCUMENT_TYPE, EXACT_WS_OPERATOR, EXCERPT, FILENAME, FULL, ID, ID_DV, IS_AMETYS_OBJECT, LANGUAGE_SEPARATOR, LENGTH, MIME_TYPES, PATH, PSEUDO_CONTENT_TYPE_VALUE_RESOURCE, PSEUDO_CONTENT_TYPES, REPEATER_ENTRY_POSITION, RESOURCE_ANCESTOR_AND_SELF_IDS, RESOURCE_ANCESTOR_IDS, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_MIME_TYPE_GROUP, RESOURCE_ROOT_ID, SIMPLE_CONTENT_PARENTS, STEMMED_OPERATOR, SYSTEM_FULL, TITLE, TITLE_SORT, TYPE_CONTENT, TYPE_CONTENT_ATTACHMENT_RESOURCE, TYPE_CONTENT_ATTRIBUTE_RESOURCE, TYPE_REPEATER, TYPE_RESOURCE, TYPE_TRASH_ELEMENT, TYPE_WF_ENTRY, TYPE_WF_STEP, WORKFLOW_CURRENT_STEPS, WORKFLOW_CURRENT_STEPS_DV, WORKFLOW_ENTRY_STATE, WORKFLOW_HISTORY_STEPS, WORKFLOW_HISTORY_STEPS_DV, WORKFLOW_NAME, WORKFLOW_REF, WORKFLOW_REF_DV, WORKFLOW_STEP_ACTIONID, WORKFLOW_STEP_CALLER, WORKFLOW_STEP_DUEDATE, WORKFLOW_STEP_FINISHDATE, WORKFLOW_STEP_ID, WORKFLOW_STEP_OWNER, WORKFLOW_STEP_STARTDATE, WORKFLOW_STEP_STATUSFields inherited from interface org.ametys.web.indexing.solr.SolrWebFieldNames
ATTACHMENT_PAGE_ID, CONTENT_IDS, CONTENT_INTERESTING_DATES, DATE_FOR_SORTING, DATES_FACET, FACETABLE_CONTENT_FIELD_PREFIX, LASTNAME_FOR_SORTING, PAGE_ANCESTOR_IDS, PAGE_CONTENT_TYPES, PAGE_DEPTH, PAGE_LONG_TITLE, PAGE_OUTGOING_REFEERENCES_RESOURCE_IDS, PAGE_PARENT_ID, PAGE_TITLE, PAGE_TYPE, PAGE_VISIBLE_ATTACHMENT_RESOURCE_IDS, SECTION_PAGE_TITLE, SERVICE_IDS, SITE_NAME, SITE_TYPE, SITEMAP_NAME, TEMPLATE, TYPE_PAGE, TYPE_PAGE_RESOURCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) indexAllFormEntries(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Index all form entries into Solr index for a given workspace.voidindexFormEntry(FormEntry entry, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, boolean waitForSolr) Add or update a form entry into Solr indexvoidservice(ServiceManager manager) voidunindexAllFormEntries(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Unindex all form entries from Solr index for a given workspace.voidunindexFormEntry(String entryId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Unindex a form entry from Solr index.voidUpdate ACL for a list of form entries in the given workspace.voidupdateWorkflowActors(List<FormEntry> entries, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Update workflow actors for a list of form entries in the given workspace.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
TYPE_FORM_ENTRY
Document type for a form entry- See Also:
-
FORM_ID
Form id field name.- See Also:
-
ROLE
The component role. -
_manager
The service manager. -
_formDAO
The form DAO -
_formEntryDAO
The form entry DAO -
_solrClientProvider
The Solr client provider -
_solrWfIndexer
The solr workflow indexer. -
_solrIndexer
The solr indexer. -
_resolver
The ametys object resolver. -
_threadIndexerHelper
The thread indexer helper -
_context
The avalon context -
_cocoonContext
Cocoon Context
-
-
Constructor Details
-
SolrFormEntryIndexer
public SolrFormEntryIndexer()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
indexFormEntry
public void indexFormEntry(FormEntry entry, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, boolean waitForSolr) throws Exception Add or update a form entry into Solr index- Parameters:
entry- The form entry to indexworkspaceName- The workspace where to indexsolrClient- The solr client to usewaitForSolr- true to wait a bit after indexing to let solr commit the document and make it available for search, false otherwise- Throws:
Exception- if an error occurs while indexing.
-
indexAllFormEntries
public IndexationResult indexAllFormEntries(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Index all form entries into Solr index for a given workspace.- Parameters:
site- The site where to index. Can be null if all form entries should be indexed.workspaceName- The workspace where to index.solrClient- The solr client to use.progressionTracker- The progression tracker to update during the indexation.- Returns:
- The result of the indexation.
-
unindexFormEntry
public void unindexFormEntry(String entryId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Unindex a form entry from Solr index.- Parameters:
entryId- The id of the form entry to unindex.workspaceName- The workspace where to unindex.solrClient- The solr client to use.- Throws:
Exception- if an error occurs while unindexing.
-
unindexAllFormEntries
public void unindexAllFormEntries(Site site, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Unindex all form entries from Solr index for a given workspace.- Parameters:
site- The site where to unindex. Can be null if all form entries should be unindexed.workspaceName- The workspace where to unindex.solrClient- The solr client to use.- Throws:
Exception- if an error occurs while unindexing.
-
updateACL
Update ACL for a list of form entries in the given workspace.- Parameters:
entries- The list of form entries to update ACL for.workspaceName- The workspace where to update ACL.- Throws:
Exception- if an error occurs while updating ACL.
-
updateWorkflowActors
public void updateWorkflowActors(List<FormEntry> entries, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Update workflow actors for a list of form entries in the given workspace.- Parameters:
entries- The list of form entries to update workflow actors for.workspaceName- The workspace where to update workflow actors.solrClient- The solr client to use.- Throws:
Exception- if an error occurs while updating workflow actors.
-