public static FlowResult processCurateObject(Context context, Request request)
{
//get input values from Form (see org.dspace.app.xmlui.aspect.administrative.CurateForm)
String task = request.getParameter("curate_task");
String objHandle = request.getParameter("identifier");
Curator curator = FlowCurationUtils.getCurator(task);
FlowResult result = null;
try
{
// Curate this object & return result
curator.curate(context, objHandle);
result = FlowCurationUtils.getRunFlowResult(task, curator, true);
}
catch (Exception e)
{
curator.setResult(task, e.getMessage());
result = FlowCurationUtils.getRunFlowResult(task, curator, false);
}
//pass curation task name & identifier back in FlowResult (so it can be pre-populated on UI)
result.setParameter("curate_task", task);
result.setParameter("identifier", objHandle);