{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/comments/73292183","id":73292183,"diff_hunk":"@@ -76,6 +77,29 @@ public void contextRefreshed() {\n \t\tcatch (IOException e) {\n \t\t\tlog.error(e);\n \t\t}\n+\n+\t\t/**\n+\t\t * Check if there is any '.zip' file in OWA app directory and deploy them\n+\t\t * this app manager is out of Spring context, so apps have to be reloaded here\n+\t\t */\n+\t\tAppManager appManager = new DefaultAppManager();\n+\t\tappManager.reloadApps();\n+\t\tFile owaDir = new File(Context.getAdministrationService().getGlobalProperty(\"owa.appFolderPath\"));\n+\t\tFile[] files = owaDir.listFiles();\n+\t\tif (files != null) {\n+\t\t\tfor (File file : files) {\n+\t\t\t\tif (file.getName().endsWith(\".zip\")) {\n+\t\t\t\t\ttry {\n+\t\t\t\t\t\tappManager.installApp(file, file.getName(), Context.getAdministrationService().getGlobalProperty(\"owa.appBaseUrl\"));\n+\t\t\t\t\t\tfile.delete();\n+\t\t\t\t\t}\n+\t\t\t\t\tcatch (IOException e) {\n+\t\t\t\t\t\tlog.error(e);","path":"omod/src/main/java/org/openmrs/module/owa/activator/OwaActivator.java","position":29,"original_position":29,"commit_id":"6b5664c3b15d29b2cbdbefd2b0e15433b71c4e69","original_commit_id":"6b5664c3b15d29b2cbdbefd2b0e15433b71c4e69","user":{"login":"dkayiwa","id":1390773,"avatar_url":"https://avatars.githubusercontent.com/u/1390773?v=3","gravatar_id":"","url":"https://api.github.com/users/dkayiwa","html_url":"https://github.com/dkayiwa","followers_url":"https://api.github.com/users/dkayiwa/followers","following_url":"https://api.github.com/users/dkayiwa/following{/other_user}","gists_url":"https://api.github.com/users/dkayiwa/gists{/gist_id}","starred_url":"https://api.github.com/users/dkayiwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkayiwa/subscriptions","organizations_url":"https://api.github.com/users/dkayiwa/orgs","repos_url":"https://api.github.com/users/dkayiwa/repos","events_url":"https://api.github.com/users/dkayiwa/events{/privacy}","received_events_url":"https://api.github.com/users/dkayiwa/received_events","type":"User","site_admin":false},"body":"How about log.error(\"some sort of what failed text\", e)?","created_at":"2016-08-03T07:29:58Z","updated_at":"2016-08-03T07:29:58Z","html_url":"https://github.com/openmrs/openmrs-module-owa/pull/43#discussion_r73292183","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/comments/73292183"},"html":{"href":"https://github.com/openmrs/openmrs-module-owa/pull/43#discussion_r73292183"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43","id":79344463,"html_url":"https://github.com/openmrs/openmrs-module-owa/pull/43","diff_url":"https://github.com/openmrs/openmrs-module-owa/pull/43.diff","patch_url":"https://github.com/openmrs/openmrs-module-owa/pull/43.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/43","number":43,"state":"open","locked":false,"title":"MAP-16 Deploy owas from zip in app directory on startup","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":"this PR is related to https://github.com/openmrs/openmrs-module-metadatamapping/pull/23\r\n\r\n~~App observer watches changes in owa base directory. If any zip file is created, it runs AppManager to deploy it and delete zip file.~~\r\n\r\nAfter context refresh OwaActivator looks for any zip files in app directory, deploys them and delete after successful deployment.","created_at":"2016-07-29T11:19:13Z","updated_at":"2016-08-03T07:29:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9152eee5729244c2a7564257070be4f7a074d26b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/43/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/statuses/6b5664c3b15d29b2cbdbefd2b0e15433b71c4e69","head":{"label":"PawelGutkowski:master","ref":"master","sha":"6b5664c3b15d29b2cbdbefd2b0e15433b71c4e69","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":64463534,"name":"openmrs-module-owa","full_name":"PawelGutkowski/openmrs-module-owa","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-owa","description":"OpenMRS module to add open web apps - ","fork":true,"url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa","forks_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/forks","keys_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/teams","hooks_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/hooks","issue_events_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/issues/events{/number}","events_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/events","assignees_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/assignees{/user}","branches_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/branches{/branch}","tags_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/tags","blobs_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/git/refs{/sha}","trees_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/statuses/{sha}","languages_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/languages","stargazers_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/stargazers","contributors_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/contributors","subscribers_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/subscribers","subscription_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/subscription","commits_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/commits{/sha}","git_commits_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/git/commits{/sha}","comments_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/comments{/number}","issue_comment_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/issues/comments{/number}","contents_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/contents/{+path}","compare_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/merges","archive_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/downloads","issues_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/issues{/number}","pulls_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/pulls{/number}","milestones_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/milestones{/number}","notifications_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/labels{/name}","releases_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/releases{/id}","deployments_url":"https://api.github.com/repos/PawelGutkowski/openmrs-module-owa/deployments","created_at":"2016-07-29T08:16:11Z","updated_at":"2016-07-29T08:16:12Z","pushed_at":"2016-08-01T08:25:19Z","git_url":"git://github.com/PawelGutkowski/openmrs-module-owa.git","ssh_url":"git@github.com:PawelGutkowski/openmrs-module-owa.git","clone_url":"https://github.com/PawelGutkowski/openmrs-module-owa.git","svn_url":"https://github.com/PawelGutkowski/openmrs-module-owa","homepage":"https://wiki.openmrs.org/display/docs/Open+Web+Apps+Module","size":7388,"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":"8943ca612251fcaaf9da642cb899cc0838f39fe5","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":27960111,"name":"openmrs-module-owa","full_name":"openmrs/openmrs-module-owa","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-owa","description":"OpenMRS module to add open web apps - ","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-module-owa","forks_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-module-owa/deployments","created_at":"2014-12-13T12:34:38Z","updated_at":"2016-02-12T16:51:47Z","pushed_at":"2016-08-01T08:25:19Z","git_url":"git://github.com/openmrs/openmrs-module-owa.git","ssh_url":"git@github.com:openmrs/openmrs-module-owa.git","clone_url":"https://github.com/openmrs/openmrs-module-owa.git","svn_url":"https://github.com/openmrs/openmrs-module-owa","homepage":"https://wiki.openmrs.org/display/docs/Open+Web+Apps+Module","size":11710,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":1,"forks":19,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43"},"html":{"href":"https://github.com/openmrs/openmrs-module-owa/pull/43"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/43"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-module-owa/statuses/6b5664c3b15d29b2cbdbefd2b0e15433b71c4e69"}}}}
{"actor":{"display_login":"dkayiwa"}}