Class FileSubmissionIndex
java.lang.Object
com.inductiveautomation.perspective.gateway.util.FileSubmissionIndex
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:
buildFromSubmission(JsonObject)walks a multi-field data object keyed by field id.buildFromChange(String, JsonElement)walks a single(fieldId, value)pair.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPairs an owning field id with the user-facing display name for a single file. -
Method Summary
Modifier and TypeMethodDescriptionbuildFromChange(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.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.
-
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 indatais 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.
-