{"action":"created","comment":{"url":"https://api.github.com/repos/IQSS/dataverse/pulls/comments/224964086","pull_request_review_id":164467834,"id":224964086,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDk2NDA4Ng==","diff_hunk":"@@ -2433,61 +2435,16 @@ public String restrictSelectedFiles(boolean restricted) throws CommandException{\n         return  returnToDraftVersion();\n     }\n \n-    public void restrictFiles(boolean restricted) throws CommandException {\n-   \n-        //if (previouslyRestrictedFiles == null) {\n-        // we don't need to buther with this \"previously restricted\" business \n-        // when in Create mode... because all the files are new, so none could \n-        // have been restricted previously;\n-        // (well, it looks like the code below should never be called in the \n-        // CREATE mode in the first place... the edit files fragment uses\n-        // its own restrictFiles() method there; also, the fmd.getDataFile().equals(fmw.getDataFile()))\n-        // line is not going to work on a new file... so be mindful of all this\n-        // when the code between the 2 beans is merged in 4.3.\n-        if (editMode != EditMode.CREATE) {\n-            previouslyRestrictedFiles = new ArrayList<>();\n-            for (FileMetadata fmd : workingVersion.getFileMetadatas()) {\n-                if (fmd.isRestricted()) {\n-                    previouslyRestrictedFiles.add(fmd);\n-                }\n+    private void restrictFiles(boolean restricted) throws CommandException {\n+        Command<Void> cmd;\n+        previouslyRestrictedFiles = new ArrayList<>();\n+        for (FileMetadata fmd : this.getSelectedFiles()) {\n+            if(fmd.isRestricted()) {\n+                previouslyRestrictedFiles.add(fmd);\n             }\n-            \n-            Command cmd;\n-            String fileNames = null;\n-            for (FileMetadata fmw : workingVersion.getFileMetadatas()) {\n-                for (FileMetadata fmd : this.getSelectedFiles()) {\n-                    if (restricted && !fmw.isRestricted()) {\n-                    // collect the names of the newly-restrticted files, ","path":"src/main/java/edu/harvard/iq/dataverse/DatasetPage.java","position":60,"original_position":60,"commit_id":"c74589fbbbedb36d219efb9408d651203405eb30","original_commit_id":"c74589fbbbedb36d219efb9408d651203405eb30","user":{"login":"qqmyers","id":6731983,"node_id":"MDQ6VXNlcjY3MzE5ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6731983?v=4","gravatar_id":"","url":"https://api.github.com/users/qqmyers","html_url":"https://github.com/qqmyers","followers_url":"https://api.github.com/users/qqmyers/followers","following_url":"https://api.github.com/users/qqmyers/following{/other_user}","gists_url":"https://api.github.com/users/qqmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/qqmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qqmyers/subscriptions","organizations_url":"https://api.github.com/users/qqmyers/orgs","repos_url":"https://api.github.com/users/qqmyers/repos","events_url":"https://api.github.com/users/qqmyers/events{/privacy}","received_events_url":"https://api.github.com/users/qqmyers/received_events","type":"User","site_admin":false},"body":"because this is called from restrictSelectedFiles above that calls save() which already sets a success message, this list of filenames is never used/never shown because the attempt to add a flash message below fails (an error in the log). ","created_at":"2018-10-13T16:07:10Z","updated_at":"2018-10-13T16:07:10Z","html_url":"https://github.com/IQSS/dataverse/pull/5184#discussion_r224964086","pull_request_url":"https://api.github.com/repos/IQSS/dataverse/pulls/5184","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/comments/224964086"},"html":{"href":"https://github.com/IQSS/dataverse/pull/5184#discussion_r224964086"},"pull_request":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/5184"}}},"pull_request":{"url":"https://api.github.com/repos/IQSS/dataverse/pulls/5184","id":222658514,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjU4NTE0","html_url":"https://github.com/IQSS/dataverse/pull/5184","diff_url":"https://github.com/IQSS/dataverse/pull/5184.diff","patch_url":"https://github.com/IQSS/dataverse/pull/5184.patch","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/5184","number":5184,"state":"open","locked":false,"title":"IQSS-5183 - improve RestrictFileCommand performance","user":{"login":"qqmyers","id":6731983,"node_id":"MDQ6VXNlcjY3MzE5ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6731983?v=4","gravatar_id":"","url":"https://api.github.com/users/qqmyers","html_url":"https://github.com/qqmyers","followers_url":"https://api.github.com/users/qqmyers/followers","following_url":"https://api.github.com/users/qqmyers/following{/other_user}","gists_url":"https://api.github.com/users/qqmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/qqmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qqmyers/subscriptions","organizations_url":"https://api.github.com/users/qqmyers/orgs","repos_url":"https://api.github.com/users/qqmyers/repos","events_url":"https://api.github.com/users/qqmyers/events{/privacy}","received_events_url":"https://api.github.com/users/qqmyers/received_events","type":"User","site_admin":false},"body":"## New Contributors\r\n\r\nWelcome! New contributors should at least glance at [CONTRIBUTING.md](/CONTRIBUTING.md), especially the section on pull requests where we encourage you to reach out to other developers before you start coding. Also, please note that we measure code coverage and prefer you write unit tests. Pull requests can still be reviewed without tests or completion of the checklist outlined below. Thanks!\r\n\r\n## Related Issues\r\n\r\n- connects to #5183 restrict/unrestrict large numbers of files\r\n\r\n## Pull Request Checklist\r\n\r\n- [ ] Unit [tests][] completed\r\n- [ ] Integration [tests][]: None\r\n- [ ] Deployment requirements, [SQL updates][], [Solr updates][], etc.: None\r\n- [ ] [Documentation][docs] completed\r\n- [ ] Merged latest from \"develop\" [branch][] and resolved conflicts\r\n\r\n[tests]: http://guides.dataverse.org/en/latest/developers/testing.html\r\n[SQL updates]: https://github.com/IQSS/dataverse/tree/develop/scripts/database/upgrades\r\n[Solr updates]: https://github.com/IQSS/dataverse/blob/develop/conf/solr/7.3.0/schema.xml\r\n[docs]: http://guides.dataverse.org/en/latest/developers/documentation.html\r\n[branch]: http://guides.dataverse.org/en/latest/developers/branching-strategy.html\r\n","created_at":"2018-10-13T15:57:17Z","updated_at":"2018-10-13T16:07:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0758fa8db26f94f34aaf0353ebed46ed3d6a1603","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IQSS/dataverse/pulls/5184/commits","review_comments_url":"https://api.github.com/repos/IQSS/dataverse/pulls/5184/comments","review_comment_url":"https://api.github.com/repos/IQSS/dataverse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/5184/comments","statuses_url":"https://api.github.com/repos/IQSS/dataverse/statuses/c74589fbbbedb36d219efb9408d651203405eb30","head":{"label":"QualitativeDataRepository:IQSS-5183-restrict_unrestrict_performance","ref":"IQSS-5183-restrict_unrestrict_performance","sha":"c74589fbbbedb36d219efb9408d651203405eb30","user":{"login":"QualitativeDataRepository","id":9614594,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MTQ1OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9614594?v=4","gravatar_id":"","url":"https://api.github.com/users/QualitativeDataRepository","html_url":"https://github.com/QualitativeDataRepository","followers_url":"https://api.github.com/users/QualitativeDataRepository/followers","following_url":"https://api.github.com/users/QualitativeDataRepository/following{/other_user}","gists_url":"https://api.github.com/users/QualitativeDataRepository/gists{/gist_id}","starred_url":"https://api.github.com/users/QualitativeDataRepository/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QualitativeDataRepository/subscriptions","organizations_url":"https://api.github.com/users/QualitativeDataRepository/orgs","repos_url":"https://api.github.com/users/QualitativeDataRepository/repos","events_url":"https://api.github.com/users/QualitativeDataRepository/events{/privacy}","received_events_url":"https://api.github.com/users/QualitativeDataRepository/received_events","type":"Organization","site_admin":false},"repo":{"id":87985547,"node_id":"MDEwOlJlcG9zaXRvcnk4Nzk4NTU0Nw==","name":"dataverse","full_name":"QualitativeDataRepository/dataverse","private":false,"owner":{"login":"QualitativeDataRepository","id":9614594,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk2MTQ1OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9614594?v=4","gravatar_id":"","url":"https://api.github.com/users/QualitativeDataRepository","html_url":"https://github.com/QualitativeDataRepository","followers_url":"https://api.github.com/users/QualitativeDataRepository/followers","following_url":"https://api.github.com/users/QualitativeDataRepository/following{/other_user}","gists_url":"https://api.github.com/users/QualitativeDataRepository/gists{/gist_id}","starred_url":"https://api.github.com/users/QualitativeDataRepository/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QualitativeDataRepository/subscriptions","organizations_url":"https://api.github.com/users/QualitativeDataRepository/orgs","repos_url":"https://api.github.com/users/QualitativeDataRepository/repos","events_url":"https://api.github.com/users/QualitativeDataRepository/events{/privacy}","received_events_url":"https://api.github.com/users/QualitativeDataRepository/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/QualitativeDataRepository/dataverse","description":"A data repository framework to share and publish research data.","fork":true,"url":"https://api.github.com/repos/QualitativeDataRepository/dataverse","forks_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/forks","keys_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/teams","hooks_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/hooks","issue_events_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/issues/events{/number}","events_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/events","assignees_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/assignees{/user}","branches_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/branches{/branch}","tags_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/tags","blobs_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/git/refs{/sha}","trees_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/statuses/{sha}","languages_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/languages","stargazers_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/stargazers","contributors_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/contributors","subscribers_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/subscribers","subscription_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/subscription","commits_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/commits{/sha}","git_commits_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/git/commits{/sha}","comments_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/comments{/number}","issue_comment_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/issues/comments{/number}","contents_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/contents/{+path}","compare_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/merges","archive_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/downloads","issues_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/issues{/number}","pulls_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/pulls{/number}","milestones_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/milestones{/number}","notifications_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/labels{/name}","releases_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/releases{/id}","deployments_url":"https://api.github.com/repos/QualitativeDataRepository/dataverse/deployments","created_at":"2017-04-11T22:38:22Z","updated_at":"2018-05-21T21:47:03Z","pushed_at":"2018-10-13T15:54:52Z","git_url":"git://github.com/QualitativeDataRepository/dataverse.git","ssh_url":"git@github.com:QualitativeDataRepository/dataverse.git","clone_url":"https://github.com/QualitativeDataRepository/dataverse.git","svn_url":"https://github.com/QualitativeDataRepository/dataverse","homepage":"http://dataverse.org","size":69800,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"IQSS:develop","ref":"develop","sha":"e948af27a30fc93a5e1bc97a929c5cf20f7e9cd2","user":{"login":"IQSS","id":675237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NTIzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/675237?v=4","gravatar_id":"","url":"https://api.github.com/users/IQSS","html_url":"https://github.com/IQSS","followers_url":"https://api.github.com/users/IQSS/followers","following_url":"https://api.github.com/users/IQSS/following{/other_user}","gists_url":"https://api.github.com/users/IQSS/gists{/gist_id}","starred_url":"https://api.github.com/users/IQSS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IQSS/subscriptions","organizations_url":"https://api.github.com/users/IQSS/orgs","repos_url":"https://api.github.com/users/IQSS/repos","events_url":"https://api.github.com/users/IQSS/events{/privacy}","received_events_url":"https://api.github.com/users/IQSS/received_events","type":"Organization","site_admin":false},"repo":{"id":14051004,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA1MTAwNA==","name":"dataverse","full_name":"IQSS/dataverse","private":false,"owner":{"login":"IQSS","id":675237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NTIzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/675237?v=4","gravatar_id":"","url":"https://api.github.com/users/IQSS","html_url":"https://github.com/IQSS","followers_url":"https://api.github.com/users/IQSS/followers","following_url":"https://api.github.com/users/IQSS/following{/other_user}","gists_url":"https://api.github.com/users/IQSS/gists{/gist_id}","starred_url":"https://api.github.com/users/IQSS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IQSS/subscriptions","organizations_url":"https://api.github.com/users/IQSS/orgs","repos_url":"https://api.github.com/users/IQSS/repos","events_url":"https://api.github.com/users/IQSS/events{/privacy}","received_events_url":"https://api.github.com/users/IQSS/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/IQSS/dataverse","description":"Open source research data repository software","fork":false,"url":"https://api.github.com/repos/IQSS/dataverse","forks_url":"https://api.github.com/repos/IQSS/dataverse/forks","keys_url":"https://api.github.com/repos/IQSS/dataverse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IQSS/dataverse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IQSS/dataverse/teams","hooks_url":"https://api.github.com/repos/IQSS/dataverse/hooks","issue_events_url":"https://api.github.com/repos/IQSS/dataverse/issues/events{/number}","events_url":"https://api.github.com/repos/IQSS/dataverse/events","assignees_url":"https://api.github.com/repos/IQSS/dataverse/assignees{/user}","branches_url":"https://api.github.com/repos/IQSS/dataverse/branches{/branch}","tags_url":"https://api.github.com/repos/IQSS/dataverse/tags","blobs_url":"https://api.github.com/repos/IQSS/dataverse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IQSS/dataverse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IQSS/dataverse/git/refs{/sha}","trees_url":"https://api.github.com/repos/IQSS/dataverse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IQSS/dataverse/statuses/{sha}","languages_url":"https://api.github.com/repos/IQSS/dataverse/languages","stargazers_url":"https://api.github.com/repos/IQSS/dataverse/stargazers","contributors_url":"https://api.github.com/repos/IQSS/dataverse/contributors","subscribers_url":"https://api.github.com/repos/IQSS/dataverse/subscribers","subscription_url":"https://api.github.com/repos/IQSS/dataverse/subscription","commits_url":"https://api.github.com/repos/IQSS/dataverse/commits{/sha}","git_commits_url":"https://api.github.com/repos/IQSS/dataverse/git/commits{/sha}","comments_url":"https://api.github.com/repos/IQSS/dataverse/comments{/number}","issue_comment_url":"https://api.github.com/repos/IQSS/dataverse/issues/comments{/number}","contents_url":"https://api.github.com/repos/IQSS/dataverse/contents/{+path}","compare_url":"https://api.github.com/repos/IQSS/dataverse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IQSS/dataverse/merges","archive_url":"https://api.github.com/repos/IQSS/dataverse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IQSS/dataverse/downloads","issues_url":"https://api.github.com/repos/IQSS/dataverse/issues{/number}","pulls_url":"https://api.github.com/repos/IQSS/dataverse/pulls{/number}","milestones_url":"https://api.github.com/repos/IQSS/dataverse/milestones{/number}","notifications_url":"https://api.github.com/repos/IQSS/dataverse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IQSS/dataverse/labels{/name}","releases_url":"https://api.github.com/repos/IQSS/dataverse/releases{/id}","deployments_url":"https://api.github.com/repos/IQSS/dataverse/deployments","created_at":"2013-11-01T18:47:39Z","updated_at":"2018-10-13T14:07:29Z","pushed_at":"2018-10-13T15:57:18Z","git_url":"git://github.com/IQSS/dataverse.git","ssh_url":"git@github.com:IQSS/dataverse.git","clone_url":"https://github.com/IQSS/dataverse.git","svn_url":"https://github.com/IQSS/dataverse","homepage":"http://dataverse.org","size":70709,"stargazers_count":344,"watchers_count":344,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":184,"mirror_url":null,"archived":false,"open_issues_count":848,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":184,"open_issues":848,"watchers":344,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/5184"},"html":{"href":"https://github.com/IQSS/dataverse/pull/5184"},"issue":{"href":"https://api.github.com/repos/IQSS/dataverse/issues/5184"},"comments":{"href":"https://api.github.com/repos/IQSS/dataverse/issues/5184/comments"},"review_comments":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/5184/comments"},"review_comment":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/5184/commits"},"statuses":{"href":"https://api.github.com/repos/IQSS/dataverse/statuses/c74589fbbbedb36d219efb9408d651203405eb30"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"qqmyers"}}