@Override public Collection findMatching(Map fieldValues) { List<AwardDTO> result = null; AwardFieldValuesDto criteria = new AwardFieldValuesDto(); criteria.setAwardId((Long) fieldValues.get(KFSPropertyConstants.PROPOSAL_NUMBER)); criteria.setAwardNumber((String) fieldValues.get("awardNumber")); criteria.setChartOfAccounts( (String) fieldValues.get(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE)); criteria.setAccountNumber((String) fieldValues.get(KFSPropertyConstants.ACCOUNT_NUMBER)); criteria.setPrincipalInvestigatorId((String) fieldValues.get("principalId")); try { result = this.getWebService().getMatchingAwards(criteria); } catch (WebServiceException ex) { GlobalVariablesExtractHelper.insertError( KcConstants.WEBSERVICE_UNREACHABLE, KfsService.getWebServiceServerName()); } if (result == null) { return new ArrayList(); } else { List<Award> awards = new ArrayList<Award>(); for (AwardDTO dto : result) { awards.add(awardFromDTO(dto)); } return awards; } }
public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) { List<AwardDTO> result = null; AwardSearchCriteriaDto criteria = new AwardSearchCriteriaDto(); criteria.setAwardId(fieldValues.get(KFSPropertyConstants.PROPOSAL_NUMBER)); criteria.setAwardNumber(fieldValues.get("awardNumber")); criteria.setChartOfAccounts(fieldValues.get(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE)); criteria.setAccountNumber(fieldValues.get(KFSPropertyConstants.ACCOUNT_NUMBER)); criteria.setPrincipalInvestigatorId(fieldValues.get("principalId")); criteria.setSponsorCode(fieldValues.get("agencyNumber")); // the below should only be passed in from the lookup framework, meaning they will all be // strings criteria.setStartDate(fieldValues.get("awardBeginningDate")); criteria.setStartDateLowerBound(fieldValues.get("rangeLowerBoundKeyPrefix_awardBeginningDate")); criteria.setEndDate(fieldValues.get("awardEndingDate")); criteria.setEndDateLowerBound(fieldValues.get("rangeLowerBoundKeyPrefix_awardEndingDate")); criteria.setBillingFrequency(fieldValues.get("awardBillingFrequency")); criteria.setAwardTotal(fieldValues.get("awardTotal")); try { result = this.getWebService().searchAwards(criteria); } catch (WebServiceException ex) { GlobalVariablesExtractHelper.insertError( KcConstants.WEBSERVICE_UNREACHABLE, KfsService.getWebServiceServerName()); } if (result == null) { return new ArrayList(); } else { List<Award> awards = new ArrayList<Award>(); for (AwardDTO dto : result) { awards.add(awardFromDTO(dto)); } return awards; } }
@Override public Collection findMatching(Map fieldValues) { List<SponsorDTO> result = null; SponsorCriteriaDto criteria = new SponsorCriteriaDto(); criteria.setSponsorCode((String) fieldValues.get("agencyNumber")); criteria.setCustomerNumber((String) fieldValues.get("customerNumber")); try { result = this.getWebService().getMatchingSponsors(criteria); } catch (WebServiceException ex) { GlobalVariablesExtractHelper.insertError( KcConstants.WEBSERVICE_UNREACHABLE, KfsService.getWebServiceServerName()); } if (result == null) { return new ArrayList(); } else { List<Agency> agencies = new ArrayList<Agency>(); for (SponsorDTO dto : result) { agencies.add(new Agency(dto)); } return agencies; } }