Deactivating and activating custom modules for a particular site in Liferay 7.4 (Part 1)

 


In Liferay 7.4 we can deactivate or activate a module for Liferay portal. This can be done using the components and app manager section from the control panel. 


But Liferay doesn’t provide any feature to activate or deactivate a module for a particular site. As it can be a necessary thing when we have multiple sites and want to limit modules for that. To achieve this in Liferay we must create a panel module, service builder and theme. In the following part we will create a panel module to list all custom modules and to give user the access to disable a module on a particular site. In second part we will create a service builder and theme. 


Creating a panel module (IntelliJ)

To show and let users perform action we need a module to display portlets and take user action.

To create a panel module this are the following steps: 

  1. Go to File -> New -> Module
  2. Select Liferay Modules 

3.Give the name to the module and choose the project type panel app.

  1. This will create a panel module
  2. After this to see all modules in view we need to add a render method that will give the list of all custom modules present on the portal.
The portlet will look like this: 






As we don’t have service builder and theme, we won’t be able to perform the active and deactivating functionality.

Conclusion

We have created a module to list all the custom modules and let the users have access to activate and deactivate modules for a particular site. In part 2 we will create a service builder and theme. 

Originally published by: https://www.inexture.com/deactivating-and-activating-liferay-objects/


Comments

Popular posts from this blog

How to Hire the Best Java Developers For Your Upcoming Project

How Can DevOps Consultants Help You Create an Impressive Presence of Your Business?

Best Frameworks to Use for AI App Development in 2022