IMetabase.ItemByIdNamespace

Syntax

ItemByIdNamespace(Id: String; Namespace_: Integer): IMetabaseObjectDescriptor;

ItemByIdNamespace[Id: String; Namespace_: Integer]: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;

Parameters

Id. Object identifier which description is to be obtained.

Namespace_. Container object key. The following repository objects: MDM repository, modeling container, Web application may be as a container object. Also different objects can be specified, the internal objects of which are not displayed in the object navigator (for example time series database, custom classes container, dictionaries and others).

Description

The ItemByIdNamespace property returns description of the object that any object-container contains.

Comments

This property is used to access inner objects (for example, selection scheme of dictionaries), as well as child objects that are stored in objects-containers.

The property returns Null if an object with the specified identifier does not exist.

Example

 Executing the example requires a form and a button named Button1 on it. The repository contains MDM repository with the RDS identifier where MDM dictionary with the Dict_1 identifier is stored.

Add links to the Metabase, Rds, Ui system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RDS: IRdsDictionary;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    MB := MetabaseClass.Active;
    RDS := MB.ItemByIdNamespace("Dict_1", MB.GetObjectKeyById("RDS")).Bind As IRdsDictionary;
    If RDS <> Null Then
        Target := WinApplication.Instance.GetPluginTarget("Rds");
        Context := Target.CreateExecutionContext;
        Context.Data := RDS;
        Target.Execute("EditDictionary", Context);
    End If;
End Sub UserProc;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RDS: IRdsDictionary;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    WinApp: WinApplication = New WinApplicationClass_2();
Begin
    MB := Params.Metabase;
    RDS := MB.ItemByIdNamespace["Dict_1", MB.GetObjectKeyById("RDS")].Bind() As IRdsDictionary;
    If RDS <> Null Then
        Target := WinApp.GetPluginTarget("Rds");
        Context := Target.CreateExecutionContext();
        Context.Data := RDS;
        Target.Execute("EditDictionary", Context, Null);
    End If;
End Sub;

Clicking the button opens the specified MDM dictionary for editing.

See also:

IMetabase