C_QanExecPlanNode.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /****************************************************************************************************************************
  2. Licensed Materials - Property of IBM
  3. BI and PM: QFW
  4. © Copyright IBM Corp. 2005, 2010
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. *****************************************************************************************************************************/
  7. function C_QanExecPlanNode( iNodeId, nProviderQuery, oParentNode, oNestedCallsParentNode )
  8. {
  9. this.m_iNodeId = iNodeId;
  10. this.m_nProviderQuery = nProviderQuery;
  11. this.m_oParentNode = oParentNode;
  12. this.m_oNestedCallsParentNode = oNestedCallsParentNode;
  13. this.m_aChildNodes = [];
  14. if( oParentNode )
  15. oParentNode.F_AddChild( this );
  16. else
  17. if( oNestedCallsParentNode )
  18. {
  19. oNestedCallsParentNode.F_AddNestedRoot( this );
  20. }
  21. };
  22. C_QanExecPlanNode.prototype.F_AddChild = function( oExecPlanNode )
  23. {
  24. this.m_aChildNodes.push( oExecPlanNode );
  25. };
  26. C_QanExecPlanNode.prototype.F_AddNestedRoot = function( oExecPlanNode )
  27. {
  28. if( !this.m_aNestedRootNodes )
  29. this.m_aNestedRootNodes = [];
  30. this.m_aNestedRootNodes.push( oExecPlanNode );
  31. };
  32. C_QanExecPlanNode.prototype.F_GetNestedRootNodes = function()
  33. {
  34. return this.m_aNestedRootNodes;
  35. };
  36. C_QanExecPlanNode.prototype.F_GetChildNodes = function()
  37. {
  38. return this.m_aChildNodes;
  39. };
  40. C_QanExecPlanNode.prototype.F_GetParentNode = function()
  41. {
  42. return this.m_oParentPlanNode;
  43. };
  44. C_QanExecPlanNode.prototype.F_GetNestedCallsParentNode = function()
  45. {
  46. return this.m_oNestedCallsParentNode;
  47. };
  48. C_QanExecPlanNode.prototype.F_GetID = function()
  49. {
  50. return this.m_iNodeId;
  51. }
  52. C_QanExecPlanNode.prototype.F_GetName = function()
  53. {
  54. if( this.m_sName )
  55. return this.m_sName;
  56. this.m_sName = this.m_nProviderQuery.getAttribute( "name" );
  57. return this.m_sName;
  58. };
  59. C_QanExecPlanNode.prototype.F_GetProvider = function()
  60. {
  61. return this.m_nProviderQuery.getAttribute( "provider" );
  62. }
  63. C_QanExecPlanNode.prototype.F_SetQueryFeedback = function( nQueryFeedbackResult )
  64. {
  65. this.m_nQueryFeedbackResult = nQueryFeedbackResult;
  66. }
  67. C_QanExecPlanNode.prototype.f_getFeedbackProperty = function( sPropertyName )
  68. {
  69. if( !this.m_nQueryFeedbackResult )
  70. return;
  71. var v_nProperty =
  72. this.m_nQueryFeedbackResult.selectSingleNode( "property[@name='" + sPropertyName + "']" );
  73. if( !v_nProperty )
  74. return;
  75. return v_nProperty.text;
  76. }
  77. C_QanExecPlanNode.prototype.F_GetCommandType = function()
  78. {
  79. return this.f_getFeedbackProperty("nativeCommandType");
  80. }
  81. C_QanExecPlanNode.prototype.F_GetNativeCommand = function()
  82. {
  83. return this.f_getFeedbackProperty("nativeCommandText");
  84. }
  85. C_QanExecPlanNode.prototype.F_GetCognosCommand = function()
  86. {
  87. return this.f_getFeedbackProperty("CognosCommandText");
  88. }
  89. C_QanExecPlanNode.prototype.F_GetConnections = function()
  90. {
  91. if( !this.m_nQueryFeedbackResult )
  92. return;
  93. var v_nlConnections =
  94. this.m_nQueryFeedbackResult.selectSingleNode( "property[@name='connections']/connection" );
  95. return v_nlConnections;
  96. }
  97. C_QanExecPlanNode.prototype.f_getProvider2OperationName = function()
  98. {
  99. if( C_QanExecPlanNode.prototype.m_provider2OperationName )
  100. return C_QanExecPlanNode.prototype.m_provider2OperationName;
  101. C_QanExecPlanNode.prototype.m_provider2OperationName = [];
  102. C_QanExecPlanNode.prototype.m_provider2OperationName["RelationalQueryProvider"] = "SQL";
  103. C_QanExecPlanNode.prototype.m_provider2OperationName["OlapQueryProvider"] = "MDX";
  104. C_QanExecPlanNode.prototype.m_provider2OperationName["CubeBuildProvider"] = "Dynamic Cube";
  105. C_QanExecPlanNode.prototype.m_provider2OperationName["MDProvider"] = "Master-Detail";
  106. C_QanExecPlanNode.prototype.m_provider2OperationName["ZeroSuppressionProvider"] = "Zero/Null Suppression";
  107. C_QanExecPlanNode.prototype.m_provider2OperationName["ReporterModeProvider"] = "Stitching";
  108. C_QanExecPlanNode.prototype.m_provider2OperationName["NoDataModeProvider"] = "Data emulation";
  109. C_QanExecPlanNode.prototype.m_provider2OperationName["MDOperationProvider"] = "Member names fix up";
  110. return C_QanExecPlanNode.prototype.m_provider2OperationName;
  111. }
  112. C_QanExecPlanNode.prototype.F_GetOperationName = function()
  113. {
  114. if( this.m_sOperationName )
  115. return this.m_sOperationName;
  116. var v_sProvider = this.F_GetProvider();
  117. if( v_sProvider == "MDOperationProvider" && this.m_aNestedRootNodes )
  118. return "@cube";
  119. this.m_sOperationName = this.f_getProvider2OperationName()[v_sProvider];
  120. if( !this.m_sOperationName )
  121. this.m_sOperationName = v_sProvider + " operation";
  122. return this.m_sOperationName;
  123. }
  124. C_QanExecPlanNode.prototype.f_getProvider2BoxHtml = function()
  125. {
  126. if( C_QanExecPlanNode.prototype.m_provider2BoxHtml )
  127. return C_QanExecPlanNode.prototype.m_provider2BoxHtml;
  128. C_QanExecPlanNode.prototype.m_provider2BoxHtml = [];
  129. C_QanExecPlanNode.prototype.m_provider2BoxHtml["RelationalQueryProvider"] = "<b>SQL<b>";
  130. C_QanExecPlanNode.prototype.m_provider2BoxHtml["OlapQueryProvider"] = "<b>MDX</b>";
  131. C_QanExecPlanNode.prototype.m_provider2BoxHtml["CubeBuildProvider"] = "Dynamic<br>Cube";
  132. C_QanExecPlanNode.prototype.m_provider2BoxHtml["MDProvider"] = "Master-Detail";
  133. C_QanExecPlanNode.prototype.m_provider2BoxHtml["ZeroSuppressionProvider"] = "Zero/Null</br>Suppression";
  134. C_QanExecPlanNode.prototype.m_provider2BoxHtml["ReporterModeProvider"] = "Stitching";
  135. C_QanExecPlanNode.prototype.m_provider2BoxHtml["NoDataModeProvider"] = "Data<br>emulation";
  136. C_QanExecPlanNode.prototype.m_provider2BoxHtml["MDOperationProvider"] = "Member names<br>fix up";
  137. return C_QanExecPlanNode.prototype.m_provider2BoxHtml;
  138. }
  139. C_QanExecPlanNode.prototype.F_GetOperationBoxHtml = function()
  140. {
  141. if( this.m_sOperationBoxHtml )
  142. return this.m_sOperationBoxHtml;
  143. var v_sProvider = this.F_GetProvider();
  144. if( v_sProvider == "MDOperationProvider" && this.m_aNestedRootNodes )
  145. return "@cube";
  146. this.m_sOperationBoxHtml = this.f_getProvider2BoxHtml()[v_sProvider];
  147. if( !this.m_sOperationBoxHtml )
  148. this.m_sOperationBoxHtml = v_sProvider + " operation";
  149. return this.m_sOperationBoxHtml;
  150. }