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 LogicalFilterTrees object describing the qualified data references for the specific data points that the data action is invoked from (see the InteractionService for details).

  • getEnvironmentContext()

    An instance of the EnvironmentContext class 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) : String

    Returns the fully qualified class name for the specified data action type.

  • getDisplayName(sPluginType:String) : String

    Returns the translated display name for the specified data action type.

  • getOrder(sPluginType:String) : Number

    Returns 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) : DataActionPluginHandler

    Constructs and returns a new instance of the DataActionHandler class.

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) : Promise

    Returns a Promise that 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) : Promise

    Carries out the upgrade on the specified data action and resolves the Promise. The upgrade itself is carried out by calling the upgrade() method on the data action (only the specific subclass of data action being upgraded is qualified to upgrade itself).

  • getOrder(sPluginType:String) : Number

    Returns a number used to sort lists of the types of data action into the preferred order.