Search in sources :

Example 1 with ModuleService

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;
}
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) StateEbo(org.kuali.rice.location.framework.state.StateEbo)

Example 2 with ModuleService

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

Example 3 with ModuleService

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;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) 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) LinkedHashMap(java.util.LinkedHashMap)

Example 4 with ModuleService

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;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ModuleService(org.kuali.kfs.krad.service.ModuleService) HashMap(java.util.HashMap) GlobalBusinessObject(org.kuali.kfs.krad.bo.GlobalBusinessObject) PersistableBusinessObject(org.kuali.kfs.krad.bo.PersistableBusinessObject) PostalCodeEbo(org.kuali.rice.location.framework.postalcode.PostalCodeEbo)

Example 5 with ModuleService

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;
}
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)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