{"action":"created","comment":{"url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/comments/46706577","id":46706577,"diff_hunk":"@@ -0,0 +1,93 @@\n+package ru.mail.jira.plugins.contentprojects.extras;\n+\n+import com.atlassian.jira.security.xsrf.RequiresXsrfCheck;\n+import com.atlassian.jira.web.action.JiraWebActionSupport;\n+import org.apache.commons.lang3.StringUtils;\n+import ru.mail.jira.plugins.commons.CommonUtils;\n+import ru.mail.jira.plugins.contentprojects.common.Consts;\n+import ru.mail.jira.plugins.contentprojects.issue.functions.SharesFunction;\n+import ru.mail.jira.plugins.contentprojects.issue.functions.SharesOutput;\n+import webwork.action.ServletActionContext;\n+\n+import javax.servlet.http.HttpServletResponse;\n+import javax.ws.rs.Produces;\n+import javax.ws.rs.core.MediaType;\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+public class ContentProjectsViewSharesAction extends JiraWebActionSupport {\n+    private String[] urls;\n+    private SharesOutput[] sharesArray;\n+\n+    public String getUrls() {\n+        return urls != null ? StringUtils.join(urls, '\\n') : null;\n+    }\n+\n+    public void setUrls(String urls) {\n+        this.urls = fillNotEmptyUrls(urls.trim().split(\"\\\\s+\"));\n+    }\n+\n+    private String[] fillNotEmptyUrls(String[] urls) {\n+        List<String> urlList = new ArrayList<String>(urls.length);\n+        for (String url : urls) {\n+            if (StringUtils.isNotEmpty(url))\n+                urlList.add(url);\n+        }\n+        return !urlList.isEmpty() ? urlList.toArray(new String[urlList.size()]) : null;\n+    }\n+\n+    public SharesOutput[] getSharesArray() {\n+        return sharesArray;\n+    }\n+\n+    public SharesOutput getSharesTotal() {\n+        int[] sharesTotal = new int[5];\n+        for (SharesOutput shares : this.sharesArray) {\n+            sharesTotal[0] += shares.getFacebook();\n+            sharesTotal[1] += shares.getMymail();\n+            sharesTotal[2] += shares.getOdnoklassniki();\n+            sharesTotal[3] += shares.getTwitter();\n+            sharesTotal[4] += shares.getVkontakte();\n+        }\n+","path":"src/main/java/ru/mail/jira/plugins/contentprojects/extras/ContentProjectsViewSharesAction.java","position":53,"original_position":53,"commit_id":"22d5b24622668bab997f5804829893b2af183c25","original_commit_id":"22d5b24622668bab997f5804829893b2af183c25","user":{"login":"andreymolchanov","id":3244075,"avatar_url":"https://avatars.githubusercontent.com/u/3244075?v=3","gravatar_id":"","url":"https://api.github.com/users/andreymolchanov","html_url":"https://github.com/andreymolchanov","followers_url":"https://api.github.com/users/andreymolchanov/followers","following_url":"https://api.github.com/users/andreymolchanov/following{/other_user}","gists_url":"https://api.github.com/users/andreymolchanov/gists{/gist_id}","starred_url":"https://api.github.com/users/andreymolchanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreymolchanov/subscriptions","organizations_url":"https://api.github.com/users/andreymolchanov/orgs","repos_url":"https://api.github.com/users/andreymolchanov/repos","events_url":"https://api.github.com/users/andreymolchanov/events{/privacy}","received_events_url":"https://api.github.com/users/andreymolchanov/received_events","type":"User","site_admin":false},"body":"перенос лишний же","created_at":"2015-12-04T17:18:21Z","updated_at":"2015-12-04T17:18:21Z","html_url":"https://github.com/mailru/jira-plugins-contentprojects/pull/9#discussion_r46706577","pull_request_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/comments/46706577"},"html":{"href":"https://github.com/mailru/jira-plugins-contentprojects/pull/9#discussion_r46706577"},"pull_request":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9","id":52676843,"html_url":"https://github.com/mailru/jira-plugins-contentprojects/pull/9","diff_url":"https://github.com/mailru/jira-plugins-contentprojects/pull/9.diff","patch_url":"https://github.com/mailru/jira-plugins-contentprojects/pull/9.patch","issue_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/9","number":9,"state":"open","locked":false,"title":"View shares page","user":{"login":"mashintsev","id":986470,"avatar_url":"https://avatars.githubusercontent.com/u/986470?v=3","gravatar_id":"","url":"https://api.github.com/users/mashintsev","html_url":"https://github.com/mashintsev","followers_url":"https://api.github.com/users/mashintsev/followers","following_url":"https://api.github.com/users/mashintsev/following{/other_user}","gists_url":"https://api.github.com/users/mashintsev/gists{/gist_id}","starred_url":"https://api.github.com/users/mashintsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mashintsev/subscriptions","organizations_url":"https://api.github.com/users/mashintsev/orgs","repos_url":"https://api.github.com/users/mashintsev/repos","events_url":"https://api.github.com/users/mashintsev/events{/privacy}","received_events_url":"https://api.github.com/users/mashintsev/received_events","type":"User","site_admin":false},"body":"<img width=\"1021\" alt=\"2015-12-04 18 41 43\" src=\"https://cloud.githubusercontent.com/assets/986470/11593698/b8e14b46-9ab6-11e5-97b1-948656bcf2df.png\">\r\n<img width=\"850\" alt=\"2015-12-04 18 41 51\" src=\"https://cloud.githubusercontent.com/assets/986470/11593697/b8e0cd56-9ab6-11e5-94f7-d461ddff8eeb.png\">\r\n","created_at":"2015-12-04T14:44:27Z","updated_at":"2015-12-04T17:18:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5090116f5f9ec91a2ca4f87cc9a4fd4e86871bc1","assignee":{"login":"andreymolchanov","id":3244075,"avatar_url":"https://avatars.githubusercontent.com/u/3244075?v=3","gravatar_id":"","url":"https://api.github.com/users/andreymolchanov","html_url":"https://github.com/andreymolchanov","followers_url":"https://api.github.com/users/andreymolchanov/followers","following_url":"https://api.github.com/users/andreymolchanov/following{/other_user}","gists_url":"https://api.github.com/users/andreymolchanov/gists{/gist_id}","starred_url":"https://api.github.com/users/andreymolchanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreymolchanov/subscriptions","organizations_url":"https://api.github.com/users/andreymolchanov/orgs","repos_url":"https://api.github.com/users/andreymolchanov/repos","events_url":"https://api.github.com/users/andreymolchanov/events{/privacy}","received_events_url":"https://api.github.com/users/andreymolchanov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9/commits","review_comments_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9/comments","review_comment_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/9/comments","statuses_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/statuses/22d5b24622668bab997f5804829893b2af183c25","head":{"label":"mailru:JC-9464","ref":"JC-9464","sha":"22d5b24622668bab997f5804829893b2af183c25","user":{"login":"mailru","id":399923,"avatar_url":"https://avatars.githubusercontent.com/u/399923?v=3","gravatar_id":"","url":"https://api.github.com/users/mailru","html_url":"https://github.com/mailru","followers_url":"https://api.github.com/users/mailru/followers","following_url":"https://api.github.com/users/mailru/following{/other_user}","gists_url":"https://api.github.com/users/mailru/gists{/gist_id}","starred_url":"https://api.github.com/users/mailru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailru/subscriptions","organizations_url":"https://api.github.com/users/mailru/orgs","repos_url":"https://api.github.com/users/mailru/repos","events_url":"https://api.github.com/users/mailru/events{/privacy}","received_events_url":"https://api.github.com/users/mailru/received_events","type":"Organization","site_admin":false},"repo":{"id":34399716,"name":"jira-plugins-contentprojects","full_name":"mailru/jira-plugins-contentprojects","owner":{"login":"mailru","id":399923,"avatar_url":"https://avatars.githubusercontent.com/u/399923?v=3","gravatar_id":"","url":"https://api.github.com/users/mailru","html_url":"https://github.com/mailru","followers_url":"https://api.github.com/users/mailru/followers","following_url":"https://api.github.com/users/mailru/following{/other_user}","gists_url":"https://api.github.com/users/mailru/gists{/gist_id}","starred_url":"https://api.github.com/users/mailru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailru/subscriptions","organizations_url":"https://api.github.com/users/mailru/orgs","repos_url":"https://api.github.com/users/mailru/repos","events_url":"https://api.github.com/users/mailru/events{/privacy}","received_events_url":"https://api.github.com/users/mailru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mailru/jira-plugins-contentprojects","description":"","fork":false,"url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects","forks_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/forks","keys_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/teams","hooks_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/hooks","issue_events_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/events{/number}","events_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/events","assignees_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/assignees{/user}","branches_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/branches{/branch}","tags_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/tags","blobs_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/refs{/sha}","trees_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/statuses/{sha}","languages_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/languages","stargazers_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/stargazers","contributors_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/contributors","subscribers_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/subscribers","subscription_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/subscription","commits_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/commits{/sha}","git_commits_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/commits{/sha}","comments_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/comments{/number}","issue_comment_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/comments{/number}","contents_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/contents/{+path}","compare_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/merges","archive_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/downloads","issues_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues{/number}","pulls_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls{/number}","milestones_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/milestones{/number}","notifications_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/labels{/name}","releases_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/releases{/id}","created_at":"2015-04-22T15:46:51Z","updated_at":"2015-11-24T13:49:21Z","pushed_at":"2015-12-04T15:44:47Z","git_url":"git://github.com/mailru/jira-plugins-contentprojects.git","ssh_url":"git@github.com:mailru/jira-plugins-contentprojects.git","clone_url":"https://github.com/mailru/jira-plugins-contentprojects.git","svn_url":"https://github.com/mailru/jira-plugins-contentprojects","homepage":null,"size":196,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":5,"default_branch":"master"}},"base":{"label":"mailru:master","ref":"master","sha":"694151da759eeb2239a64f330f4198ec58610d67","user":{"login":"mailru","id":399923,"avatar_url":"https://avatars.githubusercontent.com/u/399923?v=3","gravatar_id":"","url":"https://api.github.com/users/mailru","html_url":"https://github.com/mailru","followers_url":"https://api.github.com/users/mailru/followers","following_url":"https://api.github.com/users/mailru/following{/other_user}","gists_url":"https://api.github.com/users/mailru/gists{/gist_id}","starred_url":"https://api.github.com/users/mailru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailru/subscriptions","organizations_url":"https://api.github.com/users/mailru/orgs","repos_url":"https://api.github.com/users/mailru/repos","events_url":"https://api.github.com/users/mailru/events{/privacy}","received_events_url":"https://api.github.com/users/mailru/received_events","type":"Organization","site_admin":false},"repo":{"id":34399716,"name":"jira-plugins-contentprojects","full_name":"mailru/jira-plugins-contentprojects","owner":{"login":"mailru","id":399923,"avatar_url":"https://avatars.githubusercontent.com/u/399923?v=3","gravatar_id":"","url":"https://api.github.com/users/mailru","html_url":"https://github.com/mailru","followers_url":"https://api.github.com/users/mailru/followers","following_url":"https://api.github.com/users/mailru/following{/other_user}","gists_url":"https://api.github.com/users/mailru/gists{/gist_id}","starred_url":"https://api.github.com/users/mailru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailru/subscriptions","organizations_url":"https://api.github.com/users/mailru/orgs","repos_url":"https://api.github.com/users/mailru/repos","events_url":"https://api.github.com/users/mailru/events{/privacy}","received_events_url":"https://api.github.com/users/mailru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mailru/jira-plugins-contentprojects","description":"","fork":false,"url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects","forks_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/forks","keys_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/teams","hooks_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/hooks","issue_events_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/events{/number}","events_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/events","assignees_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/assignees{/user}","branches_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/branches{/branch}","tags_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/tags","blobs_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/refs{/sha}","trees_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/statuses/{sha}","languages_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/languages","stargazers_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/stargazers","contributors_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/contributors","subscribers_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/subscribers","subscription_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/subscription","commits_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/commits{/sha}","git_commits_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/git/commits{/sha}","comments_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/comments{/number}","issue_comment_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/comments{/number}","contents_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/contents/{+path}","compare_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/merges","archive_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/downloads","issues_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues{/number}","pulls_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls{/number}","milestones_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/milestones{/number}","notifications_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/labels{/name}","releases_url":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/releases{/id}","created_at":"2015-04-22T15:46:51Z","updated_at":"2015-11-24T13:49:21Z","pushed_at":"2015-12-04T15:44:47Z","git_url":"git://github.com/mailru/jira-plugins-contentprojects.git","ssh_url":"git@github.com:mailru/jira-plugins-contentprojects.git","clone_url":"https://github.com/mailru/jira-plugins-contentprojects.git","svn_url":"https://github.com/mailru/jira-plugins-contentprojects","homepage":null,"size":196,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9"},"html":{"href":"https://github.com/mailru/jira-plugins-contentprojects/pull/9"},"issue":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/9"},"comments":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/mailru/jira-plugins-contentprojects/statuses/22d5b24622668bab997f5804829893b2af183c25"}}}}