XML data sharing is based on the Client-Server
architecture, i.e. one application (Web server) owns the data and one or more applications (Web clients) read these data or write into them.
The PROMOTIC application can be both the Web server and the Web client for XML data.
The PROMOTIC Web server for XML data
is implemented by means of the PmaData
object (and its Web server
page) or by means of the PmaDataTable
object (and its Web server
page). The PmaData
object represents a Web component. But in the application it is necessary to have one more PmaWeb
object that offers all Web components of the application as one Web server, see Overview of the Web technology in the PROMOTIC system
The PROMOTIC Web client for XML data is implemented also by means of the PmaData/PmaDataTable object and its methods ReadFromWeb and WriteToWeb. If the application has to be only the Web client, then the PmaWeb object needn't be present.
By this way two PROMOTIC application can simply exchange data in the real-time. PmaData objects must contain the same variables in both (or more) applications, defined on the "Data" page.
For an example of the application see Example of communication by means of XML.
object can dynamically change its data size by means of the methods InsertRow
. But the size of data cannot be changed automatically by the XML transfer for security seasons
! If it is necessary to change, for example, the size of data on the client application to be the same as on the server, then the number of rows on the server has to be got (e.g. by the XML query of PmaData
object), then to perform the change by the above mentioned method and only then to call the ReadFromWeb
The XML communication supports the transfer by a hierarchy method
between the PmaData
objects. By this we mean that not only simple variables (as for example Integer
, etc.) find themselves in the PmaData
object but even a reference to the data of another PmaData object
can be a data item. Let's consider the case when the 1st item of the object /Data/DataA
has to refer to the object /Data/DataB
(both objects DataA
are of the PmaData
type). Then the 1st data item of the DataA
object must be of the Object
type and set, for example, the following by the script command:
pMe.Pm("/Data/DataA").Item(1) = pMe.Pm("/Data/DataB");
or instead of this it is possible to create a data binding PP Property of Pma object or its subobject (Ini On property start) for the first data item. We fill in the path to the DataB object in this PP connection but we left the item for setting properties blank. Thus the 1st item of the DataA object is connected directly to the DataB object.
If the server and the client have these objects configured in the same way, then it is possible to transfer even the content of the DataB object together with the DataA object. This conception is advantageous if you have more PmaData objects in the project but you want to transfer all of them in one message.
The Web client can be also for example HTML page
viewed by the Internet Explorer. In this case it is possible to use the <xml>
tag in the HTML page that allows to read XML data from the Web server. It is possible to use also the dynamic HTML and the Microsoft object Msxml2.XMLHTTP
(written in 2004 year) that can read and write into the XML data.