SaveToXml(WriterXml: Variant; Metabase: IMetabase);
WriterXml. The object, to which time series database replication parameters are saved as XML code.
Metabase. The repository that contains replicated time series database.
The SaveToXml method saves time series database replication parameters as XML code.
Executing the example requires that the repository contains a time series database with the FC identifier.
Sub Main;
Var
mb: IMetabase;
RubUpdateEx: ICubeMetaUpdateEx;
Rub: IRubricator;
CrInfo: IMetabaseObjectCreateInfo;
s: string;
XmlDoc: IXMLDOMDocument3;
el: IXmlDomElement;
Begin
mb := MetabaseClass.Active;
RubUpdateEx := New CubeMetaUpdateClass.Create As ICubeMetaUpdateEx;
Rub := mb.ItemById("FC").Bind As IRubricator;
RubUpdateEx.Rubricator := Rub;
RubUpdateEx.Metabase := Mb;
CrInfo := RubUpdateEx.CreateInfo;
CrInfo.Parent := mb.Root;
s := Mb.GenerateId("FC_COPY");
CrInfo.Id := s;
CrInfo.Name := s;
RubUpdateEx.CopyData := True;
RubUpdateEx.CopyExtraObjects := False;
RubUpdateEx.RdsDatabase := Rub.Database;
XmlDoc := New DOMDocument60.Create;
el := XmlDoc.createElement("Root");
XmlDoc.appendChild(el);
RubUpdateEx.SaveToXml(el, mb);
XmlDoc.save("C:\FC_COPY.XML");
End Sub Main;
After executing the example time series database replication parameters as XML code are saved to the C:\FC_COPY.XML file. In the file parameters are contained in the Root section.
See also: