Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.websody.corefunc
Class XSLTransform  view XSLTransform download XSLTransform.java

java.lang.Object
  extended byorg.websody.GenericFunction
      extended byorg.websody.corefunc.XSLTransform
All Implemented Interfaces:
org.websody.cache.CacheSource, org.websody.Function, javax.xml.transform.URIResolver

public class XSLTransform
extends org.websody.GenericFunction
implements javax.xml.transform.URIResolver, org.websody.cache.CacheSource

This function takes a xml file and transforms it using the specified xsl stylesheet. Additionally it provides access to the portlet parameters and the current property context.


Field Summary
protected  javax.xml.parsers.DocumentBuilder dBuilder
           
protected static javax.xml.parsers.DocumentBuilderFactory dFactory
           
protected  java.lang.String source
           
protected  java.lang.String stylesheet
           
protected static org.websody.cache.MemoryCache templatesCache
           
protected  javax.xml.transform.TransformerFactory tFactory
           
 
Fields inherited from class org.websody.GenericFunction
log, out, request, servletContext
 
Constructor Summary
XSLTransform()
           
 
Method Summary
 java.lang.Object execute()
           
private  java.io.File getFile(java.lang.String uri)
           
 java.lang.Object getValue(java.lang.Object key)
           
 boolean isModifiedSince(java.lang.Object key, java.lang.Object value, long since)
           
 long lastModified()
           
 javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base)
          Resolves an xsl:include, xsl:import, or XPath document() function.
 void setPath(java.lang.String s)
           
 void setSource(java.lang.String source)
           
 void setStylesheet(java.lang.String stylesheet)
           
 
Methods inherited from class org.websody.GenericFunction
getLifetime, init, setLifetime, setLifetime, setOut, setRequest, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templatesCache

protected static org.websody.cache.MemoryCache templatesCache

dFactory

protected static javax.xml.parsers.DocumentBuilderFactory dFactory

source

protected java.lang.String source

stylesheet

protected java.lang.String stylesheet

tFactory

protected javax.xml.transform.TransformerFactory tFactory

dBuilder

protected javax.xml.parsers.DocumentBuilder dBuilder
Constructor Detail

XSLTransform

public XSLTransform()
Method Detail

setSource

public void setSource(java.lang.String source)

setStylesheet

public void setStylesheet(java.lang.String stylesheet)

setPath

public void setPath(java.lang.String s)

lastModified

public long lastModified()
Specified by:
lastModified in interface org.websody.Function

execute

public java.lang.Object execute()
                         throws java.lang.Exception
Specified by:
execute in interface org.websody.Function

resolve

public javax.xml.transform.Source resolve(java.lang.String href,
                                          java.lang.String base)
Description copied from interface: javax.xml.transform.URIResolver
Resolves an xsl:include, xsl:import, or XPath document() function.

Specified by:
resolve in interface javax.xml.transform.URIResolver

getFile

private java.io.File getFile(java.lang.String uri)

getValue

public java.lang.Object getValue(java.lang.Object key)
                          throws java.lang.Exception
Specified by:
getValue in interface org.websody.cache.CacheSource

isModifiedSince

public boolean isModifiedSince(java.lang.Object key,
                               java.lang.Object value,
                               long since)
Specified by:
isModifiedSince in interface org.websody.cache.CacheSource