VisQueryPostProcessor.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: BI Dashboard
  6. *| (C) Copyright IBM Corp. 2017
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. define(['../../../../lib/@waca/core-client/js/core-client/ui/core/Class'], function (BaseClass) {
  13. 'use strict';
  14. /**
  15. * This Class does Query result response post-processing such as processing the original query result
  16. * into a data structure that is required by GeoInfo, Data for small multiples visualization etc.
  17. **/
  18. var PostprocessorClass = BaseClass.extend({
  19. /*{QueryResultData}*/
  20. _queryResultData: null,
  21. /*Process Information, such as now of clipped data rows*/
  22. _processInfo: null,
  23. /*
  24. *@Constructor
  25. *@param {Object} options
  26. * options.queryResultData QueryResultData object that is to be processed
  27. */
  28. init: function init(options) {
  29. PostprocessorClass.inherited('init', this, arguments);
  30. this._queryResultData = options.queryResultData;
  31. },
  32. /**
  33. *@return {QueryResultData}
  34. *
  35. *To be overridden by child class
  36. **/
  37. _processData: function _processData() {
  38. this._setProcessInfo(null); /*Set process info depending on the process*/
  39. return this._queryResultData; /*processed data*/
  40. },
  41. _getProcessInfo: function _getProcessInfo() {
  42. return this._processInfo;
  43. },
  44. _setProcessInfo: function _setProcessInfo(info) {
  45. this._processInfo = info;
  46. },
  47. processData: function processData() {
  48. return {
  49. 'result': this._processData(),
  50. 'info': this._getProcessInfo()
  51. };
  52. }
  53. });
  54. return PostprocessorClass;
  55. });
  56. //# sourceMappingURL=VisQueryPostProcessor.js.map