Search in sources :

Example 1 with CountryEbo

use of org.kuali.rice.location.framework.country.CountryEbo in project cu-kfs by CU-CommunityApps.

the class PurchasingAccountsPayableDocumentBase method getVendorCountry.

@Override
public CountryEbo getVendorCountry() {
    if (StringUtils.isBlank(vendorCountryCode)) {
        vendorCountry = null;
    } else {
        if (vendorCountry == null || !StringUtils.equals(vendorCountry.getCode(), vendorCountryCode)) {
            ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CountryEbo.class);
            if (moduleService != null) {
                Map<String, Object> keys = new HashMap<String, Object>(1);
                keys.put(LocationConstants.PrimaryKeyConstants.CODE, vendorCountryCode);
                vendorCountry = moduleService.getExternalizableBusinessObject(CountryEbo.class, keys);
            } else {
                throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed.");
            }
        }
    }
    return vendorCountry;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) CountryEbo(org.kuali.rice.location.framework.country.CountryEbo) KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ModuleService(org.kuali.kfs.krad.service.ModuleService) HashMap(java.util.HashMap) PersistableBusinessObject(org.kuali.kfs.krad.bo.PersistableBusinessObject)

Aggregations

HashMap (java.util.HashMap)1 PersistableBusinessObject (org.kuali.kfs.krad.bo.PersistableBusinessObject)1 KualiModuleService (org.kuali.kfs.krad.service.KualiModuleService)1 ModuleService (org.kuali.kfs.krad.service.ModuleService)1 CountryEbo (org.kuali.rice.location.framework.country.CountryEbo)1