{"action":"created","comment":{"url":"https://api.github.com/repos/TWCable/grabbit/pulls/comments/75145383","id":75145383,"diff_hunk":"@@ -135,6 +139,66 @@ class JcrNodeDecorator {\n         }\n     }\n \n+    private void checkoutNode() {\n+        try {\n+            JcrNodeDecorator decoratedVersionableAncestor = findVersionableAncestor();\n+            if (decoratedVersionableAncestor && !decoratedVersionableAncestor.isCheckedOut()) {\n+                decoratedVersionableAncestor.session.workspace.versionManager.checkout(decoratedVersionableAncestor.path);\n+            }\n+        }\n+        catch (Exception exception) {\n+            log.warn \"Could not checkout node ${this.path}\"\n+        }\n+    }\n+\n+    private JcrNodeDecorator findVersionableAncestor() throws RepositoryException {\n+        if (isVersionable()) {\n+            return this;\n+        }\n+        try {\n+            JcrNodeDecorator parentDecoratedNode = new JcrNodeDecorator(this.parent);\n+            return parentDecoratedNode.findVersionableAncestor();\n+        } catch (ItemNotFoundException e) {\n+            return null;\n+        }\n+    }\n+\n+    @CompileStatic(TypeCheckingMode.SKIP)\n+    private boolean isVersionable() throws RepositoryException {\n+        return mixinNodeTypes.any { it.name in [\"mix:simpleVersionable\", MIX_VERSIONABLE] }\n+    }\n+\n+    /*\n+    * Write proto properties to Jcr Node\n+    * Mixins are added before other properties\n+    */\n+\n+    void writeToJcr(ProtoNodeDecorator decoratedProtoNode, @Nonnull Session session) {","path":"src/main/groovy/com/twcable/grabbit/jcr/JcrNodeDecorator.groovy","position":60,"original_position":60,"commit_id":"5fe017d6929fd6a9887ea0a9b7139defcb732cdb","original_commit_id":"5fe017d6929fd6a9887ea0a9b7139defcb732cdb","user":{"login":"viveksachdeva","id":1879953,"avatar_url":"https://avatars.githubusercontent.com/u/1879953?v=3","gravatar_id":"","url":"https://api.github.com/users/viveksachdeva","html_url":"https://github.com/viveksachdeva","followers_url":"https://api.github.com/users/viveksachdeva/followers","following_url":"https://api.github.com/users/viveksachdeva/following{/other_user}","gists_url":"https://api.github.com/users/viveksachdeva/gists{/gist_id}","starred_url":"https://api.github.com/users/viveksachdeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viveksachdeva/subscriptions","organizations_url":"https://api.github.com/users/viveksachdeva/orgs","repos_url":"https://api.github.com/users/viveksachdeva/repos","events_url":"https://api.github.com/users/viveksachdeva/events{/privacy}","received_events_url":"https://api.github.com/users/viveksachdeva/received_events","type":"User","site_admin":false},"body":"@jbornemann : This method is writing mixin and other properties to the Jcr node... Shouldnt this operation be in one of the two wrapper objects : JcrNodeDecorator or JcrPropertyDecorator","created_at":"2016-08-17T15:26:32Z","updated_at":"2016-08-17T15:26:32Z","html_url":"https://github.com/TWCable/grabbit/pull/143#discussion_r75145383","pull_request_url":"https://api.github.com/repos/TWCable/grabbit/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/comments/75145383"},"html":{"href":"https://github.com/TWCable/grabbit/pull/143#discussion_r75145383"},"pull_request":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/TWCable/grabbit/pulls/143","id":81462485,"html_url":"https://github.com/TWCable/grabbit/pull/143","diff_url":"https://github.com/TWCable/grabbit/pull/143.diff","patch_url":"https://github.com/TWCable/grabbit/pull/143.patch","issue_url":"https://api.github.com/repos/TWCable/grabbit/issues/143","number":143,"state":"open","locked":false,"title":"issue-3-handle-mixin-property","user":{"login":"viveksachdeva","id":1879953,"avatar_url":"https://avatars.githubusercontent.com/u/1879953?v=3","gravatar_id":"","url":"https://api.github.com/users/viveksachdeva","html_url":"https://github.com/viveksachdeva","followers_url":"https://api.github.com/users/viveksachdeva/followers","following_url":"https://api.github.com/users/viveksachdeva/following{/other_user}","gists_url":"https://api.github.com/users/viveksachdeva/gists{/gist_id}","starred_url":"https://api.github.com/users/viveksachdeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viveksachdeva/subscriptions","organizations_url":"https://api.github.com/users/viveksachdeva/orgs","repos_url":"https://api.github.com/users/viveksachdeva/repos","events_url":"https://api.github.com/users/viveksachdeva/events{/privacy}","received_events_url":"https://api.github.com/users/viveksachdeva/received_events","type":"User","site_admin":false},"body":"Issue : https://github.com/TWCable/grabbit/issues/3\r\n\r\nWIP","created_at":"2016-08-16T12:26:30Z","updated_at":"2016-08-17T15:26:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fab9ee5d3bdb6ab5ee4f1308b4b4e8bd5256db4e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TWCable/grabbit/pulls/143/commits","review_comments_url":"https://api.github.com/repos/TWCable/grabbit/pulls/143/comments","review_comment_url":"https://api.github.com/repos/TWCable/grabbit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TWCable/grabbit/issues/143/comments","statuses_url":"https://api.github.com/repos/TWCable/grabbit/statuses/5fe017d6929fd6a9887ea0a9b7139defcb732cdb","head":{"label":"TWCable:issue-3-handle-mixin-property","ref":"issue-3-handle-mixin-property","sha":"5fe017d6929fd6a9887ea0a9b7139defcb732cdb","user":{"login":"TWCable","id":10778149,"avatar_url":"https://avatars.githubusercontent.com/u/10778149?v=3","gravatar_id":"","url":"https://api.github.com/users/TWCable","html_url":"https://github.com/TWCable","followers_url":"https://api.github.com/users/TWCable/followers","following_url":"https://api.github.com/users/TWCable/following{/other_user}","gists_url":"https://api.github.com/users/TWCable/gists{/gist_id}","starred_url":"https://api.github.com/users/TWCable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TWCable/subscriptions","organizations_url":"https://api.github.com/users/TWCable/orgs","repos_url":"https://api.github.com/users/TWCable/repos","events_url":"https://api.github.com/users/TWCable/events{/privacy}","received_events_url":"https://api.github.com/users/TWCable/received_events","type":"Organization","site_admin":false},"repo":{"id":31395930,"name":"grabbit","full_name":"TWCable/grabbit","owner":{"login":"TWCable","id":10778149,"avatar_url":"https://avatars.githubusercontent.com/u/10778149?v=3","gravatar_id":"","url":"https://api.github.com/users/TWCable","html_url":"https://github.com/TWCable","followers_url":"https://api.github.com/users/TWCable/followers","following_url":"https://api.github.com/users/TWCable/following{/other_user}","gists_url":"https://api.github.com/users/TWCable/gists{/gist_id}","starred_url":"https://api.github.com/users/TWCable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TWCable/subscriptions","organizations_url":"https://api.github.com/users/TWCable/orgs","repos_url":"https://api.github.com/users/TWCable/repos","events_url":"https://api.github.com/users/TWCable/events{/privacy}","received_events_url":"https://api.github.com/users/TWCable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TWCable/grabbit","description":"Grabbit - Fast Content Sync tool for AEM/CQ","fork":false,"url":"https://api.github.com/repos/TWCable/grabbit","forks_url":"https://api.github.com/repos/TWCable/grabbit/forks","keys_url":"https://api.github.com/repos/TWCable/grabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TWCable/grabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TWCable/grabbit/teams","hooks_url":"https://api.github.com/repos/TWCable/grabbit/hooks","issue_events_url":"https://api.github.com/repos/TWCable/grabbit/issues/events{/number}","events_url":"https://api.github.com/repos/TWCable/grabbit/events","assignees_url":"https://api.github.com/repos/TWCable/grabbit/assignees{/user}","branches_url":"https://api.github.com/repos/TWCable/grabbit/branches{/branch}","tags_url":"https://api.github.com/repos/TWCable/grabbit/tags","blobs_url":"https://api.github.com/repos/TWCable/grabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TWCable/grabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TWCable/grabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/TWCable/grabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TWCable/grabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/TWCable/grabbit/languages","stargazers_url":"https://api.github.com/repos/TWCable/grabbit/stargazers","contributors_url":"https://api.github.com/repos/TWCable/grabbit/contributors","subscribers_url":"https://api.github.com/repos/TWCable/grabbit/subscribers","subscription_url":"https://api.github.com/repos/TWCable/grabbit/subscription","commits_url":"https://api.github.com/repos/TWCable/grabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/TWCable/grabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/TWCable/grabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/TWCable/grabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/TWCable/grabbit/contents/{+path}","compare_url":"https://api.github.com/repos/TWCable/grabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TWCable/grabbit/merges","archive_url":"https://api.github.com/repos/TWCable/grabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TWCable/grabbit/downloads","issues_url":"https://api.github.com/repos/TWCable/grabbit/issues{/number}","pulls_url":"https://api.github.com/repos/TWCable/grabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/TWCable/grabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/TWCable/grabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TWCable/grabbit/labels{/name}","releases_url":"https://api.github.com/repos/TWCable/grabbit/releases{/id}","deployments_url":"https://api.github.com/repos/TWCable/grabbit/deployments","created_at":"2015-02-27T00:24:35Z","updated_at":"2016-08-12T17:06:28Z","pushed_at":"2016-08-17T10:41:27Z","git_url":"git://github.com/TWCable/grabbit.git","ssh_url":"git@github.com:TWCable/grabbit.git","clone_url":"https://github.com/TWCable/grabbit.git","svn_url":"https://github.com/TWCable/grabbit","homepage":"","size":1390,"stargazers_count":55,"watchers_count":55,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":47,"forks":23,"open_issues":47,"watchers":55,"default_branch":"master"}},"base":{"label":"TWCable:master","ref":"master","sha":"4afa2bfb8a0453c973947f2d760f8594829fff31","user":{"login":"TWCable","id":10778149,"avatar_url":"https://avatars.githubusercontent.com/u/10778149?v=3","gravatar_id":"","url":"https://api.github.com/users/TWCable","html_url":"https://github.com/TWCable","followers_url":"https://api.github.com/users/TWCable/followers","following_url":"https://api.github.com/users/TWCable/following{/other_user}","gists_url":"https://api.github.com/users/TWCable/gists{/gist_id}","starred_url":"https://api.github.com/users/TWCable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TWCable/subscriptions","organizations_url":"https://api.github.com/users/TWCable/orgs","repos_url":"https://api.github.com/users/TWCable/repos","events_url":"https://api.github.com/users/TWCable/events{/privacy}","received_events_url":"https://api.github.com/users/TWCable/received_events","type":"Organization","site_admin":false},"repo":{"id":31395930,"name":"grabbit","full_name":"TWCable/grabbit","owner":{"login":"TWCable","id":10778149,"avatar_url":"https://avatars.githubusercontent.com/u/10778149?v=3","gravatar_id":"","url":"https://api.github.com/users/TWCable","html_url":"https://github.com/TWCable","followers_url":"https://api.github.com/users/TWCable/followers","following_url":"https://api.github.com/users/TWCable/following{/other_user}","gists_url":"https://api.github.com/users/TWCable/gists{/gist_id}","starred_url":"https://api.github.com/users/TWCable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TWCable/subscriptions","organizations_url":"https://api.github.com/users/TWCable/orgs","repos_url":"https://api.github.com/users/TWCable/repos","events_url":"https://api.github.com/users/TWCable/events{/privacy}","received_events_url":"https://api.github.com/users/TWCable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TWCable/grabbit","description":"Grabbit - Fast Content Sync tool for AEM/CQ","fork":false,"url":"https://api.github.com/repos/TWCable/grabbit","forks_url":"https://api.github.com/repos/TWCable/grabbit/forks","keys_url":"https://api.github.com/repos/TWCable/grabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TWCable/grabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TWCable/grabbit/teams","hooks_url":"https://api.github.com/repos/TWCable/grabbit/hooks","issue_events_url":"https://api.github.com/repos/TWCable/grabbit/issues/events{/number}","events_url":"https://api.github.com/repos/TWCable/grabbit/events","assignees_url":"https://api.github.com/repos/TWCable/grabbit/assignees{/user}","branches_url":"https://api.github.com/repos/TWCable/grabbit/branches{/branch}","tags_url":"https://api.github.com/repos/TWCable/grabbit/tags","blobs_url":"https://api.github.com/repos/TWCable/grabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TWCable/grabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TWCable/grabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/TWCable/grabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TWCable/grabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/TWCable/grabbit/languages","stargazers_url":"https://api.github.com/repos/TWCable/grabbit/stargazers","contributors_url":"https://api.github.com/repos/TWCable/grabbit/contributors","subscribers_url":"https://api.github.com/repos/TWCable/grabbit/subscribers","subscription_url":"https://api.github.com/repos/TWCable/grabbit/subscription","commits_url":"https://api.github.com/repos/TWCable/grabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/TWCable/grabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/TWCable/grabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/TWCable/grabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/TWCable/grabbit/contents/{+path}","compare_url":"https://api.github.com/repos/TWCable/grabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TWCable/grabbit/merges","archive_url":"https://api.github.com/repos/TWCable/grabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TWCable/grabbit/downloads","issues_url":"https://api.github.com/repos/TWCable/grabbit/issues{/number}","pulls_url":"https://api.github.com/repos/TWCable/grabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/TWCable/grabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/TWCable/grabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TWCable/grabbit/labels{/name}","releases_url":"https://api.github.com/repos/TWCable/grabbit/releases{/id}","deployments_url":"https://api.github.com/repos/TWCable/grabbit/deployments","created_at":"2015-02-27T00:24:35Z","updated_at":"2016-08-12T17:06:28Z","pushed_at":"2016-08-17T10:41:27Z","git_url":"git://github.com/TWCable/grabbit.git","ssh_url":"git@github.com:TWCable/grabbit.git","clone_url":"https://github.com/TWCable/grabbit.git","svn_url":"https://github.com/TWCable/grabbit","homepage":"","size":1390,"stargazers_count":55,"watchers_count":55,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":47,"forks":23,"open_issues":47,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/143"},"html":{"href":"https://github.com/TWCable/grabbit/pull/143"},"issue":{"href":"https://api.github.com/repos/TWCable/grabbit/issues/143"},"comments":{"href":"https://api.github.com/repos/TWCable/grabbit/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TWCable/grabbit/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/TWCable/grabbit/statuses/5fe017d6929fd6a9887ea0a9b7139defcb732cdb"}}}}
{"actor":{"display_login":"viveksachdeva"}}