Newer Version Available
ContentAsset
File Suffix and Directory Location
ContentAsset components have the suffix .asset and are stored in the contentassets folder.
Version
ContentAsset components are available in API version 38.0 and later.
Special Access Rules
The system prevents metadata retrieval if the total size of the asset’s file content exceeds 30 MB. All pre-existing limits for packaging apply to asset files.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| format | ContentAssetFormat (enumeration of type string) | Describes the format of the asset file. Valid values are:
|
| language | string | Required. The language of the asset file label. |
| masterLabel | string | Required. The label for the asset file record, which displays in Setup. |
| originNetwork | string | For deploys, the name of the community the file is assigned upon creation. For retrievals, the name of the community the file is assigned to populates the field value. If null, file was not assigned to a community. |
| relationships | ContentAssetRelationships[] | The list of ContentAssetLinks that describe whether the asset file should be shared with the org. |
| versions | ContentAssetVersions | Required. Captures basic information about the file version(s) included the asset metadata. Typically the file has only one version. |
ContentAssetRelationships
Represents the relationships between an asset file and the locations it's linked with.
| Field Name | Field Type | Description |
|---|---|---|
| organization | ContentAssetLink[] | Carries information about sharing the asset file with the org. Maps to ContentDocumentLink. |
ContentAssetLink
Represents a relationship link for an asset file, and includes details about the level of access for the link.
| Field Name | Field Type | Description |
|---|---|---|
| access | ContentAssetAccess (enumeration of type string) | Required. The permission granted to the user of the shared file, determined by
the permission the user already has. Valid values are:
|
| name | string | Reserved for future use. |
ContentAssetVersions
Represents information about all file versions included in the asset metadata.
| Field Name | Field Type | Description |
|---|---|---|
| version | ContentAssetVersion[] | A list of file versions for the asset. |
ContentAssetVersion
Represents information about one file version included in the asset metadata.
| Field Name | Field Type | Description |
|---|---|---|
| number | string | Required. The version number. This field is based on, or sets, the ContentVersion. |
| pathOnClient | string | Required. Describes the original filename of the file. This field maps to ContentVersion.PathOnClient. It provides the data for the ContentVersion Title field. |
| zipEntry | string | If the asset file has more than one version, format is ZippedVersions. In this case, zipEntry is the name of the file within the zip. If the asset file has only one version, this field is empty. |
Declarative Metadata Sample Definition
The following is an example of a ContentAsset component.
1<?xml version="1.0" encoding="UTF-8"?>
2<ContentAsset xmlns="http://soap.sforce.com/2006/04/metadata">
3 <masterLabel>some asset</masterLabel>
4 <relationships>
5 <organization>
6 <access>VIEWER</access>
7 </organization>
8 </relationships>
9 <versions>
10 <version>
11 <number>1</number>
12 <pathOnClient>some asset.txt</pathOnClient>
13 </version>
14 </versions>
15</ContentAsset>For assets that include just one version, the format field can be omitted or specified with the value as Original. File assets with more than one version have versions wrapped in a zip file.
The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>MyAsset</members>
5 <name>ContentAsset</name>
6 </types>
7 <version>42.0</version>
8</Package>