Changeset 4869
- Timestamp:
- Mar 31, 2009, 2:21:37 PM (13 years ago)
- Location:
- trunk/www/biomaterials
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/bioplates/wells/edit_biowell.jsp
r4731 r4869 39 39 import="net.sf.basedb.clients.web.util.HTML" 40 40 import="net.sf.basedb.util.Values" 41 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 41 42 import="java.util.List" 42 43 %> … … 57 58 BioPlate bioPlate = bioWell.getPlate(); 58 59 60 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 61 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 59 62 60 63 title = "Edit biowell -- [" + bioWell.getRow() + ", " + bioWell.getColumn() + "] on bioplate " + HTML.encodeTags(bioPlate.getName()); … … 174 177 <tr> 175 178 <td class="prompt">Coordinate</td> 176 <td>[<%= bioWell.getRow()%>,<%=bioWell.getColumn()%>]</td>179 <td>[<%=rowFormatter.format(bioWell.getRow())%>,<%=columnFormatter.format(bioWell.getColumn())%>]</td> 177 180 </tr> 178 181 <tr> -
trunk/www/biomaterials/bioplates/wells/list_biowells.jsp
r4864 r4869 82 82 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 83 83 84 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 85 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 86 84 87 try 85 88 { … … 88 91 final boolean deletePermission = createPermission; 89 92 93 Enumeration<String, String> rows = new Enumeration<String,String>(); 94 for (int r = 0; r < bioplate.getPlateGeometry().getRows(); r++) 95 { 96 rows.add(Integer.toString(r), rowFormatter.format(r)); 97 } 98 90 99 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 91 100 … … 209 218 sortable="true" 210 219 filterable="true" 220 enumeration="<%=rows%>" 211 221 exportable="true" 212 222 show="always" 213 formatter="<%= new WellCoordinateFormatter(true)%>"223 formatter="<%=rowFormatter%>" 214 224 /> 215 225 <tbl:columndef … … 222 232 exportable="true" 223 233 show="always" 224 formatter="<%= new WellCoordinateFormatter(false)%>"234 formatter="<%=columnFormatter%>" 225 235 /> 226 236 <tbl:columndef … … 368 378 name="<%=itemId%>" 369 379 value="<%=itemId%>" 370 title="[<%= item.getRow()%>,<%=item.getColumn()%>]"380 title="[<%=rowFormatter.format(item.getRow())%>,<%=columnFormatter.format(item.getColumn())%>]" 371 381 <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 372 382 ></tbl:header> … … 378 388 name="item_id" 379 389 value="<%=itemId%>" 380 title="[<%= item.getRow()%>,<%=item.getColumn()%>]"390 title="[<%=rowFormatter.format(item.getRow())%>,<%=columnFormatter.format(item.getColumn())%>]" 381 391 <%=selectedItemId == itemId ? "checked" : ""%> 382 392 ></tbl:header> -
trunk/www/biomaterials/extracts/edit_extract.jsp
r4730 r4869 51 51 import="net.sf.basedb.util.Values" 52 52 import="net.sf.basedb.util.formatter.Formatter" 53 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 53 54 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 54 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 55 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 55 56 import="java.util.List" 56 57 import="java.util.Set" … … 75 76 Date eventDate = null; 76 77 boolean isPooled = false; 78 79 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 80 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 77 81 78 82 boolean readCurrentProtocol = true; … … 361 365 Forms.addListOption(list, 1, new Option()); 362 366 list[1].value = '<%=currentBioWell.getId()*(extract == null ? 1 : -1)%>'; 363 list[1].text = '[<%= currentBioWell.getRow()%>,<%=currentBioWell.getColumn()%>]';367 list[1].text = '[<%=rowFormatter.format(currentBioWell.getRow())%>,<%=columnFormatter.format(currentBioWell.getColumn())%>]'; 364 368 list.selectedIndex = 1; 365 369 <% -
trunk/www/biomaterials/extracts/index.jsp
r4730 r4869 50 50 import="net.sf.basedb.clients.web.util.HTML" 51 51 import="net.sf.basedb.util.formatter.Formatter" 52 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 52 53 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 53 54 import="java.util.Enumeration" … … 63 64 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,originalQuantity,remainingQuantity,labeledextracts,description"); 64 65 private static final Item itemType = Item.EXTRACT; 66 67 private static void registerExportFormatters(ItemContext cc) 68 { 69 cc.setObject("export.formatter.bioWell.row", new WellCoordinateFormatter(true)); 70 cc.setObject("export.formatter.bioWell.column", new WellCoordinateFormatter(false)); 71 } 65 72 %> 66 73 <% … … 321 328 final ItemQuery<Extract> query = Extract.getQuery(); 322 329 cc.configureQuery(query, true); 330 registerExportFormatters(cc); 323 331 cc.setQuery(query); 324 332 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+extracts"; … … 328 336 // Run an export plugin in single-item context 329 337 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 338 registerExportFormatters(cc); 330 339 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+extract"; 331 340 } -
trunk/www/biomaterials/extracts/list_extracts.jsp
r4734 r4869 47 47 import="net.sf.basedb.core.Permission" 48 48 import="net.sf.basedb.core.PermissionDeniedException" 49 import="net.sf.basedb.core.PlateGeometry" 49 50 import="net.sf.basedb.core.PluginDefinition" 50 51 import="net.sf.basedb.core.query.Hql" … … 63 64 import="net.sf.basedb.clients.web.util.HTML" 64 65 import="net.sf.basedb.util.formatter.Formatter" 66 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 65 67 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 66 68 import="net.sf.basedb.util.Values" … … 112 114 int numListed = 0; 113 115 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 116 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 117 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 118 119 Enumeration<String, String> wellRows = new Enumeration<String, String>(); 120 ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery(); 121 geometryQuery.order(Orders.desc(Hql.property("rows"))); 122 ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc); 123 int maxRows = result.next().getRows(); 124 for (int r = 0; r < maxRows; r++) 125 { 126 wellRows.add(Integer.toString(r), rowFormatter.format(r)); 127 } 128 114 129 %> 115 130 <base:page title="<%=title==null ? "Extracts" : title%>" type="<%=mode.getPageType()%>"> … … 360 375 title="Biowell row" 361 376 filterable="true" 377 enumeration="<%=wellRows%>" 362 378 exportable="true" 363 379 sortable="true" 380 formatter="<%=rowFormatter%>" 364 381 /> 365 382 <tbl:columndef … … 372 389 exportable="true" 373 390 sortable="true" 391 formatter="<%=columnFormatter%>" 374 392 /> 375 393 <tbl:columndef … … 702 720 visible="<%=mode.hasEditLink() && createLabeledExtractPermission && usePermission%>" 703 721 /></tbl:cell> 704 <tbl:cell column="bioPlate"> 705 <base:propertyvalue 706 item="<%=item%>" 707 property="bioWell.bioPlate" 708 enableEditLink="<%=mode.hasEditLink()%>" 709 enablePropertyLink="<%=mode.hasPropertyLink()%>" 710 /> 711 </tbl:cell> 712 <tbl:cell column="bioWellRow"> 713 <base:propertyvalue 714 item="<%=item%>" 715 property="bioWell.row" 716 enableEditLink="<%=mode.hasEditLink()%>" 717 enablePropertyLink="<%=mode.hasPropertyLink()%>" 718 /> 719 </tbl:cell> 720 <tbl:cell column="bioWellColumn"> 721 <base:propertyvalue 722 item="<%=item%>" 723 property="bioWell.column" 724 enableEditLink="<%=mode.hasEditLink()%>" 725 enablePropertyLink="<%=mode.hasPropertyLink()%>" 726 /> 727 </tbl:cell> 722 723 <% 724 BioWell well = null; 725 boolean readBioWell = true; 726 try 727 { 728 well = item.getBioWell(); 729 } 730 catch(PermissionDeniedException e) 731 { 732 readBioWell = false; 733 } 734 if (!readBioWell) 735 { 736 %> 737 <tbl:cell column="bioWellRow"><i>- denied -</i> </tbl:cell> 738 <tbl:cell column="bioWellColumn"><i>- denied -</i> </tbl:cell> 739 <tbl:cell column="bioPlate"><i>- denied -</i> </tbl:cell> 740 <% 741 } 742 else if (well == null) 743 { 744 %> 745 <tbl:cell column="bioWellRow"><i>- none -</i> </tbl:cell> 746 <tbl:cell column="bioWellColumn"><i>- none -</i> </tbl:cell> 747 <tbl:cell column="bioPlate"><i>- none -</i> </tbl:cell> 748 <% 749 750 } 751 else 752 { 753 %> 754 <tbl:cell column="bioWellRow"> 755 <tbl:cellvalue value="<%=well.getRow()%>"/> 756 </tbl:cell> 757 <tbl:cell column="bioWellColumn"> 758 <tbl:cellvalue value="<%=well.getColumn()%>"/> 759 </tbl:cell> 760 <tbl:cell column="bioPlate"><%=Base.getLinkedName(ID, well.getPlate(), false, true)%></tbl:cell> 761 <% 762 } 763 %> 728 764 <tbl:cell column="owner" 729 765 ><base:propertyvalue -
trunk/www/biomaterials/extracts/view_extract.jsp
r4746 r4869 60 60 import="net.sf.basedb.util.Values" 61 61 import="net.sf.basedb.util.formatter.Formatter" 62 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 62 63 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 63 64 import="java.util.ArrayList" … … 88 89 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 89 90 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 91 92 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 93 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 90 94 91 95 String title = null; … … 338 342 BioWell bw = extract.getBioWell(); 339 343 %> 340 [<%= bw.getRow()%>,<%=bw.getColumn()%>]344 [<%=rowFormatter.format(bw.getRow())%>,<%=columnFormatter.format(bw.getColumn())%>] 341 345 <% 342 346 } -
trunk/www/biomaterials/labeledextracts/edit_labeledextract.jsp
r4730 r4869 51 51 import="net.sf.basedb.clients.web.util.HTML" 52 52 import="net.sf.basedb.util.Values" 53 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 53 54 import="net.sf.basedb.util.formatter.Formatter" 54 55 import="net.sf.basedb.clients.web.formatter.FormatterFactory" … … 98 99 List<Label> recentLabels = (List<Label>)cc.getRecent(dc, Item.LABEL); 99 100 List<BioPlate> recentBioPlates = (List<BioPlate>)cc.getRecent(dc, Item.BIOPLATE); 101 102 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 103 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 100 104 101 105 int activeProjectId = sc.getActiveProjectId(); … … 393 397 Forms.addListOption(list, 1, new Option()); 394 398 list[1].value = '<%=currentBioWell.getId()*(extract == null ? 1 : -1)%>'; 395 list[1].text = '[<%= currentBioWell.getRow()%>,<%=currentBioWell.getColumn()%>]';399 list[1].text = '[<%=rowFormatter.format(currentBioWell.getRow())%>,<%=columnFormatter.format(currentBioWell.getColumn())%>]'; 396 400 list.selectedIndex = 1; 397 401 <% -
trunk/www/biomaterials/labeledextracts/index.jsp
r4730 r4869 51 51 import="net.sf.basedb.clients.web.util.HTML" 52 52 import="net.sf.basedb.util.formatter.Formatter" 53 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 53 54 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 54 55 import="java.util.Enumeration" … … 64 65 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,label,originalQuantity,remainingQuantity,hybridizations,description"); 65 66 private static final Item itemType = Item.LABELEDEXTRACT; 67 68 private static void registerExportFormatters(ItemContext cc) 69 { 70 cc.setObject("export.formatter.bioWell.row", new WellCoordinateFormatter(true)); 71 cc.setObject("export.formatter.bioWell.column", new WellCoordinateFormatter(false)); 72 } 66 73 %> 67 74 <% … … 335 342 final ItemQuery<LabeledExtract> query = LabeledExtract.getQuery(); 336 343 cc.configureQuery(query, true); 344 registerExportFormatters(cc); 337 345 cc.setQuery(query); 338 346 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+labeled+extracts"; … … 342 350 // Run an export plugin in single-item context 343 351 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 352 registerExportFormatters(cc); 344 353 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+labeled+extract"; 345 354 } -
trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp
r4734 r4869 47 47 import="net.sf.basedb.core.Permission" 48 48 import="net.sf.basedb.core.PermissionDeniedException" 49 import="net.sf.basedb.core.PlateGeometry" 49 50 import="net.sf.basedb.core.PluginDefinition" 50 51 import="net.sf.basedb.core.query.Hql" … … 63 64 import="net.sf.basedb.clients.web.util.HTML" 64 65 import="net.sf.basedb.util.formatter.Formatter" 66 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 65 67 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 66 68 import="net.sf.basedb.util.Values" … … 108 110 int numListed = 0; 109 111 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 112 113 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 114 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 115 116 Enumeration<String, String> wellRows = new Enumeration<String, String>(); 117 ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery(); 118 geometryQuery.order(Orders.desc(Hql.property("rows"))); 119 ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc); 120 int maxRows = result.next().getRows(); 121 for (int r = 0; r < maxRows; r++) 122 { 123 wellRows.add(Integer.toString(r), rowFormatter.format(r)); 124 } 110 125 %> 111 126 <base:page title="<%=title==null ? "Labeled extract" : title%>" type="<%=mode.getPageType()%>"> … … 368 383 title="Biowell row" 369 384 filterable="true" 385 enumeration="<%=wellRows%>" 370 386 exportable="true" 371 387 sortable="true" 388 formatter="<%=rowFormatter%>" 372 389 /> 373 390 <tbl:columndef … … 380 397 exportable="true" 381 398 sortable="true" 399 formatter="<%=columnFormatter%>" 382 400 /> 383 401 <tbl:columndef … … 714 732 %> 715 733 </tbl:cell> 716 <tbl:cell column="bioPlate"> 717 <base:propertyvalue 718 item="<%=item%>" 719 property="bioWell.bioPlate" 720 enableEditLink="<%=mode.hasEditLink()%>" 721 enablePropertyLink="<%=mode.hasPropertyLink()%>" 722 /> 723 </tbl:cell> 724 <tbl:cell column="bioWellRow"> 725 <base:propertyvalue 726 item="<%=item%>" 727 property="bioWell.row" 728 enableEditLink="<%=mode.hasEditLink()%>" 729 enablePropertyLink="<%=mode.hasPropertyLink()%>" 730 /> 731 </tbl:cell> 732 <tbl:cell column="bioWellColumn"> 733 <base:propertyvalue 734 item="<%=item%>" 735 property="bioWell.column" 736 enableEditLink="<%=mode.hasEditLink()%>" 737 enablePropertyLink="<%=mode.hasPropertyLink()%>" 738 /> 739 </tbl:cell> 734 <% 735 BioWell well = null; 736 boolean readBioWell = true; 737 try 738 { 739 well = item.getBioWell(); 740 } 741 catch(PermissionDeniedException e) 742 { 743 readBioWell = false; 744 } 745 if (!readBioWell) 746 { 747 %> 748 <tbl:cell column="bioWellRow"><i>- denied -</i> </tbl:cell> 749 <tbl:cell column="bioWellColumn"><i>- denied -</i> </tbl:cell> 750 <tbl:cell column="bioPlate"><i>- denied -</i> </tbl:cell> 751 <% 752 } 753 else if (well == null) 754 { 755 %> 756 <tbl:cell column="bioWellRow"><i>- none -</i> </tbl:cell> 757 <tbl:cell column="bioWellColumn"><i>- none -</i> </tbl:cell> 758 <tbl:cell column="bioPlate"><i>- none -</i> </tbl:cell> 759 <% 760 761 } 762 else 763 { 764 %> 765 <tbl:cell column="bioWellRow"> 766 <tbl:cellvalue value="<%=well.getRow()%>"/> 767 </tbl:cell> 768 <tbl:cell column="bioWellColumn"> 769 <tbl:cellvalue value="<%=well.getColumn()%>"/> 770 </tbl:cell> 771 <tbl:cell column="bioPlate"><%=Base.getLinkedName(ID, well.getPlate(), false, true)%></tbl:cell> 772 <% 773 } 774 %> 740 775 <tbl:cell column="owner" 741 776 ><base:propertyvalue -
trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp
r4746 r4869 59 59 import="net.sf.basedb.util.Values" 60 60 import="net.sf.basedb.util.formatter.Formatter" 61 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 61 62 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 62 63 import="java.util.ArrayList" … … 87 88 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 88 89 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 90 91 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 92 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 89 93 90 94 String title = null; … … 341 345 BioWell bw = extract.getBioWell(); 342 346 %> 343 [<%= bw.getRow()%>,<%=bw.getColumn()%>]347 [<%=rowFormatter.format(bw.getRow())%>,<%=columnFormatter.format(bw.getColumn())%>] 344 348 <% 345 349 } -
trunk/www/biomaterials/samples/edit_sample.jsp
r4730 r4869 50 50 import="net.sf.basedb.clients.web.util.HTML" 51 51 import="net.sf.basedb.util.Values" 52 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 52 53 import="net.sf.basedb.util.formatter.Formatter" 53 54 import="net.sf.basedb.clients.web.formatter.FormatterFactory" … … 93 94 List<BioPlate> recentBioPlates = (List<BioPlate>)cc.getRecent(dc, Item.BIOPLATE); 94 95 96 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 97 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 98 95 99 int activeProjectId = sc.getActiveProjectId(); 96 100 if (activeProjectId > 0) … … 363 367 Forms.addListOption(list, 1, new Option()); 364 368 list[1].value = '<%=currentBioWell.getId()*(sample == null ? 1 : -1)%>'; 365 list[1].text = '[<%= currentBioWell.getRow()%>,<%=currentBioWell.getColumn()%>]';369 list[1].text = '[<%=rowFormatter.format(currentBioWell.getRow())%>,<%=columnFormatter.format(currentBioWell.getColumn())%>]'; 366 370 list.selectedIndex = 1; 367 371 <% -
trunk/www/biomaterials/samples/index.jsp
r4730 r4869 50 50 import="net.sf.basedb.clients.web.util.HTML" 51 51 import="net.sf.basedb.util.formatter.Formatter" 52 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 52 53 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 53 54 import="java.util.Enumeration" … … 63 64 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,originalQuantity,remainingQuantity,extracts,description"); 64 65 private static final Item itemType = Item.SAMPLE; 66 67 private static void registerExportFormatters(ItemContext cc) 68 { 69 cc.setObject("export.formatter.bioWell.row", new WellCoordinateFormatter(true)); 70 cc.setObject("export.formatter.bioWell.column", new WellCoordinateFormatter(false)); 71 } 65 72 %> 66 73 <% … … 321 328 final ItemQuery<Sample> query = Sample.getQuery(); 322 329 cc.configureQuery(query, true); 330 registerExportFormatters(cc); 323 331 cc.setQuery(query); 324 332 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+samples"; … … 328 336 // Run an export plugin in single-item context 329 337 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 338 registerExportFormatters(cc); 330 339 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+sample"; 331 340 } -
trunk/www/biomaterials/samples/list_samples.jsp
r4734 r4869 44 44 import="net.sf.basedb.core.Permission" 45 45 import="net.sf.basedb.core.PermissionDeniedException" 46 import="net.sf.basedb.core.PlateGeometry" 46 47 import="net.sf.basedb.core.PluginDefinition" 47 48 import="net.sf.basedb.core.Annotation" … … 64 65 import="net.sf.basedb.util.Values" 65 66 import="net.sf.basedb.util.formatter.Formatter" 67 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 66 68 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 67 69 import="java.util.Iterator" … … 112 114 int numListed = 0; 113 115 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 116 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 117 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 118 119 Enumeration<String, String> wellRows = new Enumeration<String, String>(); 120 ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery(); 121 geometryQuery.order(Orders.desc(Hql.property("rows"))); 122 ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc); 123 int maxRows = result.next().getRows(); 124 for (int r = 0; r < maxRows; r++) 125 { 126 wellRows.add(Integer.toString(r), rowFormatter.format(r)); 127 } 114 128 %> 115 129 <base:page title="<%=title==null ? "Samples" : title%>" type="<%=mode.getPageType()%>"> … … 369 383 title="Biowell row" 370 384 filterable="true" 385 enumeration="<%=wellRows%>" 371 386 exportable="true" 372 387 sortable="true" 388 formatter="<%=rowFormatter%>" 373 389 /> 374 390 <tbl:columndef … … 381 397 exportable="true" 382 398 sortable="true" 399 formatter="<%=columnFormatter%>" 383 400 /> 384 401 <tbl:columndef … … 639 656 enablePropertyLink="<%=mode.hasPropertyLink()%>" 640 657 /></tbl:cell> 641 <tbl:cell column="bioPlate"> 642 <base:propertyvalue 643 item="<%=item%>" 644 property="bioWell.bioPlate" 645 enableEditLink="<%=mode.hasEditLink()%>" 646 enablePropertyLink="<%=mode.hasPropertyLink()%>" 647 /> 648 </tbl:cell> 649 <tbl:cell column="bioWellRow"> 650 <base:propertyvalue 651 item="<%=item%>" 652 property="bioWell.row" 653 enableEditLink="<%=mode.hasEditLink()%>" 654 enablePropertyLink="<%=mode.hasPropertyLink()%>" 655 /> 656 </tbl:cell> 657 <tbl:cell column="bioWellColumn"> 658 <base:propertyvalue 659 item="<%=item%>" 660 property="bioWell.column" 661 enableEditLink="<%=mode.hasEditLink()%>" 662 enablePropertyLink="<%=mode.hasPropertyLink()%>" 663 /> 664 </tbl:cell> 658 <% 659 BioWell well = null; 660 boolean readBioWell = true; 661 try 662 { 663 well = item.getBioWell(); 664 } 665 catch(PermissionDeniedException e) 666 { 667 readBioWell = false; 668 } 669 if (!readBioWell) 670 { 671 %> 672 <tbl:cell column="bioWellRow"><i>- denied -</i> </tbl:cell> 673 <tbl:cell column="bioWellColumn"><i>- denied -</i> </tbl:cell> 674 <tbl:cell column="bioPlate"><i>- denied -</i> </tbl:cell> 675 <% 676 } 677 else if (well == null) 678 { 679 %> 680 <tbl:cell column="bioWellRow"><i>- none -</i> </tbl:cell> 681 <tbl:cell column="bioWellColumn"><i>- none -</i> </tbl:cell> 682 <tbl:cell column="bioPlate"><i>- none -</i> </tbl:cell> 683 <% 684 685 } 686 else 687 { 688 %> 689 <tbl:cell column="bioWellRow"> 690 <tbl:cellvalue value="<%=well.getRow()%>"/> 691 </tbl:cell> 692 <tbl:cell column="bioWellColumn"> 693 <tbl:cellvalue value="<%=well.getColumn()%>"/> 694 </tbl:cell> 695 <tbl:cell column="bioPlate"><%=Base.getLinkedName(ID, well.getPlate(), false, true)%></tbl:cell> 696 <% 697 } 698 %> 665 699 <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" /> 666 700 <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" /> -
trunk/www/biomaterials/samples/view_sample.jsp
r4746 r4869 57 57 import="net.sf.basedb.util.Values" 58 58 import="net.sf.basedb.util.formatter.Formatter" 59 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 59 60 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 60 61 import="java.util.ArrayList" … … 86 87 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 87 88 89 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 90 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); 91 88 92 String title = null; 89 93 Sample sample = Sample.getById(dc, itemId); … … 323 327 BioWell bw = sample.getBioWell(); 324 328 %> 325 [<%= bw.getRow()%>,<%=bw.getColumn()%>]329 [<%=rowFormatter.format(bw.getRow())%>,<%=columnFormatter.format(bw.getColumn())%>] 326 330 <% 327 331 }
Note: See TracChangeset
for help on using the changeset viewer.