awips2/edexOsgi/com.raytheon.edex.uengine/scripts/applicationExecute.js
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

41 lines
No EOL
1.1 KiB
JavaScript

/* class constructor */
function ExecuteApplication() {
this.timeout = 10;
this.command = "";
}
/* main action method */
function _execute() {
var executer = new ExecuteCommand(this.command,this.timeout);
var result = executer.execute();
return this.makeAsciiResponse(executer.execute());;
}
/* generates the ascii response */
function _makeAsciiResponse(result) {
var response = new Array();
var makeResponse = new MakeResponseXml(result);
response[0] = makeResponse.execute();
return response;
}
/* class setters */
function _setTimeOut(time) {
this.timeout = time * 1000;
}
function _setCommandLine(commandLine) {
this.command = commandLine;
}
/* add methods to class */
ExecuteApplication.prototype.execute = _execute;
ExecuteApplication.prototype.setTimeOut = _setTimeOut;
ExecuteApplication.prototype.setCommandLine = _setCommandLine;
ExecuteApplication.prototype.makeAsciiResponse = _makeAsciiResponse;
/* short form of the script */
var runner = new ExecuteApplication();
runner.setTimeOut(10000);
/* for EDEX on Windows, change 'ps' to 'ipconfig' */
runner.setCommandLine("ps");
runner.execute();