Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

ASSET.LOAD

Queries the database for the specified asset, and then loads an instance of the asset into memory as an object.

Note

It is inadvisable to use this tag for loading a flex asset. To display data from flex assets, use Assetset Tags .

Syntax

Parameters

NAME (required)
Input. The name to use to identify the asset after it is retrieved and stored as an object in memory. All references to the asset by other ASSET tags (ASSET.CHILDREN and ASSET.GET, for example) during this session use this name to identify the asset.

TYPE (required)
Input. The asset type of the asset that you want to retrieve from the database. Typically, you provide TYPE and OBJECTID. In special cases, when you know that a specific FIELD/VALUE pair can uniquely identify the asset, you can provide TYPE and the FIELD/VALUE pair.

OBJECTID (optional)
Input. The object ID of the asset. It is required unless you use TYPE with a FIELD/VALUE pair (defined below).

FIELD (optional)
Input. Used in a pair of values with VALUE to identify the asset by supplying a field name whose corresponding value uniquely identifies the asset. Note that if the FIELD/VALUE/SITE combination that you supply identifies more than one asset, CS-Direct sets errno to -10009.

VALUE (optional)
Input. Used in a pair of values with FIELD to identify the asset by supplying a value for a field that uniquely identifies the asset.

SITE (optional)
Input. Specifies site name. Used when using FIELD/VALUE to identify a unique asset.

DEPTYPE (optional)
When the using the ASSET.LOAD tag in a template, and the assets using this template have been approved for export, this attribute specifies whether approval dependency is exact, exists, greater, or none.

Legal values are:

EDITABLE (optional)
Input. Set to true if the asset is being loaded with intent to edit. By default this is false. When set to true, all the asset data is loaded into memory as a unit. Otherwise, some data, such as blob data and asset associations may be loaded as needed. Note, setting this parameter to true is equivalent to setting option to editable.

OPTION (optional)
Input. For peformance reasons, not all of the data for an asset is necessarily loaded on asset.load. Setting this value controls how much of the ancilliary data of the asset id loaded.

Legal values are:

    • readonly(default) -- The asset is loaded for read only. Attempt to save the asset data will result in error. Asset associations and site information is not loaded. This option should be used on the live site for best performance.
    • editable -- All asset data is loaded and available for editing. Note, this option is equivalent to using the editable="true" parameter.
    • readonly_complete -- All asset data is loaded but not avalailable for editing. Attempt to save the asset data will result in error.

FLUSHONVOID (optional)
Input. Set to true if the asset is being loaded in a template whose primary purpose is to display the asset. By default, this set to false. When set to true, the page cache for this page will be flushed if the asset fails to load or the asset has been deleted (i.e., it's status field is marked 'VO', for void). This prevents the page cache on the mirror destination from containing pagelets of deleted assets.

Description

This tag executes a database query to retrieve an instance of the specified asset and then puts the instance into memory (session information), assigning it the name provided by the NAME parameter. That object is then available until the session is flushed (the root element exits) or the name is overwritten. Object names are global in scope.

You can identify the asset that you want to load with its asset type and object ID, or the asset type combined with a FIELD/VALUE/SITE combination that uniquely identifies the asset.

Typically, each template element starts with an ASSET.LOAD tag so that subsequent code can extract and display the loaded data on pages for your online site.

errno

The possible values of errno include:

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.
-10009
More than one object met the specified criteria.

Example

This code loads an article asset, identifying it by type and object ID. It then displays the name and description of the article:

This code loads a page asset, identifying it by type and a FIELD/VALUE/SITE combination. It then displays the name and description of the page:

See Also

ASSET.CHILDREN
ASSET.GET
ASSET.LIST
ASSET.LOADALL
ASSET.SCATTER

  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.