com.dynalivery.pcre
Class PCREEngine

java.lang.Object
  |
  +--com.dynalivery.pcre.PCREEngine

public class PCREEngine
extends java.lang.Object


Field Summary
static int engineClosed
           
static int engineOpened
           
static int GV_DLL
           
static int GV_ENGINE
           
 
Constructor Summary
PCREEngine(PCREClient client)
          Construct a PCRE Engine object.
PCREEngine(PCREClient client, boolean open)
          Construct a PCRE Engine object and optionally call OpenEngine.
 
Method Summary
 boolean CanClose()
          Query the print engine to see if it is closeable.
 java.lang.Object clone()
          PCREEngine objects are not clonable, this method simply throws an exception.
 void Close()
          Close the print engine.
 PCREAPI getAPI()
          Get the PCREAPI object used by this engine.
 PCREClient getClient()
          Get the client instance for this engine.
 short GetErrorCode()
          Issue a PEGetErrorCode call.
 java.lang.String GetErrorText()
          Issue a PEGetErrorStr call.
 boolean GetHandleString(int textHandle, short textLength, java.lang.StringBuffer string)
          Issue a PEGetHandleString call.
 PCREJobTable getJobTable()
          Get the job-table used by this engine.
 int getStatus()
          Get the current engine status.
 short GetVersion(int versionRequested)
          Get the version of this report engine.
 void logOffRepository()
          Should be called to release resources after the user is finished using the repository from this PCREEngine object and all PCREJob objects associated with this PCREEngine.
 boolean LogOffServer(java.lang.String dllName, PCRELogOnInfo logOnInfo)
          Log off a database server.
 void logOnRepository(java.lang.String username, java.lang.String password)
          Used to log this PCREEngine object and any PCREJob object created with this PCREEngine onto the repository.
 boolean LogOnServer(java.lang.String dllName, PCRELogOnInfo logOnInfo)
          Log on to a database server.
 boolean Open()
          Open a new print engine.
 PCREJob OpenJob(java.lang.String reportFileName)
          Open a report using this engine
 PCREJob OpenJobFromRepository(java.lang.String repositoryPath)
          Similar to the OpenJob method call except the report template is retrieved from the repository instead of the file system of the report server.
 PCRESaffronJob OpenSaffronJob()
          Get an instance of PCRESaffronJob
 PCREJob OpenSubreport(PCREJob parentJob, java.lang.String subreportName)
          Open a subreport within a job's current report.
 void PrintReport(java.lang.String reportFile)
          Print a given report
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GV_DLL

public static final int GV_DLL

GV_ENGINE

public static final int GV_ENGINE

engineClosed

public static final int engineClosed

engineOpened

public static final int engineOpened
Constructor Detail

PCREEngine

public PCREEngine(PCREClient client)
           throws PCREClientError,
                  PCREServerError,
                  PCREAPIError
Construct a PCRE Engine object.
Parameters:
client - The PCREClient object that holds the PCRE server connection.
Throws:
PCREClientError - The PCREClient object is not conntected to the PCRE server.
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote OpenEngine call returned a value indicating failure.

PCREEngine

public PCREEngine(PCREClient client,
                  boolean open)
           throws PCREClientError,
                  PCREServerError,
                  PCREAPIError
Construct a PCRE Engine object and optionally call OpenEngine.
Parameters:
client - The PCREClient object that holds the PCRE server connection.
open - If true, call OpenEngine to open the print engine.
Throws:
PCREClientError - The PCREClient object is not connected to the PCRE server.
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote OpenEngine call returned a value indicating failure.
Method Detail

CanClose

public boolean CanClose()
                 throws PCREServerError,
                        PCREAPIError
Query the print engine to see if it is closeable.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

clone

public final java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException
PCREEngine objects are not clonable, this method simply throws an exception.
Throws:
java.lang.CloneNotSupportedException - Indicates that cloning is not supported.

Close

public void Close()
           throws PCREServerError,
                  PCREAPIError
Close the print engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

getAPI

public PCREAPI getAPI()
Get the PCREAPI object used by this engine.
Returns:
An PCREAPI object.

getClient

public PCREClient getClient()
Get the client instance for this engine.
Returns:
The PCREClient for this engine.

GetErrorCode

public short GetErrorCode()
                   throws PCREServerError,
                          PCREAPIError
Issue a PEGetErrorCode call.
Returns:
The error code, or 0 on error
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetErrorCode call returned a value indicating failure.

GetErrorText

public java.lang.String GetErrorText()
                              throws PCREServerError,
                                     PCREAPIError
Issue a PEGetErrorStr call.
Returns:
The error string, or an empty string on error ( not null )
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetErrorText call returned a value indicating failure.

GetHandleString

public boolean GetHandleString(int textHandle,
                               short textLength,
                               java.lang.StringBuffer string)
                        throws PCREServerError,
                               PCREAPIError
Issue a PEGetHandleString call.
Parameters:
textHandle - The handle of the string to retrieve.
textLength - The length of the text.
string - A buffer to store the result into.
Returns:
True on success, False on error.
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetHandleString call returned a value indicating failure.

getJobTable

public PCREJobTable getJobTable()
Get the job-table used by this engine.
Returns:
The table holding all currently open PCREAPI objects

getStatus

public int getStatus()
Get the current engine status.
Returns:
The current status code

GetVersion

public short GetVersion(int versionRequested)
                 throws PCREServerError,
                        PCREAPIError
Get the version of this report engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

LogOffServer

public boolean LogOffServer(java.lang.String dllName,
                            PCRELogOnInfo logOnInfo)
                     throws PCREServerError,
                            PCREAPIError
Log off a database server.
Parameters:
dllName - The DLL to use for the data source which you wish to log off.
logOnInfo - The login information to use for logging off the database.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

LogOnServer

public boolean LogOnServer(java.lang.String dllName,
                           PCRELogOnInfo logOnInfo)
                    throws PCREServerError,
                           PCREAPIError
Log on to a database server.
Parameters:
dllName - The DLL to use for the data source which you wish to log on to.
logOnInfo - The login information to use.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

Open

public boolean Open()
             throws PCREServerError,
                    PCREAPIError
Open a new print engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

OpenJob

public PCREJob OpenJob(java.lang.String reportFileName)
                throws PCREServerError,
                       PCREAPIError
Open a report using this engine
Parameters:
reportFileName - The path and filename of the report file to open.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

OpenSaffronJob

public PCRESaffronJob OpenSaffronJob()
                              throws PCREServerError,
                                     PCREAPIError
Get an instance of PCRESaffronJob
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

OpenSubreport

public PCREJob OpenSubreport(PCREJob parentJob,
                             java.lang.String subreportName)
                      throws PCREServerError,
                             PCREAPIError
Open a subreport within a job's current report.
Parameters:
parentJob - The job associated with the report containing the subreport.
subreportName - The name of the subreport within parentJob's report.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

PrintReport

public void PrintReport(java.lang.String reportFile)
                 throws PCREServerError,
                        PCREAPIError
Print a given report
Parameters:
reportFile - The path and filename of the report file which is to be printed.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

logOnRepository

public void logOnRepository(java.lang.String username,
                            java.lang.String password)
                     throws RepositorySecurityException,
                            RepositoryServerUnavailableException,
                            RepositoryAuthenticationException,
                            InternalRepositoryException,
                            RepositoryNotEnabledException
Used to log this PCREEngine object and any PCREJob object created with this PCREEngine onto the repository. Only one user can be logged on per PCREEngine object. If this method is called after a successful login, then the current user will be logged out and the new user will attempt to log on to the repository.
Parameters:
username - a user which exists in the security realm of the Web Application Server which is running the repository.
password - the password corresponding to the username given
Throws:
RepositorySecurityException - thrown if the user does not have permission to use the repository.
RepositoryServerUnavailableException - thrown if the repository is not available.
RepositoryAuthenticationException - thrown if the username/password is not valid.
InternalRepositoryException - thrown in an unexpected error occurs in the repository or the repository proxy such as a communication failure between the repository proxy and the repository.
RepositoryNotEnabledException - thrown if the repository has not been configured on the report server machine this engine is executing on.

logOffRepository

public void logOffRepository()
                      throws InternalRepositoryException,
                             RepositoryNotEnabledException
Should be called to release resources after the user is finished using the repository from this PCREEngine object and all PCREJob objects associated with this PCREEngine.

OpenJobFromRepository

public PCREJob OpenJobFromRepository(java.lang.String repositoryPath)
                              throws RepositorySecurityException,
                                     InvalidPathnameException,
                                     InternalRepositoryException,
                                     RepositoryNotEnabledException,
                                     PCREAPIError
Similar to the OpenJob method call except the report template is retrieved from the repository instead of the file system of the report server.
Parameters:
repositoryPath - the full path to the report template in the repository.
Throws:
RepositorySecurityException - thrown if the user does not have read permission for the desired template.
InvalidPathnameException - thrown if the reposityPath does not exist.
InternalRepositoryException - thrown in an unexpected error occurs in the repository or the repository proxy such as a communication failure between the repository proxy and the repository.
RepositoryNotEnabledException - thrown if the repository has not been configured on the report server machine this engine is executing on.
PCREAPIError - thrown if a Crystal Report error occurred while opening the job.