Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed query param handling for single fixity checks
  • Loading branch information
fasseg committed Jun 13, 2013
1 parent c2bce0e commit e3d357e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Expand Up @@ -5,13 +5,15 @@
package org.fcrepo.fixity.web.resources;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

Expand Down Expand Up @@ -81,16 +83,12 @@ public ObjectFixityResult getResult(@PathParam("recordId")

@Path("/queue")
@POST
public Response queueFixityChecks() throws IOException {
fixityService.queueFixityChecks(null);
return Response.ok().build();
}

@Path("/queue/{uri}")
@POST
public Response queueFixityChecks(@PathParam("uri")
final String uri) throws IOException {
fixityService.queueFixityCheck(uri);
public Response queueFixityChecks(@QueryParam("url") final String url) throws IOException {
if (url == null || url.length() == 0){
fixityService.queueFixityChecks(null);
}else{
fixityService.queueFixityChecks(Arrays.asList(url));
}
return Response.ok().build();
}

Expand Down
Expand Up @@ -67,7 +67,7 @@
function queuePid(pid){
var path = '../fixity-results/queue';
if (pid != "All Objects"){
path = '../rest/results/queue?pid=' + pid;
path = '../fixity-results/queue?url=' + encodeURIComponent(pid);
}
$.post(path, function (data) {
location.reload(true);
Expand Down
3 changes: 2 additions & 1 deletion fcrepo-fixity-webapp/src/main/webapp/static/results.html
Expand Up @@ -39,7 +39,8 @@
.focusin(function(){
if (this.value == "All Objects"){
this.value = "";
$('#queueButton').val("Queue PID");
$('#queueButton').val("Queue Object");
$('#queueButton').tooltip("Queue an object for fixity checks e.g. 'http://localhost:8080/fcrepo/rest/objects/object-1'");
}
});

Expand Down

0 comments on commit e3d357e

Please sign in to comment.