123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- /**
- * WAS에서 전달받는 XML용 Result Object result.xml 참조
- *
- * getType() : success|select|valueobject|rowset|xml
- */
- function Result(p_type, p_requestUri, p_requestEvent) {
- this.type = p_type;
- this.getType = function() {
- return this.type;
- };
- this.setType = function(p_type) {
- this.type = p_type;
- };
- this.requestUri = p_requestUri;
- this.getRequestUri = function() {
- return this.requestUri;
- };
- this.setRequestUri = function(p_requestUri) {
- this.requestUri = p_requestUri;
- };
- this.requestEvent = p_requestEvent;
- this.getRequestEvent = function() {
- return this.requestEvent;
- };
- this.setRequestEvent = function(p_requestEvent) {
- this.requestEvent = p_requestEvent;
- };
- this.requestParameter = "";
- this.getRequestParameter = function() {
- return this.requestParameter;
- };
- this.setRequestParameter = function(p_requestParameter) {
- this.requestParameter = p_requestParameter;
- };
- this.success = false;
- this.getSuccess = function() {
- return this.success;
- };
- this.setSuccess = function(p_success) {
- this.success = p_success;
- };
- this.message = "";
- this.getMessage = function() {
- return this.message;
- };
- this.setMessage = function(p_message) {
- this.message = p_message;
- };
- this.detailMessage = "";
- this.getDetailMessage = function() {
- return this.detailMessage;
- };
- this.setDetailMessage = function(p_detailMessage) {
- this.detailMessage = p_detailMessage;
- };
- this.select_vo = null;
- this.getSelect = function() {
- return this.select_vo;
- };
- this.setSelect = function(p_select_vo) {
- this.select_vo = p_select_vo;
- };
-
- this.vo = null;
- this.getValueObject = function() {
- return this.vo;
- };
- this.setValueObject = function(p_vo) {
- this.vo = p_vo;
- };
- this.rowset = null;
- this.getRowSet = function() {
- return this.rowset;
- };
- this.setRowSet = function(p_rowset) {
- this.rowset = p_rowset;
- };
- this.xml = "";
- this.getXml = function() {
- return this.xml;
- };
- this.setXml = function(p_xml) {
- this.xml = p_xml;
- };
- this.toString = function() {
- var msg = "Result Object : \n\n" + "type=" + this.type + "\n"
- + "requestUri=" + this.requestUri + "\n" + "requestEvent="
- + this.requestEvent + "\n" + "success=" + this.success + "\n"
- + "message=" + this.message + "\n" + "requestParameter="
- + this.requestParameter + "\n";
- if (this.type == "xml") {
- msg += +"xml=" + this.xml + "\n";
- }
- return msg;
- };
- }
- function ValueObject() {
- this.keyArray = new Array();
- this.valueArray = new Array();
- this.getSize = function() {
- return this.keyArray.length;
- };
- this.getKeyArray = function() {
- return this.keyArray;
- };
- this.getValueArray = function() {
- return this.valueArray;
- };
- this.set = function(p_key, p_value) {
- this.keyArray[this.keyArray.length] = p_key;
- this.valueArray[this.valueArray.length] = p_value;
- };
- this.getValue = function(p_index) {
- return this.valueArray[p_index];
- };
- this.getKey = function(p_index) {
- return this.keyArray[p_index];
- };
- this.get = function(p_key) {
- for (var i = 0; i < this.getSize(); i++) {
- if (this.getKey(i).toLowerCase() == p_key.toLowerCase()) {
- return this.getValue(i);
- }
- }
- return "";
- };
- }
- function RowSet() {
- this.rowArray = new Array();
- this.getRowSize = function() {
- return this.rowArray.length;
- }
- this.getColSize = function() {
- if (this.rowArray.length == 0)
- return 0;
- else
- return this.rowArray[0].getSize();
- }
- this.setRow = function(p_row) {
- this.rowArray[this.rowArray.length] = p_row;
- }
- this.getRow = function(p_rowIndex) {
- return this.rowArray[p_rowIndex];
- }
- this.getColName = function(p_col_index) {
- if (this.rowArray.length == 0)
- return null;
- else
- return this.rowArray[0].getName(p_col_index);
- }
- this.getColValue = function(p_row_index, p_col_index) {
- if (this.rowArray.length == 0)
- return "";
- else {
- if (p_row_index < this.getRowSize())
- return this.rowArray[p_row_index].getValue(p_col_index);
- else
- return null;
- }
- }
- }
- function Row() {
- this.nameArray = new Array();
- this.valueArray = new Array();
- this.getSize = function() {
- return this.nameArray.length;
- };
- this.getNameArray = function() {
- return this.nameArray;
- };
- this.getValueArray = function() {
- return this.valueArray;
- };
- this.set = function(p_name, p_value) {
- this.nameArray[this.nameArray.length] = p_name;
- this.valueArray[this.valueArray.length] = p_value;
- };
- this.getValue = function(p_index) {
- return this.valueArray[p_index];
- };
- this.getName = function(p_index) {
- return this.nameArray[p_index];
- };
- this.get = function(p_name) {
- for (var i = 0; i < this.getSize(); i++) {
- if (this.getName(i) == p_name) {
- return this.getValue(i);
- }
- }
- return null;
- };
- this.toString = function() {
- var msg = "Row Object : \n\n";
- for (var i = 0; i < this.getSize(); i++) {
- msg += i + " : " + this.getName(i) + "=" + this.getValue(i) + "\n";
- }
- return msg;
- };
- }
|