extensions/net.sf.basedb.reggie/trunk/resources/admin/analysis-cleanup.js

Code
Comments
Other
Rev Date Author Line
4687 26 Feb 18 nicklas 1 var Cleanup = function()
4687 26 Feb 18 nicklas 2 {
4687 26 Feb 18 nicklas 3   var cleanup = {};
4687 26 Feb 18 nicklas 4   var debug = 0;
4687 26 Feb 18 nicklas 5
4687 26 Feb 18 nicklas 6   cleanup.initPage = function()
4687 26 Feb 18 nicklas 7   {
4687 26 Feb 18 nicklas 8     // Navigation
4687 26 Feb 18 nicklas 9     Buttons.addClickHandler('goregister', Wizard.goRegister);
4687 26 Feb 18 nicklas 10     
4687 26 Feb 18 nicklas 11     // Final registration
4687 26 Feb 18 nicklas 12     Events.addEventHandler('wizard', 'wizard-submit', cleanup.submit);
4687 26 Feb 18 nicklas 13     
4687 26 Feb 18 nicklas 14     var url = '../Admin.servlet?ID='+App.getSessionId();
4687 26 Feb 18 nicklas 15     url += '&cmd=GetSecondayAnalysisCleanupCount';
4687 26 Feb 18 nicklas 16     Wizard.showLoadingAnimation('Checking for items in the trashcan...');
4687 26 Feb 18 nicklas 17     Wizard.asyncJsonRequest(url, cleanup.countDone);
4687 26 Feb 18 nicklas 18   }
4687 26 Feb 18 nicklas 19   
4687 26 Feb 18 nicklas 20   cleanup.countDone = function(response)
4687 26 Feb 18 nicklas 21   {
4687 26 Feb 18 nicklas 22     var countDerivedBioAssays = response.countDerivedBioAssays;
4687 26 Feb 18 nicklas 23     var countDerivedBioAssayChildren = response.countDerivedBioAssayChildren;
4687 26 Feb 18 nicklas 24     var countRawBioAssays = response.countRawBioAssays;
4687 26 Feb 18 nicklas 25     Doc.element('countDerivedBioAssays').innerHTML = countDerivedBioAssays;
4687 26 Feb 18 nicklas 26     Doc.element('countRawBioAssays').innerHTML = countRawBioAssays;
4687 26 Feb 18 nicklas 27     Doc.element('countDerivedBioAssayChildren').innerHTML = countDerivedBioAssayChildren;
5581 21 Aug 19 nicklas 28     Doc.element('countFiles').innerHTML = response.countFiles;
4687 26 Feb 18 nicklas 29     Doc.show('step-1');
4687 26 Feb 18 nicklas 30     
4687 26 Feb 18 nicklas 31     if (countRawBioAssays > 0 || countDerivedBioAssays > 0)
4687 26 Feb 18 nicklas 32     {
4687 26 Feb 18 nicklas 33       Doc.show('goregister');
4687 26 Feb 18 nicklas 34       Wizard.showGoNextConfirmation(true, 'Ok, I\'m sure. Let\'s delete them!');
4687 26 Feb 18 nicklas 35     }
4687 26 Feb 18 nicklas 36   }
4687 26 Feb 18 nicklas 37   
4687 26 Feb 18 nicklas 38   
4687 26 Feb 18 nicklas 39   cleanup.submit = function()
4687 26 Feb 18 nicklas 40   {
4687 26 Feb 18 nicklas 41     // Get permission information
4687 26 Feb 18 nicklas 42     var url = '../Admin.servlet?ID='+App.getSessionId();
4687 26 Feb 18 nicklas 43     url += '&cmd=SecondaryAnalysisCleanup';
4687 26 Feb 18 nicklas 44     
4687 26 Feb 18 nicklas 45     Wizard.showLoadingAnimation('Deleting...', 'secondary-cleanup-progress');
4687 26 Feb 18 nicklas 46     Wizard.asyncJsonRequest(url, cleanup.deleteDone, 'POST');
4687 26 Feb 18 nicklas 47   }
4687 26 Feb 18 nicklas 48   
4687 26 Feb 18 nicklas 49   cleanup.deleteDone = function(response)
4687 26 Feb 18 nicklas 50   {
4687 26 Feb 18 nicklas 51     Wizard.showFinalMessage(response.messages);
4687 26 Feb 18 nicklas 52   }
4687 26 Feb 18 nicklas 53
4687 26 Feb 18 nicklas 54   return cleanup;
4687 26 Feb 18 nicklas 55 }();
4687 26 Feb 18 nicklas 56
4687 26 Feb 18 nicklas 57 Doc.onLoad(Cleanup.initPage);
4687 26 Feb 18 nicklas 58