Skip to content

Commit

Permalink
RESKC-858: The SF 424 R&R version 1-2 must be updated to allow field …
Browse files Browse the repository at this point in the history
…4.a to be populated no matter what the proposal type (new/renewal/revision/etc.)

*This logic was already updated for the 2-0 form version and needs to be applied to the 1-2 because this version of the form was not retire*d.
The field mapping from KC is “Sponsor Proposal ID” on the Sponsor and Program Info screen.
  • Loading branch information
leoherbie committed Nov 4, 2015
1 parent dc8dc11 commit 8ae8bd8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
package org.kuali.coeus.s2sgen.api.core;

/**
* Configuration constants used by the s2s subsystem.
* Configuration constants used by the s2s subsystem. The constants in this class should only
* refer to configuration names used by the {@link org.kuali.coeus.propdev.api.s2s.S2SConfigurationService}.
*/
public final class ConfigurationConstants {

Expand Down Expand Up @@ -101,9 +102,6 @@ public final class ConfigurationConstants {
public static final String US_CITIZEN_OR_NONCITIZEN_NATIONAL_TYPE_CODE = "US_CITIZEN_OR_NONCITIZEN_NATIONAL_TYPE_CODE";
public static final String PERMANENT_RESIDENT_OF_US_PENDING = "PERMANENT_RESIDENT_OF_US_PENDING";
public static final String HIERARCHY_LEVEL = "HIERARCHY_LEVEL";
public static final int CFDA_TITLE_MAX_LENGTH = 119;
public static final int PROJECT_TITLE_MAX_LENGTH = 200;
public static final int FEDERAL_ID_MAX_LENGTH = 30;


//printing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/
package org.kuali.coeus.s2sgen.impl.generate.support;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.kuali.coeus.common.questionnaire.api.answer.AnswerHeaderContract;
import org.kuali.coeus.propdev.api.core.DevelopmentProposalContract;
import org.kuali.coeus.propdev.api.core.SubmissionInfoService;
import org.kuali.coeus.propdev.api.s2s.S2SConfigurationService;
import org.kuali.coeus.propdev.api.s2s.S2sOpportunityContract;
import org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract;
Expand Down Expand Up @@ -57,7 +57,6 @@ public abstract class RRSF424BaseGenerator extends CommonSF424BaseGenerator {
protected static final String STATE_REVIEW_YES = "Y";
protected static final String STATE_REVIEW_NO = "N";
protected static final int PROGRAM_ANNOUNCEMENT_TITLE_MAX_LENGTH = 120;
protected static final int PROPOSAL_TYPE_CODE_6 = 6;
protected static final String PROPOSAL_YNQ_OTHER_AGENCY_SUBMISSION = "15";
protected static final String VALUE_YES = "Yes";
protected static final int PRIMARY_TITLE_MAX_LENGTH = 45;
Expand All @@ -74,6 +73,7 @@ public abstract class RRSF424BaseGenerator extends CommonSF424BaseGenerator {
private static final String SUBMISSION_TYPE_DESCRIPTION = "submissionTypeDescription";
protected static final String KEY_REVISION_CODE = "revisionCode";
protected static final String KEY_REVISION_OTHER_DESCRIPTION = "revisionOtherDescription";
private static final int FEDERAL_ID_MAX_LENGTH = 30;

@Autowired
@Qualifier("s2SDateTimeService")
Expand All @@ -95,10 +95,6 @@ public abstract class RRSF424BaseGenerator extends CommonSF424BaseGenerator {
@Qualifier("questionAnswerService")
protected QuestionAnswerService questionAnswerService;

@Autowired
@Qualifier("submissionInfoService")
protected SubmissionInfoService submissionInfoService;

protected String getOtherAgencySubmissionExplanation() {
Long answerId = getAnswerId(ANSWER_111, getAnswerHeaders());
String submissionExplanation = null;
Expand Down Expand Up @@ -133,6 +129,11 @@ protected String getContactType() {
}
return contactType;
}

protected String getFederalId() {
final String federalId = pdDoc.getDevelopmentProposal().getSponsorProposalNumber();
return StringUtils.substring(federalId, 0, FEDERAL_ID_MAX_LENGTH);
}
/**
*
* This method is used to get the details of Contact person
Expand All @@ -148,10 +149,6 @@ protected DepartmentalPersonDto getContactPerson(

/**
* This method tests whether a document's sponsor is in a given sponsor hierarchy.
* @param sponsorable
* @param sponsorHierarchy The name of a sponsor hierarchy
* @param level1
* @return
*/
public boolean isSponsorInHierarchy(DevelopmentProposalContract sponsorable, String sponsorHierarchy,String level1) {
return sponsorHierarchyService.isSponsorInHierarchy(sponsorable.getSponsor().getSponsorCode(), sponsorHierarchy, 1, level1);
Expand All @@ -164,7 +161,7 @@ public boolean isSponsorInHierarchy(DevelopmentProposalContract sponsorable, Str
* @return Map<String, String> Map of submission details.
*/
public Map<String, String> getSubmissionType(ProposalDevelopmentDocumentContract pdDoc) {
Map<String, String> submissionInfo = new HashMap<String, String>();
Map<String, String> submissionInfo = new HashMap<>();
S2sOpportunityContract opportunity = pdDoc.getDevelopmentProposal().getS2sOpportunity();
if (opportunity != null) {
if (opportunity.getS2sSubmissionType() != null) {
Expand Down Expand Up @@ -227,12 +224,4 @@ public QuestionAnswerService getQuestionAnswerService() {
public void setQuestionAnswerService(QuestionAnswerService questionAnswerService) {
this.questionAnswerService = questionAnswerService;
}

public SubmissionInfoService getSubmissionInfoService() {
return submissionInfoService;
}

public void setSubmissionInfoService(SubmissionInfoService submissionInfoService) {
this.submissionInfoService = submissionInfoService;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,9 @@ private RRSF424Document getRRSF424() {
if (rolodex != null) {
rrsf424.setStateID(rolodex.getState());
}
String federalId = getSubmissionInfoService().getFederalId(pdDoc.getDevelopmentProposal().getProposalNumber());
if (federalId != null) {
if (federalId.length() > 30) {
rrsf424.setFederalID(federalId.substring(0, 30));
} else {
rrsf424.setFederalID(federalId);
}
}

rrsf424.setFederalID(getFederalId());

rrsf424.setApplicantInfo(getApplicationInfo());
rrsf424.setApplicantType(getApplicantType());
rrsf424.setApplicationType(getApplicationType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.kuali.coeus.s2sgen.impl.generate.support;

import gov.grants.apply.forms.phsFellowshipSupplemental11V11.PHSFellowshipSupplemental11Document.PHSFellowshipSupplemental11.ApplicationType.TypeOfApplication;
import gov.grants.apply.forms.rrSF424V11.*;
import gov.grants.apply.forms.rrSF424V11.RRSF424Document.RRSF424;
import gov.grants.apply.forms.rrSF424V11.RRSF424Document.RRSF424.*;
Expand Down Expand Up @@ -135,14 +134,9 @@ private RRSF424Document getRRSF424() {
String state = rolodex.getState();
rrsf424.setStateID(state);
}
String federalId = getSubmissionInfoService().getFederalId(pdDoc.getDevelopmentProposal().getProposalNumber());
if (federalId != null) {
if (federalId.length() > 30) {
rrsf424.setFederalID(federalId.substring(0, 30));
} else {
rrsf424.setFederalID(federalId);
}
}

rrsf424.setFederalID(getFederalId());

rrsf424.setApplicantInfo(getApplicationInfo());
rrsf424.setApplicantType(getApplicantType());
rrsf424.setApplicationType(getApplicationType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,14 +835,7 @@ private String getAORSignature() {
}

private void setFederalId(RRSF42412 rrsf42412) {
String federalId = getSubmissionInfoService().getFederalId(pdDoc.getDevelopmentProposal().getProposalNumber());
if (federalId != null) {
if (federalId.length() > 30) {
rrsf42412.setFederalID(federalId.substring(0, 30));
} else {
rrsf42412.setFederalID(federalId);
}
}
rrsf42412.setFederalID(getFederalId());
}

private String getActivityTitle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import gov.grants.apply.system.globalLibraryV20.YesNoDataType;
import gov.grants.apply.system.universalCodesV20.CountryCodeDataType;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.xmlbeans.XmlObject;
import org.kuali.coeus.common.api.person.KcPersonContract;
import org.kuali.coeus.common.api.person.KcPersonRepositoryService;
Expand Down Expand Up @@ -81,7 +79,9 @@
*/
@FormGenerator("RRSF424_2_0_V2Generator")
public class RRSF424_2_0_V2Generator extends RRSF424BaseGenerator {
private static final Logger LOG = LoggerFactory.getLogger(RRSF424_2_0_V2Generator.class);
private static final int CFDA_TITLE_MAX_LENGTH = 119;
private static final int PROJECT_TITLE_MAX_LENGTH = 200;

private DepartmentalPersonDto departmentalPerson;
protected static final int RRSF424_Cover_Letter = 139;
private List<? extends AnswerHeaderContract> answerHeaders;
Expand Down Expand Up @@ -913,16 +913,15 @@ private String getAORSignature() {
}

private void setFederalId(RRSF42420 rrsf42420) {
String federalId = pdDoc.getDevelopmentProposal().getSponsorProposalNumber();
rrsf42420.setFederalID(StringUtils.substring(federalId, 0, ConfigurationConstants.FEDERAL_ID_MAX_LENGTH));
rrsf42420.setFederalID(getFederalId());
}

private String getActivityTitle() {
return StringUtils.substring(pdDoc.getDevelopmentProposal().getS2sOpportunity().getCfdaDescription(), 0, ConfigurationConstants.CFDA_TITLE_MAX_LENGTH);
return StringUtils.substring(pdDoc.getDevelopmentProposal().getS2sOpportunity().getCfdaDescription(), 0, CFDA_TITLE_MAX_LENGTH);
}

private String getProjectTitle() {
return StringUtils.substring(pdDoc.getDevelopmentProposal().getTitle(), 0, ConfigurationConstants.PROJECT_TITLE_MAX_LENGTH);
return StringUtils.substring(pdDoc.getDevelopmentProposal().getTitle(), 0, PROJECT_TITLE_MAX_LENGTH);
}

private String getAgencyRoutingNumber(){
Expand Down

0 comments on commit 8ae8bd8

Please sign in to comment.