org.opencms.jsp.util
Class CmsJspElFunctions

java.lang.Object
  extended byorg.opencms.jsp.util.CmsJspElFunctions

public final class CmsJspElFunctions
extends java.lang.Object

Provides utility methods to be used as functions from a JSP with the EL.

Since:
7.0.2
Version:
$Revision: 1.5 $
Author:
Alexander Kandzior
See Also:
CmsJspContentAccessBean

Method Summary
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.Locale convertLocale(java.lang.Object input)
          Returns a Locale created from an Object.
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 CmsObject getCmsObject(java.lang.Object input)
          Returns the current OpenCms user context from the given page context.
static CmsJspVfsAccessBean getVfsAccessBean(java.lang.Object input)
          Returns a JSP / EL VFS access bean.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertCmsObject

public static CmsObject convertCmsObject(java.lang.Object input)
Returns an OpenCms user context created from an Object.

Parameters:
input - the input to create an OpenCms user context from
Returns:
an OpenCms user context created from an Object

convertDate

public static java.util.Date convertDate(java.lang.Object input)
Returns a Date created from an Object.

Parameters:
input - the Object to create a Date from
Returns:
a Date created from the given Object

convertLocale

public static java.util.Locale convertLocale(java.lang.Object input)
Returns a Locale created from an Object.

Parameters:
input - the Object to create a Locale from
Returns:
a Locale created from the given Object

convertResource

public static CmsResource convertResource(CmsObject cms,
                                          java.lang.Object input)
                                   throws CmsException
Returns a resource created from an Object.

Parameters:
cms - the current OpenCms user context
input - the input to create a resource from
Returns:
a resource created from the given Object
Throws:
CmsException - in case of errors accessing the OpenCms VFS for reading the resource

convertUUID

public static CmsUUID convertUUID(java.lang.Object input)
Returns a CmsUUID created from an Object.

Parameters:
input - the Object to create a CmsUUID from
Returns:
a CmsUUID created from the given Object

getCmsObject

public static CmsObject getCmsObject(java.lang.Object input)
Returns the current OpenCms user context from the given page context.

Parameters:
input - the input to create a CmsObject from
Returns:
the current OpenCms user context from the given page context

getVfsAccessBean

public static CmsJspVfsAccessBean getVfsAccessBean(java.lang.Object input)
Returns a JSP / EL VFS access bean.

Parameters:
input - the Object to create a CmsObject from
Returns:
a JSP / EL VFS access bean

stripHtml

public static java.lang.String stripHtml(java.lang.Object input)
Strips all HTML markup from the given input.

Parameters:
input - the input to Strip from HTML
Returns:
the given input with all HTML stripped.

trimToSize

public static java.lang.String trimToSize(java.lang.String input,
                                          int length)
Returns a substring of the source, which is at most length characters long.

If a char is cut, " ..." is appended to the result.

Parameters:
input - the string to trim
length - the maximum length of the string to be returned
Returns:
a substring of the source, which is at most length characters long
See Also:
CmsStringUtil.trimToSize(String, int, String)