Document Manipulation

Source:

Methods

addPage(title, replaceifexists, setAsActive)

Adds a new page to the current TIBCO Spotfire Document
Parameters:
Name Type Description
title string The title of the newly created page.
replaceifexists boolean If true, an existing page with the name "title" will be replaced. If false, the added page will have an indexed title.
setAsActive boolean Set new page as active page? Default is true.
Source:

deleteFileFromLibrary(documenttitle)

Deletes a TIBCO Spotfire Document from TIBCO Spotfire Library.
Parameters:
Name Type Description
documenttitle string The name of the document to delete.
Source:

deletePage(pagetitle)

Delete a TIBCO Spotfire Page.
Parameters:
Name Type Description
pagetitle string The title of page to delete. If empty, the Spotfire active Page is used.
Source:
Throws:
If the page does not exist in the document.

getActivePage() → {string}

Gets the active TIBCO Spotfire Page name.
Source:
Returns:
The name of the active Spotfire Page.
Type
string

getDocumentProperty(propertyname) → {string}

Gets the value of the specified document property.
Parameters:
Name Type Description
propertyname string The name of the document property.
Source:
Returns:
The value of the document property.
Type
string
Throws:
If the property cannot be found in the document.

getDocumentPropertyNames(separator) → {string}

Gets the document property names list.
Parameters:
Name Type Description
separator string The separator to use to separate property names.
Source:
Returns:
The document property names separated by the provided separator.
Type
string

getOwnerPageTitle() → {string}

Gets the active TIBCO Spotfire page name.
Source:
Returns:
The page name.
Type
string

getPages(delimiter) → {string}

Gets the list of TIBCO Spotfire Page names.
Parameters:
Name Type Description
delimiter string Delimiter of the list of page names.
Source:
Returns:
A list of Spotfire Page Names separated by the specified delimiter.
Type
string

openDocumentFromLibrary(librarypath)

Opens a TIBCO Spotfire Document from Library.
Parameters:
Name Type Description
librarypath string Document file location in TIBCO Spotfire Library.
Source:
Throws:
If the TIBCO SPotfire Document cannot be reached.

openDocumentFromLibraryWithParameters(librarypath, parameters)

Opens a TIBCO Spotfire Document from Library with parameters.
Parameters:
Name Type Description
librarypath string Document file location in TIBCO Spotfire Library.
parameters string Configuration block text that shall be used to perform an initial configuration of the document after it has been opened. The characters "=", ";", "{", "}", "," have to be escaped by "\\" in a parameter name or in a value.
Source:
Throws:
If the TIBCO SPotfire Document cannot be reached.
Example
openDocumentFromLibraryWithParameters("/myDirectoryInLibrary/myDocument", "val_run_id=1;");

openDocumentFromLocalFile(filepath)

Opens a TIBCO Spotfire Document from a local file.
Parameters:
Name Type Description
filepath string Document file location.
Source:
Throws:
If the local file cannot be reached.
Example
openDocumentFromLocalFile("directory\\document.dxp");

renamePage(oldpagetitle, newpagetitle)

Change a TIBCO Spotfire Page Title.
Parameters:
Name Type Description
oldpagetitle string The title of page to rename. If empty, the Spotfire active Page is used.
newpagetitle string The new title of the page.
Source:
Throws:
  • If the page to rename does not exist in the document.
  • If the new title is already used in the document.

saveDocumentOnLibrary(webpanelurl, documenttitle, libraryfoldername, createfolderifmissing)

Saves the current TIBCO Spotfire document in the given TIBCO Spotfire Libray folder
Parameters:
Name Type Description
webpanelurl string The url of Discngine Web Panel to set before saving document (it will be browsed when the document is reopened)
documenttitle string The name of document which it will be saved into
libraryfoldername string The name of the TIBCO Spotfire Library folder where the document is saved. The folder must exist.
createfolderifmissing string Optional boolean parameter defaulted to false, when true the function will try to create the folder if it did not exist and the user have the rights to do so.
Source:
Throws:
If the TIBCO Spotfire Library folder cannot be reached.

saveDocumentOnLocal(webpanelurl, documentpath)

Saves the current TIBCO Spotfire document in the given path.
Parameters:
Name Type Description
webpanelurl string The url of Discngine Web Panel to set before saving document (it will be browsed when the document is reopened).
documentpath string The path which the document is saved into.
Source:

setActivePage(pageName)

Sets Page as active in the TIBCO Spotfire Document.
Parameters:
Name Type Description
pageName string Name of the page to set as active.
Source:
Throws:
If the page does not exist in the document.

setDocumentProperty(propertyname, propertyvalue)

Sets a value to the specified document property. If the document property does not exist, it is created and the provided value is setted.
Parameters:
Name Type Description
propertyname string The name of the document property. If it does not exist, it is created.
propertyvalue string The value of the document property to set.
Source:

showDetailsOnDemandPanel(show)

Shows or hides the Details-on-Demand panel.
Parameters:
Name Type Description
show boolean True to show the Details-on-Demand panel, False to hide it.
Source:

showFiltersPanel(show)

Shows or hides the Filters panel.
Parameters:
Name Type Description
show boolean True to show the Filters panel, False to hide it.
Source: