{
rows++; // Supervising heading row
}
Table table = unfinished.addTable("unfinished-submissions",rows,5);
Row header = table.addRow(Row.ROLE_HEADER);
header.addCellContent(T_s_column1);
header.addCellContent(T_s_column2);
header.addCellContent(T_s_column3);
header.addCellContent(T_s_column4);
if (supervisedItems.length > 0 && unfinishedItems.length > 0)
{
header = table.addRow();
header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head3);
}
if (unfinishedItems.length > 0)
{
for (WorkspaceItem workspaceItem : unfinishedItems)
{
Metadatum[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();
int workspaceItemID = workspaceItem.getID();
String url = contextPath+"/submit?workspaceID="+workspaceItemID;
String submitterName = submitterEPerson.getFullName();
String submitterEmail = submitterEPerson.getEmail();
String collectionName = workspaceItem.getCollection().getMetadata("name");
Row row = table.addRow(Row.ROLE_DATA);
CheckBox remove = row.addCell().addCheckBox("workspaceID");
remove.setLabel("remove");
remove.addOption(workspaceItemID);
if (titles.length > 0)
{
String displayTitle = titles[0].value;
if (displayTitle.length() > 50)
displayTitle = displayTitle.substring(0, 50) + " ...";
row.addCell().addXref(url,displayTitle);
}
else
row.addCell().addXref(url,T_untitled);
row.addCell().addXref(url,collectionName);
Cell cell = row.addCell();
cell.addContent(T_email);
cell.addXref("mailto:"+submitterEmail,submitterName);
}
}
else
{
header = table.addRow();
header.addCell(0,5).addHighlight("italic").addContent(T_s_info3);
}
if (supervisedItems.length > 0)
{
header = table.addRow();
header.addCell(null,Cell.ROLE_HEADER,0,5,null).addContent(T_s_head4);
}
for (WorkspaceItem workspaceItem : supervisedItems)
{
Metadatum[] titles = workspaceItem.getItem().getDC("title", null, Item.ANY);
EPerson submitterEPerson = workspaceItem.getItem().getSubmitter();
int workspaceItemID = workspaceItem.getID();
String url = contextPath+"/submit?workspaceID="+workspaceItemID;
String submitterName = submitterEPerson.getFullName();
String submitterEmail = submitterEPerson.getEmail();
String collectionName = workspaceItem.getCollection().getMetadata("name");
Row row = table.addRow(Row.ROLE_DATA);
CheckBox selected = row.addCell().addCheckBox("workspaceID");
selected.setLabel("select");
selected.addOption(workspaceItemID);
if (titles.length > 0)
{
String displayTitle = titles[0].value;
if (displayTitle.length() > 50)
{
displayTitle = displayTitle.substring(0, 50) + " ...";
}
row.addCell().addXref(url,displayTitle);
}
else
{
row.addCell().addXref(url, T_untitled);
}
row.addCell().addXref(url,collectionName);
Cell cell = row.addCell();
cell.addContent(T_email);
cell.addXref("mailto:"+submitterEmail,submitterName);
}
header = table.addRow();