public void addBody(Body body) throws SAXException, WingException, SQLException
{
// Get our parameters and state;
int collectionID = parameters.getParameterAsInteger("collectionID",-1);
Collection collection = Collection.find(context,collectionID);
ArrayList<Item> items = getMappedItems(collection);
// DIVISION: browse-items
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;