[MGNLDMS-204] ZipUpload: provide hooks for extending Created: 10/Jan/11  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.x

Type: New Feature Priority: Minor
Reporter: Richard Unger Assignee: Philipp Bärfuss
Resolution: Won't Do Votes: 0
Labels: dms
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

N/A


Attachments: Text File ZipUpload.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

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.



 Comments   
Comment by Magnolia International [ 10/Jan/11 ]

I think both suggestions make sense - care to provide a patch ?

Comment by Richard Unger [ 11/Jan/11 ]

Patch for ZipUpload (revision 41142)

Patches the following file:

/magnolia-module-dms/src/main/java/info/magnolia/module/dms/gui/ZipUpload.java

Comment by Philipp Bärfuss [ 11/Jan/11 ]

Thanks for the patch. Seems to be safe enough to be applied for 1.5.2 (Magnolia 4.4.2)

Comment by Richard Unger [ 13/Jan/11 ]


Fixed version of patch

Comment by Boris Kraft [ 06/Feb/12 ]

Can you check if the patch has been applied?

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 00:49:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.