com.crystaldecisions.sdk.plugin.desktop.program
Interface IScriptProgram


public interface IScriptProgram

This interface provides functionality which allows you to use a script program within the BusinessObjects Enterprise framework. This program can be used for any number of different tasks, such as deleting all instances owned by a particular user.

Script programs can be published to BusinessObjects Enterprise and scheduled to run at specific intervals. Once a script has been published and scheduled to BusinessObjects Enterprise, at the scheduled interval, the Program Job Server logs into the Central Management Server (CMS) using a logon token, and retrieves an InfoStore and EnterpriseSession instance. This information is stored in global properties, InfoStore and Session, respectively. Both of these properties are automatically present within a running Script program. This process ensures that a Script program can conveniently execute against a BusinessObjects Enterprise system.

The following global properties belong to each IScriptProgram object:

The following example uses the aforementioned global properties and object to retrieve the CMS name and all of the arguments that were set for the program:

 Script.Writeln (“Output from a script program.\n”);
 Script.Writeln(“Should be logged on with the logon token.\n”);
 Script.Writeln(“The CMS is ” + Session.CMSName);
 var args = Script.Args.toArray();
 Script.Writeln(“Returned “ + args.length + “args:“);
 var i;
 for(i=0; i<args.length; i++){
	    Script.Writeln(“args “ + i + “=” + args[i]);
 }
 Script.Writeln(“Finished”);
 

Note: Script programs are required to use impersonation as a form of additional security. Impersonation is a form of delegation which authorizes another principle to use its identity with restricted privileges. For more information see the IProgramGlobal interface.


Method Summary
 java.lang.String getArgs()
           Returns the program arguments for this script program object.
 java.lang.String getFileName()
           Returns the name of file to be processed.
 java.lang.String getUserName()
           Returns the user name for the system that this object will run on.
 java.lang.String getWorkingDir()
           Returns the working directory of this script program object.
 boolean isPasswordNotEmpty()
           Returns a boolean that indicates whether the password is set and not empty.
 boolean isPasswordSet()
           Returns a boolean that indicates whether the password is set.
 void setArgs(java.lang.String newArgs)
           Sets the program arguments for this script program object.
 void setFile(java.lang.String filePath)
           Sets the file to be processed.
 void setPassword(java.lang.String password)
           Sets the users's password for the system that this object will run on.
 void setUserName(java.lang.String userName)
           Sets the user name for the system that this object will run on.
 void setWorkingDir(java.lang.String workingDir)
           Sets the working directory of this script program object.
 

Method Detail

setFile

public void setFile(java.lang.String filePath)
             throws SDKException

Sets the file to be processed.

Parameters:
filePath - A String specifying the location of the file to be processed.
SDKException

getFileName

public java.lang.String getFileName()
                             throws SDKException

Returns the name of file to be processed.

Returns:
A String containing the name of the file to be processed.
Throws:
SDKException - This is thrown if the process is unsuccessful.

setArgs

public void setArgs(java.lang.String newArgs)

Sets the program arguments for this script program object.

Parameters:
newArgs - A String specifying the program arguments.

getArgs

public java.lang.String getArgs()

Returns the program arguments for this script program object.

Returns:
A String containing the program arguments.

getWorkingDir

public java.lang.String getWorkingDir()

Returns the working directory of this script program object.

Returns:
A String containing the working directory.

setWorkingDir

public void setWorkingDir(java.lang.String workingDir)

Sets the working directory of this script program object.

Parameters:
workingDir - A String specifying the working directory.

getUserName

public java.lang.String getUserName()

Returns the user name for the system that this object will run on.

Returns:
A String containing the username.

setUserName

public void setUserName(java.lang.String userName)

Sets the user name for the system that this object will run on.

Parameters:
userName - A String specifying the user name.

setPassword

public void setPassword(java.lang.String password)

Sets the users's password for the system that this object will run on.

Parameters:
password - A String specifying the user's password.

isPasswordSet

public boolean isPasswordSet()
                      throws SDKException

Returns a boolean that indicates whether the password is set.

Note: the password can be set and contain an empty field.

Returns:
true if the password is set, and false otherwise.
Throws:
SDKException - This is thrown if the process is unsuccessful.

isPasswordNotEmpty

public boolean isPasswordNotEmpty()
                           throws SDKException

Returns a boolean that indicates whether the password is set and not empty.

Returns:
true if the password is set and not empty, and false otherwise.
Throws:
SDKException - This is thrown if the process is unsuccessful.