Package com.microstrategy.web.objects
Interface WebPrompt
-
- All Superinterfaces:
EnumWebPersistableState
,KeyedObject
,Persistable
,WebDisplayUnit
,WebFeatures
,WebObjectInfo
,WebPromptSite
- All Known Subinterfaces:
WebConstantPrompt
,WebDimtyPrompt
,WebElementsPrompt
,WebExpressionPrompt
,WebObjectsPrompt
,WebTimePrompt
public interface WebPrompt extends WebObjectInfo, Persistable
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.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
-
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 void
answerPrompt()
Submits prompt answers to the I-Server.void
buildShortAnswerXML(WebXMLBuilder builder)
java.lang.String
getAnswerXML()
Returns the XML representation of prompt answer.java.lang.String
getAnswerXML(boolean encode)
Returns the XML representation of prompt answer.java.lang.String
getAnswerXML(boolean shortFormat, boolean encode, boolean includeClosed)
Returns an XML string representing the prompt answer.int
getBrowsableDataSourceFlags()
Returns the XDA flagsEnumDSSXMLExternalSourceFlags
of the data source for browsing.WebDisplayHelper
getDisplayHelper()
Returns a display helper object that can be used to build prompt display XML.WebDisplayHelper
getDisplayHelper(boolean populateDisplayUnits)
Returns a display helper object that can be used to build prompt display XML.WebProperties
getDisplayProperties()
Returns prompt display properties or null.int
getDSSPromptType()
java.lang.String
getKey()
Returns a key to uniquely identify aWebPrompt
.java.lang.String
getMax()
Returns value of prompt miximum property or null.java.lang.String
getMeaning()
Returns prompt meaning or nullboolean
getMerge()
????java.lang.String
getMessageId()
java.lang.String
getMin()
Returns value of prompt minimum property or null.int
getPIN()
Returns prompt's PIN assigned by the I-Server that uniquely identifies this prompt inside prompts collection.WebPromptLocation
getPrimaryLocation()
int
getPromptType()
Returns prompt typeint
getReuse()
Returns prompt reuse mode.java.lang.String
getShortAnswerXML()
Returns the XML representation of prompt answer in the format used by the Narrowcast server.java.lang.String
getShortAnswerXML(boolean encode)
Returns the XML representation of prompt answer in the format used by the Narrowcast server.java.lang.String
getShortPa()
java.lang.String
getShortPa(boolean includeClosed)
java.lang.String
getTitle()
Returns prompt title or null.WebUserAnswers
getUserAnswers()
Returns a collection of user prompt answers.int[]
getXDATypes()
Returns all XDA types associated with this prompt.boolean
hasAnswer()
A prompt contains a collections of answers (previous/default/current).boolean
hasDefaultAnswer()
A prompt contains a collections of answers (previous/default/current).boolean
hasOriginalAnswer()
Returns true if original prompt XML contained current answer, false otherwise.boolean
hasPreviousAnswer()
A prompt contains a collections of answers (previous/default/current).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).boolean
isCanceled()
Returns true if the prompt is canceled, false otherwiseboolean
isClosed()
Returns true if the prompt is closed, false otherwise.boolean
isRequired()
Returns true if this prompt is required, false otherwiseboolean
isUsed()
Returns true if the prompt is used, false otherwisevoid
populateAnswer(java.lang.String answerXML)
Populate the current answer from the XML.void
resetAnswer()
Resets the current answer to be either the previous answer or the default answer.void
resetToDefault()
Resets the current answer to the default answer if there is onevoid
setCanceled()
Sets prompt closed flag.void
setClosed(boolean closed)
Sets prompt closed flag.void
setMax(java.lang.String max)
Sets the maximum property of the prompt to the new value.void
setMeaning(java.lang.String meaning)
Sets the meaning of the prompt definition.void
setMin(java.lang.String min)
Sets the minimum property of the prompt to the new value.void
setRequired(boolean isRequired)
Sets the required flag on the prompt.void
setReuse(int reuse)
Sets the prompt reuse mode for a prompt definition.void
setTitle(java.lang.String title)
Sets the title of the prompt definition.void
validate()
Validates whether the prompt passes the maximum and minimum limits (normally are limits on count of answers), and required validation requirements.-
Methods inherited from interface com.microstrategy.utils.KeyedObject
_getObKey
-
Methods inherited from interface com.microstrategy.utils.serialization.Persistable
restoreState, restoreState, saveState, saveState, saveState, saveState
-
Methods inherited from interface com.microstrategy.web.objects.WebDisplayUnit
addDetails, applyVisitor, canHighlight, getChildUnits, getDisplayName, getDisplayUnitType, hasDetails, highlightUnit, highlightUnit, isHighlighted, isObjectInfo, isSelected, setDisplayName, setSelected
-
Methods inherited from interface com.microstrategy.web.objects.WebFeatures
isFeatureAvailable, isFeatureAvailable
-
Methods inherited from interface com.microstrategy.web.objects.WebObjectInfo
buildShortObjectAttributes, buildShortXML, getAbbreviation, getAccessGranted, getAncestors, getCardStatus, getCertifiedInfo, getComments, getContainerDid, getContainerType, getCreationTime, getCreationTimeStamp, getDataSources, getDescription, getExtendedType, getFactory, getFlags, getIconPath, getID, getModificationTime, getModificationTimeStamp, getName, getNonSchedulable, getOtherNameTransCount, getOwner, getParent, getPreSaveAsFlags, getProjectId, getProjectName, getPropertyFlags, getPropertySetFilter, getPropertySets, getRecommendationInfo, getSecurity, getState, getSubType, getType, getVersionID, getViewMediaSettings, getVisualizationViewMode, getXML, getXML, hasOwner, isAncestorNamedFolder, isDirty, isEmbedded, isHidden, isNew, isPopulated, populate, populate, setAbbreviation, setComments, setDataSources, setDescription, setExtendedType, setFlags, setHidden, setIconPath, setName, setNonSchedulable, setPreSaveAsFlags, setPropertyFlags
-
Methods inherited from interface com.microstrategy.web.objects.WebPromptSite
getPromptInstances
-
-
-
-
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
-
getReuse
int getReuse()
Returns prompt reuse mode. This will be a value fromEnumDSSXMLPromptReuse
.- Returns:
- prompt reuse mode, from
EnumDSSXMLPromptReuse
-
setReuse
void setReuse(int reuse)
Sets the prompt reuse mode for a prompt definition. This should be a value fromEnumDSSXMLPromptReuse
.- Parameters:
reuse
- The new value to use for the reuse mode of the prompt, fromEnumDSSXMLPromptReuse
.- 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 callinganswerPrompt()
. 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 theencode
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 theencode
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 theanswerXML
parameter is null and the prompt has the current answer it will be removed.- Parameters:
answerXML
- the answer XML.- Throws:
WebObjectsException
-
getDisplayHelper
WebDisplayHelper getDisplayHelper() throws WebObjectsException
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.
- 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
-
resetToDefault
void resetToDefault() throws WebObjectsException
Resets the current answer to the default answer if there is one- Throws:
WebObjectsException
-
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
-
getBrowsableDataSourceFlags
int getBrowsableDataSourceFlags()
Returns the XDA flagsEnumDSSXMLExternalSourceFlags
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:
- the XDA flags
EnumDSSXMLExternalSourceFlags
of the data source for browsing for this prompt. Default value isEnumDSSXMLExternalSourceFlags.DssXmlExternalSourceNone
.
-
getKey
java.lang.String getKey()
Returns a key to uniquely identify aWebPrompt
. The key never changes in the duration of running a report or document, while thepin
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
- iftrue
, the returned XML is formated for use by Narrowcast Serverencode
- iftrue
, the returned XML will have all the special characters HTML-encoded.includeClosed
- iftrue
, 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.
-
getPrimaryLocation
WebPromptLocation getPrimaryLocation()
-
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()
-
-