Exemplo n.º 1
0
 /**
  * . This is the Getter Method for OrganizationName
  *
  * @return Returns organizationName.
  */
 public String getOrganizationName() {
   Organization organization = getOrganization();
   if (organization != null) {
     return organization.getOrganizationName();
   } else {
     return organizationName;
   }
 }
 /**
  * @see
  *     org.kuali.kra.irb.protocol.location.ProtocolLocationService#addDefaultProtocolLocation(org.kuali.kra.irb.Protocol)
  */
 public void addDefaultProtocolLocation(Protocol protocol) {
   if (protocol.getProtocolLocations().size() == 0) {
     ProtocolLocation protocolLocation = new ProtocolLocation();
     protocolLocation.setProtocolNumber(PROTOCOL_NUMBER);
     protocolLocation.setSequenceNumber(SEQUENCE_NUMBER);
     Organization organization = getOrganization(Constants.DEFAULT_PROTOCOL_ORGANIZATION_ID);
     protocolLocation.setOrganization(organization);
     protocolLocation.setOrganizationId(organization.getOrganizationId());
     protocolLocation.setRolodexId(organization.getContactAddressId());
     protocolLocation.setProtocolOrganizationTypeCode(
         Constants.DEFAULT_PROTOCOL_ORGANIZATION_TYPE_CODE);
     protocolLocation.refreshReferenceObject(REFERENCE_PROTOCOL_ORGANIZATION_TYPE);
     protocolLocation.refreshReferenceObject(REFERENCE_ROLODEX);
     protocol.getProtocolLocations().add(protocolLocation);
   }
 }
Exemplo n.º 3
0
  /**
   * This method returns ReportEntity informations including ReportEntityType,ReportEntityIsPrime
   * and OrganizationName,CongressionalDistrict information for the Prime.
   *
   * @return ReportEntity object containing organization and Congressional District details for
   *     prime.
   */
  private ReportEntity getReportEntity() {

    ReportEntity reportEntity = ReportEntity.Factory.newInstance();
    reportEntity.setReportEntityType(ReportEntityDataType.PRIME);
    reportEntity.setReportEntityIsPrime(YesNoDataType.YES);
    Prime prime = Prime.Factory.newInstance();
    Organization organization = null;
    organization = pdDoc.getDevelopmentProposal().getApplicantOrganization().getOrganization();

    if (organization != null) {
      if (organization.getOrganizationName() != null) {
        if (organization.getOrganizationName().length() > ORGANIZATON_NAME_MAX_LENGTH) {
          prime.setOrganizationName(
              organization.getOrganizationName().substring(0, ORGANIZATON_NAME_MAX_LENGTH));
        } else {
          prime.setOrganizationName(organization.getOrganizationName());
        }
      }
      if (organization.getCongressionalDistrict() != null) {
        if (organization.getCongressionalDistrict().length() > CONGRESSIONAL_DISTRICT_MAX_LENGTH) {
          prime.setCongressionalDistrict(
              organization
                  .getCongressionalDistrict()
                  .substring(0, CONGRESSIONAL_DISTRICT_MAX_LENGTH));
        } else {
          prime.setCongressionalDistrict(organization.getCongressionalDistrict());
        }
      }
    }
    prime.setReportEntityType(ReportEntityDataType.PRIME);
    Rolodex rolodex = null;
    rolodex = pdDoc.getDevelopmentProposal().getApplicantOrganization().getRolodex();
    prime.setAddress(globLibV10Generator.getAddressDataType(rolodex));
    reportEntity.setPrime(prime);
    return reportEntity;
  }