incubator-any23-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1357273 - in /incubator/any23/trunk/service: pom.xml src/main/resources/form.html src/main/webapp/resources/form.html
Date Wed, 04 Jul 2012 14:12:52 GMT
Author: simonetripodi
Date: Wed Jul  4 14:12:51 2012
New Revision: 1357273

URL: http://svn.apache.org/viewvc?rev=1357273&view=rev
Log:
finally managed the form.html page filtering
basically, looks like that when copying resources under src/main/webapp, will be performed
at the end of filtered resources so form.html page was ALWAYS overridden with variables not
interpolated

Added:
    incubator/any23/trunk/service/src/main/resources/form.html   (with props)
Removed:
    incubator/any23/trunk/service/src/main/webapp/resources/form.html
Modified:
    incubator/any23/trunk/service/pom.xml

Modified: incubator/any23/trunk/service/pom.xml
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/service/pom.xml?rev=1357273&r1=1357272&r2=1357273&view=diff
==============================================================================
--- incubator/any23/trunk/service/pom.xml (original)
+++ incubator/any23/trunk/service/pom.xml Wed Jul  4 14:12:51 2012
@@ -87,20 +87,9 @@
         <configuration>
           <webResources>
             <resource>
-              <directory>${basedir}/src/main/webapp/resources</directory>
+              <directory>${basedir}/src/main/resources/</directory>
               <targetPath>/resources</targetPath>
               <filtering>true</filtering>
-              <includes>
-                <include>form.html</include>
-              </includes>
-            </resource>
-            <resource>
-              <directory>${basedir}/src/main/webapp/resources</directory>
-              <targetPath>/resources</targetPath>
-              <filtering>false</filtering>
-              <excludes>
-                <exclude>form.html</exclude>
-              </excludes>
             </resource>
             <resource>
               <directory>${basedir}/../</directory>

Added: incubator/any23/trunk/service/src/main/resources/form.html
URL: http://svn.apache.org/viewvc/incubator/any23/trunk/service/src/main/resources/form.html?rev=1357273&view=auto
==============================================================================
--- incubator/any23/trunk/service/src/main/resources/form.html (added)
+++ incubator/any23/trunk/service/src/main/resources/form.html Wed Jul  4 14:12:51 2012
@@ -0,0 +1,400 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+<!--
+  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.
+-->
+<html xml:lang="en"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <head>
+    <title>Apache Any23: Anything To Triples - Service ${project.version} (${implementation.build.tstamp})</title>
+    <link rel="stylesheet" type="text/css" href="resources/css/bootstrap.min.css" />
+    <script type="text/javascript" src="resources/js/jquery-1.7.2.min.js"></script>
+    <script type="text/javascript" src="resources/js/bootstrap-modal.js"></script>
+    <script type="application/javascript">
+jQuery( document ).ready( function($)
+{
+    $.each( $( '.app-base-uri' ), function()
+    {
+        $( this ).text( document.location );
+    });
+
+    $( '#app-path' ).text( document.location.pathname );
+    $( '#app-host' ).text( document.location.host );
+} );
+
+function showModal( id )
+{
+    $( id ).modal( 'show' );
+}
+    </script>
+  </head>
+  <body>
+  <div class="container">
+    <a href="http://incubator.apache.org/projects/any23.html" title="Apache Any23 Dev
Site" target="_blank">
+        <img
+            alt="Apache Any23 Dev Site"
+            src="resources/images/logo-any23-214x97.png"
+            width="90"
+        /></a>
+      <a href="http://www.apache.org/" title="Apache Software Foundation" target="_blank">
+        <img
+            alt="Apache Software Foundation"
+            src="resources/images/logo-apache-90x30.png"
+            width="90"
+        /></a>
+
+    <h1>Apache Any23 - Anything To Triples - Live Service Demo</h1>
+    <p>Parses Microformats, RDFa, Microdata, RDF/XML, Turtle, N-Triples and NQuads.</p>
+    <p>Download and install Any23: visit the <a href="http://incubator.apache.org/projects/any23.html"
target="_blank">Developers Site</a> and the <a href="http://incubator.apache.org/any23/"
target="_blank">Documentation</a>.
+    <hr />
+    <h2>Convert document at URI</h2>
+    <form class="well form-horizontal" method="get" action="any23/">
+      <label>Pick an output format and enter the URI of a web document:</label>
+
+      <div class="control-group">
+        <label class="control-label app-base-uri" for="format">http://.../</label>
+        <div class="controls">
+            <select id="format" name="format">
+            <option value="best" selected="selected">best</option>
+            <option value="turtle">turtle</option>
+            <option value="ntriples">ntriples</option>
+            <option value="rdfxml">rdfxml</option>
+            <option value="nquads">nquads</option>
+            <option value="trix">trix</option>
+            <option value="json">json</option>
+          </select>/<input type="text" size="50" name="uri" value="http://twitter.com/cygri"
/>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-validation-get">Validation</label>
+        <div class="controls">
+          <select id="url-validation-get" name="validation-mode" onclick="if(document.getElementById('url-validation-get').value.indexOf('validate')
== 0) { document.getElementById('url-report-get').checked = true; }">
+          <option value="none">none</option>
+          <option value="validate">validate</option>
+          <option value="validate-fix">validate+fix</option>
+        </select>
+          <a href="javascript:showModal( '#sPopup-fix' );">[?]</a>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-report">Report</label>
+          <div class="controls">
+           <label class="checkbox">
+             <input id="url-report-get" type="checkbox" name="report">
+             <a href="javascript:showModal( '#sPopup-report' );">[?]</a>
+          </label>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-annotate-get">Annotate</label>
+          <div class="controls">
+           <label class="checkbox">
+             <input id="url-annotate-get" type="checkbox" type="checkbox" name="annotate">
+             <a href="javascript:showModal( '#sPopup-annotate' );">[?]</a>
+          </label>
+        </div>
+      </div>
+    <div class="form-actions">
+      <button type="submit" class="btn btn-primary">Convert</button>
+      <button type="reset" class="btn">Cancel</button>
+    </div>
+    </form>
+    <hr />
+
+    <h2>Convert copy&amp;pasted document</h2>
+    <form class="well form-horizontal" method="post" action="any23/">
+      <div class="control-group">
+        <label class="control-label" for="type">Input format</label>
+        <div class="controls">
+            <select id="type" name="type">
+            <option value="">auto-detect</option>
+            <option value="text/html">HTML with Microformats, RDFa (text/html)</option>
+            <option value="application/xhtml+xml">XHTML with Microformats, RDFa, Microdata
(application/xhtml+xml)</option>
+            <option value="text/turtle">Turtle (text/turtle)</option>
+            <option value="text/nt">N-Triples (text/nt)</option>
+            <option value="text/nq">N-Quads (text/nq)</option>
+            <option value="application/trix">TriX (application/trix)</option>
+            <option value="application/rdf+xml">RDF/XML (application/rdf+xml)</option>
+            <option value="text/csv">CSV (text/csv)</option>
+          </select>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="out-format">Output format</label>
+        <div class="controls">
+            <select id="out-format" name="format">
+            <option value="best" selected="selected">best (content-negotiated)</option>
+            <option value="turtle">turtle</option>
+            <option value="ntriples">ntriples</option>
+            <option value="rdfxml">rdfxml</option>
+            <option value="nquads">nquads</option>
+            <option value="trix">trix</option>
+            <option value="json">json</option>
+          </select>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-validation-post">Validation</label>
+        <div class="controls">
+          <select id="url-validation-post" name="validation-mode" onclick="if(document.getElementById('url-validation-post').value.indexOf('validate')
== 0) { document.getElementById('url-report-post').checked = true; }">
+          <option value="none">none</option>
+          <option value="validate">validate</option>
+          <option value="validate-fix">validate+fix</option>
+        </select>
+          <a href="javascript:showModal( '#sPopup-fix' );">[?]</a>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-report">Report</label>
+          <div class="controls">
+           <label class="checkbox">
+             <input id="url-report-post" type="checkbox" name="report">
+             <a href="javascript:showModal( '#sPopup-report' );">[?]</a>
+          </label>
+        </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="url-annotate-post">Annotate</label>
+          <div class="controls">
+           <label class="checkbox">
+             <input id="url-annotate-post" type="checkbox" type="checkbox" name="annotate">
+             <a href="javascript:showModal( '#sPopup-annotate' );">[?]</a>
+          </label>
+        </div>
+      </div>
+
+        <textarea class="span11" name="body" rows="12">@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
.
+
+[] a foaf:Person;
+    foaf:name "John X. Foobar";
+    foaf:mbox_sha1sum "cef817456278b70cee8e5a1611539ef9d928810e";
+    .</textarea>
+      
+    <div class="form-actions">
+      <button type="submit" class="btn btn-primary">Convert</button>
+      <button type="reset" class="btn">Cancel</button>
+    </div>
+
+    </form>
+    <hr />
+
+    <h2>API quick reference</h2>
+    <h3>Examples</h3>
+    <ul>
+      <li><code><a href="best/twitter.com/cygri"><span class="app-base-uri">http://.../</span>best/twitter.com/cygri</a></code></li>
+      <li><code><a href="rdfxml/http://data.gov"><span class="app-base-uri">http://.../</span>rdfxml/http://data.gov</a></code></li>
+      <li><code><a href="ttl/http://www.w3.org/People/Berners-Lee/card"><span
class="app-base-uri">http://.../</span>ttl/http://www.w3.org/People/Berners-Lee/card</a></code></li>
+      <li><code><a href="?uri=http://dbpedia.org/resource/Berlin"><span
class="app-base-uri">http://.../</span>?uri=http://dbpedia.org/resource/Berlin</a></code></li>
+      <li><code><a href="?format=nt&uri=http://dbpedia.org/resource/Berlin"><span
class="app-base-uri">http://.../</span>?format=nt&uri=http://dbpedia.org/resource/Berlin</a></code></li>
+    </ul>
+    <h3>Compact API</h3>
+    <p>HTTP GET requests can be made
+      to URIs of the shape</p>
+    <pre><span class="app-base-uri">http://.../</span><em>format</em>/<em>input-uri</em></pre>
+    <p>The response is the input document converted to the desired output format.</p>
+
+    <h3>Form-style GET API</h3>
+    <p>HTTP GET requests can be made to
+      the URI
+      <code class="app-base-uri">http://.../</code> with the following
+      query parameters:
+    </p>
+    <table class="table">
+      <tr><th>uri</th><td>URI of an input document.</td></tr>
+      <tr><th>format</th><td>Desired output format, defaults to <code>best</code>.</td></tr>
+      <tr><th>validation-mode</th><td>The validation level to be
applied on the input. Possible values:<br/>
+          <code>none</code> (no validation applied);<br/>
+          <code>validate</code>(apply validation and produce validation report
if <code>annotate</code> flag is enabled);<br/>
+          <code>validate+fix</code>(apply validation, try to fix detection issues
and produce validation report if <code>annotate</code> flag is enabled).</td>
+      </tr>
+      <tr><th>annotate</th><td>If specified the output RDF will contain
extractor specific scope comments.<br/>Possible values: <code>on</code>/<code>off</code></td></tr>
+      <tr><th>report</th><td>If specified will produce a full XML
report containing extraction and validation issues other than produced metadata.<br/>Possible
values: <code>on</code>/<code>off</code></td></tr>
+    </table>
+    Such URL will return an HTTP <i>302</i> redirect to <code><span
class="app-base-uri">http://...</span>any23/<em>format</em></code>.<br/>
+    <p>The response is the input document converted to the desired output format.</p>
+
+    <h3>Direct POST API</h3>
+    <p>HTTP POSTing a document body to
+      <code><span class="app-base-uri">http://.../</span><em>format</em></code>
will convert
+      the document to the specified output format. <br/>
+      The media type of the input
+      has to be specified in the <code>Content-Type</code> HTTP header.
+      Depending on the servlet container, a <code>Content-Length</code> header
specifying
+      the length of the input document in bytes might also be required.<br/>
+      Typical media types for supported input formats are:
+    </p>
+    <table class="table">
+      <tr><th>Input format</th><th>Media type</th></tr>
+      <tr><th>HTML</th><td><code>text/html</code></td></tr>
+      <tr><th>RDF/XML</th><td><code>application/rdf+xml</code></td></tr>
+      <tr><th>Turtle</th><td><code>text/turtle</code></td></tr>
+      <tr><th>N-Triples</th><td><code>text/nt</code></td></tr>
+      <tr><th>N-Quads</th><td><code>text/nq</code></td></tr>
+      <tr><th>TriX</th><td><code>application/trix</code></td></tr>
+    </table>
+    <p>Example POST request:</p>
+    <pre>POST <span id="app-path">/</span>rdfxml HTTP/1.0
+Host: <span id="app-host">example.com</span>
+Content-Type: text/turtle
+Content-Length: 174
+
+@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .
+
+[] a foaf:Person;
+    foaf:name "John X. Foobar";
+    foaf:mbox_sha1sum "cef817456278b70cee8e5a1611539ef9d928810e";
+    .</pre>
+
+    <h3>Form-style POST API</h3>
+    <p>A document body can also be converted by HTTP POSTing form data to
+      <code><span class="app-base-uri">http://.../</span></code>.
<br/>
+      The <code>Content-Type</code> HTTP header must be set to
+      <code>application/x-www-form-urlencoded</code>. The following
+      parameters are supported:
+    </p>
+    <table class="table">
+      <tr><th>type</th><td>Media type of the input, see the table
above. If not present, auto-detection will be attempted.</td></tr>
+      <tr><th>body</th><td>Document body to be converted.</td></tr>
+      <tr><th>format</th><td>Desired output format; defaults to <code>best</code>.</td></tr>
+      <tr><th>validation-mode</th><td>The validation level to be
applied on the input. Possible values:<br/>
+        <code>none</code> (no validation applied);<br/>
+        <code>validate</code>(apply validation and produce validation report
if <code>annotate</code> flag is enabled);<br/>
+        <code>validate+fix</code>(apply validation, try to fix detection issues
and produce validation report if <code>annotate</code> flag is enabled).</td>
+      </tr>
+      <tr><th>annotate</th><td>If specified the output RDF will contain
extractor specific scope comments.<br/>Possible values: <code>on</code>/<code>off</code></td></tr>
+      <tr><th>report</th><td>If specified will produce a full XML
report containing extraction and validation issues other than produced metadata.<br/>Possible
values: <code>on</code>/<code>off</code></td></tr>
+    </table>
+
+    <h3>Output formats</h3>
+    <p>Supported output format identifiers are:</p>
+    <ul>
+      <li><code>best</code> for content negotiation according to the client's
<code>Accept</code> HTTP header</li>
+      <li><code>turtle</code>, <code>ttl</code>, <code>n3</code>
for
+        <a href="http://www.w3.org/TeamSubmission/turtle/" target="_blank">Turtle</a>/<a
href="http://www.w3.org/DesignIssues/Notation3" target="_blank">N3</a></li>
+      <li><code>ntriples</code>, <code>nt</code> for
+        <a href="http://www.w3.org/TR/rdf-testcases/#ntriples" target="_blank">N-Triples</a></li>
+      <li><code>nquads</code>, <code>nq</code> for
+        <a href="http://sw.deri.org/2008/07/n-quads/" target="_blank">N-Quads</a></li>
+      <li><code>trix</code> for
+        <a href="http://www.w3.org/2004/03/trix/" target="_blank">TriX</a></li>
+      <li><code>rdfxml</code>, <code>rdf</code>, <code>xml</code>
for
+        <a href="http://www.w3.org/TR/rdf-syntax-grammar/" target="_blank">RDF/XML</a></li>
+      <li><code>json</code> for <a href="http://json.org/" target="_blank">JSON</a></li>
+    </ul>
+
+    <h3>Error reporting</h3>
+    <p>Processing errors are indicated via
+      HTTP status codes and brief <code>text/plain</code> error messages.
+      The following status codes can be returned:</p>
+    <table class="table">
+      <thead>
+        <tr><th>Code</th><th>Reason</th></tr>
+      </thead>
+      <tbody>
+        <tr><th>200 OK</th><td>Success</td></tr>
+        <tr><th>400 Bad Request</th><td>Missing or malformed input
parameter</td></tr>
+        <tr><th>404 Not Found</th><td>Malformed request URI</td></tr>
+        <tr><th>406 Not Acceptable</th><td>None of the media types
specified in the <code>Accept</code> header are supported</td></tr>
+        <tr><th>415 Unsupported Media Type</th><td>Document body
with unsupported media type was POSTed</td></tr>
+        <tr><th>501 Not Implemented</th><td>Extraction from input
was successful, but yielded zero triples</td></tr>
+        <tr><th>502 Bad Gateway</th><td>Input document from a remote
server could not be fetched or parsed</td></tr>
+      </tbody>
+    </table>
+    <h3>Report Format</h3>
+    <p>The XML report format is subjected to changes. The current content is described
in section
+       <a href="http://incubator.apache.org/any23/service.html" target="_blank">Any23
Service</a>.
+    </p>
+    <hr />
+    <p><b>Apache Any23 v.${project.version} (${implementation.build.tstamp})</b></p>
+    <p><a href="http://incubator.apache.org/projects/any23.html" target="_blank">Any23
project homepage</a> | Hosted at <a href="http://apache.org/" target="_blank">Apache
Software Foundation</a></p>
+
+    <div id="sPopup-fix" class="modal hide fade">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal">×</button>
+        <h3>Validation</h3>
+      </div>
+      <div class="modal-body">
+        <p> 
+          The <b>Any23</b> service tries to fix some <a href="http://rdfa.info/wiki/Common-publishing-mistakes"
target="_blank">common issues</a>
+          before performing a metadata extraction. The fixing is performed according a set
of fully customizable rules. 
+        </p>
+        <p>
+          The following <i>Validation</i> options are available.
+        </p>
+        <ul>
+          <li><b>none</b>: no validation will be performed;</li>
+          <li><b>validate</b>: common errors within the document will be
detected and reported. When selected this option the
+              <b>Report</b> flag will be activated to visualize the validation
outcome;</li>
+          <li><b>validate+fix</b>: the common issues will be detected and
a fix will be applied when available.</li>
+        </ul>
+        <p>
+          Please refer to the <a href="http://incubator.apache.org/any23/dev-validation-fix.html"
target="_blank">Developer Guide</a>
+          for any further detail.
+        </p>
+      </div>
+      <div class="modal-footer">
+        <a href="#" class="btn" data-dismiss="modal">Close</a>
+      </div>
+    </div>
+
+    <div id="sPopup-report" class="modal hide fade">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal">×</button>
+        <h3>Report</h3>
+      </div>
+      <div class="modal-body">
+        <p>
+        If the <i>Report</i> checkbox is selected, the <b>Any23</b>
service returns an <b>XML</b> output containing,
+        other then the <b>extracted RDF statements</b>, other information as
the list of the <b>activated extractors</b>
+        and the <b>detected errors</b>.
+        </p>
+        <p>
+        If the <b>validation</b> or <b>validation and fix</b> has
been activated then the report contains also a list
+        of the applied fixes.
+        </p>
+      </div>
+      <div class="modal-footer">
+        <a href="#" class="btn" data-dismiss="modal">Close</a>
+      </div>
+    </div>
+
+    <div id="sPopup-annotate" class="modal hide fade">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal">×</button>
+        <h3>Annotate</h3>
+      </div>
+      <div class="modal-body">
+        <p>
+        If the <i>Annotate</i> checkbox is selected, the <b>Any23</b>
service returns an output expressed in the
+        selected <b>RDF</b> format containing also specific format <b>comments</b>
describing the activated extractor
+        scopes for every produced statement.
+        </p>
+      </div>
+      <div class="modal-footer">
+        <a href="#" class="btn" data-dismiss="modal">Close</a>
+      </div>
+    </div>
+
+  </div>
+
+  <footer class="footer">
+  <div class="container-fluid">
+  Copyright &copy; ${project.inceptionYear}-2012 The <a href="http://www.apache.org/">Apache
Software Foundation</a>. All Rights Reserved.<br/> Apache Any23, Apache, the Apache
feather logo, and the Apache Any23 project logos are trademarks of The Apache Software Foundation.
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
+  </div>
+  </footer>
+  </body>
+</html>

Propchange: incubator/any23/trunk/service/src/main/resources/form.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/any23/trunk/service/src/main/resources/form.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/any23/trunk/service/src/main/resources/form.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message