[
http://jira.magnolia-cms.com/browse/MGNLDMS-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Philipp Bärfuss updated MGNLDMS-204:
------------------------------------
Patch included: [Yes]
Fix Version/s: 1.5.2
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.
was:
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.
Thanks for the patch. Seems to be safe enough to be applied for 1.5.2 (Magnolia
4.4.2)
> ZipUpload: provide hooks for extending
> --------------------------------------
>
> Key: MGNLDMS-204
> URL: http://jira.magnolia-cms.com/browse/MGNLDMS-204
> Project: Magnolia DMS Module
> Issue Type: New Feature
> Environment: N/A
> Reporter: Richard Unger
> Assignee: Philipp Bärfuss
> Fix For: 1.5.2
>
> Attachments: ZipUpload.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------