wizardDetectorSimpleRequestAbstract.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) 2015, Arthur Schiwon <blizzz@owncloud.com>
  3. * This file is licensed under the Affero General Public License version 3 or later.
  4. * See the COPYING-README file.
  5. */
  6. OCA = OCA || {};
  7. (function() {
  8. /**
  9. * @classdesc a Port Detector. It executes the auto-detection of the port
  10. * by the ownCloud server, if requirements are met.
  11. *
  12. * @constructor
  13. */
  14. var WizardDetectorFilterSimpleRequestAbstract = OCA.LDAP.Wizard.WizardDetectorGeneric.subClass({
  15. runsOnRequest: true,
  16. /**
  17. * runs the detector, if port is not set.
  18. *
  19. * @param {OCA.LDAP.Wizard.ConfigModel} model
  20. * @param {string} configID - the configuration prefix
  21. * @returns {boolean|jqXHR}
  22. * @abstract
  23. */
  24. run: function(model, configID) {
  25. if(_.isUndefined(this.wizardMethod)) {
  26. console.warn('wizardMethod not set! ' + this.constructor);
  27. return false;
  28. }
  29. model.notifyAboutDetectionStart(this.targetKey);
  30. var params = OC.buildQueryString({
  31. action: this.wizardMethod,
  32. ldap_serverconfig_chooser: configID
  33. });
  34. return model.callWizard(params, this.processResult, this);
  35. }
  36. });
  37. OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract = WizardDetectorFilterSimpleRequestAbstract;
  38. })();