Changeset 6700
- Timestamp:
- Jan 30, 2015, 1:31:02 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/ItemContext.java
r6698 r6700 1524 1524 { 1525 1525 Restriction r = filter.getRestriction(dc, query); 1526 int rowIndex = filter.getRowIndex();1527 1526 if (r != null) 1528 1527 { 1528 int rowIndex = filter.getRowIndex(); 1529 1529 List<Restriction> rowRestrictions = allRestrictions.get(rowIndex); 1530 1530 if (rowRestrictions == null) … … 1747 1747 if (propertyFilters != null) 1748 1748 { 1749 Restriction[] restrictions = new Restriction[propertyFilters.values().size()]; 1750 int i = 0; 1749 Map<Integer, List<Restriction>> allRestrictions = new HashMap<Integer, List<Restriction>>(); 1751 1750 for (PropertyFilterPair filterPair : propertyFilters.values()) 1752 1751 { … … 1759 1758 if (r != null) 1760 1759 { 1761 restrictions[i] = r; 1762 i++; 1760 int rowIndex = filter.getRowIndex(); 1761 List<Restriction> rowRestrictions = allRestrictions.get(rowIndex); 1762 if (rowRestrictions == null) 1763 { 1764 rowRestrictions = new ArrayList<Restriction>(); 1765 allRestrictions.put(rowIndex, rowRestrictions); 1766 } 1767 rowRestrictions.add(r); 1768 1763 1769 } 1764 1770 } … … 1770 1776 } 1771 1777 } 1772 if (i > 0) 1773 { 1774 Restriction[] r2 = new Restriction[i]; 1775 System.arraycopy(restrictions, 0, r2, 0, i); 1776 query.restrict(Restrictions.and(r2)); 1778 if (allRestrictions.size() > 0) 1779 { 1780 Restriction[] rows = new Restriction[allRestrictions.size()]; 1781 int rowNo = 0; 1782 for (List<Restriction> rowRestrictions : allRestrictions.values()) 1783 { 1784 rows[rowNo] = Restrictions.nullSafeAnd(rowRestrictions); 1785 rowNo++; 1786 } 1787 query.restrict(Restrictions.or(rows)); 1777 1788 } 1778 1789 } -
trunk/www/views/experiments/bioassays/list_bioassays.jsp
r6691 r6700 196 196 sc="<%=sc%>" 197 197 item="<%=itemType%>" 198 filterrows="<%=cc.getFilterRows()%>" 198 199 subclass="fulltable" 199 200 data-inherited-annotations="true" … … 410 411 <tbl:columnheaders /> 411 412 </tbl:headerrow> 412 <tbl:headerrow> 413 <tbl:header subclass="index" /> 414 <tbl:header 415 subclass="check" 416 visible="<%=mode.hasCheck()%>" 417 ><base:icon 418 id="check.uncheck" 419 image="check_uncheck.png" 420 tooltip="Check/uncheck all" 421 422 /></tbl:header> 423 <tbl:header 424 subclass="check" 425 visible="<%=mode.hasRadio()%>" 426 /> 427 <tbl:header 428 subclass="icons" 429 visible="<%=mode.hasIcons()%>" 430 /> 431 <tbl:propertyfilter /> 432 </tbl:headerrow> 413 <% 414 int numFilters = cc.getNumPropertyFilters(); 415 int numRows = cc.getFilterRows(); 416 for (int filterNo = 0; filterNo < numRows; filterNo++) 417 { 418 boolean lastRow = filterNo == numRows-1; 419 %> 420 <tbl:headerrow> 421 <tbl:header subclass="index" /> 422 <tbl:header 423 subclass="check" 424 visible="<%=mode.hasCheck()%>" 425 ><base:icon 426 id="check.uncheck" 427 image="check_uncheck.png" 428 tooltip="Check/uncheck all" 429 visible="<%=lastRow%>" 430 /></tbl:header> 431 <tbl:header 432 subclass="check" 433 visible="<%=mode.hasRadio()%>" 434 /> 435 <tbl:header 436 subclass="icons" 437 visible="<%=mode.hasIcons()%>" 438 > 439 <base:icon 440 subclass="link table-filter-row-action" 441 image="add.png" 442 tooltip="Add extra filter row" 443 visible="<%=lastRow%>" 444 /><base:icon 445 subclass="link table-filter-row-action" 446 image="remove.png" 447 tooltip="Remove this filter row" 448 visible="<%=numRows > 1 || numFilters > 0 %>" 449 data-remove-row="<%=filterNo%>" 450 /> 451 </tbl:header> 452 <tbl:propertyfilter row="<%=filterNo%>" /> 453 </tbl:headerrow> 454 <% 455 } 456 %> 433 457 </tbl:headers> 434 458 <tbl:rows> -
trunk/www/views/experiments/bioassaysets/analysis_tree.jsp
r6604 r6700 367 367 sc="<%=sc%>" 368 368 item="<%=itemType%>" 369 filterrows="<%=cc.getFilterRows()%>" 369 370 subclass="<%=root == null ? "fulltable" : "" %>" 370 371 > … … 516 517 <tbl:toolbar 517 518 visible="<%=mode.hasToolbar()%>" 518 subclass="<%=root == null ? "bottomborder " : "topborder leftborder rightborder" %>"519 subclass="<%=root == null ? "bottomborder bg-filled-50" : "topborder leftborder rightborder bg-filled-50" %>" 519 520 > 520 521 <tbl:button … … 584 585 <tbl:columnheaders /> 585 586 </tbl:headerrow> 586 <tbl:headerrow> 587 <tbl:header subclass="index" /> 588 <tbl:header 589 subclass="check" 590 visible="<%=mode.hasCheck()%>" 591 ><base:icon 592 id="check.uncheck" 593 image="check_uncheck.png" 594 tooltip="Check/uncheck all" 595 596 /></tbl:header> 597 <tbl:header 598 subclass="check" 599 visible="<%=mode.hasRadio()%>" 600 /> 601 <tbl:header 602 subclass="icons" 603 visible="<%=mode.hasIcons()%>" 604 /> 605 <tbl:propertyfilter /> 606 </tbl:headerrow> 587 <% 588 int numFilters = cc.getNumPropertyFilters(); 589 int numRows = cc.getFilterRows(); 590 for (int filterNo = 0; filterNo < numRows; filterNo++) 591 { 592 boolean lastRow = filterNo == numRows-1; 593 %> 594 <tbl:headerrow> 595 <tbl:header subclass="index" /> 596 <tbl:header 597 subclass="check" 598 visible="<%=mode.hasCheck()%>" 599 ><base:icon 600 id="check.uncheck" 601 image="check_uncheck.png" 602 tooltip="Check/uncheck all" 603 visible="<%=lastRow%>" 604 /></tbl:header> 605 <tbl:header 606 subclass="check" 607 visible="<%=mode.hasRadio()%>" 608 /> 609 <tbl:header 610 subclass="icons" 611 visible="<%=mode.hasIcons()%>" 612 > 613 <base:icon 614 subclass="link table-filter-row-action" 615 image="add.png" 616 tooltip="Add extra filter row" 617 visible="<%=lastRow%>" 618 /><base:icon 619 subclass="link table-filter-row-action" 620 image="remove.png" 621 tooltip="Remove this filter row" 622 visible="<%=numRows > 1 || numFilters > 0 %>" 623 data-remove-row="<%=filterNo%>" 624 /> 625 </tbl:header> 626 <tbl:propertyfilter row="<%=filterNo%>" /> 627 </tbl:headerrow> 628 <% 629 } 630 %> 607 631 </tbl:headers> 608 632 <tbl:rows> -
trunk/www/views/experiments/explorer/search/list.jsp
r6612 r6700 133 133 item="<%=itemType%>" 134 134 subcontext="<%=subContext%>" 135 filterrows="<%=cc.getFilterRows()%>" 135 136 subclass="fulltable" 136 137 > … … 199 200 <tbl:columnheaders /> 200 201 </tbl:headerrow> 201 <tbl:headerrow> 202 <tbl:header clazz="icons"/> 203 <tbl:propertyfilter /> 204 </tbl:headerrow> 202 <% 203 int numFilters = cc.getNumPropertyFilters(); 204 int numRows = cc.getFilterRows(); 205 for (int filterNo = 0; filterNo < numRows; filterNo++) 206 { 207 boolean lastRow = filterNo == numRows-1; 208 %> 209 <tbl:headerrow> 210 <tbl:header subclass="icons"> 211 <base:icon 212 subclass="link table-filter-row-action" 213 image="add.png" 214 tooltip="Add extra filter row" 215 visible="<%=lastRow%>" 216 /><base:icon 217 subclass="link table-filter-row-action" 218 image="remove.png" 219 tooltip="Remove this filter row" 220 visible="<%=numRows > 1 || numFilters > 0 %>" 221 data-remove-row="<%=filterNo%>" 222 /> 223 </tbl:header> 224 <tbl:propertyfilter row="<%=filterNo%>" /> 225 </tbl:headerrow> 226 <% 227 } 228 %> 205 229 </tbl:headers> 206 230 <tbl:rows> -
trunk/www/views/experiments/explorer/view/view.jsp
r6621 r6700 81 81 import="java.util.Map" 82 82 import="java.util.HashMap" 83 import="java.util.TreeMap" 83 84 import="org.json.simple.JSONObject" 84 85 import="org.json.simple.JSONArray" … … 235 236 <t:tab id="view" title="Reporter view"> 236 237 <% 237 Collection<PropertyFilter> filters = reporterContext.getPropertyFilters(); 238 String filter = filters != null && filters.size() > 0 ? 239 Values.getString(filters, " AND ", true).replaceAll("@|�", "") : "- none -"; 238 Map<Integer, List<PropertyFilter>> filters = new TreeMap<Integer, List<PropertyFilter>>(); 239 for (PropertyFilter filter : reporterContext.getPropertyFilters()) 240 { 241 List<PropertyFilter> rowFilters = filters.get(filter.getRowIndex()); 242 if (rowFilters == null) 243 { 244 rowFilters = new ArrayList<PropertyFilter>(); 245 filters.put(filter.getRowIndex(), rowFilters); 246 } 247 rowFilters.add(filter); 248 } 249 StringBuilder filter = new StringBuilder(); 250 for (List<PropertyFilter> rowFilter : filters.values()) 251 { 252 if (filter.length() > 0) filter.append(" OR "); 253 StringBuilder sb = new StringBuilder(); 254 for (PropertyFilter pf : rowFilter) 255 { 256 if (sb.length() > 0) sb.append(" AND "); 257 sb.append(pf.getProperty()+" "+pf.getOperator()+" "+pf.getValue()); 258 } 259 filter.append(sb.toString().replaceAll("@|£", "")); 260 } 240 261 if (reporter == null) 241 262 { … … 244 265 <tr> 245 266 <th>Filter</th> 246 <td><%=HTML.encodeTags(filter )%></td>267 <td><%=HTML.encodeTags(filter.toString())%></td> 247 268 </tr> 248 269 <tr> … … 352 373 %> 353 374 <tbl:form width="2" clazz="fullform special"> 354 <tbl:cell column="filter"><%=HTML.encodeTags(filter )%></tbl:cell>375 <tbl:cell column="filter"><%=HTML.encodeTags(filter.toString())%></tbl:cell> 355 376 <tbl:cell column="id"><%=reporter.getId()%></tbl:cell> 356 377 <tbl:cell column="version"><%=reporter.getVersion()%></tbl:cell> -
trunk/www/views/experiments/reporters/list_reporters.jsp
r6604 r6700 153 153 item="<%=itemType%>" 154 154 subcontext="<%=subContext%>" 155 filterrows="<%=cc.getFilterRows()%>" 155 156 subclass="fulltable" 156 157 > … … 260 261 <tbl:headers> 261 262 <tbl:headerrow> 262 <tbl:header colspan=" 2" />263 <tbl:header colspan="3" /> 263 264 <tbl:columnheaders /> 264 265 </tbl:headerrow> 265 <tbl:headerrow> 266 <tbl:header subclass="index" /> 267 <tbl:header 268 subclass="check" 269 visible="<%=mode.hasCheck()%>" 270 ><base:icon 271 id="check.uncheck" 272 image="check_uncheck.png" 273 tooltip="Check/uncheck all" 274 275 /></tbl:header> 276 <tbl:propertyfilter /> 277 </tbl:headerrow> 266 <% 267 int numFilters = cc.getNumPropertyFilters(); 268 int numRows = cc.getFilterRows(); 269 for (int filterNo = 0; filterNo < numRows; filterNo++) 270 { 271 boolean lastRow = filterNo == numRows-1; 272 %> 273 <tbl:headerrow> 274 <tbl:header subclass="index" /> 275 <tbl:header 276 subclass="check" 277 visible="<%=mode.hasCheck()%>" 278 ><base:icon 279 id="check.uncheck" 280 image="check_uncheck.png" 281 tooltip="Check/uncheck all" 282 visible="<%=lastRow%>" 283 /></tbl:header> 284 <tbl:header 285 subclass="check" 286 visible="<%=mode.hasRadio()%>" 287 /> 288 <tbl:header 289 subclass="icons" 290 visible="<%=mode.hasIcons()%>" 291 > 292 <base:icon 293 subclass="link table-filter-row-action" 294 image="add.png" 295 tooltip="Add extra filter row" 296 visible="<%=lastRow%>" 297 /><base:icon 298 subclass="link table-filter-row-action" 299 image="remove.png" 300 tooltip="Remove this filter row" 301 visible="<%=numRows > 1 || numFilters > 0 %>" 302 data-remove-row="<%=filterNo%>" 303 /> 304 </tbl:header> 305 <tbl:propertyfilter row="<%=filterNo%>" /> 306 </tbl:headerrow> 307 <% 308 } 309 %> 278 310 </tbl:headers> 279 311 <tbl:rows> … … 319 351 <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 320 352 ></tbl:header> 353 <tbl:header clazz="icons" visible="<%=mode.hasIcons()%>" /> 321 354 322 355 <tbl:cell column="upToDate" visible="<%=hasUpToDateColumn %>"> -
trunk/www/views/experiments/spotdata/list_spotdata.jsp
r6604 r6700 194 194 item="<%=itemType%>" 195 195 subcontext="<%=subContext%>" 196 filterrows="<%=cc.getFilterRows()%>" 196 197 subclass="fulltable" 197 198 > … … 318 319 <tbl:columnheaders /> 319 320 </tbl:headerrow> 320 <tbl:headerrow> 321 <tbl:header 322 clazz="index" 323 colspan="2" 324 /> 325 <tbl:propertyfilter /> 326 </tbl:headerrow> 321 <% 322 int numFilters = cc.getNumPropertyFilters(); 323 int numRows = cc.getFilterRows(); 324 for (int filterNo = 0; filterNo < numRows; filterNo++) 325 { 326 boolean lastRow = filterNo == numRows-1; 327 %> 328 <tbl:headerrow> 329 <tbl:header subclass="index" /> 330 <tbl:header 331 subclass="icons" 332 visible="<%=mode.hasIcons()%>" 333 > 334 <base:icon 335 subclass="link table-filter-row-action" 336 image="add.png" 337 tooltip="Add extra filter row" 338 visible="<%=lastRow%>" 339 /><base:icon 340 subclass="link table-filter-row-action" 341 image="remove.png" 342 tooltip="Remove this filter row" 343 visible="<%=numRows > 1 || numFilters > 0 %>" 344 data-remove-row="<%=filterNo%>" 345 /> 346 </tbl:header> 347 <tbl:propertyfilter row="<%=filterNo%>" /> 348 </tbl:headerrow> 349 <% 350 } 351 %> 327 352 </tbl:headers> 328 353 <tbl:rows>
Note: See TracChangeset
for help on using the changeset viewer.