Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Debasis Padhi
To Work with Hooks
May 7, 2012 3:15 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 55

Join Date: March 23, 2012

Recent Posts

To override the out of the box features of Liferay we are use the Hook plugins
for example
  • to change in the Portal Properties,
  • Attach custom listners to Events
  • Jsps
______________________
Now create a new hook inside the plugin
create the exact folder structure for the source-file which is going to be changed or modified
example if we want to change in my jsp page then we have to create a folder structure of my .jsp file
docroot/META-INF/custom_jsps/html/portlet/myJsp

then do something change in your docroot/WEB-INF/liferay-hook.xml

<hook>
< !--for change in the portal properties -->
<portal-properties>portal.properties</portal-properties>

< !--for change in the Events -->
<event>
<event-class>com.project.object.ServicePreAction</event-class>
<event-type>servlet.service.events.pre.</event-type>
</event>

< !--for change in the Listner -->
<model-listener>
<model-listener-class>com.project.MyListner</model-listener-class>
<model-name>com.liferay.portlet.model.MyModel</model-name>
</model-listener>

< !--for change in the jsp file -->
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>

</hook>
Hitoshi Ozawa
RE: To Work with Hooks
April 12, 2012 5:26 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If you just want to share information you know, it may be better to create a wiki page instead of posting to a thread.emoticon
Debasis Padhi
RE: To Work with Hooks
May 7, 2012 3:18 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 55

Join Date: March 23, 2012

Recent Posts

Thank's dear One of my friend ask me about the above so I Transfer this information to him..
unfortunately he did not a logged-in user
Hitoshi Ozawa
RE: To Work with Hooks
May 7, 2012 7:32 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Is there a question in the first post? It's very to find what the question is. Can you restate the question in different terms?
David H Nebinger
RE: To Work with Hooks
May 7, 2012 7:51 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11295

Join Date: September 1, 2006

Recent Posts

Debasis Padhi:
Thank's dear One of my friend ask me about the above so I Transfer this information to him..
unfortunately he did not a logged-in user


Thanks for using the forum as your personal communication platform. Too bad there aren't more appropriate mechanisms like email, pastebin, ...
Hitoshi Ozawa
RE: To Work with Hooks
May 7, 2012 3:37 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Thanks for using the forum as your personal communication platform. Too bad there aren't more appropriate mechanisms like email, pastebin, ...


Thanks David. I now understand his reply. :-)
Debasis Padhi
RE: To Work with Hooks
May 16, 2012 6:13 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 55

Join Date: March 23, 2012

Recent Posts

Sory Hitoshi Ozawa
for using forums as my communication
Due to I'm new in liferay
I don't know how to create wikipage in liferay fourms
Hitoshi Ozawa
RE: To Work with Hooks
May 16, 2012 4:44 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Do you want to share your information with everybody or just to somebody you know?
Liferay wiki pages are to be used to share information about liferay. Once it's written, it shouldn't be deleted.
Debasis Padhi
RE: To Work with Hooks
May 18, 2012 3:54 AM
Answer

Debasis Padhi

Rank: Junior Member

Posts: 55

Join Date: March 23, 2012

Recent Posts

For the time being I want to share My knowledge with my followers
in my team who are out of station
Hitoshi Ozawa
RE: To Work with Hooks
May 18, 2012 4:13 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

For the time being I want to share My knowledge with my followers
in my team who are out of station


Then, you can write on your wall instead of in the forum. Just click on "Go to My Profile" and enter your content in the "Wall" and click "Post".