If I understand correctly, the ItemImport tool wants a separate xml file for 
each metadata schema.  I don't really like this approach, so what I did was to 
implement a little hack in the ItemImport.java file 
(org/dspace/app/itemimport/ItemImport.java).  In the addDCValue method, above 
this line:

    String element = getAttributeValue(n, "element");

I added the following block:

    String new_schema = getAttributeValue(n, "schema");
       if(new_schema != null){
        schema = new_schema;
    }

This allowed me to use multiple schemas in a single file.


Brian Helm
Programmer
Information Technology Division
UK Libraries
Phone: 859-257-0500 X 2106
Fax: 859-257-0505
E-mail: [EMAIL PROTECTED]


________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hlias Stavrakis
Sent: Wednesday, September 05, 2007 9:56 AM
To: dspace-tech Tech
Subject: [Dspace-tech] Batch import error

Hi,
 i have entered a new schema in dspace and use Batch inport tool to enter items 
and metadata values using both DC and MySchema.

During batch import when parsing the first metadata field of MySchema in 
dublin_core.xml i'm getting :

java.sql.SQLException: bad_dublin_core SchemaID=1, isReferencedBy null
 at org.dspace.content.Item.update(Item.java:1463)
 at org.dspace.content.InstallItem.installItem(InstallItem.java:146)
 at org.dspace.app.itemimport.ItemImport.addItem(ItemImport.java:663)
 at org.dspace.app.itemimport.ItemImport.addItems(ItemImport.java:506)
 at org.dspace.app.itemimport.ItemImport.main(ItemImport.java:415)
java.sql.SQLException: bad_dublin_core SchemaID=1, isReferencedBy null

the schema id of MySchema is not 1 as reported above but 3.
Furthermore, the <schema> element in dublin_core.xml has the right value 
"MySchema" but the tool recognizes only the basic DC schema because
when i define the same field in DC the tool works fine even if the <schema> 
element has "MySchema" value.

Is there any known bug or something that i did wrong?

Thanks.






-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to