IMobilePublishObject.LoadFromXml

Fore Syntax

LoadFromXml(Element: IXmlDomElement);

Fore.NET Syntax

LoadFromXml(Element: Prognoz.Platform.Interop.MsXml2.IXmlDomElement);

Parameters

Element. The element, from which object publishing parameters are loaded.

Description

The LoadFromXml method loads parameters of publication of the object of mobile application from the XML file.

Comments

To load object publishing parameters to the XML file, use the IMobilePublishObject.SaveToXml method.

Fore Example

The example is a procedure. The mobile application object to be published must be passed to the input. Executing the example requires the C:\PublishObject.xml file in the file system, which contains parameters of the published object specified in the input parameter of the procedure.

The example also uses the PublishObjectCallback class described in the Fore example for IMobilePublishObjectCallBack.SetProgress.

Add links to the Mobile, Xml system assemblies.

Sub LoadPublishObject(PublishObject: IMobilePublishObject);
Var
    XmlDoc: IXmlDomDocument3;
    el: IXmlDomElement;
    Callback: PublishObjectCallback;
    res: MobilePublishObjectResult;
Begin
    // Load publishing parameters of mobile application object
    XmlDoc := New DOMDocument60.Create;
    XmlDoc.load("C:\PublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    PublishObject.LoadFromXml(el);
    Callback := New PublishObjectCallback.Create;
    // Publish object
    res := PublishObject.Publish(Callback);
    // Display publishing results in the console window
    If res = MobilePublishObjectResult.OK Then
        Debug.WriteLine("Object publishing is finished").
    Else
        Debug.WriteLine("Error occurred on publishing the object").
    End If;
End Sub LoadPublishObject;

Procedure execution result: the specified object of the mobile application is published by the parameters specified in the C:\PublishObject.xml file and publishing results are displayed in the console window. The events occurring on publishing are handled by the PublishObjectCallback class object.

Fore.NET Example

The example is a procedure. The mobile application object to be published must be passed to the input. Executing the example requires the C:\PublishObject.xml file in the file system, which contains parameters of the published object specified in the input parameter of the procedure.

The example also uses the PublishObjectCallback class described in the Fore.NET example for IMobilePublishObjectCallBack.SetProgress.

Imports Prognoz.Platform.Interop.Mobile;
Imports Prognoz.Platform.Interop.MsXml2;

Public Shared Sub LoadPublishObject(PublishObject: IMobilePublishObject);
Var
    XmlDoc: IXmlDomDocument3;
    el: IXmlDomElement;
    Callback: PublishObjectCallback;
    res: MobilePublishObjectResult;
Begin
    // Load publishing parameters of mobile application object
    XmlDoc := New DOMDocument60.Create();
    XmlDoc.load("C:\PublishObject.xml");
    el := XmlDoc.selectSingleNode("Root"As IXmlDomElement;
    PublishObject.LoadFromXml(el);
    Callback := New PublishObjectCallback.Create();
    // Publish object
    res := PublishObject.Publish(Callback);
    // Display publishing results in the console window
    If res = MobilePublishObjectResult.mporOK Then
        System.Diagnostics.Debug.WriteLine("Object publishing is finished").
    Else
        System.Diagnostics.Debug.WriteLine("Error occurred on publishing the object").
    End If;
End Sub LoadPublishObject;

Procedure execution result: the specified object of the mobile application is published by the parameters specified in the C:\PublishObject.xml file and publishing results are displayed in the console window. The events occurring on publishing are handled by the PublishObjectCallback class object.

See also:

IMobilePublishObject