<%@ include file="init.jsp" %> <%@ page import="org.crosswire.swordweb.*" %> <% session.setAttribute("lastModType", "Bible"); String []addMods = request.getParameterValues("add"); if (addMods != null) { for (int i = 0; i < addMods.length; i++) { String addModule = addMods[i]; if (addModule != null) { SWModule m = mgr.getModuleByName(addModule); if (m != null) { parDispModules.remove(addModule); parDispModules.add(parDispModules.size(), addModule); } } } } String delModule = (String)request.getParameter("del"); if ( (delModule != null) && parDispModules.contains(delModule)) { parDispModules.remove(delModule); } if (parDispModules.size() == 0) { parDispModules.add(0, defaultBible); //our standard, fallback module } SWModule activeModule = mgr.getModuleByName((String)parDispModules.get(0)); String resetKey = request.getParameter("key"); if (resetKey != null) session.setAttribute("ActiveKey", resetKey); String activeKey = (String) session.getAttribute("ActiveKey"); if (activeKey == null) activeKey = "jas 1:19"; // our fallback key //taken from passagestudy.jsp. It's here useful, too. boolean strongs = "on".equals((String) session.getAttribute("strongs")); String buf = request.getParameter("strongs"); strongs = (buf != null) ? "on".equalsIgnoreCase(buf) : strongs; session.setAttribute("strongs", (strongs)?"on":"off"); boolean morph = "on".equals((String) session.getAttribute("morph")); buf = request.getParameter("morph"); morph = (buf != null) ? "on".equalsIgnoreCase(buf) : morph; session.setAttribute("morph", (morph)?"on":"off"); boolean startList = false; String parallelViewType = (String) session.getAttribute("parallel"); buf = request.getParameter("parallel"); if (buf != null) { parallelViewType = buf; } if (parallelViewType == null) { parallelViewType = "sidebyside"; } session.setAttribute("parallel", parallelViewType); SidebarModuleView sidebarView = new SimpleModuleView(mgr); SidebarItemRenderer delModRenderer = new SidebarItemRenderer() { public String renderModuleItem(SWModule module) { StringBuffer ret = new StringBuffer(); ret.append("
  • ") .append(module.getDescription().replaceAll("&", "&")) .append("
  • "); return ret.toString(); } }; SidebarItemRenderer addModRenderer = new SidebarItemRenderer() { public String renderModuleItem(SWModule module) { StringBuffer ret = new StringBuffer(); ret.append("
  • ") .append(module.getDescription().replaceAll("&", "&")) .append("
  • "); return ret.toString(); } }; %> <%-- override lookup URL, so this script is used to display the keys --%>

    Translations:

    Displayed modules

    click to remove

    <% Vector modules = new Vector(); for (int i = 0; i < parDispModules.size(); i++) { SWModule module = mgr.getModuleByName((String)parDispModules.get(i)); if (module != null && ((module.getCategory().equals(SwordOrb.BIBLES))||(module.getCategory().equals("Cults / Unorthodox / Questionable Material")))) { modules.add(module.getName()); } } out.print( sidebarView.renderView(modules, delModRenderer) ); %>

    Available modules

    click to add

    <% modules.clear(); for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals(SwordOrb.BIBLES) && !parDispModules.contains(modInfo[i].name)) { modules.add(modInfo[i].name); } } out.print( sidebarView.renderView(modules, addModRenderer) ); %>

    Cults / Unorthodox / Questionable Material

    click to add

    <% modules.clear(); for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals("Cults / Unorthodox / Questionable Material") && !parDispModules.contains(modInfo[i].name)) { modules.add(modInfo[i].name); } } out.print( sidebarView.renderView(modules, addModRenderer) ); %>

    Parallel viewing:

    Comentaries:

    Displayed modules

    click to remove

    <% Vector modules = new Vector(); for (int i = 0; i < parDispModules.size(); i++) { SWModule module = mgr.getModuleByName((String)parDispModules.get(i)); if (module != null && module.getCategory().equals(SwordOrb.COMMENTARIES)) { modules.add(module.getName()); } } out.print( sidebarView.renderView(modules, delModRenderer) ); %>

    Available modules

    click to add

    <% modules.clear(); for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals(SwordOrb.COMMENTARIES) && !parDispModules.contains(modInfo[i].name)) { modules.add(modInfo[i].name); } } out.print( sidebarView.renderView(modules, addModRenderer) ); %>
    <%-- end of right sightbat tag area --%> <% if (activeModule != null) { activeModule.setKeyText(activeKey); activeKey = activeModule.getKeyText(); // be sure it's formatted nicely } %>

    Parallel Viewing: <%= activeKey %>

    Parallel viewing allows you to see two or more texts side by side. For example, you could view two Bible versions of the same verse next to each other, or a verse from a specific translation and what a commentary has to say about that specific verse.

    <% //insert next and previous chapter links String prevChapterString = RangeInformation.getPreviousChapter(activeKey, activeModule); String nextChapterString = RangeInformation.getNextChapter(activeKey, activeModule); %> <%-- table which contains all verse items --%> <% Vector moduleList = new Vector(); for (int i = 0; i < parDispModules.size(); i++) { moduleList.add( mgr.getModuleByName((String)parDispModules.get(i)) ); } Vector entryList = null; if ((activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) || (activeModule.getCategory().equals(SwordOrb.BIBLES))) { entryList = RangeInformation.getChapterEntryList(activeKey, activeModule); } else { //a simple commentary entry, not multiple ones entryList = new Vector(); entryList.add(activeKey); } ModuleTextRendering rendering = null; ModuleEntryRenderer entryRenderer = null; if (parallelViewType.equals("sidebyside")) { rendering = new HorizontallyParallelTextRendering(); entryRenderer = new StandardEntryRenderer( new String("parallelstudy.jsp"), activeKey, mgr ); } else { //if (parallelViewType.equals("toptobottom")) rendering = new VerticallyParallelTextRendering(); entryRenderer = new SimpleEntryRenderer( new String("parallelstudy.jsp"), activeKey, mgr ); } if (strongs) { entryRenderer.enableFilterOption("Strong's Numbers"); } if (morph) { entryRenderer.enableFilterOption("Morphological Tags"); } out.print( rendering.render(moduleList, entryList, entryRenderer) ); //print out the text page String copyLine = activeModule.getConfigEntry("ShortCopyright"); if (copyLine.equalsIgnoreCase("")) { copyLine = ""; } if (activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) { copyLine = "WARNING: This text is considered unorthodox by most of Christendom. " + copyLine; } %>