Class PromptConstantTransform
- 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
-
- All Implemented Interfaces:
EnumPromptsBeanEvents
,LayoutTransform
,Transform
public class PromptConstantTransform extends AbstractPromptObjectTransform implements LayoutTransform
User must type the answer using a textbox. This style also supports date prompts.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description FormalParameter
displayDynamicDateAsStatic
Enforces application to display the dynamic date as a static date.FormalParameter
markDefaultAnswerAsComplex
Enforces application to mark given default answer, if exists, as complex.static int
TIME_FORMAT_HOUR_MINUTES
Value for formal parametertimeFieldFormat
to indicate that time display contains hours and minutes.static int
TIME_FORMAT_HOUR_MINUTES_SECONDS
Value for formal parametertimeFieldFormat
to indicate that time display contains hours, minutes and seconds.static int
TIME_FORMAT_NONE
Value for formal parametertimeFieldFormat
to indicate that there is no time displayFormalParameter
timeFieldFormat
This formal parameter specifies the format of the time field in DHTML mode.-
Fields inherited from class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
_blockCount, _calendar, _cssPrefix, _dataTypeForCalendar, _globalCss, _imagesFolder, cssPrefix, imgBackToTop, imgCalendar, imgError, isDhtmlMode, levelFlag, showRequired
-
Fields inherited from interface com.microstrategy.web.beans.EnumPromptsBeanEvents
ANSWER_SEPARATOR, EXPRESSION_SEPARATOR, ITEM_SEPARATOR, ITEM_SPECIAL_SEPARATOR, PROMPTS_EVENT_ADD_UNITS, PROMPTS_EVENT_ANSWER_ALL_PROMPTS, PROMPTS_EVENT_ANSWER_ANY_PROMPTS, PROMPTS_EVENT_ANSWER_CONSTANT_PROMPT, PROMPTS_EVENT_ANSWER_DIMTY_PROMPT, PROMPTS_EVENT_ANSWER_ELEMENTS_PROMPT, PROMPTS_EVENT_ANSWER_EXPRESSION_PROMPT, PROMPTS_EVENT_ANSWER_OBJECTS_PROMPT, PROMPTS_EVENT_ANSWER_PROMPTS_IN_ADVANCE, PROMPTS_EVENT_ARGUMENT_ACTION_ADD_UNITS, PROMPTS_EVENT_ARGUMENT_ACTION_ANSWER_PROMPT, PROMPTS_EVENT_ARGUMENT_ACTION_BROWSE_CHILD_FOLDER, PROMPTS_EVENT_ARGUMENT_ACTION_BROWSE_ELEMENT, PROMPTS_EVENT_ARGUMENT_ACTION_BROWSE_PARENT_FOLDER, PROMPTS_EVENT_ARGUMENT_ACTION_CANCEL_PROMPT, PROMPTS_EVENT_ARGUMENT_ACTION_CLEAR_EXISTING_AND_ADD_UNITS, PROMPTS_EVENT_ARGUMENT_ACTION_DRILL_WITHIN_HIERARCHY, PROMPTS_EVENT_ARGUMENT_ACTION_HIGHLIGHT_DIMENSION, PROMPTS_EVENT_ARGUMENT_ACTION_HIGHLIGHT_DIMENSION_ATTRIBUTE, PROMPTS_EVENT_ARGUMENT_ACTION_INCREMENTAL_FETCH, PROMPTS_EVENT_ARGUMENT_ACTION_REMOVE_UNITS, PROMPTS_EVENT_ARGUMENT_ACTION_SEARCH_BY_NAME, PROMPTS_EVENT_ARGUMENT_ACTION_SHOW_SUMMARY, PROMPTS_EVENT_ARGUMENT_ANSWER, PROMPTS_EVENT_ARGUMENT_ANSWER_FORMAT, PROMPTS_EVENT_ARGUMENT_ANSWER_MODE_OPTION, PROMPTS_EVENT_ARGUMENT_ANSWER_OPTIONS, PROMPTS_EVENT_ARGUMENT_ATTRIBUTE_ID, PROMPTS_EVENT_ARGUMENT_ATTRIBUTE_ID_AND_FORM_ID, PROMPTS_EVENT_ARGUMENT_BLOCK_BEGIN, PROMPTS_EVENT_ARGUMENT_BLOCK_COUNT, PROMPTS_EVENT_ARGUMENT_BROWSE_PATH, PROMPTS_EVENT_ARGUMENT_CALENDAR_BUTTON, PROMPTS_EVENT_ARGUMENT_CHILD_FOLDER_ID, PROMPTS_EVENT_ARGUMENT_DIMENSION_ID, PROMPTS_EVENT_ARGUMENT_DO_NOT_AUTO_REPROMPT, PROMPTS_EVENT_ARGUMENT_DRILL_TO_ATTRIBUTE_ID, PROMPTS_EVENT_ARGUMENT_EXEC_FLAGS, PROMPTS_EVENT_ARGUMENT_FILTER_STRING, PROMPTS_EVENT_ARGUMENT_FUNCTION, PROMPTS_EVENT_ARGUMENT_HIDDEN_ATTRIBUTE_ID, PROMPTS_EVENT_ARGUMENT_HIDDEN_DIMENSION_ID, PROMPTS_EVENT_ARGUMENT_INCREMENTAL_FETCH_GOTO_PAGE, PROMPTS_EVENT_ARGUMENT_LINK_ANSWERS, PROMPTS_EVENT_ARGUMENT_MATCH_CASE, PROMPTS_EVENT_ARGUMENT_MESSAGE_ALIAS, PROMPTS_EVENT_ARGUMENT_METRIC_ID, PROMPTS_EVENT_ARGUMENT_NAVIGATION, PROMPTS_EVENT_ARGUMENT_OBJECT_TYPE, PROMPTS_EVENT_ARGUMENT_ORIGIN_MESSAGE_ID, PROMPTS_EVENT_ARGUMENT_ORIGIN_SHORT_ANSWER_XML, PROMPTS_EVENT_ARGUMENT_PARENT_FOLDER_ID, PROMPTS_EVENT_ARGUMENT_PLAIN_ELEMENT_PROMPT_ANSWER, PROMPTS_EVENT_ARGUMENT_PLAIN_OBJECT_PROMPT_ANSWER, PROMPTS_EVENT_ARGUMENT_PLAIN_VALUE_PROMPT_ANSWER, PROMPTS_EVENT_ARGUMENT_PROMPT_POSITION, PROMPTS_EVENT_ARGUMENT_REOPEN_PROMPT, PROMPTS_EVENT_ARGUMENT_SAP_VARIABLE_EXCLUDE, PROMPTS_EVENT_ARGUMENT_SEARCH_NAME, PROMPTS_EVENT_ARGUMENT_SEARCH_ROOT, PROMPTS_EVENT_ARGUMENT_SRC_ANSWERS, PROMPTS_EVENT_ARGUMENT_SUB_ROOT_OPERATOR, PROMPTS_EVENT_ARGUMENT_SUBMIT_ANSWER, PROMPTS_EVENT_ARGUMENT_UNITS_TO_ADD, PROMPTS_EVENT_ARGUMENT_UNITS_TO_REMOVE, PROMPTS_EVENT_ARGUMENT_USE_SET_ANSWERS, PROMPTS_EVENT_ARGUMENT_USER_SEPARATOR, PROMPTS_EVENT_BROWSE_DIMENSION_ATTRIBUTE_ELEMENTS, PROMPTS_EVENT_BROWSE_ELEMENTS, PROMPTS_EVENT_BROWSE_HIERARCHICAL_CHILD_FOLDER, PROMPTS_EVENT_BROWSE_HIERARCHICAL_PARENT_FOLDER, PROMPTS_EVENT_CANCEL_ALL_PROMPTS, PROMPTS_EVENT_CANCEL_ANY_PROMPTS, PROMPTS_EVENT_CLEAR_EXISTING_AND_ADD_UNITS, PROMPTS_EVENT_CLEAR_HIERARCHICAL_SEARCH_EXPRESSION, PROMPTS_EVENT_DRILL_WITHIN_HIERARCHY, PROMPTS_EVENT_HIGHLIGHT_DIMENSION, PROMPTS_EVENT_HIGHLIGHT_DIMENSION_ATTRIBUTE, PROMPTS_EVENT_INCREMENTAL_FETCH, PROMPTS_EVENT_NAVIGATE_PROMPTS_BEAN, PROMPTS_EVENT_PROCESS_ALL_PROMPTS, PROMPTS_EVENT_PROCESS_ANY_PROMPTS, PROMPTS_EVENT_REMOVE_UNITS, PROMPTS_EVENT_SEARCH_BY_NAME, PROMPTS_EVENT_SHOW_ALL_PROMPTS_SUMMARY, PROMPTS_EVENT_SHOW_ANY_PROMPTS_SUMMARY, SIMPLE_SEPARATOR_CARET, SIMPLE_SEPARATOR_COMMA, SIMPLE_SEPARATOR_SEMICOLON, UNIT_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description PromptConstantTransform()
Default no-args constructor, initialize all the formal parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected java.lang.String
getAnswer()
Indicates current prompt answer.java.lang.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, java.lang.String argument, java.lang.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, java.lang.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.
The time separator (mstrweb.4682) is used in display portion as well as for concatenating the hour and minutes for the answer.protected boolean
validData(java.lang.String value, int dataType)
Validates value corresponds to given datatype.-
Methods inherited from class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
addFormalParameter, arePromptsLoadedFirstTime, checkLevel, getAnswerEvent, getArgumentName, getAttrElemBlockCount, getAvailableDisplayUnits, getCalendar, getContainerServices, getDescriptor, getDescriptor, getDescriptor, getDimensionAttribute, getDisplayHelper, getErrorMessage, getIntValue, getLocale, getMatchCaseSensitivity, getMultipleEvent, getMultipleEventArgumentString, getObjectsBlockCount, getPrompt, getPromptsAppContext, getPromptsBean, getPromptsList, getRequestKeys, getShowRequired, getStringValue, getSupportedBeanType, getTagsFactory, hasAnswer, initializeImages, initializePromptObject, isBackToTopAnchorEnabled, isDhtmlMode, isDimensionalPrompt, isForDefinition, isIFrameRequest, isItemKeptInCartAvailable, isLocked, isLockedForSearch, isNodeComplex, isPromptObjectInitialized, isPromptRequired, isPromptSummaryEnabled, isTrue, isXDA_CustomSQL_Report, isXDA_MDX_Report, isXDAReport, newHiddenInputBuilder, newNamespaceEncoder, onBeforeApplyDefaultDisplaySettings, processAvailableItems, processIncrementalFetch, renderLayout, renderMinMaxHiddenValues, renderPromptAnswerMeaning, renderPromptBackToTopAnchor, renderPromptDefaultAnswer, renderPromptErrorMessage, renderPromptHiddenInputs, renderPromptIFrameRequest, renderPromptMeaning, renderPromptNoSelectionsAvailable, renderPromptNotAnswered, renderPromptQuestion, renderPromptSummary, renderPromptSummaryAnswer, renderPromptSummaryTitle, renderPromptTitle, setArgumentValue, setAttrElemBlockCount, setEnableBackToTopAnchor, setExtraArguments, setIsItemKeptInCartAvailable, setLevelFlag, setLocale, setMatchCaseSensitivity, setObjectsBlockCount, setPromptSummary, setShowRequired, transform
-
Methods inherited from class com.microstrategy.web.transform.AbstractLayoutTransform
getLayoutContext, getLayoutDefinition, setLayoutDefinition, transformUsingLayout
-
Methods inherited from class com.microstrategy.web.transform.AbstractTransform
addFormalParam, getEvents, getFormalParams, getID, getPreview, isPreviewAvailable, isResolved, removeFormalParam, setAnnotation, setDeprecated, supports, supports
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.transform.LayoutTransform
getLayoutDefinition, setLayoutDefinition
-
Methods inherited from interface com.microstrategy.web.transform.Transform
getFormalParams, getID, getPreview, getSupportedBeanType, isPreviewAvailable, isResolved, supports, supports, transform
-
-
-
-
Field Detail
-
markDefaultAnswerAsComplex
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.
-
displayDynamicDateAsStatic
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.- Since:
- MicroStrategy Web 8.0.2
-
timeFieldFormat
public FormalParameter timeFieldFormat
This formal parameter specifies the format of the time field in DHTML mode.
The values can be one of the followingTIME_FORMAT_NONE
- Do not display time (default value).TIME_FORMAT_HOUR_MINUTES
- Display Hour and Minutes.TIME_FORMAT_HOUR_MINUTES_SECONDS
- Display Hour,Minutes and Seconds.
- Since:
- MicroStrategy Web 8.0.2
-
TIME_FORMAT_NONE
public static final int TIME_FORMAT_NONE
Value for formal parametertimeFieldFormat
to indicate that there is no time display- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
TIME_FORMAT_HOUR_MINUTES
public static final int TIME_FORMAT_HOUR_MINUTES
Value for formal parametertimeFieldFormat
to indicate that time display contains hours and minutes.- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
TIME_FORMAT_HOUR_MINUTES_SECONDS
public static final int TIME_FORMAT_HOUR_MINUTES_SECONDS
Value for formal parametertimeFieldFormat
to indicate that time display contains hours, minutes and seconds.- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
initializeCss
public void initializeCss()
Initializes CSS information to be used by this transform.- Overrides:
initializeCss
in classAbstractPromptObjectTransform
- Since:
- MicroStrategy Web 8.0.0
-
initializePromptContent
public void initializePromptContent() throws WebObjectsException
Initializes the objects the Prompt will use to render its content.
This method internally callsgetAnswer
.- Overrides:
initializePromptContent
in classAbstractPromptObjectTransform
- Throws:
WebObjectsException
- if something goes wrong when initializing prompt.
-
isAnswerComplex
public boolean isAnswerComplex()
Indicates whether or not current answer is complex or not.
It is complex if answer type is unknown.- Specified by:
isAnswerComplex
in classAbstractPromptObjectTransform
- Returns:
- boolean true if Prompt's answer is considered as complex.
-
canTransform
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 typeEnumWebPromptType.WebPromptTypeConstant
.- Specified by:
canTransform
in interfaceTransform
- Overrides:
canTransform
in classAbstractTransform
- Parameters:
data
-PromptObject
instance to transform- Returns:
- true if the data is of type
EnumWebPromptType.WebPromptTypeConstant
.
-
areThereAvailableSelections
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.- Overrides:
areThereAvailableSelections
in classAbstractPromptObjectTransform
- Returns:
- boolean true if available selection is greater than 0
-
getAnswer
protected java.lang.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
-
getDescription
public java.lang.String getDescription()
Indicates this transform's description.- Specified by:
getDescription
in interfaceTransform
- Returns:
- the description of a constant answer.
-
renderPromptContent
public void renderPromptContent(MarkupOutput out)
Renders the prompt content.- Overrides:
renderPromptContent
in classAbstractPromptObjectTransform
- Parameters:
out
-MarkupOutput
the transform output
-
renderDateField
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.- Since:
- MicroStrategy Web 8.0.2
-
renderInputText
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.- Since:
- MicroStrategy Web 8.0.0
-
renderInputText
public void renderInputText(MarkupOutput out, java.lang.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.- Since:
- MicroStrategy Web 8.0.0
-
renderTimeField
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.- Since:
- MicroStrategy Web 8.0.2
-
renderCalendar
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.- Since:
- MicroStrategy Web 8.0.0
-
renderCalendarForDateField
public void renderCalendarForDateField(MarkupOutput out)
Renders calendar HTML code.
This method is used along withrenderDateField(MarkupOutput)
method.- Parameters:
out
- MarkupOutput where to write Calendar HTML code.- Since:
- MicroStrategy Web 8.0.2
-
renderCalendar
public void renderCalendar(MarkupOutput out, java.lang.String argument, java.lang.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 textboxcalendarArg
- String Unique Id for Calendar object.- Since:
- MicroStrategy Web 8.0.0
-
renderPromptRestrictions
public void renderPromptRestrictions(MarkupOutput out)
Renders the title of the prompt.- Overrides:
renderPromptRestrictions
in classAbstractPromptObjectTransform
- Parameters:
out
-MarkupOutput
the transform output
-
isDisplayTimeEnabled
public boolean isDisplayTimeEnabled()
Returns true if the Time field needs to be displayed.
This is based on the value of the FormalParametertimeFieldFormat
and also on the data type of the constant prompt.- Since:
- MicroStrategy Web 8.0.2
-
validData
protected boolean validData(java.lang.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 validateddataType
- to determine what kind of value is being validated against.- Returns:
- boolean true if data is valid for this prompt type/style
-
-