Foren

BaseStrutsPortletAction

thumbnail
Manikantha Rajamani, geändert vor 6 Jahren.

BaseStrutsPortletAction

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
Hi Team

I have developed the Strut action hook in Liferay DXP and code is below
@Component(
immediate=true,
property={
"path=/portal/login"
},
service = StrutsAction.class
)
public class LinkedInSigninAction extends BaseStrutsPortletAction {

@Override
public void processAction(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig,
ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
// TODO Auto-generated method stub
System.out.println("Inside /portal/login functionality" );
super.processAction(originalStrutsPortletAction, portletConfig, actionRequest, actionResponse);
}

@Override
public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {
// TODO Auto-generated method stub
System.out.println("Inside /portal/login functionality render" );
return super.render(originalStrutsPortletAction, portletConfig, renderRequest, renderResponse);
}

@Override
public void serveResource(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig,
ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception {
// TODO Auto-generated method stub
super.serveResource(originalStrutsPortletAction, portletConfig, resourceRequest, resourceResponse);
}


}

When i build the hook i'm getting following error

[Class com.liferay.example.LinkedInSigninAction is not assignable to specified service com.liferay.portal.kernel.struts.StrutsAction]

FAILURE: Build failed with an exception.

* What went wrong:
Build has errors

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


is it correct way to write struct action hook in liferay Dxp or any configuration is missing.


Thanks and Regards
Manikantha R
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: BaseStrutsPortletAction

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
Manikantha Rajamani:
I have developed the Strut action hook in Liferay DXP and code is below
@Component(
immediate=true,
property={
"path=/portal/login"
},
service = StrutsAction.class
)


Um, no you haven't. You've tried changing a Liferay 6 struts action hook into a Liferay 7 struts action hook, but there is no struts action for /portal/login, the login portlet is no longer implemented using struts.






Come meet me at 2017 LSNA!
thumbnail
Manikantha Rajamani, geändert vor 6 Jahren.

RE: BaseStrutsPortletAction

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
David H Nebinger:
Manikantha Rajamani:
I have developed the Strut action hook in Liferay DXP and code is below


Um, no you haven't. You've tried changing a Liferay 6 struts action hook into a Liferay 7 struts action hook, but there is no struts action for /portal/login, the login portlet is no longer implemented using struts.



If no struts action hook for /portal/login, Then how to implement auto login by LinkedIn.
or
Any other suggestion for auto Login by Twitter.
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: BaseStrutsPortletAction

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
Manikantha Rajamani:
If no struts action hook for /portal/login, Then how to implement auto login by LinkedIn or any other suggestion for auto Login by Twitter.


Um, Linked In is OAuth. Twitter is also OAuth. And DXP supports OAuth too.









Come meet me at 2017 LSNA!
thumbnail
Manikantha Rajamani, geändert vor 6 Jahren.

RE: BaseStrutsPortletAction

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
Hi David,

i have used OAuth for LinkedIn integertion

@Component(
immediate = true, property = {"auth.public.path=/portal/linkedIn_login"},
service = Object.class
)

Whether i need to use auth.public.path=/portal/linkedIn_login

OR

Whether i need to use auth.public.path=/login/linkedIn_login

Please clarify

Thanks and Regards
Manikantha R
thumbnail
Manikantha Rajamani, geändert vor 6 Jahren.

RE: BaseStrutsPortletAction

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
David H Nebinger:
Manikantha Rajamani:
If no struts action hook for /portal/login, Then how to implement auto login by LinkedIn or any other suggestion for auto Login by Twitter.


Um, Linked In is OAuth. Twitter is also OAuth. And DXP supports OAuth too.









Come meet me at 2017 LSNA!



Hi David,

i have used OAuth for LinkedIn integertion

@Component(
immediate = true, property = {"auth.public.path=/portal/linkedIn_login"},
service = Object.class
)

Whether i need to use auth.public.path=/portal/linkedIn_login

OR

Whether i need to use auth.public.path=/login/linkedIn_login

Please clarify

Thanks and Regards
Manikantha R