public RemoteProject updateProject(User user, RemoteProject rProject) throws RemoteException
{
final Long permissionSchemeId = rProject.getPermissionScheme() == null ? null : rProject.getPermissionScheme().getId();
final Long notificationSchemeId = rProject.getNotificationScheme() == null ? null : rProject.getNotificationScheme().getId();
final Long issueSecuritySchemeId = rProject.getIssueSecurityScheme() == null ? null : rProject.getIssueSecurityScheme().getId();
com.atlassian.jira.bc.project.ProjectService.UpdateProjectValidationResult result =
projectService.validateUpdateProject(user, rProject.getName(), rProject.getKey(), rProject.getDescription(),
rProject.getLead(), rProject.getProjectUrl(), null);
com.atlassian.jira.bc.project.ProjectService.UpdateProjectSchemesValidationResult schemesResult =
projectService.validateUpdateProjectSchemes(user, permissionSchemeId, notificationSchemeId, issueSecuritySchemeId);
ErrorCollection errors = new SimpleErrorCollection();
errors.addErrorCollection(result.getErrorCollection());
errors.addErrorCollection(schemesResult.getErrorCollection());
if (errors.hasAnyErrors())
{
throw new RemoteValidationException("Cannot update project: ", errors);
}
final Project updatedProject = projectService.updateProject(result);
projectService.updateProjectSchemes(schemesResult, updatedProject);
final RemoteProject remoteProject = new RemoteProject(updatedProject, applicationProperties);
remoteProject.setNotificationScheme(rProject.getNotificationScheme());
remoteProject.setPermissionScheme(rProject.getPermissionScheme());
remoteProject.setIssueSecurityScheme(rProject.getIssueSecurityScheme());
return remoteProject;
}