The XML import and export feature requires supervisor privileges to access.
Click here for definitions and more information about XML and related technologies.
Topic Overview
To work with the XML Central feature, use the following Navigator menu path:
Setup Tools> Utilities> XML Central
This opens the XML Central dialog box whose buttons allow you to navigate to the following functions:
· [Test XML File] - to test the validity of an existing XSL style sheet file to work with XML files
· [Export to XML] - to create "Named Exports"
· Import from XML - to create and execute XML imports
· [Exit] - to exit the XML Central feature
Test XML File
When a style sheet has been created it can be tested for compatibility with XML in the Test XML dialog box.
XML export
You create the "Named Exports" in the Export XML window. You can execute the export here or elsewhere in the application. There are three types: grid (for example, reports), a record (for example, a specific customer record complete with address and contact information) and existing (for example, the Multicat report, where an HTML page containing summary information for the export is created, and then the page is processed as XML to convert it to the final report's output).
Executing exports/scripts in System Five:
· The grid type "Named Exports" are then available on any grid in System Five via the right-click pop-up menu (naming conventions are really important so staff select the right one for exporting). See Export Grid to XML.
· The record type "Named Exports" are available to the [XML Export] button on the menu bar of most <Record> Details windows in System Five (for example Customer Details window). There are many purposes you can use this button for. For example, when creating new records to populate certain fields with default information similar to a template. Or to simplify the export of the specific record that you are currently viewing. (Otherwise, you need to either export all records of a given data type, or write an SQL query for the "Named Export" that can isolate the specific record that you want to export).
· The existing type, that allows you to process an XML file on your hard drive, apply transformations and do the additional processing that the XML Export section provides, without actually having to export the data (all done within the Export XML window).
You can also use Sys5Script feature for the existing type XML export. Sys5Script.exe is a standalone program that can communicates with System Five to issue these commands by sending an XML file containing a series of instructions that System Five needs to perform (the script).
It is possible to execute scripts from within System Five, without the need to use Sys5Script.exe. See Setup Tools> Setup Wizard> Miscellaneous> XML Shortcut keys allows you to specify the filename of the script and a meaningful name for it that appears in the Navigator menu under the heading Scripts (after you restart System Five).
If you are familiar with XML technologies you may be able to create style sheets yourself for the export option. See http://www.w3.org where you can find the standards documents that serve as the definitive technical reference for XML, XSL and Xpath. See http://www.w3schools.com as a generic reference site that is more approachable and has more real-world examples that you might find easier to digest than the material on World Wide Web Consortium web site.
XML import
For the import function, to create a style sheet requires understanding of the internal structure of System Five databases. In most cases System Five creates these customized styles sheets for you to suit your specific needs. See Contact Us if you require custom style sheets.
You create and execute the "Named Imports" in the Import XML window. It's function is to import record-level information into System Five databases correctly.
Note: when exporting inventory that has pictures attached to inventory items, the actual image files must reside in the pictures subdirectory of the data folder in order to be included.
Advanced import features in System Five
When importing certain datatypes via XML, System Five can keep track of relationship information which it can then report back to the external system. Note that this is an Advanced Feature and is not supported by all the datatypes that System Five currently imports.
To use this feature, the external application must provide its unique identifier for the data type in the reference attribute of the data type's main node. The value of the reference attribute does not have to be numeric, it can be anything that has meaning to the external application:
<Invoice reference="my_unique_id">
.
.
.
</Invoice>
When the record is imported, System Five recognizes the reference number field and establishes a relationship between the reference value and the unique ID assigned to the record in the database. This relationship is temporary and is stored in memory only during import operation. To gain access to this information, an XML export must be chained to the import. The export should use the Existing export type, but leave the source file field of the export blank... the XML import will provide the mapping information in XML form with the following structure:
<System FiveSystem5XML>
<Reference>
<SystemFiveUnique>100</System FiveUnique>
<ExternalUnique>my_unique_id</ExternalUnique>
<NodeName>Invoice</NodeName>
<FileNumber>9</FileNumber>
</Reference>
</System FiveSystem5XML>
There can be multiple reference nodes if there are multiple records in the import document that contain the reference attribute. If a reference attribute is not specified for a data type that supports it, no Reference node will be generated.
System FiveUnique contains the unique ID of the record assigned during the import of the XML.
ExternalUnique is the value of the reference attribute in the source XML.
NodeName identifies the name of the node to which the reference attribute was assigned.
FileNumber identifies the data type that was imported (it corresponds to the NodeName value, which may be more convenient to use than internal file number).
The XML export would typically apply an XSL transform to do something more meaningful with the data, (to post it back to the web server, for example).
Additional processing
See Additional processing for information on command block processing for both import and export functions with an example.