Package com.avoka.fc.core.service
Class AbstractRenderReceiptService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the maximum number of concurrent processes.protected abstract DataDocument
getReceiptDocument
(Submission submission, jakarta.servlet.http.HttpServletRequest request, RequestLog requestLog, String receiptMode) Return the PDF Receipt DataDocument for the submission, request and requestLog.Return the service definition for the service.void
renderReceipt
(Submission submission, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, RequestLog requestLog) Render the PDF Receipt given the submission.byte[]
renderReceipt
(Submission submission, String mode) Return a PDF Receipt byte array rendered from the submission.void
setMaxProcesses
(Integer value) Set the maximum number of concurrent processes.void
setServiceDefinition
(ServiceDefinition serviceDefinition) Set the service definition for the service.void
setTestMode
(boolean testMode) Specify whether running in test mode an render receipt changes should not be committed to database.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.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.Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.avoka.fc.core.service.IRenderReceiptService
requiresLiveCycle
-
Field Details
-
CONTENT_TYPE_PDF
The PDF content type header value.- See Also:
-
-
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 submissionrequest
- the servlet requestrequestLog
- the request logreceiptMode
- 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 interfaceIRenderReceiptService
- Parameters:
submission
- the submissionrequest
- - the users Http servlet requestresponse
- - the Http servlet response to render torequestLog
- - the request log parameter- Throws:
ApplicationException
- if an error occurs at runtime- See Also:
-
renderReceipt
Return a PDF Receipt byte array rendered from the submission.- Specified by:
renderReceipt
in interfaceIRenderReceiptService
- Parameters:
submission
- the submissionmode
- receipt mode in [ Web | Email | Delivery ]- Returns:
- the receipt data in PDF
- Throws:
ApplicationException
- if an error occurs at runtime- See Also:
-
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 interfaceIRenderReceiptService
- 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
Set the maximum number of concurrent processes.- Specified by:
setMaxProcesses
in interfaceIRenderReceiptService
- Parameters:
value
- the maximum number of concurrent processes- Since:
- 5.0.3
- See Also:
-
getMaxProcesses
Return the maximum number of concurrent processes.- Returns:
- the maximum number of concurrent processes
- Since:
- 5.0.3
-
setServiceDefinition
Set the service definition for the service.- Specified by:
setServiceDefinition
in interfaceIServiceDefinitionAware
- Parameters:
serviceDefinition
- the service definition for the service- See Also:
-
getServiceDefinition
Return the service definition for the service.- Specified by:
getServiceDefinition
in interfaceIServiceDefinitionAware
- 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 datatemplateVersion
- the form template versionrequest
- 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 datatemplateVersion
- the form template versionrequest
- the servlet requestmode
- the receipt mode- Returns:
- the updated form submission XML data with the correct receipt mode for the receipt rendering context
-