Stable API for beta + legacy queries functional on Cherry
diff --git a/asterix-examples/src/main/resources/cherry/js/cherry.js b/asterix-examples/src/main/resources/cherry/js/cherry.js
index 8dd4524..0715ffe 100755
--- a/asterix-examples/src/main/resources/cherry/js/cherry.js
+++ b/asterix-examples/src/main/resources/cherry/js/cherry.js
@@ -1,5 +1,7 @@
$(function() {
+ APIHandler = new AsterixSDK();
+
APIqueryTracker = {};
drilldown_data_map = {};
drilldown_data_map_vals = {};
@@ -252,17 +254,21 @@
})
.aql_return({ "cell" : "$c", "count" : "count($t)" });
- // Here is an actual API call.
- var asterixAPICall = new AsterixCoreAPI()
- .dataverse("twitter")
- .statements(buildCherryQuery.parameters["statements"])
- .mode(build_cherry_mode)
- .success(cherryQuerySyncCallback, true)
- .success(cherryQueryAsyncCallback, false)
- .add_extra("payload", formData) // Legacy
- .add_extra("query_string", buildCherryQuery.parameters["statements"].join(" ")) // Legacy
- .api_core_query();
-
+ var l = new LegacyExpression();
+ l.extra({
+ "payload" : formData,
+ "query_string" : "use dataverse twitter;\n" + buildCherryQuery.parameters["statements"].join("\n")
+ });
+ l.set(buildCherryQuery.parameters["statements"].join("\n"));
+ l.success(cherryQuerySyncCallback, true);
+ l.success(cherryQueryAsyncCallback, false);
+
+ l.send("http://localhost:19101/query",
+ {
+ "query" : "use dataverse twitter;\n" + buildCherryQuery.parameters["statements"].join("\n"),
+ "mode" : build_cherry_mode,
+ });
+
APIqueryTracker = {
"query" : buildCherryQuery.parameters["statements"].join("\n"),
"data" : formData
diff --git a/asterix-examples/src/main/resources/html/example.html b/asterix-examples/src/main/resources/html/example.html
index 01f6ed0..f0373ff 100644
--- a/asterix-examples/src/main/resources/html/example.html
+++ b/asterix-examples/src/main/resources/html/example.html
@@ -11,6 +11,8 @@
var c = new CreateExpression(tinySocialCreate.join("\n"));
as.send(c);
+ var as = new AsterixSDK();
+
$('#ddl').html(tinySocialCreate.join("<br/>"));
});
</script>