daledotshan/liferay-plugins — pull request #39 by yuhai (2014-12-09 09:27:57+00:00)
Title: LPS-48245 Broken request titles with Contacts and Social Networking portlet

The root issue is that Contacts portlet includes its portletId in social
requests. This causes the request interpreter to ignore because we don't define Contacts's request interpreter. My first commit will solve the issue(LPS-48245 reported issue).

For the second commit, it will solve the issue "when friend request agreed, it should display this "Test Test and Hai Yu are now friends" in activity portlet. Due to we also lack of Contacts's activity interpreter, so this message don't display in activity portlet.

Please refer to the below fix log.

**The fix referred to social-networking-portlet's FriendsRequestInterpreter and FriendsActivityInterpreter class. And the fix used similar logic with them**

**For ContactsCenterRequestInterpreter**, when send friend request from Contacts Center portlet by clicking "contect", it will invoke ContactsCenterPortlet.requestSocialRelation(). We can know the type=12 (in contacts_center_toolbar.jsp 87 line) and extraData only includes "portletId". It is different from sending friend request from Summary Portlet. In Summary Portlet, it will invoke SummaryPortlet.addFriend(), we can know extraData includes "portletId" and "addFriendMessage" param, and type=1 in SummaryPortlet.addFriend().

So I change the requestType and remove Body field(because body will still be blank by sending friend request from Contacts Center Portlet) in FriendsRequestInterpreter.java.

In addition, I use "request-social-networking-summary-add-friend" as title pattern because its explanation is "request-social-networking-summary-add-friend={0} wants to be your friend" in language.properties.

**For ContactsCenterActivityInterpreter**, this is similar logic with FriendsActivityInterpreter. After confirming friend request, the activity should be displayed in activity portlet as "Test Test and Hai Yu are now friends". This will invoke SocialActivityInterpreterLocalServiceImpl.interpret(String selector, SocialActivity activity,ServiceContext serviceContext). So we need to add related Contacts Activity Interpreter.

Due to the activity "Test Test and Hai Yu are now friends" belongs to friend message, so we don't take care its permission in ContactsCenterActivityInterpreter.hasPermissions().

Please help check the issue.

Thanks,
Hai