March 24
Tim Telcik commented on LPS-36180.
2:14 AM Hello Kenneth, I also see a requirement for supporting timezones in the Liferay Portal scheduler API that wraps the Quartz API. One possible approach to support timezones for Quartz is to define the timezone ID in the “liferay-portlet.xml” config file. {code} <trigger> <cron> <cron-trigger-value>0 15 17 * * ?</cron-trigger-value> <cron-trigger-timezone>Australia/Brisbane</cron-trigger-timezone> </cron> </trigger> {code} The revised “liferay-portlet.xml” config could then be loaded by class “com.liferay.portal.scheduler.quartz.QuartzSchedulerEngine”. {code} package com.liferay.portal.scheduler.quartz; public class QuartzSchedulerEngine implements SchedulerEngine { protected Trigger getQuartzTrigger( com.liferay.portal.kernel.scheduler.Trigger trigger) throws SchedulerException { // code removed for clarity if (triggerType.equals(TriggerType.CRON)) { TriggerBuilder<Trigger>triggerBuilder = TriggerBuilder.newTrigger(); triggerBuilder.endAt(endDate); triggerBuilder.forJob(jobName, groupName); triggerBuilder.startAt(startDate); triggerBuilder.withIdentity(jobName, groupName); CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule( (String)trigger.getTriggerContent()); // // BEGIN LPS-36180 PATCH // // NOTE: Class “com.liferay.portal.kernel.scheduler.Trigger” must also be updated with “timezone” member/setter/getter // cronScheduleBuilder.inTimezone(trigger.getTriggerTimezone()); // // END LPS-36180 PATCH // triggerBuilder.withSchedule(cronScheduleBuilder); quartzTrigger =; } } // code removed for clarity } {code} This potential approach will need to reviewed, but may provide a starting point for a solution. Regards, Tim
February 26
Tim Telcik commented on James Falkner's blog entry, I am on-board too...., in James Falkner.
7:38 PM
Subscribe to Tim Telcik's activities. (Opens New Window)