QueryResultAnnotatedObject.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: BI Dashboard
  6. *| (C) Copyright IBM Corp. 2018
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. /**
  13. * This Class encapsulates result object which contains the
  14. * 1. Annotated result data returned from annotation execution service
  15. * 2. Annotation status (error/warning/message) including the overall predict title
  16. **/
  17. define(['./QueryResultObject'], function (BaseClass) {
  18. 'use strict';
  19. var QueryResultObject = BaseClass.extend({
  20. _predictStatus: null,
  21. _predictDeco: null,
  22. init: function init(renderContext, resultData) {
  23. QueryResultObject.inherited('init', this, [renderContext]);
  24. this._predictStatus = resultData.predictStatus;
  25. this._predictDeco = resultData.deco;
  26. this._predictResults = resultData.predictResults;
  27. },
  28. getStatus: function getStatus() {
  29. return this._predictStatus ? this._predictStatus.state : null;
  30. },
  31. getErrors: function getErrors() {
  32. return this._predictStatus ? this._predictStatus.errors : null;
  33. },
  34. getWarnings: function getWarnings() {
  35. return this._predictStatus ? this._predictStatus.warnings : null;
  36. },
  37. getMessages: function getMessages() {
  38. return this._predictStatus ? this._predictStatus.messages : null;
  39. },
  40. getPredictTitle: function getPredictTitle() {
  41. return this._predictStatus ? this._predictStatus.title : null;
  42. },
  43. getStatisticalDetails: function getStatisticalDetails() {
  44. return this._predictResults && this._predictResults.statisticalDetails || [];
  45. },
  46. isDataReordered: function isDataReordered() {
  47. return this._predictStatus && this._predictStatus.reordered;
  48. }
  49. });
  50. return QueryResultObject;
  51. });
  52. //# sourceMappingURL=QueryResultAnnotatedObject.js.map