Home > Contents > Index >
searchstate:deleteconstraint
Deletes a specific attribute constraint from a searchstate.
Syntax
<searchstate:deleteconstraint
name="ssname
" [bucket="bucketname
"] [typename="assettype
"] attribute="attribname
"/>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
CAttributes
for content attribute, orPAttributes
for product attribute). If you do not specifyTYPENAME
, a default value is picked up from a property in thegator.ini
property file:mwb.defaultattributes
. The default value is set to bePAttributes
and may be changed to be the name of any custom attribute asset types you create.
attribute
(optional)- Input parameter. Note this parameter is required if there is no bucket present. Name of the attribute whose constraint should be deleted.
Description
This tag allows the user to delete a constraint already set in a searchstate based on attribute or bucket name. It is used when the particular constraint is not relevant in a searchstate (or one generated using searchstate:fromstring) being reused in different circumstances in the code.
Error Numbers
The possible values of
errno
include:
Value Description -10004 A required parameter is missing. -13050 General error.Example
This code serializes a
searchstate
"origSS" containing a simple constraint and creates a variable which contains the string representation.<searchstate:create name="ss" /> <searchstate:addsimplestandardconstraint name="ss" attribute="productdesc" value="LU50/90/27"/> <searchstate:tostring name="ss" varname="searchstring"/> <ics:getvar name="searchstring"/><br/>The following then deletes the constraint in a new searchstate "newSS" generated from the string representation. This code then sets this
searchstate
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="newSS" /> <searchstate:fromstring name="newSS" value='<%=ics.GetVar("searchstring")%>'/> <searchstate:deleteconstraint name="newSS" attribute="productdesc"/> <assetset:setsearchedassets name="as" constraint="newSS" 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:addsimplestandardconstraint
searchstate:fromstring
searchstate:tostring
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.