Data Action Service Classes
There are several different data action service classes.
DataActionManager
All communication with DataActionManager uses
ClientEvents.DataActionManager which
implements event handlers for:
- Managing the set of data actions defined in the current workbook.
- Invoking a data action.
- Retrieving all the data actions defined in the current workbook.
- Retrieving all the data actions that are applicable to the current marked data points.
DataActionContext, EnvironmentContext
When a data action is invoked, the DataActionContext
class contains the context that's passed to the target.
getColumnValueMap()Returns a map of attribute column values keyed by attribute column names. These define the qualified data reference for the data points that the data action is invoked from.
getLogicalFilterTrees()Returns a
LogicalFilterTreesobject describing the qualified data references for the specific data points that the data action is invoked from (see theInteractionServicefor details).getEnvironmentContext()An instance of the
EnvironmentContextclass describing the source environment such as:getProjectPath()getCanvasName()getUserID()getUserName()
getReport()Returns the report that the data action is invoked from.
DataActionHandler
The DataActionHandler class registers the various data
action extensions. Its API is broadly consistent with the other extension handlers
(for example, VisualizationHandler).
The DataActionHandler class provides the following public
methods:
getClassName(sPluginType:String) : StringReturns the fully qualified class name for the specified data action type.
getDisplayName(sPluginType:String) : StringReturns the translated display name for the specified data action type.
getOrder(sPluginType:String) : NumberReturns a number used to sort lists of the types of data action into the preferred order.
The DataActionHandler class provides the following static
methods:
getDependencies(oPluginRegistry:Object) : Object.<String, Array>Returns a dependency map covering all the registered data action types.
getHandler(oPluginRegistry:Object, sExtensionPointName:String, oConfig:Object) : DataActionPluginHandlerConstructs and returns a new instance of the
DataActionHandlerclass.
DataActionUpgradeHandler
The DataActionUpgradeHandler class is called by the
UpgradeService when a report is opened.
The DataActionHandler class provides two main methods:
deferredNeedsUpgrade(sCurrentVersion, sUpgradeTopic, oDataActionJS, oActionContext) : PromiseReturns a
Promisethat resolves to a Boolean indicating whether the specified data action must be upgraded (true) or not (false). The method decides whether the data action must be upgraded by comparing the data action instance with the data action's constructor.performUpgrade(sCurrentVersion, sUpgradeTopic, oDataActionJS, oActionContext, oUpgradeContext) : PromiseCarries out the upgrade on the specified data action and resolves the
Promise. The upgrade itself is carried out by calling theupgrade()method on the data action (only the specific subclass of data action being upgraded is qualified to upgrade itself).getOrder(sPluginType:String) : NumberReturns a number used to sort lists of the types of data action into the preferred order.
