Package lumis.doui.search
Class SearchAggregationControl
- java.lang.Object
-
- lumis.doui.control.Control
-
- lumis.doui.control.DataControl
-
- lumis.doui.control.DataBoundControl
-
- lumis.doui.control.inputtext.InputTextControl
-
- lumis.doui.control.inputtext.InputHiddenControl
-
- lumis.doui.search.SearchAggregationControl
-
- All Implemented Interfaces:
java.util.Observer
,VariableResolver
,IControl
,IDataBoundControl
,IDataControl
,IRenderer
@StableMinor(version="15.0", sinceVersion="9.0") public class SearchAggregationControl extends InputHiddenControl
Control responsible for manage user's aggregations. It is expected to be attached to aSearchSource
.
The request parameter for this control is expected to have the following JSON format:
{ "currentUserQuery": "current user search query", "aggregated": { "some.aggregated.field.id": ["aggregated value 1", "aggregated value 2"], "other.aggregated.field.id": ["other aggregated value 1", "other aggregated value 2", "other aggregated value 3"] } } The
currentUserQuery
string is the current user search query (stored in the first time user typed a search query). Theaggregated
object is a map of aggregated values (that will be used to filter the big data query).
Sets source parameter values
ofaggregated values
(filtered values) andaggregations
(theaggregations
that will be performed in Big data API).
XML data available for XSLT rendering:
- Since:
- 9.0.0
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<DocumentTypeField,java.util.Set<java.lang.Object>>
aggregatedValues
protected java.util.Map<java.lang.String,java.lang.String>
aggregationIdsByFieldFullId
protected java.lang.String
currentUserQuery
-
Fields inherited from class lumis.doui.control.DataControl
FORCE_CASE_LOWER, FORCE_CASE_NONE, FORCE_CASE_UPPER, forceCase, requestParameterName, UNKNOWN_DATA_TYPE, value, valuePreviouslySet
-
Fields inherited from class lumis.doui.control.Control
childControls, controlContainer, controlDefinitionNode, controlResource, douiContext, hasValidatorSubControls, isValid, locale, ON_EVENT_CLOSE_WINDOW, ON_EVENT_LINK, ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE, ON_EVENT_POPUP_RUNTIME_INTERFACE, ON_EVENT_PROCESS_ACTION, ON_EVENT_RENDER_ACTION, ON_EVENT_REPLACE_INTERFACE, ON_EVENT_SCRIPT, ON_EVENT_VALIDATE, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
-
-
Constructor Summary
Constructors Constructor Description SearchAggregationControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getAggregatedValuesXML(DocumentTypeField field, java.util.Set<java.lang.Object> aggregatedValues)
Returns a XML string containing the aggregated values (user's applied filters).
The expected XML string format is as follows:
Service lumis.service.news News Service instance 46F55AF56C5149CB999B66A01C99BF40 Products Product Type B460F41DFF9E4839B64DDFBC1A0C0850 Digital Reflex Camera Color Red Red protected java.lang.String
getAggregationId(DocumentTypeField field)
Returns the aggregation identifier to be used in aggregation of the given field.protected java.lang.String
getAggregationResultXML(DocumentTypeField field, IAggregationResult result)
Returns a XML string of the given aggregation results for the given field.
The expected XML string format is as follows:
Service lumis.service.news News 10 lumis.service.document Documents 5 protected java.util.List<IAggregation>
getAggregations()
Returns the aggregations that will be performed in search.protected java.util.Collection<DocumentTypeField>
getFieldsToBeAggregated()
Returns a collection of fields that will be aggregated in search.void
loadFromRequest()
void
setRenderData()
protected void
setSourceParameter(Source source, java.lang.String parameterName)
Sets the parameter with the given name in the given source.protected void
setValueFromSource()
-
Methods inherited from class lumis.doui.control.inputtext.InputHiddenControl
autoAddValidators
-
Methods inherited from class lumis.doui.control.inputtext.InputTextControl
buildSubControls, fixedIdentifierRequired, init
-
Methods inherited from class lumis.doui.control.DataBoundControl
autoAddDateTimeValueValidator, autoAddDoubleValueValidator, autoAddFileSizeValidator, autoAddIntegerValueValidator, autoAddLengthValidator, autoAddLongValueValidator, autoAddRequiredValueValidator, createConverter, createDataType, getDataId, getFieldName, getProcessActionHandlerParameterName, getReload, getRequestHelpDefinition, getRuntimeDefaultSource, getSource, getSourceById, getSourceContext, getUnboundedConverter, setDefaultValue, setRawValue, setReload, setSourceParameter, setValid, setValueFromSource, update
-
Methods inherited from class lumis.doui.control.DataControl
convertValueToControlValue, getConverter, getDataType, getDefaultValue, getParameterValue, getProcessActionIds, getRequestParameterName, getValue, getValue, getValueClass, initProcessActionIds, isTrim, loadSubControlFromRequest, loadSubControlsFromRequest, setProcessActionHandlerParameter, setProcessActionHandlerParameter, setProcessActionHandlerParameters, setSourceParameters, setTrim, setValue, valueIsArray
-
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, convertToStandardValue, createContainer, disconnect, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getName, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getScriptActionValidation, getStringsToLocalize, getType, getValidationScript, getWindowProperties, getWindowProperties, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.doui.control.IControl
createContainer, disconnect, getChildControls, getControlResource, getId, getName, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes
-
Methods inherited from interface lumis.doui.control.IDataControl
getConverter, getProcessActionIds, getValue, getValue, setProcessActionHandlerParameters, setValue
-
Methods inherited from interface lumis.doui.render.IRenderer
getResources
-
-
-
-
Field Detail
-
aggregatedValues
protected java.util.Map<DocumentTypeField,java.util.Set<java.lang.Object>> aggregatedValues
-
currentUserQuery
protected java.lang.String currentUserQuery
-
aggregationIdsByFieldFullId
protected java.util.Map<java.lang.String,java.lang.String> aggregationIdsByFieldFullId
-
-
Method Detail
-
loadFromRequest
public void loadFromRequest() throws PortalException
- Specified by:
loadFromRequest
in interfaceIDataControl
- Overrides:
loadFromRequest
in classDataBoundControl
- Throws:
PortalException
-
setSourceParameter
protected void setSourceParameter(Source source, java.lang.String parameterName) throws PortalException
Description copied from class:DataControl
Sets the parameter with the given name in the given source.- Overrides:
setSourceParameter
in classDataControl
- Parameters:
source
- the sourceparameterName
- the parameter name- Throws:
PortalException
-
setValueFromSource
protected void setValueFromSource() throws PortalException
- Overrides:
setValueFromSource
in classDataBoundControl
- Throws:
PortalException
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Overrides:
setRenderData
in classInputTextControl
- Throws:
PortalException
-
getAggregatedValuesXML
protected java.lang.String getAggregatedValuesXML(DocumentTypeField field, java.util.Set<java.lang.Object> aggregatedValues) throws PortalException
Returns a XML string containing the aggregated values (user's applied filters).
The expected XML string format is as follows:
Service lumis.service.news News Service instance 46F55AF56C5149CB999B66A01C99BF40 Products Product Type B460F41DFF9E4839B64DDFBC1A0C0850 Digital Reflex Camera Color Red Red - Parameters:
field
- the field that received the given filters.aggregatedValues
- the user's applied filters values.- Returns:
- the XML string.
- Throws:
PortalException
- Since:
- 9.0.0
-
getAggregationResultXML
protected java.lang.String getAggregationResultXML(DocumentTypeField field, IAggregationResult result) throws PortalException
Returns a XML string of the given aggregation results for the given field.
The expected XML string format is as follows:
Service lumis.service.news News 10 lumis.service.document Documents 5 Service instance 46F55AF56C5149CB999B66A01C99BF40 Products 10 02763D0A79634869AB23B0AB97201D9C Support 5 Brand 4BA761C464854916A8CA454A6CE4B43D Nikon 10 7F643135B0BA401D8A78233F1D951D37 Canon 5 Type 838D178164B344E4A2B199DFF1AECB11 Electronics 829F31F3285E40CCAB8AB835AE0E7773 Photography 64BA56067F284C7DA0D9AAF624C184A6 Compacts 10 B460F41DFF9E4839B64DDFBC1A0C0850 Reflex 5 ... Color Red Red 10 Black Black 5 - Parameters:
field
- the aggregation results' field.result
- the aggregation result.- Returns:
- a XML string
- Throws:
PortalException
- Since:
- 9.0.0
-
getFieldsToBeAggregated
protected java.util.Collection<DocumentTypeField> getFieldsToBeAggregated() throws PortalException
Returns a collection of fields that will be aggregated in search.- Returns:
- a collection of fields that will be aggregated in search.
- Throws:
PortalException
- Since:
- 9.0.0
-
getAggregations
protected java.util.List<IAggregation> getAggregations() throws PortalException
Returns the aggregations that will be performed in search.- Returns:
- the aggregations that will be performed in search.
- Throws:
PortalException
- Since:
- 9.0.0
-
getAggregationId
protected java.lang.String getAggregationId(DocumentTypeField field)
Returns the aggregation identifier to be used in aggregation of the given field.- Parameters:
field
- the field.- Returns:
- the aggregation identifier to be used in aggregation of the given field.
- Since:
- 9.0.0
-
-