Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

remove web2 as agreed on nutch-dev

Sami Siren4de08e67a204
diff --git a/contrib/web2/README.txt b/contrib/web2/README.txt
deleted file mode 100644
index d4550badf..000000000
--- a/contrib/web2/README.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-This folder contains an alternative search frontend implementation
-with a goal to be modular and extendable. Currently it
-is still in very early stage of development and might miss
-some functionality from the original ui.
-
-To achieve the primary goal it uses tiles
-http://struts.apache.org/struts-tiles/index.html
-to represent blocks of functinality and layout on a search
-(and related) pages. Layout is constructed by using following
-tag libraries:
-
-jstl-c
-jstl-fmt
-struts-tiles
-
-These tiles blocks can be extended or overridden by plugins
-implementing org.apache.nutch.webapp.UIExtensionPoint. A
-plugin implementation typically contains own tiles-defs.xml
-file that contains definitions (extensions or overriders)
-it provides, tiles Controller, supporting classes and libraries.
-
-WebApp extension can contain ui logic (in forms of tiles
-controllers and pojos, jar libraries), ui markup
-(in form of html, jsp), ui resources css, javascript.
-
-To compile web2 plugins you must issue command
-ant compile-plugins
-
-After compiling you must enable plugins, please refer to nutch
-documentation
-
-To build deployable .war issue command ant war.
-
-The nutch plugins are not included in the generated war and you
-need to properly configure where your plugins are. This is achieved
-by editing the nutch configuration file <NUTCH_HOME>/conf/nutch-site.xml
-the configuration parameter you need to edit is named
-'plugin.folders'
-
-Directory contents
-
-/lib
- contains required additional libraries, all licenced and
- maintained by ASF. files:
- struts.jar (version 1.2.9) and libraries required by struts:
- commons-beanutils.jar
- commons-collections-3.0.jar
- commons-digester.jar
-
- jstl.jar
- standard.jar
-
-
-/res
- contains stylesheets to transform static html pages or page snippets
-
-/src/main/java
- java sources
-
-/src/main/resources
- resources to be packaged in .jar, currently the localized resource files
-
-/src/main/webapp
- standard webapp folder
-
-build.xml
- contains minimal build instructions to create a .war
-
-README.txt
- this file
-
-
-Web ui plugin source directory structure
-
-/lib
- contains libraries required by extension
-
-/src/conf
- configuration files for example tiles-defs.xml
-
-/src/java
- java source files
-
-/src/test
- java unit test source files
-
-/src/web
- jsp files
-
-/src/resources
- any resources that needs to be exposed to public url space
- (images, css, js...)
-
-/build.xml
-
-/plugin.xml
-
-
-JSP Templating
-
-Referencing jsp files from tiles-defs:
-
-Referencing jsp resources inside nutch war
-
-absolute path, must start with /WEB-INF
-
-<definition name="searchPage" extends=".layout"
- controllerClass="org.apache.nutch.webapp.controller.CachingSearchController">
- <put name="title" value="cached search"/>
- <put name="pageBody" value="/WEB-INF/jsp/search.jsp" />
-</definition>
-
-Referencing jsp resources inside plugins
-
-absolute path, must start with /plugin/
-
-<definition name="searchPage" extends=".layout"
- controllerClass="org.apache.nutch.webapp.controller.CachingSearchController">
- <put name="title" value="cached search"/>
- <put name="pageBody" value="/plugin/search.jsp" />
-</definition>
-
-Static resources
-
-You can include static resources (images, html, css, js) in
-plugins by putting them in src/resources, at runtime those
-resources are exposed in urlspace /resources/<plugin-id>/<resource.ext>
-
-
-Todo:
-
--Remove table structures from html to allow more flexible
-css layouts
-
--Refine the idea of extendability
-Perhaps we could just porovide maximum number of small tiles and
-then let end users combine their favourite ui from those, something like:
-
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="my-web-ui"
- name="site xxx web-ui"
- version="1.0.0"
- provider-name="Me">
-
- <runtime>
- <library name="my-web-ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="nutch-extensionpoints"/>
- <import plugin="web-search-results"/>
- <import plugin="web-search-navigation"/>
- <import plugin="web-search-clustering"/>
- <import plugin="web-search-preferences"/>
- <import plugin="web-query-propose-spelling"/>
- <import plugin="web-more"/>
- <import plugin="web-caching-oscache"/>
- <import plugin="web-search-preferences"/>
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UI"
- name="My Web UI"
- point="org.apache.nutch.webapp.extension.UI">
- <implementation id="my-ui"
- class="org.apache.nutch.webapp.extension.UI.VoidImplementation"/>
- </extension>
-</plugin>
-
-+ provide their own template and css
-
-
diff --git a/contrib/web2/build.xml b/contrib/web2/build.xml
deleted file mode 100644
index e827ee689..000000000
--- a/contrib/web2/build.xml
+++ /dev/null
@@ -1,368 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="nutch-web2">
-
- <property name="name" value="${ant.project.name}" />
- <property name="root" value="${basedir}" />
- <property name="nutch.root" location="${root}/../../" />
-
-
- <property name="build.dir" location="target" />
- <property name="build.classes" location="${build.dir}/classes" />
- <property name="build.test" location="${build.dir}/test" />
-
- <property name="src.dir" location="${root}/src/main/java" />
- <property name="src.test" location="${root}/src/main/test" />
- <property name="conf.dir" location="${nutch.root}/conf" />
-
- <property name="deploy.dir" location="target" />
-
- <property name="docs.src" value="${nutch.root}/src/web" />
- <property name="web.src.dir" value="${basedir}/src/main/webapp" />
- <property name="docs.dir" value="${build.dir}/${name}/" />
- <property name="build.plugins" value="${nutch.root}/build/plugins" />
- <property name="build.src" value="${build.dir}/jsp-src" />
-
- <property file="${nutch.root}/default.properties" />
-
-
- <property name="web.final.name" value="${name}-${version}" />
-
- <fileset id="lib.jars" dir="." includes="lib/*.jar" />
-
- <!--
- Normal classpath
- -->
- <path id="classpath">
- <pathelement location="${build.classes}" />
- <fileset refid="lib.jars" />
- <pathelement location="${nutch.root}/build/classes" />
- <fileset dir="${nutch.root}/lib">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <!-- the unit test classpath -->
- <dirname property="plugins.classpath.dir" file="${build.plugins}" />
- <path id="test.classpath">
- <pathelement location="${build.test}" />
- <pathelement location="${conf.dir}" />
- <pathelement location="${test.src.dir}" />
- <pathelement location="${plugins.classpath.dir}" />
- <path refid="classpath" />
- </path>
-
- <!--
- Init
- -->
- <target name="init">
- <mkdir dir="${build.dir}" />
- <mkdir dir="${build.classes}" />
- <mkdir dir="${build.test}" />
- </target>
-
- <!--
- Compile Java files
- -->
- <target name="compile" depends="nutch-jar, nutch-plugins, init">
- <echo message="Compiling ${name}" />
- <javac encoding="${build.encoding}" srcdir="${src.dir}"
- includes="**/*.java" destdir="${build.classes}"
- debug="${javac.debug}" optimize="${javac.optimize}"
- target="${javac.version}" source="${javac.version}"
- deprecation="${javac.deprecation}">
- <classpath refid="classpath" />
- </javac>
- </target>
-
- <target name="compile-core">
- <ant target="compile-core" inheritall="false" dir="${nutch.root}" />
- <ant target="compile" />
- </target>
-
- <!--
- Make webapp .jar
- -->
- <target name="jar" depends="compile">
- <jar jarfile="${build.dir}/${web.final.name}.jar">
- <zipfileset dir="${build.classes}" />
- <!-- localized resources -->
- <zipfileset dir="src/main/resources" />
- </jar>
- </target>
-
- <!--
- compile nutch
- -->
- <target name="nutch-jar">
- <ant dir="${nutch.root}" target="jar" inheritAll="false" />
-
- </target>
- <target name="nutch-plugins">
- <ant antfile="${nutch.root}/build.xml" dir="${nutch.root}"
- target="compile-plugins" />
-
- </target>
-
- <!--
- generate the nutch.xml (servlet context) file
- -->
- <target name="generate-context">
- <!-- xmlcatalog definition for xslt task -->
- <xmlcatalog id="docDTDs">
- <dtd publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
- location="${nutch-root}/xmlcatalog/xhtml1-transitional.dtd" />
- </xmlcatalog>
- <xslt in="${nutch.root}/conf/nutch-default.xml"
- out="${build.dir}/nutch.xml"
- style="${nutch.root}/conf/context.xsl">
- <xmlcatalog refid="docDTDs" />
- <outputproperty name="indent" value="yes" />
- </xslt>
- </target>
-
- <target name="compile-plugins" depends="init">
- <ant dir="plugins" target="deploy" inheritAll="false" />
- </target>
-
- <target name="war"
- depends="generate-context, generate-pages, jar">
- <war destfile="${build.dir}/${web.final.name}.war"
- webxml="src/main/webapp/WEB-INF/web.xml">
- <fileset dir="${web.src.dir}" excludes="WEB-INF/web.xml" />
- <zipfileset dir="${docs.src}" includes="include/*.html" />
- <zipfileset dir="${build.docs}" includes="*/include/*.html" />
- <fileset dir="${docs.dir}" />
- <lib dir="${nutch.root}/lib">
- <include name="lucene-*.jar" />
- <include name="hadoop-*.jar" />
- <include name="commons-lang-*.jar" />
- <include name="commons-cli-*.jar" />
- <include name="commons-logging-*.jar" />
- <include name="log4j-*.jar" />
- <include name="xerces-*.jar" />
- </lib>
- <lib dir="${nutch.root}/lib/jetty-ext">
- <include name="jasper-runtime*.jar" />
- </lib>
-
-
- <fileset dir="${nutch.root}/docs" includes="img/**" />
-
- <!-- webapp .jar -->
- <lib dir="${build.dir}">
- <include name="${web.final.name}.jar" />
- </lib>
- <lib dir="lib" includes="*.jar" />
-
- <!-- nutch .jar -->
- <lib dir="${nutch.root}/build">
- <include name="*.jar" />
- </lib>
- <classes dir="${conf.dir}" excludes="**/*.template" />
-
- <classes file="${nutch.root}/src/web/log4j.properties" />
-
- <!--
- <zipfileset prefix="WEB-INF/classes/plugins" dir="${build.plugins}" >
- <exclude name="parse-*/**"/>
- <exclude name="protocol-*/**"/>
- <exclude name="urlfilter-*/**"/>
- </zipfileset>
- -->
- </war>
- </target>
-
- <!--
- Deploy to ${deploy.dir}
- -->
- <target name="deploy" depends="war">
- <mkdir dir="${deploy.dir}" />
- <copy file="${build.dir}/${web.final.name}.war"
- todir="${deploy.dir}" failonerror="false" />
- </target>
-
- <taskdef classname="org.apache.jasper.JspC" name="jsp-compile">
- <classpath refid="classpath" />
- </taskdef>
- <!--
- Compile test code
- -->
- <target name="compile-test" depends="compile">
- <javac encoding="${build.encoding}" srcdir="${src.test}"
- includes="**/*.java" destdir="${build.test}"
- debug="${javac.debug}" optimize="${javac.optimize}"
- target="${javac.version}" source="${javac.version}"
- deprecation="${javac.deprecation}">
- <classpath refid="test.classpath" />
- </javac>
- </target>
-
- <!--
- Run unit tests
- -->
- <target name="test" depends="compile-test">
- <junit printsummary="yes" haltonfailure="no" fork="yes"
- errorProperty="tests.failed" failureProperty="tests.failed">
- <sysproperty key="test.data" value="${build.test}/data" />
- <sysproperty key="test.input" value="${root}/data" />
- <classpath refid="test.classpath" />
- <formatter type="plain" />
- <batchtest todir="${build.test}" unless="testcase">
- <fileset dir="${src.test}" includes="**/Test*.java"
- excludes="**/${test.exclude}.java" />
- </batchtest>
- <batchtest todir="${build.test}" if="testcase">
- <fileset dir="${src.test}" includes="**/${testcase}.java" />
- </batchtest>
- </junit>
-
- <fail if="tests.failed">Tests failed!</fail>
-
- </target>
-
- <!--
- Clean. Delete the build files, and their directories
- -->
- <target name="clean">
- <delete dir="${build.dir}" />
- <delete dir="${deploy.dir}" />
- </target>
-
- <target name="generate-locale" if="doc.locale">
- <echo message="Generating docs for locale=${doc.locale}" />
-
- <mkdir dir="${build.docs}/${doc.locale}/include" />
- <xslt in="${docs.src}/include/${doc.locale}/header.xml"
- out="${build.docs}/${doc.locale}/include/header.html"
- style="res/nutch-header.xsl">
- <xmlcatalog refid="docDTDs" />
- </xslt>
-
- <dependset>
- <srcfileset dir="${docs.src}/include/${doc.locale}"
- includes="*.xml" />
- <srcfileset dir="${docs.src}/style" includes="*.xsl" />
- <targetfileset dir="${docs.dir}/${doc.locale}" includes="*.html" />
- </dependset>
-
- <!-- <copy file="${docs.src}/style/nutch-page.xsl"
- todir="${build.docs}/${doc.locale}"
- preservelastmodified="true"/>
- -->
- <xslt basedir="${docs.src}/pages/${doc.locale}"
- destdir="${docs.dir}/${doc.locale}" includes="*.xml"
- style="res/nutch-page.xsl">
- <xmlcatalog refid="docDTDs" />
- </xslt>
- </target>
-
-
- <target name="generate-pages" depends="init">
- <mkdir dir="${build.docs}/include" />
- <copy todir="${build.docs}/include">
- <fileset dir="${docs.src}/include" />
- </copy>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="ca" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="de" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="en" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="es" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="fi" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="fr" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="hu" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="it" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="jp" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="ms" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="nl" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="pl" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="pt" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="sh" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="sr" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="sv" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="th" />
- </antcall>
-
- <antcall target="generate-locale">
- <param name="doc.locale" value="zh" />
- </antcall>
-
- <fixcrlf srcdir="${docs.dir}" eol="lf" encoding="utf-8"
- includes="**/*.html" />
-
- <replace dir="${docs.dir}" token="help.html" value="help.do"
- includes="**/*.html" />
- <replace dir="${docs.dir}" token="about.html" value="about.do"
- includes="**/*.html" />
- <replace dir="${docs.dir}" token="search.jsp" value="search.do"
- includes="**/*.html" />
- <replace dir="${docs.dir}" token="../" value=""
- includes="**/*.html" />
-
- </target>
-
-</project>
diff --git a/contrib/web2/lib/commons-beanutils.jar b/contrib/web2/lib/commons-beanutils.jar
deleted file mode 100644
index b1b89c9c9..000000000
Binary files a/contrib/web2/lib/commons-beanutils.jar and /dev/null differ
diff --git a/contrib/web2/lib/commons-collections-3.0.jar b/contrib/web2/lib/commons-collections-3.0.jar
deleted file mode 100644
index 5cc4f9062..000000000
Binary files a/contrib/web2/lib/commons-collections-3.0.jar and /dev/null differ
diff --git a/contrib/web2/lib/commons-digester.jar b/contrib/web2/lib/commons-digester.jar
deleted file mode 100644
index 976549330..000000000
Binary files a/contrib/web2/lib/commons-digester.jar and /dev/null differ
diff --git a/contrib/web2/lib/jstl.jar b/contrib/web2/lib/jstl.jar
deleted file mode 100644
index 268062d80..000000000
Binary files a/contrib/web2/lib/jstl.jar and /dev/null differ
diff --git a/contrib/web2/lib/standard.jar b/contrib/web2/lib/standard.jar
deleted file mode 100644
index c74dbad76..000000000
Binary files a/contrib/web2/lib/standard.jar and /dev/null differ
diff --git a/contrib/web2/lib/struts.jar b/contrib/web2/lib/struts.jar
deleted file mode 100644
index 7815901f3..000000000
Binary files a/contrib/web2/lib/struts.jar and /dev/null differ
diff --git a/contrib/web2/plugins/build-plugin.xml b/contrib/web2/plugins/build-plugin.xml
deleted file mode 100755
index 6111f62ae..000000000
--- a/contrib/web2/plugins/build-plugin.xml
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<!-- Imported by plugin build.xml files to define default targets. -->
-<project>
-
- <property name="name" value="${ant.project.name}"/>
- <property name="root" value="${basedir}"/>
-
- <!-- load plugin-specific properties first -->
- <property file="${user.home}/${name}.build.properties" />
- <property file="${root}/build.properties" />
-
- <property name="nutch.root" location="${root}/../../../.."/>
-
- <property name="web.root" location="../../src/main/webapp"/>
- <property name="web.lib" location="../../lib"/>
- <property name="src.dir" location="${root}/src/java"/>
- <property name="resources.dir" location="${root}/src/resources"/>
- <property name="web.dir" location="${root}/src/web"/>
- <property name="src.test" location="${root}/src/test"/>
-
- <available file="${src.test}" type="dir" property="test.available"/>
-
- <property name="conf.dir" location="${nutch.root}/conf"/>
-
- <property name="build.dir" location="${nutch.root}/build/${name}"/>
- <property name="build.src.tmp" location="${nutch.root}/build/${name}/tmp/"/>
- <property name="build.web.dir" location="${build.src.tmp}/_web"/>
- <property name="build.src.dir" location="${build.src.tmp}/_src"/>
- <property name="build.classes" location="${build.dir}/classes"/>
- <property name="build.test" location="${build.dir}/test"/>
-
- <property name="deploy.dir" location="${nutch.root}/build/plugins/${name}"/>
-
- <!-- load nutch defaults last so that they can be overridden above -->
- <property file="${nutch.root}/default.properties" />
-
- <path id="plugin.deps"/>
-
- <fileset id="lib.jars" dir="${root}" includes="lib/*.jar"/>
-
- <!-- the normal classpath -->
- <path id="classpath">
- <pathelement location="${build.classes}"/>
- <pathelement location="${nutch.root}/build/classes"/>
- <fileset dir="${nutch.root}/contrib/web2/target">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${nutch.root}/lib/">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${web.lib}">
- <include name="*.jar" />
- </fileset>
- <fileset refid="lib.jars"/>
- <path refid="plugin.deps"/>
- </path>
-
- <!-- the unit test classpath -->
- <path id="test.classpath">
- <pathelement location="${build.test}" />
- <pathelement location="${nutch.root}/build/test/classes"/>
- <pathelement location="${nutch.root}/src/test"/>
- <pathelement location="${conf.dir}"/>
- <pathelement location="${nutch.root}/build"/>
- <path refid="classpath"/>
- </path>
-
- <!-- ====================================================== -->
- <!-- Stuff needed by all targets -->
- <!-- ====================================================== -->
- <target name="init">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.classes}"/>
- <mkdir dir="${build.test}"/>
- <mkdir dir="${build.src.dir}"/>
- <mkdir dir="${build.src.dir}"/>
-<mkdir dir="${build.src.tmp}"/>
- <antcall target="init-plugin"/>
- </target>
-
- <!-- to be overridden by sub-projects -->
- <target name="init-plugin"/>
-
- <!--
- ! Used to build plugin compilation dependencies
- ! (to be overridden by plugins)
- !-->
- <target name="deps-jar"/>
-
- <!--
- ! Used to deploy plugin runtime dependencies
- ! (to be overridden by plugins)
- !-->
- <target name="deps-test"/>
-
- <!-- ====================================================== -->
- <!-- Compile the Java files -->
- <!-- ====================================================== -->
- <target name="compile" depends="init,deps-jar,compile-jsp">
- <echo message="Compiling plugin: ${name}"/>
- <javac
- encoding="${build.encoding}"
- srcdir="${src.dir};${build.src.dir}"
- includes="**/*.java"
- destdir="${build.classes}"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- target="${javac.version}"
- source="${javac.version}"
- deprecation="${javac.deprecation}">
- <classpath refid="classpath"/>
- </javac>
- </target>
-
- <target name="compile-core">
- <ant target="compile-core" inheritall="false" dir="${nutch.root}"/>
- <ant target="compile"/>
- </target>
-
- <!-- ================================================================== -->
- <!-- Make plugin .jar -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="jar" depends="compile">
- <jar
- jarfile="${build.dir}/${name}.jar"
- basedir="${build.classes}"
- >
- <zipfileset prefix="META-INF" dir="${build.src.tmp}">
- <include name="*.xml"/>
- </zipfileset>
- </jar>
- </target>
-
- <target name="jar-core" depends="compile-core">
- <jar
- jarfile="${build.dir}/${name}.jar"
- basedir="${build.classes}"
- />
- </target>
-
- <!-- ================================================================== -->
- <!-- Deploy plugin to ${deploy.dir} -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="deploy" depends="jar, deps-test">
- <mkdir dir="${deploy.dir}"/>
- <copy file="plugin.xml" todir="${deploy.dir}"
- preservelastmodified="true"/>
- <copy file="${build.dir}/${name}.jar" todir="${deploy.dir}" failonerror="false"/>
- <copy todir="${deploy.dir}" flatten="true">
- <fileset refid="lib.jars"/>
- </copy>
- </target>
-
- <!-- ================================================================== -->
- <!-- Compile test code -->
- <!-- ================================================================== -->
- <target name="compile-test" depends="compile" if="test.available">
- <javac
- encoding="${build.encoding}"
- srcdir="${src.test}"
- includes="**/*.java"
- destdir="${build.test}"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- target="${javac.version}"
- source="${javac.version}"
- deprecation="${javac.deprecation}">
- <classpath refid="test.classpath"/>
- </javac>
- </target>
-
- <!-- ================================================================== -->
- <!-- Run unit tests -->
- <!-- ================================================================== -->
- <target name="test" depends="compile-test, deploy" if="test.available">
- <echo message="Testing plugin: ${name}"/>
-
- <junit printsummary="yes" haltonfailure="no" fork="yes"
- errorProperty="tests.failed" failureProperty="tests.failed">
- <sysproperty key="test.data" value="${build.test}/data"/>
- <sysproperty key="test.input" value="${root}/data"/>
- <classpath refid="test.classpath"/>
- <formatter type="plain" />
- <batchtest todir="${build.test}" unless="testcase">
- <fileset dir="${src.test}"
- includes="**/Test*.java" excludes="**/${test.exclude}.java" />
- </batchtest>
- <batchtest todir="${build.test}" if="testcase">
- <fileset dir="${src.test}" includes="**/${testcase}.java"/>
- </batchtest>
- </junit>
-
- <fail if="tests.failed">Tests failed!</fail>
-
- </target>
-
- <!-- ================================================================== -->
- <!-- Clean. Delete the build files, and their directories -->
- <!-- ================================================================== -->
- <target name="clean">
- <delete dir="${build.dir}"/>
- <delete dir="${deploy.dir}"/>
- </target>
-
- <target name="prepare-web">
- <delete dir="${build.web.dir}"/>
- <copy todir="${build.web.dir}" >
- <fileset dir="${web.root}">
- <include name="**/common.jsp"/>
- <include name="**/*.tld"/>
- <include name="**/web.xml"/>
- </fileset>
- </copy>
- <copy todir="${build.web.dir}">
- <fileset dir="${web.dir}">
- <include name="**/*.jsp"/>
- </fileset>
- </copy>
- </target>
- <!--
- Compile jsp -> java
- -->
- <target name="compile-jsp" depends="prepare-web">
- <jsp-compile
- uriroot="${build.web.dir}"
- outputdir="${build.src.dir}"
- package="org.apache.nutch.web2.plugin"
- webxml="${build.src.tmp}/jsp-servlet-mappings.xml"
- />
- </target>
-
-</project>
diff --git a/contrib/web2/plugins/build.xml b/contrib/web2/plugins/build.xml
deleted file mode 100755
index c4ef08484..000000000
--- a/contrib/web2/plugins/build.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="Nutch" default="deploy-core" basedir=".">
-
- <target name="deploy-core">
- <ant target="compile-core" inheritall="false" dir="../../../"/>
- <ant target="deploy"/>
- </target>
-
- <!-- ====================================================== -->
- <!-- Build & deploy all the plugin jars. -->
- <!-- ====================================================== -->
- <target name="deploy">
- <ant dir="webui-extensionpoints" target="deploy"/>
- <ant dir="web-caching-oscache" target="deploy"/>
- <ant dir="web-more" target="deploy"/>
- <ant dir="web-resources" target="deploy"/>
- <ant dir="web-clustering" target="deploy"/>
- <ant dir="web-keymatch" target="deploy"/>
- <ant dir="web-query-propose-ontology" target="deploy"/>
- <ant dir="web-query-propose-spellcheck" target="deploy"/>
- <ant dir="web-subcollection" target="deploy"/>
- </target>
-
- <!-- ====================================================== -->
- <!-- Test all of the plugins. -->
- <!-- ====================================================== -->
- <target name="test">
- <parallel threadCount="2">
- <ant dir="web-caching-oscache" target="test"/>
- <ant dir="web-keymatch" target="test"/>
- </parallel>
- </target>
-
- <!-- ====================================================== -->
- <!-- Clean all of the plugins. -->
- <!-- ====================================================== -->
- <target name="clean">
- <ant dir="webui-extensionpoints" target="clean"/>
- <ant dir="web-caching-oscache" target="clean"/>
- <ant dir="web-resources" target="clean"/>
- <ant dir="web-more" target="clean"/>
- <ant dir="web-keymatch" target="clean"/>
- <ant dir="web-clustering" target="clean"/>
- <ant dir="web-query-propose-ontology" target="clean"/>
- <ant dir="web-query-propose-spellcheck" target="clean"/>
- <ant dir="web-subcollection" target="clean"/>
- </target>
-
-</project>
diff --git a/contrib/web2/plugins/web-caching-oscache/README.txt b/contrib/web2/plugins/web-caching-oscache/README.txt
deleted file mode 100644
index cc5a1e053..000000000
--- a/contrib/web2/plugins/web-caching-oscache/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Cache search results in on disc cache.
-
-This plugin is made only for demonstration purposes.
diff --git a/contrib/web2/plugins/web-caching-oscache/build.xml b/contrib/web2/plugins/web-caching-oscache/build.xml
deleted file mode 100644
index 799317222..000000000
--- a/contrib/web2/plugins/web-caching-oscache/build.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-caching-oscache" default="jar-core">
-
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
-
- <target name="init-plugin">
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-
-</project>
diff --git a/contrib/web2/plugins/web-caching-oscache/lib/oscache-2.1.jar b/contrib/web2/plugins/web-caching-oscache/lib/oscache-2.1.jar
deleted file mode 100644
index 4496a88a6..000000000
Binary files a/contrib/web2/plugins/web-caching-oscache/lib/oscache-2.1.jar and /dev/null differ
diff --git a/contrib/web2/plugins/web-caching-oscache/oscache-2.1.LICENSE.txt b/contrib/web2/plugins/web-caching-oscache/oscache-2.1.LICENSE.txt
deleted file mode 100644
index 47a6c4262..000000000
--- a/contrib/web2/plugins/web-caching-oscache/oscache-2.1.LICENSE.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ====================================================================
- * The OpenSymphony Software License, Version 1.1
- *
- * (this license is derived and fully compatible with the Apache Software
- * License - see http://www.apache.org/LICENSE.txt)
- *
- * Copyright (c) 2001-2004 The OpenSymphony Group. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * OpenSymphony Group (http://www.opensymphony.com/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "OpenSymphony" and "The OpenSymphony Group"
- * must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact [email protected] .
- *
- * 5. Products derived from this software may not be called "OpenSymphony"
- * or "OSCache", nor may "OpenSymphony" or "OSCache" appear in their
- * name, without prior written permission of the OpenSymphony Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- */
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-caching-oscache/plugin.xml b/contrib/web2/plugins/web-caching-oscache/plugin.xml
deleted file mode 100644
index 8ecf837e9..000000000
--- a/contrib/web2/plugins/web-caching-oscache/plugin.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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.
--->
-<plugin id="web-caching-oscache" name="Search result caching"
- version="1.0.0" provider-name="apache.org">
-
- <runtime>
- <library name="web-caching-oscache.jar">
- <export name="*" />
- </library>
-
- <library name="oscache-2.1.jar" />
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-caching-oscache"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-caching-oscache/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-caching-oscache/src/conf/tiles-defs.xml
deleted file mode 100644
index cae57b523..000000000
--- a/contrib/web2/plugins/web-caching-oscache/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
- <!-- Search -->
- <definition name="searchPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.CachingSearchController">
- <put name="title" value="search.title" />
- <put name="pageBody" value="search" />
- </definition>
-</tiles-definitions>
diff --git a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/cache/CustomDiskPersistenceListener.java b/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/cache/CustomDiskPersistenceListener.java
deleted file mode 100644
index 42680d401..000000000
--- a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/cache/CustomDiskPersistenceListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* 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.
-*/
-package org.apache.nutch.cache;
-
-import com.opensymphony.oscache.plugins.diskpersistence.AbstractDiskPersistenceListener;
-
-public class CustomDiskPersistenceListener extends
- AbstractDiskPersistenceListener {
-
- protected char[] getCacheFileName(String arg0) {
- return arg0.toCharArray();
- }
-
-}
diff --git a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/CacheManager.java b/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/CacheManager.java
deleted file mode 100644
index 6044c1d9d..000000000
--- a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/CacheManager.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Properties;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.webapp.common.Search;
-import org.apache.nutch.webapp.common.ServiceLocator;
-
-import com.opensymphony.oscache.base.Cache;
-import com.opensymphony.oscache.base.CacheEntry;
-import com.opensymphony.oscache.base.EntryRefreshPolicy;
-import com.opensymphony.oscache.base.NeedsRefreshException;
-import com.opensymphony.oscache.general.GeneralCacheAdministrator;
-
-/**
- * This class is responsible for configuring the used cache and
- * delivering cached Search objects.
- *
- * Configuration parameters can be overrided with default nutch
- * configuration mechanism.
- *
- * Search Objects are compressed for smaller space requirements.
- */
-public class CacheManager {
-
- public static class ByteBufferWrapper implements Serializable {
-
- private static final long serialVersionUID = 1L;
- byte[] contents;
-
- public ByteBufferWrapper(final byte[] contents){
- this.contents=contents;
- }
-
- public byte[] getContents(){
- return contents;
- }
-
- }
-
- static final Log LOG=LogFactory.getLog(CacheManager.class);
-
- static final String CACHE_KEY=CacheManager.class.getName();
-
- class NutchRefreshPolicy implements EntryRefreshPolicy {
-
- private static final long serialVersionUID = 1L;
-
- public boolean needsRefresh(CacheEntry arg0) {
- return false;
- }
- }
-
- EntryRefreshPolicy policy=new NutchRefreshPolicy();
-
-
- Cache cache;
- GeneralCacheAdministrator cacheadmin;
-
- protected CacheManager(Configuration conf){
-
- Properties p=new Properties();
-
- //use memory for caching
- boolean cacheMemory=conf.getBoolean("cache.memory", false);
- p.setProperty("cache.memory", Boolean.toString(cacheMemory));
-
- //the persistence class used
- String cachePersistenceClass=conf.get("cache.persistence.class","org.apache.nutch.cache.CustomDiskPersistenceListener");
- p.setProperty("cache.persistence.class", cachePersistenceClass);
-
- //where to store cache files (if file cache used)
- String cachePath=conf.get("cache.path", ".");
- p.setProperty("cache.path", cachePath);
-
- //cacacity of cache (how many entries)
- int cacheCapacity=conf.getInt("cache.capacity", 1000);
- p.setProperty("cache.capacity", Integer.toString(cacheCapacity));
-
- cacheadmin=new GeneralCacheAdministrator(p);
- cache=cacheadmin.getCache();
- }
-
- public synchronized static CacheManager getInstance(Configuration conf){
- CacheManager cache=(CacheManager)conf.getObject(CACHE_KEY);
-
- if(cache==null) {
- cache = new CacheManager(conf);
-
- conf.setObject(CACHE_KEY, cache);
- }
- return cache;
- }
-
- /**
- * Get Search object from cache
- * @param id key
- * @return
- * @throws NeedsRefreshException
- */
- public Search getSearch(String id, ServiceLocator locator) throws NeedsRefreshException {
- Search search=null;
-
- ByteBufferWrapper w=(ByteBufferWrapper)cache.getFromCache(id);
- if(w!=null){
-
-
- try {
- long time=System.currentTimeMillis();
- ByteArrayInputStream is=new ByteArrayInputStream(w.getContents());
- GZIPInputStream gs = new GZIPInputStream(is);
- DataInputStream dis = new DataInputStream(gs);
-
- search = new Search(locator);
- search.readFields(dis);
- long delta=System.currentTimeMillis()-time;
-
- if(LOG.isDebugEnabled()){
- LOG.debug("Decompressing cache entry took: " + delta + "ms.");
- }
-
- search.init();
- } catch (IOException e) {
- LOG.info("Could not get cached object: " + e);
- }
- }
- return search;
- }
-
- /**
- * Put Search object in cache
- *
- * @param id key
- * @param search the search to cache
- */
- public void putSearch(String id, Search search){
- try {
- long time=System.currentTimeMillis();
- ByteArrayOutputStream bos=new ByteArrayOutputStream();
- GZIPOutputStream gzos=new GZIPOutputStream(bos);
- DataOutputStream oos=new DataOutputStream(gzos);
- search.write(oos);
- oos.flush();
- oos.close();
- gzos.close();
- long delta=System.currentTimeMillis()-time;
- ByteBufferWrapper wrap=new ByteBufferWrapper(bos.toByteArray());
- if(LOG.isDebugEnabled()){
- LOG.debug("Compressing cache entry took: " + delta + "ms.");
- LOG.debug("size: " + wrap.getContents().length + " bytes");
- }
- cache.putInCache(id, wrap);
- } catch (IOException e) {
- LOG.info("cannot store object in cache: " + e);
- }
- }
-
- public void cancelUpdate(String key) {
- cache.cancelUpdate(key);
- }
-}
diff --git a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/controller/CachingSearchController.java b/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/controller/CachingSearchController.java
deleted file mode 100644
index b4f5a8f16..000000000
--- a/contrib/web2/plugins/web-caching-oscache/src/java/org/apache/nutch/webapp/controller/CachingSearchController.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.webapp.CacheManager;
-import org.apache.nutch.webapp.common.Search;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.nutch.webapp.controller.SearchController;
-import org.apache.struts.tiles.ComponentContext;
-
-import com.opensymphony.oscache.base.NeedsRefreshException;
-
-/**
- * This naive search result caching implementation is just an example of
- * extending the web ui.
- */
-public class CachingSearchController extends SearchController implements Startable {
-
- CacheManager manager=null;
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
- Search search;
-
- // key used for caching results, should really be something else but a part of user
- // definable String
- String key = request.getQueryString().replace("?","_").replace("&","_");
- StringBuffer cacheKey=new StringBuffer(key.length()*2);
- for(int i=0;i<key.length();i++){
- cacheKey.append(key.charAt(i)).append(java.io.File.separatorChar);
- }
-
- if(LOG.isDebugEnabled()){
- LOG.debug("cache key:" + cacheKey);
- }
- if (cacheKey != null) {
- try {
- search = manager.getSearch(cacheKey.toString(), locator);
- request.setAttribute(Search.REQ_ATTR_SEARCH, search);
- if(LOG.isDebugEnabled()) {
- LOG.debug("Using cached");
- }
- } catch (NeedsRefreshException e) {
- try{
- super.nutchPerform(tileContext, request, response, servletContext);
- search = (Search) locator.getSearch();
- manager.putSearch(cacheKey.toString(),
- search);
- } catch (Exception ex){
- LOG.info("Cancelling update");
- manager.cancelUpdate(cacheKey.toString());
- }
- }
- }
- }
-
- public void start(ServletContext servletContext) {
- ServiceLocator locator=getServiceLocator(servletContext);
- manager=CacheManager.getInstance(locator.getConfiguration());
- }
-}
diff --git a/contrib/web2/plugins/web-clustering/build.xml b/contrib/web2/plugins/web-clustering/build.xml
deleted file mode 100644
index 7f5545fba..000000000
--- a/contrib/web2/plugins/web-clustering/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-clustering" default="jar-core">
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-</project>
diff --git a/contrib/web2/plugins/web-clustering/plugin.xml b/contrib/web2/plugins/web-clustering/plugin.xml
deleted file mode 100644
index bf5bc4000..000000000
--- a/contrib/web2/plugins/web-clustering/plugin.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.
--->
-<plugin id="web-clustering" name="Clustering web interface extension"
- version="1.0.0" provider-name="apache.org">
-
- <runtime>
- <library name="web-clustering.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- <!--
- Following is not a proper requirement, should really require
- generic clustering plugin not any specific impplementation
-
- (TODO: remove generic clustergin stuff from core and move it
- into a plugin?)
-
- -->
- <import plugin="clustering-carrot2" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Clustering extension for Web UI"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-clustering"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
- <extension-point
- id="org.apache.nutch.webapp.extension.PreSearchExtensionPoint"
- name="Pre search extension" />
-
- <extension
- id="org.apache.nutch.webapp.extension.PreSearchExtensionPoint"
- name="Clustering extension for Web UI"
- point="org.apache.nutch.webapp.extension.PreSearchExtensionPoint">
- <implementation id="web-clustering-presearch"
- class="org.apache.nutch.clustering.ClusteringPresearchExtension" />
- </extension>
-</plugin>
diff --git a/contrib/web2/plugins/web-clustering/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-clustering/src/conf/tiles-defs.xml
deleted file mode 100644
index 705be883a..000000000
--- a/contrib/web2/plugins/web-clustering/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
- "http://struts.apache.org/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="cluster"
- path="/plugin/web-clustering/cluster.jsp"
- controllerClass="org.apache.nutch.webapp.controller.ClusteringController" />
- <definition name="cluster-checkbox"
- path="/plugin/web-clustering/cluster-checkbox.jsp"
- controllerClass="org.apache.nutch.webapp.controller.ClusteringCheckboxController" />
-</tiles-definitions>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusterResult.java b/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusterResult.java
deleted file mode 100644
index f7264f86a..000000000
--- a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusterResult.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.clustering;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.nutch.webapp.common.SearchResultBean;
-
-/** Wrapper for HitsCluster
- *
- */
-public class ClusterResult {
-
- private int numDocs;
- private String labelString="";
- HitsCluster cluster;
-
- public ClusterResult(HitsCluster cluster, int numLabels, int numDocs){
- this.numDocs=numDocs;
- this.cluster=cluster;
- int maxSize=Math.min(numLabels, cluster.getDescriptionLabels().length);
- for(int i=0;i<maxSize;i++){
- if(i>0) {
- labelString+=", ";
- }
- labelString+=cluster.getDescriptionLabels()[i];
- }
- }
-
- public String getLabel(){
- return labelString;
- }
-
- /** return document samples of cluster
- *
- * @return
- */
- public List getDocs(){
- int maxNumDocs=Math.min(numDocs,cluster.getHits().length);
- List docs=new ArrayList(maxNumDocs);
- for(int i=0;i<maxNumDocs;i++){
- docs.add(new SearchResultBean(null, null, cluster.getHits()[i],null));
- }
- return docs;
- }
-
-}
diff --git a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusteringPresearchExtension.java b/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusteringPresearchExtension.java
deleted file mode 100644
index 8b63da2ee..000000000
--- a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/ClusteringPresearchExtension.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.clustering;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.extension.PreSearchExtensionPoint;
-
-/**
- * This class is responsible for interpreting request parameters
- * and reacting if named parameter is defined.
- *
- * If clustering is available the result window is checked
- * and expanded to 100 hits if required.
- */
-public class ClusteringPresearchExtension implements PreSearchExtensionPoint {
-
-
- /**
- * Check wether clustering is active or not
- * @param locator
- * @return true if clustering is active
- */
- public static boolean isClusteringActive(ServiceLocator locator){
- return locator.getSearchForm().getValueString(REQ_PARAM_CLUSTERING_ENABLED)!=null;
- }
-
- /**
- * The parameter name to be searched from request
- */
- public static final String REQ_PARAM_CLUSTERING_ENABLED="clustering";
-
- /*
- * This hook is executed before actual search
- * so we have a change to expand the result window
- * for clusterer if clustering is active for the request
- */
- public void doPreSearch(ServiceLocator locator) {
-
- if(isClusteringActive(locator)) {
-
- int orig=locator.getSearch().getHitsRequired();
-
- int hitsToCluster = locator.getConfiguration().getInt(
- "extension.clustering.hits-to-cluster", 100);
-
- if(orig < hitsToCluster){
- locator.getSearch().setHitsRequired(hitsToCluster);
- }
- }
- }
-}
diff --git a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/Clusters.java b/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/Clusters.java
deleted file mode 100644
index 48642b922..000000000
--- a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/clustering/Clusters.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.clustering;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Wrapper object to clustering results
- */
-public class Clusters {
-
- private List clusters;
-
- public Clusters(final HitsCluster [] clustersArray, final int numClusters, final int numDocs, final int numLabels){
- clusters=new ArrayList();
- for(int i=0;i<numClusters;i++){
- clusters.add(new ClusterResult(clustersArray[i], numDocs, numLabels));
- }
- }
-
- public List getClusters(){
- return clusters;
- }
-
- public boolean getHasClusters(){
- return clusters.size()>0;
- }
-
-
-}
diff --git a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringCheckboxController.java b/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringCheckboxController.java
deleted file mode 100644
index e8e93b6cb..000000000
--- a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringCheckboxController.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-* 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.
-*/
-package org.apache.nutch.webapp.controller;
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.clustering.ClusteringPresearchExtension;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.controller.NutchController;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * Controller logic to decide wether clustering checkbox
- * is checked or not.
- */
-public class ClusteringCheckboxController extends NutchController {
-
- public static final String REQ_ATTR_CLUSTERING_ENABLED="clusteringEnabled";
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator=getServiceLocator(request);
-
- if(ClusteringPresearchExtension.isClusteringActive(locator)) {
- request.setAttribute(REQ_ATTR_CLUSTERING_ENABLED, "1");
- }
- }
-}
diff --git a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringController.java b/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringController.java
deleted file mode 100644
index d0942c244..000000000
--- a/contrib/web2/plugins/web-clustering/src/java/org/apache/nutch/webapp/controller/ClusteringController.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.clustering.ClusteringPresearchExtension;
-import org.apache.nutch.clustering.Clusters;
-import org.apache.nutch.clustering.HitsCluster;
-import org.apache.nutch.clustering.OnlineClusterer;
-import org.apache.nutch.clustering.OnlineClustererFactory;
-import org.apache.nutch.plugin.PluginRuntimeException;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.Summary;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.struts.tiles.ComponentContext;
-
-public class ClusteringController extends NutchController implements Startable {
-
- public static final String REQ_ATTR_CLUSTERS = "clusters";
-
- static OnlineClusterer clusterer = null;
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
-
- if (ClusteringPresearchExtension.isClusteringActive(locator)) {
-
- // display top N clusters and top Q documents inside them.
- int N = locator.getConfiguration().getInt(
- "extension.clustering.cluster-count", 10);
- int Q = locator.getConfiguration().getInt(
- "extension.clustering.cluster-top-documents-count", 3);
- int maxLabels = 2;
-
- HitDetails[] details = locator.getSearch().getDetails();
- Summary[] summaries = locator.getSearch().getSummaries();
-
- HitsCluster[] clusters = null;
- if (clusterer != null) {
- final long clusteringStart = System.currentTimeMillis();
- try {
- clusters = clusterer.clusterHits(details, Summary
- .toStrings(summaries));
- final long clusteringDuration = System.currentTimeMillis()
- - clusteringStart;
- LOG.info("Clustering took: " + clusteringDuration + " milliseconds.");
-
- } catch (Exception e) {
- LOG.info("Could not do clustering???" + e);
- return;
- }
- }
-
- // set new limit if fever than N results
- N = Math.min(N, clusters.length);
-
- // set to request
- Clusters clusterResult = new Clusters(clusters, N, Q, maxLabels);
- request.setAttribute(REQ_ATTR_CLUSTERS, clusterResult);
- }
- }
-
- public void start(ServletContext servletContext) {
- ServiceLocator locator = getServiceLocator(servletContext);
- try {
- clusterer = new OnlineClustererFactory(locator.getConfiguration())
- .getOnlineClusterer();
- } catch (PluginRuntimeException e) {
- LOG.info("Could not initialize Clusterer, is the plugin enabled?");
- return;
- }
- }
-}
diff --git a/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster-checkbox.jsp b/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster-checkbox.jsp
deleted file mode 100644
index 7e4e0c47f..000000000
--- a/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster-checkbox.jsp
+++ /dev/null
@@ -1,28 +0,0 @@
-<%@ page session="false"%>
-<%--
- 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.
---%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
-<c:choose>
- <c:when test="${clusteringEnabled != null}">
- <input type="checkbox" name="clustering" value="on" checked="checked"/>
- </c:when>
- <c:otherwise>
- <input id="clustbox" type="checkbox" name="clustering" />
- </c:otherwise>
-</c:choose>
- <label for="clustbox"><fmt:message key="search.clustering"/></label>
diff --git a/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster.jsp b/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster.jsp
deleted file mode 100644
index 1cf0e01ba..000000000
--- a/contrib/web2/plugins/web-clustering/src/web/web-clustering/cluster.jsp
+++ /dev/null
@@ -1,63 +0,0 @@
-<%@ page session="false"%>
-<%--
- 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.
---%>
-<%@ taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles" %>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
-<%
-// @author Dawid Weiss
-//
-// PERFORMANCE/USER INTERFACE NOTE:
-//
-// What I do here is merely a demonstration. In real life the clustering
-// process should be done in a separate "processing" stream, most likely
-// a separate HTML frame that the user's browser requests data to.
-// We don't want the user to wait with plain snippets until the clusters
-// are created.
-//
-// Also: clustering is resource consuming, so a cache of recent queries
-// would be in place. Besides, such cache would also be beneficial for the
-// purpose of re-querying existing clusters (remember that the
-// clustering extension may be a heuristic returning a DIFFERENT set of
-// clusters for an identical input).
-// See www.vivisimo.com for details of how this can be done using frames, or
-// http://carrot.cs.put.poznan.pl for an example of a Javascript solution.
-%>
-<div id="cluster"><c:choose>
- <c:when test="${clusters!=null}">
-
- <c:choose>
- <c:when test="${clusters.hasClusters}">
- <c:forEach var="cluster" items="${clusters.clusters}">
- <div style="margin: 0px; padding: 0px; font-weight: bold;"><c:out
- value="${cluster.label}"></c:out><br />
- </div>
- <c:forEach var="doc" items="${cluster.docs}">
- <li><a href="<c:out value="${doc.url}"/>"><c:out
- value="${doc.title}" /></a></li>
- </c:forEach>
- </c:forEach>
- </c:when>
- <c:otherwise>
- <!-- todo: i18n -->
-No clusters available
-</c:otherwise>
- </c:choose>
-
- </c:when>
-</c:choose>
-</div>
diff --git a/contrib/web2/plugins/web-keymatch/README.txt b/contrib/web2/plugins/web-keymatch/README.txt
deleted file mode 100644
index edbf58833..000000000
--- a/contrib/web2/plugins/web-keymatch/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Instructions
-
-0. see general instructions from web2 README.txt
-1. Copy your keymatches.xml to nutch config directory.
-2. enable web-keymatches
-3. insert <tiles:insert name="keymatch"/> into web page to enable
-functionality
-4. ant war
-5. deploy war
diff --git a/contrib/web2/plugins/web-keymatch/build.xml b/contrib/web2/plugins/web-keymatch/build.xml
deleted file mode 100644
index b8240cbd3..000000000
--- a/contrib/web2/plugins/web-keymatch/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-keymatch" default="jar-core">
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-</project>
diff --git a/contrib/web2/plugins/web-keymatch/keymatches.xml b/contrib/web2/plugins/web-keymatch/keymatches.xml
deleted file mode 100644
index 5dbc3dcb3..000000000
--- a/contrib/web2/plugins/web-keymatch/keymatches.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<keymatches>
- <keymatch type="keyword">
- <term>mapred</term>
- <url>http://lucene.apache.org/hafoop/</url>
- <title>Try Hadoop today!</title>
- </keymatch>
- <keymatch type="phrase">
- <term>search engine</term>
- <url>http://lucene.apache.org/nutch/</url>
- <title>Try nutch!</title>
- </keymatch>
- <keymatch type="exact">
- <term>apache search engine</term>
- <url>http://lucene.apache.org/nutch/</url>
- <title>Try apache nutch!</title>
- </keymatch>
- <keymatch type="exact">
- <term>kw1 kw2 kw3 kw4</term>
- <url>url/</url>
- <title>title</title>
- </keymatch>
-</keymatches>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-keymatch/plugin.xml b/contrib/web2/plugins/web-keymatch/plugin.xml
deleted file mode 100644
index c81eea321..000000000
--- a/contrib/web2/plugins/web-keymatch/plugin.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.
--->
-<plugin id="web-keymatch" name="KeyMatcher for promoting urls"
- version="1.0.0" provider-name="apache.org">
-
- <runtime>
- <library name="web-keymatch.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-keymatch"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-keymatch/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-keymatch/src/conf/tiles-defs.xml
deleted file mode 100644
index 27fbf17d8..000000000
--- a/contrib/web2/plugins/web-keymatch/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
- "http://struts.apache.org/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="keymatch" extends="decoratedDefinition" controllerClass="org.apache.nutch.webapp.controller.KeyMatchController">
- <put name="name" type="string">keymatch</put>
- <put name="decorator" type="string" value="/plugin/web-keymatch/keymatch.jsp"/>
- </definition>
-</tiles-definitions>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/AbstractFilter.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/AbstractFilter.java
deleted file mode 100644
index 8403b75cc..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/AbstractFilter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.List;
-import java.util.Map;
-
-public abstract class AbstractFilter implements KeyMatchFilter {
-
- KeyMatchFilter next=null;
-
- /* (non-Javadoc)
- * @see org.apache.nutch.keymatch.IKeyMatchFilter#setNext(org.apache.nutch.keymatch.IKeyMatchFilter)
- */
- public void setNext(KeyMatchFilter next){
- this.next=next;
- }
-
-
- /* (non-Javadoc)
- * @see org.apache.nutch.keymatch.IKeyMatchFilter#filter(java.util.List, java.util.Map)
- */
- public KeyMatch[] filter(List matches, Map context) {
- if (next==null) {
-
- //update view counts
- for(int i=0;i<matches.size();i++){
- ((KeyMatch)matches.get(i)).viewCount++;
- }
-
- return (KeyMatch[])matches.toArray(new KeyMatch[matches.size()]);
- } else {
- return next.filter(matches, context);
- }
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/CountFilter.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/CountFilter.java
deleted file mode 100644
index 6b56cc388..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/CountFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>Implementation of KeyMatchFilter that simply
- * crops the count of matches to defined level or
- * by default of 3.</p>
- *
- * <p>The number of results returned is controlled
- * with context parameter under key "count"</p>
- *
- * @author Sami Siren
- */
-public class CountFilter extends AbstractFilter {
-
- public static final String KEY_COUNT="count";
- public static final int DEFAULT_COUNT=3;
-
- public KeyMatch[] filter(List matches, Map context) {
- int count=DEFAULT_COUNT;
-
- try{
- count=Integer.parseInt((String)context.get(KEY_COUNT));
- } catch (Exception e){
- //ignore
- }
-
- if(matches.size()>count) {
- return super.filter(matches.subList(0,count), context);
- } else {
- return super.filter(matches, context);
- }
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatch.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatch.java
deleted file mode 100644
index 6cb0c18ac..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatch.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import org.apache.xerces.util.DOMUtil;
-import org.w3c.dom.Element;
-
-public class KeyMatch {
-
- public static final String TAG_TERM = "term";
-
- public static final String TAG_URL = "url";
-
- public static final String TAG_TITLE = "title";
-
- public static final String ATTR_TYPE = "type";
-
- public static final String TYPES[] = { "keyword", "phrase", "exact" };
-
- public static final int TYPE_KEYWORD=0;
- public static final int TYPE_PHRASE=1;
- public static final int TYPE_EXACT=2;
-
- static int counter = 0;
-
- String term;
- String url;
- String title;
- int type;
- int viewCount=0;
-
- transient String identifier;
-
- public KeyMatch() {
- // generate unique id
- this.identifier = "m-" + counter++;
- }
-
- public KeyMatch(String terms, String url, String title, int type) {
- this();
- this.term = terms;
- this.url = url;
- this.title = title;
-
- if (type > TYPES.length) {
- this.type = 0;
- } else {
- this.type = type;
- }
-
- }
-
- /**
- * Initialize object from Element
- *
- * @param element
- */
- public void initialize(final Element element) {
- try {
- term = DOMUtil.getChildText(
- element.getElementsByTagName(TAG_TERM).item(0)).trim();
-
- String stype = element.getAttribute(ATTR_TYPE);
- for (int i = 0; i < TYPES.length; i++) {
- if (TYPES[i].equals(stype)) {
- type = i;
- }
- }
-
- url = DOMUtil.getChildText(element.getElementsByTagName(TAG_URL).item(0))
- .trim();
- title = DOMUtil.getChildText(
- element.getElementsByTagName(TAG_TITLE).item(0)).trim();
- } catch (Exception ex) {
- // ignore
- }
- }
-
- /**
- * Fill in element with data from this object
- *
- * @param element
- */
- public void populateElement(final Element element) {
- final Element term = element.getOwnerDocument().createElement(TAG_TERM);
- term.setNodeValue(this.term);
- element.appendChild(term);
- element.setAttribute(ATTR_TYPE, TYPES[type]);
- final Element url = element.getOwnerDocument().createElement(TAG_URL);
- url.setNodeValue(this.url);
- element.appendChild(url);
- final Element title = element.getOwnerDocument().createElement(TAG_TITLE);
- title.setNodeValue(this.title);
- element.appendChild(title);
- }
-
- /**
- * @return Returns the term.
- */
- public String getTerm() {
- return term;
- }
-
- /**
- * @param term
- * The term to set.
- */
- public void setTerm(final String term) {
- this.term = term;
- }
-
- /**
- * @return Returns the title.
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * @param title
- * The title to set.
- */
- public void setTitle(final String title) {
- this.title = title;
- }
-
- /**
- * @return Returns the url.
- */
- public String getUrl() {
- return url;
- }
-
- /**
- * @param url
- * The url to set.
- */
- public void setUrl(final String url) {
- this.url = url;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if(obj instanceof KeyMatch) {
- KeyMatch other=(KeyMatch) obj;
- return (other.type==type && other.term.equals(term) && other.title.equals(title) && other.url.equals(url));
- } else
- return super.equals(obj);
- }
-
- /**
- * @return Returns the type.
- */
- public int getType() {
- return type;
- }
-
- /**
- * @param type The type to set.
- */
- public void setType(int type) {
- this.type = type;
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatchFilter.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatchFilter.java
deleted file mode 100644
index 0a99cecef..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/KeyMatchFilter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>All implementing classes should extend AbstractFilter
- * </p>
- */
-public interface KeyMatchFilter {
-
- /**
- * Do filtering for matches
- * @param matches current List of matches
- * @param context the evaluation context
- * @return
- */
- public KeyMatch[] filter(List matches, Map context);
-
- /**
- * <p>Set the next filter that is processed after this
- * one</p>
- * @param filter the filter to set
- */
- public void setNext(KeyMatchFilter filter);
-
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/SimpleKeyMatcher.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/SimpleKeyMatcher.java
deleted file mode 100644
index 1476576ba..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/SimpleKeyMatcher.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.conf.Configured;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.util.DomUtil;
-import org.apache.xerces.dom.DocumentImpl;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * <p>SimpleKeyMatcher is responsible for targetting predefined links for defined
- * keywords for example to promote some urls that are not yet part of
- * production index.</p>
- * <p>SimpleKeyMatcher is not a textadd targetting system</p>
- * <p>KeyMatcher is configured with xml configuration file:
- * <br><pre>
- * &lt;?xml version="1.0"?>
- * &lt;keymatches>
- * &lt;keymatch type="keyword|phrase|exact">
- * &lt;term>search engine&lt;/term>
- * &lt;url>http://lucene.apache.org/nutch&lt;/url>
- * &lt;title>Your favourite search engine!&lt;/title>
- * &lt;/keymatch>
- * &lt;/keymatches></pre>
- * By default Keymatcher expects the file be named keymatches.xml
- * </p>
- * <p>Match type can be one of the following: keyword, phrase, exact match.
- * Terms of a query are produced by the Query object and none of the
- * matches is case sensitive</p>
- * <b>keyword</b><br>
- * Matches on keyword level, for example query "search engine" would match both
- * keywords search and engine<br>
- * <br>
- * <b>phrase</b><br>
- * Matches phrase, for example: query "open source search engine" "search engine watch"
- * would match "search engine", but query "search from engine" would not.<br>
- * <br>
- * <b>exact</b><br>
- * Query "open source search engine" would match "open source search engine", but not
- * "search engine" nor "best open source engine"<br>
- *
- */
-public class SimpleKeyMatcher extends Configured {
-
- static final char PREFIX_KEYWORD='k';
- static final char PREFIX_PHRASE='p';
- static final char PREFIX_EXACT='e';
-
- class KeyMatcherStats {
- int terms[];
-
- void addStats(int numTerms) {
- if (numTerms <= terms.length) {
- terms[numTerms]++;
- }
- }
-
- public KeyMatcherStats(int size) {
- terms = new int[size];
- for (int i = 0; i < size; i++) {
- terms[i] = 0;
- }
- }
- }
-
- public static final Log LOG = LogFactory.getLog(SimpleKeyMatcher.class);
-
- public static final String TAG_KEYMATCH = "keymatch";
-
- public static final String TAG_KEYMATCHES = "keymatches";
-
- static final String DEFAULT_CONFIG_FILE = "keymatches.xml";
-
- static final int MAX_TERMS = 5;
-
- KeyMatcherStats stats;
- KeyMatchFilter currentFilter;
-
- HashMap matches = new HashMap();
- private String configName;
-
- public SimpleKeyMatcher(Configuration conf) {
- this(DEFAULT_CONFIG_FILE,conf);
- }
-
- /**
- * Sets currentFilter
- * @param filter the filter to set
- */
- public void setFilter(KeyMatchFilter filter) {
- this.currentFilter=filter;
- }
-
- /**
- * Construct new SimpleKeyMatcher with provided filename and configuration
- * @param resourceName
- * @param conf
- */
- public SimpleKeyMatcher(String resourceName, Configuration conf) {
- super(conf);
- configName=resourceName;
- stats = new KeyMatcherStats(MAX_TERMS);
- currentFilter=new ViewCountSorter();
- init();
- }
-
- /**
- * Initialize keyword matcher
- *
- */
- protected void init() {
- final HashMap tempMap = new HashMap();
- final InputStream input = getConf().getConfResourceAsInputStream(
- configName);
-
- if (input != null) {
- final Element root = DomUtil.getDom(input);
- try {
- input.close();
- } catch (IOException e1) {
- e1.printStackTrace();
- }
-
- final NodeList nodeList = root.getElementsByTagName(TAG_KEYMATCH);
-
- LOG.debug("Configuration file has " + nodeList.getLength()
- + " KeyMatch entries.");
- for (int i = 0; i < nodeList.getLength(); i++) {
- final Element element = (Element) nodeList.item(i);
- final KeyMatch keyMatch = new KeyMatch();
- keyMatch.initialize(element);
- addKeyMatch(tempMap, keyMatch);
- }
-
- matches=tempMap;
- }
- }
-
- /**
- * Get keymatches for query
- * @param query parsed query
- * @param context evaluation context
- * @return array of keymatches
- */
- public KeyMatch[] getMatches(final Query query, Map context) {
-
- final ArrayList currentMatches=new ArrayList();
-
- final String terms[]=query.getTerms();
-
- //"keyword"
- for(int i=0;i<terms.length;i++){
- if(LOG.isDebugEnabled()){
- LOG.debug("keyword: '" + terms[i] + "'");
- }
-
- addMatches(currentMatches, matches.get(PREFIX_KEYWORD + terms[i]));
- }
-
- //"phrase"
- for(int l=2;l<=terms.length;l++){
- if(stats.terms[l]>0) {
- for(int p=0;p<=terms.length-l;p++){
- String key="";
- for(int i=p;i<p+l;i++){
- key+=terms[i];
- if(i!=p+l-1) key+=" ";
- }
- if(LOG.isDebugEnabled()){
- LOG.debug("phrase key: '" + key + "'");
- }
- addMatches(currentMatches, matches.get(PREFIX_PHRASE + key));
- }
- }
- }
-
- //"exact"
- String key=query.toString();
- if(LOG.isDebugEnabled()){
- LOG.debug("exact key: '" + key + "'");
- }
-
- addMatches(currentMatches, matches.get(PREFIX_EXACT + key));
-
- return currentFilter.filter(currentMatches, context);
- }
-
- void addMatches(ArrayList currentMatches, Object match){
- if(match!=null) {
- if(match instanceof ArrayList) {
- currentMatches.addAll(((ArrayList)match));
- } else {
- currentMatches.add(match);
- }
- }
- }
-
- /** Get tokens of a string with nutch Query parser
- *
- * @param string
- * @return
- */
- private String[] getTokens(final String string){
- org.apache.nutch.searcher.Query q;
- try {
- q = org.apache.nutch.searcher.Query.parse(string, getConf());
- return q.getTerms();
- } catch (IOException e) {
- LOG.info("Error getting terms from query:" + e);
- }
- return new String[0];
- }
-
- /**
- * add new keymatch
- *
- * @param keymatch
- */
- protected void addKeyMatch(Map map, final KeyMatch keymatch) {
- String key="";
-
- LOG.info("Adding keymatch: MATCHTYPE=" + KeyMatch.TYPES[keymatch.type] + ", TERM='" + keymatch.term + "', TITLE='"
- + keymatch.title + "' ,URL='" + keymatch.url + "'");
-
- keymatch.term=keymatch.term.toLowerCase();
- switch (keymatch.type) {
- case KeyMatch.TYPE_EXACT: key+=PREFIX_EXACT;break;
- case KeyMatch.TYPE_PHRASE: key+=PREFIX_PHRASE;break;
- default: key+=PREFIX_KEYWORD;break;
- }
-
- //add info obout kw count for optimization
- if(keymatch.type==KeyMatch.TYPE_PHRASE) {
- stats.addStats(getTokens(keymatch.term).length);
- }
-
- key+=keymatch.term;
-
- if(map.containsKey(key)) {
- ArrayList l;
-
- Object o = matches.get(key);
- if(o instanceof ArrayList) {
- l=(ArrayList) o;
- } else {
- KeyMatch temp=(KeyMatch)o;
- l=new ArrayList();
- l.add(temp);
- }
- l.add(keymatch);
- map.put(key,l);
- } else {
- map.put(key, keymatch);
- }
- }
-
- /**
- * Add Keymatch
- *
- */
- public void addKeyMatch(KeyMatch match){
- addKeyMatch(matches, match);
- }
-
- /**
- * Saves keymatch configuration into file.
- *
- * @throws IOException
- */
- public void save() throws IOException {
- try {
- final URL url = getConf().getResource(configName);
- if (url == null) {
- throw new IOException("Resource not found: " + configName);
- }
- final FileOutputStream fos = new FileOutputStream(new File(url.getFile()));
- final DocumentImpl doc = new DocumentImpl();
- final Element keymatches = doc.createElement(TAG_KEYMATCHES);
- final Iterator iterator = matches.values().iterator();
-
- while (iterator.hasNext()) {
- final Element keymatch = doc.createElement(TAG_KEYMATCH);
- final KeyMatch keyMatch = (KeyMatch) iterator.next();
- keyMatch.populateElement(keymatch);
- keymatches.appendChild(keymatch);
- }
-
- DomUtil.saveDom(fos, keymatches);
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- throw new IOException(e.toString());
- }
- }
-
- /**
- * Clear keymatches from this SimpleKeyMatcher instance
- *
- */
- public void clear(){
- matches=new HashMap();
- }
-
- public void setKeyMatches(List keymatches){
- HashMap hm=new HashMap();
- Iterator i=keymatches.iterator();
- while(i.hasNext()) {
- KeyMatch km=(KeyMatch)i.next();
- addKeyMatch(hm,km);
- }
- matches=hm;
- }
-
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/ViewCountSorter.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/ViewCountSorter.java
deleted file mode 100644
index 5201d1a71..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/ViewCountSorter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>Implementation of KeyMatchFilter that sorts
- * keymatches based on KeyMatch view counts. It allows
- * simple rotation of matches (keymatches with lower view
- * counts are "prioritized").</p>
- */
-public class ViewCountSorter extends AbstractFilter {
-
- public class ViewCountComparator implements Comparator {
-
- public int compare(Object o1, Object o2) {
- return ((KeyMatch)o1).viewCount-((KeyMatch)o2).viewCount;
- }
- }
-
- public KeyMatch[] filter(final List currentMatches, final Map context){
- Collections.sort(currentMatches, new ViewCountSorter.ViewCountComparator());
- return super.filter(currentMatches, context);
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/package.html b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/package.html
deleted file mode 100644
index 4c3a651e2..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/keymatch/package.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>
-SimpleKeyMatcher is a utility for promoting certain web pages in your
-search wich are not yet part of production index or have low score.
-</body>
-</html>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/webapp/controller/KeyMatchController.java b/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/webapp/controller/KeyMatchController.java
deleted file mode 100644
index 814ab104b..000000000
--- a/contrib/web2/plugins/web-keymatch/src/java/org/apache/nutch/webapp/controller/KeyMatchController.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-import java.util.HashMap;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.keymatch.CountFilter;
-import org.apache.nutch.keymatch.KeyMatch;
-import org.apache.nutch.keymatch.SimpleKeyMatcher;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.struts.tiles.ComponentContext;
-
-public class KeyMatchController extends NutchController implements Startable{
-
- public static final String ATTR_KEYMATCHES="keymatches";
-
- static SimpleKeyMatcher keymatcher;
- static HashMap context;
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
- ServiceLocator serviceLocator=getServiceLocator(request);
- HashMap context=new HashMap();
- KeyMatch[] matches=keymatcher.getMatches(serviceLocator.getSearch().getQuery(),context);
- request.setAttribute(ATTR_KEYMATCHES, matches);
- }
-
- public void start(ServletContext servletContext) {
- LOG.info("Starting keymatcher");
- ServiceLocator serviceLocator=getServiceLocator(servletContext);
- keymatcher=new SimpleKeyMatcher(serviceLocator.getConfiguration());
- context=new HashMap();
- //how many matches
- context.put(CountFilter.KEY_COUNT,"1");
- LOG.info("Starting keymatcher ok");
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestSimpleKeyMatcher.java b/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestSimpleKeyMatcher.java
deleted file mode 100644
index 91da3fb2b..000000000
--- a/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestSimpleKeyMatcher.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.HashMap;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.util.NutchConfiguration;
-
-import junit.framework.TestCase;
-
-public class TestSimpleKeyMatcher extends TestCase {
-
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- conf=NutchConfiguration.create();
- km=new SimpleKeyMatcher(conf);
- }
-
- SimpleKeyMatcher km;
-
- Configuration conf;
-
- /*
- * Test method for 'org.apache.nutch.keymatch.SimpleKeyMatcher.getMatches(Query, int)'
- */
- public void testGetMatches() {
- HashMap context=new HashMap();
- context.put(CountFilter.KEY_COUNT,"1");
-
- //keyword
- KeyMatch[] matches=getKeyMatchesForString("kw1 kw2 kw3 auto");
- assertEquals(1,matches.length);
-
- //phrase
- matches=getKeyMatchesForString("search engine");
- assertEquals(1,matches.length);
-
- //exact + phrase
- matches=getKeyMatchesForString("apache search engine");
- assertEquals(2,matches.length);
-
- //exact
- matches=getKeyMatchesForString("kw1 kw2 kw3 kw4");
- assertEquals(1,matches.length);
-
- matches=getKeyMatchesForString("kw2 kw2 kw3 kw4");
- assertEquals(0,matches.length);
-
- }
-
- /*
- * Test method for 'org.apache.nutch.keymatch.SimpleKeyMatcher.addKeyMatch(Map, KeyMatch, boolean)'
- */
- public void testAddKeyMatch() {
- KeyMatch keymatch=new KeyMatch("httpd","http://www.apache.org/","apache", KeyMatch.TYPE_KEYWORD);
- km.addKeyMatch(keymatch);
- KeyMatch matched[]=getKeyMatchesForString("httpd");
- assertTrue(keymatch.equals(matched[0]));
- }
-
- private KeyMatch[] getKeyMatchesForString(String string) {
-
- Query q;
- HashMap context=new HashMap();
- context.put(CountFilter.KEY_COUNT,"1");
- try {
- q = Query.parse(string, conf);
- return km.getMatches(q,context);
- } catch (Exception e){
-
- }
- return new KeyMatch[0];
- }
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestViewCountSorter.java b/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestViewCountSorter.java
deleted file mode 100644
index 1d30f48ff..000000000
--- a/contrib/web2/plugins/web-keymatch/src/test/org/apache/nutch/keymatch/TestViewCountSorter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.keymatch;
-
-import java.util.HashMap;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.util.NutchConfiguration;
-
-import junit.framework.TestCase;
-
-public class TestViewCountSorter extends TestCase {
-
- SimpleKeyMatcher km;
- Configuration conf;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- conf=NutchConfiguration.create();
- km=new SimpleKeyMatcher(conf);
- km.clear();
- KeyMatch m=new KeyMatch("kw1","u1","t1",KeyMatch.TYPE_KEYWORD);
- km.addKeyMatch(m);
- m=new KeyMatch("kw1","u2","t2",KeyMatch.TYPE_KEYWORD);
- km.addKeyMatch(m);
- m=new KeyMatch("kw1","u3","t3",KeyMatch.TYPE_KEYWORD);
- km.addKeyMatch(m);
- ViewCountSorter vcs=new ViewCountSorter();
- vcs.setNext(new CountFilter());
- km.setFilter(vcs);
- }
-
- /*
- * Test method for 'org.apache.nutch.keymatch.ViewCountSorter.filter(List, Map)'
- */
- public void testFilter() {
- KeyMatch m1,m2,m3;
-
- KeyMatch[] matches=getKeyMatchesForString("kw1");
- m1=matches[0];
- assertNotNull(m1);
-
- matches=getKeyMatchesForString("kw1");
- m2=matches[0];
- assertNotNull(m2);
-
- matches=getKeyMatchesForString("kw1");
- m3=matches[0];
- assertNotNull(m3);
-
- assertFalse(m1.equals(m2));
- assertFalse(m2.equals(m3));
- assertFalse(m1.equals(m3));
- }
-
- private KeyMatch[] getKeyMatchesForString(String string) {
-
- Query q;
- HashMap context=new HashMap();
- context.put(CountFilter.KEY_COUNT,"1");
- try {
- q = Query.parse(string, conf);
- return km.getMatches(q,context);
- } catch (Exception e){
-
- }
- return new KeyMatch[0];
- }
-
-}
diff --git a/contrib/web2/plugins/web-keymatch/src/web/web-keymatch/keymatch.jsp b/contrib/web2/plugins/web-keymatch/src/web/web-keymatch/keymatch.jsp
deleted file mode 100644
index 988528c83..000000000
--- a/contrib/web2/plugins/web-keymatch/src/web/web-keymatch/keymatch.jsp
+++ /dev/null
@@ -1,27 +0,0 @@
-<%@ page session="false"%>
-<%--
- 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.
---%>
-<%@ taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
-<div id="keymatch">
-<c:forEach var="keymatch" items="${keymatches}">
- <a href="search.do?query=<c:out value="${keymatch.url}"/>">
- <c:out value="${keymatch.title}"/>
- </a><br/>
-</c:forEach>
-</div>
diff --git a/contrib/web2/plugins/web-more/build.xml b/contrib/web2/plugins/web-more/build.xml
deleted file mode 100644
index 709869168..000000000
--- a/contrib/web2/plugins/web-more/build.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-more" default="jar-core">
-
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
-
- <target name="init-plugin">
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-
-</project>
diff --git a/contrib/web2/plugins/web-more/plugin.xml b/contrib/web2/plugins/web-more/plugin.xml
deleted file mode 100644
index 4ec14b164..000000000
--- a/contrib/web2/plugins/web-more/plugin.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.
--->
-<plugin id="web-more" name="diplay information from index-more plgin"
- version="1.0.0" provider-name="apache.org">
-
- <runtime>
- <library name="web-more.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-more"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-more/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-more/src/conf/tiles-defs.xml
deleted file mode 100644
index 3597771ef..000000000
--- a/contrib/web2/plugins/web-more/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="more" path="/plugin/more.jsp" controllerClass="org.apache.nutch.webapp.controller.MoreController">
- <putList name="moreNames" id="moreNames">
- <add value="primaryType" type="string"/>
- <add value="subType" type="string"/>
- <add value="contentLength" type="string"/>
- <add value="lastModified" type="string"/>
- </putList>
- </definition>
-</tiles-definitions>
diff --git a/contrib/web2/plugins/web-more/src/java/org/apache/nutch/webapp/controller/MoreController.java b/contrib/web2/plugins/web-more/src/java/org/apache/nutch/webapp/controller/MoreController.java
deleted file mode 100644
index a17572010..000000000
--- a/contrib/web2/plugins/web-more/src/java/org/apache/nutch/webapp/controller/MoreController.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-import java.util.Date;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.webapp.common.SearchResultBean;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * This is the controller used when rendering a hit. Basically what
- * happens here is that we get some meta data values from HitDetails
- * and stick them into request object so the jsp can display them.
- *
- */
-public class MoreController extends NutchController {
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- SearchResultBean hit = (SearchResultBean) request.getAttribute("hit");
-
- if (hit != null) {
-
- // Content-Type
- String primaryType = hit.getDetails().getValue("primaryType");
- String subType = hit.getDetails().getValue("subType");
-
- String contentType = subType;
- if (contentType == null)
- contentType = primaryType;
- if (contentType != null) {
- request.setAttribute("contentType", contentType);
- }
- // Content-Length
- String contentLength = hit.getDetails().getValue("contentLength");
- if (contentLength != null) {
- request.setAttribute("contentLength", contentLength);
- }
-
- // Last-Modified
- String lastModified = hit.getDetails().getValue("lastModified");
- if (lastModified != null) {
- long millis = new Long(lastModified).longValue();
- Date date = new Date(millis);
- request.setAttribute("lastModified", date);
- }
- } else {
- LOG.info("hit was null?");
- }
- }
-}
diff --git a/contrib/web2/plugins/web-more/src/web/more.jsp b/contrib/web2/plugins/web-more/src/web/more.jsp
deleted file mode 100644
index 857ac6374..000000000
--- a/contrib/web2/plugins/web-more/src/web/more.jsp
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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.
--->
-<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
- xmlns:c="/tags/jstl-c" xmlns:tiles="/tags/struts-tiles"
- xmlns:fmt="/tags/jstl-fmt">
- <jsp:directive.page session="false" />
- <c:if
- test="${contentType!=null || contentLength!=null ||lastModified!=null }">
- <c:if test="${contentLength!=null}">
- <fmt:message key="search.contentType">
- <fmt:param value="${contentType}" />
- </fmt:message>
- </c:if>
- <c:if test="${contentLength!=null}">
- <fmt:message key="search.contentLength">
- <fmt:param value="${contentLength}" />
- </fmt:message>
- </c:if>
- <c:if test="${contentLength!=null}">
- <fmt:message key="search.lastModified">
- <fmt:param>
- <fmt:formatDate value="${lastModified}" />
- </fmt:param>
- </fmt:message>
- </c:if>
- <br />
- </c:if>
-</jsp:root>
diff --git a/contrib/web2/plugins/web-query-propose-ontology/build.xml b/contrib/web2/plugins/web-query-propose-ontology/build.xml
deleted file mode 100644
index f9672b1bc..000000000
--- a/contrib/web2/plugins/web-query-propose-ontology/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-query-propose-ontology" default="jar-core">
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-</project>
diff --git a/contrib/web2/plugins/web-query-propose-ontology/plugin.xml b/contrib/web2/plugins/web-query-propose-ontology/plugin.xml
deleted file mode 100644
index 9cda6e1d6..000000000
--- a/contrib/web2/plugins/web-query-propose-ontology/plugin.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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.
--->
-<plugin id="web-query-propose-ontology" name="Ontology query proposer"
- version="1.0.0" provider-name="apache.org">
-
- <runtime>
- <library name="web-query-propose-ontology.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- <import plugin="ontology" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-query-propose-ontology"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-query-propose-ontology/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-query-propose-ontology/src/conf/tiles-defs.xml
deleted file mode 100644
index 7a2dbf540..000000000
--- a/contrib/web2/plugins/web-query-propose-ontology/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
- "http://struts.apache.org/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="propose" controllerClass="org.apache.nutch.webapp.controller.OntologyProposerController" path="/plugin/web-query-propose-ontology/propose.jsp"/>
-</tiles-definitions>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-query-propose-ontology/src/java/org/apache/nutch/webapp/controller/OntologyProposerController.java b/contrib/web2/plugins/web-query-propose-ontology/src/java/org/apache/nutch/webapp/controller/OntologyProposerController.java
deleted file mode 100644
index c02e7307f..000000000
--- a/contrib/web2/plugins/web-query-propose-ontology/src/java/org/apache/nutch/webapp/controller/OntologyProposerController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.ontology.Ontology;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.struts.tiles.ComponentContext;
-
-public class OntologyProposerController extends NutchController implements Startable {
-
- public static final String ATTR_NAME="queryPropose";
-
- static Ontology ontology;
-
- public void nutchPerform(ComponentContext tileContext, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator=getServiceLocator(request);
-
- if (ontology != null) {
- LOG.info("Calling ontology with parameter:" + locator.getSearch().getQueryString());
- request.setAttribute(ATTR_NAME, ontology.subclasses(locator.getSearch().getQueryString()));
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.nutch.webapp.common.Startable#start(javax.servlet.ServletContext)
- */
- public void start(ServletContext servletContext) {
-
- ServiceLocator locator=getServiceLocator(servletContext);
-
- try {
- String urls = locator.getConfiguration().get("extension.ontology.urls");
- ontology = new org.apache.nutch.ontology.OntologyFactory(locator.getConfiguration()).getOntology();
-
- LOG.info("Initializing Ontology with urls:" + urls);
-
- //FIXME initialization code should be in Ontology instead
- if (urls==null || urls.trim().equals("")) {
- // ignored siliently
- } else {
- ontology.load(urls.split("\\s+"));
- }
- } catch (Exception e) {
- LOG.info("Exception occured while initializing Ontology" + e);
- }
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-ontology/src/web/web-query-propose-ontology/propose.jsp b/contrib/web2/plugins/web-query-propose-ontology/src/web/web-query-propose-ontology/propose.jsp
deleted file mode 100644
index 341aecce0..000000000
--- a/contrib/web2/plugins/web-query-propose-ontology/src/web/web-query-propose-ontology/propose.jsp
+++ /dev/null
@@ -1,31 +0,0 @@
-<%--
- 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.
---%>
-<%@ page session="false"%>
-<%@ taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
-<%
-// 20041129, Mike Pan and John Xing
-// Displays query-refinement hypertext based on ontology.
-// Try to be simple here. No mixing with other features such as clustering.
-%>
-<div id="refine">Refine your search:
-<c:forEach var="propose" items="${queryPropose}">
- <a href="search.do?query=<c:out value="${propose}"/>">
- <c:out value="${propose}"/>
- </a> |
-</c:forEach>
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/build.xml b/contrib/web2/plugins/web-query-propose-spellcheck/build.xml
deleted file mode 100644
index b447c88bd..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-query-propose-spellcheck" default="jar-core">
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-</project>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/plugin.xml b/contrib/web2/plugins/web-query-propose-spellcheck/plugin.xml
deleted file mode 100644
index 4246f52ad..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/plugin.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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.
--->
-<plugin id="web-query-propose-spellcheck"
- name="Spellcheck query proposer" version="1.0.0"
- provider-name="apache.org">
-
- <runtime>
- <library name="web-query-propose-spellcheck.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-query-propose-spellcheck"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-query-propose-spellcheck/src/conf/tiles-defs.xml
deleted file mode 100644
index 2c2e08b52..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "/WEB-INF/dtd/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="propose"
- path="/plugin/web-query-propose-spellcheck/propose.jsp"
- controllerClass="org.apache.nutch.webapp.controller.SpellCheckController"
- />
-</tiles-definitions>
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/NGramSpeller.java b/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/NGramSpeller.java
deleted file mode 100644
index 26e26a782..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/NGramSpeller.java
+++ /dev/null
@@ -1,907 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.spell;
-
-import org.apache.lucene.analysis.*;
-import org.apache.lucene.document.*;
-import org.apache.lucene.index.*;
-import org.apache.lucene.search.*;
-import org.apache.lucene.store.*;
-
-import java.io.*;
-
-import java.text.*;
-
-import java.util.*;
-
-/**
- * Do spelling correction based on ngram frequency of terms in an index.
- *
- * Developed based on <a
- * href="http://marc.theaimsgroup.com/?l=lucene-user&m=109474652805339&w=2">this
- * message</a> in the lucene-user list.
- *
- * <p>
- * There are two parts to this algorithm. First a ngram lookup table is formed
- * for all terms in an index. Then suggested spelling corrections can be done
- * based on this table.
- * <p>
- * The "lookup table" is actually another Lucene index. It is built by going
- * through all terms in your original index and storing the term in a Document
- * with all ngrams that make it up. Ngrams of length 3 and 4 are suggested.
- * <p>
- *
- * In addition the prefix and suffix ngrams are stored in case you want to use a
- * heuristic that people usually know the first few characters of a word.
- *
- * <p>
- * The entry's boost is set by default to log(word_freq)/log(num_docs).
- *
- * <p>
- *
- * For a word like "kings" a {@link Document} with the following fields is made
- * in the ngram index:
- *
- * <pre>
- * word:kings
- * gram3:kin
- * gram3:ing
- * gram3:ngs
- * gram4:king
- * gram4:ings
- * start3:kin
- * start4:king
- * end3:ngs
- * end4:ings
- *
- * boost: log(freq('kings'))/log(num_docs).
- * </pre>
- *
- *
- * When a lookup is done a query is formed with all ngrams in the misspelled
- * word.
- *
- * <p>
- * For a word like <code>"kingz"</code> a query is formed like this.
- *
- * Query: <br>
- * <code>
- * gram3:kin gram3:ing gram3:ngz start3:kin^B1 end3:ngz^B2 start4:king^B1 end4:ingz^B2
- * </code>
- * <br>
- *
- * Above B1 and B2 are the prefix and suffix boosts. The prefix boost should
- * probably be &gt;= 2.0 and the suffix boost should probably be just a little
- * above 1.
- *
- * <p>
- * <b>To build</b> the ngram index based on the "contents" field in an existing
- * index 'orig_index' you run the main() driver like this:<br>
- * <code>
- * java org.apache.lucene.spell.NGramSpeller -f contents -i orig_index -o ngram_index
- * </code>
- *
- * <p>
- * Once you build an index you can <b>perform spelling corrections using</b>
- * {@link #suggestUsingNGrams suggestUsingNGrams(...)}.
- *
- *
- * <p>
- *
- * To play around with the code against an index approx 100k javadoc-generated
- * web pages circa Sept/2004 go here: <a
- * href='http://www.searchmorph.com/kat/spell.jsp'>http://www.searchmorph.com/kat/spell.jsp</a>.
- *
- * <p>
- * Of interest might be the <a
- * href="http://secondstring.sourceforge.net/">secondstring</a> string matching
- * package and <a
- * href="http://specialist.nlm.nih.gov/nls/gspell/doc/apiDoc/overview-summary.html">gspell</a>.
- *
- * @author <a href="mailto:dave&#64;tropo.com?subject=NGramSpeller">David
- * Spencer</a>
- *
- * Slightly modified from original version for use in Nutch project.
- *
- */
-public final class NGramSpeller {
- /**
- * Field name for each word in the ngram index.
- */
- public static final String F_WORD = "word";
-
- /**
- * Frequency, for the popularity cutoff option which says to only return
- * suggestions that occur more frequently than the misspelled word.
- */
- public static final String F_FREQ = "freq";
-
- /**
- * Store transpositions too.
- */
- public static final String F_TRANSPOSITION = "transposition";
-
- /**
- *
- */
- private static final PrintStream o = System.out;
-
- /**
- *
- */
- private static final NumberFormat nf = NumberFormat.getInstance();
-
- public static Query lastQuery;
-
- /**
- *
- */
- private NGramSpeller() {
- }
-
- /**
- * Main driver, used to build an index. You probably want invoke like this:
- * <br>
- * <code>
- * java org.apache.lucene.spell.NGramSpeller -f contents -i orig_index -o ngram_index
- * </code>
- */
- public static void main(String[] args) throws Throwable {
- int minThreshold = 5;
- int ng1 = 3;
- int ng2 = 4;
- int maxr = 10;
- int maxd = 5;
- String out = "gram_index";
- String gi = "gram_index";
-
- String name = null;
- String field = "contents";
-
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("-i")) {
- name = args[++i];
- } else if (args[i].equals("-minThreshold")) {
- minThreshold = Integer.parseInt(args[++i]);
- } else if (args[i].equals("-gi")) {
- gi = args[++i];
- } else if (args[i].equals("-o")) {
- out = args[++i];
- } else if (args[i].equals("-t")) { // test transpositions
-
- String s = args[++i];
- o.println("TRANS: " + s);
-
- String[] ar = formTranspositions(s);
-
- for (int j = 0; j < ar.length; j++)
- o.println("\t" + ar[j]);
-
- System.exit(0);
- } else if (args[i].equals("-ng1")) {
- ng1 = Integer.parseInt(args[++i]);
- } else if (args[i].equals("-ng2")) {
- ng2 = Integer.parseInt(args[++i]);
- } else if (args[i].equals("-help") || args[i].equals("--help")
- || args[i].equals("-h")) {
- o.println("To form an ngram index:");
- o
- .println("NGramSpeller -i ORIG_INDEX -o NGRAM_INDEX [-ng1 MIN] [-ng2 MAX] [-f FIELD]");
- o.println("Defaults are ng1=3, ng2=4, field='contents'");
- System.exit(100);
- } else if (args[i].equals("-q")) {
- String goal = args[++i];
- o.println("[NGrams] for " + goal + " from " + gi);
-
- float bStart = 2.0f;
- float bEnd = 1.0f;
- float bTransposition = 0f;
-
- o.println("bStart: " + bStart);
- o.println("bEnd: " + bEnd);
- o.println("bTrans: " + bTransposition);
- o.println("ng1: " + ng1);
- o.println("ng2: " + ng2);
-
- IndexReader ir = IndexReader.open(gi);
- IndexSearcher searcher = new IndexSearcher(gi);
- List lis = new ArrayList(maxr);
- String[] res = suggestUsingNGrams(searcher, goal, ng1, ng2, maxr,
- bStart, bEnd, bTransposition, maxd, lis, true); // more popular
- o.println("Returned " + res.length + " from " + gi + " which has "
- + ir.numDocs() + " words in it");
-
- Iterator it = lis.iterator();
-
- while (it.hasNext()) {
- o.println(it.next().toString());
- }
-
- o.println();
- o.println("query: " + lastQuery.toString("contents"));
-
- Hits ghits = searcher.search(new TermQuery(
- new Term(F_WORD, "recursive")));
-
- if (ghits.length() >= 1) // umm, should only be 0 or 1
- {
- Document doc = ghits.doc(0);
- o.println("TEST DOC: " + doc);
- }
-
- searcher.close();
- ir.close();
-
- return;
- } else if (args[i].equals("-f")) {
- field = args[++i];
- } else {
- o.println("hmm? " + args[i]);
- System.exit(1);
- }
- }
-
- if (name == null) {
- o.println("opps, you need to specify the input index w/ -i");
- System.exit(1);
- }
-
- o.println("Opening " + name);
- IndexReader.unlock(FSDirectory.getDirectory(name, false));
-
- final IndexReader r = IndexReader.open(name);
-
- o.println("Docs: " + nf.format(r.numDocs()));
- o.println("Using field: " + field);
-
- IndexWriter writer = new IndexWriter(out, new WhitespaceAnalyzer(), true);
- writer.setMergeFactor(writer.getMergeFactor()*50);
- writer.setMaxBufferedDocs(writer.getMaxBufferedDocs()*50);
-
- o.println("Forming index from " + name + " to " + out);
-
- int res = formNGramIndex(r, writer, ng1, ng2, field, minThreshold);
-
- o.println("done, did " + res + " ngrams");
- writer.optimize();
- writer.close();
- r.close();
- }
-
- /**
- * Using an NGram algorithm try to find alternate spellings for a "goal" word
- * based on the ngrams in it.
- *
- * @param searcher
- * the searcher for the "ngram" index
- *
- * @param goal
- * the word you want a spell check done on
- *
- * @param ng1
- * the min ngram length to use, probably 3 and it defaults to 3 if
- * you pass in a value &lt;= 0
- *
- * @param ng2
- * the max ngram length to use, probably 3 or 4
- *
- * @param maxr
- * max results to return, probably a small number like 5 for normal
- * use or 10-100 for testing
- *
- * @param bStart
- * how to boost matches that start the same way as the goal word,
- * probably greater than 2
- *
- * @param bEnd
- * how to boost matches that end the same way as the goal word,
- * probably greater than or equal to 1
- *
- * @param bTransposition
- * how to boost matches that are also simple transpositions, or 0 to
- * disable
- *
- * @param maxd
- * filter for the max Levenshtein string distance for matches,
- * probably a number like 3, 4, or 5, or use 0 for it to be ignored.
- * This prevents words radically longer but similar to the goal word
- * from being returned.
- *
- * @param details
- * if non null is a list with one entry per match. Each entry is an
- * array of ([String] word, [Double] score, [Integer] Levenshtein
- * string distance, [Integer] word freq).
- *
- * @param morePopular
- * if true says to only return suggestions more popular than the
- * misspelled word. This prevents rare words from being suggested.
- * Note that for words that don't appear in the index at all this has
- * no effect as those words will have a frequency of 0 anyway.
- *
- * @return the strings suggested with the best one first
- */
- public static String[] suggestUsingNGrams(Searcher searcher, String goal,
- int ng1, int ng2, int maxr, float bStart, float bEnd,
- float bTransposition, int maxd, List details, boolean morePopular)
- throws Throwable {
- List res = new ArrayList(maxr);
- BooleanQuery query = new BooleanQuery();
-
- if (ng1 <= 0) {
- ng1 = 3; // guess
- }
-
- if (ng2 < ng1) {
- ng2 = ng1;
- }
-
- if (bStart < 0) {
- bStart = 0;
- }
-
- if (bEnd < 0) {
- bEnd = 0;
- }
-
- if (bTransposition < 0) {
- bTransposition = 0;
- }
-
- // calculate table of all ngrams for goal word
- String[][] gramt = new String[ng2 + 1][];
-
- for (int ng = ng1; ng <= ng2; ng++)
- gramt[ng] = formGrams(goal, ng);
-
- int goalFreq = 0;
-
- if (morePopular) {
- Hits ghits = searcher.search(new TermQuery(new Term(F_WORD, goal)));
-
- if (ghits.length() >= 1) // umm, should only be 0 or 1
- {
- Document doc = ghits.doc(0);
- goalFreq = Integer.parseInt(doc.get(F_FREQ));
- }
- }
-
- if (bTransposition > 0) {
- add(query, F_TRANSPOSITION, goal, bTransposition);
- }
-
- TRStringDistance sd = new TRStringDistance(goal);
-
- for (int ng = ng1; ng <= ng2; ng++) // for every ngram in range
- {
- String[] grams = gramt[ng]; // form word into ngrams (allow dups too)
-
- if (grams.length == 0) {
- continue; // hmm
- }
-
- String key = "gram" + ng; // form key
-
- if (bStart > 0) { // should we boost prefixes?
- add(query, "start" + ng, grams[0], bStart); // matches start of word
- }
-
- if (bEnd > 0) { // should we boost suffixes
- add(query, "end" + ng, grams[grams.length - 1], bEnd); // matches end
- // of word
- }
-
- // match ngrams anywhere, w/o a boost
- for (int i = 0; i < grams.length; i++) {
- add(query, key, grams[i]);
- }
- }
-
- Hits hits = searcher.search(query);
- int len = hits.length();
- int remain = maxr;
- int stop = Math.min(len, 100 * maxr); // go thru more than 'maxr' matches in
- // case the distance filter triggers
-
- for (int i = 0; (i < stop) && (remain > 0); i++) {
- Document d = hits.doc(i);
- String word = d.get(F_WORD); // get orig word
-
- if (word.equals(goal)) {
- continue; // don't suggest a word for itself, that would be silly
- }
-
- int dist = sd.getDistance(word); // use distance filter
-
- if ((maxd > 0) && (dist > maxd)) {
- continue;
- }
-
- int suggestionFreq = Integer.parseInt(d.get(F_FREQ));
-
- if (morePopular && (goalFreq > suggestionFreq)) {
- continue; // don't suggest a rarer word
- }
-
- remain--;
- res.add(word);
-
- if (details != null) // only non-null for testing probably
- {
- int[] matches = new int[ng2 + 1];
-
- for (int ng = ng1; ng <= ng2; ng++) {
- String[] have = formGrams(word, ng);
- int match = 0;
- String[] cur = gramt[ng];
-
- for (int k = 0; k < have.length; k++) {
- boolean looking = true;
-
- for (int j = 0; (j < cur.length) && looking; j++) {
- if (have[k].equals(cur[j])) {
- // o.println( "\t\tmatch: " + have[ k] + " on " + word);
- match++;
- looking = false;
- }
- }
-
- /*
- * if ( looking) o.println( "\t\tNO MATCH: " + have[ k] + " on " +
- * word);
- */
- }
-
- matches[ng] = match;
- }
-
- details.add(new SpellSuggestionDetails(word, hits.score(i), dist,
- suggestionFreq, matches, ng1));
- }
- }
-
- lastQuery = query; // hack for now
-
- return (String[]) res.toArray(new String[0]);
- }
-
- /**
- * Go thru all terms and form an index of the "ngrams" of length 'ng1' to
- * 'ng2' in each term. The ngrams have field names like "gram3" for a 3 char
- * ngram, and "gram4" for a 4 char one. The starting and ending (or prefix and
- * suffix) "n" characters are also stored for each word with field names
- * "start3" and "end3".
- *
- *
- * @param r
- * the index to read terms from
- *
- * @param w
- * the writer to write the ngrams to, or if null an index named
- * "gram_index" will be created. If you pass in non-null then you
- * should optimize and close the index.
- *
- * @param ng1
- * the min number of chars to form ngrams with (3 is suggested)
- *
- * @param ng2
- * the max number of chars to form ngrams with, can be equal to ng1
- *
- * @param fields
- * the field name to process ngrams from.
- *
- * @param minThreshold
- * terms must appear in at least this many docs else they're ignored
- * as the assumption is that they're so rare (...)
- *
- * @return the number of ngrams added
- *
- */
- private static int formNGramIndex(IndexReader r, IndexWriter _w, int ng1,
- int ng2, String field, int minThreshold) throws IOException {
- int mins = 0;
- float nudge = 0.01f; // don't allow boosts to be too small
- IndexWriter w;
-
- if (_w == null) {
- w = new IndexWriter("gram_index", new WhitespaceAnalyzer(), // should have
- // no effect
- true);
- } else {
- w = _w;
- }
-
- int mod = 1000; // for status
- int nd = r.numDocs();
- final float base = (float) Math.log(1.0d / ((double) nd));
-
- if (field == null) {
- field = "contents"; // def field
- }
-
- field = field.intern(); // is it doced that you can use == on fields?
-
- int grams = 0; // # of ngrams added
- final TermEnum te = r.terms(new Term(field, ""));
- int n = 0;
- int skips = 0;
-
- while (te.next()) {
- boolean show = false; // for debugging
- Term t = te.term();
- String have = t.field();
-
- if ((have != field) && !have.equals(field)) // wrong field
- {
- break;
- }
-
- if (t.text().indexOf("-") >= 0) {
- continue;
- }
-
- int df = te.docFreq();
-
- if ((++n % mod) == 0) {
- show = true;
- o.println("term: " + t + " n=" + nf.format(n) + " grams="
- + nf.format(grams) + " mins=" + nf.format(mins) + " skip="
- + nf.format(skips) + " docFreq=" + df);
- }
-
- if (df < minThreshold) // not freq enough, too rare to consider
- {
- mins++;
-
- continue;
- }
-
- String text = t.text();
- int len = text.length();
-
- if (len < ng1) {
- continue; // too short we bail but "too long" is fine...
- }
-
- // but note that long tokens that are rare prob won't get here anyway as
- // they won't
- // pass the 'minThreshold' check above
- Document doc = new Document();
- doc.add(new Field(F_WORD, text, Field.Store.YES, Field.Index.UN_TOKENIZED)); // orig term
- doc.add(new Field(F_FREQ, "" + df, Field.Store.YES, Field.Index.UN_TOKENIZED)); // for popularity cutoff optionx
-
- String[] trans = formTranspositions(text);
-
- for (int i = 0; i < trans.length; i++)
- doc.add(new Field(F_TRANSPOSITION, trans[i], Field.Store.YES, Field.Index.UN_TOKENIZED));
-
- // now loop thru all ngrams of lengths 'ng1' to 'ng2'
- for (int ng = ng1; ng <= ng2; ng++) {
- String key = "gram" + ng;
- String end = null;
-
- for (int i = 0; i < (len - ng + 1); i++) {
- String gram = text.substring(i, i + ng);
- doc.add(new Field(key, gram, Field.Store.YES, Field.Index.UN_TOKENIZED));
-
- if (i == 0) {
- doc.add(new Field("start" + ng, gram, Field.Store.YES, Field.Index.UN_TOKENIZED));
- }
-
- end = gram;
- grams++;
- }
-
- if (end != null) { // may not be present if len==ng1
- doc.add(new Field("end" + ng, end, Field.Store.YES, Field.Index.UN_TOKENIZED));
- }
- }
-
- float f1 = te.docFreq();
- float f2 = nd;
-
- float bo = (float) ((Math.log(f1) / Math.log(f2)) + nudge);
- doc.setBoost(bo);
-
- if (show) {
- o.println("f1=" + f1 + " nd=" + nd + " boost=" + bo + " base=" + base
- + " word=" + text);
- }
-
- w.addDocument(doc);
- }
-
- if (_w == null) // else you have to optimize/close
- {
- w.optimize();
- w.close();
- }
-
- return grams;
- }
-
- /**
- * Add a clause to a boolean query.
- */
- private static void add(BooleanQuery q, String k, String v, float boost) {
- Query tq = new TermQuery(new Term(k, v));
- tq.setBoost(boost);
- q.add(new BooleanClause(tq, BooleanClause.Occur.SHOULD));
- }
-
- /**
- *
- */
- public static String[] formTranspositions(String s) {
- int len = s.length();
- List res = new ArrayList(len - 1);
-
- for (int i = 0; i < (len - 1); i++) {
- char c1 = s.charAt(i);
- char c2 = s.charAt(i + 1);
-
- if (c1 == c2) {
- continue;
- }
-
- res.add(s.substring(0, i) + c2 + c1 + s.substring(i + 2));
- }
-
- return (String[]) res.toArray(new String[0]);
- }
-
- /**
- * Form all ngrams for a given word.
- *
- * @param text
- * the word to parse
- * @param ng
- * the ngram length e.g. 3
- * @return an array of all ngrams in the word and note that duplicates are not
- * removed
- */
- public static String[] formGrams(String text, int ng) {
- List res = new ArrayList(text.length() - ng + 1);
- int len = text.length();
-
- for (int i = 0; i < (len - ng + 1); i++) {
- res.add(text.substring(i, i + ng));
- }
-
- return (String[]) res.toArray(new String[0]);
- }
-
- /**
- * Add a clause to a boolean query.
- */
- private static void add(BooleanQuery q, String k, String v) {
- q.add(new BooleanClause(new TermQuery(new Term(k, v)), BooleanClause.Occur.SHOULD));
- }
-
- /**
- * Presumably this is implemented somewhere in the apache/jakarta/commons area
- * but I couldn't find it.
- *
- * @link http://www.merriampark.com/ld.htm
- *
- */
- private static class TRStringDistance {
- final char[] sa;
-
- final int n;
-
- final int[][][] cache = new int[30][][];
-
- /**
- * Optimized to run a bit faster than the static getDistance(). In one
- * benchmark times were 5.3sec using ctr vs 8.5sec w/ static method, thus
- * 37% faster.
- */
- private TRStringDistance(String target) {
- sa = target.toCharArray();
- n = sa.length;
- }
-
- // *****************************
- // Compute Levenshtein distance
- // *****************************
- public int getDistance(String other) {
- int[][] d; // matrix
- int cost; // cost
-
- // Step 1
- final char[] ta = other.toCharArray();
- final int m = ta.length;
-
- if (n == 0) {
- return m;
- }
-
- if (m == 0) {
- return n;
- }
-
- if (m >= cache.length) {
- d = form(n, m);
- } else if (cache[m] != null) {
- d = cache[m];
- } else {
- d = cache[m] = form(n, m);
- }
-
- // Step 3
- for (int i = 1; i <= n; i++) {
- final char s_i = sa[i - 1];
-
- // Step 4
- for (int j = 1; j <= m; j++) {
- final char t_j = ta[j - 1];
-
- // Step 5
- if (s_i == t_j) { // same
- cost = 0;
- } else { // not a match
- cost = 1;
- }
-
- // Step 6
- d[i][j] = min3(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1]
- + cost);
- }
- }
-
- // Step 7
- return d[n][m];
- }
-
- /**
- *
- */
- private static int[][] form(int n, int m) {
- int[][] d = new int[n + 1][m + 1];
-
- // Step 2
- for (int i = 0; i <= n; i++)
- d[i][0] = i;
-
- for (int j = 0; j <= m; j++)
- d[0][j] = j;
-
- return d;
- }
-
- // ****************************
- // Get minimum of three values
- // ****************************
- private static int min3(int a, int b, int c) {
- int mi;
-
- mi = a;
-
- if (b < mi) {
- mi = b;
- }
-
- if (c < mi) {
- mi = c;
- }
-
- return mi;
- }
-
- // *****************************
- // Compute Levenshtein distance
- // *****************************
- public static int getDistance(String s, String t) {
- return getDistance(s.toCharArray(), t.toCharArray());
- }
-
- // *****************************
- // Compute Levenshtein distance
- // *****************************
- public static int getDistance(final char[] sa, final char[] ta) {
- int[][] d; // matrix
- int i; // iterates through s
- int j; // iterates through t
- char s_i; // ith character of s
- char t_j; // jth character of t
- int cost; // cost
-
- // Step 1
- final int n = sa.length;
- final int m = ta.length;
-
- if (n == 0) {
- return m;
- }
-
- if (m == 0) {
- return n;
- }
-
- d = new int[n + 1][m + 1];
-
- // Step 2
- for (i = 0; i <= n; i++) {
- d[i][0] = i;
- }
-
- for (j = 0; j <= m; j++) {
- d[0][j] = j;
- }
-
- // Step 3
- for (i = 1; i <= n; i++) {
- s_i = sa[i - 1];
-
- // Step 4
- for (j = 1; j <= m; j++) {
- t_j = ta[j - 1];
-
- // Step 5
- if (s_i == t_j) {
- cost = 0;
- } else {
- cost = 1;
- }
-
- // Step 6
- d[i][j] = min3(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1]
- + cost);
- }
- }
-
- // Step 7
- return d[n][m];
- }
- }
-
- /* Added by Andy Liu for Nutch */
- public static class SpellSuggestionDetails {
- public String word;
-
- public double score;
-
- public int dist;
-
- public int docFreq;
-
- public int[] matches;
-
- public int ng1;
-
- public SpellSuggestionDetails(String word, double score, int dist,
- int docFreq, int[] matches, int ng1) {
- super();
- this.word = word;
- this.score = score;
- this.dist = dist;
- this.docFreq = docFreq;
- this.matches = matches;
- this.ng1 = ng1;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer("word=" + word + " score=" + score
- + " dist=" + dist + " freq=" + docFreq + "\n");
-
- for (int j = ng1; j < matches.length; j++)
- buf.append("\tmm[ " + j + " ] = " + matches[j]);
-
- return buf.toString();
- }
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerBean.java b/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerBean.java
deleted file mode 100644
index a147ef0c7..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerBean.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.spell;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.util.LogUtil;
-import org.apache.nutch.util.NutchConfiguration;
-
-/**
- * Parses queries and sends them to NGramSpeller for spell checking.
- *
- * @author Andy Liu &lt;[email protected]&gt
- */
-public class SpellCheckerBean {
- public static final Log LOG = LogFactory.getLog(SpellCheckerBean.class);
-
- IndexSearcher spellingSearcher;
-
- //
- // Configuration parameters used by NGramSpeller . Hardcoded for now.
- //
- final int minThreshold = 5;
-
- final int ng1 = 3;
-
- final int ng2 = 4;
-
- final int maxr = 10;
-
- final int maxd = 5;
-
- final float bStart = 2.0f;
-
- final float bEnd = 1.0f;
-
- final float bTransposition = 6.5f;
-
- // configuration variable names
- public static final String SPELLING_INDEX_LOCATION = "spell.index.dir";
-
- public static final String SPELLING_DOCFREQ_THRESHOLD = "spell.docfreq.threshold";
-
- public static final String SPELLING_DOCFREQ_THRESHOLD_FACTOR = "spell.docfreq.threshold.factor";
-
- String indexLocation;
-
- int threshold;
-
- int thresholdFactor;
-
- Configuration conf;
-
- public SpellCheckerBean(Configuration conf) {
- this.conf=conf;
- indexLocation = conf.get(SPELLING_INDEX_LOCATION, "./spelling");
- threshold = conf.getInt(SPELLING_DOCFREQ_THRESHOLD, 100);
- thresholdFactor = conf.getInt(SPELLING_DOCFREQ_THRESHOLD_FACTOR, 10);
- try {
- spellingSearcher = new IndexSearcher(indexLocation);
- } catch (IOException ioe) {
- LOG.info("error opening spell checking index");
- ioe.printStackTrace(LogUtil.getInfoStream(LOG));
- }
- }
-
- /** Cache in Configuration. */
- public static SpellCheckerBean get(Configuration conf) {
- SpellCheckerBean spellCheckerBean = (SpellCheckerBean) conf
- .getObject(SpellCheckerBean.class.getName());
-
- if (spellCheckerBean == null) {
- LOG.info("creating new spell checker bean");
- spellCheckerBean = new SpellCheckerBean(conf);
- conf.setObject(SpellCheckerBean.class.getName(), spellCheckerBean);
- }
- return spellCheckerBean;
- }
-
- public SpellCheckerTerms checkSpelling(Query query, String queryString) {
-
- return checkSpelling(query, queryString, threshold, thresholdFactor);
- }
-
- /**
- * Parses original query, retrieves suggestions from ngrams spelling index
- *
- * @param originalQuery
- * Query to be spell-checked
- * @param docFreqThreshold
- * Terms in query that have a docFreq lower than this threshold
- * qualify as "mispelled"
- * @param factorThreshold
- * The suggested term must have a docFreq at least factorThreshold
- * times more than the mispelled term. Set to 1 to disable.
- * @return terms with corrected spelling
- */
- public SpellCheckerTerms checkSpelling(Query query, String queryString,
- int docFreqThreshold, int factorThreshold) {
- SpellCheckerTerms spellCheckerTerms = null;
-
- try {
- spellCheckerTerms = parseOriginalQuery(query, queryString);
-
- for (int i = 0; i < spellCheckerTerms.size(); i++) {
- SpellCheckerTerm currentTerm = spellCheckerTerms.getSpellCheckerTerm(i);
- String originalTerm = currentTerm.getOriginalTerm();
-
- spellCheckerTerms.getSpellCheckerTerm(i).setOriginalDocFreq(
- getDocFreq(originalTerm));
-
- //
- // Spell checking is not effective for words under 4 letters long
- // Any words over 25 letters long isn't worth checking either.
- //
- if (originalTerm.length() < 4)
- continue;
-
- if (originalTerm.length() > 25)
- continue;
-
- List lis = new ArrayList(maxr);
-
- String[] suggestions = NGramSpeller.suggestUsingNGrams(spellingSearcher
- , originalTerm, ng1, ng2, maxr, bStart, bEnd,
- bTransposition, maxd, lis, true);
-
- if (suggestions.length > 0) {
- currentTerm.setSuggestedTerm(suggestions[0]);
-
- if (lis != null) {
- NGramSpeller.SpellSuggestionDetails detail = (NGramSpeller.SpellSuggestionDetails) lis
- .get(0);
- currentTerm.setSuggestedTermDocFreq(detail.docFreq);
- }
-
- // We use document frequencies of the original term and the suggested
- // term to guess
- // whether or not a term is mispelled. The criteria is as follows:
- //
- // 1. The term's document frequency must be under a constant threshold
- // 2. The suggested term's docFreq must be greater than the original
- // term's docFreq * constant factor
- //
- if ((currentTerm.originalDocFreq < docFreqThreshold)
- && ((currentTerm.originalDocFreq * factorThreshold) < (currentTerm.suggestedTermDocFreq))) {
- spellCheckerTerms.setHasMispelledTerms(true);
- currentTerm.setMispelled(true);
- }
- }
-
- }
-
- } catch (Throwable t) {
- t.printStackTrace();
- }
-
- return spellCheckerTerms;
- }
-
- /**
- *
- * Parses the query and preserves characters and formatting surrounding terms
- * to be spell-checked. This is done so that we can present the query in the
- * "Did you mean: XYZ" message in the same format the user originally typed
- * it.
- *
- * @param originalQuery
- * text to be parsed
- * @return spell checker terms
- */
- public SpellCheckerTerms parseOriginalQuery(Query query, String queryString)
- throws IOException {
- String[] terms = query.getTerms();
- SpellCheckerTerms spellCheckerTerms = new SpellCheckerTerms();
-
- int previousTermPos = 0;
- for (int i = 0; i < terms.length; i++) {
-
- int termPos = queryString.toLowerCase().indexOf(terms[i]);
-
- String charsBefore = "";
- String charsAfter = "";
-
- // Is this the first term? If so, we need to check for characters
- // before the first term.
- if (i == 0) {
-
- if (termPos > 0) {
- charsBefore = queryString.substring(0, termPos);
- }
-
- // We're in-between terms...
- } else {
- int endOfLastTerm = previousTermPos + terms[i - 1].length();
-
- if (endOfLastTerm < termPos) {
- charsBefore = queryString.substring(endOfLastTerm, termPos);
- }
- }
-
- // Is this the last term? If so, we need to check for characters
- // after the last term.
- if (i == (terms.length - 1)) {
-
- int endOfCurrentTerm = termPos + terms[i].length();
-
- if (endOfCurrentTerm < queryString.length()) {
- charsAfter = queryString.substring(endOfCurrentTerm, queryString
- .length());
- }
-
- }
-
- previousTermPos = termPos;
-
- spellCheckerTerms.add(new SpellCheckerTerm(terms[i], charsBefore,
- charsAfter));
-
- }
-
- return spellCheckerTerms;
-
- }
-
- public SpellCheckerTerms parseOriginalQuery(String queryString)
- throws IOException {
- return parseOriginalQuery(Query.parse(queryString, conf), queryString);
- }
-
- /**
- * Retrieves docFreq as stored within spelling index. Alternatively, we could
- * simply consult the main index for a docFreq() of a term (which would be
- * faster) but it's nice to have a separate, spelling index that can stand on
- * its own.
- *
- * @param term
- * @return document frequency of term
- */
- private int getDocFreq(String term) throws IOException {
- /*
- * Hits hits = this.spellingSearcher.getLuceneSearcher().search(new
- * TermQuery(new Term( NGramSpeller.F_WORD, term))); if (hits.length() > 0) {
- * Document doc = hits.doc(0); String docFreq =
- * doc.get(NGramSpeller.F_FREQ); return Integer.parseInt(docFreq); }
- */
- return 0;
- }
-
- public static void main(String[] args) throws Throwable {
- if (args.length < 1) {
- System.out.println("usage: SpellCheckerBean [ngrams spelling index]");
- return;
- }
-
- Configuration conf = NutchConfiguration.create();
-
- conf.set("spell.index.dir", args[0]);
-
- SpellCheckerBean checker = new SpellCheckerBean(conf);
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
-
- String line;
-
- while ((line = in.readLine()) != null) {
- Query query = Query.parse(line, conf);
- SpellCheckerTerms terms = checker.checkSpelling(query, line);
- StringBuffer buf = new StringBuffer();
-
- for (int i = 0; i < terms.size(); i++) {
- SpellCheckerTerm currentTerm = terms.getSpellCheckerTerm(i);
- buf.append(currentTerm.getCharsBefore());
-
- if (currentTerm.isMispelled()) {
- buf.append(currentTerm.getSuggestedTerm());
- } else {
- buf.append(currentTerm.getOriginalTerm());
- }
- }
-
- System.out.println("Spell checked: " + buf);
- }
- }
-
- public void init() {
- //do initialization here
- }
-
- public String[] suggest(Query query) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getID() {
- return "SPELLER";
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerm.java b/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerm.java
deleted file mode 100644
index e9ef31bc5..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerm.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.spell;
-
-public class SpellCheckerTerm {
- String originalTerm = null;
-
- String charsBefore = null;
-
- String charsAfter = null;
-
- String suggestedTerm = null;
-
- int originalDocFreq = -1;
-
- int suggestedTermDocFreq = -1;
-
- boolean isMispelled = false;
-
- public SpellCheckerTerm(String originalTerm, String charsBefore,
- String charsAfter) {
- super();
- this.originalTerm = originalTerm;
- this.charsBefore = charsBefore;
- this.charsAfter = charsAfter;
- }
-
- public String getCharsAfter() {
- return charsAfter;
- }
-
- public void setCharsAfter(String charsAfter) {
- this.charsAfter = charsAfter;
- }
-
- public String getCharsBefore() {
- return charsBefore;
- }
-
- public void setCharsBefore(String charsBefore) {
- this.charsBefore = charsBefore;
- }
-
- public int getOriginalDocFreq() {
- return originalDocFreq;
- }
-
- public void setOriginalDocFreq(int originalDocFreq) {
- this.originalDocFreq = originalDocFreq;
- }
-
- public String getOriginalTerm() {
- return originalTerm;
- }
-
- public void setOriginalTerm(String originalTerm) {
- this.originalTerm = originalTerm;
- }
-
- public int getSuggestedTermDocFreq() {
- return suggestedTermDocFreq;
- }
-
- public void setSuggestedTermDocFreq(int suggestedTermDocFreq) {
- this.suggestedTermDocFreq = suggestedTermDocFreq;
- }
-
- public String getSuggestedTerm() {
- return suggestedTerm;
- }
-
- public void setSuggestedTerm(String suggestedTerm) {
- this.suggestedTerm = suggestedTerm;
- }
-
- public boolean isMispelled() {
- return isMispelled;
- }
-
- public void setMispelled(boolean isMispelled) {
- this.isMispelled = isMispelled;
- }
-
- public String toString() {
- return "[" + originalTerm + ", " + charsBefore + ", " + charsAfter + ", "
- + suggestedTerm + ", " + originalDocFreq + ", " + suggestedTermDocFreq
- + ", " + isMispelled + "]";
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerms.java b/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerms.java
deleted file mode 100644
index 8553cb2a9..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/spell/SpellCheckerTerms.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.spell;
-
-import java.util.ArrayList;
-
-public class SpellCheckerTerms {
- boolean hasMispelledTerms = false;
- ArrayList terms=new ArrayList();
-
- public SpellCheckerTerm getSpellCheckerTerm(int i) {
- return (SpellCheckerTerm) terms.get(i);
- }
-
- public ArrayList getTerms(){
- return terms;
- }
-
- public String getSpellCheckedQuery() {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < terms.size(); i++) {
- SpellCheckerTerm term = getSpellCheckerTerm(i);
- buf.append(term.charsBefore);
- if (term.isMispelled)
- buf.append(term.suggestedTerm);
- else
- buf.append(term.originalTerm);
- buf.append(term.charsAfter);
- }
- return buf.toString();
- }
-
- public boolean getHasMispelledTerms() {
- return hasMispelledTerms;
- }
-
- public void setHasMispelledTerms(boolean hasMispelledTerms) {
- this.hasMispelledTerms = hasMispelledTerms;
- }
-
- public Object get(int index) {
- return terms.get(index);
- }
-
- public int size() {
- return terms.size();
- }
-
- public boolean add(Object arg0) {
- return terms.add(arg0);
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/webapp/controller/SpellCheckController.java b/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/webapp/controller/SpellCheckController.java
deleted file mode 100644
index e97f85a9d..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/java/org/apache/nutch/webapp/controller/SpellCheckController.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.spell.SpellCheckerBean;
-import org.apache.nutch.spell.SpellCheckerTerms;
-import org.apache.nutch.webapp.common.SearchForm;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.nutch.webapp.controller.NutchController;
-import org.apache.struts.tiles.ComponentContext;
-
-public class SpellCheckController extends NutchController implements Startable {
-
- SpellCheckerBean spellCheckerBean=null;
-
- public static final String ATTR_SPELL_TERMS="spellCheckerTerms";
- public static final String ATTR_SPELL_QUERY="spellCheckerQuery";
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
- ServiceLocator serviceLocator=getServiceLocator(request);
-
- SpellCheckerTerms spellCheckerTerms = null;
- if (spellCheckerBean != null) {
- spellCheckerTerms = spellCheckerBean.checkSpelling(serviceLocator.getSearch().getQuery(), serviceLocator.getSearch().getQueryString());
- }
-
- SearchForm form=(SearchForm)serviceLocator.getSearchForm().clone();
- form.setValue(SearchForm.NAME_QUERYSTRING,spellCheckerTerms.getSpellCheckedQuery());
- String spellQuery = form.getParameterString("utf-8");
-
- request.setAttribute(ATTR_SPELL_TERMS, spellCheckerTerms);
- request.setAttribute(ATTR_SPELL_QUERY, spellQuery);
- }
-
- public void start(ServletContext servletContext) {
- Configuration conf=getServiceLocator(servletContext).getConfiguration();
- LOG.info("Initializing spellchecker");
- spellCheckerBean = SpellCheckerBean.get(conf);
- }
-}
diff --git a/contrib/web2/plugins/web-query-propose-spellcheck/src/web/web-query-propose-spellcheck/propose.jsp b/contrib/web2/plugins/web-query-propose-spellcheck/src/web/web-query-propose-spellcheck/propose.jsp
deleted file mode 100644
index 73b58757e..000000000
--- a/contrib/web2/plugins/web-query-propose-spellcheck/src/web/web-query-propose-spellcheck/propose.jsp
+++ /dev/null
@@ -1,36 +0,0 @@
-<%--
- 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.
---%>
-<%@ page session="false"%>
-<%@ taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
-<c:if test="${spellCheckerTerms!=null && spellCheckerTerms.hasMispelledTerms}">
- <p>Did you mean <a href="search.do?<c:out value="${spellCheckerQuery}"/>">
- <c:forEach
- var="currentTerm" items="${spellCheckerTerms.terms}">
- <c:out value="${currentItem.charsBefore}" />
- <c:choose>
- <c:when test="${currentTerm.mispelled}">
- <i><b> <c:out value="${currentTerm.suggestedTerm}" /> </b></i>
- </c:when>
- <c:otherwise>
- <c:out value="${currentTerm.originalTerm}" />
- </c:otherwise>
- </c:choose>
- <c:out value="${currentItem.charsAfter}" />
- </c:forEach> </a></p>
-</c:if>
diff --git a/contrib/web2/plugins/web-resources/build.xml b/contrib/web2/plugins/web-resources/build.xml
deleted file mode 100644
index 1f73eeca6..000000000
--- a/contrib/web2/plugins/web-resources/build.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-resources" default="jar-core">
-
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
-
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-
-
-</project>
diff --git a/contrib/web2/plugins/web-resources/plugin.xml b/contrib/web2/plugins/web-resources/plugin.xml
deleted file mode 100644
index ade2d26a6..000000000
--- a/contrib/web2/plugins/web-resources/plugin.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.
--->
-<plugin id="web-resources" name="Resources plugin" version="1.0.0"
- provider-name="apache.org">
-
- <runtime>
- <library name="web-resources.jar">
- <export name="*" />
- </library>
- </runtime>
-
- <requires>
- <import plugin="webui-extensionpoints" />
- </requires>
-
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-resources"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
-
-</plugin>
diff --git a/contrib/web2/plugins/web-resources/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-resources/src/conf/tiles-defs.xml
deleted file mode 100644
index 9a2abe945..000000000
--- a/contrib/web2/plugins/web-resources/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "dtd/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="footer" path="/plugin/footer.jsp"/>
-</tiles-definitions>
\ No newline at end of file
diff --git a/contrib/web2/plugins/web-resources/src/resources/image.gif b/contrib/web2/plugins/web-resources/src/resources/image.gif
deleted file mode 100644
index 84dd68cda..000000000
Binary files a/contrib/web2/plugins/web-resources/src/resources/image.gif and /dev/null differ
diff --git a/contrib/web2/plugins/web-resources/src/web/footer.jsp b/contrib/web2/plugins/web-resources/src/web/footer.jsp
deleted file mode 100644
index d106a5ad4..000000000
--- a/contrib/web2/plugins/web-resources/src/web/footer.jsp
+++ /dev/null
@@ -1,30 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="/WEB-INF/jsp/common.jsp"%>
-<table bgcolor="3333ff" align="right">
- <tr>
- <td bgcolor="ff9900">
- <hr />
- This footer is from resources plugin
- <hr />
- <a href="opensearch?query=pelepele" /><font color="ffffff"><b>RSS</b>
- </font></a></td>
- </tr>
-</table>
-<a href="http://wiki.apache.org/nutch/FAQ"> <img border="0"
- src="resources/web-resources/image.gif"> </a>
-</div>
diff --git a/contrib/web2/plugins/web-subcollection/build.xml b/contrib/web2/plugins/web-subcollection/build.xml
deleted file mode 100644
index 7b0a6ceb6..000000000
--- a/contrib/web2/plugins/web-subcollection/build.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="web-subcollection" default="jar-core">
-
- <import file="../build-plugin.xml" />
- <property name="nutch.root" location="${root}/../../../../" />
-
- <!-- Add compilation dependencies to classpath -->
- <path id="plugin.deps">
- <fileset dir="${nutch.root}/build">
- <include name="**/subcollection/*.jar" />
- </fileset>
- </path>
-
- <target name="init-plugin">
- <echo>Copying resources templates</echo>
- <copy todir="${build.classes}/resources">
- <fileset dir="${resources.dir}" includes="**/*" />
- </copy>
- <echo>Copying UI configuration</echo>
- <copy todir="${build.classes}">
- <fileset dir="src/conf" includes="**/*" />
- </copy>
- <echo>Copying UI templates</echo>
- <copy todir="${deploy.dir}/web">
- <fileset dir="src/web" includes="**/*" />
- </copy>
- </target>
-
-</project>
diff --git a/contrib/web2/plugins/web-subcollection/plugin.xml b/contrib/web2/plugins/web-subcollection/plugin.xml
deleted file mode 100644
index 9a1339105..000000000
--- a/contrib/web2/plugins/web-subcollection/plugin.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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.
--->
-<plugin id="web-subcollection" name="subcollection ui enhancements"
- version="1.0.0" provider-name="apache.org">
- <runtime>
- <library name="web-subcollection.jar">
- <export name="*" />
- </library>
- </runtime>
- <requires>
- <import plugin="webui-extensionpoints" />
- <import plugin="subcollection" />
- </requires>
- <extension id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch ui extension point"
- point="org.apache.nutch.webapp.extension.UIExtensionPoint">
- <implementation id="web-subcollection"
- class="org.apache.nutch.webapp.extension.UIExtension.VoidImplementation" />
- </extension>
- <extension
- id="org.apache.nutch.webapp.extension.PreSearchExtensionPoint"
- name="Clustering extension for Web UI"
- point="org.apache.nutch.webapp.extension.PreSearchExtensionPoint">
- <implementation id="web-subcollection-presearch"
- class="org.apache.nutch.webapp.subcollection.SubcollectionPreSearchExtension" />
- </extension>
-</plugin>
diff --git a/contrib/web2/plugins/web-subcollection/src/conf/tiles-defs.xml b/contrib/web2/plugins/web-subcollection/src/conf/tiles-defs.xml
deleted file mode 100644
index 9414d92fe..000000000
--- a/contrib/web2/plugins/web-subcollection/src/conf/tiles-defs.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
-<tiles-definitions>
-<!--
-Tile to select subcollection
- -->
- <definition name="subcollection-select"
- path="/plugin/web-subcollection/select.jsp"
- controllerClass="org.apache.nutch.webapp.controller.SubcollectionSelectController">
- </definition>
-</tiles-definitions>
diff --git a/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/controller/SubcollectionSelectController.java b/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/controller/SubcollectionSelectController.java
deleted file mode 100644
index 2270e7d8c..000000000
--- a/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/controller/SubcollectionSelectController.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.collection.CollectionManager;
-import org.apache.nutch.collection.Subcollection;
-import org.apache.nutch.indexer.subcollection.SubcollectionIndexingFilter;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.nutch.webapp.controller.NutchController;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * This controller is responsible for providing Collection of
- * subcollections for displaying.
- */
-public class SubcollectionSelectController extends NutchController implements Startable {
-
- public class SubcollectionWrapper {
- Subcollection col;
- boolean checked;
-
- /**
- * UI Wrapper for subcollection
- * @param col Subcollection
- * @param checked is the subcollection "checked" / active
- */
- public SubcollectionWrapper(Subcollection col, boolean checked){
- this.col=col;
- this.checked=checked;
- }
-
- public String getId(){
- return col.getId();
- }
-
- public String getName(){
- return col.getName();
- }
-
- public boolean getChecked(){
- return checked;
- }
-}
-
- public static final String REQ_ATTR_SUBCOLLECTIONS="subcollections";
- public static final String REQ_ATTR_COLLECTION_SELECTED="iscollectionlimited";
-
- private CollectionManager collectionManager;
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- boolean hasSelectedCollection=false;
- ServiceLocator serviceLocator = getServiceLocator(request);
- Collection collections=collectionManager.getAll();
-
- ArrayList wrapped=new ArrayList();
- Iterator i=collections.iterator();
-
- String value=serviceLocator.getSearchForm().getValueString(SubcollectionIndexingFilter.FIELD_NAME);
-
- while(i.hasNext()){
- Subcollection collection=(Subcollection)i.next();
- boolean checked=(value!=null && value.equals(collection.getId()));
- wrapped.add(new SubcollectionWrapper(collection,checked));
- if(checked){
- hasSelectedCollection=true;
- }
- }
-
- request.setAttribute(REQ_ATTR_SUBCOLLECTIONS, wrapped);
- if(hasSelectedCollection){
- LOG.info("collection was selected");
- request.setAttribute(REQ_ATTR_COLLECTION_SELECTED,"1");
- }
- }
-
- public void start(ServletContext servletContext) {
- ServiceLocator serviceLocator=getServiceLocator(servletContext);
- collectionManager=CollectionManager.getCollectionManager(serviceLocator.getConfiguration());
- }
-
-}
diff --git a/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/subcollection/SubcollectionPreSearchExtension.java b/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/subcollection/SubcollectionPreSearchExtension.java
deleted file mode 100644
index 96f307bab..000000000
--- a/contrib/web2/plugins/web-subcollection/src/java/org/apache/nutch/webapp/subcollection/SubcollectionPreSearchExtension.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.subcollection;
-
-import org.apache.nutch.indexer.subcollection.SubcollectionIndexingFilter;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.extension.PreSearchExtensionPoint;
-
-/**
- * This class is responsible for limiting search to certain subcollection.
- * Subcollection to be searched is defined with queryparameter named
- * "subcollection".
- */
-public class SubcollectionPreSearchExtension implements PreSearchExtensionPoint {
-
- public void doPreSearch(ServiceLocator locator) {
- Query original=locator.getSearch().getQuery();
- Query modified=(Query)original.clone();
- try{
- String value=locator.getSearchForm().getValueString(SubcollectionIndexingFilter.FIELD_NAME);
- if(value!=null && value.trim().length()>0) {
- modified.addRequiredTerm(value, SubcollectionIndexingFilter.FIELD_NAME);
- }
- } catch (Exception e){
-
- }
- locator.getSearch().setQuery(modified);
- }
-
-}
diff --git a/contrib/web2/plugins/web-subcollection/src/web/web-subcollection/select.jsp b/contrib/web2/plugins/web-subcollection/src/web/web-subcollection/select.jsp
deleted file mode 100644
index 907db7199..000000000
--- a/contrib/web2/plugins/web-subcollection/src/web/web-subcollection/select.jsp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%--
- 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.
---%>
-<%@ page session="false"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
-<div id="subcollection-select"><fmt:message key="subcollection.info" />
-<c:forEach var="subcollection" items="${subcollections}">
-<c:choose>
-<c:when test="${subcollection.checked}">
-<input id="<c:out value="${subcollection.id}"/>"
-type="radio" name="subcollection" checked="checked"
- value="<c:out value="${subcollection.id}"/>" />
-</c:when>
-<c:otherwise>
-<input id="<c:out value="${subcollection.id}"/>"
-type="radio" name="subcollection"
- value="<c:out value="${subcollection.id}"/>" />
-</c:otherwise>
-</c:choose>
-<label id="<c:out value="${subcollection.id}"/>"><c:out value="${subcollection.name}" /></label>
-</c:forEach>
-<c:if test="${iscollectionlimited!=null}">
-<input id="none"
-type="radio" name="subcollection"
- value="" /><label id="none"><fmt:message key="subcollection.none" /></label>
-</c:if>
-</div>
diff --git a/contrib/web2/plugins/webui-extensionpoints/build.xml b/contrib/web2/plugins/webui-extensionpoints/build.xml
deleted file mode 100644
index 2a049dfc7..000000000
--- a/contrib/web2/plugins/webui-extensionpoints/build.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<project name="webui-extensionpoints" default="jar">
-
- <import file="../build-plugin.xml" />
-
- <!--
- ! Override the compile and jar targets,
- ! since there is nothing to compile here.
- ! -->
- <target name="compile" depends="init" />
-
- <!--target name="jar" depends="compile"/-->
-
-</project>
diff --git a/contrib/web2/plugins/webui-extensionpoints/plugin.xml b/contrib/web2/plugins/webui-extensionpoints/plugin.xml
deleted file mode 100644
index 2c7f585b2..000000000
--- a/contrib/web2/plugins/webui-extensionpoints/plugin.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?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.
--->
-<plugin id="webui-extensionpoints" name="Nutch web ui extension points"
- version="0.8.0" provider-name="apache.org">
-
- <extension-point
- id="org.apache.nutch.webapp.extension.UIExtensionPoint"
- name="Nutch web ui component" />
-
- <extension-point
- id="org.apache.nutch.webapp.extension.PreSearchExtensionPoint"
- name="PreSearch Extension Point" />
- <extension-point
- id="org.apache.nutch.webapp.extension.PostSearchExtensionPoint"
- name="PostSearch Extension Point" />
-
- <extension-point
- id="org.apache.nutch.webapp.extension.SearchExtensionPoint"
- name="Search Extension Point" />
-
-</plugin>
diff --git a/contrib/web2/res/nutch-header.xsl b/contrib/web2/res/nutch-header.xsl
deleted file mode 100644
index 049b330e9..000000000
--- a/contrib/web2/res/nutch-header.xsl
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<!-- XSLT stylesheet that generates localized versions of the page header. -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:template match="header-menu">
- <xsl:comment>This file is automatically generated. Do not edit!</xsl:comment>
- <table width="635" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td valign="bottom" width="140" rowspan="2">
- <a href="./"><img src="img/reiter/logo_nutch.gif" border="0"/></a>
- <img src="img/reiter/spacer_666666.gif" width="140" height="1"/>
- </td>
- </tr>
- <tr>
- <td width="495" valign="bottom" align="right">
- <table border="0" cellpadding="0" cellspacing="0" width="495">
- <tr>
- <td background="img/reiter/_bg_reiter.gif" width="400">
- <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
- </td>
-<!-- menu -->
- <xsl:for-each select="item">
- <td height="28" valign="bottom" width="10">
- <xsl:choose>
- <xsl:when test="position()=1">
- <img src="img/reiter/reiter_inactive_le1.gif" border="0"/>
- </xsl:when>
- <xsl:otherwise>
- <img src="img/reiter/reiter_inactive_le.gif" border="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td background="img/reiter/_bg_reiter_inactive.gif" valign="bottom" nowrap="nowrap">
- <xsl:variable name="url" select="a/@href"/>
- <a class="bodytext" href="{$url}">
- <xsl:value-of select="." disable-output-escaping="yes"/>
- </a>
- </td>
- <td height="28" valign="bottom" width="10">
- <img src="img/reiter/reiter_inactive_ri.gif" border="0"/>
- </td>
- </xsl:for-each>
-<!-- menue -->
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </xsl:template>
-</xsl:stylesheet>
diff --git a/contrib/web2/res/nutch-page.xsl b/contrib/web2/res/nutch-page.xsl
deleted file mode 100644
index 15dc5f0ae..000000000
--- a/contrib/web2/res/nutch-page.xsl
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0"?>
-<!--
- 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.
--->
-<!-- XSLT stylesheet that adds Nutch style, header, and footer
- elements. This is used by Ant to generate static html pages. -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
- <xsl:template match="page">
- <xsl:comment>This page is automatically generated. Do not edit!</xsl:comment>
- <table width="635" border="0" cellpadding="0" cellspacing="0">
- <tr valign="top">
- <td width="140">
- <xsl:call-template name="subnavi"/>
- </td>
- <td width="20" background="img/reiter/_spacer_cccccc.gif">
- <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
- </td>
- <td width="475" class="body">
- <xsl:call-template name="body"/>
- </td>
- </tr>
- </table>
- </xsl:template>
-<!-- included menu -->
- <xsl:template name="subnavi">
- <table width="100%" cellpadding="0" cellspacing="0">
- <xsl:for-each select="menu/item">
- <xsl:if test="not(.='')">
- <tr class="menuTd" height="25">
- <td class="menuTd" onmouseover="this.className='menuTdhover';" onmouseout="this.className='menuTd'" width="100%">
- <xsl:text disable-output-escaping="yes">&amp;#160;:: </xsl:text>
- <xsl:variable name="url" select="a/@href"/>
- <a href="{$url}" class="menuEntry">
- <xsl:value-of select="."/>
- </a>
- </td>
- </tr>
- <tr height="1px">
- <td>
- <img src="img/reiter/spacer_666666.gif" height="1" width="100%"/>
- </td>
- </tr>
- </xsl:if>
- </xsl:for-each>
- <tr>
- <td>
- <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
- </td>
- </tr>
- </table>
- </xsl:template>
-<!-- /included menu -->
-<!-- included body -->
- <xsl:template name="body">
- <table width="475" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="title" height="125" width="275" valign="bottom">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </td>
- <td height="125" width="200" valign="bottom">
- <img src="img/reiter/robots.gif"/>
- </td>
- </tr>
- </table>
- <br class="br"/>
- <xsl:for-each select="body/node()">
- <xsl:choose>
-<!-- orange intro -->
- <xsl:when test="name()='p' and position() &lt; 3">
- <span class="intro">
- <xsl:copy-of select="."/>
- </span>
- </xsl:when>
-<!-- all other text -->
- <xsl:otherwise>
- <span class="bodytext">
- <xsl:copy-of select="."/>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <br class="br"/>
- <br class="br"/>
- </xsl:template>
-<!-- /included body -->
-</xsl:stylesheet>
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/BaseSearch.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/BaseSearch.java
deleted file mode 100644
index 52ffba30a..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/BaseSearch.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.plugin.Extension;
-import org.apache.nutch.plugin.ExtensionPoint;
-import org.apache.nutch.webapp.extension.PostSearchExtensionPoint;
-import org.apache.nutch.webapp.extension.PreSearchExtensionPoint;
-import org.apache.nutch.webapp.extension.SearchExtensionPoint;
-
-public class BaseSearch {
-
- public static final Log LOG = LogFactory.getLog(BaseSearch.class);
-
- protected PreSearchExtensionPoint[] presearch;
-
- protected SearchExtensionPoint[] search;
-
- protected PostSearchExtensionPoint[] postsearch;
-
- protected Collection setup(String xPoint, Configuration conf) {
- LOG.info("setting up:" + xPoint);
-
- HashMap filters = new HashMap();
- try {
- ExtensionPoint point = serviceLocator.getPluginRepository()
- .getExtensionPoint(xPoint);
- if (point != null) {
- Extension[] extensions = point.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- Extension extension = extensions[i];
- Object extensionInstance = extension.getExtensionInstance();
- if (!filters.containsKey(extensionInstance.getClass().getName())) {
- filters.put(extensionInstance.getClass().getName(),
- extensionInstance);
- }
- }
- return filters.values();
- }
- } catch (Exception e) {
- LOG.info("Error setting up extensions :" + e);
- }
- return Collections.EMPTY_LIST;
-
- }
-
- private ServiceLocator serviceLocator;
-
- /**
- * Construct new BaseSearch object
- */
- public BaseSearch(ServiceLocator locator) {
- this.serviceLocator = locator;
- Collection pre = getPreSearchExtensions(serviceLocator.getConfiguration());
- presearch = new PreSearchExtensionPoint[pre.size()];
- pre.toArray(presearch);
-
- Collection searchC = getSearchExtensions(serviceLocator.getConfiguration());
- search = new SearchExtensionPoint[searchC.size()];
- searchC.toArray(search);
-
- Collection post = getPostSearchExtensions(serviceLocator.getConfiguration());
- postsearch = new PostSearchExtensionPoint[post.size()];
- post.toArray(postsearch);
- }
-
- public Collection getPreSearchExtensions(Configuration conf) {
- if (conf.getObject(PreSearchExtensionPoint.X_POINT_ID) == null) {
- conf.setObject(PreSearchExtensionPoint.X_POINT_ID, setup(
- PreSearchExtensionPoint.X_POINT_ID, conf));
- }
-
- return (Collection) conf.getObject(PreSearchExtensionPoint.X_POINT_ID);
- }
-
- public Collection getSearchExtensions(Configuration conf) {
- if (conf.getObject(SearchExtensionPoint.X_POINT_ID) == null) {
- conf.setObject(SearchExtensionPoint.X_POINT_ID, setup(
- SearchExtensionPoint.X_POINT_ID, conf));
- }
- return (Collection) conf.getObject(SearchExtensionPoint.X_POINT_ID);
- }
-
- public Collection getPostSearchExtensions(Configuration conf) {
- if (conf.getObject(PostSearchExtensionPoint.X_POINT_ID) == null) {
- conf.setObject(PostSearchExtensionPoint.X_POINT_ID, setup(
- PostSearchExtensionPoint.X_POINT_ID, conf));
- }
- return (Collection) conf.getObject(PostSearchExtensionPoint.X_POINT_ID);
- }
-
- /**
- * Call plugins participating PreSearch activities.
- */
- void callPreSearch(ServiceLocator locator) {
- LOG.info("presearch");
- for (int i = 0; i < presearch.length; i++) {
- presearch[i].doPreSearch(serviceLocator);
- }
- }
-
- /**
- * Call plugins participating Search activities.
- */
- void callSearch() {
- for (int i = 0; i < search.length; i++) {
- search[i].doSearch(serviceLocator);
- }
- }
-
- /**
- * Call plugins participating postSearch activities.
- */
- void callPostSearch(ServiceLocator locator) {
- LOG.info("postsearch");
- for (int i = 0; i < postsearch.length; i++) {
- postsearch[i].doPostSearch(serviceLocator);
- }
- }
-
- /**
- * Entry point to execute the search.
- */
- public void doSearch() {
- // create context
- callPreSearch(serviceLocator);
- serviceLocator.getSearch().performSearch();
- // callSearch();
- callPostSearch(serviceLocator);
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/NavigationHelper.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/NavigationHelper.java
deleted file mode 100644
index d9fde67b2..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/NavigationHelper.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-/**
- * Helper class to aid when forming search result navigation.
- */
-public class NavigationHelper {
-
- private int start;
-
- private int hitsPerPage;
-
- private long totalHits;
-
- private boolean totalIsExact;
-
- private int end;
-
- /**
- * Construct a new NavigationHelper
- * @param start start index
- * @param hitsPerPage
- * @param length total number of hits
- * @param totalIsExact total number of hits is exact (@see org.apache.nutch.searcher.Hits#setTotalIsExact(boolean))
- */
- public NavigationHelper(int start, int end, int hitsPerPage, long length,
- boolean totalIsExact) {
- this.start = start;
- this.end = end;
- this.hitsPerPage = hitsPerPage;
- this.totalHits = length;
- this.totalIsExact = totalIsExact;
- }
-
- /**
- * Is there a previous page available.
- *
- * @return
- */
- protected boolean hasPrev() {
- return start > 0;
- }
-
- /**
- * Is there a next page available
- * @return
- */
- protected boolean hasNext() {
- return end < totalHits && (!getShowAllHits());
- }
-
- /**
- * Proceed to next page.
- */
- protected void nextPage() {
- start += hitsPerPage;
- }
-
- /**
- * Returns offset to next page.
- *
- * @return
- */
- public long getNextPageStart() {
- return start + hitsPerPage;
- }
-
- /**
- * Proceed to previous page.
- */
- public void prev() {
- start -= hitsPerPage;
- }
-
- /**
- * Get a page number.
- * @return
- */
- public int getPageNumber() {
- return start / hitsPerPage;
- }
-
- /**
- * @return
- */
- protected boolean getShowAllHits() {
- return !totalIsExact && (start + hitsPerPage > end);
- }
-
- /**
- * Returns the number of last hit on page.
- * @return
- */
- public long getEnd() {
- return Math.min(totalHits, getNextPageStart());
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/PluginResourceLoader.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/PluginResourceLoader.java
deleted file mode 100644
index 5ee8febff..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/PluginResourceLoader.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.nutch.plugin.Extension;
-import org.apache.nutch.plugin.ExtensionPoint;
-import org.apache.nutch.plugin.PluginClassLoader;
-import org.apache.nutch.util.LogUtil;
-import org.apache.nutch.webapp.extension.UIExtensionPoint;
-
-/**
- * PluginResourceLoader is capable of loading plugged in resources.
- */
-public class PluginResourceLoader extends ClassLoader {
-
- public class ThrowAwayClassLoader extends ClassLoader {
-
- private ClassLoader one;
-
- private ClassLoader two;
-
- public ThrowAwayClassLoader(ClassLoader two, ClassLoader one) {
- this.one = one;
- this.two = two;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.ClassLoader#getResource(java.lang.String)
- */
- public URL getResource(String name) {
- URL retVal = one.getResource(name);
- if (retVal == null)
- retVal = two.getResource(name);
- return retVal;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
- */
- public InputStream getResourceAsStream(String name) {
- InputStream retVal = one.getResourceAsStream(name);
- if (retVal == null)
- retVal = two.getResourceAsStream(name);
- return retVal;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.ClassLoader#getResources(java.lang.String)
- */
- public Enumeration getResources(String name) throws IOException {
- Enumeration retVal = one.getResources(name);
- if (retVal == null)
- retVal = two.getResources(name);
- return retVal;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.ClassLoader#loadClass(java.lang.String)
- */
- public Class loadClass(String name) throws ClassNotFoundException {
- if(LOG.isDebugEnabled()){
- LOG.debug("loading class " + name + " from " + one);
- }
- try {
- return one.loadClass(name);
- } catch (ClassNotFoundException e) {
- }
- if(LOG.isDebugEnabled()){
- LOG.debug("loading class " + name + " from " + two);
- }
- try {
- return two.loadClass(name);
- } catch (ClassNotFoundException e) {
- }
- if(LOG.isDebugEnabled()){
- LOG.info("could not find class, must throw Exception");
- }
- throw new ClassNotFoundException(name);
- }
- }
-
- ClassLoader wrapped;
-
- ArrayList classloaders = new ArrayList();
-
- public static Log LOG = LogFactory.getLog(PluginResourceLoader.class);
-
- public static PluginResourceLoader getInstance(ServiceLocator locator,
- ClassLoader parent) {
- PluginResourceLoader loader = (PluginResourceLoader) locator
- .getConfiguration().getObject(PluginResourceLoader.class.getName());
-
- if (loader == null) {
- LOG.info("Created new nutch loader with parent loader:" + parent);
- loader = new PluginResourceLoader(locator, parent);
- locator.getConfiguration().setObject(
- PluginResourceLoader.class.getName(), loader);
- }
- return loader;
- }
-
- private PluginResourceLoader(ServiceLocator locator, ClassLoader parent) {
- init(locator, parent);
- }
-
- protected void init(ServiceLocator locator, ClassLoader parent) {
-
- ArrayList seen = new ArrayList();
-
- ArrayList paths = new ArrayList();
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("PluginResourceLoader : dynamically setting jars based "
- + "on plugins implementing UIExtensionPoint.");
- }
-
- ExtensionPoint point = locator.getPluginRepository().getExtensionPoint(
- UIExtensionPoint.X_POINT_ID);
-
- if (point == null) {
- LOG.info("Can't find extension point '" + UIExtensionPoint.X_POINT_ID
- + "'");
- classloaders.add(parent);
- return;
- }
-
- Extension[] extensions = point.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- Extension extension = extensions[i];
-
- PluginClassLoader loader = extension.getDescriptor().getClassLoader();
-
- // classloaders.add(loader);
-
- URL[] urls = loader.getURLs();
-
- for (int k = 0; k < urls.length; k++) {
- URL url = urls[k];
- if (!seen.contains(url)) {
- paths.add(url);
- LOG.debug("Adding to classpath:" + url);
- }
- seen.add(url);
- }
- }
-
- URL[] urls = (URL[]) paths.toArray(new URL[paths.size()]);
- classloaders.add(new URLClassLoader(urls, parent));
-
- }
-
- public URL getResource(String name) {
- Iterator i = classloaders.iterator();
-
- while (i.hasNext()) {
- ClassLoader loader = (ClassLoader) i.next();
- URL retVal = loader.getResource(name);
- if (retVal != null) {
- return retVal;
- }
- }
- return null;
- }
-
- public InputStream getResourceAsStream(String name) {
- Iterator i = classloaders.iterator();
-
- while (i.hasNext()) {
- ClassLoader loader = (ClassLoader) i.next();
- InputStream retVal = loader.getResourceAsStream(name);
- if (retVal != null) {
- return retVal;
- }
- }
- return null;
- }
-
- public Enumeration getResources(String name) throws IOException {
- Iterator i = classloaders.iterator();
-
- while (i.hasNext()) {
- ClassLoader loader = (ClassLoader) i.next();
- Enumeration retVal = loader.getResources(name);
- if (retVal != null) {
- return retVal;
- }
- }
- return null;
- }
-
- public Class loadClass(String name) throws ClassNotFoundException {
-
- try {
- // LOG.info("CUSTOM_LOADER->load");
- Iterator i = classloaders.iterator();
- Class retVal = null;
- while (i.hasNext()) {
-
- ClassLoader loader = (ClassLoader) i.next();
- // LOG.info("trying to load " + name + " from:" + loader);
- try {
- retVal = loader.loadClass(name);
- } catch (Exception e) {
- LOG.info("Exception in loader " + e);
- }
- if (retVal != null) {
- // LOG.info("CUSTOM_LOADER->found");
- return retVal;
- }
- }
- // LOG.info("CUSTOM_LOADER_not found");
- } catch (Exception e) {
- LOG.info("Exception in loader " + e);
- e.printStackTrace(LogUtil.getInfoStream(LOG));
- }
- throw new ClassNotFoundException(name);
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Preferences.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Preferences.java
deleted file mode 100644
index daee65365..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Preferences.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Locale;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Preferences represents (extendable) configuration object that is persistable
- * into user browser (as cookie).
- *
- * Cookie is in format key-1<KEYVALSEPARATOR>value-1<VALVALSEPARATOR>key-2<KEYVALSEPARATOR>value-2<VALVALSEPARATOR>key-n<KEYVALSEPARATOR>value-n
- */
-public class Preferences extends HashMap {
-
- private static final long serialVersionUID = 1;
-
- public static final String KEY_LOCALE = "L";
-
- public static final String KEY_RESULTS_PER_PAGE = "R";
-
- public static final String KEY_HITS_PER_DUP = "S";
-
- public static final String KEY_DUP_FIELD = "D";
-
- static final String DEFAULTKEYVALSEPARATOR = "_";
-
- static final String DEFAULTVALVALSEPARATOR = "-";
-
- /**
- * Name of web ui cookie that stores users cutomized user preferences.
- */
- public static final String COOKIE_NAME = "NUTCH";
-
- /**
- * Default preferences, used for all who have not customized.
- */
- static final Preferences DEFAULTS = new Preferences();
-
- static {
- // results per page
- DEFAULTS.put(KEY_RESULTS_PER_PAGE, "10");
-
- // dup field
- DEFAULTS.put(KEY_DUP_FIELD, "site");
- }
-
- /**
- * @return locale of user (from preferences if set, or from request)
- */
- public Locale getLocale(HttpServletRequest request) {
- if (containsKey(KEY_LOCALE)) {
- return new Locale((String) get(KEY_LOCALE));
- } else {
- return request.getLocale();
- }
- }
-
- /**
- * Persist Preferences as cookie.
- * @param request
- * @param response
- * @param prefs preferences object to persist
- */
- public static void setPreferencesCookie(HttpServletRequest request,
- HttpServletResponse response, Preferences prefs) {
- if (DEFAULTS.equals(prefs)) {
- removeCookie(response);
- } else {
- setPreferencesCookie(response, prefs);
- }
- }
-
- private static void setPreferencesCookie(HttpServletResponse response,
- Preferences prefs) {
- Cookie prefscookie = new Cookie(COOKIE_NAME, prefs.toString());
- prefscookie.setMaxAge(Integer.MAX_VALUE);
- response.addCookie(prefscookie);
- }
-
- /**
- * Remove cookie from browser
- *
- * @param response
- */
- public static void removeCookie(HttpServletResponse response) {
- Cookie prefscookie = new Cookie(COOKIE_NAME, "");
- prefscookie.setMaxAge(-1);
- response.addCookie(prefscookie);
- }
-
- /**
- * Parse Preferences from cookie.
- *
- * @param request
- */
- public static Preferences parseCookie(HttpServletRequest request) {
- // find right cookie
- Cookie[] c = request.getCookies();
-
- if (c != null) {
- for (int i = 0; i < c.length; i++) {
- if (COOKIE_NAME.equals(c[i].getName())) {
- return Preferences.parse(c[i].getValue());
- }
- }
- }
- return DEFAULTS;
- }
-
- /**
- * Parse a String into Preferences object using default separators
- * @param data
- * @return
- */
- public static Preferences parse(String data) {
- return parse(data,DEFAULTVALVALSEPARATOR, DEFAULTKEYVALSEPARATOR);
- }
-
- /**
- * Parse a String into a Preferences object
- * @param data String to parse
- * @param valueValueSeparator delimiter between keyValue pairs
- * @param keyValueSeparator delimiter between key & value
- * @return parsed Preferences
- */
- public static Preferences parse(String data, String valueValueSeparator, String keyValueSeparator) {
- Preferences p = new Preferences();
- p.putAll(DEFAULTS);
- String[] dataitems = data.split(valueValueSeparator);
- for (int i = 0; i < dataitems.length; i++) {
- String keyvalue[] = dataitems[i].split(keyValueSeparator);
- if (keyvalue.length == 2) {
- try {
- p.put(keyvalue[0], URLDecoder.decode((String) keyvalue[1], "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- }
- }
- return p;
- }
-
- /**
- * Return int value or default if non existing.
- * @param name
- * @param defaultVal
- * @return
- */
- public int getInt(String name, int defaultVal) {
- try {
- return get(name) == null ? defaultVal : Integer
- .parseInt((String) get(name));
- } catch (Exception e) {
- return defaultVal;
- }
- }
-
- /**
- * Return String value or default if non existing.
- * @param name
- * @param defaultVal
- * @return
- */
- public String getString(String name, String defaultVal) {
- return get(name) == null ? defaultVal : (String) get(name);
- }
-
- public String toString() {
- StringBuffer txt = new StringBuffer();
- Object[] keys = keySet().toArray();
-
- for (int i = 0; i < keys.length; i++) {
- try {
- txt.append(keys[i].toString()).append(DEFAULTKEYVALSEPARATOR).append(
- URLEncoder.encode((String) get(keys[i]), "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- if (i < keys.length - 1) {
- txt.append(DEFAULTVALVALSEPARATOR);
- }
- }
-
- return txt.toString();
- }
-
- /**
- * Get (cached) Preferences instance from request (first from request
- * attribute then from cookie).
- *
- * @param request
- * @return Preferences object from request or null if not available
- */
- public static Preferences getPreferences(final HttpServletRequest request) {
- Preferences prefs = (Preferences) request.getAttribute(Preferences.class
- .getName());
- // processing locale
- if (prefs == null) {
- prefs = parseCookie(request);
- request.setAttribute(Preferences.class.getName(), prefs);
- }
- return prefs;
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Search.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Search.java
deleted file mode 100644
index aba4f28b5..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Search.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.io.Writable;
-import org.apache.nutch.html.Entities;
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.Hits;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.searcher.Summary;
-
-/**
- * Search is a bean that represents an ongoing search.
- *
- * After search searchBean that represents the search user doing (also the
- * results) might be a good candidate for caching ?
- *
- */
-public class Search implements Writable {
-
- private static final long serialVersionUID = 1L;
-
- public static final String REQ_ATTR_SEARCH="nutchSearch";
- public static final Log LOG = LogFactory.getLog(Search.class);
-
- String queryString;
-
- String htmlQueryString;
-
- Query query;
-
- int startOffset;
-
- int hitsPerDup;
-
- // Number of results per page
- int hitsPerPage;
-
- // Number of hits required, for example clustering plugin might require more
- // than hitsPerPage hits
- int hitsRequired=0;
-
- String sortColumn;
-
- boolean sortDesc;
-
- Hits hits;
-
- Hit[] show;
-
- HitDetails[] details;
-
- Summary[] summaries;
-
- ArrayList results = null;
-
- NavigationHelper navigationHelper;
-
- ServiceLocator locator;
-
- SearchForm form;
-
- String dupField;
-
- /**
- * Perform search described by this bean
- *
- * @param bean
- */
- public void performSearch() {
-
- LOG.info("performing search, requiring:" + getHitsRequired());
-
- try {
- LOG.info("query:" + getQuery());
- LOG.info("endOffset:" + getStartOffset() + getHitsRequired());
- LOG.info("hitsPerDup:" + getHitsPerDup());
- LOG.info("dupField:" + getDupField());
- LOG.info("sortField:" + getSortColumn());
- LOG.info("descending:" + isSortDesc());
-
- hits = locator.getNutchBean().search(getQuery(),
- getStartOffset() + getHitsRequired(), getHitsPerDup(), getDupField(),
- getSortColumn(), isSortDesc());
- } catch (IOException e) {
- hits = new Hits(0, new Hit[0]);
- }
-
- int realEnd = (int) Math.min(hits.getLength(), getStartOffset()
- + getHitsRequired());
-
- init();
- show = hits.getHits(getStartOffset(), realEnd - getStartOffset());
-
- try {
- details = locator.getNutchBean().getDetails(show);
- summaries = locator.getNutchBean().getSummary(details, getQuery());
- } catch (IOException e) {
- LOG.info("Error getting hit information:" + e);
- e.printStackTrace();
- }
- }
-
- public void init(){
- int endOffset=hits.getLength();
-
- navigationHelper = new NavigationHelper(startOffset, endOffset, hitsPerPage, hits
- .getTotal(), hits.totalIsExact());
-
- // set offset to next page to form so it get's to ui
- if (navigationHelper.hasNext()) {
- form.setValue(SearchForm.NAME_START, Long.toString(navigationHelper
- .getNextPageStart()));
- }
- }
-
- /**
- * Gets the results of search to display.
- *
- * @return
- */
- public List getResults() {
-
- int len=Math.min(details.length,getHitsPerPage());
-
- if (results == null) {
- results = new ArrayList(len);
- for (int i = 0; i < len; i++) {
- results.add(new SearchResultBean(this, show[i], details[i],
- summaries[i]));
- }
- }
- return results;
- }
-
- protected int parseInt(String value, int defaultValue) {
- int ret = defaultValue;
- if (value != null) {
- try {
- ret = Integer.parseInt(value);
- } catch (Exception e) {
- // ignore
- }
- }
- return ret;
- }
-
- public Search(){
-
- }
-
- public Search(ServiceLocator locator) {
- this.locator = locator;
- Preferences prefs = locator.getPreferences();
- form = locator.getSearchForm();
-
- queryString = form.getValueString(SearchForm.NAME_QUERYSTRING);
- if (queryString == null) {
- queryString = "";
- }
- htmlQueryString = Entities.encode(queryString);
-
- startOffset = parseInt(form.getValueString(SearchForm.NAME_START), 0);
- hitsPerPage = parseInt(form.getValueString(SearchForm.NAME_HITSPERPAGE),
- prefs.getInt(Preferences.KEY_RESULTS_PER_PAGE, 10));
- hitsPerDup = parseInt(form.getValueString(SearchForm.NAME_HITSPERDUP),
- prefs.getInt(
- Preferences.KEY_HITS_PER_DUP, 2));
-
- sortColumn = form.getValueString(SearchForm.NAME_SORTCOLUMN);
-
- sortDesc = (sortColumn != null && "true".equals(form
- .getValueString(SearchForm.NAME_SORTREVERSE)));
-
- dupField = form.getValueString(SearchForm.NAME_DUPCOLUMN);
- if (dupField == null) {
- dupField = "site";
- }
-
- try {
- query = Query.parse(queryString, locator.getConfiguration());
- } catch (IOException e) {
- LOG.info("Error parsing query:" + e);
- e.printStackTrace();
- }
-
- }
-
- /**
- * @return Returns the hitsPerPage.
- */
- public int getHitsPerPage() {
- return hitsPerPage;
- }
-
- /**
- * @param hitsPerPage
- * The hitsPerPage to set.
- */
- protected void setHitsPerPage(int hitsPerPage) {
- this.hitsPerPage = hitsPerPage;
- }
-
- /**
- * @return Returns the hitsPerSite.
- */
- public int getHitsPerDup() {
- return hitsPerDup;
- }
-
- /**
- * @param hitsPerSite
- * The hitsPerSite to set.
- */
- protected void setHitsPerSite(int hitsPerSite) {
- this.hitsPerDup = hitsPerSite;
- }
-
- /**
- * @return Returns the query.
- */
- public Query getQuery() {
- return query;
- }
-
- /**
- * @param query
- * The query to set.
- */
- public void setQuery(Query query) {
- this.query = query;
- }
-
- /**
- * @return Returns the queryString.
- */
- public String getQueryString() {
- return queryString;
- }
-
- /**
- * @param queryString
- * The queryString to set.
- */
- protected void setQueryString(String queryString) {
- this.queryString = queryString;
- }
-
- /**
- * Returns true if sort is descending.
- *
- * @return Returns sort order
- */
- public boolean isSortDesc() {
- return sortDesc;
- }
-
- /**
- * Set sort order.
- *
- * @param sortAsc
- * The sortAsc to set.
- */
- protected void setSortDesc(boolean sortAsc) {
- this.sortDesc = sortAsc;
- }
-
- /**
- * @return Returns the sortColumn.
- */
- public String getSortColumn() {
- return sortColumn;
- }
-
- /**
- * @param sortColumn
- * The sortColumn to set.
- */
- protected void setSortColumn(String sortColumn) {
- this.sortColumn = sortColumn;
- }
-
- /**
- * @return Returns the startOffset.
- */
- public int getStartOffset() {
- return startOffset;
- }
-
- /**
- * @param startOffset
- * The startOffset to set.
- */
- protected void setStartOffset(int startOffset) {
- this.startOffset = startOffset;
- }
-
- /**
- * @return Returns the htmlQueryString.
- */
- public String getHtmlQueryString() {
- return htmlQueryString;
- }
-
- /**
- * @param htmlQueryString
- * The htmlQueryString to set.
- */
- protected void setHtmlQueryString(String htmlQueryString) {
- this.htmlQueryString = htmlQueryString;
- }
-
- /**
- * @return Returns the details.
- */
- public HitDetails[] getDetails() {
- return details;
- }
-
- /**
- * @param details
- * The details to set.
- */
- protected void setDetails(HitDetails[] details) {
- this.details = details;
- }
-
- /**
- * @return Returns the hits.
- */
- public Hits getHits() {
- return hits;
- }
-
- /**
- * @param hits
- * The hits to set.
- */
- protected void setHits(Hits hits) {
- this.hits = hits;
- }
-
- /**
- * @return Returns the show.
- */
- public Hit[] getShow() {
- return show;
- }
-
- /**
- * @param show
- * The show to set.
- */
- protected void setShow(Hit[] show) {
- this.show = show;
- }
-
- /**
- * @return Returns the summaries.
- */
- public Summary[] getSummaries() {
- return summaries;
- }
-
- /**
- * @param summaries
- * The summaries to set.
- */
- protected void setSummaries(Summary[] summaries) {
- this.summaries = summaries;
- }
-
- /**
- * returns start, end, total, used for printing message on search page, this
- * is why offset is +1'd.
- */
- public String[] getResultInfo() {
- return new String[] { Long.toString(startOffset + 1),
- Long.toString(navigationHelper.getEnd()),
- Long.toString(hits.getTotal()), getHtmlQueryString() };
- }
-
- /**
- * @return true if more results available
- */
- public boolean getHasNextPage() {
- return navigationHelper.hasNext();
- }
-
- /**
- * @return true if previous page if available
- */
- public boolean getHasPrevPage() {
- return navigationHelper.hasPrev();
- }
-
- public String getDupField() {
- return dupField;
- }
-
- protected SearchForm getForm() {
- return form;
- }
-
- /**
- * @return
- */
- public List getFormProperties() {
- return form.getActive();
- }
-
- public boolean getShowAllHits() {
- if(navigationHelper.getShowAllHits()){
- //remove start parameter from form
- getForm().remove(SearchForm.NAME_START);
- //add hitsPerDup=0
- getForm().setValue(SearchForm.NAME_HITSPERDUP,"0");
- }
- return navigationHelper.getShowAllHits();
- }
-
- /**
- * Return true if there are results.
- *
- * @return
- */
- public boolean getHasResults() {
- return hits.getTotal() > 0;
- }
-
- public boolean getIsSearch() {
- return queryString != null && !queryString.trim().equals("");
- }
-
- /**
- * Return number of hits required, if not specified defaults to HitsPerPage.
- * @return
- */
- public int getHitsRequired() {
- if (hitsRequired != 0) {
- return hitsRequired;
- }
- return getHitsPerPage();
- }
-
- /**
- * Set number of hits required.
- * @param hitsRequired
- */
- public void setHitsRequired(int hitsRequired) {
- this.hitsRequired = hitsRequired;
- }
-
- /**
- * Launch search.
- */
- public void launchSearch() {
- BaseSearch bs = new BaseSearch(locator);
- bs.doSearch();
- }
-
- public void write(DataOutput out) throws IOException {
- LOG.info("writing hits");
- hits.write(out);
- out.writeInt(show.length);
-
- for (int i = 0; i < show.length; i++) {
- show[i].write(out);
- }
-
- out.writeInt(details.length);
- for (int i = 0; i < details.length; i++) {
- details[i].write(out);
- }
-
- out.writeInt(summaries.length);
- for (int i = 0; i < summaries.length; i++) {
- summaries[i].write(out);
- }
-
- }
-
- public void readFields(DataInput in) throws IOException {
- hits = new Hits();
- hits.readFields(in);
- int showlength = in.readInt();
- show = new Hit[showlength];
- for (int i = 0; i < showlength; i++) {
- show[i] = new Hit();
- show[i].readFields(in);
- }
-
- int detailsLength = in.readInt();
- details = new HitDetails[detailsLength];
- for (int i = 0; i < detailsLength; i++) {
- details[i] = new HitDetails();
- details[i].readFields(in);
- }
-
- int summariesLength = in.readInt();
- summaries = new Summary[summariesLength];
- for (int i = 0; i < summariesLength; i++) {
- summaries[i] = new Summary();
- summaries[i].readFields(in);
- }
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchForm.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchForm.java
deleted file mode 100644
index e9223f9e9..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchForm.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * SearchForm is a representation of query parameters submitted as part of
- * search form. It provides functionality to preserve all required parameters
- * for example when creating link to "next page"
- *
- * Plugins participating in search
- *
- * @see org.apache.nutch.webapp.extension.PreSearch,
- * @see org.apache.nutch.webapp.extension.Search,
- * @see org.apache.nutch.webapp.extension.PostSearch
- *
- * can by reading (existing) or setting values to/from this map make sure that
- * those parameters are persisted to forms/links requiring them without any
- * special tricks.
- *
- */
-public class SearchForm {
-
- /**
- * General HTTP parameter name wich contains hits per page value
- */
- public static final String NAME_HITSPERPAGE = "hitsPerPage";
-
- public static final String NAME_HITSPERDUP = "hitsPerDup";
-
- public static final String NAME_START = "start";
-
- public static final String NAME_QUERYSTRING = "query";
-
- public static final String NAME_SORTCOLUMN = "sort";
-
- public static final String NAME_SORTREVERSE = "reverse";
-
- public static final String NAME_DUPCOLUMN = "dup";
-
- private static final long serialVersionUID = 1L;
-
- Map o_values;
-
- Map n_values = new HashMap();
-
- ArrayList active;
-
- /**
- * KeyValue presents a class that holds key value pair.
- *
- */
- public static class KeyValue {
-
- String key;
-
- String value;
-
- /**
- * Construct new KeyValue with provided values
- *
- * @param key
- * the key
- * @param value
- * the value
- */
- public KeyValue(String key, String value) {
- this.key = key;
- this.value = value;
- }
-
- /**
- * Gets the key
- *
- * @return contained key
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Gets the value
- *
- * @return contained value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value
- *
- * @param value
- * The value to set.
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return value.toString();
- }
- }
-
- /**
- * Construct new SearchForm based on provided map map values are String arrays
- *
- * @param parameters
- * original map from request
- */
- public SearchForm(Map parameters) {
- o_values = parameters;
- active = new ArrayList();
- }
-
- /**
- * Sets value for provided key.
- *
- * @param key
- * the key to set the value on
- * @param value
- * the value to set
- */
- public void setValue(String key, String value) {
- if (n_values.containsKey(key)) {
- ((KeyValue) n_values.get(key)).setValue(value);
- } else {
- n_values.put(key, new KeyValue(key, value));
- }
- if(!active.contains(n_values.get(key)))
- active.add(n_values.get(key));
- }
-
- /**
- * Gets the real value contained in keyed KeyValue.
- *
- * @param key
- * @return
- */
- public String getValue(String key) {
- if (n_values.containsKey(key) && !active.contains(n_values.get(key))) {
- active.add(n_values.get(key));
- return (String) ((KeyValue) n_values.get(key)).getValue();
- } else {
- return null;
- }
- }
-
- /**
- * Gets the String value contained in keyed KeyValue.
- *
- * @param key
- * @return Object.toString()
- */
- public String getValueString(String key) {
- if (n_values.containsKey(key)) {
- active.add(n_values.get(key));
- } else if (o_values.containsKey(key)) {
- // get only the 1st parameter
- n_values.put(key, new KeyValue(key, ((String[]) o_values.get(key))[0]));
- active.add(n_values.get(key));
- } else {
- return null;
- }
-
- try {
- return (String) ((KeyValue) n_values.get(key)).getValue();
- } catch (ClassCastException e) {
- return ((KeyValue) n_values.get(key)).getValue().toString();
- }
- }
-
- /**
- * Remove named key (and the KeyValue).
- *
- * @param key
- * @return
- */
- public KeyValue remove(String key) {
- if (n_values.containsKey(key)) {
- active.remove(n_values.get(key));
- return (KeyValue) n_values.remove(key);
- } else {
- return null;
- }
- }
-
- /**
- * Get named KeyValue object.
- *
- * @param key
- * @return named object or null if not existing
- */
- public KeyValue getKeyValue(String key) {
- if (n_values.containsKey(key)) {
- active.add(key);
- }
- return (KeyValue) n_values.get(key);
- }
-
- /**
- * Returns list of KeyValue objects that have been read or set.
- *
- * @return List containing KeyValue objects
- */
- public List getActive() {
- return active;
- }
-
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
-
- sb.append("Original map {");
-
- Iterator i = o_values.keySet().iterator();
-
- while (i.hasNext()) {
- Object o = i.next();
- sb.append("[" + o.toString()).append(", ");
- sb.append(((String[]) o_values.get(o))[0]).append("] ");
- }
- sb.append("}\n");
-
- sb.append("Used map {");
-
- i = n_values.keySet().iterator();
-
- while (i.hasNext()) {
- Object o = i.next();
- sb.append("[" + o.toString()).append(", ");
- sb.append(n_values.get(o)).append("] ");
- }
- sb.append("}\n");
-
- return sb.toString();
- }
-
- /**
- * Returns a string usable in urls that contains all active parameters and
- * their values, if submitted encoding does not work values are encoded with
- * utf-8 encoding.
- *
- * @param encoding
- * @return
- */
- public String getParameterString(String encoding)
- throws UnsupportedEncodingException {
-
- boolean useEncoding = true;
- StringBuffer sb = new StringBuffer();
-
- try {
- URLEncoder.encode("", encoding);
- } catch (UnsupportedEncodingException e) {
- useEncoding = false;
- }
-
- List l = getActive();
-
- Iterator i = l.iterator();
- while (i.hasNext()) {
- KeyValue kv = (KeyValue) i.next();
- if (useEncoding) {
- sb.append(URLEncoder.encode(kv.getKey(), encoding)).append("=").append(
- URLEncoder.encode(kv.getValue(), encoding));
- } else {
- sb.append(URLEncoder.encode(kv.getKey(), "utf-8")).append("=").append(
- URLEncoder.encode(kv.getValue(), "utf-8"));
- }
- if (i.hasNext()) {
- sb.append("&");
- }
- }
- return sb.toString();
- }
-
- public Object clone(){
- SearchForm newForm=new SearchForm(new HashMap());
- newForm.active.addAll(active);
- newForm.o_values.putAll(o_values);
- newForm.n_values.putAll(n_values);
- return newForm;
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchResultBean.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchResultBean.java
deleted file mode 100644
index cfd8d86b1..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/SearchResultBean.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-import org.apache.nutch.html.Entities;
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.Summary;
-
-/**
- * SearchResultBean contains information about one search result in easily
- * accessible form.
- */
-public class SearchResultBean {
-
- Hit hit;
-
- Summary summary;
-
- HitDetails details;
-
- Search search;
-
- public SearchResultBean(Search search, Hit hit, HitDetails details,
- Summary summary) {
- this.search = search;
- this.hit = hit;
- this.details = details;
- this.summary = summary;
- }
-
- /**
- * Url of search result.
- *
- * @return
- */
- public String getUrl() {
- return details.getValue("url");
- }
-
- /**
- * Title of search result.
- *
- * @return
- */
- public String getTitle() {
- String title = details.getValue("title");
- return title == null || title.equals("") ? getUrl() : title;
- }
-
- /**
- * Id of search result.
- *
- * @return
- */
- public String getId() {
- return "idx=" + hit.getIndexNo() + "&id=" + hit.getIndexDocNo();
- }
-
- /**
- * Summary of search result.
- *
- * @return
- */
- public String getSummary() {
- return summary.toHtml(true);
- }
-
- /**
- * Url of search result in encoded form.
- *
- * @return
- */
- public String getEncodedUrl() {
- return Entities.encode(getUrl());
- }
-
- /**
- * Title of search result in encoded form.
- *
- * @return
- */
- public String getEncodedTitle() {
- return Entities.encode(getTitle());
- }
-
- /**
- * "more" url this should be replaced with help of SearchForm.
- *
- * @return
- *
- */
- public String getMoreUrl() throws UnsupportedEncodingException {
- String more = "";
-
- more = "query="
- + URLEncoder.encode(search.getDupField() + ":" + hit.getDedupValue()
- + " " + search.getQueryString(), "UTF8")
- + "&" + SearchForm.NAME_HITSPERDUP + "=0";
-
- return more;
- }
-
- /**
- * Dedup field name.
- *
- * @return
- */
- public String getDedupValue() {
- return hit.getDedupValue();
- }
-
- /**
- * QueryString in encoded form.
- *
- * @return
- */
- public String getUrlEncodedQuery() {
- try {
- if (search.getQueryString() != null) {
- return URLEncoder.encode(search.getQueryString(), "UTF-8");
- }
- } catch (UnsupportedEncodingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return search.queryString != null ? search.queryString : "";
- }
-
- /**
- * HitDetails of search result.
- *
- * @return
- */
- public HitDetails getDetails() {
- return details;
- }
-
- /**
- * Hit of search result.
- *
- * @return
- */
- public Hit getHit() {
- return hit;
- }
-
- /**
- * Boolean indicating that there are other, lower-scoring hits with the same
- * dedup value.
- *
- * @see Hit#moreFromDupExcluded()
- *
- * @return true if more dups available
- */
- public boolean getHasMore() {
- return hit.moreFromDupExcluded();
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServiceLocator.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServiceLocator.java
deleted file mode 100644
index d27f6473e..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServiceLocator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.util.Locale;
-
-import org.apache.hadoop.conf.Configuration;
-
-import org.apache.nutch.plugin.PluginRepository;
-import org.apache.nutch.searcher.NutchBean;
-
-/**
- * ServiceLocator interface. ServiceLocator is used to get handle to some of the
- * core services of nutch.
- */
-public interface ServiceLocator {
-
- /**
- * Return active Configuration instance (application context).
- *
- * @return
- */
- public Configuration getConfiguration();
-
- /**
- * Return active PluginRepsository instance (application instance).
- *
- * @return
- */
- public PluginRepository getPluginRepository();
-
- /**
- * Return active SearchForm (request instance).
- *
- * @return
- */
- public SearchForm getSearchForm();
-
- /**
- * Return active Preferences (request context).
- *
- * @return
- */
- public Preferences getPreferences();
-
- /**
- * Return active NutchBean (application context).
- *
- * @return
- */
- public NutchBean getNutchBean();
-
- /**
- * Return active PluginResourceLoader (application context).
- *
- * @return
- */
- public PluginResourceLoader getPluginResourceLoader(ClassLoader loader);
-
- /**
- * Return active Search (request context).
- *
- * @return
- */
- public Search getSearch();
-
- /**
- * Return active locale
- * @return
- */
- public Locale getLocale();
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServletContextServiceLocator.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServletContextServiceLocator.java
deleted file mode 100644
index c94afff7f..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/ServletContextServiceLocator.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-* 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.
-*/
-package org.apache.nutch.webapp.common;
-
-import java.io.IOException;
-import java.util.Locale;
-
-import javax.servlet.ServletContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.plugin.PluginRepository;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.util.NutchConfiguration;
-
-public abstract class ServletContextServiceLocator implements ServiceLocator {
-
- /**
- * ServiceLocator will be saved in ServletContext under this key
- */
- private static final String KEY = ServletContextServiceLocator.class
- .getName();
-
- /**
- * Logger.
- */
- public static final Log LOG = LogFactory
- .getLog(ServletContextServiceLocator.class);
-
- /**
- * ServletContext this ServiceLocator is bound to.
- */
- protected ServletContext servletContext;
-
- /**
- * Active configuration.
- */
- protected Configuration config;
-
- /**
- * Active PluginRepository.
- */
- private PluginRepository repository;
-
- /**
- * Active NutchBean.
- */
- private NutchBean bean;
-
- /**
- * Private Constructor used to create new ServiceLocator when needed.
- *
- * @param servletContext
- */
- private ServletContextServiceLocator(ServletContext servletContext) {
- this.servletContext = servletContext;
- config = NutchConfiguration.get(servletContext);
- repository = PluginRepository.get(config);
- try {
- bean = new NutchBean(config);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Factory method to get handle to ServiceLocator, or if none exists in
- * ServletContext then one is created.
- *
- * @param context
- * @return ServiceLocator instance bound to ServletContext
- */
- public static ServiceLocator getInstance(ServletContext context) {
- ServiceLocator locator = (ServiceLocator) context.getAttribute(KEY);
- if (locator == null) {
- LOG.info("creating new serviceLocator for context:" + context);
- locator = new ServletContextServiceLocator(context) {
- public SearchForm getSearchForm() {
- return null;
- }
-
- public Preferences getPreferences() {
- return null;
- }
-
- public Search getSearch() {
- return null;
- }
-
- public Locale getLocale() {
- return null;
- }
- };
- context.setAttribute(KEY, locator);
- }
- return locator;
- }
-
- public Configuration getConfiguration() {
- return config;
- }
-
- public PluginRepository getPluginRepository() {
- return repository;
- }
-
- public NutchBean getNutchBean() {
- return bean;
- }
-
- public PluginResourceLoader getPluginResourceLoader(ClassLoader loader) {
- return PluginResourceLoader.getInstance(this, loader);
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Startable.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Startable.java
deleted file mode 100644
index c96b4654d..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/Startable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* 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.
-*/
-package org.apache.nutch.webapp.common;
-
-import javax.servlet.ServletContext;
-
-/**
- * Controllers wishing to be initialized must extend this interface.
- */
-public interface Startable {
-
- /**
- * This method gets called when plugin initializes.
- *
- * @param servletContext
- */
- void start(ServletContext servletContext);
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.java
deleted file mode 100644
index 8c4989187..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import java.lang.ClassLoader;
-
-/**
- * This class is responsible for parsing web.xml definitions from plugins (put
- * there by jspc when precompiling jsp files).
- *
- * Extracted information is used at runtime when dispatching requests targetted
- * to jsp resources to the precompiled servlet classes.
- */
-public class WebAppModule {
-
- HashMap servlets;
-
- List urlPatterns;
-
- ClassLoader loader = null;
-
- HashMap servletObjects = new HashMap();
-
- private ServletConfig servletConfig;
-
- /**
- * Construct new WebAppModule
- *
- * @param input
- * ionputstream to web.xml type of document
- */
- public WebAppModule(InputStream input) {
- loader = Thread.currentThread().getContextClassLoader();
- init(input);
- }
-
- public void init(InputStream input) {
- Document doc;
- servlets = new HashMap();
- urlPatterns = new ArrayList();
-
- if (input != null) {
-
- try {
- doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
- input);
- parse(doc);
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- }
- }
- loadServlets();
- }
-
- public void loadServlets() {
-
- Iterator i = getPaths().iterator();
-
- while (i.hasNext()) {
-
- String key = (String) i.next();
- String servletName = (String) servlets.get(key);
- HttpServlet servletObject;
- Class servletClass;
- try {
- servletClass = loader.loadClass(servletName);
- servletObject = (HttpServlet) servletClass.newInstance();
- servletObject.init(servletConfig);
- servletObjects.put(key, servletObject);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (ServletException e) {
- e.printStackTrace();
- }
- }
- }
-
- public WebAppModule(ClassLoader loader, ServletConfig config) {
- servletConfig = config;
- this.loader = loader;
- init(loader.getResourceAsStream("META-INF/jsp-servlet-mappings.xml"));
- }
-
- /**
- * Get jsp paths available
- *
- * @return
- */
- public List getPaths() {
- return urlPatterns;
- }
-
- public Map getMappings() {
- return servlets;
- }
-
- /**
- * Return Servlet name for path or null if non existing
- *
- * @param path
- * @return
- */
- public String getServletName(String path) {
- return (String) servlets.get(path);
- }
-
- public void parse(Document doc) {
-
- Element root = doc.getDocumentElement();
- NodeList mappings = root.getElementsByTagName("servlet-mapping");
- for (int i = 0; i < mappings.getLength(); i++) {
- Element mapping = (Element) mappings.item(i);
- Element servlet = (Element) mapping.getElementsByTagName("servlet-name")
- .item(0);
- Element pattern = (Element) mapping.getElementsByTagName("url-pattern")
- .item(0);
-
- String servletName = servlet.getTextContent().trim();
- String urlPattern = pattern.getTextContent().trim();
-
- servlets.put(urlPattern, servletName);
- urlPatterns.add(urlPattern);
- }
- }
-
- /**
- * Dispatches request to precompiled jsp
- *
- * @param relPath
- * @param request
- * @param response
- */
- public void dispatch(String relPath, HttpServletRequest request,
- HttpServletResponse response) {
-
- HttpServlet servletObject;
- if (servletObjects.containsKey(relPath)) {
- servletObject = (HttpServlet) servletObjects.get(relPath);
- } else {
- // servlet not found??
- return;
- }
- try {
- servletObject.service(request, response);
- } catch (ServletException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebappInstanceServiceLocator.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebappInstanceServiceLocator.java
deleted file mode 100644
index 64f8f33e8..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebappInstanceServiceLocator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.common;
-
-import java.util.Locale;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.nutch.plugin.PluginRepository;
-import org.apache.nutch.searcher.NutchBean;
-
-public class WebappInstanceServiceLocator implements ServiceLocator {
-
- public static final Log LOG = LogFactory.getLog(WebappInstanceServiceLocator.class);
-
- HttpServletRequest request;
-
- ServiceLocator contextLocator;
-
- /**
- * Creates new WebappInstanceServiceLocator instance and binds it to request
- *
- * @param request
- * @param servletContext
- */
- public WebappInstanceServiceLocator(HttpServletRequest request,
- ServletContext servletContext) {
- this.request = request;
- contextLocator = ServletContextServiceLocator.getInstance(servletContext);
- WebappInstanceServiceLocator.register(request, this);
- }
-
- public Preferences getPreferences() {
- return Preferences.getPreferences(request);
- }
-
- public SearchForm getSearchForm() {
- if (request.getAttribute(SearchForm.class.getName()) == null) {
- request.setAttribute(SearchForm.class.getName(), new SearchForm(request
- .getParameterMap()));
- }
- return (SearchForm) request.getAttribute(SearchForm.class.getName());
- }
-
- public Search getSearch() {
- String key = Search.REQ_ATTR_SEARCH;
- Search search = (Search) request.getAttribute(key);
- if (search == null) {
- search = new Search(this);
- request.setAttribute(key, search);
- }
-
- return search;
- }
-
- /**
- * @param request
- * @return
- */
- public static ServiceLocator getFrom(HttpServletRequest request) {
- return (ServiceLocator) request
- .getAttribute(WebappInstanceServiceLocator.class.getName());
- }
-
- /**
- * @param request
- * @param locator
- */
- public static void register(HttpServletRequest request,
- WebappInstanceServiceLocator locator) {
- WebappInstanceServiceLocator l = (WebappInstanceServiceLocator) request
- .getAttribute(WebappInstanceServiceLocator.class.getName());
- if (locator != null && locator != l) {
- request.setAttribute(WebappInstanceServiceLocator.class.getName(),
- locator);
- }
- }
-
- public Configuration getConfiguration() {
- return contextLocator.getConfiguration();
- }
-
- public PluginRepository getPluginRepository() {
- return contextLocator.getPluginRepository();
- }
-
- public NutchBean getNutchBean() {
- return contextLocator.getNutchBean();
- }
-
- public PluginResourceLoader getPluginResourceLoader(ClassLoader loader) {
- return contextLocator.getPluginResourceLoader(loader);
- }
-
- public Locale getLocale() {
- return getPreferences().getLocale(request);
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/web2_services.png b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/web2_services.png
deleted file mode 100644
index 5467f9e39..000000000
Binary files a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/web2_services.png and /dev/null differ
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/AnchorsController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/AnchorsController.java
deleted file mode 100644
index 2cbe17e93..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/AnchorsController.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.html.Entities;
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-public class AnchorsController extends NutchController {
-
- public class AnchorsBean {
- HitDetails details;
-
- ArrayList anchors;
-
- protected AnchorsBean(ArrayList v, HitDetails details) {
- this.anchors = v;
- this.details = details;
- }
-
- public String getUrl() {
- return details.getValue("url");
- }
-
- public List getAnchors() {
- return anchors;
- }
- }
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
- ServiceLocator locator = getServiceLocator(request);
- NutchBean bean = locator.getNutchBean();
-
- LOG.info("anchors request from " + request.getRemoteAddr());
- Hit hit = new Hit(Integer.parseInt(request.getParameter("idx")), Integer
- .parseInt(request.getParameter("id")));
-
- HitDetails details = bean.getDetails(hit);
-
- String[] anchors = bean.getAnchors(details);
- ArrayList anchorVector = new ArrayList();
- if (anchors != null) {
- for (int i = 0; i < anchors.length; i++) {
- anchorVector.add(Entities.encode(anchors[i]));
- }
- }
- request
- .setAttribute("nutchAnchors", new AnchorsBean(anchorVector, details));
- logRequestAttributes(request);
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/CachedController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/CachedController.java
deleted file mode 100644
index f2190dae0..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/CachedController.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.metadata.Metadata;
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-public class CachedController extends NutchController {
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
- NutchBean bean = locator.getNutchBean();
-
- LOG.info("Cache request from " + request.getRemoteAddr());
-
- Hit hit = new Hit(Integer.parseInt(request.getParameter("idx")),
- Integer.parseInt(request.getParameter("id")));
-
- HitDetails details = bean.getDetails(hit);
- String id = "idx=" + hit.getIndexNo() + "&id=" + hit.getIndexDocNo();
-
- Metadata metaData = bean.getParseData(details).getContentMeta();
-
- String content = null;
- String contentType = (String) metaData.get(Metadata.CONTENT_TYPE);
-
-
- if (contentType.startsWith("text/html")) {
- // FIXME : it's better to emit the original 'byte' sequence
- // with 'charset' set to the value of 'CharEncoding',
- // but I don't know how to emit 'byte sequence' in JSP.
- // out.getOutputStream().write(bean.getContent(details)) may work,
- // but I'm not sure.
- String encoding = (String) metaData.get("CharEncodingForConversion");
- if (encoding != null) {
- try {
- content = new String(bean.getContent(details), encoding);
- } catch (UnsupportedEncodingException e) {
- //fallback to configured charset
- content = new String(bean.getContent(details), locator
- .getConfiguration().get("parser.character.encoding.default"));
- }
- } else {
- //construct String with system default encoding
- content = new String(bean.getContent(details));
- }
- }
-
- // page content
- request.setAttribute("content", content);
- // page content type
- request.setAttribute("contentType", contentType);
- // page url
- request.setAttribute("url", details.getValue("url"));
- // page id
- request.setAttribute("id", id);
- // page content if html
- request.setAttribute("isHtml", new Boolean(contentType
- .startsWith("text/html")));
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/ExplainController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/ExplainController.java
deleted file mode 100644
index 63602ea4c..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/ExplainController.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-public class ExplainController extends NutchController {
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
- NutchBean bean = locator.getNutchBean();
-
- Hit hit = new Hit(Integer.parseInt(request.getParameter("idx")), Integer
- .parseInt(request.getParameter("id")));
- HitDetails details = bean.getDetails(hit);
- Query query = Query.parse(request.getParameter("query"), locator
- .getConfiguration());
-
- // put explanation and hitDetails into request so view can access them
- request.setAttribute("explanation", bean.getExplanation(query, hit));
- request.setAttribute("hitDetails", details.toHtml());
- request.setAttribute("query", query);
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/I18NPageController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/I18NPageController.java
deleted file mode 100644
index 61911cf51..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/I18NPageController.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Locale;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * This controller can be used in pages that require displaying of localized
- * content. In nutch this means help etc. pages.
- */
-public class I18NPageController extends NutchController {
-
- protected HashMap cached = new HashMap();
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
-
- // get base page from tiles context
- String baseName = (String) tileContext.getAttribute("basePage");
-
- // get arequest attribute name (where content will be put)
- // from tiles context
- String attrName = (String) tileContext.getAttribute("attrName");
-
- // if not available use default
- if (attrName == null) {
- attrName = "content";
- }
-
- // get users preferred locale
- Locale locale = locator.getLocale();
-
- // see if we have a cached content available
- StringBuffer content = (StringBuffer) cached.get(baseName + locale);
-
- // not available, try to read from file
- // XXX this prevents plugins to provide content
- if (content == null) {
- content = new StringBuffer();
- List suffixes = calculateSuffixes(locale);
-
- if (!suffixes.contains(servletContext
- .getInitParameter("javax.servlet.jsp.jstl.fmt.fallbackLocale"))) {
- suffixes.add(servletContext
- .getInitParameter("javax.servlet.jsp.jstl.fmt.fallbackLocale"));
- }
-
- Iterator iterator = suffixes.iterator();
-
- while (iterator.hasNext()) {
- String postfix = (String) iterator.next();
- String name = concatPostfix(baseName, postfix);
-
- InputStream is = servletContext.getResourceAsStream(name);
- if (is != null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
-
- String line;
- while ((line = br.readLine()) != null) {
- content.append(line).append("\n");
- }
- br.close();
- is.close();
- break;
- }
- }
-
- // put in cache for faster retrieval later
- cached.put(baseName + locale, content);
-
- }
- request.setAttribute(attrName, content.toString());
- }
-
- /**
- * Calculate the suffixes based on the locale.
- *
- * @param locale
- * the locale
- *
- * This method is borrowed from I18NFactorySet.java wich is part of tiles
- * (struts)
- *
- */
- private List calculateSuffixes(Locale locale) {
-
- List suffixes = new ArrayList(3);
- String language = locale.getLanguage();
- String country = locale.getCountry();
- String variant = locale.getVariant();
-
- StringBuffer suffix = new StringBuffer();
- // suffix.append('_');
- suffix.append(language);
- if (language.length() > 0) {
- suffixes.add(suffix.toString());
- }
-
- suffix.append('_');
- suffix.append(country);
- if (country.length() > 0) {
- suffixes.add(suffix.toString());
- }
-
- suffix.append('_');
- suffix.append(variant);
- if (variant.length() > 0) {
- suffixes.add(suffix.toString());
- }
-
- return suffixes;
- }
-
- /**
- * Concat postfix to the name. Take care of existing filename extension.
- * Transform the given name "name.ext" to have "name" + "postfix" + "ext". If
- * there is no ext, return "name" + "postfix".
- *
- * @param name
- * Filename.
- * @param postfix
- * Postfix to add.
- * @return Concatenated filename.
- *
- * This method is borrowed from I18NFactorySet.java wich is part of tiles
- * (struts)
- */
- private String concatPostfix(String name, String postfix) {
- if (postfix == null) {
- return name;
- }
- return "/" + postfix + name;
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/NutchController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/NutchController.java
deleted file mode 100644
index 26e9624ea..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/NutchController.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.nutch.util.LogUtil;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.ServletContextServiceLocator;
-import org.apache.nutch.webapp.common.WebappInstanceServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-import org.apache.struts.tiles.Controller;
-
-/**
- * Base class for nutch Tiles controllers.
- */
-public abstract class NutchController implements Controller {
-
- public static final Log LOG = LogFactory.getLog(NutchController.class);
-
- public final void execute(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- request.setCharacterEncoding("UTF-8");
-
- try {
- nutchPerform(tileContext, request, response, servletContext);
- } catch (Exception e) {
- LOG.info("Exception occured while executing nutch controller:");
- e.printStackTrace(LogUtil.getInfoStream(LOG));
- }
- }
-
- /**
- * Nutch controllers overwrite this method.
- *
- * @param tileContext
- * @param request
- * @param response
- * @param servletContext
- * @throws ServletException
- * @throws IOException
- */
- public abstract void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException;
-
- /**
- * Get Active service locator from request or create on if none exists.
- *
- * @param request
- * @return
- */
- protected ServiceLocator getServiceLocator(HttpServletRequest request) {
- return WebappInstanceServiceLocator.getFrom(request);
- }
-
- /**
- * Log request attributes. used for debugging
- *
- * @param request
- */
- void logRequestAttributes(HttpServletRequest request) {
- Enumeration e = request.getAttributeNames();
-
- while (e.hasMoreElements()) {
- String name = (String) e.nextElement();
- LOG.info("request attrs:" + name + " = " + request.getAttribute(name));
- }
- }
-
- /**
- * Log tiles context. used for debugging
- *
- * @param context
- */
- void logComponentContext(ComponentContext context) {
- Iterator i = context.getAttributeNames();
-
- while (i.hasNext()) {
- String name = (String) i.next();
- LOG.info("context attrs:" + name + " = " + context.getAttribute(name));
- }
- }
-
- public void perform(ComponentContext tileContext, HttpServletRequest request,
- HttpServletResponse response, ServletContext servletContext)
- throws ServletException, IOException {
- execute(tileContext, request, response, servletContext);
- }
-
- /**
- * Get servlet context service locator, this one cannot access request
- * specific information as preferences etc.
- *
- * @param servletContext
- * @return
- */
- public ServiceLocator getServiceLocator(ServletContext servletContext){
- return ServletContextServiceLocator.getInstance(servletContext);
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/PreferencesController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/PreferencesController.java
deleted file mode 100644
index 19df88d2d..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/PreferencesController.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.webapp.common.Preferences;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * Simple controller for preferences page.
- */
-public class PreferencesController extends NutchController {
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext) throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
-
- if (tileContext.getAttribute("action").equals("save")) {
- LOG.info("save");
- Preferences p = Preferences.parse(request.getQueryString(), "&", "=");
- LOG.info("setting cookie");
- Preferences.setPreferencesCookie(request, response, p);
- LOG.info("setting attribute");
- request.setAttribute("preferences", p);
- } else {
- LOG.info("view");
- request.setAttribute("preferences", locator.getPreferences());
- }
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java
deleted file mode 100644
index 0328b8d8b..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.webapp.common.Search;
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.struts.tiles.ComponentContext;
-
-/**
- * This is the main controller of nutch search application.
- */
-public class SearchController extends NutchController {
-
- public void nutchPerform(ComponentContext tileContext,
- HttpServletRequest request, HttpServletResponse response,
- ServletContext servletContext)
- throws ServletException, IOException {
-
- ServiceLocator locator = getServiceLocator(request);
-
- Search search = locator.getSearch();
- search.launchSearch();
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PostSearchExtensionPoint.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PostSearchExtensionPoint.java
deleted file mode 100644
index 0db770782..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PostSearchExtensionPoint.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.extension;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-
-/**
- * Plugins extending this extension point are run after the actual
- * search.
- */
-public interface PostSearchExtensionPoint {
-
- public static final String X_POINT_ID=PostSearchExtensionPoint.class.getName();
-
- void doPostSearch(ServiceLocator locator);
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PreSearchExtensionPoint.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PreSearchExtensionPoint.java
deleted file mode 100644
index d02add86f..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/PreSearchExtensionPoint.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.extension;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-
-/**
- * Plugins extending this extension point are run before the actual
- * search.
- */
-public interface PreSearchExtensionPoint {
-
- public static final String X_POINT_ID=PreSearchExtensionPoint.class.getName();
-
- void doPreSearch(ServiceLocator locator);
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/SearchExtensionPoint.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/SearchExtensionPoint.java
deleted file mode 100644
index 3c25605ad..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/SearchExtensionPoint.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.extension;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-
-/**
- * Plugins extending this interface can provide logic that
- * is run in parallel with the nutch search.
- */
-public interface SearchExtensionPoint {
-
- public static final String X_POINT_ID=SearchExtensionPoint.class.getName();
-
- void doSearch(ServiceLocator locator);
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/UIExtensionPoint.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/UIExtensionPoint.java
deleted file mode 100644
index ba2f2e690..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/extension/UIExtensionPoint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.extension;
-
-/**
- * Plugins implementing UIExtensionPoint can provide
- * extensions web ui in form of layout components
- * or ui logic.
- */
-public interface UIExtensionPoint {
-
- /** The name of the extension point. */
- final static String X_POINT_ID = UIExtensionPoint.class.getName();
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/CachedServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/CachedServlet.java
deleted file mode 100644
index ff320e8e4..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/CachedServlet.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.nutch.webapp.servlet;
-
-import org.apache.nutch.metadata.Metadata;
-import org.apache.nutch.net.protocols.Response;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * A servlet that serves raw Content of any mime type.
- *
- * If it fails with java.lang.OutOfMemoryError, you may have to increase heap
- * size when starting container, such as -Xms1024M -Xmx1024M
- *
- * @author John Xing
- */
-public class CachedServlet extends NutchHttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- public void init(ServletConfig conf) throws ServletException {
- super.init(conf);
- }
-
- public void destroy() {
- // maybe clean bean?
- // nothing now
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws IOException {
-
- NutchBean.LOG.info("request from " + request.getRemoteAddr());
-
- Hit hit = new Hit(Integer.parseInt(request.getParameter("idx")), Integer
- .parseInt(request.getParameter("id")));
- HitDetails details = getServiceLocator().getNutchBean().getDetails(hit);
-
- // raw bytes
- byte[] bytes = getServiceLocator().getNutchBean().getContent(details);
-
- // pass all original headers? only these for now.
- Metadata metadata = getServiceLocator().getNutchBean()
- .getParseData(details).getContentMeta();
- String contentType = metadata.get(Response.CONTENT_TYPE);
- // String lastModified = metadata.get(Metadata.LAST_MODIFIED);
- // String contentLength = metadata.get(Metadata.CONTENT_LENGTH);
- // better use this, since it may have been truncated during fetch
- // or give warning if they don't match?
- int contentLength = bytes.length;
-
- // response
- response.setContentType(contentType);
- response.setContentLength(contentLength);
-
- OutputStream os = response.getOutputStream();
- os.write(bytes);
- // need this or flush more frequently?
- // os.flush();
- os.close();
-
- return;
- }
-
- public void doPost(HttpServletRequest request, HttpServletResponse response)
- throws IOException {
- doGet(request, response);
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.java
deleted file mode 100644
index 6d7f9d410..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.servlet;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.plugin.Extension;
-import org.apache.nutch.plugin.ExtensionPoint;
-import org.apache.nutch.webapp.common.WebAppModule;
-import org.apache.nutch.webapp.extension.UIExtensionPoint;
-
-/**
- * This Servlet is responsible for dispatching requests to jsp resources from
- * plugins.
- */
-public class JspDispatcherServlet extends NutchHttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- HashMap allMappings = new HashMap();
-
- public void init(ServletConfig conf) throws ServletException {
- super.init(conf);
-
- // TODO should perhaps first try handle core definitions
-
- // process extensions
- ExtensionPoint point = getServiceLocator().getPluginRepository()
- .getExtensionPoint(UIExtensionPoint.X_POINT_ID);
-
- if (point != null) {
-
- Extension[] extensions = point.getExtensions();
-
- for (int i = 0; i < extensions.length; i++) {
- Extension extension = extensions[i];
-
- WebAppModule module = new WebAppModule(extension.getDescriptor()
- .getClassLoader(), conf);
- Iterator iterator = module.getPaths().iterator();
-
- while (iterator.hasNext()) {
- String path = (String) iterator.next();
- allMappings.put(path, module);
- }
- }
- }
- }
-
- /**
- * Process request to jsp inside plugin (jsps must be precompiled)
- *
- */
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- //get jsp include path_info from request object
- String relPath=(String)request.getAttribute("javax.servlet.include.path_info");
-
- if (allMappings.containsKey(relPath)) {
- WebAppModule module=(WebAppModule)allMappings.get(relPath);
- module.dispatch(relPath, request,response);
- }
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java
deleted file mode 100644
index 0c39c8773..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.servlet;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.ServletContextServiceLocator;
-
-/**
- * Abstract base Servlet for nutch.
- */
-public abstract class NutchHttpServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- private ServiceLocator locator;
-
- public void init(final ServletConfig servletConfig) throws ServletException {
- super.init(servletConfig);
- locator = ServletContextServiceLocator.getInstance(getServletContext());
- }
-
- /**
- * Return context relative path.
- *
- * @return
- */
- public String getContextRelativePath(final HttpServletRequest request) {
- return request.getRequestURI().substring(request.getContextPath().length());
- }
-
- /**
- * Removes the first part of path String and returns new String if there is no
- * path available return null.
- *
- * @param path
- * original path
- * @return
- */
- public String getMappingRelativePath(final String path) {
-
- String relPath = null;
-
- if (path.indexOf("/", (path.startsWith("/") ? 1 : 0)) != -1) {
- relPath = path.substring(path
- .indexOf('/', (path.startsWith("/") ? 1 : 0)));
- }
-
- return relPath;
- }
-
- /**
- * Get ServiceLocator instance
- *
- * @return
- */
- public ServiceLocator getServiceLocator() {
- return locator;
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/OpenSearchServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/OpenSearchServlet.java
deleted file mode 100644
index e23b48dec..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/OpenSearchServlet.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/**
- * 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.
- */
-
-package org.apache.nutch.webapp.servlet;
-
-import java.io.IOException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.nutch.searcher.Hit;
-import org.apache.nutch.searcher.HitDetails;
-import org.apache.nutch.searcher.Hits;
-import org.apache.nutch.searcher.NutchBean;
-import org.apache.nutch.searcher.Query;
-import org.apache.nutch.searcher.Summary;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Present search results using A9's OpenSearch extensions to RSS, plus a few
- * Nutch-specific extensions.
- */
-public class OpenSearchServlet extends NutchHttpServlet {
- private static final int DEFAULT_NUMBER_OF_HITS = 10;
-
- private static final long serialVersionUID = 1L;
-
- private static final Map NS_MAP = new HashMap();
-
- static {
- NS_MAP.put("opensearch", "http://a9.com/-/spec/opensearchrss/1.0/");
- NS_MAP.put("nutch", "http://www.nutch.org/opensearchrss/1.0/");
- }
-
- private static final Set SKIP_DETAILS = new HashSet();
- static {
- SKIP_DETAILS.add("url"); // redundant with RSS link
- SKIP_DETAILS.add("title"); // redundant with RSS title
- }
-
- public void init(ServletConfig conf) throws ServletException {
- super.init(conf);
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
-
- NutchBean.LOG.info("query request from " + request.getRemoteAddr());
-
- // get parameters from request
- request.setCharacterEncoding("UTF-8");
- String queryString = request.getParameter("query");
- if (queryString == null) {
- queryString = "";
- }
- String urlQuery = URLEncoder.encode(queryString, "UTF-8");
-
- int start = 0; // first hit to display
- String startString = request.getParameter("start");
- if (startString != null) {
- start = Integer.parseInt(startString);
- }
-
- int hitsPerPage = DEFAULT_NUMBER_OF_HITS; // number of hits to display
- String hitsString = request.getParameter("hitsPerPage");
- if (hitsString != null) {
- hitsPerPage = Integer.parseInt(hitsString);
- }
-
- String sort = request.getParameter("sort");
- boolean reverse = sort != null
- && "true".equals(request.getParameter("reverse"));
-
- // De-Duplicate handling. Look for duplicates field and for how many
- // duplicates per results to return. Default duplicates field is 'site'
- // and duplicates per results default is '2'.
- String dedupField = request.getParameter("dedupField");
- if (dedupField == null || dedupField.length() == 0) {
- dedupField = "site";
- }
- int hitsPerDup = 2;
- String hitsPerDupString = request.getParameter("hitsPerDup");
- if (hitsPerDupString != null && hitsPerDupString.length() > 0) {
- hitsPerDup = Integer.parseInt(hitsPerDupString);
- } else {
- // If 'hitsPerSite' present, use that value.
- String hitsPerSiteString = request.getParameter("hitsPerSite");
- if (hitsPerSiteString != null && hitsPerSiteString.length() > 0) {
- hitsPerDup = Integer.parseInt(hitsPerSiteString);
- }
- }
-
- // Make up query string for use later drawing the 'rss' logo.
- String params = "&hitsPerPage="
- + hitsPerPage
- + (sort == null ? "" : "&sort=" + sort
- + (reverse ? "&reverse=true" : "")
- + (dedupField == null ? "" : "&dedupField=" + dedupField));
-
- Query query = Query.parse(queryString, getServiceLocator()
- .getConfiguration());
- NutchBean.LOG.info("query: " + queryString);
-
- // execute the query
- Hits hits;
- try {
- hits = getServiceLocator().getNutchBean().search(query,
- start + hitsPerPage, hitsPerDup, dedupField, sort, reverse);
- } catch (IOException e) {
- NutchBean.LOG.warn("Search Error", e);
- hits = new Hits(0, new Hit[0]);
- }
-
- NutchBean.LOG.info("total hits: " + hits.getTotal());
-
- // generate xml results
- int end = (int) Math.min(hits.getLength(), start + hitsPerPage);
- int length = end - start;
-
- Hit[] show = hits.getHits(start, end - start);
- HitDetails[] details = getServiceLocator().getNutchBean().getDetails(show);
- Summary[] summaries = getServiceLocator().getNutchBean().getSummary(
- details, query);
-
- String requestUrl = request.getRequestURL().toString();
- String base = requestUrl.substring(0, requestUrl.lastIndexOf('/'));
-
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- Document doc = factory.newDocumentBuilder().newDocument();
-
- Element rss = addNode(doc, doc, "rss");
- addAttribute(doc, rss, "version", "2.0");
- addAttribute(doc, rss, "xmlns:opensearch", (String) NS_MAP
- .get("opensearch"));
- addAttribute(doc, rss, "xmlns:nutch", (String) NS_MAP.get("nutch"));
-
- Element channel = addNode(doc, rss, "channel");
-
- addNode(doc, channel, "title", "Nutch: " + queryString);
- addNode(doc, channel, "description", "Nutch search results for query: "
- + queryString);
- addNode(doc, channel, "link", base + "/search.jsp" + "?query=" + urlQuery
- + "&start=" + start + "&hitsPerDup=" + hitsPerDup + params);
-
- addNode(doc, channel, "opensearch", "totalResults", "" + hits.getTotal());
- addNode(doc, channel, "opensearch", "startIndex", "" + start);
- addNode(doc, channel, "opensearch", "itemsPerPage", "" + hitsPerPage);
-
- addNode(doc, channel, "nutch", "query", queryString);
-
- if ((hits.totalIsExact() && end < hits.getTotal()) // more hits to show
- || (!hits.totalIsExact() && (hits.getLength() > start + hitsPerPage))) {
- addNode(doc, channel, "nutch", "nextPage", requestUrl + "?query="
- + urlQuery + "&start=" + end + "&hitsPerDup=" + hitsPerDup + params);
- }
-
- if ((!hits.totalIsExact() && (hits.getLength() <= start + hitsPerPage))) {
- addNode(doc, channel, "nutch", "showAllHits", requestUrl + "?query="
- + urlQuery + "&hitsPerDup=" + 0 + params);
- }
-
- for (int i = 0; i < length; i++) {
- Hit hit = show[i];
- HitDetails detail = details[i];
- String title = detail.getValue("title");
- String url = detail.getValue("url");
- String id = "idx=" + hit.getIndexNo() + "&id=" + hit.getIndexDocNo();
-
- if (title == null || title.equals("")) {
- // use url for docs w/o title
- title = url;
- }
-
- Element item = addNode(doc, channel, "item");
-
- addNode(doc, item, "title", title);
- addNode(doc, item, "description", summaries[i].toString());
- addNode(doc, item, "link", url);
-
- addNode(doc, item, "nutch", "site", hit.getDedupValue());
-
- addNode(doc, item, "nutch", "cache", base + "/cached.do?" + id);
- addNode(doc, item, "nutch", "explain", base + "/explain.do?" + id
- + "&query=" + urlQuery);
-
- if (hit.moreFromDupExcluded()) {
- addNode(doc, item, "nutch", "moreFromSite", requestUrl
- + "?query="
- + URLEncoder.encode("site:" + hit.getDedupValue() + " "
- + queryString, "UTF-8") + "&hitsPerSite=" + 0 + params);
- }
-
- for (int j = 0; j < detail.getLength(); j++) { // add all from detail
- String field = detail.getField(j);
- if (!SKIP_DETAILS.contains(field)) {
- addNode(doc, item, "nutch", field, detail.getValue(j));
- }
- }
- }
-
- // dump DOM tree
-
- DOMSource source = new DOMSource(doc);
- TransformerFactory transFactory = TransformerFactory.newInstance();
- Transformer transformer = transFactory.newTransformer();
- transformer.setOutputProperty("indent", "yes");
- StreamResult result = new StreamResult(response.getOutputStream());
- response.setContentType("text/xml");
- transformer.transform(source, result);
-
- } catch (javax.xml.parsers.ParserConfigurationException e) {
- throw new ServletException(e);
- } catch (javax.xml.transform.TransformerException e) {
- throw new ServletException(e);
- }
-
- }
-
- private static Element addNode(Document doc, Node parent, String name) {
- Element child = doc.createElement(name);
- parent.appendChild(child);
- return child;
- }
-
- private static void addNode(Document doc, Node parent, String name,
- String text) {
- Element child = doc.createElement(name);
- child.appendChild(doc.createTextNode(text));
- parent.appendChild(child);
- }
-
- private static void addNode(Document doc, Node parent, String ns,
- String name, String text) {
- Element child = doc.createElementNS((String) NS_MAP.get(ns), ns + ":"
- + name);
- child.appendChild(doc.createTextNode(text));
- parent.appendChild(child);
- }
-
- private static void addAttribute(Document doc, Element node, String name,
- String value) {
- Attr attribute = doc.createAttribute(name);
- attribute.setValue(value);
- node.getAttributes().setNamedItem(attribute);
- }
-
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.java
deleted file mode 100644
index 6e203e117..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.servlet;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.nutch.plugin.PluginDescriptor;
-
-/**
- * Simple Servlet that serves resources from plugins.
- *
- * Plugin must put resources to be exposed into path /resources/ for example
- * resource /resources/possible/sub/folder/resource.jpg will then be available
- * in location <contextPath>/resources/<plugin_id>/possible/sub/folder/resource.jpg
- *
- */
-public class ResourceServlet extends NutchHttpServlet {
-
- private static final String PATH = "/resources/";
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Extract plugin id from path.
- *
- * @param path
- * @return
- */
- private String getPluginId(final String path) {
- String pluginid = null;
-
- if (path != null && path.length() >= PATH.length()) {
- String stripped = path.substring(PATH.length());
- if (stripped.indexOf("/") != -1) {
- pluginid = stripped.substring(0, stripped.indexOf("/"));
- }
- }
- return pluginid;
- }
-
- /**
- * Extract plugin relative path from path.
- *
- * @param path
- * @return
- */
- private String getPluginRelativePath(final String path) {
- String resource = path.substring(PATH.length() + getPluginId(path).length()
- + 1);
- return resource;
- }
-
- /**
- * Process a request for resource inside plugin
- */
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- PluginDescriptor descriptor = null;
- String resPath = null;
-
- String path = getContextRelativePath(request);
- String id = getPluginId(path);
- if (id != null) {
- resPath = PATH.substring(1) + getPluginRelativePath(path);
-
- descriptor = getServiceLocator().getPluginRepository()
- .getPluginDescriptor(id);
-
- if (descriptor != null) {
-
- if (descriptor != null) {
- InputStream is = descriptor.getClassLoader().getResourceAsStream(
- resPath);
- if (is != null) {
- // buffer for content
- byte[] buffer = new byte[response.getBufferSize()];
-
- int len;
- String contentType = getServletContext().getMimeType(path)
- .toString();
-
- response.setContentType(contentType);
- while ((len = is.read(buffer)) != -1) {
- // copy to outputStream
- response.getOutputStream().write(buffer, 0, len);
- }
- is.close();
- response.flushBuffer();
- return;
- }
- }
- }
- }
-
- //of no resource was found dispay error
- response.setContentType("text/plain");
- PrintWriter pw = response.getWriter();
- pw.println("type:" + getServletContext().getMimeType(path));
- pw.println("path:" + path);
- pw.println("plugin-id:" + id);
- pw.println("plugin:" + descriptor);
- pw.println("plugin relative path:" + resPath);
- return;
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java
deleted file mode 100644
index 113ee5c30..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.tiles;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.nutch.plugin.Extension;
-import org.apache.nutch.plugin.ExtensionPoint;
-import org.apache.nutch.util.LogUtil;
-import org.apache.nutch.webapp.common.PluginResourceLoader;
-import org.apache.nutch.webapp.common.ServletContextServiceLocator;
-import org.apache.nutch.webapp.common.Startable;
-import org.apache.nutch.webapp.extension.UIExtensionPoint;
-import org.apache.struts.tiles.ComponentDefinition;
-import org.apache.struts.tiles.Controller;
-import org.apache.struts.tiles.DefinitionsFactory;
-import org.apache.struts.tiles.DefinitionsFactoryConfig;
-import org.apache.struts.tiles.DefinitionsFactoryException;
-import org.apache.struts.tiles.NoSuchDefinitionException;
-import org.apache.struts.tiles.xmlDefinition.XmlDefinition;
-import org.apache.struts.tiles.xmlDefinition.XmlDefinitionsSet;
-import org.apache.struts.tiles.xmlDefinition.XmlParser;
-
-import org.xml.sax.SAXException;
-
-/**
- * Tiles DefinitionsFactory that can be extended by activated plugins.
- */
-public class ExtendableDefinitionsFactory implements DefinitionsFactory {
-
- private static final long serialVersionUID = 1L;
-
- public static final Log LOG = LogFactory
- .getLog(ExtendableDefinitionsFactory.class);
-
- DefinitionsFactoryConfig config;
-
- protected transient XmlParser xmlParser = new XmlParser();
-
- Map definitions;
-
- private ServletContext servletContext;
-
- HashMap locales = new HashMap();
-
- public ComponentDefinition getDefinition(String name, ServletRequest request,
- ServletContext servletContext) throws NoSuchDefinitionException,
- DefinitionsFactoryException {
- return (ComponentDefinition) definitions.get(name);
- }
-
- public void putDefinition(ComponentDefinition definition) {
- LOG.info("putting definition:" + definition.getName());
- definitions.put(definition.getName(), definition);
- try {
- definition.getOrCreateController();
- } catch (Exception e) {
- e.printStackTrace(LogUtil.getDebugStream(LOG));
- }
- }
-
- protected XmlDefinitionsSet getDefinitions() {
-
- LOG.debug("getDefinitions()");
-
- XmlDefinitionsSet definitions = new XmlDefinitionsSet();
- //
- // core definitions
- //
- String configFiles = config.getDefinitionConfigFiles();
- LOG.info("config files:" + configFiles);
- String[] files = configFiles.split(",");
- for (int i = 0; i < files.length; i++) {
- LOG.info("Trying to load " + files[i]);
- InputStream input = servletContext.getResourceAsStream(files[i]);
-
- LOG.info("Stream: " + input);
-
- if (input != null) {
- parseXMLDefinitionSet(input, definitions, files[i], "nutch-core");
- } else {
- LOG.info("Cannot find static " + files[i]);
- }
- }
-
- //
- // plugged implementations can override defaults if they wish
- //
- ExtensionPoint point = ServletContextServiceLocator.getInstance(
- servletContext).getPluginRepository().getExtensionPoint(
- UIExtensionPoint.X_POINT_ID);
-
- if (point != null) {
-
- Extension[] extensions = point.getExtensions();
-
- LOG.info("There are " + extensions.length
- + " extensions available for UI");
-
- for (int i = 0; i < extensions.length; i++) {
- LOG.info("Adding definitions from "
- + extensions[i].getDescriptor().getName());
- Extension extension = extensions[i];
- addToSet(definitions, extension);
- }
- } else {
- LOG.info("Cannot find extension point '" + UIExtensionPoint.X_POINT_ID
- + "'");
- }
-
- try {
- definitions.resolveInheritances();
- } catch (NoSuchDefinitionException e) {
- LOG.info("Error resolving:" + e);
- }
- return definitions;
- }
-
- protected void addToSet(XmlDefinitionsSet definitions, Extension extension) {
-
- InputStream is = extension.getDescriptor().getClassLoader()
- .getResourceAsStream("tiles-defs.xml");
- if (is == null) {
- LOG.info("Plugin " + extension.getId()
- + " did not contain tiles-defs.xml");
- return;
- }
- parseXMLDefinitionSet(is, definitions, "Plugin " + extension.getId()
- + " : tiles-defs.xml", extension.getId());
- try {
- is.close();
- } catch (Exception e) {
- e.printStackTrace(LogUtil.getDebugStream(LOG));
- }
- }
-
- protected void parseXMLDefinitionSet(InputStream input,
- XmlDefinitionsSet definitions, String info, String pluginid) {
- XmlDefinitionsSet newSet = new XmlDefinitionsSet();
-
- try {
- xmlParser.parse(input, newSet);
- } catch (IOException e) {
- LOG.info("IOException (" + e.getMessage() + ") parsing definitions "
- + info);
- e.printStackTrace();
- } catch (SAXException e) {
- LOG.info("SAXException (" + e.getMessage() + ") parsing definitions "
- + info);
- e.printStackTrace();
- }
-
- // LOG.info("Definitions:" + definitions.getDefinitions().size() + " : "
- // + definitions.toString());
-
- copySet(definitions, newSet);
-
- }
-
- private void copySet(XmlDefinitionsSet definitions2, XmlDefinitionsSet newSet) {
-
- Iterator iterator = newSet.getDefinitions().keySet().iterator();
-
- while (iterator.hasNext()) {
- String key = (String) iterator.next();
- LOG.info("adding: " + key);
- XmlDefinition value = newSet.getDefinition(key);
- definitions2.putDefinition(value);
- }
- }
-
- public void init(DefinitionsFactoryConfig config,
- ServletContext servletContext) throws DefinitionsFactoryException {
- this.config = config;
-
- this.servletContext = servletContext;
-
- xmlParser.setValidating(config.getParserValidate());
- XmlDefinitionsSet definitions = getDefinitions();
- ClassLoader current = Thread.currentThread().getContextClassLoader();
-
- PluginResourceLoader loader = ServletContextServiceLocator.getInstance(
- servletContext).getPluginResourceLoader(current);
-
- Thread.currentThread().setContextClassLoader(loader);
- initDefinitions(definitions);
- Thread.currentThread().setContextClassLoader(current);
-
- this.definitions = definitions.getDefinitions();
- }
-
- private void initDefinitions(XmlDefinitionsSet definitions) {
- Iterator i = definitions.getDefinitions().keySet().iterator();
-
- while (i.hasNext()) {
- String key = (String) i.next();
- if (LOG.isDebugEnabled()) {
- LOG.debug("Initializing controller: " + key);
- }
- XmlDefinition d = definitions.getDefinition(key);
- try {
- Controller controller = d.getOrCreateController();
- if (controller != null) {
- // check if it is implementing Startable, if so execute lifecycle
- // method
- if (controller instanceof Startable) {
- ((Startable) controller).start(servletContext);
- }
- }
- } catch (Exception e) {
- e.printStackTrace(LogUtil.getDebugStream(LOG));
- }
- }
- }
-
- public void destroy() {
- LOG.info("destroy()");
- }
-
- public void setConfig(DefinitionsFactoryConfig config,
- ServletContext servletContext) throws DefinitionsFactoryException {
- this.config = config;
- this.servletContext = servletContext;
- }
-
- public DefinitionsFactoryConfig getConfig() {
- return config;
- }
-}
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/NutchRequestProcessor.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/NutchRequestProcessor.java
deleted file mode 100644
index 986cbee95..000000000
--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/NutchRequestProcessor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.tiles;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.jstl.core.Config;
-
-import org.apache.nutch.webapp.common.ServiceLocator;
-import org.apache.nutch.webapp.common.WebappInstanceServiceLocator;
-import org.apache.struts.tiles.TilesRequestProcessor;
-
-public class NutchRequestProcessor extends TilesRequestProcessor {
-
-
- /**
- * Process locale, override the default functionality and prevent
- * session from being created.
- */
- protected void processLocale(HttpServletRequest request,
- HttpServletResponse response) {
-
- ServiceLocator locator = WebappInstanceServiceLocator.getFrom(request);
-
- if (locator == null) {
- locator = new WebappInstanceServiceLocator(request, getServletContext());
- WebappInstanceServiceLocator.register(request,
- (WebappInstanceServiceLocator) locator);
- }
-
- Config.set(request, Config.FMT_LOCALE, locator.getLocale());
- }
-}
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources.properties
deleted file mode 100644
index bd8005794..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources.properties
+++ /dev/null
@@ -1,118 +0,0 @@
-# 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.
-
-#This is the default resource file for nutch ui localization.
-#If you create a new localized version of resources, please use
-#this as the base
-
-#language code used in html lang attribute
-lang=en
-
-#anchors page title
-anchors.title=anchors
-anchors.anchors=incoming anchor text:
-anchors.page=page: <a href="{0}">{0}</a>
-
-#cached page title
-cached.title=nutch cache
-cached.page=page: <a href="{0}">{0}</a>
-cached.noContent=Sorry, no content is cached for this page.
-cached.notHtml=The cached content has mime type {0}, click this <a href="servlet/cached?{1}">link</a> to download it directly.
-
-#explain page title
-explain.title=score explanation
-explain.page=page
-explain.scoreForQuery=score for query: <tt>{0}</tt>
-
-#search page title
-search.title=search results
-
-#text in search button
-search.search=Search
-
-#text wich describes the search results (nn-nn out of nn)
-search.hits=Results <b>{0}-{1}</b> of about <b>{2}</b> total matching pages for <b>{3}</b>.
-
-#text displayed when there are no reults
-search.noResults=Your search - <b>{0}</b> - did not match any documents.
-
-#cached page link text
-search.cached=cached
-
-#explain page link text
-search.explain=explain
-
-#anchors page link text
-search.anchors=anchors
-
-#text in "next page" button
-search.next=next page
-
-#link text of
-search.moreFrom=more from
-search.showAllHits=show all hits
-
-search.clustering=clustering
-search.viewAsText=View as Plain Text
-
-#search help link text
-search.help=help
-
-#index more web ui localization
-search.contentType=[<span class="contentType">{0}</span>]
-search.contentLength=({0} bytes)
-search.lastModified={0}
-
-#view as text page title
-text.title=plain text cache
-text.note=This is the plain text version of the file: <a href="{0}">{0}</a>.
-text.noText=<i>Sorry, no plain text version is available.</i>
-
-#title of help page
-help.title=help
-
-#title of preferences page
-preferences.title=preferences
-
-#interface languages
-preferences.ui.language=Interface language
-preferences.ui.language.info=
-ca=Catalan
-de=German
-en=English
-es=Spanish
-fi=Finnish
-fr=French
-hu=Hungarian
-ms=Malay
-nl=Dutch
-pl=Polish
-pt=Portuguese
-sh=Serbo-Croatian
-sr=Serbian
-sv=Swedish
-th=Thai
-zh=Chinese
-
-#number of results
-preferences.numResults=Number of Results
-preferences.numResults.info=
-
-#text on save button
-preferences.submit=Save and return to search
-
-#subcollection
-subcollection.info=Limit your search to:
-subcollection.none=Do not limit
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_ca.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_ca.properties
deleted file mode 100644
index 68f7028c2..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_ca.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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.
-
-search.title = resultats de cerca
-search.search = Cerca
-search.hits = Coincid�ncies <b>{0}-{1}</b> (d'un total de {2} documents coincidents):
-search.cached = en mem�ria
-search.explain = explicaci�
-search.anchors = �ncores
-search.next = Seg�ent
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_de.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_de.properties
deleted file mode 100644
index 2e97bb01e..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_de.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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.
-
-lang=de
-anchors.title = Verweise
-anchors.anchors = Herzeigende Link-Texte:
-anchors.page = Seite: <a href="{0}">{0}</a>
-cached.title = Nutch Cache
-cached.page = Seite: <a href="{0}">{0}</a>
-cached.noContent = <i>Leider ist diese Seite nicht im Cache gespeichert.</i>
-explain.title = Seiteninformationen &amp; Rankingberechnung
-explain.page = Gespeicherte Seiteninformationen
-explain.scoreForQuery = Rankingberechnung f&uuml;r die Anfrage: <tt>{0}</tt>
-search.title = Suchergebnisse
-search.search = Suche
-search.hits = Treffer <b>{0}-{1}</b> (von insgesammt {2} gefundenen Seiten):
-search.cached = Im Cache
-search.explain = Erkl&auml;rung
-search.anchors = Referenzen
-search.next = Weiter
-search.clustering = Clustern
-search.viewAsText = HTML-Version
-search.moreFrom = Mehr von
-search.showAllHits = Alle Treffer anzeigen
-text.title = Nutch Text Cache
-text.note = Dies ist die Text-Version von: <a href="{0}">{0}</a>.
-text.noText = <i>Leider ist keine Text-Version verf&uuml;gbar.</i>
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_en.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_en.properties
deleted file mode 100644
index 8b1cbbec3..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_en.properties
+++ /dev/null
@@ -1,114 +0,0 @@
-# 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.
-
-#This is the default resource file for nutch ui localization.
-#If you create a new localized version of resources, please use
-#this as the base
-
-#language code used in html lang attribute
-lang=en
-
-#anchors page title
-anchors.title=anchors
-anchors.anchors=incoming anchor text:
-anchors.page=page: <a href="{0}">{0}</a>
-
-#cached page title
-cached.title=nutch cache
-cached.page=page: <a href="{0}">{0}</a>
-cached.noContent=Sorry, no content is cached for this page.
-cached.notHtml=The cached content has mime type {0}, click this <a href="servlet/cached?{1}">link</a> to download it directly.
-
-#explain page title
-explain.title=score explanation
-explain.page=page
-explain.scoreForQuery=score for query: <tt>{0}</tt>
-
-#search page title
-search.title=search results
-
-#text in search button
-search.search=Search
-
-#text wich describes the search results (nn-nn out of nn)
-search.hits=Results <b>{0}-{1}</b> of about <b>{2}</b> total matching pages for <b>{3}</b>.
-
-#text displayed when there are no reults
-search.noResults=Your search - <b>{0}</b> - did not match any documents.
-
-#cached page link text
-search.cached=cached
-
-#explain page link text
-search.explain=explain
-
-#anchors page link text
-search.anchors=anchors
-
-#text in "next page" button
-search.next=next page
-
-#link text of
-search.moreFrom=more from
-search.showAllHits=show all hits
-
-search.clustering=clustering
-search.viewAsText=View as Plain Text
-
-#search help link text
-search.help=help
-
-#index more web ui localization
-search.contentType=[<span class="contentType">{0}</span>]
-search.contentLength=({0} bytes)
-search.lastModified={0}
-
-#view as text page title
-text.title=plain text cache
-text.note=This is the plain text version of the file: <a href="{0}">{0}</a>.
-text.noText=<i>Sorry, no plain text version is available.</i>
-
-#title of help page
-help.title=help
-
-#title of preferences page
-preferences.title=preferences
-
-#interface languages
-preferences.ui.language=Interface language
-preferences.ui.language.info=
-ca=Catalan
-de=German
-en=English
-es=Spanish
-fi=Finnish
-fr=French
-hu=Hungarian
-ms=Malay
-nl=Dutch
-pl=Polish
-pt=Portuguese
-sh=Serbo-Croatian
-sr=Serbian
-sv=Swedish
-th=Thai
-zh=Chinese
-
-#number of results
-preferences.numResults=Number of Results
-preferences.numResults.info=
-
-#text on save button
-preferences.submit=Save and return to search
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_es.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_es.properties
deleted file mode 100644
index cd02b76d7..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_es.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=es
-search.title = resultados de la búsqueda
-search.search = Buscar
-search.hits = Resultados <b>{0}-{1}</b> (de un total de {2} documentos):
-search.cached = en caché
-search.explain = explicar
-search.anchors = anchors
-search.next = Siguiente
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_fi.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_fi.properties
deleted file mode 100644
index cebd8fb98..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_fi.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-lang=fi
-anchors.title=linkit
-anchors.anchors=sivulle johtavien linkkien tekstit:
-anchors.page=sivu: <a href="{0}">{0}</a>
-cached.title=v\u00E4limuisti
-cached.page=sivu: <a href="{0}">{0}</a>
-cached.noContent=<i>Sivua ei l�ydy v\u00E4limuistista.</i>
-explain.title=pisteytyksen perusteet
-explain.page=sivu
-explain.scoreForQuery=pisteytys haulle: <tt>{0}</tt>
-search.title=Hakutulokset
-search.search=Hae
-search.hits=Tulokset <b>{0}-{1}</b> (kaikkiaan {2} sopivasta dokumentista):
-search.cached=v\u00E4limuistissa
-search.explain=selit\u00E4
-search.anchors=linkit
-search.next=Seuraava
-search.help=apua
-search.clustering=ryv\u00e4stys
-search.moreFrom=lis\u00e4\u00e4 osumia kohteesta
-search.showAllHits=n\u00e4yt\u00e4 kaikki osumat
-search.viewAsText=N\u00e4yt\u00e4 sivun tekstiversio
-text.title=v\u00E4limuistin tekstiversio
-text.note=T�m� on sivun <a href="{0}">{0}</a> v\u00E4limuistin tekstiversio.
-text.noText=<i>Sivusta ei ole saatavilla tekstiversiota.</i>
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_fr.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_fr.properties
deleted file mode 100644
index 9a90a3d5e..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_fr.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=fr
-search.title = R�sultats de recherche
-search.search = Recherche
-search.hits = R�sultats <b>{0}-{1}</b> (sur un total de {2}):
-search.cached = En cache
-search.explain = Explications
-search.anchors = Ancres
-search.next = Suivant
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_hu.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_hu.properties
deleted file mode 100644
index 7748f4106..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_hu.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=hu
-search.title = keres�s eredm�nye
-search.search = Keres�s
-search.hits = <b>{0}-{1}</b>. tal�lat a {2} k�z�l:
-search.cached = T�rolt
-search.explain = Magyar�zat
-search.anchors = Kapcsol�d�s
-search.next = K�vetkez�
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_ms.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_ms.properties
deleted file mode 100644
index 0aa804db0..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_ms.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=ms
-search.title = hasil carian
-search.carian = Carian
-search.bilangan hits = Bilangan Hits &lt;b&gt;{0}-{1}&lt;/b&gt; (daripada {2} jumlah dokumen bersesuaian):
-search.tampungan = tampungan
-search.penerangan = penerangan
-search.penunjuk = penunjuk
-search.selepas = Selepas
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_nl.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_nl.properties
deleted file mode 100644
index 1716c2891..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_nl.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=nl
-search.title = zoekresultaten
-search.search = Zoek
-search.hits = Treffers <b>{0}-{1}</b> (van in totaal {2} gevonden documenten):
-search.cached = opgeslagen
-search.explain = uitleg
-search.anchors = verwijzers
-search.next = Volgende
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_pl.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_pl.properties
deleted file mode 100644
index a7a5cd290..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_pl.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# 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.
-
-lang=pl
-anchors.title = odno\u015bniki
-anchors.anchors = tekst przychodz\u0105cego odno\u015bnika:
-anchors.page = strona: <a href="{0}">{0}</a>
-cached.title = kopia nutch-a
-cached.page = strona: <a href="{0}">{0}</a>
-cached.noContent = <i>Przepraszamy, brak kopii tej strony.</i>
-explain.title = wyja\u015bnienie wyniku
-explain.page = strona
-explain.scoreForQuery = wynik dla zapytania: <tt>{0}</tt>
-search.title = wyniki wyszukiwania
-search.search = Szukaj
-search.hits = Wyniki <b>{0}-{1}</b> (z oko\u0142o {2} pasuj\u0105cych dokument\u00f3w):
-search.cached = kopia
-search.explain = wyja\u015bnij
-search.anchors = odno\u015bniki
-search.next = Nast\u0119pna strona
-search.moreFrom = Wi\u0119cej z
-search.showAllHits = Poka\u017c wszystkie wyniki
-search.clustering = grupowanie
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_pt.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_pt.properties
deleted file mode 100644
index 7c9c9a4d1..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_pt.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=pt
-search.title = resultados da pesquisa
-search.search = Localizar
-search.hits = Resultados <b>{0}-{1}</b> (de um total de {2} documentos):
-search.cached = arquivado
-search.explain = explica��o
-search.anchors = semelhantes
-search.next = Pr�ximo
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sh.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_sh.properties
deleted file mode 100644
index 0b8d713c7..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sh.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-
-lang=sh
-search.title = rezulati pretra\u017eivanja
-search.help = pomo\u0107
-search.search = Pretra\u017ei
-search.hits = Rezultati <b>{0}-{1}</b> (od oko {2} ukupno prona\u0111enih dokumenata):
-search.cached = ke\u0161irano
-search.explain = objasni
-search.anchors = veze
-search.next = slede\u0107a stranica
-search.moreFrom = ostali rezultati sa
-search.showAllHits = prika\u017ei sve rezultate
-search.clustering = clustering
-search.viewAsText = Prika\u017ei samo tekst
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sr.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_sr.properties
deleted file mode 100644
index 700d44cf0..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sr.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-
-lang=sr
-search.title = \u0440\u0435\u0437\u0443\u043B\u0430\u0442\u0438 \u043F\u0440\u0435\u0442\u0440\u0430\u0436\u0438\u0432\u0430\u045A\u0430
-search.help = \u043F\u043E\u043C\u043E\u045B
-search.search = \u041F\u0440\u0435\u0442\u0440\u0430\u0436\u0438
-search.hits = \u0420\u0435\u0437\u0443\u043B\u0442\u0430\u0442\u0438 <b>{0}-{1}</b> (\u043E\u0434 \u043E\u043A\u043E {2} \u0443\u043A\u0443\u043F\u043D\u043E \u043F\u0440\u043E\u043D\u0430\u0452\u0435\u043D\u0438\u0445 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0430\u0442\u0430):
-search.cached = \u043A\u0435\u0448\u0438\u0440\u0430\u043D\u043E
-search.explain = \u043E\u0431\u0458\u0430\u0441\u043D\u0438
-search.anchors = \u0432\u0435\u0437\u0435
-search.next = \u0441\u043B\u0435\u0434\u0435\u045B\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430
-search.moreFrom = \u043E\u0441\u0442\u0430\u043B\u0438 \u0440\u0435\u0437\u0443\u043B\u0442\u0430\u0442\u0438 \u0441\u0430
-search.showAllHits = \u043F\u0440\u0438\u043A\u0430\u0436\u0438 \u0441\u0432\u0435 \u0440\u0435\u0437\u0443\u043B\u0442\u0430\u0442\u0435
-search.clustering = clustering
-search.viewAsText = \u041F\u0440\u0438\u043A\u0430\u0436\u0438 \u0441\u0430\u043C\u043E \u0442\u0435\u043A\u0441\u0442
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sv.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_sv.properties
deleted file mode 100644
index 6cc532e05..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_sv.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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.
-
-lang=sv
-search.title = s�kresultat
-search.search = S�k
-search.hits = Tr�ffar <b>{0}-{1}</b> (av ungef�r totalt {2} matchande sidor):
-search.cached = cashad
-search.explain = f�rklara
-search.anchors = ankare
-search.next = n�sta sida
-search.moreFrom = mer fr�n
-search.showAllHits = visa alla tr�ffar
-search.clustering = klustring
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_th.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_th.properties
deleted file mode 100644
index 456def908..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_th.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=th
-search.title = \u0e1c\u0e25\u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32
-search.search = \u0e04\u0e49\u0e19\u0e2b\u0e32
-search.hits = \u0e1e\u0e1a <b>{0}-{1}</b> (\u0e08\u0e32\u0e01\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 {2} \u0e2b\u0e19\u0e49\u0e32):
-search.cached = \u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e27\u0e49
-search.explain = \u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22
-search.anchors = \u0e41\u0e2d\u0e07\u0e40\u0e04\u0e2d\u0e23\u0e4c
-search.next = \u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e2d\u0e44\u0e1b
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/resources/org/nutch/jsp/resources_zh.properties b/contrib/web2/src/main/resources/org/nutch/jsp/resources_zh.properties
deleted file mode 100644
index fa44aea2f..000000000
--- a/contrib/web2/src/main/resources/org/nutch/jsp/resources_zh.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-lang=zh
-search.title = \u67e5\u8be2\u7ed3\u679c
-search.search = \u641c\u7d22
-search.hits = \u7b2c<b>{0}-{1}</b>\u9879 (\u5171\u6709 {2} \u9879\u67e5\u8be2\u7ed3\u679c):
-search.cached = \u7f51\u9875\u5feb\u7167
-search.explain = \u8bc4\u5206\u8be6\u89e3
-search.anchors = anchors
-search.next = \u4e0b\u4e00\u9875
-search.clustering = clustering
-search.viewAsText = View as Plain Text
diff --git a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.java b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.java
deleted file mode 100644
index 06e08b1f2..000000000
--- a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.servlet;
-
-import junit.framework.TestCase;
-
-public class TestNutchHttpServlet extends TestCase {
-
- public void testGetMappingRelativePath() {
-
- NutchHttpServlet servlet = new NutchHttpServlet() {
- };
-
- assertEquals(null, servlet.getMappingRelativePath("test.jsp"));
- assertEquals("/kissa.jsp", servlet
- .getMappingRelativePath("/somepath/kissa.jsp"));
- assertEquals("/kissa.jsp", servlet
- .getMappingRelativePath("somepath/kissa.jsp"));
- }
-}
diff --git a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.java b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.java
deleted file mode 100644
index 333514f88..000000000
--- a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-package org.apache.nutch.webapp.servlet;
-
-import java.io.ByteArrayInputStream;
-
-import org.apache.nutch.webapp.common.WebAppModule;
-
-import junit.framework.TestCase;
-
-public class TestWebAppModule extends TestCase {
-
- public void testWebAppModule() {
- String webxml = "<web-app><servlet-mapping><servlet-name>a</servlet-name><url-pattern>/a.jsp</url-pattern></servlet-mapping>";
- webxml += "<servlet-mapping><servlet-name>b</servlet-name><url-pattern>/b.jsp</url-pattern></servlet-mapping>";
- webxml += "<servlet-mapping><servlet-name>c</servlet-name><url-pattern>/c.jsp</url-pattern></servlet-mapping></web-app>";
-
- WebAppModule module;
- module = new WebAppModule(new ByteArrayInputStream(webxml.getBytes()));
- assertEquals(3, module.getPaths().size());
-
- assertEquals("/a.jsp", module.getPaths().get(0));
- assertEquals("/b.jsp", module.getPaths().get(1));
- assertEquals("/c.jsp", module.getPaths().get(2));
-
- assertEquals("a", module.getServletName("/a.jsp"));
- assertEquals("b", module.getServletName("/b.jsp"));
- assertEquals("c", module.getServletName("/c.jsp"));
- }
-}
diff --git a/contrib/web2/src/main/webapp/WEB-INF/dtd/struts-config_1_2.dtd b/contrib/web2/src/main/webapp/WEB-INF/dtd/struts-config_1_2.dtd
deleted file mode 100644
index eb47d74d9..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/dtd/struts-config_1_2.dtd
+++ /dev/null
@@ -1,686 +0,0 @@
-<!--
- DTD for the Struts Application Configuration File
-
- To support validation of your configuration file, include the following
- DOCTYPE element at the beginning (after the "xml" declaration):
-
- <!DOCTYPE struts-config PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
- "http://struts.apache.org/dtds/struts-config_1_2.dtd">
-
- $Id: struts-config_1_2.dtd 55025 2004-10-18 17:40:29Z craigmcc $
--->
-
-
-<!-- ========== Defined Types ============================================= -->
-
-
-<!-- An "AttributeName" is the identifier of a page, request, session, or
- application scope attribute.
--->
-<!ENTITY % AttributeName "CDATA">
-
-
-<!-- A "BeanName" is the identifier of a JavaBean, such as a form bean,
- and also serves as the name of the corresponding scripting variable
- and the name of the JSP attribute under which the bean is accessed.
- Therefore, it must conform to the rules for a Java identifier.
--->
-<!ENTITY % BeanName "CDATA">
-
-
-<!-- A "Boolean" is the string representation of a boolean (true or false)
- variable.
--->
-<!ENTITY % Boolean "(true|false|yes|no)">
-
-
-<!-- A "ClassName" is the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element.
--->
-<!ENTITY % ClassName "CDATA">
-
-
-<!-- An "Integer" is a character string consisting solely of numeric digits,
- optionally preceeded by a minus sign, that can be converted to a
- 32-bit integer.
--->
-<!ENTITY % Integer "CDATA">
-
-
-<!-- A "Location" is a relative path, delimited by "/" characters, that
- defines the location of a resource relative to the location of the
- Struts configuration file itself.
--->
-<!ENTITY % Location "#PCDATA">
-
-
-<!-- A "PropName" is the name of a JavaBeans property, and must begin with
- a lower case letter and contain only characters that are legal in a
- Java identifier.
--->
-<!ENTITY % PropName "CDATA">
-
-
-<!-- A "RequestPath" is an module-relative URI path, beginning with a
- slash, that identifies a mapped resource (such as a JSP page or a servlet)
- within this web application.
--->
-<!ENTITY % RequestPath "CDATA">
-
-
-<!-- The name of a JSP bean scope within which such a form bean may be
- accessed.
--->
-<!ENTITY % RequestScope "(request|session)">
-
-
-<!-- ========== Top Level Elements ======================================== -->
-
-
-<!-- The "struts-config" element is the root of the configuration file
- hierarchy, and contains nested elements for all of the other
- configuration settings.
--->
-<!ELEMENT struts-config (display-name?, description?, data-sources?, form-beans?, global-exceptions?, global-forwards?, action-mappings?, controller?, message-resources*, plug-in*)>
-<!ATTLIST struts-config id ID #IMPLIED>
-
-
-<!-- The "data-sources" element describes a set of DataSource objects [JDBC 2.0
- Standard Extension]. The individual DataSource objects are configured through
- nested <data-source> elements.
--->
-<!ELEMENT data-sources (data-source*)>
-<!ATTLIST data-sources id ID #IMPLIED>
-
-
-<!-- The "data-source" element describes a DataSource object [JDBC 2.0 Standard
- Extension] that will be instantiated, configured, and made available as a
- servlet context attribute (or "application-scope bean"). Any object can be
- specified so long as it implements [javax.sql.DataSource] and can be
- configured entirely from JavaBean properties. The following attributes
- are required:
-
- className The configuration bean for this DataSource object. If
- specified, the object must be a subclass of the default
- configuration bean.
- ["org.apache.struts.config.DataSourceConfig"]
-
- key Servlet context attribute key under which this data source
- will be stored. Default is the value specified by string
- constant defined by Globals.DATA_SOURCE_KEY. The application
- module prefix (if any) is appended to the key
- (${key}$prefix}).
- [org.apache.struts.Globals.DATA_SOURCE_KEY]
-
- NOTE: The application module prefix includes the leading
- slash, so the default datasource for a module named "foo" is
- stored under "org.apache.struts.action.DATA_SOURCE/foo".
-
- type Fully qualified Java class name for this data source object.
- The class must implement DataSource [javax.sql.DataSource],
- and the object must be configurable entirely from JavaBean
- properties.
--->
-<!ELEMENT data-source (set-property*)>
-<!ATTLIST data-source id ID #IMPLIED>
-<!ATTLIST data-source className %ClassName; #IMPLIED>
-<!ATTLIST data-source key %AttributeName; #IMPLIED>
-<!ATTLIST data-source type %ClassName; #REQUIRED>
-
-
-<!-- The "form-beans" element describes the set of form bean descriptors for this
- module. The following attributes are defined:
-
- type Fully qualified Java class to use when instantiating
- ActionFormBean objects. If specified, the object must be a
- subclass of the default class type.
-
- WARNING: For Struts 1.0, this value is ignored. You
- can set the default implementation class name with the
- "formBean" initialization parameter to the Struts
- controller servlet.
--->
-<!ELEMENT form-beans (form-bean*)>
-<!ATTLIST form-beans id ID #IMPLIED>
-<!ATTLIST form-beans type %ClassName; #IMPLIED>
-
-
-<!-- The "form-bean" element describes an ActionForm subclass
- [org.apache.struts.action.ActionForm] that can be referenced by an "action"
- element.
-
-
-The "form-bean" element describes a particular form bean, which is a
- JavaBean that implements the org.apache.struts.action.ActionForm
- class. The following attributes are defined:
-
- className The configuration bean for this form bean object. If
- specified, the object must be a subclass of the default
- configuration bean.
- ["org.apache.struts.config.FormBeanConfig"]
-
- name The unique identifier for this form bean. Referenced by the
- <action> element to specify which form bean to use with its
- request.
-
- type Fully qualified Java class name of the ActionForm subclass
- to use with this form bean.
--->
-<!ELEMENT form-bean (icon?, display-name?, description?, set-property*, form-property*)>
-<!ATTLIST form-bean id ID #IMPLIED>
-<!ATTLIST form-bean className %ClassName; #IMPLIED>
-<!ATTLIST form-bean dynamic %Boolean; #IMPLIED>
-<!ATTLIST form-bean name %BeanName; #REQUIRED>
-<!ATTLIST form-bean type %ClassName; #REQUIRED>
-
-
-<!-- The "form-property" element describes a JavaBean property that can be used to
- configure an instance of a DynaActionForm or a subclass thereof. This element
- is only utilized when the "type" attribute of the enclosing "form-bean" element
- is [org.apache.struts.action.DynaActionForm] or a subclass of DynaActionForm. If
- a custom DynaActionForm subclass is used, then the "dynamic" attribute of the
- enclosing <form-bean> element must be set to "true". Since Struts 1.1.
-
- className The configuration bean for this form property object. If
- specified, the object must be a subclass of the default
- configuration bean.
- ["org.apache.struts.config.FormPropertyConfig"]
-
- initial String representation of the initial value for this property.
- If not specified, primitives will be initialized to zero and
- objects initialized to the zero-argument instantiation of that
- object class. For example, Strings will be initialized to ""
-
-
- name The name of the JavaBean property described by this element.
-
- size The number of array elements to create if the value of the
- "type" attribute specifies an array, but there is no value
- specified for the "initial" attribute.
-
- type Fully qualified Java class name of the field underlying this
- property, optionally followed by "[]" to indicate that the
- field is indexed.
--->
-<!ELEMENT form-property (set-property*)>
-<!ATTLIST form-property className %ClassName; #IMPLIED>
-<!ATTLIST form-property initial CDATA #IMPLIED>
-<!ATTLIST form-property name %PropName; #REQUIRED>
-<!ATTLIST form-property size %Integer; #IMPLIED>
-<!ATTLIST form-property type %ClassName; #REQUIRED>
-
-
-<!-- The "global-exceptions" element describes a set of exceptions that might be
- thrown by an Action object. The handling of individual exception types is
- configured through nested exception elements. An <action> element may
- override a global exception handler by registering a local exception handler
- for the same exception type. Since Struts 1.1.
--->
-<!ELEMENT global-exceptions (exception*)>
-<!ATTLIST global-exceptions id ID #IMPLIED>
-
-
-<!-- The "exception" element registers an ExceptionHandler for an exception type.
- The following attributes are defined:
-
- bundle Servlet context attribute for the message resources bundle
- associated with this handler. The default attribute is the
- value specified by the string constant declared at
- Globals.MESSAGES_KEY.
- [org.apache.struts.Globals.MESSAGES_KEY]
-
- className The configuration bean for this ExceptionHandler object.
- If specified, className must be a subclass of the default
- configuration bean
- ["org.apache.struts.config.ExceptionConfig"]
-
- handler Fully qualified Java class name for this exception handler.
- ["org.apache.struts.action.ExceptionHandler"]
-
- key The key to use with this handler's message resource bundle
- that will retrieve the error message template for this
- exception.
-
- path The module-relative URI to the resource that will complete
- the request/response if this exception occurs.
-
- scope The context ("request" or "session") that is used to access
- the ActionError object [org.apache.struts.action.ActionError]
- for this exception.
-
- type Fully qualified Java class name of the exception type to
- register with this handler.
--->
-<!ELEMENT exception (icon?, display-name?, description?, set-property*)>
-<!ATTLIST exception id ID #IMPLIED>
-<!ATTLIST exception bundle %AttributeName; #IMPLIED>
-<!ATTLIST exception className %ClassName; #IMPLIED>
-<!ATTLIST exception handler %ClassName; #IMPLIED>
-<!ATTLIST exception key CDATA #REQUIRED>
-<!ATTLIST exception path %RequestPath; #IMPLIED>
-<!ATTLIST exception scope CDATA #IMPLIED>
-<!ATTLIST exception type %ClassName; #REQUIRED>
-
-
-<!-- The "global-forwards" element describes a set of ActionForward objects
- [org.apache.struts.action.ActionForward] that are available to all Action
- objects as a return value. The individual ActionForwards are configured
- through nested <forward> elements. An <action> element may override a global
- forward by defining a local <forward> of the same name.
-
- type Fully qualified Java class to use when instantiating
- ActionForward objects. If specified, the object must be a
- subclass of the default class type.
-
- WARNING: For Struts 1.0, this value is ignored. You
- can set the default implementation class name with the
- "forward" initialization parameter to the Struts
- controller servlet.
--->
-<!ELEMENT global-forwards (forward*)>
-<!ATTLIST global-forwards id ID #IMPLIED>
-<!ATTLIST global-forwards type %ClassName; #IMPLIED>
-
-
-<!-- The "forward" element describes an ActionForward that is to be made
- available to an Action as a return value. An ActionForward is referenced by
- a logical name and encapsulates a URI. A "forward" element may be used to
- describe both global and local ActionForwards. Global forwards are available
- to all the Action objects in the module. Local forwards can be
- nested within an <action> element and only available to an Action object
- when it is invoked through that ActionMapping.
-
- className Fully qualified Java class name of ActionForward
- subclass to use for this object.
- ["org.apache.struts.action.ActionForward"]
-
- contextRelative Set this to "true" if, in a modular application, the path
- attribute starts with a slash "/" and should be considered
- relative to the entire web application rather than the module.
- Since Struts 1.1.
- DEPRECATED.
- [false]
-
- module The module prefix to use with this path. This value should
- begin with a slash ("/").
-
- name The unique identifier for this forward. Referenced by the
- Action object at runtime to select - by its logical name -
- the resource that should complete the request/response.
-
- path The module-relative or context-relative path to the resources
- that is encapsulated by the logical name of this ActionForward.
- If the path is to be considered context-relative when used in
- a modular application, then the contextRelative attribute
- should be set to "true". This value should begin with a slash
- ("/") character.
-
- redirect Set to "true" if a redirect instruction should be issued to
- the user-agent so that a new request is issued for this
- forward's resource. If true, RequestDispatcher.Redirect is
- called. If "false", RequestDispatcher.forward is called instead.
- [false]
--->
-<!ELEMENT forward (icon?, display-name?, description?, set-property*)>
-<!ATTLIST forward id ID #IMPLIED>
-<!ATTLIST forward className %ClassName; #IMPLIED>
-<!ATTLIST forward contextRelative %Boolean; #IMPLIED>
-<!ATTLIST forward module %RequestPath; #IMPLIED>
-<!ATTLIST forward name CDATA #REQUIRED>
-<!ATTLIST forward path %RequestPath; #REQUIRED>
-<!ATTLIST forward redirect %Boolean; #IMPLIED>
-
-
-<!-- The "action-mappings" element describes a set of ActionMapping objects
- [org.apache.struts.action.ActionMapping] that are available to process
- requests matching the url-pattern our ActionServlet registered with the
- container. The individual ActionMappings are configured through nested
- <action> elements. The following attributes are defined:
-
- type Fully qualified Java class to use when instantiating
- ActionMapping objects. If specified, the object must be a
- subclass of the default class type.
-
- WARNING: For Struts 1.0, this value is ignored. You
- can set the default implementation class name with the
- "mapping" initialization parameter to the Struts
- controller servlet.
--->
-<!ELEMENT action-mappings (action*)>
-<!ATTLIST action-mappings id ID #IMPLIED>
-<!ATTLIST action-mappings type %ClassName; #IMPLIED>
-
-
-<!-- The "action" element describes an ActionMapping object that is to be used
- to process a request for a specific module-relative URI. The following
- attributes are defined:
-
- attribute Name of the request-scope or session-scope attribute that
- is used to access our ActionForm bean, if it is other than
- the bean's specified "name". Optional if "name" is specified,
- else not valid.
-
- className The fully qualified Java class name of the ActionMapping
- subclass to use for this action mapping object. Defaults to
- the type specified by the enclosing <action-mappings>
- element or to "org.apache.struts.action.ActionMapping" if
- not specified.
- ["org.apache.struts.action.ActionMapping"]
-
- forward Module-relative path of the servlet or other resource that
- will process this request, instead of the Action class
- specified by "type". The path WILL NOT be processed
- through the "forwardPattern" attribute that is configured
- on the "controller" element for this module.
- Exactly one of "forward", "include", or "type" must be
- specified.
-
- include Module-relative path of the servlet or other resource that
- will process this request, instead of the Action class
- specified by "type". The path WILL NOT be processed
- through the "forwardPattern" attribute that is configured
- on the "controller" element for this module.
- Exactly one of "forward", "include", or "type" must be
- specified.
-
- input Module-relative path of the action or other resource to
- which control should be returned if a validation error is
- encountered. Valid only when "name" is specified. Required
- if "name" is specified and the input bean returns
- validation errors. Optional if "name" is specified and the
- input bean does not return validation errors.
-
- name Name of the form bean, if any, that is associated with this
- action mapping.
-
- path The module-relative path of the submitted request, starting
- with a "/" character, and without the filename extension if
- extension mapping is used.
-
- NOTE: Do *not* include a period in your path name,
- because it will look like a filename extension and
- cause your Action to not be located.
-
- parameter General-purpose configuration parameter that can be used to
- pass extra information to the Action object selected by
- this action mapping.
-
- prefix Prefix used to match request parameter names to ActionForm
- property names, if any. Optional if "name" is specified,
- else not allowed.
-
- roles Comma-delimited list of security role names that are allowed
- access to this ActionMapping object. Since Struts 1.1.
-
- scope The context ("request" or "session") that is used to
- access our ActionForm bean, if any. Optional if "name" is
- specified, else not valid. [session]
-
- suffix Suffix used to match request parameter names to ActionForm
- bean property names, if any. Optional if "name" is
- specified, else not valid.
-
- type Fully qualified Java class name of the Action subclass
- [org.apache.struts.action.Action] that will process requests
- for this action mapping. Not valid if either the "forward"
- or "include" attribute is specified. Exactly one of
- "forward", "include", or "type" must be specified.
-
- unknown Set to "true" if this object should be configured as the
- default action mapping for this module. If a request does not
- match another object, it will be passed to the ActionMapping
- object with unknown set to "true". Only one ActionMapping
- can be marked as "unknown" within a module.
- [false]
-
- validate Set to "true" if the validate method of the ActionForm bean
- should be called prior to calling the Action object for this
- action mapping, or set to "false" if you do not want the
- validate method called.
- [true]
--->
-<!ELEMENT action (icon?, display-name?, description?, set-property*, exception*, forward*)>
-<!ATTLIST action id ID #IMPLIED>
-<!ATTLIST action attribute %BeanName; #IMPLIED>
-<!ATTLIST action className %ClassName; #IMPLIED>
-<!ATTLIST action forward %RequestPath; #IMPLIED>
-<!ATTLIST action include %RequestPath; #IMPLIED>
-<!ATTLIST action input %RequestPath; #IMPLIED>
-<!ATTLIST action name %BeanName; #IMPLIED>
-<!ATTLIST action parameter CDATA #IMPLIED>
-<!ATTLIST action path %RequestPath; #REQUIRED>
-<!ATTLIST action prefix CDATA #IMPLIED>
-<!ATTLIST action roles CDATA #IMPLIED>
-<!ATTLIST action scope %RequestScope; #IMPLIED>
-<!ATTLIST action suffix CDATA #IMPLIED>
-<!ATTLIST action type %ClassName; #IMPLIED>
-<!ATTLIST action unknown %Boolean; #IMPLIED>
-<!ATTLIST action validate %Boolean; #IMPLIED>
-
-
-<!-- The "controller" element describes the ControllerConfig bean
- [org.apache.struts.config.ControllerConfig] that encapsulates
- a module's runtime configuration. The following
- attributes are defined:
-
- bufferSize The size of the input buffer used when processing
- file uploads.
- [4096]
-
- className Fully qualified Java class name of the
- ControllerConfig subclass for this controller object.
- If specified, the object must be a subclass of the
- default class.
- ["org.apache.struts.config.ControllerConfig"]
-
- contentType Default content type (and optional character encoding) to
- be set on each response. May be overridden by the Action,
- JSP, or other resource to which the request is forwarded.
- ["text/html"]
-
- forwardPattern Replacement pattern defining how the "path" attribute of a
- <forward> element is mapped to a context-relative URL when
- it starts with a slash (and when the contextRelative
- property is false). This value may consist of any
- combination of the following:
- - "$M" - Replaced by the module prefix of this module
- - "$P" - Replaced by the "path" attribute of the selected
- "forward" element
- - "$$" - Causes a literal dollar sign to be rendered
- - "$x" - (Where "x" is any character not defined above)
- Silently swallowed, reserved for future use
- If not specified, the default forwardPattern is "$M$P",
- which is consistent with the previous behavior of
- forwards. Since Struts 1.1. ["$M$P"]
-
- inputForward Set to "true" if you want the "input" attribute of
- <action> elements to be the name of a local or global
- ActionForward, which will then be used to calculate the
- ultimate URL. Set to "false" (the default) to treat the
- "input" parameter of <action> elements as a
- module-relative path to the resource
- to be used as the input form. Since Struts 1.1.
- [false]
-
- locale Set to "true" if you want a Locale object stored in the
- user's session if not already present.
- [true]
-
- maxFileSize The maximum size (in bytes) of a file to be accepted as a
- file upload. Can be expressed as a number followed by a
- "K", "M", or "G", which are interpreted to mean kilobytes,
- megabytes, or gigabytes, respectively.
- ["250M"]
-
- memFileSize The maximum size (in bytes) of a file whose contents will
- be retained in memory after uploading. Files larger than
- this threshold will be written to some alternative storage
- medium, typically a hard disk. Can be expressed as a number
- followed by a "K", "M", or "G", which are interpreted to
- mean kilobytes, megabytes, or gigabytes, respectively.
- ["256K"]
-
- multipartClass The fully qualified Java class name of the multipart
- request handler class to be used with this module.
- ["org.apache.struts.upload.CommonsMultipartRequestHandler"]
-
- nocache Set to "true" if you want the controller to add HTTP
- headers for defeating caching to every response from
- this module. [false]
-
- pagePattern Replacement pattern defining how the "page" attribute of
- custom tags using it is mapped to a context-relative URL
- of the corresponding resource. This value may consist of
- any combination of the following:
- - "$M" - Replaced by the module prefix of this module
- - "$P" - Replaced by the value of the "page" attribute
- - "$$" - Causes a literal dollar sign to be rendered
- - "$x" - (Where "x" is any character not defined above)
- Silently swallowed, reserved for future use
- If not specified, the default forwardPattern is
- "$M$P", which is consistent with previous hard coded
- behavior of URL evaluation for "page" attributes.
- ["$M$P"]
-
- processorClass The fully qualified Java class name of the
- RequestProcessor subclass to be used with this module.
- ["org.apache.struts.action.RequestProcessor"]
-
- tempDir Temporary working directory to use when processing
- file uploads.
- [{Directory provided by servlet container}]
--->
-<!ELEMENT controller (set-property*)>
-<!ATTLIST controller id ID #IMPLIED>
-<!ATTLIST controller bufferSize %Integer; #IMPLIED>
-<!ATTLIST controller className %ClassName; #IMPLIED>
-<!ATTLIST controller contentType CDATA #IMPLIED>
-<!ATTLIST controller forwardPattern CDATA #IMPLIED>
-<!ATTLIST controller inputForward %Boolean; #IMPLIED>
-<!ATTLIST controller locale %Boolean; #IMPLIED>
-<!ATTLIST controller maxFileSize CDATA #IMPLIED>
-<!ATTLIST controller memFileSize CDATA #IMPLIED>
-<!ATTLIST controller multipartClass %ClassName; #IMPLIED>
-<!ATTLIST controller nocache %Boolean; #IMPLIED>
-<!ATTLIST controller pagePattern CDATA #IMPLIED>
-<!ATTLIST controller processorClass %ClassName; #IMPLIED>
-<!ATTLIST controller tempDir CDATA #IMPLIED>
-
-
-<!-- The "message-resources" element describes a MessageResources object with
- message templates for this module. The following attributes are defined:
-
- className The configuration bean for this message resources object.
- If specified, the object must be a subclass of the default
- configuration bean.
- ["org.apache.struts.config.MessageResourcesConfig"]
-
- factory Fully qualified Java class name of the
- MessageResourcesFactory subclass to use for this message
- resources object.
- ["org.apache.struts.util.PropertyMessageResourcesFactory"]
-
- key Servlet context attribute under which this message
- resources bundle will be stored. The default attribute is
- the value specified by the string constant at
- [Globals.MESSAGES_KEY]. The module prefix (if
- any) is appended to the key (${key}${prefix}).
- [org.apache.struts.Globals.MESSAGES_KEY]
-
- NOTE: The module prefix includes the leading
- slash, so the default message resource bundle for a module
- named "foo" is stored under
- "org.apache.struts.action.MESSAGE/foo".
-
- null Set to "true" if you want our message resources to return a
- null string for unknown message keys, or "false" to return a
- message with the bad key value.
-
- parameter Configuration parameter to be passed to the createResources
- method of our factory object.
--->
-<!ELEMENT message-resources (set-property*)>
-<!ATTLIST message-resources id ID #IMPLIED>
-<!ATTLIST message-resources className %ClassName; #IMPLIED>
-<!ATTLIST message-resources factory %ClassName; #IMPLIED>
-<!ATTLIST message-resources key %AttributeName; #IMPLIED>
-<!ATTLIST message-resources null %Boolean; #IMPLIED>
-<!ATTLIST message-resources parameter CDATA #REQUIRED>
-
-
-<!-- The "plug-in" element specifies the fully qualified class name of a
- general-purpose application plug-in module that receives notification of
- application startup and shutdown events. An instance of the specified class
- is created for each element, and can be configured with nested <set-property>
- elements. The following attributes are supported:
-
- className Fully qualified Java class name of the plug-in class; must
- implement [org.apache.struts.action.PlugIn].
--->
-<!ELEMENT plug-in (set-property*)>
-<!ATTLIST plug-in id ID #IMPLIED>
-<!ATTLIST plug-in className %ClassName; #REQUIRED>
-
-
-<!-- ========== Subordinate Elements ====================================== -->
-
-
-<!-- The "description" element contains descriptive (paragraph length) text
- about the surrounding element, suitable for use in GUI tools.
--->
-<!ELEMENT description (#PCDATA)>
-<!ATTLIST description id ID #IMPLIED>
-
-
-<!-- The "display-name" element contains a short (one line) description of
- the surrounding element, suitable for use in GUI tools.
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name id ID #IMPLIED>
-
-
-<!-- The "icon" element contains a small-icon and large-icon element which
- specify the location, relative to the Struts configuration file, for small
- and large images used to represent the surrounding element in GUI tools.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-<!ATTLIST icon id ID #IMPLIED>
-
-
-<!-- The "large-icon" element specifies the location, relative to the Struts
- configuration file, of a resource containing a large (32x32 pixel)
- icon image.
--->
-<!ELEMENT large-icon (%Location;)>
-<!ATTLIST large-icon id ID #IMPLIED>
-
-
-<!-- The "set-property" element specifies the method name and initial value of
- an additional JavaBean configuration property. When the object representing
- the surrounding element is instantiated, the accessor for the indicated
- property is called and passed the indicated value. The "set-property"
- element is especially useful when a custom subclass is used with
- <data-source>, <forward>, <action>, or <plug-in> elements. The subclass
- can be passed whatever other properties may be required to configure the
- object without changing how the struts-config is parsed.
-
- property Name of the JavaBeans property whose setter method
- will be called.
-
- value String representation of the value to which this
- property will be set, after suitable type conversion
--->
-<!ELEMENT set-property EMPTY>
-<!ATTLIST set-property id ID #IMPLIED>
-<!ATTLIST set-property property %PropName; #REQUIRED>
-<!ATTLIST set-property value CDATA #REQUIRED>
-
-
-<!-- The "small-icon" element specifies the location, relative to the Struts
- configuration file, of a resource containing a small (16x16 pixel)
- icon image.
--->
-<!ELEMENT small-icon (%Location;)>
-<!ATTLIST small-icon id ID #IMPLIED>
-
diff --git a/contrib/web2/src/main/webapp/WEB-INF/dtd/tiles-config_1_1.dtd b/contrib/web2/src/main/webapp/WEB-INF/dtd/tiles-config_1_1.dtd
deleted file mode 100644
index 92675c8f7..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/dtd/tiles-config_1_1.dtd
+++ /dev/null
@@ -1,281 +0,0 @@
-<!--
- DTD for the Tile Definition File, Version 1.1
-
- To support validation of your configuration file, include the following
- DOCTYPE element at the beginning (after the "xml" declaration):
-
- <!DOCTYPE tiles-definitions PUBLIC
- "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
- "http://struts.apache.org/dtds/tiles-config_1_1.dtd">
-
- $Id: tiles-config_1_1.dtd 51703 2004-09-01 10:41:11Z niallp $
--->
-
-
-<!-- ========== Defined Types ============================================= -->
-
-
-<!-- A "Boolean" is the string representation of a boolean (true or false)
- variable.
--->
-<!ENTITY % Boolean "(true|false)">
-
-
-<!-- A "ContentType" is the content type of an attribute passed to a tile
- component.
--->
-<!ENTITY % ContentType "(string|page|template|definition)">
-
-<!-- A "ClassName" is the fully qualified name of a Java class that is
- instantiated to provide the functionality of the enclosing element.
--->
-<!ENTITY % ClassName "CDATA">
-
-<!-- A "RequestPath" is an module-relative URI path, beginning with a
- slash, that identifies a mapped resource (such as a JSP page or a servlet)
- within this web application.
--->
-<!ENTITY % RequestPath "CDATA">
-
-<!-- A "DefinitionName" is the unique identifier of a definition. This identifier
- is a logical name used to reference the definition.
--->
-<!ENTITY % DefinitionName "CDATA">
-
-<!-- A "BeanName" is the identifier of a JavaBean, such as a form bean,
- and also serves as the name of the corresponding scripting variable
- and the name of the JSP attribute under which the bean is accessed.
- Therefore, it must conform to the rules for a Java identifier.
--->
-<!ENTITY % BeanName "CDATA">
-
-<!-- A "PropName" is the name of a JavaBeans property, and must begin with
- a lower case letter and contain only characters that are legal in a
- Java identifier.
--->
-<!ENTITY % PropName "CDATA">
-
-<!-- A "Location" is a relative path, delimited by "/" characters, that
- defines the location of a resource relative to the location of the
- configuration file itself.
--->
-<!ENTITY % Location "#PCDATA">
-
-
-
-<!-- ========== Top Level Elements ======================================== -->
-
-
- <!-- deprecated: use tiles-definitions instead.-->
-<!ELEMENT component-definitions (definition+)>
-
-<!-- The "tiles-definitions" element is the root of the configuration file
- hierarchy, and contains nested elements for all of the other
- configuration settings.
--->
-<!ELEMENT tiles-definitions (definition+)>
-
-<!-- The "definition" element describes a definition that can be inserted in a jsp
- page. This definition is identified by its logical name. A definition allows
- to define all the attributes that can be set in <insert> tag from a jsp page.
-
- controllerClass The fully qualified Java class name of the controller
- subclass to call immediately before the tiles is inserted.
- Only one of controllerClass or controllerUrl should be
- specified.
-
- controllerUrl The context-relative path to the resource used as controller
- called immediately before the tiles is inserted.
- Only one of controllerClass or controllerUrl should be
- specified.
-
- extends Name of a definition that is used as ancestor of this definition.
- All attributes from the ancestor are available to the new
- definition. Any attribute inherited from the ancestor can
- be overloaded by providing a new value.
-
- name The unique identifier for this definition.
-
- page Same as path.
-
- path The context-relative path to the resource used as tiles to
- insert. This tiles will be inserted and a tiles context
- containing appropriate attributes will be available.
-
- role Security role name that is allowed access to this definition
- object. The definition is inserted only if the role name is
- allowed.
-
- template Same as path. For compatibility with the template tag library.
--->
-<!ELEMENT definition (icon?, display-name?, description?, put*, putList*)>
-<!ATTLIST definition id ID #IMPLIED>
-<!ATTLIST definition controllerClass %ClassName; #IMPLIED>
-<!ATTLIST definition controllerUrl %RequestPath; #IMPLIED>
-<!ATTLIST definition extends %DefinitionName; #IMPLIED>
-<!ATTLIST definition name %DefinitionName; #REQUIRED>
-<!ATTLIST definition page %RequestPath; #IMPLIED>
-<!ATTLIST definition path %RequestPath; #IMPLIED>
-<!ATTLIST definition role CDATA #IMPLIED>
-<!ATTLIST definition template %RequestPath; #IMPLIED>
-
-
-<!-- The "put" element describes an attribute of a definition. It allows to
- specify the tiles attribute name and its value. The tiles value can be
- specified as an xml attribute, or in the body of the <put> tag.
-
- content Same as value. For compatibility with the template tag library.
-
- direct Same as type="string". For compatibility with the template
- tag library.
-
- name The unique identifier for this put.
-
- type The type of the value. Can be: string, page, template or definition.
- By default, no type is associated to a value. If a type is
- associated, it will be used as a hint to process the value
- when the attribute will be used in the inserted tiles.
-
- value The value associated to this tiles attribute. The value should
- be specified with this tag attribute, or in the body of the tag.
--->
-<!ELEMENT put (#PCDATA)>
-<!ATTLIST put id ID #IMPLIED>
-<!ATTLIST put content CDATA #IMPLIED>
-<!ATTLIST put direct %Boolean; #IMPLIED>
-<!ATTLIST put name CDATA #REQUIRED>
-<!ATTLIST put type %ContentType; #IMPLIED>
-<!ATTLIST put value CDATA #IMPLIED>
-
-
-<!-- The "putList" element describes a list attribute of a definition. It allows to
- specify an attribute that is a java List containing any kind of values. In
- the config file, the list elements are specified by nested <add>, <item> or
- <putList>.
-
- name The unique identifier for this put list.
--->
-<!ELEMENT putList ( (add* | item* | bean* | putList*)+) >
-<!ATTLIST putList id ID #IMPLIED>
-<!ATTLIST putList name CDATA #REQUIRED>
-
-<!-- ========== Subordinate Elements ====================================== -->
-
-<!-- The "add" element describes an element of a list. It is similar to the
- <put> element.
-
- content Same as value. For compatibility with the template tag library.
-
- direct Same as type="string". For compatibility with the template
- tag library.
-
- type The type of the value. Can be: string, page, template or definition.
- By default, no type is associated to a value. If a type is
- associated, it will be used as a hint to process the value
- when the attribute will be used in the inserted tiles.
-
- value The value associated to this tiles attribute. The value should
- be specified with this tag attribute, or in the body of the tag.
--->
-<!ELEMENT add (#PCDATA)>
-<!ATTLIST add id ID #IMPLIED>
-<!ATTLIST add content CDATA #IMPLIED>
-<!ATTLIST add direct %Boolean; #IMPLIED>
-<!ATTLIST add type %ContentType; #IMPLIED>
-<!ATTLIST add value CDATA #IMPLIED>
-
-
-<!-- The "bean" element describes an element of a list. It create a bean of the
- specified java classtype. This bean is initialized with appropriate nested
- <set-property>.
-
- classtype The fully qualified classname for this bean.
--->
-<!ELEMENT bean (set-property*)>
-<!ATTLIST bean id ID #IMPLIED>
-<!ATTLIST bean classtype %ClassName; #REQUIRED>
-
-<!-- The "set-property" element specifies the method name and initial value of
- a bean property. When the object representing
- the surrounding element is instantiated, the accessor for the indicated
- property is called and passed the indicated value.
-
- property Name of the JavaBeans property whose setter method
- will be called.
-
- value String representation of the value to which this
- property will be set, after suitable type conversion
--->
-<!ELEMENT set-property EMPTY>
-<!ATTLIST set-property id ID #IMPLIED>
-<!ATTLIST set-property property %PropName; #REQUIRED>
-<!ATTLIST set-property value CDATA #REQUIRED>
-
-
-<!-- The "item" element describes an element of a list. It create a bean added as
- element to the list. Each bean can contain different properties: value, link,
- icon, tooltip. These properties are to be interpreted by the jsp page using
- them.
- By default the bean is of type
- "org.apache.struts.tiles.beans.SimpleMenuItem". This bean is useful to
- create a list of beans used as menu items.
-
- classtype The fully qualified classtype for this bean.
- If specified, the classtype must be a subclass of the interface
- "org.apache.struts.tiles.beans.MenuItem".
-
- icon The bean 'icon' property.
-
- link The bean 'link' property.
-
- tooltip The bean 'tooltip' property.
-
- value The bean 'value' property.
--->
-<!ELEMENT item (#PCDATA)>
-<!ATTLIST item id ID #IMPLIED>
-<!ATTLIST item classtype %ClassName; #IMPLIED>
-<!ATTLIST item icon CDATA #IMPLIED>
-<!ATTLIST item link CDATA #REQUIRED>
-<!ATTLIST item tooltip CDATA #IMPLIED>
-<!ATTLIST item value CDATA #REQUIRED>
-
-
-<!-- ========== Info Elements ====================================== -->
-
-<!-- The "description" element contains descriptive (paragraph length) text
- about the surrounding element, suitable for use in GUI tools.
--->
-<!ELEMENT description (#PCDATA)>
-<!ATTLIST description id ID #IMPLIED>
-
-
-<!-- The "display-name" element contains a short (one line) description of
- the surrounding element, suitable for use in GUI tools.
--->
-<!ELEMENT display-name (#PCDATA)>
-<!ATTLIST display-name id ID #IMPLIED>
-
-
-<!-- The "icon" element contains a small-icon and large-icon element which
- specify the location, relative to the Struts configuration file, for small
- and large images used to represent the surrounding element in GUI tools.
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-<!ATTLIST icon id ID #IMPLIED>
-
-
-<!-- The "large-icon" element specifies the location, relative to the Struts
- configuration file, of a resource containing a large (32x32 pixel)
- icon image.
--->
-<!ELEMENT large-icon (%Location;)>
-<!ATTLIST large-icon id ID #IMPLIED>
-
-
-<!-- The "small-icon" element specifies the location, relative to the Struts
- configuration file, of a resource containing a small (16x16 pixel)
- icon image.
--->
-<!ELEMENT small-icon (%Location;)>
-<!ATTLIST small-icon id ID #IMPLIED>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_2.dtd b/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_2.dtd
deleted file mode 100644
index 172dafa71..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_2.dtd
+++ /dev/null
@@ -1,565 +0,0 @@
-
-<!--
-The web-app element is the root of the deployment descriptor for
-a web application
--->
-
-<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
-context-param*, servlet*, servlet-mapping*, session-config?,
-mime-mapping*, welcome-file-list?, error-page*, taglib*,
-resource-ref*, security-constraint*, login-config?, security-role*,
-env-entry*, ejb-ref*)>
-
-<!--
-The icon element contains a small-icon and a large-icon element
-which specify the location within the web application for a small and
-large image used to represent the web application in a GUI tool. At a
-minimum, tools must accept GIF and JPEG format images.
--->
-
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The small-icon element contains the location within the web
-application of a file containing a small (16x16 pixel) icon image.
--->
-
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The large-icon element contains the location within the web
-application of a file containing a large (32x32 pixel) icon image.
--->
-
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended
-to be displayed by GUI tools
--->
-
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The description element is used to provide descriptive text about
-the parent element.
--->
-
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The distributable element, by its presence in a web application
-deployment descriptor, indicates that this web application is
-programmed appropriately to be deployed into a distributed servlet
-container
--->
-
-<!ELEMENT distributable EMPTY>
-
-<!--
-The context-param element contains the declaration of a web
-application's servlet context initialization parameters.
--->
-
-<!ELEMENT context-param (param-name, param-value, description?)>
-
-<!--
-The param-name element contains the name of a parameter.
--->
-
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-The param-value element contains the value of a parameter.
--->
-
-<!ELEMENT param-value (#PCDATA)>
-
-<!--
-The servlet element contains the declarative data of a
-servlet. If a jsp-file is specified and the load-on-startup element is
-present, then the JSP should be precompiled and loaded.
--->
-
-<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
-(servlet-class|jsp-file), init-param*, load-on-startup?, security-role-ref*)>
-
-<!--
-The servlet-name element contains the canonical name of the
-servlet.
--->
-
-<!ELEMENT servlet-name (#PCDATA)>
-
-<!--
-The servlet-class element contains the fully qualified class name
-of the servlet.
--->
-
-<!ELEMENT servlet-class (#PCDATA)>
-
-<!--
-The jsp-file element contains the full path to a JSP file within
-the web application.
--->
-
-<!ELEMENT jsp-file (#PCDATA)>
-
-<!--
-The init-param element contains a name/value pair as an
-initialization param of the servlet
--->
-
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-The load-on-startup element indicates that this servlet should be
-loaded on the startup of the web application. The optional contents of
-these element must be a positive integer indicating the order in which
-the servlet should be loaded. Lower integers are loaded before higher
-integers. If no value is specified, or if the value specified is not a
-positive integer, the container is free to load it at any time in the
-startup sequence.
--->
-
-<!ELEMENT load-on-startup (#PCDATA)>
-
-<!--
-The servlet-mapping element defines a mapping between a servlet
-and a url pattern
--->
-
-<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
-
-<!--
-The url-pattern element contains the url pattern of the
-mapping. Must follow the rules specified in Section 10 of the Servlet
-API Specification.
--->
-
-<!ELEMENT url-pattern (#PCDATA)>
-
-<!--
-The session-config element defines the session parameters for
-this web application.
--->
-
-<!ELEMENT session-config (session-timeout?)>
-
-<!--
-The session-timeout element defines the default session timeout
-interval for all sessions created in this web application. The
-specified timeout must be expressed in a whole number of minutes.
--->
-
-<!ELEMENT session-timeout (#PCDATA)>
-
-<!--
-The mime-mapping element defines a mapping between an extension
-and a mime type.
--->
-
-<!ELEMENT mime-mapping (extension, mime-type)>
-
-<!--
-The extension element contains a string describing an
-extension. example: "txt"
--->
-
-<!ELEMENT extension (#PCDATA)>
-
-<!--
-The mime-type element contains a defined mime type. example:
-"text/plain"
--->
-
-<!ELEMENT mime-type (#PCDATA)>
-
-<!--
-The welcome-file-list contains an ordered list of welcome files
-elements.
--->
-
-<!ELEMENT welcome-file-list (welcome-file+)>
-
-<!--
-The welcome-file element contains file name to use as a default
-welcome file, such as index.html
--->
-
-<!ELEMENT welcome-file (#PCDATA)>
-
-<!--
-The taglib element is used to describe a JSP tag library.
--->
-
-<!ELEMENT taglib (taglib-uri, taglib-location)>
-
-<!--
-The taglib-uri element describes a URI, relative to the location
-of the web.xml document, identifying a Tag Library used in the Web
-Application.
--->
-
-<!ELEMENT taglib-uri (#PCDATA)>
-
-<!--
-the taglib-location element contains the location (as a resource
-relative to the root of the web application) where to find the Tag
-Libary Description file for the tag library.
--->
-
-<!ELEMENT taglib-location (#PCDATA)>
-
-<!--
-The error-page element contains a mapping between an error code
-or exception type to the path of a resource in the web application
--->
-
-<!ELEMENT error-page ((error-code | exception-type), location)>
-
-<!--
-The error-code contains an HTTP error code, ex: 404
--->
-
-<!ELEMENT error-code (#PCDATA)>
-
-<!--
-The exception type contains a fully qualified class name of a
-Java exception type.
--->
-
-<!ELEMENT exception-type (#PCDATA)>
-
-<!--
-The location element contains the location of the resource in the
-web application
--->
-
-<!ELEMENT location (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of a Web
-Application's reference to an external resource.
--->
-
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)>
-
-<!--
-The res-ref-name element specifies the name of the resource
-factory reference name.
--->
-
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-type element specifies the (Java class) type of the data
-source.
--->
-
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The res-auth element indicates whether the application component
-code performs resource signon programmatically or whether the
-container signs onto the resource based on the principle mapping
-information supplied by the deployer. Must be CONTAINER or SERVLET
--->
-
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The security-constraint element is used to associate security
-constraints with one or more web resource collections
--->
-
-<!ELEMENT security-constraint (web-resource-collection+,
-auth-constraint?, user-data-constraint?)>
-
-<!--
-The web-resource-collection element is used to identify a subset
-of the resources and HTTP methods on those resources within a web
-application to which a security constraint applies. If no HTTP methods
-are specified, then the security constraint applies to all HTTP
-methods.
--->
-
-<!ELEMENT web-resource-collection (web-resource-name, description?,
-url-pattern*, http-method*)>
-
-<!--
-The web-resource-name contains the name of this web resource
-collection
--->
-
-<!ELEMENT web-resource-name (#PCDATA)>
-
-<!--
-The http-method contains an HTTP method (GET | POST |...)
--->
-
-<!ELEMENT http-method (#PCDATA)>
-
-<!--
-The user-data-constraint element is used to indicate how data
-communicated between the client and container should be protected
--->
-
-<!ELEMENT user-data-constraint (description?, transport-guarantee)>
-
-<!--
-The transport-guarantee element specifies that the communication
-between client and server should be NONE, INTEGRAL, or
-CONFIDENTIAL. NONE means that the application does not require any
-transport guarantees. A value of INTEGRAL means that the application
-requires that the data sent between the client and server be sent in
-such a way that it can't be changed in transit. CONFIDENTIAL means
-that the application requires that the data be transmitted in a
-fashion that prevents other entities from observing the contents of
-the transmission. In most cases, the presence of the INTEGRAL or
-CONFIDENTIAL flag will indicate that the use of SSL is required.
--->
-
-<!ELEMENT transport-guarantee (#PCDATA)>
-
-<!--
-The auth-constraint element indicates the user roles that should
-be permitted access to this resource collection. The role used here
-must appear in a security-role-ref element.
--->
-
-<!ELEMENT auth-constraint (description?, role-name*)>
-
-<!--
-The role-name element contains the name of a security role.
--->
-
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The login-config element is used to configure the authentication
-method that should be used, the realm name that should be used for
-this application, and the attributes that are needed by the form login
-mechanism.
--->
-
-<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
-
-<!--
-The realm name element specifies the realm name to use in HTTP
-Basic authorization
--->
-
-<!ELEMENT realm-name (#PCDATA)>
-
-<!--
-The form-login-config element specifies the login and error pages
-that should be used in form based login. If form based authentication
-is not used, these elements are ignored.
--->
-
-<!ELEMENT form-login-config (form-login-page, form-error-page)>
-
-<!--
-The form-login-page element defines the location in the web app
-where the page that can be used for login can be found
--->
-
-<!ELEMENT form-login-page (#PCDATA)>
-
-<!--
-The form-error-page element defines the location in the web app
-where the error page that is displayed when login is not successful
-can be found
--->
-
-<!ELEMENT form-error-page (#PCDATA)>
-
-<!--
-The auth-method element is used to configure the authentication
-mechanism for the web application. As a prerequisite to gaining access
-to any web resources which are protected by an authorization
-constraint, a user must have authenticated using the configured
-mechanism. Legal values for this element are "BASIC", "DIGEST",
-"FORM", or "CLIENT-CERT".
--->
-
-<!ELEMENT auth-method (#PCDATA)>
-
-<!--
-The security-role element contains the declaration of a security
-role which is used in the security-constraints placed on the web
-application.
--->
-
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The role-name element contains the name of a role. This element
-must contain a non-empty string.
--->
-
-<!ELEMENT security-role-ref (description?, role-name, role-link)>
-
-<!--
-The role-link element is used to link a security role reference
-to a defined security role. The role-link element must contain the
-name of one of the security roles defined in the security-role
-elements.
--->
-
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of an
-application's environment entry. This element is required to be
-honored on in J2EE compliant servlet containers.
--->
-
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
-env-entry-type)>
-
-<!--
-The env-entry-name contains the name of an application's
-environment entry
--->
-
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of an
-application's environment entry
--->
-
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully qualified Java type
-of the environment entry value that is expected by the application
-code. The following are the legal values of env-entry-type:
-java.lang.Boolean, java.lang.String, java.lang.Integer,
-java.lang.Double, java.lang.Float.
--->
-
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The ejb-ref element is used to declare a reference to an
-enterprise bean.
--->
-
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote,
-ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB
-reference. This is the JNDI name that the servlet code uses to get a
-reference to the enterprise bean.
--->
-
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected java class type of
-the referenced EJB.
--->
-
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The ejb-home element contains the fully qualified name of the
-EJB's home interface
--->
-
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The ejb-remote element contains the fully qualified name of the
-EJB's remote interface
--->
-
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The ejb-link element is used in the ejb-ref element to specify
-that an EJB reference is linked to an EJB in an encompassing Java2
-Enterprise Edition (J2EE) application package. The value of the
-ejb-link element must be the ejb-name of and EJB in the J2EE
-application package.
--->
-
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ID mechanism is to allow tools to easily make tool-specific
-references to the elements of the deployment descriptor. This allows
-tools that produce additional deployment information (i.e information
-beyond the standard deployment descriptor information) to store the
-non-standard information in a separate file, and easily refer from
-these tools-specific files to the information in the standard web-app
-deployment descriptor.
--->
-
-<!ATTLIST web-app id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST distributable id ID #IMPLIED>
-<!ATTLIST context-param id ID #IMPLIED>
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST servlet id ID #IMPLIED>
-<!ATTLIST servlet-name id ID #IMPLIED>
-<!ATTLIST servlet-class id ID #IMPLIED>
-<!ATTLIST jsp-file id ID #IMPLIED>
-<!ATTLIST init-param id ID #IMPLIED>
-<!ATTLIST load-on-startup id ID #IMPLIED>
-<!ATTLIST servlet-mapping id ID #IMPLIED>
-<!ATTLIST url-pattern id ID #IMPLIED>
-<!ATTLIST session-config id ID #IMPLIED>
-<!ATTLIST session-timeout id ID #IMPLIED>
-<!ATTLIST mime-mapping id ID #IMPLIED>
-<!ATTLIST extension id ID #IMPLIED>
-<!ATTLIST mime-type id ID #IMPLIED>
-<!ATTLIST welcome-file-list id ID #IMPLIED>
-<!ATTLIST welcome-file id ID #IMPLIED>
-<!ATTLIST taglib id ID #IMPLIED>
-<!ATTLIST taglib-uri id ID #IMPLIED>
-<!ATTLIST taglib-location id ID #IMPLIED>
-<!ATTLIST error-page id ID #IMPLIED>
-<!ATTLIST error-code id ID #IMPLIED>
-<!ATTLIST exception-type id ID #IMPLIED>
-<!ATTLIST location id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST security-constraint id ID #IMPLIED>
-<!ATTLIST web-resource-collection id ID #IMPLIED>
-<!ATTLIST web-resource-name id ID #IMPLIED>
-<!ATTLIST http-method id ID #IMPLIED>
-<!ATTLIST user-data-constraint id ID #IMPLIED>
-<!ATTLIST transport-guarantee id ID #IMPLIED>
-<!ATTLIST auth-constraint id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST login-config id ID #IMPLIED>
-<!ATTLIST realm-name id ID #IMPLIED>
-<!ATTLIST form-login-config id ID #IMPLIED>
-<!ATTLIST form-login-page id ID #IMPLIED>
-<!ATTLIST form-error-page id ID #IMPLIED>
-<!ATTLIST auth-method id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_3.dtd b/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_3.dtd
deleted file mode 100644
index 56bfb11dc..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/dtd/web-app_2_3.dtd
+++ /dev/null
@@ -1,1059 +0,0 @@
-<!--
-Copyright 2000-2001 Sun Microsystems, Inc. 901 San Antonio Road,
-Palo Alto, CA 94303, U.S.A. All rights reserved.
-
-This product or document is protected by copyright and distributed
-under licenses restricting its use, copying, distribution, and
-decompilation. No part of this product or documentation may be
-reproduced in any form by any means without prior written authorization
-of Sun and its licensors, if any.
-
-Third party software, including font technology, is copyrighted and
-licensed from Sun suppliers.
-
-Sun, Sun Microsystems, the Sun Logo, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail and Enterprise JavaBeans,
-are trademarks or registered trademarks of Sun Microsystems, Inc in the U.S.
-and other countries.
-
-All SPARC trademarks are used under license and are trademarks
-or registered trademarks of SPARC International, Inc.
-in the U.S. and other countries. Products bearing SPARC
-trademarks are based upon an architecture developed by Sun Microsystems, Inc.
-
-PostScript is a registered trademark of Adobe Systems, Inc.
-
-Federal Acquisitions: Commercial Software - Government Users Subject to
-Standard License Terms and Conditions.
-
-DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED
-CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
-IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT
-TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY
-INVALID.
-
-_________________________________________________________________________
-
-Copyright 2000-2001 Sun Microsystems, Inc.,
-901 San Antonio Road, Palo Alto, CA 94303, Etats-Unis.
-Tous droits re'serve's.
-
-
-Ce produit ou document est prote'ge' par un copyright et distribue' avec
-des licences qui en restreignent l'utilisation, la copie, la distribution,
-et la de'compilation. Aucune partie de ce produit ou de sa documentation
-associe'e ne peut e^tre reproduite sous aucune forme, par quelque moyen
-que ce soit, sans l'autorisation pre'alable et e'crite de Sun et de ses
-bailleurs de licence, s'il y en a.
-
-Le logiciel de'tenu par des tiers, et qui comprend la technologie
-relative aux polices de caracte`res, est prote'ge' par un copyright
-et licencie' par des fournisseurs de Sun.
-
-Sun, Sun Microsystems, le logo Sun, Solaris, Java, JavaServer Pages, Java
-Naming and Directory Interface, JDBC, JDK, JavaMail, et Enterprise JavaBeans,
-sont des marques de fabrique ou des marques de'pose'es de Sun
-Microsystems, Inc. aux Etats-Unis et dans d'autres pays.
-
-Toutes les marques SPARC sont utilise'es sous licence et sont
-des marques de fabrique ou des marques de'pose'es de SPARC
-International, Inc. aux Etats-Unis et dans
-d'autres pays. Les produits portant les marques SPARC sont
-base's sur une architecture de'veloppe'e par Sun Microsystems, Inc.
-
-Postcript est une marque enregistre'e d'Adobe Systems Inc.
-
-LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS,
-DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES,
-DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT
-TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE
-A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
--->
-
-<!--
-This is the XML DTD for the Servlet 2.3 deployment descriptor.
-All Servlet 2.3 deployment descriptors must include a DOCTYPE
-of the following form:
-
- <!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-
--->
-
-<!--
-The following conventions apply to all J2EE deployment descriptor
-elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace
- in the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is
- case sensitive.
-
-- In elements that specify a pathname to a file within the same
- JAR file, relative filenames (i.e., those not starting with "/")
- are considered relative to the root of the JAR file's namespace.
- Absolute filenames (i.e., those starting with "/") also specify
- names in the root of the JAR file's namespace. In general, relative
- names are preferred. The exception is .war files where absolute
- names are preferred for consistency with the servlet API.
--->
-
-
-<!--
-The web-app element is the root of the deployment descriptor for
-a web application.
--->
-<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
-context-param*, filter*, filter-mapping*, listener*, servlet*,
-servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
-error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
-login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
-
-<!--
-The auth-constraint element indicates the user roles that should
-be permitted access to this resource collection. The role-name
-used here must either correspond to the role-name of one of the
-security-role elements defined for this web application, or be
-the specially reserved role-name "*" that is a compact syntax for
-indicating all roles in the web application. If both "*" and
-rolenames appear, the container interprets this as all roles.
-If no roles are defined, no user is allowed access to the portion of
-the web application described by the containing security-constraint.
-The container matches role names case sensitively when determining
-access.
-
-
-Used in: security-constraint
--->
-<!ELEMENT auth-constraint (description?, role-name*)>
-
-<!--
-The auth-method element is used to configure the authentication
-mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization
-constraint, a user must have authenticated using the configured
-mechanism. Legal values for this element are "BASIC", "DIGEST",
-"FORM", or "CLIENT-CERT".
-
-Used in: login-config
--->
-<!ELEMENT auth-method (#PCDATA)>
-
-<!--
-The context-param element contains the declaration of a web
-application's servlet context initialization parameters.
-
-Used in: web-app
--->
-<!ELEMENT context-param (param-name, param-value, description?)>
-
-<!--
-The description element is used to provide text describing the parent
-element. The description element should include any information that
-the web application war file producer wants to provide to the consumer of
-the web application war file (i.e., to the Deployer). Typically, the tools
-used by the web application war file consumer will display the description
-when processing the parent element that contains the description.
-
-Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,
-env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,
-security-role, security-role-ref, servlet, user-data-constraint,
-web-app, web-resource-collection
--->
-<!ELEMENT description (#PCDATA)>
-
-<!--
-The display-name element contains a short name that is intended to be
-displayed by tools. The display name need not be unique.
-
-Used in: filter, security-constraint, servlet, web-app
-
-Example:
-
-<display-name>Employee Self Service</display-name>
--->
-<!ELEMENT display-name (#PCDATA)>
-
-<!--
-The distributable element, by its presence in a web application
-deployment descriptor, indicates that this web application is
-programmed appropriately to be deployed into a distributed servlet
-container
-
-Used in: web-app
--->
-<!ELEMENT distributable EMPTY>
-
-<!--
-The ejb-link element is used in the ejb-ref or ejb-local-ref
-elements to specify that an EJB reference is linked to an
-enterprise bean.
-
-The name in the ejb-link element is composed of a
-path name specifying the ejb-jar containing the referenced enterprise
-bean with the ejb-name of the target bean appended and separated from
-the path name by "#". The path name is relative to the war file
-containing the web application that is referencing the enterprise bean.
-This allows multiple enterprise beans with the same ejb-name to be
-uniquely identified.
-
-Used in: ejb-local-ref, ejb-ref
-
-Examples:
-
- <ejb-link>EmployeeRecord</ejb-link>
-
- <ejb-link>../products/product.jar#ProductEJB</ejb-link>
-
--->
-<!ELEMENT ejb-link (#PCDATA)>
-
-<!--
-The ejb-local-ref element is used for the declaration of a reference to
-an enterprise bean's local home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of the web application
- that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected local home and local interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,
- local-home, local, ejb-link?)>
-
-<!--
-The ejb-ref element is used for the declaration of a reference to
-an enterprise bean's home. The declaration consists of:
-
- - an optional description
- - the EJB reference name used in the code of
- the web application that's referencing the enterprise bean
- - the expected type of the referenced enterprise bean
- - the expected home and remote interfaces of the referenced
- enterprise bean
- - optional ejb-link information, used to specify the referenced
- enterprise bean
-
-Used in: web-app
--->
-<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,
- home, remote, ejb-link?)>
-
-<!--
-The ejb-ref-name element contains the name of an EJB reference. The
-EJB reference is an entry in the web application's environment and is
-relative to the java:comp/env context. The name must be unique
-within the web application.
-
-It is recommended that name is prefixed with "ejb/".
-
-Used in: ejb-local-ref, ejb-ref
-
-Example:
-
-<ejb-ref-name>ejb/Payroll</ejb-ref-name>
--->
-<!ELEMENT ejb-ref-name (#PCDATA)>
-
-<!--
-The ejb-ref-type element contains the expected type of the
-referenced enterprise bean.
-
-The ejb-ref-type element must be one of the following:
-
- <ejb-ref-type>Entity</ejb-ref-type>
- <ejb-ref-type>Session</ejb-ref-type>
-
-Used in: ejb-local-ref, ejb-ref
--->
-<!ELEMENT ejb-ref-type (#PCDATA)>
-
-<!--
-The env-entry element contains the declaration of a web application's
-environment entry. The declaration consists of an optional
-description, the name of the environment entry, and an optional
-value. If a value is not specified, one must be supplied
-during deployment.
--->
-<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,
-env-entry-type)>
-
-<!--
-The env-entry-name element contains the name of a web applications's
-environment entry. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within a web application.
-
-Example:
-
-<env-entry-name>minAmount</env-entry-name>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-name (#PCDATA)>
-
-<!--
-The env-entry-type element contains the fully-qualified Java type of
-the environment entry value that is expected by the web application's
-code.
-
-The following are the legal values of env-entry-type:
-
- java.lang.Boolean
- java.lang.Byte
- java.lang.Character
- java.lang.String
- java.lang.Short
- java.lang.Integer
- java.lang.Long
- java.lang.Float
- java.lang.Double
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-type (#PCDATA)>
-
-<!--
-The env-entry-value element contains the value of a web application's
-environment entry. The value must be a String that is valid for the
-constructor of the specified type that takes a single String
-parameter, or for java.lang.Character, a single character.
-
-Example:
-
-<env-entry-value>100.00</env-entry-value>
-
-Used in: env-entry
--->
-<!ELEMENT env-entry-value (#PCDATA)>
-
-<!--
-The error-code contains an HTTP error code, ex: 404
-
-Used in: error-page
--->
-<!ELEMENT error-code (#PCDATA)>
-
-<!--
-The error-page element contains a mapping between an error code
-or exception type to the path of a resource in the web application
-
-Used in: web-app
--->
-<!ELEMENT error-page ((error-code | exception-type), location)>
-
-<!--
-The exception type contains a fully qualified class name of a
-Java exception type.
-
-Used in: error-page
--->
-<!ELEMENT exception-type (#PCDATA)>
-
-<!--
-The extension element contains a string describing an
-extension. example: "txt"
-
-Used in: mime-mapping
--->
-<!ELEMENT extension (#PCDATA)>
-
-<!--
-Declares a filter in the web application. The filter is mapped to
-either a servlet or a URL pattern in the filter-mapping element, using
-the filter-name value to reference. Filters can access the
-initialization parameters declared in the deployment descriptor at
-runtime via the FilterConfig interface.
-
-Used in: web-app
--->
-<!ELEMENT filter (icon?, filter-name, display-name?, description?,
-filter-class, init-param*)>
-
-<!--
-The fully qualified classname of the filter.
-
-Used in: filter
--->
-<!ELEMENT filter-class (#PCDATA)>
-
-<!--
-Declaration of the filter mappings in this web application. The
-container uses the filter-mapping declarations to decide which filters
-to apply to a request, and in what order. The container matches the
-request URI to a Servlet in the normal way. To determine which filters
-to apply it matches filter-mapping declarations either on servlet-name,
-or on url-pattern for each filter-mapping element, depending on which
-style is used. The order in which filters are invoked is the order in
-which filter-mapping declarations that match a request URI for a
-servlet appear in the list of filter-mapping elements.The filter-name
-value must be the value of the <filter-name> sub-elements of one of the
-<filter> declarations in the deployment descriptor.
-
-Used in: web-app
--->
-<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>
-
-<!--
-The logical name of the filter. This name is used to map the filter.
-Each filter name is unique within the web application.
-
-Used in: filter, filter-mapping
--->
-<!ELEMENT filter-name (#PCDATA)>
-
-<!--
-The form-error-page element defines the location in the web app
-where the error page that is displayed when login is not successful
-can be found. The path begins with a leading / and is interpreted
-relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-error-page (#PCDATA)>
-
-<!--
-The form-login-config element specifies the login and error pages
-that should be used in form based login. If form based authentication
-is not used, these elements are ignored.
-
-Used in: login-config
--->
-<!ELEMENT form-login-config (form-login-page, form-error-page)>
-
-<!--
-The form-login-page element defines the location in the web app
-where the page that can be used for login can be found. The path
-begins with a leading / and is interpreted relative to the root of the WAR.
-
-Used in: form-login-config
--->
-<!ELEMENT form-login-page (#PCDATA)>
-
-<!--
-The home element contains the fully-qualified name of the enterprise
-bean's home interface.
-
-Used in: ejb-ref
-
-Example:
-
-<home>com.aardvark.payroll.PayrollHome</home>
--->
-<!ELEMENT home (#PCDATA)>
-
-<!--
-The http-method contains an HTTP method (GET | POST |...).
-
-Used in: web-resource-collection
--->
-<!ELEMENT http-method (#PCDATA)>
-
-<!--
-The icon element contains small-icon and large-icon elements that
-specify the file names for small and a large GIF or JPEG icon images
-used to represent the parent element in a GUI tool.
-
-Used in: filter, servlet, web-app
--->
-<!ELEMENT icon (small-icon?, large-icon?)>
-
-<!--
-The init-param element contains a name/value pair as an
-initialization param of the servlet
-
-Used in: filter, servlet
--->
-<!ELEMENT init-param (param-name, param-value, description?)>
-
-<!--
-The jsp-file element contains the full path to a JSP file within
-the web application beginning with a `/'.
-
-Used in: servlet
--->
-<!ELEMENT jsp-file (#PCDATA)>
-
-<!--
-The large-icon element contains the name of a file
-containing a large (32 x 32) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<large-icon>employee-service-icon32x32.jpg</large-icon>
--->
-<!ELEMENT large-icon (#PCDATA)>
-
-<!--
-The listener element indicates the deployment properties for a web
-application listener bean.
-
-Used in: web-app
--->
-<!ELEMENT listener (listener-class)>
-
-<!--
-The listener-class element declares a class in the application must be
-registered as a web application listener bean. The value is the fully qualified classname of the listener class.
-
-
-Used in: listener
--->
-<!ELEMENT listener-class (#PCDATA)>
-
-<!--
-The load-on-startup element indicates that this servlet should be
-loaded (instantiated and have its init() called) on the startup
-of the web application. The optional contents of
-these element must be an integer indicating the order in which
-the servlet should be loaded. If the value is a negative integer,
-or the element is not present, the container is free to load the
-servlet whenever it chooses. If the value is a positive integer
-or 0, the container must load and initialize the servlet as the
-application is deployed. The container must guarantee that
-servlets marked with lower integers are loaded before servlets
-marked with higher integers. The container may choose the order
-of loading of servlets with the same load-on-start-up value.
-
-Used in: servlet
--->
-<!ELEMENT load-on-startup (#PCDATA)>
-
-<!--
-
-The local element contains the fully-qualified name of the
-enterprise bean's local interface.
-
-Used in: ejb-local-ref
-
--->
-<!ELEMENT local (#PCDATA)>
-
-<!--
-
-The local-home element contains the fully-qualified name of the
-enterprise bean's local home interface.
-
-Used in: ejb-local-ref
--->
-<!ELEMENT local-home (#PCDATA)>
-
-<!--
-The location element contains the location of the resource in the web
-application relative to the root of the web application. The value of
-the location must have a leading `/'.
-
-Used in: error-page
--->
-<!ELEMENT location (#PCDATA)>
-
-<!--
-The login-config element is used to configure the authentication
-method that should be used, the realm name that should be used for
-this application, and the attributes that are needed by the form login
-mechanism.
-
-Used in: web-app
--->
-<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>
-
-<!--
-The mime-mapping element defines a mapping between an extension
-and a mime type.
-
-Used in: web-app
--->
-<!ELEMENT mime-mapping (extension, mime-type)>
-
-<!--
-The mime-type element contains a defined mime type. example:
-"text/plain"
-
-Used in: mime-mapping
--->
-<!ELEMENT mime-type (#PCDATA)>
-
-<!--
-The param-name element contains the name of a parameter. Each parameter
-name must be unique in the web application.
-
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-name (#PCDATA)>
-
-<!--
-The param-value element contains the value of a parameter.
-
-Used in: context-param, init-param
--->
-<!ELEMENT param-value (#PCDATA)>
-
-<!--
-The realm name element specifies the realm name to use in HTTP
-Basic authorization.
-
-Used in: login-config
--->
-<!ELEMENT realm-name (#PCDATA)>
-
-<!--
-The remote element contains the fully-qualified name of the enterprise
-bean's remote interface.
-
-Used in: ejb-ref
-
-Example:
-
-<remote>com.wombat.empl.EmployeeService</remote>
--->
-<!ELEMENT remote (#PCDATA)>
-
-<!--
-The res-auth element specifies whether the web application code signs
-on programmatically to the resource manager, or whether the Container
-will sign on to the resource manager on behalf of the web application. In the
-latter case, the Container uses information that is supplied by the
-Deployer.
-
-The value of this element must be one of the two following:
-
- <res-auth>Application</res-auth>
- <res-auth>Container</res-auth>
-
-Used in: resource-ref
--->
-<!ELEMENT res-auth (#PCDATA)>
-
-<!--
-The res-ref-name element specifies the name of a resource manager
-connection factory reference. The name is a JNDI name relative to the
-java:comp/env context. The name must be unique within a web application.
-
-Used in: resource-ref
--->
-<!ELEMENT res-ref-name (#PCDATA)>
-
-<!--
-The res-sharing-scope element specifies whether connections obtained
-through the given resource manager connection factory reference can be
-shared. The value of this element, if specified, must be one of the
-two following:
-
- <res-sharing-scope>Shareable</res-sharing-scope>
- <res-sharing-scope>Unshareable</res-sharing-scope>
-
-The default value is Shareable.
-
-Used in: resource-ref
--->
-<!ELEMENT res-sharing-scope (#PCDATA)>
-
-<!--
-The res-type element specifies the type of the data source. The type
-is specified by the fully qualified Java language class or interface
-expected to be implemented by the data source.
-
-Used in: resource-ref
--->
-<!ELEMENT res-type (#PCDATA)>
-
-<!--
-The resource-env-ref element contains a declaration of a web application's
-reference to an administered object associated with a resource
-in the web application's environment. It consists of an optional
-description, the resource environment reference name, and an
-indication of the resource environment reference type expected by
-the web application code.
-
-Used in: web-app
-
-Example:
-
-<resource-env-ref>
- <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>
- <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
-</resource-env-ref>
--->
-<!ELEMENT resource-env-ref (description?, resource-env-ref-name,
- resource-env-ref-type)>
-
-<!--
-The resource-env-ref-name element specifies the name of a resource
-environment reference; its value is the environment entry name used in
-the web application code. The name is a JNDI name relative to the
-java:comp/env context and must be unique within a web application.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-name (#PCDATA)>
-
-<!--
-The resource-env-ref-type element specifies the type of a resource
-environment reference. It is the fully qualified name of a Java
-language class or interface.
-
-Used in: resource-env-ref
--->
-<!ELEMENT resource-env-ref-type (#PCDATA)>
-
-<!--
-The resource-ref element contains a declaration of a web application's
-reference to an external resource. It consists of an optional
-description, the resource manager connection factory reference name,
-the indication of the resource manager connection factory type
-expected by the web application code, the type of authentication
-(Application or Container), and an optional specification of the
-shareability of connections obtained from the resource (Shareable or
-Unshareable).
-
-Used in: web-app
-
-Example:
-
- <resource-ref>
- <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
- <res-type>javax.sql.DataSource</res-type>
- <res-auth>Container</res-auth>
- <res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref>
--->
-<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,
- res-sharing-scope?)>
-
-<!--
-The role-link element is a reference to a defined security role. The
-role-link element must contain the name of one of the security roles
-defined in the security-role elements.
-
-Used in: security-role-ref
--->
-<!ELEMENT role-link (#PCDATA)>
-
-<!--
-The role-name element contains the name of a security role.
-
-The name must conform to the lexical rules for an NMTOKEN.
-
-Used in: auth-constraint, run-as, security-role, security-role-ref
--->
-<!ELEMENT role-name (#PCDATA)>
-
-<!--
-The run-as element specifies the run-as identity to be used for the
-execution of the web application. It contains an optional description, and
-the name of a security role.
-
-Used in: servlet
--->
-<!ELEMENT run-as (description?, role-name)>
-
-<!--
-The security-constraint element is used to associate security
-constraints with one or more web resource collections
-
-Used in: web-app
--->
-<!ELEMENT security-constraint (display-name?, web-resource-collection+,
-auth-constraint?, user-data-constraint?)>
-
-<!--
-The security-role element contains the definition of a security
-role. The definition consists of an optional description of the
-security role, and the security role name.
-
-Used in: web-app
-
-Example:
-
- <security-role>
- <description>
- This role includes all employees who are authorized
- to access the employee service application.
- </description>
- <role-name>employee</role-name>
- </security-role>
--->
-<!ELEMENT security-role (description?, role-name)>
-
-<!--
-The security-role-ref element contains the declaration of a security
-role reference in the web application's code. The declaration consists
-of an optional description, the security role name used in the code,
-and an optional link to a security role. If the security role is not
-specified, the Deployer must choose an appropriate security role.
-
-The value of the role-name element must be the String used as the
-parameter to the EJBContext.isCallerInRole(String roleName) method
-or the HttpServletRequest.isUserInRole(String role) method.
-
-Used in: servlet
-
--->
-<!ELEMENT security-role-ref (description?, role-name, role-link?)>
-
-<!--
-The servlet element contains the declarative data of a
-servlet. If a jsp-file is specified and the load-on-startup element is
-present, then the JSP should be precompiled and loaded.
-
-Used in: web-app
--->
-<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
-(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>
-
-<!--
-The servlet-class element contains the fully qualified class name
-of the servlet.
-
-Used in: servlet
--->
-<!ELEMENT servlet-class (#PCDATA)>
-
-<!--
-The servlet-mapping element defines a mapping between a servlet
-and a url pattern
-
-Used in: web-app
--->
-<!ELEMENT servlet-mapping (servlet-name, url-pattern)>
-
-<!--
-The servlet-name element contains the canonical name of the
-servlet. Each servlet name is unique within the web application.
-
-Used in: filter-mapping, servlet, servlet-mapping
--->
-<!ELEMENT servlet-name (#PCDATA)>
-
-<!--
-The session-config element defines the session parameters for
-this web application.
-
-Used in: web-app
--->
-<!ELEMENT session-config (session-timeout?)>
-
-<!--
-The session-timeout element defines the default session timeout
-interval for all sessions created in this web application. The
-specified timeout must be expressed in a whole number of minutes.
-If the timeout is 0 or less, the container ensures the default
-behaviour of sessions is never to time out.
-
-Used in: session-config
--->
-<!ELEMENT session-timeout (#PCDATA)>
-
-<!--
-The small-icon element contains the name of a file
-containing a small (16 x 16) icon image. The file
-name is a relative path within the web application's
-war file.
-
-The image may be either in the JPEG or GIF format.
-The icon can be used by tools.
-
-Used in: icon
-
-Example:
-
-<small-icon>employee-service-icon16x16.jpg</small-icon>
--->
-<!ELEMENT small-icon (#PCDATA)>
-
-<!--
-The taglib element is used to describe a JSP tag library.
-
-Used in: web-app
--->
-<!ELEMENT taglib (taglib-uri, taglib-location)>
-
-<!--
-the taglib-location element contains the location (as a resource
-relative to the root of the web application) where to find the Tag
-Libary Description file for the tag library.
-
-Used in: taglib
--->
-<!ELEMENT taglib-location (#PCDATA)>
-
-<!--
-The taglib-uri element describes a URI, relative to the location
-of the web.xml document, identifying a Tag Library used in the Web
-Application.
-
-Used in: taglib
--->
-<!ELEMENT taglib-uri (#PCDATA)>
-
-<!--
-The transport-guarantee element specifies that the communication
-between client and server should be NONE, INTEGRAL, or
-CONFIDENTIAL. NONE means that the application does not require any
-transport guarantees. A value of INTEGRAL means that the application
-requires that the data sent between the client and server be sent in
-such a way that it can't be changed in transit. CONFIDENTIAL means
-that the application requires that the data be transmitted in a
-fashion that prevents other entities from observing the contents of
-the transmission. In most cases, the presence of the INTEGRAL or
-CONFIDENTIAL flag will indicate that the use of SSL is required.
-
-Used in: user-data-constraint
--->
-<!ELEMENT transport-guarantee (#PCDATA)>
-
-<!--
-The url-pattern element contains the url pattern of the mapping. Must
-follow the rules specified in Section 11.2 of the Servlet API
-Specification.
-
-Used in: filter-mapping, servlet-mapping, web-resource-collection
--->
-<!ELEMENT url-pattern (#PCDATA)>
-
-<!--
-The user-data-constraint element is used to indicate how data
-communicated between the client and container should be protected.
-
-Used in: security-constraint
--->
-<!ELEMENT user-data-constraint (description?, transport-guarantee)>
-
-<!--
-The web-resource-collection element is used to identify a subset
-of the resources and HTTP methods on those resources within a web
-application to which a security constraint applies. If no HTTP methods
-are specified, then the security constraint applies to all HTTP
-methods.
-
-Used in: security-constraint
--->
-<!ELEMENT web-resource-collection (web-resource-name, description?,
-url-pattern*, http-method*)>
-
-<!--
-The web-resource-name contains the name of this web resource
-collection.
-
-Used in: web-resource-collection
--->
-<!ELEMENT web-resource-name (#PCDATA)>
-
-<!--
-The welcome-file element contains file name to use as a default
-welcome file, such as index.html
-
-Used in: welcome-file-list
--->
-<!ELEMENT welcome-file (#PCDATA)>
-
-<!--
-The welcome-file-list contains an ordered list of welcome files
-elements.
-
-Used in: web-app
--->
-<!ELEMENT welcome-file-list (welcome-file+)>
-
-<!--
-The ID mechanism is to allow tools that produce additional deployment
-information (i.e., information beyond the standard deployment
-descriptor information) to store the non-standard information in a
-separate file, and easily refer from these tool-specific files to the
-information in the standard deployment descriptor.
-
-Tools are not allowed to add the non-standard information into the
-standard deployment descriptor.
--->
-
-<!ATTLIST auth-constraint id ID #IMPLIED>
-<!ATTLIST auth-method id ID #IMPLIED>
-<!ATTLIST context-param id ID #IMPLIED>
-<!ATTLIST description id ID #IMPLIED>
-<!ATTLIST display-name id ID #IMPLIED>
-<!ATTLIST distributable id ID #IMPLIED>
-<!ATTLIST ejb-link id ID #IMPLIED>
-<!ATTLIST ejb-local-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref id ID #IMPLIED>
-<!ATTLIST ejb-ref-name id ID #IMPLIED>
-<!ATTLIST ejb-ref-type id ID #IMPLIED>
-<!ATTLIST env-entry id ID #IMPLIED>
-<!ATTLIST env-entry-name id ID #IMPLIED>
-<!ATTLIST env-entry-type id ID #IMPLIED>
-<!ATTLIST env-entry-value id ID #IMPLIED>
-<!ATTLIST error-code id ID #IMPLIED>
-<!ATTLIST error-page id ID #IMPLIED>
-<!ATTLIST exception-type id ID #IMPLIED>
-<!ATTLIST extension id ID #IMPLIED>
-<!ATTLIST filter id ID #IMPLIED>
-<!ATTLIST filter-class id ID #IMPLIED>
-<!ATTLIST filter-mapping id ID #IMPLIED>
-<!ATTLIST filter-name id ID #IMPLIED>
-<!ATTLIST form-error-page id ID #IMPLIED>
-<!ATTLIST form-login-config id ID #IMPLIED>
-<!ATTLIST form-login-page id ID #IMPLIED>
-<!ATTLIST home id ID #IMPLIED>
-<!ATTLIST http-method id ID #IMPLIED>
-<!ATTLIST icon id ID #IMPLIED>
-<!ATTLIST init-param id ID #IMPLIED>
-<!ATTLIST jsp-file id ID #IMPLIED>
-<!ATTLIST large-icon id ID #IMPLIED>
-<!ATTLIST listener id ID #IMPLIED>
-<!ATTLIST listener-class id ID #IMPLIED>
-<!ATTLIST load-on-startup id ID #IMPLIED>
-<!ATTLIST local id ID #IMPLIED>
-<!ATTLIST local-home id ID #IMPLIED>
-<!ATTLIST location id ID #IMPLIED>
-<!ATTLIST login-config id ID #IMPLIED>
-<!ATTLIST mime-mapping id ID #IMPLIED>
-<!ATTLIST mime-type id ID #IMPLIED>
-<!ATTLIST param-name id ID #IMPLIED>
-<!ATTLIST param-value id ID #IMPLIED>
-<!ATTLIST realm-name id ID #IMPLIED>
-<!ATTLIST remote id ID #IMPLIED>
-<!ATTLIST res-auth id ID #IMPLIED>
-<!ATTLIST res-ref-name id ID #IMPLIED>
-<!ATTLIST res-sharing-scope id ID #IMPLIED>
-<!ATTLIST res-type id ID #IMPLIED>
-<!ATTLIST resource-env-ref id ID #IMPLIED>
-<!ATTLIST resource-env-ref-name id ID #IMPLIED>
-<!ATTLIST resource-env-ref-type id ID #IMPLIED>
-<!ATTLIST resource-ref id ID #IMPLIED>
-<!ATTLIST role-link id ID #IMPLIED>
-<!ATTLIST role-name id ID #IMPLIED>
-<!ATTLIST run-as id ID #IMPLIED>
-<!ATTLIST security-constraint id ID #IMPLIED>
-<!ATTLIST security-role id ID #IMPLIED>
-<!ATTLIST security-role-ref id ID #IMPLIED>
-<!ATTLIST servlet id ID #IMPLIED>
-<!ATTLIST servlet-class id ID #IMPLIED>
-<!ATTLIST servlet-mapping id ID #IMPLIED>
-<!ATTLIST servlet-name id ID #IMPLIED>
-<!ATTLIST session-config id ID #IMPLIED>
-<!ATTLIST session-timeout id ID #IMPLIED>
-<!ATTLIST small-icon id ID #IMPLIED>
-<!ATTLIST taglib id ID #IMPLIED>
-<!ATTLIST taglib-location id ID #IMPLIED>
-<!ATTLIST taglib-uri id ID #IMPLIED>
-<!ATTLIST transport-guarantee id ID #IMPLIED>
-<!ATTLIST url-pattern id ID #IMPLIED>
-<!ATTLIST user-data-constraint id ID #IMPLIED>
-<!ATTLIST web-app id ID #IMPLIED>
-<!ATTLIST web-resource-collection id ID #IMPLIED>
-<!ATTLIST web-resource-name id ID #IMPLIED>
-<!ATTLIST welcome-file id ID #IMPLIED>
-<!ATTLIST welcome-file-list id ID #IMPLIED>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/anchors.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/anchors.jsp
deleted file mode 100644
index 5d33196be..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/anchors.jsp
+++ /dev/null
@@ -1,27 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<h3><fmt:message key="anchors.page">
- <fmt:param value="${nutchAnchors.url}" />
-</fmt:message></h3>
-<h3><fmt:message key="anchors.anchors" /></h3>
-<ul>
- <c:forEach var="anchor" items="${nutchAnchors.anchors}">
- <li><c:out value="${anchor}" /></li>
- </c:forEach>
-</ul>
-<br />
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/cached.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/cached.jsp
deleted file mode 100644
index 45a5384cd..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/cached.jsp
+++ /dev/null
@@ -1,45 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<c:if test="${isHtml}">
- <base href="<c:out value="${url}"/>">
-</c:if>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<h2 style="{color: rgb(255, 153, 0)}"><fmt:message
- key="cached.title" /></h2>
-<h3><fmt:message key="cached.page">
- <fmt:param value="${url}" />
-</fmt:message></h3>
-<hr />
-<c:choose>
- <c:when test="${isHtml}">
- <c:choose>
- <c:when test="${content!=null && content!=''}">
- <c:out value="${content}" escapeXml="false" />
- </c:when>
- <c:otherwise>
- <fmt:message key="cached.noContent" />
- </c:otherwise>
- </c:choose>
- </c:when>
- <c:otherwise>
- <fmt:message key="cached.notHtml">
- <fmt:param value="${contentType}" />
- <fmt:param value="${id}" />
- </fmt:message>
- </c:otherwise>
-</c:choose>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/common.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/common.jsp
deleted file mode 100644
index c930c37ae..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/common.jsp
+++ /dev/null
@@ -1,20 +0,0 @@
-<%--
- 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.
---%>
-<%@ page session="false"%>
-<%@ taglib prefix="tiles" uri="/tags/struts-tiles"%>
-<%@ taglib prefix="c" uri="/tags/jstl-c"%>
-<%@ taglib prefix="fmt" uri="/tags/jstl-fmt"%>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/decorator.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/decorator.jsp
deleted file mode 100644
index 73c39f5ab..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/decorator.jsp
+++ /dev/null
@@ -1,19 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<tiles:useAttribute name="decorator" />
-<c:import url="${decorator}" />
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/explain.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/explain.jsp
deleted file mode 100644
index 31a610f70..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/explain.jsp
+++ /dev/null
@@ -1,23 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<h3><fmt:message key="explain.page" /></h3>
-<c:out value="${hitDetails}" escapeXml="false" />
-<h3><fmt:message key="explain.scoreForQuery">
- <fmt:param value="${query}" />
-</fmt:message></h3>
-<c:out value="${explanation}" escapeXml="false" />
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/footer.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/footer.jsp
deleted file mode 100644
index 46a3594eb..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/footer.jsp
+++ /dev/null
@@ -1,27 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<div id="footer"><c:if test="${nutchSearch.isSearch=='true'}">
- <table bgcolor="3333ff" align="right">
- <tr>
- <td bgcolor="ff9900"><a
- href="opensearch?query=<c:out value="${nutchSearch.queryString}"/>"><font
- color="ffffff"><b>RSS</b> </font></a></td>
- </tr>
- </table>
-</c:if> <a href="http://wiki.apache.org/nutch/FAQ"> <img border="0"
- src="img/poweredbynutch_01.gif"> </a></div>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/header.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/header.jsp
deleted file mode 100644
index 312eb6291..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/header.jsp
+++ /dev/null
@@ -1,36 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<tiles:useAttribute name="title" ignore="true"
- classname="java.lang.String" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title><fmt:message key="${title}" /><c:if
- test="${nutchSearch!=null}"> - <c:out
- value="${nutchSearch.queryString}" />
-</c:if></title>
-<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
-<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
-<tiles:insert name="style" />
-<c:if test="${nutchSearch!=null}">
- <link rel="alternate" type="application/rss+xml" title="RSS"
- href="opensearch?query=<c:out value="${nutchSearch.queryString}"/>" />
- <script type="text/javascript">
- <!--
-function queryfocus() { document.search.query.focus(); }
-// -->
-</script>
-</c:if>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/i18ncontent.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/i18ncontent.jsp
deleted file mode 100644
index b18d68475..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/i18ncontent.jsp
+++ /dev/null
@@ -1,18 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<c:out value="${content}" escapeXml="false" />
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/navigate.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/navigate.jsp
deleted file mode 100644
index 20f29a373..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/navigate.jsp
+++ /dev/null
@@ -1,32 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<div id="navigation"><c:if test="${nutchSearch.hasNextPage==true}">
- <form name="search" action="search.do" method="get"><input
- type="submit" value="<fmt:message key="search.next"/>"> <c:forEach
- var="urlParameter" items="${nutchSearch.formProperties}">
- <input type="hidden" name="<c:out value="${urlParameter.key}"/>"
- value="<c:out value="${urlParameter.value}"/>" />
- </c:forEach></form>
-</c:if> <c:if test="${nutchSearch.showAllHits==true}">
- <form name="search" action="search.do" method="get"><input
- type="submit" value="<fmt:message key="search.showAllHits"/>">
- <c:forEach var="urlParameter" items="${nutchSearch.formProperties}">
- <input type="hidden" name="<c:out value="${urlParameter.key}"/>"
- value="<c:out value="${urlParameter.value}"/>" />
- </c:forEach></form>
-</c:if></div>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/noResults.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/noResults.jsp
deleted file mode 100644
index c70358d8e..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/noResults.jsp
+++ /dev/null
@@ -1,20 +0,0 @@
-<%--
- 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.
---%>
-<div id="noResults"><%@ include file="common.jsp"%>
-<fmt:message key="search.noResults">
- <fmt:param value="${nutchSearch.htmlQueryString}" />
-</fmt:message></div>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/preferences.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/preferences.jsp
deleted file mode 100644
index 1f0fa8330..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/preferences.jsp
+++ /dev/null
@@ -1,33 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<tiles:importAttribute />
-<form action="preferencesSave.do"><fmt:message
- key="preferences.ui.language" /> <select name="L">
- <c:forEach var="language" items="${languages}">
- <option value="<c:out value="${language}"/>"><fmt:message
- key="${language }" /></option>
- </c:forEach>
-</select> <fmt:message key="preferences.ui.language.info" /> <br />
-<fmt:message key="preferences.numResults" /> <select name="R">
- <c:forEach var="hits" items="${hitsPerPage}">
- <option value="<c:out value="${hits}"/>"><c:out
- value="${hits}" /></option>
- </c:forEach>
-</select> <fmt:message key="preferences.numResults.info" /> <br />
-<input type="submit" value="<fmt:message key="preferences.submit"/>" />
-</form>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/results.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/results.jsp
deleted file mode 100644
index 9a3fa5a86..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/results.jsp
+++ /dev/null
@@ -1,40 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<c:forEach var="hit" items="${nutchSearch.results}">
- <c:set var="hit" scope="request" value="${hit}" />
- <b><a href="<c:out value="${hit.url}"/>"><c:out
- value="${hit.title}" /></a></b>
- <br />
- <tiles:insert definition="more" ignore="true"/>
- <c:out value="${hit.summary}" escapeXml="false" />
- <br>
- <span class="url"><c:out value="${hit.encodedUrl}" /></span>
- (<a href="cached.do?<c:out value="${hit.id}"/>"><fmt:message
- key="search.cached" /></a>)
- (<a
- href="explain.do?<c:out value="${hit.id}"/>&query=<c:out value="${hit.urlEncodedQuery}"/>"><fmt:message
- key="search.explain" /></a>)
- (<a href="anchors.do?<c:out value="${hit.id}"/>"><fmt:message
- key="search.anchors" /></a>)
-<c:if test="${hit.hasMore==true}">
- (<a href="search.do?<c:out value="${hit.moreUrl}"/>"><fmt:message
- key="search.moreFrom" /> <c:out value="${hit.dedupValue}" /></a>)
-</c:if>
- <br />
- <br />
-</c:forEach>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/search.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/search.jsp
deleted file mode 100644
index 23c9149e8..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/search.jsp
+++ /dev/null
@@ -1,49 +0,0 @@
-<%--
- 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.
---%>
-<%@ include file="common.jsp"%>
-<c:choose>
- <c:when test="${nutchSearch.isSearch}">
- <form name="search" action="search.do" method="get"><input
- name="query" size="44"
- value="<c:out value="${nutchSearch.queryString}"/>"> <input
- type="submit" value="<fmt:message key="search.search"/>"> <a
- href="help.do"><fmt:message key="search.help" /></a></form>
- <c:choose>
- <c:when test="${nutchSearch.hasResults}">
- <fmt:message key="search.hits">
- <fmt:param value="${nutchSearch.resultInfo[0]}" />
- <fmt:param value="${nutchSearch.resultInfo[1]}" />
- <fmt:param value="${nutchSearch.resultInfo[2]}" />
- <fmt:param value="${nutchSearch.resultInfo[3]}" />
- </fmt:message>
- <br />
- <tiles:insert name="results" flush="true" />
- <!-- optional tile -->
- <tiles:insert definition="cluster" ignore="true" />
- <tiles:insert name="navigate" />
- </c:when>
- <c:otherwise>
- <tiles:insert name="noResults" />
- </c:otherwise>
- </c:choose>
- </c:when>
- <c:otherwise>
- <tiles:insert name="i18nComponent">
- <tiles:put name="basePage" value="/search.html" />
- </tiles:insert>
- </c:otherwise>
-</c:choose>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/jsp/template.jsp b/contrib/web2/src/main/webapp/WEB-INF/jsp/template.jsp
deleted file mode 100644
index 00bfd7089..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/jsp/template.jsp
+++ /dev/null
@@ -1,31 +0,0 @@
-<%--
- 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.
---%>
-<%@page contentType="text/html; charset=utf-8" session="false"%>
-<%@ include file="common.jsp"%>
-<html lang="<fmt:message key="lang"/>">
-<head>
-<tiles:insert name="header" flush="true">
- <tiles:put name="title" beanName="title" />
-</tiles:insert>
-</head>
-<body onLoad="queryfocus();">
-<c:out default="" value="${headerContent}" escapeXml="false" />
-<tiles:insert name="pageBody" flush="true" />
-<tiles:insert name="footer" />
-</body>
-</html>
-
diff --git a/contrib/web2/src/main/webapp/WEB-INF/res/style.css b/contrib/web2/src/main/webapp/WEB-INF/res/style.css
deleted file mode 100644
index c9732d1a5..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/res/style.css
+++ /dev/null
@@ -1,75 +0,0 @@
-.menuTd {
- background-color: #F9F7F4;
- height: 25;
- onMouseOver: this . style . backgroundColor = '#ECE5DC';
-}
-
-.menuTdhover {
- background-color: #ECE5DC;
- height: 25;
- onMouseOver: this . style . backgroundColor = '#ECE5DC';
-}
-
-.menuEntry {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- color: #000000;
- text-decoration: none
-}
-
-.body {
- background-color: #F9F7F4;
-}
-
-.bodytext {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- color: #000000;
- text-decoration: none
-}
-
-.title {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 26px;
- color: #FF9900;
- text-decoration: none
-}
-
-.intro {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- color: #FF9900;
- text-decoration: none
-}
-
-.orangeTd {
- background-color: #FF9900
-}
-
-ul {
- list-style-image: url(../img/reiter/ul.gif)
-}
-
-h3 {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 16px;
- color: #000000;
-}
-
-h4 {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- color: #000000;
-}
-
-.url {
- color: #996600;
-}
-
-.highlight {
- font-weight: bold;
-}
-
-.ellipsis {
- font-weight: bold;
-}
\ No newline at end of file
diff --git a/contrib/web2/src/main/webapp/WEB-INF/struts-config.xml b/contrib/web2/src/main/webapp/WEB-INF/struts-config.xml
deleted file mode 100644
index 62e2b5a3c..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/struts-config.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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.
--->
-<!DOCTYPE struts-config PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
- "dtd/struts-config_1_2.dtd">
-<struts-config>
- <form-beans />
- <!-- =================================== Action Mapping Definitions -->
- <action-mappings>
- <action path="/*" type="org.apache.struts.actions.ForwardAction"
- parameter="{1}Page" />
- </action-mappings>
- <!-- ===================================== Controller Configuration -->
- <!-- Own request processor required because the default one creates a new
- session - a thing we really don't want -->
- <controller
- processorClass="org.apache.nutch.webapp.tiles.NutchRequestProcessor" />
- <!-- ================================ Message Resources Definitions -->
- <message-resources parameter="org.nutch.jsp.resources" null="false" />
- <plug-in className="org.apache.struts.tiles.TilesPlugin">
- <set-property property="definitions-config"
- value="/WEB-INF/tiles-defs.xml" />
- <set-property property="moduleAware" value="true" />
- <set-property property="definitions-parser-validate" value="false" />
- </plug-in>
-</struts-config>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/tiles-defs.xml b/contrib/web2/src/main/webapp/WEB-INF/tiles-defs.xml
deleted file mode 100644
index 65c641f02..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/tiles-defs.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?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.
--->
-<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "dtd/tiles-config_1_1.dtd">
-<tiles-definitions>
- <definition name="stylable">
- <put name="style" value="/include/style.html" />
- </definition>
-
- <definition name="masterlayout" extends="stylable"
- path="/WEB-INF/jsp/template.jsp">
- </definition>
-
- <definition name="template" extends="masterlayout">
- <put name="title" value="title" />
- <put name="header" value=".header" />
- <put name="footer" value="footer" />
- </definition>
-
- <!-- Footer -->
- <definition name="footer" path="/WEB-INF/jsp/footer.jsp" />
-
- <!-- Search -->
- <definition name="searchPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.SearchController">
- <put name="title" value="search.title" />
- <put name="pageBody" value="search" />
- </definition>
- <definition name="search" path="/WEB-INF/jsp/search.jsp" />
-
- <!-- Cached -->
- <definition name="cachedPage" path="/WEB-INF/jsp/cached.jsp"
- controllerClass="org.apache.nutch.webapp.controller.CachedController">
- <put name="title" value="cached.title" />
- </definition>
-
- <!-- Explain -->
- <definition name="explainPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.ExplainController">
- <put name="pageBody" value="explain" />
- <put name="title" value="explain.title" />
- </definition>
- <definition name="explain" path="/WEB-INF/jsp/explain.jsp" />
-
- <!-- Anchors -->
- <definition name="anchorsPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.AnchorsController">
- <put name="pageBody" value="anchors" />
- <put name="title" value="anchors.title" />
- </definition>
- <definition name="anchors" path="/WEB-INF/jsp/anchors.jsp" />
-
- <!-- Search results -->
- <definition name="results" path="/WEB-INF/jsp/results.jsp">
- </definition>
-
- <!-- Search result navigation -->
- <definition name="navigate" path="/WEB-INF/jsp/navigate.jsp" />
-
- <definition name=".header" extends="stylable"
- path="/WEB-INF/jsp/header.jsp"
- controllerClass="org.apache.nutch.webapp.controller.I18NPageController">
- <put name="basePage" content="/include/header.html" />
- <put name="attrName" content="headerContent" />
- </definition>
-
- <!-- Localized pages (help, about,...) -->
- <definition name="localizedPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.I18NPageController">
- <put name="pageBody" value="localized" />
- </definition>
- <definition name="localized" path="/WEB-INF/jsp/i18ncontent.jsp" />
-
- <!-- Help -->
- <definition name="helpPage" extends="localizedPage">
- <put name="basePage" value="/help.html" />
- <put name="title" value="help.title" />
- </definition>
-
- <!-- About -->
- <definition name="aboutPage" extends="localizedPage">
- <put name="basePage" value="/about.html" />
- </definition>
-
- <!-- No Results -->
- <definition name="noResults" path="/WEB-INF/jsp/noResults.jsp" />
-
- <!-- Loclaized component -->
- <definition name="i18nComponent" path="/WEB-INF/jsp/i18ncontent.jsp"
- controllerClass="org.apache.nutch.webapp.controller.I18NPageController">
- </definition>
-
- <!-- Preferences -->
- <definition name="preferencesPage" extends="template"
- controllerClass="org.apache.nutch.webapp.controller.PreferencesController">
- <put name="title" value="preferences.title" />
- <put name="action" value="edit" />
- <put name="pageBody" value="preferences" />
- </definition>
-
- <definition name="preferences" page="/WEB-INF/jsp/preferences.jsp">
- <putList name="languages">
- <add value="ca" />
- <add value="de" />
- <add value="en" />
- <add value="es" />
- <add value="fi" />
- <add value="fr" />
- <add value="hu" />
- <add value="ms" />
- <add value="nl" />
- <add value="pl" />
- <add value="pt" />
- <add value="sh" />
- <add value="sr" />
- <add value="sv" />
- <add value="th" />
- <add value="zh" />
- </putList>
- <putList name="hitsPerPage">
- <add value="10" />
- <add value="20" />
- <add value="50" />
- </putList>
- </definition>
-
- <definition name="preferencesSavePage" extends="preferencesPage">
- <put name="action" value="save" />
- </definition>
-
- <!--
- Decorated definition can be used to split the logic and ui configuration apart so that
- one at a time can be changed
-
- The layout (view) can be selected with attribute named "decorator"
- -->
- <definition name="decoratedDefinition"
- path="/WEB-INF/jsp/decorator.jsp">
- <put name="decorator" value="/WEB-INF/jsp/footer.jsp" />
- </definition>
-
-</tiles-definitions>
\ No newline at end of file
diff --git a/contrib/web2/src/main/webapp/WEB-INF/tld/c.tld b/contrib/web2/src/main/webapp/WEB-INF/tld/c.tld
deleted file mode 100644
index ce80e8dd5..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/tld/c.tld
+++ /dev/null
@@ -1,416 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>c</short-name>
- <uri>http://java.sun.com/jstl/core</uri>
- <display-name>JSTL core</display-name>
- <description>JSTL 1.0 core library</description>
-
- <validator>
- <validator-class>
- org.apache.taglibs.standard.tlv.JstlCoreTLV
- </validator-class>
- <init-param>
- <param-name>expressionAttributes</param-name>
- <param-value>
- out:value
- out:default
- out:escapeXml
- if:test
- import:url
- import:context
- import:charEncoding
- forEach:items
- forEach:begin
- forEach:end
- forEach:step
- forTokens:items
- forTokens:begin
- forTokens:end
- forTokens:step
- param:encode
- param:name
- param:value
- redirect:context
- redirect:url
- set:property
- set:target
- set:value
- url:context
- url:value
- when:test
- </param-value>
- <description>
- Whitespace-separated list of colon-separated token pairs
- describing tag:attribute combinations that accept expressions.
- The validator uses this information to determine which
- attributes need their syntax validated.
- </description>
- </init-param>
- </validator>
-
- <tag>
- <name>catch</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Catches any Throwable that occurs in its body and optionally
- exposes it.
- </description>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>choose</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Simple conditional tag that establishes a context for
- mutually exclusive conditional operations, marked by
- &lt;when&gt; and &lt;otherwise&gt;
- </description>
- </tag>
-
- <tag>
- <name>out</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.OutTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Like &lt;%= ... &gt;, but for expressions.
- </description>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>default</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>escapeXml</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>if</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.IfTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Simple conditional tag, which evalutes its body if the
- supplied condition is true and optionally exposes a Boolean
- scripting variable representing the evaluation of this condition
- </description>
- <attribute>
- <name>test</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>import</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.ImportTag</tag-class>
- <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
- <body-content>JSP</body-content>
- <description>
- Retrieves an absolute or relative URL and exposes its contents
- to either the page, a String in 'var', or a Reader in 'varReader'.
- </description>
- <attribute>
- <name>url</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>varReader</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>charEncoding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>forEach</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.ForEachTag</tag-class>
- <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
- <body-content>JSP</body-content>
- <description>
- The basic iteration tag, accepting many different
- collection types and supporting subsetting and other
- functionality
- </description>
- <attribute>
- <name>items</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>begin</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>end</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>step</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>varStatus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>forTokens</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.ForTokensTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Iterates over tokens, separated by the supplied delimeters
- </description>
- <attribute>
- <name>items</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>delims</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>begin</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>end</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>step</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>varStatus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>otherwise</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
- and runs only if all of the prior conditions evaluated to
- 'false'
- </description>
- </tag>
-
- <tag>
- <name>param</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.ParamTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Adds a parameter to a containing 'import' tag's URL.
- </description>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>redirect</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.RedirectTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Redirects to a new URL.
- </description>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>url</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>remove</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Removes a scoped variable (from a particular scope, if specified).
- </description>
- <attribute>
- <name>var</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>set</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.SetTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Sets the result of an expression evaluation in a 'scope'
- </description>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>target</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>property</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>url</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Prints or exposes a URL with optional query parameters
- (via the c:param tag).
- </description>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>when</name>
- <tag-class>org.apache.taglibs.standard.tag.el.core.WhenTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Subtag of &lt;choose&gt; that includes its body if its
- condition evalutes to 'true'
- </description>
- <attribute>
- <name>test</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
-</taglib>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/tld/fmt.tld b/contrib/web2/src/main/webapp/WEB-INF/tld/fmt.tld
deleted file mode 100644
index 20523ee61..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/tld/fmt.tld
+++ /dev/null
@@ -1,442 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>fmt</short-name>
- <uri>http://java.sun.com/jstl/fmt</uri>
- <display-name>JSTL fmt</display-name>
- <description>JSTL 1.0 i18n-capable formatting library</description>
-
- <validator>
- <validator-class>
- org.apache.taglibs.standard.tlv.JstlFmtTLV
- </validator-class>
- <init-param>
- <param-name>expressionAttributes</param-name>
- <param-value>
- requestEncoding:value
- setLocale:value
- setLocale:variant
- timeZone:value
- setTimeZone:value
- bundle:basename
- bundle:prefix
- setBundle:basename
- message:key
- message:bundle
- param:value
- formatNumber:value
- formatNumber:pattern
- formatNumber:currencyCode
- formatNumber:currencySymbol
- formatNumber:groupingUsed
- formatNumber:maxIntegerDigits
- formatNumber:minIntegerDigits
- formatNumber:maxFractionDigits
- formatNumber:minFractionDigits
- parseNumber:value
- parseNumber:pattern
- parseNumber:parseLocale
- parseNumber:integerOnly
- formatDate:value
- formatDate:pattern
- formatDate:timeZone
- parseDate:value
- parseDate:pattern
- parseDate:timeZone
- parseDate:parseLocale
- </param-value>
- <description>
- Whitespace-separated list of colon-separated token pairs
- describing tag:attribute combinations that accept expressions.
- The validator uses this information to determine which
- attributes need their syntax validated.
- </description>
- </init-param>
- </validator>
-
- <tag>
- <name>requestEncoding</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.RequestEncodingTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Sets the request character encoding
- </description>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>setLocale</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.SetLocaleTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Stores the given locale in the locale configuration variable
- </description>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>variant</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>timeZone</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.TimeZoneTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Specifies the time zone for any time formatting or parsing actions
- nested in its body
- </description>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>setTimeZone</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.SetTimeZoneTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Stores the given time zone in the time zone configuration variable
- </description>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>bundle</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.BundleTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Loads a resource bundle to be used by its tag body
- </description>
- <attribute>
- <name>basename</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>prefix</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>setBundle</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.SetBundleTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Loads a resource bundle and stores it in the named scoped variable or
- the bundle configuration variable
- </description>
- <attribute>
- <name>basename</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>message</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.MessageTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Maps key to localized message and performs parametric replacement
- </description>
- <attribute>
- <name>key</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>bundle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>param</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.ParamTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Supplies an argument for parametric replacement to a containing
- &lt;message&gt; tag
- </description>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>formatNumber</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.FormatNumberTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Formats a numeric value as a number, currency, or percentage
- </description>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>currencyCode</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>currencySymbol</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>groupingUsed</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>maxIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>minIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>maxFractionDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>minFractionDigits</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>parseNumber</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.ParseNumberTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Parses the string representation of a number, currency, or percentage
- </description>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>integerOnly</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>formatDate</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.FormatDateTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Formats a date and/or time using the supplied styles and pattern
- </description>
- <attribute>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>dateStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>timeStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>timeZone</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <name>parseDate</name>
- <tag-class>org.apache.taglibs.standard.tag.el.fmt.ParseDateTag</tag-class>
- <body-content>JSP</body-content>
- <description>
- Parses the string representation of a date and/or time
- </description>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>dateStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>timeStyle</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>timeZone</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
-</taglib>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/tld/struts-tiles.tld b/contrib/web2/src/main/webapp/WEB-INF/tld/struts-tiles.tld
deleted file mode 100644
index b5e294fbc..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/tld/struts-tiles.tld
+++ /dev/null
@@ -1,338 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
-<taglib>
- <tlibversion>1.2</tlibversion>
- <jspversion>1.1</jspversion>
- <shortname>tiles</shortname>
- <uri>http://struts.apache.org/tags-tiles</uri>
- <tag>
- <name>insert</name>
- <tagclass>org.apache.struts.taglib.tiles.InsertTag</tagclass>
- <bodycontent>JSP</bodycontent>
- <attribute>
- <name>template</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>component</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>page</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>definition</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>attribute</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanName</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanProperty</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanScope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>flush</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>ignore</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>controllerUrl</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>controllerClass</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>definition</name>
- <tagclass>org.apache.struts.taglib.tiles.DefinitionTag</tagclass>
- <bodycontent>JSP</bodycontent>
- <attribute>
- <name>id</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>template</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>page</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>extends</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>put</name>
- <tagclass>org.apache.struts.taglib.tiles.PutTag</tagclass>
- <bodycontent>JSP</bodycontent>
- <attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>content</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>direct</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanName</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanProperty</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanScope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>putList</name>
- <tagclass>org.apache.struts.taglib.tiles.PutListTag</tagclass>
- <bodycontent>JSP</bodycontent>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>add</name>
- <tagclass>org.apache.struts.taglib.tiles.AddTag</tagclass>
- <bodycontent>JSP</bodycontent>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>content</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>direct</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanName</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanProperty</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>beanScope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>get</name>
- <tagclass>org.apache.struts.taglib.tiles.GetTag</tagclass>
- <bodycontent>empty</bodycontent>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>ignore</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>flush</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>getAsString</name>
- <tagclass>org.apache.struts.taglib.tiles.GetAttributeTag</tagclass>
- <bodycontent>empty</bodycontent>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>ignore</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>role</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>useAttribute</name>
- <tagclass>org.apache.struts.taglib.tiles.UseAttributeTag</tagclass>
- <teiclass>org.apache.struts.taglib.tiles.UseAttributeTei</teiclass>
- <bodycontent>empty</bodycontent>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>classname</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>ignore</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>importAttribute</name>
- <tagclass>
- org.apache.struts.taglib.tiles.ImportAttributeTag
- </tagclass>
- <bodycontent>empty</bodycontent>
- <attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>ignore</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
- <tag>
- <name>initComponentDefinitions</name>
- <tagclass>
- org.apache.struts.taglib.tiles.InitDefinitionsTag
- </tagclass>
- <bodycontent>empty</bodycontent>
- <attribute>
- <name>file</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <name>classname</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-</taglib>
diff --git a/contrib/web2/src/main/webapp/WEB-INF/web.xml b/contrib/web2/src/main/webapp/WEB-INF/web.xml
deleted file mode 100755
index 3888055e8..000000000
--- a/contrib/web2/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- 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.
--->
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "dtd/web-app_2_3.dtd">
-<web-app>
- <context-param>
- <param-name>
- javax.servlet.jsp.jstl.fmt.localizationContext
- </param-name>
- <param-value>org.nutch.jsp.resources</param-value>
- </context-param>
- <context-param>
- <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
- <param-value>en</param-value>
- </context-param>
- <servlet>
- <servlet-name>action</servlet-name>
- <servlet-class>
- org.apache.struts.action.ActionServlet
- </servlet-class>
- <init-param>
- <param-name>config</param-name>
- <param-value>/WEB-INF/struts-config.xml</param-value>
- </init-param>
- <init-param>
- <param-name>factoryClassname</param-name>
- <param-value>
- org.apache.nutch.webapp.tiles.ExtendableDefinitionsFactory
- </param-value>
- </init-param>
- <load-on-startup>2</load-on-startup>
- </servlet>
- <servlet>
- <servlet-name>Cached</servlet-name>
- <servlet-class>
- org.apache.nutch.webapp.servlet.CachedServlet
- </servlet-class>
- </servlet>
- <servlet>
- <servlet-name>OpenSearch</servlet-name>
- <servlet-class>
- org.apache.nutch.webapp.servlet.OpenSearchServlet
- </servlet-class>
- </servlet>
- <servlet>
- <servlet-name>PluginResourceServlet</servlet-name>
- <servlet-class>
- org.apache.nutch.webapp.servlet.ResourceServlet
- </servlet-class>
- </servlet>
- <servlet>
- <servlet-name>PluginJSPDispatcher</servlet-name>
- <servlet-class>
- org.apache.nutch.webapp.servlet.JspDispatcherServlet
- </servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>Cached</servlet-name>
- <url-pattern>/servlet/cached</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>OpenSearch</servlet-name>
- <url-pattern>/opensearch</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>action</servlet-name>
- <url-pattern>*.do</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PluginJSPDispatcher</servlet-name>
- <url-pattern>/plugin/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PluginResourceServlet</servlet-name>
- <url-pattern>/resources/*</url-pattern>
- </servlet-mapping>
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- <taglib>
- <taglib-uri>/tags/struts-tiles</taglib-uri>
- <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>/tags/jstl-c</taglib-uri>
- <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
- </taglib>
- <taglib>
- <taglib-uri>/tags/jstl-fmt</taglib-uri>
- <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
- </taglib>
-</web-app>
diff --git a/contrib/web2/src/main/webapp/index.jsp b/contrib/web2/src/main/webapp/index.jsp
deleted file mode 100644
index 4705488af..000000000
--- a/contrib/web2/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,20 +0,0 @@
-<%@ page session="false"%>
-<%--
- 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.
---%>
-<%
- response.sendRedirect("search.do");
-%>