Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Operation APIs

api.operation Class

Operation definition for api class. Contains all operation-related API calls.

Methods

clearCache (successCallback, errorCallback, suppressSuccessNotification)

Clears the entire cache associated with the current data source, including Analyzer's metadata cache, the Mondrian schema cache, and the Mondrian segment cache.

Parameters:

  • successCallback (Function)

    The optional function which is executed when the report has been successfully saved.

  • errorCallback (Function)

    The optional function which is executed when an exception is thrown when saving the report.

  • suppressSuccessNotification (Boolean)

    The optional parameter which controls the display of the default success notification. By default, it is set to 'false'.

Example:

var successCallback = function() {alert("Success!");}; var errorCallback = function() {alert("Error!");}; api.operation.clearCache(successCallback, errorCallback, true);

clearDropTargetIndicator (dropTarget)

Clears a drop target indicator, provided there is a drop target. This can only be seen if an indicator has been shown previously for the given drop target.

Parameter:

  • dropTarget (JSON)

    The drop target, which represents the location upon which the user will drop a draggable object.

Example:

var dropTarget = api.operation.getDropTarget(0, 0, "[MDX].[Formula]"); api.operation.clearDropTargetIndicator(dropTarget);

completeDrop (dropTarget)

Completes the drop, provided there is a drop target. The result of this drop depends on the drop target and what custom drop action is bound to the specified drop target.

Parameter:

  • dropTarget (JSON)

    The drop target, which represents the location upon which the user will drop a draggable object.

Example:

var dropTarget = api.ui.getDropTarget(0, 0, "[MDX].[Formula]"); api.operation.completeDrop(dropTarget);

getDropTarget (x y formula) JSON | Null  

Retrieves the drop target, depending on the x and y coordinates provided. The x and y coordinates are relative to the frame in which Analyzer is loaded, and not the parent frame. Any x and y coordinates from a parent window's mouse position needs to be translated such that (0, 0) is the top left corner of the frame. Valid drop targets include the filter panel, filter toggle arrow and label, and the report area.

Parameters:

  • x (Integer)

    The x coordinate.

  • y (Integer)

    The y coordinate.

  • formula (String)

    The MDX of the object which the user would want to drop onto Analyzer.

Returns:

  • JSON | Null

    If no drop target is at the provided x and y coordinates, null is returned. Otherwise, the drop target is returned as a JSON

Example:

api.operation.getDropTarget(0, 0, "[MDX].[Formula]");

redo ( )

Reapplies events in the order they were removed or undone.

Example:

api.operation.redo();

refreshReport ( )

Refreshes the report, showing any changes made to the report.

Example:

api.operation.refreshReport();

resetReport ( )

Resets the state of the report back to the most recently saved state.

Example:

api.operation.resetReport();

saveReport (name, path, successCallback, errorCallback, suppressSuccessNotification)

Saves the report.

Parameters:

  • name (String)

    The name of the report without extension.

  • path (String)

    The existing path of the repository to store the report without the report's name.

  • successCallback (Function)

    The optional function which is executed when the report has been successfully saved.

  • errorCallback (Function)

    The optional function which is executed when an exception was thrown while saving the report.

  • suppressSuccessNotification (Boolean)

    The optional parameter to control displaying the default success notification. By default, it is false.

Example:

var name ="Test name of report";
var path ="/public/my_test";
var successCallback =function(){alert("Success!");};
var errorCallback =function(){alert("Error!");};
api.operation.saveReport(name, path, successCallback, errorCallback);

showDropTargetIndicator (dropTarget)

Shows the drop target indicator, provided there is a drop target. Depending on the portion of the screen where the drop is occurring, the drop indicator may look different or move.

Parameters:

  • dropTarget (JSON)

    The drop target, which represents the location upon which the user will drop a draggable object

Example:

var dropTarget = api.operation.getDropTarget(0, 0, "[MDX].[Formula]"); api.operation.showDropTargetIndicator(dropTarget);

undo ( )

Removes events in the order they occurred.

Example:

api.operation.undo();