@Override public List<SubAward> getLinkedSubAwards(Award award) { Map<String, Object> values = new HashMap<String, Object>(); values.put("awardId", award.getAwardId()); Collection<SubAwardFundingSource> subAwardFundingSources = businessObjectService.findMatching(SubAwardFundingSource.class, values); Set<String> subAwardSet = new TreeSet<String>(); for (SubAwardFundingSource subAwardFundingSource : subAwardFundingSources) { subAwardSet.add(subAwardFundingSource.getSubAward().getSubAwardCode()); } List<SubAward> subAwards = new ArrayList<SubAward>(); for (String subAwardCode : subAwardSet) { VersionHistory activeVersion = getVersionHistoryService().findActiveVersion(SubAward.class, subAwardCode); if (activeVersion == null) { VersionHistory pendingVersion = getVersionHistoryService().findPendingVersion(SubAward.class, subAwardCode); if (pendingVersion != null) { subAwards.add((SubAward) pendingVersion.getSequenceOwner()); } } else { subAwards.add((SubAward) activeVersion.getSequenceOwner()); } } return subAwards; }
protected AnchorHtmlData getCopyLink(Award award, Boolean readOnly) { AnchorHtmlData htmlData = new AnchorHtmlData(); htmlData.setDisplayText("copy"); Properties parameters = new Properties(); parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, "awardActions"); parameters.put(KNSConstants.PARAMETER_COMMAND, KEWConstants.DOCSEARCH_COMMAND); parameters.put(KNSConstants.DOCUMENT_TYPE_NAME, getDocumentTypeName()); parameters.put("viewDocument", readOnly.toString()); parameters.put("docId", award.getAwardDocument().getDocumentNumber()); parameters.put("docOpenedFromAwardSearch", "true"); parameters.put("placeHolderAwardId", award.getAwardId().toString()); String href = UrlFactory.parameterizeUrl("../" + getHtmlAction(), parameters); htmlData.setHref(href); return htmlData; }
/** * This method is used to return the cfda number of an award. * * @see org.kuali.kra.external.Cfda.service.CfdaNumberService#getCfdaNumber(java.lang.String) */ public List<CfdaDTO> getCfdaNumber( String financialAccountNumber, String financialChartOfAccounts) { List<Award> awards = getAwards(financialAccountNumber, financialChartOfAccounts); List<CfdaDTO> cfdaNumbers = new ArrayList<CfdaDTO>(); if (ObjectUtils.isNotNull(awards)) { for (Award award : awards) { HashMap<String, String> searchCriteria = new HashMap<String, String>(); searchCriteria.put("cfdaNumber", award.getCfdaNumber()); if (ObjectUtils.isNotNull(award.getCfdaNumber())) { CFDA cfda = (CFDA) businessObjectService.findByPrimaryKey(CFDA.class, searchCriteria); if (ObjectUtils.isNotNull(cfda)) { CfdaDTO cfdaDTO = boToDTO(cfda); cfdaDTO.setAwardId(award.getAwardId() + ""); cfdaNumbers.add(cfdaDTO); } } } return cfdaNumbers; } else { return null; } }