use of edu.cornell.kfs.gl.batch.service.impl.GenericReversionCategory in project cu-kfs by CU-CommunityApps.
the class AccountReversionServiceImpl method getCategories.
/**
* @see org.kuali.kfs.coa.service.OrganizationReversionService#getCategories()
*/
public Map<String, ReversionCategoryLogic> getCategories() {
LOG.debug("getCategories() started");
Map<String, ReversionCategoryLogic> categories = new HashMap<String, ReversionCategoryLogic>();
Collection cats = accountReversionDao.getCategories();
for (Iterator iter = cats.iterator(); iter.hasNext(); ) {
ReversionCategory rc = (ReversionCategory) iter.next();
String categoryCode = rc.getReversionCategoryCode();
Map<String, ReversionCategoryLogic> beanMap = SpringContext.getBeansOfType(ReversionCategoryLogic.class);
if (beanMap.containsKey("gl" + categoryCode + "AccountReversionCategory")) {
LOG.info("Found Account Reversion Category Logic for gl" + categoryCode + "AccountReversionCategory");
categories.put(categoryCode, beanMap.get("gl" + categoryCode + "AccountReversionCategory"));
} else {
LOG.info("No Account Reversion Category Logic for gl" + categoryCode + "AccountReversionCategory; using generic");
GenericReversionCategory cat = SpringContext.getBean(GenericReversionCategory.class);
cat.setCategoryCode(categoryCode);
cat.setCategoryName(rc.getReversionCategoryName());
categories.put(categoryCode, (ReversionCategoryLogic) cat);
}
}
return categories;
}
Aggregations