Search and Invite Enhanced

 This widget is an extention of the existing search and invite widget developed by Neel Haldar.The enhancement allows you to suggest a friend to some of your existing friends..It also allows you to approve friend suggestion requests, in addition to friend requests..

A simple friend request is where user A sends a friend request to user B.When user B sees this friend request and approves it, then user A and B become friends..This has been possible using search and Invite friends widget.

With friend suggestion request, user A can suggest some of his own friends(say user C) to user B..When user B logs in, he sees that user A has suggested him a friend,user C..Once user B approves this suggestion, a friend request is sent to user C, asking user C to add user B as his friend..After user C approves it user B and C become friends..

 

Lets take a concrete example to see how this suggest a friend feature works..We'll consider a use case where Bruno wants to suggest a friend ,Sarah to John..

Login as Bruno.Select "SuggestFriends" tab and click on "Search Friends"  to view all Bruno's friends.
Bruno searches for all his friends and picks up John as the friend to whom he has to suggest some friends(Sarah)

  

 

 Click on "suggest a friend" link besides John's name,to open a popup of all existing friends of Bruno.From this list select a friend(Sarah) whom Bruno would like to suggest to John

 
 

Click on "Suggest"..The result of "Suggest" action is updated immediatedly.

 

Incase John and Sarah are already friends then an suitable message(John and Sarah are already friends) is  displayed..


When John logs in, he sees a friend suggestion request in "MyPendingRequests" tab. "MyPendingRequests" tab essentially performs the same function as the "Requests" portlet does.You can also use the "Requests" portlet to approve requests.


 

After John confirms the friend suggestion ,a friend request is automatically sent to Sarah..Now login as Sarah to see the friend request. 

 

 When Sarah confirms the friend request, Sarah and John become friends.  

Sarah can use the "Myfriends" tab to view all her current friends.

 
  

Implementation Details

The widget uses Expando to store the 3rd users info i.e(Sarah in this case) by adding a column to SocialRequest table..Since 3 users are involved in a Suggestion Request as opposed to 2 in Friend Request, extending SocialRequest table  was necessary.

   table = ExpandoTableLocalServiceUtil.addDefaultTable(
                "com.liferay.portlet.social.model.SocialRequest");
   
    ExpandoColumnLocalServiceUtil.addColumn(table.getTableId(),"selectedfriendId",
        ExpandoColumnConstants.LONG);

    ExpandoValueLocalServiceUtil.addValue(
        "com.liferay.portlet.social.model.SocialRequest",table.getName(),
        "selectedfriendId", sr.getPrimaryKey(),Long.parseLong(selFriendId));

 

Also the widget extends FriendsRequestInterpreter of WOL portlet to interpret Friend Suggestion Request.

In the first image the search container shows the user portrait .It can be configured to show only username by setting a preference.


Click here for source.

Steps to generate war

1)Unzip search-suggest-invite-portlet.zip into Liferay plugin portlets directory (..\liferay\plugins\branches\5.2.x\portlets\)

2)cd ..\liferay\plugins\branches\5.2.x\portlets\search-suggest-invite-portlet

3)Run ant

 

Blogs
Sriram krishnan
This is a really nice enhancement.
The source link, however does not have the necessary permissions. I get "You do not have permission to access the requested resource".
Thanks Ibrahim..Forgot to give view permission on the attachment..Please try now..
Sriram
Great, it works now. Are you using this portlet in a publicly facing site? If so, please share the link. I am interested in understanding the use cases of liferay and other portlets in social network sites.
Hi, I downloaded the portlet source, I have some questions.

1) where is the path ..\liferay\plugins\branches\5.2.x\portlets\ located?
2) I tried to compile with ant by plugin sdk, but I get the following error:

Buildfile: /home/tina/Scrivania/Liferay/liferay-plugins-sdk-6.0.5/portlets/search-invite-portlet/build.xml

compile:

merge:

compile-java:
[javac] Compiling 6 source files to /home/tina/Scrivania/Liferay/liferay-plugins-sdk-6.0.5/portlets/search-invite-portlet/docroot/WEB-INF/classes

BUILD FAILED
/home/tina/Scrivania/Liferay/liferay-plugins-sdk-6.0.5/build-common-plugin.xml:347: The following error occurred while executing this line:
/home/tina/Scrivania/Liferay/liferay-plugins-sdk-6.0.5/build-common.xml:102: Class not found: modern

I set all the information necessary, like the java compiler in build.username.properties (javac compiler=modern).

Could you help me please? Or could you attach the war file of this portlet?

Thanks so much

tina
Hi,
I can not dowload the source code, can you please share by sending it to
my email h_bahtat@yahoo.fr
Thanks alot
Nabil
Hi,
when I want to download the source portlet from

http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133

I got the following error:
You do not have permission to access the requested resource.

I was logged to system but I can't download it.
Would you please guide me?

Thx
I also can't download the source

It shows:
You do not have permission to access the requested resource.

http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133

Thanks
When clicking the link you mentioned I get "You do not have permission to access the requested resource.

http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133"

please set the correct rights to download it.

thank you
This is a really cool portlet but l am failing to get the source l get the error.

You do not have permission to access the requested resource.

http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133
Hi,
I can not download the code from the link:
http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133

Are authenticated on the system but I get the following error:
'You do not have permission to access the requested resource.'

Can you please help me?

Thanks!
I doen't have access eather
looking to find the code for this to see if I can get it to work with 6.0EE

Also wondering if this allows me if placed on a community page to only show the community members?
I cannot access the code. Please set permissions
Same problem here!
I cannot also not access the source:


You do not have permission to access the requested resource.

http://www.liferay.com/c/document_library/get_file?uuid=3f75b7fe-8269-4767-bd2e-785833bb74d8&groupId=852133
Hi ,
is anybody got the source code of this portlet ?

Thanks in advance
Dayanand
HI

I am not able to download search and invite portlet. It gives error like "The requested resource was not found". Please help me.

Thanks
Hi ,

Can you please provide access to download the source and war.
I am also unable to download the source and war from the above mentioned link.

Also please let me know whether this with work with Liferay 6.1

Thanks & Regards,
Manish
Hi Sriram,
can you please give me permission. I am not able to download this example as I am getting error message "You do not have permission to access the requested resource.
"

Thanks in advance
Hi Siriam,
what can I do in order to download the war?
"You do not have permission to access the requested resource"

Thanks & Regards.
Hi Sriram ,
I can not get the source, when I click "I get a message, you do not have permission to view ..."
Thanks alot.
Nabil