public class QueryExtractionComponent extends AbstractGroupExtractionComponent implements Contextualizable
| Modifier and Type | Field and Description |
|---|---|
private List<ExtractionColumn> |
_columns |
private ContentResultSetHelper |
_contentResultSetHelper |
private Context |
_context |
private boolean |
_overrideColumns |
private boolean |
_overrideSorts |
private Collection<? extends ResultField> |
_resultFields |
private SearchUIModelExtensionPoint |
_searchModelExtensionPoint |
private ServiceManager |
_serviceManager |
private Map<String,Sort.Order> |
_sortMap |
private List<Sort> |
_sorts |
_groupingFields_clauses, _contentTypes, _getQueryFromJSONHelper, _jsonUtils, _queryReferenceId_contentTypeExtensionPoint, _contentTypesHelper, _subComponents, _tagName, _thesaurusDAO, EXTRACTION_METADATA_PATH_SEPARATOR, JOIN_HIERARCHY_ELEMENT, JOIN_HIERARCHY_SEPARATOR| Constructor and Description |
|---|
QueryExtractionComponent() |
| Modifier and Type | Method and Description |
|---|---|
private List<ResultField> |
_buildResulFields(List<String> columnFieldPaths) |
private List<String> |
_getColumnsToDisplay(ExtractionExecutionContext context) |
void |
addColumn(String fieldPath,
String displayOptionalColumnName)
Add an optional column to the component
|
void |
addColumns(String... fieldPaths)
Add columns to the components.
|
void |
addSort(String filedPath,
Sort.Order order)
Add sort to the component
|
protected void |
computeReferencedQueryInfos(String refQueryContent)
Manages the stored query referenced by the component
|
void |
configure(Configuration query) |
void |
contextualize(Context context) |
List<ExtractionColumn> |
getColumns()
Retrieves the component columns
|
Map<String,Object> |
getComponentDetailsForTree()
Retrieves the details of the component for tree
|
protected ContentSearcherFactory.SimpleContentSearcher |
getContentSearcher()
Retrieves the content searcher to use for solr search
|
protected String |
getDefaultTagName()
Retrieves the default tag name
|
protected String |
getLogsPrefix()
Retrieves the prefix to use in exceptions thrown by this component
|
Map<String,Sort.Order> |
getSorts()
Retrieves the component sorts
|
boolean |
overrideColumns()
the referenced query's columns
|
boolean |
overrideSorts()
the referenced query's sorts
|
void |
prepareComponentExecution(ExtractionExecutionContext context)
Prepare the execution of the component
|
protected void |
processContents(AmetysObjectIterable<Content> contents,
ContentHandler contentHandler,
ExtractionExecutionContext context)
Process result contents to format the result document
|
protected void |
saxContents(ContentHandler contentHandler,
ExtractionExecutionContext context,
Collection<? extends ResultField> resultFields,
List<Content> contents)
Sax a content
|
void |
service(ServiceManager serviceManager) |
void |
setOverrideColumns(boolean overrideColumns)
Set the boolean to override the referenced query's columns or not
|
void |
setOverrideSorts(boolean overrideSorts)
Set the boolean to override the referenced query's sorts or not
|
addGroupingFields, getGroupingFields, organizeContentsInGroups, saxGroup_extractGroupExpressionsFromClause, _extractVariableFromClauseExpression, _getClauseQueries, _getMetadataType, addClauses, addContentTypes, executeComponent, getClauses, getContentTypes, getQueryReferenceId, setQueryReferenceIdaddSubComponent, execute, executeSubComponents, getSubComponents, getTagName, setTagNameenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate boolean _overrideColumns
private List<ExtractionColumn> _columns
private boolean _overrideSorts
private Map<String,Sort.Order> _sortMap
private Collection<? extends ResultField> _resultFields
private ServiceManager _serviceManager
private SearchUIModelExtensionPoint _searchModelExtensionPoint
private ContentResultSetHelper _contentResultSetHelper
public QueryExtractionComponent()
public void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void service(ServiceManager serviceManager) throws ServiceException
service in interface Serviceableservice in class AbstractGroupExtractionComponentServiceExceptionpublic void configure(Configuration query) throws ConfigurationException
configure in interface Configurableconfigure in class AbstractGroupExtractionComponentConfigurationExceptionpublic void prepareComponentExecution(ExtractionExecutionContext context) throws Exception
ExtractionComponentprepareComponentExecution in interface ExtractionComponentprepareComponentExecution in class AbstractGroupExtractionComponentcontext - context of the extraction componentException - if an error occursprivate List<String> _getColumnsToDisplay(ExtractionExecutionContext context)
private List<ResultField> _buildResulFields(List<String> columnFieldPaths) throws Exception
Exceptionprotected void computeReferencedQueryInfos(String refQueryContent) throws QuerySyntaxException
AbstractSolrExtractionComponentcomputeReferencedQueryInfos in class AbstractSolrExtractionComponentrefQueryContent - referenced query contentQuerySyntaxException - if there is a syntax error in the referenced queryprotected ContentSearcherFactory.SimpleContentSearcher getContentSearcher()
AbstractSolrExtractionComponentgetContentSearcher in class AbstractSolrExtractionComponentprotected void processContents(AmetysObjectIterable<Content> contents, ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception
AbstractSolrExtractionComponentprocessContents in class AbstractSolrExtractionComponentcontents - search resultscontentHandler - result documentcontext - component execution contextException - if an error occursprotected void saxContents(ContentHandler contentHandler, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields, List<Content> contents) throws Exception
AbstractGroupExtractionComponentsaxContents in class AbstractGroupExtractionComponentcontentHandler - result documentcontext - execution contextresultFields - result fields to saxcontents - contents to saxException - if an error occurspublic Map<String,Object> getComponentDetailsForTree()
ExtractionComponentgetComponentDetailsForTree in interface ExtractionComponentgetComponentDetailsForTree in class AbstractGroupExtractionComponentMap containing component detailsprotected String getDefaultTagName()
AbstractExtractionComponentgetDefaultTagName in class AbstractExtractionComponentprotected String getLogsPrefix()
AbstractExtractionComponentgetLogsPrefix in class AbstractExtractionComponentpublic boolean overrideColumns()
true if the referenced query's columns are overridden on this component, false otherwisepublic void setOverrideColumns(boolean overrideColumns)
overrideColumns - true to override columns, false otherwisepublic List<ExtractionColumn> getColumns()
public void addColumns(String... fieldPaths)
fieldPaths - Array of columns' field paths to addpublic void addColumn(String fieldPath, String displayOptionalColumnName)
fieldPath - The column's field pathdisplayOptionalColumnName - The name of the variable that manage the display of this optional columnpublic boolean overrideSorts()
true if the referenced query's sorts are overridden on this component, false otherwisepublic void setOverrideSorts(boolean overrideSorts)
overrideSorts - true to override sorts, false otherwisepublic Map<String,Sort.Order> getSorts()
public void addSort(String filedPath, Sort.Order order)
filedPath - Field on which apply sortorder - sort order to apply for field