Class sap.apf.utils.FilterModule: sap/apf/utils/filter


Filter object

Constructor Summary
new sap.apf.utils.Filter(oMessageHandler)It is designed to be used for supplying context information for the application.
Field Summary
typeContains 'filter'
Method Summary
createFilterFromSapUi5FilterJSON()Creates a filter from json format, that comes from selection variant.
getById(sId)Returns filter object or expression for a given ID, if exists.
getExpressions()Returns the logical operations and the boolean expressions of a Filter object as nested arrays for the logical operations and single level objects for the boolean expressions.
getOperators()Convenience function to get the OData operators which are defined in {sap.apf.core.constants.FilterOperators}.
getTopAnd()Returns the top 'AND' object of the filter.
intersectWith(args)Build the intersection of the this filter object with the supplied filter(s).
updateExpression(sId, oExpression)Updates an expression.
updateValue(sId, value, high)Updates a value of an expression object.
Constructor Detail
new sap.apf.utils.Filter(oMessageHandler)
It is designed to be used for supplying context information for the application. In addition, it can be used for exchanging filter values between the path and the facet filters. This function object supports the top down construction of filter expressions.
Parameters:
{sap.apf.core.MessageHandler}oMessageHandler
Field Detail
type
Contains 'filter'
Method Detail
createFilterFromSapUi5FilterJSON(): sap.apf.utils.Filter
Creates a filter from json format, that comes from selection variant. Apf creates this filter format with method sap.apf.core.utils.Filter#mapToSapUI5FilterExpression. See there for description of the format.
Returns:
{sap.apf.utils.Filter}
Returns filter object or expression for a given ID, if exists.
Parameters:
{string}sId ID of the object to be returned.
Returns:
{sap.apf.utils.FilterAnd|sap.apf.utils.FilterOr|sap.apf.utils.FilterExpression|undefined}
getExpressions(): object[]
Returns the logical operations and the boolean expressions of a Filter object as nested arrays for the logical operations and single level objects for the boolean expressions. Depending on the nesting level of the arrays the logical operators for the terms in the arrays alternates between AND and OR. The array on the highest level has the logical operator AND. It corresponds to the TopAnd filter term. Terms in general can be composed of the logical operation AND (see the FilterAnd object) or OR (see the FilterOr object) or be a boolean expression (see the FilterExpression object). AND and OR terms are returned as arrays; boolean expressions are returned as objects.
Returns:
{object[]} Array of AND terms, OR terms and expressions.
getOperators(): sap.apf.core.constants.FilterOperators
Convenience function to get the OData operators which are defined in {sap.apf.core.constants.FilterOperators}.
Returns:
{sap.apf.core.constants.FilterOperators}
Returns the top 'AND' object of the filter.
Returns:
{sap.apf.utils.FilterAnd}
intersectWith(args): sap.apf.utils.Filter
Build the intersection of the this filter object with the supplied filter(s). The method does not change the "this"-instance.
Parameters:
{sap.apf.utils.Filter|sap.apf.utils.Filter[]}args Single filter object sap.apf.utils.Filter, a comma separated parameter list of filter objects, or an array of filter objects
Returns:
{sap.apf.utils.Filter} new filter object sap.apf.utils.Filter for the intersected filters
updateExpression(sId, oExpression)
Updates an expression.
Parameters:
{string}sId ID of expression to be updated
{object}oExpression Expression object containing the updated properties
{string}oExpression.id Updated expression ID
{string}oExpression.name Updated expression name
{string}oExpression.operator Updated expression operator of type {sap.apf.core.constants.FilterOperators}
{string|number}oExpression.value Updated expression low value
{string|number}oExpression.high Updated expression high value
updateValue(sId, value, high)
Updates a value of an expression object.
Parameters:
{string}sId ID of the expression object to be updated
{string}value The new low value for the expression (optional)
{string}high The new high value for the expression (optional)