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 generic user interface enables the user to browse and select repository contents.
Constructor
Syntax
actuate.ReportExplorer(string container)
Constructs a ReportExplorer object, initializing the ReportExplorer component.
Parameter
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 44‑38 lists actuate.ReportExplorer functions.
Table 44‑38 actuate.ReportExplorer functions
Function
Description
Gets the root folder name
Gets the latestVersionOnly flag
Gets the resultDef value for this GetFolderItems
Gets the search value for this GetFolderItems
Unloads unused JavaScript variables
Registers the event handler
Removes the event handler
Sets the div container
Sets the root folder name
Sets the latestVersionOnly flag
Sets the resultDef value for this GetFolderItems
Sets the search value for this GetFolderItems
Sets the JSAPI web service
Sets the path for the initial folder selection
Sets flag to use descriptions as file/folder labels
Sets the flag to only display folders
submit( )
Applies changes made to this element
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( ));
}
getLatestVersionOnly
Syntax
boolean ReportExplorer.getLatestVersionOnly( )
Returns the latest version only flag for this ReportExplorer.
Returns
Boolean. True indicates that ReportExplorer displays only the latest version of each report.
Example
This example displays the latest version only flag in an alert box:
function alertLatestVersionFlag(myReportExplorer){
alert(myReportExplorer.getLatestVersionOnly( ));
}
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( ));
}
getSearch
Syntax
actuate.ReportExplorer.FileSearch ReportExplorer.getSearch( )
Returns the FileSearch object assigned to this ReportExplorer.
Returns
actuate.reportexplorer.FileSearch object. The file search settings.
Example
This example sets the FileSearch setting for reportexplorer1 to the FileSearch settings of reportexplorer2:
reportexplorer1.setSearch(reportexplorer2.getSearch( ));
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( );
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);
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);
setContainer
Syntax
void ReportExplorer.setContainer(string containerId)
Sets the HTML element container for the ReportExplorer content.
Parameter
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");
setFolderName
Syntax
void ReportExplorer.setFolderName(string folderName)
Sets the name of the root folder for this ReportExplorer.
Parameter
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. The string '~/' maps to the current user’s home folder.
Example
This example sets the report explorer root folder to /Public:
myReportExplorer.setFolderName("/Public");
setLatestVersionOnly
Syntax
void ReportExplorer.setLatestVersionOnly(boolean latestVersionOnly)
Sets the latest version only flag for this ReportExplorer.
Parameter
latestVersionOnly
Boolean. True removes all but the latest versions from the report explorer.
Example
This example sets ReportExplorer to display only the latest versions of all files:
myReportExplorer.setLatestVersionOnly( true );
setResultDef
Syntax
void ReportExplorer.setResultDef(string[ ] resultDef)
Sets the results definition.
Parameter
resultDef
Array of strings. Valid values are: "Name", "FileType", "Version", "VersionName", "Description", "Timestamp", "Size", and "PageCount". iHub requires the Name, FileType, and Version fields in the results definition array to identify all files.
Example
This example sets the result set to five columns of data including name, file type, version, version name, and description:
var resultDef = "Name|FileType|Version|VersionName|Description";
myReportExplorer.setResultDef( resultDef.split("|") );
setSearch
Syntax
void ReportExplorer.setSearch(actuate.ReportExplorer.FileSearch search)
Assigns a FileSearch object to this ReportExplorer.
Parameter
search
actuate.reportexplorer.FileSearch object. The file search settings.
Example
This example sets the FileSearch setting for reportexplorer1 to the FileSearch settings of reportexplorer2:
reportexplorer1.setSearch(reportexplorer2.getSearch( ));
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 iPortal.
requestOptions
actuate.RequestOptions object. Optional. requestOptions defines URL parameters to send with the authentication request, such as the iHub URL, 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://127.0.0.1:8700
/iportal", myRequestOptions);
setStartingFolder
Syntax
void ReportExplorer.setStartingFolder(string strfoldername)
Sets the fully qualified path of the initially selected folder in the explorer tree.
Parameter
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\iHub2
\servletcontainer\iportal\WEB-INF\repository\Public");
setUseDescriptionAsLabel
Syntax
void ReportExplorer.setUseDescriptionAsLabel(boolean useDescription)
Sets the explorer to display the folder description as the folder label instead of the folder name.
Parameter
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);
showFoldersOnly
Syntax
void ReportExplorer.showFoldersOnly(boolean flag)
Sets ReportExplorer to display folders but not files.
Parameter
flag
Boolean. True displays folders but not files.
Example
This example displays folders in ReportExplorer but not files:
myExplorer.showFoldersOnly(true);
submit
Syntax
void ReportExplorer.submit(function callback)
Submits requests to the server for 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.
Parameter
callback
Function. The function to execute after the asynchronous call processing is done.
Example
This example submits 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( );