Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Shashant Panwar
Dynamic cron values for cron-trigger-tag
15 de enero de 2013 13:19
Respuesta

Shashant Panwar

Ranking: New Member

Mensajes: 19

Fecha de incorporación: 21 de septiembre de 2012

Mensajes recientes

Is there any way I can dynamically pass cron values to cron-trigger-value tag or stop it dynamically.
My scenario is: I will receive a file at a location, my job will keep on polling on that directory .the moment job will get the file it will process it.
Now I want to stop the job once I am done with my file(or make sure it will look for next month now),so that it will not process the file recursively as I have a limitation neither I can remove the file nor change the name.
I have to run the job on 24th of every month.

Thanks,
Shashant
Hitoshi Ozawa
RE: Dynamic cron values for cron-trigger-tag
15 de enero de 2013 13:57
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

Instead of using tags, you'll need to programmatically create quartz jobs.

See the following thread for information:
http://www.liferay.com/community/forums/-/message_boards/message/11799978
Shashant Panwar
RE: Dynamic cron values for cron-trigger-tag
16 de enero de 2013 14:43
Respuesta

Shashant Panwar

Ranking: New Member

Mensajes: 19

Fecha de incorporación: 21 de septiembre de 2012

Mensajes recientes

Thanks for the post.But I am still not getting the concept of scheduling via program.
Can you or somebody explain it in a easier way?
I am unable to understand how stuff will work without entry in liferay-portlet.xml.
How this whole Schedular entry thing works?

SchedulerEntry entry = new SchedulerEntryImpl();
entry.setEventListenerClass(someClassName);
entry.setTriggerValue(someCronString);
entry.setTriggerType(TriggerType.CRON);
entry.setDescription(someClassName);

SchedulerEngineUtil.schedule(entry, this.getClass().getClassLoader());


Thanks for the help in advance.
Shashant
Hitoshi Ozawa
RE: Dynamic cron values for cron-trigger-tag
28 de enero de 2013 3:50
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

Check the following code for an usage sample:
\portal-impl\src\com\liferay\portlet\messageboards\service\impl\MBMailingListLocalServiceImpl.java

row 197: protected void scheduleMailingList(MBMailingList mailingList)
Shashant Panwar
RE: Dynamic cron values for cron-trigger-tag
29 de enero de 2013 12:30
Respuesta

Shashant Panwar

Ranking: New Member

Mensajes: 19

Fecha de incorporación: 21 de septiembre de 2012

Mensajes recientes

Thanks Hitoshi.
I will take a look and try to implement it programmaticaly.