Class FileSubmissionIndex

java.lang.Object
com.inductiveautomation.perspective.gateway.util.FileSubmissionIndex

public final class FileSubmissionIndex extends Object
Builds a FileId -> FieldFileEntry lookup from a Perspective form submission JSON payload. The index lets FormFiles.groupByField(java.util.List<com.inductiveautomation.perspective.gateway.util.UploadedFilePart>, java.util.Map<java.lang.String, com.inductiveautomation.perspective.gateway.util.FileSubmissionIndex.FieldFileEntry>) join multipart files[] parts (whose submitted filenames are FileIds) back to their owning form field and recover the user-facing display name from the submission JSON.

Two entry points are provided because the three call sites (form-submission, form-submit-action-performed, form-change-performed) differ in input shape but not in walking logic:

  • Method Details

    • buildFromSubmission

      public static Map<String,FileSubmissionIndex.FieldFileEntry> buildFromSubmission(com.inductiveautomation.ignition.common.gson.JsonObject data)
      Builds an index from a multi-field submission payload — used by the form-submission and form-submit-action-performed endpoints. Each entry in data is treated as a single field; values that aren't a JSON array of FileMeta-shaped objects contribute nothing.
    • buildFromChange

      public static Map<String,FileSubmissionIndex.FieldFileEntry> buildFromChange(String fieldId, @Nullable com.inductiveautomation.ignition.common.gson.JsonElement value)
      Builds an index from a single-field change event — used by the form-change-performed endpoint, where the request carries only the changing field's id and value.