Foros de discusión
Start up Hook
Tony Turner, modificado hace 11 años.
Start up Hook
New Member Mensajes: 4 Fecha de incorporación: 31/05/12 Mensajes recientes
Hi all
What's the latest thinking behind creating a start up hook (to, say, add pages to the site) that only runs when the portal starts for the very first time?
I have checked for the existence of the Hello World portlet before, but it doesn't appear to be a very fool proof method.
I want the hook to create all the portal pages and maybe add some portlets to the page on very first start-up and not on subsequent restarts.
Cheers
Tony
What's the latest thinking behind creating a start up hook (to, say, add pages to the site) that only runs when the portal starts for the very first time?
I have checked for the existence of the Hello World portlet before, but it doesn't appear to be a very fool proof method.
I want the hook to create all the portal pages and maybe add some portlets to the page on very first start-up and not on subsequent restarts.
Cheers
Tony
Masroor Khan, modificado hace 11 años.
RE: Start up Hook
Regular Member Mensajes: 124 Fecha de incorporación: 9/09/08 Mensajes recientes
Hi,
You can do this by using AppStartupAction.java
you can override this action by using hook.
Regards,
Masroor
You can do this by using AppStartupAction.java
you can override this action by using hook.
Regards,
Masroor
Siby Mathew, modificado hace 11 años.
RE: Start up Hook
Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Hi Tony,
You can create a hook and override : global.startup.events
Thanks,
Siby
You can create a hook and override : global.startup.events
Thanks,
Siby
Tony Turner, modificado hace 11 años.
RE: Start up Hook
New Member Mensajes: 4 Fecha de incorporación: 31/05/12 Mensajes recientes
Thanks.
I probably didn't make myself clear.
I want to run a hook only when the portal initializes the very first time (i.e. when first deployed and runs SQL scripts etc).
From my understanding the global.startup.events action runs every time the portal starts up.
I can put code in the hook to check for a particular database table or to look for the existence of the hello world portlet that is on the page by default by it doesn't seem like a very clean solution.;
I probably didn't make myself clear.
I want to run a hook only when the portal initializes the very first time (i.e. when first deployed and runs SQL scripts etc).
From my understanding the global.startup.events action runs every time the portal starts up.
I can put code in the hook to check for a particular database table or to look for the existence of the hello world portlet that is on the page by default by it doesn't seem like a very clean solution.;
Bart Simpson, modificado hace 11 años.
RE: Start up Hook
Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
You should have a look at sevencogs hooks, which runs only once as well as liferay's upgrade process. As I remember in seven cogs it check some db value and then decides to execute or not.
Tony Turner, modificado hace 11 años.
RE: Start up Hook
New Member Mensajes: 4 Fecha de incorporación: 31/05/12 Mensajes recientes
Related post:
http://www.liferay.com/community/forums/-/message_boards/message/15593264
http://www.liferay.com/community/forums/-/message_boards/message/15593264