fix query_all
authorAnthony Garcia <anthony.garcia@inria.fr>
Fri, 27 Sep 2013 14:46:31 +0000 (16:46 +0200)
committerAnthony Garcia <anthony.garcia@inria.fr>
Fri, 27 Sep 2013 14:46:31 +0000 (16:46 +0200)
plugins/senslabmap/senslabmap.py
plugins/senslabmap/static/js/senslabmap.js

index 73c767d..22c2060 100644 (file)
@@ -5,9 +5,11 @@ class SensLabMap (Plugin):
     # set checkboxes if a final column with checkboxes is desired
     # pass columns as the initial set of columns
     #   if None then this is taken from the query's fields
-    def __init__ (self, query, **settings):
+    def __init__ (self, query, query_all, **settings):
         Plugin.__init__ (self, **settings)
-        self.query=query
+        self.query = query
+        self.query_all = query_all
+        self.query_all_uuid = query_all.query_uuid
 
     def template_file (self):
         return "senslabmap.html"
@@ -28,4 +30,4 @@ class SensLabMap (Plugin):
         return reqs
 
     # the list of things passed to the js plugin
-    def json_settings_list (self): return ['plugin_uuid','query_uuid']
+    def json_settings_list (self): return ['plugin_uuid', 'dom_id', 'query_uuid', 'query_all_uuid']
index eb3acd2..71de05a 100644 (file)
@@ -3,48 +3,63 @@
     init: function(options, element) {
       this._super(options, element);
       
-      /* Member variables */
-      // query status
-      this.received_all = false;
-      this.received_set = false;
-      this.in_set_buffer = Array();
+      this.elmt().on('show', this, this.on_show);
       
-      var query = manifold.query_store.find_analyzed_query(options.query_uuid);
       this.method = query.object;
       
-      var keys = manifold.metadata.get_key(this.method);
-      this.key = (keys && keys.length == 1) ? keys[0] : null;
-      
       /* Setup query and record handlers */
       this.listen_query(options.query_uuid);
-      this.listen_query(options.query_uuid, 'all');
-      
+      this.listen_query(options.query_all_uuid, 'all');
+
       /* GUI setup and event binding */
       this.initialize_map();
     },
     
     initialize_map: function() {
+      console.log("init toto");
       // TODO: this is static, retrieve directly nodes
       nodes = nodes_gre;
       init();
       parseNodebox();
     },
+
+    refresh: function() {
+      console.log("refresh");
+      myrender();
+    },
     
     on_show: function(e) {
-      // TODO
+      /* GUI setup and event binding */
+      e.data.refresh();
     },
     
-    on_filter_added: function(filter) {
-      console.log(filter);
+    on_all_new_record: function(record) {
+      console.log("All New Record : " + record);
     },
     
     on_new_record: function(record) {
-      console.log(record);
+      console.log("New Record : " + record);
+    },
+
+    on_query_in_progress: function()
+    {
+      console.log('on_query_in_progress');
     },
     
-    on_record_received: function(record) {
-      console.log(record);
+    on_query_done: function()
+    {
+      console.log('on_query_done');
+    },
+
+    on_all_query_in_progress: function()
+    {
+      console.log('on_all_query_in_progress');
     },
+    
+    on_all_query_done: function()
+    {
+      console.log('on_all_query_done');
+    }
   });
   $.plugin('SensLabMap', SensLabMap);
 })(jQuery);