Package de.xima.fc.form.persist
Class AttachmentPersisterBuilder
- java.lang.Object
-
- de.xima.fc.form.persist.AttachmentPersisterBuilder
-
-
Constructor Summary
Constructors Constructor Description AttachmentPersisterBuilder(IFormRequestContext requestCtx, 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.UsecreatePersistData()
(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 return the updated form record.AttachmentPersistBuildData
createPersistData()
Reads the submitted uploads and prepares them.
-
-
-
Constructor Detail
-
AttachmentPersisterBuilder
public AttachmentPersisterBuilder(IFormRequestContext requestCtx, Vorgang vorgang, IXForm xform)
Creates a new attachment persister for a given form submission.- Parameters:
requestCtx
- The current request context that was used to submit the form.vorgang
- The form record that was edited or newly created as a result of the submission.xform
- The form that was submitted-
-
-
Method Detail
-
build
@Deprecated public Vorgang build() throws ContextBuilderException
Deprecated.UsecreatePersistData()
(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 updated form record.
- 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 return the updated form record.- Parameters:
data
- Data that was created bycreatePersistData()
.formRecord
- Persisted form record to which to add the attachments.- Returns:
- The updated form record.
- Throws:
ContextBuilderException
- When the attachments could not be processed.
-
createPersistData
public AttachmentPersistBuildData createPersistData() throws ContextBuilderException
Reads the submitted uploads and prepares them. Pass the returned value tobuild()
to persist the uploads. Whilebuild()
requires a persisted form record, this method can be used before the form record was persisted, i.e. theformRecord
passed to the constructor may be null. This is useful, e.g., when you want to reject a form submission without persisting the data.- Returns:
- The data with the attachments to be created / updated and the attachments that need to be deleted.
- Throws:
ContextBuilderException
- When the uploads could not be processed.
-
-