Home > Contents > Index >
Template Tags TOC | Alpha TOC | Tag Family TOC | Purpose TOC | Annotated TOC | Index
assetset:getassetlist
Retrieves an ordered list of assets, given optional sort criteria.
Syntax
<assetset:getassetlist name="assetset name" [list="sort attribute list"] [maxcount="maximum row count"] [method="random|highest
"] [immediateonly="true|false
"] listvarname="list name"/>Parameters
name (required)
- Input parameter. Name of an assetset object.
list (optional)
- Input parameter. Name of the list that determines sort order. This list has three columns:
attributetypename
- Name of attribute asset type to sort on.attributename
- Name of attribute to sort by, or one of the following special values:
_RATING_
- order by asset rating (CS-Engage only)
_ASSETTYPE_
- order by asset type
direction
- Eitherascending
ordescending
maxcount (optional)
- Input parameter. Maximum number of rows to return in the list. A value of
0
(zero) indicates all. If count is less than the number that otherwise is returned, then items are selected according to the specifiedmethod
argument.
method (optional)
- Input parameter. Required only if the value of
maxcount
is less than the number of items described.method
can have one of the following values:
random
- Random weighted selection based on rating.highest
- Best selection based on rating.- This parameter is meaningful only in the context of CS-Engage.
immediateonly
(optional)- Input parameter. Boolean value indicating whether to consider inherited attribute values or not. A
false
value indicates that inherited values should be considered (the default).
listvarname (required)
- Input and output parameter. As input, name of the list that holds the assigned values on output. The list has the following columns:
assettype
assetid
- A column for each sort attribute name, prefixed by the string
SORT_
.Description
Each row in the ordered list holds a value for each attribute that is used for sorting. For example, if an assetset represents a product that has two authors, (say
Fred
andSam
), and the result is specified to sort by author, then the result set has a column calledSORT_author
, with two rows (one forFred
and one forSam
).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.This tag is often used in conjunction with the
assetset:getmultiplevalues
tag, which is used to retrieve the attribute values for the assets found with this tag.
Note
If you sort on an attribute that does not exist for some assets, those assets will be filtered from the results. It is therefore often the case that sort attributes are required attributes.
The attribute ordering values Note
ascending
anddescending
operate in the reverse manner from what might be logically expected. Therefore, ifascending
order is specified, the ordinally lowest value will occur last in the result list.Example
This example obtains a list of assets from the assetset called
myassetset
. This list will include only assets that have at least one value for thebulbsize
attribute, and will be ordered in lowest first order by the value of that attribute. Furthermore, if any asset has more than one value for thebulbsize
attribute, it will be listed once for each value it has.<listobject:create name="mylistobject" columns="attributetypename,attributename,direction"/> <listobject:addrow name="mylistobject">
<listobject:argument name="attributetypename" value="PAttributes"/> <listobject:argument name="attributename" value="bulbsize"/> <listobject:argument name="direction" value="descending"/></listobject:addrow> <listobject:tolist name="mylistobject" listvarname="listout"/> <!-- Apply the sort list to an assetset and retrieve a resultset list --> <assetset:getassetlist name="myassetset" list="listout" listvarname="aslist"/>See Also
assetset:getmultiplevalues
listobject:create
listobject:addrow
listobject:tolist
Home > Contents > Index > ![]()
FatWire JSP Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.