{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments/85475753","pull_request_review_id":6190214,"id":85475753,"diff_hunk":"@@ -20,25 +20,36 @@\n import org.openmrs.module.webservices.rest.web.representation.FullRepresentation;\n import org.openmrs.module.webservices.rest.web.representation.RefRepresentation;\n import org.openmrs.module.webservices.rest.web.representation.Representation;\n+import org.openmrs.module.webservices.rest.web.resource.api.Uploadable;\n import org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingReadableResource;\n import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription;\n import org.openmrs.module.webservices.rest.web.resource.impl.NeedsPaging;\n import org.openmrs.module.webservices.rest.web.response.ResponseException;\n+import org.openmrs.web.WebUtil;\n+import org.springframework.web.multipart.MultipartFile;\n \n+import javax.servlet.ServletContext;\n+import java.io.File;\n+import java.io.IOException;\n import java.util.ArrayList;\n import java.util.List;\n import java.util.UUID;\n \n-/**\n- *\n- */\n @Resource(name = RestConstants.VERSION_1 + \"/module\", supportedClass = Module.class, supportedOpenmrsVersions = { \"1.8.*\",\n         \"1.9.*\", \"1.10.*\", \"1.11.*\", \"1.12.*\", \"2.0.*\", \"2.1.*\" })\n-public class ModuleResource1_8 extends BaseDelegatingReadableResource<Module> {\n+public class ModuleResource1_8 extends BaseDelegatingReadableResource<Module> implements Uploadable {\n+\t\n+\tprivate ModuleFactoryWrapper moduleFactoryWrapper = new ModuleFactoryWrapper();\n+\t\n+\tprivate String moduleActionLink = ModuleActionResource1_8.class.getAnnotation(Resource.class).name();\n+\t\n+\tpublic void setModuleFactoryWrapper(ModuleFactoryWrapper moduleFactoryWrapper) {\n+\t\tthis.moduleFactoryWrapper = moduleFactoryWrapper;\n+\t}\n \t\n \t@Override\n \tpublic Module getByUniqueId(String uniqueId) {\n-\t\tfor (Module module : ModuleFactory.getLoadedModules()) {\n+\t\tfor (Module module : moduleFactoryWrapper.getLoadedModules()) {\n \t\t\tif (uniqueId.equals(getUuid(module))) {","path":"omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/ModuleResource1_8.java","position":51,"original_position":51,"commit_id":"460018808b7bbff61d3405ea916346b1370b84c8","original_commit_id":"460018808b7bbff61d3405ea916346b1370b84c8","user":{"login":"PawelGutkowski","id":17570261,"avatar_url":"https://avatars.githubusercontent.com/u/17570261?v=3","gravatar_id":"","url":"https://api.github.com/users/PawelGutkowski","html_url":"https://github.com/PawelGutkowski","followers_url":"https://api.github.com/users/PawelGutkowski/followers","following_url":"https://api.github.com/users/PawelGutkowski/following{/other_user}","gists_url":"https://api.github.com/users/PawelGutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/PawelGutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PawelGutkowski/subscriptions","organizations_url":"https://api.github.com/users/PawelGutkowski/orgs","repos_url":"https://api.github.com/users/PawelGutkowski/repos","events_url":"https://api.github.com/users/PawelGutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/PawelGutkowski/received_events","type":"User","site_admin":false},"body":"I just decided keep convention which was already in place in `ModuleResource1_8`. If we decide it needs to be changed, fine by me.","created_at":"2016-10-28T05:58:01Z","updated_at":"2016-10-28T05:58:01Z","html_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255#discussion_r85475753","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments/85475753"},"html":{"href":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255#discussion_r85475753"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255","id":90945407,"html_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255","diff_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255.diff","patch_url":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/255","number":255,"state":"open","locked":false,"title":"RESTWS-627 Improve module resource","user":{"login":"PawelGutkowski","id":17570261,"avatar_url":"https://avatars.githubusercontent.com/u/17570261?v=3","gravatar_id":"","url":"https://api.github.com/users/PawelGutkowski","html_url":"https://github.com/PawelGutkowski","followers_url":"https://api.github.com/users/PawelGutkowski/followers","following_url":"https://api.github.com/users/PawelGutkowski/following{/other_user}","gists_url":"https://api.github.com/users/PawelGutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/PawelGutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PawelGutkowski/subscriptions","organizations_url":"https://api.github.com/users/PawelGutkowski/orgs","repos_url":"https://api.github.com/users/PawelGutkowski/repos","events_url":"https://api.github.com/users/PawelGutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/PawelGutkowski/received_events","type":"User","site_admin":false},"body":"https://issues.openmrs.org/browse/RESTWS-627","created_at":"2016-10-26T06:49:04Z","updated_at":"2016-10-28T05:58:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c2ce4d78ae3f0af5d6f0999e740deda82d08667","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/255/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/460018808b7bbff61d3405ea916346b1370b84c8","head":{"label":"PawelGutkowski:RESTWS-627","ref":"RESTWS-627","sha":"460018808b7bbff61d3405ea916346b1370b84c8","user":{"login":"PawelGutkowski","id":17570261,"avatar_url":"https://avatars.githubusercontent.com/u/17570261?v=3","gravatar_id":"","url":"https://api.github.com/users/PawelGutkowski","html_url":"https://github.com/PawelGutkowski","followers_url":"https://api.github.com/users/PawelGutkowski/followers","following_url":"https://api.github.com/users/PawelGutkowski/following{/other_user}","gists_url":"https://api.github.com/users/PawelGutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/PawelGutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PawelGutkowski/subscriptions","organizations_url":"https://api.github.com/users/PawelGutkowski/orgs","repos_url":"https://api.github.com/users/PawelGutkowski/repos","events_url":"https://api.github.com/users/PawelGutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/PawelGutkowski/received_events","type":"User","site_admin":false},"repo":{"id":54971308,"name":"openmrs-module-webservices.rest","full_name":"PawelGutkowski/openmrs-module-webservices.rest","owner":{"login":"PawelGutkowski","id":17570261,"avatar_url":"https://avatars.githubusercontent.com/u/17570261?v=3","gravatar_id":"","url":"https://api.github.com/users/PawelGutkowski","html_url":"https://github.com/PawelGutkowski","followers_url":"https://api.github.com/users/PawelGutkowski/followers","following_url":"https://api.github.com/users/PawelGutkowski/following{/other_user}","gists_url":"https://api.github.com/users/PawelGutkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/PawelGutkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PawelGutkowski/subscriptions","organizations_url":"https://api.github.com/users/PawelGutkowski/orgs","repos_url":"https://api.github.com/users/PawelGutkowski/repos","events_url":"https://api.github.com/users/PawelGutkowski/events{/privacy}","received_events_url":"https://api.github.com/users/PawelGutkowski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PawelGutkowski/openmrs-module-webservices.rest","description":"Provides RESTful web services for OpenMRS","fork":true,"url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest","forks_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/forks","keys_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/teams","hooks_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/hooks","issue_events_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/issues/events{/number}","events_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/events","assignees_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/assignees{/user}","branches_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/branches{/branch}","tags_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/tags","blobs_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/statuses/{sha}","languages_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/languages","stargazers_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/stargazers","contributors_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/contributors","subscribers_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/subscribers","subscription_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/subscription","commits_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/contents/{+path}","compare_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/merges","archive_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/downloads","issues_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/issues{/number}","pulls_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/pulls{/number}","milestones_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/milestones{/number}","notifications_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/labels{/name}","releases_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/releases{/id}","deployments_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-webservices.rest/deployments","created_at":"2016-03-29T11:47:22Z","updated_at":"2016-03-29T11:47:25Z","pushed_at":"2016-10-27T09:27:01Z","git_url":"git://github.com/PawelGutkowski/openmrs-module-webservices.rest.git","ssh_url":"git@github.com:PawelGutkowski/openmrs-module-webservices.rest.git","clone_url":"https://github.com/PawelGutkowski/openmrs-module-webservices.rest.git","svn_url":"https://github.com/PawelGutkowski/openmrs-module-webservices.rest","homepage":null,"size":5506,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"af10974dba8f1443ca2000a20b11eb14785800a7","user":{"login":"openmrs","id":860776,"avatar_url":"https://avatars.githubusercontent.com/u/860776?v=3","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"repo":{"id":6951233,"name":"openmrs-module-webservices.rest","full_name":"openmrs/openmrs-module-webservices.rest","owner":{"login":"openmrs","id":860776,"avatar_url":"https://avatars.githubusercontent.com/u/860776?v=3","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmrs/openmrs-module-webservices.rest","description":"Provides RESTful web services for OpenMRS","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest","forks_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/deployments","created_at":"2012-12-01T06:50:25Z","updated_at":"2016-10-27T08:44:19Z","pushed_at":"2016-10-27T09:27:01Z","git_url":"git://github.com/openmrs/openmrs-module-webservices.rest.git","ssh_url":"git@github.com:openmrs/openmrs-module-webservices.rest.git","clone_url":"https://github.com/openmrs/openmrs-module-webservices.rest.git","svn_url":"https://github.com/openmrs/openmrs-module-webservices.rest","homepage":null,"size":6798,"stargazers_count":19,"watchers_count":19,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":148,"mirror_url":null,"open_issues_count":1,"forks":148,"open_issues":1,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255"},"html":{"href":"https://github.com/openmrs/openmrs-module-webservices.rest/pull/255"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/255"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/issues/255/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/pulls/255/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-module-webservices.rest/statuses/460018808b7bbff61d3405ea916346b1370b84c8"}}}}
{"actor":{"display_login":"PawelGutkowski"}}