softwareUpdate.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. var shared = require("softwareManager/TriggerFcns");
  2. var console = require("console");
  3. var LABKEY = require("labkey");
  4. //importClass(Packages.java.io.File);
  5. //var fs = require ("fs");
  6. //how routines implemented from java look in javascript:
  7. //https://docs.nativescript.org/runtimes/android/marshalling/java-to-js
  8. function init(event, errors) {
  9. console.log("init() called in orgs.js with an event type of " + event);
  10. //console.log("Function in shared TriggerFcns.js script returns :" + shared.sampleFunc('echo'));
  11. }
  12. function complete(event, errors) {
  13. console.log("complete() called in orgs.js with an event type of " + event);
  14. }
  15. function afterInsert(row, errors){
  16. console.log("afterInsert() called in orgs.js with a row object of " + row);
  17. }
  18. function beforeUpdate(row, oldRow, errors){
  19. console.log("softwareManager::beforeUpdate() called in orgs.js with a row object of " + row + " and an oldRow of " + oldRow);
  20. }
  21. function beforeDelete(row, errors){
  22. console.log("beforeDelete() called in orgs.js with a row object of " + row);
  23. }
  24. function beforeInsert(row, errors){
  25. console.log("beforeInsert() called in orgs.js with a row object of " + row);
  26. }
  27. function afterUpdate(row, oldRow, errors){
  28. console.log("afterUpdate() called in orgs.js with a row object of " + row + " and an oldRow of " + oldRow);
  29. let scriptArg={};
  30. scriptArg.softwarePackage=row['softwarePackage'];
  31. scriptArg.source=row['source'];
  32. scriptArg.branch=row['branch'];
  33. shared.gitPull(scriptArg);
  34. console.log('gitPull reports: '+scriptArg.output);
  35. }
  36. function afterDelete(row, errors){
  37. console.log("afterDelete() called in orgs.js with a row object of " + row);
  38. }