Ensuring item import in order as defined in CSV #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have at our end the requirement to import items inside a SAF in the same order as they where defined inside the CSV used to create the SAF.
DSpace sorts the entries inside the SAF alphanumerically while importing the SAF, so an item 11 would be imported after item 9 due to the corresponding item directory names:
item_1
item_10
item_11
item_2
item_3
item_4
item_5
item_6
item_7
item_8
item_9
This change uses a String formatter based on the amount of data records to create the SAF item directories, so the sort order fits the order inside the CSV:
item_01
item_02
item_03
item_04
item_05
item_06
item_07
item_08
item_09
item_10
item_11
item_12