You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2014/03/13 15:38:08 UTC

[1/3] git commit: MARMOTTA-189: included simple timeline using timeknots.js

Repository: marmotta
Updated Branches:
  refs/heads/MARMOTTA-189 [created] 3de220825


MARMOTTA-189: included simple timeline using timeknots.js


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

Branch: refs/heads/MARMOTTA-189
Commit: 2b71c07e393503d1c86a4af4afd9167034058569
Parents: dd004d3
Author: Jakob Frank <ja...@apache.org>
Authored: Mon Feb 17 12:35:42 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Mar 13 15:34:56 2014 +0100

----------------------------------------------------------------------
 .../src/main/resources/templates/memento_timemap.ftl   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/2b71c07e/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl b/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
index 44a717d..e99bdd8 100644
--- a/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
+++ b/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
@@ -26,6 +26,9 @@
     <script type="text/javascript" src="${baseUri}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" />
+
+    <script type="text/javascript" src="http://graves.cl/timeknots/src/d3.v2.min.js"></script>
+    <script type="text/javascript" src="http://graves.cl/timeknots/src/timeknots-min.js"></script>
 </head>
 
 <body>
@@ -40,6 +43,16 @@
     </div>
     <div id="center" style="width: 100%">
         <div id="content">
+            <div id="timeknots" style="width:100%"></div>
+<script type="text/javascript">
+var v = [
+<#list versions as version>
+{'name':"${version.date}", 'date':new Date("${version.tstamp}")},
+</#list>
+{'name':"now", 'date':new Date()}
+];
+TimeKnots.draw("#timeknots", v, {dateFormat: "%Y", color: "#696", showLabels: true, labelFormat: "%Y-%m-%d %H:%M:%S"});
+</script>
             <table class="simple_table">
                 <tr>
                     <th>Verions</th>


[2/3] git commit: MARMOTTA-189: set default encoding in templating to enable url-encoding see http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_url

Posted by ja...@apache.org.
MARMOTTA-189: set default encoding in templating to enable url-encoding
see http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_url


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

Branch: refs/heads/MARMOTTA-189
Commit: 42561a732de347932086650496b851fcbc6799e2
Parents: 2b71c07
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Mar 13 15:28:51 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Mar 13 15:35:17 2014 +0100

----------------------------------------------------------------------
 .../platform/core/services/templating/TemplatingServiceImpl.java   | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/42561a73/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
index 02a5ff7..231326f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
@@ -124,6 +124,8 @@ public class TemplatingServiceImpl implements TemplatingService {
 	@Override
     public  Configuration getConfiguration(Class<?> cls) {
         Configuration cfg = new Configuration();
+        cfg.setDefaultEncoding("utf-8");
+        cfg.setURLEscapingCharset("utf-8");
         try {
             cfg.setDirectoryForTemplateLoading(templateDir);
         } catch (IOException e) {


[3/3] git commit: MARMOTTA-189: added timeline for memento using timeknots see https://github.com/alangrafu/timeknots

Posted by ja...@apache.org.
MARMOTTA-189: added timeline for memento using timeknots
see https://github.com/alangrafu/timeknots

Waiting for the timeknots-webjar to be released


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

Branch: refs/heads/MARMOTTA-189
Commit: 3de220825c74d8e9c8633e9f4c63448a262d25c5
Parents: 42561a7
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Mar 13 15:32:56 2014 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Mar 13 15:35:18 2014 +0100

----------------------------------------------------------------------
 platform/marmotta-versioning-kiwi/pom.xml       |  9 ++++
 .../resources/templates/memento_timemap.ftl     | 45 ++++++++++++++++----
 2 files changed, 46 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/3de22082/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index 53c77b6..01dc755 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -170,6 +170,15 @@
             <groupId>org.apache.marmotta</groupId>
             <artifactId>kiwi-versioning</artifactId>
         </dependency>
+
+        <!-- webjars -->
+        <dependency>
+            <!-- FIXME: Use the release when available -->
+            <groupId>org.webjars</groupId>
+            <artifactId>timeknots</artifactId>
+            <version>0.1-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
     </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/3de22082/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl b/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
index e99bdd8..92f4745 100644
--- a/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
+++ b/platform/marmotta-versioning-kiwi/src/main/resources/templates/memento_timemap.ftl
@@ -17,18 +17,25 @@
     limitations under the License.
 
 -->
+<#-- @ftlvariable name="FOOTER" type="java.lang.String" -->
+<#-- @ftlvariable name="LOGO" type="java.lang.String" -->
+<#-- @ftlvariable name="SERVER_URL" type="java.lang.String" -->
+<#-- @ftlvariable name="DEFAULT_STYLE" type="java.lang.String" -->
+<#-- @ftlvariable name="baseUri" type="java.lang.String" -->
+<#-- @ftlvariable name="versions" type="java.util.List<java.util.Map<String, String>" -->
+<#-- @ftlvariable name="original" type="java.lang.String" -->
 <!DOCTYPE html>
 <html lang="en">
 
 <head>
     <title>Timemap in HTML</title>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
-    <script type="text/javascript" src="${baseUri}webjars/jquery/1.8.2/jquery.min.js"></script>
+    <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" />
 
-    <script type="text/javascript" src="http://graves.cl/timeknots/src/d3.v2.min.js"></script>
-    <script type="text/javascript" src="http://graves.cl/timeknots/src/timeknots-min.js"></script>
+    <script type="text/javascript" src="${SERVER_URL}webjars/d3js/3.4.1/d3.min.js"></script>
+    <script type="text/javascript" src="${SERVER_URL}webjars/timeknots/0.1/timeknots-min.js"></script>
 </head>
 
 <body>
@@ -45,13 +52,35 @@
         <div id="content">
             <div id="timeknots" style="width:100%"></div>
 <script type="text/javascript">
-var v = [
+    $(function() {
+        var target = "#timeknots",
+            v = [
 <#list versions as version>
-{'name':"${version.date}", 'date':new Date("${version.tstamp}")},
+            {'name':"${version.date}", 'date':new Date("${version.tstamp}"), 'uri':"${version.uri}"},
 </#list>
-{'name':"now", 'date':new Date()}
-];
-TimeKnots.draw("#timeknots", v, {dateFormat: "%Y", color: "#696", showLabels: true, labelFormat: "%Y-%m-%d %H:%M:%S"});
+            {'name':"now", 'date':new Date(),'lineWidth':1, 'uri':"${SERVER_URL}resource?uri=${original?url}"}
+        ];
+
+        function redraw() {
+            var t = $(target).empty();
+            TimeKnots.draw(target, v, {
+                height: "50",
+                width: t.innerWidth(),
+                dateFormat: "%Y-%m-%d %H:%M:%S",
+                color: "#0B61A4",
+                showLabels: false,
+                labelFormat: "%Y-%m-%d %H:%M:%S"
+            });
+            d3.select(target+" svg").selectAll('circle')
+               .on("click", function(d) {
+                    window.location.href = d.uri;
+            });
+
+        }
+        $(window).resize(function() { redraw(); });
+
+        redraw();
+    });
 </script>
             <table class="simple_table">
                 <tr>