API Changes in Structure 4.0
Minor Java API Release
There are a few moderate changes coming with this release. The changes are backwards-compatible, so any code using API 16.x should work fine.
JIRA Version | New API Version |
---|---|
7.1+ | 16.3.0 |
See Structure API Versions for full version information and downloads.
Compatible Changes in the Java API
BigDecimal
and BigInteger
support for NUMBER attributes
Number attributes (see ValueFormat.NUMBER
) are allowed to provide instances of BigInteger
and BigDecimal
as a result. The appropriate support was added to NumberAccumulator
for calculating totals. We're limiting the precision of the numbers to MathContext.DECIMAL64
.
Note that if your code used NUMBER attributes before and assumed that the result is either Long
or Double
, this assumption may be incorrect now.
Additional methods for formatting data in export API
The following methods were added to provide more power to the exporting code:
ExportColumn.setRounding()
PrintableColumn.setDurationAsCalendarTime()
Miscellaneous
Additional factory methods in
CoreIdentities
.
Web Items
Extendable Export Menu
We have added a new web item location that lets you insert web items into Structure's Export menu.
Location name: structure.export.menu
To add a menu item, declare a <web-item>
in that location and declare the following sub-elements:
label
- the name of the menu item, supports i18n, mandatory.link
- the URL of the target page, mandatory. You can use${forestSpec}
in the URL, which will be replaced with the URL-encoded JSON representation of the forest spec currently opened. If your URL does not have${forestSpec}
in it, then forestSpec will be added to the URL as a query parameter.tooltip
- the tooltip shown when mouse hovers over the item, supports i18n, optional.styleClass
- a space-delimited CSS class names for the <i> icon element before the name, optional, defaults to a Structure-provided icon.weight
attribute - defines the order of appearance of the links, optional.condition
/conditions
- can be used to display the links conditionally.context-provider
- can be used to add additional variables to the link labels or URL.