Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
assetset:getattributevaluecount
Gets the count of distinct attribute values for a specific attribute associated with the assets represented by an assetset.
Syntax
<assetset:getattributevaluecount name="assetset name" attribute="attribute name" varname="variable name" [typename="attribute asset type name"] [immediateonly="true|false
"]/>Parameters
name (required)
- Input parameter. Name of the assetset object.
attribute (required)
- Input parameter. Name of an attribute whose values are to be looked up.
typename (optional)
- Input parameter. Asset type name of the attribute. The default is set by the parameter
mwb.defaultattributes
in thegator.ini
file. If this parameter is not set you are required to pass this argument.
immediateonly
(optional)- Input parameter. Boolean value indicating whether to include inherited attribute values or not. A
false
value indicates that inherited values should be included (the default).
varname (required)
- Input and output parameter. As input, name of the variable that holds the count of the unique values requested on output.
Description
This tag generates one or more database queries, in order to count the number of distinct values of the attribute specified. Values inherited from parent assets may also be counted by this tag.
NOTE: This tag also causes dependencies to be recorded for all assets that contribute to the returned count, or if this assetset object is not an enumerated one, then the equivalent of
render:unknowndeps
will be performed.Examples
This example counts all the distinct
PAttribute
"price
" attribute values from a given assetset object representing all 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:getattributevaluecount name="as"
typename="PAttributes" attribute="price" varname="resultcount"/>
This example counts only the distinct
PAttribute
"price
" attribute values which are not inherited from a parent, from a given assetset object representing allProduct
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" assettypes="Products"/> <!-- Get a set of all values for the given attribute. --><assetset:getattributevaluecount name="as"
typename="PAttributes" attribute="price" immediateonly="true" varname="resultcount"/>
See Also
assetset:getattributevalues
assetset:getmultiplevalues
assetset:setsearchedassets
searchstate:create
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.