Home > Contents > Index >
ASSET.CHILDREN
Queries the AssetRelationTree table and builds a list of child assets for the specified parent asset.
Syntax
<ASSET.CHILDREN
NAME="
assetName
"
[TYPE="
parent assettype
"]
[ASSETID="
parent assetid
"]
LIST="
listName
"
[CODE="
NameOfAssociation
"]
[OBJECTTYPE="
typeOfObject
"]
[OBJECTID="
objectID
"]
[DEPTYPE="
exact|exists|none
"]
[ORDER="
nrank
"]/>
Parameters
NAME (required unless type and assetid supplied)
- Input. Name assigned to the parent asset whose children you want to list. This parent asset must be loaded and assigned a name before you can pass its name to this tag. (See
ASSET.LOAD
.)
TYPE (required if name is not used)
- Input. Asset type of the parent asset whose children you want to list. Either
type+assetid
or name must be supplied to identify the parent asset.
ASSETID (required if name is not used)
- Input. Asset id of the parent asset whose children you want to list. Either
type+assetid
or name must be supplied to identify the parent asset.
LIST (required)
- Input. The name to assign to the list that stores the results. The columns in the list match the columns in the AssetRelationTree table, and, if you use the
OBJECTYPE
parameter, the asset table. If a list with this name already exists, it is replaced with this new list.
CODE (optional)
- Input. Restricts the list to include only the child assets that have the relationship (association) specified by this parameter. You can restrict the list by named associations or by unnamed relationships. This value comes from the ncode field of the AssetRelationTree.
- For example, if you include
OBJECTTYPE="Image"
andCODE="MainImage"
for an article asset, Sites lists only the image asset that is related to that article asset by the Main Image named association. Without theCODE
entry, Sites lists all the images associated with the article.
- To list only the child assets that are associated with the parent asset by unnamed relationships, use a hyphen (-). For example:
CODE= "-"
- If you do not specify
OBJECTTYPE
orCODE
, the list includes all children with named associations or unnamed relationships to the parent asset.
OBJECTTYPE (optional)
- Input. Restricts the list of children by asset type. If you supply an
OBJECTTYPE
, the list of children is a join of the AssetRelationTree and the asset table for the type specified.
- To request a specific child asset, combine this parameter with
OBJECTID
. Note that if you include anOBJECTID
,OBJECTTYPE
is not optional.
OBJECTID (optional)
- Input. Restricts the list to include only the child asset that you specify. You must provide both an
OBJECTID
and anOBJECTTYPE
to request a specific child.
DEPTYPE (optional)
- Input. This attribute specifies whether static publishing approval dependency is
exact
,exists
, ornone
.Legal values are:
exact
(default) -- Exact
specifies a version dependency. The version of the dependent asset must be equal to the version of the asset when it was approved.
exists
-- Exists
specifies that any version of the asset satisfies the dependency condition.
none
-- None
specifies no approval dependency on the asset.ORDER (optional)
Input. The fields to sort the list by and whether the sort on those fields is ascending ( asc
) or descending (desc
). By default, the sort is ascending. If you specify more than one field, separate the field names with a comma.
For example, if you specify ORDER="nrank"
, the list is sorted by rank starting at number 1. If you want the list sorted by descending rank, useORDER="nrank desc".
Description
This tag queries the AssetRelationTree table for a list of the children of the asset that you specify, listing each child with a value for all of the fields from that table (
nid
,nparentid
,nrank
,otype
,oid
, andncode
). You must either load the parent asset (ASSET.LOAD ) before you can invoke this tag or specify theTYPE
andASSETID
.For example, you can use this tag to retrieve the assets referred to by a collection asset or the image assets associated with an article asset. You can then loop through the list, or reference the data returned in the list to display the relevant information from those assets.
You can restrict the list of children by association name (
CODE
), object type, and object ID.If you use the
OBJECTTYPE
parameter, the resulting list of children is a join of the AssetRelationTree and the asset table for the type specified and contains data from both tables. In such a case, you do not need to use ASSET.LOAD to load the child asset to get asset data from the primary asset table.For more information about the columns of the AssetRelationTree table, see the section in the Developer's Guide entitled "Tree Tables" in Chapter 12.
Error Numbers
The possible values of
errno
include:
Value Description -111 The asset has no children. -10004 A required parameter is missing. -10005 The requested object is not in the object pool (is not loaded into memory). -10006 The object ID is not valid. -10007 The version of the object is not valid.Example
This code retrieves the query asset that has been associated with the Home Page through the LatestNews association and writes it to a list named
LatestNewQuery
:<ASSET.LOAD NAME="HomePage" TYPE="Page" FIELD="name" VALUE="Home"/> <ASSET.CHILDREN NAME="HomePage" LIST="LatestNewQuery" OBJECTTYPE="Query" CODE="LatestNews"/>This code retrieves the query asset that has been associated with a parent asset through the LatestNews association without loading the parent asset:
<ASSET.CHILDREN TYPE="Home" OBJECTID="Variables.cid" LIST="LatestNewQuery" OBJECTTYPE="Query" CODE="LatestNews"/>This code retrieves a collection of articles, determines the members of the collection, and then displays the Description field of each article:
<ASSET.CHILDREN NAME="MainArticle" CODE="ImageGallery" LIST="IG"/> <ASSET.LOAD NAME="IG" OBJECTTYPE="Collection" OBJECTID="IG.oid"/> <ASSET.CHILDREN NAME="IG" CODE="-" ORDER= "nrank" OBJECTTYPE="Image" LIST="IGL"/> <OL> <LOOP LIST="IGL"> <LI/> <CSVAR NAME="IGL.description"/> </LOOP> </OL>See Also
ASSET.CHILDTYPES
ASSET.LEGALCHILDTYPES
ASSET.LIST
ASSET.LOAD
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.