Package com.avoka.fc.core.service
Class LocalProcessRenderReceiptService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.AbstractRenderReceiptService
-
- com.avoka.fc.core.service.LocalProcessRenderReceiptService
-
- All Implemented Interfaces:
IRenderReceiptService,IServiceDefinitionAware
- Direct Known Subclasses:
PhantomJSRenderReceiptServiceV2,PuppeteerRenderReceiptService
public abstract class LocalProcessRenderReceiptService extends AbstractRenderReceiptService
Provides a receipt render service executing a local executable ( omJS, Chromium Puppeteer)- Since:
- 19.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLocalProcessRenderReceiptService.ProcessParams
-
Field Summary
Fields Modifier and Type Field Description protected IntegerfallbackTimeoutprotected StringreceiptPropertiesJsonprotected Stringsubfolder-
Fields inherited from class com.avoka.fc.core.service.AbstractRenderReceiptService
CONTENT_TYPE_PDF
-
-
Constructor Summary
Constructors Constructor Description LocalProcessRenderReceiptService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidappendContextDebugInfo(StringBuilder context, String htmlFilePath, LocalProcessRenderReceiptService.ProcessParams params, Submission submission)IntegergetFallbackTimeout()Set the fallback timeout in milliseconds.protected abstract SemaphoregetMaxProcessesSemphore()protected DataDocumentgetReceiptDocument(Submission submission, HttpServletRequest request, RequestLog requestLog, String receiptMode)Return the PDF Receipt DataDocument for the submission, request and requestLog.StringgetReceiptPropertiesJson()Return the system default JSON string containing the receipt properties.protected abstract StringgetReceiptSubdirectory()protected abstract booleanisDeleteFiles()protected abstract LocalProcessRenderReceiptService.ProcessParamspopulateProcessParams(LocalProcessRenderReceiptService.ProcessParams params, String workDir)protected voidrasterize(LocalProcessRenderReceiptService.ProcessParams params, Submission submission)booleanrequiresLiveCycle()Returns false as this service does not require LiveCycle.voidsetFallbackTimeout(Integer value)Set the fallback timeout in milliseconds.voidsetReceiptPropertiesJson(String value)Set the JSON string containing the receipt properties.-
Methods inherited from class com.avoka.fc.core.service.AbstractRenderReceiptService
getMaxProcesses, getServiceDefinition, hasSignatureReceiptTemplate, isSignatureReceiptRequest, renderReceipt, renderReceipt, setMaxProcesses, setServiceDefinition, setTestMode, updateReceiptMode, updateReceiptMode
-
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
-
-
-
-
Method Detail
-
requiresLiveCycle
public boolean requiresLiveCycle()
Returns false as this service does not require LiveCycle.- Returns:
- false
- See Also:
IRenderReceiptService.requiresLiveCycle()
-
getFallbackTimeout
public Integer getFallbackTimeout()
Set the fallback timeout in milliseconds. After this time, the receipt rendering process is terminated by TM.- Returns:
- the fallback process timeout in milliseconds.
-
setFallbackTimeout
public void setFallbackTimeout(Integer value)
Set the fallback timeout in milliseconds. After this time, the receipt rendering process is terminated by TM.- Parameters:
value- the fallback process timeout in milliseconds.
-
getReceiptPropertiesJson
public String getReceiptPropertiesJson()
Return the system default JSON string containing the receipt properties. This can be overridden on the organization and form version level.- Returns:
- the JSON properties
-
setReceiptPropertiesJson
public void setReceiptPropertiesJson(String value)
Set the JSON string containing the receipt properties.- Parameters:
value- the JSON properties
-
isDeleteFiles
protected abstract boolean isDeleteFiles()
-
getMaxProcessesSemphore
protected abstract Semaphore getMaxProcessesSemphore()
-
getReceiptSubdirectory
protected abstract String getReceiptSubdirectory()
-
populateProcessParams
protected abstract LocalProcessRenderReceiptService.ProcessParams populateProcessParams(LocalProcessRenderReceiptService.ProcessParams params, String workDir)
-
getReceiptDocument
protected DataDocument getReceiptDocument(Submission submission, HttpServletRequest request, RequestLog requestLog, String receiptMode) throws ApplicationException
Description copied from class:AbstractRenderReceiptServiceReturn the PDF Receipt DataDocument for the submission, request and requestLog.- Specified by:
getReceiptDocumentin classAbstractRenderReceiptService- 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
-
rasterize
protected void rasterize(LocalProcessRenderReceiptService.ProcessParams params, Submission submission) throws TimeoutException, IOException
- Throws:
TimeoutExceptionIOException
-
appendContextDebugInfo
protected void appendContextDebugInfo(StringBuilder context, String htmlFilePath, LocalProcessRenderReceiptService.ProcessParams params, Submission submission)
-
-