@@ -1,42 +1,23 @@ |
<?xml version="1.0" encoding="UTF-8"?> |
<!-- |
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
-Copyright (c) 2006, 2016 Oracle and/or its affiliates. All rights reserved. |
+ Licensed to the Apache Software Foundation (ASF) under one |
+ or more contributor license agreements. See the NOTICE file |
+ distributed with this work for additional information |
+ regarding copyright ownership. The ASF licenses this file |
+ to you under the Apache License, Version 2.0 (the |
+ "License"); you may not use this file except in compliance |
+ with the License. You may obtain a copy of the License at |
|
-Oracle and Java are registered trademarks of Oracle and/or its affiliates. |
-Other names may be trademarks of their respective owners. |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
-The contents of this file are subject to the terms of either the GNU |
-General Public License Version 2 only ("GPL") or the Common |
-Development and Distribution License("CDDL") (collectively, the |
-"License"). You may not use this file except in compliance with the |
-License. You can obtain a copy of the License at |
-http://www.netbeans.org/cddl-gplv2.html |
-or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the |
-specific language governing permissions and limitations under the |
-License. When distributing the software, include this License Header |
-Notice in each file and include the License file at |
-nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this |
-particular file as subject to the "Classpath" exception as provided |
-by Oracle in the GPL Version 2 section of the License file that |
-accompanied this code. If applicable, add the following below the |
-License Header, with the fields enclosed by brackets [] replaced by |
-your own identifying information: |
-"Portions Copyrighted [year] [name of copyright owner]" |
+ Unless required by applicable law or agreed to in writing, |
+ software distributed under the License is distributed on an |
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
+ KIND, either express or implied. See the License for the |
+ specific language governing permissions and limitations |
+ under the License. |
|
-If you wish your version of this file to be governed by only the CDDL |
-or only the GPL Version 2, indicate your decision by adding |
-"[Contributor] elects to include this software in this distribution |
-under the [CDDL or GPL Version 2] license." If you do not indicate a |
-single choice of license, a recipient has the option to distribute |
-your version of this file under either the CDDL, the GPL Version 2 or |
-to extend the choice of license to its licensees as provided above. |
-However, if you add GPL Version 2 code and therefore, elected the GPL |
-Version 2 license, then the option applies only if the new code is |
-made subject to such option by the copyright holder. |
- |
-Contributor(s): |
--> |
<project default="-deploy-ant" basedir="."> |
<target name="-init" if="deploy.ant.enabled"> |
@@ -27,17 +27,19 @@ |
endorsed.classpath=\ |
${libs.javaee-endorsed-api-6.0.classpath} |
excludes= |
+file.reference.oms-3.5.jar=lib/oms-3.5.jar |
includes=** |
j2ee.compile.on.save=false |
j2ee.copy.static.files.on.save=true |
j2ee.deploy.on.save=false |
j2ee.platform=1.6-web |
-j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.4.2.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar |
+j2ee.platform.classpath=${j2ee.server.home}/lib/annotations-api.jar:${j2ee.server.home}/lib/catalina-ant.jar:${j2ee.server.home}/lib/catalina-ha.jar:${j2ee.server.home}/lib/catalina-storeconfig.jar:${j2ee.server.home}/lib/catalina-tribes.jar:${j2ee.server.home}/lib/catalina.jar:${j2ee.server.home}/lib/ecj-4.6.3.jar:${j2ee.server.home}/lib/el-api.jar:${j2ee.server.home}/lib/jasper-el.jar:${j2ee.server.home}/lib/jasper.jar:${j2ee.server.home}/lib/jaspic-api.jar:${j2ee.server.home}/lib/jsp-api.jar:${j2ee.server.home}/lib/servlet-api.jar:${j2ee.server.home}/lib/tomcat-api.jar:${j2ee.server.home}/lib/tomcat-coyote.jar:${j2ee.server.home}/lib/tomcat-dbcp.jar:${j2ee.server.home}/lib/tomcat-i18n-de.jar:${j2ee.server.home}/lib/tomcat-i18n-es.jar:${j2ee.server.home}/lib/tomcat-i18n-fr.jar:${j2ee.server.home}/lib/tomcat-i18n-ja.jar:${j2ee.server.home}/lib/tomcat-i18n-ko.jar:${j2ee.server.home}/lib/tomcat-i18n-ru.jar:${j2ee.server.home}/lib/tomcat-i18n-zh-CN.jar:${j2ee.server.home}/lib/tomcat-jdbc.jar:${j2ee.server.home}/lib/tomcat-jni.jar:${j2ee.server.home}/lib/tomcat-util-scan.jar:${j2ee.server.home}/lib/tomcat-util.jar:${j2ee.server.home}/lib/tomcat-websocket.jar:${j2ee.server.home}/lib/websocket-api.jar |
j2ee.server.type=Tomcat |
jar.compress=false |
javac.classpath=\ |
${reference.csip-core.jar}:\ |
- ${libs.CSIP-Jersey-2.16.classpath} |
+ ${libs.CSIP-Jersey-2.16.classpath}:\ |
+ ${file.reference.oms-3.5.jar} |
# Space-separated list of extra javac options |
javac.compilerargs= |
javac.debug=true |
@@ -5,7 +5,7 @@ |
package m.oms.ages; |
|
import csip.ModelDataService; |
-import csip.ServiceException; |
+import csip.api.server.ServiceException; |
import csip.annotations.*; |
import static csip.annotations.ResourceType.*; |
import java.io.File; |
@@ -308,7 +308,7 @@ |
Utils.passOptQuotedParam(agesParam, parameter(), flags); |
|
// create parameter include file |
- Utils.createParamInclude(agesParam, getWorkspaceFile(RUN_INC)); |
+ Utils.createParamInclude(agesParam, workspace().getFile(RUN_INC)); |
|
String start = parameter().getString(PAR_STARTTIME); |
String end = parameter().getString(PAR_ENDTIME); |
@@ -319,13 +319,13 @@ |
|
File d = new File(dsl); |
if (!(d.isAbsolute() && d.exists())) { |
- d = getWorkspaceFile(dsl); |
+ d = workspace().getFile(dsl); |
} |
|
- getWorkspaceFile("output").mkdirs(); |
- getWorkspaceFile("logs").mkdirs(); |
+ workspace().getFile("output").mkdirs(); |
+ workspace().getFile("logs").mkdirs(); |
|
- Utils.runAges(d, getWorkspaceDir(), parameter(), resources(), LOG); |
+ Utils.runAges(d, workspace().getDir(), parameter(), resources(), LOG); |
|
for (String namee : parameter().getNames()) { |
for (String ofNameM : getRequestedObjfunc(OF.keySet())) { |
@@ -354,10 +354,10 @@ |
String new_string = "/tmp/csip/bin/ages/data/" + data_folder; |
obsData = Utils.getData(obs, new File(new_string), start, end); |
} else { |
- obsData = Utils.getData(obs, getWorkspaceDir(), start, end); |
+ obsData = Utils.getData(obs, workspace().getDir(), start, end); |
} |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
- double[] simData = Utils.getData(sim, getWorkspaceDir(), start, end); |
+ double[] simData = Utils.getData(sim, workspace().getDir(), start, end); |
double result = of.calculate(obsData, simData, parameter().getDouble("missing", -9999d)); |
return checkForNaN(result); |
} |
@@ -4,9 +4,9 @@ |
*/ |
package m.oms.dsl; |
|
-import csip.Executable; |
+import csip.api.server.Executable; |
import csip.ModelDataService; |
-import csip.ServiceException; |
+import csip.api.server.ServiceException; |
import csip.annotations.*; |
import csip.utils.Binaries; |
//import csip.utils.ZipFiles; |
@@ -17,7 +17,7 @@ |
import java.util.Map; |
import javax.ws.rs.Path; |
import org.apache.commons.io.FileUtils; |
-import org.apache.commons.lang.ArrayUtils; |
+import org.apache.commons.lang3.ArrayUtils; |
|
/** |
* OMS service. |
@@ -53,25 +53,25 @@ |
|
@Override |
protected void postProcess() throws Exception { |
-// ZipFiles.zip(getWorkspaceFile("output")); |
-// results().put(new File(getWorkspaceDir(), "output")); |
- results().put(getWorkspaceFile("output")); |
+// ZipFiles.zip(workspace().getFile("output")); |
+// results().put(new File(workspace().getDir(), "output")); |
+ results().put(workspace().getFile("output")); |
} |
|
|
private void runSim(String dsl, String loglevel, String options) throws Exception { |
Map sysprops = new HashMap(); |
- sysprops.put("oms3.work", getWorkspaceDir().toString()); |
+ sysprops.put("oms3.work", workspace().getDir().toString()); |
sysprops.put("oms.csip.server", "true"); |
|
- getWorkspaceFile("output").mkdirs(); |
+ workspace().getFile("output").mkdirs(); |
|
// Create a Process. |
Executable p = createProcess(loglevel, dsl, sysprops, options); |
|
int result = p.exec(); |
if (result != 0) { |
- File err = getWorkspaceFile("java-stderr.txt"); |
+ File err = workspace().getFile("java-stderr.txt"); |
if (err.exists()) { |
throw new ServiceException(FileUtils.readFileToString(err)); |
} |
@@ -82,15 +82,15 @@ |
|
private Executable createProcess(String loglevel, String dsl, |
Map<String, String> sysprops, String options) throws Exception { |
- File ws = getWorkspaceDir(); |
+ File ws = workspace().getDir(); |
List<File> jars = new ArrayList<>(); |
jars.add(resources().getFile("oms_jar")); |
jars.add(resources().getFile("jfreechart_jar")); |
jars.add(resources().getFile("groovy_jar")); |
jars.add(resources().getFile("jcommon_jar")); |
|
- jars.addAll(Binaries.getJars(getWorkspaceFile("dist"))); |
- jars.addAll(Binaries.getJars(getWorkspaceFile("lib"))); |
+ jars.addAll(Binaries.getJars(workspace().getFile("dist"))); |
+ jars.addAll(Binaries.getJars(workspace().getFile("lib"))); |
jars.addAll(Binaries.getJars(ws)); |
|
String[] sp = Binaries.asSysProps(sysprops); |
@@ -98,6 +98,6 @@ |
String[] opt = options.split("\\s+"); |
sp = (String[]) ArrayUtils.addAll(sp, opt); |
} |
- return Binaries.getResourceOMSDSL(getWorkspaceFile(dsl), sp, ws, jars, loglevel, LOG); |
+ return Binaries.getResourceOMSDSL(workspace().getFile(dsl), sp, ws, jars, loglevel, LOG); |
} |
} |
@@ -5,10 +5,10 @@ |
*/ |
package oms.utils; |
|
-import csip.Executable; |
-import csip.PayloadParameter; |
-import csip.ServiceException; |
-import csip.ServiceResources; |
+import csip.api.server.Executable; |
+import csip.api.server.PayloadParameter; |
+import csip.api.server.ServiceException; |
+import csip.api.server.ServiceResources; |
import csip.SessionLogger; |
import csip.utils.Binaries; |
import java.io.File; |
@@ -22,7 +22,7 @@ |
import oms3.io.CSTable; |
import oms3.io.DataIO; |
import org.apache.commons.io.FileUtils; |
-import org.apache.commons.lang.ArrayUtils; |
+import org.apache.commons.lang3.ArrayUtils; |
|
/** |
* |
@@ -231,7 +231,7 @@ |
* @param p |
* @param param |
* @param names |
- * @throws csip.ServiceException |
+ * @throws csip.api.server.ServiceException |
*/ |
public static void passReqQuotedParam(Map<String, String> p, |
PayloadParameter param, String... names) throws ServiceException { |
@@ -246,7 +246,7 @@ |
* @param p |
* @param param |
* @param names |
- * @throws csip.ServiceException |
+ * @throws csip.api.server.ServiceException |
*/ |
public static void passOptParam(Map<String, String> p, |
PayloadParameter param, String... names) throws ServiceException { |