ArchiveWSController { @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 3, userRole = {RoleNames.ROLE_COLLABORATOR_OWNER,RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN,RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR}) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value = "auth/workbench/{projectid}/unarchiveworkspace", method = RequestMethod.POST) public ModelAndView unarchiveWorkspace(@Validated @ModelAttribute("workspaceform") ModifyWorkspaceForm workspaceForm,BindingResult result, @PathVariable("projectid") String projectid,Principal principal) throws QuadrigaStorageException, QuadrigaAccessException { StringBuilder workspaceId; String userName; String wsInternalId; ModelAndView model; List<ModifyWorkspace> unarchiveWSList; model = new ModelAndView("auth/workbench/workspace/unarchiveworkspace"); userName = principal.getName(); unarchiveWSList = new ArrayList<ModifyWorkspace>(); workspaceId = new StringBuilder(); if(result.hasErrors()) { unarchiveWSList = workspaceFormManager.getArchivedWorkspaceList(projectid, userName); workspaceForm.setWorkspaceList(unarchiveWSList); model.getModelMap().put("success", 0); model.getModelMap().put("error", 1); model.getModelMap().put("workspaceform", workspaceForm); model.getModelMap().put("wsprojectid", projectid); } else { unarchiveWSList = workspaceForm.getWorkspaceList(); for(ModifyWorkspace workspace : unarchiveWSList) { wsInternalId = workspace.getId(); if(wsInternalId != null) { workspaceId.append(","); workspaceId.append(wsInternalId); } } archiveWSManager.unArchiveWorkspace(workspaceId.toString().substring(1), userName); model.getModelMap().put("success", 1); model.getModelMap().put("wsprojectid", projectid); } return model; }  @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 1, userRole = {RoleNames.ROLE_COLLABORATOR_OWNER,RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN,RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR}) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value="auth/workbench/{projectid}/archiveworkspace", method=RequestMethod.GET) ModelAndView archiveWorkspaceForm(@PathVariable("projectid") String projectid,Principal principal); @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 3, userRole = {RoleNames.ROLE_COLLABORATOR_OWNER,RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN,RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR}) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value = "auth/workbench/{projectid}/archiveworkspace", method = RequestMethod.POST) ModelAndView archiveWorkspace(@Validated @ModelAttribute("workspaceform") ModifyWorkspaceForm workspaceForm,BindingResult result,
			@PathVariable("projectid") String projectid,Principal principal); @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 2, userRole = { RoleNames.ROLE_COLLABORATOR_OWNER, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN, RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR }) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value = "auth/workbench/{projectId}/archiveworkspace/{workspaceId}", method = RequestMethod.GET) String archiveWorkspace(@PathVariable("workspaceId") String workspaceId,
								   @PathVariable("projectId") String projectId,
								   Principal principal, RedirectAttributes redirectAttributes); @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 1, userRole = {RoleNames.ROLE_COLLABORATOR_OWNER,RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN,RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR}) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value="auth/workbench/{projectid}/unarchiveworkspace", method=RequestMethod.GET) ModelAndView unarchiveWorkspaceForm(@PathVariable("projectid") String projectid,Principal principal); @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 3, userRole = {RoleNames.ROLE_COLLABORATOR_OWNER,RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN,RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR}) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value = "auth/workbench/{projectid}/unarchiveworkspace", method = RequestMethod.POST) ModelAndView unarchiveWorkspace(@Validated @ModelAttribute("workspaceform") ModifyWorkspaceForm workspaceForm,BindingResult result,
			@PathVariable("projectid") String projectid,Principal principal); @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT,paramIndex = 2, userRole = { RoleNames.ROLE_COLLABORATOR_OWNER, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN, RoleNames.ROLE_PROJ_COLLABORATOR_CONTRIBUTOR }) ,@ElementAccessPolicy(type=CheckedElementType.WORKSPACE,paramIndex=0,userRole={})}) @RequestMapping(value = "auth/workbench/{projectId}/unarchiveworkspace/{workspaceId}", method = RequestMethod.GET) String unarchiveWorkspace(@PathVariable("workspaceId") String workspaceId,
									 @PathVariable("projectId") String projectId, Principal principal,
									 RedirectAttributes redirectAttributes);  }
@Test @Ignore public void testUnarchiveWorkspace() { fail("Not yet implemented"); }