public class

PromptConstantTransform

extends AbstractPromptObjectTransform
implements LayoutTransform
java.lang.Object
   ↳ com.microstrategy.web.transform.AbstractTransform
     ↳ com.microstrategy.web.transform.AbstractLayoutTransform
       ↳ com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
         ↳ com.microstrategy.web.app.transforms.PromptConstantTransform

Class Overview

User must type the answer using a textbox. This style also supports date prompts.

Summary

Constants
int TIME_FORMAT_HOUR_MINUTES Value for formal parameter timeFieldFormat to indicate that time display contains hours and minutes.
int TIME_FORMAT_HOUR_MINUTES_SECONDS Value for formal parameter timeFieldFormat to indicate that time display contains hours, minutes and seconds.
int TIME_FORMAT_NONE Value for formal parameter timeFieldFormat to indicate that there is no time display
[Expand]
Inherited Constants
From interface com.microstrategy.web.beans.EnumPromptsBeanEvents
Fields
public FormalParameter displayDynamicDateAsStatic Enforces application to display the dynamic date as a static date.
public FormalParameter markDefaultAnswerAsComplex Enforces application to mark given default answer, if exists, as complex.
public FormalParameter timeFieldFormat This formal parameter specifies the format of the time field in DHTML mode.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
Public Constructors
PromptConstantTransform()
Default no-args constructor, initialize all the formal parameters.
Public Methods
boolean areThereAvailableSelections()
Indicates whether or not there are available items.
boolean canTransform(Transformable data)
Indicates whether or not given component (data) can be processed by this Transform.
String getDescription()
Indicates this transform's description.
void initializeCss()
Initializes CSS information to be used by this transform.
void initializePromptContent()
Initializes the objects the Prompt will use to render its content.
boolean isAnswerComplex()
Indicates whether or not current answer is complex or not.
boolean isDisplayTimeEnabled()
Returns true if the Time field needs to be displayed.
void renderCalendar(MarkupOutput out)
Renders calendar HTML code.
void renderCalendar(MarkupOutput out, String argument, String calendarArg)
Renders calendar HTML code.
void renderCalendarForDateField(MarkupOutput out)
Renders calendar HTML code.
void renderDateField(MarkupOutput out)
Renders the date field when the time field display is enabled.
void renderInputText(MarkupOutput out)
Renders an HTML input tag to indicate prompt answer.
void renderInputText(MarkupOutput out, String argument)
Renders an HTML input tag with ID property set to argument.
void renderPromptContent(MarkupOutput out)
Renders the prompt content.
void renderPromptRestrictions(MarkupOutput out)
Renders the title of the prompt.
void renderTimeField(MarkupOutput out)
Renders the time field as Hour/Minutes or Hour/Minutes/Seconds
It renders the Hour in 12 Hour and 24 Hour formats and the JavaScript code enables one of them based on the client machines regional settings.
Protected Methods
String getAnswer()
Indicates current prompt answer.
boolean validData(String value, int dataType)
Validates value corresponds to given datatype.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
From class com.microstrategy.web.transform.AbstractLayoutTransform
From class com.microstrategy.web.transform.AbstractTransform
From class java.lang.Object
From interface com.microstrategy.web.transform.LayoutTransform
From interface com.microstrategy.web.transform.Transform

Constants

public static final int TIME_FORMAT_HOUR_MINUTES

Value for formal parameter timeFieldFormat to indicate that time display contains hours and minutes.

Constant Value: 1 (0x00000001)

public static final int TIME_FORMAT_HOUR_MINUTES_SECONDS

Value for formal parameter timeFieldFormat to indicate that time display contains hours, minutes and seconds.

Constant Value: 2 (0x00000002)

public static final int TIME_FORMAT_NONE

Value for formal parameter timeFieldFormat to indicate that there is no time display

Constant Value: 0 (0x00000000)

Fields

public FormalParameter displayDynamicDateAsStatic

Enforces application to display the dynamic date as a static date.
If this formal parameter is set to true, then the dynamic date (e.g. Today + 1) will not be displayed as a complex answer. It would be resolved as a static date and the answer would be populated in the text box of the prompt. This flag is used as boolean value.

public FormalParameter markDefaultAnswerAsComplex

Enforces application to mark given default answer, if exists, as complex.
Complex default answers are those that can't be displayed with given prompt style because of its complexity. Most likely, these kind of answers are displayed below prompt question and expanded to corresponding expression format. This flag overrules prompt definition by marking complex given default answer.
This flag is used as boolean value.

public FormalParameter timeFieldFormat

This formal parameter specifies the format of the time field in DHTML mode.
The values can be one of the following

This flag is used as integer value.

Public Constructors

public PromptConstantTransform ()

Default no-args constructor, initialize all the formal parameters.

Public Methods

public boolean areThereAvailableSelections ()

Indicates whether or not there are available items.
This function checks size of available selections. Returns false when selections are less or equal to zero.

Returns
  • boolean true if available selection is greater than 0

public boolean canTransform (Transformable data)

Indicates whether or not given component (data) can be processed by this Transform.
Extends canTransform() by returning true only if the prompt is of type WebPromptTypeConstant.

Parameters
data PromptObject instance to transform
Returns

public String getDescription ()

Indicates this transform's description.

Returns
  • the description of a constant answer.

public void initializeCss ()

Initializes CSS information to be used by this transform.

public void initializePromptContent ()

Initializes the objects the Prompt will use to render its content.
This method internally calls getAnswer.

Throws
WebObjectsException if something goes wrong when initializing prompt.

public boolean isAnswerComplex ()

Indicates whether or not current answer is complex or not.
It is complex if answer type is unknown.

Returns
  • boolean true if Prompt's answer is considered as complex.

public boolean isDisplayTimeEnabled ()

Returns true if the Time field needs to be displayed.
This is based on the value of the FormalParameter timeFieldFormat and also on the data type of the constant prompt.

public void renderCalendar (MarkupOutput out)

Renders calendar HTML code.
It obtains Id for textbox where date will be written by getting prompt's event answer argument. Also, it assigns the Calendar an unique Id.

Parameters
out MarkupOutput where to write Calendar HTML code.

public void renderCalendar (MarkupOutput out, String argument, String calendarArg)

Renders calendar HTML code.
It takes as parameters argument indicating which Textbox to write Dates and unique Id for Calendar denoted by calendarArg.

Parameters
out MarkupOutput where to writhe Calendar HTML code.
argument String Id denoting textbox
calendarArg String Unique Id for Calendar object.

public void renderCalendarForDateField (MarkupOutput out)

Renders calendar HTML code.
This method is used along with renderDateField(MarkupOutput) method.

Parameters
out MarkupOutput where to write Calendar HTML code.

public void renderDateField (MarkupOutput out)

Renders the date field when the time field display is enabled.
This method renders a text box for user to enter the date part of the answer.
JavaScript is used to concatenate the values in the date field and the time field.

Parameters
out MarkupOutput where to write Calendar HTML code.

public void renderInputText (MarkupOutput out)

Renders an HTML input tag to indicate prompt answer.
It'll get answer's argument name for prompt event and create an HTML input tag whose id corresponds to given argument.

Parameters
out MarkupOutput where to write HTML input tag.

public void renderInputText (MarkupOutput out, String argument)

Renders an HTML input tag with ID property set to argument.

Parameters
out MarkupOutput where to write HTML input tag.
argument String input tag ID.

public void renderPromptContent (MarkupOutput out)

Renders the prompt content.

Parameters
out MarkupOutput the transform output

public void renderPromptRestrictions (MarkupOutput out)

Renders the title of the prompt.

Parameters
out MarkupOutput the transform output

public void renderTimeField (MarkupOutput out)

Renders the time field as Hour/Minutes or Hour/Minutes/Seconds
It renders the Hour in 12 Hour and 24 Hour formats and the JavaScript code enables one of them based on the client machines regional settings.
The time separator (mstrweb.4682) is used in display portion as well as for concatenating the hour and minutes for the answer.

Parameters
out MarkupOutput where to write HTML input tag.

Protected Methods

protected String getAnswer ()

Indicates current prompt answer.
Obtain the current String answer given to the prompt or a default one, if defined.

Returns
  • String answer text

protected boolean validData (String value, int dataType)

Validates value corresponds to given datatype.
It checks whether value entered corresponds to datatype in attribute form.

Parameters
value String to be validated
dataType to determine what kind of value is being validated against.
Returns
  • boolean true if data is valid for this prompt type/style