Class XSLTProcessor

    • Constructor Summary

      Constructors 
      Constructor Description
      XSLTProcessor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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<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.Source getXMLSource​(java.util.Map<org.alfresco.service.namespace.QName,​java.lang.Object> 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 process​(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.
      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 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<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 template
        xslTemplate - 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: TemplateProcessor
        Process a template in the given locale 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
        locale - The Locale to process the template in