Fórum

Liferay 7 - One time executable code

Ketan Solanki, modificado 6 Anos atrás.

Liferay 7 - One time executable code

Junior Member Postagens: 63 Data de Entrada: 28/05/14 Postagens Recentes
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
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
thumbnail
Manish Yadav, modificado 6 Anos atrás.

RE: Liferay 7 - One time executable code

Expert Postagens: 493 Data de Entrada: 26/05/12 Postagens Recentes
Ketan 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 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


Please check below URL

http://www.liferaysavvy.com/2016/07/liferay-upgrade-process.html