I am noticing that the predicate defined in the Touch UI dialog in the pathbrowser widget is not picking up the predicate.
<testProperty
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/pathbrowser"
fieldDescription="Select from a specific list"
fieldLabel="Test Property"
name="./testResult"
predicate="testpredicate"
rootPath="/content"/>
In the core project I have the predicate class (just showing the relevant code):
import com.day.cq.commons.predicate.AbstractNodePredicate;
import org.apache.commons.collections.Predicate;
.....
@Service(value = Predicate.class)
@Component(metatype = false)
@Properties({
@Property(label = "Predicate Name", name = "predicate.name", value = "testpredicate", propertyPrivate = true) })
public class TestThePredicate extends AbstractNodePredicate {
.....
@Override
public final boolean evaluate(final Node node) throws RepositoryException {
System.out.println("Entro a evaluate(Node)" + node);
LOGGER.error("********* TestThePredicate: " + "In method evaluate(Node)" + node.getPath);
}
}
The problem I am facing is that AEM does not pick up the predicate class. I must be missing something somewhere.
In the Felix console the jar is there and also the predicate class is "state satisfied".
Is there by any chance some sort of configuration I need to add?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
It's always embarrassing when you not only answer your own question, but have to admit you missed something. I would love to blame this on coffee or beer, but hey, it's pure sloppiness...
The solution is that in the class signature you need to implement the Predicate interface:
public class TestThePredicate extends AbstractNodePredicate implements Predicate {
After adding the missing part, the predicate works!
It's always embarrassing when you not only answer your own question, but have to admit you missed something. I would love to blame this on coffee or beer, but hey, it's pure sloppiness...
The solution is that in the class signature you need to implement the Predicate interface:
public class TestThePredicate extends AbstractNodePredicate implements Predicate {
After adding the missing part, the predicate works!
Awesome work here - if you send me a package of this - we would love to add this to a community HELPX article.
Views
Replies
Total Likes
Hi,
I think com.day.cq.commons.predicate.AbstractNodePredicate is deprecated in the AEM 6.4. Do you now another alternative for predicate?
Views
Replies
Total Likes
Views
Likes
Replies