{"action":"created","comment":{"url":"https://api.github.com/repos/Jasig/uPortal/pulls/comments/52063263","id":52063263,"diff_hunk":"@@ -28,28 +43,62 @@\n  */\n public abstract class AbstractTenantOperationsListener implements ITenantOperationsListener {\n \n-    private boolean failOnError = true;  // default\n+    private static final String NO_OPERATIONS_PERFORMED = \"no.operations.performed\";\n+\n+    @Autowired\n+    private IPortalRequestUtils portalRequestUtils;\n+\n+    @Autowired\n+    private IPersonManager personManager;\n \n-    public void setFailOnError(boolean failOnError) {\n-        this.failOnError = failOnError;\n+    @Autowired\n+    private ILocaleStore localeStore;\n+\n+    @Autowired\n+    private MessageSource messageSource;\n+\n+    @Override\n+    public final String getName() {\n+        return messageSource.getMessage(getClass().getName() + \".name\", null, getCurrentUserLocale());\n     }\n \n-    /**\n-     * Whether a failure in this listener represents total failure and brings \n-     * the process to an abrupt halt.  The default is <code>true</code>.\n-     */\n     @Override\n-    public boolean isFailOnError() {\n-        return failOnError;\n+    public TenantOperationResponse onCreate(ITenant tenant) {\n+        return getDefaultResponse();\n     }\n \n     @Override\n-    public void onCreate(ITenant tenant) {}\n+    public TenantOperationResponse onUpdate(ITenant tenant) {\n+        return getDefaultResponse();\n+    }\n \n     @Override\n-    public void onUpdate(ITenant tenant) {}\n+    public TenantOperationResponse onDelete(ITenant tenant) {\n+        return getDefaultResponse();\n+    }\n \n     @Override\n-    public void onDelete(ITenant tenant) {}\n+    public Set<ITenantManagementAction> getAvaialableActions() {\n+        return Collections.emptySet();\n+    }\n+\n+    protected Locale getCurrentUserLocale() {\n+        final HttpServletRequest req = this.portalRequestUtils.getCurrentPortalRequest();\n+        final IPerson person = personManager.getPerson(req);\n+        final Locale[] userLocales = localeStore.getUserLocales(person);\n+        final LocaleManager localeManager = new LocaleManager(person, userLocales);\n+        final Locale locale = localeManager.getLocales()[0];\n+        return locale;\n+    }\n+\n+    protected MessageSource getMessageSource() {\n+        return messageSource;\n+    }","path":"uportal-war/src/main/java/org/jasig/portal/tenants/AbstractTenantOperationsListener.java","position":88,"original_position":88,"commit_id":"483f73b1225c8dbccc949444f809a7d3ddb5c196","original_commit_id":"483f73b1225c8dbccc949444f809a7d3ddb5c196","user":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"body":"Perhaps refactor the previous 2 methods into 1 that hides the Local detail?","created_at":"2016-02-05T19:43:23Z","updated_at":"2016-02-05T19:43:23Z","html_url":"https://github.com/Jasig/uPortal/pull/618#discussion_r52063263","pull_request_url":"https://api.github.com/repos/Jasig/uPortal/pulls/618","_links":{"self":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/comments/52063263"},"html":{"href":"https://github.com/Jasig/uPortal/pull/618#discussion_r52063263"},"pull_request":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/618"}}},"pull_request":{"url":"https://api.github.com/repos/Jasig/uPortal/pulls/618","id":58473125,"html_url":"https://github.com/Jasig/uPortal/pull/618","diff_url":"https://github.com/Jasig/uPortal/pull/618.diff","patch_url":"https://github.com/Jasig/uPortal/pull/618.patch","issue_url":"https://api.github.com/repos/Jasig/uPortal/issues/618","number":618,"state":"open","locked":false,"title":"UP-4624:  Enhancement to the Tenant Manager (initial pass... working …","user":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"body":"…out refinements)\r\n\r\nhttps://issues.jasig.org/browse/UP-4624\r\n\r\nThis change includes enhancement to the Tenant Manager:\r\n* Report on operations performed during an Add Tenant\r\n* Allow some of these operations to fail without cancelling the whole thing\r\n* Add support for pluggable actions that are accessible from the Tenant Details screen (which is new)\r\n\r\n![tenant-manager-1](https://cloud.githubusercontent.com/assets/1127174/12856782/cd2fd5c6-cc03-11e5-8934-772fdd844576.png)\r\n![tenant-manager-2](https://cloud.githubusercontent.com/assets/1127174/12856784/cf31dcd4-cc03-11e5-8e85-fdd48fdda6bf.png)","created_at":"2016-02-05T19:29:08Z","updated_at":"2016-02-05T19:43:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55f57d7aa201c22fbe47546dd7554534a6983eda","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Jasig/uPortal/pulls/618/commits","review_comments_url":"https://api.github.com/repos/Jasig/uPortal/pulls/618/comments","review_comment_url":"https://api.github.com/repos/Jasig/uPortal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jasig/uPortal/issues/618/comments","statuses_url":"https://api.github.com/repos/Jasig/uPortal/statuses/483f73b1225c8dbccc949444f809a7d3ddb5c196","head":{"label":"drewwills:UP-4624","ref":"UP-4624","sha":"483f73b1225c8dbccc949444f809a7d3ddb5c196","user":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"repo":{"id":3848853,"name":"uPortal","full_name":"drewwills/uPortal","owner":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drewwills/uPortal","description":"Enterprise open source portal built by and for the higher education community.","fork":true,"url":"https://api.github.com/repos/drewwills/uPortal","forks_url":"https://api.github.com/repos/drewwills/uPortal/forks","keys_url":"https://api.github.com/repos/drewwills/uPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drewwills/uPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drewwills/uPortal/teams","hooks_url":"https://api.github.com/repos/drewwills/uPortal/hooks","issue_events_url":"https://api.github.com/repos/drewwills/uPortal/issues/events{/number}","events_url":"https://api.github.com/repos/drewwills/uPortal/events","assignees_url":"https://api.github.com/repos/drewwills/uPortal/assignees{/user}","branches_url":"https://api.github.com/repos/drewwills/uPortal/branches{/branch}","tags_url":"https://api.github.com/repos/drewwills/uPortal/tags","blobs_url":"https://api.github.com/repos/drewwills/uPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drewwills/uPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drewwills/uPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/drewwills/uPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drewwills/uPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/drewwills/uPortal/languages","stargazers_url":"https://api.github.com/repos/drewwills/uPortal/stargazers","contributors_url":"https://api.github.com/repos/drewwills/uPortal/contributors","subscribers_url":"https://api.github.com/repos/drewwills/uPortal/subscribers","subscription_url":"https://api.github.com/repos/drewwills/uPortal/subscription","commits_url":"https://api.github.com/repos/drewwills/uPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/drewwills/uPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/drewwills/uPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/drewwills/uPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/drewwills/uPortal/contents/{+path}","compare_url":"https://api.github.com/repos/drewwills/uPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drewwills/uPortal/merges","archive_url":"https://api.github.com/repos/drewwills/uPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drewwills/uPortal/downloads","issues_url":"https://api.github.com/repos/drewwills/uPortal/issues{/number}","pulls_url":"https://api.github.com/repos/drewwills/uPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/drewwills/uPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/drewwills/uPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drewwills/uPortal/labels{/name}","releases_url":"https://api.github.com/repos/drewwills/uPortal/releases{/id}","deployments_url":"https://api.github.com/repos/drewwills/uPortal/deployments","created_at":"2012-03-27T21:40:59Z","updated_at":"2014-06-24T21:27:06Z","pushed_at":"2016-02-05T19:25:49Z","git_url":"git://github.com/drewwills/uPortal.git","ssh_url":"git@github.com:drewwills/uPortal.git","clone_url":"https://github.com/drewwills/uPortal.git","svn_url":"https://github.com/drewwills/uPortal","homepage":"http://www.jasig.org/uportal","size":143014,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"Jasig:master","ref":"master","sha":"42c0e679e4b8acc6419d0689015c1ef9acf2c7d4","user":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"repo":{"id":2614085,"name":"uPortal","full_name":"Jasig/uPortal","owner":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jasig/uPortal","description":"Enterprise open source portal built by and for the higher education community.","fork":false,"url":"https://api.github.com/repos/Jasig/uPortal","forks_url":"https://api.github.com/repos/Jasig/uPortal/forks","keys_url":"https://api.github.com/repos/Jasig/uPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jasig/uPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jasig/uPortal/teams","hooks_url":"https://api.github.com/repos/Jasig/uPortal/hooks","issue_events_url":"https://api.github.com/repos/Jasig/uPortal/issues/events{/number}","events_url":"https://api.github.com/repos/Jasig/uPortal/events","assignees_url":"https://api.github.com/repos/Jasig/uPortal/assignees{/user}","branches_url":"https://api.github.com/repos/Jasig/uPortal/branches{/branch}","tags_url":"https://api.github.com/repos/Jasig/uPortal/tags","blobs_url":"https://api.github.com/repos/Jasig/uPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jasig/uPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jasig/uPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jasig/uPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jasig/uPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/Jasig/uPortal/languages","stargazers_url":"https://api.github.com/repos/Jasig/uPortal/stargazers","contributors_url":"https://api.github.com/repos/Jasig/uPortal/contributors","subscribers_url":"https://api.github.com/repos/Jasig/uPortal/subscribers","subscription_url":"https://api.github.com/repos/Jasig/uPortal/subscription","commits_url":"https://api.github.com/repos/Jasig/uPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jasig/uPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jasig/uPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jasig/uPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jasig/uPortal/contents/{+path}","compare_url":"https://api.github.com/repos/Jasig/uPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jasig/uPortal/merges","archive_url":"https://api.github.com/repos/Jasig/uPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jasig/uPortal/downloads","issues_url":"https://api.github.com/repos/Jasig/uPortal/issues{/number}","pulls_url":"https://api.github.com/repos/Jasig/uPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/Jasig/uPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/Jasig/uPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jasig/uPortal/labels{/name}","releases_url":"https://api.github.com/repos/Jasig/uPortal/releases{/id}","deployments_url":"https://api.github.com/repos/Jasig/uPortal/deployments","created_at":"2011-10-20T15:34:22Z","updated_at":"2016-01-12T03:05:25Z","pushed_at":"2016-02-05T19:29:08Z","git_url":"git://github.com/Jasig/uPortal.git","ssh_url":"git@github.com:Jasig/uPortal.git","clone_url":"https://github.com/Jasig/uPortal.git","svn_url":"https://github.com/Jasig/uPortal","homepage":"http://www.jasig.org/uportal","size":151116,"stargazers_count":109,"watchers_count":109,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":27,"forks":172,"open_issues":27,"watchers":109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/618"},"html":{"href":"https://github.com/Jasig/uPortal/pull/618"},"issue":{"href":"https://api.github.com/repos/Jasig/uPortal/issues/618"},"comments":{"href":"https://api.github.com/repos/Jasig/uPortal/issues/618/comments"},"review_comments":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/618/comments"},"review_comment":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/618/commits"},"statuses":{"href":"https://api.github.com/repos/Jasig/uPortal/statuses/483f73b1225c8dbccc949444f809a7d3ddb5c196"}}}}