private void countForConfiguredJobsForSystemJobs(IConfiguredScheduledJob[] list, SystemJobVoCollection jobs, TreeMap<IScheduledJob, Integer> map) { for(int i = 0; i < jobs.size(); i++) { IScheduledJob systemJob = jobs.get(i); Integer count = 0; map.put(systemJob, count); for (int j = 0; j < list.length; j++) { if (list[j].getScheduledJob().equals(jobs.get(i))) { map.put(systemJob, count += 1); } } } }
private void populateDyngrdSystemJobs(IConfiguredScheduledJob[] configuredJobs, ISchedulerServlet servletInstance) throws Exception { TreeMap<IScheduledJob, Integer> map = new TreeMap<IScheduledJob, Integer>(); SystemJobVoCollection availableJobs = domain.listAvailableSystemJobs(); countForConfiguredJobsForSystemJobs(configuredJobs, availableJobs, map); form.dyngrdSystemJobs().getRows().clear(); for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { SystemJobVo systemJob = (SystemJobVo) iter.next(); addParentSystemRow(map, systemJob); } form.dyngrdSystemJobs().setFooterValue("Total: " + availableJobs.size() + " available system jobs"); form.dyngrdSystemJobs().setValue(form.getGlobalContext().Admin.getSystemJob()); if (form.dyngrdSystemJobs().getSelectedRow() != null) { onDyngrdSystemJobsRowSelectionChanged(form.dyngrdSystemJobs().getSelectedRow()); } }
public SystemJobVoCollection listAvailableSystemJobs() { DomainFactory factory = getDomainFactory(); String hqlString = "from SystemJob job where job.isActive = :ACTIVE"; List jobs = factory.find(hqlString, new String[] {"ACTIVE"}, new Object[] {Boolean.TRUE}); return SystemJobVoAssembler.createSystemJobVoCollectionFromSystemJob(jobs); }