ISearchEngineImportContext.LoadFromXml

Fore.NET Syntax

LoadFromXml(Reader: Variant);

Parameters

Reader. XML element that is used to load indexing parameters of data sources.

Description

The LoadFromXml method loads indexing parameters from the specified XML element.

Comments

As the Reader parameter it is necessary to determine the XML element described by the IXmlDomElement interface. The structure of the child elements must be created using the SaveToXml method.

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.

Fore.NET Example

Executing the example requires the ImportsSettings.xml file in the root folder of the disc C. The file must store parameters of the object that is used to index data or metadata. 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;
Begin
    MB := Params.Metabase;
    SharedParams := MB.SpecialObject[MetabaseSpecialObject.msoSharedParams].Bind() As ISharedParams;
    SearchEngine := SharedParams.SearchEngine As ISearchEngineService;
    ImportExecutor := SearchEngine.SearchEngineSchema.ImportExecutor[SearchEngineTargetType.settMbObject];
    ImportContext := ImportExecutor.CreateContext();
    //Load settings from XML file
    XMLDoc := New DOMDocument60();
    XMLDoc.load("c:\ImportsSettings.xml");
    ImportContext.LoadFromXml(XMLDoc.documentElement);
    //...
    //Further work on data or metadata indexing
    //...
End Sub;

On executing the example the object that is used to index data source structure (dimension elements) will be created. Object settings will be loaded from the specified file.

See also:

ISearchEngineImportContext