com.businessobjects.rebean.wi
Class ReportEngines

java.lang.Object
  extended by com.businessobjects.rebean.wi.ReportEngines
All Implemented Interfaces:
java.io.Serializable

public class ReportEngines
extends java.lang.Object
implements java.io.Serializable

The ReportEngines interface is used to get the ReportEngine instance corresponding to the type of document the user wants to open. Using the ReportEngines class, you can open both Web Intelligence and Desktop Intelligence documents. Desktop Intelligence and Web Intelligence documents do not support the same OutputFormatType and ViewModeType combinations. Use the SupportedViews interface to see the ways in which it is possible to present a specific DocumentInstance or DataProvider.

Example: Create a ReportEngine instance to work on Web Intelligence documents.

 ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
 IEnterpriseSession entSession = sessionMgr.logon(userID, password, CMS, auth);
 if (entSession != null) {
     ILogonTokenMgr loginTokenManager = entSession.getLogonTokenMgr();
     String token = loginTokenManager.getDefaultToken();
     ReportEngines repEngines = (ReportEngines)enterpriseSession.getService("ReportEngines");
     ReportEngine wiRepEngine = repEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
     // ...
 }
 

Since:
11.5
See Also:
ReportEngine, SupportedViews, OutputFormatType, ViewModeType, Serialized Form

Nested Class Summary
static class ReportEngines.ReportEngineType
          A specific report engine type.
 
Constructor Summary
ReportEngines(java.lang.String logonToken)
          Deprecated. Use other constructor
ReportEngines(java.lang.String svr, ISecuritySession session)
           
 
Method Summary
 void close()
           Closes any report engines obtained through this class.
 DocumentInstance getDocumentFromStorageToken(java.lang.String token)
          Returns a DocumentInstance using a storage token.
 ReportEngine getService(ReportEngines.ReportEngineType type)
          Return a ReportEngine instance for either Desktop Intelligence or Web Intelligence documents.
 ReportEngine getServiceFromStorageToken(java.lang.String token)
          Returns the ReportEngine instance used to edit the DocumentInstance for which token is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportEngines

@Deprecated
public ReportEngines(java.lang.String logonToken)
Deprecated. Use other constructor

Initialize the ReportEngines instance using the BusinessObjects Enterprise session token.

Parameters:
logonToken - The session token.
See Also:
com.crystaldecisions.sdk.occa.security.ILogonTokenMgr

ReportEngines

public ReportEngines(java.lang.String svr,
                     ISecuritySession session)
Parameters:
svr -
session -
Method Detail

getService

public ReportEngine getService(ReportEngines.ReportEngineType type)
Return a ReportEngine instance for either Desktop Intelligence or Web Intelligence documents.

Parameters:
type - The type of ReportEngine required. For Desktop Intelligence documents use ReportEngines.ReportEngineType.FC_REPORT_ENGINE. For Web Intelligence document use ReportEngines.ReportEngineType.WI_REPORT_ENGINE.
Returns:
A ReportEngine instance.
Throws:
java.lang.NullPointerException - Thrown when type == null.
CommunicationException - Thrown when the ReportEngine instance could not be obtained. The cause exception (Throwable.getCause()) will contain more detailed information on what went wrong.

getDocumentFromStorageToken

public DocumentInstance getDocumentFromStorageToken(java.lang.String token)
Returns a DocumentInstance using a storage token.

Note: storage tokens are linked to a single ReportEngine instance.

Parameters:
token - A valid storage token.
Returns:
Returns the DocumentInstance requested using token.
Throws:
java.lang.IllegalArgumentException - Thrown when token is not recognized. The token should be obtained from a call to DocumentInstance.getStorageToken().
java.lang.IllegalStateException - Thrown when this ReportEngines does not contain a report engine of the correct type for token.
See Also:
DocumentInstance.getStorageToken(), ReportEngine.isStorageTokenValid(String)

getServiceFromStorageToken

public ReportEngine getServiceFromStorageToken(java.lang.String token)
Returns the ReportEngine instance used to edit the DocumentInstance for which token is valid.

Parameters:
token - A valid storage token.
Returns:
Returns the ReportEngine instance used to edit the DocumentInstance for which token is valid.
Throws:
java.lang.IllegalArgumentException - Thrown when token is not recognized. The token should be obtained from a call to DocumentInstance.getStorageToken().
See Also:
DocumentInstance.getStorageToken(), ReportEngine.isStorageTokenValid(String)

close

public void close()

Closes any report engines obtained through this class. This should typically be done when closing a user's session.

After calling this method, any calls to ReportEngines.getDocumentFromStorageToken(String) will result in an IllegalStateException, and ReportEngines.getServiceFromStorageToken(String) will return null.