<%@ include file="init.jsp" %> <% String resetModule = request.getParameter("mod"); String lastModType = (String) session.getAttribute("lastModType"); String activeModuleName = (resetModule != null)?resetModule : ((String) session.getAttribute(("GBS".equals(lastModType))?"gbsBook":"ActiveModule")); SWModule activeModule = mgr.getModuleByName((activeModuleName == null) ? defaultBible : activeModuleName); if ((resetModule != null) && (activeModule != null)) { if ("Generic Books".equals(activeModule.getCategory())) { session.setAttribute("gbsBook", resetModule); session.setAttribute("lastModType", "GBS"); } else { session.setAttribute("ActiveModule", resetModule); session.setAttribute("lastModType", "Bible"); } } lastModType = (String) session.getAttribute("lastModType"); String resetSearchTerm = request.getParameter("searchTerm"); if (resetSearchTerm != null) { mgr.setGlobalOption("Greek Accents", "Off"); session.setAttribute("ActiveSearchTerm", mgr.filterText("Greek Accents", resetSearchTerm)); mgr.setGlobalOption("Greek Accents", "On"); } String activeSearchTerm = (String) session.getAttribute("ActiveSearchTerm"); String range = ""; String tmp = request.getParameter("range"); if (tmp != null) range = tmp; SearchType stype = (activeModule.hasSearchFramework()) ? SearchType.LUCENE : SearchType.MULTIWORD; tmp = request.getParameter("stype"); if (tmp != null) { if (tmp.equalsIgnoreCase("P")) stype = SearchType.PHRASE; if (tmp.equalsIgnoreCase("R")) stype = SearchType.REGEX; } int soptions = 2; // default to ignore case tmp = request.getParameter("icase"); if ((tmp != null) && (!tmp.equals("1"))) soptions = 0; %> Search results for <%= new String(activeSearchTerm.getBytes("iso8859-1"), "UTF-8") %>

Translations:

    <% for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals(SwordOrb.BIBLES)) { SWModule module = mgr.getModuleByName(modInfo[i].name); %>
  • <%= module.getDescription() %>
  • <% } } %>

Original Language:

Results for "<%= new String(activeSearchTerm.getBytes("iso8859-1"), "UTF-8") %>"

<% SearchHit[] results = null; if ((activeSearchTerm != null) && (activeSearchTerm.trim().length() > 0)) { mgr.setGlobalOption("Greek Accents", "Off"); results = activeModule.search(activeSearchTerm, stype, soptions, range); mgr.setGlobalOption("Greek Accents", "On"); //save the search reusult into the session so it can be retrived later on to browse through it session.setAttribute("SearchResults", results); } else if ( activeSearchTerm == null ) { //no search term given, try to see if we have a valid search result saved results = (SearchHit[]) session.getAttribute("SearchResults"); } if ( results == null ) results = new SearchHit[0]; %>

» <%= results.length %> result<%= (results.length == 1)?"s":""%> in the text of <%= activeModule.getDescription() %>

<% Integer resultStart = new Integer(request.getParameter("start") != null ? request.getParameter("start") : "0"); Integer resultLimit = new Integer(30); for (int i = resultStart.intValue(); i < results.length && i < resultStart.intValue() + resultLimit.intValue(); i++) { activeModule.setKeyText(results[i].key); %>
" title="<%= results[i].key %>"><%= results[i].key %> <%= (results[i].score > 0)?("score: " + results[i].score) : "" %>
<% boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction"))); %>
"> <%= new String(activeModule.getRenderText().getBytes("iso-8859-1"), "UTF-8") %>
<% } %>
    <% int navStart = (resultStart.intValue() / resultLimit.intValue()) - 5; if (navStart < 0) navStart = 0; int navEnd = navStart + 10; if ( navEnd*resultLimit.intValue() > results.length ) { navEnd = (results.length / resultLimit.intValue()) + ((results.length % resultLimit.intValue()) > 0 ? 1 : 0); } %>
  • Result Page:
  • <% if ( navStart > 0 ) { %>
  • 1 [...]
  • <% } else { if (results.length < resultLimit.intValue()) { %>
  • <%= 1 %>
  • <% } } for (int i = navStart; i < navEnd; ++i) { if (i == (resultStart.intValue() / resultLimit.intValue())) { %>
  • <%= i+1 %>
  • <% } else { %>
  • <%= i+1 %>
  • <% } } %> <% int lastPage = (results.length / resultLimit.intValue()) + ((results.length % resultLimit.intValue()) > 0 ? 1 : 0) -1; if (navEnd < lastPage) { %>
  •  [...] <%= lastPage+1 %>
  • <% } %>