<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.utils.Sessions" %> <%@ page import="org.crosswire.data.DataObject" %> <%@ page import="org.crosswire.xml.XMLBlock" %> <%@ page import="org.crosswire.xml.XMLDataElement" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Feature" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Document" %> <%@ page import="org.crosswire.community.projects.ntmss.data.ShelfInstance" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Document.SearchFilter" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Document.SearchFilter.FeatureCriteria" %> <%@ page import="org.crosswire.community.projects.ntmss.data.Page" %> <%@ page import="org.crosswire.sword.keys.SWKey" %> <%@ page import="org.crosswire.sword.keys.VerseKey" %> <%@ page import="org.crosswire.sword.keys.ListKey" %> <%@ page import="java.util.List" %> <%@ page import="java.util.LinkedHashSet" %> <%@ page import="java.util.Set" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.HashSet" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Arrays" %> <%@ page import="java.util.Map" %> <%@ page import="java.util.HashMap" %> <%@ page import="org.apache.log4j.Logger" %> <%@ page import="org.crosswire.webtools.annotation.*" %> <%@ page import="org.crosswire.webtools.*" %> <%@ page import="javax.validation.constraints.NotNull" %> <%@ page import="javax.validation.constraints.Pattern" %> <%! @Description(value = "Retrieve BC view for a manuscript", name = "projects/coptot/mssview") public static class MyParameters extends Parameters { protected String []extraIndex = new String[0]; @NotNull @Description(value = "manuscript id for which to retrieve a transcript. Can include multiple docIDs separated by a pipe, e.g., ", example = "10006 or 20001|20003 for both") @Pattern(regexp = "^\\d+([|,]\\d+)?$", message = "Please enter a docID or docID list separated by | or ,") public String docID = null; @Description(value = "document name to use throughout [gaNum or bcid]", defaultValue="gaNum", example = "bcid") @Pattern(regexp = "^(gaNum|bcid)$", message = "Please enter a pageID, pageID range separated by a -, or pageID list separated by | or ,") public String docName = "gaNum"; @Description(value = "include extra index information", defaultValue="false", example = "true") public String showExtraIndex = null; public HttpServletRequest getRequest() { return this.request; } @Override protected void customValidation() { extraIndex = request.getParameterValues("showExtraIndex"); if (extraIndex == null || extraIndex.length == 0) { extraIndex = new String[]{ "*/LectionIndexCopt-", "LectionaryIndex" }; } } @Override protected String[] getExamples() { return new String[] { "For MSS View from sa 2044: ?docID=622044" }; } } public static Logger logger = null; %> <% MyParameters params = new MyParameters().loadFromRequest(request, response, false); logger = params.getLogger(); Map quireFeatures = new HashMap(); Map quireMarkingFeatures = new HashMap(); Map quireMarkingFeaturesByQuire = new HashMap(); Map pageFibreDirection = new HashMap(); List quires = new ArrayList(); int docID = -1; try {docID = Integer.parseInt(request.getParameter("docID"));} catch (Exception e){} if (docID > -1) { String bcid = Integer.toString(docID); Document doc = Document.getDocument(docID); String gaNum = doc.getGANumber(); String docName = gaNum; String canvasMaterial = "Not Set"; Feature docFeatures[] = Feature.getFeatures(doc.getDocumentID()); for (Feature f : docFeatures) { if ("BCID".equals(f.getFeatureCode())) bcid = f.getStringVal1(); if ("CanvasMaterial".equals(f.getFeatureCode())) canvasMaterial = f.getStringVal1(); if ("QuirePagePosition".equals(f.getFeatureCode())) quireFeatures.put(f.getPageID(), f); } for (Feature f : docFeatures) { if ("FibreDirection".equals(f.getFeatureCode())) { pageFibreDirection.put(f.getPageID(), f); } else if ("ScribalQuireNumberMarking".equals(f.getFeatureCode())) { params.getLogger().info("Found ScribalQuireNumberMarking: " + f); quireMarkingFeatures.put(f.getPageID(), f); Feature pageQuirePosition = quireFeatures.get(f.getPageID()); if (pageQuirePosition != null) { params.getLogger().info("Found pageQuirePosition: " + pageQuirePosition); int quireNumber = pageQuirePosition.getIntVal2(); quireMarkingFeaturesByQuire.put(quireNumber, f); } else { params.getLogger().info("Found ScribalQuireNumberMarking: " + f); } } } %> <% /* */ Map sis = new HashMap(); for (ShelfInstance i : doc.getShelfInstances()) { sis.put(i.getShelfInstanceID(), i); } List shelfInstances = new ArrayList(); Page pages[] = doc.getPages(true); for (Page p : pages) { ShelfInstance si = sis.get(p.getFirstShelfID()); if (si != null) { shelfInstances.add(si); sis.remove(si.getShelfInstanceID()); } si = sis.get(p.getSecondShelfID()); if (si != null) { shelfInstances.add(si); sis.remove(si.getShelfInstanceID()); } si = sis.get(p.getThirdShelfID()); if (si != null) { shelfInstances.add(si); sis.remove(si.getShelfInstanceID()); } } int n = 1; List shelfIDs = new ArrayList(); Map fullShelfMark = new HashMap(); for (ShelfInstance i : shelfInstances) { shelfIDs.add(i.getShelfInstanceID()); String shelfLabel = "";//i.getInstitutionCountry(); if (i.getInstitutionPlace() != null && i.getInstitutionPlace().length() > 0) shelfLabel += (shelfLabel.length() > 0 ? ", " : "") + i.getInstitutionPlace(); if (i.getInstitutionNameCustom() != null && i.getInstitutionNameCustom().length() > 0) shelfLabel += (shelfLabel.length() > 0 ? ", " : "") + i.getInstitutionNameCustom(); else if (i.getInstitutionName() != null && i.getInstitutionName().length() > 0) shelfLabel += (shelfLabel.length() > 0 ? ", " : "") + i.getInstitutionName(); if (i.getShelfNumber() != null && i.getShelfNumber().length() > 0) shelfLabel += (shelfLabel.length() > 0 ? ", " : "") + i.getShelfNumber(); fullShelfMark.put(docName+"."+n, shelfLabel); /* %> <% */ ++n; } /*%><%*/ n = -1; Set verses = new LinkedHashSet(); boolean first = true; int currentQuire = 0; int nextQuirePagePosition = 0; Feature currentQuireFeature = null; Feature currentQuireMarker = null; for (Page p : pages) { // deal with quires Feature quireStart = quireFeatures.get(p.getPageID()); Feature quireMarkerFeatureOnPage = quireMarkingFeatures.get(p.getPageID()); if (quireStart != null) { currentQuire = quireStart.getIntVal2(); nextQuirePagePosition = quireStart.getIntVal1(); currentQuireFeature = quireStart; } currentQuireMarker = currentQuire > 0 ? quireMarkingFeaturesByQuire.get(currentQuire) : null; //params.getLogger().info("currentQuire: " + currentQuire + "; currentQuireMarker: " + currentQuireMarker); p.setIntValue("QUIRENUMBER", currentQuire); p.setIntValue("QUIREPAGEPOSITION", nextQuirePagePosition++); p.setValue("QUIREFEATURE", currentQuireFeature); p.setValue("QUIREMARKERFEATURE", currentQuireMarker); p.setValue("QUIREMARKERFEATUREONPAGE", quireMarkerFeatureOnPage); p.setValue("CANVASMATERIAL", canvasMaterial); p.setValue("FIBREDIRECTION", pageFibreDirection.get(p.getPageID())); if (shelfIDs.indexOf(p.getFirstShelfID()) != n) { if (verses.size() > 0) { Page x = new Page(); x.addVerses(new ArrayList(verses)); List contents = new ArrayList(); String running = ""; for (String c : x.getBiblicalContent().split(";")) { c = c.trim(); String runningBook = running.length() > 0 ? running.substring(0, running.indexOf(" ")) : ""; String book = c.substring(0, c.indexOf(" ")); if (runningBook.equals(book)) { running += (running.length() > 0 ? "; " : "") + c; } else { if (running.length() > 0) { contents.add(running); } running = c; } //params.getLogger().info("c: " + c + "; running: " + running + "; contents: " + contents); } if (running.length() > 0) contents.add(running); for (String c : contents) { /* %> <% */ first = false; } verses = new LinkedHashSet(); if (p.getVerses() != null && p.getVerses().length > 0) verses.addAll(Arrays.asList(p.getVerses())); } n = shelfIDs.indexOf(p.getFirstShelfID()); } else { if (p.getVerses() != null && p.getVerses().length > 0) verses.addAll(Arrays.asList(p.getVerses())); } } if (verses.size() > 0) { Page x = new Page(); x.addVerses(new ArrayList(verses)); List contents = new ArrayList(); String running = ""; for (String c : x.getBiblicalContent().split(";")) { c = c.trim(); String runningBook = running.length() > 0 ? running.substring(0, running.indexOf(" ")) : ""; String book = c.substring(0, c.indexOf(" ")); if (runningBook.equals(book)) { running += (running.length() > 0 ? "; " : "") + c; } else { if (running.length() > 0) { contents.add(running); } running = c; } } if (running.length() > 0) contents.add(running); for (String c : contents) { /* %> <% */ first = false; } } %>
<% if ("bcid".equals(request.getParameter("docName"))) { docName = bcid; %> <%=bcid%> (<%=gaNum%>) <% } else { %> <%=doc.getPrimaryName()%> <% } %>
Canvas Material: <%= canvasMaterial %> Construction:
 
<%=(n==1)?"Place:":""%><%=shelfLabel%><%=docName+"."+n%>
 
<%=(first)?"Content:":""%><%=c%><%=docName+"."+(n+1)%>
<%=(first)?"Content:":""%><%=c%><%=docName+"."+(n+1)%>
 
<% currentQuire = 0; int pagesInQuire = 0; currentQuireFeature = null; int lastQuirePosition = 0; int lastCummulativeQuirePosition = 0; boolean showPathsViewer = false; List pageCounts = Arrays.asList(new String[] { "Union", "Binion", "Ternion", "Quaternion", "Quinion", "Sexternion", "Septernion", "Octernion" }); Page lastPage = null; int q = 0; for (Page p : pages) { int pQuire = p.getIntValue("QUIRENUMBER"); /* increment for missing quires if (lastPage == null) { if (pQuire != 1) { lastCummulativeQuirePosition = (pQuire - 1) * pagesInQuire; } } */ int pQuirePagePosition = p.getIntValue("QUIREPAGEPOSITION"); // out.println("pageID: " + p.getPageID() + "; quire: " + pQuire + "; page position: " + pQuirePagePosition + "
"); String quireFormula = currentQuireFeature != null ? currentQuireFeature.getStringVal2() : null; if (!showPathsViewer) showPathsViewer = (quireFormula != null && quireFormula.trim().length() > 0); //out.print("
"); if (pQuire != currentQuire) { //out.print(""); // finish last quire //params.getLogger().info("pQuire: " + pQuire); int suppliedPageCount = 0; for (++lastQuirePosition, ++lastCummulativeQuirePosition; lastQuirePosition <= pagesInQuire; ++lastQuirePosition, ++lastCummulativeQuirePosition) { //params.getLogger().info("lastQuirePosition: " + lastQuirePosition + "; lastCummulativeQuirePosition: " + lastCummulativeQuirePosition + "; pagesInQuire: " + pagesInQuire); ++suppliedPageCount; if (lastQuirePosition % 2 == 0) { printHalfLeaf(out, lastQuirePosition - 1, lastQuirePosition, lastCummulativeQuirePosition - 1, lastCummulativeQuirePosition, (suppliedPageCount == 1 ? lastPage : null), null, pagesInQuire, docName, shelfIDs, fullShelfMark, quireFormula, params); } } --lastCummulativeQuirePosition; currentQuireFeature = (Feature)p.getValue("QUIREFEATURE"); currentQuireMarker = (Feature)p.getValue("QUIREMARKERFEATURE"); pagesInQuire = (pageCounts.indexOf(currentQuireFeature.getStringVal1()) + 1) * 4; currentQuire = currentQuireFeature.getIntVal2(); lastQuirePosition = 0; %> " : "Papyrus".equals(canvasMaterial) ? "" : "")%> <% //out.print(""); lastContentOverview = null; } for (++lastQuirePosition, ++lastCummulativeQuirePosition; lastQuirePosition < pQuirePagePosition; ++lastQuirePosition, ++lastCummulativeQuirePosition) { if (lastQuirePosition % 2 == 0) { printHalfLeaf(out, lastQuirePosition - 1, lastQuirePosition, lastCummulativeQuirePosition - 1, lastCummulativeQuirePosition, null, null, pagesInQuire, docName, shelfIDs, fullShelfMark, quireFormula, params); } lastPage = null; } if (lastQuirePosition % 2 == 0) { printHalfLeaf(out, lastQuirePosition - 1, lastQuirePosition, lastCummulativeQuirePosition - 1, lastCummulativeQuirePosition, lastPage, p, pagesInQuire, docName, shelfIDs, fullShelfMark, quireFormula, params); } else { lastPage = p; } %> <% } for (++lastQuirePosition, ++lastCummulativeQuirePosition; lastQuirePosition <= pagesInQuire; ++lastQuirePosition, ++lastCummulativeQuirePosition) { String quireFormula = currentQuireFeature != null ? currentQuireFeature.getStringVal2() : null; if (lastQuirePosition % 2 == 0) { printHalfLeaf(out, lastQuirePosition - 1, lastQuirePosition, lastCummulativeQuirePosition - 1, lastCummulativeQuirePosition, lastPage, null, pagesInQuire, docName, shelfIDs, fullShelfMark, quireFormula, params); } lastPage = null; } %>
" + "Showing Page: " + p + "Quire: "+pQuire+"
Finishing last quire
 
<%= Document.getNumberTextPosition(currentQuire) + " Quire "+(currentQuireMarker != null && currentQuireMarker.getStringVal1() != null ? " (" + currentQuireMarker.getStringVal1() + ")" : "") %>
Regular Actual <%=currentQuireFeature.getStringVal1() + ("Parchment".equals(canvasMaterial) ? "Gregory’s
Rule
ActualCommon
Fibre
Direction
ActualContentShelfmark
End Finishing last quire

<% if (showPathsViewer) { %>
Complex Folio Viewer courtesy of PAThs project http://paths.uniroma1.it
<% } return; } else { ((Parameters)params).format = "html"; Serializer.reportErrors(request, response, out, params, true); } %> <%! static String[] gregRule = { "F/H", "H/F" }; static String[] turnerRule = { "→/↓", "↓/→" }; static Map quireGlyphs = new HashMap() {{ put(4, new String[] { "┏━━━━━━━", "┗━━━━━━━"}); put(8, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(12, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(16, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┃┏━━━━", "┃┃┃┗━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(20, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┃┏━━━━", "┃┃┃┃┏━━━", "┃┃┃┃┗━━━", "┃┃┃┗━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(24, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┃┏━━━━", "┃┃┃┃┏━━━", "┃┃┃┃┃┏━━", "┃┃┃┃┃┗━━", "┃┃┃┃┗━━━", "┃┃┃┗━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(28, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┃┏━━━━", "┃┃┃┃┏━━━", "┃┃┃┃┃┏━━", "┃┃┃┃┃┃┏━", "┃┃┃┃┃┃┗━", "┃┃┃┃┃┗━━", "┃┃┃┃┗━━━", "┃┃┃┗━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); put(32, new String[] { "┏━━━━━━━", "┃┏━━━━━━", "┃┃┏━━━━━", "┃┃┃┏━━━━", "┃┃┃┃┏━━━", "┃┃┃┃┃┏━━", "┃┃┃┃┃┃┏━", "┃┃┃┃┃┃┃┏", "┃┃┃┃┃┃┃┗", "┃┃┃┃┃┃┗━", "┃┃┃┃┃┗━━", "┃┃┃┃┗━━━", "┃┃┃┗━━━━", "┃┃┗━━━━━", "┃┗━━━━━━", "┗━━━━━━━"}); }}; // TODO: not threadsafe public static String lastContentOverview = null; public static String lastCanvasMaterial = null; public static void printHalfLeaf(JspWriter out, int firstNumber, int secondNumber, int firstTotal, int secondTotal, Page firstPage, Page secondPage, int quireMax, String docName, List shelfIDs, Map fullShelfMark, String quireFormula, MyParameters params) { try { int n = 0; int n2 = 0; int n3 = 0; if (firstPage!=null) n = shelfIDs.indexOf(firstPage.getFirstShelfID()) + 1; if (secondPage!=null) n = shelfIDs.indexOf(secondPage.getFirstShelfID()) + 1; if (firstPage!=null) n2 = shelfIDs.indexOf(firstPage.getSecondShelfID()) + 1; if (secondPage!=null && n2 == 0) n2 = shelfIDs.indexOf(secondPage.getSecondShelfID()) + 1; if (firstPage!=null) n3 = shelfIDs.indexOf(firstPage.getThirdShelfID()) + 1; if (secondPage!=null) n3 = shelfIDs.indexOf(secondPage.getThirdShelfID()) + 1; String canvasMaterial = (String) (firstPage != null ? firstPage.getValue("CANVASMATERIAL") : secondPage != null ? secondPage.getValue("CANVASMATERIAL") : ""); if (canvasMaterial != null && canvasMaterial.length() > 0) lastCanvasMaterial = canvasMaterial; Feature fibreDirection1 = (firstPage != null) ? (Feature)firstPage.getValue("FIBREDIRECTION") : null; Feature fibreDirection2 = (secondPage != null) ? (Feature)secondPage.getValue("FIBREDIRECTION") : null; Feature quirePageMarkFeature1 = (firstPage != null) ? (Feature)firstPage.getValue("QUIREMARKERFEATUREONPAGE") : null; Feature quirePageMarkFeature2 = (secondPage != null) ? (Feature)secondPage.getValue("QUIREMARKERFEATUREONPAGE") : null; Feature parchmentSideFeature1 = (firstPage != null) ? firstPage.getFeature("ParchmentSide") : null; Feature parchmentSideFeature2 = (secondPage != null) ? secondPage.getFeature("ParchmentSide") : null; Feature blankFeature1 = (firstPage != null) ? firstPage.getFeature("Blank") : null; Feature blankFeature2 = (secondPage != null) ? secondPage.getFeature("Blank") : null; Feature contentOverviewFeature1 = (firstPage != null) ? firstPage.getFeature("ContentOverview") : null; Feature contentOverviewFeature2 = (secondPage != null) ? secondPage.getFeature("ContentOverview") : null; String parchmentSide = (parchmentSideFeature1 != null) ? parchmentSideFeature1.getStringVal1().charAt(0)+ "/" : ""; parchmentSide += (parchmentSideFeature2 != null) ? parchmentSideFeature2.getStringVal1().charAt(0) : ""; String fibreDirection = ""; if (fibreDirection1 != null) fibreDirection += ("vertical".equals(fibreDirection1.getStringVal1()) ? "↓" : "horizontal".equals(fibreDirection1.getStringVal1()) ? "→" : fibreDirection1.getStringVal1()) + "/"; if (fibreDirection2 != null) fibreDirection += ("vertical".equals(fibreDirection2.getStringVal1()) ? "↓" : "horizontal".equals(fibreDirection2.getStringVal1()) ? "→" : fibreDirection2.getStringVal1()); out.print(""+firstTotal+"/"+secondTotal+""); // out.print(""+firstNumber+"/"+secondNumber+""); String firstPageFolio = (firstPage!=null?firstPage.getFolioNumber():""); String secondPageFolio = (secondPage!=null?secondPage.getFolioNumber():""); out.print(""+firstPageFolio+(firstPageFolio.length() > 0 || secondPageFolio.length() > 0 ? "/":"")+secondPageFolio+""); // show page quire position glyphs String rowSpan = ""; if (quireFormula != null && quireFormula.length() > 0) { rowSpan = " rowspan=\"" + quireMax/2 + "\""; } if (rowSpan.length() > 0 && (secondNumber/2-1) == 0) { out.print(""); out.println(""); out.print(""); out.print(""); out.print(""); } else if (rowSpan.length() > 0 ) { } else { out.print(""); String pageGlyph = "" + quireGlyphs.get(quireMax)[secondNumber/2-1]; if (quirePageMarkFeature1 != null || quirePageMarkFeature2 != null) { //pageGlyph = pageGlyph.substring(0, pageGlyph.length()-2); pageGlyph += " "; pageGlyph += ((quirePageMarkFeature1 != null) ? (quirePageMarkFeature1.getStringVal1() + "/") : ("/" + quirePageMarkFeature2.getStringVal1())); } pageGlyph += ""; out.println(pageGlyph); out.print(""); } Page x = new Page(); Set verses = new LinkedHashSet(); if (firstPage!=null) verses.addAll(Arrays.asList(firstPage.getVerses())); if (secondPage!=null) verses.addAll(Arrays.asList(secondPage.getVerses())); x.addVerses(new ArrayList(verses)); out.print(""); logger.info("canvasMaterial: " + canvasMaterial + "; lastCanvasMaterial: " + lastCanvasMaterial); if ("Parchment".equals(canvasMaterial) || (canvasMaterial.length() < 1 && "Parchment".equals(lastCanvasMaterial))) { out.print(gregRule[(secondNumber/2-1)%2]); } else if ("Papyrus".equals(canvasMaterial) || (canvasMaterial.length() < 1 && "Papyrus".equals(lastCanvasMaterial))) { out.print(turnerRule[(secondNumber/2-1)%2]); } out.print(""); out.print(" 0 && !gregRule[(secondNumber/2-1)%2].startsWith(parchmentSide)) out.print(" style=\"background-color:pink;\""); } else if ("Papyrus".equals(canvasMaterial)) { if (fibreDirection.length() > 0 && !turnerRule[(secondNumber/2-1)%2].startsWith(fibreDirection)) out.print(" style=\"background-color:pink;\""); } out.print(">"); if ("Parchment".equals(canvasMaterial)) { out.print(parchmentSide); } else if ("Papyrus".equals(canvasMaterial)) { out.print(fibreDirection); } out.print(""); String bc = null; if (contentOverviewFeature1 != null) { bc = contentOverviewFeature1.getStringVal1(); if (bc != null && bc.trim().length() < 1) bc = null; } if (bc == null && contentOverviewFeature1 != null) { bc = contentOverviewFeature1.getStringVal2(); if (bc != null && bc.trim().length() < 1) bc = null; } if (bc == null && contentOverviewFeature2 != null) { bc = contentOverviewFeature1.getStringVal1(); if (bc != null && bc.trim().length() < 1) bc = null; } if (bc == null && contentOverviewFeature2 != null) { bc = contentOverviewFeature1.getStringVal2(); if (bc != null && bc.trim().length() < 1) bc = null; } if (bc == null) { if (firstPage!=null) { bc = firstPage.getBiblicalContent(); for (String ei : params.extraIndex) { boolean skipS2 = false; boolean italic = false; boolean bold = false; if (ei.startsWith("/")) { italic = true; ei = ei.substring(1,ei.length()); } if (ei.startsWith("*")) { bold = true; ei = ei.substring(1,ei.length()); } // repeated to allow order difference if (ei.startsWith("/")) { italic = true; ei = ei.substring(1,ei.length()); } if (ei.endsWith("-")) { skipS2 = true; ei = ei.substring(0,ei.length()-1); } String lexIdx = firstPage.getLectionaryText(ei, skipS2); if (lexIdx != null && lexIdx.length() > 0) { if (bc.length() > 0) bc += "; "; bc += (bold ? "":"") + (italic ? "":"")+lexIdx+ (italic ? "":"") + (bold ? "":""); } } } if (bc == null || bc.trim().length() < 1) bc = ""; if (secondPage!=null) { boolean needSlash = (bc.length() > 0); boolean needSemi = false; if (secondPage.getBiblicalContent() != null && secondPage.getBiblicalContent().trim().length() > 0) { if (needSlash) bc += " / "; needSlash = false; bc += secondPage.getBiblicalContent(); needSemi = true; } for (String ei : params.extraIndex) { boolean skipS2 = false; boolean italic = false; boolean bold = false; if (ei.startsWith("/")) { italic = true; ei = ei.substring(1,ei.length()); } if (ei.startsWith("*")) { bold = true; ei = ei.substring(1,ei.length()); } // repeated to allow order difference if (ei.startsWith("/")) { italic = true; ei = ei.substring(1,ei.length()); } if (ei.endsWith("-")) { skipS2 = true; ei = ei.substring(0,ei.length()-1); } String lexIdx = secondPage.getLectionaryText(ei, skipS2); if (lexIdx != null && lexIdx.length() > 0) { if (needSlash) bc += " / "; else if (needSemi) bc += "; "; bc += (bold ? "":"") + (italic ? "":"")+lexIdx+ (italic ? "":"") + (bold ? "":""); } } } //bc = x.getBiblicalContent(); if (bc != null && bc.trim().length() < 1) bc = null; if (bc != null) logger.info("bc: " + bc); if (bc != null) lastContentOverview = null; } else lastContentOverview = bc; if (bc == null) bc = lastContentOverview; String blank = null; if (blankFeature1 != null) { blank = blankFeature1.getStringVal1(); if (blank != null && blank.trim().length() < 1) blank = null; } if (blank == null && blankFeature2 != null) { blank = blankFeature2.getStringVal1(); if (blank != null && blank.trim().length() < 1) blank = null; } if (blank != null) bc = blank; out.print(""+(bc == null ? "" : bc)+""); out.print(""); out.print((n != 0 ? fullShelfMark.get(docName + "." + n) : "")); if (firstPage.getShelfFolioNums() != null && firstPage.getShelfFolioNums().length() > 0) { String fn = firstPage.getShelfFolioNums(); if (fn != null) { out.print(", " + fn.split("\\|")[0]); } } out.print((n2 != 0 ? (" + " + fullShelfMark.get(docName + "." + n2)) : "")); if (firstPage.getShelfFolioNums() != null && firstPage.getShelfFolioNums().length() > 0) { String fn = firstPage.getShelfFolioNums(); if (fn != null && fn.split("\\|").length > 1) { out.print(", " + fn.split("\\|")[1]); } } out.print((n3 != 0 ? (" + " + fullShelfMark.get(docName + "." + n3)) : "")); if (firstPage.getShelfFolioNums() != null && firstPage.getShelfFolioNums().length() > 0) { String fn = firstPage.getShelfFolioNums(); if (fn != null && fn.split("\\|").length > 2) { out.print(", " + fn.split("\\|")[2]); } } logger.info("SF#: " +firstPage.getShelfFolioNums()); logger.info("n2: " +n2); out.print(""); out.print(""); } catch (Exception e) {} } public static class Quire { public List pages = new ArrayList(); public Quire(Page firstPage) { pages.add(firstPage); } } %>