<%@ page language="java" contentType="text/html;charset=utf-8" %> <%@ include file="init.jsp" %> <%@ page import="org.crosswire.sword.orb.*" %> <%@ page import="org.crosswire.xml.*" %> <%@ page import="java.util.Arrays" %> <% String resetModule = request.getParameter("mod"); int contextVerses = 0; try { contextVerses = Integer.parseInt(request.getParameter("context")); } catch (Exception e) {} if (resetModule != null) { session.setAttribute("ActiveModule", resetModule); } String activeModuleName = (String) session.getAttribute("ActiveModule"); if (activeModuleName == null) activeModuleName = defaultBible; SWModule activeModule = mgr.getModuleByName(activeModuleName); String resetKey = request.getParameter("key"); if (resetKey != null) { resetKey = new String(resetKey.getBytes("iso8859-1"), "UTF-8"); activeModule.setKeyText(resetKey); session.setAttribute("ActiveKey", activeModule.getKeyText()); } String activeKey = (String) session.getAttribute("ActiveKey"); if (activeKey == null) { activeKey = "john 1:1"; session.setAttribute("ActiveKey", activeKey); } mgr.setGlobalOption("Footnotes", "Off"); mgr.setGlobalOption("Cross-references", "Off"); SWModule eusVs = mgr.getModuleByName("Eusebian_vs"); SWModule eusNum = mgr.getModuleByName("Eusebian_num"); String promoLine = activeModule.getConfigEntry("ShortPromo"); eusVs.setKeyText(activeKey); String num = eusVs.getStripText().trim(); eusNum.setKeyText(num); String detailsText = eusNum.getRawEntry(); XMLTag details = new XMLBlock(detailsText); String []nums = (num + " " + details.getAttribute("assocates")).split(" "); Arrays.sort(nums); String lang = activeModule.getConfigEntry("Lang"); boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction"))); %> <% for (String n : nums) { if (n.trim().length() < 1) continue; %> <% } %> <% for (String n : nums) { if (n.trim().length() < 1) continue; eusNum.setKeyText(n.trim()); eusNum.getRenderText(); detailsText = eusNum.getRawEntry(); XMLTag d = new XMLBlock(detailsText); %> <% } %> <% // Pre context ----------------------------------------------------------------------------- if (contextVerses > 0) { for (String n : nums) { if (n.trim().length() < 1) continue; eusNum.setKeyText(n.trim()); eusNum.getRenderText(); detailsText = eusNum.getRawEntry(); XMLTag d = new XMLBlock(detailsText); String keyList[] = activeModule.parseKeyList(d.getAttribute("osisRef")); activeModule.setKeyText(keyList[0]); activeModule.getRenderText(); String book = activeModule.getKeyChildren()[1]; String keyText = activeModule.getKeyText(); for (int c = 0; c < contextVerses; ++c) activeModule.previous(); // be sure we have an upper limit on the book while (!book.equals(activeModule.getKeyChildren()[1])) activeModule.next(); %> <% } %> <% } // Eusebian Row(s) Verse Ranges ---------------------------------------------------------- %> <% for (String n : nums) { if (n.trim().length() < 1) continue; eusNum.setKeyText(n.trim()); eusNum.getRenderText(); detailsText = eusNum.getRawEntry(); XMLTag d = new XMLBlock(detailsText); String keyList[] = activeModule.parseKeyList(d.getAttribute("osisRef")); %> <% } %> <% // Post context ---------------------------------------------------------------------------------------------- if (contextVerses > 0) { %> <% for (String n : nums) { if (n.trim().length() < 1) continue; eusNum.setKeyText(n.trim()); eusNum.getRenderText(); detailsText = eusNum.getRawEntry(); XMLTag d = new XMLBlock(detailsText); String keyList[] = activeModule.parseKeyList(d.getAttribute("osisRef")); activeModule.setKeyText(keyList[keyList.length-1]); activeModule.getRenderText(); String book = activeModule.getKeyChildren()[1]; %> <% } %> <% } // end Post context ------------------------------------------------------------------------------------------------------- %>
<%= n %>
<%= d.getAttribute("osisRef") %>
> <% while (!keyText.equals(activeModule.getKeyText()) && activeModule.error() == 0) { String v = activeModule.getRenderText(); String currentKeyText = activeModule.getKeyText(); if (rtol) { %> <% } %> "> <%= activeModule.getKeyChildren()[3]%><%= v %> <% if (rtol) { %> <% } %> <% activeModule.next(); } %>
> <% for (String k : keyList) { activeModule.setKeyText(k); String v = activeModule.getRenderText(); String currentKeyText = activeModule.getKeyText(); if (rtol) { %> <% } %> "> <%= activeModule.getKeyChildren()[3]%><%= v %> <% if (rtol) { %> <% } %> <% } %>
> <% activeModule.next(); for (int i = 0; i < contextVerses && activeModule.error() == 0 && book.equals(activeModule.getKeyChildren()[1]); ++i) { String v = activeModule.getRenderText(); String currentKeyText = activeModule.getKeyText(); if (rtol) { %> <% } %> "> <%= activeModule.getKeyChildren()[3]%><%= v %> <% if (rtol) { %> <% } %> <% activeModule.next(); } %>