Interface PromptsBean

  • All Superinterfaces:
    EnumWebPersistableState, Persistable, RequestPersistable, Transformable, WebBean, WebComponent

    public interface PromptsBean
    extends WebBean
    This interface acts as a controller to orchestrate the collection and assembly of prompt questions. There are two different modes of operation:
    • Traditional Report-centric Mode: An application selects a report to execute. If it contains prompts that need to be answered, the Prompts Bean is responsible for managing those questions.
    • Prompts-centric Mode: An application creates a Prompts Bean object and supplies some number of prompt sources.
    An instance of the PromptsBean can be retrieved from the ReportBean, DocumentBean, RWBean, SubscriptionBean, ScheduleBean
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Detail

      • getCount

        int getCount​(int typeOfPrompt)
              throws WebBeanException
        Returns the count of prompts of a specific type from all the sources. The type could be a combination of two or more types.
        Parameters:
        typeOfPrompt - a bitwise flag from EnumPromptsBeanTypes.
        Returns:
        the total count of prompts of the specified type from this PromptsBean.
        Throws:
        WebBeanException - thrown if the count is unable to obtain.
      • getCurrentPromptPosition

        int getCurrentPromptPosition()
        Returns the position of the current prompt object the caller is working on.
        Returns:
        The position of the current prompt.
      • setCurrentPromptPosition

        void setCurrentPromptPosition​(int position)
                               throws WebBeanException,
                                      java.lang.IndexOutOfBoundsException
        Sets the prompt object at a new position as the current working prompt object.
        Parameters:
        position - a new position in this PromptsBean.
        Throws:
        java.lang.IndexOutOfBoundsException - thrown if the position is out of range.
        WebBeanException - thrown if error occurs when loading prompts
      • getNextPromptPosition

        int getNextPromptPosition​(int type,
                                  int startPos)
                           throws WebBeanException
        Returns the position of the prompt object of the specified type, next to the startPos. Returns -1 if it is not found.
        Parameters:
        type - a flag from EnumPromptsBeanTypes.
        startPos - the starting position to search.
        Returns:
        the position of the next prompt object of the specified type.
        Throws:
        java.lang.IndexOutOfBoundsException - thrown if startPos is out of range.
        WebBeanException - thrown if error occurs when loading prompts
      • getNextPromptPosition

        int getNextPromptPosition​(int type)
                           throws WebBeanException
        Returns the position of the prompt object of the specified type, next to the current prompt. Returns -1 if it is not found.
        Parameters:
        type - a flag from EnumPromptsBeanTypes.
        Returns:
        the position of the next prompt object of the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getNextPromptPosition

        int getNextPromptPosition()
                           throws WebBeanException
        Returns the position of the next prompt object of the same type as the current prompt, starting search from the current prompt. Returns -1 if it is not found.
        Returns:
        the position of the next prompt object of the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getPromptObject

        PromptObject getPromptObject​(int position)
                              throws WebBeanException
        Returns the PromptObject at a specific position.
        Parameters:
        position - the position of a PromptObject.
        Returns:
        the PromptObject at the specified position.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getPromptObject

        PromptObject getPromptObject()
                              throws WebBeanException
        Returns the PromptObject at the current position.
        Returns:
        the current PromptObject.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getPromptObjects

        java.util.Iterator getPromptObjects​(int typeOfPrompt)
                                     throws WebBeanException
        Returns a read-only java.util.Iterator over all the contained PromptObject, each of which has the specified type.
        Parameters:
        typeOfPrompt - a flag from EnumPromptsBeanTypes.
        Returns:
        an java.util.Iterator over all the PromptObject with the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • addPromptsSource

        PromptsSource addPromptsSource​(int promptSourceType)
                                throws java.lang.UnsupportedOperationException
        Creates and adds a new PromptsSource object to this bean.
        Parameters:
        promptSourceType - a flag from EnumPromptsSourceTypes indicating the source type.
        Returns:
        an instantiated PromptsSource.
        Throws:
        java.lang.UnsupportedOperationException - thrown if the prompts source collection is read-only.
      • getPromptsSources

        java.util.Iterator getPromptsSources()
        Returns an java.util.Iterator over all the PromptsSource contained within this bean.
        Returns:
        an iterator over all the PromptsSource.
      • getPreviousPromptPosition

        int getPreviousPromptPosition​(int type,
                                      int startPos)
                               throws WebBeanException
        Returns the position of the prompt object of the specified type, previous to the startPos. Returns -1 if it is not found.
        Parameters:
        type - a flag from EnumPromptsBeanTypes.
        startPos - the starting position to search.
        Returns:
        the position of the previous prompt object of the specified type.
        Throws:
        java.lang.IndexOutOfBoundsException - thrown if startPos is out of range.
        WebBeanException - thrown if error occurs when loading prompts
      • getPreviousPromptPosition

        int getPreviousPromptPosition​(int type)
                               throws WebBeanException
        Returns the position of the prompt object of the specified type, previous to the current prompt. Returns -1 if it is not found.
        Parameters:
        type - a flag from EnumPromptsBeanTypes.
        Returns:
        the position of the previous prompt object of the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getPreviousPromptPosition

        int getPreviousPromptPosition()
                               throws WebBeanException
        Returns the position of the previous prompt object of the same type as the current prompt, starting search from the current prompt. Returns -1 if it is not found.
        Returns:
        the position of the previous prompt object of the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
      • getPrompts

        WebPrompts getPrompts()
        Returns prompts
        Since:
        MicroStrategy Web 8.1.2
      • getPromptBean

        PromptBean getPromptBean()
                          throws WebBeanException
        Returns the PromptBean at the current position.
        Returns:
        the current PromptBean.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
        Since:
        MicroStrategy Web 9.0.0
      • getPromptBean

        PromptBean getPromptBean​(int position)
                          throws WebBeanException
        Returns the PromptBean at the specific position.
        Parameters:
        position - the position of a PromptObject.
        Returns:
        the PromptBean at the specified position.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
        Since:
        MicroStrategy Web 9.0.0
      • getPromptBeans

        java.util.Iterator<PromptBean> getPromptBeans​(int typeOfPrompt)
                                               throws WebBeanException
        Returns a read-only java.util.Iterator over all the contained PromptBean, each of which has the specified type.
        Parameters:
        typeOfPrompt - a flag from EnumPromptsBeanTypes.
        Returns:
        an java.util.Iterator over all the PromptBean with the specified type.
        Throws:
        WebBeanException - thrown if error occurs when loading prompts
        Since:
        MicroStrategy Web 9.0.0