Expand my Community achievements bar.

SOLVED

Custom Search Form - Options Predicate with JSON Source Fails - AEM 6.2

Avatar

Level 3

Customizing the "Assets Admin Search Rail" search form.

Adding a new options predicate with a "JSON Path" source results in a filter that doesn't work.

Specifically, add an "Options Predicate" and configure the following settings:

  • Field Label - whatever
  • JSON Path - Path to json object in repo (eg. /apps/appname/rights.txt)  which as the following content:

// Rights Management

{

"options": [ { "value": "royalty_free", "text": "Royalty Free" }, { "value": "rights_managed", "text": "Rights Managed" }, { "value": "restricted", "text": "Restricted" } ] }

 

  • Property Name - /jcr:content/metadata/client/usage_rights

This will result in a filter showing up with the correct options based on the JSON.  However, selecting them has not impact on the filter and the selected options does NOT show up in the search bar above.

 

Alternatively, if you create a node structure for the options instead it does work as desired.

Add a new options predicate to the search form. However instead of setting the JSON Path, set the Option Path parameter to point to a node containing the appropriate options.  In this case the selected options in the filter DO impact the results and the selections do show in the search bar at the top.

I'd like to drive options predicates from JSON.  Why doesn't this work?

1 Accepted Solution

Avatar

Correct answer by
Employee

Review Attached exercise doc. Should be helpful.

-Gaurav

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

Review Attached exercise doc. Should be helpful.

-Gaurav

Avatar

Level 4

To save anyone the trouble of downloading the word doc above, it does not provide any help to address the original question.  Generic training doc that points to a non-existent JSON (at least in 6.1).

Avatar

Employee

is this query still open or if you are able to find solution