IStandardCube.SetDefaultCallback

Syntax

SetDefaultCallback(Module: IMetabaseObjectDescriptor; Class_: String);

SetDefaultCallback(Module: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor; Class_: String);

Parameters

Module. Description of repository object, which has a class implementation.

Class_. Name of the class, which handles data saving to cube.

Description

The SetDefaultCallback method sets a handler of data saving to cube for a cube.

Comments

In the Class_ parameter specify the class that implements methods of the ICubeSaveMatrixCallback interface or is inherited and redetermines the CubeCallback class.

After cube settings are saved, the specified handler is saved in cube metadata and will be used on each data saving. Data saving can be made from visual interface on working with cube in the Analytical Queries (OLAP), Dashboards and other tools. Data saving can be also executed in application code using methods of the ICubeInstanceStorage interface. Handler that is specified using the SetDefaultCallback method corresponds to the handler that can be specified in the ICubeInstanceStorage.SaveMatrixCallback property.

The DefaultCallbackModule and DefaultCallbackClass properties can be further used to get the specified unit and class.

To reset the specified handler, execute the SetDefaultCallback method by setting the Module parameter to Null, and an empty string ("") in the Class_ - parameter.

Example

Executing the example requires a standard cube with the STD_CUBE identifier and a unit with the MOD_CALLBACK identifier. The unit implements the TCubeSaveCallback class that is used to process data saving to cube. The example of class code is given in description of ICubeInstanceStorage.SaveMatrixCallback.

Add links to the Cubes and Metabase system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Cube: IStandardCube;
Begin
    Mb := Metabaseclass.Active;
    Cube := Mb.ItemById(
"STD_CUBE").Edit As IStandardCube;
    Cube.SetDefaultCallback(Mb.ItemById(
"MOD_CALLBACK"), "TCubeSaveCallback");
    (Cube 
As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    Cube: IStandardCube;
Begin
    Mb := Params.Metabase;
    Cube := Mb.ItemById[
"STD_CUBE"].Edit() As IStandardCube;
    Cube.SetDefaultCallback(Mb.ItemById[
"MOD_CALLBACK"], "TCubeSaveCallback");
    (Cube 
As IMetabaseObject).Save();
End Sub;

After executing the example the handler of data saving to cube is set for the specified cube.

See also:

IStandardCube