for (ClaimedTask owned : ownedItems)
{
int workflowItemID = owned.getWorkflowItemID();
String stepID = owned.getStepID();
String actionID = owned.getActionID();
XmlWorkflowItem item = null;
try {
item = XmlWorkflowItem.find(context, workflowItemID);
Workflow wf = WorkflowFactory.getWorkflow(item.getCollection());
Step step = wf.getStep(stepID);
WorkflowActionConfig action = step.getActionConfig(actionID);
String url = contextPath+"/handle/"+item.getCollection().getHandle()+"/xmlworkflow?workflowID="+workflowItemID+"&stepID="+stepID+"&actionID="+actionID;
Metadatum[] titles = item.getItem().getDC("title", null, Item.ANY);
String collectionName = item.getCollection().getMetadata("name");
EPerson submitter = item.getSubmitter();
String submitterName = submitter.getFullName();
String submitterEmail = submitter.getEmail();
// Message state = getWorkflowStateMessage(owned);
boolean taskHasPool = step.getUserSelectionMethod().getProcessingAction().usesTaskPool();
if(taskHasPool){
//We have a workflow item that uses a pool, ensure we see the return to pool button
showReturnToPoolButton = true;
}
Row row = table.addRow();
Cell firstCell = row.addCell();
if(taskHasPool){
CheckBox remove = firstCell.addCheckBox("workflowandstepID");
remove.setLabel("selected");
remove.addOption(workflowItemID + ":" + step.getId());
}
// The task description
row.addCell().addXref(url,message("xmlui.XMLWorkflow." + wf.getID() + "." + stepID + "." + actionID));
// The item description
if (titles != null && 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);
// Submitted too
row.addCell().addXref(url,collectionName);
// Submitted by
Cell cell = row.addCell();
cell.addContent(T_email);
cell.addXref("mailto:"+submitterEmail,submitterName);
} catch (WorkflowConfigurationException e) {
Row row = table.addRow();
row.addCell().addContent("Error: Configuration error in workflow.");
log.error(LogManager.getHeader(context, "Error while adding owned tasks on the submissions page", ""), e);
} catch (Exception e) {
log.error(LogManager.getHeader(context, "Error while adding owned tasks on the submissions page", ""), e);
}
}
if(showReturnToPoolButton){
Row row = table.addRow();
row.addCell(0,5).addButton("submit_return_tasks").setValue(T_w_submit_return);
}
}
else
{
Row row = table.addRow();
row.addCell(0,5).addHighlight("italic").addContent(T_w_info2);
}
// Tasks in the pool
table = workflow.addTable("workflow-tasks",pooledItems.size()+2,5);
table.setHead(T_w_head3);
header = table.addRow(Row.ROLE_HEADER);
header.addCellContent(T_w_column1);
header.addCellContent(T_w_column2);
header.addCellContent(T_w_column3);
header.addCellContent(T_w_column4);
header.addCellContent(T_w_column5);
if (pooledItems.size() > 0)
{
for (PoolTask pooled : pooledItems)
{
String stepID = pooled.getStepID();
int workflowItemID = pooled.getWorkflowItemID();
String actionID = pooled.getActionID();
XmlWorkflowItem item;
try {
item = XmlWorkflowItem.find(context, workflowItemID);
Workflow wf = WorkflowFactory.getWorkflow(item.getCollection());
String url = contextPath+"/handle/"+item.getCollection().getHandle()+"/xmlworkflow?workflowID="+workflowItemID+"&stepID="+stepID+"&actionID="+actionID;
Metadatum[] titles = item.getItem().getDC("title", null, Item.ANY);
String collectionName = item.getCollection().getMetadata("name");
EPerson submitter = item.getSubmitter();
String submitterName = submitter.getFullName();
String submitterEmail = submitter.getEmail();
// Message state = getWorkflowStateMessage(pooled);