A binary asset that has visible dimensions, being the shared parent of images and videos. Adds pixel height and width to the file properties inherited from BinaryAsset. A script does not obtain a VisualAsset directly - use uploadImage or uploadVideo on the asset manager, which return the ImageAsset and VideoAsset subtypes.

Group: Assets

Extends: BinaryAsset


Properties

PropertyReturnsDescription
heightintThe height of the image or video in pixels.
widthintThe width of the image or video in pixels.

Inherited from BinaryAsset

Properties

PropertyReturnsDescription
cdnUrlStringAddress to serve the file from a content delivery network, set when the asset has been published to a CDN. Null when the file should be served from the platform itself.
fileSizeLongSize of the file in bytes, as recorded when it was stored. Where the asset has alternative formats this is the size of the primary representation only, and it is null when the size was never worked out.
hashStringThe SHA-1 hash of the file's content, which is how the bytes are located in the hash store. Duplicating an asset shares the same hash rather than copying the bytes.

Methods

getHash()

Returns: String

The SHA-1 hash of the file's content, which is how the bytes are located in the hash store. Duplicating an asset shares the same hash rather than copying the bytes.

getFileSize()

Returns: Long

Size of the file in bytes, as recorded when it was stored. Where the asset has alternative formats this is the size of the primary representation only, and it is null when the size was never worked out.

getCdnUrl()

Returns: String

Address to serve the file from a content delivery network, set when the asset has been published to a CDN. Null when the file should be served from the platform itself.


Inherited from Asset

Properties

PropertyReturnsDescription
allRelationsList<Relation>Every relation which points from this asset to another one, for example the thumbnail of a video. This reads the relations from the database, so treat it as a query rather than as a cheap field read.
assetTypesList<String>The asset type names this asset is tagged with, which is how the library is filtered into groups such as banners or product shots. Types are applied when the asset is uploaded and can be added afterwards, and the list is empty rather than null when the asset has none.
authorProfileIdLongIdentifier of the profile which created the asset, where that was recorded. Null for assets which were not attributed to a person.
createdDateDateWhen the asset was first added to the library. Duplicating an asset keeps the created date of the asset it was copied from.
formatStringThe media format of the asset, for example image, video, text, or a media type such as text and html. Treat it as the asset's type; searching the library matches on this as well as on the name, and uploading through the asset manager routes on it to decide whether an image, a video or a plain binary file is created.
languageStringLanguage code for the asset's content, used to pick the right variant when the same asset exists in several languages. Null when the asset is not language specific.
modifiedDateDateWhen the asset was last changed. It is set by whatever updates the asset, so it is only as accurate as the code which maintains it.
nameStringHuman readable name for the asset, used when searching the library and when listing assets. It is not guaranteed to be unique within a tenant.
notesStringFree text notes about the asset, describing what it is or how it should be used. Set when the asset is uploaded, and null when nothing has been recorded.
relatedEntityIdLongIdentifier of a profile or organisation this asset relates to, typically set when the asset is a contract document belonging to one specific person or organisation. Null for a general library asset. It can be set when uploading through the asset manager by passing a related entity id.
uniqueIdStringA globally unique identifier for the asset, usually a UUID. This is the stable handle to refer to an asset by, so use it rather than a database id when linking to an asset from content, and note that a duplicated asset is given a fresh one.

Methods

getUniqueId() · getName() · getAuthorProfileId() · getRelatedEntityId() · getCreatedDate() · getModifiedDate() · getFormat() · getNotes() · getAssetTypes() · getLanguage() · getAllRelations() · getRelations(String predicate) · getRelationsTo(String predicate)

getUniqueId()

Returns: String

A globally unique identifier for the asset, usually a UUID. This is the stable handle to refer to an asset by, so use it rather than a database id when linking to an asset from content, and note that a duplicated asset is given a fresh one.

getName()

Returns: String

Human readable name for the asset, used when searching the library and when listing assets. It is not guaranteed to be unique within a tenant.

getAuthorProfileId()

Returns: Long

Identifier of the profile which created the asset, where that was recorded. Null for assets which were not attributed to a person.

getRelatedEntityId()

Returns: Long

Identifier of a profile or organisation this asset relates to, typically set when the asset is a contract document belonging to one specific person or organisation. Null for a general library asset. It can be set when uploading through the asset manager by passing a related entity id.

getCreatedDate()

Returns: Date

When the asset was first added to the library. Duplicating an asset keeps the created date of the asset it was copied from.

getModifiedDate()

Returns: Date

When the asset was last changed. It is set by whatever updates the asset, so it is only as accurate as the code which maintains it.

getFormat()

Returns: String

The media format of the asset, for example image, video, text, or a media type such as text and html. Treat it as the asset's type; searching the library matches on this as well as on the name, and uploading through the asset manager routes on it to decide whether an image, a video or a plain binary file is created.

getNotes()

Returns: String

Free text notes about the asset, describing what it is or how it should be used. Set when the asset is uploaded, and null when nothing has been recorded.

getAssetTypes()

Returns: List<String>

The asset type names this asset is tagged with, which is how the library is filtered into groups such as banners or product shots. Types are applied when the asset is uploaded and can be added afterwards, and the list is empty rather than null when the asset has none.

getLanguage()

Returns: String

Language code for the asset's content, used to pick the right variant when the same asset exists in several languages. Null when the asset is not language specific.

getAllRelations()

Returns: List<Relation>

Every relation which points from this asset to another one, for example the thumbnail of a video. This reads the relations from the database, so treat it as a query rather than as a cheap field read.

getRelations(String predicate)

Returns: List<Relation>

Finds the relations of one kind which point from this asset to another, for example the thumb relation from a video to its thumbnail image. This reads from the database, so treat it as a query rather than as a cheap field read.

ParameterDescription
predicatethe name of the relationship to match, usually the type of the relationship to the object, for example "thumb"

getRelationsTo(String predicate)

Returns: List<Relation>

Finds the relations of one kind which point at this asset from other assets, in other words the reverse of getRelations. This reads from the database, so treat it as a query rather than as a cheap field read.

ParameterDescription
predicatethe name of the relationship to match, for example "thumb" to find the assets which use this asset as their thumbnail

Methods

getHeight()

Returns: int

The height of the image or video in pixels.

getWidth()

Returns: int

The width of the image or video in pixels.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.