@PublicApi public abstract class AbstractDashboardGadgetHandler extends Object implements com.botronsoft.cmj.spi.configuration.gadget.DashboardGadgetHandler
DashboardGadgetHandler
implementations that want to use the DSL for describing the syntax of gadget user
preferences. Extend this class and implement the describeUserPreferences()
method to describe the syntax of all user preferences
by invoking the gadget(String)
method.Constructor and Description |
---|
AbstractDashboardGadgetHandler()
Non-argument constructor for implementations.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
describeUserPreferences()
Implement this method to describe the syntax of gadget user preferences.
|
protected UserPreferenceContainerDescriptor |
gadget(String uriOrModuleKey)
Describes the syntax of the different user preferences for a gadget.
|
protected void |
handleError(String uriOrModuleKey,
String userPreferenceName,
Throwable t)
This method will be invoked when an exception is caught during processing of a user preference.
|
protected String |
transformUnhandledUserPreferencesForExport(String uriOrModuleKey,
String userPreferenceName,
String userPreferenceValue,
Map<String,String> userPreferences,
com.botronsoft.cmj.spi.configuration.ExportContext exportContext)
This method will be invoked for each user preference that has not been described in
describeUserPreferences() . |
protected String |
transformUnhandledUserPreferencesForImport(String uriOrModuleKey,
String userPreferenceName,
String userPreferenceValue,
Map<String,String> userPreferences,
com.botronsoft.cmj.spi.configuration.ImportContext importContext)
This method will be invoked for each user preference that has not been described in
describeUserPreferences() . |
Map<String,String> |
transformUserPreferencesForExport(String uriOrModuleKey,
Map<String,String> userPreferences,
com.botronsoft.cmj.spi.configuration.ExportContext exportContext) |
Map<String,String> |
transformUserPreferencesForImport(String uriOrModuleKey,
Map<String,String> userPreferences,
com.botronsoft.cmj.spi.configuration.ImportContext importContext) |
public AbstractDashboardGadgetHandler()
public Map<String,String> transformUserPreferencesForExport(String uriOrModuleKey, Map<String,String> userPreferences, com.botronsoft.cmj.spi.configuration.ExportContext exportContext)
transformUserPreferencesForExport
in interface com.botronsoft.cmj.spi.configuration.gadget.DashboardGadgetHandler
public Map<String,String> transformUserPreferencesForImport(String uriOrModuleKey, Map<String,String> userPreferences, com.botronsoft.cmj.spi.configuration.ImportContext importContext)
transformUserPreferencesForImport
in interface com.botronsoft.cmj.spi.configuration.gadget.DashboardGadgetHandler
protected abstract void describeUserPreferences()
#gadget(String)}.
protected void handleError(String uriOrModuleKey, String userPreferenceName, Throwable t)
uriOrModuleKey
- the URI of the dashboard gadget or the module key of the dashboard item.userPreferenceName
- the name of the user preference that failed to export.t
- thrown on error.protected String transformUnhandledUserPreferencesForExport(String uriOrModuleKey, String userPreferenceName, String userPreferenceValue, Map<String,String> userPreferences, com.botronsoft.cmj.spi.configuration.ExportContext exportContext)
describeUserPreferences()
. The default
behavior is to return the same value.uriOrModuleKey
- the URI of the dashboard gadget or the module key of the dashboard item.userPreferenceName
- the name of the user preference.userPreferenceValue
- the raw value of the user preference.userPreferences
- all other raw user preferences being exported.exportContext
- the context of the export operation.protected String transformUnhandledUserPreferencesForImport(String uriOrModuleKey, String userPreferenceName, String userPreferenceValue, Map<String,String> userPreferences, com.botronsoft.cmj.spi.configuration.ImportContext importContext)
describeUserPreferences()
. The default
behavior is to return the same value.uriOrModuleKey
- the URI of the dashboard gadget or the module key of the dashboard item.userPreferenceName
- the name of the user preference.userPreferenceValue
- the raw value of the user preference.userPreferences
- all other raw user preferences being imported.importContext
- the context of the import operation.protected final UserPreferenceContainerDescriptor gadget(String uriOrModuleKey)
uriOrModuleKey
- the URI of the dashboard gadget or the module key of the dashboard item. This is the same URI that is used in the
atlassian-plugin.xml descriptor. See the Dashboards SPI public documentation for instructions on how to get the URI for
your gadget.Copyright © 2022. All rights reserved.