Class FormPrintServiceImpl
java.lang.Object
org.kuali.coeus.s2sgen.impl.print.FormPrintServiceImpl
- All Implemented Interfaces:
org.kuali.coeus.s2sgen.api.print.FormPrintService
@Component("formPrintService")
public class FormPrintServiceImpl
extends Object
implements org.kuali.coeus.s2sgen.api.print.FormPrintService
This class is implementation of PrintService. It provides the functionality
to generate PDF for all forms along with their attachments
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFileToZip(String path, String sourceFile, ZipOutputStream zipOutputStream) protected voidaddFolderToZip(String path, String sourceFolder, ZipOutputStream zipOutputStream) protected StringfindSubmittedXml(org.kuali.coeus.propdev.api.s2s.S2sAppSubmissionContract appSubmission) protected org.kuali.coeus.sys.api.model.KcFilegetAttributeContent(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, String contentId) protected StringgetFileNameForFormPrinting(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) protected org.apache.xmlbeans.XmlObjectgetFormObject(gov.grants.apply.system.metaGrantApplication.GrantApplicationDocument submittedXml) This method gets formObject from submitted Applicationprotected org.kuali.coeus.propdev.api.s2s.S2sAppSubmissionContractgetLatestS2SAppSubmission(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) This method gets the latest S2SAppSubmission record from the list of S2SAppSubmissions.protected org.kuali.coeus.sys.api.model.KcFilegetLegacyCoeusAttachmentContent(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, String[] contentIds, String[] contentDesc) org.kuali.coeus.propdev.api.attachment.NarrativeServiceprotected FormPrintServiceImpl.PrintableResultgetPDFStream(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) This method is used to generate byte stream of formsorg.kuali.coeus.propdev.api.s2s.S2sApplicationServiceorg.kuali.coeus.propdev.api.s2s.S2SConfigurationServicegetSelectedNamespaces(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.protected FormPrintServiceImpl.PrintableResultgetSubmittedPDFStream(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) This method is to write the submitted application data to a pdfStreamorg.kuali.coeus.propdev.api.s2s.UserAttachedFormServiceprotected booleanisPdfType(byte[] data) org.kuali.coeus.s2sgen.api.print.FormPrintResultprintForm(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) This method is used for the printing of forms in PDF format.protected voidsaveGrantsGovXml(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, boolean formEntryFlag, org.apache.xmlbeans.XmlObject formObject, List<org.kuali.coeus.s2sgen.api.generate.AttachmentData> attachmentList, List<? extends org.kuali.coeus.propdev.api.s2s.S2sAppAttachmentsContract> attachmentLists) protected voidsetFormObject(gov.grants.apply.system.metaGrantApplication.GrantApplicationDocument.GrantApplication.Forms forms, org.apache.xmlbeans.XmlObject formObject) voidsetNarrativeService(org.kuali.coeus.propdev.api.attachment.NarrativeService narrativeService) voidsetS2sApplicationService(org.kuali.coeus.propdev.api.s2s.S2sApplicationService s2sApplicationService) voidsetS2SCommonBudgetService(S2SCommonBudgetService s2SCommonBudgetService) voidsetS2SConfigurationService(org.kuali.coeus.propdev.api.s2s.S2SConfigurationService s2SConfigurationService) voidsetS2SDateTimeService(S2SDateTimeService s2SDateTimeService) voidsetS2SFormGeneratorService(S2SFormGeneratorRetrievalService s2SFormGeneratorService) voidsetS2SPrintingService(S2SPrintingService s2SPrintingService) voidsetS2SValidatorService(S2SValidatorService s2SValidatorService) voidsetUserAttachedFormService(org.kuali.coeus.propdev.api.s2s.UserAttachedFormService userAttachedFormService) protected static bytetoUnsignedByte(int intVal) convert int to unsigned byte
-
Field Details
-
s2SCommonBudgetService
@Autowired @Qualifier("s2SCommonBudgetService") protected S2SCommonBudgetService s2SCommonBudgetService
-
-
Constructor Details
-
FormPrintServiceImpl
public FormPrintServiceImpl()
-
-
Method Details
-
printForm
public org.kuali.coeus.s2sgen.api.print.FormPrintResult printForm(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc) throws org.kuali.coeus.s2sgen.api.core.S2SException This method is used for the printing of forms in PDF format. It generates PDF forms and puts it intoKcFile- Specified by:
printFormin interfaceorg.kuali.coeus.s2sgen.api.print.FormPrintService- Parameters:
pdDoc- (ProposalDevelopmentDocumentContract)- Returns:
KcFilewhich contains all information related to the generated PDF- Throws:
org.kuali.coeus.s2sgen.api.core.S2SException
-
saveGrantsGovXml
protected void saveGrantsGovXml(org.kuali.coeus.propdev.api.core.ProposalDevelopmentDocumentContract pdDoc, boolean formEntryFlag, org.apache.xmlbeans.XmlObject formObject, List<org.kuali.coeus.s2sgen.api.generate.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 org.kuali.coeus.s2sgen.api.core.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:
org.kuali.coeus.s2sgen.api.core.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 org.kuali.coeus.s2sgen.api.core.S2SException This method is used to generate byte stream of forms- Parameters:
pdDoc- ProposalDevelopmentDocumentContract- Returns:
- ByteArrayOutputStream[] PDF byte Array
- Throws:
org.kuali.coeus.s2sgen.api.core.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
-
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
-
setS2SPrintingService
-
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
-
getS2SValidatorService
-
getUserAttachedFormService
public org.kuali.coeus.propdev.api.s2s.UserAttachedFormService getUserAttachedFormService() -
setUserAttachedFormService
public void setUserAttachedFormService(org.kuali.coeus.propdev.api.s2s.UserAttachedFormService userAttachedFormService) -
getS2SDateTimeService
-
setS2SDateTimeService
-
getS2SCommonBudgetService
-
setS2SCommonBudgetService
-
setS2SFormGeneratorService
-
setS2SValidatorService
-