[Tynstep-svn] r16 - in trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server: guice handler jsword/com/tyndalehouse/step/web/server

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Tue Nov 3 15:39:41 MST 2009


Author: ChrisBurrell
Date: 2009-11-03 15:39:41 -0700 (Tue, 03 Nov 2009)
New Revision: 16

Removed:
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/jsword/com/tyndalehouse/step/web/server/jsword/
Modified:
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java
Log:


Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java	2009-11-03 22:39:17 UTC (rev 15)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java	2009-11-03 22:39:41 UTC (rev 16)
@@ -5,11 +5,11 @@
 import org.apache.commons.logging.Log;
 
 import com.google.inject.Singleton;
+import com.tyndalehouse.step.web.server.db.RefDataDbCommand;
 import com.tyndalehouse.step.web.server.handler.GetAvailableBibleVersionsHandler;
 import com.tyndalehouse.step.web.server.handler.GetBibleBooksHandler;
 import com.tyndalehouse.step.web.server.handler.GetCurrentBibleTextHandler;
 import com.tyndalehouse.step.web.server.handler.GetModuleRefDataHandler;
-import com.tyndalehouse.step.web.shared.result.GetModuleRefDataResult;
 
 /**
  * Module which binds the handlers and configurations
@@ -24,5 +24,7 @@
 		bindHandler(GetCurrentBibleTextHandler.class);
 		bindHandler(GetModuleRefDataHandler.class);
 		bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
+		bind(RefDataDbCommand.class).in(Singleton.class);
+	
 	}
 }
\ No newline at end of file

Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java	2009-11-03 22:39:17 UTC (rev 15)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java	2009-11-03 22:39:41 UTC (rev 16)
@@ -10,6 +10,7 @@
 
 import org.apache.commons.logging.Log;
 import org.crosswire.jsword.book.Book;
+import org.crosswire.jsword.book.BookCategory;
 import org.crosswire.jsword.book.Books;
 
 import com.google.inject.Inject;
@@ -36,7 +37,10 @@
 		
 		for(int ii = 0; ii < books.size(); ii++) {
 			b = ((Book) books.get(ii));
-			map.put(b.getInitials(), b.getName());
+			
+			if(b.getBookCategory() == BookCategory.BIBLE) {
+				map.put(b.getInitials(), b.getName());
+			}
 		}
 		
 		return new GetAvailableBibleVersionsResult(map);

Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java	2009-11-03 22:39:17 UTC (rev 15)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java	2009-11-03 22:39:41 UTC (rev 16)
@@ -10,16 +10,21 @@
 import org.apache.commons.logging.Log;
 
 import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.tyndalehouse.step.web.server.db.RefDataDbCommand;
 import com.tyndalehouse.step.web.shared.command.GetModuleRefDataCommand;
 import com.tyndalehouse.step.web.shared.result.GetModuleRefDataResult;
 
 public class GetModuleRefDataHandler implements
 		ActionHandler<GetModuleRefDataCommand, GetModuleRefDataResult> {
 	private final Log logger;
+	private final Injector injector;
 
 	@Inject
-	public GetModuleRefDataHandler(Log logger) {
+	public GetModuleRefDataHandler(Log logger, Injector injector) {
 		this.logger = logger;
+		this.injector = injector;
+		
 	}
 
 	@Override
@@ -27,6 +32,9 @@
 			ExecutionContext arg1) throws ActionException {
 
 		SortedMap<String, String> refData = new TreeMap<String, String>(); 
+
+		//RefDataDbCommand dbCommand = injector.getInstance(RefDataDbCommand.class);
+		//dbCommand.select("1");
 		
 		if(command.getModuleName() == null) {
 			//TODO: For now hardcode the whole thing




More information about the Tynstep-svn mailing list