-
New Feature
-
Resolution: Won't Do
-
Minor
-
None
-
N/A
-
-
Yes
-
Empty show more show less
While creating my image-metadata module, I was looking for a way to "hook" into the Zip-Upload in DMS.
Unfortunately, there is currently no way to extend the ZipUpload with custom functionality, other than replacing the whole class.
My Use-Case is the following: when a user uploads a ZIP-File with images, I want to automatically perform my metadata import (EXIF & XMP tags) for all contained images.
Problem is that the class info.magnolia.module.dms.gui.ZipUpload (DMS module) does not provide a hook which is called per processed file, and declares it's methods processFile and processEntry as private, making it impossible to extend the class.
Solution:
Add a method like
protected void postProcessFile(Content dmsNode){}
to class ZipUpload, and make sure it gets called from within processFile for each file handled.
Alternatively, just make processFile and processEntry protected rather than private.