Search in sources :

Example 1 with OfficeStatusEntity

use of org.mifos.customers.office.business.OfficeStatusEntity in project head by mifos.

the class AuditConfiguration method fetchMasterData.

private void fetchMasterData(String entityName, Short localeId, String classPath) throws SystemException {
    Class clazz = null;
    try {
        clazz = Thread.currentThread().getContextClassLoader().loadClass(classPath);
    } catch (ClassNotFoundException e) {
        throw new SystemException(e);
    }
    List<MasterDataEntity> masterDataList = legacyMasterDao.findMasterDataEntities(clazz);
    for (MasterDataEntity masterDataEntity : masterDataList) {
        if (masterDataEntity instanceof PersonnelStatusEntity) {
            String name = ApplicationContextProvider.getBean(MessageLookup.class).lookup(masterDataEntity.getLookUpValue());
            ((PersonnelStatusEntity) masterDataEntity).setName(name);
        }
        if (masterDataEntity instanceof PersonnelLevelEntity) {
            String name = ApplicationContextProvider.getBean(MessageLookup.class).lookup(masterDataEntity.getLookUpValue());
            ((PersonnelLevelEntity) masterDataEntity).setName(name);
        }
        if (masterDataEntity instanceof OfficeLevelEntity) {
            String name = ApplicationContextProvider.getBean(MessageLookup.class).lookup(masterDataEntity.getLookUpValue());
            ((OfficeLevelEntity) masterDataEntity).setName(name);
        }
        if (masterDataEntity instanceof OfficeStatusEntity) {
            String name = ApplicationContextProvider.getBean(MessageLookup.class).lookup(masterDataEntity.getLookUpValue());
            ((OfficeStatusEntity) masterDataEntity).setName(name);
        }
        valueMap.put(masterDataEntity.getId().toString(), masterDataEntity.getName());
    }
}
Also used : SystemException(org.mifos.framework.exceptions.SystemException) MasterDataEntity(org.mifos.application.master.business.MasterDataEntity) MessageLookup(org.mifos.application.master.MessageLookup) PersonnelLevelEntity(org.mifos.customers.personnel.business.PersonnelLevelEntity) OfficeStatusEntity(org.mifos.customers.office.business.OfficeStatusEntity) PersonnelStatusEntity(org.mifos.customers.personnel.business.PersonnelStatusEntity) OfficeLevelEntity(org.mifos.customers.office.business.OfficeLevelEntity)

Aggregations

MessageLookup (org.mifos.application.master.MessageLookup)1 MasterDataEntity (org.mifos.application.master.business.MasterDataEntity)1 OfficeLevelEntity (org.mifos.customers.office.business.OfficeLevelEntity)1 OfficeStatusEntity (org.mifos.customers.office.business.OfficeStatusEntity)1 PersonnelLevelEntity (org.mifos.customers.personnel.business.PersonnelLevelEntity)1 PersonnelStatusEntity (org.mifos.customers.personnel.business.PersonnelStatusEntity)1 SystemException (org.mifos.framework.exceptions.SystemException)1