Foren

How to replace/override (FacebookConnectAction)

Peter Hellstrand, geändert vor 11 Jahren.

How to replace/override (FacebookConnectAction)

Regular Member Beiträge: 166 Beitrittsdatum: 30.11.11 Neueste Beiträge
I have done some hooks, autologin, after login event. replaced jsp. This was simple. How can I replace the code below? Can this be done in a Hook or do I need to do anything else.

The reason I need to do this is that I need to extrakt more than name and email from the jsonObject(facebook). So if any of you have better ideas please share. I have extended the scope of the login button in navigation.jsp. The url in the link looks fine. I just need to extrakt the value(interests) and put them in the User object.

http://www.jarvana.com/jarvana/view/com/liferay/portal/portal-impl/6.0.5/portal-impl-6.0.5-sources.jar!/com/liferay/portlet/login/action/FacebookConnectAction.java?format=ok
thumbnail
Vitaliy Koshelenko, geändert vor 11 Jahren.

RE: How to replace/override (FacebookConnectAction)

Expert Beiträge: 319 Beitrittsdatum: 25.03.11 Neueste Beiträge
Create a hook (liferay-hook.xml) on struts action like:

<!--?xml version="1.0" encoding="UTF-8"?-->

<hook>
    <struts-action>
        <struts-action-path>/login/facebook_connect</struts-action-path>
        <struts-action-impl>com.liferay.portlet.login.action.FacebookConnectActionImpl</struts-action-impl>
    </struts-action>
</hook>


(in FacebookConnectActionImpl class implement your own logic).
Peter Hellstrand, geändert vor 11 Jahren.

RE: How to replace/override (FacebookConnectAction)

Regular Member Beiträge: 166 Beitrittsdatum: 30.11.11 Neueste Beiträge
Thank you. I am getting errors when trying to build. Am I missing something?


30: package com.liferay.portal.struts does not exist
[javac] import com.liferay.portal.struts.ActionConstants;
thumbnail
Vitaliy Koshelenko, geändert vor 11 Jahren.

RE: How to replace/override (FacebookConnectAction)

Expert Beiträge: 319 Beitrittsdatum: 25.03.11 Neueste Beiträge
Check if appropriate libraries are available in your project. It seems that the class com.liferay.portal.struts.ActionConstants is not found.
Rakesh V, geändert vor 9 Jahren.

RE: How to replace/override (FacebookConnectAction)

New Member Beiträge: 10 Beitrittsdatum: 03.03.14 Neueste Beiträge
Hi Peter Hellstrand,

This is Rakesh and even I'm trying to implement similar functionality like trying to retrieve facebook friends list when the user prefers to login to liferay using a facebook id. I see that even you were trying to implement similar functionality.

I see that we can use facebook rest API to get friends list but I'm not suree how to catch facebook session id in liferay.

So, if possible please provide me the sample code/instructions on how we can achieve this.