[ https://issues.apache.org/jira/browse/JCRVLT-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16515363#comment-16515363 ]
Marius Petria edited comment on JCRVLT-305 at 6/18/18 5:43 AM: --------------------------------------------------------------- [~tripod] you are right, using the filter.add(nodes, props) exports only the node and its properties but there are 2 problems with that: 1. filter.add(nodes) should behave as filter.add(nodes, props) with props having a empty list of entries (see test filterRelativePropertiesSingleSet_NotDeep_no_propertyFilter_addNodes in [1]). Maybe the code should look like: {code:java} public void add(PathFilterSet set) { nodesFilterSets.add(set); propsFilterSets.add(new PathFilterSet(set.getRoot())); } {code} 2. The example with filter.add(nodes, props) produces an incomplete filter.xml file - no include clause (see test filterRelativePropertiesSingleSet_NotDeep_no_propertyFilter_sourceCheck in [1]). This is because the generateSource iterates only over property filters when the xml is generated. {code:java} <?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/tmp"/> </workspaceFilter> {code} [1] [https://github.com/apache/jackrabbit-filevault/pull/28/files#diff-427da2ed13e27d4de628819d62b0d5a1R267] was (Author: mpetria): [~tripod] you are right, using the filter.add(nodes, props) exports only the node and its properties but there are 2 problems with that: 1. filter.add(nodes) should behave as filter.add(nodes, props) with props having a empty list of entries (see test filterRelativePropertiesSingleSet_NotDeep_no_propertyFilter_addNodes in [1]). Maybe the code should look like: {code:java} public void add(PathFilterSet set) { nodesFilterSets.add(set); propsFilterSets.add(new PathFilterSet(set.getRoot())); } {code} 2. The example with filter.add(nodes, props) produces an incomplete filter.xml file (see test filterRelativePropertiesSingleSet_NotDeep_no_propertyFilter_sourceCheck in [1]). This is because the generateSource iterates only over property filters when the xml is generated. {code:java} <?xml version="1.0" encoding="UTF-8"?> <workspaceFilter version="1.0"> <filter root="/tmp"/> </workspaceFilter> {code} [1] [https://github.com/apache/jackrabbit-filevault/pull/28/files#diff-427da2ed13e27d4de628819d62b0d5a1R267] > DefaultWorkspaceFilter.add(nodeFilters) does not include properties > ------------------------------------------------------------------- > > Key: JCRVLT-305 > URL: https://issues.apache.org/jira/browse/JCRVLT-305 > Project: Jackrabbit FileVault > Issue Type: Bug > Reporter: Marius Petria > Priority: Major > > The add method should only add the filter set to nodeFilterSets, otherwise an > include pattern for nodes will reject all properties. > {code} > public void add(PathFilterSet set) { > nodesFilterSets.add(set); > propsFilterSets.add(set); > } > {code} > [1] > https://github.com/apache/jackrabbit-filevault/blob/9eb53d36adfb7695a44075c72ca7ff0cedafabcc/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/config/DefaultWorkspaceFilter.java#L102 -- This message was sent by Atlassian JIRA (v7.6.3#76005)