Home > Contents > Index >
assetset:getattributevalues
Gets the list of attribute values that are associated with the assets represented by an assetset.
Syntax
<assetset:getattributevalues name="assetset name" attribute="attribute name" listvarname="list name" [typename="attribute asset type name"] [immediateonly="true|false
"] [ordering="ascending|descending
"]/>Parameters
name (required)
- Input parameter. Name of the assetset object.
attribute (required)
- Input parameter. Name of an attribute whose value should 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).
listvarname (required)
- Input and output parameter. As input, name of a list that holds a list of string values assigned on output and obtained from the assetset's attributes.
ordering (optional)
- Input parameter. Indicates whether the result list should be in ascending or descending order; value can be either
ascending
ordescending
.
Description
This tag generates one or more database queries, in order to retrieve the value of the attributes specified. Only distinct values are retrieved. Values inherited from parent assets may also be retrieved by this tag.
NOTE: This tag also causes dependencies to be recorded for all assets that contribute to the returned lists, or if this assetset object is not an enumerated one, then the equivalent of
render:unknowndeps
will be performed.
It is highly inefficient to retrieve values for multiple attributes, one at a time, by using this tag repeatedly on an assetset. It is recommended instead that assetset:getmultiplevalues be used in such circumstances. Note
Examples
This example gets all the distinct
PAttribute
"price
" attribute values, in lowest first order (see Note above), 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:getattributevalues ordering="descending" name="as"
typename="PAttributes" attribute="price" listvarname="results"/>
This example gets only the distinct
PAttribute
"price
" attribute values, in lowest first order (see Note above), 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:getattributevalues ordering="descending" name="as"
typename="PAttributes" attribute="price" immediateonly="true" listvarname="results"/>
See Also
assetset:getmultiplevalues
assetset:setsearchedassets
searchstate:create
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.