Class actuate.RequestOptions
Description
The request options that loginServlet requires to authenticate requests. RequestOptions is used by other classes to provide authentication information. It also adds any customized options to the request URL.
Constructor
Syntax
actuate.RequestOptions( actuate.RequestOptions requestOptions)
Constructs a new RequestOptions object.
Parameter
requestOptions
actuate.RequestOptions object. Optional. Provides request option settings to copy into this RequestOptions object.
Function summary
Table 7‑51 lists actuate.RequestOptions functions.
Table 7‑51 actuate.RequestOptions functions 
Function
Description
Returns the BIRT iHub URL value
Returns the current locale
Returns the repository type
Returns the current REST API authentication token
Returns the volume
Returns the volume profile
Appends custom parameters to the request URL
Sets the BIRT iHub URL value
Sets the locale
Sets the repository type: enterprise or workgroup
Sets the authentication token to use when running JSAPI commands from a REST API application
Sets the volume
Sets the volume profile
getIServerUrl
Syntax
string RequestOptions.getIserverurl( )
Returns the BIRT iHub URL.
Returns
String. The URL for BIRT iHub.
Example
To retrieve the BIRT iHub URL from the RequestOptions object reqOps, use code similar to the following:
var iHubUrl = reqOps.getIServerUrl( );
getLocale
Syntax
string RequestOptions.getLocale( )
Returns the current locale or null if no locale is set.
Returns
String. The locale value; null for default.
Example
This example pops up an alert box if the locale value is set to the default:
var locale = reqOps.getLocale( );
if (locale == null){
alert("Locale value is default");
}
getRepositoryType
Syntax
string RequestOptions.getRepositoryType( )
Returns the repository type: enterprise or workgroup.
Returns
String. Valid repository type values are enterprise or workgroup.
Example
To retrieve the repository type for the RequestOptions object reqOps, use code similar to the following:
var repositorytype = reqOps.getRepositoryType( );
getRESTAuthToken
Syntax
string RequestOptions.getRESTAuthToken( )
Returns the current REST API authentication token. setRESTAuthToken( ) sets the token to the value retrieved from the REST API login resource.
Returns
String. The value set by setRESTAuthToken( ) or null if not set.
Example
To retrieve the REST API authentication token for the RequestOptions object reqOps, use code similar to the following:
var restAuthToken = reqOps.getRESTAuthToken( );
if (restAuthToken == null){
alert("REST API authentication token is not available");
}
getVolume
Syntax
string RequestOptions.getVolume( )
Returns the volume.
Returns
String. The name of the volume.
Example
To retrieve the volume for the RequestOptions object reqOps, use code similar to the following:
var encyVol = reqOps.getVolume( );
getVolumeProfile
Syntax
string RequestOptions.getVolumeProfile( )
Returns the volume profile by name. Valid volume profile names are listed in the service’s WEB-INF\volumeProfile.xml file.
Returns
String. The volume profile.
Example
To retrieve the volume profile for the RequestOptions object reqOps, use code similar to the following:
var volProfile = reqOps.getVolumeProfile( );
setCustomParameters
Syntax
void RequestOptions.setCustomParameters(object parameters)
Returns a custom parameter in the request URL.
Parameter
parameters
Object. An associative array of name:value pairs for URL parameters.
Example
To add "&myParam=myValue" in a request URL derived from RequestOptions object, use code similar to the following:
MyRequestOptions.setCustomParameters({myParam: "myValue"});
setIServerUrl
Syntax
void RequestOptions.setIServerUrl(string iServerUrl)
Sets the BIRT iHub URL.
Parameter
Iserverurl
String. The BIRT iHub URL value.
Example
This example sets the BIRT iHub URL for the reqOps RequestOptions object:
reqOps.setIserverUrl("http://127.0.0.1:8700");
setLocale
Syntax
void RequestOptions.setLocale(string Locale)
Sets the locale.
Parameter
Locale
String. Optional. The locale value. Null indicates the default locale.
Example
This example resets the locale for the reqOps RequestOptions object to the default value provided by the actuate web service to which the JSAPI connects:
reqOps.setLocale( );
This example resets the locale for the reqOps RequestOptions object to Spain using the Spanish locale code listed in <context root>\WEB-INF\localemap.xml:
reqOps.setLocale("es_ES");
setRepositoryType
Syntax
void RequestOptions.setRepositoryType(string repositoryType)
Sets the repository type, either enterprise or workgroup.
Parameter
repositoryType
String. Valid repository type values are enterprise or standalone, as designated by the Actuate web application service with which to connect. Use the following constants:
*actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA
*actuate.RequestOptions.REPOSITORY_STANDALONE
Example
This example sets the repository to workgroup:
reqOps.setRepositoryType(
actuate.RequestOptions.REPOSITORY_STANDALONE);
setRESTAuthToken
Syntax
void RequestOptions.setRESTAuthToken(string restAuthToken)
Sets the authentication token to use when running JSAPI commands from a REST API application.
Parameter
restAuthToken
String. The value provided by the REST API login resource.
Example
This example sets the REST API authentication token, using the value, authId, provided by the REST API login resource and initializes the JSAPI:
function acLoad( ) {
actuate.load( "viewer" );
var iportalUrl = 'http://mymachine:8700/iportal';
var reqOps = new actuate.RequestOptions( );
reqOps.setRepositoryType( actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA );
reqOps.setIServerUrl( "http://mymachine:8000" );
reqOps.setVolumeProfile( "Default Volume" );
reqOps.setRESTAuthToken( authId );
actuate.initialize( iportalUrl, reqOps, null, null, JSAPILoaded, JSAPINotLoaded );
}
setVolume
Syntax
void RequestOptions.setVolume(string volume)
Sets the volume.
Parameter
volume
String. The volume.
Example
To set the volume to marcom if the RequestOptions object reqOps volume is null, use code similar to the following:
if( reqOps.getVolume( ) == null){
reqOps.setVolume("marcom");
}
setVolumeProfile
Syntax
void RequestOptions.setVolumeProfile(string volumeProfile)
Sets the volume profile to use. Valid volume profile names are listed in the service’s WEB-INF\volumeProfile.xml file.
Parameter
volumeProfile
String. The volume profile.
Example
To set the volume profile to myServer if the RequestOptions object reqOps volume profile is null, use code similar to the following:
if( reqOps.getVolume( ) == null){
reqOps.setVolumeProvile("myServer");
}