Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Add default value for format parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
oucs0130 committed Feb 9, 2011
1 parent bdd8134 commit bdec08d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/main/java/uk/ac/ox/oucs/sirlouie/EiasAvailability.java
Expand Up @@ -46,17 +46,13 @@ public class EiasAvailability {
@Produces({"application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response/*String*/ get(
@QueryParam("id") String openurl,
@QueryParam("format") String format,
@QueryParam("format") @DefaultValue("json") String format,
@QueryParam("callback") @DefaultValue("callback") String callback) {

log.debug(openurl+":"+format+":"+callback);

try {

if (null == format) {
throw new Exception("Response format not specified");
}

SFXService service = new SFXService(openurl);
OpenURI uri = new OpenURI(URLEncoder.encode(openurl, "UTF-8"));
ResponseBean bean = service.getResource(uri.getURI().toString());
Expand Down
Expand Up @@ -51,16 +51,12 @@ public class LibraryAvailability {
@Produces({"application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response get(
@QueryParam("id") String id,
@QueryParam("format") String format,
@QueryParam("format") @DefaultValue("json") String format,
@QueryParam("callback") @DefaultValue("callback") String callback) {

log.debug(id+":"+format+":"+callback);

try {

if (null == format) {
throw new Exception("Response format not specified");
}

PrimoService service = new PrimoService(getProperties().getWebResourseURL());
DaiaURI uri = new DaiaURI(id);
Expand Down
Expand Up @@ -3,8 +3,6 @@
import java.util.ArrayList;
import java.util.Collection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.XMLFilterImpl;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/uk/ac/ox/oucs/sirlouie/sfx/SFXXMLFilter.java
Expand Up @@ -9,9 +9,6 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.XMLFilterImpl;

import uk.ac.ox.oucs.sirlouie.daia.Department;
import uk.ac.ox.oucs.sirlouie.daia.Item;
import uk.ac.ox.oucs.sirlouie.daia.Message;
import uk.ac.ox.oucs.sirlouie.reply.SearError;
import uk.ac.ox.oucs.sirlouie.reply.SearLibrary;
import uk.ac.ox.oucs.sirlouie.reply.SearLink;
Expand Down

0 comments on commit bdec08d

Please sign in to comment.