How to customize liferay services in Liferay 7/Overriding liferay services in liferay 7
How to override the liferay services?
As we used to work in the LR 6.2, we can override the liferay services using the servicewrapper template of blade CLI.
Following are the steps to do so.
First we will be creating a new Liferay Module as shown below.
Fill in the Name of the project and select the template as servicewrapper now click next.
In the next step fill in the package and the your custom class. Click on the button next to service and select the service wrapper that you need to override. In our case we are going to override the UserLocalServiceWrapper.
Override the required methods in the MyUserLocalServiceOverride and deploy the project using gradel deploy.
Now try to login and you can see that the methods are being called and system trace is getting printed out.
RELATED POSTS