public final class CmsJspElFunctions
extends java.lang.Object
CmsJspContentAccessBean| 限定符和类型 | 方法和说明 |
|---|---|
static CmsObject |
convertCmsObject(java.lang.Object input)
Returns an OpenCms user context created from an Object.
|
static java.util.Date |
convertDate(java.lang.Object input)
Returns a Date created from an Object.
|
static java.util.List<java.lang.Object> |
convertList(java.util.List<java.lang.Object> input,
java.lang.String attributeName)
Returns a list of attribute values specified by the attribute name of the items of the given list.
|
static java.util.Locale |
convertLocale(java.lang.Object input)
Returns a Locale created from an Object.
|
static javax.servlet.ServletRequest |
convertRequest(java.lang.Object input)
Tries to convert the given input object into a request.
|
static CmsResource |
convertResource(CmsObject cms,
java.lang.Object input)
Returns a resource created from an Object.
|
static CmsUUID |
convertUUID(java.lang.Object input)
Returns a CmsUUID created from an Object.
|
static java.lang.String |
escape(java.lang.String source,
java.lang.String encoding)
Encodes a String in a way that is compatible with the JavaScript escape function.
|
static CmsObject |
getCmsObject(java.lang.Object input)
Returns the current OpenCms user context from the given page context.
|
static java.lang.Integer |
getListSize(java.util.List<java.lang.Object> input)
Returns the size of the given list.
|
static java.lang.String |
getNavigationUri(java.lang.Object input)
Returns the current navigation URI.
|
static java.lang.String |
getRequestLink(java.lang.String url)
Returns the link without parameters from a String that is formatted for a GET request.
|
static java.lang.String |
getRequestParam(java.lang.String url,
java.lang.String paramName)
Returns the value of a parameter from a String that is formatted for a GET request.
|
static CmsJspVfsAccessBean |
getVfsAccessBean(java.lang.Object input)
Returns a JSP / EL VFS access bean.
|
static java.lang.String |
lookup(java.lang.String key,
java.lang.String map)
Looks up the given key from the map that is passed as a String, and returns either the
element found or the empty String.
|
static java.lang.String |
lookup(java.lang.String key,
java.lang.String map,
java.lang.String defaultValue)
Looks up the given key from the map that is passed as a String, and returns either the
element found or the default value.
|
static java.lang.String |
stripHtml(java.lang.Object input)
Strips all HTML markup from the given input.
|
static java.lang.String |
trimToSize(java.lang.String input,
int length)
Returns a substring of the source, which is at most length characters long.
|
static java.lang.String |
unescape(java.lang.String source,
java.lang.String encoding)
Decodes a String in a way that is compatible with the JavaScript
unescape function.
|
public static CmsObject convertCmsObject(java.lang.Object input)
CmsObject, it is casted and returned unchanged.
ServletRequest, the OpenCms user context is read from the request context.
PageContext, the OpenCms user context is read from the request of the page context.
input - the input to create an OpenCms user context frompublic static java.util.Date convertDate(java.lang.Object input)
Date already, if so it is casted and returned unchanged.
Long, and if so the Date is created from the Long value.
input - the Object to create a Date frompublic static java.util.List<java.lang.Object> convertList(java.util.List<java.lang.Object> input,
java.lang.String attributeName)
input - the list of objects to obtain the attribute values fromattributeName - the name of the attribute to obtainpublic static java.util.Locale convertLocale(java.lang.Object input)
Locale already, if so it is casted and returned.
input - the Object to create a Locale frompublic static javax.servlet.ServletRequest convertRequest(java.lang.Object input)
This is only possible if the input object is already a request or if it is a page context.
If everything else, this method returns null.
input - the input object to convert to a requestnullpublic static CmsResource convertResource(CmsObject cms, java.lang.Object input) throws CmsException
CmsResource, it is casted to the resource and returned unchanged.
CmsUUID, the given OpenCms context is used to read a resource with
this UUID from the VFS.
cms - the current OpenCms user contextinput - the input to create a resource fromCmsException - in case of errors accessing the OpenCms VFS for reading the resourcepublic static CmsUUID convertUUID(java.lang.Object input)
input - the Object to create a CmsUUID frompublic static java.lang.String escape(java.lang.String source,
java.lang.String encoding)
source - The text to be encodedencoding - the encoding typepublic static CmsObject getCmsObject(java.lang.Object input)
input - the input to create a CmsObject frompublic static java.lang.Integer getListSize(java.util.List<java.lang.Object> input)
input - the list of objects to obtain the size frompublic static java.lang.String getNavigationUri(java.lang.Object input)
Which can be the request URI or the VFS resource URI.
In case a sitemap is used, the navigation URI will be the request URI, if not the VFS resource URI is returned.
input - the request convertible object to get the navigation URI frompublic static java.lang.String getRequestLink(java.lang.String url)
url - the URL to remove the parameters frompublic static java.lang.String getRequestParam(java.lang.String url,
java.lang.String paramName)
url - the URL to get the parameter value fromparamName - the request parameter namepublic static CmsJspVfsAccessBean getVfsAccessBean(java.lang.Object input)
input - the Object to create a CmsObject frompublic static java.lang.String lookup(java.lang.String key,
java.lang.String map)
The map String must have the form "key1:value1|key2:value2" etc.
key - the key to look upmap - the map represented as a Stringpublic static java.lang.String lookup(java.lang.String key,
java.lang.String map,
java.lang.String defaultValue)
The map String must have the form "key1:value1|key2:value2" etc.
key - the key to look upmap - the map represented as a StringdefaultValue - the default valuepublic static java.lang.String stripHtml(java.lang.Object input)
CmsJspContentAccessValueWrapper, an optimized
method is used for the HTML stripping.
input - the input to Strip from HTMLpublic static java.lang.String trimToSize(java.lang.String input,
int length)
If a char is cut, " ..." is appended to the result.
input - the string to trimlength - the maximum length of the string to be returnedCmsStringUtil.trimToSize(String, int, String)public static java.lang.String unescape(java.lang.String source,
java.lang.String encoding)
source - The String to be decodedencoding - the encoding type