Actuate JavaScript API classes : Class actuate.ReportExplorer

Class actuate.ReportExplorer

Description

The actuate.ReportExplorer class retrieves and displays a navigable repository or file system interface that enables users to navigate folders and select files. This is a generic UI that enables the user to browse and select repository contents.

Constructor

Syntax

actuate.ReportExplorer(string container)

Constructs a ReportExplorer object for a page, initializing the reportexplorer component.

Parameters

container

String. The name of the HTML element that displays the rendered reportexplorer component or a container object. The constructor initializes the reportexplorer component but does not render it.

Function summary

Table 4-32 lists actuate.ReportExplorer functions.

actuate.ReportExplorer.getFolderName

Syntax

string ReportExplorer.getFolderName( )

Returns the name of the root folder for this reportexplorer.

Returns

String. The folder name.

Example

This example displays the root folder’s name in an alert box.

function alertRootFolder(myReportExplorer){
  alert(myReportExplorer.getFolderName( ));
}

actuate.ReportExplorer.getLatestVersionOnly

Syntax

boolean ReportExplorer.getLatestVersionOnly( )

Returns the latest version only flag for this reportexplorer.

Returns

Boolean. True indicates

Example

This example displays the latest version only flag in an alert box.

function alertLatestVersionFlag(myReportExplorer){
  alert(myReportExplorer.getLatestVersionOnly( ));
}

actuate.ReportExplorer.getResultDef

Syntax

string[ ] ReportExplorer.getResultDef( )

Returns the results definition.

Returns

Array of Strings. Valid values are: "Name", "FileType", "Version", "VersionName", "Description", "Timestamp", "Size", and "PageCount"

Example

This example displays the results definition an alert box.

function alertResultsDefinition(myReportExplorer){
  alert(myReportExplorer.getResultDef( ));
}

actuate.ReportExplorer.getSearch

Syntax

actuate.ReportExplorer.FileSearch ReportExplorer.getSearch( )

Returns the FileSearch object assigned to this report explorer.

Returns

actuate.reportexplorer.FileSearch object.

Example

This example sets the FileSearch setting for reportexplorer1 to the FileSearch settings of reportexplorer2.

reportexplorer1.setSearch(reportexplorer2.getSearch( ));

actuate.ReportExplorer.onUnload

Syntax

void ReportExplorer.onUnload( )

Unloads javascript variables that are no longer needed by reportexplorer

Example

This example cleans up unused JavaScript variables for myReportExplorer.

myReportExplorer.onUnload( );

actuate.ReportExplorer.registerEventHandler

Syntax

void ReportExplorer.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 ReportExplorer 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.

myReportExplorer.registerEventHandler(actuate.ReportExplorer.EventConstants.ON_EXCEPTION, errorHandler);

actuate.ReportExplorer.removeEventHandler

Syntax

void ReportExplorer.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.

myReportExplorer.removeEventHandler(actuate.ReportExplorer.EventConstants.ON_EXCEPTION, errorHandler);

actuate.ReportExplorer.setContainer

Syntax

void ReportExplorer.setContainer(string containerId)

Sets the HTML element container for the reportexplorer content.

Parameters

containerID

String. The name of the HTML element that displays the group of rendered reportexplorer components.

Example

This example sets MyReportExplorer to render the <div> element labeled "History".

myReportExplorer.setContainer("History");

actuate.ReportExplorer.setFolderName

Syntax

void ReportExplorer.setFolderName(string folderName)

Sets the name of the root folder for this reportexplorer.

Parameters

folderName

String. The name of the repository folder to use as the root folder. Use a repository path to use subfolders for the root folder.

Example

This example sets the report explorer root folder to /Public.

myReportExplorer.setFolderName("/Public");

actuate.ReportExplorer.setLatestVersionOnly

Syntax

void ReportExplorer.setLatestVersionOnly(boolean latestVersionOnly)

Sets the latest version only flag for this reportexplorer.

Parameters

latestVersionOnly

Boolean. True removes all but the latest versions from the report explorer.

Example

This example sets report explorer to display only the latest versions of all files.

myReportExplorer.setLatestVersionOnly( true )

actuate.ReportExplorer.setResultDef

Syntax

void ReportExplorer.setResultDef(string[ ] resultDef)

Sets the results definition.

Parameters

resultDef

Array of Strings. Valid values are: "Name", "FileType", "Version", "VersionName", "Description", "Timestamp", "Size", and "PageCount"

Example

This example sets the result set to 5 columns of data including name, file type, version, version name, and description.

var resultDef = "Name|FileType|Version|VersionName|Description";
myReportExplorer.setResultDef( resultDef.split("|") );

actuate.ReportExplorer.setSearch

Syntax

void ReportExplorer.setSearch(actuate.ReportExplorer.FileSearch search)

Sets a FileSearch object assigned to this report explorer.

Parameters

search

actuate.reportexplorer.FileSearch object.

Example

This example sets the FileSearch setting for reportexplorer1 to the FileSearch settings of reportexplorer2.

reportexplorer1.setSearch(reportexplorer2.getSearch( ));

actuate.ReportExplorer.setService

Syntax

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

Sets the target service URL to which this explorer links. When the service URL is not set, this viewer links to the default service URL which is set on the actuate object.

Parameters

iPortalURL

String. The target Actuate web application URL, either a Java Component or Information Console.

requestOptions

actuate.RequestOptions object. Optional. RequestOptions defines URL parameters to send with the authentication request, such as the iServer URL, Encyclopedia volume, or repository type. The URL can also include custom parameters.

Example

This example sets the URL for the Actuate iPortal web application service.

myExplorer.setService("http://localhost:8700/iportal", myRequestOptions);

actuate.ReportExplorer.setStartingFolder

Syntax

void ReportExplorer.setStartingFolder(string strfoldername)

Sets the fully qualified path of the initially selected folder in the explorer tree.

Parameters

strfoldername

String. The fully qualified path of a folder.

Example

This example sets the initially selected folder to Public in the local repository.

myExplorer.setStartingFolder("C:\Program Files\Actuate11\iServer\servletcontainer\iportal\WEB-INF\repository\Public");

actuate.ReportExplorer.setUseDescriptionAsLabel

Syntax

void ReportExplorer.setUseDescriptionAsLabel(boolean useDescription)

Sets the explorer to display the folder description as the folder label instead of the folder name.

Parameters

useDescription

Boolean. True displays descriptions for folders instead of folder names.

Example

This example displays descriptions for folders instead of folder names.

myExplorer.setUseDescriptionAsLabel(true);

actuate.ReportExplorer.showFoldersOnly

Syntax

void ReportExplorer.showFoldersOnly(boolean flag)

Sets the Report Explorer to display folders but not files.

Parameters

flag

Boolean. True displays folders but not files.

Example

This example displays folders in the report explorer but not files.

myExplorer.showFoldersOnly(true);

actuate.ReportExplorer.submit

Syntax

void ReportExplorer.submit(function callback)

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

Parameters

callback

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

Example

This example submits the reportexplorer with a root folder that set with setStartingFolder( ) and result definition set with setResultDef( ).

myExplorer.setStartingFolder("/Dashboard/Contents");
var resultDef = "Name|FileType|Version|VersionName|Description";
myExplorer.setResultDef( resultDef.split("|") );
myExplorer.submit( );

(c) Copyright Actuate Corporation 2011