Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Modifying Default GET Behavior of Social Component

Avatar

Level 5

Hi all,

Just wondering what's the best way to modify the default GET behavior of a social component? In this particular case, it is a custom social component, similar to the TodoMVC sample[1]. This is great in that it shows the custom PostOperations extended from AbstractSocialOperation.

However, let's say I've got 20,000 nodes created under my custom social component and on page load, I just want the ONE that was created by the logged in user, how can I change the default GET behavior of the component to query for a specific child node, instead of loading them all?

On page load I see an initial templates call to load the HBS template, there's an empty "selector" value there.... Does that do anything? Is there a way to utilize that?

[1] https://github.com/Adobe-Marketing-Cloud/aem-communities-todomvc-sample

1 Accepted Solution

Avatar

Correct answer by
Employee

Greg,

You will have to change this file - https://github.com/Adobe-Marketing-Cloud/aem-communities-todomvc-sample/blob/master/bundles/aem-comm...

You might have to perform a search in getAllItems method. getAllItems should use search.find API as opposed to srp#listChildren. You specify the constraints you want in the find API.

Thanks

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

Greg,

You will have to change this file - https://github.com/Adobe-Marketing-Cloud/aem-communities-todomvc-sample/blob/master/bundles/aem-comm...

You might have to perform a search in getAllItems method. getAllItems should use search.find API as opposed to srp#listChildren. You specify the constraints you want in the find API.

Thanks