Update cookies preferences
Promotic

Description of the PROMOTIC XML files for Import/Export

This part contains the description of the XML file structure for saving (export) of the configuration (development) data of the PROMOTIC system.

A general XML document consists of so-called "tags". It is a word closed inside the square brackets followed by a tag content and completed by the end sign of the tag, for example:
<Prop> .. tag content .. </Prop>
The tag content can be empty (then the whole tag can be written in short, for example. <Prop/>), there can be a plain text or there can be other tags included in it. There can be more tags on the same level (consecutively), it is also possible to nest them into arbitrary level. Every tag can have so-called attributes that are written, for example, as follows (attribute is Name in this case):
<Prop Name="PmaNumber"> .. tag content .. </Prop>


The PROMOTIC system uses the XML data structure on many places (see e.g. XML data sharing in runtime). We'll describe the XML structure for saving the development data here.

The tag can be here, for example, the object of the PROMOTIC system - in this case it includes in itself more tags representing e.g. properties of this object.
For example, in the following text the <Content> tag includes the <PmaObject> tag that consists from two Prop tags.
<Content>
  <PmaObject Type="PmaNumber" Name="number0" Import="XXX" Defimport="XXX">
    <Prop Name="Value">100</Prop>
    <Prop Name="Unit">cm</Prop>
  </PmaObject>
</Content>
Here the tag <Prop Name="Value">100</Prop> means that the property named "Value" has the value 100.

Structure of XML PROMOTIC document is as follows

<?xml version="1.0" encoding="utf-8"?>
<Document CfgSelect="XXX" Load="XXX">
  <Cfg Name="NameCfg1" Src="XXX">
    <Dst Ctx="XXX" Defimport="XXX" Import="XXX"/>
  
    <Content>
      <PmaObject Type="PmaNumber" Name="Number0" Import="XXX" Defimport="XXX">
        <Prop Name="Value">100</Prop>
        <Prop Name="Unit">~KeyName</Prop>
      </PmaObject>
    </Content>
  </Cfg>
  
  <Cfg Name="NameCfg2">
    ...
  </Cfg>
  ...
</Document>


Note 1: The file is logically sectioned into configurations <Cfg>. These can be more in the file. On import in the development environment PROMOTIC can be selected which configuration to read or it is also possible to read all configurations. The data themselves are placed in the configuration inside the <Content> tag.
The behavior of the whole document and each configuration can be affected on import in the description of the structure by mentioned attributes.
Note 2: The XML document (not only the PROMOTIC XML document) is case sensitive text in the names of tags and attributes.
Note 3: <?xml version="1.0" encoding="utf-8"?> is generated by the PROMOTIC system and it is mandatory. This is the identification that it goes about the XML file.

Description of the <Document> tag: (this tag is mandatory)

Attribute CfgSelect="XXX" (optional):
CfgSelect="First" means that only the first configuration that suits to the context position, is selected from the file and there is no continuation
If not set, then all configurations in the file are imported (depending on Dst, see further)
Attribute Load="XXX" (optional):
Load="Auto": the import passes without an interactive part
Load="Interactive": (default) the interactive procedure (with questions)

Description of the <Cfg> tag: (this tag is mandatory)

Attribute Name="NameCfg": the name of the configuration.
Attribute Src="Promoticdata.xml" (optional): Promoticdata.xml is the name of the external file (keeping the XML file structure described here) that is read by the PROMOTIC system on reading the NameCfg configuration (in this case the data from the <Content> tag are NOT read).
If not set, then the data from the <Content> tag are read.

Description of the <Dst> tag: (this tag is optional)

Specifies the validity of the configuration context in dependency on the object into which it is imported. There can be more <Dst> tags in the configuration.
Attribute Ctx="XXX": the name of the tag class, for example:
<GPanel Name="XXX"></Gpanel>
is the tag of the Gpanel class, in this case Ctx="GPanel" would mean:
- if this configuration was imported into the panel, then it is valid.
- if this configuration was imported into the Pmg object or, for example, into the Pma object, then it is INvalid and the import of the configuration is not performed.

If <Dst> is not stated in the XML file, then the configuration is always valid.
Attribute Defimport="XXX" (optional): Except the <Dst> tag it can be defined this attribute at any tag. It specifies how to import all subtags except the stated tag.
Defimport="IfNotExist" - subtags are imported only if they don't exist
Defimport="IfExist" - subtags are imported only if they exist
Defimport="Replace" - if the subtag exists, then it is imported; if it does not exist, then it is created and imported
Defimport="Add" - subtags always created as new ones and then they are imported (names are kept according the XML document)
Defimport="AddWithNewName" - subtags always created as new ones and then they are imported (names are newly created)
Defimport="RemoveAndNew" - if subtags don't exist, then they are created and imported; if they exist, then they are deleted, new ones are created and finally imported
Defimport="Remove" - all subtags are deleted
Defimport="No" - no subtags are imported
Defimport="NoThis" - subtags are not imported if not stated (by setting DefImport, Import)
Attribute Import="XXX" (optional): Except the <Dst> tag it can be defined this attribute at any tag. It specifies how to import the tag where this attribute is stated. XXX takes the same meanings as the Defimport.


Note: The Import, Defimport attributes for configurations where they are not explicitly stated in the <Dst> section, are specified in the window for the import by the "Import type" option.
If they are stated on both places, then attributes in the <Dst> section in the XML file have precedence.

Description of the <Content> tag: (this tag is mandatory)

This tag contains solitary PROMOTIC data.
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.