掲示板

Create a new scheduler in a Liferay hook

11年前 に Pepe Perez によって更新されました。

Create a new scheduler in a Liferay hook

New Member 投稿: 14 参加年月日: 12/09/18 最新の投稿
Hi,

I need to create a new scheduler in Liferay 6.1.1 to execute a process every night at 3:00 AM, but I would like to do it in a new hook, not in a portlet. Please, is there any easy way to do this?

Thanks.

Regards.
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Not in a hook, no. You could do it via an EXT, but not a hook.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Is there a reason that you don't want to create a portlet instead of a hook? You're essentially adding a new functionality. It's possible to hard code the 3:00 AM but it's really better to create a configuration page where admin can set the time.
11年前 に Pepe Perez によって更新されました。

RE: Create a new scheduler in a Liferay hook

New Member 投稿: 14 参加年月日: 12/09/18 最新の投稿
Ok, if I do it with a portlet, is there any way to start the scheduler when Liferay is deployed?

Sorry if my question is kind of weird. I'm a beginner in this.

Thanks.

Regards.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Ok, if I do it with a portlet, is there any way to start the scheduler when Liferay is deployed?


What do you mean "Liferay is deployed"? Are you deploying liferay war file? Can just deploy the portlet war after deploying liferay war file.

If you mean when liferay is started, don't see any problem with using portlet.
thumbnail
11年前 に Vilmos Papp によって更新されました。

RE: Create a new scheduler in a Liferay hook

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
Hi,

Please check http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd and examine scheduler-entry element. If you specify it you can set your own scheduler for your portlet with the scheduling as well:


<scheduler-entry>
	<scheduler-event-listener-class>com.mycompany.portlet.test.TestPortlet</scheduler-event-listener-class>
	<trigger>
		<cron>
			<cron-trigger-value>0 0/1 * 1/1 * ? *</cron-trigger-value>
		</cron>
	</trigger>
</scheduler-entry>


Regards,
Vilmos
11年前 に Pepe Perez によって更新されました。

RE: Create a new scheduler in a Liferay hook

New Member 投稿: 14 参加年月日: 12/09/18 最新の投稿
Done :-)

Thank you all.

Regards.