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
    • Similar Issues:
      Show 4 results 

      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.

        Issue Links

          Activity

          Hide
          JR Houn added a comment -

          I just noticed that it was mentioned in the comments that this story was implemented in master. This story was not reviewed because the Fix Version only mentioned 6.2.x EE which shouldn't normally be receiving story tickets since it's a legacy branch. I'm adding Master as a fix version so this gets reviewed by someone in QA - especially since this looks like something that there should be some test coverage on.

          Show
          JR Houn added a comment - I just noticed that it was mentioned in the comments that this story was implemented in master. This story was not reviewed because the Fix Version only mentioned 6.2.x EE which shouldn't normally be receiving story tickets since it's a legacy branch. I'm adding Master as a fix version so this gets reviewed by someone in QA - especially since this looks like something that there should be some test coverage on.
          Hide
          Albert Lee added a comment - - edited

          PASSED Manual Testing using the following steps:

          1. Deploy the following plugins
            1. Chat
            2. Contacts
            3. Marketplace
            4. Microblogs
            5. Notifications
            6. Private Messaging
            7. SO
          2. Shutdown portal and navigate to tomcat-home/webapps/chat-portlet/WEB-INF/classes
          3. Update portlet.properties and add the following::
             buddy.list.allowed.social.relation.types=12
            
            #buddy.list.strategy=all
            #buddy.list.strategy=sites
            #buddy.list.strategy=sites,social
            buddy.list.strategy=social
            
          4. Add a page and add the Contact Center portlet
          5. Add a user
          6. Navigate to the Contact Center portlet and 'Connect' to the user
          7. Open another internet browser an login as the user
          8. Confirm the 'Connect' request via the Notifications portlet
          9. Assert in both browsers that test test and the user can see each other in the Chat portlet
          10. Shutdown portal and navigate to tomcat-home/webapps/chat-portlet/WEB-INF/classes
          11. update portlet.properties to the following:
             buddy.list.allowed.social.relation.types=2
            
          12. Start up portal and assert test test and the user cannot see each other in the Chat portlet

          When a user sets buddy.list.strategy to either "sites" or "sites,social", the chat filter can be further refined setting social relation types ie buddy.list.allowed.social.relation.types. Currently there are only two social relations that are utilized:12 (Connection via Contacts Center Portlet) and 2 (Friend via Social Networking Portlet).

          Passed on:
          Tomcat 7.0.42 + MySQL 5.5. Portal master GIT ID: f100a79db02f02a1226a55264f2faf33bc9822a4.
          Plugins master GIT ID: 6f495ee287be93550d7830c8b7dff70db245cd0e.
          Tomcat 7.0.42 + MySQL 5.5. Portal ee-6.2.x GIT ID: eaa0a199fa8a2ad874f37d1b99c423e5ac052b4c.
          Plugins ee-6.2.x GIT ID: eaedd70fb0413f92b703021b708894daeac16cc1.

          Show
          Albert Lee added a comment - - edited PASSED Manual Testing using the following steps: Deploy the following plugins Chat Contacts Marketplace Microblogs Notifications Private Messaging SO Shutdown portal and navigate to tomcat-home/webapps/chat-portlet/WEB-INF/classes Update portlet.properties and add the following:: buddy.list.allowed.social.relation.types=12 #buddy.list.strategy=all #buddy.list.strategy=sites #buddy.list.strategy=sites,social buddy.list.strategy=social Add a page and add the Contact Center portlet Add a user Navigate to the Contact Center portlet and 'Connect' to the user Open another internet browser an login as the user Confirm the 'Connect' request via the Notifications portlet Assert in both browsers that test test and the user can see each other in the Chat portlet Shutdown portal and navigate to tomcat-home/webapps/chat-portlet/WEB-INF/classes update portlet.properties to the following: buddy.list.allowed.social.relation.types=2 Start up portal and assert test test and the user cannot see each other in the Chat portlet When a user sets buddy.list.strategy to either "sites" or "sites,social", the chat filter can be further refined setting social relation types ie buddy.list.allowed.social.relation.types. Currently there are only two social relations that are utilized:12 (Connection via Contacts Center Portlet) and 2 (Friend via Social Networking Portlet). Passed on: Tomcat 7.0.42 + MySQL 5.5. Portal master GIT ID: f100a79db02f02a1226a55264f2faf33bc9822a4. Plugins master GIT ID: 6f495ee287be93550d7830c8b7dff70db245cd0e. Tomcat 7.0.42 + MySQL 5.5. Portal ee-6.2.x GIT ID: eaa0a199fa8a2ad874f37d1b99c423e5ac052b4c. Plugins ee-6.2.x GIT ID: eaedd70fb0413f92b703021b708894daeac16cc1.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Structure Helper Panel