The email prompt class is a class which aids in rendering a graphical user interface as well as handling primary events which happen as a result of user interaction.
It's important to remember the overall theme of what happens in an eSF application on a Lexmark computer. A Profile is a series of Prompt's. A prompt is an individual screen which can be rendered and handle events. There are several standard prompts that the SDK provides such as a Message prompt, String prompt, and other base prompts that can be utilized in many settings.
As part of this project though, the requirements for the screens cause us to have to implement a custom prompt. When implementing a custom prompt you must create a class that extends BasePrompt and implements VlmlPrompt. One method which will need to be overridden is getVlml which returns the String representation of the custom vlml to be shown to the user.
We saw in the SDK that many of the examples would literally write the VLML into string literals which would cause them to have to escape a lot of text and generally looked tedious. The way that we tackled this problem was to have the VLML centralized into an xml file which we then import in program code and convert to a String representation that the framework expects. Gavin used the StringSubstitutor class so that we could place tags within the xml file such as ${texttoreplace} and using the string substitutor class we could easily throw in dynamic elements into the VLML file. This proved useful when I was implementing the EmailPrompt class as the Email Prompt needs to be able to display different messages depending on the messages that are passed into the constructor. Therefore I was able to put a tag like ${radio1} in the VLML file and have that text replaced with one of the messages passed into the constructor.
No comments:
Post a Comment