Liferay Hook Plugin Support | Netbeans Portal Pack 3.0.2

General Blogs 2009/03/22 投稿者 Santh Chetan Chadalavada

 

Portal Pack makes life easier yet again !!. This time with the NetBeans Hook Plugin for Liferay.

Available @ Netbeans PortalPack 3.0.2


Introduction: This plugin has been developed to provide hook tooling support through Netbeans Portal Pack. For more information

on Liferay Hook checkout the Portal Hook Plugins Wiki

This new feature will help creating different kinds of hooks supported by Liferay Portal. Lets look each type of hook and how we can create them using Netbeans Portal Pack plugin.

  • Event Type Hook :  Liferay provides different kind of event type hooks and Portal Pack now supports all the different kinds of event hooks. For example, add a post login hook to do your custom stuff after each user login.
  1. Create a web project:
  2. In Server and Settings choose Liferay Portal Server 5.2.2 and click on Finish the create the project.
  3. Right click on the project. In Categories Select WebSpace/Liferay Plugins -> Hook Plugin. 
  4. Click On Next. From the Hooks Wizard top dropdown choose Event Handler Hook.
  5. Provide ClassName and Package. Choose the Event Type from the bottom drop down and click Finish. 
  6. liferay-hook.xml, portal.properties, Event class files will be generated with the provided information.You can edit the java file put some code and save.
  7. Right click on the project and select Deploy.
  • Model Listener Hook : Using this hooks, you can do specific tasks whenever there is any CRUD operation in a specific model.
  1. Right click on the project-> Select Hook Plugin -> Choose Model Listeners Hook. 
  2. Choose the model by Clicking on Search. 
  3. Click Finish. Modify the code generated by Portal Pack Plugin, save it, Right click on the project and deploy. 
  • Jsp Hook : Using this hook, user can customize the core portal jsps/portlet in a decoupled manner without touching the core. For example, you can change the look and feel of the blog portlet in your hook application. And once you undeploy the hook application, the customization will go away. The Portal Pack provides wizard to create jsp hooks where user can select the core portal components which he/she wants to customize and the required files will be automatically imported to the hooks application. This feature can be used by SI for the portal customization.
  1. From the Hook Plugin Wizard choose the Jsp Hook from the drop down. Liferay Core jsp root folder(html) will be populated in the left pane. 
  2.  
  3. Once clicked on Finish, folder structure will be created under the default custom jsp directory "/WEB-INF/jsp".
  • Portal.properties Hook : You can override certain portal.properties through your hooks application.
  1. Select the Properties Hook from the drop down on a Clean Web Project(Which does not have a hook created to it).
  2. portal.properties will be create with commented pre entires supported to be overriden.

 

Undeploying Hooks:

All the deployed hook plugins can be undeployed from Netbeans -> Services -> Liferay Server -> Global -> Hooks.

Right Click on the Hook Plugin and selecting Undeploy will undeploy it from the Portal Server. 

 

該当件数: 1 件