Interface WebPrompt

    • Method Detail

      • getPromptType

        int getPromptType()
        Returns prompt type
        Returns:
        prompt type
        See Also:
        EnumWebPromptType
      • getPIN

        int getPIN()
        Returns prompt's PIN assigned by the I-Server that uniquely identifies this prompt inside prompts collection.
        Returns:
        prompt's PIN assigned by the I-Server.
      • getTitle

        java.lang.String getTitle()
        Returns prompt title or null.
        Returns:
        prompt title or null
      • setTitle

        void setTitle​(java.lang.String title)
        Sets the title of the prompt definition.
        Parameters:
        title - The new title for the prompt definition.
        Since:
        MicroStrategy Web 9.0.0
      • getMeaning

        java.lang.String getMeaning()
        Returns prompt meaning or null
        Returns:
        prompt meaning or null
      • setMeaning

        void setMeaning​(java.lang.String meaning)
        Sets the meaning of the prompt definition.
        Parameters:
        meaning - The new value for the meaning property.
        Since:
        MicroStrategy Web 9.0.0
      • isUsed

        boolean isUsed()
        Returns true if the prompt is used, false otherwise
        Returns:
        true if the prompt is used, false otherwise
      • isClosed

        boolean isClosed()
        Returns true if the prompt is closed, false otherwise. When a prompt's answer has been submitted to and validated by Intelligence Server, the prompt is marked as closed.
        Returns:
        true if the prompt is closed, false otherwise
        See Also:
        answerPrompt()
      • setClosed

        void setClosed​(boolean closed)
        Sets prompt closed flag. If this flag set to true the prompt answer will not be sent to I-Server.
        Parameters:
        closed - the closed flag value
        See Also:
        answerPrompt()
      • isCanceled

        boolean isCanceled()
        Returns true if the prompt is canceled, false otherwise
        Returns:
        true if the prompt is canceled, false otherwise
        See Also:
        answerPrompt()
      • setCanceled

        void setCanceled()
        Sets prompt closed flag. If this flag set to true then when the answerPrompt is called for this prompt the SDK will request the I-Server to cancel the prompt
        See Also:
        answerPrompt()
      • isRequired

        boolean isRequired()
        Returns true if this prompt is required, false otherwise
        Returns:
        true if the prompt is required, false otherwise
      • setRequired

        void setRequired​(boolean isRequired)
        Sets the required flag on the prompt. This is only a meaningful thing to do for a prompt definition, not a prompt question.
        Parameters:
        isRequired - The new value for the isRequired flag.
        Since:
        MicroStrategy Web 9.0.0
      • setReuse

        void setReuse​(int reuse)
        Sets the prompt reuse mode for a prompt definition. This should be a value from EnumDSSXMLPromptReuse.
        Parameters:
        reuse - The new value to use for the reuse mode of the prompt, from EnumDSSXMLPromptReuse.
        Since:
        MicroStrategy Web 9.0.0
      • getMerge

        boolean getMerge()
        ????
      • getMin

        java.lang.String getMin()
        Returns value of prompt minimum property or null. This value is used to validate prompt answers.
        Returns:
        value of prompt minimum property or null.
      • setMin

        void setMin​(java.lang.String min)
        Sets the minimum property of the prompt to the new value. This is only a meaningful thing to do for prompt definitions, not prompt answers.
        Parameters:
        min - The new minimum value, or null to remove the minimum restriction.
        Since:
        MicroStrategy Web 9.0.0
      • getMax

        java.lang.String getMax()
        Returns value of prompt miximum property or null. This value is used to validate prompt answers.
        Returns:
        value of prompt miximum property or null.
      • setMax

        void setMax​(java.lang.String max)
        Sets the maximum property of the prompt to the new value. This is only a meaningful thing to do for prompt definitions, not prompt answers.
        Parameters:
        max - The new maximum value, or null to remove the maximum restriction.
        Since:
        MicroStrategy Web 9.0.0
      • getDisplayProperties

        WebProperties getDisplayProperties()
        Returns prompt display properties or null. This should be used instead of getPropertySets for prompt objects - this collection will contain only those properties that are specific to executing the prompt.
        Returns:
        value of prompt display properties or null.
      • hasOriginalAnswer

        boolean hasOriginalAnswer()
        Returns true if original prompt XML contained current answer, false otherwise.
        Returns:
        true if original prompt XML contained current answer, false otherwise.
      • hasAnswer

        boolean hasAnswer()
        A prompt contains a collections of answers (previous/default/current). This method checks whether there is a non-null current answer.The current answer is the answer that gets submitted to the Server when you call answer prompt.
        Returns:
        true if if the prompt has current answer and it is not null. Note: If the answer has an empty collection of answers, this method would return true.
        See Also:
        hasPreviousAnswer(), hasDefaultAnswer()
      • hasDefaultAnswer

        boolean hasDefaultAnswer()
        A prompt contains a collections of answers (previous/default/current). The default answer is part of the prompt definition. Returns true if the prompt has a non-null default answer, false otherwise.
        Returns:
        true if the prompt has default answer, false otherwise.
        See Also:
        hasAnswer(), hasPreviousAnswer()
      • hasPreviousAnswer

        boolean hasPreviousAnswer()
        A prompt contains a collections of answers (previous/default/current). The previous answer is the answer from the previous execution. Returns true if the prompt has previous answer, false otherwise.
        Returns:
        true if the prompt has previous answer, false otherwise.
        See Also:
        hasAnswer()
      • validate

        void validate()
               throws WebObjectsException
        Validates whether the prompt passes the maximum and minimum limits (normally are limits on count of answers), and required validation requirements. This method should be called after setting answer for this prompt and before calling answerPrompt(). This check in done at web server side, no Intelligence Server call involved. An exception is thrown if one of the conditions fails - check the error code to see which test failed.
        Throws:
        WebAPIHelperException - Signals that the prompt answer failed validation requirements.
        WebObjectsException
      • getAnswerXML

        java.lang.String getAnswerXML()
        Returns the XML representation of prompt answer. This XML can be persisted and used later to populate answer of prompt object received from I-Server. This way it is possible to reduce significantly the size of information persisted on the client.
        Returns:
        the XML representation of prompt answer.
      • getAnswerXML

        java.lang.String getAnswerXML​(boolean encode)
        Returns the XML representation of prompt answer. If the encode parameter is true the reurned string will be HTML encodded.
        Parameters:
        encode - a flag indicating that the XML must be HTM encoded
        Returns:
        the XML representation of prompt answer.
      • getShortAnswerXML

        java.lang.String getShortAnswerXML()
        Returns the XML representation of prompt answer in the format used by the Narrowcast server. This XML can be persisted in the Narrowcast server repository and used later to populate answer of prompt object received from I-Server.
        Returns:
        the XML representation of prompt answer in the format used by the Narrowcast server.
      • getShortAnswerXML

        java.lang.String getShortAnswerXML​(boolean encode)
        Returns the XML representation of prompt answer in the format used by the Narrowcast server. If the encode parameter is true the reurned string will be HTML encodded.
        Parameters:
        encode - a flag indicating that the XML must be HTM encoded
        Returns:
        the XML representation of prompt answer in the format used by the Narrowcast server.
      • populateAnswer

        void populateAnswer​(java.lang.String answerXML)
                     throws WebObjectsException
        Populate the current answer from the XML. This method takes both standard and short answer formats. If the answerXML parameter is null and the prompt has the current answer it will be removed.
        Parameters:
        answerXML - the answer XML.
        Throws:
        WebObjectsException
      • answerPrompt

        void answerPrompt()
                   throws WebObjectsException
        Submits prompt answers to the I-Server. This method behaves differently based on the values of Closed and Cancel properties (see the table below)

        Property Values

        Comments

        Closed = False and Cancel = False

        The answer method will send the answer in the prompt object to the I-Server. If the object did not have any answer, it will send an empty answer to I-Server. If the call is successful, it will mark the object as closed.

        Closed = False and Cancel = True

        The answer method will ask the I-Server to cancel the prompt. If the call is successful it will mark the object as closed. Note that canceling a prompt is semantically different that answering a prompt with empty answer.

        Closed = True and Cancel = True or False

        Since the prompt is marked closed, the answer method will not make any call to the I-Server.

        Throws:
        WebObjectsException - if there were some problems submitting answers to the I-Server.
      • resetAnswer

        void resetAnswer()
                  throws WebObjectsException
        Resets the current answer to be either the previous answer or the default answer. Sets the previous Answer if available as the current answer. If there is no previous answer, it sets the default answer as the current answer.
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 7.5.1
      • getDisplayHelper

        WebDisplayHelper getDisplayHelper​(boolean populateDisplayUnits)
                                   throws WebObjectsException
        Returns a display helper object that can be used to build prompt display XML.
        Parameters:
        populateDisplayUnits - suggests that the suggested answers must be populated
        Returns:
        a display helper object that can be used to build prompt display XML.
        Throws:
        WebObjectsException
      • getXDATypes

        int[] getXDATypes()
        Returns all XDA types associated with this prompt. This should be used by the GUI to determine any features which may need to be disabled. If this is not an XDA report, then this will be null.
        Returns:
        An int array of XDA types, from EnumDSSXMLXDAType, or null if this is not an XDA prompt.
        Since:
        MicroStrategy Web 8.0.0
      • getKey

        java.lang.String getKey()
        Returns a key to uniquely identify a WebPrompt. The key never changes in the duration of running a report or document, while the pin could change if there are embedded prompt emerging out.
        Returns:
        a key to uniquely identify a WebPrompt.
        Since:
        MicroStrategy Web 8.0.1
      • getAnswerXML

        java.lang.String getAnswerXML​(boolean shortFormat,
                                      boolean encode,
                                      boolean includeClosed)
        Returns an XML string representing the prompt answer. This XML can be persisted and used later to populate answer of prompt object received from I-Server. This way it is possible to reduce significantly the size of information persisted on the client.
        Parameters:
        shortFormat - if true, the returned XML is formated for use by Narrowcast Server
        encode - if true, the returned XML will have all the special characters HTML-encoded.
        includeClosed - if true, thr returned XML also contains the answer XML for all the closed prompts.
        Returns:
        an XML string representing the prompt answers.
        Since:
        MicroStrategy Web 8.0.2
      • getUserAnswers

        WebUserAnswers getUserAnswers()
        Returns a collection of user prompt answers. An empty collection is returned if there is no user prompt answers from the prompt question object.
        Returns:
        a collection of user prompt answers.
        Since:
        MicroStrategy Web 9.0.0
      • isAnswerEmpty

        boolean isAnswerEmpty()
        Returns true if the current prompt answer is null or the answer collection is empty (For example, in Elements collection is empty in case of an element prompt).
        Returns:
        true.
      • getDSSPromptType

        int getDSSPromptType()
      • buildShortAnswerXML

        void buildShortAnswerXML​(WebXMLBuilder builder)
      • getShortPa

        java.lang.String getShortPa()
      • getShortPa

        java.lang.String getShortPa​(boolean includeClosed)
      • getMessageId

        java.lang.String getMessageId()