AnsweredAssumed Answered

JSF content rendering tags

Question asked by flashard on Mar 18, 2009
I couldn't see any built in way to do it, so I've created some JSF/Facelets tags that render Alfresco produced XML.  The first is the transform tag that transforms using XPATH/XSLT, and the second is a generic cache tag that caches rendered output.  I've also directly incorporated caching into the transform tag so you can use a single concise tag to produced cached/transformed output

Tags in my page look like e.g.:

<con:transform contentLocation="<file or classpath location>" path="/page/body" region="common"/>

- content, contentLocation, or contentStream: specifies the source of the input XML
- stylesheet, stylesheetLocation, or stylesheetStream: specifies the source for the XSLT (the default is the use of an inbuilt XSLT that converts line breaks to <BR/> tags
- path: optionally specfies a subset of the source XML
- region: optionally specifies a caching region (required when cache = true)

with optional attributes
cache = [true | false] (defaults to true): which either enables or disables the cache
markCachingOutput = [true | false] (defaults to true): which writes out HTML comments indicating when content has come from the cache

The reason for posting is to see whether this is useful for anyone else - I'll productionise it and post to the forge if anyone else thinks they might use it.