cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Download Action

uskiki85
Champ in-the-making
Champ in-the-making
Hi,

I need to customize a download action. I would like this action transform the document in pdf and launch the download with the pdf url generated by a webscript.

So I have created the action button

<action type="action-link" id="onActionCustomDownload" label="actions.document.CustomDownload" />

and in the actions.js, i have add


onActionCustomDownload: function dlA_onActionCustomDownload(file)
{
    
   //call a webscript which make PDF transformation
    this.modules.actions.genericAction(
     {
              success:
              {
                  message: this.msg("message.download.success")
               },
               failure:
               {
                  message: this.msg("message.download.failure")
               },
               webscript:
               {
                 method: Alfresco.util.Ajax.GET,
                 name: "downDoc?node={node}",                
                 params:
                 {
                    node: nodeRef.nodeRef                                 
                 }               
               }
         }
     // download pdf file ?? pdfurl ?
     windows.open(pdrurl);
}

Actually, the pdf file is generated but i don't know how to return pdf url from my webscript or maybe there is another way to do this ?

Thanks for your help
1 REPLY 1

mikeh
Star Contributor
Star Contributor
Please don't cross-post. I already moved your original question to the Share Development forum.

Thanks,
Mike