Class ThymeleafResponseWriter

  • All Implemented Interfaces:
    org.apache.solr.response.QueryResponseWriter, org.apache.solr.util.plugin.NamedListInitializedPlugin, org.apache.solr.util.plugin.SolrCoreAware

    public class ThymeleafResponseWriter
    extends Object
    implements org.apache.solr.response.QueryResponseWriter, org.apache.solr.util.plugin.SolrCoreAware
    A response writer utilizing the Thymeleaf template engine.
    Author:
    shopping24 GmbH, Torsten Bøgh Köster (@tboeghk)
    • Field Summary

      • Fields inherited from interface org.apache.solr.response.QueryResponseWriter

        CONTENT_TYPE_TEXT_ASCII, CONTENT_TYPE_TEXT_UTF8, CONTENT_TYPE_XML_UTF8
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getContentType​(org.apache.solr.request.SolrQueryRequest request, org.apache.solr.response.SolrQueryResponse response)  
      protected org.thymeleaf.TemplateEngine getEngine()  
      void inform​(org.apache.solr.core.SolrCore core)
      This get's called as soon the core is ready, which is after the init(NamedList) method below.
      void init​(org.apache.solr.common.util.NamedList args)
      Configures engine and template resolving.
      protected void preProcess​(org.thymeleaf.context.WebContext context, org.apache.solr.request.SolrQueryRequest request, org.apache.solr.response.SolrQueryResponse response)  
      void write​(Writer writer, org.apache.solr.request.SolrQueryRequest request, org.apache.solr.response.SolrQueryResponse response)  
    • Constructor Detail

      • ThymeleafResponseWriter

        public ThymeleafResponseWriter()
    • Method Detail

      • inform

        public void inform​(org.apache.solr.core.SolrCore core)
        This get's called as soon the core is ready, which is after the init(NamedList) method below.
        Specified by:
        inform in interface org.apache.solr.util.plugin.SolrCoreAware
      • write

        public void write​(Writer writer,
                          org.apache.solr.request.SolrQueryRequest request,
                          org.apache.solr.response.SolrQueryResponse response)
        Specified by:
        write in interface org.apache.solr.response.QueryResponseWriter
      • preProcess

        protected void preProcess​(org.thymeleaf.context.WebContext context,
                                  org.apache.solr.request.SolrQueryRequest request,
                                  org.apache.solr.response.SolrQueryResponse response)
      • getEngine

        protected org.thymeleaf.TemplateEngine getEngine()
      • getContentType

        public String getContentType​(org.apache.solr.request.SolrQueryRequest request,
                                     org.apache.solr.response.SolrQueryResponse response)
        Specified by:
        getContentType in interface org.apache.solr.response.QueryResponseWriter
      • init

        public void init​(org.apache.solr.common.util.NamedList args)
        Configures engine and template resolving.
        Specified by:
        init in interface org.apache.solr.util.plugin.NamedListInitializedPlugin
        Specified by:
        init in interface org.apache.solr.response.QueryResponseWriter