留言板

Create a new scheduler in a Liferay hook

Pepe Perez,修改在11 年前。

Create a new scheduler in a Liferay hook

New Member 帖子: 14 加入日期: 12-9-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
David H Nebinger,修改在11 年前。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Not in a hook, no. You could do it via an EXT, but not a hook.
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 帖子: 7942 加入日期: 10-3-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.
Pepe Perez,修改在11 年前。

RE: Create a new scheduler in a Liferay hook

New Member 帖子: 14 加入日期: 12-9-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
Hitoshi Ozawa,修改在11 年前。

RE: Create a new scheduler in a Liferay hook

Liferay Legend 帖子: 7942 加入日期: 10-3-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
Vilmos Papp,修改在11 年前。

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
Pepe Perez,修改在11 年前。

RE: Create a new scheduler in a Liferay hook

New Member 帖子: 14 加入日期: 12-9-18 最近的帖子
Done :-)

Thank you all.

Regards.