<%@ page import="java.net.URL"%> <%@ page import="java.io.InputStream"%> <%@ page import="java.util.Vector"%> <%@ page import="java.util.Hashtable"%> <%@ page import="org.crosswire.xml.XMLRepo"%> <%@ page import="org.crosswire.xml.XMLObject"%> <%@ page import="org.crosswire.xml.XMLBlock"%> <%@ page import="org.crosswire.community.data.User"%> <%@ page import="org.crosswire.community.data.Document"%> <%@ page import="org.crosswire.community.data.Project"%> <% final String mssListURL = "http://www.csntm.org/Api/PublicManuscripts"; final String mssBaseURL = "http://csntm.org"; final String legal = "The requirements that need to be satisfied for using these images in publication vary from manuscript to manuscript. Each possessing institute or individual has its own requirements. If you wish to publish any of these images, you will need to get permission from CSNTM first. We can then direct you to the contact person of the institute that owns the manuscript(s) for further instructions. CSNTM does not charge for the use of these images, though the institute that owns the manuscripts may. At minimum, CSNTM needs to be credited with the photographs and the possessing institute needs to be credited with ownership of the manuscript in all research for which these images are used."; class CSDoc { public String gaName = ""; public String baseURL = ""; public String type = ""; public int imageCount = 0; public Document indexDoc = null; public int percComplete = 0; } String root = session.getServletContext().getContextPath(); User user = (User)session.getAttribute("user"); Vector docs = new Vector(); Hashtable resp = new Hashtable(); XMLRepo repo = XMLRepo.instance(pageContext); Project indexing = (Project)repo.get(new Project("indexing")); User[] members = indexing.getMembers(); for (User u: members) { XMLObject[] documents = repo.getObjects(new Document(u.getID())); for (XMLObject o : documents) { Document d = (Document) o; resp.put(d.getGAName(), d); } } String data = ""; URL url = new URL(mssListURL); try { InputStream responseStream = url.openStream(); byte line[] = new byte[254]; int len; while ((len = responseStream.read(line)) != -1) { data += new String(line, 0, len, "UTF-8"); } responseStream.close(); if (data.length() > 0) { XMLBlock csntmData = new XMLBlock(data); for (XMLBlock ms : csntmData.getBlocks("Manuscript")) { CSDoc doc = new CSDoc(); doc.baseURL = ms.getValue("Url"); doc.type = ms.getValue("Type"); try { doc.imageCount = Integer.parseInt(ms.getValue("ImageCount")); } catch (Exception e) {} doc.gaName = ms.getValue("GregoryAlandNumber"); if (doc.gaName != null && doc.gaName.length() > 0) { if (!doc.gaName.startsWith("GA ")) { if ("Lectionary".equals(doc.type)) doc.gaName = "Lect " + doc.gaName; doc.gaName = "GA " + doc.gaName; } } else doc.gaName = ms.getValue("ShelfNumber"); doc.indexDoc = resp.get(doc.gaName); if (doc.indexDoc != null) { Document.Page pages[] = doc.indexDoc.getPages(); if (pages != null) { int highest = pages.length; for (int i = highest - 1; i > 0; i--) { String bc = pages[i].getBibleCoverage(); String desc = pages[i].getDescription(); if (((bc != null) && (bc.length() > 0)) || ((desc != null) && (desc.length() > 0))) { doc.percComplete = (int)(((double)(i+1) / highest) * 100); //out.print("d="+doc.gaName+"; h="+highest+"; i="+i+"; pc="+doc.percComplete); break; } } } } docs.add(doc); } } } catch (Exception e) { e.printStackTrace(); } %>
<% if (user != null) { %> <% } %>
HomeMy Documents

Collaborative Manuscript Indexing

All images are located at The Center for the Study of New Testament Manuscripts <% for (CSDoc doc: docs) { String respUser = (doc.indexDoc == null) ? null : doc.indexDoc.getOwnerID(); %> <% } %>
StatusIndexerGregory-Aland NumberTypeImage CountCSNTM Info
<% if (respUser == null) { %>   <% if (user != null && indexing.isMember(user)) { %> Claim Responsibility <% } } else { %>
 <%= doc.percComplete %>% Complete (">View) <% if (doc.percComplete > 0) { // for stupid ie %>
 
<% } // for stupid ie %>
<%= respUser %>
<% } %>
<%= doc.gaName %> <%= doc.type %> <%= doc.imageCount %> View Info