use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class Account method getPostalZipCode.
/**
* Gets the postalZipCode attribute.
*
* @return Returns the postalZipCode.
*/
@Override
public PostalCodeEbo getPostalZipCode() {
if (StringUtils.isBlank(accountZipCode) || StringUtils.isBlank(accountCountryCode)) {
postalZipCode = null;
} else {
if (postalZipCode == null || !StringUtils.equals(postalZipCode.getCode(), accountZipCode) || !StringUtils.equals(postalZipCode.getCountryCode(), accountCountryCode)) {
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, accountCountryCode);
keys.put(LocationConstants.PrimaryKeyConstants.CODE, accountZipCode);
postalZipCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return postalZipCode;
}
use of org.kuali.kfs.krad.service.ModuleService in project cu-kfs by CU-CommunityApps.
the class Account method getAccountPhysicalCampus.
/**
* Gets the accountPhysicalCampus attribute.
*
* @return Returns the accountPhysicalCampus
*/
@Override
public CampusEbo getAccountPhysicalCampus() {
if (StringUtils.isBlank(accountPhysicalCampusCode)) {
accountPhysicalCampus = null;
} else {
if (accountPhysicalCampus == null || !StringUtils.equals(accountPhysicalCampus.getCode(), accountPhysicalCampusCode)) {
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, accountPhysicalCampusCode);
accountPhysicalCampus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
} else {
throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.");
}
}
}
return accountPhysicalCampus;
}
Aggregations