Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7915

Provide pluggable Velocity context tool facility

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.4, 6.0
    • Component/s: contrib - Velocity
    • Labels:
      None

      Description

      Currently the "tools" placed in the VelocityResponseWriter's context are hard-coded. It can be very handy to be able to plug in 3rd party or custom tools (just any ol' Java object a "tool" can be).

      Here's a list of the currently hard-coded tools: https://github.com/apache/lucene-solr/blob/trunk/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java#L189-L199


      The implementation committed allows custom tools to be registered as part of the VelocityResponseWriter definition in solrconfig.xml like this:

              <queryResponseWriter name="velocityWithCustomTools" class="solr.VelocityResponseWriter">
                <lst name="tools">
                  <str name="mytool">com.example.solr.velocity.MyTool</str>
                  <!-- ... -->
                </lst>
              </queryResponseWriter>
      

        Attachments

          Activity

            People

            • Assignee:
              ehatcher Erik Hatcher
              Reporter:
              ehatcher Erik Hatcher
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: