Ported Cherry partially to new API
diff --git a/asterix-examples/src/main/resources/cherry/examples/cherry.html b/asterix-examples/src/main/resources/cherry/examples/cherry.html
index 42a3bc3..8e37cfe 100755
--- a/asterix-examples/src/main/resources/cherry/examples/cherry.html
+++ b/asterix-examples/src/main/resources/cherry/examples/cherry.html
@@ -17,6 +17,9 @@
<script src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/geostats.js" ></script>
+
+ <script src="../../core/js/easyXDM/easyXDM.debug.js"></script>
+ <script src="http://localhost:19101/sdk/static/js/asterix-api-core.js"></script>
<script src="../js/asterix-api-core.js" type="text/javascript"></script>
<script src="../js/cherry.js" type="text/javascript"></script>
<style type="text/css">
diff --git a/asterix-examples/src/main/resources/cherry/js/asterix-api-core.js b/asterix-examples/src/main/resources/cherry/js/asterix-api-core.js
index 13c32b3..e5d64eb 100755
--- a/asterix-examples/src/main/resources/cherry/js/asterix-api-core.js
+++ b/asterix-examples/src/main/resources/cherry/js/asterix-api-core.js
@@ -400,36 +400,54 @@
* @param {Object} extra, any extra stuff passed from UI [TEMPORARY]
*/
AsterixCoreAPI.prototype.api_helper_proxy_handler = function(json, callback, extra) {
- var api = this;
- $.ajax({
- type : 'POST',
- url: "ajaxFacadeCherry.php",
- data: json,
- dataType: "json",
- success: function(data) {
-
- var response = $.parseJSON(data[0]);
- if (response && response["error-code"]) {
-
- api.api_helper_default_on_error( response["error-code"][0], response["error-code"][1] );
-
- } else if (response && response["results"]) {
-
- var fn_callback = callback["sync"];
- fn_callback(data, api.extra);
-
- } else if (response["handle"]) {
-
- var fn_callback = callback["async"];
- fn_callback(data, api.extra);
-
- } else if (response["status"]) {
- var fn_callback = callback["sync"];
- fn_callback(data, api.extra);
- }
- }
- });
+ /*var callbacks = {
+ "sync" : api.ui_callback_on_success,
+ "async" : api.ui_callback_on_success_async
+ };
+ var json = {
+ "endpoint" : "http://localhost:19101/query",
+ "query" : use_dataverse + api.parameters["statements"].join("\n"),
+ "mode" : api.parameters["mode"]
+ };*/
+ var as = new AsterixSDK();
+ api = this;
+
+ var branch = function(response) {
+
+ if (response && response["error-code"]) {
+
+ api.api_helper_default_on_error( response["error-code"][0], response["error-code"][1] );
+
+ } else if (response && response["results"]) {
+ var fn_callback = callback["sync"];
+ fn_callback(response, extra);
+
+ } else if (response["handle"]) {
+
+ var fn_callback = callback["async"];
+ fn_callback(response, extra);
+
+ } else if (response["status"]) {
+
+ var fn_callback = callback["sync"];
+ fn_callback(response, extra);
+ }
+ };
+
+ var c = {
+ "onSend" : function() {
+ return {
+ "endpoint" : json["endpoint"],
+ "apiData" : {
+ "query" : json["query"],
+ "mode" : json["mode"]
+ },
+ "callback" : branch
+ };
+ }
+ };
+ as.send(c);
}
/**
diff --git a/asterix-examples/src/main/resources/cherry/js/cherry.js b/asterix-examples/src/main/resources/cherry/js/cherry.js
index 97625c5..8dd4524 100755
--- a/asterix-examples/src/main/resources/cherry/js/cherry.js
+++ b/asterix-examples/src/main/resources/cherry/js/cherry.js
@@ -417,8 +417,7 @@
* @param {Object} extra, extra data passed from the API call - legacy stuff
*/
function cherryQuerySyncCallback(res, extra) {
- var response = $.parseJSON(res[0]);
- records = response["results"];
+ records = res["results"];
var coordinates = [];
var weights = [];
diff --git a/asterix-examples/src/main/resources/js/easyXDM/MIT-license.txt b/asterix-examples/src/main/resources/core/js/easyXDM/MIT-license.txt
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/MIT-license.txt
rename to asterix-examples/src/main/resources/core/js/easyXDM/MIT-license.txt
diff --git a/asterix-examples/src/main/resources/js/easyXDM/cors/index.html b/asterix-examples/src/main/resources/core/js/easyXDM/cors/index.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/cors/index.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/cors/index.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM-2.4.17.1.zip b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM-2.4.17.1.zip
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM-2.4.17.1.zip
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM-2.4.17.1.zip
Binary files differ
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.debug.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.debug.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.debug.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.debug.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.min.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.min.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.Widgets.min.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.Widgets.min.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.debug.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.debug.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.debug.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.debug.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyXDM.min.js b/asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.min.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyXDM.min.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyXDM.min.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/easyxdm.swf b/asterix-examples/src/main/resources/core/js/easyXDM/easyxdm.swf
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/easyxdm.swf
rename to asterix-examples/src/main/resources/core/js/easyXDM/easyxdm.swf
Binary files differ
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/blank.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/blank.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/blank.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/blank.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/bookmark.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/bookmark.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/bookmark.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/bookmark.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/bookmark.js b/asterix-examples/src/main/resources/core/js/easyXDM/example/bookmark.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/bookmark.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/bookmark.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/bridge.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/bridge.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/bridge.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/bridge.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/data.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/data.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/data.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/data.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/glossary.aspx b/asterix-examples/src/main/resources/core/js/easyXDM/example/glossary.aspx
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/glossary.aspx
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/glossary.aspx
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/index.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/index.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/index.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/index.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/methods.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/methods.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/methods.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/methods.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remote.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remote.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remote.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remote.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remoteapp.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remoteapp.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remoteapp.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remoteapp.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remotedata.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remotedata.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remotedata.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remotedata.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remotemethods.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remotemethods.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remotemethods.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remotemethods.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remoterpcbackend.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remoterpcbackend.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remoterpcbackend.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remoterpcbackend.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/remotetransport.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/remotetransport.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/remotetransport.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/remotetransport.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/resize_iframe.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/resize_iframe.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/resize_iframe.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/resize_iframe.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/resize_intermediate.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/resize_intermediate.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/resize_intermediate.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/resize_intermediate.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/resized_iframe_1.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/resized_iframe_1.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/resized_iframe_1.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/resized_iframe_1.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/resized_iframe_2.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/resized_iframe_2.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/resized_iframe_2.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/resized_iframe_2.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/transport.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/transport.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/transport.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/transport.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/upload.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/upload.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/upload.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/upload.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/upload_handler.aspx b/asterix-examples/src/main/resources/core/js/easyXDM/example/upload_handler.aspx
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/upload_handler.aspx
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/upload_handler.aspx
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/upload_rpc.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/upload_rpc.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/upload_rpc.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/upload_rpc.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/widget.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/widget.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/widget.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/widget.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/widgets.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/widgets.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/widgets.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/widgets.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/example/xhr.html b/asterix-examples/src/main/resources/core/js/easyXDM/example/xhr.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/example/xhr.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/example/xhr.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/json2.js b/asterix-examples/src/main/resources/core/js/easyXDM/json2.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/json2.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/json2.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/name.html b/asterix-examples/src/main/resources/core/js/easyXDM/name.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/name.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/name.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/easyTest.css b/asterix-examples/src/main/resources/core/js/easyXDM/tests/easyTest.css
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/easyTest.css
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/easyTest.css
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/easyTest.js b/asterix-examples/src/main/resources/core/js/easyXDM/tests/easyTest.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/easyTest.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/easyTest.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/easyXDM.debug.js b/asterix-examples/src/main/resources/core/js/easyXDM/tests/easyXDM.debug.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/easyXDM.debug.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/easyXDM.debug.js
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/index.html b/asterix-examples/src/main/resources/core/js/easyXDM/tests/index.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/index.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/index.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/s.gif b/asterix-examples/src/main/resources/core/js/easyXDM/tests/s.gif
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/s.gif
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/s.gif
Binary files differ
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/test_namespace.html b/asterix-examples/src/main/resources/core/js/easyXDM/tests/test_namespace.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/test_namespace.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/test_namespace.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/test_rpc.html b/asterix-examples/src/main/resources/core/js/easyXDM/tests/test_rpc.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/test_rpc.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/test_rpc.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/test_transport.html b/asterix-examples/src/main/resources/core/js/easyXDM/tests/test_transport.html
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/test_transport.html
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/test_transport.html
diff --git a/asterix-examples/src/main/resources/js/easyXDM/tests/tests.js b/asterix-examples/src/main/resources/core/js/easyXDM/tests/tests.js
similarity index 100%
rename from asterix-examples/src/main/resources/js/easyXDM/tests/tests.js
rename to asterix-examples/src/main/resources/core/js/easyXDM/tests/tests.js