You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/05/16 02:32:07 UTC

svn commit: r170289 [19/24] - in /lenya/site: ./ 1_2_x/ 1_2_x/components/accesscontrol/ 1_2_x/components/asset-management/ 1_2_x/components/authoring/ 1_2_x/components/deployment/ 1_2_x/components/editors/ 1_2_x/components/layout/ 1_2_x/components/link-management/ 1_2_x/components/metadata/ 1_2_x/components/multilingual/ 1_2_x/components/publication/ 1_2_x/components/repository/ 1_2_x/components/resource-types/ 1_2_x/components/revisioncontrol/ 1_2_x/components/search/ 1_2_x/components/sitemanagement/ 1_2_x/components/tasks/ 1_2_x/components/uri-handling/ 1_2_x/components/workflow/ 1_2_x/how-to/ 1_2_x/installation/ 1_2_x/misc/ 1_2_x/tutorial/ 1_4/ 1_4/concepts/ 1_4/installation/ 1_4/reference/ 1_4/reference/publication-templating/ 1_4/reference/usecase-framework/ community/

Added: lenya/site/1_2_x/how-to/new_publication.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_2_x/how-to/new_publication.pdf?rev=170289&view=auto
==============================================================================
--- lenya/site/1_2_x/how-to/new_publication.pdf (added)
+++ lenya/site/1_2_x/how-to/new_publication.pdf Sun May 15 17:32:04 2005
@@ -0,0 +1,205 @@
+%PDF-1.3
+%ª«¬­
+4 0 obj
+<< /Type /Info
+/Producer (FOP 0.20.5) >>
+endobj
+5 0 obj
+<< /Length 3035 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gatm>HZ.]L&c^a\@M(GV"*c8OHFq96c<YH...@BIBOt2sJfclp6qp-h>OeHA\lskdkY[eCnN/Sdn1jY41PNRD!`C^l)>C7:`)r^8*29BdFH%1>6k=*)5ijYNr(E.FQ%NF!5CU_YANOY;%c,@DZA(ljYipPeJ([peH[:6K+=DhgqVXrsboIlfiFKe?IXYITX0aV>\_M&kk:6Xnom?SrN)bV,_G<i^obF[VWR"RUF6-F6+bac1Q[p+aBD%`Ft?(B;>C,Ju<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AaCql+m<0p&(`.g$4g8UpI6!gKn)o)~>
+endstream
+endobj
+6 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 5 0 R
+/Annots 7 0 R
+>>
+endobj
+7 0 obj
+[
+8 0 R
+11 0 R
+]
+endobj
+8 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 129.3 562.6 223.284 550.6 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 10 0 R
+/H /I
+>>
+endobj
+9 0 obj
+<<
+/Type /FileSpec
+/F (typical-lenya-setup.pdf)
+>>
+endobj
+10 0 obj
+<<
+/S /GoToR
+/F 9 0 R
+/D [ 0 /XYZ null null null ] 
+>>
+endobj
+11 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 160.644 229.88 297.3 217.88 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (../../1_2_x/how-to/deploy_publication.html)
+/S /URI >>
+/H /I
+>>
+endobj
+12 0 obj
+<< /Length 1243 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gat%#?#SIU'ReT:+GujcJ;0@<;3L[^FNKE7BsZO2*p1:HCg%GuM4-icn\61=aXbJR2C(h6l2,IFGjces^GZjg'NkR.BRMR.'GqT@eX(u+=06bda0+["Fb9V*3K*GDh%=D%%rO^WjP%b%,*%&S(K_Ym,N*ja;Jg%ti.X'rpd*tgEsn^@OGY-*.SH&r$lnuV@=Tk?Bi(i-=>)fn(b):R(Q%e%9S+9Q3j+ZB$f.Pld/*?i2N)%BUTMD:_kMe_>D>9'56<00!D4G:'XO,CYUjj](,;l:lUAeK+JUj/nFXr3q=//&@&/tK#IXa&S!s[NgAW<In+-&*%%=g[M?jF3;ZV&gJPMD:da:)/<E)ZfJW2'UfJaBFP6Q#+KYS<fDd%=*$i!gkD@<$X@kIdJ,*a]O3QMdfL^b?kb@#>tamoICkfU1>iZF]Z/lXFDB55qf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A << /URI (../../1_2_x/how-to/look_and_feel.html)
+/S /URI >>
+/H /I
+>>
+endobj
+16 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 18.0 615.2 58.656 603.2 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (../../1_2_x/how-to/look_and_feel.html)
+/S /URI >>
+/H /I
+>>
+endobj
+17 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+18 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+19 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F6
+/BaseFont /Times-Italic
+/Encoding /WinAnsiEncoding >>
+endobj
+20 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /Helvetica
+/Encoding /WinAnsiEncoding >>
+endobj
+21 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F9
+/BaseFont /Courier
+/Encoding /WinAnsiEncoding >>
+endobj
+22 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica-Oblique
+/Encoding /WinAnsiEncoding >>
+endobj
+23 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F7
+/BaseFont /Times-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 2
+/Kids [6 0 R 13 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ >>
+endobj
+3 0 obj
+<< 
+/Font << /F3 17 0 R /F5 18 0 R /F1 20 0 R /F6 19 0 R /F9 21 0 R /F2 22 0 R /F7 23 0 R >> 
+/ProcSet [ /PDF /ImageC /Text ] >> 
+endobj
+xref
+0 24
+0000000000 65535 f 
+0000006446 00000 n 
+0000006511 00000 n 
+0000006561 00000 n 
+0000000015 00000 n 
+0000000071 00000 n 
+0000003198 00000 n 
+0000003318 00000 n 
+0000003350 00000 n 
+0000003482 00000 n 
+0000003548 00000 n 
+0000003619 00000 n 
+0000003811 00000 n 
+0000005147 00000 n 
+0000005270 00000 n 
+0000005304 00000 n 
+0000005490 00000 n 
+0000005673 00000 n 
+0000005786 00000 n 
+0000005896 00000 n 
+0000006007 00000 n 
+0000006115 00000 n 
+0000006221 00000 n 
+0000006337 00000 n 
+trailer
+<<
+/Size 24
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+6706
+%%EOF

Added: lenya/site/1_2_x/how-to/search-and-results.xsp
URL: http://svn.apache.org/viewcvs/lenya/site/1_2_x/how-to/search-and-results.xsp?rev=170289&view=auto
==============================================================================
--- lenya/site/1_2_x/how-to/search-and-results.xsp (added)
+++ lenya/site/1_2_x/how-to/search-and-results.xsp Sun May 15 17:32:04 2005
@@ -0,0 +1,656 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsp:page language="java"
+  xmlns:xsp="http://apache.org/xsp"
+  xmlns:util="http://apache.org/xsp/util/2.0"
+  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+>
+  <xsp:structure>
+    <xsp:include>java.io.FileNotFoundException</xsp:include>
+    <xsp:include>java.util.Enumeration</xsp:include>
+    <xsp:include>java.util.HashSet</xsp:include>
+    <xsp:include>java.util.Hashtable</xsp:include>
+    <xsp:include>java.util.Iterator</xsp:include>
+    <xsp:include>java.util.StringTokenizer</xsp:include>
+    <xsp:include>java.util.Vector</xsp:include>
+    <xsp:include>org.apache.avalon.framework.context.ContextException</xsp:include>
+    <xsp:include>org.apache.avalon.framework.component.ComponentException</xsp:include>
+    <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
+    <xsp:include>org.apache.lenya.ac.Accreditable</xsp:include>
+    <xsp:include>org.apache.lenya.ac.Identifiable</xsp:include>
+    <xsp:include>org.apache.lenya.ac.Identity</xsp:include>
+    <xsp:include>org.apache.lenya.lucene.ReTokenizeFile</xsp:include>
+    <xsp:include>org.apache.lenya.lucene.Publication</xsp:include>
+    <xsp:include>org.apache.lucene.analysis.Analyzer</xsp:include>
+    <xsp:include>org.apache.lucene.analysis.standard.StandardAnalyzer</xsp:include>
+    <xsp:include>org.apache.lucene.document.Document</xsp:include>
+    <xsp:include>org.apache.lucene.document.Field</xsp:include>
+    <xsp:include>org.apache.lucene.queryParser.QueryParser</xsp:include>
+    <xsp:include>org.apache.lucene.queryParser.MultiFieldQueryParser</xsp:include>
+    <xsp:include>org.apache.lucene.search.Hits</xsp:include>
+    <xsp:include>org.apache.lucene.search.IndexSearcher</xsp:include>
+    <xsp:include>org.apache.lucene.search.Query</xsp:include>
+    <xsp:include>org.apache.lucene.search.Searcher</xsp:include>
+    <xsp:include>org.apache.lucene.search.Sort</xsp:include>
+  </xsp:structure>
+
+<xsp:logic>
+    File workDir = null;
+    File indexDir=null;
+    File excerptDir=null;
+    String[] fields={"contents","title"};
+    String field = "contents";
+    Vector roles = new Vector();
+    Hashtable protectedAreas = new Hashtable();
+
+    /** 
+     * Contextualize this class 
+     */
+    public void contextualize(Context context) throws ContextException {
+      super.contextualize( context );
+      workDir = (File) context.get(Constants.CONTEXT_WORK_DIR);
+    }
+
+    /**
+     * Search index
+     */
+    Hits search(String query_string, String publication_id, String sortField, boolean sortReverse) throws ProcessingException, IOException{
+
+       // Load roles
+       Session session = request.getSession(true);
+       if(session != null){
+          Identity id=(Identity) session.getAttribute("org.apache.lenya.ac.Identity");
+          if(id != null){
+             Identifiable[] ids = id.getIdentifiables();
+             Accreditable[] acs =id.getAccreditables();
+             for (int ai = 0; ai &lt; acs.length; ai++) {
+                boolean found = false;
+                for(int i = 0; i &lt; ids.length; i++){
+                   if(ids[i].toString().equals(acs[ai].toString())){ found = true;}
+                }
+                if(!found){
+                   roles.add(acs[ai].toString());
+                }
+             }
+          }  // id
+       }  // session
+      hits=null;
+      try{
+        Searcher searcher=new IndexSearcher(indexDir.getAbsolutePath());
+        Analyzer l_analyzer=new StandardAnalyzer();
+
+        QueryParser l_queryParser = new QueryParser(field,l_analyzer); // Single field
+        l_queryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
+
+        getLogger().debug(query_string);
+        Query l_query = l_queryParser.parse(query_string); // Single field
+
+        if (sortField != null) {
+          Sort sort = new Sort(sortField, sortReverse);
+          hits = searcher.search(l_query, sort);
+        }else{
+          hits = searcher.search(l_query);
+        }
+        if(hits != null){
+          return hits;
+        }
+      }catch(IOException e){
+        System.err.println(".search(): EXCEPTION: "+e);
+        throw e;
+      }catch(Exception e){
+        System.err.println(".search(): EXCEPTION: "+e);
+      }
+      return null;
+   }
+
+   /**
+    *
+    */
+   String getPercent(float score){
+     return ""+java.lang.Math.round(score*100.0);
+   }
+
+   Hits hits;
+   int hits_length=-1;
+
+   String[] words=new String[0];
+
+   int hitsPerPage;
+   int maxPages;
+   int excerptOffset;
+   int start;
+   int end;
+
+</xsp:logic>
+
+  <search-and-results>
+<xsp:logic>
+    // ***********************
+    // *** Protected Areas ***
+    // ***********************
+    // DEFINITION: protectedAreas.add("/UrlStart", "group,group");  
+    // UrlStart begins with / after .../live.
+    // There are no spaces between groups and commas.
+    protectedAreas.put("/employee", "employee");
+
+    // Get sitemap path
+    org.apache.excalibur.source.Source input_source=this.resolver.resolveURI("");
+    String sitemapPath=input_source.getURI();
+    sitemapPath=sitemapPath.substring(5); // Remove "file:" protocol
+
+    // Read parameters from sitemap
+    String numberOfPubs = parameters.getParameter("number-of-pubs", "1");
+    Publication[] pubs = new Publication[Integer.parseInt(numberOfPubs)];
+    for(int i = 0;i &lt; pubs.length;i++) {
+      pubs[i] = new Publication();
+      pubs[i].id = parameters.getParameter("pub"+i+"-id","@ID@");
+      pubs[i].name = parameters.getParameter("pub"+i+"-name","@NAME@");
+      pubs[i].indexDir = parameters.getParameter("pub"+i+"-index-dir","@INDEX-DIR@");
+      pubs[i].searchFields = parameters.getParameter("pub"+i+"-search-fields","title,contents");
+      pubs[i].excerptDir = parameters.getParameter("pub"+i+"-excerpt-dir","@EXCERPT-DIR@");
+      pubs[i].prefix = parameters.getParameter("pub"+i+"-prefix","@PREFIX@");
+    }
+    String param_hits_per_page = parameters.getParameter("max-hits-per-page","13");
+    hitsPerPage = Integer.parseInt(param_hits_per_page);
+    String param_max_pages = parameters.getParameter("max-pages","5");
+    maxPages = Integer.parseInt(param_max_pages);
+    String param_excerpt_offset = parameters.getParameter("excerpt-offset","100");
+    excerptOffset = Integer.parseInt(param_excerpt_offset);
+
+    // Read parameters from query string
+    String urlQuerystring = <xsp-request:get-query-string />;
+    String query = <xsp-request:get-parameter name="query" default=""/>;
+    String publication_id = <xsp-request:get-parameter name="publication-id" default="phlburg"/>;
+    String sortBy = <xsp-request:get-parameter name="sortBy" default="score"/>;
+    String sortReverse = <xsp-request:get-parameter name="sortReverse" default="false"/>;
+
+    String language = "";
+    StringTokenizer qsTokens = new StringTokenizer(urlQuerystring, "&amp;&#061;", true);
+    String token = "";
+    HashSet languageSet = new HashSet();
+    if(qsTokens.hasMoreTokens()){ token = qsTokens.nextToken(); }
+    while(qsTokens.hasMoreTokens()){
+       if(token.equalsIgnoreCase("language")){ 
+          token = qsTokens.nextToken();
+          if(token.equals("=") &amp;&amp; qsTokens.hasMoreTokens()){
+             languageSet.add(qsTokens.nextToken());
+          }
+       }else{
+          token = qsTokens.nextToken();
+       }
+    }
+    Iterator languageSetItems = languageSet.iterator();
+    if(languageSetItems.hasNext()){ language = languageSetItems.next().toString(); }
+    while(languageSetItems.hasNext()){ language += "," + languageSetItems.next().toString(); }
+    if(language.length() == 0) language = "en";
+
+    String startString = <xsp-request:get-parameter name="start" default="1"/>;
+    String endString = <xsp-request:get-parameter name="end" default="10"/>;
+    start=new Integer(startString).intValue();
+    if(endString == null){
+      end=hitsPerPage;
+    }else{
+      end=new Integer(endString).intValue();
+    }
+
+    // Find the number of the selected publication
+    int whichPublication=0;
+    for (int i = 0;i &lt; pubs.length;i++) {
+      if (pubs[i].id.equals(publication_id)) {
+        whichPublication = i;
+      }
+    }
+
+    // Get all search fields
+    Vector twords = null;
+    Vector myFields = new Vector();
+    Enumeration parameterNames = request.getParameterNames();
+    while(parameterNames.hasMoreElements()){
+       String parameterName=(String)parameterNames.nextElement();
+       String value=request.getParameter(parameterName);
+
+       if (parameterName.indexOf(".fields") > 0) { // looking for field parameters
+          StringTokenizer st = new StringTokenizer(parameterName, ".");
+          int length = st.countTokens();
+          if(st.hasMoreTokens()){
+             String fieldPublicationId = st.nextToken();
+             if(st.hasMoreTokens()){
+                if(fieldPublicationId.equals(publication_id) || fieldPublicationId.equals("dummy-index-id")) {
+                   st.nextToken(); // Ignore "fields" token
+                   if(length == 2) { // radio or select
+                      myFields.addElement(value);
+                   }else if (length == 3) { // checkbox
+                      myFields.addElement(st.nextToken());
+                   }else{
+                      // something is wrong
+                   }
+                }
+             }
+          }
+       }
+    }
+    if(myFields.size() > 0) {
+       field = (String)myFields.elementAt(0);
+       fields = new String[myFields.size()];
+       for(int i = 0; i &lt; myFields.size(); i++) {
+          fields[i] = (String)myFields.elementAt(i);
+       }
+     }
+     // Set index and excerpt dir
+     String param_index_dir=pubs[whichPublication].indexDir;
+     if(param_index_dir.charAt(0) == '/'){
+        indexDir=new File(param_index_dir);
+        }
+     else{
+        indexDir=new File(sitemapPath+File.separator+param_index_dir);
+        }
+     String param_excerpt_dir=pubs[whichPublication].excerptDir;
+     if(param_excerpt_dir.charAt(0) == '/'){
+        excerptDir=new File(param_excerpt_dir);
+     }else{
+        excerptDir=new File(sitemapPath+File.separator+param_excerpt_dir);
+     }
+</xsp:logic>
+    <configuration><xsp:attribute name="checked-pid"><xsp:expr>publication_id</xsp:expr></xsp:attribute>
+      <number-of-publications><xsp:expr>numberOfPubs</xsp:expr></number-of-publications>
+
+<xsp:logic>
+      for(int i = 0;i &lt; pubs.length;i++) {
+</xsp:logic>
+         <publication><xsp:attribute name="pid"><xsp:expr>pubs[i].id</xsp:expr></xsp:attribute>
+           <name><xsp:expr>pubs[i].name</xsp:expr></name>
+           <index-dir><xsp:expr>pubs[i].indexDir</xsp:expr></index-dir>
+           <search-fields>
+<xsp:logic>
+               String[] searchFields = pubs[i].getFields();
+               if (searchFields != null) {
+                   for (int k = 0; k &lt; searchFields.length; k++) {
+                       <field><xsp:expr>searchFields[k]</xsp:expr></field>
+                   }
+               } else {
+</xsp:logic>
+                   <xsp:content><xsp:expr>pubs[i].searchFields</xsp:expr></xsp:content><exception>.getFields() returned null</exception>
+<xsp:logic>
+               }
+</xsp:logic>
+           </search-fields>
+           <excerpt-dir><xsp:expr>pubs[i].excerptDir</xsp:expr></excerpt-dir>
+           <prefix><xsp:expr>pubs[i].prefix</xsp:expr></prefix>
+         </publication>
+<xsp:logic>
+      }
+</xsp:logic>
+      <hits-per-page><xsp:expr>hitsPerPage</xsp:expr></hits-per-page>
+      <max-pages><xsp:expr>maxPages</xsp:expr></max-pages>
+      <excerpt-offset><xsp:expr>excerptOffset</xsp:expr></excerpt-offset>
+    </configuration>
+
+<!-- Search Results -->
+      <search>
+<xsp:logic>
+          Enumeration para_names = request.getParameterNames();
+          if(para_names.hasMoreElements()){
+</xsp:logic>
+            <request-parameters>
+<xsp:logic>
+              while(para_names.hasMoreElements()){
+                String para_name=(String)para_names.nextElement();
+                String para_value=request.getParameter(para_name);
+</xsp:logic>
+                <parameter><xsp:attribute name="name"><xsp:expr>para_name</xsp:expr></xsp:attribute><xsp:attribute name="value"><xsp:expr>para_value</xsp:expr></xsp:attribute></parameter>
+                <xsp:element><xsp:param name="name"><xsp:expr>para_name</xsp:expr></xsp:param><xsp:expr>para_value</xsp:expr></xsp:element>
+<xsp:logic>
+                }
+</xsp:logic>
+            </request-parameters>
+<xsp:logic>
+            }
+          if(query != null &amp;&amp; query.length() != 0 &amp;&amp; publication_id != null &amp;&amp; publication_id.length() > 0){
+
+            try {
+                if (sortBy.equals("score")) {
+                   hits = search(query, publication_id, null, false);
+                } else {
+                   if (sortReverse.equals("true")) {
+                       hits = search(query, publication_id, sortBy, true);
+                   } else {
+                       hits = search(query, publication_id, sortBy, false);
+                   }
+                }
+            } catch(Exception e) {
+</xsp:logic>
+                <exception><xsp:expr>e.toString()</xsp:expr></exception>
+<xsp:logic>
+            }
+            if(hits != null){
+              hits_length=hits.length();
+              }
+            else{
+              hits_length=-1;
+              hits=null;
+              }
+</xsp:logic>
+            <publication-id><xsp:expr>publication_id</xsp:expr></publication-id>
+            <publication-name><xsp:expr>pubs[whichPublication].name</xsp:expr></publication-name>
+            <publication-prefix><xsp:expr>pubs[whichPublication].prefix</xsp:expr></publication-prefix>
+            <sort-by><xsp:expr>sortBy</xsp:expr></sort-by>
+            <query><xsp:expr>query</xsp:expr></query>
+<xsp:logic>
+            if(query != null){
+              twords = new Vector();
+</xsp:logic>
+              <words>
+<xsp:logic>
+              StringTokenizer st=new StringTokenizer(query," ");
+              while(st.hasMoreTokens()){
+                String word=(String)st.nextElement();
+                if(!(word.equalsIgnoreCase("OR") || word.equalsIgnoreCase("AND"))){
+                  <word><xsp:expr>word</xsp:expr></word>
+                  twords.addElement(word);
+                  }
+                }
+              words=new String[twords.size()];
+              for(int i=0;i&lt;twords.size();i++){
+                words[i]=(String)twords.elementAt(i);
+              }
+</xsp:logic>
+              </words>
+<xsp:logic>
+              }
+</xsp:logic>
+            <start><xsp:expr>start</xsp:expr></start>
+            <end><xsp:expr>end</xsp:expr></end>
+            <language><xsp:expr>language</xsp:expr></language>
+            <fields>
+<xsp:logic>
+              for (int i = 0; i &lt; fields.length; i++) {
+                <field><xsp:expr>fields[i]</xsp:expr></field>
+              }
+</xsp:logic>
+            </fields>
+<xsp:logic>
+      try{
+        Analyzer ll_analyzer=new StandardAnalyzer();
+        QueryParser queryParser = new QueryParser(field,ll_analyzer);
+        //MultiFieldQueryParser queryParser = new MultiFieldQueryParser("contents",ll_analyzer);
+        queryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
+        Query ll_query = queryParser.parse(query);
+        //Query ll_query = queryParser.parse(query,fields,ll_analyzer);
+        <query><xsp:expr>ll_query.toString("contents")</xsp:expr></query>
+        }
+      catch(Exception e){
+        <exception><xsp:expr>e.toString()</xsp:expr></exception>
+        }
+            }
+          else{
+            hits_length=-1;
+            hits=null;
+            }
+</xsp:logic>
+      </search>
+<xsp:logic>
+            if(hits != null){
+    int validCount = 0;  //number of valid results
+</xsp:logic>
+        <results>
+<xsp:logic>
+       if(hits_length &gt; 0){
+</xsp:logic>
+     <hits>
+<xsp:logic>
+// i = index of result.  validCount = count valid results.
+for (int i = 0; (i &lt; hits.length()); i++) {
+                Document ldoc=hits.doc(i);
+                Enumeration lfields = ldoc.fields();
+                String lpath=ldoc.get("path");
+
+                String lurl=ldoc.get("url");
+                String ltitle=ldoc.get("title");
+                String mime_type=ldoc.get("mime-type");
+                String docLanguage = "";
+                if(lpath != null){
+</xsp:logic>
+                  <hit>
+                    <score><xsp:attribute name="percent"><xsp:expr>getPercent(hits.score(i))</xsp:expr></xsp:attribute>
+                    <xsp:expr>hits.score(i)</xsp:expr></score> 
+                    <path><xsp:expr>lpath</xsp:expr></path>
+                  </hit>
+<xsp:logic>
+                }
+                else if(lurl != null){
+                   // Check Language
+                   // This also filters sitetree.xml since it has no language.
+                   docLanguage = "";
+                   while (lfields.hasMoreElements()) {
+                      Field lfield = (Field)lfields.nextElement();
+			    if(0 == lfield.name().compareTo("language")){
+                         docLanguage = lfield.stringValue();
+			    }
+                   }
+</xsp:logic>
+<language><xsp:expr>language</xsp:expr></language>
+<language-check><xsp:attribute name="doc"><xsp:expr>docLanguage</xsp:expr></xsp:attribute></language-check>
+<xsp:logic>
+                   if((docLanguage.length() > 0) &amp;&amp; (language.indexOf(docLanguage) != -1)){
+</xsp:logic>
+<language-yes/>
+<xsp:logic>
+                      // Get URL parts
+                      String parent = "";
+                      String filename = "";
+                      String querystring = "";
+                      if(lurl.lastIndexOf("/") &gt; -1) {
+                          parent = lurl.substring(0,lurl.lastIndexOf("/"));
+                          filename = lurl.substring(lurl.lastIndexOf("/")+1);
+                      }
+                      if(lurl.indexOf("?") &gt; -1) {
+                          querystring = lurl.substring(lurl.indexOf("?"));
+                      }
+                      // Check Restricted
+                      boolean restricted = false;
+                      // Get list of restricted prefixes and check against roles.
+                      Enumeration protectedArea = protectedAreas.keys();
+                      while((!restricted) &amp;&amp; protectedArea.hasMoreElements()){
+                         String startUrl = (String) protectedArea.nextElement();
+                         if(parent.startsWith(startUrl)){
+                            StringTokenizer rolesAllowed = new StringTokenizer((String)protectedAreas.get(startUrl), ",");
+                            restricted = true; 
+                            while(rolesAllowed.hasMoreElements()){
+                      // Check roles
+                               if(roles.contains(rolesAllowed.nextElement())){
+                                  restricted = false;
+                               }
+                            }
+                         }
+                      }
+                      if(!restricted){
+                         // Build hit
+                         validCount++;
+                         if((validCount &gt;= start) &amp;&amp; (validCount &lt;= end)){
+</xsp:logic>
+                  <hit><xsp:attribute name="pos"><xsp:expr>validCount</xsp:expr></xsp:attribute>
+                    <fields>
+<xsp:logic>
+                    lfields = ldoc.fields();
+                    int first = -1;
+                    while (lfields.hasMoreElements()) {
+                       Field lfield = (Field)lfields.nextElement();
+                       String slfield = lfield.stringValue();
+
+                       if(lfield.name().equals("htmlbody")){
+                          String tmphtmlbody = slfield;
+                          String upperhtmlbody = tmphtmlbody.toUpperCase();
+                          if(twords != null){
+                             Enumeration twordsE = twords.elements();
+                             while(twordsE.hasMoreElements()){
+                                int last = 0;
+                                String word = twordsE.nextElement().toString();
+                                String upperword = word.toUpperCase();
+                                int wordLen = word.length();
+                                StringBuffer sb = new StringBuffer();
+                                int current = upperhtmlbody.indexOf(upperword);
+                                if((current &lt; first) || (first == -1)) first = current;
+                                while(current &gt; last){
+                                   sb.append(tmphtmlbody.substring(last, current));
+                                   sb.append("~").append(tmphtmlbody.substring(current, current + wordLen)).append("~");
+                                   last = current + wordLen;
+                                   current = upperhtmlbody.indexOf(upperword, last);
+                                }
+                                sb.append(tmphtmlbody.substring(last));
+                                tmphtmlbody = sb.toString();
+                                upperhtmlbody = tmphtmlbody.toUpperCase();
+                             }
+                          }
+                          if(slfield.length() &gt; excerptOffset){
+                             int start = 0;
+                             int end = excerptOffset;
+                             int half = excerptOffset/2;
+                             if(first &lt; half){
+                                end = tmphtmlbody.indexOf(' ', excerptOffset);
+                             }else{
+                                start = tmphtmlbody.indexOf(' ', first - half);
+                                end = tmphtmlbody.indexOf(' ', start + excerptOffset);
+                             }
+                             tmphtmlbody = tmphtmlbody.substring(start, end);
+                          }
+                          StringTokenizer tokens = new StringTokenizer(tmphtmlbody, "~");
+                          boolean needCloseHtmlBody = false;
+                          if(tokens.hasMoreTokens()){
+                          needCloseHtmlBody = true;
+</xsp:logic>
+                             <htmlbody><xsp:expr>tokens.nextToken()</xsp:expr>
+<xsp:logic>
+                          }
+                          while(tokens.hasMoreTokens()){
+</xsp:logic>
+                             <word><xsp:expr>tokens.nextToken()</xsp:expr></word>
+<xsp:logic>
+                             if(tokens.hasMoreTokens()){
+</xsp:logic>
+                                <xsp:expr>tokens.nextToken()</xsp:expr>
+<xsp:logic>
+                             }
+                          }
+                          if(needCloseHtmlBody){
+</xsp:logic>
+                             </htmlbody>
+<xsp:logic>
+                          }
+                       }else{
+
+</xsp:logic>
+                        <xsp:element><xsp:param name="name"><xsp:expr>lfield.name()</xsp:expr></xsp:param><xsp:expr>slfield</xsp:expr></xsp:element>
+<xsp:logic>
+                       }
+                    }
+
+</xsp:logic>
+                    </fields>
+                    <score><xsp:attribute name="percent"><xsp:expr>getPercent(hits.score(i))</xsp:expr></xsp:attribute><xsp:expr>hits.score(i)</xsp:expr></score> 
+                    <uri>
+                      <xsp:attribute name="parent"><xsp:expr>parent</xsp:expr></xsp:attribute>
+                      <xsp:attribute name="filename"><xsp:expr>filename</xsp:expr></xsp:attribute>
+                      <xsp:attribute name="querystring"><xsp:expr>querystring</xsp:expr></xsp:attribute>
+                      <xsp:expr>lurl</xsp:expr>
+                    </uri>
+<xsp:logic>
+                    File excerptFile=new File(excerptDir+File.separator+lurl);
+                    if((ltitle != null) &amp;&amp; (ltitle.length() &gt; 0)){
+                      <title><xsp:expr>ltitle</xsp:expr></title>
+                    }else{
+                      <title><xsp:expr>excerptFile.getName()</xsp:expr></title>
+                      <no-title/>
+                    }
+                    if((mime_type != null) &amp;&amp; (mime_type.length() &gt; 0)){
+                      <mime-type><xsp:expr>mime_type</xsp:expr></mime-type>
+                    }else{
+                      <no-mime-type/>
+                    }
+                    try{
+                      ReTokenizeFile rtf=new ReTokenizeFile();
+                      rtf.setOffset(excerptOffset);
+                      String excerpt=rtf.getExcerpt(excerptFile,words);
+                      if(excerpt != null){
+                        excerpt=rtf.emphasizeAsXML(rtf.tidy(excerpt),words);
+                        <util:include-expr><util:expr><xsp:expr>excerpt</xsp:expr></util:expr></util:include-expr>
+                      }else{
+                        throw new Exception("excerpt == null. Maybe file does not contain the words!");
+                        }
+                      }
+                    catch(FileNotFoundException e){
+</xsp:logic>
+                      <no-excerpt>
+                      <file><xsp:attribute name="src"><xsp:expr>excerptFile.getAbsolutePath()+" "+words[0]+" "+e</xsp:expr></xsp:attribute></file>
+                      </no-excerpt>
+<xsp:logic>
+                      }
+                    catch(Exception e){
+                      <excerpt-exception><xsp:expr>""+e</xsp:expr></excerpt-exception>
+                      }
+</xsp:logic>
+                  </hit>
+<xsp:logic>
+                 }
+} // END - Within range (start-end)
+} // END - Check Restricted
+} // END - Check Language
+             }
+</xsp:logic>
+     </hits>
+<xsp:logic>
+        }else{
+</xsp:logic>
+       <no-hits/>
+<xsp:logic>
+        }
+             int number_of_pages=(validCount/hitsPerPage);
+             if(number_of_pages*hitsPerPage != validCount){
+               number_of_pages=number_of_pages+1;
+               }
+             if(number_of_pages &gt; maxPages){
+               number_of_pages=maxPages;
+               }
+             if(validCount == 0){
+               number_of_pages=0;
+               <no-pages/>
+               }
+             else{
+</xsp:logic>
+             <pages>
+<xsp:logic>
+             for(int i=0;i&lt;number_of_pages;i++){
+               int pstart=i*hitsPerPage+1;
+               int pend=(i+1)*hitsPerPage;
+               if(validCount &lt; pend){
+                 pend=validCount;
+                 }
+               String type="other";
+               if(pstart == start){
+                 type="current";
+                 }
+               else if(pstart == start-hitsPerPage){
+                 type="previous";
+                 }
+               else if(pstart == start+hitsPerPage){
+                 type="next";
+                 }
+</xsp:logic>
+               <page>
+                 <xsp:attribute name="start"><xsp:expr>pstart</xsp:expr></xsp:attribute>
+                 <xsp:attribute name="end"><xsp:expr>pend</xsp:expr></xsp:attribute>
+                 <xsp:attribute name="type"><xsp:expr>type</xsp:expr></xsp:attribute>
+               </page>
+<xsp:logic>
+              }
+</xsp:logic>
+             </pages>
+<xsp:logic>
+             }
+</xsp:logic>
+<total-hits><xsp:expr>validCount</xsp:expr></total-hits>
+        </results>
+<xsp:logic>
+            }
+</xsp:logic>
+   </search-and-results>
+</xsp:page>
+

Added: lenya/site/1_2_x/how-to/search.html
URL: http://svn.apache.org/viewcvs/lenya/site/1_2_x/how-to/search.html?rev=170289&view=auto
==============================================================================
--- lenya/site/1_2_x/how-to/search.html (added)
+++ lenya/site/1_2_x/how-to/search.html Sun May 15 17:32:04 2005
@@ -0,0 +1,730 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.6">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Searching Publications How-To</title>
+<link type="text/css" href="../../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../../skin/profile.css" rel="stylesheet">
+<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../../favicon.ico">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache</a> &gt; <a href="http://lenya.apache.org/">lenya</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href=""><img class="logoImage" alt="Lenya" src="../../images/apache-lenya-light.png" title=""></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href=""></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with :');" value="Search the site with :" size="25" name="q" id="query" type="text">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li>
+<a class="base-not-selected" href="../../index.html">Project</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../1_4/index.html">Version 1.4</a>
+</li>
+<li class="current">
+<a class="base-selected" href="../../1_2_x/index.html">Version 1.2</a>
+</li>
+<li>
+<a class="base-not-selected" href="../../community/index.html">Community</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript" language="JavaScript"><!--
+              document.write("Published: " + document.lastModified);
+              //  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+             
+             &nbsp;
+           </div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Version 1.2</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../1_2_x/index.html">Index</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.2', '../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div>
+<div id="menu_1.1.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/installation/index.html">Download</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/installation/subversion.html">Subversion Access</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/installation/source_version.html">Install Instructions</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../../skin/')" id="menu_1.1.3Title" class="menutitle">Tutorial</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/index.html">Introduction</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/understanding_lenya.html">1. Understanding Lenya</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/installing_lenya.html">2. Installing Lenya</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/anatomy_of_the_pipeline.html">3. Anatomy of the Pipeline</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/editing_in_lenya.html">4. Editing in Lenya</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/custom_navigation.html">5. Custom Navigation in Lenya</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/mod_proxy_and_lenya.html">6a. Mod Proxy and Lenya</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/tutorial/mod_proxy_and_lenya_continued.html">6b. Mod Proxy and Lenya</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">How-To</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/faq.html">FAQ</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/new_publication.html">New Publication</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/deploy_publication.html">Deploy Publication</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/look_and_feel.html">Look and Feel</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/custom_resourcetype.html">Custom Resource Type</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/new_mime_type.html">Adding Mime Types</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/site_navigation.html">Site Navigation</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/ldap_authentication.html">LDAP Authentication</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/cms_menus.html">CMS Menus</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/cms_screens.html">CMS Screens</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Search Publications</div>
+<div class="menupageitemgroup">
+<div class="menupageitem">
+<a href="#Introduction">Introduction</a>
+</div>
+<div class="menupageitem">
+<a title="Indexing on Windows" href="#Indexing+on+Windows">Indexing on Windows...</a>
+</div>
+<div class="menupageitem">
+<a title="Fix the XML results to be usable." href="#Fix+the+XML+results+to+be+usable.">Fix the XML results...</a>
+</div>
+<div class="menupageitem">
+<a title="Blocking default search." href="#Blocking+default+search.">Blocking default se...</a>
+</div>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/how-to/external_data.html">External Data</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5', '../../skin/')" id="menu_1.1.5Title" class="menutitle">Components</div>
+<div id="menu_1.1.5" class="menuitemgroup">
+<div onclick="SwitchMenu('menu_1.1.5.1', '../../skin/')" id="menu_1.1.5.1Title" class="menutitle">Access&nbsp;Control</div>
+<div id="menu_1.1.5.1" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/terms.html">Basic Terms</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/accesscontrollers.html">Access&nbsp;Controllers</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/accesscontrollerresolvers.html">Access Controller Resolvers</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/authenticators.html">Authenticators</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/authorizers.html">Authorizers</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/policymanagers.html">Policies and Policy&nbsp;Managers</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/accreditablemanagers.html">Accreditable&nbsp;Managers</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/accesscontrol/ssl.html">SSL Encryption</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.2', '../../skin/')" id="menu_1.1.5.2Title" class="menutitle">Authoring</div>
+<div id="menu_1.1.5.2" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/authoring/adding-document-creator.html">Adding a new document creator</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/authoring/image-upload.html">Image Upload</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/authoring/openoffice.html">OpenOffice</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.3', '../../skin/')" id="menu_1.1.5.3Title" class="menutitle">Deployment</div>
+<div id="menu_1.1.5.3" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/deployment/proxying.html">Proxying</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.4', '../../skin/')" id="menu_1.1.5.4Title" class="menutitle">Editors</div>
+<div id="menu_1.1.5.4" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/editors/htmlform.html">HTML Form Editor</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/editors/1form.html">HTML One Form Editor</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/editors/bxe.html">Bitflux Editor</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/editors/kupu.html">Kupu</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/editors/xopus.html">Xopus</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.5', '../../skin/')" id="menu_1.1.5.5Title" class="menutitle">Layout</div>
+<div id="menu_1.1.5.5" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/layout/navigation.html">Navigation</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/layout/xhtml-templating.html">XHTML templating</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/layout/static-resources.html">Serving static resources</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/layout/lenya-menubar.html">Lenya Menubar</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.6', '../../skin/')" id="menu_1.1.5.6Title" class="menutitle">Publication</div>
+<div id="menu_1.1.5.6" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/publication/pageenvelopemodule.html">PageEnvelopeModule</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/publication/siteTree.html">Site tree</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.7', '../../skin/')" id="menu_1.1.5.7Title" class="menutitle">Resource&nbsp;Types</div>
+<div id="menu_1.1.5.7" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/resource-types/resource-types.html">Resource&nbsp;Types</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.8', '../../skin/')" id="menu_1.1.5.8Title" class="menutitle">Revision Control</div>
+<div id="menu_1.1.5.8" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/revisioncontroller.html">Revision Controller</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/rcml.html">RCML</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/checkin.html">Check In</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/checkout.html">Check Out</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/version.html">Revisions</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/revisioncontrol/rollback.html">Rollback</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.9', '../../skin/')" id="menu_1.1.5.9Title" class="menutitle">Repository</div>
+<div id="menu_1.1.5.9" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/repository/webdav.html">WebDAV Servers</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.10', '../../skin/')" id="menu_1.1.5.10Title" class="menutitle">Search</div>
+<div id="menu_1.1.5.10" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/search/lucene.html">Searching with Lucene</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.11', '../../skin/')" id="menu_1.1.5.11Title" class="menutitle">URI Handling</div>
+<div id="menu_1.1.5.11" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/uri-handling/URIParametrizer.html">URI Parametrizer</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/uri-handling/standardURI.html">URI Scheme</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/uri-handling/usecases.html">Usecases</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.12', '../../skin/')" id="menu_1.1.5.12Title" class="menutitle">Asset Management</div>
+<div id="menu_1.1.5.12" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/asset-management/management.html">Asset Management</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.13', '../../skin/')" id="menu_1.1.5.13Title" class="menutitle">Link Management</div>
+<div id="menu_1.1.5.13" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/link-management/link-management.html">Link Management</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.14', '../../skin/')" id="menu_1.1.5.14Title" class="menutitle">Meta Data</div>
+<div id="menu_1.1.5.14" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/metadata/metadata.html">Meta Data Handling</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.15', '../../skin/')" id="menu_1.1.5.15Title" class="menutitle">Multilingual Documents</div>
+<div id="menu_1.1.5.15" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/multilingual/multilingual.html">Multilingual Document Handling</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.16', '../../skin/')" id="menu_1.1.5.16Title" class="menutitle">Tasks</div>
+<div id="menu_1.1.5.16" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/concept.html">The Task Concept</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/defining.html">Defining Tasks</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/taskaction.html">The TaskAction</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/scheduling.html">Scheduling a Task</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.16.5', '../../skin/')" id="menu_1.1.5.16.5Title" class="menutitle">Included tasks</div>
+<div id="menu_1.1.5.16.5" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/anttask.html">AntTask</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/publisher.html">DefaultFilePublisher</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/exporter.html">StaticHTMLExporter</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/mailtask.html">MailTask</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/tasks/development.html">Developing Tasks</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.17', '../../skin/')" id="menu_1.1.5.17Title" class="menutitle">Workflow</div>
+<div id="menu_1.1.5.17" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/workflow/terms.html">Terms</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/workflow/state-machine.html">The State Machine</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/workflow/configuration.html">Configuration</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/workflow/implementation.html">Implementation</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.5.18', '../../skin/')" id="menu_1.1.5.18Title" class="menutitle">Site Management</div>
+<div id="menu_1.1.5.18" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/archive.html">Archive</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/copy.html">Copy</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/deactivate.html">Deactivate</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/delete.html">Delete</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/deletetrash.html">Delete the trash</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/move.html">Move</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/moveupdown.html">Move Up/Down</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/rename.html">Rename</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/components/sitemanagement/restore.html">Restore</a>
+</div>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.1.6', '../../skin/')" id="menu_1.1.6Title" class="menutitle">Miscellaneous</div>
+<div id="menu_1.1.6" class="menuitemgroup">
+<div class="menuitem">
+<a title="" href="../../1_2_x/misc/namespaces.html">Namespaces</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/misc/coding-guidelines.html">Coding Guidelines</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/misc/reserved_names.html">Reserved Names</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/misc/unittests.html">Unit Tests</a>
+</div>
+<div class="menuitem">
+<a title="" href="../../1_2_x/misc/xinclude-processor.html">XInclude Processor</a>
+</div>
+</div>
+<div class="menuitem">
+<a title="" href="../../../apidocs/1.2/index.html">1.2 API (Javadoc)</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div id="skinconf-txtlink"></div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="search.pdf"><img alt="PDF -icon" src="../../skin/images/pdfdoc.gif" class="skin"><br>
+        PDF</a>
+</div>
+<h1>Searching Publications How-To</h1>
+    
+<a name="N1000E"></a><a name="Introduction"></a>
+<h2 class="h3">Introduction</h2>
+<div class="section">
+<p>This article has 4 goals:</p>
+<ol>
+            
+<li>Complete instructions for indexing on Windows.</li>
+            
+<li>Display search with a publication's layout rather than the global layout.</li>
+            
+<li> Filter out a Member's Only area from the results.</li>
+            
+<li> Fix poor design decisions and bugs.</li>
+            
+</ol>
+<p>Changes include:</p>
+<ol>
+            
+<li> Index live XML files.<br>The standard method crawls the site, putting the results into the  "htdocs_dump" directory. The index is built from there. The index will not include documents not accessible from the start page, such as Members' Only sections. The index also include navigation menus.<br>Using the XML files indexes all content, whether accessible or not, and does not index the site architecture. If a visitor searches on "search", they should receive documents including the word "search", not every page with the search function (which should be every page in a well-designed website).<br>The index still includes everything in a document including header information such as author. It is easy to limit the index to the content body, but that could cause complications when using non-standard Lenya documents (Custom DocTypes/Resource Types). If Custom Doctypes are used, modify searchfixer.xsl (see below). <strong>Custom Doctypes were not tested with this configuration.</strong>
+</li>
+            
+            
+<li> Remove "Members' Only" documents if not authorized. Visitors must be logged in and in one of the specified Goups. It is the reverse of the current Lenya security, since deep URLs must pass the test for all parents. Example: /employees/programmers must pass tests for both the "/employees" and "/employees/programmers" sections.</li>
+            
+            
+<li> Add language to the index.</li>
+            
+<li> Limit initial search to current language.</li>
+            
+<li> Search page: Remove choice of publications. (This is a design decision. One publication = one website. With protected areas, there should be no need for multiple publications.)</li>
+            
+<li> Search page: Filter by chosen languages.</li>
+            
+<li> Default to search "Content", not "Title".</li>
+            
+<li> Increase the default results per page from 3 to 10.</li>
+</ol>
+<p>NOTE: Replace {pub} with your publication name in all instructions.</p>
+</div>
+            
+<a name="N1004E"></a><a name="Indexing+on+Windows"></a>
+<h2 class="h3">Indexing on Windows</h2>
+<div class="section">
+<p>This assumes Lenya 1.2.2 was installed to C:\apache-lenya-1.2.2 If your installation is different, adjust the paths. The indexer adds namespaces to the data of Fields in the index. The namespaces are not used (and are annoying), so remove them. An alternative is to fix the XML later, but why bother? File: <em>C:\apache-lenya-1.2.2\build\lenya\webapp\WEB-INF\classes\org\apache\lenya\lucene\index\configuration2xslt.xsl</em> Add the following line:</p>
+<pre class="code">&lt;xsl:template match="namespace"/&gt;</pre>
+<ol>
+<li>Set the configuration by changing: <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\config\search\lucene-live.xconf</em>
+            To:
+            <pre class="code">
+            &lt;?xml version="1.0"?&gt;
+             &lt;lucene&gt;
+                 &lt;update-index type="new"/&gt;
+                 &lt;index-dir src="../../work/search/lucene/index/live/index"/&gt;
+                 &lt;htdocs-dump-dir src="../../content/live"/&gt;
+                 &lt;indexer class="org.apache.lenya.lucene.index.ConfigurableIndexer"&gt;
+                     &lt;configuration src="lenyadocs.xconf"/&gt;
+                     &lt;extensions src="xml"/&gt;
+                 &lt;/indexer&gt;
+             &lt;/lucene&gt;</pre>
+</li>
+            
+<li> Create a new file in the same directory to tell lucene what fields to index (filename must match the configuration src in lucene-live.xconf): <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\config\search\lenyadocs.xconf</em>
+            Add this:
+            <pre class="code">&lt;?xml version="1.0"?&gt;
+             &lt;luc:document xmlns:luc="http://apache.org/cocoon/lenya/lucene/1.0"&gt;
+             &lt;luc:field name="title" type="Text"&gt;
+                 &lt;namespace prefix="lenya"&gt;http://apache.org/cocoon/lenya/page-envelope/1.0&lt;/namespace&gt;
+                 &lt;namespace prefix="dc"&gt;http://purl.org/dc/elements/1.1/&lt;/namespace&gt;
+                 &lt;xpath&gt;/*/lenya:meta/dc:subject&lt;/xpath&gt;
+             &lt;/luc:field&gt;
+             &lt;luc:field name="htmltitle" type="Text"&gt;
+                 &lt;namespace prefix="xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/namespace&gt;
+                 &lt;xpath&gt;/xhtml:html/xhtml:head/xhtml:title&lt;/xpath&gt;
+             &lt;/luc:field&gt;
+             &lt;luc:field name="language" type="Text"&gt;
+                 &lt;namespace prefix="lenya"&gt;http://apache.org/cocoon/lenya/page-envelope/1.0&lt;/namespace&gt;
+                 &lt;namespace prefix="dc"&gt;http://purl.org/dc/elements/1.1/&lt;/namespace&gt;
+                 &lt;xpath&gt;/*/lenya:meta/dc:language&lt;/xpath&gt;
+             &lt;/luc:field&gt;
+             &lt;luc:field name="description" type="Text"&gt;
+                 &lt;namespace prefix="lenya"&gt;http://apache.org/cocoon/lenya/page-envelope/1.0&lt;/namespace&gt;
+                 &lt;namespace prefix="dc"&gt;http://purl.org/dc/elements/1.1/&lt;/namespace&gt;
+                 &lt;xpath&gt;/*/lenya:meta/dc:description&lt;/xpath&gt;
+             &lt;/luc:field&gt;
+             &lt;luc:field name="htmlbody" type="Text"&gt;
+                 &lt;namespace prefix="xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/namespace&gt;
+                 &lt;xpath&gt;/xhtml:html/xhtml:body&lt;/xpath&gt;
+             &lt;/luc:field&gt;
+             &lt;luc:field name="contents" type="UnStored" xpath="/"/&gt;
+             &lt;/luc:document&gt;</pre>
+            
+</li>
+            
+<li> Create a batch file: <em>C:\apache-lenya-1.2.2\tools\bin\Index-{pub}.bat</em> With this:
+            <pre class="code">
+             SET LENYAPUB={pub}
+             SET CLASSPATH=.
+             SET ANT_HOME=C:\apache-lenya-1.2.2\tools
+             ant -f ../../build/lenya/webapp/lenya/bin/crawl_and_index.xml
+            -Dlucene.xconf=../../build/lenya/webapp/lenya/pubs/%LENYAPUB%/config/search/lucene-live.xconf
+            index</pre>
+            
+</li>
+            
+            
+<li> To create a logfile (and avoid some ant errors), create a file: <em>C:\apache-lenya-1.2.2\tools\bin\log4j.properties</em> With this:
+            <pre class="code">
+             log4j.rootLogger=INFO, lucene
+             log4j.appender.lucene = org.apache.log4j.FileAppender
+             log4j.appender.lucene.File = lucene.log
+             log4j.appender.lucene.Append = false
+             log4j.appender.lucene.layout = org.apache.log4j.PatternLayout
+             log4j.appender.lucene.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p
+            %-30.30c{2} %x - %m %n</pre>
+            
+</li>
+            
+            
+<li> Quit Lenya (to avoid file-locking issues). Run the batch file. Check the  log.The index created works, but the results are not formatted properly.</li>
+            
+<li> "sitemap.xml" may appear.</li>
+            
+<li> All links are wrong. They have an extra slash and "/index_xx.xml" must be changed to ".html".</li>
+            
+<li> The excerpt is not available and displays a Java error.</li>
+            
+<li>These are fixed in the next section.</li>
+</ol>
+</div>
+<a name="N10094"></a><a name="Fix+the+XML+results+to+be+usable."></a>
+<h2 class="h3">Fix the XML results to be usable.</h2>
+<div class="section">
+<p>Copy <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\xslt\search\sort.xsl</em> To: <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\lenya\xslt\search\sort.xsl</em>. Copy <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\xslt\navigation\search.xsl</em>
+            to <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\lenya\xslt\navigation\search.xsl</em>
+            After the other params, add this line:</p>
+<pre class="code">&lt;xsl:param name="chosenlanguage"/&gt;</pre>
+<p>Add the usecase and language fields to the form tag:</p>
+<pre class="code">
+            &lt;form&gt;
+                &lt;input type="hidden" name="lenya.usecase" value="search"/&gt;
+                &lt;input type="hidden" name="language" value="{$chosenlanguage}"/&gt;
+                &lt;input class="searchfield" type="text" name="query" alt="Search field"/&gt;
+                &lt;input class="searchsubmit" type="submit" value="Search" name="find"/&gt;
+            &lt;/form&gt;</pre>
+<p>
+<a href="search-and-results.xsp">Download</a> new file: <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\lenya\content\search\search-and-results.xsp</em> Based on <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\content\search\search-and-results.xsp</em>
+</p>
+<ul>
+            
+<li>Removed useless information. (I like dynamic lists better than anyone, but Search is a standard function with standard outputs, so why bother? I only left the &lt;fields&gt; tag to separate our output from lucene's.)</li>
+            
+<li>Added language filter.</li>
+            
+<li>Added protected section filter.</li>
+            
+<li>Hardcoded ProtectedUrls. The default is to require visitors be in an  "employee" Group to access "/live/employee". <strong>Configure this for your website.</strong>
+</li>
+            
+<li>Uses Groups rather than Roles. (Roles are useless as long as "world" inherits "visit" for everything.)</li>
+            
+<li>Fixed counters and total. (Total-hits changed from property to element of results.)</li>
+           
+<li>Other bug fixes</li>
+</ul>
+<p>
+<a href="searchfixer.xsl">Download</a> new file: <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\lenya\xslt\search\searchfixer.xsl</em> This file converts our poor output to something usable.</p>
+<ul>
+<li>Add languages to configuration</li>
+            
+<li>Move total-hits from element to property of results.</li>
+            
+<li>Choose "title" from "htmltitle" or Lucene's "title".</li>
+            
+<li>Choose "excerpt" from "htmlbody", Lenya's "description", or Lucene's "excerpt"</li>
+            
+<li>Transform URI from lucene's "uri" (/about/jobs/index_en.xml) to Lenya link (about/jobs_en.html).</li>
+            
+<li>The default is to use htmlbody for the excerpt. <strong>This file must be modified when using Custom Doctypes that do not have a /html/body.</strong>
+</li>
+            
+</ul>
+<p>
+<a href="usecase-search.xmap">Download</a> new file:
+            <em>C:\apache-lenya-1.2.2\build\lenya\webapp\lenya\pubs\{pub}\usecase-search.xmap</em>
+</p>
+</div>
+<a name="N100FE"></a><a name="Blocking+default+search."></a>
+<h2 class="h3">Blocking default search.</h2>
+<div class="section">
+<p> It is important to block the default search when implementing ProtectedAreas to prevent visitors from typing the URL of the default search (or, if this publication was in production, using a bookmark to the old search) and seeing links to protected documents.</p>
+<ul> 
+            
+<li> Create new file:  <em>build\lenya\webapp\lenya\pubs\{pub}\lenya\lucene.xmap</em>
+</li>
+            
+<li>Add content:
+            <pre class="code">
+             &lt;?xml version="1.0" encoding="UTF-8"?&gt;
+             &lt;map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"&gt;
+             &lt;map:pipelines&gt;
+                 &lt;map:pipeline&gt;
+                     &lt;map:match pattern="*/search-*/lucene.xml"&gt;
+                         &lt;map:redirect-to uri="/{page-envelope:publication-id}/live/index.html?lenya.usecase=search"/&gt;
+                     &lt;/map:match&gt;
+                     &lt;map:match pattern="*/search-*/lucene*"&gt;
+                         &lt;map:redirect-to uri="/{page-envelope:publication-id}/live/index.html?lenya.usecase=search"/&gt;
+                     &lt;/map:match&gt;
+                 &lt;/map:pipeline&gt;
+             &lt;/map:pipelines&gt;
+             &lt;/map:sitemap&gt;</pre>
+</li>
+</ul>
+</div>   
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+ Copyright &copy; 2002-2005 The Apache Software Foundation.</div>
+<div id="feedback">
+    Send feedback about the website to:
+  <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A01_2_x/how-to/search.html">dev@lenya.apache.org</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Propchange: lenya/site/1_2_x/how-to/search.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: lenya/site/1_2_x/how-to/search.pdf
URL: http://svn.apache.org/viewcvs/lenya/site/1_2_x/how-to/search.pdf?rev=170289&view=auto
==============================================================================
--- lenya/site/1_2_x/how-to/search.pdf (added)
+++ lenya/site/1_2_x/how-to/search.pdf Sun May 15 17:32:04 2005
@@ -0,0 +1,347 @@
+%PDF-1.3
+%ª«¬­
+4 0 obj
+<< /Type /Info
+/Producer (FOP 0.20.5) >>
+endobj
+5 0 obj
+<< /Length 553 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gb!<L95g=S&:j6IME.ttSbdng*4&LD:"2dpJs8l%%P3uQ<,*dC]#h^j%;>.RKcCaNJS.(dO$=089br-0EaTIlaJsdC:D"/j#8Du>bhK'/b)jXmA:NQ^GUN*k37M]XJi-2!1E?B6G"l9'IB?N4[,:LqS`pkO6?Zj>8V#*epo`X*6-A60FdDJ7BcRI@'^Ej6$a"`SqX3E>!%$gr9T[79its)+46dckF(7\r(gj>Xe`BW[9ru@]6Msg-YY$orgL:HA+t+Xsc$O)]TKM7M<Q^[(puc]rY('fZ;BNMH6-r"oq8J.@H3Z0e-:h_SI#45/]WGN\T`3k\pobdsS^>MsB_p"1eZQ[YAdt=0:[eHA[R;Q-,p?V`)Q/tJPbLUBT(/]*`LjI^/7k(cHqr(KFm:2LHIH]O;\jBX-Oa@gi-?ll2LI,2&J1"*#VlF_KIXJ@2R\">'3g&;9-W=pDo%R5^aP'Xgm*>7D<q.oGBNb5$0id*#[<dbE2m_Hfh&]$apVRjdoCnA>>MTUK.=pb!53)@j+K,en"qe,0ACu^7(;pj8<dHE~>
+endstream
+endobj
+6 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 5 0 R
+/Annots 7 0 R
+>>
+endobj
+7 0 obj
+[
+8 0 R
+10 0 R
+12 0 R
+14 0 R
+]
+endobj
+8 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 12.0 631.666 79.328 619.666 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 9 0 R
+/H /I
+>>
+endobj
+10 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 12.0 613.466 126.656 601.466 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 11 0 R
+/H /I
+>>
+endobj
+12 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 12.0 595.266 180.992 583.266 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 13 0 R
+/H /I
+>>
+endobj
+14 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 12.0 577.066 136.976 565.066 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A 15 0 R
+/H /I
+>>
+endobj
+16 0 obj
+<< /Length 2992 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+Gat=.CQI5i(&bk]6I;'DJV`<Te...@5SiL>.[O"-O;cE;X59q2tOQQ^=:;;.*rjN%&tW9#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obj
+<< /Length 2803 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+GauHMCN%tM&cM-)5mRX/#M"_#LCrDdn\*%=OeT=Fr2D6)'tKL[:gA_cb<h<...@i>_%Pno!`qZ>j(>LtY:?d<Rl0>P3ea]dQ:P-K='27/&;>O6[D,pjY`QnY!aK+?3B8fcG.o85A8NQ-Ya$`,'OAhV[tk_m9b*bgpmTE<5.UL(`$<0+Hi$DUkfb0]`2rmsI?,Eg]I9C'G":_eQ@5JTP#r;q<Ot$j"^q%,s9TT"&0HXSAR$/#ZI9fSKfpJ;`]QBjhKcJ/=*t?'sO@oT2M2D:&a^F\D%mFB-lSn6tuWbq>iAGZu=as88:gMg]Y%>E?G[AJ4]\B$IV@mN3n\:t.7dZg<O&Lk5RB,sur;~>
+endstream
+endobj
+21 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 20 0 R
+/Annots 22 0 R
+>>
+endobj
+22 0 obj
+[
+23 0 R
+24 0 R
+25 0 R
+]
+endobj
+23 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 0.0 632.72 49.992 620.72 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (search-and-results.xsp)
+/S /URI >>
+/H /I
+>>
+endobj
+24 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 0.0 466.32 49.992 454.32 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (searchfixer.xsl)
+/S /URI >>
+/H /I
+>>
+endobj
+25 0 obj
+<< /Type /Annot
+/Subtype /Link
+/Rect [ 0.0 326.32 49.992 314.32 ]
+/C [ 0 0 0 ]
+/Border [ 0 0 0 ]
+/A << /URI (usecase-search.xmap)
+/S /URI >>
+/H /I
+>>
+endobj
+26 0 obj
+<< /Length 360 /Filter [ /ASCII85Decode /FlateDecode ]
+ >>
+stream
+GarVIbAP3?&A7TLHV=nrJ5%^t<N2sd<^!8d\$cP$i.pCGY3e(2h\Y$ei(tRKm%To=R>jPZ$@O.NAONMJm.P`k1r]Yd3)hLT>6B`B27*PtkT+LS>&>Q^@R!hLLkS_Lp/$k:&P0.!TMG!]\6keKF4V/?Z1l-K^-KA71]tlIoSad27*I?EUC"Ii\kVaib*ESm0h>I6cA/\rFC3NtkGGHU,uF9"HEoAr+V8ZF33:/#">`4Y87r%s?O9\@)."'EFCs;HmYd^>j-Y[ZHNEW_3WKO!'?=&-r3f%[pQ"I$EU#SS#RbJ-DPV;km:2n)^YdXWJ'kAWg",?O3/3#J=BW4I']::gRa/9)k(m;VJ'JLJp&~>
+endstream
+endobj
+27 0 obj
+<< /Type /Page
+/Parent 1 0 R
+/MediaBox [ 0 0 612 792 ]
+/Resources 3 0 R
+/Contents 26 0 R
+>>
+endobj
+29 0 obj
+<<
+ /Title (\376\377\0\61\0\40\0\111\0\156\0\164\0\162\0\157\0\144\0\165\0\143\0\164\0\151\0\157\0\156)
+ /Parent 28 0 R
+ /Next 30 0 R
+ /A 9 0 R
+>> endobj
+30 0 obj
+<<
+ /Title (\376\377\0\62\0\40\0\111\0\156\0\144\0\145\0\170\0\151\0\156\0\147\0\40\0\157\0\156\0\40\0\127\0\151\0\156\0\144\0\157\0\167\0\163)
+ /Parent 28 0 R
+ /Prev 29 0 R
+ /Next 31 0 R
+ /A 11 0 R
+>> endobj
+31 0 obj
+<<
+ /Title (\376\377\0\63\0\40\0\106\0\151\0\170\0\40\0\164\0\150\0\145\0\40\0\130\0\115\0\114\0\40\0\162\0\145\0\163\0\165\0\154\0\164\0\163\0\40\0\164\0\157\0\40\0\142\0\145\0\40\0\165\0\163\0\141\0\142\0\154\0\145\0\56)
+ /Parent 28 0 R
+ /Prev 30 0 R
+ /Next 32 0 R
+ /A 13 0 R
+>> endobj
+32 0 obj
+<<
+ /Title (\376\377\0\64\0\40\0\102\0\154\0\157\0\143\0\153\0\151\0\156\0\147\0\40\0\144\0\145\0\146\0\141\0\165\0\154\0\164\0\40\0\163\0\145\0\141\0\162\0\143\0\150\0\56)
+ /Parent 28 0 R
+ /Prev 31 0 R
+ /A 15 0 R
+>> endobj
+33 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+34 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F5
+/BaseFont /Times-Roman
+/Encoding /WinAnsiEncoding >>
+endobj
+35 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F6
+/BaseFont /Times-Italic
+/Encoding /WinAnsiEncoding >>
+endobj
+36 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /Helvetica
+/Encoding /WinAnsiEncoding >>
+endobj
+37 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F9
+/BaseFont /Courier
+/Encoding /WinAnsiEncoding >>
+endobj
+38 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica-Oblique
+/Encoding /WinAnsiEncoding >>
+endobj
+39 0 obj
+<< /Type /Font
+/Subtype /Type1
+/Name /F7
+/BaseFont /Times-Bold
+/Encoding /WinAnsiEncoding >>
+endobj
+1 0 obj
+<< /Type /Pages
+/Count 5
+/Kids [6 0 R 17 0 R 19 0 R 21 0 R 27 0 R ] >>
+endobj
+2 0 obj
+<< /Type /Catalog
+/Pages 1 0 R
+ /Outlines 28 0 R
+ /PageMode /UseOutlines
+ >>
+endobj
+3 0 obj
+<< 
+/Font << /F3 33 0 R /F5 34 0 R /F1 36 0 R /F6 35 0 R /F9 37 0 R /F2 38 0 R /F7 39 0 R >> 
+/ProcSet [ /PDF /ImageC /Text ] >> 
+endobj
+9 0 obj
+<<
+/S /GoTo
+/D [17 0 R /XYZ -5.0 731.0 null]
+>>
+endobj
+11 0 obj
+<<
+/S /GoTo
+/D [17 0 R /XYZ -5.0 306.266 null]
+>>
+endobj
+13 0 obj
+<<
+/S /GoTo
+/D [19 0 R /XYZ -5.0 155.3 null]
+>>
+endobj
+15 0 obj
+<<
+/S /GoTo
+/D [21 0 R /XYZ -5.0 303.32 null]
+>>
+endobj
+28 0 obj
+<<
+ /First 29 0 R
+ /Last 32 0 R
+>> endobj
+xref
+0 40
+0000000000 65535 f 
+0000013185 00000 n 
+0000013271 00000 n 
+0000013363 00000 n 
+0000000015 00000 n 
+0000000071 00000 n 
+0000000715 00000 n 
+0000000835 00000 n 
+0000000881 00000 n 
+0000013508 00000 n 
+0000001014 00000 n 
+0000013571 00000 n 
+0000001150 00000 n 
+0000013637 00000 n 
+0000001286 00000 n 
+0000013701 00000 n 
+0000001422 00000 n 
+0000004507 00000 n 
+0000004615 00000 n 
+0000007276 00000 n 
+0000007384 00000 n 
+0000010280 00000 n 
+0000010403 00000 n 
+0000010444 00000 n 
+0000010613 00000 n 
+0000010775 00000 n 
+0000010941 00000 n 
+0000011393 00000 n 
+0000013766 00000 n 
+0000011501 00000 n 
+0000011664 00000 n 
+0000011882 00000 n 
+0000012179 00000 n 
+0000012412 00000 n 
+0000012525 00000 n 
+0000012635 00000 n 
+0000012746 00000 n 
+0000012854 00000 n 
+0000012960 00000 n 
+0000013076 00000 n 
+trailer
+<<
+/Size 40
+/Root 2 0 R
+/Info 4 0 R
+>>
+startxref
+13817
+%%EOF

Added: lenya/site/1_2_x/how-to/searchfixer.xsl
URL: http://svn.apache.org/viewcvs/lenya/site/1_2_x/how-to/searchfixer.xsl?rev=170289&view=auto
==============================================================================
--- lenya/site/1_2_x/how-to/searchfixer.xsl (added)
+++ lenya/site/1_2_x/how-to/searchfixer.xsl Sun May 15 17:32:04 2005
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" 
+    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
+    xmlns:session="http://www.apache.org/xsp/session/2.0" 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+    <xsl:param name="area" select="'live'"/>
+
+<xsl:variable name="pubid">
+<xsl:value-of select="search-and-results/configuration/publication/name" />
+</xsl:variable>
+
+
+    <xsl:template match="search-results">
+        <xsl:apply-templates select="search-and-results"/>
+    </xsl:template>
+
+    <xsl:template match="search-and-results">
+       <search-and-results>
+         <configuration>
+           <xsl:apply-templates select="configuration"/>
+         </configuration>
+         <xsl:apply-templates select="search"/>
+         <xsl:apply-templates select="results"/>
+       </search-and-results>
+    </xsl:template>
+    
+    <xsl:template match="configuration">
+        <xsl:apply-templates/>
+        <xsl:apply-templates select="//search-results/publication/languages" />
+    </xsl:template>
+
+    <xsl:template match="languages">
+        <languages>
+           <xsl:apply-templates select="language"/>
+        </languages>
+    </xsl:template>
+
+    <xsl:template match="results">
+         <results total-hits="{total-hits}">
+           <xsl:apply-templates select="pages"/>
+           <xsl:apply-templates select="hits"/>
+         </results>
+    </xsl:template>
+
+    <xsl:template match="hits">
+       <hits>
+          <xsl:apply-templates select="hit"/>
+      </hits>
+    </xsl:template>
+
+    <xsl:template match="hit">
+       <xsl:if test="uri[@filename != 'sitetree.xml']">
+          <hit pos="{@pos}">
+             <xsl:apply-templates select="score"/>
+             <xsl:apply-templates select="uri"/>
+<title>
+<xsl:choose>
+<xsl:when test="string-length(fields/title) &gt; 0"><xsl:value-of select="fields/title"/></xsl:when>
+<xsl:when test="string-length(fields/htmltitle) &gt; 0"><xsl:value-of select="fields/htmltitle"/></xsl:when>
+<xsl:when test="string-length(title) &gt; 0"><xsl:value-of select="title"/></xsl:when>
+<xsl:otherwise>Untitled</xsl:otherwise>
+</xsl:choose>
+</title>
+
+<!--             <xsl:apply-templates select="excerpt"/>   Lucene Excerpt -->
+<!--             <xsl:apply-templates select="fields/description"/> Lenya Description -->
+             <xsl:apply-templates select="fields/htmlbody"/> <!-- HTML Body -->
+          </hit>
+       </xsl:if>
+    </xsl:template>
+    
+    <xsl:template match="uri">
+ <uri><xsl:value-of select="$pubid"/><xsl:value-of select="@parent"/>_<xsl:value-of select="../fields/language"/>.html</uri>
+    </xsl:template>
+    
+    <xsl:template match="description">
+        <excerpt><xsl:value-of select="."/></excerpt>
+    </xsl:template>
+    <xsl:template match="htmlbody">
+        <excerpt><xsl:apply-templates/></excerpt>
+    </xsl:template>
+
+    <xsl:template match="@*|node()" priority="-1">
+        <xsl:copy>
+            <xsl:apply-templates select="@*|node()"/>
+        </xsl:copy>
+    </xsl:template>
+</xsl:stylesheet>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org