コード例 #1
0
  /**
   * This method returns SurveyOnEEODocument object based on proposal development document which
   * contains the SurveyOnEEODocument informations
   * OrganizationName,DUNSID,OpportunityTitle,CFDANumber for a particular proposal
   *
   * @return surveyOnEEODocument(SurveyOnEEODocument) {@link XmlObject} of type SurveyOnEEODocument.
   */
  private SurveyOnEEODocument surveyOnEEODocument() {
    SurveyOnEEODocument surveyOnEEODocument = SurveyOnEEODocument.Factory.newInstance();
    SurveyOnEEO surveyOnEEO = SurveyOnEEO.Factory.newInstance();
    surveyOnEEO.setFormVersion(S2SConstants.FORMVERSION_1_1);

    if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
      if (pdDoc.getDevelopmentProposal().getApplicantOrganization().getLocationName() != null) {
        if (pdDoc.getDevelopmentProposal().getApplicantOrganization().getLocationName().length()
            > ORGANIZATON_NAME_MAX_LENGTH) {
          surveyOnEEO.setOrganizationName(
              pdDoc
                  .getDevelopmentProposal()
                  .getApplicantOrganization()
                  .getLocationName()
                  .substring(0, ORGANIZATON_NAME_MAX_LENGTH));
        } else {
          surveyOnEEO.setOrganizationName(
              pdDoc.getDevelopmentProposal().getApplicantOrganization().getLocationName());
        }
      }

      if (pdDoc
              .getDevelopmentProposal()
              .getApplicantOrganization()
              .getOrganization()
              .getDunsNumber()
          != null) {
        if (pdDoc
                .getDevelopmentProposal()
                .getApplicantOrganization()
                .getOrganization()
                .getDunsNumber()
                .length()
            > DUNS_NUMBER_MAX_LENGTH) {
          surveyOnEEO.setDUNSID(
              pdDoc
                  .getDevelopmentProposal()
                  .getApplicantOrganization()
                  .getOrganization()
                  .getDunsNumber()
                  .substring(0, DUNS_NUMBER_MAX_LENGTH));
        } else {
          surveyOnEEO.setDUNSID(
              pdDoc
                  .getDevelopmentProposal()
                  .getApplicantOrganization()
                  .getOrganization()
                  .getDunsNumber());
        }
      }
    }
    S2sOpportunity s2sOpportunity = pdDoc.getDevelopmentProposal().getS2sOpportunity();
    String opportunityTitle = "";
    if (s2sOpportunity != null) {
      s2sOpportunity.refreshNonUpdateableReferences();
      opportunityTitle = s2sOpportunity.getOpportunityTitle();
      surveyOnEEO.setCFDANumber(s2sOpportunity.getCfdaNumber());
    }
    surveyOnEEO.setOpportunityTitle(opportunityTitle);
    surveyOnEEODocument.setSurveyOnEEO(surveyOnEEO);
    return surveyOnEEODocument;
  }
コード例 #2
0
 /**
  * This method typecasts the given {@link XmlObject} to the required generator type and returns
  * back the document of that generator type.
  *
  * @param xmlObject which needs to be converted to the document type of the required generator
  * @return {@link XmlObject} document of the required generator type
  * @see org.kuali.kra.s2s.generator.S2SFormGenerator#getFormObject(XmlObject)
  */
 public XmlObject getFormObject(XmlObject xmlObject) {
   SurveyOnEEODocument surveyOnEEODocument = SurveyOnEEODocument.Factory.newInstance();
   SurveyOnEEO surveyOnEEO = SurveyOnEEO.Factory.newInstance();
   surveyOnEEODocument.setSurveyOnEEO(surveyOnEEO);
   return surveyOnEEODocument;
 }