org.kuali.rice.krad.uif.util
Class MessageStructureUtils

java.lang.Object
  extended by org.kuali.rice.krad.uif.util.MessageStructureUtils

public class MessageStructureUtils
extends Object

Rich message structure utilities for parsing message content and converting it to components/content

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
MessageStructureUtils()
           
 
Method Summary
static String addBlanks(String text)
          Inserts   into the string passed in, if spaces exist at the beginning and/or end, so spacing is not lost in html translation.
static List<Component> parseMessage(String messageId, String messageText, List<Component> componentList, View view, boolean parseComponents)
          Parses the message text passed in and returns the resulting rich message component structure.
static String translateStringMessage(String messageText)
          Translate a message with special hooks described in MessageStructureUtils.parseMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageStructureUtils

public MessageStructureUtils()
Method Detail

translateStringMessage

public static String translateStringMessage(String messageText)
Translate a message with special hooks described in MessageStructureUtils.parseMessage. However, tags which reference components will not be allowed/translated - only tags which can translate to string content will be included for this translation.

Parameters:
messageText - messageText with only String translateable tags included (no id or component index tags)
Returns:
html translation of rich messageText passed in
See Also:
parseMessage(java.lang.String, java.lang.String, java.util.List, org.kuali.rice.krad.uif.view.View, boolean)

parseMessage

public static List<Component> parseMessage(String messageId,
                                           String messageText,
                                           List<Component> componentList,
                                           View view,
                                           boolean parseComponents)
Parses the message text passed in and returns the resulting rich message component structure.

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):

If the [] characters are needed in message text, they need to be declared with an escape character: \\[ \\]

Parameters:
messageId - id of the message
messageText - message text to be parsed
componentList - the inlineComponent list
view - the current view
Returns:
list of components representing the parsed message structure

addBlanks

public static String addBlanks(String text)
Inserts &nbsp; into the string passed in, if spaces exist at the beginning and/or end, so spacing is not lost in html translation.

Parameters:
text - string to insert &nbsp;
Returns:
String with &nbsp; inserted, if applicable


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.