In summary,
the portal (6.0 or above) supports 6 different types of plugins out-of-the-box.
They are
1. portlets
2. themes,
3. layout templates,
4. webs,
5. hooks, and
6. ext.
1) Portlets: web applications that run in a portion of a web page;
2) Themes:
look and feel of pages;
3) Layout Templates: ways of choosing how the portlets will be arranged
on a page;
4) Hooks:
allow hooking into the portal core functionality;
5) Webs:
regular Java EE web modules designed to work with the portal, like ESB
(Enterprise Service Bus), SSO (Single
Sign-On), etc.
6) Ext:
ext environment as a plugin.
Hooks:
Hooks can
fill a wide variety of the common needs for overriding Liferay core
functionality. Whenever possible, hooks should be used in place of Ext plugins,
as they are hot-deployable and more forward compatible. Some common scenarios
which require the use of a hook are the need to perform custom actions on
portal startup or user login, overwrite or extend portal JSPs, modify portal
properties, or replace a portal service with your own implementation. Liferay
can be customized using either hook plugins or Ext plugins. Best way is to try doing
all your customizations as hooks if possible.
If you find something you
can’t do in a hook—maybe you need to customize a property that is not yet
supported by hooks, extend an internal Liferay class, implement a custom
Permission Checker, or extend a Liferay Struts action—you can use the Ext
plugin to do this.
Generally
there are 4 types of hook parameters:
1. portal-properties
(portal properties hooks)
2. language-properties
(language properties hooks)
3. custom-jsp-dir
(custom JSPs hooks)
4. service (portal
service hooks)
1) portal
properties hooks allow runtime
re-configuration of the portal.
2) Language
properties hooks allow us to
install new translations or override few words in existing translations.
3) JSP hooks
provide a way to easily modify JSP files without having to alter the core of
the portal
4) Portal
service hooks provide a way to easily override portal services
Over view of HOOKS:
Ø Hooks are used to
override/extends liferay core functionalities.
Ø Hooks are hot-deployable.
Ø Hooks are created within
liferay-plug-in-sdk/hooks folder.
Ø Hooks are preferred over
Ext-plugins whenever possible.
Uses of HOOKS:
Ø Performing custom actions on
portal startup or user login
Ø Overriding or extend portal
JSPs
Ø Modifying portal properties
Ø Replacing portal services
with your own implementation