Issues
Predicate for pathfield
Description
Attachments
Details
Details
Assignee
Reporter

Components
Fix versions
Affects versions
Priority
Activity
Stefan SeifertNovember 18, 2019 at 11:03 AM
i think you have to make sure inside your own filter to not include nodes like jcr:content - as it is the case for the default "hierarchyNotFile". something like
node.isNodeType(JcrConstants.NT_HIERARCHYNODE) and not node.isNodeType(JcrConstants.NT_FILE)

Jürgen BäckmannNovember 12, 2019 at 9:12 AM
The predicate is definied as follows
@Component(
service = Predicate.class,
property = {"predicate.name=namedpredicate", "metatype=false"})
public class FraFormsReferenzPredicate extends AbstractResourcePredicate{
@Override public boolean evaluate(Resource resource) {
…..}

Jürgen BäckmannNovember 12, 2019 at 8:58 AM
Maybe there is a little issue.
If I use the filter predicate together with:
wcm-io/handler/url/components/granite/form/siteRootPathField
the resource parameter of the evalute(Resource resource) method has a Node (which seems to be correct)
If I use the filter with
wcm-io/wcm/ui/granite/components/form/pathfield
the resource parameter of the evaluate(Resource resource) method has a Content Node (ends with /jcr:content)
I then have a problem with an empty column:
without predicate filter:
So, it seems that even the children of the jcr:content Node are called into the evaluate method….
Hope you can reproduce this.

Jürgen BäckmannNovember 11, 2019 at 1:19 PM
Works great for me. Thank you…
Stefan SeifertNovember 4, 2019 at 9:38 PM
i've implemented a solution that should support all "Resource"-based predicates registered in OSGi (an not only the 4 default ones) - you can give it a try with version 1.4.1-SNAPSHOT
Is there a possiblity to enhance the Pathfield functionality for resourceType "wcm-io/wcm/ui/granite/components/form/pathfield"?
It would be great to have the possibility to have a custom filter with a predicate. There is this possibiltity for the pathbrowser component, but the pathbrowser shows no preview images.