IMobilePublishObject.LoadFromXml

Fore Syntax

LoadFromXml(Element: IXmlDomElement);

Fore.NET Syntax

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

Parameters

Element. The element from which the 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 the object publishing parameters to the XML file, use the IMobilePublishObject.SaveToXml method.

Fore Example

This 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 the 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 an object
    res := PublishObject.Publish(Callback);
    // Display the publishing results in the console window
    If res = MobilePublishObjectResult.OK Then
        Debug.WriteLine("The object publishing is finished").
    Else
        Debug.WriteLine("Error occurred on publishing the object").
    End If;
End Sub LoadPublishObject;

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

Fore.NET Example

This 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 the 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 an object
    res := PublishObject.Publish(Callback);
    // Display the publishing results in the console window
    If res = MobilePublishObjectResult.mporOK Then
        System.Diagnostics.Debug.WriteLine("The object publishing is finished").
    Else
        System.Diagnostics.Debug.WriteLine("Error occurred on publishing the object").
    End If;
End Sub LoadPublishObject;

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

See also:

IMobilePublishObject