Skip to content
Browse files

Add default value for format parameter

  • Loading branch information...
1 parent bdd8134 commit bdec08d5df3e445a02c5de79c2340b96b4580b13 @oucs0130 oucs0130 committed Feb 9, 2011
View
6 src/main/java/uk/ac/ox/oucs/sirlouie/EiasAvailability.java
@@ -46,17 +46,13 @@
@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());
View
6 src/main/java/uk/ac/ox/oucs/sirlouie/LibraryAvailability.java
@@ -51,16 +51,12 @@
@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);
View
2 src/main/java/uk/ac/ox/oucs/sirlouie/primo/PrimoXMLFilter.java
@@ -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;
View
3 src/main/java/uk/ac/ox/oucs/sirlouie/sfx/SFXXMLFilter.java
@@ -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;

0 comments on commit bdec08d

Please sign in to comment.
Something went wrong with that request. Please try again.