dion 2003/07/07 20:47:45
Modified: src/plugins-build/xdoc/src/plugin-resources site.jsl
src/plugins-build/xdoc/xdocs index.xml
Log:
Add a search element to nav courtesy of Tim A.
This is MAVEN-554 with a fix
Revision Changes Path
1.28 +27 -1 maven/src/plugins-build/xdoc/src/plugin-resources/site.jsl
Index: site.jsl
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/src/plugin-resources/site.jsl,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- site.jsl 4 Jul 2003 08:39:04 -0000 1.27
+++ site.jsl 8 Jul 2003 03:47:45 -0000 1.28
@@ -163,7 +163,7 @@
</j:if>
<x:if select="$nav">
- <jsl:applyTemplates select="$nav/body/menu[not(@type) |
@type='header']"/>
+ <jsl:applyTemplates select="$nav/body/menu[not(@type) |
@type='header'] | $nav/body/search"/>
</x:if>
<!-- Standard Maven Navigation -->
@@ -412,6 +412,32 @@
<doc:itemLink name="${_name}" link="${_link}"/>
<j:set var="linkCount" value="${1+linkCount}"/>
</x:forEach>
+ </jsl:template>
+
+ <!-- Google site search -->
+ <jsl:template match="search" trim="false">
+ <!-- Search code: http://www.google.com/searchcode.html -->
+ <!-- Google logos: http://www.google.com/stickers.html -->
+ <!-- Terms: http://www.google.com./services/terms_free.html -->
+ <div>
+ <strong>Search ${pom.name}</strong>
+ <form method="get" action="http://www.google.com/search">
+ <a class="navlink" href="http://www.google.com">
+ <img src="http://www.google.com/logos/Logo_25wht.gif"
+ alt="Google" border="0" />
+ </a><p/>
+ <j:set var="siteURL" value="${pom.url}"/>
+ <!-- google fails on urls that end with / -->
+ <j:if test="${siteURL.endsWith('/')}">
+ <j:set var="URLLength" value="${siteURL.length() - 1}"/>
+ <j:set var="siteURL" value="${siteURL.substring(0,
URLLength.intValue())}"/>
+ </j:if>
+ <input type="text" size="15" name="q" maxlength="255" value=""/>
+ <input type="submit" value="Go" name="btnG"/>
+ <input type="hidden" name="domains" value="${siteURL}"/>
+ <input type="hidden" id="search" name="sitesearch" value="${siteURL}"/>
+ </form>
+ </div>
</jsl:template>
<!-- process a documentation section -->
1.5 +4 -0 maven/src/plugins-build/xdoc/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/xdocs/index.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- index.xml 5 Apr 2003 11:23:05 -0000 1.4
+++ index.xml 8 Jul 2003 03:47:45 -0000 1.5
@@ -44,6 +44,10 @@
</footer>
]]></source>
<p>
+ If a <code>search</code> element is found in the
<code>navigation.xml</code> body, a search navigation
+ menu is generated that uses <a href="http://www.google.com">google</a>
+ </p>
+ <p>
In addition to xdocs, users may wish to include other types of
files such as images, their own HTML files, PDFs, etc. By
default, this plugin will copy all files located in the
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]