How to revive legacy "flatStructure" download
Question?
- What piece of functionality do you have a question about? About the asset download functionality
- What are you trying to achieve? What should I do to prevents the creation of additional folder that wraps my assets in my zip file while downloading ? Like in the legacy mode "flatStructure"
I think we'll have to add a toggle to the dialog that lets you force a flat structure and check that on like 118 here:
https://github.com/adobe/asset-share-commons/blob/develop/core.cloud/src/main/java/com/adobe/aem/commons/assetshare/content/renditions/download/async/impl/AsyncAssetRenditionsDownloadServlet.java
I'm not sure what would happen if you have 2 assets w the same file name tho (but in different assets folders)
I don't really understand what to do here.
Do I need to force 118 to false ?
I tried doing that but the folder is still created
Seems like my Post request is going to https://github.com/adobe/asset-share-commons/blob/develop/core/src/main/java/com/adobe/aem/commons/assetshare/content/renditions/download/impl/AssetRenditionsDownloadServlet.java and not the async one
Are on on SDK? SDK doesn't have the AEM async download framework.
You'd have to develop against an RDE to dev/test against the async stuff
Oh that's why ! I'm on a SDK on my local environment, I didn't know that there was a difference.
Mmh if I only wanted to custom this https://github.com/adobe/asset-share-commons/blob/develop/core/src/main/java/com/adobe/aem/commons/assetshare/content/renditions/download/impl/AssetRenditionsZipperImpl.java By extending to it and changing 97 to false ?
Would it work? And how should I do that? I tried a few things but my request doesn't seems to go in it.
I may have succeded somehow, but that doesn't seem a clean way to do it.
https://github.com/adobe/asset-share-commons/blob/develop/core/src/main/java/com/adobe/aem/commons/assetshare/content/renditions/download/impl/AssetRenditionsDownloadServlet.java
https://github.com/adobe/asset-share-commons/blob/develop/core/src/main/java/com/adobe/aem/commons/assetshare/content/renditions/download/impl/AssetRenditionsZipperImpl.java
I took these both into my code and set it to false and that did the job mmh
Ahh - yes, if you're going to run this on AEM as a cloud service you need to do it in the async. If your are running 6.5 the you'd do it on the old one.
By the way, I was wondering "I'm not sure what would happen if you have 2 assets w the same file name tho (but in different assets folders)" what is happening right now when 2 assets w the same name is being downloaded ? The 2nd asset isn't downloaded ?
if (folderName != null && !zipEntryFolderNames.contains(folderName)) { addFolderAsZipEntry(folderName + "/", zipOutputStream); zipEntryFolderNames.add(folderName); }
Thinking about adding this into the main-line -- do you need this for AEM CS or 6.5?
I'm using 6.5