Module: documentEditor/UIApi

These methods represent the interface between the SmartComponents and the TTKF UI.

Methods

<inner> closeDialog()

Closes the dialog.
If the dialog will be closed without calling the methode "saveChanges", no changes will be saved in the document.

<inner> getApiVersion() → {string}

Gets the gui api version.

Returns:

an object with the version number of the SmartComponent GUI api in json object syntax. The objects contains the major version, minor version and revision number.

Type
string

<inner> getGuiLanguage() → {string}

Gets the gui language of the document editor.

Returns:

The gui language in ISO 3166 format ("en-us","de-de").

Type
string

<inner> getParameterList() → {string}

Gets a list with all component parameter ids.
If a component is part of a template,
the list is filtered depending on the template permissions.

Returns:

A list of parameter names in json array syntax.

Type
string

<inner> getParameterValue(id) → {string}

Gets the current value for a parameter.

Parameters:
Name Type Description
id string

The parameter id.

Returns:

The parameter value.

Type
string

<inner> getSharedPath() → {string}

Gets the path to the shared files.

Returns:

file path

Type
string

<inner> importFile(id) → {string}

Imports the selected file to the shared folder after calling the saveChanges method.


The object that is accessible as a parameter in the SmartComponent provides the following information:


  • {string} fileName The name of the imported file

  • {string} width The width of the image.

  • {string} height The height of the image.

Important:


The width and height properties are only defined, if the imported file is an image.
Otherwise these properties are "undefined"!

Parameters:
Name Type Description
id string

The parameter id.

Returns:

The url to the file.

Type
string

<inner> saveChanges() → {string}

Saves the changes to the document that are done by the api.
If the dialog will be closed without calling this function, no changes will be saved in the document.

Returns:

a list of modified and saved parameters in json array syntax.

Type
string

<inner> setDialogSize(width, height)

Sets the size for the dialog in the documnet editor.

Parameters:
Name Type Description
width number

The width of the dialog.

height number

The height of the dialog.

<inner> setParameterValue(id, value)

Sets a parameter value.

Parameters:
Name Type Description
id string

The parameter id.

value string

The value for the parameter.