Clicking a restricted bitstream in DSpace will display a request form. The form displays the title of the item by default. In version 5x, I managed to get to display other metadata instead of title (eg citation).
The code I used to display:
Metadatum[] titleDC = item.getMetadata("dc", "title", null, Item.ANY);
Metadatum[] citationDC = item.getMetadata("dc", "identifier", "citation", Item.ANY);
String document = "";
if (citationDC != null && citationDC.length > 0) {
document = citationDC[0].value;
} else {
if (titleDC != null && titleDC.length > 0)
document = titleDC[0].value;
}
itemRequest.addPara(document);
I cannot use this code in version 6x because of major changes in the source code. Below is the default code in DSpace 6x to display the item's title:
String titleDC = item.getName();
if (titleDC != null && titleDC.length() > 0)
itemRequest.addPara(titleDC);
It seems there is no item.getMetadata
in version 6. My question is how to translate the version 5x code
Metadatum[] citationDC = item.getMetadata("dc", "identifier", "citation", Item.ANY);
into version 6?