Liferay Hooks


Liferay Hooks

Liferay Hooks are used to override core functionality of liferay services, web resources, language properties, filters, indexers, structs actions etc  and below are list of Hooks available in Liferay 6.2 below versions.   Liferay DXP will not use any HOOKs at all and it uses OSGI platform to override the Liferay core functionality.

Liferay Hooks are hot deployable, but EXT’s are not. so always prefer Hooks over EXT’s to override core functionality.

Liferay available hook configuration types:

  • Web resource (JSP, JS, images) Hooks
  • Service wrapper Hooks
  • Portal Properties
    • Portal Events
      • application.startup.events
      • login.events.post
      • login.events.pre
      • logout.events.post
      • logout.events.pre
      • servlet.service.events.post
      • servlet.service.events.pre
      • servlet.session.create.events
      • servlet.session.destroy.events
    • Portal Properties
      • Liferay Hook Properties
  • Struts Action
  • Servlet Filters
  • Auth Pipeline
  • Modal Listeners
  • Indexers
  • Language Hook

How to create Hook?

Liferay IDE provides plugin type as “Hook” to create Hook Plugin. In Liferay IDE, select  File -> New ->Liferay Plugin Project and give the name as login and select “Hook” as plugin type.

It will create login-hook in the Project Explorer. In next steps we will create JSP Hook configuration. It’s always best practice to create one HOOK for project, so that you can easily look what are core Liferay core JSP’s are modified.

 

Access all Liferay Hook Tutorials below:

Liferay JSP Hook

Liferay JSP hooks are used to override  JSP,  java script, images etc.Lets create a simple jsp hook that override login.jsp from Liferay core JSP’s. All web resource Hook configuration will in in custom-jsp-dir in liferay-hook.xml file…

READ MORE

Liferay Service Hook

Liferay Service  Hook are used to override methods in the Liferay Service Layer. You can override the all methods defined {EntityName}ServiceWrapper.java classes, but you can not add new methods. You can add methods but those are not…
READ MORE