AnsweredAssumed Answered

Custom Web Script for document Download

Question asked by cris_cc on Jun 3, 2010
Latest reply on Jun 17, 2010 by jottley
Hello everyone,
I need to write a custom Web Script in order to download a file from the repository.
I know that there are native services to do that, but I need to validate the document id through other back-end systems using remote.call

Here what I've done so far in the cstdownload.get.js :

var nodeid = args.nodeid;

if ( crossCheck(nodeid) ){ // This is a Custom function!!!
   
    var file = search.findNode("workspace://SpacesStore/" + nodeid);

   // Render the content of the file here !!! HELP pls!!
  
}else{
    status.code = 400;
    status.message = "Check on back-end system is failed!";
    status.redirect = true;
}

function crossCheck(nodeid){
…..
}

Does anyone have some suggestion where I can find some good example to do that?

I checked the forum and alfresco docs, but I've just found example about native services.

I'm running Alfresco Community v3.2.0 (r2 2440).

Thanks in advance,
Cris

Outcomes