Modifying Default GET Behavior of Social Component

Avatar

Avatar

Gdubz-57m2mu

Avatar

Gdubz-57m2mu

Gdubz-57m2mu

14-11-2016

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

View Entire Topic

Avatar

Avatar

aponnusa

Employee

Avatar

aponnusa

Employee

aponnusa
Employee

16-11-2016

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