private PHSCoverLetter12Document getPHSCoverLetter ( ) { PHSCoverLetter12Document phsCoverLetterDocument = PHSCoverLetter12Document . Factory . newInstance ( ) ; PHSCoverLetter12 phsCoverLetter = PHSCoverLetter12 . Factory . newInstance ( ) ; CoverLetterFile coverLetterFile = CoverLetterFile . Factory . newInstance ( ) ; phsCoverLetter . setFormVersion ( FormVersion . v1_2 . getVersion ( ) ) ; AttachedFileDataType attachedFileDataType = null ; for ( NarrativeContract narrative : pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) ) { if ( narrative . getNarrativeType ( ) . getCode ( ) != null && Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) == NARRATIVE_PHS_COVER_LETTER ) { attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType != null ) { coverLetterFile . setCoverLetterFilename ( attachedFileDataType ) ; break ; } } } phsCoverLetter . setCoverLetterFile ( coverLetterFile ) ; phsCoverLetterDocument . setPHSCoverLetter12 ( phsCoverLetter ) ; return phsCoverLetterDocument ; }
This method is used to get PHSCoverLetter12Document attachment from the narrative attachments .