You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by rg...@apache.org on 2005/08/09 06:00:32 UTC

svn commit: r230965 - in /cocoon/gsoc/rgraham/refdoc/samples: slop.html snippets/add-attrs-neutralDoc.xsl snippets/searchxml-to-neutralDoc.xsl snippets/sitemap.xmap

Author: rgraham
Date: Mon Aug  8 21:00:23 2005
New Revision: 230965

URL: http://svn.apache.org/viewcvs?rev=230965&view=rev
Log:
Modified slop.html to use the query parameter pageLength in dealing with searching for now. This currently just sets the length of the returned search results to 100 and should be dynamic in the future.

Added add-attrs-neutralDoc.xsl for transforming the Neutral Docs to a better format for sorting and publishing.

Modified searchxml-to-neutralDoc.xsl trivially.

Modified sitemap.xmap to remove some doktor comments and tried to fix some problems. Specifically viewing the slop sitemap file's snippets.

Added:
    cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl
Modified:
    cocoon/gsoc/rgraham/refdoc/samples/slop.html
    cocoon/gsoc/rgraham/refdoc/samples/snippets/searchxml-to-neutralDoc.xsl
    cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap

Modified: cocoon/gsoc/rgraham/refdoc/samples/slop.html
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/slop.html?rev=230965&r1=230964&r2=230965&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/slop.html (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/slop.html Mon Aug  8 21:00:23 2005
@@ -87,7 +87,7 @@
     (see patch-README.txt for how to create the index)
     <ul>
       <li>
-        <a href="snippets/searchQuery/slop">Try to search our index for "slop"</a>
+        <a href="snippets/searchQuery/slop?pageLength=100">Try to search our index for "slop"</a>
       </li>
       <li>
         <a href="snippets/searchQuery/slop/neutraldoc">Neutral Document Generated from searchQuery for "slop"</a>

Added: cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl?rev=230965&view=auto
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl (added)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/add-attrs-neutralDoc.xsl Mon Aug  8 21:00:23 2005
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--
+  Reformating step one, Neutral Document for  publishing
+  SVN $Id: add-attrs-neutralDoc.xsl,v 1.1 2005/06/02 16:28:35 bdelacretaz Exp $
+ -->
+<xsl:transform version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+   <xsl:param name="query"/> 
+
+  <xsl:template match="/">
+      <xsl:element name="{$query}">
+        <xsl:apply-templates />
+      </xsl:element>  
+  </xsl:template>
+  
+  <xsl:template match="snippet">
+      <xsl:copy use-attribute-sets="snippet">
+        <xsl:call-template name="copy"/>
+       </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template name="copy">
+      <xsl:copy-of select="descendant::*"/>
+  </xsl:template>
+  
+  <xsl:attribute-set name="snippet">
+        <xsl:attribute name="type">
+            <xsl:value-of select="descendant::type/."/>
+        </xsl:attribute>
+        <xsl:attribute name="key">
+            <xsl:value-of select="descendant::key/."/>
+        </xsl:attribute>
+</xsl:attribute-set> 
+  
+</xsl:transform>
\ No newline at end of file

Modified: cocoon/gsoc/rgraham/refdoc/samples/snippets/searchxml-to-neutralDoc.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/searchxml-to-neutralDoc.xsl?rev=230965&r1=230964&r2=230965&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/searchxml-to-neutralDoc.xsl (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/searchxml-to-neutralDoc.xsl Mon Aug  8 21:00:23 2005
@@ -28,9 +28,7 @@
 
   <xsl:template match="//search:results">
     <xsl:element name="{@query-string}">
-        <xsl:apply-templates select="//search:hits/search:hit">
-            <xsl:sort order="descending" select="descendant::search:hits/search:hit/search:field[type = @name]/."/> 
-        </xsl:apply-templates>
+        <xsl:apply-templates select="//search:hits"/>
     </xsl:element> 
   </xsl:template>
   

Modified: cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap?rev=230965&r1=230964&r2=230965&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap Mon Aug  8 21:00:23 2005
@@ -35,6 +35,9 @@
     <map:view name="marked" from-label="marked">
       <map:serialize type="xml"/>
     </map:view>
+    <map:view name="neutralOne" from-label="neutralOne">
+      <map:serialize type="xml"/>
+    </map:view>
     <map:view name="select" from-label="select">
       <map:serialize type="xml"/>
     </map:view>
@@ -70,6 +73,8 @@
       </map:match>
       
       <!-- Testing searching from the pipeline -->
+      <!-- FIXME we need a better way to display more than 10 results per page than including
+          ?pageLength=100 in the query string -->
       <map:match pattern="searchQuery/*">
         <map:generate type="search">
           <map:parameter name="query" value="{1}"/>
@@ -78,9 +83,12 @@
       </map:match>
       
       <!-- Testing searching from the pipeline -->
-      <map:match pattern="**/neutraldoc">
-        <map:generate src="cocoon:/{1}"/>
-        <map:transform src="searchxml-to-neutralDoc.xsl"/>
+      <map:match pattern="searchQuery/*/neutraldoc">
+        <map:generate src="cocoon:/searchQuery/{1}?pageLength=100"/>
+        <map:transform label="neutralOne" src="searchxml-to-neutralDoc.xsl"/>
+        <map:transform src="add-attrs-neutralDoc.xsl">
+            <map:parameter name="query" value="{1}"/>
+        </map:transform>
         <map:serialize type="xml"/>
       </map:match>
 
@@ -134,10 +142,8 @@
 
       <!-- all other files: use text mode snippets extraction -->
       <!-- TODO: {1} should be used to select different code repositories -->
-      <!--@doktor-start key:slop, type:sitemap-example, name:SlopGenerator-->
       <map:match pattern="*/**.*">
         <map:generate type="slop" src="{global:slopbase}/{2}.{3}">
-       <!-- ... @doktor-end --> 
           <map:parameter name="preserve-space" value="true"/>
           <map:parameter name="valid-tagname-chars" value=""/>
         </map:generate>