public Collection getFrequencyUsingReportCodeAndClass(String reportCode, String reportClass) throws Exception { businessObjectService = KcServiceLocator.getService(BusinessObjectService.class); Map<String, String> classReportFreqParams = new HashMap<String, String>(); classReportFreqParams.put("reportCode", reportCode); classReportFreqParams.put("reportClassCode", reportClass); Collection<ValidClassReportFrequency> coll = businessObjectService.findMatching(ValidClassReportFrequency.class, classReportFreqParams); Set<String> frequencyCodes = new HashSet<String>(); if (!coll.isEmpty()) { for (ValidClassReportFrequency aVcrf : coll) { frequencyCodes.add(aVcrf.getFrequencyCode()); } } return frequencyCodes; }
public Collection getFrequencyBaseUsingFrequencyCode(String frequencyCode) throws Exception { businessObjectService = KcServiceLocator.getService(BusinessObjectService.class); Map<String, String> params = new HashMap<String, String>(); params.put("frequencyCode", frequencyCode); Collection<ValidFrequencyBase> coll = businessObjectService.findMatching(ValidFrequencyBase.class, params); Set<String> frequencyBaseCodes = new HashSet<String>(); if (!coll.isEmpty()) { for (ValidFrequencyBase aVcrf : coll) { frequencyBaseCodes.add(aVcrf.getFrequencyBaseCode()); } } return frequencyBaseCodes; }