Home > Contents > Index >
Expanded TOC   |    Purpose TOC   |    Annotated TOC   |    Index

 

AssetGetChildren

Queries the AssetRelationTree table and builds a list of child assets for the specified parent asset.

Syntax

Parameters

authusername (required)
(String) Name of the user to log in, as registered in Content Server.

authpassword(required)
(String) Password for the associated user name.

TYPE (required)
(String) The asset type of the asset that you want to retrieve from the database. For your web service, the value must be page.The list of children is a join of the AssetRelationTree and the asset table for the type specified.

Typically, you provide TYPE and OBJECTID to request a specific child asset. When you know that a specific field/value pair can uniquely identify the asset, you can provide TYPE and the field/value pair instead. Either the OBJECTID or the FIELD and VALUE combination, but not both, are required to load an asset.

OBJECTID (required)
(String) The unique identifying number that references the Asset object. Not required if you use TYPE with the FIELD and VALUE paired parameters (defined below).

FIELD (optional)
(String) A field is any one of the column names for the asset. For example, standard fields for CS-Direct assets include name, template, status, description, subtype, category, modified, headline, byline, and body. Use the field name in conjunction with the VALUE parameter as the name portion of a name/value pair. The field name and its corresponding value uniquely identifies the asset to be loaded. Note that if the field/value pair that you supply identifies more than one asset, the AssetLoad operation uses the first one that it finds.

Not required if you use TYPE with the OBJECTID parameter.

VALUE (optional)
(String) Value that corresponds to the field specified by the FIELD parameter. Paired with the field name, this parameter uniquely identifies an asset by supplying the associated value.

Not required if you use TYPE with the OBJECTID parameter.

CODE (optional)
(String). 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" and CODE="MainImage" for an article asset, CS-Direct lists only the image asset that is related to that article asset by the Main Image named association. Without the CODE entry, CS-Direct 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 or CODE, the list includes all children with named associations or unnamed relationships to the parent asset.

Valid values are either Placed or Unplaced.

CHILDTYPE (optional)
(String) The asset type of child that you want to retrieve. The child asset type, which can be the same as the TYPE parameter, depends on the asset that you are passing. For example, common asset types include article, image, page, collection, and query. Other asset types include those flex assets for CS-Direct Advantage and CS-Engage assets. If no ChildTYPE parameter is passed, the GetChildren operation returns all children for the asset by default.

CHILDID (optional)
(String) The object ID of the specific child node to return. If you supply a child ID, you must also supply a child type. If no child ID is specified, the GetChildren operation returns all children for the asset.

ORDER (optional)
(String) The fields to sort the list by, and whether the sort result on those fields is ascending or descending. For example, you can specify ID, name, date, created by user, and so on. 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, use ORDER="nrank desc".

Description

This operation 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, and ncode). You must load the parent asset with the AssetLoad operation before you can invoke this operation to query for and list its children. The list is a standard Content Server list.

Typical use for this operation is to retrieve the assets referred to by a collection asset, the image assets associated with an article asset, and so on. 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, object ID, and rank (ORDER).

If you use the TYPE 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 that case, you do not need to use the AssetLoad operation for a child asset of that type if that asset type stores all of its asset data in the primary asset table. Instead, you can get that information from the list.

Returns

Ilist containing children.

errno

The possible values of errno include:

Value Description
-111 The asset has no children.
-10001 The implementing class is invalid.
-10002 There is a missing method for the implementing class.
-10003 The method could not be invoked successfully.
-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.
-10009 More than one object met the specified criteria.

 

Example

This code retrieves a collection of articles, determines the members of the collection, and then displays the nid (node ID) field of each article:

 

  Home > Contents > Index >

FatWire Web Services Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.