Displaying differences for changeset
display as  

nbproject/build-impl.xml

@@ -1010,7 +1010,7 @@
         <copyfiles files="${reference.csip-core.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.commons-math-2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <copyfiles files="${file.reference.csip-lib-air-0.1.2.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
-        <copyfiles files="${file.reference.csip-lib-water-1.1.8.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+        <copyfiles files="${file.reference.csip-lib-water-3.1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
         <mkdir dir="${build.web.dir}/META-INF"/>
         <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
     </target>
@@ -1019,7 +1019,7 @@
         <copyfiles files="${reference.csip-core.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.commons-math-2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
         <copyfiles files="${file.reference.csip-lib-air-0.1.2.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
-        <copyfiles files="${file.reference.csip-lib-water-1.1.8.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+        <copyfiles files="${file.reference.csip-lib-water-3.1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
     </target>
     <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
         <delete dir="${build.web.dir}/WEB-INF/lib"/>

nbproject/project.properties

@@ -35,7 +35,7 @@
 excludes=
 file.reference.commons-math-2.0.jar=lib/commons-math-2.0.jar
 file.reference.csip-lib-air-0.1.2.jar=lib/csip-lib-air-0.1.2.jar
-file.reference.csip-lib-water-1.1.8.jar=lib/csip-lib-water-1.1.8.jar
+file.reference.csip-lib-water-3.1.1.jar=lib/csip-lib-water-3.1.1.jar
 includes=**
 j2ee.compile.on.save=true
 j2ee.copy.static.files.on.save=true
@@ -49,7 +49,7 @@
     ${reference.csip-core.jar}:\
     ${file.reference.commons-math-2.0.jar}:\
     ${file.reference.csip-lib-air-0.1.2.jar}:\
-    ${file.reference.csip-lib-water-1.1.8.jar}
+    ${file.reference.csip-lib-water-3.1.1.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.debug=true

nbproject/project.xml

@@ -28,7 +28,7 @@
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.csip-lib-water-1.1.8.jar}</file>
+                    <file>${file.reference.csip-lib-water-3.1.1.jar}</file>
                     <path-in-war>WEB-INF/lib</path-in-war>
                 </library>
             </web-module-libraries>

src/java/m/datadownload/V1_0.java

@@ -1,6 +1,7 @@
 package m.datadownload;
 
 import csip.ModelDataService;
+import csip.PayloadParameter;
 import csip.annotations.Description;
 import csip.annotations.Name;
 import csip.annotations.Resource;
@@ -14,36 +15,39 @@
 @Description("USGS, USGS wells, STORET, SNOTEL, CDWR, NCDC data download")
 @VersionInfo("1.0")
 @Path("m/datadownload/datadownload/1.0")
-@Resource(file = "/python/driver.py", type = FILE, id = "driver")
 public class V1_0 extends ModelDataService {
 
     guiDataDownloads model = new guiDataDownloads();
+    
+    @Override
+    protected void preProcess() throws Exception {
+        model.setDirectory(getWorkspaceDir().toString());
+        
+        PayloadParameter inputPayload = parameter();
+        model.setAttributeFile(inputPayload.getString("attribute_file"));
+        model.setBeginDate(inputPayload.getString("begin_date"));
+        model.setEndDate(inputPayload.getString("end_date"));
+        model.setUSGSflowTF(inputPayload.getBoolean("USGS_flow_true"));
+        model.setUSGSwqTF(inputPayload.getBoolean("USGS_wq_true"));
+        model.setUSGSfloodTF(inputPayload.getBoolean("USGS_flood_true"));
+        model.setUSGSstageDischargeTF(inputPayload.getBoolean("USGS_stagedischarge_true"));
+        model.setUSGSWellsDepthTF(inputPayload.getBoolean("USGSwells_depth_true"));
+        model.setUSGSWellsWatertableHeightTF(inputPayload.getBoolean("USGSwells_height_true"));
+        model.setUSGSWellwqTF(inputPayload.getBoolean("USGSwells_wq_true"));
+        model.setSTORETflowTF(inputPayload.getBoolean("STORET_flow_true"));
+        model.setSTORETwqTF(inputPayload.getBoolean("STORET_wq_true"));
+        model.setCDWRflowTF(inputPayload.getBoolean("CDWR_flow_true"));
+        model.setCDWRstageDischargeTF(inputPayload.getBoolean("CDWR_stagedischarge_true"));
+        model.setNADPannualDataTF(inputPayload.getBoolean("NADP_annual_true"));
+        model.setNADPmonthlyDataTF(inputPayload.getBoolean("NADP_monthly_true"));
+        model.setNADPweeklyDataTF(inputPayload.getBoolean("NADP_weekly_true"));
+        model.setCDSNflowTF(inputPayload.getBoolean("CDSN_flow_true"));
+        model.setCDSNwqTF(inputPayload.getBoolean("CDSN_wq_true"));
+    }
 
     @Override
     protected void doProcess() throws Exception {
-        model.setMainFolder(getWorkspaceDir().toString());
-        model.setAttributeFile(getStringParam("attribute_file"));
-        model.setBeginDate(getStringParam("begin_date"));
-        model.setEndDate(getStringParam("end_date"));
-        model.setUSGSflowTF(getBooleanParam("USGS_flow_true"));
-        model.setUSGSwqTF(getBooleanParam("USGS_wq_true"));
-        model.setUSGSfloodTF(getBooleanParam("USGS_flood_true"));
-        model.setUSGSstageDischargeTF(getBooleanParam("USGS_stagedischarge_true"));
-        model.setUSGSWellsDepthTF(getBooleanParam("USGSwells_depth_true"));
-        model.setUSGSWellsWatertableHeightTF(getBooleanParam("USGSwells_height_true"));
-        model.setUSGSWellwqTF(getBooleanParam("USGSwells_wq_true"));
-        model.setSTORETflowTF(getBooleanParam("STORET_flow_true"));
-        model.setSTORETwqTF(getBooleanParam("STORET_wq_true"));
-        model.setCDWRflowTF(getBooleanParam("CDWR_flow_true"));
-        model.setCDWRstageDischargeTF(getBooleanParam("CDWR_stagedischarge_true"));
-        model.setNADPannualDataTF(getBooleanParam("NADP_annual_true"));
-        model.setNADPmonthlyDataTF(getBooleanParam("NADP_monthly_true"));
-        model.setNADPweeklyDataTF(getBooleanParam("NADP_weekly_true"));
-        model.setCDSNflowTF(getBooleanParam("CDSN_flow_true"));
-        model.setCDSNwqTF(getBooleanParam("CDSN_wq_true"));
-        
-        File f = getResourceFile("driver");
-        model.run(f);
+        model.run();
     }
     
     @Override

src/java/m/datadownload/guiDataDownloads.java

@@ -27,7 +27,7 @@
 import java.util.zip.ZipOutputStream;
 
 /**
-* Last Updated: 22-June-2017
+* Last Updated: 19-June-2019
 * @author Tyler Wible
 * @since 12-April-2012
 */
@@ -84,7 +84,7 @@
     public File getResults(){ return new File(directory, "downloadData.zip"); }
     
     //Sets
-    public void setMainFolder(String directory_str){ directory = directory_str; }
+    public void setDirectory(String directory_str){ directory = directory_str; }
     public void setAttributeFile(String attributeFile_str){ attributeFile = attributeFile_str; }
     public void setBeginDate(String beginDate_str){ beginDate = beginDate_str; }
     public void setEndDate(String endDate_str){ endDate = endDate_str; }
@@ -193,7 +193,7 @@
         fileNameList.add(fileName);
         return fileNameList;
     }
-    public void run(File storetResourceFile) throws IOException, ParseException, InterruptedException, Exception {
+    public void run() throws IOException, ParseException, InterruptedException, Exception {
         long startTime = System.currentTimeMillis();
         
         //If no date input, make it the maximum of available data
@@ -286,7 +286,7 @@
                     fileNameList = writeOutputFile(textData, fileNameList, "SNOTEL_" + currentAttributes[index_state] + "_" + currentAttributes[index_station_id] + ".csv", currentAttributes[index_database]);
                     
                 }else{
-                    WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(currentAttributes[index_database], "", storetResourceFile);
+                    WaterDataInterface waterLib = WaterData.getNewWaterDataInterface(currentAttributes[index_database], "");
                     String stationId_fixed = currentAttributes[index_station_id].replace("/", "");
                     if((currentAttributes[index_database].equalsIgnoreCase("USGS") && USGSflowTF) ||
                        (currentAttributes[index_database].equalsIgnoreCase("STORET") && STORETflowTF) || 
@@ -371,6 +371,6 @@
     public static void main(String[] args) throws IOException, Exception{
         //Run model
         guiDataDownloads model = new guiDataDownloads();
-        model.run(null);
+        model.run();
     }
 }
\ No newline at end of file