Home > Contents > Index >
SEARCHSTATE.CREATE
Builds an empty searchstate object.
Syntax
<SEARCHSTATE.CREATE NAME="ssname" [OP="and|or"]/>Parameters
NAME(required)- Input and output parameter. As input, name of the searchstate object to create on output.
OP(optional)- Input parameter. Searchstate type, either
andoror. The default isand.
Examples
This code creates an empty
SEARCHSTATEwith a default type ofand. Two constraints ss1 and ss2 are then added to this searchstate. Any assets with matching values for both constraint ss1 and ss2 will be returned. If no assets match both constraints simultaneously nothing is returned This code then sets thisSEARCHSTATEinto anASSETSET.SETSEARCHEDASSETStag to constrain theASSETSETto 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 one of the constrained attributes for the returned assets:<!-- Iterate through a list of attribute values. --> <!-- First, create a blank searchstate. --> <SEARCHSTATE.CREATE NAME="ss"/> <!-- Associate the blank searchstate with a new asset set. --> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="ss"/> <!-- Get a set of all values for the given attribute. --> <ASSETSET.GETATTRIBUTEVALUES ORDERING="descending" NAME="as"
ATTRIBUTE="Price" LISTVARNAME="results"/>This code creates a
SEARCHSTATEwith two clauses that are joined by anoroperation. Assets that match eitherGermicidal LampsorWatt%are returned.<SEARCHSTATE.CREATE NAME="ss" OP="or"/> <SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT NAME="ss" BUCKET="ss1" ATTRIBUTE="cat2" VALUE="Germicidal Lamps"/> <SEARCHSTATE.ADDSIMPLELIKECONSTRAINT NAME="ss" BUCKET="ss2" ATTRIBUTE="cat2" VALUE="Watt%"/> <ASSETSET.SETSEARCHEDASSETS NAME="as" CONSTRAINT="ss" ASSETTYPES="Products"/> <ASSETSET.GETATTRIBUTEVALUES NAME="as" ATTRIBUTE="cat2" LISTVARNAME="resultlist"/> <LOOP LIST="resultlist"> <CSVAR NAME="resultlist.value"/><br/> </LOOP>See Also
SEARCHSTATE.ADDSIMPLELIKECONSTRAINT
SEARCHSTATE.ADDSTANDARDCONSTRAINT
ASSETSET.SETSEARCHEDASSETS
ASSETSET.GETATTRIBUTEVALUES
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.