{"action":"created","comment":{"url":"https://api.github.com/repos/diging/conceptpower/pulls/comments/46483546","id":46483546,"diff_hunk":"@@ -27,84 +33,98 @@\n @Controller\r\n public class ConceptTypeEditController {\r\n \r\n-\t@Autowired\r\n-\tprivate IConceptTypeManger typeManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IUserManager usersManager;\r\n-\r\n-\t/**\r\n-\t * This method provides a type information to edit type page\r\n-\t * \r\n-\t * @param typeid\r\n-\t *            Represents a type which has to be edited\r\n-\t * @param model\r\n-\t *            Generic model holder for servlet\r\n-\t * @return Returns a string value to redirect user to type edit page\r\n-\t */\r\n-\t@RequestMapping(value = \"auth/concepttype/edittype/{typeid}\", method = RequestMethod.GET)\r\n-\tpublic String prepareEditType(@PathVariable(\"typeid\") String typeid,\r\n-\t\t\tModelMap model) {\r\n-\r\n-\t\tConceptType type = typeManager.getType(typeid);\r\n-\t\tmodel.addAttribute(\"typeid\", type.getTypeId());\r\n-\t\tmodel.addAttribute(\"typeName\", type.getTypeName());\r\n-\t\tmodel.addAttribute(\"description\", type.getDescription());\r\n-\t\tmodel.addAttribute(\"matches\", type.getMatches());\r\n-\r\n-\t\tConceptType[] allTypes = typeManager.getAllTypes();\r\n-\r\n-\t\tMap<String, String> types = new LinkedHashMap<String, String>();\r\n-\t\tfor (ConceptType conceptType : allTypes) {\r\n-\t\t\ttypes.put(conceptType.getTypeId(), conceptType.getTypeName());\r\n-\t\t}\r\n-\r\n-\t\tmodel.addAttribute(\"selectedtypeid\", typeid);\r\n-\t\tmodel.addAttribute(\"selectedtypename\", types.get(typeid));\r\n-\t\ttypes.remove(typeid);\r\n-\t\tmodel.addAttribute(\"supertypes\", types);\r\n-\r\n-\t\treturn \"/auth/concepttype/edittype\";\r\n-\t}\r\n-\r\n-\t/**\r\n-\t * This method stores the updated information of a type\r\n-\t * \r\n-\t * @param typeid\r\n-\t * @param req\r\n-\t *            holds HTTP request information\r\n-\t * @param principal\r\n-\t *            holds logged in user information\r\n-\t * @return Returns a string value to redirect user to type list page\r\n-\t */\r\n-\t@RequestMapping(value = \"auth/concepttype/storeedittype/{typeid}\", method = RequestMethod.POST)\r\n-\tpublic String editType(@PathVariable(\"typeid\") String typeid,\r\n-\t\t\tHttpServletRequest req, Principal principal) {\r\n-\r\n-\t\tConceptType type = typeManager.getType(typeid);\r\n-\t\ttype.setTypeName(req.getParameter(\"name\"));\r\n-\t\ttype.setDescription(req.getParameter(\"description\"));\r\n-\t\ttype.setMatches(req.getParameter(\"match\"));\r\n-\t\ttype.setSupertypeId(req.getParameter(\"supertypes\"));\r\n-\r\n-\t\tString userId = usersManager.findUser(principal.getName()).getUsername();\r\n-\t\tString modified = type.getModified() != null ? type.getModified() : \"\";\r\n-\t\tif (!modified.trim().isEmpty())\r\n-\t\t\tmodified += \", \";\r\n-\t\ttype.setModified(modified + userId + \"@\" + (new Date()).toString());\r\n-\r\n-\t\ttypeManager.storeModifiedConceptType(type);\r\n-\t\treturn \"redirect:/auth/concepttype\";\r\n-\t}\r\n-\r\n-\t/**\r\n-\t * This method returns the string to redirect user to type list page when\r\n-\t * user cancels type edit operation\r\n-\t * \r\n-\t * @return Returns a string value to redirect user to concept type list page\r\n-\t */\r\n-\t@RequestMapping(value = \"auth/concepttype/edittype/canceledit\", method = RequestMethod.GET)\r\n-\tpublic String cancelEdit() {\r\n-\t\treturn \"redirect:/auth/concepttype\";\r\n-\t}\r\n+    @Autowired\r\n+    private IConceptTypeManger typeManager;\r\n+\r\n+    @Autowired\r\n+    private IUserManager usersManager;\r\n+\r\n+    @Autowired\r\n+    private ConceptTypeAddValidator validator;\r\n+\r\n+    @InitBinder\r\n+    protected void initBinder(WebDataBinder binder) {\r\n+        binder.setValidator(validator);\r\n+    }\r\n+\r\n+    /**\r\n+     * This method provides a type information to edit type page\r\n+     * \r\n+     * @param typeid\r\n+     *            Represents a type which has to be edited\r\n+     * @param model\r\n+     *            Generic model holder for servlet\r\n+     * @return Returns a string value to redirect user to type edit page\r\n+     */\r\n+    @RequestMapping(value = \"auth/concepttype/edittype/{typeid}\", method = RequestMethod.GET)\r\n+    public String prepareEditType(@PathVariable(\"typeid\") String typeid, ModelMap model,\r\n+            @ModelAttribute(\"conceptTypeAddForm\") ConceptTypeAddForm conceptTypeAddForm) {\r\n+\r\n+        ConceptType type = typeManager.getType(typeid);\r\n+\r\n+        conceptTypeAddForm.setTypeName(type.getTypeName());\r\n+        conceptTypeAddForm.setOldTypeName(type.getTypeName());\r\n+        conceptTypeAddForm.setTypeDescription(type.getDescription());\r\n+        conceptTypeAddForm.setMatches(type.getMatches());\r\n+        conceptTypeAddForm.setSelectedType(type.getSupertypeId().trim());\r","path":"Conceptpower+Spring/src/main/java/edu/asu/conceptpower/web/ConceptTypeEditController.java","position":137,"original_position":137,"commit_id":"04051341af7ca0007324bd481291ca908ddec553","original_commit_id":"04051341af7ca0007324bd481291ca908ddec553","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":"What's \"selected type\"? Shouldn't that be \"supertype\"?","created_at":"2015-12-02T22:11:35Z","updated_at":"2015-12-02T22:11:35Z","html_url":"https://github.com/diging/conceptpower/pull/30#discussion_r46483546","pull_request_url":"https://api.github.com/repos/diging/conceptpower/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/comments/46483546"},"html":{"href":"https://github.com/diging/conceptpower/pull/30#discussion_r46483546"},"pull_request":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/diging/conceptpower/pulls/30","id":52295564,"html_url":"https://github.com/diging/conceptpower/pull/30","diff_url":"https://github.com/diging/conceptpower/pull/30.diff","patch_url":"https://github.com/diging/conceptpower/pull/30.patch","issue_url":"https://api.github.com/repos/diging/conceptpower/issues/30","number":30,"state":"open","locked":false,"title":"Story/ccp 113","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":"[CCP-113] Resolved Bean Definition","created_at":"2015-12-01T18:23:07Z","updated_at":"2015-12-02T22:11:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc01b84780eeee220bf32f159d7644885e80f2b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diging/conceptpower/pulls/30/commits","review_comments_url":"https://api.github.com/repos/diging/conceptpower/pulls/30/comments","review_comment_url":"https://api.github.com/repos/diging/conceptpower/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diging/conceptpower/issues/30/comments","statuses_url":"https://api.github.com/repos/diging/conceptpower/statuses/04051341af7ca0007324bd481291ca908ddec553","head":{"label":"diging:story/CCP-113","ref":"story/CCP-113","sha":"04051341af7ca0007324bd481291ca908ddec553","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":32412644,"name":"conceptpower","full_name":"diging/conceptpower","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/conceptpower","description":"","fork":false,"url":"https://api.github.com/repos/diging/conceptpower","forks_url":"https://api.github.com/repos/diging/conceptpower/forks","keys_url":"https://api.github.com/repos/diging/conceptpower/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/conceptpower/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/conceptpower/teams","hooks_url":"https://api.github.com/repos/diging/conceptpower/hooks","issue_events_url":"https://api.github.com/repos/diging/conceptpower/issues/events{/number}","events_url":"https://api.github.com/repos/diging/conceptpower/events","assignees_url":"https://api.github.com/repos/diging/conceptpower/assignees{/user}","branches_url":"https://api.github.com/repos/diging/conceptpower/branches{/branch}","tags_url":"https://api.github.com/repos/diging/conceptpower/tags","blobs_url":"https://api.github.com/repos/diging/conceptpower/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/conceptpower/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/conceptpower/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/conceptpower/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/conceptpower/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/conceptpower/languages","stargazers_url":"https://api.github.com/repos/diging/conceptpower/stargazers","contributors_url":"https://api.github.com/repos/diging/conceptpower/contributors","subscribers_url":"https://api.github.com/repos/diging/conceptpower/subscribers","subscription_url":"https://api.github.com/repos/diging/conceptpower/subscription","commits_url":"https://api.github.com/repos/diging/conceptpower/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/conceptpower/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/conceptpower/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/conceptpower/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/conceptpower/contents/{+path}","compare_url":"https://api.github.com/repos/diging/conceptpower/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/conceptpower/merges","archive_url":"https://api.github.com/repos/diging/conceptpower/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/conceptpower/downloads","issues_url":"https://api.github.com/repos/diging/conceptpower/issues{/number}","pulls_url":"https://api.github.com/repos/diging/conceptpower/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/conceptpower/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/conceptpower/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/conceptpower/labels{/name}","releases_url":"https://api.github.com/repos/diging/conceptpower/releases{/id}","created_at":"2015-03-17T18:35:40Z","updated_at":"2015-11-06T18:36:43Z","pushed_at":"2015-12-02T19:03:25Z","git_url":"git://github.com/diging/conceptpower.git","ssh_url":"git@github.com:diging/conceptpower.git","clone_url":"https://github.com/diging/conceptpower.git","svn_url":"https://github.com/diging/conceptpower","homepage":"http://diging.github.io/conceptpower/","size":18234,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"develop"}},"base":{"label":"diging:develop","ref":"develop","sha":"51cc01e3fbdee4be62ef2ebe2699c4a62a55282c","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":32412644,"name":"conceptpower","full_name":"diging/conceptpower","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/conceptpower","description":"","fork":false,"url":"https://api.github.com/repos/diging/conceptpower","forks_url":"https://api.github.com/repos/diging/conceptpower/forks","keys_url":"https://api.github.com/repos/diging/conceptpower/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/conceptpower/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/conceptpower/teams","hooks_url":"https://api.github.com/repos/diging/conceptpower/hooks","issue_events_url":"https://api.github.com/repos/diging/conceptpower/issues/events{/number}","events_url":"https://api.github.com/repos/diging/conceptpower/events","assignees_url":"https://api.github.com/repos/diging/conceptpower/assignees{/user}","branches_url":"https://api.github.com/repos/diging/conceptpower/branches{/branch}","tags_url":"https://api.github.com/repos/diging/conceptpower/tags","blobs_url":"https://api.github.com/repos/diging/conceptpower/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/conceptpower/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/conceptpower/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/conceptpower/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/conceptpower/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/conceptpower/languages","stargazers_url":"https://api.github.com/repos/diging/conceptpower/stargazers","contributors_url":"https://api.github.com/repos/diging/conceptpower/contributors","subscribers_url":"https://api.github.com/repos/diging/conceptpower/subscribers","subscription_url":"https://api.github.com/repos/diging/conceptpower/subscription","commits_url":"https://api.github.com/repos/diging/conceptpower/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/conceptpower/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/conceptpower/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/conceptpower/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/conceptpower/contents/{+path}","compare_url":"https://api.github.com/repos/diging/conceptpower/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/conceptpower/merges","archive_url":"https://api.github.com/repos/diging/conceptpower/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/conceptpower/downloads","issues_url":"https://api.github.com/repos/diging/conceptpower/issues{/number}","pulls_url":"https://api.github.com/repos/diging/conceptpower/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/conceptpower/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/conceptpower/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/conceptpower/labels{/name}","releases_url":"https://api.github.com/repos/diging/conceptpower/releases{/id}","created_at":"2015-03-17T18:35:40Z","updated_at":"2015-11-06T18:36:43Z","pushed_at":"2015-12-02T19:03:25Z","git_url":"git://github.com/diging/conceptpower.git","ssh_url":"git@github.com:diging/conceptpower.git","clone_url":"https://github.com/diging/conceptpower.git","svn_url":"https://github.com/diging/conceptpower","homepage":"http://diging.github.io/conceptpower/","size":18234,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/30"},"html":{"href":"https://github.com/diging/conceptpower/pull/30"},"issue":{"href":"https://api.github.com/repos/diging/conceptpower/issues/30"},"comments":{"href":"https://api.github.com/repos/diging/conceptpower/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diging/conceptpower/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/diging/conceptpower/statuses/04051341af7ca0007324bd481291ca908ddec553"}}}}