Class FreeMarkerWithLuceneExtensionsModelFactory

  • All Implemented Interfaces:
    TemplateActionModelFactory

    public class FreeMarkerWithLuceneExtensionsModelFactory
    extends java.lang.Object
    implements TemplateActionModelFactory
    A factory implementation to build suitable models for the freemarker templating language.
    Author:
    Andy Hind
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getModel()
      Get the non-contextual model.
      java.util.Map<java.lang.String,​java.lang.Object> getModel​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Defines a non-contextual nod model + the contextual node
      java.lang.String getTemplateEngine()
      The name of the template engine for which this model applies.
      void setServiceRegistry​(ServiceRegistry serviceRegistry)
      Set the service registry
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FreeMarkerWithLuceneExtensionsModelFactory

        public FreeMarkerWithLuceneExtensionsModelFactory()
        Default constructor.
    • Method Detail

      • setServiceRegistry

        public void setServiceRegistry​(ServiceRegistry serviceRegistry)
        Set the service registry
        Parameters:
        serviceRegistry - ServiceRegistry
      • getModel

        public java.util.Map<java.lang.String,​java.lang.Object> getModel()
        Get the non-contextual model. This defines:
        1. dates: date, today, yesterday, tomorrow
        2. functions: luceneDateRange, selectSingleNode
        Specified by:
        getModel in interface TemplateActionModelFactory
        Returns:
        - the model for the template engine.
      • getModel

        public java.util.Map<java.lang.String,​java.lang.Object> getModel​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Defines a non-contextual nod model + the contextual node
        Specified by:
        getModel in interface TemplateActionModelFactory
        Parameters:
        nodeRef - NodeRef
        Returns:
        - the model (with nodeRef as its context).
      • getTemplateEngine

        public java.lang.String getTemplateEngine()
        The name of the template engine for which this model applies. In this case, "freemarker".
        Specified by:
        getTemplateEngine in interface TemplateActionModelFactory
        Returns:
        - the template engine.