From: <bi...@us...> - 2008-07-28 19:43:01
|
Revision: 2508 http://archive-access.svn.sourceforge.net/archive-access/?rev=2508&view=rev Author: binzino Date: 2008-07-28 19:43:10 +0000 (Mon, 28 Jul 2008) Log Message: ----------- Initial revision. Added in NutchWAX version 0.12.1. Added Paths: ----------- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt Added: trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt =================================================================== --- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt (rev 0) +++ trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt 2008-07-28 19:43:10 UTC (rev 2508) @@ -0,0 +1,105 @@ + +HOWTO-xslt.txt +2008-07-25 +Aaron Binns + +Table of Contents + o Prerequisites + - NutchWAX HOWTO.txt + o Overview + o XSLTFilter and web.xml + + +====================================================================== +Prerequisites +====================================================================== + +This HOWTO assumes you've already read the main NutchWAX HOWTO and are +familiar with importing and indexing archive files with NutchWAX. + +Also, we assume that you are familiar with deploying the Nutch(WAX) +web application into a servlet container such as Tomcat. + + +====================================================================== +Overview +====================================================================== + +Nutch is bundled with two search interfaces + + JSP pages: search.jsp, refine-query.jsp, etc. + Servlet : OpenSearchServlet + +If you read the OpenSearchServlet.java source code and the search.jsp +page, you'll notice a lot of similarity, if not duplication of code. + +The Internet Archive Web Team plans to improve and expand upon the +existing OpenSearchServlet interface as well as adding more XML-based +capabilities, including replacements for the existing JSP pages. In +short, moving away from JSP and toward XML. + +But by favoring XML over JSP, how does one make an HTML UI? By adding +XSLT to the XML interfaces. + +This HOWTO describes the process for adding an XSL transformation to +the OpenSearch XML output. + +This shall be the blueprint for future XML-based interfaces as well. + + +====================================================================== +XSLTFilter and web.xml +====================================================================== + +Adding an XSL transformation to an XML-based interface, such as the +OpenSearchServlet is straightforward. Simply add the XSLTFilter to +the servlet's path and specify the XSL transform to apply. + +For example, consider the default Nutch web.xml + + <servlet> + <servlet-name>OpenSearch</servlet-name> + <servlet-class>org.apache.nutch.searcher.OpenSearchServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>OpenSearch</servlet-name> + <url-pattern>/opensearch</url-pattern> + </servlet-mapping> + +Let's say we want to retain the '/opensearch' path for the XML output, +and add the human-friendly HTML page at '/coolsearch' + +First, we add an additional 'servlet-mapping' for our new path: + + <servlet-mapping> + <servlet-name>OpenSearch</servlet-name> + <url-pattern>/coolsearch</url-pattern> + </servlet-mapping> + +Then, we add the XSLTFilter, passing it a URL to the XSLT file + + <filter> + <filter-name>XSLT Filter</filter-name> + <filter-class>org.archive.nutchwax.XSLTFilter</filter-class> + <init-param> + <param-name>xsltUrl</param-name> + <param-value>[URL to XSLT file]</param-value> + </init-param> + </filter> + +Lastly, we apply the filter to the same path as the our human-friendly +HTML path: + + <filter-mapping> + <filter-name>XSLT Filter</filter-name> + <url-pattern>/coolsearch</url-pattern> + </filter-mapping> + +This way, we have two URLs, which run the exact same +OpenSearchServlet, but one produces the unperturbed OpenSearch XML +output whereas the other produces human-friendly HTML output. + + OpenSearch XML : http://someserver/opensearch?query=foo + Human-friendly HTML : http://someserver/coolsearch?query=foo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bi...@us...> - 2008-10-13 18:38:05
|
Revision: 2611 http://archive-access.svn.sourceforge.net/archive-access/?rev=2611&view=rev Author: binzino Date: 2008-10-13 18:37:57 +0000 (Mon, 13 Oct 2008) Log Message: ----------- Added info about sample files. Modified Paths: -------------- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt Modified: trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt =================================================================== --- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt 2008-10-13 18:08:29 UTC (rev 2610) +++ trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt 2008-10-13 18:37:57 UTC (rev 2611) @@ -103,3 +103,15 @@ OpenSearch XML : http://someserver/opensearch?query=foo Human-friendly HTML : http://someserver/coolsearch?query=foo + +====================================================================== +Samples +====================================================================== + +You can find sample 'web.xml' and 'search.xsl' files in + + contrib/archive/web + +in the compiled Nutch package. Or in this source tree under + + src/web This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bi...@us...> - 2010-03-18 22:12:05
|
Revision: 2978 http://archive-access.svn.sourceforge.net/archive-access/?rev=2978&view=rev Author: binzino Date: 2010-03-18 22:11:53 +0000 (Thu, 18 Mar 2010) Log Message: ----------- Update for NW 0.13. Modified Paths: -------------- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt Modified: trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt =================================================================== --- trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt 2010-03-18 22:10:35 UTC (rev 2977) +++ trunk/archive-access/projects/nutchwax/archive/HOWTO-xslt.txt 2010-03-18 22:11:53 UTC (rev 2978) @@ -1,6 +1,6 @@ HOWTO-xslt.txt -2008-12-18 +2009-06-25 Aaron Binns Table of Contents @@ -128,8 +128,5 @@ You can find sample 'web.xml' and 'search.xsl' files in - contrib/archive/web - -in the compiled Nutch package. Or in this source tree under - - src/web + ./src/nutch/src/web/jsp/search.xsl + ./src/nutch/src/web/web.xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |