Search in sources :

Example 1 with StateEbo

use of org.kuali.rice.location.framework.state.StateEbo 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)

Aggregations

HashMap (java.util.HashMap)1 ContractsAndGrantsModuleService (org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService)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 StateEbo (org.kuali.rice.location.framework.state.StateEbo)1