Search in sources :

Example 6 with ModuleService

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;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ContractsAndGrantsModuleService(org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService) 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) PostalCodeEbo(org.kuali.rice.location.framework.postalcode.PostalCodeEbo)

Example 7 with ModuleService

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;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ContractsAndGrantsModuleService(org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService) KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ModuleService(org.kuali.kfs.krad.service.ModuleService) CampusEbo(org.kuali.rice.location.framework.campus.CampusEbo) HashMap(java.util.HashMap) PersistableBusinessObject(org.kuali.kfs.krad.bo.PersistableBusinessObject)

Aggregations

HashMap (java.util.HashMap)7 KualiModuleService (org.kuali.kfs.krad.service.KualiModuleService)7 ModuleService (org.kuali.kfs.krad.service.ModuleService)7 PersistableBusinessObject (org.kuali.kfs.krad.bo.PersistableBusinessObject)6 ContractsAndGrantsModuleService (org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService)4 CampusEbo (org.kuali.rice.location.framework.campus.CampusEbo)2 PostalCodeEbo (org.kuali.rice.location.framework.postalcode.PostalCodeEbo)2 LinkedHashMap (java.util.LinkedHashMap)1 ContractsAndGrantsCfda (org.kuali.kfs.integration.cg.ContractsAndGrantsCfda)1 LaborModuleService (org.kuali.kfs.integration.ld.LaborModuleService)1 GlobalBusinessObject (org.kuali.kfs.krad.bo.GlobalBusinessObject)1 BusinessObject (org.kuali.rice.krad.bo.BusinessObject)1 CountryEbo (org.kuali.rice.location.framework.country.CountryEbo)1 StateEbo (org.kuali.rice.location.framework.state.StateEbo)1