Package de.xima.fc.form.persist
Class AttachmentPersisterBuilder
- java.lang.Object
-
- de.xima.fc.form.persist.AttachmentPersisterBuilder
-
- All Implemented Interfaces:
AutoCloseable
public class AttachmentPersisterBuilder extends Object implements AutoCloseable
Builder for persisting attachments of aVorgang
and returning that form record.- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description AttachmentPersisterBuilder(IFormRequestContext requestCtx, FormPersistRequest requestData, Vorgang vorgang, IXForm xform)
Creates a new attachment persister for a given form submission.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Vorgang
build()
Deprecated.UsecreatePersistBuildData()
(which may be called before a form record exists), then callbuild(AttachmentPersistBuildData, Vorgang)
with the existing form record.Vorgang
build(AttachmentPersistBuildData data, Vorgang formRecord)
Updates the form record with the attachments that were submitted and returns the updated form record.void
close()
-
-
-
Constructor Detail
-
AttachmentPersisterBuilder
public AttachmentPersisterBuilder(IFormRequestContext requestCtx, FormPersistRequest requestData, Vorgang vorgang, IXForm xform) throws IOException
Creates a new attachment persister for a given form submission.- Parameters:
requestCtx
- The current request context that was used to submit the form.requestData
- The request data with the uploads map that will be sent via the API.vorgang
- The form record that was edited or newly created as a result of the submission.xform
- The form that was submitted-- Throws:
IOException
- When the temp dir for files could not be created.
-
-
Method Detail
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
build
@Deprecated public Vorgang build() throws ContextBuilderException
Deprecated.UsecreatePersistBuildData()
(which may be called before a form record exists), then callbuild(AttachmentPersistBuildData, Vorgang)
with the existing form record.Updates the form record with the attachments that were submitted and return the updated form record.- Returns:
- the new updated form record instance
- Throws:
ContextBuilderException
- When the attachments could not be processed.
-
build
public Vorgang build(AttachmentPersistBuildData data, Vorgang formRecord) throws ContextBuilderException
Updates the form record with the attachments that were submitted and returns the updated form record. If the provided form record itself is null or the provided persist data is empty, the form record will be returned unchanged.- Parameters:
data
- Data that was created bycreatePersistBuildData()
.formRecord
- Persisted form record to which to add the attachments.- Returns:
- the (updated or unchanged) form record instance
- Throws:
ContextBuilderException
- When the attachments could not be processed.
-
-