[#RESSUP-1455] Added Award lookup field for Institutional Proposal Number#1606
[#RESSUP-1455] Added Award lookup field for Institutional Proposal Number#1606rojlarge wants to merge 1 commit intokuali:contribfrom
Conversation
| .stream() | ||
| .map(afp -> afp.getAward().getAwardNumber()) | ||
| .collect(Collectors.toList()); | ||
| fieldValues.put("awardNumber", StringUtils.join(awardNumbers, '|')); |
There was a problem hiding this comment.
I'd probably use stream.reduce rather than stringutils.join
|
Thanks for pointing that out Travis, that's definitely better than StringUtils.join. However, it looks like collecting with Collectors.joining is the cleanest option. |
|
I agree. The concept is basically the same as a reduce in this case :) |
| if (StringUtils.isBlank(awardNumbers)) { | ||
| return new ArrayList<>(); | ||
| } | ||
| fieldValues.put("awardNumber", awardNumbers); |
There was a problem hiding this comment.
If awardNumber is set as a search criteria then append. Don't just overwrite the value with the map.put
There was a problem hiding this comment.
Related, @rojlarge did you try just renaming the field to fundingProposals.proposal.proposalNumber and not doing this search separately? That way hopefully OJB would do all the necessary joins to make it happen automatically?
There was a problem hiding this comment.
Yeah, I was just looking at that... I swear there was a reason initially that we couldn't do that, but I just tried removing the changes to AwardLookupableHelperServiceImpl.java entirely (the lookup field is already named "fundingProposals.proposal.proposalNumber" in Award.xml) and it seems to work just fine. I can take another look at this tomorrow to make sure I'm not missing anything else, but doing it that way is way cleaner and handles the "awardNumber" case w/ wildcarding correctly.
|
I did some more testing, and just using the correct field name works fine. I've updated this branch to only include the Award.xml change, and rebased it off of the latest master as well. |
RESSUP-1455
This pull request adds an "Institutional Proposal ID" field to the Award lookup, which returns the active version of Awards associated with any version of the requested IP.