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/01/16 09:37:00 UTC

[jira] [Commented] (SLING-6462) Filter Isolated jcr:content nodes (by includes) are not deployed

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

Robert Munteanu commented on SLING-6462:
----------------------------------------

[~schaefa] - I tried to reproduce this but I can't . I've attached a full project which AFAIU is exactly what you're trying, and changes to {{/etc/designs/base/jcr:content}} are sent to the server. Can you upload a similar project that reproduces your problem? I'm trying with the latest IDE tooling from git if that matters.

> Filter Isolated jcr:content nodes (by includes) are not deployed
> ----------------------------------------------------------------
>
>                 Key: SLING-6462
>                 URL: https://issues.apache.org/jira/browse/SLING-6462
>             Project: Sling
>          Issue Type: Bug
>          Components: Tooling
>         Environment: MacOS Sierra, JDK 1.8, latest Sling
>            Reporter: Andreas Schaefer
>            Priority: Major
>             Fix For: Sling Eclipse IDE 1.2.0
>
>         Attachments: SLING-6462.zip
>
>
> If a jcr:content node is included by a filter.xml but not its parent then the deployment of the corresponding .content.xml fails and with it its parent node becomes a Sling Folder and the jcr:content node is missing.
> Assuming we have the following on our file system:
> - A folder /etc/designs/base
> - A file .content.xml in that folder:
> <?xml version="1.0" encoding="UTF-8"?>
> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
>     jcr:primaryType="cq:Page">
>     <jcr:content
>         cq:doctype="html_5"
>         cq:template="/libs/wcm/core/templates/designpage"
>         jcr:primaryType="cq:PageContent"
>         jcr:title="AEM Base Components"
>         sling:resourceType="wcm/core/components/designer"/>
> </jcr:root>
> A filter.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <workspaceFilter version="1.0">
>     <filter root="/apps/base"/>
>     <filter root="/etc/clientlibs/base"/>
>     <filter root="/etc/designs/base">
>         <include pattern="/etc/designs/base/jcr:content"/>
>     </filter>
> <!--
>     <filter root="/etc/designs/base"/>
> -->
> </workspaceFilter>
> Taking out the include filter and replace it with the comment out one below makes the deployment work.
> Some preliminary investigations revealed that the ResourceChangeCommandFactory.getFilterResult() returns
> PREREQUISITE instead of ALLOW as the path that is tested is /etc/designs/base instead of /etc/designs/base/jcr:content.
> Locally I added that code after the filter.filter() call and before the return:
> //AS NOTE: If we have a jcr:content and it is limited by an include then it might fail
> //AS NOTE: (DENY) or worse coming back as PREREQUISITE making an undefined node. Here it
> //AS NOTE: checks if the resource proxy has a child of jcr:content and if so check with
> //AS NOTE: that path.
> if(filterResult != FilterResult.ALLOW && resourceProxy != null) {
>     List<ResourceProxy> resourceProxyChildren = resourceProxy.getChildren();
>     if(resourceProxyChildren.size() == 1) {
>         ResourceProxy child = resourceProxyChildren.get(0);
>         if(child.getPath().endsWith("/jcr:content")) {
>             FilterResult temp = filter.filter(child.getPath());
>             if(temp == FilterResult.ALLOW) {
>                 return FilterResult.ALLOW;
>             }
>         }
>     }
> }



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