Changeset 6268


Ignore:
Timestamp:
Apr 11, 2013, 8:51:47 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

Merged patch release 3.2.2 to the trunk.

Location:
trunk
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/credits.txt

    r6214 r6268  
    11$Id$
    22
    3 The current BASE team is (at BASE 3.2.1 release)
     3The current BASE team is (at BASE 3.2.2 release)
    44{{{
    55Jari Häkkinen
  • trunk/doc/src/docbook/user/webclient.xml

    r5971 r6268  
    852852              <listitem>
    853853                <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).
    856859                </para>
    857860              </listitem>
  • trunk/src/clients/jobagent/net/sf/basedb/clients/jobagent/Agent.java

    r5827 r6268  
    4343import net.sf.basedb.clients.jobagent.slotmanager.SlotManager;
    4444import net.sf.basedb.core.Application;
     45import net.sf.basedb.core.Config;
    4546import net.sf.basedb.core.DbControl;
    4647import net.sf.basedb.core.InvalidDataException;
     
    882883    {
    883884      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");
    884887      Application.start(false);
    885888      sc = Application.newSessionControl("net.sf.basedb.clients.jobagent",
  • trunk/src/clients/web/net/sf/basedb/clients/web/formatter/FormatterFactory.java

    r5440 r6268  
    3333import net.sf.basedb.core.Unit;
    3434import net.sf.basedb.util.ColorGenerator;
     35import net.sf.basedb.util.formatter.AdaptiveNumberFormatter;
    3536import net.sf.basedb.util.formatter.BooleanFormatter;
    3637import net.sf.basedb.util.formatter.DateFormatter;
     
    7172    if (formatter == null)
    7273    {
    73       formatter = new NumberFormatter(FormatterSettings.getNumDecimals(sc), false);
     74      formatter = new AdaptiveNumberFormatter(FormatterSettings.getNumDecimals(sc), false);
    7475      sc.setSessionSetting("formatter.float", formatter);
    7576    }
     
    9495    if (formatter == null)
    9596    {
    96       formatter = new NumberFormatter(FormatterSettings.getNumDecimals(sc), true);
     97      formatter = new AdaptiveNumberFormatter(FormatterSettings.getNumDecimals(sc), true);
    9798      sc.setSessionSetting("formatter.double", formatter);
    9899    }
  • trunk/src/core/net/sf/basedb/core/BioMaterialEvent.java

    r6127 r6268  
    697697    }
    698698
    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());
    715700
    716701    return new BioMaterialEventSource(getDbControl(), src);
     
    738723    BioMaterialEventSourceData src = sources.remove(data);
    739724   
    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
    748726    if (src == null) return;
     727   
     728    ensureProductParentCorrectness(getData());
    749729   
    750730    if (src.getId() != 0) getDbControl().getHibernateSession().delete(src);
     
    759739  }
    760740
     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 
    761776  /**
    762777    Check if the biomaterial is allowed as a source.
  • trunk/src/core/net/sf/basedb/core/Install.java

    r6214 r6268  
    119119    method.
    120120  */
    121   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(111).intValue();
     121  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(112).intValue();
    122122 
    123123  public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress,
  • trunk/src/core/net/sf/basedb/core/Update.java

    r6132 r6268  
    4646import net.sf.basedb.core.data.AnyToAnyData;
    4747import net.sf.basedb.core.data.ArraySlideData;
     48import net.sf.basedb.core.data.BioMaterialEventData;
    4849import net.sf.basedb.core.data.BioMaterialEventSourceData;
    4950import net.sf.basedb.core.data.BioPlateData;
     
    6061import net.sf.basedb.core.data.ItemParameterValueData;
    6162import net.sf.basedb.core.data.ItemSubtypeData;
     63import net.sf.basedb.core.data.MeasuredBioMaterialData;
    6264import net.sf.basedb.core.data.PhysicalBioAssayData;
    6365import net.sf.basedb.core.data.ProjectData;
     
    168170    </td>
    169171  </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>
    170180  </table>
    171181
     
    274284        if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 111...");
    275285        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);
    276293        progress_current += progress_step;
    277294      }
     
    777794  }
    778795
     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 
    779840  // Item type codes for item types that was removed since BASE 2
    780841  private static final int LABELEDEXTRACT = 204;
  • trunk/src/core/net/sf/basedb/util/formatter/PrefixSuffixFormatter.java

    r6127 r6268  
    5151  private final Formatter<T> parent;
    5252  private final String suffix;
     53  private final boolean usePrefixForNull;
     54  private final boolean useSuffixForNull;
    5355 
    5456  /**
    55     Create a new formatter.
     57    Create a new formatter. Prefix and suffix are included for null values.
    5658    @param prefix The prefix, or null to not use any prefix
    5759    @param parent The parent formatter, if null a {@link ToStringFormatter}
     
    6163  public PrefixSuffixFormatter(String prefix, Formatter<T> parent, String suffix)
    6264  {
     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  {
    6381    this.prefix = prefix == null ? "" : prefix;
     82    this.usePrefixForNull = usePrefixForNull;
    6483    this.parent = parent == null ? new ToStringFormatter<T>() : parent;
    6584    this.suffix = suffix == null ? "" : suffix;
     85    this.useSuffixForNull = useSuffixForNull;
    6686  }
     87
    6788 
    6889  /*
     
    7394  public String format(T value)
    7495  {
    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();
    76101  }
    77102  @Override
  • trunk/www/biomaterials/events/list_events.jsp

    r6260 r6268  
    122122  int numListed = 0;
    123123  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
     124  Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc);
    124125  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioMaterial);
    125126  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
     
    230231        exportable="false"
    231232        unit="<%=microGram%>"
     233        formatter="<%=numericFormatter %>"
    232234      />
    233235      <tbl:columndef
     
    502504                <tbl:cell column="eventDate" value="<%=item.getEventDate()%>" />
    503505                <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)%>" />
    505507                <tbl:cell column="bioPlateEvent">
    506508                  <%
  • trunk/www/biomaterials/events/view_event.jsp

    r6261 r6268  
    5656  import="net.sf.basedb.util.Values"
    5757  import="net.sf.basedb.util.formatter.Formatter"
     58  import="net.sf.basedb.util.formatter.NumberFormatter"
     59  import="net.sf.basedb.util.formatter.PrefixSuffixFormatter"
    5860  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     61  import="net.sf.basedb.clients.web.formatter.FormatterSettings"
    5962  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    6063  import="net.sf.basedb.clients.web.extensions.JspContext"
     
    8891{
    8992  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
    9096  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
    9197
     
    261267      <tr>
    262268        <th>Used quantity</th>
    263         <td><%=Values.formatNumber(event.getUsedQuantity(bioMaterial), 2, " µg")%></td>
     269        <td><%=quantityFormatter.format(event.getUsedQuantity(bioMaterial))%></td>
    264270      </tr>
    265271      <tr>
     
    310316            <%=Base.getLinkedName(ID, source, source == null, true)%>
    311317            <%=sourceType != null ? "(" + sourceType + ")" : "" %>
    312             <%=Values.formatNumber(evtSrc.getUsedQuantity(), 2, " µg")%>
     318            <%=quantityFormatter.format(evtSrc.getUsedQuantity())%>
    313319            <br>
    314320            <%
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r6260 r6268  
    152152  int numListed = 0;
    153153  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
     154  Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc);
    154155  WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true);
    155156  WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false);
     
    338339        exportable="true"
    339340        unit="<%=microGram%>"
     341        formatter="<%=numericFormatter%>"
    340342      />
    341343      <tbl:columndef
     
    348350        exportable="true"
    349351        unit="<%=microGram%>"
     352        formatter="<%=numericFormatter%>"
    350353      />
    351354      <tbl:columndef
     
    774777                  /></tbl:cell>
    775778                <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()%>" />
    778781                <tbl:cell column="tag"
    779782                  ><base:propertyvalue
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r6261 r6268  
    6767  import="net.sf.basedb.util.formatter.Formatter"
    6868  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
     69  import="net.sf.basedb.util.formatter.PrefixSuffixFormatter"
    6970  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     71  import="net.sf.basedb.clients.web.formatter.FormatterSettings"
    7072  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    7173  import="net.sf.basedb.clients.web.extensions.JspContext"
     
    100102{
    101103  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
    102107  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
    103108 
     
    283288        <tr>
    284289          <th>Original quantity</th>
    285           <td><%=Values.formatNumber(extract.getOriginalQuantity(), 2, " µg")%></td>
     290          <td><%=quantityFormatter.format(extract.getOriginalQuantity())%></td>
    286291        </tr>
    287292        <tr>
    288293          <th class="subprompt">- remaining</th>
    289           <td><%=Values.formatNumber(extract.getRemainingQuantity(), 2, " µg")%></td>
     294          <td><%=quantityFormatter.format(extract.getRemainingQuantity())%></td>
    290295        </tr>
    291296        <tr>
     
    410415                  %>
    411416                </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>
    413418                <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell>
    414419              </tbl:row>
     
    523528                    %>
    524529                  </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>
    526531                  <tbl:cell column="description"><%=HTML.encodeTags(child == null ? "" : child.getDescription())%></tbl:cell>
    527532                </tbl:row>
  • trunk/www/biomaterials/lists/members/index.jsp

    r6192 r6268  
    204204  else if ("AddMembers".equals(cmd))
    205205  {
    206     ItemContext memberContext = sc.getCurrentContext(itemType, subContext);
     206    ItemContext memberContext = sc.getCurrentContext(itemType);
    207207    final ItemQuery<? extends BioMaterial> query = list.getAllBioMaterials();
    208208    memberContext.configureQuery(dc, query, true);
  • trunk/www/biomaterials/samples/list_samples.jsp

    r6260 r6268  
    141141  int numListed = 0;
    142142  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
     143  Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc);
    143144  WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true);
    144145  WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false);
     
    235236        exportable="true"
    236237        unit="<%=microGram%>"
     238        formatter="<%=numericFormatter%>"
    237239      />
    238240      <tbl:columndef
     
    245247        exportable="true"
    246248        unit="<%=microGram%>"
     249        formatter="<%=numericFormatter%>"
    247250      />
    248251      <tbl:columndef
     
    648651                  /></tbl:cell>
    649652                <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()%>" />
    652655                <tbl:cell column="protocol"
    653656                  ><base:propertyvalue
  • trunk/www/biomaterials/samples/view_sample.jsp

    r6260 r6268  
    6363  import="net.sf.basedb.util.formatter.Formatter"
    6464  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
     65  import="net.sf.basedb.util.formatter.PrefixSuffixFormatter"
    6566  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     67  import="net.sf.basedb.clients.web.formatter.FormatterSettings"
    6668  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    6769  import="net.sf.basedb.clients.web.extensions.JspContext"
     
    9698{
    9799  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
    98103  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
    99104
     
    271276      <tr>
    272277        <th>Original quantity</th>
    273         <td><%=Values.formatNumber(sample.getOriginalQuantity(), 2, " µg")%></td>
     278        <td><%=quantityFormatter.format(sample.getOriginalQuantity())%></td>
    274279      </tr>
    275280      <tr>
    276281        <th class="subprompt">- remaining</th>
    277         <td><%=Values.formatNumber(sample.getRemainingQuantity(), 2, " µg")%></td>
     282        <td><%=quantityFormatter.format(sample.getRemainingQuantity())%></td>
    278283      </tr>
    279284      <tr>
     
    377382                  }
    378383                  %>
    379                   </tbl:cell>
    380                   <tbl:cell column="quantity"><%=Values.formatNumber(item.getUsedQuantity(), 2)%></tbl:cell>
    381                   <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell>
    382                 </tbl:row>
    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              <%
    384389            }
    385390            %>
    386               </tbl:rows>
    387             </tbl:data>
    388           </tbl:table>
    389           <%
    390         }
    391         %>
    392         </base:section>
     391            </tbl:rows>
     392          </tbl:data>
     393        </tbl:table>
    393394        <%
     395      }
     396      %>
     397      </base:section>
     398      <%
    394399      SpecialQuery<BioMaterialEventSource> childQuery = sample.getChildCreationEvents();
    395400      childQuery.join(Hql.innerJoin("es", "event", "evt", true));
     
    461466                    %>
    462467                  </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>
    464469                  <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell>
    465470                </tbl:row>
  • trunk/www/filemanager/directories/list_directories.jsp

    r6199 r6268  
    371371    %>
    372372    <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;">
    374374      <tbl:toolbar subclass="bottomborder">
    375375        <tbl:button
     
    386386        />
    387387      </tbl:toolbar>
    388       <div id="joust" style="overflow: auto;"></div>
     388      <div id="joust" class="absolutefull" style="overflow: auto; top: 2em;"></div>
    389389    </div>
    390390    </base:body>
  • trunk/www/filemanager/files/list_files.jsp

    r6221 r6268  
    236236  int numListed = 0;
    237237  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
    238   int numDecimals = FormatterSettings.getNumDecimals(sc);
    239238  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, current);
    240239  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
     
    10101009                icon = "file_compressed.png";
    10111010              }
    1012               String fileSize = Values.formatBytes(item.getSize(), numDecimals);
     1011              String fileSize = Values.formatBytes(item.getSize(), 2);
    10131012              index++;
    10141013              numListed++;
     
    10961095                  /></tbl:cell>
    10971096                <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>
    10991098                <tbl:cell column="compressed"><%=item.isCompressed() ? "yes" : "no"%></tbl:cell>
    11001099                <tbl:cell column="writeProtected"><%=item.isWriteProtected() ? "yes" : "no"%></tbl:cell>
  • trunk/www/filemanager/files/view_file.jsp

    r6244 r6268  
    422422        <tr>
    423423          <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>
    425425        </tr>
    426426        <%
  • trunk/www/views/physicalbioassays/view_bioassay.jsp

    r6255 r6268  
    6666  import="net.sf.basedb.util.formatter.Formatter"
    6767  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     68  import="net.sf.basedb.clients.web.formatter.FormatterSettings"
    6869  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    6970  import="net.sf.basedb.clients.web.extensions.JspContext"
     
    9798{
    9899  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
     100  Formatter<Number> numberFormatter = FormatterFactory.getNumberFormatter(sc);
    99101  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
    100102
     
    419421                  </tbl:cell>
    420422                  <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>
    422424                  <tbl:cell column="description"><%=HTML.encodeTags(bm == null ? "" : bm.getDescription())%></tbl:cell>
    423425                </tbl:row>
Note: See TracChangeset for help on using the changeset viewer.