viewer.interactive.core.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 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. CCognosViewer.prototype.sortColumn=function(_1){
  13. var _2=_1.which?_1.which==1:_1.button==0;
  14. var _3=new CognosViewerSort(_1,this);
  15. if(_2&&_3.isSort(_1)){
  16. _3.execute();
  17. return true;
  18. }
  19. return false;
  20. };
  21. CCognosViewer.prototype.isInteractiveViewer=function(){
  22. return true;
  23. };
  24. CCognosViewer.prototype.canExpand=function(){
  25. var _4=new ExpandMemberAction();
  26. _4.setCognosViewer(this);
  27. return _4._canShowMenu(this.getSelectionController())&&_4._canEnableMenu(this.getSelectionController());
  28. };
  29. CCognosViewer.prototype.canCollapse=function(){
  30. var _5=new CollapseMemberAction();
  31. _5.setCognosViewer(this);
  32. return _5._canEnableMenu(this.getSelectionController());
  33. };
  34. CCognosViewer.prototype.expand=function(){
  35. var _6=new ExpandMemberAction();
  36. _6.setCognosViewer(this);
  37. _6.execute();
  38. };
  39. CCognosViewer.prototype.collapse=function(){
  40. var _7=new CollapseMemberAction();
  41. _7.setCognosViewer(this);
  42. _7.execute();
  43. };
  44. function RAPReportInfo(_8,_9){
  45. this.m_reportInfoJSON=_8;
  46. this.m_containerInfoJSON={};
  47. this.m_iContainerCount=0;
  48. this.m_bPromptPart=null;
  49. this.m_bSingleContainer=null;
  50. this.m_bDetailFilteringDisabled=null;
  51. this.m_aDrilledOnHUNs=null;
  52. this.m_bPassTrackingToBUA=null;
  53. this.m_sDisplayTypes=null;
  54. this.m_bContainsInteractiveDataContainer=null;
  55. this.m_bContainsFilters=false;
  56. this.m_bContainsSlider=false;
  57. this.m_referenceInfoObject={};
  58. this.initializeContainerInfo();
  59. this._addNonVisibleReferences(this.m_reportInfoJSON.reportLevelProperties);
  60. this._populateHun(_9);
  61. };
  62. RAPReportInfo.prototype.initializeContainerInfo=function(){
  63. if(this.m_reportInfoJSON){
  64. var _a=this.m_reportInfoJSON.containers;
  65. if(_a){
  66. this.m_iContainerCount=_a.length;
  67. for(var _b=0;_b<this.m_iContainerCount;++_b){
  68. var _c=_a[_b].container;
  69. this.m_containerInfoJSON[_c]=_a[_b];
  70. this.m_containerInfoJSON[_c].m_itemInfoJSON=this._initializeItemInfo(_a[_b].itemInfo);
  71. this.m_containerInfoJSON[_c].m_drillabilityJSON=this._initializeDrillability(_a[_b].drillability);
  72. this._addFilterReferences(_a[_b].filter);
  73. this._addSliderReferences(_a[_b].sliders);
  74. this.m_containerInfoJSON[_c].layoutIndex=_b;
  75. if(_a[_b].filter){
  76. this.m_bContainsFilters=true;
  77. }
  78. if(_a[_b].sliders){
  79. this.m_bContainsSlider=true;
  80. }
  81. }
  82. }
  83. }
  84. };
  85. RAPReportInfo.prototype._initializeItemInfo=function(_d){
  86. var _e={};
  87. for(var _f in _d){
  88. _e[_d[_f].item]=_d[_f];
  89. this.m_referenceInfoObject[_d[_f].item]=true;
  90. }
  91. return _e;
  92. };
  93. RAPReportInfo.prototype._initializeDrillability=function(_10){
  94. var _11={};
  95. for(var idx in _10){
  96. _11[_10[idx].item]=_10[idx];
  97. this.m_referenceInfoObject[_10[idx].item]=true;
  98. }
  99. return _11;
  100. };
  101. RAPReportInfo.prototype._addFilterReferences=function(_13){
  102. for(var idx in _13){
  103. this.m_referenceInfoObject[_13[idx].item]=true;
  104. if(_13[idx].type==="contextSlice"&&_13[idx].hierarchyName){
  105. this.m_referenceInfoObject[_13[idx].hierarchyName]=true;
  106. }
  107. }
  108. };
  109. RAPReportInfo.prototype._addSliderReferences=function(_15){
  110. for(var idx in _15){
  111. this.m_referenceInfoObject[_15[idx].name]=true;
  112. }
  113. };
  114. RAPReportInfo.prototype._addNonVisibleReferences=function(_17){
  115. if(_17&&_17.nonVisibleFiltersMemberItemInfo){
  116. for(var i=0;i<_17.nonVisibleFiltersMemberItemInfo.length;i++){
  117. this.m_referenceInfoObject[_17.nonVisibleFiltersMemberItemInfo[i]]=true;
  118. }
  119. }
  120. };
  121. RAPReportInfo.prototype.isReferenced=function(_19){
  122. return (this.m_referenceInfoObject[_19])?true:false;
  123. };
  124. RAPReportInfo.prototype.getDrillability=function(_1a,_1b){
  125. if(!_1b){
  126. return this.m_containerInfoJSON[_1a].m_drillabilityJSON;
  127. }else{
  128. return this.m_containerInfoJSON[_1a].m_drillabilityJSON[_1b];
  129. }
  130. };
  131. RAPReportInfo.prototype.getContainers=function(){
  132. return this.m_containerInfoJSON;
  133. };
  134. RAPReportInfo.prototype.getContainer=function(lid){
  135. return this.m_containerInfoJSON[lid];
  136. };
  137. RAPReportInfo.prototype.getContainerIds=function(_1d){
  138. var _1e=[];
  139. for(containerName in this.m_containerInfoJSON){
  140. var _1f=this.m_containerInfoJSON[containerName];
  141. if(_1f&&_1f.displayTypeId==_1d){
  142. _1e.push(_1f.container);
  143. }
  144. }
  145. return _1e;
  146. };
  147. RAPReportInfo.prototype.getContainerFromPos=function(_20){
  148. return this.m_reportInfoJSON.containers[_20];
  149. };
  150. RAPReportInfo.prototype.getReportLevelProperties=function(){
  151. return this.m_reportInfoJSON.reportLevelProperties;
  152. };
  153. RAPReportInfo.prototype.getItemInfo=function(_21,_22){
  154. if(!_22){
  155. return this.m_containerInfoJSON[_21].m_itemInfoJSON;
  156. }
  157. if(this.m_containerInfoJSON[_21]){
  158. return this.m_containerInfoJSON[_21].m_itemInfoJSON[_22];
  159. }
  160. return null;
  161. };
  162. RAPReportInfo.prototype.isReportLevel_nonVisibleFilterItem=function(_23){
  163. if(_23&&_23.length>0){
  164. var _24=this.m_reportInfoJSON.reportLevelProperties;
  165. if(_24){
  166. if(_24&&_24.nonVisibleFiltersMemberItemInfo){
  167. for(var i=0;i<_24.nonVisibleFiltersMemberItemInfo.length;i++){
  168. if(_23===_24.nonVisibleFiltersMemberItemInfo[i]){
  169. return true;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. return false;
  176. };
  177. RAPReportInfo.prototype.isChildContainer=function(lid){
  178. return ((this.m_containerInfoJSON[lid]&&this.m_containerInfoJSON[lid].parentContainer)?true:false);
  179. };
  180. RAPReportInfo.prototype.getItemDetails=function(_27,_28){
  181. var obj=null;
  182. for(var lid in this.m_containerInfoJSON){
  183. var _2b=this.getItemInfo(lid,_27);
  184. if(_2b&&_2b.hun===_28){
  185. obj={};
  186. obj.item=_2b.item;
  187. if(_2b.hun){
  188. obj.hun=_2b.hun;
  189. }
  190. obj.lid=lid;
  191. obj.queryName=_2b.queryName;
  192. break;
  193. }
  194. }
  195. return (obj)?obj:null;
  196. };
  197. RAPReportInfo.prototype.getItemDetailsByHun=function(_2c){
  198. var _2d=null;
  199. for(var lid in this.m_containerInfoJSON){
  200. var _2f=this.getItemInfo(lid);
  201. for(var _30 in _2f){
  202. var _31=_2f[_30];
  203. if(_31.hun===_2c){
  204. _2d=_30;
  205. break;
  206. }
  207. }
  208. }
  209. return (_2d?this.getItemDetails(_2d,_2c):null);
  210. };
  211. RAPReportInfo.prototype._populateHun=function(oCV){
  212. if(oCV){
  213. var _33=oCV.getSelectionController().getCCDManager();
  214. var _34=oCV.envParams;
  215. var _35=oCV.getRAPReportInfo();
  216. var _36=false;
  217. for(var lid in this.m_containerInfoJSON){
  218. var _38=this.m_containerInfoJSON[lid].m_itemInfoJSON;
  219. for(var _39 in _38){
  220. var _3a=_38[_39];
  221. if(_3a.hun){
  222. continue;
  223. }
  224. var _3b=this.getHUNForItem(_3a,_33,lid,_35);
  225. if(_3b){
  226. _3a.hun=_3b;
  227. _36=true;
  228. }
  229. }
  230. }
  231. if(_36&&typeof JSON!="undefined"&&JSON!=null&&JSON.stringify){
  232. _34["rapReportInfo"]=JSON.stringify(this.m_reportInfoJSON);
  233. }
  234. }
  235. };
  236. RAPReportInfo.prototype.getHUNForItem=function(_3c,_3d,lid,_3f){
  237. var _40=this.getHUNFromCCDManager(_3d,_3c);
  238. var _41=null;
  239. if(!_40&&_3f){
  240. _41=_3f.getItemInfo(lid,_3c.item);
  241. if(_41){
  242. _40=_41.hun;
  243. }
  244. }
  245. return _40;
  246. };
  247. RAPReportInfo.prototype.getHUNFromCCDManager=function(_42,_43){
  248. var _44={};
  249. var _45=null;
  250. var _46=this._findQueryMetadataId(_42,_44,_43.queryName);
  251. if(_46){
  252. _45=_42.GetHUNForRDI(_43.item,_46);
  253. }
  254. return _45;
  255. };
  256. RAPReportInfo.prototype._findQueryMetadataId=function(_47,_48,_49){
  257. if(_48[_49]){
  258. return _48[_49];
  259. }
  260. var _4a=_47.GetMetadataIdForQueryName(_49);
  261. if(_4a){
  262. _48[_49]=_4a;
  263. return _4a;
  264. }
  265. return null;
  266. };
  267. RAPReportInfo.prototype.isPromptPart=function(){
  268. if(this.m_bPromptPart===null){
  269. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.promptWidget===true){
  270. this.m_bPromptPart=true;
  271. }else{
  272. this.m_bPromptPart=false;
  273. }
  274. }
  275. return this.m_bPromptPart;
  276. };
  277. RAPReportInfo.prototype.getContainerCount=function(){
  278. return this.m_iContainerCount;
  279. };
  280. RAPReportInfo.prototype.isSingleContainer=function(){
  281. if(this.m_bSingleContainer===null){
  282. if(this.m_iContainerCount===1&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.singleContainerReport===true){
  283. this.m_bSingleContainer=true;
  284. }else{
  285. this.m_bSingleContainer=false;
  286. }
  287. }
  288. return this.m_bSingleContainer;
  289. };
  290. RAPReportInfo.prototype.isDetailFilteringDisabled=function(){
  291. if(this.m_bDetailFilteringDisabled===null){
  292. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.detailFilteringDisabled===true){
  293. this.m_bDetailFilteringDisabled=true;
  294. }else{
  295. this.m_bDetailFilteringDisabled=false;
  296. }
  297. }
  298. return this.m_bDetailFilteringDisabled;
  299. };
  300. RAPReportInfo.prototype.getPassTrackingtoBUA=function(){
  301. if(this.m_bPassTrackingToBUA===null){
  302. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.shouldNotPassTrackingtoBUA===true){
  303. this.m_bPassTrackingToBUA=false;
  304. }else{
  305. this.m_bPassTrackingToBUA=true;
  306. }
  307. }
  308. return this.m_bPassTrackingToBUA;
  309. };
  310. RAPReportInfo.prototype.getDrilledOnHUNs=function(){
  311. if(!this.m_aDrilledOnHUNs&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs){
  312. this.m_aDrilledOnHUNs=this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs;
  313. }
  314. return this.m_aDrilledOnHUNs;
  315. };
  316. RAPReportInfo.prototype.getDisplayTypes=function(_4b){
  317. if(this.m_sDisplayTypes===null||_4b){
  318. var _4c="";
  319. var _4d=[];
  320. for(var lid in this.m_containerInfoJSON){
  321. if(!_4b||lid!=_4b){
  322. _4d.push(this.m_containerInfoJSON[lid].displayTypeId);
  323. }
  324. }
  325. _4c=_4d.join(",");
  326. if(_4c==""&&this.isPromptPart()){
  327. _4c="promptWidget";
  328. }
  329. if(!_4b){
  330. this.m_sDisplayTypes=_4c;
  331. }
  332. return _4c;
  333. }
  334. return this.m_sDisplayTypes;
  335. };
  336. RAPReportInfo.prototype.isChart=function(lid){
  337. var id=lid.toLowerCase();
  338. return id!="mapchart"&&id.match("chart$")=="chart";
  339. };
  340. RAPReportInfo.prototype.isViz=function(lid){
  341. if(this.m_containerInfoJSON[lid]){
  342. var _52=this.m_containerInfoJSON[lid].displayTypeId;
  343. if(_52){
  344. return (_52.toLowerCase()=="viz");
  345. }
  346. }
  347. return false;
  348. };
  349. RAPReportInfo.prototype.isInteractiveDataContainer=function(lid){
  350. var _54=false;
  351. if(this.m_containerInfoJSON[lid]){
  352. var _55=this.m_containerInfoJSON[lid].displayTypeId;
  353. if(_55){
  354. var id=_55.toLowerCase();
  355. _54=id=="crosstab"||id=="list"||id=="viz"||this.isChart(id);
  356. }
  357. }
  358. return _54;
  359. };
  360. RAPReportInfo.prototype.containsInteractiveDataContainer=function(){
  361. if(this.m_bContainsInteractiveDataContainer==null){
  362. this.m_bContainsInteractiveDataContainer=false;
  363. for(var lid in this.m_containerInfoJSON){
  364. if(this.isInteractiveDataContainer(lid)){
  365. this.m_bContainsInteractiveDataContainer=true;
  366. break;
  367. }
  368. }
  369. }
  370. return this.m_bContainsInteractiveDataContainer;
  371. };
  372. RAPReportInfo.prototype.containsFilters=function(){
  373. return this.m_bContainsFilters;
  374. };
  375. RAPReportInfo.prototype.getFilterObject=function(_58,_59){
  376. for(var lid in this.m_containerInfoJSON){
  377. var _5b=this.getFilterObjectFromContainer(lid,_58,_59);
  378. if(_5b){
  379. return _5b;
  380. }
  381. }
  382. return null;
  383. };
  384. RAPReportInfo.prototype.getFilterObjectFromContainer=function(lid,_5d,_5e){
  385. var _5f=this.m_containerInfoJSON[lid];
  386. if(_5f&&_5f.filter){
  387. var _60=_5f.filter.length;
  388. for(var i=0;i<_60;++i){
  389. var _62=_5f.filter[i];
  390. if(_5d==_62.item){
  391. if(!_5e||(_62.itemLabel&&_62.itemLabel.length>0)){
  392. return _62;
  393. }
  394. }
  395. }
  396. }
  397. return null;
  398. };
  399. RAPReportInfo.prototype.hunHasFilterOrSlider=function(_63){
  400. if(!_63){
  401. return null;
  402. }
  403. for(var lid in this.m_containerInfoJSON){
  404. var _65=this.m_containerInfoJSON[lid];
  405. if(_65&&_65.filter){
  406. var _66=_65.filter.length;
  407. for(var i=0;i<_66;++i){
  408. var _68=_65.filter[i];
  409. if(_68.HUN&&_63.indexOf(_68.HUN)==0){
  410. return _68.item;
  411. }
  412. }
  413. }
  414. if(_65&&_65.sliders){
  415. var _66=_65.sliders.length;
  416. for(var i=0;i<_66;++i){
  417. var _69=_65.sliders[i];
  418. if(_69.hun&&_63.indexOf(_69.hun)==0){
  419. return _69.name;
  420. }
  421. }
  422. }
  423. }
  424. return null;
  425. };
  426. RAPReportInfo.prototype.hasSlider=function(){
  427. return this.m_bContainsSlider;
  428. };
  429. RAPReportInfo.prototype.collectSliderSetFromReportInfo=function(){
  430. var _6a={};
  431. for(var lid in this.m_containerInfoJSON){
  432. var _6c=this.m_containerInfoJSON[lid].sliders;
  433. if(_6c){
  434. for(var _6d=0;_6d<_6c.length;++_6d){
  435. var _6e=_6c[_6d].clientId;
  436. _6a[_6e]=_6c[_6d];
  437. }
  438. }
  439. }
  440. return _6a;
  441. };
  442. RAPReportInfo.prototype._getEventTimings=function(){
  443. return (this.m_reportInfoJSON&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.eventTimings)?this.m_reportInfoJSON.reportLevelProperties.eventTimings:null;
  444. };
  445. RAPReportInfo.prototype.destroy=function(){
  446. GUtil.destroyProperties(this);
  447. };
  448. function ModifyReportAction(){
  449. this.m_reuseConversation=true;
  450. };
  451. ModifyReportAction.prototype=new CognosViewerAction();
  452. ModifyReportAction.prototype.addActionContextAdditionalParms=function(){
  453. };
  454. ModifyReportAction.prototype.runReport=function(){
  455. return true;
  456. };
  457. ModifyReportAction.prototype.updateRunReport=function(){
  458. };
  459. ModifyReportAction.prototype.reuseQuery=function(){
  460. return false;
  461. };
  462. ModifyReportAction.prototype.reuseGetParameter=function(){
  463. return true;
  464. };
  465. ModifyReportAction.prototype.reuseConversation=function(_6f){
  466. if(typeof _6f!="undefined"){
  467. this.m_reuseConversation=_6f;
  468. }
  469. return this.m_reuseConversation;
  470. };
  471. ModifyReportAction.prototype.updateInfoBar=function(){
  472. return true;
  473. };
  474. ModifyReportAction.prototype.getUndoHint=function(){
  475. return "";
  476. };
  477. ModifyReportAction.prototype.isUndoable=function(){
  478. return true;
  479. };
  480. ModifyReportAction.prototype.saveSpecForUndo=function(){
  481. return false;
  482. };
  483. ModifyReportAction.prototype.keepFocusOnWidget=function(){
  484. return true;
  485. };
  486. ModifyReportAction.prototype.keepRAPCache=function(){
  487. return true;
  488. };
  489. ModifyReportAction.prototype.getActionKey=function(){
  490. return null;
  491. };
  492. ModifyReportAction.prototype.canBeQueued=function(){
  493. return false;
  494. };
  495. ModifyReportAction.prototype.getPromptOption=function(){
  496. return "false";
  497. };
  498. ModifyReportAction.prototype.createActionDispatcherEntry=function(){
  499. var _70=new ModifyReportDispatcherEntry(this.m_oCV);
  500. _70.initializeAction(this);
  501. return _70;
  502. };
  503. ModifyReportAction.prototype.isSelectSingleMember=function(_71){
  504. var _72=this.m_oCV.getRAPReportInfo();
  505. var _73=_71.getDataItems();
  506. if(_72&&_73.length>0){
  507. var _74=this.getContainerId(this.m_oCV.getSelectionController());
  508. var _75=_72.getItemInfo(_74,_73[0][0]);
  509. if(_75.single=="true"){
  510. return true;
  511. }
  512. }
  513. return false;
  514. };
  515. ModifyReportAction.prototype.execute=function(){
  516. var oCV=this.getCognosViewer();
  517. oCV.setKeepFocus(this.keepFocusOnWidget());
  518. this.updateRunReport();
  519. if(this.runReport()==true){
  520. var _77=this.createActionDispatcherEntry();
  521. this.addAdditionalOptions(_77);
  522. oCV.dispatchRequest(_77);
  523. }else{
  524. var _78=this.createCognosViewerDispatcherEntry("modifyReport");
  525. _78.setCallbacks({"complete":{"object":this,"method":this.updateReportSpecCallback}});
  526. oCV.dispatchRequest(_78);
  527. }
  528. this.fireModifiedReportEvent();
  529. };
  530. ModifyReportAction.prototype.updateReportSpecCallback=function(_79){
  531. var _7a=_79.getResponseState();
  532. var _7b=new RequestHandler(this.m_oCV);
  533. _7b.updateViewerState(_7a);
  534. if(!this.m_bUndoAdded){
  535. this.m_bUndoAdded=true;
  536. var _7c=this.getUndoRedoQueue();
  537. if(_7c){
  538. _7c.initUndoObj({"tooltip":this.getUndoHint(),"saveSpec":true});
  539. _7c.add({"reportUpdated":true});
  540. }
  541. var _7d=this.getCognosViewer().getViewerWidget();
  542. if(_7d){
  543. _7d.updateToolbar();
  544. }
  545. }
  546. };
  547. ModifyReportAction.prototype.addActionContext=function(){
  548. var _7e="<reportActions";
  549. if(this.runReport()==false){
  550. _7e+=" run=\"false\"";
  551. }
  552. _7e+=">";
  553. _7e+=this.getReportActionContext();
  554. _7e+="</reportActions>";
  555. return _7e;
  556. };
  557. ModifyReportAction.prototype.getReportActionContext=function(){
  558. var _7f=this.getCognosViewer();
  559. var _80=_7f.getSelectionController();
  560. var _81="<"+this.m_sAction+">";
  561. var _82=this.getContainerId(_80);
  562. if(_82!=""){
  563. _81+="<id>"+xml_encode(_82)+"</id>";
  564. }
  565. _81+=this.getRTStateInfo();
  566. _81+=this.getSelectionContext();
  567. var _83=this.addActionContextAdditionalParms();
  568. if(_83!=null&&_83!="undefined"){
  569. _81+=_83;
  570. }
  571. _81+="</"+this.m_sAction+">";
  572. if(this.updateInfoBar()){
  573. _81+=this.getGetInfoActionContext();
  574. }
  575. return _81;
  576. };
  577. ModifyReportAction.prototype.getGetInfoActionContext=function(){
  578. return "<GetInfo/>";
  579. };
  580. ModifyReportAction.prototype.getRTStateInfo=function(){
  581. var _84=this.getCognosViewer().getViewerWidget();
  582. if(_84&&_84.getBUXRTStateInfoMap){
  583. var _85=_84.getBUXRTStateInfoMap();
  584. return _85?_85:"";
  585. }
  586. return "";
  587. };
  588. ModifyReportAction.prototype.createEmptyMenuItem=function(){
  589. return {name:"None",label:"(empty)",iconClass:"",action:null,items:null};
  590. };
  591. ModifyReportAction.prototype.getStateFromResponse=function(_86){
  592. var _87=null;
  593. if(_86&&typeof _86!="undefined"&&_86.responseText&&typeof _86.responseText!="undefined"&&_86.responseText.length>0){
  594. var _88=XMLBuilderLoadXMLFromString(_86.responseText);
  595. var _89=_88.getElementsByTagName("state");
  596. if(_89!=null&&_89.length>0){
  597. try{
  598. if(typeof _89[0].text!="undefined"){
  599. _87=eval("("+_89[0].text+")");
  600. }else{
  601. _87=eval("("+_89[0].textContent+")");
  602. }
  603. }
  604. catch(e){
  605. if(typeof console!="undefined"&&console&&console.log){
  606. console.log(e);
  607. }
  608. }
  609. }
  610. }
  611. return _87;
  612. };
  613. ModifyReportAction.prototype.getSelectedCellTags=function(){
  614. var _8a="";
  615. var _8b=this.getCognosViewer().getSelectionController().getSelections();
  616. for(var i=0;i<_8b.length;++i){
  617. var _8d=_8b[i].getCellRef();
  618. var _8e=_8b[i].getDataItems()[0];
  619. if(typeof _8e=="undefined"||_8e==null){
  620. _8e="";
  621. }
  622. var tag=this.getRAPLayoutTag(_8d);
  623. if(tag!=null){
  624. _8a+="<tag><tagValue>"+xml_encode(tag)+"</tagValue><dataItem>"+xml_encode(_8e)+"</dataItem></tag>";
  625. }else{
  626. _8a+="<tag><tagValue/><dataItem>"+xml_encode(_8e)+"</dataItem></tag>";
  627. }
  628. }
  629. if(_8a!=""){
  630. _8a="<selectedCellTags>"+_8a+"</selectedCellTags>";
  631. }
  632. return _8a;
  633. };
  634. ModifyReportAction.prototype.getIsNumericFromReportInfo=function(_90){
  635. var _91=this.getSelectedReportInfo();
  636. if(_91!=null&&typeof _91.itemInfo!="undefined"){
  637. for(var _92=0;_92<_91.itemInfo.length;++_92){
  638. if(_90==_91.itemInfo[_92].item&&typeof _91.itemInfo[_92].numeric!="undefined"){
  639. return (_91.itemInfo[_92].numeric=="true");
  640. }
  641. }
  642. }
  643. return false;
  644. };
  645. function ExpandCollapseMemberAction(){
  646. this.m_sAction="ExpandCollapseMember";
  647. this.m_sExpandCollapseType=null;
  648. this.m_RAPReportInfo=null;
  649. this.m_itemInfo=null;
  650. this.m_sPreviousDataItem=null;
  651. };
  652. ExpandCollapseMemberAction.prototype=new ModifyReportAction();
  653. ExpandCollapseMemberAction.baseclass=ModifyReportAction.prototype;
  654. ExpandCollapseMemberAction.prototype._getCanExpand=function(_93){
  655. var _94=this._getItemInfo(_93);
  656. return (_94&&_94.canExpand);
  657. };
  658. ExpandCollapseMemberAction.prototype._isExpanded=function(_95){
  659. var _96=this._getSelectedMUN(_95);
  660. if(!_96){
  661. return false;
  662. }
  663. var _97=this._getItemInfo(_95);
  664. return (_97&&_97.expandedMembers&&_97.expandedMembers[_96]===true);
  665. };
  666. ExpandCollapseMemberAction.prototype._getSelectedMUN=function(_98){
  667. var _99=null;
  668. var _9a=_98.getMuns();
  669. if(_9a&&_9a.length>0&&_9a[0].length>0){
  670. _99=_9a[0][0];
  671. }
  672. return _99;
  673. };
  674. ExpandCollapseMemberAction.prototype._getDataItem=function(_9b){
  675. if(!_9b){
  676. return null;
  677. }
  678. var _9c=null;
  679. var _9d=_9b.getDataItems();
  680. if(_9d&&_9d.length>0&&_9d[0].length>0){
  681. _9c=_9d[0][0];
  682. }
  683. return _9c;
  684. };
  685. ExpandCollapseMemberAction.prototype._getItemInfo=function(_9e){
  686. var _9f=this._getDataItem(_9e);
  687. if(!_9f){
  688. return null;
  689. }
  690. var _a0=this.removeNamespace(_9e.getLayoutElementId());
  691. this.m_RAPReportInfo=this.m_oCV.getRAPReportInfo();
  692. this.m_itemInfo=this.m_RAPReportInfo.getItemInfo(_a0,_9f);
  693. this.m_sPreviousDataItem=_9f;
  694. return this.m_itemInfo;
  695. };
  696. ExpandCollapseMemberAction.prototype._alwaysCanExpandCollapse=function(_a1){
  697. var _a2=this._getItemInfo(_a1);
  698. return (_a2&&_a2.alwaysCanExpandCollapse);
  699. };
  700. ExpandCollapseMemberAction.prototype._canShowMenu=function(_a3){
  701. var _a4=this._getFirstSelectedObject(_a3);
  702. return (_a4&&this._hasMUN(_a4)&&this._isCrosstab(_a4)&&this._isOnEdge(_a4)&&!_a3.areSelectionsMeasureOrCalculation());
  703. };
  704. ExpandCollapseMemberAction.prototype._getCtxId=function(_a5){
  705. var _a6=_a5.getCellRef();
  706. if(_a6&&_a6.getAttribute){
  707. var _a7=_a6.getAttribute("ctx");
  708. if(_a7){
  709. _a7=_a7.split("::")[0].split(":")[0];
  710. return _a7;
  711. }
  712. }
  713. return "";
  714. };
  715. ExpandCollapseMemberAction.prototype._hasMUN=function(_a8){
  716. var _a9=_a8.getMuns();
  717. return _a9.length>0?true:false;
  718. };
  719. ExpandCollapseMemberAction.prototype._isCrosstab=function(_aa){
  720. return _aa.getDataContainerType()==="crosstab"?true:false;
  721. };
  722. ExpandCollapseMemberAction.prototype._isOnEdge=function(_ab){
  723. return _ab.getLayoutType()==="columnTitle"?true:false;
  724. };
  725. ExpandCollapseMemberAction.prototype.keepRAPCache=function(){
  726. return false;
  727. };
  728. ExpandCollapseMemberAction.prototype.updateMenu=function(_ac){
  729. var _ad=this.m_oCV.getSelectionController();
  730. _ac.visible=this._canShowMenu(_ad);
  731. if(!_ac.visible){
  732. return _ac;
  733. }
  734. _ac.disabled=!this._canEnableMenu(_ad);
  735. return _ac;
  736. };
  737. ExpandCollapseMemberAction.prototype._canEnableMenu=function(_ae){
  738. return true;
  739. };
  740. ExpandCollapseMemberAction.prototype._getFirstSelectedObject=function(_af){
  741. var _b0=_af.getAllSelectedObjects();
  742. if(_b0.length>0){
  743. return _b0[0];
  744. }
  745. return null;
  746. };
  747. ExpandCollapseMemberAction.prototype._isSingleSelection=function(_b1){
  748. var _b2=_b1.getAllSelectedObjects();
  749. return (_b2.length===1);
  750. };
  751. ExpandCollapseMemberAction.prototype.addActionContextAdditionalParms=function(){
  752. var _b3=this.getCognosViewer().getSelectionController();
  753. var _b4=this._getFirstSelectedObject(_b3);
  754. var _b5=_b3.getPun(this._getCtxId(_b4));
  755. if(_b5){
  756. _b5="<PUN>"+sXmlEncode(_b5)+"</PUN>";
  757. }
  758. var _b6="";
  759. if(this.m_sExpandCollapseType){
  760. _b6="<ExpandCollapseType>"+this.m_sExpandCollapseType+"</ExpandCollapseType>";
  761. }
  762. return this.getSelectedCellTags()+_b5+_b6;
  763. };
  764. function ExpandMemberAction(){
  765. this.m_sAction="ExpandCollapseMember";
  766. this.m_sExpandCollapseType="ExpandMember";
  767. };
  768. ExpandMemberAction.prototype=new ExpandCollapseMemberAction();
  769. ExpandMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
  770. ExpandMemberAction.prototype.getUndoHint=function(){
  771. return RV_RES.IDS_JS_EXPAND_MEMBER;
  772. };
  773. ExpandMemberAction.prototype._canEnableMenu=function(_b7){
  774. if(!this._isSingleSelection(_b7)){
  775. return false;
  776. }
  777. var _b8=this._getFirstSelectedObject(_b7);
  778. if(this._alwaysCanExpandCollapse(_b8)){
  779. return true;
  780. }
  781. var _b9=this._getCtxId(_b8);
  782. var _ba=true;
  783. if(_b7.getDrillUpDownEnabled()===true){
  784. _ba=_b7.canDrillDown(_b9);
  785. }
  786. return (_ba&&this._getCanExpand(_b8)&&!this._isExpanded(_b8));
  787. };
  788. function CollapseMemberAction(){
  789. this.m_sAction="ExpandCollapseMember";
  790. this.m_sExpandCollapseType="CollapseMember";
  791. };
  792. CollapseMemberAction.prototype=new ExpandCollapseMemberAction();
  793. CollapseMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
  794. CollapseMemberAction.prototype.getUndoHint=function(){
  795. return RV_RES.IDS_JS_COLLAPSE_MEMBER;
  796. };
  797. CollapseMemberAction.prototype._canDisableMenu=function(_bb){
  798. if(this._isSingleSelection(_bb)&&!this._isExpanded()){
  799. return true;
  800. }
  801. return false;
  802. };
  803. CollapseMemberAction.prototype._canEnableMenu=function(_bc){
  804. var _bd=this._getFirstSelectedObject(_bc);
  805. if(this._alwaysCanExpandCollapse(_bd)){
  806. return true;
  807. }
  808. return (this._isSingleSelection(_bc)&&this._isExpanded(_bd));
  809. };
  810. function DrillAction(){
  811. this.m_bUseReportInfoSelection=false;
  812. this.m_aDrillSelectedObjects=[];
  813. this.m_useMARequest=false;
  814. this.m_userSelectedDrillItem=null;
  815. };
  816. DrillAction.prototype=new ModifyReportAction();
  817. DrillAction.prototype.getHoverClassName=function(){
  818. return "";
  819. };
  820. DrillAction.prototype.setRequestParms=function(_be){
  821. if(_be){
  822. this.m_userSelectedDrillItem=_be.userSelectedDrillItem;
  823. }
  824. };
  825. DrillAction.prototype.setKeepFocusOnWidget=function(_bf){
  826. this.m_bKeepFocusOnWidget=_bf;
  827. };
  828. DrillAction.prototype.keepFocusOnWidget=function(){
  829. if(typeof this.m_bKeepFocusOnWidget!="undefined"){
  830. return this.m_bKeepFocusOnWidget;
  831. }
  832. return true;
  833. };
  834. DrillAction.prototype.getDrillabilityForItemFromReportInfo=function(_c0){
  835. if(!this.m_oCV){
  836. return null;
  837. }
  838. var _c1=this.m_oCV.getRAPReportInfo();
  839. if(!_c1){
  840. return null;
  841. }
  842. var _c2=_c1.getContainers();
  843. for(var _c3 in _c2){
  844. var _c4=_c1.getDrillability(_c3);
  845. if(_c4[_c0]){
  846. return _c4[_c0];
  847. }
  848. }
  849. return null;
  850. };
  851. DrillAction.prototype.onDoubleClick=function(evt){
  852. this.execute();
  853. };
  854. DrillAction.prototype.preProcess=function(){
  855. if(typeof this.m_drillSpec==="undefined"||this.m_drillSpec===null){
  856. var _c6=this.generateDrillSpecObjects();
  857. if(!_c6){
  858. return null;
  859. }
  860. var _c7=this.getCognosViewer();
  861. var _c8=_c7.getViewerWidget();
  862. if(_c8){
  863. var _c9=_c7.getModelPath();
  864. _c8.getWidgetContextManager().raiseDrillEvent(_c6,this.m_sAction,_c9);
  865. }
  866. }
  867. };
  868. DrillAction.prototype.generateDrillSpecObjects=function(){
  869. try{
  870. var _ca=[];
  871. var oCV=this.getCognosViewer();
  872. var _cc=oCV.getDrillMgr();
  873. var _cd=oCV.getSelectionController();
  874. var _ce=true;
  875. var _cf=_cc.getDrillParameters(this.m_drillOption,true,_ce,this.m_userSelectedDrillItem);
  876. if(_cf.length===0){
  877. return null;
  878. }
  879. var _d0=_cc.getSelectedObject();
  880. if(_cf.length>3*4&&(_d0.getDataContainerType()=="crosstab"||_d0.getLayoutType()=="chartElement")){
  881. _cf.length=3*4;
  882. }
  883. var _d1=_cc.getSelectedObject().getSelectedContextIds();
  884. for(var i=0,_d3=0;_d3<_d1.length&&i<_cf.length;++_d3){
  885. var _d4=_d1[_d3][0];
  886. var _d5=_cd.getRefDataItem(_d4);
  887. var _d6=_cd.getMun(_d4);
  888. var _d7=_cd.getDisplayValue(_d4);
  889. if(_cd.getDrillFlagForMember(_d4)===0){
  890. i=i+4;
  891. continue;
  892. }
  893. var _d8={"dataItem":_cf[i++],"mun":_cf[i++],"lun":_cf[i++],"hun":_cf[i++]};
  894. if(_d5!=""&&_d7!=""){
  895. if(_d8.dataItem===_d5){
  896. _d8.displayValue=_d7;
  897. }
  898. }
  899. var _d9=_cd.getUsageInfo(_d4);
  900. _d8.isMeasure=(_d9==="2")?"true":"false";
  901. var _da=false;
  902. if(_d6!=""&&_d9!="2"){
  903. var _db=this.getDrillabilityForItemFromReportInfo(_d5);
  904. if((_db!=null&&_db.disableDown==true)||this.m_oCV.getSelectionController().getDrillFlagForMember(_d4)==1){
  905. _da=true;
  906. }
  907. }
  908. if(_da){
  909. if(_d8.dataItem===_d5){
  910. _d8.summary="true";
  911. }
  912. }
  913. _ca.push(_d8);
  914. }
  915. return (_ca.length>0)?_ca:null;
  916. }
  917. catch(e){
  918. return null;
  919. }
  920. };
  921. DrillAction.prototype.parseDrillSpec=function(evt){
  922. try{
  923. var oCV=this.getCognosViewer();
  924. if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
  925. return false;
  926. }
  927. this.m_drillSpec=evt.payload.drillSpec;
  928. var _de=XMLBuilderLoadXMLFromString(this.m_drillSpec);
  929. var _df=_de.firstChild;
  930. var _e0=getCognosViewerSCObjectRef(oCV.getId());
  931. _e0.m_aSelectedObjects=[];
  932. if(_e0.hasSelectedChartNodes()){
  933. _e0.clearSelectionData();
  934. }
  935. var _e1=XMLHelper_FindChildrenByTagName(_df,"DrillGroup",false);
  936. for(var _e2=0;_e2<_e1.length;++_e2){
  937. var _e3=XMLHelper_FindChildByTagName(_e1[_e2],"MUN",false);
  938. var _e4=XMLHelper_GetText(_e3);
  939. var _e5="";
  940. var _e6="";
  941. var _e7="";
  942. var _e8="";
  943. var _e9=XMLHelper_FindChildByTagName(_e1[_e2],"DisplayValue",false);
  944. if(_e9!=null){
  945. _e7=XMLHelper_GetText(_e9);
  946. }
  947. var _ea=XMLHelper_FindChildByTagName(_e1[_e2],"LUN",false);
  948. if(_ea!=null){
  949. _e5=XMLHelper_GetText(_ea);
  950. }
  951. var _eb=XMLHelper_FindChildByTagName(_e1[_e2],"HUN",false);
  952. if(_eb!=null){
  953. _e6=XMLHelper_GetText(_eb);
  954. }
  955. var _ec=XMLHelper_FindChildByTagName(_e1[_e2],"Summary",false);
  956. if(_ec!=null){
  957. _e8=XMLHelper_GetText(_ec);
  958. }
  959. this.selectObject(_e4,_e5,_e6,_e7,_e8,_e0);
  960. }
  961. }
  962. catch(e){
  963. return false;
  964. }
  965. return (_e0.m_aSelectedObjects.length>0);
  966. };
  967. DrillAction.prototype.parseDrillSpecObjects=function(_ed){
  968. if(this.useReportInfoSelection()){
  969. return this.parseDrillSpecObjectsWithReportInfo(_ed);
  970. }
  971. try{
  972. var oCV=this.getCognosViewer();
  973. if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
  974. return false;
  975. }
  976. this.m_drillSpec="";
  977. var _ef=getCognosViewerSCObjectRef(oCV.getId());
  978. _ef.m_aSelectedObjects=[];
  979. if(_ef.hasSelectedChartNodes()){
  980. _ef.clearSelectionData();
  981. }
  982. for(var i in _ed){
  983. var _f1=_ed[i];
  984. var _f2=(_f1.summary)?_f1.summary:"";
  985. var _f3=true;
  986. this.selectObject(_f1.mun,_f1.lun,_f1.hun,_f1.displayValue,_f2,_ef,_f3);
  987. }
  988. }
  989. catch(e){
  990. return false;
  991. }
  992. return (_ef.m_aSelectedObjects.length>0);
  993. };
  994. DrillAction.prototype.getDrillabilityForCtxValue=function(_f4){
  995. if(console&&console.log){
  996. console.log("Required method, getDrillabilityForCtxValue, not implemented.");
  997. }
  998. };
  999. DrillAction.prototype.setDrillabilityForSelectObject=function(_f5){
  1000. this.drillability=this.getDrillabilityForCtxValue(_f5);
  1001. };
  1002. DrillAction.prototype.canDrillDown=function(){
  1003. if(console&&console.log){
  1004. console.log("Required method, canDrillDown, not implemented.");
  1005. }
  1006. };
  1007. DrillAction.prototype.canDrilUp=function(){
  1008. if(console&&console.log){
  1009. console.log("Required method, canDrilUp, not implemented.");
  1010. }
  1011. };
  1012. DrillAction.prototype.selectObject=function(_f6,_f7,_f8,_f9,_fa,_fb,_fc){
  1013. var _fd=_f8;
  1014. var _fe=_f7;
  1015. var _ff=_f6;
  1016. var _100=false;
  1017. var _101=_fb.getCtxIdFromMun(_f6);
  1018. var _102=_101;
  1019. if(_101===""){
  1020. var _103=_fb.replaceNamespaceForSharedTM1DimensionOnly(_f7,_f8,_f6);
  1021. _fe=_103.lun;
  1022. _fd=_103.hun;
  1023. if(_fd!==_f8){
  1024. _ff=this._replaceNamespace(_f6,_fd);
  1025. }
  1026. _100=(_fc==true);
  1027. _101=_fb.getCtxIdFromMetaData(_fe,_fd,_100);
  1028. if(_101===""){
  1029. return false;
  1030. }
  1031. }
  1032. this.setDrillabilityForSelectObject(_101);
  1033. if((_100==true)||(this.m_sAction=="DrillDown"&&this.canDrillDown())||(this.m_sAction=="DrillUp"&&this.canDrillUp())){
  1034. var _104=_fb.getSelections().length;
  1035. _fb.selectObject(_ff,_fe,_fd,_100);
  1036. var _105=_fb.getSelections();
  1037. if(_102===""&&_105.length>_104){
  1038. var _106=_105[_105.length-1].m_aMuns;
  1039. _106[_106.length]=[];
  1040. _106[_106.length-1].push(_ff);
  1041. var _107=_105[_105.length-1].m_aDisplayValues;
  1042. _107.push(_f9);
  1043. _105[_105.length-1].useDisplayValueFromObject=true;
  1044. }
  1045. if(_fa=="true"){
  1046. _105=_fb.getSelections();
  1047. _105[_105.length-1].onSummary=true;
  1048. }
  1049. }
  1050. };
  1051. DrillAction.prototype._replaceNamespace=function(mun,_109){
  1052. var _10a=null;
  1053. if(_109){
  1054. var _10b=_109.substr(0,_109.indexOf("].[")+1);
  1055. if(mun&&_10b&&!(mun.match("^"+_10b))){
  1056. var _10c=mun.indexOf("].[");
  1057. _10a=_10b+mun.substr(_10c+1,mun.length);
  1058. }
  1059. }
  1060. return _10a||mun;
  1061. };
  1062. DrillAction.prototype.addActionContextAdditionalParms=function(){
  1063. var _10d="";
  1064. var _10e=(this.useReportInfoSelection())?this.m_aDrillSelectedObjects:this.getCognosViewer().getSelectionController().getSelections();
  1065. var _10f=null;
  1066. for(var i=0;i<_10e.length;++i){
  1067. if(_10e[i].onSummary){
  1068. _10f=(this.useReportInfoSelection())?_10e[i].item:_10e[i].getDataItems()[0][0];
  1069. _10d+="<dataItem>"+xml_encode(_10f)+"</dataItem>";
  1070. }
  1071. }
  1072. if(_10d!=""){
  1073. _10d="<onSummary>"+_10d+"</onSummary>";
  1074. }
  1075. if(this.m_userSelectedDrillItem){
  1076. _10d+=("<userSelectedDrillItem>"+this.m_userSelectedDrillItem+"</userSelectedDrillItem>");
  1077. }
  1078. if(this.m_useMARequest===true){
  1079. _10d=_10d+"<useMAGetChildRequest>false</useMAGetChildRequest>";
  1080. _10d=_10d+"<useMAGetParentRequest>false</useMAGetParentRequest>";
  1081. }
  1082. _10d+=this.addClientContextData(3);
  1083. return _10d;
  1084. };
  1085. DrillAction.prototype.getDrillOptionsAsString=function(){
  1086. var _111=this.getViewerWidget();
  1087. var _112="";
  1088. if(_111){
  1089. _112="<addSummaryMembers>"+_111.getDrillOptions().addSummaryMembers+"</addSummaryMembers>";
  1090. _112=_112+"<backwardsCompatible>"+_111.getDrillOptions().backwardsCompatible+"</backwardsCompatible>";
  1091. }
  1092. return _112;
  1093. };
  1094. DrillAction.prototype.getItemInfo=function(_113,_114){
  1095. var _115=_113.getRAPReportInfo();
  1096. if(!_115){
  1097. return null;
  1098. }
  1099. var _116=_115.getContainers();
  1100. for(var _117 in _116){
  1101. var _118=_115.getItemInfo(_117);
  1102. if(_118[_114]){
  1103. return _118[_114];
  1104. }
  1105. }
  1106. return null;
  1107. };
  1108. DrillAction.prototype.isSelectionFilterEnabled=function(){
  1109. var _119=this.getViewerWidget();
  1110. if(!_119){
  1111. return false;
  1112. }
  1113. return _119.isSelectionFilterEnabled();
  1114. };
  1115. DrillAction.prototype.getHierarchyHasExpandedSet=function(_11a,_11b){
  1116. var _11c=this.getItemInfo(_11a,_11b);
  1117. return (_11c&&_11c.hierarchyHasExpandedMembers);
  1118. };
  1119. DrillAction.prototype.getIsRSDrillParent=function(_11d,_11e){
  1120. var _11f=this.getItemInfo(_11d,_11e);
  1121. return (_11f&&_11f.isRSDrillParent);
  1122. };
  1123. DrillAction.prototype.setUseReportInfoSelection=function(_120){
  1124. this.m_bUseReportInfoSelection=_120;
  1125. };
  1126. DrillAction.prototype.useReportInfoSelection=function(){
  1127. return this.m_bUseReportInfoSelection;
  1128. };
  1129. DrillAction.prototype.parseDrillSpecObjectsWithReportInfo=function(_121){
  1130. try{
  1131. var _122=this.m_oCV.getRAPReportInfo();
  1132. if(!_122){
  1133. return null;
  1134. }
  1135. this.m_drillSpec="";
  1136. this.m_aDrillSelectedObjects=[];
  1137. for(var i in _121){
  1138. this.populateSelectObjectWithReportInfo(_121[i],_122);
  1139. }
  1140. }
  1141. catch(e){
  1142. return false;
  1143. }
  1144. return (this.m_aDrillSelectedObjects.length>0);
  1145. };
  1146. DrillAction.prototype.populateSelectObjectWithReportInfo=function(_124,_125){
  1147. var _126=_125.getItemDetails(_124.dataItem,_124.hun);
  1148. if(!_126){
  1149. _126=_125.getItemDetailsByHun(_124.hun);
  1150. if(!_126){
  1151. return null;
  1152. }
  1153. }
  1154. if(_124.mun){
  1155. _126.mun=_124.mun;
  1156. }
  1157. if(_124.lun){
  1158. _126.lun=_124.lun;
  1159. }
  1160. if(_124.displayValue){
  1161. _126.displayValue=_124.displayValue;
  1162. }
  1163. if(_124.isMeasure==="true"){
  1164. _126.isMeasure=true;
  1165. }
  1166. if(_124.summary==="true"){
  1167. _126.onSummary=true;
  1168. }
  1169. this.m_aDrillSelectedObjects.push(_126);
  1170. };
  1171. DrillAction.prototype.getSelectionContext=function(){
  1172. if(this.useReportInfoSelection()){
  1173. return this.genLeanSelection();
  1174. }else{
  1175. return CognosViewerAction.prototype.getSelectionContext.call(this);
  1176. }
  1177. };
  1178. DrillAction.prototype.genLeanSelection=function(){
  1179. if(this.m_aDrillSelectedObjects.length==0){
  1180. return "";
  1181. }
  1182. var _127="";
  1183. for(var idx in this.m_aDrillSelectedObjects){
  1184. var obj=this.m_aDrillSelectedObjects[idx];
  1185. _127+="<selectedCell>";
  1186. _127+=("<name>"+obj.item+"</name>"+"<display>"+obj.displayValue+"</display>"+"<rapLayoutTag>"+obj.lid+"</rapLayoutTag>"+"<queryName>"+obj.queryName+"</queryName>");
  1187. if(obj.mun){
  1188. _127+=("<nodeUse>"+obj.mun+"</nodeUse>");
  1189. _127+=("<nodeType>memberUniqueName</nodeType>");
  1190. }
  1191. if(obj.hun){
  1192. _127+=("<nodeHierarchyUniqueName>"+obj.hun+"</nodeHierarchyUniqueName>");
  1193. }
  1194. var _12a=(obj.isMeasure)?"measure":"nonMeasure";
  1195. _127+=("<nodeUsage>"+_12a+"</nodeUsage>");
  1196. _127+="</selectedCell>";
  1197. }
  1198. return ("<selection>"+_127+"</selection>");
  1199. };
  1200. DrillAction.prototype.runReport=function(){
  1201. if(this.getViewerWidget()){
  1202. return this.getViewerWidget().shouldReportBeRunOnAction();
  1203. }else{
  1204. return true;
  1205. }
  1206. };
  1207. DrillAction.prototype.canBeQueued=function(){
  1208. if(this.getViewerWidget()){
  1209. return !(this.getViewerWidget().isVisible());
  1210. }else{
  1211. return false;
  1212. }
  1213. };
  1214. function DrillUpDownAction(){
  1215. this.m_sAction="DrillDown";
  1216. this.m_drillOption="drillDown";
  1217. this.undoTooltip="";
  1218. };
  1219. DrillUpDownAction.prototype=new DrillAction();
  1220. DrillUpDownAction.prototype.getHoverClassName=function(){
  1221. return "dl";
  1222. };
  1223. DrillUpDownAction.prototype.getUndoHint=function(){
  1224. return this.undoTooltip;
  1225. };
  1226. DrillUpDownAction.prototype.keepRAPCache=function(){
  1227. return false;
  1228. };
  1229. DrillUpDownAction.prototype.updateDrillability=function(_12b,_12c){
  1230. this.m_oCV=_12b;
  1231. var _12d=_12c.getAttribute("ctx");
  1232. this.drillability=0;
  1233. if(_12d){
  1234. var _12e=_12d.split("::");
  1235. if(_12e&&_12e.length>0){
  1236. if(_12e.length>2){
  1237. this.drillability=this.getDrillabilityForIntersection(_12e[1].split(":")[0],_12e[2].split(":")[0]);
  1238. }else{
  1239. if(_12e.length===2){
  1240. this.drillability=this.getDrillabilityForCtxValue(_12e[1].split(":")[0]);
  1241. }else{
  1242. this.drillability=this.getDrillabilityForCtxValue(_12e[0].split(":")[0]);
  1243. }
  1244. }
  1245. }
  1246. }
  1247. if(this.isDefaultDrillUp(_12c)){
  1248. this.m_sAction="DrillUp";
  1249. this.m_drillOption="drillUp";
  1250. this.undoTooltip=RV_RES.RV_DRILL_UP;
  1251. }else{
  1252. this.m_sAction="DrillDown";
  1253. this.m_drillOption="drillDown";
  1254. this.undoTooltip=RV_RES.RV_DRILL_DOWN;
  1255. }
  1256. return this.drillability;
  1257. };
  1258. DrillUpDownAction.prototype.updateDrillabilityFromSelections=function(){
  1259. var _12f=this.m_oCV.getSelectionController();
  1260. var _130=_12f.getAllSelectedObjects();
  1261. this.drillability=0;
  1262. if(_130!=null&&typeof _130!="undefined"&&_130.length==1&&_130[0].m_contextIds!=null){
  1263. if(_130[0].getLayoutType()=="section"){
  1264. this.drillability=0;
  1265. }else{
  1266. if(_130[0].m_contextIds.length==0){
  1267. this.drillability=0;
  1268. }else{
  1269. if(typeof DrillContextMenuHelper!=="undefined"&&DrillContextMenuHelper.needsDrillSubMenu(this.m_oCV)){
  1270. this.drillability=this.getDrillabilityForAll(_130[0].m_contextIds);
  1271. }else{
  1272. if(_130[0].m_contextIds.length>2){
  1273. this.drillability=this.getDrillabilityForIntersection(_130[0].m_contextIds[1][0],_130[0].m_contextIds[2][0]);
  1274. }else{
  1275. this.drillability=this.getDrillabilityForCtxValue(_130[0].m_contextIds[0][0]);
  1276. }
  1277. }
  1278. }
  1279. }
  1280. }
  1281. return this.drillability;
  1282. };
  1283. DrillUpDownAction.prototype.getDrillabilityForCtxValue=function(_131){
  1284. var _132=0;
  1285. var _133=this.m_oCV.getSelectionController();
  1286. var _134=_133.getRefDataItem(_131);
  1287. if(this.getHierarchyHasExpandedSet(this.m_oCV,_134)&&this.getIsRSDrillParent(this.m_oCV,_134)){
  1288. _132=1;
  1289. return _132;
  1290. }
  1291. if(_133.getMun(_131)!==""&&_133.getUsageInfo(_131)!=="2"){
  1292. _132=(+_133.getDrillFlagForMember(_131));
  1293. var _135=this.getDrillabilityForItemFromReportInfo(_133.getRefDataItem(_131));
  1294. if(_135!=null){
  1295. if(_135.disableDown==true||_135.isolated==true){
  1296. if(_132==1||_132>=3||_135.isolated==true){
  1297. _132=1;
  1298. }else{
  1299. _132=0;
  1300. }
  1301. }
  1302. if(_135.disableUp==true){
  1303. if(_132>=2){
  1304. _132=2;
  1305. }else{
  1306. _132=0;
  1307. }
  1308. }
  1309. }
  1310. }
  1311. return _132;
  1312. };
  1313. DrillUpDownAction.prototype.getDrillabilityForIntersection=function(_136,_137){
  1314. var _138=this.getDrillabilityForCtxValue(_136);
  1315. return this.mergeDrillability(_138,_137);
  1316. };
  1317. DrillUpDownAction.prototype.getDrillabilityForAll=function(_139){
  1318. var _13a=(_139.length>=2)?1:0;
  1319. var _13b;
  1320. if(_139.length==2){
  1321. _13b=1;
  1322. }else{
  1323. if(_139.length>2){
  1324. _13b=2;
  1325. }else{
  1326. _13b=0;
  1327. }
  1328. }
  1329. var _13c=0;
  1330. for(var iDim=_13a;iDim<=_13b;++iDim){
  1331. for(var _13e=0;_13e<_139[iDim].length;++_13e){
  1332. _13c=this.mergeDrillability(_13c,_139[iDim][_13e]);
  1333. }
  1334. }
  1335. return _13c;
  1336. };
  1337. DrillUpDownAction.prototype.mergeDrillability=function(_13f,_140){
  1338. var _141=this.getDrillabilityForCtxValue(_140);
  1339. if(_13f==_141){
  1340. return _13f;
  1341. }
  1342. if(_13f>_141){
  1343. var temp=_13f;
  1344. _13f=_141;
  1345. _141=temp;
  1346. }
  1347. if(_13f==1&&_141==2){
  1348. return 3;
  1349. }
  1350. return _141;
  1351. };
  1352. DrillUpDownAction.prototype.hasPermission=function(){
  1353. if(this.m_oCV){
  1354. if(this.m_oCV.isDrillBlackListed()){
  1355. return false;
  1356. }
  1357. var _143=this.m_oCV.envParams;
  1358. if(_143){
  1359. return !(this.m_oCV.isLimitedInteractiveMode()||(_143["cv.objectPermissions"].indexOf("read")===-1));
  1360. }
  1361. }
  1362. return false;
  1363. };
  1364. DrillUpDownAction.prototype.canDrillUp=function(){
  1365. return ((this.drillability==1||this.drillability==3||this.drillability==4)&&this.hasPermission());
  1366. };
  1367. DrillUpDownAction.prototype.canDrillDown=function(){
  1368. return ((this.drillability==2||this.drillability==3||this.drillability==4)&&this.hasPermission());
  1369. };
  1370. DrillUpDownAction.prototype.isDefaultDrillUp=function(_144){
  1371. if(this.drillability==1||this.drillability==4||(_144&&_144.getAttribute("ischarttitle")==="true")){
  1372. return true;
  1373. }else{
  1374. return false;
  1375. }
  1376. };
  1377. DrillUpDownAction.prototype.doOnMouseOver=function(evt){
  1378. if(this.drillability>0&&!this.getCognosViewer().isLimitedInteractiveMode()){
  1379. var _146=getCtxNodeFromEvent(evt);
  1380. this.addDrillableClass(_146);
  1381. if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
  1382. this.addDrillableClass(evt.toElement);
  1383. }
  1384. }
  1385. };
  1386. DrillUpDownAction.prototype.doOnMouseOut=function(evt){
  1387. var _148=getCtxNodeFromEvent(evt);
  1388. if(_148){
  1389. this.removeDrillableClass(_148);
  1390. if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
  1391. this.removeDrillableClass(evt.toElement);
  1392. }
  1393. }
  1394. };
  1395. DrillUpDownAction.prototype.onMouseOver=function(evt){
  1396. this.doOnMouseOver(evt);
  1397. };
  1398. DrillUpDownAction.prototype.onMouseOut=function(evt){
  1399. this.doOnMouseOut(evt);
  1400. };
  1401. DrillUpDownAction.prototype.onDoubleClick=function(evt){
  1402. if(this.drillability>0&&this.hasPermission()&&!this.isSelectionFilterEnabled()){
  1403. this.execute();
  1404. var _14c=getCtxNodeFromEvent(evt);
  1405. if(_14c!=null){
  1406. this.removeDrillableClass(_14c);
  1407. }
  1408. }
  1409. };
  1410. DrillUpDownAction.prototype.addDrillableClass=function(node){
  1411. if(!node.className.match(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)"))){
  1412. node.className+=" "+this.getHoverClassName();
  1413. }
  1414. };
  1415. DrillUpDownAction.prototype.removeDrillableClass=function(node){
  1416. var _14f=node.className;
  1417. _14f=_14f.replace(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)")," ");
  1418. node.className=_14f.replace(/^\s*/,"").replace(/\s*$/,"");
  1419. };
  1420. function DrillUpDownOrThroughAction(){
  1421. this.m_hasAuthoredDrillTargets=false;
  1422. this.m_canDrillUpDown=false;
  1423. };
  1424. DrillUpDownOrThroughAction.prototype=new DrillUpDownAction();
  1425. DrillUpDownOrThroughAction.prototype.init=function(_150,_151){
  1426. if(this.getCognosViewer()){
  1427. var _152=this.getCognosViewer().getViewerWidget();
  1428. if(_152&&_152.isSelectionFilterEnabled()){
  1429. return;
  1430. }else{
  1431. if(this.m_oCV.isDrillBlackListed()){
  1432. return;
  1433. }
  1434. }
  1435. }
  1436. this.m_hasAuthoredDrillTargets=_150;
  1437. this.m_canDrillUpDown=_151;
  1438. };
  1439. DrillUpDownOrThroughAction.prototype.updateDrillabilityInfo=function(_153,_154){
  1440. if(this.m_canDrillUpDown){
  1441. return this.updateDrillability(_153,_154);
  1442. }
  1443. return null;
  1444. };
  1445. DrillUpDownOrThroughAction.prototype.onMouseOver=function(evt){
  1446. if(this.m_hasAuthoredDrillTargets){
  1447. var _156=getCtxNodeFromEvent(evt);
  1448. if(_156){
  1449. this.addDrillableClass(_156);
  1450. this._set_chartImage_drillThroughCursor_IE("pointer",evt);
  1451. }
  1452. }
  1453. if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
  1454. this.doOnMouseOver(evt);
  1455. }
  1456. };
  1457. DrillUpDownOrThroughAction.prototype.onMouseOut=function(evt){
  1458. if(this.m_hasAuthoredDrillTargets){
  1459. var _158=getCtxNodeFromEvent(evt);
  1460. if(_158){
  1461. this.removeDrillableClass(_158);
  1462. this._set_chartImage_drillThroughCursor_IE("default",evt);
  1463. }
  1464. }
  1465. if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
  1466. this.doOnMouseOut(evt);
  1467. }
  1468. };
  1469. DrillUpDownOrThroughAction.prototype._getDrillThroughChartImage_from_chartArea=function(evt){
  1470. var _15a=getCrossBrowserNode(evt);
  1471. if(_15a){
  1472. var _15b=this.m_oCV.getSelectionController();
  1473. return _15b.getSelectedChartImageFromChartArea(_15a);
  1474. }
  1475. };
  1476. DrillUpDownOrThroughAction.prototype._set_chartImage_drillThroughCursor_IE=function(_15c,evt){
  1477. if(dojo.isIE||dojo.isTrident){
  1478. var oImg=this._getDrillThroughChartImage_from_chartArea(evt);
  1479. if(oImg){
  1480. oImg.style.cursor=_15c;
  1481. }
  1482. }
  1483. };
  1484. function DrillDownAction(){
  1485. this.m_sAction="DrillDown";
  1486. this.m_drillOption="drillDown";
  1487. };
  1488. DrillDownAction.prototype=new DrillUpDownAction();
  1489. DrillDownAction.prototype.getUndoHint=function(){
  1490. return RV_RES.RV_DRILL_DOWN;
  1491. };
  1492. DrillDownAction.prototype.getHoverClassName=function(){
  1493. return "dl";
  1494. };
  1495. DrillDownAction.prototype.updateMenu=function(_15f){
  1496. _15f.visible=this.ifContainsInteractiveDataContainer();
  1497. if(!_15f.visible){
  1498. return _15f;
  1499. }
  1500. this.updateDrillabilityFromSelections();
  1501. if(!this.canDrillDown()){
  1502. _15f.disabled=true;
  1503. }else{
  1504. _15f.disabled=false;
  1505. DrillContextMenuHelper.updateDrillMenuItems(_15f,this.m_oCV,this.m_sAction);
  1506. }
  1507. return _15f;
  1508. };
  1509. function DrillUpAction(){
  1510. this.m_sAction="DrillUp";
  1511. this.m_drillOption="drillUp";
  1512. };
  1513. DrillUpAction.prototype=new DrillUpDownAction();
  1514. DrillUpAction.prototype.getHoverClassName=function(){
  1515. return "dl";
  1516. };
  1517. DrillUpAction.prototype.getUndoHint=function(){
  1518. return RV_RES.RV_DRILL_UP;
  1519. };
  1520. DrillUpAction.prototype.updateMenu=function(_160){
  1521. _160.visible=this.ifContainsInteractiveDataContainer();
  1522. if(!_160.visible){
  1523. return _160;
  1524. }
  1525. this.updateDrillabilityFromSelections();
  1526. if(!this.canDrillUp()){
  1527. _160.disabled=true;
  1528. }else{
  1529. _160.disabled=false;
  1530. DrillContextMenuHelper.updateDrillMenuItems(_160,this.m_oCV,this.m_sAction);
  1531. }
  1532. return _160;
  1533. };
  1534. function CognosViewerSort(_161,oCV){
  1535. this.m_oCV=oCV;
  1536. if(_161){
  1537. this.m_oEvent=_161;
  1538. this.m_oNode=getCrossBrowserNode(_161,true);
  1539. }
  1540. };
  1541. CognosViewerSort.prototype.setNode=function(node){
  1542. this.m_oNode=node;
  1543. };
  1544. CognosViewerSort.prototype.getNode=function(){
  1545. return this.m_oNode;
  1546. };
  1547. CognosViewerSort.prototype.isSort=function(){
  1548. if(this.m_oNode&&this.m_oNode.nodeName=="IMG"&&(this.m_oNode.id).indexOf("sortimg")>=0){
  1549. return true;
  1550. }else{
  1551. return false;
  1552. }
  1553. };
  1554. CognosViewerSort.prototype.execute=function(){
  1555. var _164=getCognosViewerSCObjectRef(this.m_oCV.getId());
  1556. _164.selectSingleDomNode(this.m_oNode.parentNode);
  1557. var _165=this.getSortAction();
  1558. _165.setCognosViewer(this.m_oCV);
  1559. _165.execute();
  1560. if(window.gViewerLogger){
  1561. window.gViewerLogger.addContextInfo(_164);
  1562. }
  1563. };
  1564. CognosViewerSort.prototype.getSortAction=function(){
  1565. var _166=this.m_oCV.getAction("Sort");
  1566. var _167=this.m_oNode.getAttribute("sortOrder");
  1567. if(_167.indexOf("nosort")!=-1){
  1568. _166.setRequestParms({order:"ascending",type:"value"});
  1569. }else{
  1570. if(_167.indexOf("ascending")!=-1){
  1571. _166.setRequestParms({order:"descending",type:"value"});
  1572. }else{
  1573. if(_167.indexOf("descending")!=-1){
  1574. _166.setRequestParms({order:"none",type:"value"});
  1575. }
  1576. }
  1577. }
  1578. return _166;
  1579. };
  1580. function SortAction(){
  1581. this.m_sAction="Sort";
  1582. this.m_sortOrder="none";
  1583. this.m_sortType="";
  1584. this.m_sItem="";
  1585. this.m_sId="";
  1586. };
  1587. SortAction.prototype=new ModifyReportAction();
  1588. SortAction.prototype.doExecute=function(){
  1589. if(this.m_sortOrder==="none"){
  1590. if(this.getContainerId(this.m_oCV.getSelectionController())){
  1591. var _168=this.getCurrentSortFromSelection();
  1592. if(this.m_sortType==="value"&&_168.indexOf("sortByValue")===-1){
  1593. return false;
  1594. }else{
  1595. if(this.m_sortType==="label"&&_168.indexOf("sortByLabel")===-1){
  1596. return false;
  1597. }
  1598. }
  1599. }
  1600. }
  1601. return true;
  1602. };
  1603. SortAction.prototype.execute=function(){
  1604. if(this.doExecute()){
  1605. ModifyReportAction.prototype.execute.call(this);
  1606. }
  1607. };
  1608. SortAction.prototype.getUndoHint=function(){
  1609. if(this.m_sortOrder=="none"){
  1610. return RV_RES.IDS_JS_DONT_SORT;
  1611. }else{
  1612. return RV_RES.IDS_JS_SORT;
  1613. }
  1614. };
  1615. SortAction.prototype.setRequestParms=function(_169){
  1616. this.m_sortOrder=_169.order;
  1617. this.m_sortType=_169.type;
  1618. if(_169.id!=null&&typeof _169.id!="undefined"){
  1619. this.m_sId=_169.id;
  1620. }
  1621. if(_169.item!=null&&typeof _169.item!="undefined"){
  1622. this.m_sItem=_169.item;
  1623. }
  1624. };
  1625. SortAction.prototype.addActionContextAdditionalParms=function(){
  1626. var _16a=this.m_oCV.getSelectionController();
  1627. var _16b="<order>"+this.m_sortOrder+"</order>";
  1628. if(this.m_sortType=="label"){
  1629. _16b+="<byLabel/>";
  1630. }
  1631. if(this.getContainerId(_16a)==""&&this.m_sId!=null&&typeof this.m_sId!="undefined"&&this.m_sId!=""){
  1632. _16b+=("<id>"+xml_encode(this.m_sId)+"</id>");
  1633. }
  1634. if(this.m_sItem!=null&&typeof this.m_sItem!="undefined"&&this.m_sItem!=""){
  1635. _16b+=("<item>"+xml_encode(this.m_sItem)+"</item>");
  1636. }
  1637. _16b+=this.addClientContextData(3);
  1638. _16b+=this.getSelectedCellTags();
  1639. return _16b;
  1640. };
  1641. SortAction.prototype.toggleMenu=function(_16c,_16d){
  1642. if(_16d){
  1643. _16c.iconClass="sort";
  1644. _16c.disabled=false;
  1645. }else{
  1646. _16c.iconClass="sortDisabled";
  1647. _16c.disabled=true;
  1648. }
  1649. return _16c;
  1650. };
  1651. SortAction.prototype.updateMenu=function(_16e){
  1652. _16e.visible=this.ifContainsInteractiveDataContainer();
  1653. if(!_16e.visible){
  1654. return _16e;
  1655. }
  1656. this.buildMenu(_16e);
  1657. if(_16e.disabled==true){
  1658. return this.toggleMenu(_16e,false);
  1659. }
  1660. return this.buildDynamicMenuItem(this.toggleMenu(_16e,true),"Sort");
  1661. };
  1662. SortAction.prototype.buildSelectedItemsString=function(_16f,_170,_171){
  1663. try{
  1664. var _172=_16f[_16f.length-1];
  1665. if(_170){
  1666. var _173=_172.getDisplayValues()[0];
  1667. if(typeof _173=="undefined"){
  1668. _173=_172.getUseValues()[0][0];
  1669. }
  1670. return _173;
  1671. }else{
  1672. return _172.getDataItemDisplayValue(_171);
  1673. }
  1674. }
  1675. catch(e){
  1676. if(console&&console.log){
  1677. console.log(e);
  1678. }
  1679. }
  1680. };
  1681. SortAction.prototype.buildMenu=function(_174){
  1682. _174.visible=this.ifContainsInteractiveDataContainer();
  1683. if(!_174.visible){
  1684. return _174;
  1685. }
  1686. if(!this.isSelectionSortable()){
  1687. return this.toggleMenu(_174,false);
  1688. }
  1689. _174=this.toggleMenu(_174,true);
  1690. var _175=[];
  1691. var _176=this.m_oCV.getSelectionController();
  1692. var _177=_176.getAllSelectedObjects();
  1693. if(_177.length==1&&_177[0].isHomeCell()==false){
  1694. var _178=_176.getDataContainerType();
  1695. var _179=this.getContainerId(_176);
  1696. var _17a=this.getReportInfo(_179);
  1697. if(_178==""&&!this.isSelectionOnChart()&&_177[0].getLayoutType()=="section"){
  1698. if(_17a!=null){
  1699. _178=_17a.displayTypeId;
  1700. }
  1701. }
  1702. var _17b,_17c,_17d;
  1703. var _17e=this.getCurrentSortFromSelection();
  1704. var _17f=this.isSelectionOnChart();
  1705. var _180=_17e.indexOf("sortByValue")!=-1;
  1706. var _181=_17e.indexOf("sortByValueAscending")!=-1;
  1707. var _182=_17e.indexOf("sortByValueDescending")!=-1;
  1708. var _183=this.m_oCV.isIWidgetMobile();
  1709. if(_178=="list"){
  1710. var _184={name:"SortAscending",label:RV_RES.IDS_JS_SORT_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"value"}},items:null};
  1711. this.addMenuItemChecked(_181,_184,"sortAscending");
  1712. _175.push(_184);
  1713. var _185={name:"SortDescending",label:RV_RES.IDS_JS_SORT_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"value"}},items:null};
  1714. this.addMenuItemChecked(_182,_185,"sortDescending");
  1715. _175.push(_185);
  1716. var _186={name:"DontSort",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"value"}},items:null};
  1717. this.addMenuItemChecked(!_180,_186,"sortNone");
  1718. _175.push(_186);
  1719. }else{
  1720. if(_178=="crosstab"||_17f){
  1721. if(_177[0].getLayoutType()=="columnTitle"||_17f){
  1722. _17b=this.m_oCV.getRAPReportInfo();
  1723. if(this.canSortByValueOnCrosstab(_177[0],_17b)){
  1724. _17c=RV_RES.IDS_JS_SORT_BY_VALUE;
  1725. if(_17f){
  1726. _17d=this.buildSelectedItemsString(_177,true,_17a);
  1727. if(typeof _17d!=="undefined"){
  1728. _17c+=":"+_17d;
  1729. }
  1730. }
  1731. var _187={name:"SortByValue",label:_17c,action:null,items:[{name:"Ascending",label:RV_RES.IDS_JS_SORT_BY_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"value"}},items:null},{name:"Descending",label:RV_RES.IDS_JS_SORT_BY_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"value"}},items:null},{name:"SortNone",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"value"}},items:null}]};
  1732. this.addMenuItemChecked(_180,_187);
  1733. this.addMenuItemChecked(_181,_187.items[0],"sortAscending");
  1734. this.addMenuItemChecked(_182,_187.items[1],"sortDescending");
  1735. this.addMenuItemChecked(!_180,_187.items[2],"sortNone");
  1736. if(_183){
  1737. _187.flatten=true;
  1738. }
  1739. _175.push(_187);
  1740. }
  1741. if(this.canSortByLabelOnCrosstab(_177[0])){
  1742. _17c=RV_RES.IDS_JS_SORT_BY_LABEL;
  1743. if(_17f){
  1744. _17d=this.buildSelectedItemsString(_177,false,_17a);
  1745. if(typeof _17d!=="undefined"){
  1746. _17c+=":"+_17d;
  1747. }
  1748. }
  1749. var _188={name:"SortByLabel",label:_17c,action:null,items:[{name:"Ascending",label:RV_RES.IDS_JS_SORT_BY_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"label"}},items:null},{name:"Descending",label:RV_RES.IDS_JS_SORT_BY_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"label"}},items:null},{name:"SortNone",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"label"}},items:null}]};
  1750. var _189=_17e.indexOf("sortByLabel")!=-1;
  1751. this.addMenuItemChecked(_189,_188);
  1752. this.addMenuItemChecked(_17e.indexOf("sortByLabelAscending")!=-1,_188.items[0],"sortAscending");
  1753. this.addMenuItemChecked(_17e.indexOf("sortByLabelDescending")!=-1,_188.items[1],"sortDescending");
  1754. this.addMenuItemChecked(!_189,_188.items[2],"sortNone");
  1755. if(_183){
  1756. _188.flatten=true;
  1757. }
  1758. _175.push(_188);
  1759. }
  1760. }
  1761. }
  1762. }
  1763. }
  1764. if(_175.length==0){
  1765. this.toggleMenu(_174,false);
  1766. }else{
  1767. if(_183){
  1768. if(_178=="crosstab"||_17f){
  1769. _174.useChildrenItems=true;
  1770. }else{
  1771. _174.flatten=true;
  1772. }
  1773. }
  1774. _174.items=_175;
  1775. this.toggleMenu(_174,true);
  1776. }
  1777. return _174;
  1778. };
  1779. SortAction.prototype.isSelectionSortable=function(){
  1780. var _18a=this.m_oCV.getSelectionController();
  1781. var _18b=_18a.getAllSelectedObjects();
  1782. if(_18b.length==1){
  1783. var _18c=_18b[0];
  1784. if(_18a.getDataContainerType()=="crosstab"&&_18c.getLayoutType()=="datavalue"){
  1785. return false;
  1786. }
  1787. if(_18a.hasSelectedChartNodes()){
  1788. var node=_18c.getArea();
  1789. if(node.nodeName=="AREA"||node.nodeName=="IMG"){
  1790. return _18b[0].getLayoutType()=="ordinalAxisLabel"||_18b[0].getLayoutType()=="legendLabel";
  1791. }
  1792. }else{
  1793. var data=_18c.getDataItems();
  1794. if(_18c.getCellRef().getAttribute("type")=="datavalue"&&!(data&&data.length)){
  1795. return false;
  1796. }
  1797. var _18f=_18c.getCellRef();
  1798. if(_18f.getAttribute("no_data_item_column")==="true"){
  1799. return false;
  1800. }
  1801. if(_18f.getAttribute("canSort")!="false"){
  1802. return true;
  1803. }
  1804. }
  1805. }
  1806. return false;
  1807. };
  1808. SortAction.prototype.getCurrentSortFromSelection=function(){
  1809. var _190=this.getContainerId(this.m_oCV.getSelectionController());
  1810. var _191=this.m_oCV.getRAPReportInfo();
  1811. var _192="";
  1812. if(_190!=""&&_191){
  1813. var _193=_191.getContainer(_190);
  1814. if(typeof _193.sort!="undefined"){
  1815. var _194=this.m_oCV.getSelectionController();
  1816. var _195=_194.getAllSelectedObjects();
  1817. if(_195.length==1){
  1818. var _196=_195[0].getDataItems();
  1819. if(_196.length<1){
  1820. return _192;
  1821. }
  1822. var _197=_196[0][0];
  1823. for(var _198=0;_198<_193.sort.length;++_198){
  1824. var _199=_193.sort[_198];
  1825. if(typeof _199.labels=="string"&&_199.labels==_197){
  1826. _192+=_199.order=="descending"?"sortByLabelDescending":"sortByLabelAscending";
  1827. }
  1828. if(typeof _199.valuesOf=="string"&&(_199.valuesOf==_197||this.isSortedValueOnRenamedColumn(_195[0],_199))){
  1829. _192+=_199.order=="descending"?"sortByValueDescending":"sortByValueAscending";
  1830. }else{
  1831. if(_199.valuesOf instanceof Array){
  1832. var _19a=true;
  1833. for(var _19b=0;_19b<_199.valuesOf.length;++_19b){
  1834. if(_19b<_195[0].m_contextIds[0].length){
  1835. var ctx=_195[0].m_contextIds[0][_19b];
  1836. var _19d=_194.getDisplayValue(ctx);
  1837. var _19e=this.findItemLabel(_193,_199.valuesOf[_19b].item);
  1838. if(_19e!=_19d){
  1839. _19a=false;
  1840. break;
  1841. }
  1842. }
  1843. }
  1844. if(_19a){
  1845. _192+=_199.valuesOf[0].order=="descending"?"sortByValueDescending":"sortByValueAscending";
  1846. }
  1847. }
  1848. }
  1849. }
  1850. }
  1851. }
  1852. }
  1853. return _192;
  1854. };
  1855. SortAction.prototype.isSortedValueOnRenamedColumn=function(_19f,_1a0){
  1856. if(_1a0&&_19f){
  1857. return (_1a0.valuesOf===_19f.getColumnRP_Name()&&_19f.getLayoutType()==="columnTitle");
  1858. }
  1859. };
  1860. SortAction.prototype.findItemLabel=function(_1a1,item){
  1861. var _1a3=_1a1.itemInfo;
  1862. if(_1a3){
  1863. for(var i=0;i<_1a3.length;i++){
  1864. if(_1a3[i].item===item){
  1865. if(_1a3[i].itemLabel){
  1866. return _1a3[i].itemLabel;
  1867. }
  1868. break;
  1869. }
  1870. }
  1871. }
  1872. return item;
  1873. };
  1874. SortAction.prototype.canSortByValueOnCrosstab=function(_1a5,_1a6){
  1875. var _1a7=this.m_oCV.getSelectionController();
  1876. var _1a8=this.getContainerId(this.m_oCV.getSelectionController());
  1877. if(_1a7.isRelational()==true){
  1878. return false;
  1879. }
  1880. if(_1a7.selectionsHaveCalculationMetadata()&&this.selectedObjectIsLeaf(_1a8,_1a5,_1a6)){
  1881. var _1a9=_1a5.getMuns()[0];
  1882. for(var _1aa=0;_1aa<_1a9.length;++_1aa){
  1883. if(_1a9[_1aa]!=null&&_1a9[_1aa].indexOf("uuid:")>=0){
  1884. return false;
  1885. }
  1886. }
  1887. return true;
  1888. }
  1889. return false;
  1890. };
  1891. SortAction.prototype.selectedObjectIsLeaf=function(_1ab,_1ac,_1ad){
  1892. if(_1ad){
  1893. var _1ae=_1ac.getDataItems();
  1894. if(_1ae!=null&&typeof _1ae!="undefined"&&_1ae.length>0){
  1895. var _1af=_1ad.getDrillability(_1ab,_1ae[0][0]);
  1896. if(_1af){
  1897. return _1af.leaf==true;
  1898. }
  1899. }
  1900. }
  1901. return false;
  1902. };
  1903. SortAction.prototype.canSortByLabelOnCrosstab=function(_1b0){
  1904. var _1b1=this.m_oCV.getSelectionController();
  1905. var _1b2=_1b1.getAllSelectedObjects();
  1906. if(_1b2.length==1){
  1907. var _1b0=_1b2[0];
  1908. if(this.isSelectSingleMember(_1b0)==false){
  1909. if(_1b1.selectionsNonMeasureWithMUN()||!_1b1.selectionsHaveCalculationMetadata()){
  1910. return true;
  1911. }
  1912. }
  1913. }
  1914. return false;
  1915. };
  1916. function ActionFormFields(_1b3){
  1917. this.m_dispatcherEntry=_1b3;
  1918. this.m_oCV=_1b3.getViewer();
  1919. };
  1920. ActionFormFields.prototype.addFormFields=function(){
  1921. var _1b4=this.m_dispatcherEntry;
  1922. var _1b5=_1b4.getAction();
  1923. _1b5.preProcess();
  1924. _1b4.addFormField("ui.action","modifyReport");
  1925. if(this.m_oCV.getModelPath()!==""){
  1926. _1b4.addFormField("modelPath",this.m_oCV.getModelPath());
  1927. if(typeof this.m_oCV.envParams["metaDataModelModificationTime"]!="undefined"){
  1928. _1b4.addFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
  1929. }
  1930. }
  1931. if(_1b5.doAddActionContext()===true){
  1932. var _1b6=_1b5.addActionContext();
  1933. _1b4.addFormField("cv.actionContext",_1b6);
  1934. if(window.gViewerLogger){
  1935. window.gViewerLogger.log("Action context",_1b6,"xml");
  1936. }
  1937. }
  1938. var _1b7=this.m_oCV.envParams["bux"]=="true";
  1939. if(_1b7){
  1940. _1b4.addFormField("cv.showFaultPage","false");
  1941. }else{
  1942. _1b4.addFormField("cv.showFaultPage","true");
  1943. }
  1944. _1b4.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  1945. _1b4.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  1946. _1b4.addDefinedFormField("modelPath",this.m_oCV.envParams["modelPath"]);
  1947. _1b4.addDefinedFormField("packageBase",this.m_oCV.envParams["packageBase"]);
  1948. _1b4.addDefinedFormField("rap.state",this.m_oCV.envParams["rap.state"]);
  1949. _1b4.addDefinedFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
  1950. _1b4.addDefinedFormField("ui.primaryAction",this.m_oCV.envParams["ui.primaryAction"]);
  1951. _1b4.addNonNullFormField("cv.debugDirectory",this.m_oCV.envParams["cv.debugDirectory"]);
  1952. _1b4.addNonNullFormField("ui.objectClass",this.m_oCV.envParams["ui.objectClass"]);
  1953. _1b4.addNonNullFormField("bux",this.m_oCV.envParams["bux"]);
  1954. _1b4.addNonNullFormField("baseReportModificationTime",this.m_oCV.envParams["baseReportModificationTime"]);
  1955. _1b4.addNonNullFormField("originalReport",this.m_oCV.envParams["originalReport"]);
  1956. var _1b8=this.m_oCV.getFlashChartOption();
  1957. if(_1b8!=null){
  1958. _1b4.addFormField("savedFlashChartOption",_1b8);
  1959. if(_1b8&&_1b5!=null&&typeof (_1b5.m_requestParams)!="undefined"&&typeof (_1b5.m_requestParams.targetType)!="undefined"){
  1960. var _1b9=false;
  1961. var _1ba=null;
  1962. if(typeof (_1b5.m_requestParams.targetType.targetType)!="undefined"){
  1963. _1ba=_1b5.m_requestParams.targetType.targetType;
  1964. }else{
  1965. _1ba=_1b5.m_requestParams.targetType;
  1966. }
  1967. if(_1ba.match("v2_")!=null||_1ba.match("_v2")!=null){
  1968. _1b9=true;
  1969. }else{
  1970. var _1bb=this.m_oCV.getRAPReportInfo();
  1971. var _1bc=_1b5.getSelectedReportInfo();
  1972. if(_1bb&&_1bc){
  1973. var _1bd=_1bb.getDisplayTypes(_1bc.container);
  1974. if(_1bd.match("v2_")!=null||_1bd.match("_v2")!=null){
  1975. _1b9=true;
  1976. }
  1977. }
  1978. }
  1979. _1b4.addFormField("hasAVSChart",_1b9);
  1980. }else{
  1981. _1b4.addFormField("hasAVSChart",this.m_oCV.hasAVSChart());
  1982. }
  1983. }
  1984. var sEP=this.m_oCV.getExecutionParameters();
  1985. if(sEP){
  1986. _1b4.addFormField("executionParameters",encodeURIComponent(sEP));
  1987. }
  1988. _1b4.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
  1989. _1b4.addFormField("m_tracking",encodeURIComponent(this.m_oCV.getTracking()));
  1990. var sCAF=this.m_oCV.getCAFContext();
  1991. if(sCAF){
  1992. _1b4.addFormField("ui.cafcontextid",sCAF);
  1993. }
  1994. if(_1b5.forceRunSpecRequest()){
  1995. _1b4.addFormField("widget.forceRunSpec","true");
  1996. }
  1997. };
  1998. function ModifyReportDispatcherEntry(oCV){
  1999. ModifyReportDispatcherEntry.baseConstructor.call(this,oCV);
  2000. this.m_action=null;
  2001. if(oCV){
  2002. this.m_viewerWidget=oCV.getViewerWidget();
  2003. this.setRequestHandler(new RequestHandler(oCV));
  2004. this.setWorkingDialog(oCV.getWorkingDialog());
  2005. this.setRequestIndicator(oCV.getRequestIndicator());
  2006. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting}});
  2007. }
  2008. };
  2009. ModifyReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
  2010. ModifyReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
  2011. ModifyReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
  2012. ModifyReportDispatcherEntry.prototype.initializeAction=function(_1c1){
  2013. this.setKey(_1c1.getActionKey());
  2014. this.setCanBeQueued(_1c1.canBeQueued());
  2015. this.m_action=_1c1;
  2016. };
  2017. ModifyReportDispatcherEntry.prototype.getAction=function(){
  2018. return this.m_action;
  2019. };
  2020. ModifyReportDispatcherEntry.prototype.prepareRequest=function(){
  2021. if(this.m_viewerWidget){
  2022. DispatcherEntry.addWidgetInfoToFormFields(this.m_viewerWidget,this);
  2023. }
  2024. var _1c2=new ActionFormFields(this);
  2025. _1c2.addFormFields();
  2026. if(this.m_viewerWidget){
  2027. this.addFormField("cv.id",this.m_viewerWidget.getViewerId());
  2028. }
  2029. this.addFormField("keepIterators","true");
  2030. this.addFormField("run.prompt",this.m_action.getPromptOption());
  2031. if(this.m_action.reuseQuery()===true){
  2032. this.addFormField("reuseResults","true");
  2033. }else{
  2034. if(this.m_action.reuseGetParameter()===true){
  2035. this.addFormField("reuseResults","paramInfo");
  2036. }
  2037. }
  2038. if(this.m_action.keepRAPCache()===false&&this.m_viewerWidget){
  2039. this.m_viewerWidget.clearRAPCache();
  2040. }
  2041. if(this.m_action.reuseConversation()===true){
  2042. this.addFormField("cv.reuseConversation","true");
  2043. }
  2044. if(this.m_action.isUndoable()&&this.m_action.getUndoRedoQueue()){
  2045. this.m_action.getUndoRedoQueue().initUndoObj({"tooltip":this.m_action.getUndoHint(),"saveSpec":this.m_action.saveSpecForUndo()});
  2046. }
  2047. if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")){
  2048. this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
  2049. }
  2050. this.getViewer().clearTabs();
  2051. };
  2052. ModifyReportDispatcherEntry.prototype.onComplete=function(_1c3,arg1){
  2053. if(this.getRequestHandler()){
  2054. this.getRequestHandler().onComplete(_1c3);
  2055. }
  2056. };
  2057. ModifyReportDispatcherEntry.prototype.onPrompting=function(_1c5){
  2058. if(this.getRequestHandler()){
  2059. this.getRequestHandler().onPrompting(_1c5);
  2060. }
  2061. };
  2062. ModifyReportDispatcherEntry.prototype.onWorking=function(_1c6,arg1){
  2063. this.parent.onWorking.call(this,_1c6,arg1);
  2064. var _1c8=_1c6.getResponseState();
  2065. if(this.getRequestHandler()){
  2066. this.getRequestHandler().updateViewerState(_1c8);
  2067. }
  2068. };
  2069. SortAction.prototype.getGetInfoActionContext=function(){
  2070. return "<GetInfo><include><sort/></include></GetInfo>";
  2071. };