My favorites | Sign in
Project Logo
             
Search
for
Updated May 24, 2008 by ste...@e-nation.dk
Labels: Phase-Deploy, Featured
OctoolsFeatures  
Features of the octools module

Features of the octools module

Jstl adapters of OpenCms classes

Using a simple tag in your jsp, you can gain access to the CmsJspActionElement and CmsRequestContext classes.

<%@ taglib prefix="oc" uri="http://dk.valtech.com/taglib/octools" %>

<oc:defineObjects />

The requested file is "${ cmsRequest.uri }"
The Title property is "${ cms.property[ 'Title' ] }"
This is a link to <a href="${ cms.link['index.html'] }">index.html</a>

The objects are also available in scriptlets, if you ever want to use that. Like this <%= cms.link("index.html") %>

(The name was inspired by the tag from the portlet specification: <portal:defineObjects />)

The actual classes are not those from OpenCms, since they are not very Expression Language friendly. Instead they are wrapped in adapter classes from octools called CmsJstlActionElement and CmsJstlRequestContext. These classes provide map-style getters for properties, the link-method etc.

The navigation tags

Are you tired of writing navigation code, using scriptlets? The solution is to use the octools navigation tags. Using jsp tags, you can generate a navigation simply like this:

<%@ taglib prefix="oc" uri="http://dk.valtech.com/taglib/octools" %>

<%-- This snippet generates the navigation for the top-level of the site. Usually the language folders --%>

<oc:navigation var="nav" status="status" level="0" endLevel="0">
	<a href="${ cms.link[nav.resourceName] }">${ nav.navText }</a>
	<c:if test="${ not status.last }"> | </c:if>
</oc:navigation>

Read more about the navigation tag on the OctoolsNavigation page (that comes soon).

The breadcrumb tag

new to version 1.1.3

Kind of the same as above. This is a tag to generate breadcrumbs, to avoid using scriptlets.

<%@ taglib prefix="oc" uri="http://dk.valtech.com/taglib/octools" %>

<%-- This snippet generates the breadcrumb from level 1 of the site. Usually the selected language folder (e.g. /en/) --%>

<ul class="breadcrumb">
	<oc:breadcrumb begin="1" var="nav" varStatus="status">
		<li>
			<a href="${ cms.link[nav.resourceName] }">${ nav.title }</a>
		</li>
		<c:if test="${ not status.last }"><li>&gt;</li></c:if>
	</oc:breadcrumb>
</ul>

Friendly Property Editor

If you create a template that requires special properties to be set on the file that it renders, you can take advantage of the friendly property editor of octools.

On the template, set the property template.properties to point to a xmlcontent file based on the schema in /system/modules/dk.valtech.octools/schema/TemplateProperties.xsd.

Example setup:


Sign in to add a comment
Hosted by Google Code