AnsweredAssumed Answered

Custom Download Action

Question asked by uskiki85 on Mar 18, 2011
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

Outcomes