Actuate JavaScript API classes : Class actuate.DataService

Class actuate.DataService

Description

Retrieves data from Actuate BIRT reports as a ResultSet.

Constructor

Syntax

actuate.DataService( )

Constructs a DataService object.

Function summary

Table 4-15 lists actuate.DataService functions.

Returns the URL for the Actuate web application Service set in this DataService.

actuate.DataService.downloadResultSet

Syntax

actuate.data.ResultSet DataService.downloadResultSet(string datasource, actuate.data.Request request, function callback, function errorCallback)

Returns data from an Actuate BIRT report document that is in an Actuate web application. The actuate.data.ResultSet object that downloadResultSet( ) returns is used by the callback function.

Parameters

datasource

String. The name of the document from which to retrieve data.

request

actuate.data.Request object. Specifies the request for the report.

callback

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

errorCallback

Function. The function to call when an error occurs. The possible errors are actuate.Exception objects. The errorCallback( ) function must take an exception as an argument.

Returns

actuate.data.ResultSet object.

Example

This example retrieves a result set and applies a sorter to the result set.

myDataService.downloadResultSet("Quarterly Sales", mySalesRequest, makeAscendingSales(mySalesRequest), errorCallback(handler);

actuate.DataService.getId

Syntax

string DataService.getId( )

Returns the ID of this object.

Returns

String

Example

This example returns the current object ID.

myDataService.getId( );

actuate.DataService.getIportalUrl

Syntax

string DataService.getIportalUrl( )

Returns the URL for the Actuate web application service. Set the URL with setService( ).

Returns

String

Example

The following sample code retrieves the URL for the Actuate service:

myDataService.getIportalUrl( );

actuate.DataService.getRequestOptions

Syntax

actuate.RequestOptions DataService.getRequestOptions( )

Returns the RequestOptions currently set in this DataService. Set the RequestOptions with setService( ).

Returns

actuate.RequestOptions object.

Example

The following sample code retrieves the RequestOptions object with the options that are set for this DataService object and sets the repository type.

var reqOpts = myDataService.getRequestOptions( );
reqOpts.setRepositoryType(actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA);

actuate.DataService.setService

Syntax

void DataService.setService(string iPortalURL, actuate.RequestOptions requestOptions)

Sets the URL for the target Actuate web application service, along with any options for that URL. When the URL is not set, the DataService object uses the default service, which is set by the actuate class’ initialize( ) function.

Parameters

iPortalURL

String. The target Actuate web application URL.

requestOptions

actuate.RequestOptions object. Optional. RequestOptions defines the URL parameters to send with the authentication request, such as the iServer URL, Encyclopedia volume, or repository type. The requestOptions object can also add custom parameters to the URL. When the requestOptions parameter is null, setService( ) uses the default parameter values for the target Actuate web application URL. These default parameter values are defined in the Actuate web application’s web.xml file.

Example

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

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

(c) Copyright Actuate Corporation 2011