ISharedParams.EtlTemplates

Fore Syntax

EtlTemplates(Type: EtlTemplateType): IEtlTemplates;

Fore.NET Syntax

EtlTemplates[Type: Prognoz.Platform.Interop.KeFore.EtlTemplateType]: Prognoz.Platform.Interop.KeFore.IEtlTemplates;

Parameters

Type. Custom template type for the ETL task.

Description

The EtlTemplates property returns collection of custom templates of sources or consumers.

Comments

To work with event handlers  of reports, use ISharedParams.EventHandlers.

Fore Example

Executing the example requires a unit with the USERCLASSFORETL identifier containing the USER_PROVIDER class to implement required interfaces.

Example of the USER_PROVIDER class using Fore

Add links to the Fore, Metabase, Xml system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Params: ISharedParams;
    Templates: IEtlTemplates;
    Template: IEtlTemplate;
    xmlEl: IXmlDomElement;
    xmlDom: IXmlDomDocument;
    Node: IXmlDomNode;
Begin
    MB := MetabaseClass.Active;
    Params := MB.SpecialObject(MetabaseSpecialObject.SharedParams).Edit As ISharedParams;
    Templates := params.EtlTemplates(ETLTemplateType.Provider);
    Template := Templates.Add;
    xmlDom := New FreeThreadedDOMDocument60.Create;
    xmlEl := xmlDom.createElement("firstTemplate");
    xmlEl.setAttribute("server""PPServer");
    xmlEl.setAttribute("database""databse");
    xmlDom.appendChild(xmlEl);
    Node := xmlDom.createNode("Element""Table""");
    xmlEl.appendChild(Node);
    Node.text := "T_SEP";
    Template.Module := mb.ItemById("USERSCLASSFORETL");
    Template.Class_ := "User_Provider";
    Template.Id := "TemplId";
    Template.Name := "TemplName";
    Debug.WriteLine("The ETL object template type - " + Template.Type.ToString);
    (Params As IMetabaseObject).Save;
End Sub UserProc;

After executing the example on the ETL task opening new custom template of data source will be available.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Example of the USER_PROVIDER class using Fore.NET

Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.MsXml2;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Paramss: ISharedParams;
    Templates: IEtlTemplates;
    Template: IEtlTemplate;
    xmlEl: IXmlDomElement;
    xmlDom: IXmlDomDocument = New FreeThreadedDOMDocument60Class();
    Node: IXmlDomNode;
Begin
    MB := Params.Metabase;
    Paramss := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Edit() As ISharedParams;
    Templates := Paramss.EtlTemplates[ETLTemplateType.etlttProvider];
    Template := Templates.Add(); ;
    xmlEl := xmlDom.createElement("firstTemplate");
    xmlEl.setAttribute("server""PPServer");
    xmlEl.setAttribute("database""databse");
    xmlDom.appendChild(xmlEl);
    Node := xmlDom.createNode("Element""Table""");
    xmlEl.appendChild(Node);
    Node.text := "T_SEP";
    Template.Module := mb.ItemById["USERSCLASSFORETL"];
    Template.@Class := "User_Provider";
    Template.Id := "TemplId";
    Template.Name := "TemplName";
    System.Diagnostics.Debug.WriteLine("ETL object template type - " + Template.Type.ToString());
    (Params As IMetabaseObject).Save();
End Sub;

See also:

ISharedParams