AEM 6.5 - Querying against Synthetic resources

Avatar

Avatar

kimonp31365843

Avatar

kimonp31365843

kimonp31365843

27-02-2021

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

 

 

6.5 querybuilder synthetic
View Entire Topic

Avatar

Avatar

KiranVedantam1992

Avatar

KiranVedantam1992

KiranVedantam1992

28-02-2021

Hi @kimonp31365843,

 

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