April 28, 2022
The Liferay developer community has been waiting since long for Ext with Liferay 7 and it got recently released with GA4. This post will be focused on Ext Plugin and how to implement Ext Plugin in Liferay 7/ DXP. In case you are new to Liferay and don’t know what is EXT, here is quick background.
What is Ext?
Ext is stand for extension plugin/environment. Ext plugins are most powerful tool used to extend Liferay Portal. The customization which can’t be done using Hook, can be achieved with Ext. Liferay supports the following use cases for Ext plugin.
1. Custom implementation for any beans which declared in Liferay Portal’s Spring files. (Wherever possible use service wrappers instead of an Ext plugin). Liferay 7 removed many beans, so make sure your overriding beans are still relevant.
2. Overwriting a class in Liferay Portal core JAR.
3. Modify Liferay Portal’s web.xml file.
Ext plugins are not recommended unless there is no other way to achieve the goal. Ext plugin can only be created using Plugin SDK.
Here are some pre-requisites:
Let’s look at Ext with Liferay 7 by taking example of how to override any service implementation class using Ext.
Here are the steps:
1. First of all create Ext Plugin:
2. Create ext-spring.xml file:
3. Defining custom Bean:
4. Create Custom Implementation class:
5. Deployment Steps:
Ext plugin is now ready for deployment. Before we move ahead make sure “app.server.dir” property is configured in build.[username].properties file.
Congratulations, you are done with Ext plugin. I hope this post will help you for customization with Liferay Portal.
Post by,
Zeenesh Patel