Posts

Showing posts with the label jsp override

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 imple...

Liferay Core JSP Override

Image
Liferay Core JSP Override Core JSP Override Using Custom JSP Bag Overview We often need to customize the portal appearance. For styling customization we can use custom themes or style books, for business-logic adjustments - service wrappers or portlet filters. But when we need to change what is displayed on the page (make changes to the markup itself) - we need to override the portal JSP files. Fortunately, there are extension points for this. For core JSPs we can use a Custom JSP Bag.  What is a Core JSP? Liferay 7 has a modular architecture.  Previously (Liferay 6.2 and below versions) had a monolith one: Liferay was a single web application deployed to webapps/ROOT. All the JSP files were stored in webapps/ROOT/html folder. For these JSPs customization there was a “JSP hook” approach.  In Liferay 7 most of these JSPs were moved to separate modules. Remaining JSPs, which are still inside webapps/ROOT/html folder are considered as “Core JSPs”: For these JSPs...