Initializing help system before first use

Attachment

Contains information about a scenario or app attachment. See scenario.getScenarioAttachments().

Method summary

name description
download Downloads this attachment.
getDataUrl Returns a URL where the attachment data can be downloaded from.
getDescription Returns the description of the attachment.
getEditor Returns the editor details for the attachment.
getFilename Returns the filename for this attachment.
getId Returns the unique ID for this attachment.
getLastModifiedDate Returns the date/time when the last modification of the attachment data took place.
getLastModifiedUserId Returns the ID of the last user to modify the attachment data.
getSize Returns the size of the attachment data.
getTags Returns the tags applied to this attachment.
hasEditor Returns the editor details for the attachment.
openProperties Opens the file attachments dialog showing the properties of this attachment.

Methods

method
download ( )

Downloads this attachment. Depending on browser settings, this may prompt the user to choose where to save the file, or save it automatically.

details
Example
examples
attachment.download();
Back to Top
method
getDataUrl ( ) → {string}

Returns a URL where the attachment data can be downloaded from.

details
Returns:
returns table
Type Description
type
string
The relative path to download the attachment data
Example
examples
var url = attachment.getDataUrl();
Back to Top
method
getDescription ( ) → {string}

Returns the description of the attachment.

details
Returns:
returns table
Type Description
type
string
The description of the attachment
Example
examples
var description = attachment.getDescription();
Back to Top
method
getEditor ( editorId ) → {AttachmentEditor}

Returns the editor details for the attachment.

Parameters:
params
Name Type Argument Description
editorId
type
insight.enums.EditorType
optional  id of the editor to retrieve
details
Throws:
exceptions
Will throw an error if attachment doesn't have a requested editor
Returns:
returns table
Type Description
type
AttachmentEditor
Attachment Editor object. Returns editor with the same id as editorId or first editor, when editorId is not specified.
Example
examples
var attachmentEditor = attachment.getEditor();
Back to Top
method
getFilename ( ) → {string}

Returns the filename for this attachment.

details
Returns:
returns table
Type Description
type
string
The filename for this attachment
Example
examples
var filename = attachment.getFilename();
Back to Top
method
getId ( ) → {string}

Returns the unique ID for this attachment.

details
Returns:
returns table
Type Description
type
string
The ID representing this attachment
Example
examples
var id = attachment.getId();
Back to Top
method
getLastModifiedDate ( ) → {Date}

Returns the date/time when the last modification of the attachment data took place.

details
Returns:
returns table
Type Description
type
Date
The last modified time
Example
examples
var date = attachment.getLastModifiedDate();
Back to Top
method
getLastModifiedUserId ( ) → {string}

Returns the ID of the last user to modify the attachment data.

details
Returns:
returns table
Type Description
type
string
The User ID of the modifying user
Example
examples
var userId = attachment.getLastModifiedUserId();
Back to Top
method
getSize ( ) → {number}

Returns the size of the attachment data.

details
Returns:
returns table
Type Description
type
number
The size in bytes of the attachment data in bytes.
Example
examples
var size = attachment.getSize();
Back to Top
method
getTags ( ) → {Array.<string>}

Returns the tags applied to this attachment.

details
Returns:
returns table
Type Description
type
Array.<string>
An array of tag names
Example
examples
var tags = attachment.getTags();
Back to Top
method
hasEditor ( editorId ) → {boolean}

Returns the editor details for the attachment.

Parameters:
params
Name Type Argument Description
editorId
type
insight.enums.EditorType
optional  id of the editor to retrieve
details
Returns:
returns table
Type Description
type
boolean
When editorId is specified, returns true if attachment has an editor with specified id, otherwise returns false. When editorId is not specified, returns true if there's any editors available, otherwise returns false
Example
examples
var hasEditor = attachment.hasEditor();
Back to Top
method
openProperties ( propertyName )

Opens the file attachments dialog showing the properties of this attachment. If propertyName is provided then the edit mode will be activated for that property of the attachment.

Parameters:
params
Name Type Argument Description
propertyName optional  the name of a property to edit ('filename', 'description' or 'tags')
details
Example
examples
attachment.openProperties('filename');
Back to Top