DSpace
  1. DSpace
  2. DS-973

Improve error reporting during CSV import

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Minor 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
    • Epic:

      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.

        Activity

        Hide
        Stuart Lewis added a comment -
        Duplicate of DS-834 CSV import dialog doesn't handle csv errors gracefully.

        Fixed in trunk.
        Show
        Stuart Lewis added a comment - Duplicate of DS-834 CSV import dialog doesn't handle csv errors gracefully. Fixed in trunk.
        Hide
        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
        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
        Stuart Lewis added a comment -
        Hi Ivan, apologies - I'll check this out.
        Show
        Stuart Lewis added a comment - Hi Ivan, apologies - I'll check this out.
        Hide
        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
        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
        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
        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:
            Stuart Lewis
            Reporter:
            Ivan Masár
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: