accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1230608 [7/16] - in /incubator/accumulo/trunk: ./ contrib/accumulo_sample/ src/assemble/ src/core/ src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ src/core/src/main/java/org/apache/accumulo/core/master/thrift/ src/core/...
Date Thu, 12 Jan 2012 16:06:20 GMT
Added: incubator/accumulo/trunk/src/examples/wikisearch/query-war/pom.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query-war/pom.xml?rev=1230608&view=auto
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query-war/pom.xml (added)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query-war/pom.xml Thu Jan 12 16:06:14
2012
@@ -0,0 +1,66 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>accumulo-wikisearch</artifactId>
+    <groupId>org.apache.accumulo</groupId>
+    <version>1.5.0-incubating-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>wikisearch-query-war</artifactId>
+  <packaging>war</packaging>
+  <name>wikisearch-query-war</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax</groupId>
+      <artifactId>javaee-web-api</artifactId>
+      <version>6.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.1.1</version>
+        <configuration>
+          <failOnMissingWebXml>true</failOnMissingWebXml>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: incubator/accumulo/trunk/src/examples/wikisearch/query-war/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/jboss-web.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/jboss-web.xml?rev=1230608&view=auto
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/jboss-web.xml
(added)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/jboss-web.xml
Thu Jan 12 16:06:14 2012
@@ -0,0 +1,20 @@
+<?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.
+-->
+<jboss-web>
+  <context-root>/accumulo-wikisearch</context-root>
+</jboss-web>

Propchange: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/jboss-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/web.xml?rev=1230608&view=auto
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/web.xml
(added)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/web.xml
Thu Jan 12 16:06:14 2012
@@ -0,0 +1,57 @@
+<?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.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
+
+  <context-param>
+    <param-name>resteasy.jndi.resources</param-name>
+    <param-value>Query/local</param-value>
+  </context-param>
+
+  <listener>
+    <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
+  </listener>
+
+  <servlet>
+    <servlet-name>Resteasy</servlet-name>
+    <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>Resteasy</servlet-name>
+    <url-pattern>/rest/*</url-pattern>
+  </servlet-mapping>
+
+  <context-param>
+    <param-name>resteasy.servlet.mapping.prefix</param-name>
+    <param-value>/rest</param-value>
+  </context-param>
+
+  <servlet>
+    <servlet-name>UserInterface</servlet-name>
+    <jsp-file>/ui.jsp</jsp-file>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>UserInterface</servlet-name>
+    <url-pattern>/ui/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>

Propchange: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/style.xsl
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/style.xsl?rev=1230608&view=auto
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/style.xsl (added)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/style.xsl Thu
Jan 12 16:06:14 2012
@@ -0,0 +1,47 @@
+<?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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes" />
+	<xsl:template match="/results">
+	<html>
+	<table border="1">
+		<tr><th>Id</th><th>Title</th><th>Timestamp</th><th>Comments</th><th>Document
Link</th></tr>
+		<xsl:for-each select="document">
+			<tr>
+				<td><xsl:value-of select="field[@name = 'ID']/text()" /></td>
+				<td><xsl:value-of select="field[@name = 'TITLE']/text()" /></td>
+				<td><xsl:value-of select="field[@name = 'TIMESTAMP']/text()" /></td>
+				<td><xsl:value-of select="field[@name = 'COMMENTS']/text()" /></td>
+				<xsl:variable name="pointer" select="field[@name ='DOCUMENT']/text()" />
+				<xsl:variable name="href">
+					<xsl:text>/accumulo-wikisearch/rest/Query/content?query=</xsl:text><xsl:copy-of
select="$pointer"/><xsl:text>&amp;auths=all</xsl:text>
+				</xsl:variable>
+				<xsl:variable name="link">
+					<xsl:element name="a">
+						<xsl:attribute name="href"><xsl:copy-of select="$href" /></xsl:attribute>
+						<xsl:attribute name="target">_blank</xsl:attribute>
+						<xsl:text>View Document</xsl:text>
+					</xsl:element>
+				</xsl:variable>
+				<td><xsl:copy-of select="$link"/></td>
+			</tr>
+		</xsl:for-each>
+	</table>
+	</html>
+	</xsl:template>
+</xsl:stylesheet>

Propchange: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/style.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/ui.jsp
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/ui.jsp?rev=1230608&view=auto
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/ui.jsp (added)
+++ incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/ui.jsp Thu
Jan 12 16:06:14 2012
@@ -0,0 +1,127 @@
+<!--
+  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" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Wiki Search Page</title>
+        <style type="text/css">
+        	#comments {
+				width: 90%;
+				margin: auto;
+        	}
+        	h1 {
+        		text-align: center;
+        	}
+			#d {
+				width: 80%;
+				margin: auto;
+			}
+			.center_box {
+				width: 70%;
+				margin: auto;
+			}
+			.center_input {
+				width: 30%;
+				margin: auto;
+			}
+        </style>
+    </head>
+    <body>
+    	<div id="comments">
+    		<h1>Wiki Search using Apache Accumulo</h1>
+    		<p>This sample application demonstrates the ability to use search documents using
Apache Accumulo. The associated ingest software
+    		extracts the id, title, timestamp, and comments from each wikipedia article. In addition,
the wikipedia text has been tokenized
+    		and is available for searching. You can enter a boolean expression into the search
box below and select the particular set of
+    		wikipedia languages you want to search.</p>
+    		<p> Fields available for searching:
+    		<ol>
+    			<li>TEXT</li>
+    			<li>ID</li>
+    			<li>TITLE</li>
+    			<li>TIMESTAMP</li>
+    			<li>COMMENTS</li>
+    		</ol>
+    		<p>The search syntax is boolean logic, for example: TEXT == 'boy' and TITLE =~
'Autism'. The supported operators are:
+    		==, !=, &lt;, &gt;, &le;, &ge;, =~, and !~. Likewise grouping can be
performed using parentheses and predicates can be
+    		joined using and, or, and not.
+    	</div>
+    	<div id="d">
+	    	<form id="FORM" name="queryForm" method="get" target="results" onsubmit="return
setAction()">
+	    		<br />
+	    		<br />
+	    		<div class="center_box">
+	    		<label>Query: </label>
+	    		<input id="QUERY" type="text" name="query" size="100" maxlength="300"/>
+	    		</div>
+	    		<br />
+	    		<div class="center_input">
+	    		<label>All</label><input type="checkbox" name="auths" value="all" />
+				</div>
+	    		<div class="center_input">
+				<label>Arabic</label> <input type="checkbox" name="auths" value="arwiki"
/>
+				<label>Brazilian</label> <input type="checkbox" name="auths" value="brwiki"
/>
+				<label>Chinese</label> <input type="checkbox" name="auths" value="zhwiki"
/>
+				</div>
+				<div class="center_input">
+				<label>Dutch</label> <input type="checkbox" name="auths" value="nlwiki"
/>
+	    		<label>English</label> <input type="checkbox" name="auths" value="enwiki"
/>
+				<label>Farsi</label> <input type="checkbox" name="auths" value="fawiki"
/>
+				</div>
+	    		<div class="center_input">				
+				<label>French</label> <input type="checkbox" name="auths" value="frwiki"
/>
+				<label>German</label> <input type="checkbox" name="auths" value="dewiki"
/>
+				<label>Greek</label> <input type="checkbox" name="auths" value="elwiki"
/>
+				</div>
+	    		<div class="center_input">				
+				<label>Italian</label> <input type="checkbox" name="auths" value="itwiki"
/>
+				<label>Spanish</label> <input type="checkbox" name="auths" value="eswiki"
/>
+				<label>Russia</label>n <input type="checkbox" name="auths" value="ruwiki"
/><br />
+				</div>
+	    		<div class="center_input">				
+				<input type="submit" name="Submit Query" />
+				</div>
+	    	</form>
+	   		<br />
+	   		<br />
+	    	<iframe name="results" width="90%" height="400" scrolling="yes" >
+	    	</iframe>
+    	</div>
+    	<script type="text/javascript">
+    		function setAction() {
+	    		var f = document.forms[0];
+	    		var authString = "";
+	    		var sep = "";
+	    		for (var i=0; i<f.auths.length; i++) {
+	    			if (f.auths[i].checked) {
+	    				authString = authString + sep + f.auths[i].value;
+	    				sep = ",";
+	    			}
+	    		}
+	    		//Build the new query
+				var existingAction = "/accumulo-wikisearch/rest/Query/html";
+	    		var query = f.query.value;
+	    		
+	    		var newAction = existingAction + "?query=" + query + "&auths=" + authString;
+	    		document.forms[0].action = newAction;
+    		}
+    	</script>    	
+    </body>
+</html>

Propchange: incubator/accumulo/trunk/src/examples/wikisearch/query-war/src/main/webapp/ui.jsp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message