%@page contentType="text/html; charset=UTF-8" %>
<%@ page import="org.crosswire.sword.mgr.SWMgr" %>
<%@ page import="com.objectspace.jgl.HashMapIterator" %>
<%@ page import="com.objectspace.jgl.Map" %>
<%@ page import="java.util.TreeMap" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="gnu.regexp.RE" %>
<%@ page import="java.io.File" %>
<%
try {
response.setCharacterEncoding("UTF-8");
String modName = "NKJV";
try {modName = request.getParameterValues("modName")[0];} catch (Exception e) {}
String sections[] = new String[] { "attic", "avattic", "av", "beta", "experimental", "exp", "wycliffe" };
String spsection = "";
for (String s : sections) {
String sparam = request.getParameter(s);
if (sparam != null && !sparam.equals("")) {
spsection = s;
break;
}
}
if ("exp".equals(spsection)) spsection = "experimental"; // handle old "exp" param for backward compat
boolean tester = false;
try {tester = (request.getParameterValues("tester")[0] != null);} catch (Exception e) {}
SWMgr conf = null;
String swordhome = "/home/ftp/pub/sword/"+spsection+"raw/";
conf = SWMgr.getInstance(swordhome);
Map module = (Map)conf.config.sections.get(modName);
if (module == null) {
out.print("No module found: " + modName);
return;
}
String modNotes = "";
String langName = (String)module.get("Lang");
String description = (String)module.get("Description");
String about = (String)module.get("About");
String distLic = (String)module.get("DistributionLicense");
String promo = (String)module.get("ShortPromo");
boolean locked = ((String)module.get("CipherKey") != null);
if (tester)
locked = false;
if (promo != null)
about += "
" + promo;
//locked downloads are possible now
locked = false;
String rawdl = locked ? "[locked]" : "[download]";
String windl = locked ? "[locked]" : "[download]";
String macdl = locked ? "[locked]" : "[download]";
String version = (String)module.get("Version");
if (version == null)
version = "1.0";
String date = (String)module.get("SwordVersionDate");
if (date != null)
version = version + " (" + date + ")";
String minimumversion = (String)module.get("MinimumVersion");
if (minimumversion == null)
minimumversion = "1.5.1a";
String category = (String)module.get("Category");
if (category != null && category.startsWith("Cult")) {
modNotes = category;
category = null;
}
if (category == null)
category = (String)module.get("ModDrv");;
if (category != null) {
// continue if we don't have a module we wish to display
if ((category.equals("RawText"))
|| (category.equals("zText")))
category = "Bible";
else if ((category.equals("RawCom"))
|| (category.equals("HREFCom"))
|| (category.equals("RawFiles"))
|| (category.equals("zCom")))
category = "Commentary";
else if ((category.equals("RawLD"))
|| (category.equals("RawLD4")))
category = "Dictionary";
}
for (Enumeration en = module.values("GlobalOptionFilter"); en.hasMoreElements();) {
String val = (String)en.nextElement();
if (val.endsWith("Strongs")) {
if (!modNotes.equals(""))
modNotes += "
";
modNotes += "Includes Strong's Numbers";
}
if (val.endsWith("Morph")) {
if (!modNotes.equals(""))
modNotes += "
";
modNotes += "Includes Morphology Codes";
}
if (val.endsWith("Footnotes")) {
if (!modNotes.equals(""))
modNotes += "
";
modNotes += "Includes Footnotes";
}
if (val.endsWith("SectionHeadings")) {
if (!modNotes.equals(""))
modNotes += "
";
modNotes += "Includes Section Headings";
}
}
if (!modNotes.equals("")) modNotes = "
Module Name | <%= modName %> |
Book Name | <%= description %> |
Module Type | <%= category %> |
Language | <%= langName %> |
Module Version | <%= version %> |
Minimum SWORD Version | <%= minimumversion %> |
Download Size | <%= sizeDownload %> |
Install Size | <%= sizeInstall %> |
About | <%= about %> |
Distribution License | <%= distLic %> |
Download | <%= rawdl %> |
Download: Windows | <%= windl %> |
Download: MacOSX | <%= macdl %> |