Interface WebPrompts
- 
 public interface WebPromptsThis 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()andgetXML(boolean encode)method provide the persistence, while loading functionality is porovide by theWebResultSetInstance.getPrompts(String xml)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. - Since:
- MicroStrategy Web 7.3.1 or earlier
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidanswerFromLink(java.lang.String linkXml)voidanswerFromLink(java.lang.String linkXml, java.lang.String srcAnswers)voidanswerPrompts()Submits prompt answers to the I-Server.voidanswerPrompts(int execFlags)java.util.Enumerationelements()Returns an Enumeration of prompts in the collection.WebPromptfindPromptByPIN(int pin)Finds a prompt by its PIN.WebPromptget(int index)Returns a prompt by its index in the collection.WebPromptget(java.lang.String key)Returns theWebPromptmapped by the key in the current collection.java.lang.StringgetAnswerXML()Returns the XML string representing answers of all prompts in the collection that have an answer.java.lang.StringgetAnswerXML(boolean encode)Returns the XML string representing answers of all prompts in the collection that have an answer.java.lang.StringgetAnswerXML(boolean shortFormat, boolean encode, boolean includeClosed)Returns an XML string representing the answers of all prompts in the collection that have an answer.WebPromptgetById(java.lang.String id)Finds prompt based on its DSS IDjava.lang.StringgetShortAnswerXML()Returns the XML string representing answers of all prompts in the collection that have an answer.java.lang.StringgetShortAnswerXML(boolean encode)Returns the XML string representing answers of all prompts in the collection that have an answer.java.lang.StringgetShortXML()java.lang.StringgetXML()Returns the XML string representing this prompt collection.java.lang.StringgetXML(boolean encode)Returns the XML string representing this prompt collection.booleanisEmpty()Returns true if there is no prompts in the collection, false otherwise.voidloadAnswers(java.lang.String messageID)voidpopulate(java.lang.String xml)voidpopulateAnswers(java.lang.String answerXML)Populate prompt answers from the XML.voidpopulateFromReport(java.lang.String xml)voidsetCanceled()Sets the Canceled attribute for all prompts in the collection.voidsetClosed(boolean closed)Sets closed flag for all prompts in the collection.intsize()Returns the number of prompts in the collectionvoidvalidate()Validates each prompt in this prompt collection.
 
- 
- 
- 
Method Detail- 
getWebPrompt get(int index) throws java.lang.IndexOutOfBoundsException Returns a prompt by its index in the collection.- Parameters:
- index- - the prompt index in the collection
- Returns:
- the prompt object
- Throws:
- java.lang.IndexOutOfBoundsException- it the index is < 0 or >=size().
 
 - 
sizeint size() Returns the number of prompts in the collection- Returns:
- the number of prompts in the collection
 
 - 
isEmptyboolean isEmpty() Returns true if there is no prompts in the collection, false otherwise.- Returns:
- true if there is no prompts in the collection, false otherwise.
 
 - 
elementsjava.util.Enumeration elements() Returns an Enumeration of prompts in the collection.- Returns:
- an Enumeration of prompts in the collection.
 
 - 
findPromptByPINWebPrompt findPromptByPIN(int pin) Finds a prompt by its PIN.- Returns:
- a Prompt object or null if the Prompt with specified PIN not found.
 
 - 
validatevoid validate() throws WebObjectsExceptionValidates each prompt in this prompt collection. This method steps through each prompt and calls theWebPrompt.validate()method. This method validates that the answers are consistent with the restrictions which that prompt definition impose.- Throws:
- WebAPIHelperException- Thrown if an error occurs in the validation process.
- WebObjectsException
 
 - 
getAnswerXMLjava.lang.String getAnswerXML() 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 answer XML string
 
 - 
getAnswerXMLjava.lang.String getAnswerXML(boolean encode) 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.- Parameters:
- encode- if true, then the returned string will have all special characters HTML-encoded.
- Returns:
- the answer XML string
 
 - 
loadAnswersvoid loadAnswers(java.lang.String messageID) throws WebObjectsException- Throws:
- WebObjectsException
- Since:
- MicroStrategy Web 7.5.1
 
 - 
getShortAnswerXMLjava.lang.String getShortAnswerXML() 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 answer XML string
 
 - 
getShortAnswerXMLjava.lang.String getShortAnswerXML(boolean encode) 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.- Parameters:
- encode- if true, then the returned string will have all special characters HTML-encoded.
- Returns:
- the answer XML string
 
 - 
populateAnswersvoid populateAnswers(java.lang.String answerXML) throws WebObjectsExceptionPopulate 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.- Parameters:
- answerXML- the string containing answer XML
- Throws:
- WebObjectsException- if errors are detected in XML format or data
 
 - 
getXMLjava.lang.String getXML() Returns the XML string representing this prompt collection. This string can be persisted and used later to rebuild answer object (WebResultSetInstance.getPrompts(String)).- Returns:
- the prompts XML string
 
 - 
getXMLjava.lang.String getXML(boolean encode) Returns the XML string representing this prompt collection. This string can be persisted and used later to rebuild answer object (WebResultSetInstance.getPrompts(String)).- Parameters:
- encode- if true, then the returned string will have all special characters HTML-encoded.
- Returns:
- the prompts XML string
 
 - 
setCanceledvoid setCanceled() Sets the Canceled attribute for all prompts in the collection. If it set to true then next call toanswerPrompts()will result in canceling all prompts.
 - 
setClosedvoid setClosed(boolean closed) Sets closed flag for all prompts in the collection.- Parameters:
- closed- value to set.
 
 - 
answerPromptsvoid answerPrompts() throws WebObjectsExceptionSubmits prompt answers to the I-Server. The method loops through all prompts in the collection, and submits answers for all prompts that have it.- Throws:
- WebObjectsException- if there were some problems submitting answers to the I-Server.
 
 - 
answerPromptsvoid answerPrompts(int execFlags) throws WebObjectsException- Throws:
- WebObjectsException
 
 - 
getWebPrompt get(java.lang.String key) throws java.lang.IllegalArgumentException Returns theWebPromptmapped by the key in the current collection.- Parameters:
- key- the key uniquely identifying a- WebPrompt
- Returns:
- the WebPromptobject.
- Throws:
- java.lang.IllegalArgumentException- thrown if there is no such a- WebPromptmapped by the key.
- Since:
- MicroStrategy Web 8.0.1
 
 - 
getAnswerXMLjava.lang.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. This string can be persisted and used later to populate prompts returned by I-Server with current answers.- 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
 
 - 
getByIdWebPrompt getById(java.lang.String id) Finds prompt based on its DSS ID- Parameters:
- id- prompt DSS ID
- Returns:
- prompt object
- Since:
- MicroStrategy Web 8.1.2
 
 - 
answerFromLinkvoid answerFromLink(java.lang.String linkXml) throws WebObjectsException- Throws:
- WebObjectsException
- Since:
- MicroStrategy Web 8.1.2
 
 - 
answerFromLinkvoid answerFromLink(java.lang.String linkXml, java.lang.String srcAnswers) throws WebObjectsException- Throws:
- WebObjectsException
 
 - 
populatevoid populate(java.lang.String xml) throws WebObjectsException- Throws:
- WebObjectsException
 
 - 
getShortXMLjava.lang.String getShortXML() 
 - 
populateFromReportvoid populateFromReport(java.lang.String xml) throws WebObjectsException- Throws:
- WebObjectsException
 
 
- 
 
-