Skip to content

Commit

Permalink
removed timebundle and changed timemap as per memento specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyudmila Balakireva committed Sep 6, 2012
1 parent c5bdf88 commit 7e26ba5
Show file tree
Hide file tree
Showing 195 changed files with 4,911 additions and 15,521 deletions.
Expand Up @@ -171,7 +171,7 @@ public Response getMemento(String id,String date, HttpHeaders hh) throws ParseE
//}
String origlink ="<"+id+">;rel=\"original\"";
String timemap = " , <"+baseUri.toString() +"timemap/link/" + id+">;rel=\"timemap\"; type=\"application/link-format\"";
String timebundle = " , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
// String timebundle = " , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
String timegate =" , <"+baseUri.toString() +"timegate/" + id+">;rel=\"timegate\" ";
//if (indextimemap!=null) {
//timemap=" , <"+indextimemap+ id+">;rel=\"timemap\"; type=\"application/link-format\"";
Expand Down Expand Up @@ -251,7 +251,7 @@ public Response getMemento(String id,String date, HttpHeaders hh) throws ParseE

r.header("Location", location);
r.header("Memento-Datetime",httpformatter.format(m.getAccessdate()));
r.header("Link",origlink+links +timemap+timebundle + timegate);
r.header("Link",origlink+links +timemap + timegate);
return r.build();

}
Expand Down Expand Up @@ -350,7 +350,7 @@ public Response getMemento(String id,String date, HttpHeaders hh) throws ParseE
r.header("Content-Language",m.getLang());
}
r.header("Memento-Datetime",httpformatter.format(m.getAccessdate()));
r.header("Link",origlink+links +timemap+timebundle + timegate);
r.header("Link",origlink+links +timemap + timegate);
return r.build();

}
Expand Down Expand Up @@ -381,7 +381,7 @@ public Response getHead(String id,String date) throws ParseException {

String origlink ="<"+id+">;rel=\"original\"";
String timemap = " , <"+baseUri.toString() +"timemap/link/" + id+">;rel=\"timemap\"; type=\"application/link-format\"";
String timebundle = " , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
// String timebundle = " , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
String timegate =" , <"+baseUri.toString() +"timegate/" + id+">;rel=\"timegate\" ";
// if (indextimemap!=null) {
// timemap=" , <"+indextimemap+ id+">;rel=\"timemap\"; type=\"application/link-format\"";
Expand Down Expand Up @@ -434,7 +434,7 @@ public Response getHead(String id,String date) throws ParseException {
}

r.header("Memento-Datetime",httpformatter.format(m.getAccessdate()));
r.header("Link",origlink+links +timemap+timebundle + timegate);
r.header("Link",origlink+links +timemap + timegate);
return r.build();

}
Expand Down

This file was deleted.

Expand Up @@ -157,7 +157,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat

String origlink ="<"+id+">;rel=\"original\"";
String timemap = " , <"+baseurl.toString() +"timemap/link/" + id+">;rel=\"timemap\"; type=\"application/link-format\"";
String timebundle = " , <"+baseurl.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
// String timebundle = " , <"+baseurl.toString() +"timebundle/" + id+">;rel=\"timebundle\"";
//if (indextimemap!=null) {
// timemap=" , <"+indextimemap+ id+">;rel=\"timemap\"; type=\"application/link-format\"";
// }
Expand All @@ -174,7 +174,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat

r.header("Vary","negotiate,accept-datetime");
// r.header("TCN", "list");
r.header("Link",origlink +timemap +timebundle+links);
r.header("Link",origlink +timemap +links);
//bad not parsable date
return r.build();
}
Expand All @@ -193,7 +193,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat
String links = mc.composeLinkHeader(m.getAccessdate(),m.getLastMemento().getAccessdate(),m.getFirstMemento().getAccessdate(),id);
ResponseBuilder r = Response.status(400);
r.header("Vary","negotiate,accept-datetime");
r.header("Link",origlink +timemap +timebundle+links);
r.header("Link",origlink +timemap +links);
//bad not parsable interval date
return r.build();

Expand Down Expand Up @@ -252,7 +252,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat
if( m.getNextMemento().getAccessdate().after(intdate2)){
ResponseBuilder r = Response.status(406);
r.header("Vary","negotiate,accept-datetime");
r.header("Link",origlink+ links +timemap +timebundle);
r.header("Link",origlink+ links +timemap );
return r.build();
}
else {
Expand All @@ -274,7 +274,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat
chlinks=chsb.toString();
r.header("Location",chlocation);
r.header("Vary","negotiate,accept-datetime");
r.header("Link",origlink+ chlinks +timemap +timebundle);
r.header("Link",origlink+ chlinks +timemap );
return r.build();

}
Expand All @@ -283,7 +283,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat

ResponseBuilder r = Response.status(406);
r.header("Vary","negotiate,accept-datetime");
r.header("Link",origlink+ links +timemap +timebundle);
r.header("Link",origlink+ links +timemap );

return r.build();

Expand All @@ -302,7 +302,7 @@ public Response getTimegate( @Context HttpHeaders hh, @Context UriInfo ui, @Pat
r.header("Location",location);
r.header("Vary","negotiate,accept-datetime");
// r.header("TCN", "choice");
r.header("Link",origlink+ links +timemap +timebundle);
r.header("Link",origlink+ links +timemap );
return r.build();


Expand Down
Expand Up @@ -24,17 +24,17 @@
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.ResponseBuilder;

import org.dspace.foresite.Aggregation;
import org.dspace.foresite.ResourceMap;
import org.dspace.foresite.OREFactory;
import org.dspace.foresite.Agent;
import org.dspace.foresite.AggregatedResource;
import org.dspace.foresite.ORESerialiser;
import org.dspace.foresite.ORESerialiserFactory;
import org.dspace.foresite.ResourceMapDocument;
import org.dspace.foresite.Triple;
import org.dspace.foresite.jena.TripleJena;
import org.dspace.foresite.Predicate;
//import org.dspace.foresite.Aggregation;
//import org.dspace.foresite.ResourceMap;
//import org.dspace.foresite.OREFactory;
//import org.dspace.foresite.Agent;
//import org.dspace.foresite.AggregatedResource;
//import org.dspace.foresite.ORESerialiser;
//import org.dspace.foresite.ORESerialiserFactory;
//import org.dspace.foresite.ResourceMapDocument;
//import org.dspace.foresite.Triple;
//import org.dspace.foresite.jena.TripleJena;
//import org.dspace.foresite.Predicate;

/*
@author Lyudmila Balakireva
Expand Down Expand Up @@ -75,8 +75,8 @@ public Response getMyLinks(@PathParam("id") String idp, @Context UriInfo ui) th
Iterator it = mset.iterator();
StringBuffer sb = new StringBuffer("<"+id+">;rel=\"original\"\n");
sb.append(" , <"+baseUri.toString() +"timegate/" + id+">;rel=\"timegate\" ");
sb.append (" , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"");
sb.append (" , <"+baseUri.toString() +"timemap/link/" + id+">;rel=\"timemap self\"; type=\"application/link-format\"");
// sb.append (" , <"+baseUri.toString() +"timebundle/" + id+">;rel=\"timebundle\"");
sb.append (" , <"+baseUri.toString() +"timemap/link/" + id+">;rel=\"self\"; type=\"application/link-format\"");
int count = 0;
while (it.hasNext()) {
Memento m = (Memento) it.next();
Expand Down Expand Up @@ -109,7 +109,7 @@ public Response getMyLinks(@PathParam("id") String idp, @Context UriInfo ui) th
//return sb.toString();
}


/*
@GET
@Path("rdf/{id:.*}")
@Produces("application/rdf+xml" )
Expand Down Expand Up @@ -209,5 +209,5 @@ public Response getRDF(@PathParam("id") String idp, @Context UriInfo ui) throws
return r.build();
//return serialisation;
}

*/
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

0 comments on commit 7e26ba5

Please sign in to comment.