Forums

Home » Liferay Sync

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pilar Hidalgo
spring hook
August 10, 2012 6:11 AM
Answer

Pilar Hidalgo

Rank: New Member

Posts: 14

Join Date: April 10, 2012

Recent Posts

Hi all,

I have a portlet that I need that it has information when system loads. I have thought a solution with spring. The doubt is if can be done to a hook by spring to do this initial load . I understand that this code is foreign to the portlet. thanks for your help!!
Ketan Patel
RE: spring hook
August 10, 2012 9:32 PM
Answer

Ketan Patel

Rank: Junior Member

Posts: 70

Join Date: May 4, 2012

Recent Posts

Hi Pilar Hidalgo,

Can you please explain your question in details? I am not getting what you want with spring hook.

Thanks,
Ketan Patel
Hitoshi Ozawa
RE: spring hook
August 11, 2012 1:56 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Following page in Liferay's document may be of some help. Maybe you can just add your event to the startup event list.

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/startup-events
Sagar A Vyas
RE: spring hook
August 12, 2012 2:06 AM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 655

Join Date: April 17, 2009

Recent Posts

Pilar Hidalgo:
Hi all,

I have a portlet that I need that it has information when system loads. I have thought a solution with spring. The doubt is if can be done to a hook by spring to do this initial load . I understand that this code is foreign to the portlet. thanks for your help!!


Hi Pillar,

You can achieve this kind of requirement by hook.

Hook is provide such facilities to override the event,you can override following events
1. Application startup event - If you want to execute certain code before server gets started.
2. Login Event (Pre/Post)
3. Service Event (Pre /Post)

I guess you need to create hook by overriding by application startup event.

Note : You will not have fully access of certain variable at that time,so be conscious for that. HOOKs

Thanks,
Sagar Vyas