Introduction
External data can be imported to vSEC:CMS via XML or CSV file(s). This imported data can then be made available as vSEC:CMS variables to be used in workflows as required.
Data imported using this mechanism is stored in the local file system on the server where vSEC:CMS is installed. Typically this is located here c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\cms_db\data if vSEC:CMS was installed to the default installation location. Additionally, it is important to be aware that the content of this folder is not included in standard vSEC:CMS backups.
This article will explain how to import generic data into vSEC:CMS and how to use such data once imported.
Data Import
As mentioned in the Introduction above there are 2 ways that data can be imported, via XML or CSV file. We will divide the mechanism into 2 different sections below, XML Import and CSV Import.
XML Import
The format of XML import file should be like below:
<?xml version="1.0" encoding="UTF-8"?> <data> <e id="7C4E934E963F06EB7DA0FCBC"> <v name="rfid.uid" value="UID_1"/> </e> </data> <cms_config> <v name="CMS-Rfid-CSN" value="rfid.csn"/> </cms_config> |
Where an <e> XML node is referencing one unique entity to be imported and the id= attribute will be the id that vSEC:CMS will search this entry for later (CSN in this example). Each entity can contain several variable values <v> node(s) with name= attribute containing vSEC:CMS variable name and value= attribute containing variable value.
To import a XML file of this format the file needs to have an .in extension and will be copied into c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\cms_db\import folder. vSEC:CMS service will pick it up automatically and import it. The result of the import process will be to put into the c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\cms_db\import folder with the same filenames as the imported file with appended timestamp and result. For example, putting a file csv_uid.in into c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\cms_db\import will result in these files being created
csv_uid.in_20210506082039366.succ
csv_uid.in_20210506082039366.fail
CVS Import
The CSV import is working as an additional prepartoon step to the XML import as described above.
The file will have to contain a header and lines with the data to be imported.
"rfid.csn","rfid.uid" "7C4E934E963F06EB7DA0FCBC","UID_1" |
The header is containing vSEC:CMS variable name(s).
The CSV file for import needs to be put into c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\db_import folder and then the CsvImportTool.exe needs to be used to convert the CSV file into XML format and put it into c:\Program Files (x86)\Versasec\vSEC_CMS S-Series\cms_db\import folder to be imported to vSEC:CMS.
1. Close vSEC:CMS console.
2. Copy the prepared CSV file to the folder db_import where vSEC:CMS application was installed to (typically C:\Program Files (x86)\Versasec\vSEC_CMS S-Series).
3. Browse to the location where vSEC:CMS application was installed to (typically C:\Program Files (x86)\Versasec\vSEC_CMS S-Series) and double click the file CsvImportTool.exe.
4. Click the Import button.
5. If the entries in the CSV file are configured correctly and the import is successful a success dialog will appear similar to below.
6. Start vSEC:CMS console and browse to Options – Variables page.
7. Click the Add button. Select Imported from Add Variable drop-down field and select the Variable name from the drop-down list. Select the Parameter to be associated with this new variable, for example, ${RfidCsn} in this example.
Click Ok to save and close.