Extending and customizing Liferay
Liferay provides many out of the box features, included a fully featured content management system, a social collaboration suite and several productivity tools. For some portals those functionalities might be exactly what you need, but for some others you might want to extend them or customize how they work or how they look by default.
Liferay provides several types of plugins that are specialized for an specific type of customization. It is possible to combine several plugin types into a single .war file. For example it is a common practice to combine Themes and Layout Templates. The following sections describe each type of plugin you may need to use.
Customizing the look and feel: Themes
Themes allow the look of the Liferay portal to be changed using a combination of CSS and Velocity templates. In many cases, it is possible to adapt the default Liferay theme to the desired look using only CSS, providing the most forward compatibility. If CSS is not sufficient and more major changes are required, Liferay allows you to include only the templates you modified in your theme, and it will automatically copy the rest from the default theme. Like portlets, themes are hot-deployed as plugins into a Liferay instance.
Adding new predefined page layouts: Layout Templates
Layouts are similar to themes, except that they change the arrangement of portlets on a page rather than its look. Layout templates are also written in Velocity and are hot-deployable.
Customizing or extending the out of the box functionalities: Hook plugins
Hook plugins are the recommended method of customizing the the core functionality of Liferay at many predefined extension points. Hook plugins can be used to modify portal properties or to perform custom actions on startup, shutdown, login, logout, session creation and session destruction. Using service wrappers, it is possible for a hook plugin to replace any of the core Liferay services with a custom implementation. Hook plugins can also replace the JSP templates used by any of the default portlets, allowing you to customize their appearance as desired. Best of all, hooks are hot-deployable plugins just like portlets.
Advanced customization: Ext plugins
Ext plugins provide the largest degree of flexibility in modifying the Liferay core, and allow replacing essentially any class with custom implementations. This flexibility comes at a cost however, as it is highly unlikely that an Ext plugin written for one version of Liferay will continue to work in the next version without modification. For this reason, Ext plugins are only recommended for cases where an advanced customization is really needed and there is no other way to accomplish the same goal. Also you should make sure that you are familiar with the Liferay core to make sure the Ext plugin doesn't have a negative effect on existing funcitonalities.. Even though Ext plugins are deployed as plugins, the server must be restarted for changes to take effect. For this reason, Ext plugins should not be combined with other types of plugins.
Tip: If you have developed for Liferay 5.2 or before, you may be familiar with what was known as "Extension Environment". Ext plugins are a new feature in Liferay 6.0 which replace the extension environment in order to simplify its development. It is possible to automatically convert any existing Extension Environment into a plugin. Check the chapter Migrating old extension environments for detailed instructions.