1. 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.2+ | 16.6.0 |
See Structure API Versions for full version information and downloads.
2. Compatible Changes in the Java API
2.1. Attribute API changes
Support for aggregation over subtree part has been added. Four subtree part kinds are supported:
CHILDREN
– direct children onlyLEAVES
– leaf forest rows onlySTRICT
– full subtree without root nodeSUBTREE
– full subtree
CoreAttributeSpecs.Param
; behavior is described in ReductionStrategy
. One can apply behavior to loader by subclassing ReducingAggregateLoader
and overriding ValueReducer.reduce
method (and other ValueReducer
methods if convenient). Chosen subtree part is specified by AttributeSpec
parameter 'type' (CoreAttributeSpecs.Param.TYPE
) and defaults to SUBTREE
.LongSumLoader
(changed)NumberSumLoader
(changed)AbstractDistinctSumLoader
(changed)
To support this change some other changes have been made:
Since distinct loaders can now accept parameters
DistinctAttributes.NON_UNIQUE_ITEMS_SPEC
has been deprecated andDistinctAttributes
was marked as@Internal.
Handy
SingleDependencyReducingAggregateLoader
(subclass ofReducingAggregateLoader
) was added.Class
SecureSingleDependencyReducingAggregateLoader
aggregates values from subtree part, replacing value toAttributeValue.undefined()
if user shouldn't have access to data by security reasons.AttributeLoaderSecurity
encapsulates security checks. Can be used whenSecureSingleDependencyReducingAggregateLoader
isn't applicable.AttributeValue.isEmpty()
is a shortcut for!AttributeValue.isDefined() && AttributeValue.getLoaderData(Object.class) == null
AttributeValue.ofNullable()
is a shortcut forvalue == null ? AttributeValue.undefined() : AttributeValue.of(value)
NumberAccumulator.toNumber()
is a shortcut forNumberAccumulator.toValue().getValue()
AbstractAggregateLoader.firstChildError()
method traverses errors throughAttributeLoader.Aggregate
. Used to transmit formula errors (other loaders currently don't supply error values).
2.2. ForestSpec
-sensitive attributes
Attribute values can now depend on the forest spec for which the attribute is requested. Two new methods have been added to AttributeContext
to support this:
getBaseForestSpec()
returns theForestSpec
, if there is one;getBaseStructureId()
returns the structure ID part of the base forest spec.
Also there is a new version of StructureAttributeSpec.getAttributeValues()
, marked @Internal
.
The Notes column introduced in Structure 4.1 now uses the base forest spec instead of the structureId
parameter, which has been removed.
2.3. Jira Service Desk Request Type support
A constant and a static method have been added to support the Request Type from Jira Service Desk as a separate item type:
CoreItemTypes.REQUEST_TYPE
CoreIdentities.sdRequestType()
2.4. Miscellaneous
Added
GenerationContext.getForestSpec()
, which returns the forest spec being generated.ValueFormat.ANY
, introduced in version 16.5.0, is now supported by the REST API.Added new versions of
ForestAccessCache.getInvisibleRows()
which acceptLongSizedIterable
as input. The old methods acceptingLongList
are now@Deprecated
, kept only for binary compatibility.ArrayForest.moveSubtreeAtIndex()
now returns -1 if no move is needed, i.e. the subtree is already at the given location.@NotNull
and@Nullable
annotations have been added in multiple places to clarify nullability contracts.