Expand my Community achievements bar.

SOLVED

AEM 6.5 - Querying against Synthetic resources

Avatar

Adobe Champion

Hi everyone,

 

We have the following scenario in place:

  • We want to create a MyItems listing page
  • Every MyItem consists of a page containing (among others)
    • MyItem Banner component
    • MyItem Config component
  • In the listing page, we need to query against and extract facets from
    • MyItem Banner component props
    • MyItem Config component props
      • Some prop values are not stored directly but (when the MyItem page is rendered) are retrieved on-the-fly from an external integration

Questions:

  • Is it possible to have a "unified" query to use in the listing page, considering we have different sources of information for each listable element?
  • I was thinking of leveraging Synthetic resources (e.g. create MyItemSyntehticResource with all required props and then query against these)
  • In previous versions maybe that could also be possible via custom ResourceProvider implementation
  • So far I am unsure how to go about it - or if it's at all possible

 

Any ideas?

 

Kind regards

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @kimonp,

 

For the use-case that you have mentioned, you can do the below steps

  • Let the page load - with all the pros in the required components
  • Once the load is completed, make an ajax call to the servlet and send the page path
  • In the servlet, using page path, fetch the page resource and then the component eventually - with the values already available
  • Then use the query to show the results

Note: This might impact the query results if the page load is slow.

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @kimonp,

 

For the use-case that you have mentioned, you can do the below steps

  • Let the page load - with all the pros in the required components
  • Once the load is completed, make an ajax call to the servlet and send the page path
  • In the servlet, using page path, fetch the page resource and then the component eventually - with the values already available
  • Then use the query to show the results

Note: This might impact the query results if the page load is slow.

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Adobe Champion

Hi @Kiran_Vedantam ,

 

Thanks for your reply, but I think your solution applies to the MyItem details rendering. I am talking about having a listing component where all MyItems are listed and can extract facets, filter against them, etc.

Avatar

Community Advisor

Hi @kimonp,

 

yes, you can do it. Please try this.

  • Create all my items pages under a root page
  • Now in the MyItems listing page, on page load, write a servlet to trigger the resource type
  • Pass the root page path to the servlet in the request parameters
  • In the servlet, iterate over the pages and send the JSON response to the Front end with banner component and config component details
  • Now in FE you can play around with the received JSON values for search and other stuff

 

Hope this helps.

 

Thanks,

Kiran Vedantam

Avatar

Adobe Champion
Thanks for your reply. This does not solve the facet extraction issue though, right?