Actuate JavaScript API classes : Class actuate.Dashboard

Class actuate.Dashboard

Description

Represents a dashboard object.

Constructor

Syntax

actuate.Dashboard(string container)

Constructs a dashboard object.

Parameters

container

Optional String. Container object or name of a container in the current document ID of container where controls are to be rendered.

Function summary

Table 4-5 describes actuate.Dashboard functions

actuate.Dashboard.downloadDashboard

Syntax

void Dashboard.downloadDashboard(function callback)

Downloads the dashboard definitions.

Parameters

callback

Function. The callback function to use after the Dashboard finishes downloading. This function must take the returned Dashboard object as an input parameter.

Example

This example specifies a function to call after the Dashboard object finishes downloading.

myDashboard.downloadDashboard(runNext);
function runNext(dashobject){
  mydashboard.getDashboardName(dashobject);
}

actuate.Dashboard.embedTemplate

Syntax

void Dashboard.embedTemplate(boolean isEmbedded)

A personal dashboard can use a shared template file or embed a template file.

Parameters

isEmbedded

Boolean. When the isEmbedded parameter is true, the personal dashboard uses an embedded template file. The default value is false.

Example

This example specifies that the personal dashboard myDashboard uses an embedded template file.

myDashboard.embedTemplate(true);

actuate.Dashboard.getActiveTab

Syntax

string Dashboard.getActiveTab

This function returns the name of the current active tab for the Dashboard.

Returns

String. The name of the current active Dashboard tab.

Example

This example calls getActiveTab( ) to display the name of the active tab for the myDashboard dashboard object in an alert box.

alert(myDashboard.getActiveTab( ));

actuate.Dashboard.getDashboardName

Syntax

string Dashboard.getDashboardName( )

Returns the dashboard name used by the Dashboard object

Returns

String. The Dashboard’s name.

Example

This example calls getDashboardName( ) to display the Dashboard object’s dashboard name in an alert box.

alert(myDashboard.getDashboardName( ));

actuate.Dashboard.getTemplate

Syntax

string Dashboard.getTemplate( )

Returns the repository path for the iServer volume.

Returns

String. The repository path for the iServer volume.

Example

This example calls getTemplate( ) to display the repository path for the iServer volume in an alert box.

alert(myDashboard.getTemplate( ));

actuate.Dashboard.onUnload

Syntax

void Dashboard.onUnload( )

Unloads JavaScript variables that are no longer needed by Dashboard.

Example

This example calls unloads JavaScript variables and displays the Dashboard object’s dashboard name in an alert box.

myDashboard.onUnload;
alert("JS variables unloaded for " + myDashboard.getDashboardName( ));

actuate.Dashboard.registerEventHandler

Syntax

void Dashboard.registerEventHandler(string eventName, function handler)

Registers an event handler to activate for parameter eventName. This function can assign several handlers to a single event.

Parameters

eventName

String. Event name to capture.

handler

Function. The function to execute when the event occurs. The handler must take two arguments: the dashboard instance that fired the event and an event object specific to the event type.

Example

This example registers the errorHandler( ) function to respond to the ON_EXCEPTION event.

myDashboard.registerEventHandler(actuate.dashboard.EventConstants.ON_EXCEPTION, errorHandler);

actuate.Dashboard.removeEventHandler

Syntax

void Dashboard.removeEventHandler(string eventName, function handler)

Removes an event handler to activate for parameter eventName.

Parameters

eventName

String. Event name to remove from the internal list of registered events.

handler

Function. The function to disable.

Example

This example removes the errorHandler( ) function from responding to the ON_EXCEPTION event.

myDashboard.removeEventHandler(actuate.dashboard.EventConstants.ON_EXCEPTION, errorHandler);

actuate.Dashboard.renderContent

Syntax

void Dashboard.renderContent(object[ ] dashboardDefinitions, function callback)

Renders the dashboard definitions content to the container. The submit API calls the renderContent API internally. The renderContent( ) function assumes that the user has already a list of DashboardDefinition to process.

Parameters

dashboardDefinitions

Array of Objects. Each object is some piece of dashboard metadata and as many can be added as needed. Typically, this array contains the following metadata:

n  
n  
n  
n  
n  
n  

callback

Function. The callback function to call after renderContent( ) finishes.

Example

This example renders the myDash dashboard object using the defs dashboardDefinition array. and calls afterRender( ) once complete.

myDash.renderContent(defs, afterRender);

actuate.Dashboard.save

Syntax

void Dashboard.save(function callback)

Saves the dashboard as a .dashboard file.

Parameters

callback

Function. Optional. The function to execute after the save operation completes.

Example

This example saves the dashboard as .dashboard file.

myDash.save( );

actuate.Dashboard.setActiveTab

Syntax

void Dashboard.setActiveTab(string tabName)

Sets a specified tab as the active tab. Only one tab can be active at a time.

Parameters

tabName

String. The name of the tab to set as the active tab.

Example

This example sets the Files tab as the active tab for this dashboard.

myDash.setActiveTab("Files");

actuate.Dashboard.setContainer

Syntax

void Dashboard.setContainer(string containerID)

The container that will be used for rendering the Dashboard page HTML fragment.

Parameters

containerID

String. The container ID.

Example

This example sets the container where the myDash dashboard object renders.

myDash.setContainer("leftpane");

actuate.Dashboard.setDashboardName

Syntax

void Dashboard.setDashboardName(string dashboardName)

Sets the dashboard name to view.

Parameters

dashboardName

String. A fully qualified repository path and file name.

Example

This example sets the path for the myDash dashboard object.

myDash.setDashboardName("/Dashboard/Contents/Hello.DASHBOARD");

actuate.Dashboard.setHeight

Syntax

void Dashboard.setHeight(integer height)

Sets the dashboard’s startup height.

Parameters

height

Integer. Specifies the height in pixels.

Example

To set the dashboard height to 400 pixels, use code similar to the following:

myDashboard.setHeight(400);

actuate.Dashboard.setService

Syntax

void Dashboard.setService(string iportalURL, actuate.RequestOptions requestOptions)

Set the web service this dashboard component connects to.

Parameters

iportalURL

String. The URL of the web service to connect to.

requestOptions

actuate.RequestOptions object. Request options, if any, to apply to the connection. See actuate.RequestOptions for details on the options that this parameter can set.

Example

This example connects a dashboard component to the iPortal service and adds a custom URL parameter.

function setDashboardService( ){
  myDashboard.setService("http://localhost:8700/iportal", myRequestOptions.setCustomParameters({myParam: "myValue"});
}

actuate.Dashboard.setSize

Syntax

void Dashboard.setSize(integer height, integer width)

Sets the dashboard’s startup size.

Parameters

height

Integer. Height in pixels.

width

Integer. Width in pixels.

Example

To set the dashboard height to 400 pixels and the width to 800 pixels, use code similar to the following:

myDashboard.setSize(400, 800);

actuate.Dashboard.setTemplate

Syntax

void Dashboard.setTemplate(string path)

Sets the template path. This function overwrites the template path that is used by Information Console.

Parameters

path

String. Specifies a new template path.

Example

This example sets the template path for myDashboard to /iportal/jsapi/template/path.

myDashboard.setTemplate("/iportal/jsapi/template/path");

actuate.Dashboard.setWidth

Syntax

void Dashboard.setWidth(integer width)

Sets the dashboard’s startup width.

Parameters

width

Integer. Specifies the width in pixels.

Example

To set the dashboard width to 800 pixels, use code similar to the following:

myDashboard.setHeight(800);

actuate.Dashboard.showGallery

Syntax

void Dashboard.showGallery(boolean show)

Shows the gadget gallery.

Parameters

show

Boolean. The gadget gallery is visible when this parameter is set to true.

Example

To show the gadget gallery for the myDashboard dashboard object, use code similar to the following:

myDashboard.showGallery(true);

actuate.Dashboard.showTabNavigation

Syntax

void Dashboard.showTabNavigation(boolean show)

Shows the tab toolbar.

Parameters

show

Boolean. The tab toolbar is visible when this parameter is set to true.

Example

To show the tab toolbar for the myDashboard dashboard object, use code similar to the following:

myDashboard.showTabNavigation(true);

actuate.Dashboard.submit

Syntax

void Dashboard.submit(function callback)

Submits requests to the server for the dashboard. When this function is called, an AJAX request is triggered to submit all pending operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the dashboard container.

Parameters

callback

Function. The function to execute after the asynchronous call processing is done.

Example

This example submits the dashboard name that was set with setDashboardName( ).

dash.setDashboardName("/Dashboard/Contents/Hello.DASHBOARD");
dash.submit( );

actuate.Dashboard.usePersonalDashboard

Syntax

void Dashboard.usePersonalDashboard(boolean true|false)

Forces the dashboard framework to use the user’s personal dashboard.

Parameters

true|false

Boolean. A value of true sets the dashboard framework to ignore any value set by the setDashboardName( ) method. The dashboard framework creates a new personal dashboard file for the logged in user when no personal dashboard file is present.

Example

To force the use of a personal dashboard for the myDashboard object, use code similar to the following:

myDashboard.usePersonalDashboard(true);

(c) Copyright Actuate Corporation 2011