Documentation
Liferay provides a rich store of resources and knowledge to help our community better use and work with our technology.
Creating a Hook
Hooks are stored within the hooks directory of the plugins directory. Navigate to this directory in terminal and enter the following command to create a new hook (Linux and Mac OS X):
./create.sh example "Example"
On Windows enter the following instead:
create.bat example "Example"
You should get a BUILD SUCCESSFUL message from Ant, and there will now be a new folder inside of the hooks folder in your Plugins SDK. Notice that the Plugins SDK automatically appends "-hook" to the project name when creating this folder.
Deploying the Hook
Open a terminal window in your hooks/example-hook directory and enter this command:
ant deploy
You should get a BUILD SUCCESSFUL message, which means that your hook is now being deployed. If you switch to the terminal window running Liferay, and wait for a few seconds, you should see the message "Hook for example-hook is available for use." However, unlike portlets or themes, your new hook doesn't actually do anything yet.