public interface

DocumentBean

implements ResultSetBean
com.microstrategy.web.beans.DocumentBean

Class Overview

This interface is used to manage the collection of document data and enable it to be rendered. It leverages many of the features of the WebBean and ObjectBean interfaces. It reuses the ObjectBean interface to allow a document to: (a) be retrieved by name (and with wildcard) (b) retrieve its parent folder bean.

The main methods it provides in this interface are:

  • Document execution settings: Users can set the message ID, state ID and synchronous nature of the request. Users can also have the document directly saved in the Inbox and control whether server-side caches are used and updated or not used at all.
  • In-memory HTML caching: If the application builder wants to hold a Document Bean in the user's session or the application context, it may do so as a way of caching the results. If done in this manner, the document data need not be transformed with every request to transform, but only when the document is retrieved from the Intelligence Server. In this way, the Document Bean may be instructed on when to release its XML and re-execute the document. This is done using a simple expiration time period, in hours.
  • Access the underlying reports of the document

Summary

Constants
int GRAPH_REPORTS Identifies those underlying reports whose view mode is set to Graph
int GRID_REPORTS Identifies those underlying reports whose view mode is set to Grid
[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
Public Methods
abstract boolean cancelRequest()
Cancels the current request.
abstract void collectData(boolean populateReportInstances)
Triggers execution to the back end no matter whether it is synchronous or asynchronous.
abstract int getCount()
Returns the number of reports in the document
abstract int getCount(int typeOfReports)
Returns the number of reports in the document of the type passed.
abstract WebDocumentInstance getDocumentInstance()
Returns the Document Instance set.
abstract int getExecutionFlags()
Returns the execution flag as of EnumDSSXMLExecutionFlags when running the WebDocument contained in this bean.
abstract ReportBean getReport(int index, int typeOfReports)
Returns the ReportBean at the given index among the list of reports of the type passed.
abstract ReportBean getReport(int index)
Returns the ReportBean at a given index.
abstract Iterator getReports()
Returns an Iterator that contains the ReportBean objects within the document.
abstract Iterator getReports(int typeOfReports)
Returns an Iterator that contains the ReportBean objects within the document of the type passed.
abstract String getResult()
Returns the result of a document execution.
abstract int getViewMode()
Returns the view mode.
abstract void setExecutionFlags(int executionFlags)
Sets the execution flags as of EnumDSSXMLExecutionFlags to this bean.
abstract void setViewMode(int viewMode)
Sets the view mode (Possible values : EnumWebDocumentViewMode)
[Expand]
Inherited Methods
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.beans.ObjectBean
From interface com.microstrategy.web.beans.RequestPersistable
From interface com.microstrategy.web.beans.ResultSetBean
From interface com.microstrategy.web.beans.Transformable
From interface com.microstrategy.web.beans.WebBean
From interface com.microstrategy.web.beans.WebComponent

Constants

public static final int GRAPH_REPORTS

Identifies those underlying reports whose view mode is set to Graph

Constant Value: 2 (0x00000002)

public static final int GRID_REPORTS

Identifies those underlying reports whose view mode is set to Grid

Constant Value: 1 (0x00000001)

Public Methods

public abstract boolean cancelRequest ()

Cancels the current request.

Returns
  • true if successfully cancelled.

public abstract void collectData (boolean populateReportInstances)

Triggers execution to the back end no matter whether it is synchronous or asynchronous. If this method fails to collect data, an exception is raised and saved in a WebBeanError instance.

Parameters
populateReportInstances If set to true, the document execution retrieves the report instances for the document too.
Throws
WebBeanException thrown if there is any backend error

public abstract int getCount ()

Returns the number of reports in the document

Returns
  • The number of reports in the document
Throws
WebBeanException thrown if the count can be obtained

public abstract int getCount (int typeOfReports)

Returns the number of reports in the document of the type passed. The types that can be passed are GRAPH_REPORTS, GRID_REPORTS & their combination.

Parameters
typeOfReports The type of report to be considered within the reports in the document.
Returns
  • The number of reports in the document (of type passed)
Throws
IllegalArgumentException if the typeOfReports passed is invalid.
WebBeanException thrown if the count is unable to get

public abstract WebDocumentInstance getDocumentInstance ()

Returns the Document Instance set.

Returns
Throws
WebBeanException thrown if there is any backend error

public abstract int getExecutionFlags ()

Returns the execution flag as of EnumDSSXMLExecutionFlags when running the WebDocument contained in this bean.

Returns
  • the WebDocument execution flag.

public abstract ReportBean getReport (int index, int typeOfReports)

Returns the ReportBean at the given index among the list of reports of the type passed. Possible report types that can be passed are GRAPH_REPORTS, GRID_REPORTS and their combination.

Parameters
index the index of the Report in the Document. The index begins from 0.
typeOfReports The list of Reports to be scanned
Returns
  • the ReportBean at specified position.
Throws
IllegalArgumentException if the typeOfReports passed is invalid.
IndexOutOfBoundsException if the no report exists at index passed i.e. the index is out of range.
WebBeanException thrown if there is backend error when retrieving the contained report.

public abstract ReportBean getReport (int index)

Returns the ReportBean at a given index. The index begins from 0.

Parameters
index The index of the report to be retrieved from the Document.
Returns
  • the ReportBean at the specified position.
Throws
IndexOutOfBoundsException if the no report exists at index passed i.e. the index is out of range.
WebBeanException thrown if there is any backend error when retrieving the contained report.

public abstract Iterator getReports ()

Returns an Iterator that contains the ReportBean objects within the document.

Returns
  • An Iterator over the Reports in the Document
Throws
WebBeanException thrown if there is backend error when retrieving reports.

public abstract Iterator getReports (int typeOfReports)

Returns an Iterator that contains the ReportBean objects within the document of the type passed. Possible report types that can be passed are GRAPH_REPORTS, GRID_REPORTS and their combination.

Parameters
typeOfReports The type of reports to be considered while scanning the document and building the iterator.
Returns
  • An Iterator over the Reports in the Document of type passed.
Throws
IllegalArgumentException if the typeOfReports passed is invalid.
WebBeanException thrown if there is backend error when retrieving reports of the specified type.

public abstract String getResult ()

Returns the result of a document execution.

Returns
  • The result of a document execution. The result might be HTML or XML based on the execution flag set.
Throws
WebBeanException thrown if there is backend error when retriving the document result.

public abstract int getViewMode ()

Returns the view mode. Possible values are listed in EnumWebDocumentViewMode.

Returns
  • the view mode.

public abstract void setExecutionFlags (int executionFlags)

Sets the execution flags as of EnumDSSXMLExecutionFlags to this bean.

Parameters
executionFlags the WebDocument execution flag.

public abstract void setViewMode (int viewMode)

Sets the view mode (Possible values : EnumWebDocumentViewMode)

Parameters
viewMode a new view mode.