From 8a3cd1d9c2908a60de521424622dfae04ba7c297 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Tue, 14 Jun 2016 10:55:28 +0000 Subject: Menu: fetch species from gn_server --- doc/Architecture.org | 27 +++++++++++++++++----- .../static/new/javascript/dataset_select_menu.js | 21 ++++++++++++++--- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/doc/Architecture.org b/doc/Architecture.org index c263d3b9..c3b63b49 100644 --- a/doc/Architecture.org +++ b/doc/Architecture.org @@ -1,5 +1,13 @@ * GeneNetwork Architecture +#+TITLE: Installing GeneNetwork services + +* Table of Contents :TOC: + - [[#genenetwork-architecture][GeneNetwork Architecture]] + - [[#introduction][Introduction]] + - [[#webserver][Webserver]] + - [[#gnserver-rest][GnServer (REST)]] + ** Introduction This document describes the architecture of GN2. Because GN2 is @@ -7,9 +15,16 @@ evolving, only a high-level overview is given here. ** Webserver -The webserver is built on [[http://flask.pocoo.org/][Python flask]] and this GN2 source code can be -found on [[https://github.com/genenetwork/genenetwork2/tree/master/wqflask/wqflask][github]] in the wqflask directory. The routing tables are -defined in [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/views.py][views.py]]. For example the main page is loaded from a -template named [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/templates/index_page.htm][index_page.html]] in the [[https://github.com/genenetwork/genenetwork2/tree/master/wqflask/wqflask/templates][templates]] directory. In the -template you can find get the form gets filled by a Javascript -routine defined in [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/static/new/javascript/dataset_select_menu.js][data_select_menu.js]]. +The main [[https://github.com/genenetwork/genenetwork2][GN2 webserver]] is built on [[http://flask.pocoo.org/][Python flask]] and this GN2 source +code can be found on [[https://github.com/genenetwork/genenetwork2/tree/master/wqflask/wqflask][github]] in the wqflask directory. The routing +tables are defined in [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/views.py][views.py]]. For example the main page is loaded +from a template named [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/templates/index_page.htm][index_page.html]] in the [[https://github.com/genenetwork/genenetwork2/tree/master/wqflask/wqflask/templates][templates]] directory. In +the template you can find get the form gets filled by a Javascript +routine defined in [[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/wqflask/static/new/javascript/dataset_select_menu.js][data_select_menu.js]] which picks up a static JSON +file for the menu. This static file is generated with +[[https://github.com/genenetwork/genenetwork2/blob/master/wqflask/maintenance/gen_select_dataset.py][gen_select_dataset.py]]. Note that this JSON data will soon be served +by gn_server, see [[#gnserver-rest][GnServer (REST)]]. + +** GnServer (REST) + +The [[https://github.com/genenetwork/gn_server][GnServer REST API]] is built on high performance [[http://elixir-lang.org/][Elixir]] with [[https://github.com/falood/maru][Maru]]. diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js index 1fe4cf75..473e920e 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js @@ -10,10 +10,25 @@ $(function() { dataType: 'json', success: process_json }); + $.getJSON("http://localhost:8880/int/menu/species", + function(data) { + console.log("***** GOT DATA from GN_SERVER ****"); + console.log(data[0]); + var species = data.map(function(item) { + console.log(item) + menu = [item[1],item[2]] + console.log(menu) + return menu; + }); + + console.log(species); + redo_dropdown($('#species'), species); + }); + populate_species = function() { - var species_list; - species_list = this.jdata.species; - redo_dropdown($('#species'), species_list); + // var species_list; + // species_list = this.jdata.species; + // redo_dropdown($('#species'), species_list); return populate_group(); }; window.populate_species = populate_species; -- cgit v1.2.3