Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
searchstate:addrangeconstraint
Adds a range constraint to a searchstate on a specific attribute.
Syntax
<searchstate:addrangeconstraintname="ssname" [bucket="bucketname"] [typename="assettype"] attribute="attribname" lower="lowrange" upper="uprange"]/>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. Internal asset type name for the attribute (either
CAttributesfor content attribute, orPAttributesfor product attribute). If you do not specifyTYPENAME, a default value is picked up from a property in thegator.iniproperty file:mwb.defaultattributes. The default value is set to bePAttributesand 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.
lower|lowerequal(required)- Input parameter. Bottom end of the range. Specify either this parameter or
upperor both.
upper|upperequal(required)- Input parameter. Top end of the range. Specify either this parameter or
loweror both.
Description
The
searchstateobject referred to bynameis updated to include the new constraint specified by this tag. This constraint specifies theupperandlowerlimits on theattributebeing searched on.Error Numbers
The possible values of
errnoinclude:
Value Description -10004 A required parameter is missing. -13050 General error.Example
This code creates an empty
searchstateand adds a range constraint. The constraint setsupperandlowerlimits on theattributebeing searched on. Thetypenameparameter is not specified and the default set in gator.ini is picked up. Any assets with values for this attribute in that range will be returned as matches for this constraint. 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 actual values for theattributeof the returned assets:<searchstate:create name="ss" /> <searchstate:addrangeconstraint name="ss" attribute="price" upper="3" lowerequal="2"/> <assetset:setsearchedassets name="as" constraint="ss" assettypes="Products"/> <assetset:getattributevalues name="as" attribute="price" listvarname="resultlist"/> <ics:listloop listname="resultlist"> <ics:listget listname="resultlist" fieldname="value"/><br/> </ics:listloop>See Also
searchstate:create
searchstate:addsimplestandardconstraint
searchstate:addrichtextconstraint
assetset:setsearchedassets
assetset:getattributevalues
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.