{"action":"created","comment":{"url":"https://api.github.com/repos/diging/quadriga/pulls/comments/40597673","id":40597673,"diff_hunk":"@@ -0,0 +1,85 @@\n+package edu.asu.spring.quadriga.web.workbench;\n+\n+import java.security.Principal;\n+import java.util.Properties;\n+\n+import javax.annotation.Resource;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Controller;\n+import org.springframework.validation.BindingResult;\n+import org.springframework.validation.annotation.Validated;\n+import org.springframework.web.bind.annotation.ModelAttribute;\n+import org.springframework.web.bind.annotation.PathVariable;\n+import org.springframework.web.bind.annotation.RequestMapping;\n+import org.springframework.web.bind.annotation.RequestMethod;\n+import org.springframework.web.servlet.ModelAndView;\n+\n+import edu.asu.spring.quadriga.aspects.annotations.AccessPolicies;\n+import edu.asu.spring.quadriga.aspects.annotations.CheckedElementType;\n+import edu.asu.spring.quadriga.aspects.annotations.ElementAccessPolicy;\n+import edu.asu.spring.quadriga.domain.impl.workbench.Project;\n+import edu.asu.spring.quadriga.domain.workbench.IProject;\n+import edu.asu.spring.quadriga.exceptions.QuadrigaAccessException;\n+import edu.asu.spring.quadriga.exceptions.QuadrigaStorageException;\n+import edu.asu.spring.quadriga.service.workbench.IModifyProjectManager;\n+import edu.asu.spring.quadriga.service.workbench.IRetrieveProjectManager;\n+import edu.asu.spring.quadriga.web.login.RoleNames;\n+\n+@Controller\n+public class EditProjectController {\n+\n+\t@Autowired\n+\tIModifyProjectManager projectManager;\n+\n+\t@Autowired\n+\tIRetrieveProjectManager retrieveProjectManager;\n+\n+\t@Resource(name = \"projectconstants\")\n+\tprivate Properties messages;\n+\n+\tprivate static final Logger logger = LoggerFactory.getLogger(ModifyProjectController.class);\n+\n+\t@AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT, paramIndex = 1, userRole = {\n+\t\t\tRoleNames.ROLE_COLLABORATOR_ADMIN, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN }) })\n+\t@RequestMapping(value = \"auth/workbench/editProjectPageURL/{projectid}\", method = RequestMethod.GET)\n+\tpublic ModelAndView editProjectPageURL(@PathVariable(\"projectid\") String projectid, Principal principal)\n+\t\t\tthrows QuadrigaStorageException, QuadrigaAccessException {\n+\t\tModelAndView model;\n+\t\tIProject project;\n+\t\tlogger.info(\"Updating project details\");\n+\t\tmodel = new ModelAndView(\"auth/workbench/editProjectPageURL\");\n+\t\tproject = retrieveProjectManager.getProjectDetails(projectid);\n+\t\tmodel.getModelMap().put(\"project\", project);\n+\t\tmodel.getModelMap().put(\"unixnameurl\", messages.getProperty(\"project_unix_name.url\"));\n+\t\tmodel.getModelMap().put(\"success\", 0);\n+\t\treturn model;\n+\t}\n+\n+\t@AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT, paramIndex = 3, userRole = {\n+\t\t\tRoleNames.ROLE_COLLABORATOR_ADMIN, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN }) })\n+\t@RequestMapping(value = \"auth/workbench/editProjectPageURL/{projectid}\", method = RequestMethod.POST)\n+\tpublic ModelAndView editProjectPageURL(@Validated @ModelAttribute(\"project\") Project project, BindingResult result,\n+\t\t\t@PathVariable(\"projectid\") String projectid, Principal principal)\n+\t\t\t\t\tthrows QuadrigaStorageException, QuadrigaAccessException {\n+\t\tModelAndView model;\n+\t\tString userName = principal.getName();\n+\n+\t\tlogger.info(\"Update project details\");\n+\t\tmodel = new ModelAndView(\"auth/workbench/editProjectPageURL\");\n+\t\tif (result.hasErrors()) {\n+\t\t\tlogger.error(\"Update project details error:\", result);\n+\t\t\tmodel.getModelMap().put(\"project\", project);\n+\t\t\tmodel.getModelMap().put(\"unixnameurl\", messages.getProperty(\"project_unix_name.url\"));\n+\t\t\tmodel.getModelMap().put(\"success\", 0);\n+\t\t} else {\n+\t\t\tprojectManager.updateProjectURL(project.getProjectId(), project.getProjectAccess().name(),\n+\t\t\t\t\tproject.getUnixName(), userName);\n+\t\t\tmodel.getModelMap().put(\"success\", 1);","path":"Quadriga/src/main/java/edu/asu/spring/quadriga/web/workbench/EditProjectController.java","position":80,"original_position":80,"commit_id":"d0a78a9e8c93421f305c8940c6f7b7925aefcfd8","original_commit_id":"d0a78a9e8c93421f305c8940c6f7b7925aefcfd8","user":{"login":"jdamerow","id":8881141,"avatar_url":"https://avatars.githubusercontent.com/u/8881141?v=3","gravatar_id":"","url":"https://api.github.com/users/jdamerow","html_url":"https://github.com/jdamerow","followers_url":"https://api.github.com/users/jdamerow/followers","following_url":"https://api.github.com/users/jdamerow/following{/other_user}","gists_url":"https://api.github.com/users/jdamerow/gists{/gist_id}","starred_url":"https://api.github.com/users/jdamerow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdamerow/subscriptions","organizations_url":"https://api.github.com/users/jdamerow/orgs","repos_url":"https://api.github.com/users/jdamerow/repos","events_url":"https://api.github.com/users/jdamerow/events{/privacy}","received_events_url":"https://api.github.com/users/jdamerow/received_events","type":"User","site_admin":false},"body":"same here, do you need this?","created_at":"2015-09-28T19:58:45Z","updated_at":"2015-09-28T19:58:45Z","html_url":"https://github.com/diging/quadriga/pull/11#discussion_r40597673","pull_request_url":"https://api.github.com/repos/diging/quadriga/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments/40597673"},"html":{"href":"https://github.com/diging/quadriga/pull/11#discussion_r40597673"},"pull_request":{"href":"https://api.github.com/repos/diging/quadriga/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/diging/quadriga/pulls/11","id":46175820,"html_url":"https://github.com/diging/quadriga/pull/11","diff_url":"https://github.com/diging/quadriga/pull/11.diff","patch_url":"https://github.com/diging/quadriga/pull/11.patch","issue_url":"https://api.github.com/repos/diging/quadriga/issues/11","number":11,"state":"open","locked":false,"title":"Story quad 5","user":{"login":"mkarthik90","id":9751475,"avatar_url":"https://avatars.githubusercontent.com/u/9751475?v=3","gravatar_id":"","url":"https://api.github.com/users/mkarthik90","html_url":"https://github.com/mkarthik90","followers_url":"https://api.github.com/users/mkarthik90/followers","following_url":"https://api.github.com/users/mkarthik90/following{/other_user}","gists_url":"https://api.github.com/users/mkarthik90/gists{/gist_id}","starred_url":"https://api.github.com/users/mkarthik90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkarthik90/subscriptions","organizations_url":"https://api.github.com/users/mkarthik90/orgs","repos_url":"https://api.github.com/users/mkarthik90/repos","events_url":"https://api.github.com/users/mkarthik90/events{/privacy}","received_events_url":"https://api.github.com/users/mkarthik90/received_events","type":"User","site_admin":false},"body":"Formatting changes done","created_at":"2015-09-28T16:07:40Z","updated_at":"2015-09-28T19:58:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f49216c3becafa006d7210dd1b495eadd14f8ddb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diging/quadriga/pulls/11/commits","review_comments_url":"https://api.github.com/repos/diging/quadriga/pulls/11/comments","review_comment_url":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diging/quadriga/issues/11/comments","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/d0a78a9e8c93421f305c8940c6f7b7925aefcfd8","head":{"label":"diging:story-QUAD-5","ref":"story-QUAD-5","sha":"d0a78a9e8c93421f305c8940c6f7b7925aefcfd8","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":32819066,"name":"quadriga","full_name":"diging/quadriga","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/quadriga","description":"","fork":false,"url":"https://api.github.com/repos/diging/quadriga","forks_url":"https://api.github.com/repos/diging/quadriga/forks","keys_url":"https://api.github.com/repos/diging/quadriga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/quadriga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/quadriga/teams","hooks_url":"https://api.github.com/repos/diging/quadriga/hooks","issue_events_url":"https://api.github.com/repos/diging/quadriga/issues/events{/number}","events_url":"https://api.github.com/repos/diging/quadriga/events","assignees_url":"https://api.github.com/repos/diging/quadriga/assignees{/user}","branches_url":"https://api.github.com/repos/diging/quadriga/branches{/branch}","tags_url":"https://api.github.com/repos/diging/quadriga/tags","blobs_url":"https://api.github.com/repos/diging/quadriga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/quadriga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/quadriga/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/quadriga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/quadriga/languages","stargazers_url":"https://api.github.com/repos/diging/quadriga/stargazers","contributors_url":"https://api.github.com/repos/diging/quadriga/contributors","subscribers_url":"https://api.github.com/repos/diging/quadriga/subscribers","subscription_url":"https://api.github.com/repos/diging/quadriga/subscription","commits_url":"https://api.github.com/repos/diging/quadriga/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/quadriga/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/quadriga/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/quadriga/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/quadriga/contents/{+path}","compare_url":"https://api.github.com/repos/diging/quadriga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/quadriga/merges","archive_url":"https://api.github.com/repos/diging/quadriga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/quadriga/downloads","issues_url":"https://api.github.com/repos/diging/quadriga/issues{/number}","pulls_url":"https://api.github.com/repos/diging/quadriga/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/quadriga/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/quadriga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/quadriga/labels{/name}","releases_url":"https://api.github.com/repos/diging/quadriga/releases{/id}","created_at":"2015-03-24T19:05:57Z","updated_at":"2015-08-17T14:20:42Z","pushed_at":"2015-09-28T18:53:52Z","git_url":"git://github.com/diging/quadriga.git","ssh_url":"git@github.com:diging/quadriga.git","clone_url":"https://github.com/diging/quadriga.git","svn_url":"https://github.com/diging/quadriga","homepage":"http://diging.github.io/quadriga/","size":10344,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"base":{"label":"diging:develop","ref":"develop","sha":"d05391b57bbced46d7d4638aed9000a929a84b5c","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":32819066,"name":"quadriga","full_name":"diging/quadriga","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/quadriga","description":"","fork":false,"url":"https://api.github.com/repos/diging/quadriga","forks_url":"https://api.github.com/repos/diging/quadriga/forks","keys_url":"https://api.github.com/repos/diging/quadriga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/quadriga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/quadriga/teams","hooks_url":"https://api.github.com/repos/diging/quadriga/hooks","issue_events_url":"https://api.github.com/repos/diging/quadriga/issues/events{/number}","events_url":"https://api.github.com/repos/diging/quadriga/events","assignees_url":"https://api.github.com/repos/diging/quadriga/assignees{/user}","branches_url":"https://api.github.com/repos/diging/quadriga/branches{/branch}","tags_url":"https://api.github.com/repos/diging/quadriga/tags","blobs_url":"https://api.github.com/repos/diging/quadriga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/quadriga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/quadriga/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/quadriga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/quadriga/languages","stargazers_url":"https://api.github.com/repos/diging/quadriga/stargazers","contributors_url":"https://api.github.com/repos/diging/quadriga/contributors","subscribers_url":"https://api.github.com/repos/diging/quadriga/subscribers","subscription_url":"https://api.github.com/repos/diging/quadriga/subscription","commits_url":"https://api.github.com/repos/diging/quadriga/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/quadriga/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/quadriga/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/quadriga/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/quadriga/contents/{+path}","compare_url":"https://api.github.com/repos/diging/quadriga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/quadriga/merges","archive_url":"https://api.github.com/repos/diging/quadriga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/quadriga/downloads","issues_url":"https://api.github.com/repos/diging/quadriga/issues{/number}","pulls_url":"https://api.github.com/repos/diging/quadriga/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/quadriga/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/quadriga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/quadriga/labels{/name}","releases_url":"https://api.github.com/repos/diging/quadriga/releases{/id}","created_at":"2015-03-24T19:05:57Z","updated_at":"2015-08-17T14:20:42Z","pushed_at":"2015-09-28T18:53:52Z","git_url":"git://github.com/diging/quadriga.git","ssh_url":"git@github.com:diging/quadriga.git","clone_url":"https://github.com/diging/quadriga.git","svn_url":"https://github.com/diging/quadriga","homepage":"http://diging.github.io/quadriga/","size":10344,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/11"},"html":{"href":"https://github.com/diging/quadriga/pull/11"},"issue":{"href":"https://api.github.com/repos/diging/quadriga/issues/11"},"comments":{"href":"https://api.github.com/repos/diging/quadriga/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/diging/quadriga/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diging/quadriga/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/diging/quadriga/statuses/d0a78a9e8c93421f305c8940c6f7b7925aefcfd8"}}}}