Prev | Current Page 698 | Next

Frank Zammetti

"Practical DWR 2 Projects"

nextToken();
String reportName = inRSD.getReportName() + gc.get(Calendar.HOUR_OF_DAY) +
gc.get(Calendar.MINUTE) + nextDay;
JobDetail jobDetail =
new JobDetail(reportName, null, ReportRunner.class);
JobDataMap dataMap = jobDetail.getJobDataMap();
dataMap.put("reportName", inRSD.getReportName());
dataMap.put("runTime", inRSD.getRunTime().toString());
dataMap.put("daysOfWeek", inRSD.getDaysOfWeek());
int day = 0;
if (nextDay.equalsIgnoreCase("SUN")) { day = 1; }
if (nextDay.equalsIgnoreCase("MON")) { day = 2; }
if (nextDay.equalsIgnoreCase("TUE")) { day = 3; }
if (nextDay.equalsIgnoreCase("WED")) { day = 4; }
if (nextDay.equalsIgnoreCase("THU")) { day = 5; }
if (nextDay.equalsIgnoreCase("FRI")) { day = 6; }
if (nextDay.equalsIgnoreCase("SAT")) { day = 7; }
CHAPTER 7 n ENTER THE ENTERPRISE: A DWR-BASED REPORT PORTAL 413
Trigger trigger = TriggerUtils.makeWeeklyTrigger(day,
gc.get(Calendar.HOUR_OF_DAY), gc.get(Calendar.MINUTE));
trigger.setStartTime(new Date());
trigger.setName(reportName + "_Trigger");
sched.scheduleJob(jobDetail, trigger);
}
}
First, a Calendar (more specifically, a subclass of Calendar, GregorianCalendar) is instantiated
and its time set to the time specified by the incoming ReportScheduleDescriptor object.


Pages:
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710