Skip to content

Commit

Permalink
RESKC-982: Fix application type.
Browse files Browse the repository at this point in the history
Regardless of proposal type selected, the Data Validation and/or the Opportunity Search > Forms screen return error based on S2S Application Type.
With form SF424-V2.1:
/GrantApplication/Forms/SF424_2_1/ApplicationType is not valid in SF424-V2.1
and
With form SF424-V2.0:
/GrantApplication/Forms/SF424/ApplicationType is not valid in SF424-V2.0

Steps to recreate:
Create a PD record, with basic info to save and Proposal Type = New
In S2S Opportunity Search, search for Grants.gov test opportunity NISTNOTRR2 and link.
Add a PI
Questionnaire: answer the GG Form questionnaire
S2S Opportunity Search > Create the PDF for the SF424-V2.1
Results:
error stating the Application Type not Valid in SF424-V2.1
Return to Proposal Details and change proposal type to any other.
Attempt to Print.
Same error re Application Type remains.
This is may be a result of the recently added Proposal Types and/or RESKC-360 which was for a problem in MIT KC Production soon after go-live related to the same form.
PD S2S - Error messages re "Application Type" for SF424-V2.1 and SF424-V2.0 (NOT RR versions)
  • Loading branch information
Gayathri Athreya committed Dec 3, 2015
1 parent 2f63bbe commit 2bbd144
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@
import org.springframework.core.io.Resource;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.*;

/**
* This Class is used to generate XML object for grants.gov SF424V2.1. This form is generated using XMLBean classes and is based on
Expand Down Expand Up @@ -136,20 +133,15 @@ private SF42421 getSF42421() {
ApplicationType.Enum applicationTypeEnum = null;
if (pdDoc.getDevelopmentProposal().getProposalType() != null) {
String proposalTypeCode = pdDoc.getDevelopmentProposal().getProposalType().getCode();
if (s2SConfigurationService.getValueAsString(
ConfigurationConstants.PROPOSAL_TYPE_CODE_NEW).equals(proposalTypeCode)) {
if (doesParameterContainCode(ConfigurationConstants.PROPOSAL_TYPE_CODE_NEW, proposalTypeCode)) {
applicationTypeEnum = ApplicationType.NEW;
} else if (s2SConfigurationService.getValueAsString(
ConfigurationConstants.PROPOSAL_TYPE_CODE_RESUBMISSION).equals(proposalTypeCode)) {
} else if (doesParameterContainCode(ConfigurationConstants.PROPOSAL_TYPE_CODE_RESUBMISSION, proposalTypeCode)) {
applicationTypeEnum = ApplicationType.REVISION;
} else if (s2SConfigurationService.getValueAsString(
ConfigurationConstants.PROPOSAL_TYPE_CODE_RENEWAL).equals(proposalTypeCode)) {
} else if (doesParameterContainCode(ConfigurationConstants.PROPOSAL_TYPE_CODE_RENEWAL, proposalTypeCode)) {
applicationTypeEnum = ApplicationType.CONTINUATION;
} else if (s2SConfigurationService.getValueAsString(
ConfigurationConstants.PROPOSAL_TYPE_CODE_CONTINUATION).equals(proposalTypeCode)) {
} else if (doesParameterContainCode(ConfigurationConstants.PROPOSAL_TYPE_CODE_CONTINUATION, proposalTypeCode)) {
applicationTypeEnum = ApplicationType.CONTINUATION;
} else if (s2SConfigurationService.getValueAsString(
ConfigurationConstants.PROPOSAL_TYPE_CODE_REVISION).equals(proposalTypeCode)) {
} else if (doesParameterContainCode(ConfigurationConstants.PROPOSAL_TYPE_CODE_REVISION, proposalTypeCode)) {
applicationTypeEnum = ApplicationType.REVISION;
}
}
Expand Down Expand Up @@ -427,6 +419,11 @@ private SF42421 getSF42421() {
return sf424V21;
}

protected boolean doesParameterContainCode(String parameterName, String code) {
List<String> parameterValues = s2SConfigurationService.getValuesFromCommaSeparatedParam(parameterName);
return parameterValues.contains(code);
}

private void setApplicatTypeCodes(SF42421 sf424V21) {
OrganizationContract organization = pdDoc.getDevelopmentProposal().getApplicantOrganization().getOrganization();
List<? extends OrganizationTypeContract> organizationTypes = organization.getOrganizationTypes();
Expand Down

0 comments on commit 2bbd144

Please sign in to comment.