request.getContextPath() + "/dspace-admin/groups?group=" +
request.getContextPath() + "/tools/group-edit?group_id=" +
    private void processConfirmEditCollection(Context context,        HttpServletRequest request,        HttpServletResponse response,        Community community,        Collection collection)        throws ServletException, IOException, SQLException, AuthorizeException    {        if (request.getParameter("create").equals("true"))        {            // We need to create a new community            collection = community.createCollection();            request.setAttribute("collection", collection);        }        // Update the basic metadata        collection.setMetadata("name", request.getParameter("name"));        collection.setMetadata("short_description",            request.getParameter("short_description"));        String intro = request.getParameter("introductory_text");        if (intro.equals(""))        {            intro = null;        }        String copy = request.getParameter("copyright_text");        if (copy.equals(""))        {            copy = null;        }        String side = request.getParameter("side_bar_text");        if (side.equals(""))        {            side = null;        }        String license = request.getParameter("license");        if (license.equals(""))        {            license = null;        }        String provenance = request.getParameter("provenance_description");        if (provenance.equals(""))        {            provenance = null;        }        collection.setMetadata("introductory_text", intro);        collection.setMetadata("copyright_text", copy);        collection.setMetadata("side_bar_text", side);        collection.setMetadata("license", license);        collection.setMetadata("provenance_description", provenance);        // Which button was pressed?        String button = UIUtil.getSubmitButton(request, "submit");        if (button.equals("submit_set_logo"))        {            // Change the logo - delete any that might be there first            collection.setLogo(null);            // Display "upload logo" page.  Necessary attributes already set by            // doDSPost()            JSPManager.showJSP(request, response, "/dspace-admin/upload-logo.jsp");        }        else if(button.equals("submit_delete_logo"))        {            // Simply delete logo            collection.setLogo(null);            // Show edit page again - attributes set in doDSPost()            JSPManager.showJSP(request, response, "/dspace-admin/edit-collection.jsp");        }        else if(button.startsWith("submit_wf_create_"))        {            int step = Integer.parseInt(button.substring(17));            // Create new group            Group newGroup = Group.create(context);            newGroup.setName("COLLECTION_" + collection.getID() + "_WFSTEP_" +                step);            newGroup.update();            collection.setWorkflowGroup(step, newGroup);            collection.update();            // Forward to group edit page            response.sendRedirect(response.encodeRedirectURL(                request.getContextPath() + "/dspace-admin/groups?group=" +                    newGroup.getID()));        }        else if(button.equals("submit_authorization_edit"))        {            // Forward to policy edit page            response.sendRedirect(response.encodeRedirectURL(                request.getContextPath() + "/dspace-admin/authorize?collection_id=" +                    collection.getID() + "&submit_collection_select=1"));        }        else if(button.startsWith("submit_wf_edit_"))        {            int step = Integer.parseInt(button.substring(15));            // Edit workflow group            Group g = collection.getWorkflowGroup(step);            response.sendRedirect(response.encodeRedirectURL(                request.getContextPath() + "/dspace-admin/groups?group=" +                    g.getID()));        }        else if(button.startsWith("submit_wf_delete_"))        {            // Delete workflow group            int step = Integer.parseInt(button.substring(17));            Group g = collection.getWorkflowGroup(step);            collection.setWorkflowGroup(step, null);            // Have to update to avoid ref. integrity error            collection.update();            g.delete();            // Show edit page again - attributes set in doDSPost()            JSPManager.showJSP(request, response, "/dspace-admin/edit-collection.jsp");        }        else if(button.equals("submit_create_template"))        {            // Create a template item            collection.createTemplateItem();            // Forward to edit page for new template item            Item i = collection.getTemplateItem();	    // have to update to avoid ref. integrity error	    collection.update();	    context.complete();            response.sendRedirect(response.encodeRedirectURL(                request.getContextPath() + "/dspace-admin/edit-item?item_id=" +                    i.getID()));	    return;        }        else if(button.equals("submit_edit_template"))        {            // Forward to edit page for template item            Item i = collection.getTemplateItem();            response.sendRedirect(response.encodeRedirectURL(                request.getContextPath() + "/dspace-admin/edit-item?item_id=" +                    i.getID()));        }        else if(button.equals("submit_delete_template"))        {            collection.removeTemplateItem();            // Show edit page again - attributes set in doDSPost()            JSPManager.showJSP(request, response, "/dspace-admin/edit-collection.jsp");        }        else        {            // Plain old "create/update" button pressed - go back to main page            showControls(context, request, response);        }        // Commit changes to DB	collection.update();	context.complete();    }