You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by tk...@apache.org on 2014/10/15 17:37:18 UTC

[1/3] git commit: fixes memento time issue within memento links

Repository: marmotta
Updated Branches:
  refs/heads/develop 174ad5abd -> 3cda9e0a9


fixes memento time issue within memento links


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

Branch: refs/heads/develop
Commit: 09157c5f769ecc8424dd108047f3365c2b262bbb
Parents: 174ad5a
Author: tkurz <tk...@apache.org>
Authored: Wed Oct 15 16:49:40 2014 +0200
Committer: tkurz <tk...@apache.org>
Committed: Wed Oct 15 16:49:40 2014 +0200

----------------------------------------------------------------------
 .../versioning/model/MementoVersionSet.java     |  4 +--
 .../webservices/MementoWebService.java          | 34 ++++++++------------
 2 files changed, 16 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/09157c5f/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
index 3424ac1..45a50dc 100644
--- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
+++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
@@ -55,7 +55,7 @@ public class MementoVersionSet {
         //first, last and current are mandatory
         if( first == null || last == null || current == null) throw new MementoException("Memento links cannot be produced");
 
-        links.add(buildLink(prefix,original.toString(),first.getCommitTime(),"first memento"));
+        links.add(buildLink(prefix, original.toString(), first.getCommitTime(), "first memento"));
         links.add(buildLink(prefix,original.toString(),last.getCommitTime(),"last memento"));
         links.add(buildLink(prefix,original.toString(),current.getCommitTime(),"memento"));
 
@@ -71,7 +71,7 @@ public class MementoVersionSet {
 
     private String buildLink( String prefix, String resource, Date date, String rel ) {
         return  "<" + prefix + MementoUtils.MEMENTO_DATE_FORMAT.format(date) + "/" + resource +
-                ">;datetime=\"" + date.toString() + "\";rel=\"" + rel +"\"";
+                ">;datetime=\"" + MementoUtils.MEMENTO_DATE_FORMAT.format(date.toString()) + "\";rel=\"" + rel +"\"";
     }
 
     public Resource getOriginal() {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/09157c5f/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/webservices/MementoWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/webservices/MementoWebService.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/webservices/MementoWebService.java
index dffac04..d04bda2 100644
--- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/webservices/MementoWebService.java
+++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/webservices/MementoWebService.java
@@ -17,24 +17,7 @@
  */
 package org.apache.marmotta.platform.versioning.webservices;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-
+import com.google.common.base.Preconditions;
 import org.apache.marmotta.commons.collections.CollectionUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.MarmottaHttpUtils;
@@ -61,7 +44,18 @@ import org.openrdf.rio.Rio;
 import org.openrdf.sail.SailException;
 import org.slf4j.Logger;
 
-import com.google.common.base.Preconditions;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Webservice manages memento related services, namely:
@@ -227,7 +221,7 @@ public class MementoWebService {
                         .ok()
                         .header("Link", CollectionUtils.fold(links," ,"))
                         .header("Content-Type", type.toString())
-                        .header("Memento-Datetime", versions.getCurrent().getCommitTime().toString())
+                        .header("Memento-Datetime", MementoUtils.MEMENTO_DATE_FORMAT.format(versions.getCurrent().getCommitTime()))
                         .entity(entity)
                         .build();
 


[3/3] git commit: fixes date parse bug

Posted by tk...@apache.org.
fixes date parse bug


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

Branch: refs/heads/develop
Commit: 3cda9e0a9ec1a5c3781567d5710df5f542c7bda4
Parents: 484a79b
Author: tkurz <tk...@apache.org>
Authored: Wed Oct 15 17:36:02 2014 +0200
Committer: tkurz <tk...@apache.org>
Committed: Wed Oct 15 17:36:02 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/versioning/model/MementoVersionSet.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/3cda9e0a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
index 45a50dc..84997e3 100644
--- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
+++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/model/MementoVersionSet.java
@@ -71,7 +71,7 @@ public class MementoVersionSet {
 
     private String buildLink( String prefix, String resource, Date date, String rel ) {
         return  "<" + prefix + MementoUtils.MEMENTO_DATE_FORMAT.format(date) + "/" + resource +
-                ">;datetime=\"" + MementoUtils.MEMENTO_DATE_FORMAT.format(date.toString()) + "\";rel=\"" + rel +"\"";
+                ">;datetime=\"" + MementoUtils.MEMENTO_DATE_FORMAT.format(date) + "\";rel=\"" + rel +"\"";
     }
 
     public Resource getOriginal() {


[2/3] git commit: simplify query in dataviews

Posted by tk...@apache.org.
simplify query in dataviews


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

Branch: refs/heads/develop
Commit: 484a79bcf023c29c50ebb1ebba46bc670edb89cb
Parents: 09157c5
Author: tkurz <tk...@apache.org>
Authored: Wed Oct 15 17:07:14 2014 +0200
Committer: tkurz <tk...@apache.org>
Committed: Wed Oct 15 17:07:14 2014 +0200

----------------------------------------------------------------------
 .../marmotta-core/src/main/resources/web/admin/dataview.html     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/484a79bc/platform/marmotta-core/src/main/resources/web/admin/dataview.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/dataview.html b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
index 46facb9..59fcb23 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/dataview.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
@@ -152,8 +152,8 @@
                 $("#resources").empty().append(loader());
                 var target = $("#types").empty().append(loader()),
                     query = _graph ?
-                        "SELECT ?class (COUNT(?s) AS ?count) WHERE { GRAPH <"+_graph+"> {{?s a ?class} UNION {SELECT ?s WHERE { GRAPH <"+_graph+"> { ?s ?a ?b. FILTER NOT EXISTS{?s a ?class}}}GROUP BY ?s}}}GROUP BY ?class" :
-                        "SELECT ?class (COUNT(?s) AS ?count) WHERE {{?s a ?class} UNION {SELECT ?s WHERE{ ?s ?a ?b. FILTER NOT EXISTS{?s a ?class}}GROUP BY ?s}}GROUP BY ?class";
+                        "SELECT ?class (COUNT(?s) AS ?count) WHERE { GRAPH <"+_graph+"> {{?s a ?class} UNION { GRAPH <"+_graph+"> { ?s ?a ?b. FILTER NOT EXISTS{?s a ?class}}}}}GROUP BY ?class" :
+                        "SELECT ?class (COUNT(?s) AS ?count) WHERE {{?s a ?class} UNION { ?s ?a ?b. FILTER NOT EXISTS{?s a ?class}}}GROUP BY ?class";
                 function error() {
                     target.empty().text("Could not load classes");
                 }