use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class Account method getAccountState.
/**
* Gets the accountState attribute
*
* @return Returns the accountState
*/
@Override
public StateEbo getAccountState() {
if (StringUtils.isBlank(accountStateCode) || StringUtils.isBlank(accountCountryCode)) {
accountState = null;
} else {
if (accountState == null || !StringUtils.equals(accountState.getCode(), accountStateCode) || !StringUtils.equals(accountState.getCountryCode(), accountCountryCode)) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
if (moduleService != null) {
Map<String, Object> keys = new HashMap<String, Object>(2);
keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, accountCountryCode);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountStateCode);
accountState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return accountState;
}
use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class AccountGlobalRule method checkCfda.
private boolean checkCfda(String accountCfdaNumber) {
boolean success = true;
ContractsAndGrantsCfda cfda = null;
if (!StringUtils.isEmpty(accountCfdaNumber)) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(ContractsAndGrantsCfda.class);
if (moduleService != null) {
Map<String, Object> keys = new HashMap<String, Object>(1);
keys.put(KFSPropertyConstants.CFDA_NUMBER, accountCfdaNumber);
cfda = moduleService.getExternalizableBusinessObject(ContractsAndGrantsCfda.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
success = (ObjectUtils.isNull(cfda)) ? false : true;
if (!success) {
putFieldError(KFSPropertyConstants.CATALOG_OF_DOMESTIC_ASSISTANCE_NUMBER, KFSKeyConstants.ERROR_DOCUMENT_GLOBAL_ACCOUNT_CFDA_NUMBER_INVALID);
}
}
return success;
}
use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherBatchDefault method getCampus.
/**
* Gets the campus attribute.
*
* @return Returns the campus.
*/
public CampusEbo getCampus() {
if (StringUtils.isBlank(campusCode)) {
campus = null;
} else {
if (campus == null || !StringUtils.equals(campus.getCode(), campusCode)) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
if (moduleService != null) {
Map<String, Object> keys = new HashMap<String, Object>(1);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, campusCode);
campus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return campus;
}
use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class OrganizationGlobal method getPostalZip.
public PostalCodeEbo getPostalZip() {
// Copied zip-code-updating logic from Organization BO.
if (StringUtils.isBlank(organizationZipCode) || StringUtils.isBlank(organizationCountryCode)) {
postalZip = null;
} else {
if (postalZip == null || !StringUtils.equals(postalZip.getCode(), organizationZipCode) || !StringUtils.equals(postalZip.getCountryCode(), organizationCountryCode)) {
ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
if (moduleService != null) {
Map<String, Object> keys = new HashMap<String, Object>(2);
keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, organizationCountryCode);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, organizationZipCode);
postalZip = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return postalZip;
}
use of org.kuali.kfs.krad.service.ModuleService 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;
}
Aggregations