ShowImportDialog Command

Purpose

It starts the wizard that is used to start the current or create a new import object based on a time series database.

Parameters of Use

Command parameters are passed in the Data property. To ensure command execution, specify one of the following values in this property:

Value type Description
IRubricatorInstance The time series database, for which a new import object is created.
IImportRequestInstance The import object to be started.

Application Features

Depending on the passed parameter type, a new import object is created or an existing import object is started. The command can be used for time series database only.

Example 1

Executing the example requires a form and a button named Button1 on it. The repository must contain a time series database created with the OBJ_RUBRICATOR identifier. An import object with the Import identifier is created in the database.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: IMetabase;
        Rub: IMetabaseObjectDescriptor;
        Import: IImportRequestInstance;
        CommandTarget: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        Rub := MB.ItemById("OBJ_RUBRICATOR");
        Import := MB.ItemByIdNamespace("Import", Rub.Key).Open(NullAs IImportRequestInstance;
        CommandTarget := WinApplication.Instance.GetPluginTarget("FactRubricator");
        Context := CommandTarget.CreateExecutionContext;
        Context.Data := Import;
        Context.ParentWindow := Self As IWin32Window;
        Context.Modal := True;
        CommandTarget.Execute("ShowImportDialog", Context);
    End Sub Button1OnClick;

Clicking the button opens a wizard to start the specified data import object in the time series database. The wizard dialog box opens modally relative to the current form.

Example 2

Executing the example requires a form and a button named Button1 on it. The repository must have a time series database created with the OBJ_RUBRICATOR identifier.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: IMetabase;
        RubInst: IRubricatorInstance;
        CommandTarget: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        RubInst := MB.ItemById("OBJ_RUBRICATOR").Open(NullAs IRubricatorInstance;
        CommandTarget := WinApplication.Instance.GetPluginTarget("FactRubricator");
        Context := CommandTarget.CreateExecutionContext;
        Context.Data := RubInst;
        Context.ParentWindow := Self As IWin32Window;
        Context.Modal := True;
        CommandTarget.Execute("ShowImportDialog", Context);
    End Sub Button1OnClick;

Clicking the button opens a wizard to create a new or to start the current data import object in the time series database. The wizard dialog box opens modally relative to the current form.

See also:

IUiCommandTarget.Execute