[FORMDB-18] Cannot map attachments to form fields (when form has multiple attachments) Created: 08/May/17  Updated: 08/May/17

Status: Open
Project: Form2DB App
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Fadi Wissa Assignee: Marvin Kerkhoff
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File storeAttachments modification.png    
Issue Links:
relation
is related to FORMDB-9 Form2DB possible improvements Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

When I have two (or more) attachments on the same form, after the user submits the form, I cannot tell which attachment belongs to which field.

Let's say there's a customer logo attachment field and a customer background image attachment field.
After the data is submitted and saved in the DB I cannot tell which attachment file belongs to which "field" in the original form.

My recommendation would be to keep the original file name as uploaded by the user, but to include the attachment mgnl:asset node within another node/folder that has the name of the field the file belongs to.



 Comments   
Comment by Fadi Wissa [ 08/May/17 ]

My quick implementation is as follows:

I basically added the following line to Form2dbProcessor.storeAttachments

Node fileFolderNode = entry.addNode(attachment.getKey(), "mgnl:folder");
... then added the fileNode to this fileFolderNode
Node fileNode = fileFolderNode.addNode(filename, Asset.NAME);

Generated at Mon Feb 12 01:58:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.