留言板

Liferay 7 - One time executable code

Ketan Solanki,修改在6 年前。

Liferay 7 - One time executable code

Junior Member 帖子: 63 加入日期: 14-5-28 最近的帖子
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,修改在6 年前。

RE: Liferay 7 - One time executable code

Expert 帖子: 493 加入日期: 12-5-26 最近的帖子
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