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/31 06:34:43 UTC

svn commit: r264939 - in /cocoon/gsoc/rgraham/refdoc/samples: annotated-code/doktor-future.txt annotated-code/doktor-usage.txt index.html snippets/publish.xsl snippets/sitemap.xmap

Author: rgraham
Date: Tue Aug 30 21:34:25 2005
New Revision: 264939

URL: http://svn.apache.org/viewcvs?rev=264939&view=rev
Log:
Created publish.xsl to publish some files from a search on a key. The "published" keys are doktor-usage, doktor-about, and doktor-future. It is *very* simple.

The files corresponding to those keys are the locations for those comments.

Updated sitemap to no longer depend on slop stuff.

Updated Index to include info about configuring the Lucene Block index.


Added:
    cocoon/gsoc/rgraham/refdoc/samples/snippets/publish.xsl
Modified:
    cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-future.txt
    cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-usage.txt
    cocoon/gsoc/rgraham/refdoc/samples/index.html
    cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap

Modified: cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-future.txt
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-future.txt?rev=264939&r1=264938&r2=264939&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-future.txt (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-future.txt Tue Aug 30 21:34:25 2005
@@ -15,7 +15,7 @@
 */
 
 /*
-@doktor-start type:description, name:More Automation"
+@doktor-start type:description, name:More Automation
 
 While modifying the sitemap and creating html pages that allow easy access to the snippets
 is a functional method of doing things I think that the future holds more automated ways of creating the index
@@ -25,7 +25,7 @@
 */
 
 /*
-@doktor-start type:description, name:Cleaner XSL"
+@doktor-start type:description, name:Cleaner XSL
 
 The state of the XSL files right now is not perfect. Many could be refactored together or
 refeactored themselves to do things more efficiently or effectively. This is especially true of
@@ -46,7 +46,7 @@
 */
 
 /*
-@doktor-start type:description, name:Dynamic Publishing"
+@doktor-start type:description, name:Dynamic Publishing
 
 The doktor project would be greatly enhanced by the ability to search for any terms (not a key)
 and get a reasonable document returned. Currently that would be difficult to do, but it might be that

Modified: cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-usage.txt
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-usage.txt?rev=264939&r1=264938&r2=264939&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-usage.txt (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/annotated-code/doktor-usage.txt Tue Aug 30 21:34:25 2005
@@ -1,31 +1,31 @@
 @doktor key:doktor-usage
 
-@doktor-start type:description name:neutral-ordering.xsl
+@doktor-start type:description, name:neutral-ordering.xsl
 This template does for ordering the snippets in the netral doc for publishing them.
 @doktor-end
 
 
-@doktor-start type:description name:add-attrs-neutralDoc.xsl
+@doktor-start type:description, name:add-attrs-neutralDoc.xsl
 This template moves the name, type, and key into the snippet tag as attributes. It takes in the search query as a parameter.
 @doktor-end
 
 
-@doktor-start type:description name:clear-bad-keys.xsl
+@doktor-start type:description, name:clear-bad-keys.xsl
 This template clears all snippets out of the document that do not have
 keys that match the search query. It takes in the search query as a parameter.
 @doktor-end
 
 
-@doktor-start type:description name:searchxml-to-neutralDoc.xsl
+@doktor-start type:description, name:searchxml-to-neutralDoc.xsl
 This turns the search XML document into neutralDoc format. It takes in the search query as a parameter.
 @doktor-end
 
-@doktor-start type:description name:Search Pipeline
+@doktor-start type:description, name:Search Pipeline
 The search pipeline is pretty simple. It sets the component parameter for the
 Lucene block search to display 100 search queries per page. This is so we can have them all in one place to process, but isn't really a permanent solution. Finally it simply uses the Lucene block's search generator and serializes the result to XML.
 @doktor-end
 
-@doktor-start type:description name:Neutral Doc Pipeline
+@doktor-start type:description, name:Neutral Doc Pipeline
 The Neutral Doc pipeline has a few stages. First is takes the search query and gets the document returned for that as from the search pipeline. It then hands that to searchxml-to-neutralDoc.xsl. That then moves to addattrs-neutralDoc.xsl, clear-bad-keys.xsl, and finally neutral-ordering.xsl.
 @doktor-end
 

Modified: cocoon/gsoc/rgraham/refdoc/samples/index.html
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/index.html?rev=264939&r1=264938&r2=264939&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/index.html (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/index.html Tue Aug 30 21:34:25 2005
@@ -108,5 +108,12 @@
     <a href="slop.html">Extended Examples with SLOP block</a>
     </p>
     
+    
+    <h2>Configuring Lucene Block Index</h2>
+    Put this is you web-inf/xconf/cocoon-lucene.xconf file:
+      <pre><lucene-xml-indexer logger="core.search.lucene">
+      <index-fields>snippet_id, metadata, content</index-fields>
+      <store-fields>snippet_id, metadata, content, filename, key, type, name, filetype</store-fields>
+      </lucene-xml-indexer></pre>
   </body>
 </html>

Added: cocoon/gsoc/rgraham/refdoc/samples/snippets/publish.xsl
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/publish.xsl?rev=264939&view=auto
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/publish.xsl (added)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/publish.xsl Tue Aug 30 21:34:25 2005
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<!--
+  Publish my documents for doktor
+  SVN $Id: publish.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:template match="/">
+      <h3><xsl:value-of select="//snippet/@key"/></h3>
+      <h4>descriptions</h4>
+       <xsl:for-each select="//snippet">
+           <h5><xsl:value-of select="@name"/></h5>
+           <p><xsl:value-of select="descendant::content/."/></p>
+       </xsl:for-each>
+  </xsl:template>
+  
+  <xsl:template match="snippet[@type='']"> 
+    <h3><xsl:value-of select="@key"/></h3>
+  </xsl:template>
+
+  <xsl:template match="snippet"> 
+    <p><xsl:value-of select="//content"/></p>
+  </xsl:template>
+  
+</xsl:transform>
\ No newline at end of file

Modified: cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap?rev=264939&r1=264938&r2=264939&view=diff
==============================================================================
--- cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap (original)
+++ cocoon/gsoc/rgraham/refdoc/samples/snippets/sitemap.xmap Tue Aug 30 21:34:25 2005
@@ -35,12 +35,6 @@
     <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>
     <map:view name="raw-snippets" from-label="raw-snippets">
       <map:serialize type="xml"/>
     </map:view>
@@ -60,10 +54,9 @@
       <global-variables>
         <!-- TODO this should be configurable, maybe with several possible roots -->
         <codebase>../annotated-code</codebase>
-        <slopbase>../../slop</slopbase>
       </global-variables>
     </map:component-configurations>
-
+    
     <map:pipeline>
       <!-- Testing the indexing of LuceneIndexTransformer -->
       <map:match pattern="lit">
@@ -80,7 +73,7 @@
           <map:parameter name="query" value="{1}"/>
         </map:generate>  
         <map:serialize type="xml"/>
-      </map:match>
+      </map:match> 
       
       <!-- ND --> 
       <map:match pattern="searchQuery/*/neutraldoc">
@@ -95,6 +88,13 @@
         <map:transform src="neutral-ordering.xsl"/>
         <map:serialize type="xml"/>
       </map:match>
+      
+    <map:match pattern="searchQuery/*/neutraldoc/publish">
+      <map:generate src="cocoon:/searchQuery/{1}/neutraldoc"/>
+      <map:transform src="publish.xsl"/>
+      <map:serialize type="html"/>
+    </map:match>
+      
 
       <!-- retrieve the list of snippets in a file -->
       <map:match pattern="**/doktor-snippets/">
@@ -108,7 +108,7 @@
       <!-- retrieve a single snippet, for indexing -->
       <map:match pattern="**/doktor-snippets/*">
         <map:generate src="cocoon:/{1}"/>
-        <map:transform label="select" src="snippet-selector.xsl" >
+        <map:transform src="snippet-selector.xsl">
           <map:parameter name="snippetId" value="{2}"/>
         </map:transform>
         <map:transform src="snippets-to-index.xsl">
@@ -119,14 +119,14 @@
 
       <!-- top-level directory listing -->
       <map:match pattern="*/">
-        <map:generate type="directory" src="{global:slopbase}"/>
+        <map:generate type="directory" src="{global:codebase}"/>
         <map:transform label="links" src="dir-to-links.xsl"/>
         <map:serialize type="xml"/>
       </map:match>
 
       <!-- subdirectories listing -->
       <map:match pattern="*/**/">
-        <map:generate type="directory" src="{global:slopbase}/{2}"/>
+        <map:generate type="directory" src="{global:codebase}/{2}"/>
         <map:transform label="links" src="dir-to-links.xsl"/>
         <map:serialize type="xml"/>
       </map:match>
@@ -134,7 +134,7 @@
       <!-- XML files, xconf, sitemaps: use xml mode -->
       <!-- TODO: {1} should be used to select different code repositories -->
       <map:match type="regexp" pattern="^([^\./]+)/([^\.]+)\.(xml|xconf|xmap|xweb|xsamples)$">
-        <map:generate src="{global:slopbase}/{2}.{3}"/>
+        <map:generate src="{global:codebase}/{2}.{3}"/>
         <map:transform label="marked" src="mark-xml-comments.xsl"/>
         <map:transform label="raw-snippets" src="xml-to-snippets.xsl">
           <map:parameter name="filename" value="{2}.{3}"/>
@@ -146,8 +146,10 @@
 
       <!-- 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}">
+        <map:generate type="slop" src="{global:codebase}/{2}.{3}">
+       <!-- ... @doktor-end --> 
           <map:parameter name="preserve-space" value="true"/>
           <map:parameter name="valid-tagname-chars" value=""/>
         </map:generate>