SaveToXml(Writer: Variant);
Writer. XML element where indexing parameters are saved.
The SaveToXml method saves indexing parameters to the specified XML element.
As the Writer parameter, it is necessary to determine the XML element described by the IXmlDomElement interface. The specified element must be created and included into structure of the XML document, to which settings will be saved.
IMPORTANT. Because of the existing features of the Fore language implementation and use of multi-thread mode on indexing, working with indexing parameters using code in the Fore language is not supported. Develop in the Fore.NET language.
Add links to the BiSearch, KeFore, Metabase, MsXml2 system assemblies.
Imports Prognoz.Platform.Interop.BISearch;
Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.MsXml2;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
SharedParams: ISharedParams;
SearchEngine: ISearchEngineService;
ImportExecutor: IImportExecutor;
ImportContext: ISearchEngineImportContext;
XMLDoc: IXMLDOMDocument3;
XMLElement: IXmlDomElement;
Begin
MB := Params.Metabase;
SharedParams := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Bind() As ISharedParams;
SearchEngine := SharedParams.SearchEngine As ISearchEngineService;
ImportExecutor := SearchEngine.SearchEngineSchema.ImportExecutor[SearchEngineTargetType.settSourceData];
ImportContext := ImportExecutor.CreateContext();
//...
//Determine indexing settings of data or metadata
//...
XMLDoc := New DOMDocument60();
XMLElement := XMLDoc.createElement("Imports");
XMLDoc.appendChild(XMLElement);
ImportContext.SaveToXml(XMLElement);
XMLDoc.save("c:\ImportsSettings.xml");
End Sub;
On executing the example the object that is used to index data source structure (dimension elements) will be created. The determined settings will be saved to the specified file.
See also: