Understanding the *-export.xml File
Copyright © 2018 EarthSoft, Inc • Modified: 12 Dec 2018
The first step in understanding and customizing EDD exports in EQuIS is understanding the *-export.xml file. The *-export.xml file is one of the files that defines the format (along with the *.xsd file, the *.vb file, the *-enum.xml file, etc.). In order for the *-export.xml file to be used by the format, the *-export.xml file must exist in the same directory as the *.xsd file and the *.xsd file must include a <edd:export>node within the <xs:appinfo> node that indicates the name of the *-export.xml file (see Figure 1). Note that the reference to the export file does not need to include the ".xml" extension; the extension is assumed to be either ".xml" (a plain text XML file) or ".xme" (an encrypted XML file).
Particularly for large or complex EDD formats, it is often useful to have a number of different types of exports. For example, the EFWEDD format includes one export for lab EDDs and another for field EDDs. Each of these different exports is defined within the same *-export.xml file as a "report".
The root node (also referred to as the document node) of the *-export.xml file must be the <reports> node. The <reports>node may contain one or more <report>nodes. Each <report> node must contain exactly two child nodes: <parameters> and <commands>.
The <parameters> node contains zero or more <param> nodes that define the parameters used for the report. The information for each parameter is very similar to the information defined for other reports in the ST_REPORT_PARAMETER table. The parameter definitions are used to automatically generate the input parameters seen by the user when running the report. Figure 2 shows the parameters that are defined for the "EFWEDD LAB EDD" Report.
The <commands> node within a report contains one or more <command> nodes. Each <command>node represents a separate SQL command (e.g. query) that will be executed against the database using the parameter values defined by the user. The output of the query will be used to populate the section of the EDD indicated in the table_name attribute of the <command> node. The connection_type attribute may be used to define SQL syntax for a specific type of database (Microsoft SQL Server or Oracle Database).
If the syntax is specific to Microsoft SQL Server, then the attribute would be connection_type="SqlConnection". If the syntax is specific to Oracle Database, then the attribute would be connection_type="OracleConnection". If the syntax is generic (and will work for either type of database), then the connection_type attribute may be omitted. The number of <command> nodes will depend on the number of sections of the EDD being populated (and whether or not the syntax is different for both types of databases). The content of the<command> node is an XML <CDATA>node that contains the actual SQL. Figure 3 shows the commands for populating the "EFW2LabSMP" EDD section of the EFWEDD Lab EDD Report.