marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject [2/3] git commit: MARMOTTA-289: sync templates at the marmotta webapp artifact
Date Tue, 27 Aug 2013 09:51:45 GMT
MARMOTTA-289: sync templates at the marmotta webapp artifact


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/704a28d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/704a28d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/704a28d9

Branch: refs/heads/develop
Commit: 704a28d97f7df5e947f979434732614cf8ff7072
Parents: 38c7212
Author: Sergio Fernández <wikier@apache.org>
Authored: Tue Aug 27 11:43:53 2013 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Tue Aug 27 11:43:53 2013 +0200

----------------------------------------------------------------------
 .../src/main/webapp/WEB-INF/templates/404.ftl   | 132 +++--
 .../src/main/webapp/WEB-INF/templates/admin.ftl | 141 ++---
 .../main/webapp/WEB-INF/templates/rdfhtml.ftl   | 527 ++++++++++---------
 3 files changed, 428 insertions(+), 372 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/704a28d9/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
index 7309ab3..52eca32 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
@@ -17,74 +17,68 @@
     limitations under the License.
 
 -->
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-  <title>404 Not Found - LMF Linked Data Explorer</title>
-  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-1.7.2.js"></script>
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-ui-1.8.21.js"></script>
-  <link href="${baseUri}core/public/style/style1.css" title="screen" rel="stylesheet"
type="text/css" />
-  <link href="${baseUri}core/public/style/center.css" title="screen" rel="stylesheet"
type="text/css" />  
-  <style type="text/css">
-    div#center {
-      float: none; 
-      width: auto; 
-      vertical-align: middle; 
-      min-height: 400px; 
-      margin: 0; 
-      padding: 2em 30% 5em 30%;
-    }
-    div#center > * {
-      margin-top: 2em;
-      font-size: 1.6em;
-    }
-    div#center > p > a > img {
-      vertical-align: text-top;
-      margin-left: 0.15em;
-    }
-  </style>  
-</head>
-
-<body>
-
-<div id="header">
-  <div id="logo">
-    <a href="${baseUri}">
-      <img src="${baseUri}core/public/img/lmf-white.png" alt="LMF" />
-    </a>
-  </div>
-  <h1>LMF Linked Data Explorer</h1>
-</div>
-
-<div id="center">
-
-  <h2>404 Not Found</h2>
-
-  <p>
-    <strong><a href="${baseUri}resource?uri=${encoded_uri}">${uri}</a></strong><a
href="${uri}"><img src="${baseUri}core/public/img/link.png" alt="${uri}" title="go to
${uri} directly" /></a>
-  </p>
-  
-  <p>
-    Sorry, but the requested resource could not be found in LMF right now,
-    but may be available again in the future.
-  </p>  
-
-</div>
-
-<div id="footer" class="clear">
-    <span><abbr title="Linked Media Framework">LMF</abbr> is a project
of <a href="http://www.newmedialab.at/">SNML-TNG</a></span>
-</div>
-
-<script type="text/javascript"> 
-
-  $(document).ready(function() {
-
-  });
-
-</script> 
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
+
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+    <title>404 Not Found - Marmotta Linked Data Explorer</title>
+    <script src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js" type="text/javascript"
></script>
+    <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css"
/>
+    <link href="${SERVER_URL}${DEFAULT_STYLE}rdfhtml.css" rel="stylesheet" type="text/css"
/>
+    <link href="${SERVER_URL}${DEFAULT_STYLE}404.css" rel="stylesheet" type="text/css"
/>
+  </head>
+
+  <body>
+
+    <div id="wrapper">
+    <div id="header">
+        <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
+            <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
+        </a>
+        <h1>Marmotta Linked Data Explorer</h1>
+        <div class="clean"></div>
+    </div>
+    <div class="clear"></div>
+    <div id="center">
+        <div id="content">
+
+          <h2>404 Not Found</h2>
+        
+          <p>
+            <strong><a href="${SERVER_URL}resource?uri=${encoded_uri}">${uri}</a></strong><a
href="${uri}"><img src="${SERVER_URL}core/public/img/icon/link.png" alt="${uri}" title="go
to ${uri} directly" /></a>
+          </p>
+          
+          <p>
+            Sorry, but ${message}.
+          </p>  
+        
+        </div>
+        
+    </div>
+
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+                ${FOOTER}
+            </span>
+        </div>
+    </div> 
+
+    </div>
+
+    <script type="text/javascript"> 
+
+    $(document).ready(function() {
+
+    });
+
+    </script> 
+
+  </body>
 
 </html>
+

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/704a28d9/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
index 0cf86db..d0d36fe 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/admin.ftl
@@ -17,65 +17,88 @@
     limitations under the License.
 
 -->
-<!DOCTYPE html>
-<html>
-    <head>
-	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
-        <link href="${SERVER_URL}core/public/style/javadoc.css" rel="stylesheet" type="text/css"
/>
-	    <link href="${SERVER_URL}core/public/style/style1.css" title="screen" rel="stylesheet"
type="text/css" />
-        <link href="${SERVER_URL}core/public/style/style2.css" title="beamer" rel="alternate
stylesheet" type="text/css" />
-        <link href="${SERVER_URL}core/public/img/icon-small.ico" rel="SHORTCUT ICON">
-        <script type="text/javascript">
-            var _BASIC_URL = "${BASIC_URL}";
-            //use _SERVER_URL for webservice calls
-            var _SERVER_URL = "${SERVER_URL}";
-        </script>
-        <script type="text/javascript" src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js"></script>
-        <script type="text/javascript" src="${SERVER_URL}core/public/js/widgets/current-user.js"></script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
+
+<head>
+
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <link href="${SERVER_URL}${DEFAULT_STYLE}javadoc.css" rel="stylesheet" type="text/css"
/>
+    <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css"
/>
+    <link href="${SERVER_URL}core/public/img/icon/lmf.ico" rel="SHORTCUT ICON">
+    <script type="text/javascript">
+        var _BASIC_URL = "${BASIC_URL}";
+        //use _SERVER_URL for webservice calls
+        var _SERVER_URL = "${SERVER_URL}";
+
+        var _CURRENT_STYLE = "${DEFAULT_STYLE}";
+
+    </script>
+    <#if USER_MODULE_IS_ACTIVE>
+        <link href="${SERVER_URL}user/admin/style/style.css" rel="stylesheet" type="text/css">
+        <script type="text/javascript" src="${SERVER_URL}user/admin/widgets/user.js"></script>
         <script type="text/javascript">
-            $(function() {
-        	  new LMF.currentUserWidget(_SERVER_URL, document.getElementById("login_logout")).init();
-        	});
+            window.onload = function () {
+                    LoginLogout.draw(_SERVER_URL,"login_logout");
+            }
         </script>
-        ${HEAD}
-        <title>LMF - The Linked Media Server</title>
-        <style type="text/css">
-        	#login_logout {
-				float: right;
-				margin: 5px;
-        	}
-        </style>
-    </head>
-    <body>
-        <a id="top-link" href="${SERVER_URL}">TOPLINK</a>
-        <div id="wrapper">
-            <div id="header">
-                <div id="logo">
-                    <a href="${SERVER_URL}"><img src="${SERVER_URL}core/public/img/lmf-white.png"
/></a>
-                </div>
-                <div id="header_text">
-                	<h1>${CURRENT_TITLE}</h1>
-                	<div id="topnav">
-    	            	<div id="login_logout"></div>
-    	            </div>
-                </div>
-            </div>
-            <div class="clear"></div>
-            <div id="left">
-                ${MODULE_MENU}
-            </div>
-            <div id="center">
-                ${CONTENT}
-            </div>
-            <div class="clear"></div>
-            <div id="footer">
-                <span>
-                    <a href="http://lmf.googlecode.com">LMF</a> 
-                    is a project of 
-                    <a href="http://www.newmedialab.at/">SNML-TNG</a>
-                </span>
-            </div>
+    </#if>
+
+    ${HEAD}
+
+</head>
+
+<body>
+
+<div id="wrapper">
+    <div id="header">
+        <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
+            <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
+        </a>
+        <h1>${CURRENT_MODULE} - ${CURRENT_TITLE}</h1>
+        <#if USER_MODULE_IS_ACTIVE>
+            <div id="login_logout"></div>
+        </#if>
+    </div>
+    <div class="clear"></div>
+    <div id="left">
+        <ul id="menu">
+            <#list MODULE_MENU as menu>
+            <li
+                <#if menu.properties["active"]>
+                        class="menu_item active"
+                <#else>
+                        class="menu_item"
+                </#if>
+            >
+                <div class="menu_heading"><a href="${menu.submenu[0].properties["path"]}">${menu.properties["title"]}</a></div>
+                <ul class="submenu">
+                <#list menu.submenu as submenu>
+                    <li
+                        <#if submenu.properties["active"]> class="active" </#if>
+                    >
+                    <a href="${submenu.properties["path"]}">${submenu.properties["title"]}</a>
+                    </li>
+                </#list>
+                </ul>
+            </li>
+            </#list>
+        </ul>
+    </div>
+    <div id="center">
+        <div id="content">
+        ${CONTENT}
+        </div>
+    </div>
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+                ${FOOTER}
+            </span>
         </div>
-    </body>
-</html>
+    </div>
+</div>
+

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/704a28d9/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
index 16379fc..f131133 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/rdfhtml.ftl
@@ -18,279 +18,318 @@
 
 -->
 <!DOCTYPE html>
-<html lang="en" prefix="${prefixMappings}">
+<html lang="en" prefix="${prefixMappings}" xmlns="http://www.w3.org/1999/html">
 
 <head>
   <title>Resource/s in HTML</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-1.7.2.js"></script>
-  <script type="text/javascript" src="${baseUri}core/public/js/lib/jquery-ui-1.8.21.js"></script>
-  <link href="${baseUri}core/public/style/style1.css" title="screen" rel="stylesheet"
type="text/css" />
-  <link href="${baseUri}core/public/style/rdfhtml.css" title="screen" rel="stylesheet"
type="text/css" />
-</head>
+  <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
+  <script type="text/javascript" src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js"></script>
+  <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css"
/>
+  <link href="${SERVER_URL}${DEFAULT_STYLE}rdfhtml.css" rel="stylesheet" type="text/css"
/>
+  <#if resources?size = 1>
+  <link rel="alternate" type="application/rdf+xml" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml"
/> 
+  <link rel="alternate" type="text/rdf+n3" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3"
/> 
+  <link rel="alternate" type="text/turtle" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle"
/> 
+  <link rel="alternate" type="application/rdf+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson"
/> 
+  <link rel="alternate" type="application/ld+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson"
/> 
+  </#if>
+      
+  <script>
+      $(document).ready(function(){
+          $(".submenu li").click(function(event){
+              event.preventDefault();
+              if(!$(this).hasClass("active")) {
+                  $(".submenu").children().removeClass("active");
+                  $(this).addClass("active");
+                  var tabid = $(this).children(":first").attr("href").substring(1);
+                  $("#content").children().hide();
+                  $("#"+tabid).show();
+              }
+          })
 
-<body>
+          $("a.ldcache").each(function(index) {
+              $(this).click(function() {
+                  window.location.href = "${SERVER_URL}resource?uri=" + encodeURIComponent($(this).attr("href"));
+                  return false;
+              });
+          });
 
-<div id="header">
-  <div id="logo">
-    <a href="${baseUri}">
-      <img src="${baseUri}core/public/img/lmf-white.png" alt="LMF" />
-    </a>
-  </div>
-  <h1>LMF Linked Data Explorer</h1>
-</div>
+          function loader(uri, type, target) {
+
+              var table = $("#"+target);
+
+              function linkify(text) {
+                  var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
+                  return text.replace(exp,"<a href='$1' class='ldcache'>$1</a>");
+              }
+              function zebra(index) {
+                  return ( index % 2 ? "even": "odd" );
+              }
+              function createRow(data, cssClass) {
+                  return $("<tr>", {})
+                          .append($("<td>", {html: linkify(data.s)}))
+                          .append($("<td>", {html: linkify(data.p)}))
+                          .append($("<td>", {html: linkify(data.o)}))
+                          .append($("<td>", {html: linkify(data.c)}))
+                          .addClass(cssClass);
+              }
+              return {
+                  resource: uri,
+                  target: table,
+                  offset: 0,
+                  limit: 10,
+                  fetch: function() {
+                      var self = this;
+                      $.getJSON("${SERVER_URL}inspect/" + type, {uri: self.resource, start:
self.offset, limit: self.limit}, function(data) {
+                          if(data.length == 0) {
+                              console.log(table);
+                              table.replaceWith("<p class='no_triples'>No triples to
display</p>");
+                          }
+                          for( var i in data) {
+                              var t = data[i];
+                              table.append(createRow(t, zebra(i)));
+                          }
+                      });
+                  },
+                  next: function(step) {
+                      step = step || this.limit;
+                      this.offset += step;
+                      this.fetch();
+                  },
+                  prev: function(step) {
+                      step = step || this.limit
+                      this.offset = Math.max(this.offset - step, 0);
+                      this.fetch();
+                  },
+                  more: function() {
+                      this.limit += 5;
+                      this.fetch();
+                  },
+                  less: function() {
+                      this.limit = Math.max(this.limit - 5, 5);
+                      this.fetch();
+                  },
+                  first: function() {
+                      this.offset = 0;
+                      this.fetch();
+                  }
+              };
+          }
+
+      <#if resources?size = 1>
+          var subjLoader = new loader("${resources[0].uri}", "subject", "inspect_subject");
+          subjLoader.fetch();
+          $("#s0").click(function() {subjLoader.first();});
+          $("#s1").click(function() {subjLoader.prev();});
+          $("#s2").click(function() {subjLoader.next();});
+          $("#s3").click(function() {subjLoader.more();});
+          $("#s4").click(function() {subjLoader.less();});
+
+          var propLoader = new loader("${resources[0].uri}", "predicate", "inspect_property");
+          propLoader.fetch();
+
+          var objLoader = new loader("${resources[0].uri}", "object", "inspect_object");
+          objLoader.fetch();
+      </#if>
+
+      })
+  </script>
+</head>
 
+<body>
 <#function zebra index>
-  <#if (index % 2) == 0>
-    <#return "even" />
-  <#else>
-    <#return "odd" />
-  </#if>
+    <#if (index % 2) == 0>
+        <#return "odd" />
+    <#else>
+        <#return "even" />
+    </#if>
 </#function>
 
 <#function cacheClass object>
-  <#if object.cache?has_content>
-    <#return "ldcache" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.cache?has_content>
+        <#return "ldcache" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
 <#function rdfaAttributes object>
-  <#return "${rdfaDatatype(object)} ${rdfaLanguage(object)}" />
+    <#return "${rdfaDatatype(object)} ${rdfaLanguage(object)}" />
 </#function>
 
 <#function rdfaDatatype object>
-  <#if object.datatype?has_content>
-    <#return "datatype=\"${object.datatype}\"" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.datatype?has_content>
+        <#return "datatype=\"${object.datatype}\"" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
 <#function rdfaLanguage object>
-  <#if object.lang?has_content>
-    <#return "lang=\"${object.lang}\"" />
-  <#else>
-    <#return "" />
-  </#if>
+    <#if object.lang?has_content>
+        <#return "lang=\"${object.lang}\"" />
+    <#else>
+        <#return "" />
+    </#if>
 </#function>
 
-<div id="tabs">
-
-    <ul>
-    
-        <li><a href="#tab-raw-triples">raw triples</a></li>
-        
+<div id="wrapper">
+    <div id="header">
+        <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
+            <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
+        </a>
+        <h1>RDF/HTML</h1>
         <#if resources?size = 1>
-        <li><a href="#tab-inspection">inspection</a></li>
-        </#if>  
-        
-    </ul>
-    
-    <div id="tab-raw-triples">
-   
-        <#if resources?has_content>
-          <#list resources as resource>
-            <div class="subheader">
-              <h3>Local description of <a href="${resource.uri}" class="ldcache">${resource.uri}</a>:</h3>
-            </div>
-            <table>
-              <tr class="trClassHeader">
-                <th>property</th>
-                <th>has value</th>
-                <th>context</th>
-                <th id="info">info</th>
-              </tr>
-              <#list resource.triples as triple>
-              <tr class="${zebra(triple_index)}">
-                <td><a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a></td>
-                <td about="${resource.uri}">
-                <#if triple.object.uri?has_content>
-                <a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
-                <#else> 
-                <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
+        <div id="top_serialisation_links">
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle">Turtle</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson">JSON-LD</a>
+        </div>
+        <div class="clean"></div>
+        </#if>
+    </div>
+    <div class="clear"></div>
+    <div id="left">
+    <ul id="menu">
+        <li class="menu_item">
+        <div class="menu_heading">Views</div>
+        <ul class="submenu">
+                <li class="active"><a href="#tab-raw-triples">Triples</a></li>
+                <#if resources?size = 1>
+                <li><a href="#tab-inspection">Inspector</a></li>
                 </#if>
-                </td>
-                <td><a href="${triple.context.curie}">${triple.context.curie}</a></td>
-                <td>${triple.info}</td>
-              </tr>
-              </#list>
-            </table>
-            <p id="rawrdf">
-              Get this resource in raw RDF: 
-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>,

-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>,

-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=text/turtle">Turtle</a>,

-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>,

-              <a href="${baseUri}resource?uri=${resource.encoded_uri}&amp;format=application/json">JSON-LD</a>
-            </p>
-          </#list>
-        <#else> 
-          <div class='subheader'>
-            <h3>No local triples to display!</h3>
-          </div>
-        </#if>   
-        
+            </ul>
+        </li>
+    </ul>
     </div>
-    
-    <#if resources?size = 1>
-    <div id="tab-inspection">
-        <div class="subheader">
-            <h3>Inspection of <a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>:</h3>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>
as Subject</h4>
-            <button id="s0">|&lt;</button>
-            <button id="s1">&lt;</button>
-        	<button id="s2">&gt;</button>
-        	<button id="s3">+</button>
-        	<button id="s4">-</button>
-        	<table id="inspect_subject">
-        	  <tr class="trClassHeader">
-        	    <th>Subject</th>
-        	    <th>Property</th>
-        	    <th>Object</th>
-        	    <th>Context<th>
-        	  </tr>
-        	</table>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>
as Property</h4>
-        	<table id="inspect_property">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
-        </div>
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>
as Object</h4>
-        	<table id="inspect_object">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
+    <div id="center">
+        <div id="content">
+            <div id="tab-raw-triples">
+
+            <h1>Triples</h1>
+            <#if resources?has_content>
+                <#list resources as resource>
+                    <h2><a href="${resource.uri}" class="ldcache">${resource.uri}</a>
+                        <#if timemaplink??>
+                            <a style="float:right" id="timemap_link" href="${SERVER_URL}${timemaplink}${resource.uri}">
+                                <img style="width: 24px" title="browser versions" alt="memento"
src="${SERVER_URL}core/public/img/icon/memento_logo_128.png">
+                            </a>
+                        </#if>
+                    </h2>
+                    <table class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>property</th>
+                            <th>has value</th>
+                            <th>context</th>
+                            <th id="info">info</th>
+                        </tr>
+                        <#list resource.triples as triple>
+                            <tr class="${zebra(triple_index)}">
+                                <td><a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a></td>
+                                <td about="${resource.uri}">
+                                    <#if triple.object.uri?has_content>
+                                        <a rel="${triple.predicate.curie}" href="${triple.object.uri}"
class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    <#else>
+                                        <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
+                                    </#if>
+                                </td>
+                                <td><a href="${triple.context.uri}">${triple.context.curie}</a></td>
+                                <td>${triple.info}</td>
+                            </tr>
+                        </#list>
+                    </table>
+                    <#if resources?size != 1>
+                    <p id="rawrdf">
+                        Get this resource in raw RDF:
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=text/turtle">Turtle</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>,
+                        <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/ld%2Bjson">JSON-LD</a>
+                    </p>
+                    </#if>
+                </#list>
+            <#else>
+                <p>
+                    No local triples to display!
+                </p>
+            </#if>
+
+            </div>
+
+        <#if resources?size = 1>
+            <div id="tab-inspection" style="display: none">
+                <h1>Inspection of <a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a></h1>
+                <div class="introspectionDetails">
+                    <h2>Resource as Subject</h2>
+                    <div id="table_buttons">
+                    <button id="s0">|&lt;</button>
+                    <button id="s1">&lt;</button>
+                    <button id="s2">&gt;</button>
+                    <button id="s3">+</button>
+                    <button id="s4">-</button>
+                    </div>
+                    <table id="inspect_subject" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <div class="introspectionDetails">
+                    <h2>Resource as Property</h2>
+                    <table id="inspect_property" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <div class="introspectionDetails">
+                    <h2>Resource as Object</h2>
+                    <table id="inspect_object" class="simple_table">
+                        <tr class="trClassHeader">
+                            <th>Subject</th>
+                            <th>Property</th>
+                            <th>Object</th>
+                            <th>Context</th>
+                        </tr>
+                    </table>
+                </div>
+                <!--
+                <div class="introspectionDetails">
+                    <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>
as Context</h4>
+                	<table id="inspect_context">
+                      <tr class="trClassHeader">
+                        <th>Subject</th>
+                        <th>Property</th>
+                        <th>Object</th>
+                        <th>Context<th>
+                      </tr>
+                	</table>
+                </div>
+                -->
+            </div>
+        </#if>
         </div>
-        <!--
-        <div class="introspectionDetails">
-            <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a>
as Context</h4>
-        	<table id="inspect_context">
-              <tr class="trClassHeader">
-                <th>Subject</th>
-                <th>Property</th>
-                <th>Object</th>
-                <th>Context<th>
-              </tr>
-        	</table>
+    </div>
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+            ${FOOTER}
+            </span>
         </div>
-        -->
     </div>
-    </#if>   
-    
 </div>
-
-<div id="footer" class="clear">
-    <span><abbr title="Linked Media Framework">LMF</abbr> is a project
of <a href="http://www.newmedialab.at/">SNML-TNG</a></span>
-</div>
-
-<script type="text/javascript"> 
-
-  $(document).ready(function() {
-
-    $("div#tabs").tabs();
-    
-    $("a.ldcache").each(function(index) { 
-      $(this).click(function() { 
-        window.location.href = "${baseUri}resource?uri=" + encodeURIComponent($(this).attr("href"));

-        return false; 
-      }); 
-    });    
-    
-    function loader(uri, type, target) {
-        function linkify(text) {
-            var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
-            return text.replace(exp,"<a href='$1' class='ldcache'>$1</a>"); 
-        }
-        function zebra(index) {
-             return ( index % 2 ? "even": "odd" );
-        }                
-        function createRow(data, cssClass) {
-            return $("<tr>", {})
-                .append($("<td>", {html: linkify(data.s)}))
-                .append($("<td>", {html: linkify(data.p)}))
-                .append($("<td>", {html: linkify(data.o)}))
-                .append($("<td>", {html: linkify(data.c)}))
-                .addClass(cssClass);
-        }
-        return {
-            resource: uri,
-            target: $(target),
-            offset: 0,
-            limit: 10,
-            fetch: function() {
-                var self = this;
-                $.getJSON("${baseUri}inspect/" + type, {uri: self.resource, start: self.offset,
limit: self.limit}, function(data) {
-                    //self.target.empty();
-                    for( var i in data) {
-                        var t = data[i];
-                        self.target.append(createRow(t, zebra(i)));                     
               
-                    }
-                });
-            },
-            next: function(step) {
-                step = step || this.limit;
-                this.offset += step;
-                this.fetch();
-            },
-            prev: function(step) {
-                step = step || this.limit
-                this.offset = Math.max(this.offset - step, 0);
-                this.fetch();
-            },
-            more: function() {
-                this.limit += 5;
-                this.fetch();
-            },
-            less: function() {
-                this.limit = Math.max(this.limit - 5, 5);
-                this.fetch();
-            },
-            first: function() {
-                this.offset = 0;
-                this.fetch();
-            }
-        };
-    }    
-    
-    <#if resources?size = 1>
-    var subj = $("table#inspect_subject tbody");
-    var subjLoader = new loader("${resources[0].uri}", "subject", subj);
-    subjLoader.fetch();
-    $("#s0").click(function() {subjLoader.first();});
-    $("#s1").click(function() {subjLoader.prev();});
-    $("#s2").click(function() {subjLoader.next();});
-    $("#s3").click(function() {subjLoader.more();});
-    $("#s4").click(function() {subjLoader.less();});
-
-    var prop = $("table#inspect_property tbody");
-    var propLoader = new loader("${resources[0].uri}", "predicate", prop);
-    propLoader.fetch();
-
-    var obj = $("table#inspect_object tbody");
-    var objLoader = new loader("${resources[0].uri}", "object", obj);
-    objLoader.fetch();    
-    </#if> 
-
-  });
-
-</script> 
-
 </body>
 
 </html>
+


Mime
View raw message