Package org.alfresco.repo.template
Class XSLTProcessor
- java.lang.Object
-
- org.alfresco.repo.processor.BaseProcessor
-
- org.alfresco.repo.template.XSLTProcessor
-
- All Implemented Interfaces:
org.alfresco.processor.Processor,TemplateProcessor
public class XSLTProcessor extends BaseProcessor implements TemplateProcessor
-
-
Field Summary
Fields Modifier and Type Field Description static org.alfresco.service.namespace.QNameROOT_NAMESPACE-
Fields inherited from class org.alfresco.repo.processor.BaseProcessor
extension, name, processorExtensions, scriptService, services, templateService
-
-
Constructor Summary
Constructors Constructor Description XSLTProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddParameters(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<java.lang.String>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.SourcegetXMLSource(java.util.Map<org.alfresco.service.namespace.QName,java.lang.Object> model)voidprocess(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.voidprocess(java.lang.String template, java.lang.Object model, java.io.Writer out, java.util.Locale locale)Process a template in the given locale against the supplied data model and write to the out.voidprocessString(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.voidregister()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
-
-
-
-
Method Detail
-
register
public void register()
Description copied from class:BaseProcessorRegisters this processor with the relevant services- Overrides:
registerin classBaseProcessor
-
process
public void process(java.lang.String template, java.lang.Object model, java.io.Writer out)Description copied from interface:TemplateProcessorProcess a template against the supplied data model and write to the out.- Specified by:
processin interfaceTemplateProcessor- Parameters:
template- Template name/pathmodel- Object model to process template againstout- 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:TemplateProcessorProcess a string template against the supplied data model and write to the out.- Specified by:
processStringin interfaceTemplateProcessor- Parameters:
template- Template stringmodel- Object model to process template againstout- Writer object to send output too
-
addScripts
protected java.util.List<java.lang.String> 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 templatexslTemplate- the xsl template
-
getXMLSource
protected javax.xml.transform.Source getXMLSource(java.util.Map<org.alfresco.service.namespace.QName,java.lang.Object> model)
-
process
public void process(java.lang.String template, java.lang.Object model, java.io.Writer out, java.util.Locale locale)Description copied from interface:TemplateProcessorProcess a template in the given locale against the supplied data model and write to the out.- Specified by:
processin interfaceTemplateProcessor- Parameters:
template- Template name/pathmodel- Object model to process template againstout- Writer object to send output toolocale- The Locale to process the template in
-
-