Current solution involves composite field based solution and requires the presence of redundant static fields for dimensions (width and height) and file name. Those are quirky implementation-wise and also are buggy.
The following improvements should be made to the Upload Field implementation:
- Attach all metadata information that is part of a File to the UploadField (removing the need for redundant static fields).
- Add required property and validation to UploadField
- Enable adding custom factoryClass for the UploadField to maintain flexibility in adding new features to the UploadField (DamUploadField in Assets app).
- Remove redundant static fields from Assets app (and update the app descriptor for the improved UploadField)
- Extract ValueBoundProperty interface from info.magnolia.ui.field.FieldDefinition, which enables adding a Value based property trait to both simple FieldDefinition (which always have a value) or a info.magnolia.ui.editor.ComplexPropertyDefinition (which may or may not have a Value trait).