Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   Importing XML/CSV, posted by Barend on Tue Oct 8 18:14:20 2013 import.xml
    icon2.gif   Re: Importing XML/CSV, posted by Andreas Luedeke on Wed Oct 9 09:19:54 2013 
       icon2.gif   Re: Importing XML/CSV, posted by Barend on Sun Oct 13 16:32:05 2013 umowy.cfg
          icon3.gif   Re: Importing XML/CSV, posted by Andreas Luedeke on Wed Oct 16 16:53:55 2013 elogd.cfgimp.xml
             icon2.gif   Re: Importing XML/CSV, posted by Barend on Tue Oct 22 10:56:13 2013 
Message ID: 67585     Entry time: Wed Oct 16 16:53:55 2013     In reply to: 67582     Reply to this: 67589
Icon: Idea  Author: Andreas Luedeke  Author Email: andreas.luedeke@psi.ch 
Category: Bug report  OS: Windows  ELOG Version: 2.9.2 
Subject: Re: Importing XML/CSV 

Barend wrote:

Andreas Luedeke wrote:

Barend wrote:
Hi Stefan,
I'm experiencing problems importing XML (.csv is not working at all for me).
My logbook contains 3 date-attributes besides the system DATE (entry time), date-format is defined as %d %b %y.
The XML file hold the date format "DD.MM.YYYY"
- During "preview" I see that all entries are listed.
- During the import I get the "wrong date format" error.
- When I review the Summary, I see that only the first XML entry (all 3 date-attributes hold a date) was imported.
- When I try to re-import the XML from the second entry (after removing the 1st entry from XML - this second entry hold NO date-value on one of the date-attributes) the elogd.exe crashes and I get the "Service Temporarily Unavailable" error page.
- When I try to re-import the XML from the modified second entry (after removing the 1st entry from XML - this second entry holds date-value on all of the date-attributes) the elogd.exe crashes and I get the "Service Temporarily Unavailable" error page.

Any suggestion what could be wrong? Is it the missing date-value?

 Can you post your elog configuration file (elog.cfg)?

 
Detect language » English
 

 Hi Andreas,

I had to filter-out some other logbook. Please find attached the configuration section for the affected logbook "UMOWY".

Looking forward to your review.

Regards, Barend

Hi Barend,

I can confirm that this is a bug of the ELOG import function: if you have a field that is defined as type "date" or "datetime", then elogd requires the value of the field to be of a matching format.
It is not even allowed to omit the time in "datetime" format. If the field is not required in an entry, then it is therefore possible to create an entry that cannot be imported.
I've attached a minimal example elogd.cfg and XML import file to reproduce the problem.
I'm afraid you'll either need to wait for a patch, or you can add dummy dates for all your empty date fields in the XML import file. Just do a "replace all" with your favourite editor; in my example you would e.g. replace all "<D></D>" strings with "<D>01-01-1970</D>" before the import.
 
Detect language » English
 

Cheers, Andreas

 
Detect language » English
 
 
Detect language » English
 
Attachment 1: elogd.cfg  73 Bytes  | Hide | Hide all
[global]
port = 8080

[TestXmlImportOfDate]
Attributes = D
Type D = date
Attachment 2: imp.xml  358 Bytes  | Hide | Hide all
<?xml version="1.0" encoding="ISO-8859-1"?>
<ELOG_LIST>
	<ENTRY>
		<MID>1</MID>
		<DATE>Mon  07 Oct 2013 11:41:42 +0200</DATE>
		<ENCODING>plain</ENCODING>
		<D>20.10.2012</D>
		<TEXT>ABCD</TEXT>
	</ENTRY>
	<ENTRY>
		<MID>2</MID>
		<DATE>Mon  07 Oct 2013 11:41:43 +0200</DATE>
		<ENCODING>plain</ENCODING>
		<D></D>
		<TEXT>DEF</TEXT>
	</ENTRY>
</ELOG_LIST>
ELOG V3.1.5-fe60aaf