StorageItemModel
The StorageItem model represents a storage item of an asset.
implements: hash, sequence<StorageItemModel>, scalar
bundle: online channel standard (oc)
since 4.2.0
The StorageItem model represents a storage item of an asset.
When addressed as a sequence this model behaves like a sequence containing just itself.
Common Properties
key ↦ String
since 4.2.0
Returns key of the storage item.
mimetype ↦ String
since 4.2.0
Returns the MIME type of the storage item.
filelength ↦ Number
since 4.2.0
Returns the file size of the storage item in bytes.
hashcode ↦ String
since 4.5.4
Returns the hash code of the storage item contents. Should the attribute not exist, an empty string will be returned.
xml ↦ NodeModel
since 4.3.0
Returns the xml defining the storage item's properties.
element ↦ AssetElementModel
since 4.2.0
Returns the asset element structure this storage item is defined in
Image Properties
width ↦ Number
since 4.2.0
Returns the value of the attribute width. Should the attribute not exist, -1 will be returned.
height ↦ Number
since 4.2.0
Returns the value of the attribute height. Should the attribute not exist, -1 will be returned.
dpi ↦ Number
since 4.2.0
Returns the value of the attribute dpi. Should the attribute not exist, -1 will be returned.
color ↦ String
since 4.2.0
Returns the value of the attribute color. Should the attribute not exist, an empty string will be returned.
Text Properties
content ↦ String | NodeModel
since 4.2.0
Returns the textual content of the storage item.
If the MIME type is equal to text/xml, the return value is of type Node. Otherwise, the MIME type will be checked. If it begins with “text”, a String will be returned; otherwise undefined will be returned.
URL Generation
url ↦ String
since 4.2.0
Returns the URL for a storage item.
url(String:fileName) ↦ String
since 4.2.0
Returns the URL of a storage item using the given fileName
persistentUrl ↦ String
since 4.4.3
Returns an URL which always points to the content of the storage item with the same key in always in the current version of the asset.
This means that the URL remains valid when the content of the storage item is updated.
For this reason browser caching is disabled for such URLs.
downloadUrl ↦ String
since 4.4.3
Returns the URL of the storage item for the download, i.e. with Content-Disposition Attachment.
downloadUrl(String:fileName) ↦ String
since 4.2.0
Returns the URL of a storage item using the given fileName
Filename is set i.e. by a Content-Disposition Attachment.
persistentDownloadUrl ↦ String
since 4.4.3
Returns the URL of the storage item for download, i.e. with Content-Disposition Attachment. The URL always points to the content of the storage item in the current version of the asset.
This means that the URL remains valid when the content of the storage item is updated.
For this reason browser caching is disabled for such URLs.
persistentDownloadUrl(String:fileName) ↦ String
since 4.2.0
Returns the URL of a storage item using the given fileName
Filename is set i.e. by a Content-Disposition Attachment.
The URL always points to the content of the storage item in the current version of the asset.
This means that the URL remains valid when the content of the storage item is updated.
For this reason browser caching is disabled for such URLs.
[used as scalar] ↦ String
since 4.2.0
Returns the key of the storage item.
Defined hash keys
available ↦ false
since 2019.3.1
return if storage item is currently accessible
dataUrl ↦ String
since 5.3.2
Returns the content encoded as base64 data url. Attention: increases memory consumption during page creation.