Division div = body.addInteractiveDivision("browse-items",contextPath + "/admin/mapper", Division.METHOD_GET,"primary administrative mapper");
div.setHead(T_head1);
if (AuthorizeManager.authorizeActionBoolean(context, collection, Constants.REMOVE))
{
Para actions = div.addPara();
actions.addButton("submit_unmap").setValue(T_submit_unmap);
actions.addButton("submit_return").setValue(T_submit_return);
}
else
{
Para actions = div.addPara();
Button button = actions.addButton("submit_unmap");
button.setValue(T_submit_unmap);
button.setDisabled();
actions.addButton("submit_return").setValue(T_submit_return);
div.addPara().addHighlight("fade").addContent(T_no_remove);
}
Table table = div.addTable("browse-items-table",1,1);
Row header = table.addRow(Row.ROLE_HEADER);
header.addCellContent(T_column1);
header.addCellContent(T_column2);
header.addCellContent(T_column3);
header.addCellContent(T_column4);
for (Item item : items)
{
String itemID = String.valueOf(item.getID());
Collection owningCollection = item.getOwningCollection();
String owning = owningCollection.getMetadata("name");
String author = "unkown";
DCValue[] dcAuthors = item.getDC("contributor",Item.ANY,Item.ANY);
if (dcAuthors != null && dcAuthors.length >= 1)
author = dcAuthors[0].value;
String title = "untitled";
DCValue[] dcTitles = item.getDC("title",null,Item.ANY);
if (dcTitles != null && dcTitles.length >= 1)
title = dcTitles[0].value;
String url = contextPath+"/handle/"+item.getHandle();
Row row = table.addRow();
CheckBox select = row.addCell().addCheckBox("itemID");
select.setLabel("Select");
select.addOption(itemID);
row.addCellContent(owning);
row.addCell().addXref(url,author);
row.addCell().addXref(url,title);
}
if (AuthorizeManager.authorizeActionBoolean(context, collection, Constants.REMOVE))
{
Para actions = div.addPara();
actions.addButton("submit_unmap").setValue(T_submit_unmap);
actions.addButton("submit_return").setValue(T_submit_return);
}
else
{
Para actions = div.addPara();
Button button = actions.addButton("submit_unmap");
button.setValue(T_submit_unmap);
button.setDisabled();
actions.addButton("submit_return").setValue(T_submit_return);
div.addPara().addHighlight("fade").addContent(T_no_remove);
}