Changeset 704
- Timestamp:
- 09/19/10 09:37:51 (14 years ago)
- Location:
- MDService2/trunk/MDService2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r699 r704 508 508 }); 509 509 510 $('.cmd_resubmit').live('click', function(event) { 511 var qid = $(this).closest('.query_wrapper').attr("id"); 512 513 queryset.resubmit(qid); 514 515 }); 516 510 517 511 518 $('.cmd_down').live('click', function(event) { -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r692 r704 8 8 this.listid = ""; 9 9 this.container = {}; 10 11 10 // page 11 this.startRecord = 1; 12 this.maximumRecords = 50; 13 //TODO load 14 15 // 16 this.is_resubmit = 0; 12 17 }; 13 18 … … 39 44 40 45 Query.prototype.query_uri = function () { 41 return "?q=" + escape(this.query) + "&collection=" + this.collection + "&columns=" + this.columns ;46 return "?q=" + escape(this.query) + "&collection=" + this.collection + "&columns=" + this.columns + "&startRecord=" + this.startRecord + "&iend=" + this.maximumRecords; 42 47 //return $.param(this.query); 43 48 }; … … 100 105 "<span class='cmd cmd_delete'> </span><span class='cmd cmd_get'></span><span class='query_id'>" + 101 106 this.listid + "</span> <span class='query'>" + 102 this.collection + ": " + Query.simplequerystring(this.query) + "</span><span class='cmd cmd_save'></span><span class='cmd cmd_ select'></span></div>" +107 this.collection + ": " + Query.simplequerystring(this.query) + "</span><span class='cmd cmd_save'></span><span class='cmd cmd_resubmit'></span></div>" + 103 108 "<div class='result'></div></div>"; 104 109 addToQuerylist(x); … … 109 114 110 115 var uri = link('recordset','htmltable', this.query_uri()); 111 notifyUser("submitting query:" + uri); 112 116 var re = ""; 117 118 var l_resubmit = this.is_resubmit; 119 if (l_resubmit == 1) { 120 this.is_resubmit = 0; 121 re = "re" 122 } 123 124 notifyUser(re + "submitting query:" + uri); 113 125 this.container.find('.result').load( uri, function() { 114 126 notifyUser("result-loaded",'debug'); 127 115 128 var get = $(this).parent().find('.cmd_get'); 116 129 … … 120 133 121 134 var result_header = $(this).children('.result_header'); 122 var q_header = $(this).parent().find('.query_header'); 123 q_header.append(result_header); 124 135 136 var q_header; 137 q_header = $(this).parent().find('.query_header'); 138 if (l_resubmit == 1) { 139 result_header.remove(); 140 } else { 141 q_header.append(result_header); 142 } 143 144 q_header.find('.reload').click(function() { 145 146 var qid = $(this).closest('.query_wrapper').attr("id"); 147 queryset.resubmit(qid); 148 /* 149 var startRecord = $(this).parent().find('.start_record').val(); 150 var maximumRecords = $(this).parent().find('.maximum_records').val(); 151 var id = $(this).closest('.query_wrapper').attr("id"); 152 153 queryset_container.container = $('#' + id ); 154 var q = queryset.queries[id.substring(1)-1]; 155 156 q.startRecord = startRecord; 157 q.maximumRecords = maximumRecords; 158 q.is_resubmit = 1; 159 q.submit(); 160 queryset_container.container = $('#q' + queryset.queries.length ); 161 //$('#' + id ). 162 */ 163 }); 125 164 }); 126 165 127 166 }; 167 128 168 129 169 … … 235 275 } 236 276 return json_cols; 237 } 238 239 240 }; 277 }, 278 279 resubmit: function(qid){ 280 var query = queryset.queries[qid.substring(1)-1]; 281 queryset_container.container = $('#' + qid ); 282 query.is_resubmit = 1; 283 query.startRecord = $('#' + qid ).find('.start_record').val(); 284 query.maximumRecords = $('#' + qid ).find('.maximum_records').val(); 285 query.submit(); 286 queryset_container.container = $('#q' + queryset.queries.length ); 287 288 } 289 290 291 }; -
MDService2/trunk/MDService2/WebContent/style/cmdi.css
r699 r704 80 80 background-image: url("imgs/icon_filter_10.png"); 81 81 } 82 .cmd_resubmit { 83 background-image: url("imgs/icon_filter_10.png"); 84 } 82 85 83 86 .cmd_up { -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java
r689 r704 29 29 import org.xml.sax.SAXException; 30 30 import org.xml.sax.InputSource; 31 import org.apache.commons.lang.StringEscapeUtils; 31 32 32 33 … … 108 109 //e.setNamedItem(attr); 109 110 e.setAttribute("id", c.toString()); 110 String[] key_array = key_info.split(" -");111 String[] key_array = key_info.split("//-"); 111 112 112 113 e.setAttribute("type", key_array[0]); … … 182 183 transformed = ""; 183 184 } else { 184 try { 185 transformed = query.toURLParam(); 186 transformed = transformed.replace("'", "__qqqqq__"); 187 //Admin.notifyUser("CACHE.transformQuery:"+transformed); 188 } catch (MalformedURLException e) { 189 // TODO Auto-generated catch block 190 e.printStackTrace(); 191 transformed = ""; 192 } 185 transformed = query.getSimpleQueryString(); 186 transformed = StringEscapeUtils.escapeXml(transformed); 187 //Admin.notifyUser("CACHE.transformQuery:"+transformed); 193 188 } 194 189 return transformed; … … 201 196 String xpath_expr=""; 202 197 203 String[] key_array = key_info.split(" -");198 String[] key_array = key_info.split("//-"); 204 199 String query_str; 205 200 201 Admin.notifyUser("formPATH:" + key_info); 202 203 206 204 if(key_array.length > 1){ 205 //Admin.notifyUser("formPATH- querystring:" + key_array[1]); 207 206 if (key_array[0].equals("recordset")){ 208 207 query_str = transformQuery(key_array[1]); 208 Admin.notifyUser("formPATH- querystring-transformed:" + query_str); 209 209 } 210 210 else { -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java
r690 r704 51 51 String key=""; 52 52 if (getActionkey()!=null) { 53 key += getActionkey() + " -" ;53 key += getActionkey() + "//-" ; 54 54 } 55 55 if (getCompid()!=null) { 56 key += getCompid() + " -" ;56 key += getCompid() + "//-" ; 57 57 } 58 58 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r690 r704 176 176 String key=""; 177 177 if (getActionkey()!=null) { 178 key += getActionkey() + " -" ;178 key += getActionkey() + "//-" ; 179 179 } 180 180 if (getQ()!=null) { 181 key += getQ() + " -" ;181 key += getQ() + "//-" ; 182 182 } 183 183 if (getCollection()!=null) { -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java
r690 r704 188 188 } 189 189 190 public String getSimpleQueryString() { 191 String[] arr_and = query_string.split(" and "); 192 String simple_form = ""; 193 String simple_form_all = ""; 194 String rel = ""; 195 196 for( int i=0;i<arr_and.length;i++){ 197 arr_and[i] = arr_and[i].trim(); 198 String[] arr_or = arr_and[i].split(" or "); 199 simple_form = ""; 200 for( int j=0;j<arr_or.length;j++){ 201 arr_or[j] = arr_or[j].trim(); 202 while (arr_or[j].substring(0,1).equals("(") ) { 203 arr_or[j] = arr_or[j].substring(1,arr_or[j].length()); 204 arr_or[j] = arr_or[j].trim(); 205 } 206 while ( arr_or[j].substring(arr_or[j].length()-1,arr_or[j].length()).equals(")")){ 207 arr_or[j] = arr_or[j].substring(0,arr_or[j].length()-1); 208 arr_or[j] = arr_or[j].trim(); 209 } 210 if (j > 0) { 211 rel = " or "; 212 } else { 213 rel = ""; 214 } 215 simple_form = simple_form + rel + arr_or[j]; 216 } 217 Admin.notifyUser(simple_form); 218 if (arr_or.length > 1){ 219 simple_form = "(" + simple_form + ") "; 220 } 221 if (i > 0) { 222 rel = " and "; 223 } else { 224 rel = ""; 225 } 226 simple_form_all = simple_form_all + rel + simple_form; 227 228 } 229 230 return simple_form_all; 231 } 190 232 /** 191 233 * construct the URL-Param -
MDService2/trunk/MDService2/src/xsl/mdset2view.xsl
r699 r704 20 20 21 21 <xsl:include href="cmd_commons.xsl"/> 22 23 <xsl:param name="startRecord">1</xsl:param> 24 <xsl:param name="maximumRecords">50</xsl:param> 22 25 23 26 <!-- <xsl:param name="format" select="'table'" /> table|list|detail --> … … 100 103 <span class="label" >query:</span><span class="value"><xsl:value-of select="echoedSearchRetrieveRequest" /></span>; 101 104 <span class="label" >hitcount:</span><span class="value hilight"><xsl:value-of select="numberOfRecords" /></span>; 102 <span class="label" >showing:</span><span class="value"><xsl:value-of select="diagnostics" /></span> 105 <span class="label" >showing:</span><span class="value"><xsl:value-of select="diagnostics" /></span>; 106 <span class="label" >startRecord:</span><span><input type="text" size="5" class="value start_record"><xsl:attribute name="value"> 107 <xsl:value-of select="$startRecord"/> 108 </xsl:attribute> 109 </input></span> 110 <span class="label" >maximumRecords:</span><span><input type="text" size="5" class="value maximum_records" ><xsl:attribute name="value"> 111 <xsl:value-of select="$maximumRecords"/> 112 </xsl:attribute></input></span> 113 <button class="reload">reload</button> 103 114 </div> 104 115 </xsl:template>
Note: See TracChangeset
for help on using the changeset viewer.