Hello Stefan,

you are right this looks (not tested it) like a bug in:

https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java#L736

addItem(c, mycollections, sourceDir, dircontents[i], mapOut, template);
should be
addItem(c, clist, sourceDir, dircontents[i], mapOut, template);

If you add the line you mentioned
" I add at line 736 the statement mycollections = clist. After this 
change the process behave like -c option is set."
This will fail if using the importer with the -c option.

You can file it in our issue Tracker:
https://jira.duraspace.org/browse/DS/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel

Hope this helps

and

Grüße aus dem Ruhrpott

Claudia


Am 30.07.2015 um 12:50 schrieb Stefan Fritzsche:
> Dear Members,
>
> i try to ingest some content with the commandline tool "dspace import".
>
> I want to ingest the content via the Simple Archive Format
> (https://wiki.duraspace.org/display/DSDOC5x/Importing+and+Exporting+Items+via+Simple+Archive+Format).
>
>
> The ingest is started with
>
> dspace@server> dspace import -a -e f...@bar.de -s . -m mapfile.
> No collections given. Assuming 'collections' file inside item directory
> Adding items from directory: .
> Generating mapfile: mapfile
> Processing collections file: collections
> ...
>
> The content of the collection file is "123456789/9".
>
> When i start the ingest, the process throws a NullPointerException but
> if i use the -c option with the collection_id from the file it works.
>
> I use the debugger to find the cause of the exception. The method
> addItem(Context c, Collection[] mycollections, String path, String
> itemname, PrintWriter mapOut, boolean template) throws Exception) in the
> package org.dspace.app.itemimport throws the exception.
> I determine that the method addItem is called with the parameter
> mycollections = null but if i use the -c option the parameter holds the
> collection_id.
>
> I add at line 736 the statement mycollections = clist. After this change
> the process behave like -c option is set.
>
> My questions are:
> Is this a bug and should i report it?
> Has my fix some side effects?
>
> Thanks in advance,
> Stefan
>
> ------------------------------------------------------------------------------
> _______________________________________________
> DSpace-tech mailing list
> DSpace-tech@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette: 
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>

-- 
Claudia Juergen
Eldorado

Technische Universität Dortmund
Universitätsbibliothek
Vogelpothsweg 76
44227 Dortmund

Tel.: +49 231-755 40 43
Fax: +49 231-755 40 32
claudia.juer...@ub.tu-dortmund.de
www.ub.tu-dortmund.de


Wichtiger Hinweis: Die Information in dieser E-Mail ist vertraulich. Sie 
ist ausschließlich für den Adressaten bestimmt. Sollten Sie nicht der 
für diese E-Mail bestimmte Adressat sein, unterrichten Sie bitte den 
Absender und vernichten Sie diese Mail. Vielen Dank.
Unbeschadet der Korrespondenz per E-Mail sind unsere Erklärungen 
ausschließlich final rechtsverbindlich, wenn sie in herkömmlicher 
Schriftform (mit eigenhändiger Unterschrift) oder durch Übermittlung 
eines solchen Schriftstücks per Telefax erfolgen.

Important note: The information included in this e-mail is confidential. 
It is solely intended for the recipient. If you are not the intended 
recipient of this e-mail please contact the sender and delete this 
message. Thank you.
Without prejudice of e-mail correspondence our statements are only 
legally binding when they are made in the conventional written form 
(with personal signature) or when such documents are sent by fax.

------------------------------------------------------------------------------
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to