Displaying differences for changeset
 
display as  

src/java/c/GIS_DB_Factory.java

@@ -5,6 +5,7 @@
  */
 package c;
 
+import csip.Config;
 import java.sql.Connection;
 import java.sql.SQLException;
 import org.apache.commons.lang.NotImplementedException;
@@ -14,30 +15,23 @@
  * @author scase
  */
 public class GIS_DB_Factory { 
-    public static GIS_DB createGISEngine(Connection connection) throws csip.ServiceException, SQLException, NotImplementedException {
+    
+    public static GIS_DB createGISEngine() throws Exception {
+        //TODO:  This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations.
         GIS_DB ret_val = null;
+
+        // Return pg connection, unless mssql is specified in config param
+        String db = Config.getString("conservation_resources.database", "pg");
+        if (db.contentEquals("mssql")) {
+            ret_val = new MsSQLGIS();
+        }
+        else {
+            ret_val = PostGIS.singleton();
+            //throw new NotImplementedException("Unsupported DBMS type specified.  " + connection.getMetaData().getDatabaseProductName()  + " is not implemented.");
+        }
         
-        //TODO:  create the appropriate GISObjectConsumers here...Need one for PostgreSQL as well...Need an improved implementation of the old csip-gis-utils that has been decoupled and does not use temp tables,
-        if (connection.getMetaData().getDatabaseProductName().contains("Microsoft SQL")) {
-            ret_val = new MsSQLGIS( connection );
-        }
-        else{
-            throw new NotImplementedException("Unsupported DBMS type specified.  " + connection.getMetaData().getDatabaseProductName()  + " is not implemented.");
-        }
         return ret_val;
     }
 
-// uncomment for PostgreSQL Server implementation
-    public static GIS_DB createGISEngine() throws Exception {
-        //TODO:  This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations.
-        return PostGIS.singleton();
-    }
-
-// uncomment for MS SQL Server implementation
-//    public static GIS_DB createGISEngine() throws Exception {
-//        //TODO:  This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations.
-//        return new MsSQLGIS();
-//    }    
-
 }
    
\ No newline at end of file

src/java/c/MsSQLGIS.java

@@ -26,7 +26,7 @@
  * and open the template in the editor.
  */
 //TODO:  This needs to be moved to the conf file!
-@Resource(file = "jdbc:sqlserver://129.82.20.241:1433;databaseName=conservation_resources;user=sa;password=csurams#1",
+@Resource(file = "${conservation_resources.db}",
         env = {"maxWait=10000", "jmxEnabled=false"}, id = "csip.erosion.sqlsvr", type = JDBC)
 
 /**

src/java/m/weps/V1_3_1.java

@@ -47,21 +47,19 @@
 
 // weps, weps.version is in the csip-conf.file
 @Resource(type = EXECUTABLE, file = "/bin/${arch}/${weps.version}/weps.exe", id = WEPS_EXE)
-//@Resource(type = EXECUTABLE, file = "/bin/${csip.arch}/weps", id = WEPS_EXE)
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/weps-1.3.9", id = WEPS_EXE)
+
 // cligen
 @Resource(type = EXECUTABLE, file = "/bin/${arch}/cligen.exe", id = CLIGEN)
-//@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/cligen", id = CLIGEN)
 @Resource(type = FILE, file = "/data/upd_US_cligen_stations.par", id = STATION_PAR)
+
 // windgen
 @Resource(type = EXECUTABLE, file = "/bin/win-x86/wind_gen4.exe", wine = true, id = WINDGEN)
 @Resource(type = EXECUTABLE, file = "/bin/${arch}/interpolate.exe", id = INTERPOLATE)
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/interpolate", id = INTERPOLATE)
 @Resource(type = EXECUTABLE, file = "/bin/${arch}/interp_wdb.exe", id = INTERP_WDB)
-////@Resource(type = EXECUTABLE, file = "/bin/lin-amd64/interp_wdb", id = INTERP_WDB)
 @Resource(type = FILE, file = "/data/wind_gen_his_upper_US_NRCS.idx", id = WINDGEN_IDX)
 @Resource(type = FILE, file = "/data/wind_gen_his_upper_US.wdb", id = DEFAULT_WIND_STATION_DB)
 @Resource(type = FILE, file = "/data/interpolation_boundary.pol", id = BOUNDARY_POL)
+
 // report
 @Resource(type = FILE, file = "/data/weps_report.json", id = REPORT_JSON_ID)
 

web/META-INF/configcsip8090.json

@@ -4,6 +4,7 @@
     "csip.dir": "/tmp/csip",
     "csip.results.dir": "/tmp/csip/results",
     "csip.work.dir": "/tmp/csip/work",
+    "conservation_resources.db": "jdbc:sqlserver://129.82.20.241:1433;databaseName=conservation_resources;user=sa;password=csurams#1",
     "lmod.db": "jdbc:sqlserver:\/\/129.82.20.242:1433;databaseName=lmod_zedx;user=lmod-rw;password=managements",
     "pg.chunks": "8",
     "pg.connpool": "8",

web/META-INF/csip-conf.json

@@ -1,5 +1,5 @@
 {
-    "csip-erosion.version": "$version: 0.2.59 eb5986b2c844 2016-05-11 wlloyd@titan, built at 2016-05-13 17:28 by wlloyd$",
+    "csip-erosion.version": "$version: 0.2.60 8ddd81fda7dd 2016-05-13 wlloyd@titan, built at 2016-05-16 13:24 by wlloyd$",
     "weps.version" : "1.3.9",
     "csip.home" : "/tmp/csip"
 }