IMetabaseObjectCreateInfo.Parent

Syntax

Parent: IMetabaseObjectDescriptor;

Parent: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor;

Description

The Parent property determines location of the object that is created.

Comments

A repository folder or one of objects-containers of the repository can be set as a location. The following objects can be set as an object-container: MDM repository, Time series database, Modeling container, Assembly, .NET assembly.

The property is set to Null by default, the object is created in the root folder of the repository.

Example

Add links to the Db and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    DB: IDatabase;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DATABASE;
    CrInfo.Id := 
"NewBD";
    CrInfo.Name := 
New database;
    CrInfo.Parent := MB.Root;
    MObj := MB.CreateObject(CrInfo).Edit;
    DB := MObj 
As IDatabase;
    DB.Authentication := AuthenticationMode.Password;
    DB.DriverId := 
"ORCL";
    DB.LogonData.ParamValue(
"SERVER") := "Test";
    DB.LogonData.ParamValue(
"SCHEME") := "TestShema";
    DB.UseMetabaseCredentials := 
True;
    MObj.Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Db;


Public Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    DB: IDatabase;
Begin
    MB := Params.Metabase;
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DATABASE As Int32;
    CrInfo.Id := "NewBD";
    CrInfo.Name := New database;
    CrInfo.Parent := MB.Root;
    MObj := MB.CreateObject(CrInfo).Edit();
    DB := MObj As IDatabase;
    DB.Authentication := AuthenticationMode.amPassword;
    DB.DriverId := "ORCL";
    DB.LogonData.ParamValue["SERVER"] := "Test";
    DB.LogonData.ParamValue["SCHEME"] := "TestShema";
    DB.UseMetabaseCredentials := True;
    MObj.Save();
End Sub;

After executing the example a new database is created in the repository root. The data are placed on the Test server in the TestShema scheme. The password authentication is used when connecting to the database. Login and password are taken from the credentials, specified on login to the platform.

See also:

IMetabaseObjectCreateInfo