org.alfresco.repo.template
Class XSLTProcessor

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessor
      extended by org.alfresco.repo.template.XSLTProcessor
All Implemented Interfaces:
org.alfresco.processor.Processor, TemplateProcessor

public class XSLTProcessor
extends BaseProcessor
implements TemplateProcessor


Field Summary
static org.alfresco.service.namespace.QName ROOT_NAMESPACE
           
 
Fields inherited from class org.alfresco.repo.processor.BaseProcessor
extension, name, processorExtensions, scriptService, services, templateService
 
Constructor Summary
XSLTProcessor()
           
 
Method Summary
protected  void addParameters(XSLTemplateModel xsltModel, org.w3c.dom.Document xslTemplate)
          Adds the specified parameters to the xsl template as variables within the alfresco namespace.
protected  java.util.List addScripts(XSLTemplateModel xsltModel, org.w3c.dom.Document xslTemplate)
          Adds a script element to the xsl which makes static methods on this object available to the xsl tempalte.
protected  javax.xml.transform.Source getXMLSource(java.util.Map model)
           
 void process(java.lang.String template, java.lang.Object model, java.io.Writer out)
          Process a template against the supplied data model and write to the out.
 void processString(java.lang.String template, java.lang.Object model, java.io.Writer out)
          Process a string template against the supplied data model and write to the out.
 void register()
          Registers this processor with the relevant services
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessor
getExtension, getName, getProcessorExtensions, registerProcessorExtension, setExtension, setName, setScriptService, setServiceRegistry, setTemplateService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.processor.Processor
getExtension, getName, registerProcessorExtension
 

Field Detail

ROOT_NAMESPACE

public static final org.alfresco.service.namespace.QName ROOT_NAMESPACE
Constructor Detail

XSLTProcessor

public XSLTProcessor()
Method Detail

register

public void register()
Description copied from class: BaseProcessor
Registers this processor with the relevant services

Overrides:
register in class BaseProcessor

process

public void process(java.lang.String template,
                    java.lang.Object model,
                    java.io.Writer out)
Description copied from interface: TemplateProcessor
Process a template against the supplied data model and write to the out.

Specified by:
process in interface TemplateProcessor
Parameters:
template - Template name/path
model - Object model to process template against
out - Writer object to send output too

processString

public void processString(java.lang.String template,
                          java.lang.Object model,
                          java.io.Writer out)
Description copied from interface: TemplateProcessor
Process a string template against the supplied data model and write to the out.

Specified by:
processString in interface TemplateProcessor
Parameters:
template - Template string
model - Object model to process template against
out - Writer object to send output too

addScripts

protected java.util.List addScripts(XSLTemplateModel xsltModel,
                                    org.w3c.dom.Document xslTemplate)
Adds a script element to the xsl which makes static methods on this object available to the xsl tempalte.

Parameters:
xslTemplate - the xsl template

addParameters

protected void addParameters(XSLTemplateModel xsltModel,
                             org.w3c.dom.Document xslTemplate)
Adds the specified parameters to the xsl template as variables within the alfresco namespace.

Parameters:
xsltModel - the variables to place within the xsl template
xslTemplate - the xsl template

getXMLSource

protected javax.xml.transform.Source getXMLSource(java.util.Map model)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.