EtlTemplates(Type: EtlTemplateType): IEtlTemplates;
Type. Custom template type for the ETL task.
The EtlTemplates property returns collection of custom templates of sources or consumers.
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.
See also: