@@ -20,30 +20,18 @@ |
</target> |
<target name="-deploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials"> |
<echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/> |
- <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"> |
- <classpath> |
- <pathelement path="${tomcat.home}/lib/catalina-ant.jar"/> |
- <pathelement path="${tomcat.home}/lib/tomcat-coyote.jar"/> |
- <pathelement path="${tomcat.home}/lib/tomcat-util.jar"/> |
- <pathelement path="${tomcat.home}/bin/tomcat-juli.jar"/> |
- </classpath> |
- </taskdef> |
- <deploy url="${tomcat.url}/manager/text" username="${tomcat.username}" |
+ <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" |
+ classpath="${tomcat.home}/server/lib/catalina-ant.jar"/> |
+ <deploy url="${tomcat.url}/manager" username="${tomcat.username}" |
password="${tomcat.password}" path="${Context(path)}" |
war="${deploy.ant.archive}"/> |
<property name="deploy.ant.client.url" value="${tomcat.url}${Context(path)}"/> |
</target> |
<target name="-undeploy-ant" if="deploy.ant.enabled" depends="-init,-check-credentials"> |
<echo message="Undeploying ${Context(path)}"/> |
- <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"> |
- <classpath> |
- <pathelement path="${tomcat.home}/lib/catalina-ant.jar"/> |
- <pathelement path="${tomcat.home}/lib/tomcat-coyote.jar"/> |
- <pathelement path="${tomcat.home}/lib/tomcat-util.jar"/> |
- <pathelement path="${tomcat.home}/bin/tomcat-juli.jar"/> |
- </classpath> |
- </taskdef> |
- <undeploy url="${tomcat.url}/manager/text" username="${tomcat.username}" |
+ <taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" |
+ classpath="${tomcat.home}/server/lib/catalina-ant.jar"/> |
+ <undeploy url="${tomcat.url}/manager" username="${tomcat.username}" |
password="${tomcat.password}" path="${Context(path)}"/> |
</target> |
</project> |
@@ -102,6 +102,7 @@ |
double r2sci_er = 0.0; |
|
File[] dummy = new File[0]; // the client function should check for null array. |
+ JSONObject syncRequest = JSONUtils.clone(getRequest()); |
if (JSONUtils.checkKeyExistsB(getParamMap(), KEY_LENGTH) |
&& JSONUtils.checkKeyExistsB(getParamMap(), KEY_STEEPNESS)) { |
// do a r2 call >>> |
@@ -113,14 +114,16 @@ |
req_results.put(RES_SLOPE_DELIVERY); |
req_results.put(RES_SLOPE_T_VALUE); |
req_results.put(RES_SLOPE_DEGRAD); |
- getRequest().getJSONObject(KEY_METAINFO).put(KEY_REQUEST_RESULTS, req_results); |
- getRequest().getJSONObject(KEY_METAINFO).put(KEY_MODE, SYNC); |
+ syncRequest.getJSONObject(KEY_METAINFO).put(KEY_MODE, SYNC); |
+ syncRequest.getJSONObject(KEY_METAINFO).put(KEY_REQUEST_RESULTS, req_results); |
//LOG.info("This is the request =) : "+getRequest().toString()); |
//String url = Config.getString("codebase.url", "bad")+"/csip-erosion/m/rusle2/1.2"; |
//LOG.info(url); |
LOG.info("STARTING RUSLE2"); |
+ LOG.info("R2 Request" + syncRequest); |
//JSONObject r2Response = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/rusle2/1.2", getRequest(), dummy); |
- JSONObject r2Response = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/rusle2/1.3", getRequest()); |
+ JSONObject r2Response = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/rusle2/1.3", syncRequest); |
+ LOG.info("R2 Response "+ syncRequest); |
|
Map<String, JSONObject> r2Results = JSONUtils.preprocess(r2Response.getJSONArray(KEY_RESULT)); |
|
@@ -148,20 +151,20 @@ |
|
LOG.info("The soil is: " + wepsSoil.toString()); |
//getParamMap().put(WEPS_KEY_SOIL, wepsSoil); |
- getRequest().getJSONArray(KEY_PARAMETER).put(wepsSoil); |
+ syncRequest.getJSONArray(KEY_PARAMETER).put(wepsSoil); |
} |
if (!JSONUtils.checkKeyExistsB(getParamMap(), WEPS_KEY_MANAGEMENT)) { |
|
JSONObject lmodweps = (JSONObject) JSONUtils.getJSONArrayParam(getParamMap(), KEY_MGMTS).get(0); |
JSONObject lmodwepsobj = JSONUtils.data(WEPS_KEY_MANAGEMENT, lmodweps); |
//getParamMap().put(WEPS_KEY_MANAGEMENT, lmodwepsobj); |
- getRequest().getJSONArray(KEY_PARAMETER).put(lmodwepsobj); |
+ syncRequest.getJSONArray(KEY_PARAMETER).put(lmodwepsobj); |
} |
|
LOG.info("Trying to invoke WEPS for SCI"); |
|
//JSONObject wepsResponse = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/weps/1.2", getRequest(), dummy); |
- JSONObject wepsResponse = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/weps/1.3", getRequest()); |
+ JSONObject wepsResponse = new Client(LOG).doPOST("http://localhost:8080/csip-erosion/m/weps/1.3", syncRequest); |
|
|
Map<String, JSONObject> wepsResults = JSONUtils.preprocess(wepsResponse.getJSONArray(KEY_RESULT)); |