Author: cdupoirieux
Date: Fri Jan 13 04:22:52 2006
New Revision: 368698
URL: http://svn.apache.org/viewcvs?rev=368698&view=rev
Log:
search-input.ft for pelt migration.
Added:
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/search-input.ft
- copied, changed from r368658,
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/pelt/html/search-input.ft
Modified:
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv
Modified:
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv?rev=368698&r1=368697&r2=368698&view=diff
==============================================================================
---
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv
(original)
+++
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt.fv
Fri Jan 13 04:22:52 2006
@@ -274,15 +274,13 @@
<forrest:property
name="branding-logo-logo">images/project.png</forrest:property>
</forrest:contract>
</forrest:hook>
- <!--
<forrest:contract name="search-input">
- <forrest:properties contract="search-input">
- <forrest:property name="input-size">25</forrest:property>
- <forrest:property name="search-input">
- <search name="MyProject" domain="mydomain" provider="google"/>
- </forrest:property>
- </forrest:properties>
+ <forrest:property name="input-size">25</forrest:property>
+ <forrest:property name="search-input">
+ <search name="MyProject" domain="mydomain" provider="google"/>
+ </forrest:property>
</forrest:contract>
+ <!--
<forrest:hook name="nav-main-hook">
<forrest:contract name="nav-main">
<forrest:properties contract="nav-main">
Copied:
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/search-input.ft
(from r368658,
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/pelt/html/search-input.ft)
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/search-input.ft?p2=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/search-input.ft&p1=forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/pelt/html/search-input.ft&r1=368658&r2=368698&rev=368698&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.themer/resources/themes/pelt/html/search-input.ft
(original)
+++
forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/pelt/html/search-input.ft
Fri Jan 13 04:22:52 2006
@@ -15,90 +15,98 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<forrest:contract name="search-input" type="nugget"
+<forrest:contract name="search-input"
xmlns:forrest="http://apache.org/forrest/templates/1.0">
<description>
- search-input will output the default search form.
+ <p>search-input will output the default search form.</p>
+ <p>To enable lucene search add provider="lucene" (default is google).
+ @domain will enable sitesearch for the specific domain with google. In
+ other words google will search the @domain for the query string.</p>
</description>
<usage><![CDATA[<forrest:contract name="search-input">
- <forrest:properties contract="search-input">
- <forrest:property name="search-lucene">lucene-search.html</forrest:property>
- <forrest:property name="input-size">25</forrest:property>
+ [<forrest:property
name="search-lucene">lucene-search.html</forrest:property>]
+ [<forrest:property name="input-size">25</forrest:property>]
<forrest:property name="search-input">
<search name="MyProject" domain="mydomain" provider="google"/>
</forrest:property>
- </forrest:properties>]
</forrest:contract>]]></usage>
-
+
<forrest:template
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
xmlns:forrest="http://apache.org/forrest/templates/1.0"
- format="html" name="search-input" inputFormat="xsl" body="true" head="true">
+ name="search-input" inputFormat="xsl">
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!--FIXME: IMO each search provider should provide a form.
This form should be refactored into
+ <!--FIXME: IMO each search provider should provide a form. This form
should be refactored into
a meta-search from-->
- <xsl:template name="search-input-head">
- <script type="text/javascript" language="javascript"
src="{$root}themes/getBlank.js"> </script>
- </xsl:template>
+ <xsl:param name="search-lucene" select="'lucene-search.html'"/>
+ <xsl:param name="input-size"/>
+ <xsl:param name="search-input"/>
+ <xsl:param name="defaultVariables" select="'test.html'"/>
+ <xsl:variable name="root" select="$defaultVariables/*/[EMAIL
PROTECTED]'root']/@value"/>
+
+ <xsl:template match="/">
+ <forrest:content>
+ <forrest:part xpath="/html/head">
+ <script type="text/javascript" language="javascript"
src="{$root}themes/getBlank.js"> </script>
+ </forrest:part>
- <xsl:template name="search-input-body">
- <xsl:param name="search-lucene" select="'lucene-search.html'"/>
- <xsl:param name="input-size">25</xsl:param>
- <xsl:param name="search-input"/>
-<xsl:comment>+
- |start Search
+ <forrest:part>
+<xsl:comment>+
+ |start Search
+</xsl:comment>
- <div class="searchbox">
- <div class="round-top-left-small">
- <div class="round-top-right-small">
- <div class="search-input">
- <!-- Form prompt -->
- <xsl:variable name="search-prompt">
- <i18n:text>Search the site with</i18n:text>
- <xsl:value-of select="$search-input/search/@provider"/>
- </xsl:variable>
- <!-- Form action -->
- <xsl:variable name="search-action">
- <xsl:choose>
- <xsl:when test="$search-input/search/@provider = 'lucene'">
- <xsl:value-of select="$root"/>
- <xsl:value-of select="$search-lucene"/>
- </xsl:when>
- <xsl:otherwise>http://www.google.com/search</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Form query field -->
- <xsl:variable name="search-query">
- <xsl:choose>
- <xsl:when test="$search-input/search/@provider = 'lucene'">
- queryString</xsl:when>
- <xsl:otherwise>q</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Search form generation -->
- <form method="get" action="{$search-action}">
- <div class="search-hidden">
- <input type="hidden" name="sitesearch"
- value="{$search-input/search/@domain}"/>
- </div>
- <div class="search-field">
- <input type="text" name="{$search-query}"
- size="{$input-size}"
value="{normalize-space($search-prompt)}"
- onFocus="getBlank(this,
'{normalize-space($search-prompt)}');"
- onBlur="getPrompt(this,
'{normalize-space($search-prompt)}');"/>
- </div>
- <div class="search-submit">
- <input type="submit" value="Search" name="Search"
- i18n:attr="value"/>
+ <div class="searchbox">
+ <div class="round-top-left-small">
+ <div class="round-top-right-small">
+ <div class="search-input">
+ <!-- Form prompt -->
+ <xsl:variable name="search-prompt">
+ <i18n:text>Search the site with</i18n:text>
+ <xsl:value-of select="$search-input/search/@provider"/>
+ </xsl:variable>
+ <!-- Form action -->
+ <xsl:variable name="search-action">
+ <xsl:choose>
+ <xsl:when test="$search-input/search/@provider =
'lucene'">
+ <xsl:value-of select="$root"/>
+ <xsl:value-of select="$search-lucene"/>
+ </xsl:when>
+
<xsl:otherwise>http://www.google.com/search</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Form query field -->
+ <xsl:variable name="search-query">
+ <xsl:choose>
+ <xsl:when test="$search-input/search/@provider =
'lucene'">
+ queryString</xsl:when>
+ <xsl:otherwise>q</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Search form generation -->
+ <form method="get" action="{$search-action}">
+ <div class="search-hidden">
+ <input type="hidden" name="sitesearch"
+ value="{$search-input/search/@domain}"/>
+ </div>
+ <div class="search-field">
+ <input type="text" name="{$search-query}"
+ size="{$input-size}"
value="{normalize-space($search-prompt)}"
+ onFocus="getBlank(this,
'{normalize-space($search-prompt)}');"
+ onBlur="getPrompt(this,
'{normalize-space($search-prompt)}');"/>
+ </div>
+ <div class="search-submit">
+ <input type="submit" value="Search" name="Search"
+ i18n:attr="value"/>
+ </div>
+ </form>
</div>
- </form>
+ </div>
</div>
</div>
- </div>
- </div>
- <xsl:comment>+ |end search +</xsl:comment>
+ <xsl:comment>+ |end search +</xsl:comment>
+ </forrest:part>
+ </forrest:content>
</xsl:template>
- </xsl:stylesheet>
- </forrest:template>
+ </xsl:stylesheet>
+ </forrest:template>
</forrest:contract>