Author: thorsten Date: Wed Sep 22 12:34:15 2010 New Revision: 999907 URL: http://svn.apache.org/viewvc?rev=999907&view=rev Log: based on TIKA-488 and requested in DROIDS-102 adding search box that is using search-lucene.com as search provider. Since this search can be used by various projects adding it to forrest makes the most sense.
Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml (with props) Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml?rev=999907&view=auto ============================================================================== --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml (added) +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml Wed Sep 22 12:34:15 2010 @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<forrest:contract name="search-input-provider-search-lucene" +xmlns:forrest="http://apache.org/forrest/templates/1.0"> + <description> + <p>search-input-provider-search-lucene will output the default search form but using search-lucene.com instead of any other provider.</p> + <div class="warning"> + <div class="label">Warning</div> + <div class="content">You need to include +<![CDATA[<forrest:contract name="helper-form-blank"/>]]> +in your view!!! If you are not, the contract will not work correctly.</div> + </div> + </description> + <usage> + <![CDATA[<forrest:contract name="search-input-provider-search-lucene"> + <forrest:property name="search-input-provider-search-lucene-input-size" value="25"/> + <forrest:property name="search-input-provider-search-lucene-project" value="droids"/> +</forrest:contract>]]> +</usage> + <forrest:template xmlns:i18n="http://apache.org/cocoon/i18n/2.1" + xmlns:forrest="http://apache.org/forrest/templates/1.0" name="search-input" + inputFormat="xsl"> + <xsl:stylesheet version="1.1" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:param name="search-input-provider-search-lucene-input-size" /> + <xsl:param name="search-input-provider-search-lucene-project" /> + <xsl:param name="defaultVariables" select="'test.html'" /> + <xsl:variable name="root" + select="$defaultVariables/*...@name='root']/@value" /> + <xsl:template match="/"> + <forrest:content> + <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:translate> + <i18n:text i18n:key="Search the site with">Search the + site with {0}</i18n:text> + <i18n:param>search-lucene.com</i18n:param> + </i18n:translate> + </xsl:variable> + <!-- Form action --> + <xsl:variable name="search-action" select="concat('http://search-lucene.com/',$search-input-provider-search-lucene-project/@value)"/> + <!-- Form query field --> + <xsl:variable name="search-query" select="'q'"/> + <!-- Search form generation --> + <form method="get" action="{$search-action}"> + <div class="search-field"> + <input type="text" name="{normalize-space($search-query)}" + size="{$search-input-provider-search-lucene-input-size/@value}" + 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> + </div> + </div> + </div> + <xsl:comment>+ |end search +</xsl:comment> + </forrest:part> + </forrest:content> + </xsl:template> + </xsl:stylesheet> + </forrest:template> +</forrest:contract> Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themer/themes/pelt/html/search-input-provider-search-lucene.contract.xml ------------------------------------------------------------------------------ svn:eol-style = native