C
- The expected cell type.M
- The expected column type.@PublicSpi
public interface ExportRendererProvider<C extends ExportCell,M extends ExportColumn<C>>
ExportRendererProvider
processes the export requests for the Structure widget columns. The required export
format is represented by an ExportFormat
instance, and a particular widget column is represented by its
ViewSpecification.Column
instance. If a renderer provider recognizes the format and the column, it must
return a non-null ExportRenderer
instance that will render the column. The renderer provider may throw a
StructureProviderException
when it is supposed to serve the export request, but unable to do so for whatever
reason, e.g. missing or invalid column configuration, insufficient permissions, or an unexpected error downstream.
In general, all column specifications are given to all interested renderer providers for examination. In
atlassian-plugin.xml
the renderer providers can be assigned to specific column keys and/or export formats.
The providers with no column key (format) associations are considered generic and used for all column keys (formats).
More specific providers have precedence over more generic ones. The providers assigned to the current column key and
export format are consulted first, then the providers for the current column key, then the providers for the current
export format, then the completely generic providers. This allows the plug-in developers to mix generic and
customized export renderers in a flexible way. The order within a specificity class is arbitrary, so if several
providers have the same specificity and return ExportRenderer
instances for the same column, it is not
defined which one of them will be used.
Single-format renderer providers and their renderers can be parameterized with the expected ExportCell
and
ExportColumn
subtypes. Generic or multiple-format providers and renderers can use the basic cell and column
types or implement the raw interfaces.
Each renderer provider is also given a ExportRequestContext
instance that corresponds to the current data
request. To render aggregate columns, the provider must call
prepareAggregate()
on the given context
. The result of the aggregate calculation will be available to the returned
ExportRenderer
instances via ExportRenderContext#getPreparedAggregates()
.
The provider can also associate arbitrary data with the current request by calling
putObject()
on the given
context
. The data will be available to ExportRenderer
instances via
ColumnContext.getObject()
. Please
note that contexts are shared between ExportRendererProvider
and ExportRenderer
instances from all
plug-ins, so we advise that you use unique keys (e.g. private singleton objects or your own enum
s) to avoid
conflicts.
ExportRenderer
Modifier and Type | Method and Description |
---|---|
ExportRenderer<C,M> |
getColumnRenderer(ExportFormat exportFormat,
ViewSpecification.Column columnSpec,
ExportRequestContext context) |
@Nullable ExportRenderer<C,M> getColumnRenderer(@NotNull ExportFormat exportFormat, @NotNull ViewSpecification.Column columnSpec, @NotNull ExportRequestContext context) throws StructureProviderException
exportFormat
- The export format.columnSpec
- The column specification.context
- The current request context.ExportRenderer
instance if this renderer provider can serve the given columnSpec
,
null
otherwise.StructureProviderException
- if this provider is supposed to serve the given column, but cannot serve it, e.g.
because of missing or invalid parameters, insufficient permissions, or for any other reason.Copyright © 2024 Tempo Software. All Rights Reserved.