Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-42584

As a Portal Administrator, I would like the ability to define the Social Relation Types allowed for Chat portlet to filter buddies

    Details

    • Branch Version/s:
      6.2.x
    • Backported to Branch:
      Committed

      Description

      === Current functionality

      1. Portal Administrator can set the property "buddy.list.strategy" to "friends" in portlet.properties to list buddies based on the existence of a SocialRelation with type SocialRelationConstants.TYPE_BI_FRIEND ("2").
      2. When the buddy strategy is set to "friends", we try to retrieve friends with SocialRelation type SocialRelationConstants.TYPE_BI_FRIEND in

      DefaultBuddyFinderImpl.getBuddies
      // ...
      		else if (PortletPropsValues.BUDDY_LIST_STRATEGY.equals("friends")) {
      			buddies = StatusLocalServiceUtil.getSocialStatuses(
      				userId, SocialRelationConstants.TYPE_BI_FRIEND, modifiedDate, 0,
      				PortletPropsValues.BUDDY_LIST_MAX_BUDDIES);
      

      3. Users can send connection request from Contacts Center, however, these requests will have the type SocialRelationConstants.TYPE_BI_CONNECTION, thus, once these requests get confirmed, Chat portlet won't be able to filter buddies on social basis.
      4. We have many other (bi-directional) Social Relation types in our API:

      SocialRelationConstants
      public class SocialRelationConstants {
      
      	public static final int TYPE_BI_CONNECTION = 12;
      
      	public static final int TYPE_BI_COWORKER = 1;
      
      	public static final int TYPE_BI_FRIEND = 2;
      
      	public static final int TYPE_BI_ROMANTIC_PARTNER = 3;
      
      	public static final int TYPE_BI_SIBLING = 4;
      
      	public static final int TYPE_BI_SPOUSE = 5;
      
      // ...
      

      5. Chat & Contacts are part of Social Office

      -----------------------------------------------------------------------------------------------------------------------------

      === Changes done in this story
      1- New portlet property added:

      # Input a list of comma delimited values of allowed social relation types.
      # This property will only be used if the property "buddy.list.strategy"
      # is set to "sites,social" or "social".
      #
      # Valid bidirectional are 12 for "TYPE_BI_CONNECTION", 1 for
      # "TYPE_BI_COWORKER", 2 for "TYPE_BI_FRIEND", 3 for
      # "TYPE_BI_ROMANTIC_PARTNER", and 4 for "TYPE_BI_SIBLING" from
      # com.liferay.portlet.social.model.SocialRelationConstants.
      #
      buddy.list.allowed.social.relation.types=2,12
      

      2- Property

      buddy.list.strategy=friends

      has been renamed to

      social

      , but backward compatibility is ensured in the backend logic:

      buddy.list.strategy=all
      #buddy.list.strategy=sites
      #buddy.list.strategy=sites,social
      #buddy.list.strategy=social
      

      3- Administrators now are able to define the social relation types allowed that are used to filter buddies in the chat panel.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: