Liferay Hook Interview Questions


  • What is Hook plugins in Liferay?
    • 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 HOOK at all and it uses OSGI platform to override the Liferay core functionality.Access tutorial for complete details:
  • What are all configuration can be overridden using Hooks?
    • 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
  • What is your preference in EXT and HOOK?
    • Liferay Hooks are hot deployable, but EXT’s are not. so always prefer Hooks over EXT’s to override core functionality.
    • EXT should be used when it is not feasible through HOOK configuration
  • Explain how do you override liferay login.jsp?
    • We will create JSP Hook for this, so create hook plugin
    • Create custom_jsps in docroot like :     docroot/custom_jsps 
    • edit liferay-hook.xml and add below tag:
      • <custom-jsp-dir>/custom_jsps</custom-jsp-dir>
    • copy the login.jsp from html path like : html/portlet/login/login.jsp
  • Explain how does liferay loads hooked JSP?
    •  Liferay just copies login.jsp from hook plugin to  to liferay html folder and moves original html to login.portal.jsp,which is original file.
    • When we un deploy, liferay just deletes login.jsp and reverts login.portal.jsp file again.
  • Suppose you have created two hook plugins for login.jsp? which one will take effect?
    • Both Hook plugin will deploy and you will not get any error. Liferay uses JSP from which it deployed latest order.
  • What is importance of custom-jsp-global tag in liferay hook?  or (What is Application Adapters in Liferay and how to create them)?
    • Application Adapters are Hook Plugins  will allow us to scope the Hook changes to a particular  site by not affecting the entire portal.
    • How to create Application Adapter?
      • To create a Application Adapter, all you need is a Hook with custom JSPs and “custom-jsp-global” set to false
      • <hook>  <custom-jsp-dir>/custom_jsps</custom-jsp-dir>  <custom-jsp-global>false</custom-jsp-global> </hook>
    • When custom-jsp-global set to “true” then the hook is applied to all sites .
    • When custom-jsp-global set it to false  then we have the option of configuring which sites that hook will apply. Go to the Control Panel > Sites > Test Site > Configuration > Site Settings and  at bottom of page, you will find a Configuration section with Application Adapters and a drop down. There you can set the hook you want to apply to the siteHook Application Adaater
  • How you can change the existing implementation of indexing of Liferay Core service ?
    • Using Indexer Post Processor hook
  • Is it possible to add new method in service through service wrapper hook?
    • No. Even you write methods then those will not accessible
  • can we add new struts actions using Hooks?
    • Yes, We can create new struts actions

— In Progress —-

Advanced Liferay Interview Questions

Advanced Liferay Interview Questions Explain cluster process in Liferay? Access below tutorial for cluster setup in liferay Liferay Clustering Concepts  Liferay Clustering Concepts tutorial will drive you on READ MORE

Liferay Portlet Basic Interview Questions

Liferay Portlet Basic Interview Questions  What is Portal? Portal is platform to create web applications where portal provides commonly used features such as user  management, authentication, sites, web content management to READ MORE

Liferay ServiceBuilder Interview Questions

Liferay ServiceBuilder Interview Questions   What is Service Builder and advantages of using it? Access this tutorial for details: Liferay ServiceBuilder concepts and anatomy  Liferay provides Service Builder tool for generating modal objects, READ MORE

Liferay Theme Interview Questions

Liferay Theme Interview Questions  How to set portlet preference in theme? Liferay provides a built-in VM variable called$velocityPortletPreferences for this purpose.$velocityPortletPreferences is a Map<String, String>.  READ MORE

Liferay Administration Interview Questions

Liferay Administration Interview Questions    How to you manage liferay portal administration? The control panel provides an interface for the creation and maintenance of: Plugin Configuration Custom READ MORE

Liferay Hook Interview Questions

Liferay Hook Interview Questions What is Hook plugins in Liferay? Liferay Hooks are used to override core functionality of liferay services, web resources, language properties, filters, indexers, structs actions etcREAD MORE