public class QueryExtractionComponent extends AbstractGroupExtractionComponent implements TwoStepsExecutingExtractionComponent, Contextualizable
Modifier and Type | Field and Description |
---|---|
private ColumnHelper |
_columnHelper |
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
|
Iterable<Content> |
computeFirstLevelResults(ExtractionExecutionContext context)
Computes first level results for preparing multiple extraction executions
|
protected void |
computeReferencedQueryInfos(String refQueryContent)
Manages the stored query referenced by the component
|
void |
configure(Configuration query) |
void |
contextualize(Context context) |
void |
executeFor(ContentHandler contentHandler,
Iterable<Content> firstLevelResults,
ExtractionExecutionContext context)
Execute the extraction of the component for the given first level results
|
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(Iterable<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, getContents, getContentTypes, getQueryReferenceId, setQueryReferenceId
addSubComponent, execute, executeSubComponents, getSubComponents, getTagName, setTagName
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
addSubComponent, getContentTypes, getSubComponents
private 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
private ColumnHelper _columnHelper
public QueryExtractionComponent()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class AbstractGroupExtractionComponent
ServiceException
public void configure(Configuration query) throws ConfigurationException
configure
in interface Configurable
configure
in class AbstractGroupExtractionComponent
ConfigurationException
public void prepareComponentExecution(ExtractionExecutionContext context) throws Exception
ExtractionComponent
prepareComponentExecution
in interface ExtractionComponent
prepareComponentExecution
in class AbstractGroupExtractionComponent
context
- context of the extraction componentException
- if an error occursprivate List<String> _getColumnsToDisplay(ExtractionExecutionContext context)
private List<ResultField> _buildResulFields(List<String> columnFieldPaths) throws Exception
Exception
protected void computeReferencedQueryInfos(String refQueryContent) throws QuerySyntaxException
AbstractSolrExtractionComponent
computeReferencedQueryInfos
in class AbstractSolrExtractionComponent
refQueryContent
- referenced query contentQuerySyntaxException
- if there is a syntax error in the referenced queryprotected ContentSearcherFactory.SimpleContentSearcher getContentSearcher()
AbstractSolrExtractionComponent
getContentSearcher
in class AbstractSolrExtractionComponent
protected void processContents(Iterable<Content> contents, ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception
AbstractSolrExtractionComponent
processContents
in class AbstractSolrExtractionComponent
contents
- search resultscontentHandler
- result documentcontext
- component execution contextException
- if an error occurspublic Iterable<Content> computeFirstLevelResults(ExtractionExecutionContext context) throws Exception
TwoStepsExecutingExtractionComponent
computeFirstLevelResults
in interface TwoStepsExecutingExtractionComponent
context
- context of the extraction componentException
- if an error occurspublic void executeFor(ContentHandler contentHandler, Iterable<Content> firstLevelResults, ExtractionExecutionContext context) throws Exception
TwoStepsExecutingExtractionComponent
executeFor
in interface TwoStepsExecutingExtractionComponent
contentHandler
- result documentfirstLevelResults
- A subset of the first level content results previously returned by TwoStepsExecutingExtractionComponent.computeFirstLevelResults(ExtractionExecutionContext)
context
- context of the extraction componentException
- if an error occursprotected void saxContents(ContentHandler contentHandler, ExtractionExecutionContext context, Collection<? extends ResultField> resultFields, List<Content> contents) throws Exception
AbstractGroupExtractionComponent
saxContents
in class AbstractGroupExtractionComponent
contentHandler
- result documentcontext
- execution contextresultFields
- result fields to saxcontents
- contents to saxException
- if an error occurspublic Map<String,Object> getComponentDetailsForTree()
ExtractionComponent
getComponentDetailsForTree
in interface ExtractionComponent
getComponentDetailsForTree
in class AbstractGroupExtractionComponent
Map
containing component detailsprotected String getDefaultTagName()
AbstractExtractionComponent
getDefaultTagName
in class AbstractExtractionComponent
protected String getLogsPrefix()
AbstractExtractionComponent
getLogsPrefix
in class AbstractExtractionComponent
public 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