You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2003/11/16 19:49:34 UTC
cvs commit: cocoon-lenya/src/webapp/lenya/xslt/search search-and-results.xsl
michi 2003/11/16 10:49:34
Modified: src/webapp/lenya lucene.xmap
src/webapp/lenya/content/search search-and-results.xsp
src/webapp/lenya/xslt/search search-and-results.xsl
Log:
search fields depending on the index added
Revision Changes Path
1.10 +14 -0 cocoon-lenya/src/webapp/lenya/lucene.xmap
Index: lucene.xmap
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/lucene.xmap,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- lucene.xmap 14 Nov 2003 21:02:16 -0000 1.9
+++ lucene.xmap 16 Nov 2003 18:49:34 -0000 1.10
@@ -17,13 +17,27 @@
<map:generate type="serverpages" src="content/search/search-and-results.xsp" label="xml">
<map:parameter name="max-hits-per-page" value="3"/>
<map:parameter name="max-pages" value="7"/>
+
<map:parameter name="number-of-pubs" value="1"/>
+<!--
+ <map:parameter name="number-of-pubs" value="2"/>
+-->
+
<map:parameter name="pub0-id" value="{1}"/>
<map:parameter name="pub0-name" value="{1}"/>
<map:parameter name="pub0-index-dir" value="pubs/{1}/work/search/lucene/index/{2}/index"/>
<map:parameter name="pub0-search-fields" value="title,contents"/>
<map:parameter name="pub0-excerpt-dir" value="pubs/{1}/work/search/lucene/htdocs_dump/{2}"/>
<map:parameter name="pub0-prefix" value=""/>
+
+<!--
+ <map:parameter name="pub1-id" value="matrix"/>
+ <map:parameter name="pub1-name" value="Matrix"/>
+ <map:parameter name="pub1-index-dir" value="pubs/oscom/work/search/lucene/index/index-cmfsMatrix"/>
+ <map:parameter name="pub1-search-fields" value="title,contents,license"/>
+ <map:parameter name="pub1-excerpt-dir" value="pubs/oscom/content/authoring/matrix"/>
+ <map:parameter name="pub1-prefix" value="http://www.oscom.org/matrix"/>
+-->
</map:generate>
<map:transform src="xslt/search/sort.xsl"/>
1.6 +14 -1 cocoon-lenya/src/webapp/lenya/content/search/search-and-results.xsp
Index: search-and-results.xsp
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/content/search/search-and-results.xsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- search-and-results.xsp 14 Nov 2003 12:02:52 -0000 1.5
+++ search-and-results.xsp 16 Nov 2003 18:49:34 -0000 1.6
@@ -143,13 +143,25 @@
end=new Integer(endString).intValue();
}
- String fields_para=<xsp-request:get-parameter name="fields" default="all"/>;
+ String fields_para = request.getParameter(publication_id + ".fields");
+ //String fields_para = <!--<xsp-request:get-parameter name="fields" default="null"/>-->;
+
+ field = fields_para;
+ fields = new String[1];
+ fields[0] = field;
+/*
if(fields_para.equals("title")){
fields=new String[1];
fields[0]="title";
field="title";
}
+ if(fields_para.equals("license")){
+ fields=new String[1];
+ fields[0]="license";
+
+ field="license";
+ }
else{
fields=new String[2];
fields[0]="contents";
@@ -157,6 +169,7 @@
field="contents";
}
+*/
1.23 +43 -31 cocoon-lenya/src/webapp/lenya/xslt/search/search-and-results.xsl
Index: search-and-results.xsl
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/search/search-and-results.xsl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- search-and-results.xsl 9 Oct 2003 13:37:46 -0000 1.22
+++ search-and-results.xsl 16 Nov 2003 18:49:34 -0000 1.23
@@ -20,25 +20,17 @@
<h1>Search with Lucene (Area: <xsl:value-of select="$area"/>)</h1>
<form>
<table bgcolor="#dddddd">
-<!--
-<tr><td>
- <xsl:for-each select="configuration/publication">
- <xsl:choose>
- <xsl:when test="@pid = ../@checked-pid">
- <input type="radio" name="publication-id"><xsl:attribute name="value"><xsl:value-of select="@pid"/></xsl:attribute><xsl:attribute name="checked"/></input><xsl:value-of select="name"/>
- </xsl:when>
- <xsl:otherwise>
- <input type="radio" name="publication-id"><xsl:attribute name="value"><xsl:value-of select="@pid"/></xsl:attribute></input><xsl:value-of select="name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
-</td></tr>
--->
+
+
<tr><td>
<input type="text" name="queryString" size="60">
<xsl:attribute name="value"><xsl:value-of select="search/query-string"/></xsl:attribute>
</input>
</td></tr>
+
+
+<xsl:apply-templates select="configuration"/>
+
<tr><td>
Sort by
<select name="sortBy">
@@ -56,23 +48,9 @@
</option>
</select>
</td></tr>
-<tr><td>
- Fields
- <select name="fields">
- <option value="all">
- <xsl:if test="search/fields='all'">
- <xsl:attribute name="selected">selected</xsl:attribute>
- </xsl:if>
- Contents (Title or Body)
- </option>
- <option value="title">
- <xsl:if test="search/fields='title'">
- <xsl:attribute name="selected">selected</xsl:attribute>
- </xsl:if>
- Title
- </option>
- </select>
-</td></tr>
+
+
+
<tr><td align="right">
<input type="submit" name="find" value="Search"/>
</td></tr>
@@ -84,6 +62,40 @@
</body>
</html>
</xsl:template>
+
+
+
+<xsl:template match="configuration">
+ <xsl:for-each select="publication">
+<tr><td>
+ <xsl:choose>
+ <xsl:when test="@pid = ../@checked-pid">
+ <input type="radio" name="publication-id"><xsl:attribute name="value"><xsl:value-of select="@pid"/></xsl:attribute><xsl:attribute name="checked"/></input><xsl:value-of select="name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <input type="radio" name="publication-id"><xsl:attribute name="value"><xsl:value-of select="@pid"/></xsl:attribute></input><xsl:value-of select="name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</td></tr>
+
+<tr><td>
+ Fields
+ <select name="{@pid}.fields">
+ <xsl:for-each select="search-fields/field">
+ <option value="{.}">
+ <xsl:if test="/search-and-results/search/fields = .">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </option>
+ </xsl:for-each>
+ </select>
+</td></tr>
+ </xsl:for-each>
+</xsl:template>
+
+
+
<xsl:template match="results">
<h3>Results (Publication <xsl:value-of select="../search/publication-name"/>)</h3>
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org