Changeset 1032


Ignore:
Timestamp:
01/03/11 22:41:08 (13 years ago)
Author:
gaba
Message:

withSumary

Location:
MDService2/trunk/MDService2/WebContent
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/index.jsp

    r1030 r1032  
    119119                                <input type="text" id="input-simplequery" name="_query"  />
    120120                                <input type="submit"  value="submit" id="submit-query"/>
     121                                <input type="checkbox" checked="false" id="input-withsumary" name="WS"/>
    121122                                <input type="text" id="query_list" name="_query_" />   
    122123                                <table class="cmds-ui-elem-stretch"><tr>
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r1031 r1032  
    102102}
    103103// TODO multiple collections
    104 function submit_query (columns, query, squery) {
     104function submit_query (columns, query, squery, ws) {
    105105        notifyUser("processing query");
    106106       
     
    114114        var q = new Query(collections, columns, query, squery); //actions.collections.current, query );
    115115        q.repository = getSelectedRepository();
     116        if (ws) {
     117                q.options = "withSumary";
     118        }
    116119        notifyUser("submit_query:" + q.query_uri(),'debug');
    117120        queryset.addquery(q);
     
    11281131                        notifyUser(searchclauseset.sctext,'debug');
    11291132                        //submit_query ($('#columns_list').attr("value"),searchclauseset.sctext, $('#input-simplequery').attr("value"));                       
    1130                         submit_query (columns_widget.getColumnsListText(),searchclauseset.sctext, $('#input-simplequery').attr("value"));
     1133                        submit_query (columns_widget.getColumnsListText(),searchclauseset.sctext, $('#input-simplequery').attr("value"), $('#input-withsumary').attr("checked"));
    11311134        });
    11321135
     
    11541157                var squery = "";
    11551158                var bookmark = "0";
     1159                var json_options = "null";
    11561160               
    11571161                if ($(this).parents('.result').length > 0){
     
    11651169                        json_cols = queryset.getcolumns(qid);
    11661170                        squery = queryset.getsquery(qid);
     1171                        json_options = queryset.getoptions(qid);
    11671172                }
    11681173                 
     
    11811186                        jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"] = [{}];
    11821187                }
    1183                 var jsonq = {"name":"", "squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols, "bookmark" : bookmark};
     1188                var jsonq = {"name":"", "squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols, "options" : json_options, "bookmark" : bookmark};
    11841189               
    11851190                var name;
     
    14541459                columns_widget.load(query.columns.split(','));
    14551460                $('#input-simplequery').attr("value",query.squery);
     1461                $('#input-withsumary').attr("checked",(query.options != null));
    14561462        }
    14571463
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r1029 r1032  
    2424        // repository
    2525        this.repository = 1;
     26        this.options = null;
    2627       
    2728        this.columns_widget = null;
     
    6162        }
    6263        this.columns = columns_text;
     64       
     65        var options_text = "";
     66        if (json.options == undefined) {
     67                this.options = null;
     68        } else {
     69                if (json.options != "null"){
     70                        $.each(json.options,function(i,item){
     71                                options_text = options_text + "," + item;
     72                        });
     73                        if (options_text.length > 1) {
     74                                options_text = options_text.substring(1);       
     75                        }
     76                        this.options = options_text;
     77                } else {
     78                        this.options = null;
     79                }
     80        }
     81       
    6382};
    6483
     
    8099        }
    81100        params = params + "collection=" + this.getcollectiontext("index") + "&columns=" + this.getcolumnstext() + "&startRecord=" + this.startRecord + "&maximumRecords=" + this.maximumRecords + "&repository=" + this.repository;
     101        if  (this.options != null) {
     102                params = params + "&options=withSumary";
     103        }
    82104        return params;
    83105        //return $.param(this.query);
     
    265287        "<span class='cmd cmd_get'></span><span class='cmd cmd_save'></span><span class='cmd cmd_del'> </span>" +
    266288        "<span class='query_id'>" +     this.listid + "</span>: <span class='query'>" +
    267         this.getcollectiontext("name") + ":" + Query.queryliststring(this.squery, this.query) + "</span>" +
     289        this.getcollectiontext("name") + ":" + Query.queryliststring(this.squery, this.query) + ", repository:" + this.repository.toString() + "</span>" +
    268290                        "<a class='cmd cmd_xml' target='_blank' href='" + this.link("xml") + "'>xml</a> <a class='cmd cmd_link' target='_blank' href='" + this.link("fullpage") + "' >link</a></div>" +
    269291                //      <span class='cmd cmd-xml'></span><span class='cmd cmd-page'></span><span class='cmd cmd-link'></span></div>" +         
     
    548570                return json_cols;
    549571        },
    550        
     572        getoptions: function(qid) {
     573                var opts = null;
     574                var json_opts;
     575               
     576                for (var i = 0; i < this.queries.length; i++) {
     577                        if (this.queries[i].listid == qid) {
     578                                opts = this.queries[i].options;
     579                        }
     580                }
     581               
     582                if (opts != null) {
     583                        json_opts = [{}];
     584                        json_opts[0] = opts;
     585                }
     586                return opts;
     587        },
    551588        resubmit: function(qid){
    552589                var query = queryset.queries[qid.substring(1)-1];
Note: See TracChangeset for help on using the changeset viewer.