Class SubmissionFieldPreparers

java.lang.Object
formflow.library.pdf.SubmissionFieldPreparers

@Component public class SubmissionFieldPreparers extends Object
  • Constructor Details

  • Method Details

    • prepareSubmissionFields

      public List<SubmissionField> prepareSubmissionFields(Submission submission)
      This method creates a list of SubmissionField objects which will be used to create the PdfField objects that will eventually populate a given PDF. First it creates a single map of all input related data by flattening the subflow and input data objects into a single map. Then, it iterates over each preparer and calls the prepareSubmissionFields passing the submission, the flattened input data map and the PdfMap object from a given `pdf-map.yaml` file. First the default preparers are called which will run the OneToOnePreparer, OneToManyPreparer and the DatabaseFieldPreparer. Then, it will call any custom preparers that have been added to the application context by an implementer of the formflow library. The custom preparers are called last so that any SubmissionField objects created by the default preparers can and will be overridden by the custom preparers.
      Parameters:
      submission - the Submission that holds the data we need to prepare for the PDF file
      Returns:
      a list of SubmissionField objects for all fields in a given PdfMap from a `pdf-map.yaml` file.