/** * @see * org.springframework.web.servlet.mvc.AbstractController#handleRequestInternal(javax.servlet.http.HttpServletRequest, * javax.servlet.http.HttpServletResponse) */ @Override protected ModelAndView handleRequestInternal( HttpServletRequest request, HttpServletResponse response) throws Exception { String outResponse = ""; User user = ControllerUtil.getSignedInUser(); Set<User> owners = new TreeSet<User>(); owners.add(user); Project project = projectService.getById(Long.parseLong(request.getParameter(PROJECTID))); CreateOtmlModuleParameters params = new CreateOtmlModuleParameters(); params.setName(project.getCurnit().getSdsCurnit().getName()); params.setUrl(RooloOtmlModuleDao.defaultOtrunkCurnitUrl); params.setRetrieveotmlurl( Util.getPortalUrl(request) + "/repository/retrieveotml.html?otmlModuleId="); byte[] otmlbytes = (byte[]) project.getCurnit().accept(new CurnitGetOtmlVisitor()); if (otmlbytes != null) { params.setOtml(otmlbytes); Curnit copiedCurnit = curnitService.createCurnit(params); ProjectParameters projParams = new ProjectParameters(); projParams.setCurnitId(copiedCurnit.getId()); projParams.setJnlpId(project.getJnlp().getId()); projParams.setOwners(owners); projParams.setProjectname(project.getName()); projParams.setProjectType(project.getProjectType()); projectService.createProject(projParams); outResponse = "Project " + project.getName() + " has been successfully " + "copied and can be found in My Customized Projects."; } else { outResponse = "This project is not of a type that can be copied."; } ModelAndView modelAndView = new ModelAndView(); modelAndView.addObject(RESPONSE, outResponse); return modelAndView; }