Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.3
-
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>