public abstract class SearchFilterModel extends java.lang.Object implements XMLMarshallable
abstract Java class represents a search filter to aggregate all search criteria
that you can use to search for data stored in the connected SAP CC system; You can specify basic criteria and specialized search criteria.
Note
Refer to the known Java subclasses to work with the search filters that are dedicated to the searched objects:
| Master Data (pricing catalog of the service provider) | Customer Master Data (end customers of the service provider) | Technical Data |
|---|---|---|
|
|
|
attribute descriptions to define your basic search criteria.
Refer to the lists of predefined names in the Java classes of the data search filters.
Maximum size: Limits the returned items count (-1 if no limitation); The result is pagined. Total count required: If true, the total count of searched items must be returned From: Represents a current item unique ID from which the search must begin Sort: Indicates the sort order which will be applied on the unique
identifier for searching items Result type: Specifies if the result must be a list of complete objects, a list of attribute sets, or
only a list of IDs
You can specify some specific search criteria by using some predefined specific formulas available in the specialized search filters.
AttributeDescriptionModel,
SpecificFormulaModelThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:complexType name="SearchFilter">
<xs:sequence>
<xs:element ref="attributeDescription" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="specificFormula" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="attributeResultDescription" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="from" type="xs:string"/>
<xs:attribute name="maxSize" type="xs:int"/> <!-- means "all" if not set -->
<xs:attribute name="sort" type="SearchOrderType" default="noOrder"/>
<xs:attribute name="totalCountRequired" type="xs:boolean" default="false"/> <!-- Specifies if the total count of items must be performed -->
<xs:attribute name="resultType" type="ResultTypeTypeSF" default="objects"/>
</xs:complexType><xs:element name="attributeResultDescription">
<xs:complexType>
<xs:sequence>
<xs:element ref="attributeName" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element><xs:element name="attributeName">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element><xs:element name="SearchFilter" type="SearchFilter" abstract="true"/> <!-- The search order is sorted in time so the sorting process works on OID absolute values because of partitioning (OID could be negative) -->
<xs:simpleType name="SearchOrderType">
<xs:restriction base="xs:string">
<xs:enumeration value="asc"/> <!-- forward response result -->
<xs:enumeration value="desc"/><!-- backward response result -->
<xs:enumeration value="noOrder"/><!-- no sort required, more efficient -->
</xs:restriction>
</xs:simpleType><xs:simpleType name="ResultTypeTypeSF">
<xs:restriction base="xs:string">
<xs:enumeration value="ids"/> <!-- object IDs are returned -->
<xs:enumeration value="attributes"/> <!-- object attributes are returned -->
<xs:enumeration value="objects"/><!-- object models are returned -->
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ASC_ORDER
Constant for ascending search order (value is set to
""asc"") |
static int |
ATTRIBUTES_RESULT_TYPE
Constant for "attributes" result type (value is set to
2) |
static java.lang.String |
DESC_ORDER
Constant for descending search order (value is set to
"desc") |
static int |
FILTER_GROUP_PNR
Constant
|
static int |
ID_RESULT_TYPE
Constant for "ids" result type (value is set to
1) |
static int |
ITERATOR_MODE
INTERNAL USE ONLY - Constant for "iterator" search mode (value is set to
1). |
static int |
LIST_MODE
Constant for "list" search mode (value is set to
0) |
static java.lang.String |
NO_ORDER
Constant for no order search order (value is set to
"noOrder") |
static int |
OBJECT_RESULT_TYPE
Constant for "objects" result type (value is set to
0) |
| Constructor and Description |
|---|
SearchFilterModel(java.lang.String searchFilterName)
Builds an empty SearchFilterModel;
This builder is mainly used through the
super() pointer. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeSelection(AttributeDescriptionModel sel)
Adds a selection filter that ports on an attribute field.
|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
void |
addSpecificFormula(SpecificFormulaModel formula)
Adds a specific constraint for the search operation, regarding to the working scope;
See
getSpecificFormulaList() for more information. |
java.util.List<java.lang.String> |
getAttributeResultList()
Returns the list of attribute values that must be returned in the result;
An attribute is the name of an
AttributeDescriptionModel. |
java.util.List<AttributeDescriptionModel> |
getAttributeSelectionList()
Gets the list of constraints which must be checked for searching item;
This list contains all criteria which port on object main attribute.
|
java.util.List<AttributeDescriptionModel> |
getAttributeSelectionListFromGroup(java.lang.String group)
Gets the list of constraints which must be checked for searching items and
which belong to the same group.
|
int |
getFilterGroup()
Returns the filter group of the search filter; default is
BnR. |
java.lang.String |
getFrom()
Gets the from cursor.
|
abstract java.util.Vector<AttributeDescriptionModel> |
getMainAttributeDescriptionCatalog()
Returns the list of main attribute descriptions on which the user can build some search criteria;
See
getMainAttributeDescriptionFromCatalog()
for more information. |
abstract AttributeDescriptionModel |
getMainAttributeDescriptionFromCatalog(java.lang.String attributeName)
Returns an empty constraint from a catalog that can be used for specifying
a criterion on a main attribute (identified by its name).
|
int |
getMaxSize()
Gets the max;
The max value represents the max number of results answering to the search request.
|
int |
getResultType()
Gets the search result type.
|
java.lang.String |
getSearchFilterName()
Returns the XML element name of the current
search filter.
|
int |
getSearchMode()
Gets the search mode that must be used with this filter.
|
java.lang.String |
getSort()
Gets the cursor search order.
|
abstract java.util.Vector<SpecificFormulaModel> |
getSpecificFormulaCatalog()
Returns the catalog of available specific formula for the current search filter;
See
getSpecificFormulaList() for more information; |
abstract SpecificFormulaModel |
getSpecificFormulaFromCatalog(java.lang.String formCode)
Returns a specific formula from the catalog according to its name;
See
getSpecificFormulaList() for more information; |
java.util.List<SpecificFormulaModel> |
getSpecificFormulaList()
Gets the list of specific constraints.
|
boolean |
isCountRequired()
Tells if the total number of selected items must be returned;
See
setCountRequiredFlag() for more information. |
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setAttributeSelectionList(java.util.List<AttributeDescriptionModel> sels)
Sets the list of constraints which port on attribute fields.
|
void |
setCountRequiredFlag(boolean flag)
Sets the flag for returning the total number of selected items.
|
void |
setFrom(java.lang.String f)
Gets the from cursor.
|
void |
setMaxSize(int d)
Sets the max;
The max value represents the max number of results answering to the search request.
|
void |
setResultType(int type)
Sets the search result type.
|
void |
setSearchFilterName(java.lang.String name)
Sets the XML element name of the current
search filter.
|
void |
setSearchMode(int mode)
INTERNAL USE ONLY - Sets the search mode which must be used with this filter.
|
void |
setSort(java.lang.String sortOrder)
Sets the from cursor search order; The default value is NO_ORDER.
|
void |
setSpecificFormulaList(java.util.List<SpecificFormulaModel> specifics)
Sets the list of specific constraints;
See
getSpecificFormulaList() for more information. |
public static final int OBJECT_RESULT_TYPE
0)public static final int ID_RESULT_TYPE
1)public static final int ATTRIBUTES_RESULT_TYPE
2)public static final int LIST_MODE
0)public static final int ITERATOR_MODE
1).
Reserved for internal use. Cannot be set by your client application.public static final java.lang.String ASC_ORDER
""asc"")public static final java.lang.String DESC_ORDER
"desc")public static final java.lang.String NO_ORDER
"noOrder")public static final int FILTER_GROUP_PNR
public SearchFilterModel(java.lang.String searchFilterName)
super() pointer.searchFilterName - The name of the XML element that implements this XML complex typepublic java.lang.String getSearchFilterName()
public void setSearchFilterName(java.lang.String name)
name - The name to setpublic int getMaxSize()
public void setMaxSize(int d)
d - The maximum sizepublic int getSearchMode()
listMode is available through the API (default value).
The iteratorMode is reserved for internal use.listMode (default value). iteratorMode (reserved for internal use). public void setSearchMode(int mode)
listMode is available through the API (default value).
The iteratorMode is reserved for internal use.
Set the searchMode which must be used with the current filter.
The available values are:
LIST_MODE (default value). ITERATOR_MODE (reserved for internal use). mode - The search mode to setpublic int getResultType()
ids:
the search operation will return only the unique identifiers of the targeted objectsobjects:
the search operation will return the targeted objectsattributes:
the search operation will return only the required attributes of the targeted objectspublic void setResultType(int type)
The possible types are:
ids:
the search operation will return only the unique identifiers of the targeted objectsobjects:
the search operation will return the targeted objectsattributes:
the search operation will return only the required attributes of the targeted objectstype - The result type to setpublic java.lang.String getFrom()
null) is used as a beginning index for searching items.
This cursor is mainly used as following:
null.
He can also specify a search order which will be applied on unique ids ("asc" by example).SearchResult). getLastID()) it means that some
other items exist into the database and a new search request can be executed. SearchResult with null
as value, it means that no more searched item exists into the DB and that the search operation can be stopped. public void setFrom(java.lang.String f)
The from cursor (if not null) is used as a beginning index for searching items. This cursor is mainly used as following during a search window:
null.
He can also specify a search order which will be applied on unique ids ("asc" by example).SearchResult). getLastID()) it means that some
other items exist into the database and a new search request can be executed. SearchResult with null
as value, it means that no more searched item exists into the DB and that the search operation can be stopped. Note
The from cursor is always transmitted as a String even if the unique ID is a number. In this case, please cast it into a String value.
f - The from cursor. If it sets to public java.lang.String getSort()
The available value are:
public void setSort(java.lang.String sortOrder)
The available values are:
Note
If NO_ORDER is set, the SAP CC system will decide itself what is the best order to use and sometime will use some internal ID (Object ID OID) for improving search performances.
According to search window mechanism definition
(see from cursor),
it is not recommended to change the sort order into a same search window.
sortOrder - The order which is used for managing the cursorpublic java.util.List<AttributeDescriptionModel> getAttributeSelectionList()
The boolean conjunction operator (AND) is applied between each list element.
In addition, the same operator will be applied between the last element
of this list and the first element of the specific constraint list
(see specificFormula).
A search criterion is expressed through an
AttributeDescriptionModel . Indeed an attribute
description model, describes the attribute (name, type, default value) and aggregates some constraints
which must be checked by the attribute. In this case, those constraints are some good candidates to
express search criteria.
The available constraint types are:
EnumeratedListConstraint for defining
a list of allowed values.RangeConstraint for defining
range type constraints.FormatConstraint for defining
constraints on String based on pattern definition.AttributeDescriptionModelpublic void setAttributeSelectionList(java.util.List<AttributeDescriptionModel> sels)
getAttributeSelectionList() for more information.sels - A list of attribute descriptionspublic java.util.List<AttributeDescriptionModel> getAttributeSelectionListFromGroup(java.lang.String group)
It exists 4 groups for qualifying an attribute:
MAIN_GROUP: the attribute
is a main attribute which is located into the main item table.ADDITIONAL_GROUP: the attribute
is an additional attribute which is located into the additional item table.PARAMETER_GROUP: the attribute
is a parameter attribute which is located into a related parameter table.COUNTER_GROUP: the attribute
is viewed as a counter which is located into a related table.group - The group name.
The available values are:
attribute descriptions currently defined in this filterpublic void addAttributeSelection(AttributeDescriptionModel sel)
sel - The selection which must be added into the listpublic java.util.List<SpecificFormulaModel> getSpecificFormulaList()
As some searchable items can be specific, the specific
formula allows the user to complete the list of criteria with
predefined specific constraints which cannot be expressed by an
AttributeDescriptionModel.
SpecificFormulaModelpublic void setSpecificFormulaList(java.util.List<SpecificFormulaModel> specifics)
getSpecificFormulaList() for more information.specifics - A list of SpecificFormulaModelpublic void addSpecificFormula(SpecificFormulaModel formula)
getSpecificFormulaList() for more information.formula - The specific constraint which must be added into the specific constraint listpublic void setCountRequiredFlag(boolean flag)
flag - If set to true, the result will contain the total
item count which match the constraints.
If it is set to false, the total count will be set to -1.
See totalCount into
SearchResult.public boolean isCountRequired()
setCountRequiredFlag() for more information.true if the total item count must be returned, false otherwisepublic int getFilterGroup()
BnR.
This method is surrounded in PnR search filter models.public java.util.List<java.lang.String> getAttributeResultList()
AttributeDescriptionModel.public abstract SpecificFormulaModel getSpecificFormulaFromCatalog(java.lang.String formCode)
getSpecificFormulaList() for more information;formCode - The code that identifies the specific formulanull if the formula does not exist.public abstract java.util.Vector<SpecificFormulaModel> getSpecificFormulaCatalog()
getSpecificFormulaList() for more information;SpecificFormulaModelpublic abstract AttributeDescriptionModel getMainAttributeDescriptionFromCatalog(java.lang.String attributeName)
In main concrete filter, it exists some main attributes on which constraint can port on. The main difference between main attribute group and other attribute groups (additional, parameter, counter) is that those attributes are predefined. So we can establish the catalog of the main attribute for a concrete search filter, for which it will be possible to build some search criteria.
This method gives the possibility to retrieve a predefined constraint on a main attribute that belongs to the main attribute catalog.
attributeName - The name of the attribute; see the related concrete class for
more information.null if the specified attribute name
does not match any catalog attributepublic abstract java.util.Vector<AttributeDescriptionModel> getMainAttributeDescriptionCatalog()
getMainAttributeDescriptionFromCatalog()
for more information.attribute descriptions
that are related to main attributes of the concrete search filter.public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into