ModifyReportDispatcherEntry.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2014
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. /*
  13. *******************************************************************************
  14. *** View DispatcherEntry.js for information on the dispatcher entry classes ***
  15. *******************************************************************************
  16. */
  17. function ModifyReportDispatcherEntry(oCV)
  18. {
  19. ModifyReportDispatcherEntry.baseConstructor.call(this, oCV);
  20. this.m_action = null;
  21. if (oCV) {
  22. this.m_viewerWidget = oCV.getViewerWidget();
  23. this.setRequestHandler(new RequestHandler(oCV));
  24. this.setWorkingDialog(oCV.getWorkingDialog());
  25. this.setRequestIndicator(oCV.getRequestIndicator());
  26. this.setCallbacks({
  27. "complete" : {"object" : this, "method" : this.onComplete},
  28. "prompting" : {"object" : this, "method" : this.onPrompting}
  29. });
  30. }
  31. }
  32. ModifyReportDispatcherEntry.prototype = new AsynchDataDispatcherEntry();
  33. ModifyReportDispatcherEntry.baseConstructor = AsynchDataDispatcherEntry;
  34. ModifyReportDispatcherEntry.prototype.parent = AsynchDataDispatcherEntry.prototype;
  35. ModifyReportDispatcherEntry.prototype.initializeAction = function(action)
  36. {
  37. this.setKey(action.getActionKey());
  38. this.setCanBeQueued(action.canBeQueued());
  39. this.m_action = action;
  40. };
  41. ModifyReportDispatcherEntry.prototype.getAction = function() {
  42. return this.m_action;
  43. };
  44. ModifyReportDispatcherEntry.prototype.prepareRequest = function()
  45. {
  46. if(this.m_viewerWidget){
  47. DispatcherEntry.addWidgetInfoToFormFields(this.m_viewerWidget, this);
  48. }
  49. var actionFormFields = new ActionFormFields(this);
  50. actionFormFields.addFormFields();
  51. if (this.m_viewerWidget) {
  52. this.addFormField("cv.id", this.m_viewerWidget.getViewerId());
  53. }
  54. this.addFormField("keepIterators", "true");
  55. this.addFormField("run.prompt", this.m_action.getPromptOption());
  56. if(this.m_action.reuseQuery() === true) {
  57. this.addFormField("reuseResults", "true");
  58. }
  59. else if (this.m_action.reuseGetParameter() === true) {
  60. this.addFormField("reuseResults", "paramInfo");
  61. }
  62. if(this.m_action.keepRAPCache() === false && this.m_viewerWidget) {
  63. // delete the rap cache
  64. this.m_viewerWidget.clearRAPCache();
  65. }
  66. if (this.m_action.reuseConversation() === true) {
  67. this.addFormField("cv.reuseConversation", "true");
  68. }
  69. if (this.m_action.isUndoable() && this.m_action.getUndoRedoQueue()) {
  70. this.m_action.getUndoRedoQueue().initUndoObj({"tooltip" : this.m_action.getUndoHint(), "saveSpec" : this.m_action.saveSpecForUndo()});
  71. }
  72. // So that we'll end up on the same tab
  73. if (this.getViewer().getCurrentlySelectedTab() && !this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")) {
  74. this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup", this.getViewer().getCurrentlySelectedTab());
  75. }
  76. this.getViewer().clearTabs();
  77. };
  78. ModifyReportDispatcherEntry.prototype.onComplete = function(asynchDATAResponse, arg1)
  79. {
  80. if (this.getRequestHandler()) {
  81. this.getRequestHandler().onComplete(asynchDATAResponse);
  82. }
  83. };
  84. ModifyReportDispatcherEntry.prototype.onPrompting = function(response) {
  85. if (this.getRequestHandler()) {
  86. this.getRequestHandler().onPrompting(response);
  87. }
  88. };
  89. /**
  90. * Need to update the Viewer state with any information we might have gotten in the working response
  91. * @param {Object} asynchDATAResponse
  92. * @param {Object} arg1
  93. */
  94. ModifyReportDispatcherEntry.prototype.onWorking = function(asynchDATAResponse, arg1)
  95. {
  96. this.parent.onWorking.call(this, asynchDATAResponse, arg1);
  97. var responseState = asynchDATAResponse.getResponseState();
  98. if (this.getRequestHandler()) {
  99. this.getRequestHandler().updateViewerState(responseState);
  100. }
  101. };