OutputHandler.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Content-Apps
  5. *| (C) Copyright IBM Corp. 2018
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or disclosure
  8. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *+------------------------------------------------------------------------+
  10. */
  11. define([
  12. 'bi/commons/ui/core/Class'
  13. ], function (Class) {
  14. 'use strict';
  15. var OutputHandler = Class.extend({
  16. /**
  17. * Called by constructor.
  18. * @param {object} options
  19. */
  20. init: function (options) {
  21. void (options);
  22. },
  23. /**
  24. * Returns the relative priority of this handler: the higher the number the higher the priority.
  25. * So if two handlers can execute the output, the one with the higher priority will be chosen
  26. * @returns {number} the relative priority of this handler
  27. */
  28. getPriority: function() {
  29. return -1;
  30. },
  31. /**
  32. * Returns a boolean to indicate if it can handle the output, given the options
  33. * @param {object} options
  34. * @param {object} options.glassContext
  35. * @param {object} options.output
  36. * @param {object} options.report
  37. * @returns {boolean}
  38. */
  39. canExecute: function(options) {
  40. void(options);
  41. return false;
  42. },
  43. /**
  44. * Returns a promise wrapped boolean to indicate if it handled the output, given the options
  45. * @param {object} options
  46. * @param {object} options.glassContext
  47. * @param {object} options.output
  48. * @param {object} options.report
  49. * @returns {object} Promise
  50. */
  51. execute: function(options) {
  52. void(options);
  53. return Promise.reject(new Error('Function not implemented'));
  54. }
  55. });
  56. return OutputHandler;
  57. });