Alfresco – Customizing alfresco-unzip-action addon

Related to my last article Sending a notification email to Site Administrators by using JavaScript API, we are going to customize alfresco-unzip-action by using the same principles. This addon include one new Share action to unzip inside Alfresco any ZIP file.

Following JavaScript unzips a ZIP file on the same folder (by using the action defined by alfresco-unzip-action). Next, we’ll define a new rule in order to throw this script every time a new document is uploaded to the folder.


function main() {
    var importer = actions.create("import");
    importer.parameters.encoding = "UTF-8";
    importer.parameters.destination = document.parent;


In order to have this script available in web interface, we need to upload it to scripts folder repository (Data Dictionary > Scripts)

Rule definition

Once our script is available, just choose one site folder and create a new rule by using Run script option and setting:

  • When:
    • Items are created or enter this folder
  • If all criteria are met:
    • MIME type for cm:content is ‘ZIP’
  • Run action
    • Run script ‘unzip.js’

From now, every time a new zip file is uploaded to the folder, its content will be unzipped in the same location.

Published by angelborroy

Understanding software.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: