<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Document" %> <%@ page import="org.crosswire.data.DataObject" %> <%@ page import="org.crosswire.utils.Utils" %> <%@ page import="org.crosswire.utils.HTTPUtils" %> <%@ page import="org.apache.log4j.Logger" %> <% Logger logger = Logger.getLogger("bibliography/get"); String zoteroAPIKey = Utils.getSysConfig(session).getProperty("ZoteroAPIKey"); String zoteroUser = Utils.getSysConfig(session).getProperty("ZoteroUser"); logger.info("zoteroAPIKey="+zoteroAPIKey); logger.info("zoteroUser="+zoteroUser); int docID = -1; try {docID = Integer.parseInt(request.getParameter("docID"));} catch (Exception e){} String format = request.getParameter("format"); if (format == null) format = "xhtml"; String zFormat = "bib"; if ("rss".equals(format)) zFormat="atom"; if ("json".equals(format)) zFormat="json"; if (docID > -1) { response.setContentType("text/xml"); Document doc = Document.getDocument(docID); if (doc == null) { %> <% return; } if (zFormat == "json") { response.setContentType("text/json"); } else { response.setContentType("text/html"); } String url = "https://api.zotero.org/users/"+zoteroUser+"/items/"; String params = "tag="+doc.getDocumentID(); params += "&key="+zoteroAPIKey; params += "&format="+zFormat; try { HTTPUtils.Response r = new HTTPUtils.Response(); StringBuffer z = HTTPUtils.postURL(url, params, HTTPUtils.GET, r); if ("Invalid key".equals(z.toString().trim())) { logger.warn("Bibliographic service not configured properly with a Zortero API key. See sysconfig.properties"); return; } if (r.resultCode < 0) return; if (zFormat.equals("bib")) { z.append("
"); z.append("Lookup " + doc.getGANumber() + " in J.K. Elliott's Bibliography of Greek New Testament Manuscripts at Université de Lausanne's BiBIL"); z.append("
"); } %> <%=z%> <% } catch (Exception e) {} return; } %>

bibliography/get

Retrieve bibliographical material associated with a manuscript

Parameters

docIDmanuscript id to query, e.g., 10046
formatxhtml | rss | json