Fórum

Create a new scheduler in a Liferay hook

Pepe Perez, modificado 11 Anos atrás.

Create a new scheduler in a Liferay hook

New Member Postagens: 14 Data de Entrada: 18/09/12 Postagens Recentes
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, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Not in a hook, no. You could do it via an EXT, but not a hook.
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

New Member Postagens: 14 Data de Entrada: 18/09/12 Postagens Recentes
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, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
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, modificado 11 Anos atrás.

RE: Create a new scheduler in a Liferay hook

New Member Postagens: 14 Data de Entrada: 18/09/12 Postagens Recentes
Done :-)

Thank you all.

Regards.