Posts

Showing posts from March, 2023

Liferay Dynamic Includes

Image
Liferay Dynamic Includes How to customize JSPs with Dynamic Includes Overview There are several ways for JSP customization in Liferay. For Core JSPs you can use a Custom JSP Bag . For module JSPs you can use an OSGi Fragment Bundle . These approaches are powerful: you can make any changes you need to the JSPs being customized. But they have a common drawback: after portal upgrade to the next version you might need to come back to these modules, and merge changes from Liferay with your customizations. Dynamic Includes can solve this problem, and make portal upgrades easier and safer.  What is a Dynamic Include? Dynamic Include is a Liferay extension point, which provides developers with a possibility to modify core and module JSPs without a complete override.  It consists of two parts: A l iferay-util:dynamic-include tag - used by Liferay to provide the extension points in certain places for JSP files; A DynamicInclude interface - to be implemented by

Liferay Module JSP Override

Image
Liferay Module JSP Override Module JSP Override Using OSGi Fragment Overview Liferay provides a lot of out-of-the-box applications, which can be used for building portals: login widget, blogs and forums, wiki or web contents. We often need to customize a particular widget UI according to business needs. In such cases we need to modify JSP files for that widget’s module. Module JSP Override is a solution here. There are several ways to proceed with Module JSP Override, and OSGi Fragment is one of them. In this article we’ll review what are Module JSPs and OSGi Fragments, how to find the target JSP file and how to implement a custom OSGi Fragment for Module JSP Override. What is a Module JSP? Liferay 6.2 (and previous versions) had a monolith architecture. Liferay was deployed as a single application under the ROOT context, and all the JSP files were stored in webapps/ROOT/html folder. For such JSPs customization a JSP hook approach was used. In Lif