Class FormPrintServiceImpl

java.lang.Object
org.kuali.coeus.s2sgen.impl.print.FormPrintServiceImpl
All Implemented Interfaces:
FormPrintService

@Component("formPrintService") public class FormPrintServiceImpl extends Object implements FormPrintService
This class is implementation of PrintService. It provides the functionality to generate PDF for all forms along with their attachments
  • Field Details

    • s2SCommonBudgetService

      @Autowired @Qualifier("s2SCommonBudgetService") protected S2SCommonBudgetService s2SCommonBudgetService
  • Constructor Details

    • FormPrintServiceImpl

      public FormPrintServiceImpl()
  • Method Details

    • printForm

      public FormPrintResult printForm(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) throws S2SException
      This method is used for the printing of forms in PDF format. It generates PDF forms and puts it into KcFile
      Specified by:
      printForm in interface FormPrintService
      Parameters:
      pdDoc - (ProposalDevelopmentDocumentContract)
      Returns:
      KcFile which contains all information related to the generated PDF
      Throws:
      S2SException
    • saveGrantsGovXml

      protected void saveGrantsGovXml(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, boolean formEntryFlag, org.apache.xmlbeans.XmlObject formObject, List<AttachmentData> attachmentList, List<? extends org.kuali.coeus.propdev.api.s2s.S2sAppAttachmentsContract> attachmentLists) throws Exception
      Throws:
      Exception
    • addFolderToZip

      protected void addFolderToZip(String path, String sourceFolder, ZipOutputStream zipOutputStream) throws Exception
      Throws:
      Exception
    • addFileToZip

      protected void addFileToZip(String path, String sourceFile, ZipOutputStream zipOutputStream) throws Exception
      Throws:
      Exception
    • getFileNameForFormPrinting

      protected String getFileNameForFormPrinting(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc)
    • getSubmittedPDFStream

      protected FormPrintServiceImpl.PrintableResult getSubmittedPDFStream(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) throws S2SException
      This method is to write the submitted application data to a pdfStream
      Parameters:
      pdDoc - Proposal Development Document.
      Returns:
      ByteArrayOutputStream[] of the submitted application data.
      Throws:
      S2SException
    • findSubmittedXml

      protected String findSubmittedXml(org.kuali.coeus.propdev.api.s2s.S2sAppSubmissionContract appSubmission)
    • getPDFStream

      protected FormPrintServiceImpl.PrintableResult getPDFStream(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) throws S2SException
      This method is used to generate byte stream of forms
      Parameters:
      pdDoc - ProposalDevelopmentDocumentContract
      Returns:
      ByteArrayOutputStream[] PDF byte Array
      Throws:
      S2SException
    • getFormObject

      protected org.apache.xmlbeans.XmlObject getFormObject(gov.grants.apply.system.metaGrantApplication.GrantApplicationDocument submittedXml)
      This method gets formObject from submitted Application
      Parameters:
      submittedXml - GrantApplicationDocument object of the submitted form.
      Returns:
      XmlObject form object corresponding to the GrantApplicationDocument and FormMappingInfo objects.
    • getAttributeContent

      protected org.kuali.coeus.sys.api.model.KcFile getAttributeContent(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, String contentId)
    • getLegacyCoeusAttachmentContent

      protected org.kuali.coeus.sys.api.model.KcFile getLegacyCoeusAttachmentContent(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, String[] contentIds, String[] contentDesc)
    • getLatestS2SAppSubmission

      protected org.kuali.coeus.propdev.api.s2s.S2sAppSubmissionContract getLatestS2SAppSubmission(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc)
      This method gets the latest S2SAppSubmission record from the list of S2SAppSubmissions. It iterates through the list and returns the record that has highest SubmissionNo
      Parameters:
      pdDoc - ProposalDevelopmentDocumentContract
      Returns:
      S2sAppSubmissionContract
    • getSelectedNamespaces

      protected Set<String> getSelectedNamespaces(List<? extends org.kuali.coeus.propdev.api.s2s.S2sOppFormsContract> s2sOppForms)
      This method sorts all the forms in order as specified in S2sFormBinding.xml and returns the list of namespaces in sorted order.
      Parameters:
      s2sOppForms - list of S2sOppForms.
      Returns:
      List<String> list of sorted name spaces.
    • isPdfType

      protected boolean isPdfType(byte[] data)
    • toUnsignedByte

      protected static byte toUnsignedByte(int intVal)
      convert int to unsigned byte
    • setFormObject

      protected void setFormObject(gov.grants.apply.system.metaGrantApplication.GrantApplicationDocument.GrantApplication.Forms forms, org.apache.xmlbeans.XmlObject formObject)
    • getNarrativeService

      public org.kuali.coeus.propdev.api.attachment.NarrativeService getNarrativeService()
    • setNarrativeService

      public void setNarrativeService(org.kuali.coeus.propdev.api.attachment.NarrativeService narrativeService)
    • getS2SPrintingService

      public S2SPrintingService getS2SPrintingService()
    • setS2SPrintingService

      public void setS2SPrintingService(S2SPrintingService s2SPrintingService)
    • getS2SConfigurationService

      public org.kuali.coeus.propdev.api.s2s.S2SConfigurationService getS2SConfigurationService()
    • setS2SConfigurationService

      public void setS2SConfigurationService(org.kuali.coeus.propdev.api.s2s.S2SConfigurationService s2SConfigurationService)
    • getS2sApplicationService

      public org.kuali.coeus.propdev.api.s2s.S2sApplicationService getS2sApplicationService()
    • setS2sApplicationService

      public void setS2sApplicationService(org.kuali.coeus.propdev.api.s2s.S2sApplicationService s2sApplicationService)
    • getS2SFormGeneratorService

      public S2SFormGeneratorRetrievalService getS2SFormGeneratorService()
    • getS2SValidatorService

      public S2SValidatorService getS2SValidatorService()
    • getUserAttachedFormService

      public org.kuali.coeus.propdev.api.s2s.UserAttachedFormService getUserAttachedFormService()
    • setUserAttachedFormService

      public void setUserAttachedFormService(org.kuali.coeus.propdev.api.s2s.UserAttachedFormService userAttachedFormService)
    • getS2SDateTimeService

      public S2SDateTimeService getS2SDateTimeService()
    • setS2SDateTimeService

      public void setS2SDateTimeService(S2SDateTimeService s2SDateTimeService)
    • getS2SCommonBudgetService

      public S2SCommonBudgetService getS2SCommonBudgetService()
    • setS2SCommonBudgetService

      public void setS2SCommonBudgetService(S2SCommonBudgetService s2SCommonBudgetService)
    • setS2SFormGeneratorService

      public void setS2SFormGeneratorService(S2SFormGeneratorRetrievalService s2SFormGeneratorService)
    • setS2SValidatorService

      public void setS2SValidatorService(S2SValidatorService s2SValidatorService)