Flexi2XML is a tool that enables batch importing of data into the ABRA Flexi accounting system. This tool can import data into a local
or remote system. It requires a REST API to function.
The foundation is a configuration file that determines how and where data should be uploaded. The import process works as follows:
find all files matching the specified mask (e.g. *.csv). The mask is defined as a regular expression:
.*.csvimport them to the specified address in the chosen format (the format is controlled by the server) and record the output to a log
if the import succeeds (without errors), rename the file so that it no longer matches the mask
If any export fails, the system will attempt to import it again on the next run. The configuration of the imported format is governed by the REST API parameters.
Configuration Parameters
The flexibee2xml command is run as follows:
flexibee2xml --load config.xml
Configuration file:
<?xml version="1.0"?><config> <username>winstrom</username> <password>winstrom</password> <!-- identifikátor firmy, do které data nahrát --> <company>demo</company> <!-- server --> <host>demo.winstrom.eu</host> <!-- port - výchozí 5434 --> <port>5434</port> <!-- přípona, která bude přidána do názvu po přejmenování --> <renameSuffix>-loaded</renameSuffix> <!-- seznam akcí, které se mají provést --> <action> <!-- URL, kam nahrát data, začíná na / --> <url>/faktura-vydana.csv?format=sofix&encoding=windows-1250&delimeter=;</url> <!-- typ souboru. obvykle text/csv, text/xml a nebo application/json --> <contentType>text/csv</contentType> <!-- maska pro výběr souborů --> <mask>VFA.*.csv</mask> <directory>.</directory> </action> <action> <!-- starts with / --> <url>/pokladni-pohyb.xml?format=awis</url> <!-- typ souboru. obvykle text/csv, text/xml a nebo application/json --> <contentType>text/xml</contentType> <!-- maska pro výběr souborů --> <mask>items.*.xml</mask> <directory>.</directory> </action></config>
Supported Parameters in the action Section
<xslt> | Apply this XSLT to the content (in its XML form). |
<failMessage> | Message displayed to the user on error. |
<successMessage> | Message displayed to the user upon successful upload. |
<requiredMessage> | Message displayed to the user if no file has been transferred. |
<delimeter> | Delimiter used when converting from CSV to XML. |
<encoding> | Character encoding used when converting from CSV to XML. |
<csv2xml> | Row element name in XML when converting from CSV. |
<contentType> | Content Type used for the HTTP request when uploading to (or downloading from) Flexi. |
<url> | The address to upload files to or download files from. |
<mask> | A regular expression that defines the list of files to import to the server. |
<directory> | The directory in which to search for files matching the mask |
<renameOnFailure> | Rename files even when an error occurs. |
<log> | The file to which conversion errors should be written. |
Supported Parameters in the config Section
<failMessage> | Message displayed to the user on error. |
<successMessage> | Message displayed to the user upon successful upload. |
<contentType> | Content Type used for the HTTP request when uploading to (or downloading from) Flexi. |
<directory> | The directory in which to search for files matching the mask |
<renameOnFailure> | Rename files even when an error occurs. |
<showProgress> | Display the number of exported files and their status. |
<host> | The address (DNS or IP) of the Flexi server. |
<port> | The port of the Flexi server. |
<username> | The username to be used for the import. |
<password> | The password of the user to be used for the import. |
<company> | The company ID to which/from which data will be uploaded (part of the URL). |
<renameDir> | The directory to which successfully uploaded files will be moved. |
<renamePrefix> | The filename prefix to which successfully uploaded files will be renamed. |
<renameSuffix> | The filename suffix to which successfully uploaded files will be renamed. |
Note: on Windows, two variants exist — flexibee2xml and flexibee2xml-cli. The first is compiled as a GUI application and does not open a command-line window. It is therefore neater in appearance, but does not display error messages.
