index modules license coding style to do |
Import file formatThis document describes the file format to import data into Uni-d applications. This file format applies both to the ImportServlet and to the Import tool. The Uni-d 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. General rules
File structure
Table directives
:table:Company:UnidType,Reference,Name :table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier :table:Company/TraceId: UnidType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber :table:Company/TraceId: UnidType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber] _NOTE_ for the finders, you can only use those finders which select only fields from the table itsel. If the selector includes referenced fields from other tables, it cannot be used to find the records in the import file. Data line structure
Import / UpdateThe import servlet / tool can be used both for importing and for updating data. When a record is specified, Uni-d 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, Uni-d 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 find a matching record. Linked recordsThe 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 finder. 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. ExamplesA 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".
$Id: ImportFileFormat.wiki 660 2004-08-23 05:25:22Z triathlon98 $ |