활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
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
해결되었습니다! 솔루션으로 이동.
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
Any one has any thought on this?
Appreciate any help on this.
조회 수
답글
좋아요 수
Anyone has any idea on this? Its becoming important to complete from our project tasks prespective..
조회 수
답글
좋아요 수
Hello All,
I am trying exact same thing. I am using an extended comments component that uses the profile image based on path to we.retail profile page instead of my-project profile page.
Did two things. Created
Please suggest how the dependency could be resolved or any other class I need to extend in my UserProfileComponentFactory class
조회 수
답글
좋아요 수
I too am having this issue. I had already tried what both of the previous users have tried. Has anyone had any success overriding the user profile?
조회 수
답글
좋아요 수
Try to work with priority level of your extended component ( AbstractUser) as ootb components get registered first and custom component need priority level higher than ootb.
Try adding this to your extended component class
----------------------------------------------------
/** Priority level of the component. */
@Property(name = "priority", intValue = 200)
protected int priority;
----------------------------------------------
Yes,It worked for us after changing priority level to 200.
조회 수
답글
좋아요 수
ashokkumar wrote...
Try to work with priority level of your extended component ( AbstractUser) as ootb components get registered first and custom component need priority level higher than ootb.
Try adding this to your extended component class
----------------------------------------------------
/** Priority level of the component. */
@Property(name = "priority", intValue = 200)
protected int priority;
----------------------------------------------
I was using a value greater than 0 when I first wrote my override component. Is there a way for us to determine what the different priority levels are for the various OOTB implementations so we know what priority we have to use? For other components, using any value greater than 0 has always been sufficient for us.
The quoted response is the correct answer for future people attempting to override a component. I was comically frustrated last night while working on this, and ended up using 999999 as my priority, which obviously made it begin working. You should also ensure that you are using the correct cq-social-badging-api and cq-social-scoring-api packages instead of the classes out of the Uber JAR on AEM 6.1, since the Uber JAR version is older.
조회 수
답글
좋아요 수
Steven,
You are absolutely right saying that almost every community component comes with default priority level 0 to support custom extensions. With livefyre integration post AEM 6.1 GA, we have a new implementation of AbstractUser via this factory - com.adobe.social.integrations.livefyre.user.impl.LivefyreUserFactoryImpl (see using system/console/components) which has priority level 100. so for any custom extension, this need to be superseded.
I believe this need to be documented for future reference and we will surely do that. Thanks.
조회 수
답글
좋아요 수
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
조회 수
답글
좋아요 수
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
monikaa6 wrote...
![]()
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
Thanks Monika, it worked perfectly.
조회 수
답글
좋아요 수
조회 수
Likes
답글