Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-23932

Date format not handled by the Scan Importer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Bug
    • Affects Version/s: 9.10-SNAPSHOT
    • Fix Version/s: 9.10
    • Component/s: Scan importer

      Description

      Environment : MacOS + Mongo + Redis

      Step to reproduce:

      With this configuration, an error is raised on the date format :

      2017-12-12 11:14:30,019 ERROR [Nuxeo-Importer-1] [org.nuxeo.ecm.platform.scanimporter.processor.ScanedFileSourceNode] Error during properties parsing
      java.io.IOException: java.text.ParseException: Unparseable date: 
      	at org.nuxeo.ecm.platform.scanimporter.service.ScannedFileMapperComponent.parseMetaData(ScannedFileMapperComponent.java:126)
      	at org.nuxeo.ecm.platform.scanimporter.processor.ScanedFileSourceNode.getChildren(ScanedFileSourceNode.java:91)
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:327)
      	at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.run(GenericThreadedImportTask.java:377)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.text.ParseException: Unparseable date: 
      	at org.apache.commons.lang3.time.FastDateParser.parse(FastDateParser.java:367)
      	at org.apache.commons.lang3.time.FastDateFormat.parse(FastDateFormat.java:550)
      	at org.nuxeo.ecm.platform.scanimporter.service.ScannedFileMapperComponent.parseMetaData(ScannedFileMapperComponent.java:124)
      	... 6 more
      

      It happens because of this line in the extension :

      <fieldMapping sourceXPath="//date[@name='order_date']" targetXPath="foo:order_date" targetType="date" dateFormat="yyyy-MM-dd"/>
      

      As a result, the date metadata contained in XML file which should be imported is:

      <date name="order_date" label="Order date" value="2005-03-17" />
      

      So it really looks like the dateFormat is not correctly handled by the importer

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 minutes
                  5m