Choose the Best Data Action Class to Extend

Before you start writing your custom data action plug-in, decide which of the existing data action classes you want to extend. Choose the data action class that provides functionality that most closely matches what you want your data action to do.

Each data action inherits from the AbstractDataAction class as shown in the class diagram. The class diagram shows the two abstract data action classes (AbstractDataAction and AbstractHTTPDataAction) and the four concrete data action classes (CanvasDataAction, URLNavigationDataAction, HTTPAPIDataAction, and EventDataAction) that you can extend. Each data action that you provide must extend one of these classes. Which class you extend depends on the behavior you want to implement when you invoke your data action. Most third-party data actions are likely to extend either URLNavigationDataAction, HTTPAPIDataAction or EventDataAction.

Regardless of which class you extend, when your data action is invoked, you're provided with metadata describing the full context of the data-point from which the data action is invoked. See Data Action Context.

AbstractDataAction Class

AbstractDataAction is the abstract base class from which all types of data action inherit. It's responsible for providing common functionality and default behavior that the subclasses can use.

AbstractDataAction

All types of data action are subclasses of the AbstractDataAction base class. It provides the core set of functionality common to all data actions. Unless you're creating a complex data action that carries out multiple types of action when invoked, or you need to do something not supported by the concrete classes, you shouldn't extend this class directly. If you need to create a complex data action then consider extending the concrete class that most closely provides the functionality you require.

AbstractDataAction Syntax

+ AbstractDataAction(oKOModel)

+ getKOViewModel():DataActionKOModel

+ createFromJS(fDataActionConstructor, sClassName, oDataActionKOModelUS) : AbstractDataAction
+ invoke(oActionContext, oDataActionContext)
+ getGadgetInfos(oReport) : AbstractGadgetInfo[]
+ validate() : DataActionError
+ getSettings() : Object
+ requiresActionContextToInvoke() : Boolean
+ isAllowedHere() : Boolean
# createNameGadgetInfo(oReport) : AbstractGadgetInfo
# createAnchorToGadgetInfo(oReport) : AbstractGadgetInfo
# createPassValuesGadgetInfo(oReport) : AbstractGadgetInfo

DataActionKOModel Class

Each subclass of AbstractDataAction is likely to create its own subclass of DataActionKOModel. The DataActionKOModel base class provides the following properties:

DataActionKOModel, ValuePassingMode

  • sID:String

    The unique ID given to the data action instance.

  • sClass:String

    The class name of this specific type of data action.

  • sName:String

    The display name given to the data action instance.

  • sVersion
  • sScopeID
  • eValuePassingMode:ValuePassingMode

    The mode used when passing context values. The mode can be one of the ValuePassingMode values (ALL, ANCHOR_DATA, NONE, CUSTOM).

  • aAnchorToColumns: ColumnKOViewModel[]

    The columns that this data action is anchored to. This is optional. If not supplied, then the data action is available on all columns.

  • aContextColumns : ColumnKOViewModel[]

    The columns that this data action includes in the context passed to the data action target when the data action is invoked. If not supplied, all marked columns are included in the context.

CanvasDataAction Class

CanvasDataAction is a subclass of the AbstractDataAction base class. You can extend this concrete class to provide the functionality you require.

CanvasDataAction

Use the CanvasDataAction class to navigate from a data point in a visualization to a different canvas. The canvas you're navigating to can be in the same workbook or a different one. All the active filters for the source visualization are passed to the target canvas along with new filters that describe the Qualified Data Reference of the data point itself. If your data action needs to navigate to a different canvas then this is the class your data action should extend.

+ CanvasDataAction(oKOModel)

+ create(s)ID_sName) : CanvasDataAction
+ upgrade(oOldDataActionJS) : Object

+ invoke(oActionContext: ActionContext, oDataActionContext:DataActionContext)
+ getGadgetInfos(oReport) : AbstractGadgetInfo[]
+ validate() : DataActionError
# createProjectGadgetInfo(oReport) : AbstractGadgetInfo
# createCanvasGadgetInfo(oReport) : AbstractGadgetInfo

EventDataAction Class

EventDataAction is a subclass of the AbstractDataAction base class. You can extend this concrete class to provide the functionality you require.

EventDataAction

Use the EventDataAction class to publish a client-side event. You can then register one or more subscribers that listen for that event and perform their own actions. Use this type of data action in more complex use cases where you've a large amount of code and can benefit from keeping your data action code loosely coupled to the code that performs the necessary actions when the data action is invoked.

+ EventDataAction(oKOModel)

+ create(sID_sName) : EventDataAction
+ upgrade(oOldDataActionJS) : Object
+ invoke(oActionContext: ActionContext, oDataActionContext:DataActionContext)
+ getGadgetInfos(oReport) : AbstractGadgetInfo[]
+ validate() : DataActionError
# createEventGadgetInfo(oReport) : AbstractGadgetInfo

AbstractHTTPDataAction Class

AbstractHTTPDataAction is the abstract base class that the URLNavigationDataAction and HTTPAPIDataAction subclasses inherit common functionality and default behavior from.

AbstractHTTPDataAction

The AbstractHTTPDataAction abstract base class is shared by both the URLNavigationDataAction and HTTPAPIDataAction classes. If your data action needs to open a web page in a new browser tab you must extend URLNavigationDataAction. If your data action needs to invoke an HTTP API then you should extend HTTPAPIDataAction. You may decide it's better to extend AbstractHTTPDataAction directly.

+ HTTPDataAction(oKOModel)
+ validate() : DataActionError
# createURLGadgetInfo(oReport) : AbstractGadgetInfo

URLNavigationDataAction Class

URLNavigationDataAction is a subclass or the AbstractHTTPDataAction base class.

URLNavigationDataAction

Use the URLNavigationDataAction class to open a specific URL in a new browser tab. You compose the URL using tokens that are replaced with values derived from data points that the user selects when they invoke the data action. The data point values are passed as part of the data action context to the external web page. For example, create a data action invoked using a CustomerID column that opens a customer's web page in your Customer Relations Management application such as Oracle Sales Cloud.

+ URLNavigationDataAction(oKOModel)
+ create(sID_sName) : URLNavigationDataAction
+ upgrade(oOldDataActionJS) : Object
+ invoke(oActionContext: ActionContext, oDataActionContext:DataActionContext)
+ getGadgetInfos(oReport) : AbstractGadgetInfo[]

HTTPAPIDataAction Class

HTTPAPIDataAction is a subclass or the AbstractHTTPDataAction base class. You can extend this concrete class to provide the functionality you require.

HTTPAPIDataAction

Use the HTTPAPIDataAction class to invoke HTTP APIs by creating an asyncronous XMLHTTPRequest (XHR) and submitting it to the specified URL. The HTTP response code enables a message to be displayed briefly on the canvas. For example, you can customize the request to send JSON or XML payloads to a REST or SOAP server and you can customize the response handler to show a custom user interface.

For the HTTPAPIDataAction data action to work, you must add the URL of the HTTP API you want to access to your list of Safe Domains and grant it Connect access. See Register Safe Domains.

+ HTTPAPIDataAction(oKOModel)
+ create(sID_sName) : HTTPAPIDataAction
+ upgrade(oOldDataActionJS) : Object
+ invoke(oActionContext: ActionContext, oDataActionContext:DataActionContext)
+ getGadgetInfos(oReport) : AbstractGadgetInfo[]
# createHTTPMethodGadgetInfo(oReport) : AbstractGadgetInfo
# createPostParamGadgetInfo(oReport) : AbstractGadgetInfo