Package com.microstrategy.web.beans
Interface DocumentBean
-
- All Superinterfaces:
EnumWebPersistableState
,ObjectBean
,Persistable
,RequestPersistable
,ResultSetBean
,Transformable
,WebBean
,WebComponent
public interface DocumentBean extends ResultSetBean
This interface is used to manage the collection of document data and enable it to be rendered. It leverages many of the features of theWebBean
andObjectBean
interfaces. It reuses theObjectBean
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
- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description static int
GRAPH_REPORTS
Identifies those underlying reports whose view mode is set to Graphstatic int
GRID_REPORTS
Identifies those underlying reports whose view mode is set to Grid-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancelRequest()
Cancels the current request.void
collectData(boolean populateReportInstances)
Triggers execution to the back end no matter whether it is synchronous or asynchronous.int
getCount()
Returns the number of reports in the documentint
getCount(int typeOfReports)
Returns the number of reports in the document of the type passed.WebDocumentInstance
getDocumentInstance()
Returns the Document Instance set.int
getExecutionFlags()
Returns the execution flag as ofEnumDSSXMLExecutionFlags
when running theWebDocument
contained in this bean.ReportBean
getReport(int index)
Returns theReportBean
at a given index.ReportBean
getReport(int index, int typeOfReports)
Returns theReportBean
at the given index among the list of reports of the type passed.java.util.Iterator
getReports()
Returns an Iterator that contains theReportBean
objects within the document.java.util.Iterator
getReports(int typeOfReports)
Returns an Iterator that contains theReportBean
objects within the document of the type passed.java.lang.String
getResult()
Returns the result of a document execution.int
getViewMode()
Returns the view mode.void
setExecutionFlags(int executionFlags)
Sets the execution flags as ofEnumDSSXMLExecutionFlags
to this bean.void
setViewMode(int viewMode)
Sets the view mode (Possible values :EnumWebDocumentViewMode
)-
Methods inherited from interface com.microstrategy.web.beans.ObjectBean
getBlockBegin, getBlockCount, getDisplayName, getFlags, getLevel, getObjectID, getObjectInfo, getObjectName, getObjectType, getParentFolderBean, getParentFolderBean, getParentID, setBlockBegin, setBlockCount, setFlags, setLevel, setObjectID, setObjectInfo, setObjectName, setObjectType
-
Methods inherited from interface com.microstrategy.utils.serialization.Persistable
restoreState, restoreState, saveState, saveState, saveState, saveState
-
Methods inherited from interface com.microstrategy.web.beans.RequestPersistable
restoreStateFromRequest, restoreStateFromRequest
-
Methods inherited from interface com.microstrategy.web.beans.ResultSetBean
getExpiration, getLastPromptMessageID, getMaxWait, getMessageID, getPollingFrequency, getPromptsBean, getPromptsEventHandler, getResultSetInstance, getSaveToInbox, getStateID, initializeFromSchedule, initializeFromSubscription, isPrompted, isReady, refresh, refresh, setDisplayName, setExpiration, setMaxWait, setMessageID, setPollingFrequency, setPromptsEventHandler, setSaveToInbox, setStateID
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
addTransform, addTransformByClass, addTransformByStyle, addTransformByStyle, clearTransforms, getBeanContext, getMessageString, getMyTransformInstances, getTransformInstance, getTransformInstance, getTransformInstances, getType, hasTransform, hasTransform, invalidateTransformCache, setBeanContext, transform, transform
-
Methods inherited from interface com.microstrategy.web.beans.WebBean
getDocument, getErrorInfo, getSessionInfo, isStale, setSessionInfo, setStale
-
Methods inherited from interface com.microstrategy.web.beans.WebComponent
addChild, addChildStateInfo, addChildStateInfo, collectData, collectMinimalData, generateOutput, getBeanContext, getChild, getChild, getChildByClass, getChildByType, getChildCount, getChildrenByClass, getDefaultStateLevel, getFeaturesManager, getMaximumStateLevel, getName, getOutputFormat, getParent, getPath, getPersistMode, getRenderingFilter, getRoot, getTargetBean, getTargetBeanPath, getWebEvent, getWebEvent, getWebEventHandler, getXMLStatus, handleRequest, hasChanged, hasJustOpened, initBean, invalidateChildrenState, isBeanContextEmpty, isFeatureAvailable, prepareForReuse, removeChild, removeChild, searchChild, setBeanContext, setBeanContext, setChanged, setChanged, setDefaultStateLevel, setFeaturesManager, setName, setOutputFormat, setParent, setPersistMode, setRenderingFilter, setTargetBean, setTargetBeanPath, setWebEventHandler
-
-
-
-
Field Detail
-
GRID_REPORTS
static final int GRID_REPORTS
Identifies those underlying reports whose view mode is set to Grid- See Also:
- Constant Field Values
-
GRAPH_REPORTS
static final int GRAPH_REPORTS
Identifies those underlying reports whose view mode is set to Graph- See Also:
- Constant Field Values
-
-
Method Detail
-
getDocumentInstance
WebDocumentInstance getDocumentInstance() throws WebBeanException
Returns the Document Instance set.- Returns:
- The
WebDocumentInstance
set on the bean. - Throws:
WebBeanException
- thrown if there is any backend error
-
getCount
int getCount(int typeOfReports) throws WebBeanException, java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException
- if the typeOfReports passed is invalid.WebBeanException
- thrown if the count is unable to get
-
getCount
int getCount() throws WebBeanException
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
-
getReport
ReportBean getReport(int index) throws WebBeanException, java.lang.IndexOutOfBoundsException
Returns theReportBean
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:
java.lang.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.
-
getReport
ReportBean getReport(int index, int typeOfReports) throws WebBeanException, java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
Returns theReportBean
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:
java.lang.IllegalArgumentException
- if the typeOfReports passed is invalid.java.lang.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.
-
getReports
java.util.Iterator getReports(int typeOfReports) throws WebBeanException, java.lang.IllegalArgumentException
Returns an Iterator that contains theReportBean
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:
java.lang.IllegalArgumentException
- if the typeOfReports passed is invalid.WebBeanException
- thrown if there is backend error when retrieving reports of the specified type.
-
getReports
java.util.Iterator getReports() throws WebBeanException
Returns an Iterator that contains theReportBean
objects within the document.- Returns:
- An Iterator over the Reports in the Document
- Throws:
WebBeanException
- thrown if there is backend error when retrieving reports.
-
collectData
void collectData(boolean populateReportInstances) throws WebBeanException
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 aWebBeanError
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
-
getResult
java.lang.String getResult() throws WebBeanException
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.
-
cancelRequest
boolean cancelRequest()
Cancels the current request.- Specified by:
cancelRequest
in interfaceResultSetBean
- Returns:
- true if successfully cancelled.
-
getExecutionFlags
int getExecutionFlags()
Returns the execution flag as ofEnumDSSXMLExecutionFlags
when running theWebDocument
contained in this bean.- Returns:
- the
WebDocument
execution flag.
-
setExecutionFlags
void setExecutionFlags(int executionFlags)
Sets the execution flags as ofEnumDSSXMLExecutionFlags
to this bean.- Parameters:
executionFlags
- theWebDocument
execution flag.
-
getViewMode
int getViewMode()
Returns the view mode. Possible values are listed inEnumWebDocumentViewMode
.- Returns:
- the view mode.
- Since:
- MicroStrategy Web 7.5.0
-
setViewMode
void setViewMode(int viewMode)
Sets the view mode (Possible values :EnumWebDocumentViewMode
)- Parameters:
viewMode
- a new view mode.- Since:
- MicroStrategy Web 7.5.0
-
-