Home >
AssetGetChildren
Queries the AssetRelationTree table and builds a list of child assets for the specified parent asset.
Syntax
assetGetChildren(java.lang.String authusername, java.lang.String authpassword, java.lang.String TYPE, java.lang.String OBJECTID, java.lang.String FIELD, java.lang.String VALUE, java.lang.String CODE, java.lang.String CHILDTYPE, java.lang.String CHILDID, java.lang.String ORDER)Parameters
authusername (required)- (String) Name of the user to log in, as registered in Sites .
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
TYPEandOBJECTIDto request a specific child asset. When you know that a specific field/value pair can uniquely identify the asset, you can provideTYPEand the field/value pair instead. Either theOBJECTIDor theFIELDandVALUEcombination, but not both, are required to load an asset.
OBJECTID (required)- (String) The unique identifying number that references the
Assetobject. 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 Sites assets include
name,template,status,description,subtype,category,modified,headline,byline, andbody. Use the field name in conjunction with theVALUEparameter 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, theAssetLoadoperation uses the first one that it finds.
- Not required if you use
TYPEwith theOBJECTIDparameter.
VALUE (optional)- (String) Value that corresponds to the field specified by the
FIELDparameter. Paired with the field name, this parameter uniquely identifies an asset by supplying the associated value.
- Not required if you use
TYPEwith theOBJECTIDparameter.
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
ncodefield 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 theCODEentry, 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
OBJECTTYPEorCODE, the list includes all children with named associations or unnamed relationships to the parent asset.
- Valid values are either
PlacedorUnplaced.
CHILDTYPE (optional)- (String) The asset type of child that you want to retrieve. The child asset type, which can be the same as the
TYPEparameter, depends on the asset that you are passing. For example, common asset types includearticle,image,page,collection, andquery. Other asset types include those flex assets for Sites and Sites-Engage assets. If noChildTYPEparameter is passed, theGetChildrenoperation 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
GetChildrenoperation 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
ascendingordescending. For example, you can specifyID,name,date,created by user, and so on. By default, the sort isascending. If you specify more than one field, separate the field names with a comma.
- For example, if you specify O
RDER="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 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, andncode). You must load the parent asset with theAssetLoadoperation before you can invoke this operation to query for and list its children. The list is a standard Sites 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
TYPEparameter, 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 theAssetLoadoperation 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.
Error Numbers
The possible values of
errnoinclude:
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:AssetService service = new AssetServiceLocator(); AssetPortType port = service.getAssetPort(); IList myList = port.assetGetChildren("user_author", "demo", "Page", "968685128066", null, null, null, "Query", null, null);
Home > Contents > Index > ![]()
Oracle Web Services Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.