This document describes the file format to import data into equanda applications.
This file format applies both to the ImportServlet and to the Import tool.
The equanda import file format is roughly based on CSV files.
However, many extensions have been provided to make the import file self-contained,
provide for powerful features like multiple fields and links,
to allow data for different tables to be sent in one connection
and that the table and field names can be specified.
Some example table directives :
:table:Company:equandaType,Reference,Name
:table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier
:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber
:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber]
NOTE for the selectors, you can only use those selectors which select only fields from the table itself.
If the selector includes referenced fields from other tables, it cannot be used to select the records in the import file.
The import servlet / tool can be used both for importing and for updating data.
When a record is specified, equanda uses the specified selector to check whether the record already exists.
If it does, then the fields are updated, otherwise a new record is inserted.
When no selector is specified, equanda tries to see whether the data line included a unique field.
If it does, this field is used to check for existence of the record.
When more than one unique field is included,
it is not defined which field will be used first to try to select a matching record.
The data line can include linked records either using a selector, or by specifying the actual value.
When using a selector name, the value is the list of parameters for the selector.
If there is more than one parameter then this list needs to be enclosed in square brackets.
If the field is single linked, and the selector returns more than one record, then the import fails.
Alternatively, you may use a field list (optionally combined with a selector).
This will create or update the record and link it.
A couple of simple examples for some fictive tables (definition not included and may be different for each example).
:table: JustAString : Value
Simple test
This will include the string "Simpletest" without space, as spaces are discarded when the value is not quoted.
:table:Address: Reference, Street, Location
"addr1", "Mechelbaan", "Putte"
:table:Person: Name, Address/Reference
"Joachim", "addr1"
Simple example of a linked record.
:table:Person: Name, Address[Street, Location]
"Joachim", ["Mechelbaan", "Putte"]
Simple example of a multiple linked record.
:table:Person: Name, Address[[Street, Location]]
"Wim", [ ["Kerklaan", "Putte"], ["Heistraat", "Bree"] ]
Use of the automatic creation of linked records.
:table:Person: Name, Address[ Street, Location/Zip[Zip,City] ]
"Joachim", [ "Mechelbaan", [ "2580", "Putte" ] ]
Advanced linked record with nesting and combined selector and fieldlist for "Location".