Package com.avoka.fc.core.service
Class SubmissionService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.SubmissionService
- All Implemented Interfaces:
ISubmissionService
Provides a submission service.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addServiceLog
(Submission submission, String serviceName, String serviceInfo, String serviceUrl) Record service usage for a submission.void
copyFormAttachments
(Submission sourceSubmission, Submission targetSubmission, Document targetXmlDoc) Copy the attachments of the source submission to the target submission and its form XML document.Create and initialise a new submission object.createAndInitialiseSubmission
(Form form, String receiptNumber, String trackingCode) Create and initialise a new submission object.createSubmissionHistory
(Submission submission, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a new submission history record.createSubmissionHistory
(Submission submission, HttpServletRequest request, Date requestTime) Create a new submission history record.createSubmissionHistory
(Submission submission, HttpServletRequest request, Date requestTime, boolean isBackgroundSave) Create a new submission history record.void
expireTaskSubmission
(Submission submission) Expires the given task submission and calls the expiry REST endpoint, if defined.Return authentication service instance.getPendingPaymentLog
(Submission submission, String serviceCode) Returns the most recent payment log that is pending for the given submission and payment service codeinitializeOpenedSubmission
(Form form, HttpServletRequest request, RequestLog requestLog, Document document, Submission submission) Initializes an open submission record ready for filling out.void
initiateEmailVerification
(Document document, Submission submission, Form form, SchemaSeedVO schemaSeed, HttpServletRequest request) Initiate submission email verification if configuredboolean
boolean
void
populateSubmissionExtractData
(Document document, Submission submission, SchemaSeed schemaSeed) Populate submission XML data extract values.void
populateSubmissionExtractData
(Document document, Submission submission, SchemaSeedVO schemaSeed) Populate submission XML data extract values.void
prepareReturnToForm
(Submission submission, byte[] submissionXmlData, HttpServletRequest request) Prepare a submission for a "Return to Form" operation.void
pruneOrphanedInFormAttachments
(Document document, Submission submission, HttpServletRequest request) Prune orphaned In-Form attachments from the submission record based on the form XML document.void
resumeAbandonedForm
(Submission submission) Resume the abandoned 'Open' or 'Form Start' submission.boolean
retryRESTSubmissionDelivery
(Submission submission) Reset the 'In Progress' delivery to 'Ready' to enable REST Service delivery queue retry.saveSubmission
(SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog) Deprecated.saveSubmission
(SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a Submission record and persists it into the database for the given submission document.protected Submission
saveSubmissionUnmanaged
(UserAccount userAccount, SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a submission record Save a submission record without committing the database transaction.void
setAuthenticationService
(IAuthenticationService authenticationService) Set the authentication service.void
setDataExtractsOnBackgroundSave
(boolean dataExtractsOnBackgroundSave) void
setFormSavedProcessorOnBackgroundSave
(boolean formSavedProcessorOnBackgroundSave) void
setFormStarted
(RequestLog requestLog) Set the form started flag based on the request log (to avoid contention on the submission log).protected void
setSubmissionExpiryTime
(Submission submission, Document document) Set the submission expiry time based on the associated form configuration.void
setTaskAssigneeGroup
(Submission submission, Group group) Update the assignee group for a task submission.boolean
updatePaymentTypeForService
(Submission submission) Looks up the payment service for the submission's client and updates the payment type if necessary.void
updateSubmissionDeliveryProcessID
(Submission submission) Deprecated.LiveCycle support has been removedMethods 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
-
Field Details
-
SPRING_BEAN_NAME
The Spring configuration bean name.- See Also:
-
-
Constructor Details
-
SubmissionService
public SubmissionService()
-
-
Method Details
-
getAuthenticationService
Return authentication service instance.- Returns:
- authentication service instance
-
setAuthenticationService
Set the authentication service.- Parameters:
authenticationService
- the authentication service
-
isDataExtractsOnBackgroundSave
public boolean isDataExtractsOnBackgroundSave()- Returns:
- the dataExtractsOnBackgroundSave
-
setDataExtractsOnBackgroundSave
public void setDataExtractsOnBackgroundSave(boolean dataExtractsOnBackgroundSave) - Parameters:
dataExtractsOnBackgroundSave
- the dataExtractsOnBackgroundSave to set
-
isFormSavedProcessorOnBackgroundSave
public boolean isFormSavedProcessorOnBackgroundSave()- Returns:
- the formSavedProcessorOnBackgroundSave
-
setFormSavedProcessorOnBackgroundSave
public void setFormSavedProcessorOnBackgroundSave(boolean formSavedProcessorOnBackgroundSave) - Parameters:
formSavedProcessorOnBackgroundSave
- the formSavedProcessorOnBackgroundSave to set
-
saveSubmission
@Deprecated public Submission saveSubmission(SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog) Deprecated.Create a Submission record and persists it into the database for the given submission document. Note that this method contains database transactions.- Parameters:
submissionDataBean
- submission documentrequest
- http requestrequestLog
- the request log record- Returns:
- the created Submission record
-
saveSubmission
public Submission saveSubmission(SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a Submission record and persists it into the database for the given submission document. Note that this method contains database transactions.- Specified by:
saveSubmission
in interfaceISubmissionService
- Parameters:
submissionDataBean
- submission documentrequest
- http requestrequestLog
- the request log recordisBackgroundSave
- whether it is back ground save- Returns:
- the created Submission record
- Since:
- 3.6.4
- See Also:
-
prepareReturnToForm
public void prepareReturnToForm(Submission submission, byte[] submissionXmlData, HttpServletRequest request) Prepare a submission for a "Return to Form" operation. This will clear out attachments and reset the payment status. The form status will be set to "Saved".- Parameters:
submission
- the submission (required, form status must not be Completed or Expired)submissionXmlData
- the submission XML data to store (required)request
- the user return to form request- Since:
- 4.0.0
-
updateSubmissionDeliveryProcessID
Deprecated.LiveCycle support has been removedUpdate the submission delivery process ID if not already set.- Parameters:
submission
- the submission record
-
createAndInitialiseSubmission
Create and initialise a new submission object. This method should be used in place of invokingnew Submission()
.- Parameters:
form
- the submission form (required)- Returns:
- a new submission object
-
createAndInitialiseSubmission
public Submission createAndInitialiseSubmission(Form form, String receiptNumber, String trackingCode) Create and initialise a new submission object. This method should be used in place of invokingnew Submission()
.- Parameters:
form
- the submission form (required)receiptNumber
- the receipt number to use (optional; only set if the receipt number of a previous submission that no longer exists shall be reused)trackingCode
- (optional; only set if the tracking code of a previous submission that no longer exists shall be reused)- Returns:
- a new submission object
- Since:
- 4.1.0
-
getPendingPaymentLog
Returns the most recent payment log that is pending for the given submission and payment service code- Parameters:
submission
- the submission (required)serviceCode
- the payment service code (required)- Returns:
- the most recent incomplete payment for this submission and payment service code, if one exists
-
updatePaymentTypeForService
Looks up the payment service for the submission's client and updates the payment type if necessary. This can happen if the form was rendered when a credit card service was configured, but at payment type this has changed to a hosted service or vice versa. This method performs a database commit.- Parameters:
submission
- the non-null submission with payments outstanding (required)- Returns:
- true if a change to the payment type was made
-
initializeOpenedSubmission
public Submission initializeOpenedSubmission(Form form, HttpServletRequest request, RequestLog requestLog, Document document, Submission submission) Initializes an open submission record ready for filling out. This method will create a new submission record if required.- Parameters:
form
- the form (required)request
- the servlet request (required)requestLog
- the request log (required)document
- the form XML data (required)submission
- the assigned task submission, if one already exists (optional)- Returns:
- the submission
- Since:
- 4.0.0
-
createSubmissionHistory
public SubmissionHistory createSubmissionHistory(Submission submission, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a new submission history record. Please note this method will does not commit changes.- Parameters:
submission
- the form submission (required)request
- the servlet request (required)requestLog
- the requestLog (required)isBackgroundSave
- whether the submission history is a background save- Returns:
- the new submission history object
- Since:
- 4.3.3
-
createSubmissionHistory
public SubmissionHistory createSubmissionHistory(Submission submission, HttpServletRequest request, Date requestTime, boolean isBackgroundSave) Create a new submission history record. Please note this method will does not commit changes. Note: This method assumes that the submission history is not a background save. If you need to store a background save request, please use {@link this#createSubmissionHistory(Submission, HttpServletRequest, RequestLog, boolean)}.- Parameters:
submission
- the form submission (required)request
- the servlet request (required)requestTime
- the request time (required)isBackgroundSave
- whether the submission history is a background save- Returns:
- the new submission history object
- Since:
- 5.0.0
-
createSubmissionHistory
public SubmissionHistory createSubmissionHistory(Submission submission, HttpServletRequest request, Date requestTime) Create a new submission history record. Please note this method will does not commit changes. Note: This method assumes that the submission history is not a background save. If you need to store a background save request, please use {@link this#createSubmissionHistory(Submission, HttpServletRequest, RequestLog, boolean)}.- Parameters:
submission
- the form submission (required)request
- the servlet request (required)requestTime
- the request time (required)- Returns:
- the new submission history object
- Since:
- 3.6.1
-
populateSubmissionExtractData
public void populateSubmissionExtractData(Document document, Submission submission, SchemaSeed schemaSeed) Populate submission XML data extract values.- Parameters:
document
- the submission data (required)submission
- the submission record (required)schemaSeed
- the configuration schema seed (required)
-
populateSubmissionExtractData
public void populateSubmissionExtractData(Document document, Submission submission, SchemaSeedVO schemaSeed) Populate submission XML data extract values.- Parameters:
document
- the submission data (required)submission
- the submission record (required)schemaSeed
- the configuration schema seed VO (required)- Since:
- 5.1.0
-
expireTaskSubmission
Expires the given task submission and calls the expiry REST endpoint, if defined.- Parameters:
submission
- the task submission (required)- Throws:
ApplicationException
- if the submission is already expired or completed, or if an error occurred when calling the REST endpoint- Since:
- 4.0.0
-
retryRESTSubmissionDelivery
Reset the 'In Progress' delivery to 'Ready' to enable REST Service delivery queue retry.- Parameters:
submission
- the submission to reset- Returns:
- true if the submission delivery status was set to 'Ready' or false otherwise
- Since:
- 4.1.8
-
setTaskAssigneeGroup
Update the assignee group for a task submission. Existing submission groups will be deleted. This method does NOT perform a database commit.- Parameters:
submission
- the submission (required)group
- the new assignee group (required)- Since:
- 4.0.0
-
copyFormAttachments
public void copyFormAttachments(Submission sourceSubmission, Submission targetSubmission, Document targetXmlDoc) Copy the attachments of the source submission to the target submission and its form XML document.- Parameters:
sourceSubmission
- the source submission (required)targetSubmission
- the target submission (required)targetXmlDoc
- the target Form XML document (optional)- Since:
- 4.1.0
-
pruneOrphanedInFormAttachments
public void pruneOrphanedInFormAttachments(Document document, Submission submission, HttpServletRequest request) Prune orphaned In-Form attachments from the submission record based on the form XML document.- Parameters:
document
- the document containing current submission XML data (required)submission
- the submission (required, must use in-form attachments and not be on T.Field)request
- the servlet request (required)- Since:
- 4.3.1
-
setSubmissionExpiryTime
Set the submission expiry time based on the associated form configuration.- Parameters:
submission
- the submission record to determine the maximum submission time of (required)document
- the submission XML document (required)- Since:
- 4.2.0
-
resumeAbandonedForm
Resume the abandoned 'Open' or 'Form Start' submission.- Parameters:
submission
- the submission to resume- Since:
- 4.3.3
-
saveSubmissionUnmanaged
protected Submission saveSubmissionUnmanaged(UserAccount userAccount, SubmissionDataBean submissionDataBean, HttpServletRequest request, RequestLog requestLog, boolean isBackgroundSave) Create a submission record Save a submission record without committing the database transaction.- Parameters:
userAccount
- the associated user accountsubmissionDataBean
- the submission data beanrequest
- the servlet requestrequestLog
- the associated request log recordisBackgroundSave
- whether it's background save- Returns:
- the new submission record
-
setFormStarted
Set the form started flag based on the request log (to avoid contention on the submission log). This method performs a database commit.- Parameters:
requestLog
- the request log (required)- Since:
- 4.3.4
-
addServiceLog
public void addServiceLog(Submission submission, String serviceName, String serviceInfo, String serviceUrl) Record service usage for a submission. This method performs a database commit.- Parameters:
submission
- the submission for which a service was invoked (required)serviceName
- the service name (required)serviceInfo
- additional information (optional; up to 200 characters)serviceUrl
- the URL associated with the service (optional; up to 200 characters)- Since:
- 4.3.4
-
initiateEmailVerification
public void initiateEmailVerification(Document document, Submission submission, Form form, SchemaSeedVO schemaSeed, HttpServletRequest request) Initiate submission email verification if configured- Parameters:
document
- the form XML document (required)submission
- the submission (required)form
- the form associated with the submission (required)schemaSeed
- the schema seed associated with the form (optional)request
- the submission request (optional)
-