Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | 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.
Example
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:<searchstate:create name="ss" /> <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"/> <ics:listloop listname="resultlist"> <ics:listget listname="resultlist" fieldname="value"/><br/> </ics:listloop>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"/> <ics:listloop listname="resultlist"> <ics:listget listname="resultlist" fieldname="value"/><br/> </ics:listloop>See Also
searchstate:create
searchstate:addstandardconstraint
searchstate:addsimplelikeconstraint
searchstate:addsimplestandardconstraint
assetset:setsearchedassets
assetset:getattributevalues
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.