AEM 6.5 - Querying against Synthetic resources

Avatar

Avatar
Boost 10
Level 2
kimonp31365843
Level 2

Likes

10 likes

Total Posts

34 posts

Correct reply

3 solutions
Top badges earned
Boost 10
Affirm 3
Validate 1
Ignite 3
Ignite 1
View profile

Avatar
Boost 10
Level 2
kimonp31365843
Level 2

Likes

10 likes

Total Posts

34 posts

Correct reply

3 solutions
Top badges earned
Boost 10
Affirm 3
Validate 1
Ignite 3
Ignite 1
View profile
kimonp31365843
Level 2

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

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile
KiranVedantam1992
Level 7

27-02-2021

Hi @kimonp31365843,

 

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.

Answers (2)

Answers (2)

Avatar

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile
KiranVedantam1992
Level 7

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

Avatar

Avatar
Boost 10
Level 2
kimonp31365843
Level 2

Likes

10 likes

Total Posts

34 posts

Correct reply

3 solutions
Top badges earned
Boost 10
Affirm 3
Validate 1
Ignite 3
Ignite 1
View profile

Avatar
Boost 10
Level 2
kimonp31365843
Level 2

Likes

10 likes

Total Posts

34 posts

Correct reply

3 solutions
Top badges earned
Boost 10
Affirm 3
Validate 1
Ignite 3
Ignite 1
View profile
kimonp31365843
Level 2

28-02-2021

Hi @KiranVedantam1992 ,

 

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.