diff --git a/o2web/source/x_component_Common/Actions/RestActions.js b/o2web/source/x_component_Common/Actions/RestActions.js deleted file mode 100644 index 5258a8b1ebc3be18dc4420027a523346a9ba8c85..0000000000000000000000000000000000000000 --- a/o2web/source/x_component_Common/Actions/RestActions.js +++ /dev/null @@ -1,113 +0,0 @@ -MWF.xApplication.Common.Actions = MWF.xApplication.Common.Actions || {}; -MWF.xApplication.Common.Actions.RestActions = new Class({ - initialize: function(){ - - this.designAddress = ""; - MWF.getJSON("../x_component_Common/Actions/properties.jsp", function(json){ - this.actions = json; - }.bind(this), false); - }, - - listApplicationAddress: function(success, failure){ - var url = this.actions.listAddress; - url = this.actions.slotHost+url; - var callback = new MWF.xApplication.Common.Actions.RestActions.Callback(success, failure); - MWF.getJSON(url, callback); - }, - - getDesignAddress: function(success, failure){ -// var name = "x_processplatform_core_designer"; -// var url = this.actions.getAddress.replace(/{id}/g, name); -// url = this.actions.slotHost+url; -// var callback = new MWF.process.RestActions.Callback(success, failure, function(data){ -// this.designAddress = data.data.url; -// }.bind(this)); - -// MWF.getJSON(url, callback); - - this.designAddress = "http://xa01.zoneland.net:9080/x_processplatform_assemble_designer"; - //this.designAddress = "http://localhost:9080/x_processplatform_front_designer"; - if (success) success.apply(); - }, - - request: function(success, failure, type, arg){ - if (this.designAddress){ - this["_"+type](success, failure, arg); - }else{ - this.getDesignAddress(function(data){ - this["_"+type](success, failure, arg); - }.bind(this), failure); - } - }, - - _getId: function(success, failure, count){ - var url = this.designAddress+this.actions.getId; - url = url.replace(/{count}/g, count); - var callback = new MWF.xApplication.Common.Actions.RestActions.Callback(success, failure); - MWF.getJSON(url, callback); - }, - - getId: function(count, success, failure){ - this.request(success, failure, "getId", count); - }, - getUUID: function(){ - if (!this.designAddress) this.getDesignAddress(); - var url = this.designAddress+this.actions.getId; - url = url.replace(/{count}/g, "1"); - var id = ""; - var callback = new MWF.xApplication.Common.Actions.RestActions.Callback(function(ids){ - id = ids.data[0].id; - }, null); - MWF.getJSON(url, callback, false); - return id; - } -}); - -MWF.xApplication.Common.Actions.RestActions.Callback = new Class({ - initialize: function(success, failure, appendSuccess, appendFailure){ - this.success = success; - this.failure = failure; - this.appendSuccess = appendSuccess; - this.appendFailure = appendFailure; - }, - - onSuccess: function(responseJSON, responseText){ - - switch(responseJSON.type) { - case "success": - if (this.appendSuccess) this.appendSuccess(responseJSON); - if (this.success) this.success(responseJSON); - break; - case "warn": - MWF.xDesktop.notice("info", {x: "right", y:"top"}, responseJSON.errorMessage.join("\n")); - - if (this.appendSuccess) this.appendSuccess(responseJSON); - if (this.success) this.success(responseJSON); - break; - case "error": - this.doError(null, responseText, responseJSON.message); - break; - } - }, - onRequestFailure: function(xhr){ - this.doError(xhr, "", ""); - }, - onFailure: function(xhr){ - this.doError(xhr, "", ""); - }, - onError: function(text, error){ - this.doError(null, text, error); - }, - doError: function(xhr, text, error){ - - if (this.appendFailure) this.appendFailure(xhr, text, error); - if (this.failure) this.failure(xhr, text, error); - if (!this.failure && !this.appendFailure){ - - var errorText = error; - if (xhr) errorText = xhr.responseText; - MWF.xDesktop.notice("error", {x: "right", y:"top"}, "request json error: "+errorText); - // throw "request error: "+errorText; - } - } -}); diff --git a/o2web/source/x_component_Common/Actions/properties.jsp b/o2web/source/x_component_Common/Actions/properties.jsp deleted file mode 100644 index af2fdd07c35f5e31b2990f35ff2ea505ed28f5ba..0000000000000000000000000000000000000000 --- a/o2web/source/x_component_Common/Actions/properties.jsp +++ /dev/null @@ -1,14 +0,0 @@ -<%@ page language="java" contentType="application/json; charset=UTF-8" import="java.io.FileInputStream, java.util.Properties"%> -<% - String propertiesPath = this.getClass().getClassLoader().getResource("slot_prop.properties").getPath(); - FileInputStream fis = new FileInputStream(propertiesPath); - Properties prop = new Properties(); - prop.load(fis); -%> -{ - "slotHost": "<%=prop.getProperty("platform_slot_host") %>", - "listAddress": "<%=prop.getProperty("platform_slot_list_address") %>", - "getAddress": "<%=prop.getProperty("platform_slot_get_address") %>", - "getId": "<%=prop.getProperty("platform_uuid") %>" -} -<% fis.close(); %> \ No newline at end of file