/**
  * If the sponsor has changed, default the key personnel role codes to COI if the role can't be
  * found
  */
 public void handleSponsorChange(ProposalDevelopmentDocument proposalDevelopmentDocument) {
   for (int i = 0;
       i < proposalDevelopmentDocument.getDevelopmentProposal().getProposalPersons().size();
       i++) {
     ProposalPerson person =
         proposalDevelopmentDocument.getDevelopmentProposal().getProposalPersons().get(i);
     if (person.getRole() == null) {
       person.setProposalPersonRoleId(PropAwardPersonRole.CO_INVESTIGATOR);
       String propertyName = ProposalDevelopmentConstants.PropertyConstants.PROPOSAL_PERSONS;
       getGlobalVariableService()
           .getMessageMap()
           .putInfo(
               propertyName + "[" + i + "].proposalPersonRoleId",
               KeyConstants.INFO_PERSONNEL_INVALID_ROLE,
               person.getDevelopmentProposal().getSponsorCode(),
               person.getFullName());
     }
   }
 }
 /**
  * During navigation and routing the ad hoc recipients which are transient get removed. To solve
  * this, repopulate them in the document before each save. This will stop the system from removing
  * the current recipients from the database.
  *
  * <p>Extra logic added to assist in avoiding the null document number issue.
  */
 public void populateAdHocRecipients(ProposalDevelopmentDocument proposalDevelopmentDocument) {
   if (StringUtils.isEmpty(proposalDevelopmentDocument.getDocumentNumber())
       && proposalDevelopmentDocument.getDocumentHeader() != null
       && StringUtils.isNotEmpty(
           proposalDevelopmentDocument.getDocumentHeader().getDocumentNumber())) {
     proposalDevelopmentDocument.setDocumentNumber(
         proposalDevelopmentDocument.getDocumentHeader().getDocumentNumber());
   }
   if (StringUtils.isNotEmpty(proposalDevelopmentDocument.getDocumentNumber())) {
     getDocumentAdHocService().addAdHocs(proposalDevelopmentDocument);
   }
 }
 protected void preSave(ProposalDevelopmentDocument proposalDevelopmentDocument) {
   if (proposalDevelopmentDocument.isDefaultDocumentDescription()) {
     proposalDevelopmentDocument.setDefaultDocumentDescription();
   }
 }