Modifying Default GET Behavior of Social Component | Community
Skip to main content
Gdubz-57m2mu
Level 5
November 14, 2016
Solved

Modifying Default GET Behavior of Social Component

  • November 14, 2016
  • 1 reply
  • 1358 views

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

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 aponnusa

Greg,

You will have to change this file - https://github.com/Adobe-Marketing-Cloud/aem-communities-todomvc-sample/blob/master/bundles/aem-communities-todomvc/src/main/java/com/adobe/aem/social/todomvc/impl/TodoListImpl.java#L68

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

1 reply

aponnusaAdobe EmployeeAccepted solution
Adobe Employee
November 16, 2016

Greg,

You will have to change this file - https://github.com/Adobe-Marketing-Cloud/aem-communities-todomvc-sample/blob/master/bundles/aem-communities-todomvc/src/main/java/com/adobe/aem/social/todomvc/impl/TodoListImpl.java#L68

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