Event Hook
We know about the Event in Servlet. Event is nothing
but whenever we want we can deploy the application and whenever we don’t want
we can undeploy, likewise user log-In, user-Logout . These are the some of the
events in web application. In this way
we are having preprocess and
postprocess.
In Event hook we can customize the community. We can
implement user-defined community by
Overriding run().
Here 1st
we need to create User and Community. After creating them add User to Community.
Note: It is used to change the URL (web/guest/home
to web/suresh)
How to Create Event Hook ?
· Create Liferay Project
> Project Name > Select the Plugin HOOK >click on finish
· Right click on Project
>New => Liferay Hook > select portal.properties > click on Next
· Go to ‘Define
action to be execute on portal event’ and click add then select one from the
list for say ‘login.event.post’.
· Create a new
class (custom class along with the package. Superclass: Action), to create a class you have to go New then
Give
custom class name, package and superclass (as Action)
· Create ‘User’ and
a ‘Community’. Assign user to community
· Override run()
method .
No comments:
Post a Comment