[sword-cvs] swordweb dailydevotion.jsp,1.3,1.4 fulllibrary.jsp,1.2,1.3 init.jsp,1.4,1.5 parallelstudy.jsp,1.8,1.9 passagestudy.jsp,1.5,1.6 powersearch.jsp,1.4,1.5 preferences.jsp,1.2,1.3 wordsearchresults.jsp,1.9,1.10

sword@www.crosswire.org sword@www.crosswire.org
Thu, 21 Aug 2003 13:31:26 -0700


Update of /usr/local/cvsroot/swordweb
In directory www:/tmp/cvs-serv29306

Modified Files:
	dailydevotion.jsp fulllibrary.jsp init.jsp parallelstudy.jsp 
	passagestudy.jsp powersearch.jsp preferences.jsp 
	wordsearchresults.jsp 
Log Message:



Index: dailydevotion.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/dailydevotion.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dailydevotion.jsp	20 Aug 2003 21:24:49 -0000	1.3
+++ dailydevotion.jsp	21 Aug 2003 20:31:24 -0000	1.4
@@ -21,8 +21,8 @@
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
 				SWModule module = mgr.getModuleByName(modInfo[i].name);
-				if (("Daily Devotional".equals(modInfo[i].type)) ||
-					 ("Daily Devotional".equals(module.getConfigEntry("Category")))) {
+				if ((SwordOrb.DAILYDEVOS.equals(modInfo[i].category)) ||
+					 (SwordOrb.DAILYDEVOS.equals(module.getConfigEntry("Category")))) {
 	%>
 			<li><a href="dailydevotion.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="Add <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>
 	<%

Index: fulllibrary.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/fulllibrary.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fulllibrary.jsp	20 Aug 2003 21:24:49 -0000	1.2
+++ fulllibrary.jsp	21 Aug 2003 20:31:24 -0000	1.3
@@ -47,19 +47,19 @@
 <%
 			Vector leaves = new Vector();
 			for (int i = 0; i < modInfo.length; i++) {
-				if (!leaves.contains(modInfo[i].type)) {
-					leaves.add(modInfo[i].type);
-					boolean open = catTreeOpen.contains(modInfo[i].type);
+				if (!leaves.contains(modInfo[i].category)) {
+					leaves.add(modInfo[i].category);
+					boolean open = catTreeOpen.contains(modInfo[i].category);
 %>
 		
-					<li><b><a href="fulllibrary.jsp?<%= (open)?"close":"open" %>=<%= URLEncoder.encode(modInfo[i].type) %>"><%= ((open)?"[-]":"[+]") %></a>  <%= modInfo[i].type %></b></li>
+					<li><b><a href="fulllibrary.jsp?<%= (open)?"close":"open" %>=<%= URLEncoder.encode(modInfo[i].category) %>"><%= ((open)?"[-]":"[+]") %></a>  <%= modInfo[i].category %></b></li>
 <%
 					if (open) {
 %>
 						<ul>
 <%
 						for (int j = 0; j < modInfo.length; j++) {
-							if (modInfo[i].type.equals(modInfo[j].type)) {
+							if (modInfo[i].category.equals(modInfo[j].category)) {
 								SWModule module = mgr.getModuleByName(modInfo[j].name);
 								if (module != null) {
 %>
@@ -95,15 +95,15 @@
 				}
 				String type = module.getConfigEntry("Category");
 				if ((type == null) || (type.length() < 2))
-					type = module.getType();
+					type = module.getCategory();
 				String targetURL = "";
 				if ((SwordOrb.BIBLES.equals(type)) || (SwordOrb.COMMENTARIES.equals(type))) {
 					targetURL = "passagestudy.jsp?mod="+URLEncoder.encode(module.getName());
 				}
-				else if ("Daily Devotional".equals(type)) {
+				else if (SwordOrb.DAILYDEVOS.equals(type)) {
 					targetURL = "dailydevotion.jsp?mod="+URLEncoder.encode(module.getName());
 				}
-				else if ("Generic Books".equals(type)) {
+				else if (SwordOrb.GENBOOKS.equals(type)) {
 					targetURL = "bookdisplay.jsp?mod="+URLEncoder.encode(module.getName());
 				}
 %>

Index: init.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/init.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- init.jsp	19 Aug 2003 04:09:03 -0000	1.4
+++ init.jsp	21 Aug 2003 20:31:24 -0000	1.5
@@ -4,6 +4,8 @@
 %>
 <%@ page import="org.crosswire.util.Base64" %>
 <%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Arrays" %>
+<%@ page import="java.util.Comparator" %>
 <%@ page import="org.crosswire.sword.orb.*" %>
 <%@ page import="java.net.URLEncoder" %>
 <%
@@ -13,6 +15,36 @@
 	if (modInfo == null) {
 		// we don't have it cached yet, so get it from the orb and save it in the session
 		modInfo = mgr.getModInfoList();
+		Arrays.sort(modInfo, new Comparator() {
+			public int compare(Object o1, Object o2) {
+				ModInfo m1 = (ModInfo) o1;
+				ModInfo m2 = (ModInfo) o2;
+				StringBuffer comp1 = new StringBuffer();
+				StringBuffer comp2 = new StringBuffer();
+				for (int i = 0; i < 2; i++) {
+					ModInfo mi = (i == 0)?m1:m2;
+					StringBuffer sb = (i==0)?comp1:comp2;
+					if (mi.category.equals(SwordOrb.BIBLES)) {
+						sb.append("1");
+					}
+					else if (mi.category.equals(SwordOrb.COMMENTARIES)) {
+						sb.append("2");
+					}
+					else if (mi.category.equals(SwordOrb.DAILYDEVOS)) {
+						sb.append("3");
+					}
+					else if (mi.category.equals(SwordOrb.LEXDICTS)) {
+						sb.append("4");
+					}
+					else if (mi.category.equals(SwordOrb.GENBOOKS)) {
+						sb.append("5");
+					}
+				}
+				comp1.append(m1.description);
+				comp2.append(m2.description);
+				return (comp1.toString().compareTo(comp2.toString()));
+			}
+		});
 		session.setAttribute("ModInfo", modInfo);
 	}
 

Index: parallelstudy.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/parallelstudy.jsp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- parallelstudy.jsp	20 Aug 2003 21:26:09 -0000	1.8
+++ parallelstudy.jsp	21 Aug 2003 20:31:24 -0000	1.9
@@ -43,7 +43,7 @@
 		<%
 			for (int i = 0; i < parDispModules.size(); i++) {
 				SWModule module = mgr.getModuleByName((String)parDispModules.get(i));
-				if (module != null && module.getType().equals(SwordOrb.BIBLES)) {
+				if (module != null && module.getCategory().equals(SwordOrb.BIBLES)) {
 		%>
 					<li>
 						<a href="parallelstudy.jsp?del=<%= URLEncoder.encode(module.getName()) %>" title="Remove from displayed modules">
@@ -63,7 +63,7 @@
 		<ul>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.BIBLES)) {
+				if (modInfo[i].category.equals(SwordOrb.BIBLES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 					if ( parDispModules.contains(module.getName()) ) {
 						continue;
@@ -90,7 +90,7 @@
 		<%
 			for (int i = 0; i < parDispModules.size(); i++) {
 				SWModule module = mgr.getModuleByName((String)parDispModules.get(i));
-				if (module != null && module.getType().equals(SwordOrb.COMMENTARIES)) {
+				if (module != null && module.getCategory().equals(SwordOrb.COMMENTARIES)) {
 		%>
 				<li>
 					<a href="parallelstudy.jsp?del=<%= URLEncoder.encode(module.getName()) %>" title="Remove from displayed modules">
@@ -109,7 +109,7 @@
 		<ul>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.COMMENTARIES)) {
+				if (modInfo[i].category.equals(SwordOrb.COMMENTARIES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 					if ( parDispModules.contains(module.getName()) ) {
 						continue;
@@ -142,8 +142,8 @@
 		</ul>
 		<%
 			activeModule = mgr.getModuleByName((String)parDispModules.get(0));
-			if (activeModule.getType().equals(SwordOrb.BIBLES) ||
-			    activeModule.getType().equals(SwordOrb.COMMENTARIES))
+			if (activeModule.getCategory().equals(SwordOrb.BIBLES) ||
+			    activeModule.getCategory().equals(SwordOrb.COMMENTARIES))
 			{
 		%>
 

Index: passagestudy.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/passagestudy.jsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- passagestudy.jsp	20 Aug 2003 21:26:09 -0000	1.5
+++ passagestudy.jsp	21 Aug 2003 20:31:24 -0000	1.6
@@ -32,7 +32,7 @@
 			<ul>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.BIBLES)) {
+				if (modInfo[i].category.equals(SwordOrb.BIBLES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="passagestudy.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="view Romans 8:26-39 in <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>
@@ -60,7 +60,7 @@
 			<ul>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.COMMENTARIES)) {
+				if (modInfo[i].category.equals(SwordOrb.COMMENTARIES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="passagestudy.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="view Romans 8:26-39 in <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>
@@ -84,7 +84,7 @@
 			<li><a href="" title="display Romans 10">next chapter</a></li>
 		</ul>
 		<%
-			if (activeModule.getType().equals(SwordOrb.BIBLES)) {
+			if (activeModule.getCategory().equals(SwordOrb.BIBLES)) {
 				String chapterPrefix = activeKey.substring(0, activeKey.indexOf(":"));
 				for (activeModule.setKeyText(chapterPrefix + ":1"); (activeModule.error() == (char)0); activeModule.next()) {
 					String keyText = activeModule.getKeyText();

Index: powersearch.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/powersearch.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- powersearch.jsp	20 Aug 2003 21:26:09 -0000	1.4
+++ powersearch.jsp	21 Aug 2003 20:31:24 -0000	1.5
@@ -24,7 +24,7 @@
 		<hr/>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.BIBLES)) {
+				if (modInfo[i].category.equals(SwordOrb.BIBLES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="powersearch.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="Add <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>
@@ -48,7 +48,7 @@
 		<hr/>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.COMMENTARIES)) {
+				if (modInfo[i].category.equals(SwordOrb.COMMENTARIES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="powersearch.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="Add <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>

Index: preferences.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/preferences.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- preferences.jsp	23 May 2003 18:31:01 -0000	1.2
+++ preferences.jsp	21 Aug 2003 20:31:24 -0000	1.3
@@ -5,11 +5,11 @@
 	if (addModule != null) {
 		SWModule mod = mgr.getModuleByName(addModule);
 		if (mod != null) {
-			if (mod.getType().equals(SwordOrb.BIBLES)) {
+			if (mod.getCategory().equals(SwordOrb.BIBLES)) {
 				prefBibles.remove(mod.getName());
 				prefBibles.add(0, mod.getName());
 			}
-			if (mod.getType().equals(SwordOrb.COMMENTARIES)) {
+			if (mod.getCategory().equals(SwordOrb.COMMENTARIES)) {
 				prefCommentaries.remove(mod.getName());
 				prefCommentaries.add(0, mod.getName());
 			}
@@ -20,10 +20,10 @@
 	if (delModule != null) {
 		SWModule mod = mgr.getModuleByName(delModule);
 		if (mod != null) {
-			if (mod.getType().equals(SwordOrb.BIBLES)) {
+			if (mod.getCategory().equals(SwordOrb.BIBLES)) {
 				prefBibles.remove(mod.getName());
 			}
-			if (mod.getType().equals(SwordOrb.COMMENTARIES)) {
+			if (mod.getCategory().equals(SwordOrb.COMMENTARIES)) {
 				prefCommentaries.remove(mod.getName());
 			}
 		}
@@ -51,7 +51,7 @@
 		<hr/>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.BIBLES)) {
+				if (modInfo[i].category.equals(SwordOrb.BIBLES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="preferences.jsp?add=<%= URLEncoder.encode(modInfo[i].name) %>" title="Add <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>
@@ -76,7 +76,7 @@
 		<hr/>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.COMMENTARIES)) {
+				if (modInfo[i].category.equals(SwordOrb.COMMENTARIES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="preferences.jsp?add=<%= URLEncoder.encode(modInfo[i].name) %>" title="Add <%= module.getDescription().replaceAll("&", "&amp;") %>"><%= module.getDescription().replaceAll("&", "&amp;") %></a></li>

Index: wordsearchresults.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/wordsearchresults.jsp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- wordsearchresults.jsp	20 Aug 2003 21:26:09 -0000	1.9
+++ wordsearchresults.jsp	21 Aug 2003 20:31:24 -0000	1.10
@@ -42,7 +42,7 @@
 		<ul>
 		<%
 			for (int i = 0; i < modInfo.length; i++) {
-				if (modInfo[i].type.equals(SwordOrb.BIBLES)) {
+				if (modInfo[i].category.equals(SwordOrb.BIBLES)) {
 					SWModule module = mgr.getModuleByName(modInfo[i].name);
 		%>
 				<li><a href="wordsearchresults.jsp?mod=<%= URLEncoder.encode(modInfo[i].name) %>" title="view Romans 8:26-39 in <%= module.getDescription() %>"><%= module.getDescription() %></a></li>