Home > Contents > Index >
SEARCHSTATE.ADDSTANDARDCONSTRAINT
Adds an attribute name/value constraint into a new or existing searchstate object.
Syntax
<SEARCHSTATE.ADDSTANDARDCONSTRAINT
NAME="ssname
" [BUCKET="bucketname
"] [TYPENAME="assettype
"] ATTRIBUTE="attribname
" [LIST="listname
"] [IMMEDIATEONLY="true|false
"] [CASEINSENSITIVE="true|false
"]/>Parameters
NAME
(required)- Input parameter. Name of an object representing a searchstate.
BUCKET
(optional)- Input parameter. Bucket name. If not specified, the attribute name is used. Use this parameter to indicate which constraint you need when the same attribute is used in multiple contstraints. A bucket is an alias and functions similar to an inner join in SQL; when you have multiple tables that have columns of the same name, you must specify the table name to indicate which column you are requesting.
TYPENAME
(optional)- Input parameter. The internal asset name for the attribute (either
CAttributes
for content attribute, orPAttributes
for product attribute). If you do not specifyTYPENAME
, a value is supplied from a property in thegator.ini
property file:mwb.defaultattributes=PAttributes.
The default value is set to bePAttributes
and may be changed to be the name of any custom attribute asset types you create.
ATTRIBUTE
(required)- Input parameter. Name of the attribute to constrain.
LIST
(optional)- Input parameter. A list of the constrained values for the attribute. If specified, one or more of the values must match the attribute for a product to meet the constraint. The default is that all assets that have any value for the attribute match the constraint.
IMMEDIATEONLY
(optional)- Input parameter. A Boolean value:
true
indicates that the search is limited to values directly associated with the specified attribute;false
(the default) extends the search to include values inherited from a parent.
CASEINSENSITIVE (optional)
- Input parameter. A Boolean value:
true
indicates that the comparison is case-insensitive;false
(the default) considers case in the comparison.
Description
The object referred to by
NAME
is updated to include the new constraint. If the attribute name is already in the searchstate, then the new constraint replaces the old constraint. For database columns of type CLOB, only LIKE condition is supported.Error Numbers
The possible values of
errno
include:
Value Description -10004 A required parameter is missing. -13050 General error: usually fields or columns of a resultset or list are not as expected.Example
This code creates an empty
SEARCHSTATE
and adds a standard constraint. The constraint sets theattribute
to search on but does not specify alist
of values to match against. Thetypename
parameter is not specified and the default set in gator.ini is picked up. Any assets with values for this attribute will be returned as matches. This code then sets thisSEARCHSTATE
into anASSETSET.SETSEARCHEDASSETS
tag to constrain theASSETSET
to be used when searching with other assetset tags. The last tag uses this constrained assetset to search for matching assets and fetch a list of values for a different attribute of the returned assets:<SEARCHSTATE.CREATE NAME="ss" /> <SEARCHSTATE.ADDSTANDARDCONSTRAINT NAME="ss" ATTRIBUTE="cat2" /> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="ss" ASSETTYPES="Products"/> <ASSETSET.GETATTRIBUTEVALUES NAME="as" ATTRIBUTE="productdesc" LISTVARNAME="resultlist"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>This code sets a list which contains two values to match into the standard constraint. The final resultlist will contain a subset of the results in the previous example:
<LISTOBJECT.CREATE NAME="lo" COLUMNS="value" /> <LISTOBJECT.ADDROW NAME="lo" value="Germicidal Lamps"/> <LISTOBJECT.ADDROW NAME="lo" value="Watt-Miser PAR Lamps"/> <LISTOBJECT.LIST NAME="lo" LISTVARNAME="matchlist"/> <SEARCHSTATE.CREATE NAME="ss" /> <SEARCHSTATE.ADDSTANDARDCONSTRAINT NAME="ss" ATTRIBUTE="cat2" LIST="matchlist"/> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="ss" ASSETTYPES="Products"/> <ASSETSET.GETATTRIBUTEVALUES NAME="as" ATTRIBUTE="productdesc" LISTVARNAME="resultlist"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>See Also
SEARCHSTATE.CREATE
SEARCHSTATE.ADDLIKECONSTRAINT
SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT
ASSETSET.SETSEARCHEDASSETS
ASSETSET.GETATTRIBUTEVALUES
ListObjects
Home > Contents > Index > Oracle XML Tag Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.