Changeset 1032
- Timestamp:
- 01/03/11 22:41:08 (13 years ago)
- Location:
- MDService2/trunk/MDService2/WebContent
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/index.jsp
r1030 r1032 119 119 <input type="text" id="input-simplequery" name="_query" /> 120 120 <input type="submit" value="submit" id="submit-query"/> 121 <input type="checkbox" checked="false" id="input-withsumary" name="WS"/> 121 122 <input type="text" id="query_list" name="_query_" /> 122 123 <table class="cmds-ui-elem-stretch"><tr> -
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r1031 r1032 102 102 } 103 103 // TODO multiple collections 104 function submit_query (columns, query, squery ) {104 function submit_query (columns, query, squery, ws) { 105 105 notifyUser("processing query"); 106 106 … … 114 114 var q = new Query(collections, columns, query, squery); //actions.collections.current, query ); 115 115 q.repository = getSelectedRepository(); 116 if (ws) { 117 q.options = "withSumary"; 118 } 116 119 notifyUser("submit_query:" + q.query_uri(),'debug'); 117 120 queryset.addquery(q); … … 1128 1131 notifyUser(searchclauseset.sctext,'debug'); 1129 1132 //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")); 1131 1134 }); 1132 1135 … … 1154 1157 var squery = ""; 1155 1158 var bookmark = "0"; 1159 var json_options = "null"; 1156 1160 1157 1161 if ($(this).parents('.result').length > 0){ … … 1165 1169 json_cols = queryset.getcolumns(qid); 1166 1170 squery = queryset.getsquery(qid); 1171 json_options = queryset.getoptions(qid); 1167 1172 } 1168 1173 … … 1181 1186 jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"] = [{}]; 1182 1187 } 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}; 1184 1189 1185 1190 var name; … … 1454 1459 columns_widget.load(query.columns.split(',')); 1455 1460 $('#input-simplequery').attr("value",query.squery); 1461 $('#input-withsumary').attr("checked",(query.options != null)); 1456 1462 } 1457 1463 -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r1029 r1032 24 24 // repository 25 25 this.repository = 1; 26 this.options = null; 26 27 27 28 this.columns_widget = null; … … 61 62 } 62 63 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 63 82 }; 64 83 … … 80 99 } 81 100 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 } 82 104 return params; 83 105 //return $.param(this.query); … … 265 287 "<span class='cmd cmd_get'></span><span class='cmd cmd_save'></span><span class='cmd cmd_del'> </span>" + 266 288 "<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>" + 268 290 "<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>" + 269 291 // <span class='cmd cmd-xml'></span><span class='cmd cmd-page'></span><span class='cmd cmd-link'></span></div>" + … … 548 570 return json_cols; 549 571 }, 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 }, 551 588 resubmit: function(qid){ 552 589 var query = queryset.queries[qid.substring(1)-1];
Note: See TracChangeset
for help on using the changeset viewer.