Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

how can we remove Unarchived file also when we do unpublish the zip file?

Avatar

Level 4

Once asset zip file publish from author to publish instance the UnarchiverProcess(workflow) extracts ZIP files into DAM Folder.

how to remove Unarchived file once we unpublish the zip file form author instance. here zip file get removed once we unpublished the asset but Unarchived file remains as its. how can we remove this file also when we do unpublish the zip file?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @karthick1356,

I think the way how you are currently using Unarchiver Process is incorrect. In my opinion zip file should be extracted on author instance, and then you should publish the result of this operation. This will give you full control in terms of activation and/or deactivation or any updates, e.g. metadata etc

The current approach you are using could produce following issues:

  • you can not deactivate files that have been extracted from archive
  • you can accidentally overwrite the extracted files, e.g. when you upload file with the same name in the location where zip file has been unarchived
  • there could be some inconsistency between publish instance, e.g. in case when on one of the publish instance unarchive process will fail, as a result some files will be or not available for end user depending on publish instance he/she will be redirected to
  • this is rather corner case, but I can imagine that for large zip archive, unarchiving process can consume lot of resources and have some temporary impact on publish instance performance

I would recommend to change location of unarchiving process to AEM author instance, this will allow to solve your problem and avoid other issues in the future.

If for any reason you still wanted to keep your process and run unarchive on publish, then you will need to transfer data related to this process (or rather results of this process) to author instance to have ability to run deactivation. This could be done using sling distribution or revers replication - but to me this sound like an overengineering.

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi @karthick1356,

I think the way how you are currently using Unarchiver Process is incorrect. In my opinion zip file should be extracted on author instance, and then you should publish the result of this operation. This will give you full control in terms of activation and/or deactivation or any updates, e.g. metadata etc

The current approach you are using could produce following issues:

  • you can not deactivate files that have been extracted from archive
  • you can accidentally overwrite the extracted files, e.g. when you upload file with the same name in the location where zip file has been unarchived
  • there could be some inconsistency between publish instance, e.g. in case when on one of the publish instance unarchive process will fail, as a result some files will be or not available for end user depending on publish instance he/she will be redirected to
  • this is rather corner case, but I can imagine that for large zip archive, unarchiving process can consume lot of resources and have some temporary impact on publish instance performance

I would recommend to change location of unarchiving process to AEM author instance, this will allow to solve your problem and avoid other issues in the future.

If for any reason you still wanted to keep your process and run unarchive on publish, then you will need to transfer data related to this process (or rather results of this process) to author instance to have ability to run deactivation. This could be done using sling distribution or revers replication - but to me this sound like an overengineering.

Avatar

Level 4

Hi Lukasz, Yes, you are right that zip file should be extracted on author instance. This was changed earlier as per org decision to save some space in author instance. is there any way to make it better in publish instance?

Avatar

Level 4

Hi lukasz, i had created the folder of same name of unarchived file and added jcr:content node to it in the author Instance. Now i tried to unpublish the folder from author instance and its unpublished. there is no unarchived  folder present in the publish instance. I need to check that is there any side effect by doing this way. do you think this is fine do it ?

Avatar

Community Advisor

Hi @karthick1356,

Well, from my point of view this looks more like a workaround than a proper solution - which I think will be to do zip archive extraction on author instance.

Nevertheless if this works for you, and is acceptable from your customer side - I do not see any side effects, maybe apart the fact you will have to manually create specific folder on author, that will correspond to folder that has been created as part of zip archive extraction on publish, to proceed with deactivation. But maybe this is not happen to often, and this activity is not an issue in your case.

Avatar

Level 4

Thanks @lukasz-m. I have plan to move manual folder creation process into code, so that as soon as i upload the file the correspond folder get created behind scene.