com.microstrategy.web.objects.WebPrompts |
This interface represents a read-only collection of WebPrompt objects associated with a report. Other than providing access to individual prompt objects, this interface is mainly used when you want to operate on the collection instead of individual prompt objects.
The WebPrompts interface exposes methods to persist the prompt objects via XML
definitions. The getXML()
and getXML(boolean)
method
provide the persistence, while loading functionality is porovide by the
getPrompts(String)
method of the WebReportInstance
interface.
The WebPrompts interface also introduces the notion of the Answer XML. The Answer XML is that component of the prompt definition that represents the current answer as specified by the user. By providing a persistence mechanism for the answer component it allows the user to minimize the amount of data they need to persist the prompt objects. The WebPrompts interface also introduces methods to support a special answer format used in the Aurora/Hydra.
The DisplayXML property aggregates the Display XML for all prompts in the collection.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void | answerFromLink(String linkXml) | ||||||||||
abstract void | answerFromLink(String linkXml, String srcAnswers) | ||||||||||
abstract void | answerPrompts(int execFlags) | ||||||||||
abstract void |
answerPrompts()
Submits prompt answers to the I-Server.
| ||||||||||
abstract Enumeration |
elements()
Returns an Enumeration of prompts in the collection.
| ||||||||||
abstract WebPrompt |
findPromptByPIN(int pin)
Finds a prompt by its PIN.
| ||||||||||
abstract WebPrompt |
get(int index)
Returns a prompt by its index in the collection.
| ||||||||||
abstract WebPrompt |
get(String key)
Returns the
WebPrompt mapped by the key in the current collection. | ||||||||||
abstract String |
getAnswerXML(boolean shortFormat, boolean encode, boolean includeClosed)
Returns an XML string representing the answers of all prompts in the collection
that have an answer.
| ||||||||||
abstract String |
getAnswerXML()
Returns the XML string representing answers of all prompts in the collection
that have an answer.
| ||||||||||
abstract String |
getAnswerXML(boolean encode)
Returns the XML string representing answers of all prompts in the collection
that have an answer.
| ||||||||||
abstract WebPrompt |
getById(String id)
Finds prompt based on its DSS ID
| ||||||||||
abstract String |
getShortAnswerXML(boolean encode)
Returns the XML string representing answers of all prompts in the collection
that have an answer.
| ||||||||||
abstract String |
getShortAnswerXML()
Returns the XML string representing answers of all prompts in the collection
that have an answer.
| ||||||||||
abstract String | getShortXML() | ||||||||||
abstract String |
getXML(boolean encode)
Returns the XML string representing this prompt collection.
| ||||||||||
abstract String |
getXML()
Returns the XML string representing this prompt collection.
| ||||||||||
abstract boolean |
isEmpty()
Returns true if there is no prompts in the collection, false otherwise.
| ||||||||||
abstract void | loadAnswers(String messageID) | ||||||||||
abstract void | populate(String xml) | ||||||||||
abstract void |
populateAnswers(String answerXML)
Populate prompt answers from the XML.
| ||||||||||
abstract void | populateFromReport(String xml) | ||||||||||
abstract void |
setCanceled()
Sets the Canceled attribute for all prompts in the collection.
| ||||||||||
abstract void |
setClosed(boolean closed)
Sets closed flag for all prompts in the collection.
| ||||||||||
abstract int |
size()
Returns the number of prompts in the collection
| ||||||||||
abstract void |
validate()
Validates each prompt in this prompt collection.
|
Submits prompt answers to the I-Server. The method loops through all prompts in the collection, and submits answers for all prompts that have it.
WebObjectsException | if there were some problems submitting answers to the I-Server. |
---|
Returns an Enumeration of prompts in the collection.
Finds a prompt by its PIN.
Returns a prompt by its index in the collection.
index | - the prompt index in the collection |
---|
IndexOutOfBoundsException | it the index is < 0 or >=size(). |
---|
Returns the WebPrompt
mapped by the key in the current collection.
key | the key uniquely identifying a WebPrompt |
---|
WebPrompt
object.IllegalArgumentException | thrown if there is no such a WebPrompt
mapped by the key. |
---|
Returns an XML string representing the answers of all prompts in the collection that have an answer. This string can be persisted and used later to populate prompts returned by I-Server with current answers.
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 the XML string representing answers of all prompts in the collection that have an answer. This string can be persisted and used later to populate prompts returned by I-Server with current answers.
Returns the XML string representing answers of all prompts in the collection that have an answer. This string can be persisted and used later to populate prompts returned by I-Server with current answers.
encode | if true, then the returned string will have all special characters HTML-encoded. |
---|
Finds prompt based on its DSS ID
id | prompt DSS ID |
---|
Returns the XML string representing answers of all prompts in the collection that have an answer. The XNL is formatted for use in Nerrowcast server. This string can be persisted and used later to populate prompts returned by I-Server with current answers.
encode | if true, then the returned string will have all special characters HTML-encoded. |
---|
Returns the XML string representing answers of all prompts in the collection that have an answer. The XML is formatted for use in Nerrowcast server. This string can be persisted and used later to populate prompts returned by I-Server with current answers.
Returns the XML string representing this prompt collection. This string can
be persisted and used later to rebuild answer object
(getPrompts(String)
).
encode | if true, then the returned string will have all special characters HTML-encoded. |
---|
Returns the XML string representing this prompt collection. This string can
be persisted and used later to rebuild answer object
(getPrompts(String)
).
Returns true if there is no prompts in the collection, false otherwise.
Populate prompt answers from the XML. Usually the XML will be a string obtained from the previous call to the getAnswer method and persisted between web pages. It is also possible to build the answer XML independently.
answerXML | the string containing answer XML |
---|
WebObjectsException | if errors are detected in XML format or data |
---|
Sets the Canceled attribute for all prompts in the collection. If it set to true then
next call to answerPrompts()
will result in canceling all prompts.
Sets closed flag for all prompts in the collection.
closed | value to set. |
---|
Returns the number of prompts in the collection
Validates each prompt in this prompt collection. This method steps through each prompt and
calls the WebPrompt.validate()
method. This method validates
that the answers are consistent with the restrictions which that prompt definition impose.
Thrown if an error occurs in the validation process. | |
WebObjectsException |