You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by eh...@apache.org on 2013/04/29 01:30:58 UTC

svn commit: r1476858 - in /lucene/dev/trunk: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/backwards/ lucene/benchmark/ lucene/classification/ lucene/codecs/ lucene/core/ lucene/demo/ lucene/facet/ lucene/grouping/ lucene/highli...

Author: ehatcher
Date: Sun Apr 28 23:30:57 2013
New Revision: 1476858

URL: http://svn.apache.org/r1476858
Log:
SOLR-4759: Velocity template cleanup

Added:
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/README.txt
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/README.txt
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster_results.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/cluster_results.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/error.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/error.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit_grouped.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/hit_grouped.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit_plain.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/hit_plain.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/join_doc.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/join_doc.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/mime_type_lists.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/mime_type_lists.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/pagination_bottom.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/pagination_bottom.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/pagination_top.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/pagination_top.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/product_doc.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/product_doc.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/query_form.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/query_form.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/query_group.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/query_group.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/query_spatial.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/query_spatial.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/results_list.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/results_list.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/richtext_doc.vm
      - copied unchanged from r1476857, lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/velocity/richtext_doc.vm
Removed:
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/clusterResults.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hitGrouped.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/join-doc.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/product-doc.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/queryGroup.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/querySpatial.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/richtext-doc.vm
Modified:
    lucene/dev/trunk/   (props changed)
    lucene/dev/trunk/dev-tools/   (props changed)
    lucene/dev/trunk/lucene/   (props changed)
    lucene/dev/trunk/lucene/BUILD.txt   (props changed)
    lucene/dev/trunk/lucene/CHANGES.txt   (props changed)
    lucene/dev/trunk/lucene/LICENSE.txt   (props changed)
    lucene/dev/trunk/lucene/MIGRATE.txt   (props changed)
    lucene/dev/trunk/lucene/NOTICE.txt   (props changed)
    lucene/dev/trunk/lucene/analysis/   (props changed)
    lucene/dev/trunk/lucene/analysis/common/   (props changed)
    lucene/dev/trunk/lucene/backwards/   (props changed)
    lucene/dev/trunk/lucene/benchmark/   (props changed)
    lucene/dev/trunk/lucene/build.xml   (props changed)
    lucene/dev/trunk/lucene/classification/   (props changed)
    lucene/dev/trunk/lucene/codecs/   (props changed)
    lucene/dev/trunk/lucene/common-build.xml   (props changed)
    lucene/dev/trunk/lucene/core/   (props changed)
    lucene/dev/trunk/lucene/demo/   (props changed)
    lucene/dev/trunk/lucene/facet/   (props changed)
    lucene/dev/trunk/lucene/grouping/   (props changed)
    lucene/dev/trunk/lucene/highlighter/   (props changed)
    lucene/dev/trunk/lucene/ivy-settings.xml   (props changed)
    lucene/dev/trunk/lucene/join/   (props changed)
    lucene/dev/trunk/lucene/licenses/   (props changed)
    lucene/dev/trunk/lucene/memory/   (props changed)
    lucene/dev/trunk/lucene/misc/   (props changed)
    lucene/dev/trunk/lucene/module-build.xml   (props changed)
    lucene/dev/trunk/lucene/queries/   (props changed)
    lucene/dev/trunk/lucene/queryparser/   (props changed)
    lucene/dev/trunk/lucene/sandbox/   (props changed)
    lucene/dev/trunk/lucene/site/   (props changed)
    lucene/dev/trunk/lucene/spatial/   (props changed)
    lucene/dev/trunk/lucene/suggest/   (props changed)
    lucene/dev/trunk/lucene/test-framework/   (props changed)
    lucene/dev/trunk/lucene/tools/   (props changed)
    lucene/dev/trunk/solr/   (props changed)
    lucene/dev/trunk/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/trunk/solr/NOTICE.txt   (props changed)
    lucene/dev/trunk/solr/build.xml   (props changed)
    lucene/dev/trunk/solr/cloud-dev/   (props changed)
    lucene/dev/trunk/solr/common-build.xml   (props changed)
    lucene/dev/trunk/solr/contrib/   (props changed)
    lucene/dev/trunk/solr/contrib/velocity/src/test-files/velocity/solr/collection1/conf/velocity/numFound.vm   (props changed)
    lucene/dev/trunk/solr/core/   (props changed)
    lucene/dev/trunk/solr/example/   (props changed)
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/VM_global_library.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/browse.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/debug.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/did_you_mean.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_fields.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_pivot.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_queries.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_ranges.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facets.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/footer.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/head.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/header.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/layout.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/main.css
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/suggest.vm
    lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/tabs.vm
    lucene/dev/trunk/solr/licenses/   (props changed)
    lucene/dev/trunk/solr/site/   (props changed)
    lucene/dev/trunk/solr/solrj/   (props changed)
    lucene/dev/trunk/solr/test-framework/   (props changed)
    lucene/dev/trunk/solr/webapp/   (props changed)

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Sun Apr 28 23:30:57 2013
@@ -93,6 +93,9 @@ Other Changes
 * SOLR-4757: Change the example to use the new solr.xml format and core 
   discovery by directory structure. (Mark Miller)
 
+* SOLR-4759: Velocity (/browse) template cosmetic cleanup.
+  (Mark Bennett, ehatcher)
+
 ==================  4.3.0 ==================
 
 Versions of Major Components

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/VM_global_library.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/VM_global_library.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/VM_global_library.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/VM_global_library.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,8 @@
+#**
+ *  Global macros used by other templates.
+ *  This file must be named VM_global_library.vm
+ *  in order for Velocity to find it.
+ *#
 
 #macro(param $key)$request.params.get($key)#end
 
@@ -167,4 +172,4 @@ $math.toDouble($math.add($inval,$gapval)
 #else
 $math.add($inval,$gapval)##
 #end
-#end
\ No newline at end of file
+#end

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/browse.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/browse.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/browse.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/browse.vm Sun Apr 28 23:30:57 2013
@@ -1,9 +1,13 @@
-#set($searcher=$request.searcher)
-#set($params=$request.params)
+#**
+ *  Main entry point into the /browse templates
+ *#
+
+#set($searcher = $request.searcher)
+#set($params = $request.params)
 #set($clusters = $response.response.clusters)
 #set($mltResults = $response.response.get("moreLikeThis"))
 #set($annotate = $params.get("annotateBrowse"))
-#parse('query.vm')
+#parse('query_form.vm')
 #parse('did_you_mean.vm')
 
 <div class="navigators">
@@ -11,40 +15,19 @@
 </div>
 
 <div class="pagination">
-  #if($response.response.get('grouped'))
-    <span><span class="results-found">$response.response.get('grouped').size() group(s)</span> found in ${response.responseHeader.QTime} ms</span>
-  #else<span><span class="results-found">$page.results_found</span> results found in ${response.responseHeader.QTime} ms</span>
-  Page <span class="page-num">$page.current_page_number</span> of <span
-        class="page-count">$page.page_count</span>#end
+  #parse("pagination_top.vm")
 </div>
 
+## Show Error Message, if any
 <div class="error">
-  #if(${response.response.error.code})
-    <h1>ERROR ${response.response.error.code}</h1>
-    ${response.response.error.msg}
-  #end
+  #parse("error.vm")
 </div>
 
+## Render Results, actual matching docs
 <div class="results">
-  #if($response.response.get('grouped'))
-    #foreach($grouping in $response.response.get('grouped'))
-      #parse("hitGrouped.vm")
-    #end
-  #else
-    #foreach($doc in $response.results)
-      #parse("hit.vm")
-    #end
-  #end
+  #parse("results_list.vm")
 </div>
 
 <div class="pagination">
-  #if($response.response.get('grouped'))
-  #else
-  #link_to_previous_page("previous")
-  <span class="results-found">$page.results_found</span> results found.
-  Page <span class="page-num">$page.current_page_number</span> of <span
-        class="page-count">$page.page_count</span>
-  #link_to_next_page("next")
-  #end
-  <br/>
+  #parse("pagination_bottom.vm")
 </div>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/cluster.vm Sun Apr 28 23:30:57 2013
@@ -1,9 +1,19 @@
-<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>Clusters</h2>
+#**
+ *  Check if Clustering is Enabled and then
+ *  call cluster_results.vm
+ *#
+
+<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>
+  Clusters
+</h2>
+
+## Div tag has placeholder text by default
 <div id="clusters">
   Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see results
 </div>
-<script type="text/javascript">
 
+## Replace the div content *if* Carrot^2 is available
+<script type="text/javascript">
   $('#clusters').load("#url_for_solr/clustering#lens",
-    {'wt':'velocity', 'v.template':"clusterResults"});
+    {'wt':'velocity', 'v.template':"cluster_results"});
 </script>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/debug.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/debug.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/debug.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/debug.vm Sun Apr 28 23:30:57 2013
@@ -1,17 +1,28 @@
-#if($params.getBool("debugQuery",false))
-  <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a>
-  <pre style="display:none">$response.getExplainMap().get($doc.getFirstValue('id'))</pre>
-  <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>toggle all fields</a>
+#**
+ *  Show Debugging Information, if enabled
+ *#
+
+#if( $params.getBool("debugQuery",false) )
+  <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>
+    toggle explain</a>
+
+  <pre style="display:none">
+    $response.getExplainMap().get($doc.getFirstValue('id'))
+  </pre>
+
+  <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>
+    toggle all fields</a>
+
   <pre2 style="display:none">
-  #foreach($fieldname in $doc.fieldNames)
-     <br>
-       <span class="field-name">$fieldname :</span>
-       <span>
-       #foreach($value in $doc.getFieldValues($fieldname))
-         $esc.html($value)
-       #end
-       </span>
-  #end
-   </br>
+    #foreach($fieldname in $doc.fieldNames)
+      <br>
+        <span class="field-name">$fieldname :</span>
+        <span>
+          #foreach($value in $doc.getFieldValues($fieldname))
+            $esc.html($value)
+          #end
+        </span>
+      </br>
+    #end
   </pre2>
-#end
\ No newline at end of file
+#end

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/did_you_mean.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/did_you_mean.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/did_you_mean.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/did_you_mean.vm Sun Apr 28 23:30:57 2013
@@ -1,4 +1,9 @@
+#**
+ *  Hyperlinked spelling suggestions in results list
+ *#
+
 #set($dym = $response.response.spellcheck.suggestions.collation.collationQuery)
 #if($dym)
-  Did you mean <a href="#{url_for_home}#{lensNoQ}&q=$esc.url($dym)">$esc.html($dym)</a>?
-#end
\ No newline at end of file
+  Did you mean
+  <a href="#{url_for_home}#{lensNoQ}&q=$esc.url($dym)">$esc.html($dym)</a>?
+#end

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_fields.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_fields.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_fields.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_fields.vm Sun Apr 28 23:30:57 2013
@@ -1,15 +1,23 @@
+#**
+ *  Display facets based on field values
+ *  e.g.: fields specified by &facet.field=
+ *#
+
 #if($response.facetFields)
-    <h2 #annTitle("Facets generated by adding &facet.field= to the request")>Field Facets</h2>
-    #foreach($field in $response.facetFields)
-      ## Hide facets without value
-      #if($field.values.size() > 0)
+  <h2 #annTitle("Facets generated by adding &facet.field= to the request")>
+    Field Facets
+  </h2>
+  #foreach($field in $response.facetFields)
+    ## Hide facets without value
+    #if($field.values.size() > 0)
       <span class="facet-field">$field.name</span>
-
       <ul>
         #foreach($facet in $field.values)
-            <li><a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)</li>
+          <li>
+            <a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)
+          </li>
         #end
       </ul>
-      #end
-    #end
-  #end
\ No newline at end of file
+    #end  ## end if > 0
+  #end    ## end for each facet field
+#end      ## end if response has facet fields

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_pivot.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_pivot.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_pivot.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_pivot.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,12 @@
-<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>Pivot Facets</h2>
+#**
+ *  Display Pivot-Based Facets
+ *  e.g.: facets specified by &facet.pivot=
+ *#
+
+<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>
+  Pivot Facets
+</h2>
+
 #set($pivot = $response.response.facet_counts.facet_pivot)
+
 #display_facet_pivot($pivot, "")

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_queries.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_queries.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_queries.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_queries.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,12 @@
+#**
+ *  Display facets based on specific facet queries
+ *  e.g.: facets specified by &facet.query=
+ *#
+
 #set($field = $response.response.facet_counts.facet_queries)
-<h2 #annTitle("Facets generated by adding &facet.query= to the request")>Query Facets</h2>        
-#display_facet_query($field, "", "")
\ No newline at end of file
+
+<h2 #annTitle("Facets generated by adding &facet.query= to the request")>
+  Query Facets
+</h2>
+
+#display_facet_query($field, "", "")

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_ranges.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_ranges.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_ranges.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facet_ranges.vm Sun Apr 28 23:30:57 2013
@@ -1,4 +1,12 @@
-<h2 #annTitle("Facets generated by adding &facet.range= to the request")>Range Facets</h2>
+#**
+ *  Display facets based on ranges of values, AKA "Bukets"
+ *  e.g.: ranges specified by &facet.range=
+ *#
+
+<h2 #annTitle("Facets generated by adding &facet.range= to the request")>
+  Range Facets
+</h2>
+
 #foreach ($field in $response.response.facet_counts.facet_ranges)
   ## Hide facets without value
   #if($field.value.counts.size() > 0)
@@ -11,5 +19,5 @@
 	#set($before = $field.value.before)
 	#set($after = $field.value.after)
 	#display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
-  #end
-#end
\ No newline at end of file
+  #end  ## end if has any values
+#end    ## end for each facet range

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facets.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facets.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facets.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/facets.vm Sun Apr 28 23:30:57 2013
@@ -1,5 +1,10 @@
+#**
+ *  Overall Facet display block
+ *  Invokes the 4 facet and 1 cluster template
+ *#
+
 #parse('facet_fields.vm')
 #parse('facet_queries.vm')
 #parse('facet_ranges.vm')
 #parse('facet_pivot.vm')
-#parse('cluster.vm')
\ No newline at end of file
+#parse('cluster.vm')

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/footer.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/footer.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/footer.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/footer.vm Sun Apr 28 23:30:57 2013
@@ -1,17 +1,43 @@
+#**
+ *  Render the bottom section of the page visible to users
+ *#
+
 <hr/>
 <div>
   <span>Options:</span>
+
   #if($request.params.get('debugQuery'))
-  <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">disable debug</a>
+    <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">
+      disable debug</a>
   #else
-  <a href="#url_for_lens&debugQuery=true&fl=*,score">enable debug</a>
+    <a href="#url_for_lens&debugQuery=true&fl=*,score">
+      enable debug</a>
   #end
+  -
   #if($annotate)
-  <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">disable annotation</a>
+    <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">
+      disable annotation</a>
   #else
-  <a href="#url_for_lens&annotateBrowse=true">enable annotation</a>
+    <a href="#url_for_lens&annotateBrowse=true">
+      enable annotation</a>
   #end
-  <a #annTitle("Click to switch to an XML response: &wt=xml") href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">XML</a></div>
-<div>Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a></div>
-<div><span>Documentation: </span> <a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">Solr Wiki</a></div>
-<div>Disclaimer: The locations displayed in this demonstration are purely fictional.  It is more than likely that no store with the items listed actually exists at that location!</div>        
\ No newline at end of file
+  -
+  <a #annTitle("Click to switch to an XML response: &wt=xml") href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">
+    XML results</a>
+
+</div>
+
+<div>
+  Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a>
+</div>
+<div>
+  <span>Documentation: </span>
+  <a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">
+    Solr Wiki</a>
+  </div>
+<div>
+  Disclaimer:
+  The locations displayed in this demonstration are purely fictional.
+  It is more than likely that no store with the items listed actually
+  exists at that location!
+</div>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/head.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/head.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/head.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/head.vm Sun Apr 28 23:30:57 2013
@@ -1,7 +1,10 @@
-
-    ## An example of using an arbitrary request parameter
-    <title>#param('title')</title>
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+#**
+ *  Provide elements for the <head> section of the HTML document
+ *#
+
+  ## An example of using an arbitrary request parameter
+  <title>#param('title')</title>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
 
   <script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
   <link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
@@ -26,7 +29,7 @@
         }
       });
 
-      // http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=i&terms.sort=count
+      // http://localhost:8983/solr/collection1/terms?terms.fl=name&terms.prefix=i&terms.sort=count&wt=velocity&v.template=suggest
     });
 
-    </script>
\ No newline at end of file
+    </script>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/header.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/header.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/header.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/header.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,7 @@
+#**
+ *  Render the top section of the page visible to users
+ *#
+
 <div id="head">
   <span ><a href="#url_for_home#if($request.params.get('debugQuery'))?debugQuery=true#end"><img src="#{url_root}/img/solr.png" id="logo"/></a></span>
-</div>
\ No newline at end of file
+</div>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/hit.vm Sun Apr 28 23:30:57 2013
@@ -1,11 +1,25 @@
+#**
+ *  Called for each matching document but then
+ *  calls one of product_doc, join_doc or richtext_doc
+ *  depending on which fields the doc has
+ *#
+
 #set($docId = $doc.getFieldValue('id'))
 
 <div class="result-document">
-#if($doc.getFieldValue('name'))
-  #parse("product-doc.vm")
-#elseif($doc.getFieldValue('compName_s'))
-  #parse("join-doc.vm")
-#else
-  #parse("richtext-doc.vm")
-#end
+
+  ## Has a "name" field ?
+  #if($doc.getFieldValue('name'))
+    #parse("product_doc.vm")
+
+  ## Has a "compName_s" field ?
+  #elseif($doc.getFieldValue('compName_s'))
+    #parse("join_doc.vm")
+
+  ## Fallback to richtext_doc
+  #else
+    #parse("richtext_doc.vm")
+
+  #end
+
 </div>

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/layout.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/layout.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/layout.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/layout.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,7 @@
+#**
+ *  Overall HTML page layout
+ *#
+
 <html>
 <head>
   #parse("head.vm")

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/main.css
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/main.css?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/main.css (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/main.css Sun Apr 28 23:30:57 2013
@@ -49,10 +49,32 @@ a {
   position: relative;  
 }
 
+.tabs-bar {
+  padding: 5px;
+  width: 100%;
+  border: 1px solid;
+  border-width: 0px 0px 1px 0px;
+}
+.tab {
+  font-weight: bold;
+  padding: 5px;
+  margin: 0px 5px;
+  border: 1px solid;
+  background-color: #dddddd;
+  border-top-left-radius: 4px;
+  border-top-right-radius: 4px;
+}
+.tab:hover {
+  background: #FEC293;
+}
+.tab.selected {
+  background-color: #ffffff;
+  border-bottom: 1px solid #ffffff;
+}
+
 .navigators h2 {
   background: #FEC293;
-  border: 1px solid #ce9d77;
-  padding: 5px;
+  padding: 2px 5px;
 }
 
 .navigators ul {

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/suggest.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/suggest.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/suggest.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/suggest.vm Sun Apr 28 23:30:57 2013
@@ -1,3 +1,8 @@
+#**
+ *  Provides cynamic spelling suggestions
+ *  as you type in the search form
+ *#
+
 #foreach($t in $response.response.terms.name)
-$t.key
-#end
\ No newline at end of file
+  $t.key
+#end

Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/tabs.vm
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/tabs.vm?rev=1476858&r1=1476857&r2=1476858&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/tabs.vm (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/velocity/tabs.vm Sun Apr 28 23:30:57 2013
@@ -1,6 +1,50 @@
+#**
+ *  Provides navigation/access to Advanced search options
+ *  Usually displayed near the top of the page
+ *#
+
 ##TODO: Make some nice tabs here
+
 #set($queryOpts = $params.get("queryOpts"))
-<span #annTitle("Click the link to demonstrate various Solr capabilities")><span>Examples: </span><span class="tab">#if($queryOpts && $queryOpts != "")<a href="#url_for_home/?#debug#annotate">Simple</a>#{else}Simple#end</span>
-<span class="tab">#if($queryOpts == "spatial")Spatial#else<a href="#url_for_home?&queryOpts=spatial#debug#annotate">Spatial</a>#end</span>
-<span class="tab">#if($queryOpts == "group")Group By#else<a href="#url_for_home?#debug#annotate&queryOpts=group&group=true&group.field=manu_exact">Group By</a>#end</span></span>
-<hr/>        
\ No newline at end of file
+
+<div class="tabs-bar" #annTitle("Click the link to demonstrate various Solr capabilities")>
+
+  <span>Type of Search:</span>
+
+  ##queryOpts=$queryOpts
+
+  ## return to Simple Search
+  ##set( $selected = ($queryOpts && $queryOpts != "") )
+  #set( $selected = ! $queryOpts )
+  <span class="tab #if($selected)selected#end">
+    #if($selected)
+      Simple
+    #else
+      <a href="#url_for_home/?#debug#annotate">
+        Simple</a>
+    #end
+  </span>
+
+  ## GEO-Spatial / Location Based
+  #set( $selected = ($queryOpts == "spatial") )
+  <span class="tab #if($selected)selected#end">
+    #if($selected)
+      Spatial
+    #else
+      <a href="#url_for_home?&queryOpts=spatial#debug#annotate">
+        Spatial</a>
+    #end
+  </span>
+
+  ## Group By Field
+  #set( $selected = ($queryOpts == "group") )
+  <span class="tab #if($selected)selected#end">
+    #if($selected)
+      Group By
+    #else
+      <a href="#url_for_home?#debug#annotate&queryOpts=group&group=true&group.field=manu_exact">
+        Group By</a>
+    #end
+  </span>
+
+</div>