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 class
LocalProcessRenderReceiptService.ProcessParams
-
Field Summary
Fields Modifier and Type Field Description protected Integer
fallbackTimeout
protected String
receiptPropertiesJson
protected String
subfolder
-
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 void
appendContextDebugInfo(StringBuilder context, String htmlFilePath, LocalProcessRenderReceiptService.ProcessParams params, Submission submission)
Integer
getFallbackTimeout()
Set the fallback timeout in milliseconds.protected abstract Semaphore
getMaxProcessesSemphore()
protected DataDocument
getReceiptDocument(Submission submission, HttpServletRequest request, RequestLog requestLog, String receiptMode)
Return the PDF Receipt DataDocument for the submission, request and requestLog.String
getReceiptPropertiesJson()
Return the system default JSON string containing the receipt properties.protected abstract String
getReceiptSubdirectory()
protected abstract boolean
isDeleteFiles()
protected abstract LocalProcessRenderReceiptService.ProcessParams
populateProcessParams(LocalProcessRenderReceiptService.ProcessParams params, String workDir)
protected void
rasterize(LocalProcessRenderReceiptService.ProcessParams params, Submission submission)
boolean
requiresLiveCycle()
Returns false as this service does not require LiveCycle.void
setFallbackTimeout(Integer value)
Set the fallback timeout in milliseconds.void
setReceiptPropertiesJson(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:AbstractRenderReceiptService
Return the PDF Receipt DataDocument for the submission, request and requestLog.- Specified by:
getReceiptDocument
in 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:
TimeoutException
IOException
-
appendContextDebugInfo
protected void appendContextDebugInfo(StringBuilder context, String htmlFilePath, LocalProcessRenderReceiptService.ProcessParams params, Submission submission)
-
-