| |||||||
FRAMES NO FRAMES |
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<anyxmlelement xmlns:cms="http://www.opencms.org/taglib/cms" />
The OpenCms / JSP integration tag library
Used by OpenCms, the Open Source Content Management System.
(c) Alkacon Software GmbH & Co. KG For more details about OpenCms, please see http://www.opencms.org/. For more details about Alkacon Software GmbH, please see http://www.alkacon.com/.
Tag Library Information | |
Display Name | OpenCms JSP standard taglib |
Version | 1.1 |
Short Name | cms |
URI | http://www.opencms.org/taglib/cms |
Tag Summary | |
bundle | Loads a resource bundle to be used by its tag body. Replaces the You can use |
setBundle | Loads a resource bundle and stores it in the named scoped variable or the bundle configuration variable. Like <fmt:setBundle>, but using OpenCms' bundle loader mechanism. |
property | This tag enables read access to a file's OpenCms properties. |
user | This tag enables access to the properties of the currently logged in user. |
info | This tag enables access to some system information like OpenCms version etc. |
link | The tag adjusts the links to the OpenCms VFS provided in the tag's body (including request parameters). Links MUST be adjusted to work correctly, because resources might be statically exported and also absolute pathes to resources that are not exported must be extended by the prefix "/{webapp name}/opencms". Example: |
This tag can be used for PDF generation. The primary use case is the PDF output of a specific content. It expands to a link for a PDF which is generated on the fly when the link is requested. The PDF is generated from an XHTML document via the Java library "Flying Saucer". | |
pdfthumbnail | This tag is used to generate a png or jpg thumbnail from a PDF and expands to a link to the thumbnail. The thumbnail is created when the link is requested for the first time. |
ugc | Initializes a user generated content form session. |
decorate | This tag is used to decorate HTML. The code in the body of the tag is decorated according to the given configuration file and locale. A template for the config file is found at /system/config/decoration/configuration.xml . Look up the documentation for more information. |
parse | This tag is used to postprocess HTML via custom HtmlParser extending org.opencms.jsp.parse.A_CmsConfiguredHtmlParser. The "output" HTML of the JSP code in the tag's body becomes processed by the configured parser. |
template | This tag allows to split JSPs in several elements and use <cms:include> to include special elements. Note that from the included JSPs, code not in the body of any <cms:element> tag will always be included. |
contentload | This tag loads XML content items from the OpenCms VFS. It is in particular useful to iterate over a list of collected content. For each content the code in the body is executed once. Use <cms:contentaccess> to access loaded contents. |
contentshow | Deprecated. This tag provides access to individual XML content node element values. |
contentinfo | This tag provides access to information about the XML contents collected via <cms:contentload> . It has to be used in the body of <cms:contentload> . Typically, the tag is employed to build up a page navigation or, when using the surrounding <cms:contentload> with the attribute preload="true" , to get information about the number of contents collected. |
contentaccess | This tag provides access to an XML content. It has to be used in the body of <cms:contentload> . |
contentloop | Deprecated. This tag allows looping through XML content node element values. |
contentcheck | Deprecated. Use properties of org.opencms.jsp.util.CmsJspContentAccessBean via the EL instead. This tag provides conditional logic for checking the element of a XML content. The body of the tag is only processed if the conditions specified by the attributes and their values all evaluate to true. The tag has to be used in the body of <cms:contentload> . |
resourceload | This tag loads resources from the OpenCms VFS. It is used similar to <cms:contentload> , but loads all kind of OpenCms resources. Use <cms:resourceaccess> to access loaded resources. |
resourceaccess | This tag provides access OpenCms resources. It has to be used in the body of <cms:resourceload> . |
usertracking | Multi-purpose tag for tracking resource visits and subscription management. |
label | This tag is used to read values from the OpenCms workplace message bundles. Place the key in the tag's body and the value for the locale of the current request context is returned. |
include | This tag is used for including OpenCms subelements in a page. It is similar to the "include" JSP directive. But, in contrast, it loads the input at runtime, not at compile time. In the body of the tag, the <cms:param> tag can be used to pass parameters to the included file. You could also specify the file to include in the tag's body. Note that all Uris should be given as absolute or relative pathes without web application or servlet path, nor wrapped by a <cms:link> . |
edit | The tag can be used to place edit buttons around arbitrary HTML fragment. It allows to edit, add or delete XML contents. Typically it is used in the contexts of lists, e.g., news lists, where each list entry should be editable. |
editable | This tag is used to enable the direct edit functionality. It is placed in the header of a none-container-page template for most use cases. An exeception is the use with attribute <enable-ade> for container page templates. |
device | This tag is used to output different HTML for various device types. The body of the tag is only included if the device where the output is rendered matches a device listed via the type attribute. Hint: You might want to use a template context provider instead of the tag to adjust your web site to multiple devices. |
enable-ade | This tag is used to enable the advanced direct editing within a template. Just place <cms:enable-ade /> in the head section of your template. |
param | Adds a parameter to the outer tag (if supported). |
img | This tag allows using the OpenCms native image scaling mechanism. It generates the HTML required to include the selected image, adding the required image scaling parameters. The following image formats are supported: BMP, GIF, JPEG, PNG, PNM, TIFF. Note: Picture scaling is by default only enabled for target size with width and height <=1500. The size can be changed in the image scaler configuration in the file opencms-vfs.xml in the body of the tag <loader> . Also other options for the image scaler are set there. |
scaleImage | This tag allows flexible creation of scaled images using the OpenCms native image scaling mechanism. It generates an image bean that can render scaled versions of the selected image, adding the required image scaling parameters. The following image formats are supported: BMP, GIF, JPEG, PNG, PNM, TIFF. Note: Picture scaling is by default only enabled for target size with width and height <=1500. The size can be changed in the image scaler configuration in the file opencms-vfs.xml in the body of the tag <loader> . Also other options for the image scaler are set there. This tag is an alternative to the cms:img tag, providing more flexibility by not generating any output but providing a bean that may be used to generate any output needed. This way you can use scaled images for
|
export | This tag can be used to write JSP code from a JSP to files in the static export. Code in the tag's body is not processed by OpenCms. |
jquery | This tag allows to include jquery and some jquery plugins code and style sheets that are shipped with OpenCms. The tag will include the unpacked version of JQuery in the offline project (for better debug facilities) and the packed version in the online project (for better performance). Use the tag in the HTML head section of your template. |
container | This tag enables the template mechanism for container pages. |
display | Via this tag, you can render an XML content with a given formatter from inside a (formatter) JSP. In particular, the tag is useful for rendering list items from within a list formatter. The tag can be configured to work for contents of different type - thus it also for lists of mixed resources. Optionally, you can display edit points at the output. They facilitate similar editing functionality as In the body of the
|
simpledisplay | Via this tag, you can render an XML content with a given formatter from inside a (formatter) JSP. This tag is simpler than the <cms:display> tag in that it only allows you to specify a single formatter. Optionally, you can display edit points at the output. They facilitate similar editing functionality as In the body of the
|
displayFormatter | This tag can be used only inside Note that alternatively, the attribute |
formatter | This tag loads single XML content items. |
nocache | This tag sends no-cache headers to the browser. |
headincludes | This tag enables content-dependent dynamic inclusion of css/javascript resources on a containerpage. It should be placed in the HTML head-section of a container page template. If dynamic inclusion is enabled, resources required by a special formatter that are configured in its formatter_config, are included on demand. |
navigation | This tag provides access to a list of elements that should be shown in the navigation, i.e., elements where at least one of the properties NavText or NavPos are set. The tag is the standard tool to build up dynamic page navigations. |
elementsetting | Provides access to the settings of an ADE container element. The tag is replaced with the value of the requested setting. Useful, e.g., to adjust formatters to element settings. |
search | This tag provides support to generate search forms and result lists for a server-side handled Solr search. It takes an (XML or JSON) configuration file or a JSON configuration String and essentially exposes an object with the search results and also the necessary information to suitably build up your search form. It supports facets and highlighting. If you do not specify a search index explicitly, the tag uses "Solr Offline" and "Solr Online", depending on the current project. To get detailed information on the configuraiton options, just have a look at an XML content of type |
simplesearch | This tag provides support to generate search forms and result lists for a server-side handled Solr search. It takes an (XML or JSON) configuration file or a JSON configuration String and essentially exposes an object with the search results and also the necessary information to suitably build up your search form. It supports facets and highlighting. If you do not specify a search index explicitly, the tag uses "Solr Offline" and "Solr Online", depending on the current project. To get detailed information on the configuraiton options, just have a look at an XML content of type |
secureparams | Enables automatic parameter escaping for a Flex Request. |
jsonpart | Converts the output of the contained JSP code to an encoded JSON form, to be used in combination with the servlet filter org.opencms.jsp.jsonpart.CmsJsonPartFilter. |
addparams | Allows the JSP programmer to dynamically add request parameters (using the |
map | Can be used to create a java.util.Map with string keys and values using nested |
jsonobject | Creates a JSON object and adds it to the surrounding JSON context, or stores the JSON in a page context attribute. The content of the JSON object is provided by nested cms:json... tags. |
jsonarray | Creates a JSON array and adds it to the surrounding JSON context, or stores the JSON in a page context attribute. The content of the array is provided by nested cms:json... tags. |
jsonvalue | Takes a JSON value from the 'value' attribute and adds it to the surrounding JSON context or sets it as a page context attribute. |
enable-list-add | Enables the option for creating a new content in the ADE menu of a container page element when used in the element's formatter. |
Function Summary | ||
void | addToList( java.util.List, java.lang.Object) | Extends the given list by adding the provided object. The 1st parameter is the list, the 2nd the value to add. |
org.opencms.jsp.util.CmsJspVfsAccessBean | vfs( java.lang.Object) | Provides simple access to a org.opencms.jsp.util.CmsJspVfsAccessBean. The argument object must in some way be suitable to extract a suitable instance of the org.opencms.file.CmsObject. Hint: Easy access to the vfs access bean on a JSP is also provided via |
java.util.Date | convertDate( java.lang.Object) | Allows conversion of Long values to Dates. Can also handle Strings that represent a Long or a Date. Example: <fmt:formatDate value="${cms:convertDate(value.Date)}" dateStyle="SHORT" timeStyle="SHORT" type="both" /> |
java.util.List | convertList( java.util.List, java.lang.String) | Takes a list of Java beans as first argument and a property name for a property of these beans as second argument. The function returns a list where for each given bean the specified property is returned, i.e., for each bean, bean.property is returned. |
org.opencms.file.CmsObject | getCmsObject( java.lang.Object) | Returns the current OpenCms user context from the page context when pageContext is given as argument. |
java.lang.Integer | getListSize( java.util.Collection) | Returns the size of the given list. |
java.lang.String | getModuleParam( java.lang.String, java.lang.String) | Returns a parameter value from the module parameters. |
java.util.Locale | convertLocale( java.lang.Object) | Allows conversion of Objects to Locales. Can also handle Strings that are locales, or Locales itself. If no valid locale is provided, the OpenCms default locale is returned. |
java.lang.String | stripHtml( java.lang.Object) | Strips all HTML markup from the given input. |
java.lang.Long | mathFloor( java.lang.Object) | Calculates the next smallest integer for the given number parameter. |
java.lang.Long | mathCeil( java.lang.Object) | Calculates the next largest integer for the given number parameter. |
java.lang.Long | mathRound( java.lang.Object) | Calculates the next integer for the given number parameter by rounding. |
java.lang.Double | toNumber( java.lang.Object, java.lang.Object) | Converts the given Object to a (Double) number, falling back to a default if this is not possible. |
java.lang.String | trimToSize( java.lang.String, int) | Returns a prefix of the String argument, that is not longer then the given int value. |
org.opencms.util.CmsUUID | convertUUID( java.lang.Object) | Allows conversion of String values to CmsUUIDs. Can also handle byte[] that are CmsUUIDs, or CmsUUID itself. |
java.util.List | createList( ) | Returns a newly created, empty List object. There is no way to create an empty list using standard JSTL methods, hence this function. |
java.lang.String | getRequestParam( java.lang.String, java.lang.String) | Given an URL as String, formatted for a GET request, as first argument and a request parameter name as second parameter, the value of this request parameter in the first argument is returned. |
java.lang.String | getRequestLink( java.lang.String) | Returns the link, that is given as argument of type String and formatted for a GET request, without parameters. |
java.lang.String | escape( java.lang.String, java.lang.String) | Encodes a String in a way similar to the JavaScript "encodeURIcomponent" function. In order to avoid encoding hell, it's better to just use JavaScript "decodeURIcomponent" can decode Strings that have been encoded using this method, provided "UTF-8" has been used as encoding. The 1st parameter is the String to encode, the 2nd the encoding to be used, e.g. "UTF-8". |
java.lang.String | encode( java.lang.String) | Encodes a String in a way similar to the JavaScript "encodeURIcomponent" function, using "UTF-8" for character encoding. JavaScript "decodeURIcomponent" can decode Strings that have been encoded using this method. |
java.util.Map | jsonToMap( java.lang.String) | Converts a JSON string to a map with string keys/value pairs. |
java.lang.String | unescape( java.lang.String, java.lang.String) | Decodes a String in a way similar to the JavaScript "decodeURIcomponent" function. In order to avoid encoding hell, it's better to just use This method can decode Strings that have been encoded in JavaScript with "encodeURIcomponent", provided "UTF-8" is used as encoding. The 1st parameter is the String to decode, the 2nd the encoding the string was encoded with, e.g. "UTF-8". |
java.lang.String | decode( java.lang.String) | Decodes a String in a way similar to the JavaScript "decodeURIcomponent" function, using "UTF-8" for character encoding. This method can decode Strings that have been encoded in JavaScript with "encodeURIcomponent". |
java.lang.String | navUri( java.lang.Object) | Returns the current request URI. DEPRECATED On a JSP, use |
java.lang.String | lookupDefault( java.lang.String, java.lang.String, java.lang.String) | Uses the 1st String as key to look up from the map that is passed as the 2nd String, and returns either the element found or the default value from the 3rd String. The map String must have the form |
java.lang.String | lookup( java.lang.String, java.lang.String) | Uses the 1st String as key to look up from the map that is passed as the 2nd String, and returns either the element found or the empty String. The map String must have the form |
java.lang.String | repairHtml( java.lang.String) | Repairs the given HTML input by adding potentially missing closing tags. |
boolean | isSubSitemap( org.opencms.file.CmsResource) | Returns whether the given resource is a sub sitemap folder. |
boolean | isWrapper( java.lang.Object) | Returns whether the given value is an instance of A_CmsJspValueWrapper . |
java.lang.String | addLeadingAndTrailingSlash( java.lang.String) | Adds leading and trailing slashes to a path, if the path does not already start or end with a slash. |
java.lang.String | changeFileNameSuffixToo( java.lang.String,java.lang.String) | Changes the given filenames suffix from the current suffix to the provided suffix. The 1st parameter is the filename, the 2nd the new suffix. |
boolean | comparePaths( java.lang.String, java.lang.String) | Compares two paths, ignoring leading and trailing slashes. Returns true if the paths are equal (ignoring leading and trailing slashes). |
java.lang.String | escapeHtml( java.lang.String) | Replaces line breaks to <br/> and HTML control characters like < > & " with their HTML entity representation. |
java.lang.String | escapeJavaScript( java.lang.String) | Escapes a String so it may be used in JavaScript String definitions.
This method escapes line breaks ( |
java.lang.String | escapePattern( java.lang.String) | Escapes a String so it may be used as a Perl5 regular expression. This method replaces the following characters in a String: |
java.lang.String | extractHtmlBody( java.lang.String) | Extracts the content of a This method should be pretty robust and work even if the input HTML does not contains a valid body tag. |
java.lang.String | formatResourceName( java.lang.String, int) | Shortens a resource name or path so that it is not longer than the provided maximum length. In order to reduce the length of the resource name, only complete folder names are removed and replaced with ... successively, starting with the second folder. The first folder is removed only in case the result still does not fit if all subfolders have been removed. Example: |
java.lang.String | getCommonPrefixPath( java.lang.String, java.lang.String) | Returns the common parent path of two paths. |
java.util.Locale | getLocaleForName( java.lang.String) | Returns a java.util.Locale calculated from the suffix of the given String, or The locale returned will include the optional country code if this was part of the suffix. |
java.lang.String | getLocaleSuffixForName( java.lang.String) | Returns the locale suffix from the given String, or Examples:
|
java.util.List | getPathComponents( java.lang.String) | Splits a path into its non-empty path components. If the path is the root path, an empty list will be returned. |
java.lang.String | getRelativeSubPath( java.lang.String, java.lang.String) | Converts the given path to a path relative to a base folder, but only if it actually is a sub-path of the latter, otherwise The 1st parameter is the path, the 2nd paramerter is the base folder. |
boolean | isEmptyOrWhitespaceOnly( java.lang.String) | Returns true if the provided String is either null or contains only white spaces. |
boolean | isPrefixPath( java.lang.String, java.lang.String) | Checks if the first path is a prefix of the second path.. This method is different compared to |
boolean | isValidJavaClassName( java.lang.String) | Checks if the given class name is a valid Java class name. |
boolean | validateRegex( java.lang.String, java.lang.String) | Validates a value (1st parameter) against a regular expression (2nd parameter). |
java.lang.Object | parseJson( java.lang.String) | Parses JSON data into an object. |
| |||||||
FRAMES NO FRAMES |