Class Message
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,Component,Ordered,ScriptEventSupport,ContentElement,LifecycleElement,org.springframework.core.Ordered
The Message is used to display static text in the user interface
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptionsFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCodeFields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteValidation(ValidationTrace tracer) Validates different requirements of component compiling a series of reports detailing information on errors found in the component.The inlineComponents are a list of components in order by index.The message component structure is a list of components which represent the components that make up a message when using rich message functionality.Text that makes up the message that will be displayed.Defines the html tag that will wrap this message, if left blank, this will automatically be set by the framework to the appropriate tag (in most cases p or div)booleanTrue if the message contains block elements, or when it contains an unknown tag that may be a block element.booleanIndicates if the inline components must be parsed for rich messagesbooleanisRender()Override to render only if the message text has been given or there is a conditional expression on the message text Indicates whether the component should be rendered in the UIbooleanIf true, render the wrapper element (p or div) around this message (default true).booleanIf this message is considered a rich message (is using some rich message functionality with by using the special [] tags), returns truevoidperformApplyModel(Object model, LifecycleElement parent) Message perform apply model parses message text for rich text functionality if the messageText contains [ or ] special characters The following updates are done here: Evaluate the progressive render condition (if set) and combine with the current render status to set the render status Called after the initialize phase to perform conditional logic based on the model datavoidperformFinalize(Object model, LifecycleElement parent) The following finalization is done here: progressiveRender and conditionalRefresh variables are processed if set If any of the style properties were given, sets the style string on the style property Set the skipInTabOrder flag for nested components The last phase before the view is renderedvoidsetInlineComponents(List<Component> inlineComponents) Set the inlineComponents to be filled in at indexes referenced by [n] in the messagevoidsetMessageComponentStructure(List<Component> messageComponentStructure) Set the message component structure.voidsetMessageText(String messageText) Setter for the message textvoidsetParseComponents(boolean parseComponents) Sets the parse components flag to indicate if inline components must be parsed for rich messagesvoidsetRenderWrapperTag(boolean renderWrapperTag) Sets the generate wrapper element flagvoidsetWrapperTag(String wrapperTag) Methods inherited from class org.kuali.rice.krad.uif.element.ContentElementBase
afterEvaluateExpression, getComponentTypeNameMethods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContainerIdSuffix, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContainerIdSuffix, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setExcludeIf, setExcludeUnless, setFieldsToSendOnRefresh, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOmitFromFormPost, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycleMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.uif.component.Component
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFieldsToSendOnRefresh, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOmitFromFormPost, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyleMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, notifyCompleted, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycleMethods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScriptMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
performApplyModel
Message perform apply model parses message text for rich text functionality if the messageText contains [ or ] special characters The following updates are done here:- Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
- Specified by:
performApplyModelin interfaceLifecycleElement- Overrides:
performApplyModelin classComponentBase- Parameters:
model- - Top level object containing the data (could be the form or a top level business object, dto)parent- parent lifecycle element
-
performFinalize
The following finalization is done here:- progressiveRender and conditionalRefresh variables are processed if set
- If any of the style properties were given, sets the style string on the style property
- Set the skipInTabOrder flag for nested components
Here final preparations can be made based on the updated view state.
- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classComponentBase- Parameters:
model- - top level object containing the dataparent- - parent component
-
isRender
public boolean isRender()Override to render only if the message text has been given or there is a conditional expression on the message text Indicates whether the component should be rendered in the UIIf set to false, the corresponding component template will not be invoked (therefore nothing will be rendered to the UI).
- Specified by:
isRenderin interfaceLifecycleElement- Overrides:
isRenderin classComponentBase- Returns:
- boolean true if the component should be rendered, false if it should not be
-
getMessageText
Text that makes up the message that will be displayed.If special characters [] are detected the message is split at that location. The types of features supported by the parse are (note that <> are not part of the content, they specify placeholders):
- [id=<component id>] - insert component with id specified at that location in the message
- [n] - insert component at index n from the inlineComponent list
- [<html tag>][/<html tag>] - insert html content directly into the message content at that location, without the need to escape the <> characters in xml
- [color=<html color code/name>][/color] - wrap content in color tags to make text that color in the message
- [css=<css classes>][/css] - apply css classes specified to the wrapped content - same as wrapping the content in span with class property set
- [link=<href src>][/link] - an easier way to create an anchor that will open in a new page to the href specified after =
- [action=<href src>][/action] - create an action link inline without having to specify a component by
id or index. The options for this are as follows and MUST be in a comma separated list in the order specified
(specify 1-4 always in this order):
- methodToCall(String)
- validateClientSide(boolean) - true if not set
- ajaxSubmit(boolean) - true if not set
- successCallback(js function or function declaration) - this only works when ajaxSubmit is true
In addition to these settings, you can also specify data to send to the server in this fashion (space is required between settings and data):
[action=<action settings> data={key1: 'value 1', key2: value2}]
If the [] characters are needed in message text, they need to be declared with an escape character: \\[ \\]
- Returns:
- message text
-
setMessageText
Setter for the message text- Parameters:
messageText-
-
getWrapperTag
Defines the html tag that will wrap this message, if left blank, this will automatically be set by the framework to the appropriate tag (in most cases p or div)- Returns:
- the html tag used to wrap this message
-
setWrapperTag
- See Also:
-
isRenderWrapperTag
public boolean isRenderWrapperTag()If true, render the wrapper element (p or div) around this message (default true).The wrapper will be either a p tag, for when the element only contains inline elements, or a div tag, for when the message might contain block level elements or undetermined html tags resulting from rich message functionality. When false, skips the wrapper generation for this message - this has the additional effect the css classes/style classes will be lost for this message.
- Returns:
- true if generating a wrapping span, false otherwise
-
setRenderWrapperTag
public void setRenderWrapperTag(boolean renderWrapperTag) Sets the generate wrapper element flag- Parameters:
renderWrapperTag-
-
getMessageComponentStructure
The message component structure is a list of components which represent the components that make up a message when using rich message functionality.The structure represents the parsed messageText when not set. Normally this structure is setup by the Message class and SHOULD NOT BE SET in xml, unless full control over the structure is needed.
- Returns:
- list of components which represent the message structure
-
setMessageComponentStructure
Set the message component structure. This will override/ignore messageText when set. Normally this SHOULD NOT BE SET by the xml configuration.- Parameters:
messageComponentStructure- list of components which represent the message structure
-
getInlineComponents
@ViewLifecycleRestriction(exclude={"APPLY_MODEL","FINALIZE"}) public List<Component> getInlineComponents()The inlineComponents are a list of components in order by index.inlineComponents is only used when the message is using rich message functionality. A message with [0] will reference component at index 0 of this list and insert it at that place in the message, and likewise [1] will reference item 1, etc. If the index referenced is out of bounds (or list doesn't exist), an error will be thrown during message parse.
- Returns:
- the inlineComponents to be filled in at indexes referenced by [n] in the message
-
setInlineComponents
Set the inlineComponents to be filled in at indexes referenced by [n] in the message- Parameters:
inlineComponents- the inlineComponents to be filled in at indexes referenced by [n] in the message
-
isParseComponents
public boolean isParseComponents()Indicates if the inline components must be parsed for rich messages- Returns:
- boolean
-
setParseComponents
public void setParseComponents(boolean parseComponents) Sets the parse components flag to indicate if inline components must be parsed for rich messages- Parameters:
parseComponents-
-
isRichMessage
public boolean isRichMessage()If this message is considered a rich message (is using some rich message functionality with by using the special [] tags), returns true- Returns:
- return true if this message contains rich message content
-
isContainsBlockElements
public boolean isContainsBlockElements()True if the message contains block elements, or when it contains an unknown tag that may be a block element.- Returns:
- true when the message contains block elements (non-inline elements), false otherwise
-
completeValidation
Validates different requirements of component compiling a series of reports detailing information on errors found in the component. Used by the RiceDictionaryValidator.- Specified by:
completeValidationin interfaceComponent- Overrides:
completeValidationin classComponentBase- Parameters:
tracer- Record of component's location
-