swordapp / JavaClient2.0

A Java implementation of the SWORDv2 client responsibilities
http://www.swordapp.org
Other
8 stars 10 forks source link

Getting the dc:identifier #1

Open pes130 opened 11 years ago

pes130 commented 11 years ago

Hello Richard,

First of all, congratulations for this useful library.

I've succesully checked in items with your sword java client. But I have a questions:

How can I recover de dc:identifier field (dublin core). I mean, I need the following: <record> <header> <identifier>oai:localhost:123456789/21</identifier> ... </header> <metadata> <oai_dc:dc xmlns:oai_dc="....."> <dc:title>Picnic at Hanging Rock</dc:title> ... <dc:description>Misteriosa historia ¿basada en hechos reales?</dc:description> ... <dc:identifier>http://hdl.handle.net/123456789/21&lt;/dc:identifier&gt; ... </oai_dc:dc> </metadata> </record>

I know it's dublin core field, but I need exactly that http://hdl.handle.net/123456789/21, or at least the 21.

Looking at the atom feed output obtained with: Content content = client.getContent(resp.getLocation(), "application/atom+xml;type=feed", null, auth);

content.getFeed().writeTo(System.out);

After inserting the item, the most similar i found is: ... <entry> <id>http://localhost:8080/xmlui/bitstream/123456789/21/2/testPDF.pdf&lt;/id&gt; <title type="text">Original Deposit http://localhost:8080/xmlui/bitstream/123456789/21/2/testPDF.pdf&lt;/title&gt; ... </entry> <entry> <id>http://localhost:8080/xmlui/bitstream/123456789/21/3/sword-2012-11-13T20:49:59.original.xml&lt;/id&gt; <title type="text">Original Deposit http://localhost:8080/xmlui/bitstream/123456789/21/3/sword-2012-11-13T20:49:59.original.xml&lt;/title&gt; ... <content type="application/octet-stream" src="http://localhost:8080/xmlui/bitstream/123456789/21/3/sword-2012-11-13T20:49:59.original.xml" /> ... </entry> ...

Is there a way to obtain it more directly?

Thanks in advance!

Pablo

richard-jones commented 11 years ago

Hi Pablo,

Sorry for the long delay in responding ... only just saw your new issue.

Your first example looks like an OAI-PMH feed, and I'm not quite sure I understand the relationship.

If you are after the handle from DSpace, the best thing is to look to see if it exposes something like atom:link@rel="alternate", which is most likely to contain the handle. Remember also that an item in DSpace won't get a handle until it gets archived, so if it remains in the workspace, or is held in the workflow, you won't be able to get this information.

Hope that helps!

Cheers,

Richard