2 Iulii 2007

Bitstream handles

MPOW hacked up a way to assign handles to bitstreams in DSpace, because DSpace (despite repeated calls for this feature) wasn’t going to.

Works fine and dandy, except for one little detail: HTML ingest. I found out today that our hack assigns bitstream handles just fine, but there’s no way to find out the handle for any given bitstream inside an HTML ingest other than trial-and-error, because DSpace uses DSpace’s own internal URL system internally.

So I just spent an hour trying to work out how to SQL-query a list of the bitstream handles and names in a given item. This is one heinously ugly query, but it did what I wanted:

select handle.handle, bitstream.name from handle, bitstream where handle.resource_type_id = '0' and handle.resource_id = bitstream.bitstream_id and bitstream.bitstream_id in (select bitstream_id from bundle2bitstream where bundle_id in (select bundle_id from bundle where name = 'ORIGINAL' and bundle_id in (select bundle_id from item2bundle where item_id = (select resource_id from handle where handle='(insert item’s handle here)'))));

This won’t be helpful to any other DSpace admins, sorry; it relies on our local hack. But after three false starts and much too much time, I don’t want to lose the damn query!