Home > Contents > Index >
ASSET.EXPORT
Gathers Sites variables to create an XML rendition of an asset.
Syntax
<ASSET.EXPORTNAME="asset instance object"
PREFIX="prefix"
[OUTPUT="variable name]" />
[FILE="output file name"] />
[WRITEATTRVALUE="true|false"] />
Parameters
NAME (required)
- Name of the asset instance object.
PREFIX (required)
- First part of the name of all variables and lists to be gathered and used to genreate the XML. Variables are named with the prefix, a colon, then the field name. For example,
Variables.prefix:fieldname
.
OUTPUT (optional)
- Name of the output variable. This variable contains the resulting XML. Either output or file parameter is required.
FILE (optional)
- Name of the filename in which to write the XML. Either file or output parameter is required.
WRITEATTRVALUE (optional)
- Indicates whether to write the data of the attribute within the XML attribute tag or not. The default setting is true. If set to true the xml output for a simple string attribute will look like:
Otherwise, the xml output for a simple string attribute will look like:
<attribute name="simple"> <string value="the value for the string"/> </attribute>
<attribute name="simple"> <string> the value for the string </string> </attribute>
Description
The tag gathers previously scattered Sites variables of an asset and generates XML data describing all the scattered data of that variable. The XML can be written to a file or another Sites variable. Writing to a file is preferable for any asset which has a lot of data.
Error Numbers
The possible values of
errno
include:
Value Description Value Description -301 Error writing file. -10004 A required parameter is missing. -10005 The requested object is not in the object pool (is not loaded into memory).Example
The following code is an example of how to export a simple asset and import it in a newly created asset. This code exports a 'Collection' with id 968769614795 and then imports it into the new asset.
<ASSET.LOAD NAME="assetName1" TYPE="Collection" OBJECTID="968769614795"/> <!-- Scatter all fields of the asset into Sites variables --> <ASSET.SCATTER NAME="assetName1" PREFIX="exportPrefix1" EXCLUDE="true" /> <!-- Generate the XML and put it in Sites Variables.exportOutput --> <ASSET.EXPORT NAME="assetName1" PREFIX="exportPrefix1" OUTPUT="exportOutput" /> <!-- Create a new asset for importing the exported file --> <ASSET.CREATE NAME="newAsset" TYPE="Collection"/> <!-- Scatter all fields of the XML into Sites variables --> <ASSET.IMPORT NAME="newAsset" PREFIX="importPrefix1" XML="Variables.exportOutput" /> <!-- Gather the variables into the newly created asset --> <ASSET.GATHER NAME="newAsset" PREFIX="importPrefix1" FIELDLIST="*"/> <!-- Set the name of the asset to "Copy of [name]" --> <ASSET.SET NAME="newAsset" FIELD="name" VALUE="Copy of Variables.exportPrefix1:name"/> <!-- Save the asset --> <ASSET.SAVE NAME="newAsset"/>See Also
ASSET.CREATE
ASSET.GATHER
ASSET.GET
ASSET.IMPORT
ASSET.LOAD
ASSET.SAVE
ASSET.SCATTER
ASSET.SET
Home > Contents > Index > Oracle XML Tag Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.