public class RhnTagFunctions
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Boolean |
arrayContains(java.lang.String[] array,
java.lang.String string)
Checks to see if an array of Strings contains any element that .equals()
the given String
|
static java.lang.String |
arrayToString(java.lang.String[] array)
Joins an array of Strings into a comma-separated String
|
static java.lang.String |
escapeJS(java.lang.String param)
Escape the characters in a String using JavaScript String rules.
|
static java.lang.String |
getConfig(java.lang.String confIn)
Fetch a value from our Configuration system.
|
static java.lang.String |
localizedValue(java.lang.String messageId)
Provides the i18n'ed string for the given messageId.
|
static java.lang.String |
localizedValue(java.lang.String messageId,
java.lang.String params)
This method is a variation of the the localizedValue(key) method
This is exclusively used by the el expressions in
various jsp pages.
|
static java.lang.String |
localizedValueAnd2ndParam(java.lang.String messageId,
java.lang.String param1,
java.lang.String param2)
This method translates the message together with the 2nd parameter
|
static java.lang.String |
localizedValueAndParams(java.lang.String messageId,
java.lang.String params)
This method is translates the message together with all the parameters
|
static java.lang.String |
urlEncode(java.lang.String param)
Encode a urlEncode a param
|
public static java.lang.String arrayToString(java.lang.String[] array)
array - The array of Strings to joinpublic static java.lang.Boolean arrayContains(java.lang.String[] array,
java.lang.String string)
array - The array of Strings to checkstring - The string to look for in the arraypublic static java.lang.String getConfig(java.lang.String confIn)
confIn - configuration value you are searching forpublic static java.lang.String localizedValue(java.lang.String messageId)
<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> to the top of your jsp page
The you can say
${rhn:localize("rhn.foo.bar")} to get the localized value
messageId - the message id to localize onpublic static java.lang.String localizedValue(java.lang.String messageId,
java.lang.String params)
<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> to the top of your jsp page
The you can say
${rhn:localizeWithParams("rhn.foo.bar","param0|param1")} to get the localized value The method parameter 'param' takes a list of key parameters seperated by a '|'. It is rather unfortunate for it to take a '|' instead of taking a String[] as params.. This is because we donot know a way of creating arrays as el expressions...
messageId - the message id to localize onparams - a list of values separated by '|', or null...public static java.lang.String localizedValueAndParams(java.lang.String messageId,
java.lang.String params)
messageId - the message id to localize onparams - a list of values separated by '|', or null...public static java.lang.String localizedValueAnd2ndParam(java.lang.String messageId,
java.lang.String param1,
java.lang.String param2)
messageId - massage idparam1 - regular paramparam2 - param to localizepublic static java.lang.String urlEncode(java.lang.String param)
param - to be url encodedpublic static java.lang.String escapeJS(java.lang.String param)
param - to be escaped