Extend the User Profile Information in Communities Components | Community
Skip to main content
New Participant
January 25, 2017
Solved

Extend the User Profile Information in Communities Components

  • January 25, 2017
  • 11 replies
  • 4950 views

Hi All,

We are using AEM 6.2 communities Feature pack FP2. I am trying to extend some of communities components(activitystream,comments)

I was able to extend them, but both of these components retrive some of user information (avatar image, name etc).

We are storing the profile images of user at different place, so I want to change the logic of pulling the avatar image for these components.

What is the best way to do that so I just need to extend/override this logic at one place and that become available for all communities components we are using

I tried extending the "AbstractUser" class and bind it to "social/commons/components/author" resourceType in Factory, but that is not getting called.

Please suggest the best way to implement this.

Thanks

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 monikaa6

Bharath valse wrote...

monikaa6 wrote...

Yes,It worked for us after changing priority level to 200.

 

Hello Monika,

Could you please explain which classes did you extend to override to get a custom avatar URL and how the binding is done to a OOB component.

My requirement is to override a context variable "author.avatarUrl" which is being populated from some java class in the backend. Any pointers would be helpful as to how to get started with extending and modifying the context variables.

Thanks 

 

Hello Bharath,

I wrote the Component class which extends the "AbstractUser" class and implements the "User" class and then overridden the getAvatarUrl() method logic here.

and created the Factory class for the component class which extends AbstractSocialComponentFactory implements SocialComponentFactory.

In Factory Class did the binding on the "social/commons/components/author", so every OOB component which returns the USER object of this type will call this class (For e.g OOB activitystream and comment component)

Make sure the priority for this component should be kept higher, I kept it to 200 then only it worked.

Hope that helps!!

Thanks,

Monika

11 replies

monikaa6Author
New Participant
February 10, 2017

Any one has any thought on this?

Appreciate any help on this.