Hi Mike,

(I had responded in our Slack [1] #tech-support channel as well)

I'm not entirely sure that the Simple Archive Format supports export/import
of versioned items.  Versioned items are a newer feature, and I'm not
seeing any recent code changes to the Simple Archive Format import/export
features that implies it was updated to support versioned items.

The Documentation for Simple Archive Format also doesn't currently mention
Item Level Versioning:
https://wiki.duraspace.org/display/DSDOC6x/Importing+and+Exporting+Items+via+Simple+Archive+Format

So, my guess here is that this may a bug, as Simple Archive Format code
hasn't been updated to support multiple version import/export.  Ideally, it
seems like the export code should be updated to export all versions of an
item (instead, of having to run a separate "export" command per item
version, like your example shows).  Then, the import code should be updated
to understand how to import multiple versions.

If we don't hear from anyone else who knows of a way to get this to work,
then I'd recommend logging this as bug in our issue tracker (and we can
write a note into the Documentation as well):
https://jira.duraspace.org/projects/DS/

- Tim

[1] https://wiki.duraspace.org/display/DSPACE/Slack

On Tue, May 8, 2018 at 1:09 PM <[email protected]> wrote:

> Hi,
>
> I'm getting this error importing an items with multiple versions using
> DSpace 6.2:
>
> read handle: '20.500.12111/1420.2'
> java.lang.NullPointerException
> at
> org.dspace.versioning.VersionHistoryServiceImpl.getVersion(VersionHistoryServiceImpl.java:112)
> at
> org.dspace.identifier.VersionedHandleIdentifierProvider.restoreItAsVersion(VersionedHandleIdentifierProvider.java:257)
> at
> org.dspace.identifier.VersionedHandleIdentifierProvider.register(VersionedHandleIdentifierProvider.java:196)
> at
> org.dspace.identifier.IdentifierServiceImpl.register(IdentifierServiceImpl.java:117)
> at
> org.dspace.content.InstallItemServiceImpl.installItem(InstallItemServiceImpl.java:71)
> at
> org.dspace.app.itemimport.ItemImportServiceImpl.addItem(ItemImportServiceImpl.java:516)
> at
> org.dspace.app.itemimport.ItemImportServiceImpl.addItems(ItemImportServiceImpl.java:338)
> at
> org.dspace.app.itemimport.ItemImportCLITool.main(ItemImportCLITool.java:375)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
> at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
> java.lang.NullPointerException
>
> *Steps to reproduce:*
>
> 1- export an item with 2 or more versions:
> dspace export --type=ITEM --id=20.500.12111/1420 --dest=/tmp/1420
> --number=1
> dspace export --type=ITEM --id=20.500.12111/1420.2 --dest=/tmp/1420
> --number=2
>
> 2- delete the item
>
> 3- import the item from the command line.
> dspace import -a -e [email protected] -c 20.500.12111/160 -s /tmp/1420 -m
> 1420.map
>
> Things i tried to confirm the initial export was successful:
>
> - If i remove version 2 (folder 2) from /tmp/1420/ i can import the
> original version 20.500.12111/1420 without version 2
> - If i change the handle number of version 2 inside the handle file to a
> new handle like 20.500.12111/1500 instead of 120.500.12111/1420.2 i'm able
> to import version 2 as a whole new item but that's not what i'm after.
>
> It seems like a bug to me, can anyone confirm this?
>
> Regards,
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Tim Donohue
Technical Lead for DSpace & DSpaceDirect
DuraSpace.org | DSpace.org | DSpaceDirect.org

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to