Home > Contents > Index >
asset:search
Locates a list of asset primary table rows based on the asset type and a set of search criteria.
Syntax
<asset:search type="asset type" [subtype="asset subtype"] prefix="prefix" [fieldlist="field name(s)"] [exclude="true|false"] [what="fieldsToReturn"] [limit="maximum assets"] [order="order-by string"] list="list variable name" />Parameters
type (required)
- Asset type of assets for which to search.
subtype (optional)
- Asset subtype. For flex assets, this must be specified if asset attributes are part of the search criteria.
prefix (required)
- Prefix for variable names used to specify search criteria .
fieldlist (optional)
- A comma-separated list of field names that may have search criteria specified. If this argument is not specified, then all local fields are considered. The following key words represent groups of attributes: "LocalFields" - fields of the asset's primary table "Publist" - publication ids.
exclude (optional)
- When set to
true
, it specifies to expect criteria passed in all fields except those specified by the fieldlist parameter.
what (optional)
- Comma separated list of fields from the asset's primary table to return. '*' indicates return all fields.
limit (optional)
- Maximum number of assets to return.
order (optional)
- An Order-By string to add to the end of the query. You can only use fields in the asset type's primary table for the order-by string.
list (required)
- Name of resulting list.
Description
The search criteria are gathered from Sites variables. For attributes of simple types, the variable search criteria is gathered from the following:
prefix:attribute
_op
- Search operation - Valid values are=, !=, <, >, <=, >=, like,
ornot like
.
prefix:attribute
_map
- For case-insensitive search of string fields. Indicates whether to map everything to upper or lower case before performing the operation. - Valid values arenone, upper,
orlower
.
prefix:attribute:
Total
- Number of criteria for this attribute to string together with ORs.
prefix:attribute:
n - Where n is a number between 0 andprefix:attribute:
Total
-1 , indicating the search value.If there is no
prefix:attribute:
Total
variable:
prefix:attribute
- Search valueError Numbers
The possible values of
errno
include:
Value Description -105 Database error. -10001 The implementing class is invalid. -10002 There is a missing method for the implementing class. -10003 The method could not be invoked successfully. -10001 The implementing class is invalid. -12006 There is no such asset type. -12064 Invalid asset search criteria.Example
This code gets a list of Collection assets whose status is not voided and name is like Stories. It returns all the columns of the Collection table. It then displays the name and description of each collection:
<ics:setvar name="prefix:status_op" value="!="/> <ics:setvar name="prefix:status" value="VO"/> <ics:setvar name="prefix:name_op" value="like"/> <ics:setvar name="prefix:name" value="Stories"/> <asset:search type="Collection" prefix="prefix" list="collections"/> <ics:listloop listname="collections"><ics:listget listname="collections" fieldname="name"/> ,<ics:listget listname="collections" fieldname="description"/><br/></ics:listloop>This code gets a list of Products assets whose Symbol attribute is - PMDEX or PMDIX, regardless of case. It then displays the name and description of each asset:
<ics:setvar name="prd2:Attribute_Symbol:Total" value="2"/> <ics:setvar name="prd2:Attribute_Symbol:0" value="pmdex"/> <ics:setvar name="prd2:Attribute_Symbol:0_op" value="="/> <ics:setvar name="prd2:Attribute_Symbol:0_map" value="lower"/> <ics:setvar name="prd2:Attribute_Symbol:1" value="pmdix"/> <ics:setvar name="prd2:Attribute_Symbol:1_op" value="="/> <ics:setvar name="prd2:Attribute_Symbol:1_map" value="lower"/> <asset:search type="Products" subtype="PTypeFund" prefix="prd2" list="pmdproducts" what="id,name,description" fieldlist='Attribute_Symbol'/> <ics:listloop listname="pmdproducts"><ics:listget listname="pmdproducts" fieldname="name"/> ,<ics:listget listname="pmdproducts" fieldname="description"/><br/></ics:listloop>See Also
asset:list
ics:listloop
ics:listget
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.