Row headerrow = mdchanges.addRow(Row.ROLE_HEADER);
// Show the item
if (!change.isNewItem())
{
Item i = change.getItem();
Cell cell = headerrow.addCell(1, 2); // colspan="2"
cell.addContent(T_changes_pending);
cell.addContent(" " + i.getID() + " (" + i.getHandle() + ")");
}
else
{
headerrow.addCellContent(T_new_item);
}
}
// Show actions
if (change.isDeleted())
{
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-delete");
Cell cell = mdrow.addCell();
cell.addContent(T_item_delete);
mdrow.addCellContent("");
}
if (change.isWithdrawn())
{
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-withdraw");
Cell cell = mdrow.addCell();
cell.addContent(T_item_withdraw);
mdrow.addCellContent("");
}
if (change.isReinstated())
{
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"item-reinstate");
Cell cell = mdrow.addCell();
cell.addContent(T_item_reinstate);
mdrow.addCellContent("");
}
// Show new owning collection
if (change.getNewOwningCollection() != null)
{
Collection c = change.getNewOwningCollection();
if (c != null)
{
String cHandle = c.getHandle();
String cName = c.getName();
Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
colrow.addCellContent(T_collection_newowner);
colrow.addCellContent(cHandle + " (" + cName + ")");
}
}
// Show old owning collection
if (change.getOldOwningCollection() != null)
{
Collection c = change.getOldOwningCollection();
if (c != null)
{
String cHandle = c.getHandle();
String cName = c.getName();
Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
colrow.addCellContent(T_collection_oldowner);
colrow.addCellContent(cHandle + " (" + cName + ")");
}
}
// Show new mapped collections
for (Collection c : newCollections)
{
String cHandle = c.getHandle();
String cName = c.getName();
Row colrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
colrow.addCellContent(T_collection_mapped);
colrow.addCellContent(cHandle + " (" + cName + ")");
}
// Show old mapped collections
for (Collection c : oldCollections)
{
String cHandle = c.getHandle();
String cName = c.getName();
Row colrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
colrow.addCellContent(T_collection_unmapped);
colrow.addCellContent(cHandle + " (" + cName + ")");
}
// Show additions
for (Metadatum dcv : adds)
{
Row mdrow = mdchanges.addRow("addition",Row.ROLE_DATA,"metadata-addition");
String md = dcv.schema + "." + dcv.element;
if (dcv.qualifier != null)
{
md += "." + dcv.qualifier;
}
if (dcv.language != null)
{
md += "[" + dcv.language + "]";
}
Cell cell = mdrow.addCell();
cell.addContent(T_item_addition);
cell.addContent(" (" + md + ")");
mdrow.addCellContent(dcv.value);
}
// Show removals
for (Metadatum dcv : removes)
{
Row mdrow = mdchanges.addRow("deletion",Row.ROLE_DATA,"metadata-deletion");
String md = dcv.schema + "." + dcv.element;
if (dcv.qualifier != null)
{
md += "." + dcv.qualifier;
}
if (dcv.language != null)
{
md += "[" + dcv.language + "]";
}
Cell cell = mdrow.addCell();
cell.addContent(T_item_deletion);
cell.addContent(" (" + md + ")");
mdrow.addCellContent(dcv.value);
}
}
Para actions = div.addPara();
Button applychanges = actions.addButton("submit_confirm");