|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.gx.webmanager.taglib.FunctionLibrary
public class FunctionLibrary
Implements the wmfn taglibrary functions. The functions may be used in the expressionlanguage used in jsp
pages.
Usage: ${wmfn:function(arg0, ...)}
Example of usage:
< script type="text/javascript" >
alert('page title is ${wmfn:escapeToJavascript(pageVersion.title)}');
< /script >
| Field Summary | |
|---|---|
static java.lang.String |
literalEndTag
|
static java.lang.String |
literalStartTag
|
| Method Summary | |
|---|---|
static java.lang.String |
addLineFeed()
Get a line feed (usually line feeds in JSP pages are ignored). |
static boolean |
contains(java.lang.Object instance,
java.lang.Object[] array)
Return true if the array contains the instance. |
static java.lang.String |
convertToJavaScript(java.lang.String value)
Convert html code to javascript document.write statements. |
static java.lang.String |
convertToNmtoken(java.lang.String source)
Converts a given source String to a valid nmtoken. |
static java.lang.String |
escapeToJavaScript(java.lang.String value)
Replace \\ by \\\\ and ' by \\' in a string so that it can be used in a javascript. |
static java.lang.String |
escapeToText(java.lang.String value)
Surround the text part by a <pre> tag so that we know while processing that this part should be taken literally and so that line feeds should be preserved. |
static java.lang.String |
formatExternalUrl(java.lang.String value)
Returns the value prepended with "http://", unless it starts with "mailto:", "javascript:", "/", "#" or if it matches against the "[A-Za-z]*://.*" pattern using a regular expression. |
static java.lang.String |
formSignatureParameterName(javax.servlet.ServletContext context)
Get the name of the secure form request parameter If secure forms are turned on, then this function will return the name of the form parameter which should be used for sending the form signature. |
static int |
indexOf(java.lang.Object instance,
java.lang.Object[] array)
Returns the index of the object in the array or -1 if the array doesn't contain the object. |
static boolean |
instanceOf(java.lang.Object instance,
java.lang.String className)
More flexible instanceOf implementation than te built-in Java instanceof operator. |
static java.util.Map<java.lang.Object,java.lang.Object> |
putAll(java.util.Map<java.lang.Object,java.lang.Object> initialMap,
java.util.Map<java.lang.Object,java.lang.Object> additionalMap)
Copies all of the mappings from the additional map to the initial map. |
static java.util.Map<java.lang.String,java.lang.Object> |
putAllIgnoreCase(java.util.Map<java.lang.String,java.lang.Object> initialMap,
java.util.Map<java.lang.String,java.lang.Object> additionalMap)
Copies all of the mappings from the additional map to the initial map. |
static java.lang.String |
replaceNewLines(java.lang.String value)
Replace new lines by <br />. |
static java.lang.String |
signForm(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String html)
Add a secure form signature to a fragment of HTML |
static java.lang.String |
signFormParameters(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String[] names)
Computes a signature for a set of names for the use of secureforms in SiteWorks. |
static java.lang.String |
signFragment(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String source)
Generate a secure forms signature for the given HTML fragment |
static java.util.SortedMap[] |
sortMaps(java.util.SortedMap[] rows,
java.lang.String key,
boolean ascending)
Sorts an array of SortedMaps by the elements at a specified key. |
static java.lang.Object[][] |
sortRows(java.lang.Object[][] rows,
int column,
boolean ascending)
Sorts a two dimensional array (an array of arrays) by the objects in a column. |
static java.lang.Object[] |
subArray(java.lang.Object[] rows,
int from,
int to)
Returns a sub array of the original array. |
static java.lang.String |
urlEncode(java.lang.String s)
Url encode an utf-8 string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String literalStartTag
public static final java.lang.String literalEndTag
| Method Detail |
|---|
public static java.lang.Object[] subArray(java.lang.Object[] rows,
int from,
int to)
rows - The original array.from - The index of the first element in the resulting array.to - The index of the last element in the resulting array.
from to
index to.
public static java.lang.Object[][] sortRows(java.lang.Object[][] rows,
int column,
boolean ascending)
rows - The array that should be sorted.column - The column index for comparing rows.ascending - Indicates whether the sort order is ascending or descending.
public static java.lang.String urlEncode(java.lang.String s)
s - the original string.
public static java.util.SortedMap[] sortMaps(java.util.SortedMap[] rows,
java.lang.String key,
boolean ascending)
rows - The array that should be sorted.key - The key for the elements that should be used for comparing rows.ascending - Indicates whether the sort order is ascending or descending.
key.
public static boolean contains(java.lang.Object instance,
java.lang.Object[] array)
instance - an objectarray - an array of objects
public static int indexOf(java.lang.Object instance,
java.lang.Object[] array)
instance - an objectarray - an array of objects
public static boolean instanceOf(java.lang.Object instance,
java.lang.String className)
instance - className -
true if instance is of type className,public static java.lang.String escapeToJavaScript(java.lang.String value)
value -
public static java.lang.String replaceNewLines(java.lang.String value)
value -
public static java.lang.String escapeToText(java.lang.String value)
value - The string to be escaped
public static java.lang.String addLineFeed()
<pre>\r\n</pre>public static java.lang.String convertToJavaScript(java.lang.String value)
value - Usually some HTML fragment that needs to be written in the document
public static final java.lang.String convertToNmtoken(java.lang.String source)
source - the source String
public static java.lang.String formatExternalUrl(java.lang.String value)
value - The external url which may or may not start with a protocol.
public static java.lang.String signFragment(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String source)
context - Current ServletContext object.request - Current HttpServletRequest object.source - HTML fragment containing HTML INPUT tags.
public static java.lang.String signFormParameters(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String[] names)
context - Current ServletContext object.request - Current HttpServletRequest object.names - The names of the inputs
"" if an exception occurred.public static java.lang.String formSignatureParameterName(javax.servlet.ServletContext context)
context - Current ServletContext object.
public static java.lang.String signForm(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
java.lang.String html)
throws SignException
context - The current ServletContext object. From JSP this will typicall be
"pageContext.servletContext".request - The current HttpServletRequest object .From JSP this will typically be
"pageContext.request".html - The fragment of HTML to sign. This code should contain
SignException
public static java.util.Map<java.lang.Object,java.lang.Object> putAll(java.util.Map<java.lang.Object,java.lang.Object> initialMap,
java.util.Map<java.lang.Object,java.lang.Object> additionalMap)
initialMap - Initial map.additionalMap - Mappings to be stored in the initial map.
Map#putAll(Map)}.
public static java.util.Map<java.lang.String,java.lang.Object> putAllIgnoreCase(java.util.Map<java.lang.String,java.lang.Object> initialMap,
java.util.Map<java.lang.String,java.lang.Object> additionalMap)
keyOne.equalsIgnoreCase(keyTwo) is true.
initialMap - Initial map.additionalMap - Mappings to be stored in the initial map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||