1 / 2

Create A Custom Post Login Action in Liferay DXP 7.1

While working in the Liferay DXP 7.1 environment, we often need to perform a certain action when a user logs in to the Liferay server. I have put steps that would help a Liferay practitioner perform that action and save the development time.

contcentric
Télécharger la présentation

Create A Custom Post Login Action in Liferay DXP 7.1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Create A Custom Post Login Action in Liferay DXP 7.1 While working in the Liferay DXP 7.1 environment, we often need to perform a certain action when a user logs in to the Liferay server. To achieve this, we need to programmatically perform some action when a user logs in. I have put together the steps which would help a Liferay practitioner perform that action and save the development time. To give you a small example, suppose, we want to send an email notification to the admin when a user logs in to the Liferay server. By implementing the steps mentioned in this blog, the same can be achieved. Click this and read more about Liferay development services Prerequisites: 1) Java 1.8 It https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads- 2133151.html can be downloaded from 2) Liferay DXP 7.1 bundled with tomcat. It download can be downloaded from https://www.liferay.com/products/dxp/trial- 3) Eclipse/Liferay Developer Studio (For reference here I am using eclipse toolbar) Proceed with the following step by step procedure to create your Liferay DXP 7.1 CustomLoginAction action. 1) Once you are done with above-mentioned prerequisites and have completed basic Liferay Environment Setup, your screen should look like the below-mentioned image. 2) In Eclipse select Liferay as your current perspective. 3) Go to File->New->Liferay Work Space Project and enter details as shown in below image. Call: India +91 9925144200, USA +1 (732) 927-5544; Email: sales@contcentric.com

  2. 4) Click Finish after entering details and your newly created Liferay workspace project structure should look something as shown in below image. Now once you’re done with basic Liferay project workspace setup you would need to create a module containing your custom login action that could be deployed in your Liferay DXP Server later. 5) Right click on CustomLoginAction project and got to New->Liferay Module Project and enter details as shown in below image. 6) Again, click Finish after entering details and your newly created Liferay module project structure should look at something as shown in below image. Once you’re ready with the deployable module you would need to implement some service class inside the module that would actually be responsible for your custom login desired action. 7) Again, right click on DemoModule and go to New->Liferay Component Class and select Login Pre Action from Component Class Template dropdown and select finish as shown in below image. 8) After selecting Finish, your screen should appear as shown in the below image. 9) Now in order to implement some custom post login action in your class Component section where it {“key=login.events.pre”}, simply change it to {“key=login.events.post”} and your class should look as shown in below image. is mentioned pre property = Now you can deploy this module. Log in to your Liferay environment and you would be able to see your CustomLoginAction Service Class S.O.P in your console as shown in below image. If you find any challenge in implementing the same, feel free to contact us. Call: India +91 9925144200, USA +1 (732) 927-5544; Email: sales@contcentric.com

More Related