Home > Contents > 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, for example, assetset:setasset.
Syntax
<asset:load name="assetName
" type="assetType
" [objectid="object.id
"] [field="fieldName
"] [value="fieldValue
"] [site="siteName
"] [deptype="exact|exists|none"] [editable="true|false"] [option="editable|readonly|readonly_complete"] [flushonvoid="true|false"]/>Parameters
name
(required)- Input. Name 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. Asset type of the asset that you want to retrieve from the database. Provide both
type
andobjectid
.
objectid
(optional)- Input. Object ID of the asset. It is required unless you use a
field/value
pair (defined below). Errno is set to -10006 only if objectid does not have a numeric value. There is no verification on whether the object exists or not. Note, ifobjectid
is used, thesite
parameter value will be ignored.
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 thefield/value/site
combination that you supply identifies more than one asset, Sites 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. Note, if thesite
is supplied, and an attribute for the selectedtype
is larger the value defined in cc.bigtext (futuretense.ini), the attribute value returned will be the path and file name where the content is stored.
deptype (optional)
- When 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 isexact
,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.
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 toeditable
.
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 theeditable="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 is 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
JSP
template element starts with anasset:load
tag so that subsequent code can extract and display the loaded data on pages for your on-line site.Error Numbers
The possible values of
errno
include:
Value Description -101 No rows returned. -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. -10006 The object ID is not of numeric value. -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:
<asset:load name="MainArticle" type="Article" objectid='<%=ics.GetVar("cid")%>' flushonvoid="true" /> <asset:scatter name="MainArticle" prefix="main" /> <ics:getvar name="first:name"/>,<ics:getvar name="main:description"/>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:<asset:load name="NewsSectionFront" type="Page" field="name" value="News" site='<%=ics.GetVar("site")%>'/> <asset:get name="NewsSectionFront" field="name" /> <asset:get name="NewsSectionFront" field="description" /> <ics:getvar name="name"/>,<ics:getvar name="description"/>See Also
asset:children
asset:get
asset:list
asset:loadall
asset:scatter
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.