Occasionally I'll need to grab the collection_id (database id for a collection) for some scripting or so forth from DSpace. It's not blatantly obvious how to do that when you only have the collection handle. There are two ways of which I know, and I shall share here.
Using the GUI
Login as administrator => navigate to the collection => use one of the Admin Tools such as Edit Authorizations or Delete (but don't ACTUALLY delete the collection, obviously!) and the database ID for the collection is displayed in the page heading.
Programmatically
If you need to grab the ID in a program, then you can use SQL like:
where COLLECTION_HANDLE is something like 2123/1234 (ie: handle prefix + identifier), because, you see, resource_id in the handle table is actually synonymous with the collection_id in the collection table (and probably community_id and item_id in their respective tables).
Dear Sir,
ReplyDeleteThanks for the help, very useful information