Opened 14 years ago

Closed 14 years ago

#1522 closed enhancement (fixed)

Add support for timestamp type to formulas

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 2.16
Component: core Version:
Keywords: Cc:


As a side-effect of #1512 and it's propagation to extended properties formulas can now also return timestamp values. The option is already present in the gui when creating a new formula. But it will create a date instead of a timestamp when used. A fix is needed to make various listings display a timestamp. We should also check if the various exporters can handle it. The table exporter currently throws an exception: java.sql.Timestamp cannot be cast to java.lang.Number
at net.sf.basedb.clients.web.plugins.SimpleExport.exportProperties(
at net.sf.basedb.clients.web.plugins.SimpleExport.performExport(
at net.sf.basedb.core.PluginExecutionRequest.invoke(
Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.lang.Number
at net.sf.basedb.util.formatter.NumberFormatter.format(
at net.sf.basedb.clients.web.plugins.PlainTextTemplate.writeProperty(
at net.sf.basedb.clients.web.plugins.SimpleExport.exportProperties(
... 5 more

Change History (1)

comment:1 by Nicklas Nordborg, 14 years ago

Resolution: fixed
Status: newclosed

(In [5440]) Fixes #1522: Add support for timestamp type to formulas

List pages with formulas now use the proper formatter (added FormatterFactory.getFormulaFormatter) which builds on the value type of the formula. The problem wih the table exporter was not actually related to the timestamp... but to a hard-coded Type.FLOAT value type for all formulas.

Other exporters (BaseFileExporter and BfsExporter) doesn't use formatters at all.

Note: See TracTickets for help on using tickets.