Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleOverview
The JSMA entity provides access to the underlying IBS entity of a file that has been stored. It allows you to retrieve the entity information, update and delete the entity.

Index

Table of Contents
maxLevel3

Methods

The JSMA entity provides the following methods:

string entity.uuid

Returns the IBS UUID of the entity.

Example

Code Block
languagejs
linenumberstrue
...
var entity = file.getIbsEntity();
entity.uuid # => 'c61ee560-56b3-4722-9070-dc2ed51b116a'
...

object entity.info

Retrieves the entity information from the IBS API and returns it as an object.

Example

Code Block
languagejs
linenumberstrue
...
var entity = file.getIbsEntity();
var info = entity.info;
Object.keys(info) # => [
  "expirydate",
  "creationdate",
  "pinned",
  "countparents",
  "description",
  "type",
  "modificationdate",
  "uuid",
  "hrid",
  "datasource",
  "mimetype",
  "state",
  "countchildren"
]
...

void entity.update(options)

Updates the entity via the IBS API.

Example

Code Block
languagejs
linenumberstrue
...
var entity = file.getIbsEntity();
info = entity.update({ description: 'a new description' });
...

Parameter options:object (required)

See possible fields in the IBS entity API documentation.

void entity.delete()

Deletes the entity in the IBS.

Example

Code Block
languagejs
linenumberstrue
...
var entity = file.getIbsEntity();
info = entity.delete();
...