/** * Process the save or remove step. If the user has selected to * remove their submission then remove it. * * @param context The current DSpace content * @param id The unique ID of the current workspace/workflow * @param request The cocoon request object. */ public static void processSaveOrRemove(Context context, String id, Request request) throws SQLException, AuthorizeException, IOException { if (request.getParameter("submit_remove") != null) { // If they selected to remove the item then delete everything. WorkspaceItem workspace = findWorkspace(context,id); workspace.deleteAll(); context.commit(); } }
workspaceItem.deleteAll();
"workspace_item_id=" + workspaceItem.getID() + ",item_id=" + workspaceItem.getItem().getID())); workspaceItem.deleteAll(); showMainPage(context, request, response); context.complete();
@Override public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { Request request = ObjectModelHelper.getRequest(objectModel); Context context = ContextUtil.obtainContext(request); if(!AuthorizeManager.isAdmin(context)){ throw new AuthorizeException(); } int[] workflowIdentifiers = Util.getIntParameters(request, "workflow_id"); if(workflowIdentifiers != null){ for (int workflowIdentifier : workflowIdentifiers) { XmlWorkflowItem workflowItem = XmlWorkflowItem.find(context, workflowIdentifier); if (workflowItem != null) { WorkspaceItem workspaceItem = XmlWorkflowManager.sendWorkflowItemBackSubmission(context, workflowItem, context.getCurrentUser(), "Item sent back to the submisson process by admin", null); //Delete the workspaceItem workspaceItem.deleteAll(); } } } return null; } }