AEM 6.5 - Querying against Synthetic resources | Community
Skip to main content
Adobe Champion
February 27, 2021
Solved

AEM 6.5 - Querying against Synthetic resources

  • February 27, 2021
  • 3 replies
  • 1370 views

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kiran_Vedantam

Hi @user55521,

 

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.

3 replies

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
February 28, 2021

Hi @user55521,

 

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.

user55521Adobe ChampionAuthor
Adobe Champion
March 1, 2021

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.

Kiran_Vedantam
Community Advisor
Community Advisor
March 1, 2021

Hi @user55521,

 

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

user55521Adobe ChampionAuthor
Adobe Champion
March 1, 2021
Thanks for your reply. This does not solve the facet extraction issue though, right? 🙂