Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

SEARCHSTATE.ADDSIMPLELIKECONSTRAINT

Adds an attribute name/single value constraint to an existing searchstate.

Syntax

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, or PAttributes for product attribute). If you do not specify TYPENAME, a value is supplied from a property in the gator.ini property file: mwb.defaultattributes=PAttributes. The default value is set to be PAttributes 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.

VALUE (required)
Input parameter. The single value that constrains the attribute.

IMMEDIATEONLY (optional)
Input parameter. A boolean: 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.

Description

This tag is the simple version of SEARCHSTATE.ADDLIKECONSTRAINT . This tag is similar to a database LIKE operation and accepts wild cards (%). The object referred to by NAME is updated to reflect the new constraint. If the attribute name is already in the searchstate, then the new constraint replaces the old constraint.

errno

The possible values of errno include:

Value
Description
-10004
A required parameter is missing.
-13050
General error.

Example

This code creates an empty SEARCHSTATE and adds a like constraint. The constraint sets the attribute to search on and specifies a value to match against. The typename parameter is not specified and the default set in gator.ini is picked up. Any assets with matching values for this attribute will be returned . This code then sets this SEARCHSTATE into an ASSETSET.SETSEARCHEDASSETS tag to constrain the ASSETSET 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:

See Also

SEARCHSTATE.CREATE
SEARCHSTATE.ADDSIMPLESTANDARDCONSTRAINT
SEARCHSTATE.ADDLIKECONSTRAINT
ASSETSET.SETSEARCHEDASSETS
ASSETSET.GETATTRIBUTEVALUES

  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.