You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by fl...@apache.org on 2012/06/19 00:51:28 UTC

svn commit: r1351524 [9/9] - in /incubator/stanbol/branches/cameltrial/flow: jersey/src/main/java/org/apache/stanbol/flow/ jersey/src/main/java/org/apache/stanbol/flow/jersey/ jersey/src/main/java/org/apache/stanbol/flow/jersey/fragment/ jersey/src/mai...

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/enhancerweb.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/enhancerweb.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/enhancerweb.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/enhancerweb.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,143 @@
+<#--
+  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.
+-->
+
+<#if !it.executionNodes??>
+  <p><em>There seams to be a problem with the Enhancement Chain <b>${it.chain.name}</b>. 
+   To fix this an Administrator needs to install, configure and enable enhancement 
+   chains and -engines by using the <a href="/system/console">OSGi console</a>.</em></p>
+<#elseif it.executionNodes?size == 0>
+  <p><em>There is no active engines for Enhancement Chain <b>${it.chain.name}</b>. 
+   Administrators can install, configure and enable enhancement chains and 
+   -engines by using the <a href="/system/console">OSGi console</a>.</em></p>
+<#else>
+  <#assign executionNodes = it.executionNodes>
+  <div class="enginelisting">
+  <#if it.chainAvailable>
+    <div class="collapsed">
+  <#else>
+    <div>
+  </#if>
+  <p class="collapseheader">Enhancement Chain: 
+    <#if it.chainAvailable>
+      <span style="color:#006600">
+    <#else>
+      <span style="color:#660000">
+    </#if>
+    <strong>${it.chain.name}</strong></span> 
+    <#if it.activeNodes?size &lt; it.executionNodes?size>
+      <strong>${it.activeNodes?size}/</strong><#else> all </#if><strong>${it.executionNodes?size}</strong>
+    engines available 
+      <span style="float: right; margin-right: 25px;">
+        &lt; List of <a href="#">Enhancement Chains</a> &gt;
+      </span>
+    </p>
+    <div class="collapsable">
+    <ul>
+      <#list executionNodes as node>
+        <li>
+        <#if node.engineActive>
+          <span style="color:#006600">
+        <#elseif node.optional>
+          <span style="color:#666666">
+        <#else>
+          <span style="color:#660000">
+        </#if>
+          <b>${node.engineName}</b> 
+          <small>(
+          <#if node.optional> optional <#else> required </#if>, 
+          <#if node.engineActive>
+            ${node.engine.class.simpleName})</small></li>
+          <#else>
+            currently not available)</small>
+          </span>
+          </li>
+        </#if>
+      </#list>
+    </ul>
+    <p class="note">You can enable, disable and deploy new engines using the
+      <a href="/system/console/components">OSGi console</a>.</p>
+    </div>
+    </div>
+  </div>
+  
+<script>
+$(".enginelisting p").click(function () {
+  $(this).parents("div").toggleClass("collapsed");
+})
+.find("a").click(function(e){
+    e.stopPropagation();
+    //link to all active Enhancement Chains
+    window.location = "${it.publicBaseUri}enhancer/chain";
+    return false;
+});     
+</script>
+</#if>
+<#if it.chainAvailable>
+  <p>Paste some text below and submit the form to let the Enhancement Chain ${it.chain.name} enhance it:</p>
+  <form id="enginesInput" method="POST" accept-charset="utf-8">
+    <p><textarea rows="15" name="content"></textarea></p>
+    <p class="submitButtons">Output format:
+      <select name="format">
+        <option value="application/json">JSON-LD</option>
+        <option value="application/rdf+xml">RDF/XML</option>
+        <option value="application/rdf+json">RDF/JSON</option>
+        <option value="text/turtle">Turtle</option>
+        <option value="text/rdf+nt">N-TRIPLES</option>
+      </select> <input class="submit" type="submit" value="Run engines">
+    </p>
+  </form>
+<script language="javascript">
+function registerFormHandler() {
+   $("#enginesInput input.submit", this).click(function(e) {
+     // disable regular form click
+     e.preventDefault();
+     
+     var data = {
+       content: $("#enginesInput textarea[name=content]").val(),
+       ajax: true,
+       format:  $("#enginesInput select[name=format]").val()
+     };
+     var base = window.location.href.replace(/\/$/, "");
+     
+     $("#enginesOuputWaiter").show();
+     
+     // submit the form query using Ajax
+     $.ajax({
+       type: "POST",
+       url: base,
+       data: data,
+       dataType: "html",
+       cache: false,
+       success: function(result) {
+         $("#enginesOuputWaiter").hide();
+         $("#enginesOuput").html(result);
+       },
+       error: function(result) {
+         $("#enginesOuputWaiter").hide();
+         $("#enginesOuput").text('Invalid query.');
+       }
+     });
+   });
+ }
+ $(document).ready(registerFormHandler);
+</script>
+  <div id="enginesOuputWaiter" style="display: none">
+    <p>Stanbol is analysing your content...</p>
+    <p><img alt="Waiting..." src="${it.staticRootUrl}/home/images/ajax-loader.gif" /></p>
+  </div>
+  <p id="enginesOuput"></p>
+</#if>
\ No newline at end of file

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/entities.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/entities.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/entities.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/entities.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,65 @@
+<#--
+  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.
+-->
+<#macro listing entities>
+<#list entities as entity>
+<p>
+<table class="collapsed">
+<thead>
+<tr>
+  <th class="thumb">
+    <img src="${entity.thumbnailSrc}"
+      onerror="$(this).attr('src', '${entity.missingThumbnailSrc}');"
+      alt="${entity.name}" />
+  </th>
+  <th class="name">
+    <#if entity.uri?exists>
+    <a href="${entity.uri}" title="${entity.summary}">${entity.name}</a>
+    <#else>
+    ${entity.name}
+    </#if>
+  </th>
+</tr>
+</thead>
+<tbody>
+<#if entity.suggestions?size != 0>
+<tr class="subheader">
+  <td colspan="2">Referenced entities</td>
+</tr>
+</#if>
+<#list entity.suggestions as suggestion>
+<tr>
+  <td class="thumb"><img src="${suggestion.thumbnailSrc}"
+    onerror="$(this).attr('src', '${suggestion.missingThumbnailSrc}');" alt="${suggestion.label}" /></td>
+  <td><a href="${suggestion.uri}" title="${suggestion.summary}" class="external">${suggestion.label}</a></td>
+</tr>
+</#list>
+<#if entity.mentions?size != 0>
+<tr class="subheader">
+  <td colspan="2">Mentions</td>
+</tr>
+</#if>
+<#list entity.mentions as mention>
+<tr>
+  <td></td>
+  <td>${mention}</td>
+</tr>
+</#list>
+</tbody>
+</table>
+</p>
+</#list>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/executionmetadata.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/executionmetadata.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/executionmetadata.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/imports/executionmetadata.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,78 @@
+<#--
+  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.
+-->
+<#macro view>
+
+<h3>Enhancement Process Metadata</h3>
+<div id="executionmetadata" class="enginelisting">
+  <script>
+    $("#executionmetadata p").click(function () {
+      $(this).parents("div").toggleClass("collapsed");
+    });    
+  </script>
+  <#if !it.chainExecution??>
+    <p> No metadata available <small>
+    (This indicates that the used EnhancementJobManager
+    does not support this feature)</small><p>
+  <#else>
+    <#if it.chainExecution.failed>
+      <div>
+    <#else>
+    <div class="collapsed">
+    </#if>
+    <p class="collapseheader"> Execution of Chain 
+      <#if it.chainExecution.completed>
+        <span style="color:#006600">
+      <#elseif it.chainExecution.failed>
+        <span style="color:#660000">
+      <#else>
+         <span>
+      </#if>
+      <strong>${it.chainExecution.chainName}</strong> 
+      ${it.chainExecution.statusText} </span>
+      in <strong>${it.chainExecution.durationText}</strong>.
+    </p>
+    <div class="collapsable">
+    <ul>
+      <#list it.engineExecutions as node>
+        <li><#if node.offsetText??>${node.offsetText}<#else>${node.startTime}</#if>:
+        <#if node.completed>
+          <span style="color:#006600">
+        <#elseif node.failed && node.executionNode.optional>
+          <span style="color:#666666">
+        <#elseif node.failed && !node.executionNode.optional>
+          <span style="color:#660000">
+        <#else>
+           <span>
+        </#if>
+          <b>${node.statusText}</b></span> 
+          in ${node.durationText} :
+          <b>${node.executionNode.engineName}</b>
+          <small>(
+          <#if node.executionNode.optional> optional <#else> required </#if>, 
+          start: ${node.startTime}, completion: ${node.completionTime})
+          </small>
+          </span>
+          </li>
+      </#list>
+    </ul>
+    </div>
+  </div>
+  </#if>
+</div>
+
+
+</#macro>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/AbstractEnhancerUiResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/AbstractEnhancerUiResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/AbstractEnhancerUiResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/AbstractEnhancerUiResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,34 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Apache Stanbol Enhancer" hasrestapi=true>
+
+
+<div class="panel" id="webview">
+  <#include "/imports/enhancerweb.ftl">
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+  <#include "/imports/doc/enhancerbase.ftl">
+  <#include "/imports/doc/multipartcontentitem.ftl">
+  <#include "/imports/doc/executionplan.ftl">
+</div>
+
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ChainsRootResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ChainsRootResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ChainsRootResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ChainsRootResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,101 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Enhancement Chains" hasrestapi=true>
+
+
+<div class="panel" id="webview">
+<p> Enhancement Chains define a set of Enhancement Engines as well as the 
+execution oder of those used to enhance content parsed to the Stanbol Enhancer.<p>
+Currently the following Chains are available:
+<ul>
+  <#list it.chains as chain>
+    <#assign name = chain.name >
+    <li> <a href="${it.publicBaseUri}enhancer/chain/${name}">${name}</a>
+    (<#if it.isDefault(name)><b>default</b>,</#if>
+    id: ${it.getServiceId(name)}, ranking: ${it.getServiceRanking(name)},
+    impl: ${chain.class.simpleName}
+    )<#if it.getServicePid(name)??>: 
+    <a href="/system/console/configMgr/${it.getServicePid(name)}">configure</a></#if>
+  </#list>
+</ul>
+<p>Enhancement Request for the <a href="${it.publicBaseUri}enhancer">
+/enhancer</a> and <a href="${it.publicBaseUri}engines">
+/engines</a> endpoints are processed by using the default chain - the engine
+in the above list marked as <b>default</b>. </p><p>
+The default Chain is defined as (1) the Chain with the name "default" 
+and the highest <code>service.ranking</code> or (2) if no Chain has the name 
+"default" is active than the Chain with the highest <code>service.ranking</code> 
+(regardless of the name).<p>
+
+<p class="note">
+You can configure Chains by using the the <a href="/system/console/configMgr">
+Configuration Tab</a> of the OSGi console.</p>
+
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Enhancement Chains Metadata</h3>
+
+<p>This stateless interface allows the caller to query all available
+Enhancement Chains</p>
+<p> GET requests with an accept header of any supported RDF serialisation 
+such as
+<code><pre>
+    curl -H "Accept: application/rdf+xml" ${it.publicBaseUri}enhancer/chain
+</pre></code>
+will return information about the available enhancement chains.</p>
+<h4>Example:</h4>
+<p><a href="#" onclick="getChainConfig(); return false;">clicking here</a> to
+get the metadata for the currently active enhancement chains</p>
+<script language="javascript">
+  function getChainConfig() {
+     var base = window.location.href.replace(/\/$/, "");
+     
+     $("#chainMetadataResult").show();     
+     
+     // submit the form query using Ajax
+     $.ajax({
+       type: "GET",
+       url: base,
+       data: "",
+       dataType: "text",
+       beforeSend: function(req) {
+         req.setRequestHeader("Accept", "application/rdf+xml");
+       },
+       cache: false,
+       success: function(result) {
+         $("#chainMetadata").text(result);
+       },
+       error: function(result) {
+         $("#chainMetadata").text('Error while loading chain config.');
+       }
+     });
+   }
+</script>
+<div id="chainMetadataResult" style="display: none">
+<p><a href="#" onclick="$('#chainMetadataResult').hide(); return false;">Hide results</a>
+<pre id="chainMetadata">... waiting for results ...</pre>
+</div>
+
+
+</div>
+
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ContentItemResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ContentItemResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ContentItemResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/ContentItemResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,47 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#import "/imports/contentitem.ftl" as contentitem>
+<#escape x as x?html>
+<@common.page title="Content Item: ${it.localId} (${it.contentItem.mimeType})" hasrestapi=false> 
+
+<h3>Public URI of this resource</h3>
+<pre>${it.contentItem.uri.unicodeString}</pre>
+
+<h3>Content preview</h3>
+<div class="contentItemPreview">
+<#if it.textContent?exists>
+<pre>${it.textContent}</pre>
+</#if>
+<#if it.imageSrc?exists>
+<img class="preview" src="${it.imageSrc}" alt="Image content of ${it.localId}" />
+</#if>
+</div>
+
+<ul class="downloadLinks">
+<#if it.downloadHref?exists>
+<li><a href="${it.downloadHref}" class="download">Download the original Content Item</a></li>
+</#if>
+<#if it.metadataHref?exists>
+<li><a href="${it.metadataHref}" class="downloadRDF">Download the related RDF enhancements</a></li>
+</#if>
+</ul>
+
+<@contentitem.view />
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEngineResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEngineResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEngineResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEngineResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,58 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Enhancement Engine ${it.name}" hasrestapi=true>
+
+
+<div class="panel" id="webview">
+<p> Enhancement Engine Details: <ul>
+<li> name: ${it.name}
+<li> class: ${it.engine.class}
+<li> ordering: ${it.ordering}
+<li> service.id : ${it.id}
+<li> service.ranking: ${it.ranking}
+</ul>
+<p class="note"> You can <a href="/system/console/configMgr/${it.pid}">
+configure this engine</a> by using the the Configuration Tab of the OSGi console.</p>
+
+<#--
+<p> This is the list of all active Enhancement Engines active for 
+the name ${it.name}:
+<ul>
+  <#list it.engines as engine>
+    <li> <a href="${it.publicBaseUri}enhancer/engine/${engine.name}">${engine.name}</a>
+      (impl: ${engine.class.simpleName})
+  </#list>
+</ul>
+<p>
+
+-->
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Enhancement Engines RESTful API</h3>
+
+<p>This stateless interface allows the caller to query all available
+Enhancement Engines</p>
+
+
+</div>
+
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEnginesRootResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEnginesRootResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEnginesRootResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/EnhancementEnginesRootResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,92 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Enhancement Engines" hasrestapi=true>
+
+
+<div class="panel" id="webview">
+
+<p> This is the list of all active Enhancement Engines.
+<ul>
+  <#list it.engines as engine>
+    <#assign name = engine.name >
+    <li> <a href="${it.publicBaseUri}enhancer/engine/${name}">${name}</a>
+    (id: ${it.getServiceId(name)}, ranking: ${it.getServiceRanking(name)}, 
+    impl: ${engine.class.simpleName}
+    )<#if it.getServicePid(name)??>: 
+    <a href="/system/console/configMgr/${it.getServicePid(name)}">configure</a></#if>
+  </#list>
+</ul>
+<p>
+EnhancementEngines are used to define <a href="${it.publicBaseUri}enhancer/chain">
+Enhancement Chains</a> that can than be used to enhance content parsed to the
+Stanbol Enhancer.</p>
+<p class="note"> You can configure Chains by using the the
+<a href="/system/console/configMgr">Configuration Tab</a> of the OSGi console.</p>
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Enhancement Engine Metadata</h3>
+
+<p>This stateless interface allows the caller to query all available
+Enhancement Engines</p>
+<p> GET requests with an accept header of any supported RDF serialisation 
+such as
+<code><pre>
+    curl -H "Accept: application/rdf+xml" ${it.publicBaseUri}enhancer/engine
+</pre></code>
+will return information about the available enhancement engines.</p>
+
+<h4>Example:</h4>
+<p><a href="#" onclick="getChainConfig(); return false;">clicking here</a> to
+get the metadata for the currently active enhancement engines</p>
+<script language="javascript">
+  function getChainConfig() {
+     var base = window.location.href.replace(/\/$/, "");
+     
+     $("#engineMetadataResult").show();     
+     
+     // submit the form query using Ajax
+     $.ajax({
+       type: "GET",
+       url: base,
+       data: "",
+       dataType: "text",
+       beforeSend: function(req) {
+         req.setRequestHeader("Accept", "application/rdf+xml");
+       },
+       cache: false,
+       success: function(result) {
+         $("#engineMetadata").text(result);
+       },
+       error: function(result) {
+         $("#engineMetadata").text('Error while loading chain config.');
+       }
+     });
+   }
+</script>
+<div id="engineMetadataResult" style="display: none">
+<p><a href="#" onclick="$('#engineMetadataResult').hide(); return false;">Hide results</a>
+<pre id="engineMetadata">... waiting for results ...</pre>
+</div>
+
+</div>
+
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,87 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Apache Stanbol Flow" hasrestapi=true>
+
+
+<div class="panel" id="webview">
+	<h3> Web View and REST API have to be documented</h3>
+<#--  <#include "/imports/enhancerweb.ftl"> -->
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+	<h3> REST API documentation have to be done</h3>
+    <#-- 1. Documentation of the normal RESTful API -->  
+<#--    <#include "/imports/doc/enhancerbase.ftl"> -->
+  
+    <#-- 2. Documentation of Enhancer Configuration RESTful API -->  
+<#--    <h3>Enhancer Configuration</h3>
+    
+    <p> GET requests with an accept header of any supported RDF serialisation 
+    such as
+    <code><pre>
+        curl -H "Accept: application/rdf+xml" ${it.publicBaseUri}enhancer
+    </pre></code>
+    will return information about the available enhancement chains and engines.</p>
+    <h4>Example:</h4>
+    <p><a href="#" onclick="getChainConfig(); return false;">clicking here</a> to
+    get the metadata for the currently active enhancement chains and engines</p>
+    <script language="javascript">
+      function getChainConfig() {
+         var base = window.location.href.replace(/\/$/, "");
+         
+         $("#enhancerConfigResult").show();     
+         
+         // submit the form query using Ajax
+         $.ajax({
+           type: "GET",
+           url: base,
+           data: "",
+           dataType: "text",
+           beforeSend: function(req) {
+             req.setRequestHeader("Accept", "application/rdf+xml");
+           },
+           cache: false,
+           success: function(result) {
+             $("#enhancerConfiguration").text(result);
+           },
+           error: function(result) {
+             $("#enhancerConfiguration").text('Error while loading chain config.');
+           }
+         });
+       }
+    </script>
+    <div id="enhancerConfigResult" style="display: none">
+    <p><a href="#" onclick="$('#enhancerConfigResult').hide(); return false;">Hide results</a>
+    <pre id="enhancerConfiguration">... waiting for results ...</pre>
+    </div>
+    
+    <p>In addition there is aleo a <a href="${it.publicBaseUri}enhancer/sparql">
+    SPARQL Endpoint</a> that allows to query the configuration</p>
+-->
+    <#-- 3. Documentation of the multipart ContentItem RESTful API -->  
+<#--    <#include "/imports/doc/multipartcontentitem.ftl"> -->
+    
+    <#-- 5. Documentation of the ExecutionPlan RESTful API -->  
+<#--    <#include "/imports/doc/executionplan.ftl"> -->
+    
+</div>
+
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/sparql.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/sparql.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/sparql.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/FlowRootResource/sparql.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,48 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#import "/imports/enhancersparql.ftl" as sparql>
+<#escape x as x?html>
+<@common.page title="SPARQL Endpoint for the Stanbol Enhancer Configuration" hasrestapi=false>
+
+  <p>This allows to query the configuration of the Stanbol Enhancer for 
+    active Enhancement Engines and EnhancementChains.</p>
+  
+  <p><a href="http://en.wikipedia.org/wiki/Sparql">SPARQL</a> is the
+    standard query language the most commonly used to provide interactive
+    access to semantic knowledge bases.</p>
+    
+  <p>A SPARQL endpoint is a standardized HTTP access to perform SPARQL queries.
+    Developers of REST clients will find all the necessary documentation in the
+    official <a href="http://www.w3.org/TR/rdf-sparql-protocol/#query-bindings-http">W3C
+    page for the RDF SPARQL protocol</a>.</p>
+    
+  <p>The Stanbol enhancer SPARQL endpoint gives access to the Configuration
+    of the Stanbol Enhancer. It does NOT allow to auery enhancement results.
+    Users that want to query/search for ContentItems based on extracted
+    knowledge should use instead:<ul>
+    <li> the <b><a href="${it.rootUrl}contenthub">Contenthub</a></b>: Supports
+        semantic search based on configurable semantic indexes.</li>
+    <li> <b><a href="${it.rootUrl}sparql">Sparql Endpoint</a></b>: Supports
+        SPARQL querys over the RDF graph containing the metadata of all enhanced
+        ContentItmes. </li>
+    </ul></p>
+ 
+  <@sparql.form/>
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/StoreRootResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/StoreRootResource/index.ftl?rev=1351524&view=auto
==============================================================================
--- incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/StoreRootResource/index.ftl (added)
+++ incubator/stanbol/branches/cameltrial/flow/web/src/main/resources/org/apache/stanbol/flow/jersey/templates/org/apache/stanbol/flow/jersey/resource/StoreRootResource/index.ftl Mon Jun 18 22:51:22 2012
@@ -0,0 +1,166 @@
+<#--
+  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.
+-->
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Store" hasrestapi=true> 
+
+<div class="panel" id="webview">
+<h3>Recently uploaded Content Items</h3>
+
+<div class="storeContents">
+<table>
+  <tr>
+    <th>Local ID</th>
+    <th>Media type</th>
+    <th>Enhancements <img src="${it.staticRootUrl}/images/rdf.png"
+       alt="Format: RDF"/></th>
+  </tr>
+  <#list it.recentlyEnhancedItems as item>
+  <tr>
+    <td><a href="${item.uri}" title="${item.uri}">${item.localId}</a></td>
+    <td>${item.mimetype}</td>
+    <td><a href="${it.rootUrl}/store/metadata/${item.localId}">${item.enhancements}</a></td>
+  </tr>
+  </#list>
+</ul>
+</table>
+<ul class="previousNext">
+  <#if it.moreRecentItemsUri?exists>
+    <li class="moreRecent"><a href="${it.moreRecentItemsUri}">More recent items</a></li>
+  </#if>
+  <#if it.olderItemsUri?exists>
+    <li class="older"><a href="${it.olderItemsUri}">Older items</a></li>
+  </#if>
+</ul>
+</div>
+
+
+<h3>Submit a new Content Item for analysis</h3>
+
+<form method="POST" accept-charset="utf-8">
+  <fieldset>
+  <legend>Submit raw text content</legend>
+  <p><textarea rows="15" name="content"></textarea></p>
+  <p><input type="submit" value="Submit text"></p>
+  </fieldset>
+</form>
+
+<form method="POST" accept-charset="utf-8">
+  <fieldset>
+  <legend>Submit a remote public resource by URL</legend>
+  <p><input name="url" type="text" class="url" />
+     <input type="submit" value="Submit URL"></p>
+  </fieldset>
+</form>
+
+<form method="POST" accept-charset="utf-8"  enctype="multipart/form-data">
+  <fieldset>
+  <legend>Upload a local file</legend>
+  <p><input name="file" type="file"/>
+     <input type="submit" value="Submit file"></p>
+  </fieldset>
+</form>
+
+
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Uploading new content to the store</h3>
+
+  <p>You can upload content to the store for analysis with or without providing the content
+   id at your option:<p>
+  <ol>
+    <li><code>PUT</code> content to <code>${it.publicBaseUri}store/content/<strong>content-id</strong></code>
+     with <code>Content-Type: text/plain</code>.</li>
+    <li><code>GET</code> enhancements from the same URL with
+     header <code>Accept: application/rdf+xml</code>.</li>
+  </ol>
+  
+  <p><code><strong>content-id</strong></code> can be any valid path and
+   will be used to fetch your item back later.</p>
+
+  <p>On a unix-ish box you can use run the following command from
+   the top-level source directory to populate the Stanbol enhancer service with
+    sample content items:</p>
+
+<pre>
+for file in data/text-examples/*.txt;
+do
+  curl -i -X PUT -H "Content-Type:text/plain" -T $file ${it.publicBaseUri}store/content/$(basename $file) ;
+done
+</pre> 
+
+  Alternatively you can let the Stanbol enhancer automatically build an id base on the SHA1
+  hash of the content by posting it at the root of the store.
+  <ol>
+    <li><code>POST</code> content to <code>${it.publicBaseUri}store/</code>
+     with <code>Content-Type: text/plain</code>.</li>
+    <li><code>GET</code> enhancements from the URL in the response along with
+       header <code>Accept: application/rdf+xml</code>.</li>
+  </ol>
+  
+  <p>For instance:</p>
+<pre>
+curl -i -X POST -H "Content-Type:text/plain" \
+     --data "The Stanbol enhancer can detect famous cities such as Paris." \
+     ${it.publicBaseUri}store
+    
+HTTP/1.1 201 Created
+Location: ${it.publicBaseUri}store/content/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+Content-Length: 0
+Server: Jetty(6.1.x)
+</pre>
+
+
+<h3>Fetching back the original content item and the related enhancements from the store</h3>
+
+<p>Once the content is created in the store, you can fetch back either the original content, a HTML summary view or
+the extracted RDF metadata by dereferencing the URL using the <code>Accept</code> header
+as selection switch:<p>
+
+<pre>
+curl -i <strong>-H "Accept: text/plain"</strong> ${it.publicBaseUri}store/content/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+
+HTTP/1.1 307 TEMPORARY_REDIRECT
+Location: ${it.publicBaseUri}store/<strong>raw</strong>/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+Content-Length: 0
+Server: Jetty(6.1.x)
+</pre>
+
+<pre>
+curl -i <strong>-H "Accept: text/html"</strong> ${it.publicBaseUri}store/content/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+
+HTTP/1.1 307 TEMPORARY_REDIRECT
+Location: ${it.publicBaseUri}store/<strong>page</strong>/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+Content-Length: 0
+Server: Jetty(6.1.x)
+</pre>
+
+<pre>
+curl -i <strong>-H "Accept: application/rdf+xml"</strong> ${it.publicBaseUri}store/content/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+
+HTTP/1.1 307 TEMPORARY_REDIRECT
+Location: ${it.publicBaseUri}store/<strong>metadata</strong>/sha1-84854eb6802a601ca2349ba28cc55f0b930ac96d
+Content-Length: 0
+Server: Jetty(6.1.x)
+</pre>
+
+</div>
+
+
+</...@common.page>
+</#escape>