[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-08-21 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135104#comment-16135104
 ] 

Timothee Maret commented on SLING-7066:
---

[~bdelacretaz] Thanks for the spec. I think that one behaviour needs to be 
clarified.
How are mixins merged between the default mixins and those specific to a given 
path element ?

I think we could either

1. Merge the two sets of mixins ; or
2. Use the most specific set of mixins (path specific > default > empty)

wdyt ?

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-08-21 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135112#comment-16135112
 ] 

Bertrand Delacretaz commented on SLING-7066:


Maybe it's better to disallow mixins in the bracketed statement that defines 
defaults?

So this would be invalid for example:

{code}
create path (sling:Folder mixin mix:A) /var/foo
{code}

And a valid statement would be 
{code}
create path (sling:Folder) /var/foo(mixin mix:A)
{code}

I don't think setting the same mixin on each level of a path is a common use 
case, and if that's really needed that remains possible.

WDYT?


> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-08-21 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135116#comment-16135116
 ] 

Timothee Maret commented on SLING-7066:
---

Thanks [~bdelacretaz]! Fine with me, this way we could still add default mixin 
later if it becomes a strong requirement. 

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-09-14 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16166618#comment-16166618
 ] 

Timothee Maret commented on SLING-7066:
---

[~bdelacretaz] I have implemented the mixins support in 
https://github.com/tmaret/sling/commit/498df4e60b408555d0684fdf911aeba6273c0f3c

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-09-15 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167529#comment-16167529
 ] 

Timothee Maret commented on SLING-7066:
---

Commit at http://svn.apache.org/r1808431

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-09-15 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167545#comment-16167545
 ] 

Timothee Maret commented on SLING-7066:
---

Added example in the documentation at http://svn.apache.org/r1808435

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-09-19 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171728#comment-16171728
 ] 

Bertrand Delacretaz commented on SLING-7066:


Your changes look good to me, thanks!

It might be good to add tests to {{ParsingErrorsTest}} for invalid statements 
like (I suppose) {{create path (sling:Folder mixin mix:A) /var/foo}}

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
> Fix For: Repoinit Parser 1.2.0, Repoinit JCR 1.2.0
>
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7066) Support mixins in repoinit "create path" statements

2017-09-19 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171777#comment-16171777
 ] 

Timothee Maret commented on SLING-7066:
---

Thanks [~bdelacretaz]! I have commit tests for invalid statements in 
http://svn.apache.org/r1808883.

> Support mixins in repoinit "create path" statements
> ---
>
> Key: SLING-7066
> URL: https://issues.apache.org/jira/browse/SLING-7066
> Project: Sling
>  Issue Type: New Feature
>  Components: Repoinit
>Reporter: Bertrand Delacretaz
>Assignee: Timothee Maret
>Priority: Minor
> Fix For: Repoinit Parser 1.2.0, Repoinit JCR 1.2.0
>
>
> The repoinit "create path" statement currently supports nodetypes but no 
> mixins, we should add support for them.
> The current create path syntax is like
> {code}
> create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder
> create path /one/two/three
> create path /three/four(nt:folk)/five(nt:jazz)/six
> {code}
> Where the first bracketed statement, before the path, is the default nodetype 
> for all subpaths, and each subpath can have a specific nodetype.
> To add mixin support I suggest the syntax of these examples for these 
> bracketed statements:
> {code}
> (sling:Folder mixin mix:A, mix:B)
> (nt:unstructured mixin mix:C)
> (mixin mix:A)
> (mixin mix:A, mix:B)
> {code}
> The last two forms without a nodeteype meaning "set mixins only but keep the 
> default nodetype", which in this example
> {code}
> create path (sling:Folder) /var/foo(mixin mix:B)
> {code}
> means /var/foo is of type sling:Folder with mixin mix:B
> whereas in this example
> {code}
> create /var/bar(mixin mix:C)
> {code}
> /var/bar uses the default type defined by /var's type, with mix:C added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)