I have a rather complicated query that fails on a search for the property "hideInNav." I'm trying to get all pages where this is not true, but I can't figure out the operation that accomplishes this.
I've tried the following:
2_property=hideInNav
2_property.operation=like
2_property.1_value=%
2_property.2_value=false
and
2_property=hideInNav
2_property.operation=unequals
2_property.value=true
Neither returns the list of pages I'm looking for. If the hideInNav property hasn't been set, it seems that there's no ability query on it.
Solved! Go to Solution.
You are trying to base a search on the hideInNav prop. However - basing an AEM Query on a prop that may or may not exist may not work if the prop is not defined.
The best thing to so is to get a result set (maybe query pages - based on a path) and then check to see if the prop is there. You can invoke this method to detemine if a property exists on a node:
http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#hasProperty(java.lang.String)
Views
Replies
Total Likes
You are trying to base a search on the hideInNav prop. However - basing an AEM Query on a prop that may or may not exist may not work if the prop is not defined.
The best thing to so is to get a result set (maybe query pages - based on a path) and then check to see if the prop is there. You can invoke this method to detemine if a property exists on a node:
http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#hasProperty(java.lang.String)
Views
Replies
Total Likes
You can use the 'PropertyExistence' check using the JQOM query. refer [1] for the same. we are also releasing an article on JQOM query next week
On a whim I tried the following, which seems to do the trick:
map.put("group.p.or", "true"); map.put("group.1_property", "hideInNav"); map.put("group.1_property.operation","like"); map.put("group.1_property.value","false"); map.put("group.2_property", "hideInNav"); map.put("group.2_property.operation","not");
that looks good - I will ask the AEM doc team to add this to the documentation so it helps AEM users.
Views
Replies
Total Likes
Views
Likes
Replies