Class FreeMarkerWithLuceneExtensionsModelFactory

java.lang.Object
org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory
All Implemented Interfaces:
TemplateActionModelFactory

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

    • FreeMarkerWithLuceneExtensionsModelFactory

      public FreeMarkerWithLuceneExtensionsModelFactory()
      Default constructor.
  • Method Details

    • setServiceRegistry

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

      public Map<String,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 Map<String,Object> getModel(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 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.