Aktivitäten

März 24
Tim Telcik kommentierte LPS-36180.
02:14 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 = triggerBuilder.build(); } } // code removed for clarity } {code} This potential approach will need to reviewed, but may provide a starting point for a solution. Regards, Tim
Februar 26
Tim Telcik kommentierte den Blog von James Falkner, I am on-board too.... in James Falkner.
19:38
Die Aktivitäten von Tim Telcik abonnieren. (Öffnet neues Fenster)