You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (JIRA)" <ji...@apache.org> on 2018/08/17 15:55:00 UTC

[jira] [Comment Edited] (SLING-7593) ResourceTraversor doesn't support ResourceDecorator pattern

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

Robert Munteanu edited comment on SLING-7593 at 8/17/18 3:54 PM:
-----------------------------------------------------------------

[~joana] - I unfortunately had to revert the changes to the API bundle ([sling-org-apache-sling-api commit 88b2222|https://github.com/apache/sling-org-apache-sling-api/commit/88b2222]
) as they caused a regression - see SLING-7833 . I can't reopen this bug since it was already closed, so please open a new bug which contains an updated fix.

To minimize the changes of breakage, please run the Sling ITs with the updated bundles.


was (Author: rombert):
[~joana] - I unfortunately had to revert the changes to the API bundle as they caused a regression - see SLING-7833 . I can't reopen this bug since it was already closed, so please open a new bug which contains an updated fix.

To minimize the changes of breakage, please run the Sling ITs with the updated bundles.

> ResourceTraversor doesn't support ResourceDecorator pattern
> -----------------------------------------------------------
>
>                 Key: SLING-7593
>                 URL: https://issues.apache.org/jira/browse/SLING-7593
>             Project: Sling
>          Issue Type: Bug
>          Components: API, Servlets
>            Reporter: Joanna Jasnowska
>            Assignee: Carsten Ziegeler
>            Priority: Blocker
>             Fix For: API 2.18.2, Servlets Get 2.1.32
>
>         Attachments: calling_deprecated_ResourceUtil_listChildren(resource)_replaced_with_resource_listChildren.patch, listChildren_method_fixed.patch
>
>
> In my current project, we are using ResourceDecorator pattern. In one case we would like to decorate a resource with additional children. Unfortunately ResourceTraversor object doesn't accept information about children from ResourceDecorator. It is caused by usage of ResourceUtil.listChildren(resource) method (inside ResourceTraversor class) which is deprecated. Under the hood the method invokes resource.getResourceResolver.listChildren(resource) method which reads data directly from repo. In result our additional children are not returned. Moreover, we don't have a place to add them to the list returned from resourceResolver.listChildren method.
> When we change the approach and we invoke resource.listChildren() method instead of ResourceUtil.listChildren(resource) then we get solution which is compatible with ResourceDecorator pattern and on the other hand when resources are not decorated then no changes should be observed.
> Additionally I have one additional question about org.apache.sling.servlets.get bundle imported packages. Why do we have the following dependency org.apache.sling.api.resource.external;version="[1.0,2)" in the latest released version? On the other hand the same bundle has dependency on org.apache.sling.api.resource; version="[2.10,3)". Is it expected? If yes then how to provide org.apache.sling.api.resource.external;version="[1.0,2)" on my environment, because now I don't have it.
> In the attachment section, you could find patch containing fix for the described scenario.



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