{"action":"created","comment":{"url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/comments/37291807","id":37291807,"diff_hunk":"@@ -1,22 +1,213 @@\n \r\n package app.controllers;\r\n \r\n+import java.io.File;\r\n+import java.io.FileNotFoundException;\r\n+import java.io.IOException;\r\n+import java.nio.file.Files;\r\n+import java.nio.file.Path;\r\n+import java.nio.file.Paths;\r\n+import java.util.ArrayList;\r\n+import java.util.HashMap;\r\n+import java.util.HashSet;\r\n+import java.util.List;\r\n+import java.util.Map;\r\n+import java.util.Set;\r\n+\r\n+import javax.servlet.ServletContext;\r\n+\r\n import org.springframework.beans.factory.annotation.Autowired;\r\n import org.springframework.data.rest.core.annotation.RepositoryEventHandler;\r\n+import org.springframework.http.HttpHeaders;\r\n import org.springframework.http.HttpStatus;\r\n+import org.springframework.http.MediaType;\r\n import org.springframework.http.ResponseEntity;\r\n+import org.springframework.web.bind.annotation.PathVariable;\r\n+import org.springframework.web.bind.annotation.RequestBody;\r\n import org.springframework.web.bind.annotation.RequestMapping;\r\n import org.springframework.web.bind.annotation.RequestMethod;\r\n import org.springframework.web.bind.annotation.RestController;\r\n \r\n+import app.generator.CVGenerator;\r\n import app.model.Employee;\r\n+import app.model.Project;\r\n+import app.model.ProjectInfo;\r\n+import app.model.TagCloud;\r\n+import app.model.TagCloudEnum;\r\n import app.repository.EmployeeRepository;\r\n+import app.repository.TagCloudRepository;\r\n+\r\n+import com.lowagie.text.DocumentException;\r\n \r\n \r\n @RestController\r\n-@RequestMapping(\"/employees\")\r\n+@RequestMapping(\"/resources/employees\")\r\n @RepositoryEventHandler(Employee.class)\r\n public class EmployeeRestController {\r\n \t\r\n+\t@Autowired\r\n+\tEmployeeRepository employeeRepository;\r\n+\t\r\n+\t@Autowired\r\n+    private ServletContext servletContext;\r\n+\t\r\n+\t@Autowired\r\n+\tTagCloudRepository tagCloudRepository;\r\n+\t\r\n+\r\n+\t/**\r\n+\t * \r\n+\t * @return all {Employee}s from repository\r\n+\t */\r\n+\t\r\n+\t@RequestMapping(method = RequestMethod.GET)\r\n+\tpublic ResponseEntity get(){\r\n+\t\t\r\n+\t\treturn new ResponseEntity(employeeRepository.findAll(), HttpStatus.OK);\r\n+\t}\r\n+\t\r\n+\t\r\n+\t/**\r\n+\t * \r\n+\t * @param emp - {Employee} for save\r\n+\t * @return {ResponseEntity} with {HttpStatus.OK}\r\n+\t */\r\n+\t@RequestMapping(method = RequestMethod.PUT)\r\n+\tpublic ResponseEntity put(@RequestBody Employee emp){\r\n+\t\t\r\n+\t\temployeeRepository.save(emp);\r\n+\t\treturn new ResponseEntity(HttpStatus.OK);\r\n+\t}\r\n+\t\r\n+\t/**\r\n+\t * \r\n+\t * @param id - {Employee} id for deletion\r\n+\t * @return {HttpStatus.NOT_FOUND} or {HttpStatus.OK}\r\n+\t */\r\n+\t@RequestMapping(value = \"/{id}\" , method = RequestMethod.DELETE)\r\n+\tpublic ResponseEntity delete(@PathVariable(\"id\") int id){\r\n+\t\t\r\n+\t\tif(employeeRepository.findOne(id) == null) \r\n+\t\t\treturn new ResponseEntity(HttpStatus.NOT_FOUND);\r\n+\t\t\r\n+\t\temployeeRepository.delete(id);\r\n+\t\t\r\n+\t\treturn new ResponseEntity(HttpStatus.OK);\r\n+\t}\r\n+\t\r\n+\t/**\r\n+\t * \r\n+\t * \r\n+\t * @param id - {Employee} id\r\n+\t * @return {Employee} from repository wrapped in {ResponseEntity}\r\n+\t */\r\n+\t\r\n+\t@RequestMapping(value = \"/{id}\")\r\n+\tpublic ResponseEntity getEmployee(@PathVariable(\"id\") int id){\r\n+\t\t\r\n+\t\treturn new ResponseEntity(employeeRepository.findOne(id), HttpStatus.FOUND);\r\n+\r\n+\t}\r\n+\r\n+\t/**\r\n+\t * \r\n+\t * \r\n+\t * @param id - {Employee} id\r\n+\t * @return {Set} of {ProjectInfo}s wrapped in {ResponseEntity}\r\n+\t */\r\n+\t\r\n+\t@RequestMapping(value = \"/{id}/projectinfoes\", method = RequestMethod.GET)\r\n+\tpublic ResponseEntity getEmployeeProjects(@PathVariable(\"id\") int id){\r","path":"HRTool/src/main/java/app/controllers/EmployeeRestController.java","position":121,"original_position":121,"commit_id":"4200e747ab4063c12d7a2af738ad22bbb9deca96","original_commit_id":"4200e747ab4063c12d7a2af738ad22bbb9deca96","user":{"login":"nantic","id":7562858,"avatar_url":"https://avatars.githubusercontent.com/u/7562858?v=3","gravatar_id":"","url":"https://api.github.com/users/nantic","html_url":"https://github.com/nantic","followers_url":"https://api.github.com/users/nantic/followers","following_url":"https://api.github.com/users/nantic/following{/other_user}","gists_url":"https://api.github.com/users/nantic/gists{/gist_id}","starred_url":"https://api.github.com/users/nantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nantic/subscriptions","organizations_url":"https://api.github.com/users/nantic/orgs","repos_url":"https://api.github.com/users/nantic/repos","events_url":"https://api.github.com/users/nantic/events{/privacy}","received_events_url":"https://api.github.com/users/nantic/received_events","type":"User","site_admin":false},"body":"This should also be provided by default.","created_at":"2015-08-18T12:25:53Z","updated_at":"2015-08-18T12:25:53Z","html_url":"https://github.com/GavriloDrljaca/ExecomTool/pull/9#discussion_r37291807","pull_request_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/comments/37291807"},"html":{"href":"https://github.com/GavriloDrljaca/ExecomTool/pull/9#discussion_r37291807"},"pull_request":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9","id":42688940,"html_url":"https://github.com/GavriloDrljaca/ExecomTool/pull/9","diff_url":"https://github.com/GavriloDrljaca/ExecomTool/pull/9.diff","patch_url":"https://github.com/GavriloDrljaca/ExecomTool/pull/9.patch","issue_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/9","number":9,"state":"open","locked":false,"title":"rest api","user":{"login":"nemcha92","id":13483698,"avatar_url":"https://avatars.githubusercontent.com/u/13483698?v=3","gravatar_id":"","url":"https://api.github.com/users/nemcha92","html_url":"https://github.com/nemcha92","followers_url":"https://api.github.com/users/nemcha92/followers","following_url":"https://api.github.com/users/nemcha92/following{/other_user}","gists_url":"https://api.github.com/users/nemcha92/gists{/gist_id}","starred_url":"https://api.github.com/users/nemcha92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemcha92/subscriptions","organizations_url":"https://api.github.com/users/nemcha92/orgs","repos_url":"https://api.github.com/users/nemcha92/repos","events_url":"https://api.github.com/users/nemcha92/events{/privacy}","received_events_url":"https://api.github.com/users/nemcha92/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-18T11:42:51Z","updated_at":"2015-08-18T12:25:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a6bf19b21efc0464bf70a32ca768e0668fbc15f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9/commits","review_comments_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9/comments","review_comment_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/9/comments","statuses_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/statuses/4200e747ab4063c12d7a2af738ad22bbb9deca96","head":{"label":"GavriloDrljaca:restAPI","ref":"restAPI","sha":"4200e747ab4063c12d7a2af738ad22bbb9deca96","user":{"login":"GavriloDrljaca","id":12487854,"avatar_url":"https://avatars.githubusercontent.com/u/12487854?v=3","gravatar_id":"","url":"https://api.github.com/users/GavriloDrljaca","html_url":"https://github.com/GavriloDrljaca","followers_url":"https://api.github.com/users/GavriloDrljaca/followers","following_url":"https://api.github.com/users/GavriloDrljaca/following{/other_user}","gists_url":"https://api.github.com/users/GavriloDrljaca/gists{/gist_id}","starred_url":"https://api.github.com/users/GavriloDrljaca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavriloDrljaca/subscriptions","organizations_url":"https://api.github.com/users/GavriloDrljaca/orgs","repos_url":"https://api.github.com/users/GavriloDrljaca/repos","events_url":"https://api.github.com/users/GavriloDrljaca/events{/privacy}","received_events_url":"https://api.github.com/users/GavriloDrljaca/received_events","type":"User","site_admin":false},"repo":{"id":39824396,"name":"ExecomTool","full_name":"GavriloDrljaca/ExecomTool","owner":{"login":"GavriloDrljaca","id":12487854,"avatar_url":"https://avatars.githubusercontent.com/u/12487854?v=3","gravatar_id":"","url":"https://api.github.com/users/GavriloDrljaca","html_url":"https://github.com/GavriloDrljaca","followers_url":"https://api.github.com/users/GavriloDrljaca/followers","following_url":"https://api.github.com/users/GavriloDrljaca/following{/other_user}","gists_url":"https://api.github.com/users/GavriloDrljaca/gists{/gist_id}","starred_url":"https://api.github.com/users/GavriloDrljaca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavriloDrljaca/subscriptions","organizations_url":"https://api.github.com/users/GavriloDrljaca/orgs","repos_url":"https://api.github.com/users/GavriloDrljaca/repos","events_url":"https://api.github.com/users/GavriloDrljaca/events{/privacy}","received_events_url":"https://api.github.com/users/GavriloDrljaca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GavriloDrljaca/ExecomTool","description":"","fork":false,"url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool","forks_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/forks","keys_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/teams","hooks_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/hooks","issue_events_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/events{/number}","events_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/events","assignees_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/assignees{/user}","branches_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/branches{/branch}","tags_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/tags","blobs_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/refs{/sha}","trees_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/statuses/{sha}","languages_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/languages","stargazers_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/stargazers","contributors_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/contributors","subscribers_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/subscribers","subscription_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/subscription","commits_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/commits{/sha}","git_commits_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/commits{/sha}","comments_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/comments{/number}","issue_comment_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/comments{/number}","contents_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/contents/{+path}","compare_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/merges","archive_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/downloads","issues_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues{/number}","pulls_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls{/number}","milestones_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/milestones{/number}","notifications_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/labels{/name}","releases_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/releases{/id}","created_at":"2015-07-28T09:17:18Z","updated_at":"2015-07-28T09:21:17Z","pushed_at":"2015-08-18T12:19:54Z","git_url":"git://github.com/GavriloDrljaca/ExecomTool.git","ssh_url":"git@github.com:GavriloDrljaca/ExecomTool.git","clone_url":"https://github.com/GavriloDrljaca/ExecomTool.git","svn_url":"https://github.com/GavriloDrljaca/ExecomTool","homepage":null,"size":5148,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"GavriloDrljaca:pages","ref":"pages","sha":"46ca3a9e4d7abf1d90235475e491fc4894305517","user":{"login":"GavriloDrljaca","id":12487854,"avatar_url":"https://avatars.githubusercontent.com/u/12487854?v=3","gravatar_id":"","url":"https://api.github.com/users/GavriloDrljaca","html_url":"https://github.com/GavriloDrljaca","followers_url":"https://api.github.com/users/GavriloDrljaca/followers","following_url":"https://api.github.com/users/GavriloDrljaca/following{/other_user}","gists_url":"https://api.github.com/users/GavriloDrljaca/gists{/gist_id}","starred_url":"https://api.github.com/users/GavriloDrljaca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavriloDrljaca/subscriptions","organizations_url":"https://api.github.com/users/GavriloDrljaca/orgs","repos_url":"https://api.github.com/users/GavriloDrljaca/repos","events_url":"https://api.github.com/users/GavriloDrljaca/events{/privacy}","received_events_url":"https://api.github.com/users/GavriloDrljaca/received_events","type":"User","site_admin":false},"repo":{"id":39824396,"name":"ExecomTool","full_name":"GavriloDrljaca/ExecomTool","owner":{"login":"GavriloDrljaca","id":12487854,"avatar_url":"https://avatars.githubusercontent.com/u/12487854?v=3","gravatar_id":"","url":"https://api.github.com/users/GavriloDrljaca","html_url":"https://github.com/GavriloDrljaca","followers_url":"https://api.github.com/users/GavriloDrljaca/followers","following_url":"https://api.github.com/users/GavriloDrljaca/following{/other_user}","gists_url":"https://api.github.com/users/GavriloDrljaca/gists{/gist_id}","starred_url":"https://api.github.com/users/GavriloDrljaca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavriloDrljaca/subscriptions","organizations_url":"https://api.github.com/users/GavriloDrljaca/orgs","repos_url":"https://api.github.com/users/GavriloDrljaca/repos","events_url":"https://api.github.com/users/GavriloDrljaca/events{/privacy}","received_events_url":"https://api.github.com/users/GavriloDrljaca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GavriloDrljaca/ExecomTool","description":"","fork":false,"url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool","forks_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/forks","keys_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/teams","hooks_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/hooks","issue_events_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/events{/number}","events_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/events","assignees_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/assignees{/user}","branches_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/branches{/branch}","tags_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/tags","blobs_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/refs{/sha}","trees_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/statuses/{sha}","languages_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/languages","stargazers_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/stargazers","contributors_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/contributors","subscribers_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/subscribers","subscription_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/subscription","commits_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/commits{/sha}","git_commits_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/git/commits{/sha}","comments_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/comments{/number}","issue_comment_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/comments{/number}","contents_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/contents/{+path}","compare_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/merges","archive_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/downloads","issues_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues{/number}","pulls_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls{/number}","milestones_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/milestones{/number}","notifications_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/labels{/name}","releases_url":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/releases{/id}","created_at":"2015-07-28T09:17:18Z","updated_at":"2015-07-28T09:21:17Z","pushed_at":"2015-08-18T12:19:54Z","git_url":"git://github.com/GavriloDrljaca/ExecomTool.git","ssh_url":"git@github.com:GavriloDrljaca/ExecomTool.git","clone_url":"https://github.com/GavriloDrljaca/ExecomTool.git","svn_url":"https://github.com/GavriloDrljaca/ExecomTool","homepage":null,"size":5148,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9"},"html":{"href":"https://github.com/GavriloDrljaca/ExecomTool/pull/9"},"issue":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/9"},"comments":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/GavriloDrljaca/ExecomTool/statuses/4200e747ab4063c12d7a2af738ad22bbb9deca96"}}}}