IDtObject.Save

Fore Syntax

Save(Element: IXMLDOMElement);

Fore.NET Syntax

Save(Element: Prognoz.Platform.Interop.MsXml2.IXMLDOMElement);

Parameters

Element. XML element, in which data source consumer parameters are saved.

Description

The Save method saves data source or data consumer parameters in XML format.

Comments

To download data source or consumer parameters from XML format, use the IDtObject.Load method.

Fore example

Executing the example requires a module with the CUSTOM_LOAD identifier, containing the MyDtCustomProvider class. Add links to the Metabase, Dt, Xml system assemblies.

Sub UserProc_Save;
Var
    UsProv: IDtUserProviderEx;
    Doc: FreeThreadedDOMDocument60;
    Element: IXmlDomElement;
Begin
    UsProv := New DtUserProviderEx.Create;
    UsProv.Metabase := MetabaseClass.Active;
    UsProv.ImplClass := "CUSTOM_LOAD.MyDtCustomProvider";
    UsProv.Open;
    Doc := New FreeThreadedDOMDocument60.Create;
    Element := Doc.createElement("UserProvider");
    UsProv.Save(Element);
    Doc.appendChild(Element);
    Doc.save("C:\UserProvider.xml");
    UsProv.Close;
End Sub UserProc_Save;

After executing the example parameters of the created user data consumer are loaded in C:\UserProvider.xml XML file.

Fore.NET example

Executing the example requires a .NET assembly with the CUSTOM_LOAD_NET identifier containing the MyDtCustomProvider class.

Imports Prognoz.Platform.Interop.Dt;
Imports Prognoz.Platform.Interop.MsXml2;

Public Shared Sub Main(Params: StartParams);
Var
    UsProv: IDtUserProviderEx;
    Doc: FreeThreadedDOMDocument60;
    Element: IXmlDomElement;
Begin
    UsProv := New DtUserProviderEx.Create();
    UsProv.Metabase := Params.Metabase;
    UsProv.ImplClass := "CUSTOM_LOAD_NET.MyDtCustomProvider";
    UsProv.Open();
    Doc := New FreeThreadedDOMDocument60.Create();
    Element := Doc.createElement("UserProvider");
    UsProv.Save(Element);
    Doc.appendChild(Element);
    Doc.save("C:\\UserProvider.xml");
    UsProv.Close();
End Sub;

After executing the example parameters of the created user data consumer are loaded in C:\UserProvider.xml XML file.

See also:

IDtObject