use of org.mifos.dto.domain.ValueListElement in project head by mifos.
the class PersonAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
PersonActionForm personActionForm = (PersonActionForm) form;
Short officeId = getShortValue(personActionForm.getOfficeId());
OfficeBO office = this.officeDao.findOfficeById(officeId);
SessionUtils.setAttribute(PersonnelConstants.OFFICE, office, request);
personActionForm.clear();
//Shahid - keeping the previous session objects for the sake of existing tests, once fully converted to spring
//then we can get rid of the session objects made redundant by the dto
DefinePersonnelDto definePersonnelDto = this.personnelServiceFacade.retrieveInfoForNewUserDefinition(officeId);
SessionUtils.setAttribute("definePersonnelDto", definePersonnelDto, request);
List<ValueListElement> titles = this.customerDao.retrieveTitles();
List<ValueListElement> genders = this.customerDao.retrieveGenders();
List<ValueListElement> maritalStatuses = this.customerDao.retrieveMaritalStatuses();
List<ValueListElement> languages = Localization.getInstance().getLocaleForUI();
List<RoleBO> roles = legacyRolesPermissionsDao.getRoles();
List<PersonnelLevelEntity> personnelLevels = this.customerDao.retrievePersonnelLevels();
SessionUtils.setCollectionAttribute(PersonnelConstants.TITLE_LIST, titles, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, personnelLevels, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.GENDER_LIST, genders, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.MARITAL_STATUS_LIST, maritalStatuses, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.LANGUAGE_LIST, languages, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLES_LIST, roles, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLEMASTERLIST, roles, request);
List<CustomFieldDefinitionEntity> customFieldDefs1 = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, customFieldDefs1, request);
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
personActionForm.setCustomFields(customFields);
if (office.getOfficeLevel() != OfficeLevel.BRANCHOFFICE) {
for (MasterDataEntity level : personnelLevels) {
if (level.getId().equals(PersonnelLevel.LOAN_OFFICER.getValue())) {
personnelLevels.remove(level);
break;
}
}
}
personActionForm.setCustomFields(new ArrayList<CustomFieldDto>());
personActionForm.setDateOfJoiningMFI(DateUtils.makeDateAsSentFromBrowser());
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.ValueListElement in project head by mifos.
the class PersonAction method get.
@TransactionDemarcate(saveToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
PersonActionForm personActionForm = (PersonActionForm) form;
String globalId = request.getParameter("globalPersonnelNum");
if (globalId == null) {
globalId = personActionForm.getGlobalPersonnelNum();
}
PersonnelInformationDto personnelInformationDto = this.personnelServiceFacade.getPersonnelInformationDto(null, globalId);
SessionUtils.removeThenSetAttribute("personnelInformationDto", personnelInformationDto, request);
// John W - for other actions downstream (like edit) business_key set (until all actions refactored)
PersonnelBO personnelBO = this.personnelDao.findPersonnelById(personnelInformationDto.getPersonnelId());
SessionUtils.removeThenSetAttribute(Constants.BUSINESS_KEY, personnelBO, request);
String url = String.format("PersonAction.do?globalPersonnelNum=%s", personnelBO.getGlobalPersonnelNum());
SessionUtils.removeThenSetAttribute("currentPageUrl", url, request);
List<ValueListElement> titles = this.customerDao.retrieveTitles();
List<ValueListElement> genders = this.customerDao.retrieveGenders();
List<ValueListElement> maritalStatuses = this.customerDao.retrieveMaritalStatuses();
List<ValueListElement> languages = Localization.getInstance().getLocaleForUI();
List<RoleBO> roles = legacyRolesPermissionsDao.getRoles();
List<PersonnelLevelEntity> personnelLevels = this.customerDao.retrievePersonnelLevels();
for (PersonnelLevelEntity personnelLevelEntity : personnelLevels) {
String messageTextLookup = ApplicationContextProvider.getBean(MessageLookup.class).lookup(personnelLevelEntity.getLookUpValue().getPropertiesKey());
personnelLevelEntity.setName(messageTextLookup);
}
SessionUtils.setCollectionAttribute(PersonnelConstants.TITLE_LIST, titles, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, personnelLevels, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.GENDER_LIST, genders, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.MARITAL_STATUS_LIST, maritalStatuses, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.LANGUAGE_LIST, languages, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLES_LIST, roles, request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLEMASTERLIST, roles, request);
List<CustomFieldDefinitionEntity> customFieldDefs1 = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, customFieldDefs1, request);
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
personActionForm.setCustomFields(customFields);
return mapping.findForward(ActionForwards.get_success.toString());
}
use of org.mifos.dto.domain.ValueListElement in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveClientDropdownData.
private ClientDropdownsDto retrieveClientDropdownData() {
List<ValueListElement> salutations = this.customerDao.retrieveSalutations();
List<ValueListElement> genders = this.customerDao.retrieveGenders();
List<ValueListElement> maritalStatuses = this.customerDao.retrieveMaritalStatuses();
List<ValueListElement> citizenship = this.customerDao.retrieveCitizenship();
List<ValueListElement> ethnicity = this.customerDao.retrieveEthnicity();
List<ValueListElement> educationLevels = this.customerDao.retrieveEducationLevels();
List<ValueListElement> businessActivity = this.customerDao.retrieveBusinessActivities();
List<ValueListElement> poverty = this.customerDao.retrievePoverty();
List<ValueListElement> handicapped = this.customerDao.retrieveHandicapped();
List<ValueListElement> livingStatus = this.customerDao.retrieveLivingStatus();
ClientDropdownsDto clientDropdowns = new ClientDropdownsDto(salutations, genders, maritalStatuses, citizenship, ethnicity, educationLevels, businessActivity, poverty, handicapped, livingStatus);
return clientDropdowns;
}
use of org.mifos.dto.domain.ValueListElement in project head by mifos.
the class ClientServiceFacadeWebTier method retrieveClientFamilyDetails.
@Override
public ClientFamilyDetailsDto retrieveClientFamilyDetails() {
List<ValueListElement> genders = new ArrayList<ValueListElement>();
List<ValueListElement> livingStatus = new ArrayList<ValueListElement>();
List<FamilyDetailDto> familyDetails = new ArrayList<FamilyDetailDto>();
boolean familyDetailsRequired = ClientRules.isFamilyDetailsRequired();
if (familyDetailsRequired) {
genders = this.customerDao.retrieveGenders();
livingStatus = this.customerDao.retrieveLivingStatus();
familyDetails.add(new FamilyDetailDto());
}
return new ClientFamilyDetailsDto(familyDetailsRequired, familyDetails, genders, livingStatus);
}
use of org.mifos.dto.domain.ValueListElement in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveMultipleLoanAccountDetails.
@Override
public MultipleLoanAccountDetailsDto retrieveMultipleLoanAccountDetails(String searchId, Short branchId, Integer productId) {
List<ClientBO> clients = this.customerDao.findActiveClientsUnderParent(searchId, branchId);
if (clients.isEmpty()) {
throw new BusinessRuleException(LoanConstants.NOSEARCHRESULTS);
}
LoanOfferingBO loanOffering = this.loanProductDao.findById(productId);
// FIXME - Refactor MultipleLoanCreationDto into proper Dto
List<MultipleLoanCreationDto> multipleLoanDetails = buildClientViewHelper(loanOffering, clients);
List<ValueListElement> allLoanPruposes = this.loanProductDao.findAllLoanPurposes();
boolean loanPendingApprovalStateEnabled = ProcessFlowRules.isLoanPendingApprovalStateEnabled();
return new MultipleLoanAccountDetailsDto(allLoanPruposes, loanPendingApprovalStateEnabled);
}
Aggregations