DrillAction.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2013
  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. function DrillAction() {
  13. this.m_bUseReportInfoSelection = false; //default is false
  14. this.m_aDrillSelectedObjects = []; //local array to store selected objects
  15. this.m_useMARequest = false; //flag to enable action arguments block for use ma instead V5 request for getting child/parent information
  16. this.m_userSelectedDrillItem = null;
  17. }
  18. DrillAction.prototype = new ModifyReportAction();
  19. DrillAction.prototype.getHoverClassName = function() { return ""; };
  20. /**
  21. * Only set when the user has picked a specific entry off of the drill down or up subMenu
  22. */
  23. DrillAction.prototype.setRequestParms = function(parms) {
  24. if (parms) {
  25. this.m_userSelectedDrillItem = parms.userSelectedDrillItem;
  26. }
  27. };
  28. DrillAction.prototype.setKeepFocusOnWidget = function(keepFocus)
  29. {
  30. this.m_bKeepFocusOnWidget = keepFocus;
  31. };
  32. DrillAction.prototype.keepFocusOnWidget = function()
  33. {
  34. if (typeof this.m_bKeepFocusOnWidget != "undefined")
  35. {
  36. return this.m_bKeepFocusOnWidget;
  37. }
  38. return true;
  39. };
  40. DrillAction.prototype.getDrillabilityForItemFromReportInfo = function(itemName)
  41. {
  42. if( !this.m_oCV )
  43. {
  44. return null;
  45. }
  46. var reportInfo = this.m_oCV.getRAPReportInfo();
  47. if(!reportInfo)
  48. {
  49. return null;
  50. }
  51. var containers = reportInfo.getContainers();
  52. for( var container in containers )
  53. {
  54. var drillability = reportInfo.getDrillability(container);
  55. if( drillability[itemName])
  56. {
  57. return drillability[itemName];
  58. }
  59. }
  60. return null;
  61. };
  62. DrillAction.prototype.onDoubleClick = function(evt)
  63. {
  64. this.execute();
  65. };
  66. DrillAction.prototype.preProcess = function()
  67. {
  68. //should only have drill spec if handling a synchronize drill event - in which
  69. //case we don't want to fire drill event again
  70. if( typeof this.m_drillSpec === "undefined" || this.m_drillSpec === null )
  71. {
  72. var aDrillSpecObjects = this.generateDrillSpecObjects();
  73. if (!aDrillSpecObjects) {
  74. return null;
  75. }
  76. var oCognosViewer = this.getCognosViewer();
  77. var oViewerWidget = oCognosViewer.getViewerWidget();
  78. if (oViewerWidget) {
  79. var sModelPath = oCognosViewer.getModelPath();
  80. oViewerWidget.getWidgetContextManager().raiseDrillEvent(aDrillSpecObjects, this.m_sAction, sModelPath);
  81. }
  82. }
  83. };
  84. /*
  85. * returns array of Drill spec object
  86. *
  87. * drill spec object has following properties
  88. *
  89. oDrillSpecObject = {
  90. "dataItem": "",
  91. "mun": "",
  92. "lun": "",
  93. "hun": "",
  94. "displayValue": "",
  95. "summary": "" //optional
  96. };
  97. */
  98. DrillAction.prototype.generateDrillSpecObjects = function()
  99. {
  100. try
  101. {
  102. var aDrillSpecObjects = [];
  103. var oCV = this.getCognosViewer();
  104. var drillMgr = oCV.getDrillMgr();
  105. var selectionController = oCV.getSelectionController();
  106. var bIsSyncDrill = true;
  107. var aDrillParams = drillMgr.getDrillParameters(this.m_drillOption, true, bIsSyncDrill, this.m_userSelectedDrillItem );
  108. if (aDrillParams.length === 0) {
  109. return null;
  110. }
  111. var oSelectedObject = drillMgr.getSelectedObject();
  112. if (aDrillParams.length > 3*4 && (oSelectedObject.getDataContainerType() == "crosstab" || oSelectedObject.getLayoutType() == "chartElement" )) {
  113. //In drillParams, which is a flat array, each context id corresponds to 4 entries (value, mun, lun, hun).
  114. //For crosstab and chart, the fourth ctx id and beyond are from master-detail links,
  115. //need to remove them to avoid synced-drilling on them.
  116. aDrillParams.length = 3 * 4;
  117. }
  118. var aContextIds = drillMgr.getSelectedObject().getSelectedContextIds();
  119. for (var i=0, drillGroupIndex = 0; drillGroupIndex < aContextIds.length && i <aDrillParams.length; ++drillGroupIndex) {
  120. var ctxValue = aContextIds[drillGroupIndex][0];
  121. var sDataItem = selectionController.getRefDataItem(ctxValue);
  122. var sMUN = selectionController.getMun(ctxValue);
  123. var sDisplayValue = selectionController.getDisplayValue(ctxValue);
  124. //Exclude the member that cannot be drilled on from the drill spec.
  125. if( selectionController.getDrillFlagForMember( ctxValue ) === 0 ){
  126. i = i + 4; //skip over the entries for the excluded member
  127. continue;
  128. }
  129. var oDrillSpecObject = {
  130. "dataItem": aDrillParams[i++],
  131. "mun": aDrillParams[i++],
  132. "lun": aDrillParams[i++],
  133. "hun": aDrillParams[i++]
  134. };
  135. //insert the display values.
  136. if (sDataItem != "" && sDisplayValue != "") {
  137. if (oDrillSpecObject.dataItem === sDataItem) {
  138. oDrillSpecObject.displayValue = sDisplayValue;
  139. }
  140. }
  141. var sUsageValue = selectionController.getUsageInfo(ctxValue);
  142. oDrillSpecObject.isMeasure = (sUsageValue === '2')? "true" : "false";
  143. //insert if drilling on summary
  144. var drillSummary = false;
  145. if (sMUN != "" && sUsageValue != '2') {
  146. var drillabilityObj = this.getDrillabilityForItemFromReportInfo(sDataItem);
  147. if ((drillabilityObj != null && drillabilityObj.disableDown == true) || this.m_oCV.getSelectionController().getDrillFlagForMember(ctxValue) == 1) {
  148. drillSummary = true;
  149. }
  150. }
  151. if (drillSummary) {
  152. if (oDrillSpecObject.dataItem === sDataItem) {
  153. oDrillSpecObject.summary = "true";
  154. }
  155. }
  156. aDrillSpecObjects.push(oDrillSpecObject);
  157. }
  158. return (aDrillSpecObjects.length>0)? aDrillSpecObjects : null;
  159. } catch( e )
  160. {
  161. return null;
  162. }
  163. };
  164. /*
  165. * This function parses the drill spec and creates a selected object
  166. * based on the spec.
  167. * Returns false if an exception occurs, true otherwise
  168. */
  169. DrillAction.prototype.parseDrillSpec = function( evt )
  170. {
  171. try
  172. {
  173. var oCV = this.getCognosViewer();
  174. if( oCV.getStatus() !== 'complete' || oCV.getConversation() === "")
  175. {
  176. return false;
  177. }
  178. this.m_drillSpec = evt.payload.drillSpec;
  179. var xmlDom = XMLBuilderLoadXMLFromString(this.m_drillSpec);
  180. var drillParametersNode = xmlDom.firstChild;
  181. var selectionController = getCognosViewerSCObjectRef(oCV.getId());
  182. selectionController.m_aSelectedObjects = []; //do we need to do this?
  183. // For some testcases (please see COGCQ00245956), especially for charts, the selected chart area is not cleaned-up properly
  184. // and the object of the old selection is hanging around creating strange behaviour.
  185. // So, clear the selection chart area if an old one is hanging around. Here is the only place to do this.
  186. if (selectionController.hasSelectedChartNodes())
  187. {
  188. selectionController.clearSelectionData();
  189. }
  190. var aDrillGroups = XMLHelper_FindChildrenByTagName(drillParametersNode, "DrillGroup", false);
  191. for(var iDrillGroupIndex = 0; iDrillGroupIndex < aDrillGroups.length; ++iDrillGroupIndex)
  192. {
  193. var munNode = XMLHelper_FindChildByTagName(aDrillGroups[iDrillGroupIndex], "MUN", false);
  194. var sMun = XMLHelper_GetText(munNode);
  195. var sLun = "";
  196. var sHun = "";
  197. var sDisplayValue = "";
  198. var sSummary = "";
  199. var displayValueNode = XMLHelper_FindChildByTagName(aDrillGroups[iDrillGroupIndex], "DisplayValue", false);
  200. if(displayValueNode != null)
  201. {
  202. sDisplayValue = XMLHelper_GetText(displayValueNode);
  203. }
  204. var lunNode = XMLHelper_FindChildByTagName(aDrillGroups[iDrillGroupIndex], "LUN", false);
  205. if(lunNode != null)
  206. {
  207. sLun = XMLHelper_GetText(lunNode);
  208. }
  209. var hunNode = XMLHelper_FindChildByTagName(aDrillGroups[iDrillGroupIndex], "HUN", false);
  210. if(hunNode != null)
  211. {
  212. sHun = XMLHelper_GetText(hunNode);
  213. }
  214. var summaryNode = XMLHelper_FindChildByTagName(aDrillGroups[iDrillGroupIndex], "Summary", false);
  215. if(summaryNode != null)
  216. {
  217. sSummary = XMLHelper_GetText(summaryNode);
  218. }
  219. this.selectObject(sMun, sLun, sHun, sDisplayValue, sSummary, selectionController );
  220. }
  221. }
  222. catch( e )
  223. {
  224. return false;
  225. }
  226. return( selectionController.m_aSelectedObjects.length > 0 );
  227. };
  228. DrillAction.prototype.parseDrillSpecObjects = function( aDrillSpecObjects )
  229. {
  230. if (this.useReportInfoSelection()) {
  231. return this.parseDrillSpecObjectsWithReportInfo(aDrillSpecObjects);
  232. }
  233. try
  234. {
  235. var oCV = this.getCognosViewer();
  236. if( oCV.getStatus() !== 'complete' || oCV.getConversation() === "")
  237. {
  238. return false;
  239. }
  240. this.m_drillSpec = "";
  241. var selectionController = getCognosViewerSCObjectRef(oCV.getId());
  242. selectionController.m_aSelectedObjects = []; //do we need to do this?
  243. // For some testcases (please see COGCQ00245956), especially for charts, the selected chart area is not cleaned-up properly
  244. // and the object of the old selection is hanging around creating strange behaviour.
  245. // So, clear the selection chart area if an old one is hanging around. Here is the only place to do this.
  246. if (selectionController.hasSelectedChartNodes())
  247. {
  248. selectionController.clearSelectionData();
  249. }
  250. for(var i in aDrillSpecObjects)
  251. {
  252. var oSpec = aDrillSpecObjects[i];
  253. var sSummary = (oSpec.summary)? oSpec.summary :"";
  254. //For sync drill, drill flags are ignored so that we can sychronized dataItemDimensionalEdgeSummary
  255. var bIsSyncDrill = true;
  256. this.selectObject(oSpec.mun, oSpec.lun, oSpec.hun, oSpec.displayValue, sSummary, selectionController, bIsSyncDrill );
  257. }
  258. }
  259. catch( e )
  260. {
  261. return false;
  262. }
  263. return( selectionController.m_aSelectedObjects.length > 0 );
  264. };
  265. DrillAction.prototype.getDrillabilityForCtxValue = function(sCtxId){
  266. if (console && console.log) {
  267. console.log("Required method, getDrillabilityForCtxValue, not implemented.");
  268. }
  269. };
  270. DrillAction.prototype.setDrillabilityForSelectObject = function(sCtxId){
  271. this.drillability = this.getDrillabilityForCtxValue( sCtxId );
  272. };
  273. DrillAction.prototype.canDrillDown = function(){
  274. if (console && console.log) {
  275. console.log("Required method, canDrillDown, not implemented.");
  276. }
  277. };
  278. DrillAction.prototype.canDrilUp = function(){
  279. if (console && console.log) {
  280. console.log("Required method, canDrilUp, not implemented.");
  281. }
  282. };
  283. DrillAction.prototype.selectObject = function(sMun, sLun, sHun, sDisplayValue, sOnSummary, selectionController, bIsSyncDrill )
  284. {
  285. var sActualHun = sHun;
  286. var sActualLun = sLun;
  287. var sActualMun = sMun;
  288. var bIgnoreDrillFlag = false;
  289. var sCtxId = selectionController.getCtxIdFromMun(sMun);
  290. var sCtxIdByMun = sCtxId;
  291. if(sCtxId === "")
  292. {
  293. var oActualLunAndHun = selectionController.replaceNamespaceForSharedTM1DimensionOnly(sLun, sHun, sMun);
  294. sActualLun = oActualLunAndHun.lun;
  295. sActualHun = oActualLunAndHun.hun;
  296. if(sActualHun !== sHun){//The HUN has been udpated with the new namespace for TM1 shared dimension
  297. sActualMun = this._replaceNamespace(sMun, sActualHun);//Replace MUN with the new namespace for TM1 shared dimension
  298. }
  299. //set bIgnoreDrillFlag to true if this is sync drill and you're getting ctxId from metadata. This is to allow for sync of dataItemDimensionalEdgeSummary.
  300. bIgnoreDrillFlag = ( bIsSyncDrill == true );
  301. sCtxId = selectionController.getCtxIdFromMetaData(sActualLun, sActualHun, bIgnoreDrillFlag);
  302. if( sCtxId === "" )
  303. {
  304. return false;
  305. }
  306. }
  307. this.setDrillabilityForSelectObject(sCtxId);
  308. if((bIgnoreDrillFlag == true) || (this.m_sAction == "DrillDown" && this.canDrillDown()) || (this.m_sAction == "DrillUp" && this.canDrillUp() ) )
  309. {
  310. var beforeNumber = selectionController.getSelections().length;
  311. selectionController.selectObject( sActualMun, sActualLun, sActualHun, bIgnoreDrillFlag );
  312. var selectionObjects = selectionController.getSelections();
  313. if (sCtxIdByMun === "" && selectionObjects.length > beforeNumber) {
  314. var aMuns = selectionObjects[selectionObjects.length -1].m_aMuns;
  315. aMuns[aMuns.length] = [];
  316. aMuns[aMuns.length-1].push(sActualMun);
  317. var aDisplayValues = selectionObjects[selectionObjects.length -1].m_aDisplayValues;
  318. aDisplayValues.push(sDisplayValue);
  319. selectionObjects[selectionObjects.length -1].useDisplayValueFromObject = true;
  320. }
  321. if (sOnSummary == "true") {
  322. selectionObjects = selectionController.getSelections();
  323. selectionObjects[selectionObjects.length-1].onSummary = true;
  324. }
  325. }
  326. };
  327. DrillAction.prototype._replaceNamespace = function(mun, sActualHun) {
  328. var sResult = null;
  329. if(sActualHun){
  330. var sNamespace = sActualHun.substr(0, sActualHun.indexOf("].[") + 1);
  331. if(mun && sNamespace && !(mun.match("^" + sNamespace))){
  332. var iFirstDotPos = mun.indexOf("].[");
  333. sResult = sNamespace + mun.substr(iFirstDotPos + 1, mun.length);
  334. }
  335. }
  336. return sResult || mun;
  337. };
  338. DrillAction.prototype.addActionContextAdditionalParms = function()
  339. {
  340. var params = "";
  341. var selectionObjects = (this.useReportInfoSelection())? this.m_aDrillSelectedObjects : this.getCognosViewer().getSelectionController().getSelections();
  342. var sItem = null;
  343. for (var i = 0; i < selectionObjects.length; ++i)
  344. {
  345. if (selectionObjects[i].onSummary)
  346. {
  347. sItem = (this.useReportInfoSelection())? selectionObjects[i].item :
  348. selectionObjects[i].getDataItems()[0][0]; //expect only one because this is passed down from drill event.
  349. params += "<dataItem>" + xml_encode(sItem) + "</dataItem>";
  350. }
  351. }
  352. if (params != "") {
  353. params = "<onSummary>" + params + "</onSummary>";
  354. }
  355. if (this.m_userSelectedDrillItem) {
  356. params += ("<userSelectedDrillItem>" + this.m_userSelectedDrillItem + "</userSelectedDrillItem>");
  357. }
  358. //following flags to make drill performance optimisation with switching V5 to MA for some requests
  359. if (this.m_useMARequest === true) {
  360. params = params + "<useMAGetChildRequest>false</useMAGetChildRequest>";
  361. params = params + "<useMAGetParentRequest>false</useMAGetParentRequest>";
  362. }
  363. params += this.addClientContextData(/*maxValuesPerRDI*/3);
  364. return params;
  365. };
  366. DrillAction.prototype.getDrillOptionsAsString = function(){
  367. var oViewerWidget = this.getViewerWidget();
  368. var result = "";
  369. if(oViewerWidget){
  370. result = "<addSummaryMembers>" + oViewerWidget.getDrillOptions().addSummaryMembers + "</addSummaryMembers>";
  371. result = result + "<backwardsCompatible>" + oViewerWidget.getDrillOptions().backwardsCompatible + "</backwardsCompatible>";
  372. }
  373. return result;
  374. };
  375. DrillAction.prototype.getItemInfo = function( cognosViewer, itemName )
  376. {
  377. var rapReportInfo = cognosViewer.getRAPReportInfo()
  378. if( !rapReportInfo )
  379. {
  380. return null;
  381. }
  382. var containers = rapReportInfo.getContainers();
  383. for( var container in containers )
  384. {
  385. var itemInfo = rapReportInfo.getItemInfo( container );
  386. if( itemInfo[itemName])
  387. {
  388. return itemInfo[itemName];
  389. }
  390. }
  391. return null;
  392. };
  393. DrillAction.prototype.isSelectionFilterEnabled = function() {
  394. var oWidget = this.getViewerWidget();
  395. if (!oWidget) {
  396. return false;
  397. }
  398. return oWidget.isSelectionFilterEnabled();
  399. };
  400. DrillAction.prototype.getHierarchyHasExpandedSet = function( cognosViewer, itemName )
  401. {
  402. var itemInfo = this.getItemInfo( cognosViewer, itemName );
  403. return ( itemInfo && itemInfo.hierarchyHasExpandedMembers );
  404. };
  405. DrillAction.prototype.getIsRSDrillParent = function( cognosViewer, itemName )
  406. {
  407. var itemInfo = this.getItemInfo( cognosViewer, itemName );
  408. return ( itemInfo && itemInfo.isRSDrillParent );
  409. };
  410. /*
  411. * Sets m_bUseReportInfoSelection flag
  412. */
  413. DrillAction.prototype.setUseReportInfoSelection = function( bFlag )
  414. {
  415. this.m_bUseReportInfoSelection = bFlag;
  416. }
  417. /*
  418. * returns m_bUseReportInfoSelection flag
  419. */
  420. DrillAction.prototype.useReportInfoSelection = function()
  421. {
  422. return this.m_bUseReportInfoSelection;
  423. }
  424. /*
  425. * parses input object and populates m_aDrillSelectedObjects array.
  426. */
  427. DrillAction.prototype.parseDrillSpecObjectsWithReportInfo = function( aDrillSpecObjects )
  428. {
  429. try
  430. {
  431. var oReportInfo = this.m_oCV.getRAPReportInfo();
  432. if(!oReportInfo){
  433. return null;
  434. }
  435. this.m_drillSpec = "";
  436. this.m_aDrillSelectedObjects = [];
  437. for(var i in aDrillSpecObjects) {
  438. this.populateSelectObjectWithReportInfo(aDrillSpecObjects[i], oReportInfo );
  439. }
  440. }
  441. catch( e )
  442. {
  443. return false;
  444. }
  445. return( this.m_aDrillSelectedObjects.length > 0 );
  446. };
  447. /*
  448. * Creates an object with enough infomation to create Lean-selection and
  449. * adds the object to m_aDrillSelectedObjects array.
  450. *
  451. * The object has all the fields from returned object of getItemDetails and the drill-spec object
  452. * obj = {
  453. * item,
  454. * hun,
  455. * lid,
  456. * queryName,
  457. * mun,
  458. * lun,
  459. * displayValue,
  460. * isMeasure,
  461. * onSummary
  462. * }
  463. */
  464. DrillAction.prototype.populateSelectObjectWithReportInfo = function(oSpec, oReportInfo)
  465. {
  466. var oItemDetails = oReportInfo.getItemDetails(oSpec.dataItem, oSpec.hun);
  467. if (!oItemDetails) {
  468. oItemDetails = oReportInfo.getItemDetailsByHun(oSpec.hun);
  469. if (!oItemDetails) {
  470. return null;
  471. }
  472. }
  473. if (oSpec.mun) {
  474. oItemDetails.mun = oSpec.mun;
  475. }
  476. if (oSpec.lun) {
  477. oItemDetails.lun = oSpec.lun;
  478. }
  479. if (oSpec.displayValue) {
  480. oItemDetails.displayValue = oSpec.displayValue;
  481. }
  482. if (oSpec.isMeasure === "true") {
  483. oItemDetails.isMeasure = true;
  484. }
  485. if (oSpec.summary === "true") {
  486. oItemDetails.onSummary = true;
  487. }
  488. this.m_aDrillSelectedObjects.push(oItemDetails);
  489. };
  490. /*
  491. * Override
  492. */
  493. DrillAction.prototype.getSelectionContext = function()
  494. {
  495. if (this.useReportInfoSelection() ) {
  496. return this.genLeanSelection();
  497. } else {
  498. return CognosViewerAction.prototype.getSelectionContext.call(this);
  499. }
  500. };
  501. /*
  502. * Returns string representing selectedCell elements.
  503. * m_aDrillSelectedObjects array is used as source of selected cells.
  504. */
  505. DrillAction.prototype.genLeanSelection = function()
  506. {
  507. if (this.m_aDrillSelectedObjects.length ==0) {
  508. return "";
  509. }
  510. var sSelection = "";
  511. for (var idx in this.m_aDrillSelectedObjects) {
  512. var obj = this.m_aDrillSelectedObjects[idx];
  513. /*
  514. * Fields of obj: queryName, hun, lun, mun, displayValue, lid, and onSummary
  515. */
  516. sSelection += "<selectedCell>";
  517. sSelection += (
  518. "<name>" + obj.item + "</name>" +
  519. "<display>" + obj.displayValue + "</display>" +
  520. "<rapLayoutTag>" + obj.lid + "</rapLayoutTag>" +
  521. "<queryName>" + obj.queryName + "</queryName>"
  522. );
  523. if (obj.mun) {
  524. sSelection += ("<nodeUse>" + obj.mun + "</nodeUse>");
  525. sSelection += ("<nodeType>memberUniqueName</nodeType>");
  526. }
  527. if (obj.hun) {
  528. sSelection += ("<nodeHierarchyUniqueName>" + obj.hun + "</nodeHierarchyUniqueName>");
  529. }
  530. var sUsage = (obj.isMeasure)? "measure" : "nonMeasure";
  531. sSelection += ("<nodeUsage>" + sUsage + "</nodeUsage>");
  532. sSelection += "</selectedCell>";
  533. }
  534. return ("<selection>" + sSelection + "</selection>");
  535. };
  536. /*
  537. * Overrride
  538. * This function is used in AddActionContexts, i.e <reportActions>
  539. *
  540. * If widget is not visible, we want <reportActions runReport=false>
  541. */
  542. DrillAction.prototype.runReport = function()
  543. {
  544. if (this.getViewerWidget()) {
  545. return this.getViewerWidget().shouldReportBeRunOnAction()
  546. }
  547. else {
  548. return true;
  549. }
  550. };
  551. /*
  552. * Override
  553. *
  554. * Enables Queuing if widget is not visible
  555. */
  556. DrillAction.prototype.canBeQueued = function()
  557. {
  558. if (this.getViewerWidget()) {
  559. return !(this.getViewerWidget().isVisible());
  560. }
  561. else {
  562. return false;
  563. }
  564. };