[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-07-15 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


I updated the javadoc accordingly in 
https://github.com/apache/sling-org-apache-sling-api/commit/9e31b3074e6ee6a7ca665e8c34f4909a9e2a26b4
 and added links to the ResourceStream/ResourceFilterStream classes.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-07-12 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


Actually after having a second thought I am not sure if it worth to have this 
improved visitor given the fact that 
{{ResourceStream}}/{{ResourceFilterStream}} provide all that functionality 
already with a modern {{Stream}} interface. I would rather just mention this in 
in the {{AbstractResourceVisitor}} javadoc and refer to those classes.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-07-11 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


[~jebailey] Thanks, makes sense. I will even add a link to your more modern 
stream based way of traversal within the javadoc.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-07-11 Thread Jason E Bailey (JIRA)


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

Jason E Bailey commented on SLING-8271:
---

Before pulling this, I think this is a bit limited in scope and could be 
improved with  a Predicate object to determine the ability to descend. In a 
similar way to 
[https://github.com/apache/sling-org-apache-sling-resource-filter/blob/master/src/main/java/org/apache/sling/resource/filter/ResourceStream.java]

You could just extend it to accept(visitor, predicate) and that would allow you 
to define a predicate inline in your source

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-07-11 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


I provided a new PR in 
https://github.com/apache/sling-org-apache-sling-api/pull/13/files.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-20 Thread Robert Munteanu (JIRA)


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

Robert Munteanu commented on SLING-8271:


{quote}I don't think we need to deprecate the existing one. You could just 
create an AbstractStoppableResourceVisitor (or maybe different name) next to 
it{quote}

+1

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-20 Thread Carsten Ziegeler (JIRA)


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

Carsten Ziegeler commented on SLING-8271:
-

I don't think we need to deprecate the existing one. You could just create an 
AbstractStoppableResourceVisitor (or maybe different name) next to it

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-20 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


After having a second thought I think it would be good to allow to stop 
traversal at all (not only stop visiting the child resources). This will be 
hard though to implement in a backwards compatible fashion, so I rather would 
deprecate the old AbstractResourceVisitor and come up with a new class which 
allows to influence the traversal behaviour. I therefore reverted 
https://github.com/apache/sling-org-apache-sling-api/commit/36dcee948a3a92fc402bc5d3fab6ec4c2b8038a5
 in 
https://github.com/apache/sling-org-apache-sling-api/commit/6c82bfa4a8a3344f6cde99a29c2a3097d243d8e5.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-12 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


In most use cases I have in mind the same logic is needed for visit and 
shouldVisitChildren. If we separate those into two methods it is more effort 
for the implementation of those two to share common code. Just think about the 
use case to list all resources of a specific type. You often don’t want to 
traverse the children once you reached such a resource.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-12 Thread Julian Sedding (JIRA)


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

Julian Sedding commented on SLING-8271:
---

I see this is already committed. But not yet released.

Maybe a method {{boolean shouldVisitChildren(Resource)}} or even {{boolean 
skipChildren(Resource)}} could help avoid long method names and more 
importantly conflating the visiting and traversing aspects.

Something along those lines:
{code:java}
public void accept(final Resource res) {
if (res != null) {
visit(res);
if (shouldVisitChildren(res)) { // default impl returns true
traverseChildren(res.listChildren());
}
}
}
{code}

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-12 Thread Robert Munteanu (JIRA)


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

Robert Munteanu commented on SLING-8271:


Sure, works for me.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-12 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


[~rombert] {{maybeVisit}} sounds like you can prevent the {{visit}} method from 
being called on the given resource. This is not true. You can only prevent 
descending into the child resources. In this case the long method name is IMHO 
better because any shorter version is not self-explanatory (and nowadays 
everyone uses an IDE with code completion, so no one should type that manually)

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-11 Thread Robert Munteanu (JIRA)


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

Robert Munteanu commented on SLING-8271:


How about {{maybeVisit}} or {{checkedVisit}}?

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-11 Thread Carsten Ziegeler (JIRA)


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

Carsten Ziegeler commented on SLING-8271:
-

[~kwin] Proposal looks good to me, the method name is a little bit long, I 
can't think of any good name either, continueVisit came to my mind, not sure if 
its better though

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-11 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


My proposal is in 
https://github.com/apache/sling-org-apache-sling-api/pull/12/files.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-8271) Improve AbstractResourceVisitor to allow to stop visiting child resources

2019-02-11 Thread Konrad Windszus (JIRA)


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

Konrad Windszus commented on SLING-8271:


[~cziegeler] Since you added the code originally WDYT about this proposal? Do 
you have any good naming suggestion for that additional {{visit}} method? Java 
unfortunately doesn't allow us to name it {{visit}} as well.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -
>
> Key: SLING-8271
> URL: https://issues.apache.org/jira/browse/SLING-8271
> Project: Sling
>  Issue Type: Improvement
>  Components: API
>Affects Versions: API 2.20.0
>Reporter: Konrad Windszus
>Priority: Major
> Fix For: API 2.20.2
>
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into subresources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)