Changeset 6268
- Timestamp:
- Apr 11, 2013, 8:51:47 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.2-stable merged: 6213,6226,6248-6253,6263-6265 /tags/3.2.2 (added) merged: 6266
- Property svn:mergeinfo changed
-
trunk/credits.txt
r6214 r6268 1 1 $Id$ 2 2 3 The current BASE team is (at BASE 3.2. 1release)3 The current BASE team is (at BASE 3.2.2 release) 4 4 {{{ 5 5 Jari Häkkinen -
trunk/doc/src/docbook/user/webclient.xml
r5971 r6268 852 852 <listitem> 853 853 <para> 854 The number of decimals to display for numerical floating point values. 855 The default is 2. 854 The base number of decimals to display for numerical floating point values. 855 The default is 2. This setting is used for values between 1 and 10. For higher 856 or lower values, the number of decimals is adapted in order to not loose 857 information (eg. 0.0059 instead of 0.01) or give the impression of very 858 high precision (eg. 135000 instead of 135000.00). 856 859 </para> 857 860 </listitem> -
trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java
r5827 r6268 43 43 import net.sf.basedb.clients.jobagent.slotmanager.SlotManager; 44 44 import net.sf.basedb.core.Application; 45 import net.sf.basedb.core.Config; 45 46 import net.sf.basedb.core.DbControl; 46 47 import net.sf.basedb.core.InvalidDataException; … … 882 883 { 883 884 log.info("Starting BASE application"); 885 // Disable database cleanup script, it is only needed on the web client 886 Config.setProperty("db.cleanup.interval", "0"); 884 887 Application.start(false); 885 888 sc = Application.newSessionControl("net.sf.basedb.clients.jobagent", -
trunk/src/clients/web/net/sf/basedb/clients/web/formatter/FormatterFactory.java
r5440 r6268 33 33 import net.sf.basedb.core.Unit; 34 34 import net.sf.basedb.util.ColorGenerator; 35 import net.sf.basedb.util.formatter.AdaptiveNumberFormatter; 35 36 import net.sf.basedb.util.formatter.BooleanFormatter; 36 37 import net.sf.basedb.util.formatter.DateFormatter; … … 71 72 if (formatter == null) 72 73 { 73 formatter = new NumberFormatter(FormatterSettings.getNumDecimals(sc), false);74 formatter = new AdaptiveNumberFormatter(FormatterSettings.getNumDecimals(sc), false); 74 75 sc.setSessionSetting("formatter.float", formatter); 75 76 } … … 94 95 if (formatter == null) 95 96 { 96 formatter = new NumberFormatter(FormatterSettings.getNumDecimals(sc), true);97 formatter = new AdaptiveNumberFormatter(FormatterSettings.getNumDecimals(sc), true); 97 98 sc.setSessionSetting("formatter.double", formatter); 98 99 } -
trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java
r6127 r6268 697 697 } 698 698 699 if (getData().getBioMaterial() != null) 700 { 701 // If the product is a biomaterial we may need to set parent + parent type 702 MeasuredBioMaterialData product = getData().getBioMaterial(); 703 if (sources.size() == 1) 704 { 705 // This is the first parent 706 product.setParentType(bioMaterial.getType().getValue()); 707 product.setParent(bmData); 708 } 709 else 710 { 711 // Clear if we get more than one parent 712 product.setParent(null); 713 } 714 } 699 ensureProductParentCorrectness(getData()); 715 700 716 701 return new BioMaterialEventSource(getDbControl(), src); … … 738 723 BioMaterialEventSourceData src = sources.remove(data); 739 724 740 if (sources.size() == 0) 741 { 742 if (getData().getBioMaterial() != null) 743 { 744 getData().getBioMaterial().setParentType(null); 745 } 746 } 747 725 // Early exit if no change 748 726 if (src == null) return; 727 728 ensureProductParentCorrectness(getData()); 749 729 750 730 if (src.getId() != 0) getDbControl().getHibernateSession().delete(src); … … 759 739 } 760 740 741 /** 742 Ensure that the {@link MeasuredBioMaterial#getParent()} 743 and {@link MeasuredBioMaterial#getParentType()} reflect the current 744 sources collection. 745 */ 746 static void ensureProductParentCorrectness(BioMaterialEventData event) 747 { 748 MeasuredBioMaterialData product = event.getBioMaterial(); 749 if (product != null) 750 { 751 // If the product is a biomaterial we may need to set parent + parent type 752 Map<BioMaterialData, BioMaterialEventSourceData> sources = event.getSources(); 753 int numSources = sources.size(); 754 755 if (numSources == 0) 756 { 757 // Clear parent type and parent item 758 product.setParentType(null); 759 product.setParent(null); 760 } 761 else if (numSources == 1) 762 { 763 // This is the only parent 764 BioMaterialData parent = sources.keySet().iterator().next(); 765 product.setParentType(Item.fromDataObject(parent).getValue()); 766 product.setParent(parent); 767 } 768 else 769 { 770 // Clear if we get more than one parent 771 product.setParent(null); 772 } 773 } 774 } 775 761 776 /** 762 777 Check if the biomaterial is allowed as a source. -
trunk/src/core/net/sf/basedb/core/Install.java
r6214 r6268 119 119 method. 120 120 */ 121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(11 1).intValue();121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(112).intValue(); 122 122 123 123 public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress, -
trunk/src/core/net/sf/basedb/core/Update.java
r6132 r6268 46 46 import net.sf.basedb.core.data.AnyToAnyData; 47 47 import net.sf.basedb.core.data.ArraySlideData; 48 import net.sf.basedb.core.data.BioMaterialEventData; 48 49 import net.sf.basedb.core.data.BioMaterialEventSourceData; 49 50 import net.sf.basedb.core.data.BioPlateData; … … 60 61 import net.sf.basedb.core.data.ItemParameterValueData; 61 62 import net.sf.basedb.core.data.ItemSubtypeData; 63 import net.sf.basedb.core.data.MeasuredBioMaterialData; 62 64 import net.sf.basedb.core.data.PhysicalBioAssayData; 63 65 import net.sf.basedb.core.data.ProjectData; … … 168 170 </td> 169 171 </tr> 172 <tr> 173 <td>112</td> 174 <td> 175 Not an actual database schema change, but we need to fix the parent_id and parent_type 176 columns in the BioMaterials table to really reflect what is in the BioMaterialEventSources2 177 table. For more info see BASE ticket: http://base.thep.lu.se/ticket/1745 178 </td> 179 </tr> 170 180 </table> 171 181 … … 274 284 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 111..."); 275 285 schemaVersion = updateToSchemaVersion111(session, progress); 286 progress_current += progress_step; 287 } 288 289 if (schemaVersion < 112) 290 { 291 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 112..."); 292 schemaVersion = updateToSchemaVersion112(session, progress); 276 293 progress_current += progress_step; 277 294 } … … 777 794 } 778 795 796 /** 797 Ensure that parent_id and parent_type in BioMaterials table is correct 798 when compared to BioMaterialEventSources2 table. 799 @return The new schema version (=112) 800 */ 801 private static int updateToSchemaVersion112(org.hibernate.Session session, final ProgressReporter progress) 802 throws BaseException 803 { 804 final int schemaVersion = 112; 805 org.hibernate.Transaction tx = null; 806 try 807 { 808 tx = HibernateUtil.newTransaction(session); 809 810 // Get all BioMaterial that has null in parent_id and/or parent_type 811 String hql = "select bm.creationEvent from MeasuredBioMaterialData bm" + 812 " where bm.parent is null or bm.parentType is null"; 813 814 org.hibernate.Query query = HibernateUtil.createQuery(session, hql); 815 List<BioMaterialEventData> events = HibernateUtil.loadList(BioMaterialEventData.class, query, null); 816 int i = 0; 817 for (BioMaterialEventData event : events) 818 { 819 BioMaterialEvent.ensureProductParentCorrectness(event); 820 i++; 821 } 822 823 // Update the schema version number 824 setSchemaVersion(session, schemaVersion); 825 826 // Commit the changes 827 HibernateUtil.commit(tx); 828 log.info("updateToSchemaVersion112: OK"); 829 } 830 catch (RuntimeException ex) 831 { 832 if (tx != null) HibernateUtil.rollback(tx); 833 log.error("updateToSchemaVersion112: FAILED", ex); 834 throw ex; 835 } 836 return schemaVersion; 837 } 838 839 779 840 // Item type codes for item types that was removed since BASE 2 780 841 private static final int LABELEDEXTRACT = 204; -
trunk/src/core/net/sf/basedb/util/formatter/PrefixSuffixFormatter.java
r6127 r6268 51 51 private final Formatter<T> parent; 52 52 private final String suffix; 53 private final boolean usePrefixForNull; 54 private final boolean useSuffixForNull; 53 55 54 56 /** 55 Create a new formatter. 57 Create a new formatter. Prefix and suffix are included for null values. 56 58 @param prefix The prefix, or null to not use any prefix 57 59 @param parent The parent formatter, if null a {@link ToStringFormatter} … … 61 63 public PrefixSuffixFormatter(String prefix, Formatter<T> parent, String suffix) 62 64 { 65 this(prefix, true, parent, suffix, true); 66 } 67 68 /** 69 Create a new formatter. 70 @param prefix The prefix, or null to not use any prefix 71 @param usePrefixForNull If set, the prefix is always included, otherwise only for non-null 72 values 73 @param parent The parent formatter, if null a {@link ToStringFormatter} 74 is automatically created 75 @param suffix The suffix, or null to not use any suffix 76 @param useSuffixForNull If set, the suffix is always included, otherwise only for non-null 77 values 78 */ 79 public PrefixSuffixFormatter(String prefix, boolean usePrefixForNull, Formatter<T> parent, String suffix, boolean useSuffixForNull) 80 { 63 81 this.prefix = prefix == null ? "" : prefix; 82 this.usePrefixForNull = usePrefixForNull; 64 83 this.parent = parent == null ? new ToStringFormatter<T>() : parent; 65 84 this.suffix = suffix == null ? "" : suffix; 85 this.useSuffixForNull = useSuffixForNull; 66 86 } 87 67 88 68 89 /* … … 73 94 public String format(T value) 74 95 { 75 return prefix + parent.format(value) + suffix; 96 StringBuilder sb = new StringBuilder(); 97 if (value != null || usePrefixForNull) sb.append(prefix); 98 sb.append(parent.format(value)); 99 if (value != null || useSuffixForNull) sb.append(suffix); 100 return sb.toString(); 76 101 } 77 102 @Override -
trunk/www/biomaterials/events/list_events.jsp
r6260 r6268 122 122 int numListed = 0; 123 123 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 124 Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc); 124 125 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioMaterial); 125 126 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); … … 230 231 exportable="false" 231 232 unit="<%=microGram%>" 233 formatter="<%=numericFormatter %>" 232 234 /> 233 235 <tbl:columndef … … 502 504 <tbl:cell column="eventDate" value="<%=item.getEventDate()%>" /> 503 505 <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" /> 504 <tbl:cell column="quantity" ><%=Values.formatNumber(item.getUsedQuantity(bioMaterial), 2)%></tbl:cell>506 <tbl:cell column="quantity" value="<%=item.getUsedQuantity(bioMaterial)%>" /> 505 507 <tbl:cell column="bioPlateEvent"> 506 508 <% -
trunk/www/biomaterials/events/view_event.jsp
r6261 r6268 56 56 import="net.sf.basedb.util.Values" 57 57 import="net.sf.basedb.util.formatter.Formatter" 58 import="net.sf.basedb.util.formatter.NumberFormatter" 59 import="net.sf.basedb.util.formatter.PrefixSuffixFormatter" 58 60 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 61 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 59 62 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 60 63 import="net.sf.basedb.clients.web.extensions.JspContext" … … 88 91 { 89 92 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 93 Formatter<Number> numberFormatter = FormatterFactory.getNumberFormatter(sc); 94 Formatter<Number> quantityFormatter = new PrefixSuffixFormatter(null, false, numberFormatter, " µg", false); 95 90 96 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 91 97 … … 261 267 <tr> 262 268 <th>Used quantity</th> 263 <td><%= Values.formatNumber(event.getUsedQuantity(bioMaterial), 2, " µg")%></td>269 <td><%=quantityFormatter.format(event.getUsedQuantity(bioMaterial))%></td> 264 270 </tr> 265 271 <tr> … … 310 316 <%=Base.getLinkedName(ID, source, source == null, true)%> 311 317 <%=sourceType != null ? "(" + sourceType + ")" : "" %> 312 <%= Values.formatNumber(evtSrc.getUsedQuantity(), 2, " µg")%>318 <%=quantityFormatter.format(evtSrc.getUsedQuantity())%> 313 319 <br> 314 320 <% -
trunk/www/biomaterials/extracts/list_extracts.jsp
r6260 r6268 152 152 int numListed = 0; 153 153 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 154 Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc); 154 155 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 155 156 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); … … 338 339 exportable="true" 339 340 unit="<%=microGram%>" 341 formatter="<%=numericFormatter%>" 340 342 /> 341 343 <tbl:columndef … … 348 350 exportable="true" 349 351 unit="<%=microGram%>" 352 formatter="<%=numericFormatter%>" 350 353 /> 351 354 <tbl:columndef … … 774 777 /></tbl:cell> 775 778 <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell> 776 <tbl:cell column="originalQuantity" ><%=Values.formatNumber(item.getOriginalQuantity(), 2)%></tbl:cell>777 <tbl:cell column="remainingQuantity" ><%=Values.formatNumber(item.getRemainingQuantity(), 2)%></tbl:cell>779 <tbl:cell column="originalQuantity" value="<%=item.getOriginalQuantity()%>" /> 780 <tbl:cell column="remainingQuantity" value="<%=item.getRemainingQuantity()%>" /> 778 781 <tbl:cell column="tag" 779 782 ><base:propertyvalue -
trunk/www/biomaterials/extracts/view_extract.jsp
r6261 r6268 67 67 import="net.sf.basedb.util.formatter.Formatter" 68 68 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 69 import="net.sf.basedb.util.formatter.PrefixSuffixFormatter" 69 70 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 71 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 70 72 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 71 73 import="net.sf.basedb.clients.web.extensions.JspContext" … … 100 102 { 101 103 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 104 Formatter<Number> numberFormatter = FormatterFactory.getNumberFormatter(sc); 105 Formatter<Number> quantityFormatter = new PrefixSuffixFormatter(null, false, numberFormatter, " µg", false); 106 102 107 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 103 108 … … 283 288 <tr> 284 289 <th>Original quantity</th> 285 <td><%= Values.formatNumber(extract.getOriginalQuantity(), 2, " µg")%></td>290 <td><%=quantityFormatter.format(extract.getOriginalQuantity())%></td> 286 291 </tr> 287 292 <tr> 288 293 <th class="subprompt">- remaining</th> 289 <td><%= Values.formatNumber(extract.getRemainingQuantity(), 2, " µg")%></td>294 <td><%=quantityFormatter.format(extract.getRemainingQuantity())%></td> 290 295 </tr> 291 296 <tr> … … 410 415 %> 411 416 </tbl:cell> 412 <tbl:cell column="quantity"><%= Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>417 <tbl:cell column="quantity"><%=numberFormatter.format(item.getUsedQuantity())%></tbl:cell> 413 418 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell> 414 419 </tbl:row> … … 523 528 %> 524 529 </tbl:cell> 525 <tbl:cell column="quantity"><%= Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>530 <tbl:cell column="quantity"><%=numberFormatter.format(item.getUsedQuantity())%></tbl:cell> 526 531 <tbl:cell column="description"><%=HTML.encodeTags(child == null ? "" : child.getDescription())%></tbl:cell> 527 532 </tbl:row> -
trunk/www/biomaterials/lists/members/index.jsp
r6192 r6268 204 204 else if ("AddMembers".equals(cmd)) 205 205 { 206 ItemContext memberContext = sc.getCurrentContext(itemType , subContext);206 ItemContext memberContext = sc.getCurrentContext(itemType); 207 207 final ItemQuery<? extends BioMaterial> query = list.getAllBioMaterials(); 208 208 memberContext.configureQuery(dc, query, true); -
trunk/www/biomaterials/samples/list_samples.jsp
r6260 r6268 141 141 int numListed = 0; 142 142 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 143 Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc); 143 144 WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); 144 145 WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); … … 235 236 exportable="true" 236 237 unit="<%=microGram%>" 238 formatter="<%=numericFormatter%>" 237 239 /> 238 240 <tbl:columndef … … 245 247 exportable="true" 246 248 unit="<%=microGram%>" 249 formatter="<%=numericFormatter%>" 247 250 /> 248 251 <tbl:columndef … … 648 651 /></tbl:cell> 649 652 <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell> 650 <tbl:cell column="originalQuantity" ><%=Values.formatNumber(item.getOriginalQuantity(), 2)%></tbl:cell>651 <tbl:cell column="remainingQuantity" ><%=Values.formatNumber(item.getRemainingQuantity(), 2)%></tbl:cell>653 <tbl:cell column="originalQuantity" value="<%=item.getOriginalQuantity()%>" /> 654 <tbl:cell column="remainingQuantity" value="<%=item.getRemainingQuantity()%>" /> 652 655 <tbl:cell column="protocol" 653 656 ><base:propertyvalue -
trunk/www/biomaterials/samples/view_sample.jsp
r6260 r6268 63 63 import="net.sf.basedb.util.formatter.Formatter" 64 64 import="net.sf.basedb.util.formatter.WellCoordinateFormatter" 65 import="net.sf.basedb.util.formatter.PrefixSuffixFormatter" 65 66 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 67 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 66 68 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 67 69 import="net.sf.basedb.clients.web.extensions.JspContext" … … 96 98 { 97 99 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 100 Formatter<Number> numberFormatter = FormatterFactory.getNumberFormatter(sc); 101 Formatter<Number> quantityFormatter = new PrefixSuffixFormatter(null, false, numberFormatter, " µg", false); 102 98 103 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 99 104 … … 271 276 <tr> 272 277 <th>Original quantity</th> 273 <td><%= Values.formatNumber(sample.getOriginalQuantity(), 2, " µg")%></td>278 <td><%=quantityFormatter.format(sample.getOriginalQuantity())%></td> 274 279 </tr> 275 280 <tr> 276 281 <th class="subprompt">- remaining</th> 277 <td><%= Values.formatNumber(sample.getRemainingQuantity(), 2, " µg")%></td>282 <td><%=quantityFormatter.format(sample.getRemainingQuantity())%></td> 278 283 </tr> 279 284 <tr> … … 377 382 } 378 383 %> 379 380 <tbl:cell column="quantity"><%=Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>381 382 383 384 </tbl:cell> 385 <tbl:cell column="quantity"><%=numberFormatter.format(item.getUsedQuantity())%></tbl:cell> 386 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell> 387 </tbl:row> 388 <% 384 389 } 385 390 %> 386 </tbl:rows> 387 </tbl:data> 388 </tbl:table> 389 <% 390 } 391 %> 392 </base:section> 391 </tbl:rows> 392 </tbl:data> 393 </tbl:table> 393 394 <% 395 } 396 %> 397 </base:section> 398 <% 394 399 SpecialQuery<BioMaterialEventSource> childQuery = sample.getChildCreationEvents(); 395 400 childQuery.join(Hql.innerJoin("es", "event", "evt", true)); … … 461 466 %> 462 467 </tbl:cell> 463 <tbl:cell column="quantity"><%= Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>468 <tbl:cell column="quantity"><%=numberFormatter.format(item.getUsedQuantity())%></tbl:cell> 464 469 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell> 465 470 </tbl:row> -
trunk/www/filemanager/directories/list_directories.jsp
r6199 r6268 371 371 %> 372 372 <base:body onload="initialise()"> 373 <div id="main" class="absolutefull joust auto-init" data-auto-init="drag-support" >373 <div id="main" class="absolutefull joust auto-init" data-auto-init="drag-support" style="overflow: hidden;"> 374 374 <tbl:toolbar subclass="bottomborder"> 375 375 <tbl:button … … 386 386 /> 387 387 </tbl:toolbar> 388 <div id="joust" style="overflow: auto;"></div>388 <div id="joust" class="absolutefull" style="overflow: auto; top: 2em;"></div> 389 389 </div> 390 390 </base:body> -
trunk/www/filemanager/files/list_files.jsp
r6221 r6268 236 236 int numListed = 0; 237 237 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 238 int numDecimals = FormatterSettings.getNumDecimals(sc);239 238 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, current); 240 239 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); … … 1010 1009 icon = "file_compressed.png"; 1011 1010 } 1012 String fileSize = Values.formatBytes(item.getSize(), numDecimals);1011 String fileSize = Values.formatBytes(item.getSize(), 2); 1013 1012 index++; 1014 1013 numListed++; … … 1096 1095 /></tbl:cell> 1097 1096 <tbl:cell column="size"><span title="<%=item.getSize()%> bytes"><%=fileSize%></span></tbl:cell> 1098 <tbl:cell column="compressedSize"><span title="<%=item.getCompressedSize()%> bytes"><%=Values.formatBytes(item.getCompressedSize(), numDecimals)%></span></tbl:cell>1097 <tbl:cell column="compressedSize"><span title="<%=item.getCompressedSize()%> bytes"><%=Values.formatBytes(item.getCompressedSize(), 2)%></span></tbl:cell> 1099 1098 <tbl:cell column="compressed"><%=item.isCompressed() ? "yes" : "no"%></tbl:cell> 1100 1099 <tbl:cell column="writeProtected"><%=item.isWriteProtected() ? "yes" : "no"%></tbl:cell> -
trunk/www/filemanager/files/view_file.jsp
r6244 r6268 422 422 <tr> 423 423 <th class="subprompt">- compressed size</th> 424 <td title="<%=file.getCompressedSize()%> bytes"><%=Values.formatBytes(file.getCompressedSize() )%></td>424 <td title="<%=file.getCompressedSize()%> bytes"><%=Values.formatBytes(file.getCompressedSize(), 2)%></td> 425 425 </tr> 426 426 <% -
trunk/www/views/physicalbioassays/view_bioassay.jsp
r6255 r6268 66 66 import="net.sf.basedb.util.formatter.Formatter" 67 67 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 68 import="net.sf.basedb.clients.web.formatter.FormatterSettings" 68 69 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 69 70 import="net.sf.basedb.clients.web.extensions.JspContext" … … 97 98 { 98 99 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 100 Formatter<Number> numberFormatter = FormatterFactory.getNumberFormatter(sc); 99 101 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); 100 102 … … 419 421 </tbl:cell> 420 422 <tbl:cell column="tag" visible="<%=bm != null && bm.getType() == Item.EXTRACT%>"><base:propertyvalue item="<%=bm%>" property="tag" /></tbl:cell> 421 <tbl:cell column="quantity"><%= Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>423 <tbl:cell column="quantity"><%=numberFormatter.format(item.getUsedQuantity())%></tbl:cell> 422 424 <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell> 423 425 </tbl:row>
Note: See TracChangeset
for help on using the changeset viewer.