SQLException, AuthorizeException
{
String buttonPressed = UIUtil.getSubmitButton(request, "submit_own");
// Get workspace item, if any
WorkspaceItem workspaceItem;
try
{
int wsID = Integer.parseInt(request.getParameter("workspace_id"));
workspaceItem = WorkspaceItem.find(context, wsID);
}
catch (NumberFormatException nfe)
{
workspaceItem = null;
}
// Get workflow item specified, if any
WorkflowItem workflowItem;
try
{
int wfID = Integer.parseInt(request.getParameter("workflow_id"));
workflowItem = WorkflowItem.find(context, wfID);
}
catch (NumberFormatException nfe)
{
workflowItem = null;
}
// Respond to button press
boolean ok = false;
if (buttonPressed.equals("submit_new"))
{
// New submission: Redirect to submit
response.sendRedirect(response.encodeRedirectURL(request
.getContextPath()
+ "/submit"));
ok = true;
}
else if (buttonPressed.equals("submit_own"))
{
// Review own submissions
showPreviousSubmissions(context, request, response);
ok = true;
}
else if (buttonPressed.equals("submit_resume"))
{
// User clicked on a "Resume" button for a workspace item.
String wsID = request.getParameter("workspace_id");
response.sendRedirect(response.encodeRedirectURL(request
.getContextPath()
+ "/submit?resume=" + wsID));
ok = true;
}
else if (buttonPressed.equals("submit_delete"))
{
// User clicked on a "Remove" button for a workspace item
if (workspaceItem != null)
{
log.info(LogManager.getHeader(context, "confirm_removal",
"workspace_item_id=" + workspaceItem.getID()));
request.setAttribute("workspace.item", workspaceItem);
JSPManager.showJSP(request, response,
"/mydspace/remove-item.jsp");
}