Wednesday, 16 May 2012

Create basic script

JavaScript SandBox script file has extension of .jsb . File includes one main() function.

function main(env, args) {
  var req = args.get('request');
  var res = args.get('response');
  var root = args.get('root');
  var folder_id = args.get('folder_id');
  var folder_path = args.get('folder_path');
  var file_id = args.get('file_id');
  var file_name = args.get('file_name');

  res.setContentType('text/html');
  res.write('Root: ' + root + '
'); res.write('Folder Id: ' + folder_id + '
'); res.write('Folder Path: ' + folder_path + '
'); res.write('File Id: ' + file_id + '
'); res.write('File Name: ' + file_name + '
'); }

No comments:

Post a Comment