forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From che...@apache.org
Subject svn commit: rev 10520 - in xml/forrest/trunk/src/core/context/skins: forrest-css/xslt/html forrest-site/xslt/html krysalis-site/xslt/html tigris-style/xslt/html
Date Tue, 04 May 2004 17:27:21 GMT
Author: cheche
Date: Tue May  4 10:27:20 2004
New Revision: 10520

Modified:
   xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
   xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
   xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
   xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
Log:
New lucene and google API thanks to Florian G. Haas


Modified: xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl	(original)
+++ xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl	Tue May
 4 10:27:20 2004
@@ -64,8 +64,7 @@
 		</div>
 		
         <!-- ================= start Banner ================== -->
-        <form method="get" action="http://www.google.com/search">
-			<div id="mainheader">
+   	    <div id="mainheader">
 	          <!-- ================= start Group Logo ================== -->
 	          <xsl:if test="$config/group-url">
 	  	      	<xsl:call-template name="renderlogo">
@@ -80,20 +79,38 @@
 	          <!-- ================= end Group Logo ================== -->
 	          <span class="textonly"> - </span>
 	          <!-- ================= start Search ================== -->
-	          <xsl:if test="not($config/disable-search) or
-	                $config/disable-search='false' and $config/searchsite-domain and
-	                $config/searchsite-name">
-	              <span id="search">
-		              <input type="hidden" name="as_sitesearch" value="{$config/searchsite-domain}"/>
-		              <input type="text" class="query" name="as_q"/>
-		              <input type="submit" value="Search"/>
-		              <br />
-		              <span class="searchtext">
-		                the <xsl:value-of select="$config/searchsite-name"/> site
-		              </span>
-		          </span>
+	          <xsl:if test="$config/search">
+	              <xsl:choose>
+		          <xsl:when test="$config/search/@provider = 'lucene'">
+                              <!-- Lucene search -->
+                              <form method="get" action="{$root}{$lucene-search}">
+     	                          <span id="search">
+		                      <input type="text" class="query" name="queryString"/>
+		                      <input type="submit" value="Search"/>
+		                      <br />
+		                      <span class="searchtext">
+		                          the <xsl:value-of select="$config/search/@name"/> site
+		                      </span>
+		                  </span>
+		              </form>
+		          </xsl:when>
+                          <xsl:otherwise>
+                              <!-- Google search -->
+                              <form method="get" action="http://www.google.com/search">
+	                          <span id="search">
+		                      <input type="hidden" name="as_sitesearch" value="{$config/search/@domain}"/>
+		                      <input type="text" class="query" name="as_q"/>
+		                      <input type="submit" value="Search"/>
+		                      <br />
+		                      <span class="searchtext">
+		                          the <xsl:value-of select="$config/search/@name"/> site
+		                      </span>
+		                  </span>
+		              </form>
+		          </xsl:otherwise>
+	              </xsl:choose>
 	          </xsl:if>
-			  <!-- ================= end Search ================== -->
+	          <!-- ================= end Search ================== -->
 			  <span class="textonly"> - </span>
 	          <!-- ================= start Project Logo ================== -->
 	          <xsl:if test="$config/project-url">
@@ -108,7 +125,6 @@
 	          </xsl:if>
 	          <!-- ================= end Project Logo ================== -->
 	        </div>    
-		</form>
 		
 		<hr class="textonly"/>
 

Modified: xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl	(original)
+++ xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl	Tue May
 4 10:27:20 2004
@@ -146,8 +146,8 @@
                     <tr>
                       <td><img class="spacer" src="{$spacer}" alt="" width="1" height="1"
/></td>
                       <td nowrap="nowrap">
-                        <input type="hidden" name="sitesearch" value="{$config/search/attribute::domain}"/>
-                        <input type="text" id="query" name="q" size="15"/>
+                        <input type="hidden" name="as_sitesearch" value="{$config/search/attribute::domain}"/>
+                        <input type="text" id="query" name="as_q" size="15"/>
                         <img class="spacer" src="{$spacer}" alt="" width="5" height="1"
/>
                         <input type="submit" value="Search" name="Search"/>
                         <br />

Modified: xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl	(original)
+++ xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl	Tue May
 4 10:27:20 2004
@@ -118,46 +118,82 @@
         </td>
         <!-- ( =================  Search ================== ) -->
         <td class="search" align="right" rowspan="2" valign="top">
-          <xsl:if test="not($config/disable-search) or
-            $config/disable-search='false' and not($config/disable-search='alt')
-            and $config/searchsite-domain and
-            $config/searchsite-name">
-            <form method="get" action="http://www.google.com/search" target="_blank">
-              <table class="dialog" cellspacing="0" cellpadding="0" border="0">
-                <tr>
-                  <td colspan="3" class="border" height="10"></td>
-                </tr>
-                <tr>
-                  <td colspan="3" height="8"></td>
-                </tr>
-                <tr>
-                  <td></td>
-                  <td nowrap="nowrap">
-                    <input type="hidden" name="sitesearch" value="{$config/searchsite-domain}"/>
-                    <input type="text" id="query" name="q" size="15"/>
-                    &#160;
-                    <input type="submit" value="Search" name="Search"/>
-                    <br />
-                      the <xsl:value-of select="$config/searchsite-name"/> site
-                      <!-- setting search options off for the moment -->
-                      <!--
-                      <input type="radio" name="web" value="web"/>web site&#160;&#160;<input
type="radio" name="mail" value="mail"/>mail lists
-                      -->
-                  </td>
-                  <td></td>
-                </tr>
-
-                <tr>
-                  <td colspan="3" height="7"></td>
-                </tr>
-
-                <tr>
-                  <td class="search border bottom-left"></td>
-                  <td class="search border bottomborder"></td>
-                  <td class="search border bottom-right"></td>
-                </tr>
-              </table>
-            </form>
+          <xsl:if test="$config/search">
+	    <xsl:choose>
+              <xsl:when test="$config/search/@provider = 'lucene'">
+                <!-- Lucene search -->
+                <form method="get" action="{$root}{$lucene-search}">
+		  <table class="dialog" cellspacing="0" cellpadding="0" border="0">
+		    <tr>
+		      <td colspan="3" class="border" height="10"></td>
+		    </tr>
+		    <tr>
+		      <td colspan="3" height="8"></td>
+		    </tr>
+		    <tr>
+		      <td></td>
+		      <td nowrap="nowrap">
+			<input type="text" id="query" name="queryString" size="15"/>
+			&#160;
+			<input type="submit" value="Search" name="Search"/>
+			<br />
+			the <xsl:value-of select="$config/search/@name"/> site
+		      </td>
+		      <td></td>
+		    </tr>
+		    
+		    <tr>
+		      <td colspan="3" height="7"></td>
+		    </tr>
+		    
+		    <tr>
+		      <td class="search border bottom-left"></td>
+		      <td class="search border bottomborder"></td>
+		      <td class="search border bottom-right"></td>
+		    </tr>
+		  </table>
+		</form>
+	      </xsl:when>
+	      <xsl:otherwise>
+		<!-- Google search -->
+		<form method="get" action="http://www.google.com/search" target="_blank">
+		  <table class="dialog" cellspacing="0" cellpadding="0" border="0">
+		    <tr>
+		      <td colspan="3" class="border" height="10"></td>
+		    </tr>
+		    <tr>
+		      <td colspan="3" height="8"></td>
+		    </tr>
+		    <tr>
+		      <td></td>
+		      <td nowrap="nowrap">
+			<input type="hidden" name="as_sitesearch" value="{$config/search/@domain}"/>
+			<input type="text" id="query" name="as_q" size="15"/>
+			&#160;
+			<input type="submit" value="Search" name="Search"/>
+			<br />
+			the <xsl:value-of select="$config/search/@name"/> site
+			<!-- setting search options off for the moment -->
+			<!--
+			<input type="radio" name="web" value="web"/>web site&#160;&#160;<input
type="radio" name="mail" value="mail"/>mail lists
+			-->
+		      </td>
+		      <td></td>
+		    </tr>
+		    
+		    <tr>
+		      <td colspan="3" height="7"></td>
+		    </tr>
+		    
+		    <tr>
+		      <td class="search border bottom-left"></td>
+		      <td class="search border bottomborder"></td>
+		      <td class="search border bottom-right"></td>
+		    </tr>
+		  </table>
+		</form>
+	      </xsl:otherwise>
+	    </xsl:choose>
           </xsl:if>
         </td>
 

Modified: xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl	(original)
+++ xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl	Tue May
 4 10:27:20 2004
@@ -134,26 +134,38 @@
           </xsl:if>        </td>
         
         <!-- ( =================  Search ================== ) -->        
-        <td align="right" valign="top">
-          <xsl:if test="not($config/disable-search) or
-            $config/disable-search='false' and not($config/disable-search='alt')
-            and $config/searchsite-domain and
-            $config/searchsite-name">
-            <div id="login" align="right" class="right">
-             <form method="get" action="http://www.google.com/search" target="_blank">
-               <input type="hidden" name="sitesearch" value="{$config/searchsite-domain}"/>
-               <select name="go">
-                 <option value="foo">Search...</option>
-     
-                 <option value="site">The <xsl:value-of select="$config/searchsite-name"/>
site</option>
-                 <option value="web">The web</option>
-               </select> for 
-               <input type="text" id="query" name="q" size="15"/> 
-               <input type="submit" value="Go" name="Search"/>
-             </form>
-          </div>
-         </xsl:if>
-        </td>       
+	  <!-- FIXME (Florian Haas): I think either this or the
+	  lateral search bar should go away. Keeping both is confusing
+	  to users, and tedious to maintain. -->
+	  <td align="right" valign="top">
+	    <xsl:if test="$config/search">
+	      <div id="login" align="right" class="right">
+		<xsl:choose>
+		  <xsl:when test="$config/search/@provider = 'lucene'">
+		    <form method="get" action="{$root}{$lucene-search}">
+		      Search
+		      the <xsl:value-of select="$config/search/@name"/> site
+		      for 
+		      <input type="text" id="query" name="queryString" size="15"/> 
+		      <input type="submit" value="Go" name="Search"/>
+		    </form>
+		  </xsl:when>
+		  <xsl:otherwise>
+		    <form method="get" action="http://www.google.com/search" target="_blank">
+		      <select name="as_sitesearch">
+			<option value="">Search...</option>
+			
+			<option value="{$config/search/@domain}">The <xsl:value-of select="$config/search/@name"/>
site</option>
+			<option value="">The web</option>
+		      </select> for 
+		      <input type="text" id="query" name="as_q" size="15"/> 
+		      <input type="submit" value="Go" name="Search"/>
+		    </form>
+		  </xsl:otherwise>
+		</xsl:choose>
+	      </div>
+	    </xsl:if>
+	  </td>       
        </tr>   
       </table>  
      </div>
@@ -254,28 +266,48 @@
     <!-- ( ================= end Menu items ================== ) -->
 
     <!-- ( =================  Search ================== ) -->       
-        
-   <xsl:if test="not($config/disable-search) or
-                 $config/disable-search='alt' and $config/searchsite-domain and
-                 $config/searchsite-name">
-    <form action="http://www.google.com/search" method="get">
-      <div id="searchbox" class="toolgroup">
-       <div class="label"><strong>Search</strong></div>
-       <div class="body">
-        <div>
-        <select name="sitesearch">
-         <option value="{$config/searchsite-domain}" selected="selected"><xsl:value-of
select="$config/searchsite-name"/></option>
-         <option value="" >the web</option>
-        </select>
-       </div>
-       <div>
-        <input type="text" id="query" name="q" size="12" /> 
-        <input type="submit" value="Go" name="Go" />
-       </div>
-      </div>   
-     </div>
-     </form>
-    </xsl:if>    
+      <xsl:if test="$config/search">
+	<xsl:choose>
+	  <!-- Lucene search -->
+	  <xsl:when test="$config/search/@provider = 'lucene'">
+	    <form action="{$root}{$lucene-search}" method="get">
+	      <div id="searchbox" class="toolgroup">
+		<div class="label"><strong>Search</strong></div>
+		<div class="body">
+		  <div>
+		    <xsl:value-of select="$config/search/@name"/>
+		  </div>
+		  <div>
+		    <input type="text" id="query" name="queryString" size="12" /> 
+		    <input type="submit" value="Go" name="Go" />
+		  </div>
+		</div>   
+	      </div>
+	    </form>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <!-- Google search -->
+	    <form action="http://www.google.com/search" method="get" target="_blank">
+	      <div id="searchbox" class="toolgroup">
+		<div class="label"><strong>Search</strong></div>
+		<div class="body">
+		  <div>
+		    <select name="as_sitesearch">
+		      <option value="{$config/search/@domain}" selected="selected"><xsl:value-of
select="$config/search/@name"/></option>
+		      <option value="" >the web</option>
+		    </select>
+		  </div>
+		  <div>
+		    <input type="text" id="query" name="as_q" size="12" /> 
+		    <input type="submit" value="Go" name="Go" />
+		  </div>
+		</div>   
+	      </div>
+	    </form>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:if>
+
     
  	<xsl:if test="$filename = 'index.html' and $config/credits">
       <div id="admfun" class="toolgroup">
@@ -378,7 +410,7 @@
       </xsl:if>
       -->
   </xsl:template>
-  
+
   <xsl:template match="node()|@*" priority="-1">
     <xsl:copy>
       <xsl:apply-templates select="@*"/>

Mime
View raw message