Home > Contents > Index > 
Expanded TOC | Purpose TOC | Annotated TOC | Index 
AssetLoad
Queries the database for the specified asset, loads an instance of the asset into memory within the
Assetobject, and returns the loaded asset in an XML wrapper.
Note
This operation does not load flex assets.
Syntax
assetLoad(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 EXCLUDE, java.lang.String FIELDLIST)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.
- Typically, you provide
 TYPEandOBJECTID. 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 (optional)- (String) The unique identifying number that references the
 Assetobject. Not required if you useTYPEwith theFIELDandVALUEpaired parameters.
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, 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.
EXCLUDE (optional)- (Boolean) Depending on whether the value of
 EXCLUDEisTrueorFalse, theAssetLoadoperation either returns the fields specified in theFIELDLISTor returns the fields that are not contained in the list.
Trueindicates that all fields except the fields in theFIELDLISTare to be returned.
Falseindicates that only fields inFIELDLISTare to be returned. That is, it returns fields specified with theFIELDLISTparameter. The default value isFalse.
FIELDLIST (optional)- (String) Comma-separated list of fields that you want to include or exclude from the request for asset fields. The
 EXCLUDEparameter, which operates on theFIELDLIST, determines whether the fields in the list are returned or whether all fields other than those in the list are returned.
Description
Based on the specified parameters,
AssetLoadfills anAssetobject with data. It executes a database query to retrieve an instance of the specified asset and then saves the instance in memory.Multiple parameters provide different ways to identify the asset to load. Enter the parameter or parameter combination that is the most convenient identifier for your application, and leave blank placeholders for the unused parameters. Although only the
TYPEparameter is required, you must also supply at least theOBJECTIDor theFIELDandVALUEpaired parameters. You can identify the asset that you want to load by specifying its asset type and object ID, or by specifying its asset type combined with a field/value pair that uniquely identifies the asset.Typically, each web service calls the
AssetLoadoperation to start so that subsequent code can extract and display the loaded data on pages. All input parameters are strings.Note that the
AssetLoadoperation does not load information from the AssetPublication table or the AssetRelationTree table. If you need information from the AssetRelationTree table, use the AssetGetChildren operation. If you need information from other auxiliary tables, you can issue queries using the object ID of the loaded asset.Returns
Asset object that contains the requested field values.
errno
The possible values of
errnoinclude:
Value Description -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 loads a page asset, identifying it by type and object ID:
AssetService service = (AssetService)new AssetService_Impl(); AssetPortType port = service.getAssetPort(); LoadedAsset la = port.assetLoad("user_author", "demo", "Page", "968685128066", null, null, null, null);See Also
AssetSet Operations
AssetSet operations cover the functions required to retrieve attribute values for flex assets. The AssetSet group comprises the following operations:
Home > Contents > Index > ![]()
FatWire Web Services Reference
Copyright 2005 by FatWire Software
All rights reserved.