LoadFromXml(Element: IXmlDomElement);
SaveToXml(Element: Prognoz.Platform.Interop.MsXml2.IXmlDomElement);
Element. The element, from which published object parameters are loaded.
The LoadFromXml method loads parameters of the published object of mobile application from XML file.
To load object parameters to XML file, use the IMobileApplicationPublishObject.SaveToXml method.
The example is a procedure. The mobile application object must be passed to the input. Executing the example requires the C:\MAPublishObject.xml file in the file system that contains parameters of the published object specified in the input parameter of the procedure.
Add links to the Metabase, Mobile, Xml system assemblies.
Sub MAPubObsLoad(MaPubObj: IMobileApplicationPublishObject);
Var
XmlDoc: IXmlDomDocument3;
el: IXmlDomElement;
MbObj: IMetabaseObject;
s: String;
Begin
// Load parameters of mobile application objects
XmlDoc := New DOMDocument60.Create;
XmlDoc.load("C:\MAPublishObject.xml");
el := XmlDoc.selectSingleNode("Root") As IXmlDomElement;
MaPubObj.LoadFromXml(el);
// Display message in the console window
MbObj := MaPubObj.PublishObject.Object;
s := MbObj.Name + " (" + MbObj.Id + ")";
If MaPubObj.CreateResult = CreateMobileObjectResult.Ok Then
Debug.WriteLine("Object parameters '" + s + "' are loaded");
Else
Debug.WriteLine("Error loading the object '" + s + "'");
End If;
End Sub MAPubObsLoad;
Procedure execution result: parameters of the specified mobile application object are loaded from the C:\MAPublishObject.xml file, and the message about this procedure is displayed in the console window.
The example is a procedure. The mobile application object must be passed to the input. Executing the example requires the C:\MAPublishObject.xml file in the file system that contains parameters of the published object specified in the input parameter of the procedure.
Imports Prognoz.Platform.Interop.Mobile;
Imports Prognoz.Platform.Interop.MsXml2;
…
Public Shared Sub MAPubObsLoad(MaPubObj: IMobileApplicationPublishObject);
Var
XmlDoc: IXmlDomDocument3;
el: IXmlDomElement;
MbObj: IMetabaseObject;
s: String;
Begin
// Load parameters of mobile application objects
XmlDoc := New DOMDocument60.Create();
XmlDoc.load("C:\MAPublishObject.xml");
el := XmlDoc.selectSingleNode("Root") As IXmlDomElement;
MaPubObj.LoadFromXml(el);
// Display message in the console window
MbObj := MaPubObj.PublishObject.Object;
s := MbObj.Name + " (" + MbObj.Id + ")";
If MaPubObj.CreateResult = CreateMobileObjectResult.cmorOk Then
System.Diagnostics.Debug.WriteLine("Object parameters '" + s + "' are loaded").
Else
System.Diagnostics.Debug.WriteLine("Error loading the object '" + s + "'").
End If;;
End Sub MAPubObsLoad;
Procedure execution result: parameters of the specified mobile application object are loaded from the C:\MAPublishObject.xml file, and the message about this procedure is displayed in the console window.
See also: