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 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
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • 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

      • 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 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:
        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 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:
        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 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:
        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 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.
      • 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 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
      • 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 interface ResultSetBean
        Returns:
        true if successfully cancelled.
      • getExecutionFlags

        int getExecutionFlags()
        Returns the execution flag as of EnumDSSXMLExecutionFlags when running the WebDocument contained in this bean.
        Returns:
        the WebDocument execution flag.
      • setExecutionFlags

        void setExecutionFlags​(int executionFlags)
        Sets the execution flags as of EnumDSSXMLExecutionFlags to this bean.
        Parameters:
        executionFlags - the WebDocument execution flag.
      • getViewMode

        int getViewMode()
        Returns the view mode. Possible values are listed in EnumWebDocumentViewMode.
        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