Foros de discusión
Liferay 7 - One time executable code
Ketan Solanki, modificado hace 6 años.
Liferay 7 - One time executable code
Junior Member Mensajes: 63 Fecha de incorporación: 28/05/14 Mensajes recientes
Hi,
I want to create site and it's pages through program. First time I did it manually - one by one - on my local dev and so didn't realize the need but when I had to deploy the same on QA environment, I realized that this has to be done through program.
I found a few APIs like
which will be useful to get the task done.
I know that in Liferay 6.x I could have done it in Hook but hooks don't exist any more in Liferay 7 - OSGi components have taken over everything.
My requirement is that, I should execute this class just once at the time of deployment, then what type of class I should extend? Or at worse while server startup (I can control by checking if the site/page already exist with certain names then don't create)?
Can someone please let me know what type of component I should create for the task. I tried looking for blogs on internet, but haven't found a doc/blog which mentions above thing.
Thanks very much,
Ketan
I want to create site and it's pages through program. First time I did it manually - one by one - on my local dev and so didn't realize the need but when I had to deploy the same on QA environment, I realized that this has to be done through program.
I found a few APIs like
GroupLocalServiceUtil
LayoutLocalServiceUtil
which will be useful to get the task done.
I know that in Liferay 6.x I could have done it in Hook but hooks don't exist any more in Liferay 7 - OSGi components have taken over everything.
My requirement is that, I should execute this class just once at the time of deployment, then what type of class I should extend? Or at worse while server startup (I can control by checking if the site/page already exist with certain names then don't create)?
Can someone please let me know what type of component I should create for the task. I tried looking for blogs on internet, but haven't found a doc/blog which mentions above thing.
Thanks very much,
Ketan
Manish Yadav, modificado hace 6 años.
RE: Liferay 7 - One time executable code
Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientesKetan Solanki:
Hi,
I want to create site and it's pages through program. First time I did it manually - one by one - on my local dev and so didn't realize the need but when I had to deploy the same on QA environment, I realized that this has to be done through program.
I found a few APIs likeGroupLocalServiceUtil
LayoutLocalServiceUtil
which will be useful to get the task done.
I know that in Liferay 6.x I could have done it in Hook but hooks don't exist any more in Liferay 7 - OSGi components have taken over everything.
My requirement is that, I should execute this class just once at the time of deployment, then what type of class I should extend? Or at worse while server startup (I can control by checking if the site/page already exist with certain names then don't create)?
Can someone please let me know what type of component I should create for the task. I tried looking for blogs on internet, but haven't found a doc/blog which mentions above thing.
Thanks very much,
Ketan
Please check below URL
http://www.liferaysavvy.com/2016/07/liferay-upgrade-process.html