Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-973

Improve error reporting during CSV import

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.0, 1.7.1, 1.7.2, 1.8.0
    • Fix Version/s: 1.8.0
    • Component/s: DSpace API
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      5
    • Documentation Status:
      Not Required

      Description

      The metadata-import script returns "Error reading file: 1" when the CSV header contains an unknown element (e.g. "test").
      It works well if the element is qualified (e.g. "dc.test") "Error reading file: Unknown metadata element in heading: dc.test"

      There should be a more helpful error message for this.

        Attachments

          Activity

          Hide
          stuartlewis Stuart Lewis added a comment -

          Duplicate of DS-834 CSV import dialog doesn't handle csv errors gracefully.

          Fixed in trunk.

          Show
          stuartlewis Stuart Lewis added a comment - Duplicate of DS-834 CSV import dialog doesn't handle csv errors gracefully. Fixed in trunk.
          Hide
          helix84 Ivan Masár added a comment -

          Stuart, you marked this as a duplicate of bug which was fixed in r6452. I'm currently running trunk r6496 and this particular error occurs there, so this bug should be reopened.

          Show
          helix84 Ivan Masár added a comment - Stuart, you marked this as a duplicate of bug which was fixed in r6452. I'm currently running trunk r6496 and this particular error occurs there, so this bug should be reopened.
          Hide
          stuartlewis Stuart Lewis added a comment -

          Hi Ivan, apologies - I'll check this out.

          Show
          stuartlewis Stuart Lewis added a comment - Hi Ivan, apologies - I'll check this out.
          Hide
          stuartlewis Stuart Lewis added a comment -

          Hi Ivan,

          Could you re-test this please? I've tried, and it worked OK for me. It is handled by this piece of code:

          See: http://scm.dspace.org/svn/repo/dspace/trunk/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java

          // Verify that the heading is valid in the metadata registry
          String[] clean = element.split("
          [");
          String[] parts = clean[0].split("
          .");

          if (parts.length < 2)

          { throw new MetadataImportInvalidHeadingException(element, MetadataImportInvalidHeadingException.ENTRY, columnCounter); }

          Any heading with less than one period ('.') in it will fail this test, and throw the exception. Then see:

          http://scm.dspace.org/svn/repo/dspace/trunk/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java

          else

          { return "Bad metadata declaration in row " + column + ": " + badHeading; }

          Thanks,

          Stuart

          Show
          stuartlewis Stuart Lewis added a comment - Hi Ivan, Could you re-test this please? I've tried, and it worked OK for me. It is handled by this piece of code: See: http://scm.dspace.org/svn/repo/dspace/trunk/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java // Verify that the heading is valid in the metadata registry String[] clean = element.split(" ["); String[] parts = clean [0] .split(" ."); if (parts.length < 2) { throw new MetadataImportInvalidHeadingException(element, MetadataImportInvalidHeadingException.ENTRY, columnCounter); } Any heading with less than one period ('.') in it will fail this test, and throw the exception. Then see: http://scm.dspace.org/svn/repo/dspace/trunk/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java else { return "Bad metadata declaration in row " + column + ": " + badHeading; } Thanks, Stuart
          Hide
          stuartlewis Stuart Lewis added a comment -

          Closing - DS-811 should fix all error messages such as this. Please open a new ticket (or re-open this ticket) if this is still a problem in trunk.

          Show
          stuartlewis Stuart Lewis added a comment - Closing - DS-811 should fix all error messages such as this. Please open a new ticket (or re-open this ticket) if this is still a problem in trunk.

            People

            • Assignee:
              stuartlewis Stuart Lewis
              Reporter:
              helix84 Ivan Masár
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: