You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by si...@apache.org on 2012/05/04 15:38:17 UTC

svn commit: r1333955 [2/2] - in /incubator/stanbol/trunk/contenthub/web: ./ src/main/java/org/apache/stanbol/contenthub/web/fragment/ src/main/java/org/apache/stanbol/contenthub/web/resources/ src/main/resources/org/apache/stanbol/contenthub/web/static...

Modified: incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource/index.ftl?rev=1333955&r1=1333954&r2=1333955&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource/index.ftl (original)
+++ incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/SemanticIndexManagerResource/index.ftl Fri May  4 13:38:16 2012
@@ -17,39 +17,44 @@
 <#import "/imports/common.ftl" as common>
 <#escape x as x?html>
 <@common.page title="LD Path" hasrestapi=true>
-
-  <h3>Recently Submitted LD Programs</h3>
-  <div id="storeContents" class="storeContents">
-    <div id="submittedPrograms">
-      <table>
-        <tr>
-          <th></th>
-          <th>ProgramName</th>
-          <th>LD Path Program</th>
-        </tr>
-        <#list it.ldPrograms as ldProgram>
+  <div class="panel" id="webview">
+    <h3>Recently Submitted LD Programs</h3>
+    <div id="storeContents" class="storeContents">
+      <div id="submittedPrograms">
+        <table>
           <tr>
-            <td><img src="${it.staticRootUrl}/contenthub/images/delete_icon_16.png" onClick="javascript:deleteProgram('${ldProgram.name}')" title="Delete this program" /></td>
-            <td>${ldProgram.name}</td>
-            <td>${ldProgram.ldPathProgram}</td>
+            <th></th>
+            <th>ProgramName</th>
+            <th>LD Path Program</th>
           </tr>
-        </#list>
-      </table>
+          <#list it.ldPrograms as ldProgram>
+            <tr>
+              <td><img src="${it.staticRootUrl}/contenthub/images/delete_icon_16.png" onClick="javascript:deleteProgram('${ldProgram.name}')" title="Delete this program" /></td>
+              <td>${ldProgram.name}</td>
+              <td>${ldProgram.ldPathProgram}</td>
+            </tr>
+          </#list>
+        </table>
+      </div>
     </div>
+    
+    <br/>
+    
+    <h3>Submit a new LD Program</h3>
+    <fieldset>
+      <legend>Give an LD Program Name and LD Path Program</legend>
+      <p>Program Name:</p>
+      <p><input type="text" id="programNameText" /></p>
+      <p>LD Path Program:</p>
+      <p><textarea rows="15" id="ldPathProgramTextArea" name="content"></textarea></p>
+      <p><input type="submit" id="ldProgramSubmit" value="Submit Program" onClick="javascript:submitProgram();" /></p>
+    </fieldset>
   </div>
   
-  <br/>
-  
-  <h3>Submit a new LD Program</h3>
-  <fieldset>
-    <legend>Give an LD Program Name and LD Path Program</legend>
-    <p>Program Name:</p>
-    <p><input type="text" id="programNameText" /></p>
-    <p>LD Path Program:</p>
-    <p><textarea rows="15" id="ldPathProgramTextArea" name="content"></textarea></p>
-    <p><input type="submit" id="ldProgramSubmit" value="Submit Program" onClick="javascript:submitProgram();" /></p>
-  </fieldset>
-  
+  <div class="panel" id="restapi" style="display: none;">
+    <#include "/imports/ldpathrestapi.ftl">
+  </div>  
+
   <script language="javascript">
       function submitProgram() {
           var programName = $.trim($("#programNameText").val());

Modified: incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/StoreResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/StoreResource/index.ftl?rev=1333955&r1=1333954&r2=1333955&view=diff
==============================================================================
--- incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/StoreResource/index.ftl (original)
+++ incubator/stanbol/trunk/contenthub/web/src/main/resources/org/apache/stanbol/contenthub/web/templates/org/apache/stanbol/contenthub/web/resources/StoreResource/index.ftl Fri May  4 13:38:16 2012
@@ -133,81 +133,7 @@
 </div>
 
 <div class="panel" id="restapi" style="display: none;">
-  <h3>Uploading new content to the Contenthub</h3>
-
-  <p>Contenthub lives at the endpoint starting with "contenthub":</p>
-  <code>${it.publicBaseUri}contenthub/</code>
-  <p>This endpoint automatically forwards to:</p>
-  <code>${it.publicBaseUri}contenthub/${it.indexName}/store/</code>
-  <p>The endpoint to which Contenthub automatically forwards includes the name of the default index,
-  whose name is "contenthub". That is the reason for two consecutive "contenthub"s in the endpoint.
-  Lastly, "store" page provides the storage related functionalities of Contenthub such as document submission.</p>
-
-  <p>You can upload content to the Contenthub for analysis with or without providing the content
-   id at your option:</p>
-  <ul>
-    <li><code>POST</code> content to <code>${it.publicBaseUri}contenthub/${it.indexName}/store/<strong>content-id</strong></code>
-     with <code>Content-Type: text/plain</code>.</li>
-    <li><code>GET</code> content with its enhancements from the same URL.</li>
-  </ul>
-  
-  <p><code><strong>content-id</strong></code> can be any valid URI and
-   will be used to fetch your item back later. <code><strong>content-id</strong></code>s are unique within Contenthub.</p>
-
-  <p>On a unix-ish box you can use run the following command from
-   the top-level source directory to populate the Stanbol Contenthub service with
-   sample content items:</p>
-
-  <pre>
-  for file in enhancer/data/text-examples/*.txt;
-  do
-    curl -i -X POST -H "Content-Type:text/plain" -T $file ${it.publicBaseUri}contenthub/${it.indexName}/store/$(basename $file);
-  done
-  </pre> 
-
-  Alternatively you can let the Stanbol Contenthub automatically build an id base on the SHA1
-  hash of the content by posting it at the root of the Contenthub.
-  <ul>
-    <li><code>POST</code> content to <code>${it.publicBaseUri}contenthub/${it.indexName}/store</code>
-     with <code>Content-Type: text/plain</code>.</li>
-  </ul>
-  
-  <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}contenthub/${it.indexName}/store
-    
-HTTP/1.1 201 Created
-Location: ${it.publicBaseUri}contenthub/${it.indexName}/store/content/{<code><strong>content-id</strong><code>}
-Content-Length: 0
-Server: Jetty(6.1.x)
-</pre>
-
-<h3>Fetching back the original content item and the related enhancements from the Contenthub</h3>
-
-<p>Once the content is created in the Contenthub, you can fetch back either the original content, a HTML summary view or
-the extracted RDF metadata by dereferencing the URL:</p>
-
-<pre>
-curl -i <strong>-H "Accept: text/plain"</strong> ${it.publicBaseUri}contenthub/${it.indexName}/store/content/{<code><strong>content-id</strong><code>}
-
-HTTP/1.1 307 TEMPORARY_REDIRECT
-Location: ${it.publicBaseUri}contenthub/${it.indexName}/store/raw/{<code><strong>content-id</strong><code>}
-Content-Length: 0
-Server: Jetty(6.1.x)
-</pre>
-
-<p>
-Tutorials on Stanbol Contenthub can be found in the following links:<br/>
-<a href="http://incubator.apache.org/stanbol/docs/trunk/contenthub/">Contenhub - One Minute Tutorial</a><br/>
-<a href="http://incubator.apache.org/stanbol/docs/trunk/contenthub/contenthub5min">Contenthub - Five Minutes Tutorial</a>
-</p>
-
-<h4>The RESTful API of the Contenthub</h4>
-
-<#-- Will be written by Meric -->
-
+  <#include "/imports/storerestapi.ftl">
 </div>
 
 <script language="javascript">
@@ -218,7 +144,7 @@ Tutorials on Stanbol Contenthub can be f
         $.get("${it.publicBaseUri}contenthub/ldpath", function(indexes) {
             innerStr = "<select id='indexSelect' onChange='javascript:redirectIndex();'>" + "<option value='contenthub'>contenthub</option>"
             for(var index in indexes) {
-                innerStr += "<option value=" + index + ">" + index + "</option>";
+                innerStr += "<option value=\"" + index + "\">" + index + "</option>";
             }
             innerStr += "</select>";
             $("#indexDiv").html(innerStr);
@@ -391,6 +317,10 @@ Tutorials on Stanbol Contenthub can be f
     }
   
     function performSearch() {
+        if($("#searchKeywords").val() == null || $.trim($("#searchKeywords").val()).length == 0) {
+            alert("You should enter keyword(s) for search");
+            return;
+        }
         var lurl = "${it.publicBaseUri}contenthub/${it.indexName}/search/featured?fromStore=\"y\"&queryTerm=" + $("#searchKeywords").val();
         window.location.replace(lurl);
     }