Class AbstractRenderReceiptService

All Implemented Interfaces:
IRenderReceiptService, IServiceDefinitionAware
Direct Known Subclasses:
AcroFormRenderReceiptService, LocalProcessRenderReceiptService, PhantomJSRenderReceiptService

public abstract class AbstractRenderReceiptService extends CayenneService implements IRenderReceiptService, IServiceDefinitionAware
Provides an abstract PDF receipt rendering service for subclasses to implement.
Since:
4.0.0
  • Field Details

  • Constructor Details

    • AbstractRenderReceiptService

      public AbstractRenderReceiptService()
  • Method Details

    • getReceiptDocument

      protected abstract DataDocument getReceiptDocument(Submission submission, jakarta.servlet.http.HttpServletRequest request, RequestLog requestLog, String receiptMode) throws ApplicationException
      Return the PDF Receipt DataDocument for the submission, request and requestLog.
      Parameters:
      submission - the form submission
      request - the servlet request
      requestLog - the request log
      receiptMode - receipt mode in [ Web | Email | Delivery ]
      Returns:
      the PDF Receipt DataDocument for the submission, request and requestLog
      Throws:
      ApplicationException
    • renderReceipt

      public void renderReceipt(Submission submission, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, RequestLog requestLog) throws ApplicationException
      Render the PDF Receipt given the submission.
      Specified by:
      renderReceipt in interface IRenderReceiptService
      Parameters:
      submission - the submission
      request - - the users Http servlet request
      response - - the Http servlet response to render to
      requestLog - - the request log parameter
      Throws:
      ApplicationException - if an error occurs at runtime
      See Also:
    • renderReceipt

      public byte[] renderReceipt(Submission submission, String mode) throws ApplicationException
      Return a PDF Receipt byte array rendered from the submission.
      Specified by:
      renderReceipt in interface IRenderReceiptService
      Parameters:
      submission - the submission
      mode - receipt mode in [ Web | Email | Delivery ]
      Returns:
      the receipt data in PDF
      Throws:
      ApplicationException - if an error occurs at runtime
      See Also:
    • generateReceipt

      public byte[] generateReceipt(TemplateVersion templateVersion, String xml) throws ApplicationException
      Return a PDF Receipt byte array rendered from the Form TemplateVersion and xml
      Parameters:
      templateVersion - the form templateVersion
      xml - the xmlData
      Returns:
      the receipt data in PDF
      Throws:
      ApplicationException - if an error occurs at runtime
      Since:
      24.10.0
    • setTestMode

      public void setTestMode(boolean testMode)
      Specify whether running in test mode an render receipt changes should not be committed to database.
      Specified by:
      setTestMode in interface IRenderReceiptService
      Parameters:
      testMode - Specify whether running in test mode an render receipt changes should not be committed to database
      Since:
      4.1.15
      See Also:
    • setMaxProcesses

      public void setMaxProcesses(Integer value)
      Set the maximum number of concurrent processes.
      Specified by:
      setMaxProcesses in interface IRenderReceiptService
      Parameters:
      value - the maximum number of concurrent processes
      Since:
      5.0.3
      See Also:
    • getMaxProcesses

      public Integer getMaxProcesses()
      Return the maximum number of concurrent processes.
      Returns:
      the maximum number of concurrent processes
      Since:
      5.0.3
    • setServiceDefinition

      public void setServiceDefinition(ServiceDefinition serviceDefinition)
      Set the service definition for the service.
      Specified by:
      setServiceDefinition in interface IServiceDefinitionAware
      Parameters:
      serviceDefinition - the service definition for the service
      See Also:
    • getServiceDefinition

      public ServiceDefinition getServiceDefinition()
      Return the service definition for the service.
      Specified by:
      getServiceDefinition in interface IServiceDefinitionAware
      Returns:
      the service definition for the service
      See Also:
    • updateReceiptMode

      protected String updateReceiptMode(String xmlData, TemplateVersion templateVersion, jakarta.servlet.http.HttpServletRequest request)
      Return the updated form submission XML data with the correct receipt mode for the receipt rendering context.
      Parameters:
      xmlData - the form submission XML data
      templateVersion - the form template version
      request - the servlet request
      Returns:
      the updated form submission XML data with the correct receipt mode for the receipt rendering context
      Since:
      4.0.0
    • updateReceiptMode

      protected String updateReceiptMode(String xmlData, TemplateVersion templateVersion, jakarta.servlet.http.HttpServletRequest request, String mode)
      Return the updated form submission XML data with the correct receipt mode for the receipt rendering context.
      Parameters:
      xmlData - the form submission XML data
      templateVersion - the form template version
      request - the servlet request
      mode - the receipt mode
      Returns:
      the updated form submission XML data with the correct receipt mode for the receipt rendering context