public interface

WebPrompt

implements Persistable WebObjectInfo
com.microstrategy.web.objects.WebPrompt
Known Indirect Subclasses

Class Overview

This interface represents a prompt object. It defines finctionality common to all prompt types. Note that if the properties of a prompt object are needed, it is highly preferred to use getDisplayProperties instead of getPropertySets.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
Public Methods
abstract void answerPrompt()
Submits prompt answers to the I-Server.
abstract void buildShortAnswerXML(WebXMLBuilder builder)
abstract String getAnswerXML(boolean encode)
Returns the XML representation of prompt answer.
abstract String getAnswerXML()
Returns the XML representation of prompt answer.
abstract String getAnswerXML(boolean shortFormat, boolean encode, boolean includeClosed)
Returns an XML string representing the prompt answer.
abstract int getBrowsableDataSourceFlags()
Returns the XDA flags EnumDSSXMLExternalSourceFlags of the data source for browsing.
abstract int getDSSPromptType()
abstract WebDisplayHelper getDisplayHelper()
Returns a display helper object that can be used to build prompt display XML.
abstract WebDisplayHelper getDisplayHelper(boolean populateDisplayUnits)
Returns a display helper object that can be used to build prompt display XML.
abstract WebProperties getDisplayProperties()
Returns prompt display properties or null.
abstract String getKey()
Returns a key to uniquely identify a WebPrompt.
abstract String getMax()
Returns value of prompt miximum property or null.
abstract String getMeaning()
Returns prompt meaning or null
abstract boolean getMerge()
????
abstract String getMessageId()
abstract String getMin()
Returns value of prompt minimum property or null.
abstract int getPIN()
Returns prompt's PIN assigned by the I-Server that uniquely identifies this prompt inside prompts collection.
abstract WebPromptLocation getPrimaryLocation()
abstract int getPromptType()
Returns prompt type
abstract int getReuse()
Returns prompt reuse mode.
abstract String getShortAnswerXML()
Returns the XML representation of prompt answer in the format used by the Narrowcast server.
abstract String getShortAnswerXML(boolean encode)
Returns the XML representation of prompt answer in the format used by the Narrowcast server.
abstract String getShortPa(boolean includeClosed)
abstract String getShortPa()
abstract String getTitle()
Returns prompt title or null.
abstract WebUserAnswers getUserAnswers()
Returns a collection of user prompt answers.
abstract int[] getXDATypes()
Returns all XDA types associated with this prompt.
abstract boolean hasAnswer()
A prompt contains a collections of answers (previous/default/current).
abstract boolean hasDefaultAnswer()
A prompt contains a collections of answers (previous/default/current).
abstract boolean hasOriginalAnswer()
Returns true if original prompt XML contained current answer, false otherwise.
abstract boolean hasPreviousAnswer()
A prompt contains a collections of answers (previous/default/current).
abstract 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).
abstract boolean isCanceled()
Returns true if the prompt is canceled, false otherwise
abstract boolean isClosed()
Returns true if the prompt is closed, false otherwise.
abstract boolean isRequired()
Returns true if this prompt is required, false otherwise
abstract boolean isUsed()
Returns true if the prompt is used, false otherwise
abstract void populateAnswer(String answerXML)
Populate the current answer from the XML.
abstract void resetAnswer()
Resets the current answer to be either the previous answer or the default answer.
abstract void setCanceled()
Sets prompt closed flag.
abstract void setClosed(boolean closed)
Sets prompt closed flag.
abstract void setMax(String max)
Sets the maximum property of the prompt to the new value.
abstract void setMeaning(String meaning)
Sets the meaning of the prompt definition.
abstract void setMin(String min)
Sets the minimum property of the prompt to the new value.
abstract void setRequired(boolean isRequired)
Sets the required flag on the prompt.
abstract void setReuse(int reuse)
Sets the prompt reuse mode for a prompt definition.
abstract void setTitle(String title)
Sets the title of the prompt definition.
abstract void validate()
Validates whether the prompt passes the maximum and minimum limits (normally are limits on count of answers), and required validation requirements.
[Expand]
Inherited Methods
From interface com.microstrategy.utils.KeyedObject
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.objects.WebDisplayUnit
From interface com.microstrategy.web.objects.WebFeatures
From interface com.microstrategy.web.objects.WebObjectInfo
From interface com.microstrategy.web.objects.WebPromptSite

Public Methods

public abstract void answerPrompt ()

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.

public abstract void buildShortAnswerXML (WebXMLBuilder builder)

public abstract 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.

public abstract 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.

public abstract 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.

public abstract int getBrowsableDataSourceFlags ()

Returns the XDA flags EnumDSSXMLExternalSourceFlags of the data source for browsing. GUI can use this flag to determine the functionalities supported by this data source (for example, element search).

Returns

public abstract int getDSSPromptType ()

public abstract WebDisplayHelper getDisplayHelper ()

Returns a display helper object that can be used to build prompt display XML.

Returns
  • a display helper object that can be used to build prompt display XML.

public abstract WebDisplayHelper getDisplayHelper (boolean populateDisplayUnits)

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.

public abstract 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.

public abstract 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.

public abstract 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.

public abstract String getMeaning ()

Returns prompt meaning or null

Returns
  • prompt meaning or null

public abstract boolean getMerge ()

????

public abstract String getMessageId ()

public abstract 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.

public abstract 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.

public abstract WebPromptLocation getPrimaryLocation ()

public abstract int getPromptType ()

Returns prompt type

Returns
  • prompt type

public abstract int getReuse ()

Returns prompt reuse mode. This will be a value from EnumDSSXMLPromptReuse.

Returns

public abstract 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.

public abstract 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.

public abstract String getShortPa (boolean includeClosed)

public abstract String getShortPa ()

public abstract String getTitle ()

Returns prompt title or null.

Returns
  • prompt title or null

public abstract 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.

public abstract 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.

public abstract 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.

public abstract 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.

public abstract boolean hasOriginalAnswer ()

Returns true if original prompt XML contained current answer, false otherwise.

Returns
  • true if original prompt XML contained current answer, false otherwise.

public abstract 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

public abstract 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.
See Also
  • {@link #hasAnswer()}

public abstract boolean isCanceled ()

Returns true if the prompt is canceled, false otherwise

Returns
  • true if the prompt is canceled, false otherwise
See Also

public abstract 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

public abstract boolean isRequired ()

Returns true if this prompt is required, false otherwise

Returns
  • true if the prompt is required, false otherwise

public abstract boolean isUsed ()

Returns true if the prompt is used, false otherwise

Returns
  • true if the prompt is used, false otherwise

public abstract void populateAnswer (String answerXML)

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.

public abstract void resetAnswer ()

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.

public abstract 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

public abstract 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

public abstract void setMax (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.

public abstract void setMeaning (String meaning)

Sets the meaning of the prompt definition.

Parameters
meaning The new value for the meaning property.

public abstract void setMin (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.

public abstract 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.

public abstract 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.

public abstract void setTitle (String title)

Sets the title of the prompt definition.

Parameters
title The new title for the prompt definition.

public abstract void validate ()

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
Signals that the prompt answer failed validation requirements.
WebObjectsException