CCDataManager.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  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. CCDManager -- Report Viewer class which manages Context Data supplied by RSVP in JSON format
  14. */
  15. // Constructor
  16. function CCDManager(cv) {
  17. this.m_cd = null;
  18. this.m_md = null;
  19. this.m_oCV = null;
  20. this.m_dataItemInfo = null;
  21. }
  22. // Set functions
  23. CCDManager.prototype.SetContextData = function(CD) {
  24. if (this.m_cd)
  25. {
  26. this.m_cd = null;
  27. }
  28. this.m_cd = CD;
  29. };
  30. CCDManager.prototype.SetMetadata = function(MD) {
  31. if (this.m_md)
  32. {
  33. this.m_md = null;
  34. }
  35. this.m_md = MD;
  36. };
  37. CCDManager.prototype.AddContextData = function(CD) {
  38. if (!this.m_cd) {
  39. this.m_cd = CD;
  40. } else {
  41. // Add additional context data
  42. for (var i in CD) {
  43. this.m_cd[i] = CD[i];
  44. }
  45. }
  46. };
  47. CCDManager.prototype.AddMetadata = function(MD) {
  48. if (!this.m_md) {
  49. this.m_md = MD;
  50. } else {
  51. // Add additional metadata
  52. for (var j in MD) {
  53. this.m_md[j] = MD[j];
  54. }
  55. }
  56. };
  57. /**
  58. * Returns a cloned copy of the metadata array
  59. */
  60. CCDManager.prototype.getClonedMetadataArray = function() {
  61. var clone = {};
  62. applyJSONProperties(clone, this.m_md);
  63. return clone;
  64. };
  65. /**
  66. * Returns a clones copy of the context data array
  67. */
  68. CCDManager.prototype.getClonedContextdataArray = function() {
  69. var clone = {};
  70. applyJSONProperties(clone, this.m_cd);
  71. return clone;
  72. };
  73. CCDManager.prototype.SetCognosViewer = function(viewer) {
  74. if (viewer) {
  75. this.m_oCV = viewer;
  76. }
  77. };
  78. CCDManager.prototype.onComplete_GetCDRequest = function(asynchDataResponse, callback) {
  79. if (asynchDataResponse) {
  80. var dataResponse = asynchDataResponse.getResult();
  81. var xmlResponse = XMLBuilderLoadXMLFromString(dataResponse);
  82. if (xmlResponse) {
  83. var allBlocks = xmlResponse.getElementsByTagName("Block");
  84. for (var i = 0; i < allBlocks.length; i++) {
  85. var sContext = "";
  86. var blockNode = allBlocks[i].firstChild;
  87. while(blockNode)
  88. {
  89. sContext += blockNode.nodeValue;
  90. blockNode = blockNode.nextSibling;
  91. }
  92. var cd = eval('('+ sContext +')');
  93. this.AddContextData(cd);
  94. }
  95. }
  96. }
  97. if (callback && typeof callback == "function") {
  98. callback();
  99. }
  100. };
  101. CCDManager.prototype.FetchContextData = function(ctxids, callback) {
  102. var missingCtxids = [];
  103. var c = null, ctxLen = ctxids.length;
  104. for (var i = 0; i < ctxLen; ++i ) {
  105. c = ctxids[i];
  106. if (c != "" && !this.ContextIdExists(c)) {
  107. missingCtxids.push(c);
  108. }
  109. }
  110. if (missingCtxids.length) {
  111. if (this.m_oCV) {
  112. this.getContextData(missingCtxids, callback);
  113. }
  114. }
  115. //Note that this is not the number fetched (they come back in blocks controlled by the
  116. //ContextBlockSize option), but rather the number of ctxids which did not have context info
  117. return missingCtxids.length;
  118. };
  119. CCDManager.prototype.getContextData = function(ctxids, callback)
  120. {
  121. var oCV = this.m_oCV;
  122. var asynchRequest = new AsynchDataDispatcherEntry(oCV);
  123. asynchRequest.setCanBeQueued(false);
  124. if (!oCV.isBux) {
  125. asynchRequest.forceSynchronous();
  126. }
  127. var form = document["formWarpRequest" + oCV.getId()];
  128. var conversation = oCV.getConversation();
  129. var tracking = oCV.getTracking();
  130. if (!tracking && form && form["m_tracking"] && form["m_tracking"].value) {
  131. tracking = form["m_tracking"].value;
  132. }
  133. // In fragments we don't put a 'blocker' over the report after doing a request,
  134. // so it's possible we trying to do a getContext after a report type request (forward, next page, ...)
  135. // has been sent. That causes an error since you can't have two requests on the same conversation ID.
  136. // Fix for 11732: Prompts report throws DPR-ERR-2022 error when executed in a multipage portlet
  137. if (oCV.m_viewerFragment) {
  138. var activeRequest = oCV.getActiveRequest();
  139. if (activeRequest && activeRequest.getFormField("m_tracking") == tracking) {
  140. return;
  141. }
  142. }
  143. var oCallbacks = {customArguments: [callback],
  144. "complete" : {"object" : this, "method" : this.onComplete_GetCDRequest}
  145. };
  146. //Override the prompting callback if the current staus is "prompting"
  147. if(oCV.getStatus() == 'prompting'){
  148. oCallbacks["prompting"] = {"object" : this, "method" : this.onComplete_GetCDRequest};
  149. }
  150. asynchRequest.setCallbacks(oCallbacks);
  151. if (conversation && oCV.envParams["ui.action"] != 'view') {
  152. asynchRequest.addFormField("ui.action", "getContext");
  153. asynchRequest.addFormField("ui.conversation", conversation);
  154. } else {
  155. var uiObject = form["ui.object"];
  156. if (typeof uiObject.length != 'undefined' && uiObject.length >1) {
  157. asynchRequest.addFormField("ui.object", form["ui.object"][0].value);
  158. } else {
  159. asynchRequest.addFormField("ui.object", form["ui.object"].value);
  160. }
  161. asynchRequest.addFormField("ui.action", "getObjectContext");
  162. }
  163. asynchRequest.addFormField("cv.responseFormat", "asynchDetailContext");
  164. asynchRequest.addFormField("context.format", "initializer");
  165. asynchRequest.addFormField("context.type", "reportService");
  166. asynchRequest.addFormField("context.selection", ctxids.join(','));
  167. asynchRequest.addNonEmptyStringFormField("m_tracking", tracking);
  168. oCV.dispatchRequest(asynchRequest);
  169. };
  170. // Existential Tests
  171. CCDManager.prototype.ContextIdExists = function(ctxid) {
  172. return (this.m_cd && this.m_cd[ctxid]?true:false);
  173. };
  174. CCDManager.prototype.HasContextData = function() {
  175. return (this.m_cd ? true:false);
  176. };
  177. CCDManager.prototype.HasMetadata = function() {
  178. return (this.m_md ? true:false);
  179. };
  180. // Access Functions
  181. CCDManager.prototype._getMDPropertyFromCD = function(ctxid, sCdProp, sMdProp) {
  182. var p = null;
  183. this.FetchContextData([ctxid]);
  184. var cd = this.m_cd && this.m_cd[ctxid];
  185. if (cd) {
  186. var md = this.m_md[ cd[sCdProp] ];
  187. if (md) {
  188. p = md[sMdProp];
  189. }
  190. }
  191. return p;
  192. };
  193. // Properties Derived from Reference Data Item
  194. CCDManager.prototype.GetDrillFlag = function(ctxid) {
  195. return this._getMDPropertyFromCD(ctxid, 'r', 'drill');
  196. };
  197. CCDManager.prototype.getModelPathFromBookletItem = function(bookletId) {
  198. var mp = null;
  199. var md = this.m_md[bookletId];
  200. if (md) {
  201. mp = md.mp;
  202. if (mp && this.m_md[mp]) {
  203. mp = this.m_md[mp].mp;
  204. }
  205. }
  206. return mp ? mp : null;
  207. };
  208. CCDManager.prototype.GetBookletModelBasedDrillThru = function(bookletId) {
  209. var p = null;
  210. var md = this.m_md[bookletId];
  211. if (md) {
  212. p = md.modelBasedDrillThru;
  213. }
  214. return p ? p : 0;
  215. };
  216. CCDManager.prototype.GetDrillFlagForMember = function(ctxid) {
  217. // Return the correct drill flag for members only
  218. var drillFlag = null;
  219. var d = this._getMDPropertyFromCD(ctxid, 'r', 'drill');
  220. if (d !== null && this.m_cd[ctxid].m) {
  221. drillFlag = d;
  222. }
  223. return drillFlag;
  224. };
  225. CCDManager.prototype.GetDataType = function(ctxid) {
  226. return this._getMDPropertyFromCD(ctxid, 'r', 'dtype');
  227. };
  228. CCDManager.prototype.GetUsage = function(ctxid) {
  229. return this._getMDPropertyFromCD(ctxid, 'r', 'usage');
  230. };
  231. CCDManager.prototype.GetHUN = function(ctxid) {
  232. var hun = this._getMDPropertyFromCD(ctxid, 'h', 'h');
  233. if (!hun) {
  234. var h = this._getMDPropertyFromCD(ctxid, 'r', 'h');
  235. if (h) {
  236. hun = this.m_md[h].h;
  237. }
  238. }
  239. if (hun!=null && hun.indexOf("[__ns_")==0 ) {
  240. /* Query Framework will occasionally return a HUN from a temporary namespace it uses for internal processing.
  241. * To avoid downstream problems with this, any HUN that begins with the [__ns_ prefix is removed here.
  242. * QFW has been notified and should attempt to eliminate this situation.
  243. */
  244. hun = null;
  245. }
  246. return hun;
  247. };
  248. CCDManager.prototype.GetQuery = function(ctxid) {
  249. var qry = null;
  250. var q = this._getMDPropertyFromCD(ctxid, 'r', 'q');
  251. if (q) {
  252. qry = this.m_md[q].q;
  253. }
  254. return qry;
  255. };
  256. CCDManager.prototype.GetDepth = function(ctxid) {
  257. return this._getMDPropertyFromCD(ctxid, 'r', 'level');
  258. };
  259. //Properties Derived from Context Data
  260. CCDManager.prototype.GetDisplayValue = function(ctxid) {
  261. var useVal = null;
  262. this.FetchContextData([ctxid]);
  263. if (this.ContextIdExists(ctxid) && this.m_cd[ctxid]) {
  264. useVal = this.m_cd[ctxid].u;
  265. }
  266. return useVal;
  267. };
  268. CCDManager.prototype.GetPUN = function(ctxid) {
  269. return this._getMDPropertyFromCD(ctxid, 'p', 'p');
  270. };
  271. CCDManager.prototype.GetLUN = function(ctxid) {
  272. return this._getMDPropertyFromCD(ctxid, 'l', 'l');
  273. };
  274. CCDManager.prototype.GetMUN = function(ctxid) {
  275. return this._getMDPropertyFromCD(ctxid, 'm', 'm');
  276. };
  277. CCDManager.prototype.GetDUN = function(ctxid) {
  278. return this._getMDPropertyFromCD(ctxid, 'd', 'd');
  279. };
  280. CCDManager.prototype.GetQMID = function(ctxid) {
  281. return this._getMDPropertyFromCD(ctxid, 'i', 'i');
  282. };
  283. CCDManager.prototype.GetRDIValue = function(ctxid) {
  284. return this._getMDPropertyFromCD(ctxid, 'r', 'r');
  285. };
  286. /**
  287. * Get Booklet Item value
  288. */
  289. CCDManager.prototype.GetBIValue = function(ctxid) {
  290. return this._getMDPropertyFromCD(ctxid, 'r', 'bi');
  291. };
  292. CCDManager.prototype.getContextIdForMetaData = function(lun, hun, bIgnoreDrillFlag )
  293. {
  294. var metaArray = [ {"expression": lun, "type":"l"},{"expression": hun, "type" :"h"} ];
  295. for(var index = 0; index < metaArray.length; ++index)
  296. {
  297. var sMetaItem = metaArray[index].expression;
  298. var sType = metaArray[index].type;
  299. if(sMetaItem == "")
  300. {
  301. continue;
  302. }
  303. for(var metaDataItem in this.m_md)
  304. {
  305. if(this.m_md[metaDataItem][sType] == sMetaItem)
  306. {
  307. for(var refDataItem in this.m_md)
  308. {
  309. if(this.m_md[refDataItem].r && this.m_md[refDataItem][sType] == metaDataItem)
  310. {
  311. if(this.m_md[refDataItem].drill != 0 || bIgnoreDrillFlag == true)
  312. {
  313. for(var ctx in this.m_cd)
  314. {
  315. if(this.m_cd[ctx].r == refDataItem && this.m_cd[ctx].m)
  316. {
  317. return ctx;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. }
  326. return "";
  327. };
  328. // Get Context id given a MUN - these methods assume that the context ids are available.
  329. CCDManager.prototype.GetContextIdForMUN = function(mun) {
  330. var mdIndex = null;
  331. var ctxid = null;
  332. // Find the mun in the metadata
  333. for (var i in this.m_md) {
  334. if (this.m_md[i].m == mun) {
  335. mdIndex = i;
  336. break;
  337. }
  338. }
  339. if (mdIndex != null) {
  340. for (var j in this.m_cd) {
  341. if (this.m_cd[j].m == mdIndex) {
  342. ctxid = j;
  343. break;
  344. }
  345. }
  346. }
  347. return ctxid;
  348. };
  349. // Get Context ids with a given RDI (may be more than 1) - these methods assume that the context ids are available.
  350. CCDManager.prototype.GetContextIdsForRDI = function(rdi) {
  351. var ctxids = [];
  352. // Find the mun in the metadata
  353. for (var i in this.m_md) {
  354. if (this.m_md[i].r == rdi) {
  355. ctxids.push(i);
  356. }
  357. }
  358. return ctxids;
  359. };
  360. CCDManager.prototype.getMUNForRDIAndUseValue = function(rdi, useValue) {
  361. var ctxids = this.GetContextIdsForRDI(rdi);
  362. for (var i in this.m_cd) {
  363. for (var j in ctxids) {
  364. if (this.m_cd[i].r == ctxids[j] && this.m_cd[i].u == useValue) {
  365. var munId = this.m_cd[i].m;
  366. if (munId) {
  367. return this.m_md[munId].m;
  368. }
  369. }
  370. }
  371. }
  372. return null;
  373. };
  374. // Return, if applicable, the min/max values CURRENTLY IN THE CONTEXT TABLE for this rdi
  375. CCDManager.prototype.GetPageMinMaxForRDI = function(rdi) {
  376. var pageMin=null;
  377. var pageMax=null;
  378. var ctxids = this.GetContextIdsForRDI(rdi);
  379. //TODO: Until we know all context data has been fetched previously, we need
  380. // to fetch it here to guarantee that we have the full page of data.
  381. this.FetchContextData([0]);
  382. for (var i in this.m_cd) {
  383. for (var j in ctxids) {
  384. if (this.m_cd[i].r == ctxids[j]) {
  385. var currentFloatValue = parseFloat(this.m_cd[i].u);
  386. if (currentFloatValue == this.m_cd[i].u) {
  387. if ( pageMin == null || currentFloatValue < pageMin) {
  388. pageMin = currentFloatValue;
  389. }
  390. if ( pageMax == null || currentFloatValue > pageMax) {
  391. pageMax = currentFloatValue;
  392. }
  393. }
  394. }
  395. }
  396. }
  397. if (pageMin != null && pageMax != null) {
  398. return eval('({ pageMin: ' + pageMin +', pageMax: ' + pageMax + '})');
  399. }
  400. };
  401. // Get Context id given a display value
  402. CCDManager.prototype.GetContextIdForDisplayValue = function(value) {
  403. var ctxid = null;
  404. for (var i in this.m_cd) {
  405. if (this.m_cd[i].u == value) {
  406. ctxid = i;
  407. break;
  408. }
  409. }
  410. return ctxid;
  411. };
  412. // Get Context id given a use value
  413. CCDManager.prototype.GetContextIdForUseValue = function(value) {
  414. var mdIndex = null;
  415. var mdValueType = null;
  416. var ctxid = null;
  417. // Find the value in the metadata
  418. for (var i in this.m_md) {
  419. var md = this.m_md[i];
  420. for (var j in md) {
  421. if (md[j] == value) {
  422. mdIndex = i;
  423. mdValueType = j;
  424. break;
  425. }
  426. }
  427. }
  428. if (mdIndex != null) {
  429. for (var k in this.m_cd) {
  430. if (this.m_cd[k][mdValueType] == mdIndex) {
  431. ctxid = k;
  432. break;
  433. }
  434. }
  435. }
  436. return ctxid;
  437. };
  438. CCDManager.prototype.getDataItemInfo = function() {
  439. if (this.m_cd) {
  440. var rdiCount = {};
  441. this.m_dataItemInfo = {};
  442. for (var i in this.m_cd) {
  443. var rdiKey=this.m_cd[i].r;
  444. if (typeof rdiKey != "undefined") {
  445. var diName = this.m_md[rdiKey].r;
  446. if (this.m_dataItemInfo[diName]==null) {
  447. this.m_dataItemInfo[diName] = 1;
  448. } else {
  449. this.m_dataItemInfo[diName]++;
  450. }
  451. }
  452. }
  453. return CViewerCommon.toJSON(this.m_dataItemInfo);
  454. }
  455. return "";
  456. };
  457. //Dump the contents of the metadata table as a JSON string.
  458. CCDManager.prototype.DataItemInfoToJSON = function() {
  459. return this.getDataItemInfo();
  460. };
  461. // Dump the contents of the metadata table as a JSON string.
  462. CCDManager.prototype.MetadataToJSON = function() {
  463. if (this.m_md) {
  464. return CViewerCommon.toJSON(this.m_md);
  465. }
  466. return "";
  467. };
  468. // Dump the contents of the context data table as a JSON string.
  469. CCDManager.prototype.ContextDataToJSON = function() {
  470. if (this.m_cd) {
  471. return CViewerCommon.toJSON(this.m_cd);
  472. }
  473. return "";
  474. };
  475. // Dump the contents of A SUBSET of the context data table as a JSON string.
  476. CCDManager.prototype.ContextDataSubsetToJSON = function(maxValuesPerRDI) {
  477. if (maxValuesPerRDI<=0) {
  478. return this.ContextDataToJSON();
  479. }
  480. if (this.m_cd) {
  481. var rdiCount = {};
  482. var cdSubset = {};
  483. for (var i in this.m_cd) {
  484. var rdiKey=this.m_cd[i].r;
  485. if (typeof rdiKey != "undefined") {
  486. if (rdiCount[rdiKey]==null) {
  487. rdiCount[rdiKey]=0;
  488. } else {
  489. rdiCount[rdiKey]++;
  490. }
  491. if (rdiCount[rdiKey] < maxValuesPerRDI) {
  492. cdSubset[i]=this.m_cd[i];
  493. }
  494. }
  495. }
  496. return CViewerCommon.toJSON(cdSubset);
  497. }
  498. return "";
  499. };
  500. // Get HUN with a given RDI and queryName
  501. CCDManager.prototype.GetHUNForRDI = function(rdi, queryNameId) {
  502. // Find the mun in the metadata
  503. for (var i in this.m_md) {
  504. if (this.m_md[i].r == rdi && this.m_md[i].q == queryNameId) {
  505. var hunId = this.m_md[i].h;
  506. if( hunId )
  507. {
  508. return this.m_md[hunId].h;
  509. }
  510. }
  511. }
  512. return null;
  513. };
  514. // Get Context ids with a given queryname
  515. CCDManager.prototype.GetMetadataIdForQueryName = function(queryName) {
  516. for (var i in this.m_md) {
  517. if (this.m_md[i].q === queryName) {
  518. return i;
  519. }
  520. }
  521. return null;
  522. };
  523. CCDManager.prototype._isEmptyObject = function(obj) {
  524. for (var property in obj) {
  525. return false;
  526. }
  527. return true;
  528. };
  529. CCDManager.prototype.isMetadataEmpty = function() {
  530. if (this.m_md) {
  531. return this._isEmptyObject(this.m_md);
  532. }
  533. return true;
  534. };
  535. CCDManager.prototype.GetBestPossibleItemName = function(ctxId) {
  536. var item = this.m_cd[ctxId];
  537. if (!item) {
  538. return null;
  539. }
  540. if (item.l && this.m_md[item.l].l) {
  541. //Level Unique Name
  542. return this._getStringInLastBracket( this.m_md[item.l].l );
  543. }
  544. if (item.r && this.m_md[item.r].r) {
  545. //Reference to Data Item
  546. return this._getStringInLastBracket( this.m_md[item.r].r );
  547. }
  548. if (item.h && this.m_md[item.h].h) {
  549. //Hierarchy Unique Name
  550. return this._getStringInLastBracket( this.m_md[item.h].h );
  551. }
  552. if (item.i && this.m_md[item.i].i) {
  553. //Query Model ID
  554. return this._getStringInLastBracket( this.m_md[item.i].i );
  555. }
  556. return null;
  557. };
  558. CCDManager.prototype.GetBestPossibleDimensionMeasureName = function(ctxId) {
  559. var item = this.m_cd[ctxId];
  560. if (item && item.m && this.m_md[item.m] && this.m_md[item.m].m) {
  561. //Member Unique Name
  562. return this._getStringInLastBracket( this.m_md[item.m].m );
  563. }
  564. return null;
  565. };
  566. CCDManager.prototype._getStringInLastBracket = function(str) {
  567. if (str && str.indexOf('].[') >0) {
  568. var splitedStr = str.split('].[');
  569. var lastString = splitedStr[splitedStr.length-1];
  570. return lastString.substring(0, lastString.length-1); //remove ']' at the end
  571. }
  572. return str;
  573. };
  574. /**
  575. * update member unique name with the current namespace (cube name)that is from the same shared TM1 dimension
  576. * */
  577. CCDManager.prototype._replaceNamespaceForSharedTM1DimensionOnly = function(memberUniqueName){
  578. var oNSAndDIMToLookup = this._getNamespaceAndDimensionFromUniqueName(memberUniqueName);
  579. if(oNSAndDIMToLookup && this.m_md){
  580. for(var mdEntry in this.m_md){
  581. var sMun = this.m_md[mdEntry].m;
  582. if(sMun && sMun.length >0){
  583. if(sMun.indexOf("->:[TM].") > 0){
  584. var oObj = this._getNamespaceAndDimensionFromUniqueName(sMun);
  585. if(oObj.dimension && oObj.dimension === oNSAndDIMToLookup.dimension && oObj.namespace !== oNSAndDIMToLookup.namespace){
  586. var iFirstDotPos = memberUniqueName.indexOf(".");
  587. return oObj.namespace + memberUniqueName.substr(iFirstDotPos, memberUniqueName.length);
  588. }
  589. }else{
  590. var iArrowSymbolPos = sMun.indexOf("->:[");
  591. if(iArrowSymbolPos >0 ){
  592. if(sMun.substr(iArrowSymbolPos + 4, 4) !== "TM]."){
  593. return memberUniqueName;
  594. }
  595. }
  596. }
  597. }
  598. }
  599. }
  600. return memberUniqueName;
  601. };
  602. CCDManager.prototype._getNamespaceAndDimensionFromUniqueName = function(uniqueName){
  603. if(uniqueName && uniqueName.length > 0 && uniqueName.indexOf("].[") > 0){
  604. var aElements = uniqueName.split("].[");
  605. if(aElements.length > 1){
  606. return {"namespace" : aElements[0]+"]" , "dimension": "["+ aElements[1]+"]"};
  607. }
  608. }
  609. return null;
  610. };
  611. CCDManager.prototype.destroy = function(){
  612. delete this.m_cd;
  613. delete this.m_md;
  614. delete this.m_oCV;
  615. delete this.m_dataItemInfo;
  616. };