Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sunny huang
how the co-worker could be friends automatically?
October 23, 2012 7:59 AM
Answer

sunny huang

Rank: New Member

Posts: 6

Join Date: January 17, 2011

Recent Posts

hi,

In liferay the co-worker would be friends automatically,how liferay have this function and where is the code?

Thanks in advance
Saurabh Mehta
RE: how the co-worker could be friends automatically?
December 26, 2012 11:00 AM
Answer

Saurabh Mehta

Rank: New Member

Posts: 3

Join Date: December 24, 2012

Recent Posts

I also need similar functionality. If you were able to achieve this, then please let me know what all steps should I follow to get a list of co-workers as friends by default.

Thanks in advance!!
Jelmer Kuperus
RE: how the co-worker could be friends automatically?
December 26, 2012 2:55 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

Coworker is a bit of a broad concept here that can mean different things to different people

  • It might mean that a social relationship exists between this coworker and yourself of the type SocialRelationConstants.TYPE_BI_COWORKER
  • It might mean every user of a specific organisation that you are also a part of
  • Or it might mean every user of the portal, because the portal is exclusively used by your coworkers


What you need to do differs slightly depending on this

Regardless probably the easiest way to solve this would be to define a model listener that creates the SocialRelations of type SocialRelationConstants.TYPE_BI_FRIEND which constitute a friendship, when an entity is created and that removes them when that entity is removed.

What the entity is your model listener should be listening for depends on what you consider a coworker.
Saurabh Mehta
RE: how the co-worker could be friends automatically?
December 27, 2012 5:47 AM
Answer

Saurabh Mehta

Rank: New Member

Posts: 3

Join Date: December 24, 2012

Recent Posts

Hi Jelmer,

Thanks for your reply. I am newbie to Liferay and I was thinking that I will be able to achieve this with the help of Organization, Communities or User groups(Any one out of these three). But this looks to a bit complex and need some tweak in code.

Once again thanks for your time..

Thanks