viewer.qs.core.js 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590
  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. cvLoadDialog=function(_1,_2,_3,_4,_5,_6){
  13. _6=((_6===undefined)?true:_6);
  14. var _7=document.getElementById("formWarpRequest"+_1.getId());
  15. if(_7&&_1){
  16. _1.getWorkingDialog().hide();
  17. var _8="";
  18. var _9="";
  19. var _a=null;
  20. if(_1.isAccessibleMode()){
  21. _8="winNAT_"+(new Date()).getTime();
  22. _9=_1.getWebContentRoot()+"/"+"rv/blankNewWin.html?cv.id="+this.getCVId();
  23. }else{
  24. var _b=document.body;
  25. _a=new CModal("","",_b,null,null,_4,_3,true,true,false,true,_1.getWebContentRoot());
  26. if(typeof _5=="string"){
  27. document.getElementById(CMODAL_CONTENT_ID).setAttribute("title",_5);
  28. }
  29. document.getElementById(CMODAL_BACK_IFRAME_ID).setAttribute("title",RV_RES.IDS_JS_MODAL_BACK_IFRAME);
  30. _8=CMODAL_CONTENT_ID;
  31. }
  32. var _c=document.createElement("FORM");
  33. _c.method="POST";
  34. _c.action=_1.getGateway();
  35. _c.target=_8;
  36. _c.style.margin="0px";
  37. document.body.appendChild(_c);
  38. for(var _d in _2){
  39. _c.appendChild(createHiddenFormField(_d,_2[_d]));
  40. }
  41. if(_6){
  42. _c.appendChild(createHiddenFormField("cv.id",_1.getId()));
  43. _c.appendChild(createHiddenFormField("b_action","xts.run"));
  44. _c.appendChild(createHiddenFormField("ui.action",_7["ui.action"].value));
  45. _c.appendChild(createHiddenFormField("ui.object",_7["ui.object"].value));
  46. if(typeof _1.rvMainWnd!="undefined"){
  47. _c.appendChild(createHiddenFormField("run.outputFormat",_1.rvMainWnd.getCurrentFormat()));
  48. }
  49. if(typeof _7["run.outputLocale"]!="undefined"){
  50. _c.appendChild(createHiddenFormField("run.outputLocale",_7["run.outputLocale"].value));
  51. }
  52. if(typeof _c["backURL"]=="undefined"&&typeof _c["ui.backURL"]=="undefined"&&typeof _7["ui.backURL"]!="undefined"){
  53. _c.appendChild(createHiddenFormField("ui.backURL",_7["ui.backURL"].value));
  54. }
  55. if(typeof _1!="undefined"&&typeof _1.getConversation!="undefined"&&typeof _1.getTracking!="undefined"){
  56. _c.appendChild(createHiddenFormField("ui.conversation",_1.getConversation()));
  57. _c.appendChild(createHiddenFormField("m_tracking",_1.getTracking()));
  58. if(_1.envParams["ui.name"]!="undefined"){
  59. _c.appendChild(createHiddenFormField("ui.name",_1.envParams["ui.name"]));
  60. }
  61. }
  62. }
  63. var _e=window.onbeforeunload;
  64. window.onbeforeunload=null;
  65. if(_1.isAccessibleMode()){
  66. window.open(_9,_8,"rv");
  67. _c.submit();
  68. }else{
  69. _c.submit();
  70. _a.show();
  71. }
  72. window.onbeforeunload=_e;
  73. document.body.removeChild(_c);
  74. _1.modalShown=true;
  75. }
  76. };
  77. function createHiddenFormField(_f,_10){
  78. var _11=document.createElement("input");
  79. _11.setAttribute("type","hidden");
  80. _11.setAttribute("name",_f);
  81. _11.setAttribute("id",_f);
  82. _11.setAttribute("value",_10);
  83. return (_11);
  84. };
  85. function isAuthenticationFault(_12){
  86. if(_12!=null){
  87. var _13=XMLHelper_FindChildByTagName(_12,"CAM",true);
  88. return (_13!=null&&XMLHelper_FindChildByTagName(_13,"promptInfo",true)!=null);
  89. }
  90. };
  91. function processAuthenticationFault(_14,_15){
  92. if(isAuthenticationFault(_14)){
  93. launchLogOnDialog(_15,_14);
  94. return true;
  95. }
  96. return false;
  97. };
  98. function isObjectEmpty(_16){
  99. for(var _17 in _16){
  100. if(_16.hasOwnProperty(_17)){
  101. return false;
  102. }
  103. }
  104. return true;
  105. };
  106. function launchLogOnDialog(_18,_19){
  107. try{
  108. var oCV=getCognosViewerObjectRef(_18);
  109. var _1b={"b_action":"xts.run","m":"portal/close.xts","h_CAM_action":"logonAs"};
  110. if(_19!=null){
  111. var _1c=XMLHelper_FindChildrenByTagName(_19,"namespace",true);
  112. if(_1c!=null){
  113. for(var _1d=0;_1d<_1c.length;++_1d){
  114. var _1e=_1c[_1d];
  115. if(_1e!=null){
  116. var _1f=XMLHelper_FindChildByTagName(_1e,"name",false);
  117. var _20=XMLHelper_FindChildByTagName(_1e,"value",false);
  118. if(_1f!=null&&_20!=null){
  119. var _21=XMLHelper_GetText(_1f);
  120. var _22=XMLHelper_GetText(_20);
  121. if(_21!=null&&_21.length>0){
  122. _1b[_21]=_22;
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. cvLoadDialog(oCV,_1b,540,460,null,false);
  130. }
  131. catch(exception){
  132. }
  133. };
  134. function getCVWaitingOnFault(){
  135. var oCV=null;
  136. for(var _24=0;_24<window.gaRV_INSTANCES.length;_24++){
  137. if(window.gaRV_INSTANCES[_24].getRetryDispatcherEntry()!=null){
  138. oCV=window.gaRV_INSTANCES[_24];
  139. break;
  140. }
  141. }
  142. return oCV;
  143. };
  144. function ccModalCallBack(_25,_26){
  145. var oCV=getCVWaitingOnFault();
  146. destroyCModal();
  147. if(typeof HiddenIframeDispatcherEntry=="function"&&HiddenIframeDispatcherEntry.hideIframe){
  148. var oCV=window.gaRV_INSTANCES[0];
  149. if(oCV){
  150. HiddenIframeDispatcherEntry.hideIframe(oCV.getId());
  151. }
  152. }
  153. if(oCV!=null){
  154. if(typeof _25!="undefined"&&_25=="ok"){
  155. var _28=oCV.getRetryDispatcherEntry();
  156. if(_28){
  157. _28.retryRequest();
  158. }
  159. if(oCV.getRV()!=null){
  160. oCV.getRV().updateUserName();
  161. }
  162. }else{
  163. oCV.rvMainWnd.hideOpenMenus();
  164. }
  165. }
  166. };
  167. function closeErrorPage(){
  168. var oCV=getCVWaitingOnFault();
  169. destroyCModal();
  170. if(oCV!=null){
  171. oCV.setRetryDispatcherEntry(null);
  172. oCV.rvMainWnd.hideOpenMenus();
  173. }
  174. };
  175. function getCrossBrowserNode(evt,_2b){
  176. var _2c=null;
  177. if(_2b&&evt.explicitOriginalTarget){
  178. _2c=evt.explicitOriginalTarget;
  179. }else{
  180. if(evt.originalTarget){
  181. _2c=evt.originalTarget;
  182. }else{
  183. if(evt.target){
  184. _2c=evt.target;
  185. }else{
  186. if(evt.srcElement){
  187. _2c=evt.srcElement;
  188. }
  189. }
  190. }
  191. }
  192. try{
  193. if(_2c&&_2c.nodeType==3){
  194. _2c=_2c.parentNode;
  195. }
  196. }
  197. catch(ex){
  198. }
  199. return _2c;
  200. };
  201. function getNodeFromEvent(evt,_2e){
  202. var _2f=getCrossBrowserNode(evt,true);
  203. if(_2f&&_2f.getAttribute&&_2f.getAttribute("name")=="primarySelectionDiv"){
  204. _2f=_2f.parentNode.firstChild;
  205. }
  206. if(_2f&&_2f.getAttribute&&_2f.getAttribute("flashChartContainer")=="true"){
  207. _2f=_2f.firstChild;
  208. }
  209. if(_2f&&_2f.getAttribute&&_2f.getAttribute("chartContainer")=="true"&&_2f.childNodes){
  210. for(var i=0;i<_2f.childNodes.length;i++){
  211. if(_2f.childNodes[i].nodeName.toLowerCase()=="img"){
  212. _2f=_2f.childNodes[i];
  213. break;
  214. }
  215. }
  216. }else{
  217. if(!_2e&&_2f&&_2f.nodeName&&_2f.nodeName.toLowerCase()=="img"&&_2f.getAttribute("rsvpChart")!="true"){
  218. _2f=_2f.parentNode;
  219. }
  220. }
  221. return _2f;
  222. };
  223. function getCtxNodeFromEvent(evt){
  224. try{
  225. var _32=getCrossBrowserNode(evt);
  226. var _33=_32.nodeName.toUpperCase();
  227. if((_33=="SPAN"||_33=="AREA"||_33=="IMG")&&_32.getAttribute("ctx")!=null){
  228. return _32;
  229. }else{
  230. if(_33=="SPAN"&&(_32.parentNode.getAttribute("ctx")!=null)){
  231. return _32.parentNode;
  232. }
  233. }
  234. }
  235. catch(exception){
  236. }
  237. return null;
  238. };
  239. function getDocumentFromEvent(evt){
  240. var _35=getCrossBrowserNode(evt,true);
  241. var _36=_35.document?_35.document:_35.ownerDocument;
  242. return _36;
  243. };
  244. function stopEventBubble(evt){
  245. evt.returnValue=false;
  246. evt.cancelBubble=true;
  247. if(typeof evt.stopPropagation!="undefined"){
  248. evt.stopPropagation();
  249. }
  250. if(typeof evt.preventDefault!="undefined"){
  251. evt.preventDefault();
  252. }
  253. return false;
  254. };
  255. function setNodeFocus(evt){
  256. evt=(evt)?evt:((event)?event:null);
  257. var _39=getNodeFromEvent(evt);
  258. if(_39&&_39.nodeName){
  259. var _3a=_39.nodeName.toLowerCase();
  260. if((_3a=="td"||_3a=="span")&&_39.childNodes&&_39.childNodes.length>0&&_39.childNodes[0].className=="textItem"){
  261. try{
  262. _39.childNodes[0].focus();
  263. }
  264. catch(e){
  265. if(typeof console!=="undefined"&&console.log){
  266. console.log("CCognosViewer: Could not set focus to node. setNodeFocus method common.js");
  267. }
  268. }
  269. }
  270. }
  271. };
  272. function html_encode(str){
  273. return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");
  274. };
  275. function replaceNewLine(_3c){
  276. var _3d=/\r\n|\r|\n/g;
  277. var _3e="<br/>";
  278. return _3c.replace(_3d,_3e);
  279. };
  280. function xml_encode(_3f){
  281. var _40=""+_3f;
  282. if((_40=="0")||((_3f!=null)&&(_3f!=false))){
  283. _40=_40.replace(/&/g,"&amp;");
  284. _40=_40.replace(/</g,"&lt;");
  285. _40=_40.replace(/>/g,"&gt;");
  286. _40=_40.replace(/"/g,"&quot;");
  287. _40=_40.replace(/'/g,"&apos;");
  288. }else{
  289. if(_3f==null){
  290. _40="";
  291. }
  292. }
  293. return _40;
  294. };
  295. function xml_decodeParser(_41,_42){
  296. var _43=_41;
  297. switch(_42){
  298. case "amp":
  299. _43="&";
  300. break;
  301. case "lt":
  302. _43="<";
  303. break;
  304. case "gt":
  305. _43=">";
  306. break;
  307. case "quot":
  308. _43="\"";
  309. break;
  310. case "apos":
  311. _43="'";
  312. break;
  313. }
  314. return _43;
  315. };
  316. function xml_decode(_44){
  317. var _45=""+_44;
  318. if((_45=="0")||((_44!=null)&&(_44!=false))){
  319. _45=_45.replace(/&(amp|lt|gt|quot|apos);/g,xml_decodeParser);
  320. }else{
  321. if(_44==null){
  322. _45="";
  323. }
  324. }
  325. return _45;
  326. };
  327. function xpath_attr_encode(_46){
  328. var _47=null;
  329. if(_46.indexOf("'")>=0&&_46.indexOf("\"")>=0){
  330. var _48=_46.split("\"");
  331. _47="concat(";
  332. for(var i=0;i<_48.length;++i){
  333. if(i>0){
  334. _47+=",";
  335. }
  336. if(_48[i].length>0){
  337. _47+=("\""+_48[i]+"\"");
  338. }else{
  339. _47+="'\"'";
  340. }
  341. }
  342. _47+=")";
  343. }else{
  344. if(_46.indexOf("'")>=0){
  345. _47="\""+_46+"\"";
  346. }else{
  347. _47="'"+_46+"'";
  348. }
  349. }
  350. return _47;
  351. };
  352. function getCognosViewerObjectString(sId){
  353. return "oCV"+sId;
  354. };
  355. function getCognosViewerObjectRefAsString(sId){
  356. return "window."+getCognosViewerObjectString(sId);
  357. };
  358. function getCognosViewerObjectRef(sId){
  359. return window[getCognosViewerObjectString(sId)];
  360. };
  361. function getCognosViewerSCObjectString(sId){
  362. return "oCVSC"+sId;
  363. };
  364. function getCognosViewerSCObjectRefAsString(sId){
  365. return "window."+getCognosViewerSCObjectString(sId);
  366. };
  367. function getCognosViewerSCObjectRef(sId){
  368. return window[getCognosViewerSCObjectString(sId)];
  369. };
  370. function cleanupGlobalObjects(sId){
  371. cleanupVariable(getCognosViewerObjectString(sId));
  372. cleanupVariable(getCognosViewerSCObjectString(sId));
  373. };
  374. function cleanupVariable(_51){
  375. if(typeof window[_51]!="undefined"&&window[_51]){
  376. if(isIE()){
  377. eval("delete "+_51);
  378. }else{
  379. delete window[_51];
  380. }
  381. }
  382. };
  383. function loadClass(_52){
  384. try{
  385. var _53=eval("new "+_52+"();");
  386. return _53;
  387. }
  388. catch(e){
  389. return null;
  390. }
  391. };
  392. function getElementsByClassName(_54,_55,_56){
  393. var _57=(_55=="*"&&_54.all)?_54.all:_54.getElementsByTagName(_55);
  394. var _58=[];
  395. var _59=new RegExp("(^|\\s)"+_56+"(\\s|$)");
  396. var _5a=_57.length;
  397. for(var i=0;i<_5a;i++){
  398. var _5c=_57[i];
  399. if(_59.test(_5c.className)){
  400. _58.push(_5c);
  401. }
  402. }
  403. return _58;
  404. };
  405. function getImmediateLayoutContainerId(_5d){
  406. var _5e=_5d;
  407. while(_5e!=null){
  408. if(_5e.getAttribute&&_5e.getAttribute("lid")!=null){
  409. return _5e.getAttribute("lid");
  410. }
  411. _5e=_5e.parentNode;
  412. }
  413. return null;
  414. };
  415. function getChildElementsByAttribute(_5f,_60,_61,_62){
  416. return getDescendantElementsByAttribute(_5f,_60,_61,_62,true);
  417. };
  418. function getElementsByAttribute(_63,_64,_65,_66,_67,_68){
  419. return getDescendantElementsByAttribute(_63,_64,_65,_66,false,_67,_68);
  420. };
  421. function getDescendantElementsByAttribute(_69,_6a,_6b,_6c,_6d,_6e,_6f){
  422. var _70=[];
  423. var _71=null;
  424. if(typeof _6f==="undefined"){
  425. _71=(typeof _6c!="undefined")?new RegExp("(^|\\s)"+_6c+"(\\s|$)","i"):null;
  426. }else{
  427. _71=_6f;
  428. }
  429. if(typeof _6a=="string"){
  430. _6a=[_6a];
  431. }
  432. var _72=(_69?_6a.length:0);
  433. for(var _73=0;_73<_72;_73++){
  434. var _74=null;
  435. if(_6d){
  436. if(_6a[_73]=="*"&&_69.all){
  437. _74=_69.childNodes;
  438. }else{
  439. _74=[];
  440. var _75=_69.childNodes;
  441. for(var i=0;i<_75.length;++i){
  442. if(_75[i].nodeName.toLowerCase()==_6a[_73].toLowerCase()){
  443. _74.push(_75[i]);
  444. }
  445. }
  446. }
  447. }else{
  448. _74=(_6a[_73]=="*"&&_69.all)?_69.all:_69.getElementsByTagName(_6a[_73]);
  449. }
  450. var _77=_74.length;
  451. for(var idx=0;idx<_77;idx++){
  452. var _79=_74[idx];
  453. var _7a=_79.getAttribute&&_79.getAttribute(_6b);
  454. if(_7a!==null){
  455. var _7b=null;
  456. if(typeof _7a==="number"){
  457. _7b=String(_7a);
  458. }else{
  459. if(typeof _7a==="string"&&_7a.length>0){
  460. _7b=_7a;
  461. }
  462. }
  463. if(_7b!==null){
  464. if(typeof _6c=="undefined"||(_71&&_71.test(_7b))){
  465. _70.push(_79);
  466. if(_6e!=-1&&_70.length>_6e){
  467. return [];
  468. }else{
  469. if(_6e==1&&_70.length==1){
  470. return _70;
  471. }
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. return _70;
  479. };
  480. function savedOutputDoneLoading(_7c,_7d){
  481. var oCV=window["oCV"+_7c];
  482. var _7f=(oCV&&oCV.getViewerWidget?oCV.getViewerWidget():null);
  483. var _80=(_7f?_7f.getSavedOutput():null);
  484. if(_80){
  485. _80.outputDoneLoading();
  486. }else{
  487. if(_7d<5){
  488. _7d++;
  489. var _81=function(){
  490. savedOutputDoneLoading(_7c,_7d);
  491. };
  492. setTimeout(_81,100);
  493. }
  494. }
  495. };
  496. function getNavVer(){
  497. var _82;
  498. if(isIE()){
  499. return getIEVersion();
  500. }else{
  501. _82=navigator.userAgent.split("/");
  502. return parseFloat(_82[_82.length-1]);
  503. }
  504. };
  505. function isSafari(){
  506. return (navigator.userAgent.toLowerCase().indexOf("safari")!=-1&&navigator.userAgent.toLowerCase().indexOf("chrome")==-1);
  507. };
  508. function isIE(){
  509. return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
  510. };
  511. function getIEVersion(){
  512. var _83=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
  513. return _83?parseFloat(_83[1]):null;
  514. };
  515. function isFF(){
  516. return (navigator.userAgent.indexOf("Firefox")!=-1);
  517. };
  518. function isIOS(){
  519. return navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1;
  520. };
  521. function displayChart(_84,_85,_86,_87){
  522. if(_85.length>1){
  523. document.images[_84].src=_85;
  524. }
  525. };
  526. function isFlashChartNode(evt){
  527. var _89=getNodeFromEvent(evt);
  528. if(_89!=null&&typeof _89.getAttribute=="function"){
  529. return _89.getAttribute("flashChart")!=null;
  530. }
  531. return false;
  532. };
  533. function onFlashChartRightClick(evt){
  534. if(evt&&evt.button&&evt.button!=0&&isFlashChartNode(evt)){
  535. return onViewerChartFocus(evt);
  536. }
  537. };
  538. function onViewerChartFocus(evt){
  539. if(evt.stopPropagation){
  540. evt.stopPropagation();
  541. }
  542. if(evt.preventDefault){
  543. evt.preventDefault();
  544. }
  545. if(evt.preventCapture){
  546. evt.preventCapture();
  547. }
  548. if(evt.preventBubble){
  549. evt.preventBubble();
  550. }
  551. var _8c=getNodeFromEvent(evt);
  552. var _8d=_8c.getAttribute("viewerId");
  553. if(!_8d){
  554. _8d=_8c.parentNode.getAttribute("viewerId");
  555. }
  556. if(!_8d){
  557. return;
  558. }
  559. var oCV=window["oCV"+_8d];
  560. var _8f=oCV.getAction("Selection");
  561. _8f.pageClicked(evt);
  562. return stopEventBubble(evt);
  563. };
  564. function clientToScreenCoords(_90,_91){
  565. var _92=_90;
  566. var _93={topCoord:0,leftCoord:0};
  567. while(_92!=null&&_92!=_91){
  568. _93.topCoord+=_92.offsetTop;
  569. _93.leftCoord+=_92.offsetLeft;
  570. _92=_92.offsetParent;
  571. }
  572. return _93;
  573. };
  574. function getCurrentPosistionString(oCV,_95,_96){
  575. var _97=RV_RES.IDS_JS_INFOBAR_ITEM_COUNT;
  576. var _98=/\{0\}/;
  577. var _99=/\{1\}/;
  578. _97=_97.replace(_98,_95);
  579. _97=" "+_97.replace(_99,_96)+" ";
  580. return _97;
  581. };
  582. function applyJSONProperties(obj,_9b){
  583. for(property in _9b){
  584. if(typeof _9b[property]=="object"&&!(_9b[property] instanceof Array)){
  585. if(typeof obj[property]=="undefined"){
  586. obj[property]={};
  587. }
  588. applyJSONProperties(obj[property],_9b[property]);
  589. }else{
  590. obj[property]=_9b[property];
  591. }
  592. }
  593. };
  594. function CViewerCommon(){
  595. };
  596. CViewerCommon.openNewWindowOrTab=function(_9c,_9d){
  597. return window.open(_9c,_9d);
  598. };
  599. CViewerCommon.toJSON=function(obj){
  600. var _9f=typeof (obj);
  601. if(_9f!="object"||_9f===null){
  602. if(_9f==="string"){
  603. obj="\""+obj+"\"";
  604. }
  605. return String(obj);
  606. }else{
  607. var _a0;
  608. var _a1;
  609. var _a2=[];
  610. var _a3=(obj&&obj.constructor==Array);
  611. for(_a0 in obj){
  612. _a1=obj[_a0];
  613. _9f=typeof (_a1);
  614. if(_9f==="string"){
  615. _a1="\""+_a1+"\"";
  616. }else{
  617. if(_9f=="object"&&_a1!==null){
  618. _a1=CViewerCommon.toJSON(_a1);
  619. }
  620. }
  621. _a2.push((_a3?"":"\""+_a0+"\":")+String(_a1));
  622. }
  623. return (_a3?"[":"{")+String(_a2)+(_a3?"]":"}");
  624. }
  625. };
  626. function resizePinnedContainers(){
  627. var oCV=window.gaRV_INSTANCES[0];
  628. if(oCV&&!oCV.m_viewerFragment){
  629. var _a5=oCV.getPinFreezeManager();
  630. if(_a5&&_a5.hasFrozenContainers()){
  631. var _a6=document.getElementById("RVContent"+oCV.getId());
  632. var _a7=document.getElementById("mainViewerTable"+oCV.getId());
  633. var _a8=_a6.clientWidth;
  634. var _a9=_a7.clientHeight;
  635. _a5.resize(_a8,_a9);
  636. if(isIE()){
  637. oCV.repaintDiv(_a6);
  638. }
  639. }
  640. }
  641. };
  642. function setWindowHref(url){
  643. var _ab=window.onbeforeunload;
  644. window.onbeforeunload=null;
  645. window.location.href=url;
  646. window.onbeforeunload=_ab;
  647. };
  648. CViewerCommon.getMessage=function(msg,_ad){
  649. if(typeof _ad=="undefined"){
  650. return msg;
  651. }else{
  652. if(typeof _ad=="string"){
  653. msg=msg.replace("{0}",_ad);
  654. }else{
  655. if(_ad.length){
  656. for(var i=0;i<_ad.length;++i){
  657. msg=msg.replace("{"+i+"}",_ad[i]);
  658. }
  659. }else{
  660. msg=msg.replace("{0}",_ad);
  661. }
  662. }
  663. }
  664. return msg;
  665. };
  666. function getViewerDirection(){
  667. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  668. return gaRV_INSTANCES[0].getDirection();
  669. }
  670. return "ltr";
  671. };
  672. function isViewerBidiEnabled(){
  673. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  674. var _af=gaRV_INSTANCES[0].isBidiEnabled();
  675. if(_af){
  676. return true;
  677. }
  678. }
  679. return false;
  680. };
  681. function getViewerBaseTextDirection(){
  682. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  683. return gaRV_INSTANCES[0].getBaseTextDirection();
  684. }
  685. return "";
  686. };
  687. function enforceTextDir(_b0){
  688. if(isViewerBidiEnabled()&&_b0){
  689. var _b1=getViewerBaseTextDirection();
  690. var _b2=BidiUtils.getInstance();
  691. if(_b1=="auto"){
  692. _b1=_b2.resolveStrBtd(_b0);
  693. }
  694. var _b3=(!dojo._isBodyLtr())?_b2.RLM:_b2.LRM;
  695. return _b3+((_b1==="rtl")?_b2.RLE:_b2.LRE)+_b0+_b2.PDF+_b3;
  696. }
  697. return _b0;
  698. };
  699. function getElementDirection(_b4){
  700. var dir=null;
  701. if(_b4.currentStyle){
  702. dir=_b4.currentStyle.direction;
  703. }else{
  704. if(window.getComputedStyle){
  705. var _b6=window.getComputedStyle(_b4,null);
  706. if(_b6){
  707. dir=_b6.getPropertyValue("direction");
  708. }
  709. }
  710. }
  711. if(dir){
  712. dir=dir.toLowerCase();
  713. }
  714. return dir;
  715. };
  716. function getScrollLeft(_b7){
  717. if(getElementDirection(_b7)==="rtl"&&isFF()){
  718. return _b7.scrollWidth-_b7.offsetWidth+_b7.scrollLeft;
  719. }
  720. return _b7.scrollLeft;
  721. };
  722. function setScrollLeft(_b8,_b9){
  723. if(getElementDirection(_b8)==="rtl"&&isFF()){
  724. _b8.scrollLeft=_b8.offsetWidth+_b9-_b8.scrollWidth;
  725. }else{
  726. _b8.scrollLeft=_b9;
  727. }
  728. };
  729. function setScrollRight(_ba,_bb){
  730. if(getElementDirection(_ba)==="rtl"&&isFF()){
  731. _ba.scrollLeft=-_bb;
  732. }else{
  733. _ba.scrollLeft=_ba.scrollWidth-_ba.offsetWidth-_bb;
  734. }
  735. };
  736. function getBoxInfo(el,_bd){
  737. if(!getBoxInfo.aStyles){
  738. getBoxInfo.aStyles=[{name:"marginLeft",ie:"marginLeft",ff:"margin-left"},{name:"marginRight",ie:"marginRight",ff:"margin-right"},{name:"marginTop",ie:"marginTop",ff:"margin-top"},{name:"marginBottom",ie:"marginBottom",ff:"margin-bottom"},{name:"borderLeftWidth",ie:"borderLeftWidth",ff:"border-left-width"},{name:"borderRightWidth",ie:"borderRightWidth",ff:"border-right-width"},{name:"borderTopWidth",ie:"borderTopWidth",ff:"border-top-width"},{name:"borderBottomWidth",ie:"borderBottomWidth",ff:"border-bottom-width"},{name:"paddingLeft",ie:"paddingLeft",ff:"padding-left"},{name:"paddingRight",ie:"paddingRight",ff:"padding-right"},{name:"paddingTop",ie:"paddingTop",ff:"padding-top"},{name:"paddingBottom",ie:"paddingBottom",ff:"padding-bottom"}];
  739. }
  740. var _be={};
  741. var _bf=null;
  742. if(el.currentStyle){
  743. _bf=el.currentStyle;
  744. }else{
  745. if(window.getComputedStyle){
  746. _bf=window.getComputedStyle(el,null);
  747. }
  748. }
  749. if(!_bf){
  750. return null;
  751. }
  752. for(i in getBoxInfo.aStyles){
  753. var _c0=getBoxInfo.aStyles[i];
  754. var _c1=null;
  755. if(_bf.getPropertyValue){
  756. _c1=_bf.getPropertyValue(_c0.ff);
  757. }else{
  758. _c1=_bf[_c0.ie];
  759. }
  760. if(_c1&&_bd){
  761. _c1=Number(_c1.replace("px",""));
  762. }
  763. _be[_c0.name]=_c1;
  764. }
  765. return _be;
  766. };
  767. var GUtil={};
  768. GUtil.createHiddenForm=function(_c2,_c3,_c4,_c5){
  769. var _c6=document.getElementById(_c2);
  770. if(_c6){
  771. document.body.removeChild(_c6);
  772. }
  773. _c6=document.createElement("form");
  774. _c6.id=_c2;
  775. _c6.name=_c2;
  776. _c6.method=_c3;
  777. _c6.style.display="none";
  778. _c6.action=document.forms["formWarpRequest"+_c4].action;
  779. _c6.target=_c5+(new Date()).getTime();
  780. document.body.appendChild(_c6);
  781. return _c6;
  782. };
  783. GUtil.createFormField=function(el,_c8,_c9){
  784. var _ca=document.createElement("input");
  785. _ca.type="hidden";
  786. _ca.name=_c8;
  787. _ca.value=_c9;
  788. el.appendChild(_ca);
  789. };
  790. GUtil.generateCallback=function(_cb,_cc,_cd){
  791. if(_cb){
  792. var _ce=_cd||this;
  793. _cc=(_cc instanceof Array)?_cc:[];
  794. return (function(_cf){
  795. if(typeof _cf!="undefined"&&_cc.length==0){
  796. _cc.push(_cf);
  797. }
  798. return _cb.apply(_ce,_cc);
  799. });
  800. }else{
  801. return (function(){
  802. });
  803. }
  804. };
  805. GUtil.destroyProperties=function(_d0,_d1){
  806. var _d2;
  807. if(_d0 instanceof Array){
  808. for(var i=0;i<_d0.length;i++){
  809. _d2=_d0[i];
  810. if(_d2 instanceof String){
  811. _d2=null;
  812. }else{
  813. if(_d2&&_d2.destroy&&!_d2._beingDestroyed){
  814. _d2.destroy();
  815. }
  816. GUtil.destroyProperties(_d2);
  817. }
  818. }
  819. }else{
  820. if(_d0 instanceof Object){
  821. if(_d0._beingDestroyed){
  822. return;
  823. }
  824. var obj=_d0;
  825. obj._beingDestroyed=true;
  826. for(var _d5 in obj){
  827. _d2=obj[_d5];
  828. if(_d5==="_beingDestroyed"||_d5==="m_destroyed"||_d5==="_destroyed"||typeof _d2=="function"){
  829. continue;
  830. }
  831. if(_d2 instanceof Array){
  832. GUtil.destroyProperties(_d2);
  833. }else{
  834. if(_d2 instanceof Object){
  835. if(typeof _d2.destroy=="function"&&!_d2._destroyed&&(_d2!==CCognosViewer||_d1)){
  836. _d2.destroy();
  837. }
  838. }
  839. }
  840. delete obj[_d5];
  841. }
  842. }
  843. }
  844. };
  845. function CCognosViewerRequest(_d6){
  846. this.m_sAction="";
  847. this.m_oOptions=new CDictionary();
  848. this.m_oParams=new CDictionary();
  849. this.m_oFormFields=new CDictionary();
  850. this.m_sRequestType="ajax";
  851. this.m_callback=null;
  852. this.setAction(_d6);
  853. };
  854. CCognosViewerRequest.prototype.setCallback=function(_d7){
  855. this.m_callback=_d7;
  856. };
  857. CCognosViewerRequest.prototype.getCallback=function(){
  858. return this.m_callback;
  859. };
  860. CCognosViewerRequest.prototype.setRequestType=function(_d8){
  861. if(typeof _d8!="undefined"&&typeof _d8=="string"){
  862. if(_d8.match(/\ajax\b|\bpost\b|\bget\b/i)){
  863. this.m_sRequestType=_d8;
  864. }
  865. }
  866. };
  867. CCognosViewerRequest.prototype.getRequestType=function(){
  868. return this.m_sRequestType;
  869. };
  870. CCognosViewerRequest.prototype.addOption=function(_d9,_da){
  871. this.m_oOptions.add(_d9,_da);
  872. };
  873. CCognosViewerRequest.prototype.removeOption=function(_db){
  874. this.m_oOptions.remove(_db);
  875. };
  876. CCognosViewerRequest.prototype.addParameter=function(_dc,_dd){
  877. this.m_oParams.add(_dc,_dd);
  878. };
  879. CCognosViewerRequest.prototype.addFormField=function(_de,_df){
  880. this.m_oFormFields.add(_de,_df);
  881. };
  882. CCognosViewerRequest.prototype.getFormFields=function(){
  883. return this.m_oFormFields;
  884. };
  885. CCognosViewerRequest.prototype.getAction=function(){
  886. return this.m_sAction;
  887. };
  888. CCognosViewerRequest.prototype.getOption=function(_e0){
  889. return this.m_oOptions.get(_e0);
  890. };
  891. CCognosViewerRequest.prototype.getParameter=function(_e1){
  892. return this.m_oParams.get(_e1);
  893. };
  894. CCognosViewerRequest.prototype.hasOption=function(_e2){
  895. return this.m_oOptions.exists(_e2);
  896. };
  897. CCognosViewerRequest.prototype.hasParameter=function(_e3){
  898. return this.m_oParams.exists(_e3);
  899. };
  900. CCognosViewerRequest.prototype.setAction=function(_e4){
  901. this.m_sAction=_e4;
  902. };
  903. function XmlHttpObject(){
  904. this.m_formFields=new CDictionary();
  905. this.xmlHttp=XmlHttpObject.createRequestObject();
  906. this.m_requestIndicator=null;
  907. this.m_httpCallbacks={};
  908. this.m_asynch=true;
  909. this.m_headers=null;
  910. };
  911. XmlHttpObject.prototype.setHeaders=function(_e5){
  912. this.m_headers=_e5;
  913. };
  914. XmlHttpObject.prototype.getHeaders=function(){
  915. return this.m_headers;
  916. };
  917. XmlHttpObject.prototype.newRequest=function(){
  918. var _e6=new XmlHttpObject();
  919. _e6.init(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
  920. this.executeHttpCallback("newRequest");
  921. return _e6;
  922. };
  923. XmlHttpObject.prototype.abortHttpRequest=function(){
  924. if(this.xmlHttp!=null){
  925. this.xmlHttp.abort();
  926. this.xmlHttp=null;
  927. this.executeHttpCallback("cancel");
  928. this.m_httpCallbacks={};
  929. }
  930. };
  931. XmlHttpObject.prototype.cancel=function(){
  932. this.abortHttpRequest();
  933. };
  934. XmlHttpObject.prototype.executeHttpCallback=function(_e7){
  935. if(this.m_httpCallbacks&&this.m_httpCallbacks[_e7]){
  936. var _e8=this.concatResponseArguments(this.m_httpCallbacks.customArguments);
  937. var _e9=GUtil.generateCallback(this.m_httpCallbacks[_e7].method,_e8,this.m_httpCallbacks[_e7].object);
  938. _e9();
  939. return true;
  940. }
  941. return false;
  942. };
  943. XmlHttpObject.prototype.setCallbacks=function(_ea){
  944. if(!this.m_httpCallbacks){
  945. this.m_httpCallbacks={};
  946. }
  947. for(callback in _ea){
  948. this.m_httpCallbacks[callback]=_ea[callback];
  949. }
  950. };
  951. XmlHttpObject.prototype.getCallbacks=function(){
  952. return this.m_httpCallbacks;
  953. };
  954. XmlHttpObject.createRequestObject=function(){
  955. var _eb=null;
  956. if(window.XMLHttpRequest){
  957. _eb=new XMLHttpRequest();
  958. }else{
  959. if(window.ActiveXObject){
  960. _eb=new ActiveXObject("Msxml2.XMLHTTP");
  961. }else{
  962. }
  963. }
  964. return _eb;
  965. };
  966. XmlHttpObject.prototype.waitForXmlHttpResponse=function(){
  967. var _ec=this.xmlHttp;
  968. if(_ec&&_ec.readyState===4){
  969. if(_ec.status===200){
  970. this.httpSuccess();
  971. }else{
  972. this.httpError();
  973. }
  974. }else{
  975. }
  976. };
  977. XmlHttpObject.prototype.init=function(_ed,_ee,url,_f0){
  978. this.m_action=_ed;
  979. this.m_gateway=_ee;
  980. this.m_url=url;
  981. this.m_asynch=_f0;
  982. };
  983. XmlHttpObject.prototype.httpSuccess=function(){
  984. this.executeHttpCallback("postHttpRequest");
  985. this.executeHttpCallback("entryComplete");
  986. this.executeHttpCallback("complete");
  987. this.m_httpCallbacks=null;
  988. };
  989. XmlHttpObject.prototype.httpError=function(){
  990. this.executeHttpCallback("entryFault");
  991. this.executeHttpCallback("fault");
  992. this.m_httpCallbacks=null;
  993. };
  994. XmlHttpObject.prototype.forceSynchronous=function(){
  995. this.m_asynch=false;
  996. };
  997. XmlHttpObject.prototype.sendRequest=function(){
  998. this.sendHtmlRequest(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
  999. };
  1000. XmlHttpObject.prototype.sendHtmlRequest=function(_f1,_f2,url,_f4){
  1001. var _f5=this.xmlHttp;
  1002. if(_f5){
  1003. _f5.open(_f1,_f2,_f4);
  1004. if(_f4){
  1005. _f5.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
  1006. }else{
  1007. _f5.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
  1008. if(!isIE()){
  1009. _f5.onload=GUtil.generateCallback(this.httpSuccess,[],this);
  1010. _f5.onerror=GUtil.generateCallback(this.httpError,[],this);
  1011. }
  1012. }
  1013. _f5.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  1014. if(this.m_headers){
  1015. for(header in this.m_headers){
  1016. _f5.setRequestHeader(header,this.m_headers[header]);
  1017. }
  1018. }
  1019. this.executeHttpCallback("preHttpRequest");
  1020. var _f6=this.convertFormFieldsToUrl();
  1021. if(url){
  1022. _f6+=url;
  1023. }
  1024. _f5.send(_f6);
  1025. }
  1026. };
  1027. XmlHttpObject.prototype.getResponseXml=function(){
  1028. return (this.xmlHttp)?this.xmlHttp.responseXML:null;
  1029. };
  1030. XmlHttpObject.prototype.getResponseText=function(){
  1031. return (this.xmlHttp)?this.xmlHttp.responseText:"";
  1032. };
  1033. XmlHttpObject.prototype.getResponseHeader=function(_f7){
  1034. return (this.xmlHttp)?this.xmlHttp.getResponseHeader(_f7):null;
  1035. };
  1036. XmlHttpObject.prototype.getStatus=function(){
  1037. return this.xmlHttp.status;
  1038. };
  1039. XmlHttpObject.prototype.addFormField=function(_f8,_f9){
  1040. this.m_formFields.add(_f8,_f9);
  1041. };
  1042. XmlHttpObject.prototype.getFormFields=function(){
  1043. return this.m_formFields;
  1044. };
  1045. XmlHttpObject.prototype.getFormField=function(_fa){
  1046. return this.m_formFields.get(_fa);
  1047. };
  1048. XmlHttpObject.prototype.clearFormFields=function(){
  1049. this.m_formFields=new CDictionary();
  1050. };
  1051. XmlHttpObject.prototype.convertFormFieldsToUrl=function(){
  1052. var url="";
  1053. var _fc=this.m_formFields.keys();
  1054. for(var _fd=0;_fd<_fc.length;_fd++){
  1055. if(_fd>0){
  1056. url+="&";
  1057. }
  1058. url+=encodeURIComponent(_fc[_fd])+"="+encodeURIComponent(this.m_formFields.get(_fc[_fd]));
  1059. }
  1060. return url;
  1061. };
  1062. XmlHttpObject.prototype.concatResponseArguments=function(_fe){
  1063. var _ff=[this];
  1064. if(_fe){
  1065. _ff=_ff.concat(_fe);
  1066. }
  1067. return _ff;
  1068. };
  1069. function AsynchRequest(_100,_101){
  1070. AsynchRequest.baseConstructor.call(this);
  1071. this.m_gateway=_100;
  1072. this.m_webContentRoot=_101;
  1073. this.m_callbacks={};
  1074. this.m_soapFault=null;
  1075. this.m_faultDialog=null;
  1076. this.m_promptDialog=null;
  1077. this.m_logonDialog=null;
  1078. };
  1079. AsynchRequest.prototype=new XmlHttpObject();
  1080. AsynchRequest.baseConstructor=XmlHttpObject;
  1081. AsynchRequest.prototype.parent=XmlHttpObject.prototype;
  1082. AsynchRequest.prototype.getTracking=function(){
  1083. return "";
  1084. };
  1085. AsynchRequest.prototype.getConversation=function(){
  1086. return "";
  1087. };
  1088. AsynchRequest.prototype.getPrimaryAction=function(){
  1089. return "";
  1090. };
  1091. AsynchRequest.prototype.getActionState=function(){
  1092. return "";
  1093. };
  1094. AsynchRequest.prototype.getAsynchStatus=function(){
  1095. return "";
  1096. };
  1097. AsynchRequest.prototype.getResult=function(){
  1098. return null;
  1099. };
  1100. AsynchRequest.prototype.getSoapFault=function(){
  1101. return this.m_soapFault;
  1102. };
  1103. AsynchRequest.prototype.constructFaultEnvelope=function(){
  1104. return null;
  1105. };
  1106. AsynchRequest.prototype.getPromptHTMLFragment=function(){
  1107. return "";
  1108. };
  1109. AsynchRequest.prototype.isRAPWaitTrue=function(){
  1110. return false;
  1111. };
  1112. AsynchRequest.prototype.getRAPRequestCache=function(){
  1113. return null;
  1114. };
  1115. AsynchRequest.prototype.getMainConversation=function(){
  1116. return null;
  1117. };
  1118. AsynchRequest.prototype.getMainTracking=function(){
  1119. return null;
  1120. };
  1121. AsynchRequest.prototype.construct=function(){
  1122. };
  1123. AsynchRequest.prototype.executeCallback=function(_102){
  1124. if(this.m_callbacks[_102]){
  1125. var _103=this.concatResponseArguments(this.m_callbacks.customArguments);
  1126. var _104=GUtil.generateCallback(this.m_callbacks[_102].method,_103,this.m_callbacks[_102].object);
  1127. _104();
  1128. return true;
  1129. }
  1130. return false;
  1131. };
  1132. AsynchRequest.prototype.setCallbacks=function(_105){
  1133. if(!this.m_callbacks){
  1134. this.m_callbacks={};
  1135. }
  1136. for(callback in _105){
  1137. this.m_callbacks[callback]=_105[callback];
  1138. }
  1139. };
  1140. AsynchRequest.prototype.getCallbacks=function(){
  1141. return this.m_callbacks;
  1142. };
  1143. AsynchRequest.prototype.newRequest=function(){
  1144. var _106=this.construct();
  1145. _106.setHeaders(this.getHeaders());
  1146. if(this.getFormFields().exists("b_action")){
  1147. _106.addFormField("b_action",this.getFormField("b_action"));
  1148. }
  1149. if(this.getFormFields().exists("cv.catchLogOnFault")){
  1150. _106.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
  1151. }
  1152. _106.setPromptDialog(this.m_promptDialog);
  1153. _106.setFaultDialog(this.m_faultDialog);
  1154. _106.setLogonDialog(this.m_logonDialog);
  1155. _106.m_asynch=this.m_asynch;
  1156. if(this.m_callbacks.newRequest){
  1157. var _107=GUtil.generateCallback(this.m_callbacks.newRequest.method,[_106],this.m_callbacks.newRequest.object);
  1158. _107();
  1159. }
  1160. return _106;
  1161. };
  1162. AsynchRequest.prototype.success=function(){
  1163. var _108=this.getAsynchStatus();
  1164. switch(_108){
  1165. case "stillWorking":
  1166. case "working":
  1167. this.working();
  1168. break;
  1169. case "prompting":
  1170. this.prompting();
  1171. break;
  1172. case "fault":
  1173. case "complete":
  1174. case "conversationComplete":
  1175. this.complete();
  1176. break;
  1177. default:
  1178. this.complete();
  1179. break;
  1180. }
  1181. };
  1182. AsynchRequest.prototype.setFaultDialog=function(_109){
  1183. if(_109 instanceof IFaultDialog){
  1184. if(typeof console!="undefined"){
  1185. console.log("AsynchRequest.prototype.setFaultDialog is deprecated");
  1186. }
  1187. this.m_faultDialog=_109;
  1188. }else{
  1189. if(_109&&typeof console!="undefined"){
  1190. console.log("The parameter faultDialog must be an instance of IFaultDialog");
  1191. }
  1192. }
  1193. };
  1194. AsynchRequest.prototype.setPromptDialog=function(_10a){
  1195. if(_10a instanceof IPromptDialog){
  1196. if(typeof console!="undefined"){
  1197. console.log("AsynchRequest.prototype.setPromptDialog is deprecated");
  1198. }
  1199. this.m_promptDialog=_10a;
  1200. }else{
  1201. if(_10a&&typeof console!="undefined"){
  1202. console.log("The parameter promptDialog must be an instance of IPromptDialog");
  1203. }
  1204. }
  1205. };
  1206. AsynchRequest.prototype.setLogonDialog=function(_10b){
  1207. if(_10b instanceof ILogOnDialog){
  1208. if(typeof console!="undefined"){
  1209. console.log("AsynchRequest.prototype.setLogonDialog is deprecated");
  1210. }
  1211. this.m_logonDialog=_10b;
  1212. }else{
  1213. if(_10b&&typeof console!="undefined"){
  1214. console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
  1215. }
  1216. }
  1217. };
  1218. AsynchRequest.prototype.resubmitRequest=function(){
  1219. var _10c=this.newRequest();
  1220. _10c.m_formFields=this.m_formFields;
  1221. _10c.sendRequest();
  1222. return _10c;
  1223. };
  1224. AsynchRequest.prototype.sendRequest=function(){
  1225. var _10d=this;
  1226. var _10e={"complete":{"object":_10d,"method":_10d.successHandler},"fault":{"object":_10d,"method":_10d.errorHandler}};
  1227. this.init("POST",this.m_gateway,"",this.m_asynch);
  1228. this.executeCallback("preHttpRequest");
  1229. this.parent.setCallbacks.call(this,_10e);
  1230. this.parent.sendRequest.call(this);
  1231. };
  1232. AsynchRequest.prototype.errorHandler=function(){
  1233. this.executeCallback("postHttpRequest");
  1234. this.executeCallback("entryFault");
  1235. this.executeCallback("error");
  1236. };
  1237. AsynchRequest.prototype.successHandler=function(){
  1238. this.executeCallback("postHttpRequest");
  1239. if(typeof window["AsynchRequestPromptDialog"]!="undefined"&&window["AsynchRequestPromptDialog"]!=null){
  1240. window["AsynchRequestPromptDialog"].hide();
  1241. window["AsynchRequestPromptDialog"]=null;
  1242. }
  1243. if(this.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  1244. var _10f=this.getResponseText();
  1245. if(_10f.indexOf("<ERROR_CODE>CAM_PASSPORT_ERROR</ERROR_CODE>")!=-1){
  1246. this.passportTimeout();
  1247. }else{
  1248. if((_10f.indexOf("http-equiv=\"refresh\"")!=-1)||(_10f.indexOf("http-equiv='refresh'")!=-1)){
  1249. this.passportTimeout();
  1250. }else{
  1251. this.executeCallback("entryFault");
  1252. if(!this.executeCallback("fault")){
  1253. var _110=window.open("","","height=400,width=500");
  1254. if(_110!=null){
  1255. _110.document.write(_10f);
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }else{
  1261. this.m_soapFault=this.constructFaultEnvelope();
  1262. if(this.m_soapFault!=null){
  1263. var _111=XMLHelper_FindChildByTagName(this.m_soapFault,"CAM",true);
  1264. if(_111!=null&&XMLHelper_FindChildByTagName(_111,"promptInfo",true)){
  1265. this.passportTimeout();
  1266. }else{
  1267. this.fault();
  1268. }
  1269. }else{
  1270. this.success();
  1271. }
  1272. }
  1273. };
  1274. AsynchRequest.prototype.cancel=function(){
  1275. this.parent.cancel.call(this);
  1276. var _112=this.getFormField("m_tracking");
  1277. if(_112){
  1278. var _113=new XmlHttpObject();
  1279. _113.init("POST",this.m_gateway,"",false);
  1280. if(this.getFormField("cv.outputKey")){
  1281. _113.addFormField("b_action","cvx.high");
  1282. _113.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
  1283. _113.setHeaders(this.getHeaders());
  1284. }else{
  1285. _113.addFormField("b_action","cognosViewer");
  1286. }
  1287. _113.addFormField("cv.responseFormat","successfulRequest");
  1288. _113.addFormField("ui.action","cancel");
  1289. _113.addFormField("m_tracking",_112);
  1290. if(this.getFormField("cv.debugDirectory")){
  1291. _113.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
  1292. }
  1293. _113.sendRequest();
  1294. this.executeCallback("cancel");
  1295. }
  1296. };
  1297. AsynchRequest.prototype.working=function(){
  1298. this.executeCallback("working");
  1299. var _114=this.newRequest();
  1300. _114.addFormField("m_tracking",this.getTracking());
  1301. if(this.getFormField("cv.outputKey")){
  1302. _114.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
  1303. _114.addFormField("b_action","cvx.high");
  1304. }
  1305. if(this.isRAPWaitTrue()){
  1306. _114.m_formFields=this.m_formFields;
  1307. _114.addFormField("m_tracking",this.getTracking());
  1308. _114.addFormField("rapWait","true");
  1309. var _115=this.getRAPRequestCache();
  1310. if(_115!==null&&typeof _115!="undefined"){
  1311. _114.addFormField("rapRequestCache",_115);
  1312. }
  1313. var _116=this.getMainConversation();
  1314. if(_116){
  1315. _114.addFormField("mainConversation",_116);
  1316. }
  1317. var _117=this.getMainTracking();
  1318. if(_117){
  1319. _114.addFormField("mainTracking",_117);
  1320. }
  1321. }else{
  1322. _114.addFormField("ui.action","wait");
  1323. _114.addFormField("ui.primaryAction",this.getPrimaryAction());
  1324. _114.addFormField("cv.actionState",this.getActionState());
  1325. if(this.getFormField("ui.preserveRapTags")){
  1326. _114.addFormField("ui.preserveRapTags",this.getFormField("ui.preserveRapTags"));
  1327. }
  1328. if(this.getFormField("ui.backURL")){
  1329. _114.addFormField("ui.backURL",this.getFormField("ui.backURL"));
  1330. }
  1331. if(this.getFormField("errURL")){
  1332. _114.addFormField("errURL",this.getFormField("errURL"));
  1333. }
  1334. if(this.getFormField("cv.showFaultPage")){
  1335. _114.addFormField("cv.showFaultPage",this.getFormField("cv.showFaultPage"));
  1336. }
  1337. if(this.getFormField("cv.catchLogOnFault")){
  1338. _114.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
  1339. }
  1340. }
  1341. if(this.getFormField("bux")){
  1342. _114.addFormField("bux",this.getFormField("bux"));
  1343. }
  1344. if(this.getFormField("cv.debugDirectory")){
  1345. _114.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
  1346. }
  1347. _114.sendRequest();
  1348. };
  1349. AsynchRequest.prototype.prompting=function(){
  1350. this.executeCallback("entryComplete");
  1351. if(!this.executeCallback("prompting")){
  1352. if(this.m_promptDialog!=null){
  1353. this.showPromptPage();
  1354. }else{
  1355. if(typeof console!="undefined"){
  1356. console.log("An unhandled prompt response was returned: %o",this.xmlHttp);
  1357. }
  1358. }
  1359. }
  1360. this.executeCallback("postEntryComplete");
  1361. };
  1362. AsynchRequest.prototype.promptPageOkCallback=function(_118){
  1363. var _119=this.newRequest();
  1364. _119.addFormField("ui.action","forward");
  1365. _119.addFormField("m_tracking",this.getTracking());
  1366. _119.addFormField("ui.conversation",this.getConversation());
  1367. _119.addFormField("ui.primaryAction",this.getPrimaryAction());
  1368. _119.addFormField("cv.actionState",this.getActionState());
  1369. for(var _11a in _118){
  1370. _119.addFormField(_11a,_118[_11a]);
  1371. }
  1372. _119.sendRequest();
  1373. window["AsynchRequestObject"]=null;
  1374. };
  1375. AsynchRequest.prototype.promptPageCancelCallback=function(){
  1376. window["AsynchRequestPromptDialog"].hide();
  1377. this.complete();
  1378. };
  1379. AsynchRequest.prototype.showPromptPage=function(){
  1380. window["AsynchRequestObject"]=this;
  1381. window["AsynchRequestPromptDialog"]=this.m_promptDialog;
  1382. var _11b=this.m_promptDialog.getViewerId()==null?"":"?cv.id="+this.m_promptDialog.getViewerId();
  1383. window["AsynchRequestPromptDialog"].initialize(this.m_webContentRoot+"/rv/showStandalonePrompts.html"+_11b,400,400);
  1384. window["AsynchRequestPromptDialog"].show();
  1385. };
  1386. AsynchRequest.prototype.passportTimeout=function(){
  1387. this.executeCallback("entryFault");
  1388. if(!this.executeCallback("passportTimeout")){
  1389. if(this.m_logonDialog!=null){
  1390. this.m_logonDialog.show(response.getSoapFault());
  1391. }else{
  1392. if(typeof console!="undefined"){
  1393. console.log("An unhandled passport timeout fault was returned: %o",this.getSoapFault());
  1394. }
  1395. }
  1396. }
  1397. };
  1398. AsynchRequest.prototype.fault=function(){
  1399. this.executeCallback("entryFault");
  1400. if(!this.executeCallback("fault")){
  1401. if(this.m_faultDialog!=null){
  1402. this.m_faultDialog.show(this.getSoapFault());
  1403. }else{
  1404. if(typeof console!="undefined"){
  1405. console.log("An unhandled soap fault was returned: %o",this.getSoapFault());
  1406. }
  1407. }
  1408. }
  1409. };
  1410. AsynchRequest.prototype.complete=function(){
  1411. this.executeCallback("entryComplete");
  1412. this.executeCallback("complete");
  1413. this.executeCallback("postEntryComplete");
  1414. };
  1415. AsynchRequest.prototype.getSoapFaultCode=function(){
  1416. var _11c=this.constructFaultEnvelope();
  1417. if(_11c){
  1418. var _11d=XMLHelper_FindChildByTagName(_11c,"faultcode",true);
  1419. if(_11d!=null){
  1420. return XMLHelper_GetText(_11d);
  1421. }
  1422. }
  1423. return null;
  1424. };
  1425. AsynchRequest.prototype.getSoapFaultDetailMessageString=function(){
  1426. var _11e=this.constructFaultEnvelope();
  1427. if(_11e){
  1428. var _11f=XMLHelper_FindChildByTagName(_11e,"messageString",true);
  1429. if(_11f!=null){
  1430. return XMLHelper_GetText(_11f);
  1431. }
  1432. }
  1433. return null;
  1434. };
  1435. function AsynchDATARequest(_120,_121){
  1436. AsynchDATARequest.baseConstructor.call(this,_120,_121);
  1437. this.m_oResponseState=null;
  1438. this.m_sResponseState=null;
  1439. this.m_endOfStateIdx=-1;
  1440. this.cStatePrefix="<xml><state>";
  1441. this.cStateSuffix="</state></xml>";
  1442. };
  1443. AsynchDATARequest.prototype=new AsynchRequest();
  1444. AsynchDATARequest.baseConstructor=AsynchRequest;
  1445. AsynchDATARequest.prototype.getEndOfStateIdx=function(){
  1446. if(this.m_endOfStateIdx==-1){
  1447. var _122=this.getResponseText().substring(0,12);
  1448. if(_122==this.cStatePrefix){
  1449. this.m_endOfStateIdx=this.getResponseText().indexOf(this.cStateSuffix);
  1450. if(this.m_endOfStateIdx!=-1){
  1451. this.m_endOfStateIdx+=this.cStateSuffix.length;
  1452. }
  1453. }
  1454. }
  1455. return this.m_endOfStateIdx;
  1456. };
  1457. AsynchDATARequest.prototype.getResponseStateText=function(){
  1458. if(!this.m_sResponseState){
  1459. this.getResponseState();
  1460. }
  1461. return this.m_sResponseState;
  1462. };
  1463. AsynchDATARequest.prototype.getResponseState=function(){
  1464. if(this.m_oResponseState==null&&this.getEndOfStateIdx()!=-1){
  1465. this.m_sResponseState=this.getResponseText().substring(this.cStatePrefix.length,this.getEndOfStateIdx()-this.cStateSuffix.length);
  1466. if(this.m_sResponseState!=null){
  1467. this.m_sResponseState=xml_decode(this.m_sResponseState);
  1468. this.m_oResponseState=eval("("+this.m_sResponseState+")");
  1469. }
  1470. }
  1471. return this.m_oResponseState;
  1472. };
  1473. AsynchDATARequest.prototype.getAsynchStatus=function(){
  1474. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sStatus!="undefined"){
  1475. return this.getResponseState().m_sStatus;
  1476. }
  1477. return "unknown";
  1478. };
  1479. AsynchDATARequest.prototype.getTracking=function(){
  1480. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sTracking!="undefined"){
  1481. return this.getResponseState().m_sTracking;
  1482. }
  1483. return "";
  1484. };
  1485. AsynchDATARequest.prototype.getConversation=function(){
  1486. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sConversation!="undefined"){
  1487. return this.getResponseState().m_sConversation;
  1488. }
  1489. return "";
  1490. };
  1491. AsynchDATARequest.prototype.getPrimaryAction=function(){
  1492. if(this.getResponseState()!=null&&typeof this.getResponseState().envParams!="undefined"&&this.getResponseState().envParams["ui.primaryAction"]!="undefined"){
  1493. return this.getResponseState().envParams["ui.primaryAction"];
  1494. }
  1495. return "";
  1496. };
  1497. AsynchDATARequest.prototype.getActionState=function(){
  1498. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sActionState!="undefined"){
  1499. return this.getResponseState().m_sActionState;
  1500. }
  1501. return "";
  1502. };
  1503. AsynchDATARequest.prototype.getResult=function(){
  1504. if(this.getEndOfStateIdx()!=-1){
  1505. return this.getResponseText().substring(this.getEndOfStateIdx(),this.getResponseText().length);
  1506. }
  1507. return "";
  1508. };
  1509. AsynchDATARequest.prototype.getDebugLogs=function(){
  1510. if(this.getResponseState()!=null&&typeof this.getResponseState().debugLogs!="undefined"){
  1511. return this.getResponseState().debugLogs;
  1512. }
  1513. return "";
  1514. };
  1515. AsynchDATARequest.prototype.getPromptHTMLFragment=function(){
  1516. return this.getResult();
  1517. };
  1518. AsynchDATARequest.prototype.constructFaultEnvelope=function(){
  1519. if(this.m_soapFault==null){
  1520. var _123=this.getResponseState();
  1521. if(_123!=null){
  1522. if(_123.m_sSoapFault){
  1523. var _124=_123.m_sSoapFault;
  1524. this.m_soapFault=XMLBuilderLoadXMLFromString(_124);
  1525. }
  1526. }
  1527. }
  1528. return this.m_soapFault;
  1529. };
  1530. AsynchDATARequest.prototype.construct=function(){
  1531. var _125=new AsynchDATARequest(this.m_gateway,this.m_webContentRoot);
  1532. _125.setCallbacks(this.m_callbacks);
  1533. if(this.getFormFields().exists("cv.responseFormat")){
  1534. _125.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
  1535. }else{
  1536. _125.addFormField("cv.responseFormat","data");
  1537. }
  1538. return _125;
  1539. };
  1540. AsynchDATARequest.prototype.getEnvParam=function(_126){
  1541. var _127=this.getResponseState();
  1542. if(_127&&typeof _127.envParams!="undefined"&&typeof _127.envParams[_126]!="undefined"){
  1543. return _127.envParams[_126];
  1544. }
  1545. return null;
  1546. };
  1547. AsynchDATARequest.prototype.isRAPWaitTrue=function(){
  1548. var _128=this.getEnvParam("rapWait");
  1549. if(_128!=null){
  1550. return _128=="true"?true:false;
  1551. }
  1552. return false;
  1553. };
  1554. AsynchDATARequest.prototype.getRAPRequestCache=function(){
  1555. return this.getEnvParam("rapRequestCache");
  1556. };
  1557. AsynchDATARequest.prototype.getMainConversation=function(){
  1558. return this.getEnvParam("mainConversation");
  1559. };
  1560. AsynchDATARequest.prototype.getMainTracking=function(){
  1561. return this.getEnvParam("mainTracking");
  1562. };
  1563. function AsynchJSONRequest(_129,_12a){
  1564. AsynchJSONRequest.baseConstructor.call(this,_129,_12a);
  1565. this.m_jsonResponse=null;
  1566. };
  1567. AsynchJSONRequest.prototype=new AsynchRequest();
  1568. AsynchJSONRequest.baseConstructor=AsynchRequest;
  1569. AsynchJSONRequest.prototype.getJSONResponseObject=function(){
  1570. if(this.m_jsonResponse==null){
  1571. if(this.getResponseHeader("Content-type").indexOf("application/json")!=-1){
  1572. var text=this.getResponseText();
  1573. if(text!=null){
  1574. var _12c=this.removeInvalidCharacters(text);
  1575. this.m_jsonResponse=eval("("+_12c+")");
  1576. }
  1577. }
  1578. }
  1579. return this.m_jsonResponse;
  1580. };
  1581. AsynchJSONRequest.prototype.getTracking=function(){
  1582. var _12d=this.getJSONResponseObject();
  1583. if(_12d){
  1584. return _12d.tracking;
  1585. }
  1586. return "";
  1587. };
  1588. AsynchJSONRequest.prototype.getConversation=function(){
  1589. var _12e=this.getJSONResponseObject();
  1590. if(_12e){
  1591. return _12e.conversation;
  1592. }
  1593. return "";
  1594. };
  1595. AsynchJSONRequest.prototype.getAsynchStatus=function(){
  1596. var _12f=this.getJSONResponseObject();
  1597. if(_12f){
  1598. return _12f.status;
  1599. }
  1600. return "unknown";
  1601. };
  1602. AsynchJSONRequest.prototype.getPrimaryAction=function(){
  1603. var _130=this.getJSONResponseObject();
  1604. if(_130){
  1605. return _130.primaryAction;
  1606. }
  1607. return "";
  1608. };
  1609. AsynchJSONRequest.prototype.getActionState=function(){
  1610. var _131=this.getJSONResponseObject();
  1611. if(_131){
  1612. return _131.actionState;
  1613. }
  1614. return "";
  1615. };
  1616. AsynchJSONRequest.prototype.getDebugLogs=function(){
  1617. var _132=this.getJSONResponseObject();
  1618. if(_132){
  1619. return _132.debugLogs;
  1620. }
  1621. return "";
  1622. };
  1623. AsynchJSONRequest.prototype.isRAPWaitTrue=function(){
  1624. var _133=this.getJSONResponseObject();
  1625. if(_133){
  1626. return (_133.rapWait==="true");
  1627. }
  1628. return false;
  1629. };
  1630. AsynchJSONRequest.prototype.getRAPRequestCache=function(){
  1631. var _134=this.getJSONResponseObject();
  1632. if(_134){
  1633. var _135=_134.rapRequestCache;
  1634. if(_135!==null&&typeof _135!="undefined"){
  1635. return _135;
  1636. }
  1637. }
  1638. return null;
  1639. };
  1640. AsynchJSONRequest.prototype.getMainConversation=function(){
  1641. var _136=this.getJSONResponseObject();
  1642. if(_136){
  1643. return _136.mainConversation;
  1644. }
  1645. return null;
  1646. };
  1647. AsynchJSONRequest.prototype.getMainTracking=function(){
  1648. var _137=this.getJSONResponseObject();
  1649. if(_137){
  1650. return _137.mainTracking;
  1651. }
  1652. return null;
  1653. };
  1654. AsynchJSONRequest.prototype.getResult=function(){
  1655. var _138=this.getJSONResponseObject();
  1656. if(_138&&_138.json){
  1657. var _139=this.removeInvalidCharacters(_138.json);
  1658. return eval("("+_139+")");
  1659. }
  1660. return null;
  1661. };
  1662. AsynchJSONRequest.prototype.removeInvalidCharacters=function(text){
  1663. if(text){
  1664. text=text.replace(/(\n|\r|\t)+/g,"");
  1665. }
  1666. return text;
  1667. };
  1668. AsynchJSONRequest.prototype.getPromptHTMLFragment=function(){
  1669. var _13b=this.getJSONResponseObject();
  1670. if(_13b&&_13b.promptHTMLFragment){
  1671. return _13b.promptHTMLFragment;
  1672. }
  1673. return "";
  1674. };
  1675. AsynchJSONRequest.prototype.constructFaultEnvelope=function(){
  1676. if(this.m_soapFault==null){
  1677. var _13c=this.getJSONResponseObject();
  1678. if(_13c.status=="fault"){
  1679. this.m_soapFault=XMLBuilderLoadXMLFromString(_13c.fault);
  1680. }
  1681. }
  1682. return this.m_soapFault;
  1683. };
  1684. AsynchJSONRequest.prototype.construct=function(){
  1685. var _13d=new AsynchJSONRequest(this.m_gateway,this.m_webContentRoot);
  1686. _13d.setCallbacks(this.m_callbacks);
  1687. if(this.getFormFields().exists("cv.responseFormat")){
  1688. _13d.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
  1689. }else{
  1690. _13d.addFormField("cv.responseFormat","asynchJSON");
  1691. }
  1692. return _13d;
  1693. };
  1694. function IFaultDialog(){
  1695. };
  1696. IFaultDialog.prototype.show=function(){
  1697. if(typeof console!="undefined"){
  1698. console.log("Required method IFaultDialog:show not implemented.");
  1699. }
  1700. };
  1701. IFaultDialog.prototype.handleUnknownHTMLResponse=function(){
  1702. if(typeof console!="undefined"){
  1703. console.log("Required method IFaultDialog:handlerUnknownHTMLResponse not implemented.");
  1704. }
  1705. };
  1706. function ILogOnDialog(){
  1707. };
  1708. ILogOnDialog.prototype.show=function(_13e){
  1709. if(typeof console!="undefined"){
  1710. console.log("Required method ILogOnDialog:show not implemented.");
  1711. }
  1712. };
  1713. ILogOnDialog.prototype.handleUnknownHTMLResponse=function(_13f){
  1714. if(typeof console!="undefined"){
  1715. console.log("Required method ILogOnDialog:handleUnknownHTMLResponse not implemented.");
  1716. }
  1717. };
  1718. function IPromptDialog(){
  1719. };
  1720. IPromptDialog.prototype.initialize=function(url,_141,_142){
  1721. if(typeof console!="undefined"){
  1722. console.log("Required method IModalDialog:initialize not implemented.");
  1723. }
  1724. };
  1725. IPromptDialog.prototype.show=function(){
  1726. if(typeof console!="undefined"){
  1727. console.log("Required method IModalDialog:show not implemented.");
  1728. }
  1729. };
  1730. IPromptDialog.prototype.hide=function(){
  1731. if(typeof console!="undefined"){
  1732. console.log("Required method IModalDialog:hide not implemented.");
  1733. }
  1734. };
  1735. function IRequestHandler(){
  1736. };
  1737. IRequestHandler.prototype.preHttpRequest=function(_143){
  1738. if(typeof console!="undefined"){
  1739. console.log("Required method IRequestHandler:preHttpRequest not implemented.");
  1740. }
  1741. };
  1742. IRequestHandler.prototype.postHttpRequest=function(_144){
  1743. if(typeof console!="undefined"){
  1744. console.log("Required method IRequestHandler:postHttpRequest not implemented.");
  1745. }
  1746. };
  1747. IRequestHandler.prototype.postComplete=function(_145){
  1748. if(typeof console!="undefined"){
  1749. console.log("Required method IRequestHandler:postComplete not implemented.");
  1750. }
  1751. };
  1752. IRequestHandler.prototype.onComplete=function(_146){
  1753. if(typeof console!="undefined"){
  1754. console.log("Required method IRequestHandler:onComplete not implemented.");
  1755. }
  1756. };
  1757. IRequestHandler.prototype.onPostEntryComplete=function(_147){
  1758. if(typeof console!="undefined"){
  1759. console.log("Required method IRequestHandler:onPostEntryComplete not implemented.");
  1760. }
  1761. };
  1762. IRequestHandler.prototype.onFault=function(_148){
  1763. if(typeof console!="undefined"){
  1764. console.log("Required method IRequestHandler:onFault not implemented.");
  1765. }
  1766. };
  1767. IRequestHandler.prototype.onPrompting=function(_149){
  1768. if(typeof console!="undefined"){
  1769. console.log("Required method IRequestHandler:onPrompting not implemented.");
  1770. }
  1771. };
  1772. IRequestHandler.prototype.onWorking=function(_14a){
  1773. if(typeof console!="undefined"){
  1774. console.log("Required method IRequestHandler:onWorking not implemented.");
  1775. }
  1776. };
  1777. IRequestHandler.prototype.setWorkingDialog=function(_14b){
  1778. if(typeof console!="undefined"){
  1779. console.log("Required method IRequestHandler:setWorkingDialog not implemented.");
  1780. }
  1781. };
  1782. IRequestHandler.prototype.setRequestIndicator=function(_14c){
  1783. if(typeof console!="undefined"){
  1784. console.log("Required method IRequestHandler:setExecutionCursor not implemented.");
  1785. }
  1786. };
  1787. function IRequestIndicator(){
  1788. };
  1789. IRequestIndicator.prototype.show=function(){
  1790. if(typeof console!="undefined"){
  1791. console.log("Required method IRequestIndicator:show not implemented.");
  1792. }
  1793. };
  1794. IRequestIndicator.prototype.hide=function(){
  1795. if(typeof console!="undefined"){
  1796. console.log("Required method IRequestIndicator:hide not implemented.");
  1797. }
  1798. };
  1799. function BaseRequestHandler(oCV){
  1800. if(oCV){
  1801. this.m_oCV=oCV;
  1802. this.m_workingDialog=null;
  1803. this.m_requestIndicator=null;
  1804. this.m_faultDialog=null;
  1805. this.m_logOnDialog=null;
  1806. this.m_promptDialog=null;
  1807. this.m_httpRequestConfig=this.m_oCV.getConfig()&&this.m_oCV.getConfig().getHttpRequestConfig()?this.m_oCV.getConfig().getHttpRequestConfig():null;
  1808. }
  1809. };
  1810. BaseRequestHandler.prototype=new IRequestHandler();
  1811. BaseRequestHandler.prototype.onError=function(_14e){
  1812. };
  1813. BaseRequestHandler.prototype.onComplete=function(){
  1814. };
  1815. BaseRequestHandler.prototype.onPrompting=function(){
  1816. };
  1817. BaseRequestHandler.prototype.resubmitInSafeMode=function(){
  1818. };
  1819. BaseRequestHandler.prototype.massageHtmlBeforeDisplayed=function(){
  1820. };
  1821. BaseRequestHandler.prototype.onPostEntryComplete=function(){
  1822. this._processDelayedLoadingQueue();
  1823. };
  1824. BaseRequestHandler.prototype.getViewer=function(){
  1825. return this.m_oCV;
  1826. };
  1827. BaseRequestHandler.prototype.setDispatcherEntry=function(_14f){
  1828. this.m_oDispatcherEntry=_14f;
  1829. };
  1830. BaseRequestHandler.prototype.getDispatcherEntry=function(){
  1831. return this.m_oDispatcherEntry;
  1832. };
  1833. BaseRequestHandler.prototype.processInitialResponse=function(_150){
  1834. this.updateViewerState(_150);
  1835. };
  1836. BaseRequestHandler.prototype.setLogOnDialog=function(_151){
  1837. if(_151==null){
  1838. this.m_logOnDialog=null;
  1839. }else{
  1840. if(_151 instanceof ILogOnDialog){
  1841. this.m_logOnDialog=_151;
  1842. }else{
  1843. if(_151&&typeof console!="undefined"){
  1844. console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
  1845. }
  1846. }
  1847. }
  1848. };
  1849. BaseRequestHandler.prototype.setWorkingDialog=function(_152){
  1850. if(_152==null){
  1851. this.m_workingDialog=null;
  1852. }else{
  1853. if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getWorkingDialog()){
  1854. this.m_workingDialog=this.m_httpRequestConfig.getWorkingDialog();
  1855. }else{
  1856. if(_152 instanceof IRequestIndicator){
  1857. this.m_workingDialog=_152;
  1858. }else{
  1859. if(_152&&typeof console!="undefined"){
  1860. console.log("The parameter workingDialog must be an instance of IRequestIndicator");
  1861. }
  1862. }
  1863. }
  1864. }
  1865. };
  1866. BaseRequestHandler.prototype.getWorkingDialog=function(){
  1867. return this.m_workingDialog;
  1868. };
  1869. BaseRequestHandler.prototype.setRequestIndicator=function(_153){
  1870. if(_153==null){
  1871. this.m_requestIndicator=null;
  1872. }else{
  1873. if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getRequestIndicator()){
  1874. this.m_requestIndicator=this.m_httpRequestConfig.getRequestIndicator();
  1875. }else{
  1876. if(_153 instanceof IRequestIndicator){
  1877. this.m_requestIndicator=_153;
  1878. }else{
  1879. if(_153&&typeof console!="undefined"){
  1880. console.log("The parameter requestIndicator must be an instance of IRequestIndicator");
  1881. }
  1882. }
  1883. }
  1884. }
  1885. };
  1886. BaseRequestHandler.prototype.getRequestIndicator=function(){
  1887. return this.m_requestIndicator;
  1888. };
  1889. BaseRequestHandler.prototype.setFaultDialog=function(_154){
  1890. if(_154==null){
  1891. this.m_faultDialog=null;
  1892. }else{
  1893. if(_154 instanceof IFaultDialog){
  1894. this.m_faultDialog=_154;
  1895. }else{
  1896. if(_154&&typeof console!="undefined"){
  1897. console.log("The parameter faultDialog must be an instance of IFaultDialog");
  1898. }
  1899. }
  1900. }
  1901. };
  1902. BaseRequestHandler.prototype.setPromptDialog=function(_155){
  1903. if(_155==null){
  1904. this.m_promptDialog=null;
  1905. }else{
  1906. if(_155 instanceof IPromptDialog){
  1907. this.m_promptDialog=_155;
  1908. }else{
  1909. if(_155&&typeof console!="undefined"){
  1910. console.log("The parameter promptDialog must be an instance of IPromptDialog");
  1911. }
  1912. }
  1913. }
  1914. };
  1915. BaseRequestHandler.prototype.preHttpRequest=function(_156){
  1916. if(_156&&typeof _156.getFormField=="function"){
  1917. if(_156.getFormField("ui.action")!="wait"&&_156.getFormField("rapWait")!="true"){
  1918. if(this.m_requestIndicator){
  1919. this.m_requestIndicator.show();
  1920. }
  1921. }
  1922. }
  1923. };
  1924. BaseRequestHandler.prototype.postHttpRequest=function(_157){
  1925. if(_157&&typeof _157.getAsynchStatus=="function"){
  1926. var _158=_157.getAsynchStatus();
  1927. if(_158!="working"&&_158!="stillWorking"){
  1928. if(this.m_workingDialog){
  1929. this.m_workingDialog.hide();
  1930. }
  1931. if(this.m_requestIndicator){
  1932. this.m_requestIndicator.hide();
  1933. }
  1934. }
  1935. }else{
  1936. if(this.m_workingDialog){
  1937. this.m_workingDialog.hide();
  1938. }
  1939. if(this.m_requestIndicator){
  1940. this.m_requestIndicator.hide();
  1941. }
  1942. }
  1943. };
  1944. BaseRequestHandler.prototype.onFault=function(_159){
  1945. var oCV=this.getViewer();
  1946. if(this.m_workingDialog){
  1947. this.m_workingDialog.hide();
  1948. }
  1949. if(this.m_requestIndicator){
  1950. this.m_requestIndicator.hide();
  1951. }
  1952. if(typeof FaultDialog=="undefined"){
  1953. if(typeof console!="undefined"){
  1954. console.log("An unhandled fault was returned: %o",_159);
  1955. }
  1956. return;
  1957. }
  1958. if(!this.m_faultDialog){
  1959. this.m_faultDialog=new FaultDialog(this.getViewer());
  1960. }
  1961. if(_159&&_159.getResponseHeader&&_159.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  1962. this.m_faultDialog.handleUnknownHTMLResponse(_159.getResponseText());
  1963. }else{
  1964. if(_159&&_159.getSoapFault){
  1965. this.m_faultDialog.show(_159.getSoapFault());
  1966. }else{
  1967. if(oCV.getSoapFault()){
  1968. var _15b=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  1969. this.m_faultDialog.show(_15b);
  1970. oCV.setSoapFault("");
  1971. }else{
  1972. if(typeof console!="undefined"){
  1973. console.log("An unhandled fault was returned: %o",_159);
  1974. }
  1975. }
  1976. }
  1977. }
  1978. };
  1979. BaseRequestHandler.prototype.isAuthenticationFault=function(_15c){
  1980. var oCV=this.getViewer();
  1981. var _15e=null;
  1982. if(_15c&&_15c.getSoapFault){
  1983. _15e=_15c.getSoapFault();
  1984. }else{
  1985. if(oCV.getSoapFault()){
  1986. _15e=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  1987. }
  1988. }
  1989. if(_15e!=null){
  1990. var _15f=XMLHelper_FindChildByTagName(_15e,"CAM",true);
  1991. return (_15f!=null&&XMLHelper_FindChildByTagName(_15f,"promptInfo",true)!=null);
  1992. }
  1993. return false;
  1994. };
  1995. BaseRequestHandler.prototype.onPassportTimeout=function(_160){
  1996. var oCV=this.getViewer();
  1997. if(this.m_workingDialog){
  1998. this.m_workingDialog.hide();
  1999. }
  2000. if(this.m_requestIndicator){
  2001. this.m_requestIndicator.hide();
  2002. }
  2003. if(!this.m_logOnDialog){
  2004. this.m_logOnDialog=new LogOnDialog(this.getViewer());
  2005. }
  2006. if(_160&&_160.getResponseHeader&&_160.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  2007. var _162="";
  2008. if(_160.getResponseText){
  2009. _162=_160.getResponseText();
  2010. }
  2011. if((_162.indexOf("http-equiv=\"refresh\"")!=-1)||(_162.indexOf("http-equiv='refresh'")!=-1)){
  2012. this.m_logOnDialog.show(null);
  2013. }else{
  2014. this.m_logOnDialog.handleUnknownHTMLResponse(_162);
  2015. }
  2016. }else{
  2017. if(_160&&_160.getSoapFault){
  2018. this.m_logOnDialog.show(_160.getSoapFault());
  2019. }else{
  2020. if(oCV.getSoapFault()){
  2021. var _163=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  2022. this.m_logOnDialog.show(_163);
  2023. oCV.setSoapFault("");
  2024. }else{
  2025. if(typeof console!="undefined"){
  2026. console.log("BaseRequestHandler.prototype.onPassportTimeout: An unhandled authentication fault was returned: %o",_160);
  2027. }
  2028. }
  2029. }
  2030. }
  2031. };
  2032. BaseRequestHandler.prototype.onWorking=function(_164){
  2033. if(this.m_workingDialog){
  2034. var _165=_164&&typeof _164.getAsynchStatus=="function"&&_164.getAsynchStatus()=="stillWorking"?true:false;
  2035. if(!_165){
  2036. if(this.m_requestIndicator){
  2037. this.m_requestIndicator.hide();
  2038. }
  2039. this.m_workingDialog.show();
  2040. }
  2041. }
  2042. };
  2043. BaseRequestHandler.prototype.onCancel=function(){
  2044. if(this.m_workingDialog){
  2045. this.m_workingDialog.hide();
  2046. }
  2047. if(this.m_requestIndicator){
  2048. this.m_requestIndicator.hide();
  2049. }
  2050. var oCV=this.getViewer();
  2051. oCV.gbPromptRequestSubmitted=false;
  2052. this._processDelayedLoadingQueue();
  2053. };
  2054. BaseRequestHandler.prototype._processDelayedLoadingQueue=function(){
  2055. var oCV=this.getViewer();
  2056. if(oCV&&oCV.getViewerWidget()){
  2057. var _168=oCV.getViewerWidget();
  2058. if(_168.getLoadManager()){
  2059. _168.getLoadManager().processQueue();
  2060. }
  2061. }
  2062. };
  2063. BaseRequestHandler.prototype.onPrompting=function(_169){
  2064. var oCV=this.getViewer();
  2065. if(this.m_workingDialog){
  2066. this.m_workingDialog.hide();
  2067. }
  2068. if(this.m_requestIndicator){
  2069. this.m_requestIndicator.hide();
  2070. }
  2071. if(!this.m_promptDialog){
  2072. this.m_promptDialog=new PromptDialog(this.getViewer());
  2073. }
  2074. window["AsynchRequestObject"]=_169;
  2075. window["AsynchRequestPromptDialog"]=this.m_promptDialog;
  2076. var _16b="?cv.id="+oCV.getId();
  2077. window["AsynchRequestPromptDialog"].initialize(oCV.getWebContentRoot()+"/rv/showStandalonePrompts.html"+_16b,400,400);
  2078. window["AsynchRequestPromptDialog"].show();
  2079. };
  2080. BaseRequestHandler.prototype.processDATAReportResponse=function(_16c){
  2081. var oCV=this.getViewer();
  2082. if(!oCV||oCV.m_destroyed){
  2083. if(console){
  2084. console.warn("Tried to process a data response on an invalid CCognosViewer",oCV);
  2085. }
  2086. return;
  2087. }
  2088. var _16e=_16c.getResponseState();
  2089. if(!_16e){
  2090. this.resubmitInSafeMode();
  2091. }
  2092. if(this.loadReportHTML(_16c.getResult())===false){
  2093. this.resubmitInSafeMode();
  2094. }
  2095. this.updateViewerState(_16e);
  2096. };
  2097. BaseRequestHandler.prototype.updateViewerState=function(_16f){
  2098. var oCV=this.getViewer();
  2099. applyJSONProperties(oCV,_16f);
  2100. var _171=oCV.getStatus();
  2101. if(typeof oCV.envParams["ui.spec"]!="undefined"&&oCV.envParams["ui.spec"].indexOf("&lt;")===0){
  2102. oCV.envParams["ui.spec"]=xml_decode(oCV.envParams["ui.spec"]);
  2103. }
  2104. if(_171!="fault"){
  2105. if(oCV.envParams["rapReportInfo"]){
  2106. this._processRapReportInfo(oCV);
  2107. }
  2108. if(typeof _16f.clientunencodedexecutionparameters!="undefined"){
  2109. var _172=document.getElementById("formWarpRequest"+oCV.getId());
  2110. if(_172!=null&&typeof _172["clientunencodedexecutionparameters"]!="undefined"){
  2111. _172["clientunencodedexecutionparameters"].value=_16f.clientunencodedexecutionparameters;
  2112. }
  2113. if(typeof document.forms["formWarpRequest"]!="undefined"&&typeof document.forms["formWarpRequest"]["clientunencodedexecutionparameters"]!="undefined"){
  2114. document.forms["formWarpRequest"]["clientunencodedexecutionparameters"].value=_16f.clientunencodedexecutionparameters;
  2115. }
  2116. }
  2117. }else{
  2118. oCV.setTracking("");
  2119. }
  2120. };
  2121. BaseRequestHandler.prototype._processRapReportInfo=function(oCV){
  2122. if(oCV.envParams["rapReportInfo"]){
  2123. var _174=eval("("+oCV.envParams["rapReportInfo"]+")");
  2124. if(typeof RAPReportInfo!="undefined"){
  2125. var _175=new RAPReportInfo(_174,oCV);
  2126. oCV.setRAPReportInfo(_175);
  2127. }
  2128. }
  2129. };
  2130. BaseRequestHandler.prototype.loadReportHTML=function(_176){
  2131. if(!_176){
  2132. return true;
  2133. }
  2134. var oCV=this.getViewer();
  2135. if(window.IBM&&window.IBM.perf){
  2136. window.IBM.perf.log("viewer_gotHtml",oCV);
  2137. }
  2138. if(oCV.m_undoStack.length>0){
  2139. oCV.m_undoStack[oCV.m_undoStack.length-1].m_bRefreshPage=true;
  2140. }
  2141. oCV.pageNavigationObserverArray=[];
  2142. oCV.m_flashChartsObjectIds=[];
  2143. var _178=_176.replace(/<form[^>]*>/gi,"").replace(/<\/form[^>]*>/gi,"");
  2144. oCV.m_sHTML=_178;
  2145. oCV.setHasPrompts(false);
  2146. var id=oCV.getId();
  2147. var _17a=document.getElementById("RVContent"+id);
  2148. var _17b=document.getElementById("CVReport"+id);
  2149. if(window.gScriptLoader){
  2150. var _17c=oCV.getViewerWidget()?true:false;
  2151. var _17d=oCV.getViewerWidget()?document.getElementById("_"+oCV.getViewerWidget().iContext.widgetId+"_cv"):_17b;
  2152. _178=window.gScriptLoader.loadCSS(_178,_17d,_17c,id);
  2153. }
  2154. if(oCV.sBrowser=="ie"){
  2155. _178="<span style='display:none'>&nbsp;</span>"+_178;
  2156. }
  2157. _17b.innerHTML=_178;
  2158. this.massageHtmlBeforeDisplayed();
  2159. if(window.gScriptLoader){
  2160. var _17e=GUtil.generateCallback(oCV.showLoadedContent,[_17a],oCV);
  2161. oCV.m_resizeReady=false;
  2162. if(!window.gScriptLoader.loadAll(_17b,_17e,id,true)){
  2163. if(window.gScriptLoader.containsAjaxWarnings()){
  2164. return false;
  2165. }
  2166. }
  2167. }else{
  2168. _17a.style.display="block";
  2169. }
  2170. var _17f=document.querySelectorAll("button");
  2171. var _180=_17f.length;
  2172. for(var k=0;k<_180;k++){
  2173. var _182=_17f[k];
  2174. var id=_182.id;
  2175. var _183=id.match(/reprompt/);
  2176. if(_183){
  2177. var _184=_182.outerHTML;
  2178. var _185=_184.match(/layoutname="\w+"/);
  2179. if(_185!==null){
  2180. var _186=_185[0];
  2181. var _187=/".*"/;
  2182. var _188=_187.exec(_186);
  2183. if(oCV.getCurrentPromptControlFocus()==_188){
  2184. _182.focus();
  2185. oCV.setCurrentPromptControlFocus(null);
  2186. _182=null;
  2187. }
  2188. }else{
  2189. oCV.setCurrentPromptControlFocus(null);
  2190. _182=null;
  2191. }
  2192. }
  2193. }
  2194. oCV.updateOutputForA11ySupport();
  2195. this._clearFindState();
  2196. return true;
  2197. };
  2198. BaseRequestHandler.prototype._clearFindState=function(){
  2199. var oCV=this.getViewer();
  2200. var _18a=oCV.getState()&&oCV.getState().getFindState()?oCV.getState().getFindState():null;
  2201. if(_18a&&!_18a.findOnServerInProgress()){
  2202. oCV.getState().clearFindState();
  2203. }
  2204. };
  2205. BaseRequestHandler.prototype.showReport=function(){
  2206. var oCV=this.getViewer();
  2207. var _18c=document.getElementById("CVReport"+oCV.getId());
  2208. if(_18c){
  2209. _18c.style.display="";
  2210. }
  2211. };
  2212. BaseRequestHandler.prototype.postComplete=function(){
  2213. var oCV=this.getViewer();
  2214. if(oCV.shouldWriteNavLinks()){
  2215. oCV.writeNavLinks(oCV.getSecondaryRequests().join(" "));
  2216. }
  2217. if(oCV.getStatus()==="complete"){
  2218. oCV.m_undoStack=[new CognosViewerSession(oCV)];
  2219. }
  2220. };
  2221. BaseRequestHandler.prototype.onAsynchStatusUpdate=function(_18e){
  2222. if(this.m_httpRequestConfig){
  2223. var _18f=this.m_httpRequestConfig.getReportStatusCallback(_18e);
  2224. if(_18f){
  2225. _18f();
  2226. }
  2227. }
  2228. };
  2229. BaseRequestHandler.prototype.addCallbackHooks=function(){
  2230. if(!this.m_httpRequestConfig){
  2231. return;
  2232. }
  2233. this._addCallback("complete","onComplete");
  2234. this._addCallback("working","onWorking");
  2235. this._addCallback("prompting","onPrompting");
  2236. };
  2237. BaseRequestHandler.prototype._addCallback=function(_190,_191){
  2238. var _192=_190;
  2239. var _193=this[_191];
  2240. this[_191]=function(_194){
  2241. _193.apply(this,arguments);
  2242. var _195=null;
  2243. if(_194&&typeof _194.getAsynchStatus=="function"){
  2244. _195=_194.getAsynchStatus();
  2245. }else{
  2246. _195=_192=="complete"?this.getViewer().getStatus():_192;
  2247. }
  2248. if(_195=="stillWorking"){
  2249. return;
  2250. }
  2251. var _196=this.m_httpRequestConfig.getReportStatusCallback(_195);
  2252. if(typeof _196=="function"){
  2253. setTimeout(_196,10);
  2254. }
  2255. };
  2256. };
  2257. function ViewerBaseWorkingDialog(_197){
  2258. if(!_197){
  2259. return;
  2260. }
  2261. this.setCognosViewer(_197);
  2262. this.m_oCV=_197;
  2263. this.m_sNamespace=_197.getId();
  2264. this.m_sGateway=_197.getGateway();
  2265. this.m_UIBlacklist=null;
  2266. this.m_bUse=true;
  2267. this.m_bCancelSubmitted=false;
  2268. };
  2269. ViewerBaseWorkingDialog.prototype=new IRequestIndicator();
  2270. ViewerBaseWorkingDialog.prototype.setCognosViewer=function(oCV){
  2271. this.m_oCV=oCV;
  2272. };
  2273. ViewerBaseWorkingDialog.prototype.getCognosViewer=function(){
  2274. return this.m_oCV;
  2275. };
  2276. ViewerBaseWorkingDialog.prototype.getGateway=function(){
  2277. return this.m_sGateway;
  2278. };
  2279. ViewerBaseWorkingDialog.prototype.getNamespace=function(){
  2280. return this.m_sNamespace;
  2281. };
  2282. ViewerBaseWorkingDialog.prototype.cancelSubmitted=function(){
  2283. return this.m_bCancelSubmitted;
  2284. };
  2285. ViewerBaseWorkingDialog.prototype.setCancelSubmitted=function(_199){
  2286. this.m_bCancelSubmitted=_199;
  2287. };
  2288. ViewerBaseWorkingDialog.prototype.show=function(){
  2289. var _19a=document.getElementById(this.getContainerId());
  2290. if(_19a){
  2291. _19a.style.display="block";
  2292. this.enableCancelButton();
  2293. }else{
  2294. this.create();
  2295. }
  2296. var _19b=document.getElementById("reportBlocker"+this.m_oCV.getId());
  2297. if(_19b){
  2298. _19b.style.display="block";
  2299. }
  2300. };
  2301. ViewerBaseWorkingDialog.prototype.create=function(){
  2302. if(typeof document.body!="undefined"){
  2303. if(this.isModal()){
  2304. this.createModalWaitDialog();
  2305. }else{
  2306. this.createInlineWaitDialog();
  2307. }
  2308. }
  2309. };
  2310. ViewerBaseWorkingDialog.prototype.createContainer=function(_19c){
  2311. var _19d=document.createElement("div");
  2312. _19d.setAttribute("id",this.getContainerId());
  2313. _19d.className=_19c?"modalWaitPage":"inlineWaitPage";
  2314. return _19d;
  2315. };
  2316. ViewerBaseWorkingDialog.prototype.createModalWaitDialog=function(){
  2317. this._createBlocker();
  2318. var _19e=this.createContainer(true);
  2319. _19e.innerHTML=this.renderHTML();
  2320. _19e.style.zIndex="7002";
  2321. _19e.setAttribute("role","region");
  2322. _19e.setAttribute("aria-label",RV_RES.GOTO_WORKING);
  2323. document.body.appendChild(_19e);
  2324. var _19f=this.createModalIframeBackground();
  2325. document.body.appendChild(_19f);
  2326. var _1a0=0;
  2327. var _1a1=0;
  2328. if(typeof window.innerHeight!="undefined"){
  2329. _1a0=Math.round((window.innerHeight/2)-(_19e.offsetHeight/2));
  2330. _1a1=Math.round((window.innerWidth/2)-(_19e.offsetWidth/2));
  2331. }else{
  2332. _1a0=Math.round((document.body.clientHeight/2)-(_19e.offsetHeight/2));
  2333. _1a1=Math.round((document.body.clientWidth/2)-(_19e.offsetWidth/2));
  2334. }
  2335. _19e.style.bottom=_1a0+"px";
  2336. _19e.style.left=_1a1+"px";
  2337. _19f.style.left=_1a1-1+"px";
  2338. _19f.style.bottom=_1a0-1+"px";
  2339. _19f.style.width=_19e.offsetWidth+2+"px";
  2340. _19f.style.height=_19e.offsetHeight+2+"px";
  2341. };
  2342. ViewerBaseWorkingDialog.prototype._createBlocker=function(){
  2343. var _1a2=document.getElementById("reportBlocker"+this.m_oCV.getId());
  2344. if(_1a2){
  2345. return;
  2346. }
  2347. var _1a3=document.getElementById("mainViewerTable"+this.m_oCV.getId());
  2348. if(_1a3){
  2349. _1a2=document.createElement("div");
  2350. _1a3.parentNode.appendChild(_1a2);
  2351. _1a2.id="reportBlocker"+this.m_oCV.getId();
  2352. _1a2.style.zIndex="6001";
  2353. _1a2.style.position="absolute";
  2354. _1a2.style.top="0px";
  2355. _1a2.style.left="0px";
  2356. _1a2.style.width="100%";
  2357. _1a2.style.height="100%";
  2358. _1a2.style.display="none";
  2359. _1a2.style.opacity="0";
  2360. _1a2.style.backgroundColor="#FFFFFF";
  2361. _1a2.style.filter="alpha(opacity:0)";
  2362. }
  2363. };
  2364. ViewerBaseWorkingDialog.prototype.createInlineWaitDialog=function(){
  2365. var _1a4=this.m_oCV.getId();
  2366. var _1a5=document.getElementById("CVReport"+_1a4);
  2367. if(_1a5){
  2368. var _1a6=this.createContainer(false);
  2369. _1a6.innerHTML="<table width=\"100%\" height=\"100%\"><tr><td valign=\"middle\" align=\"center\" role=\"presentation\">"+this.renderHTML()+"</td></tr></table>";
  2370. _1a5.appendChild(_1a6);
  2371. }
  2372. };
  2373. ViewerBaseWorkingDialog.prototype.createModalIframeBackground=function(){
  2374. var _1a7=document.createElement("iframe");
  2375. var _1a8="..";
  2376. var oCV=this.getCognosViewer();
  2377. if(oCV!==null){
  2378. _1a8=oCV.getWebContentRoot();
  2379. }
  2380. _1a7.setAttribute("id",this.getContainerId()+"Iframe");
  2381. _1a7.setAttribute("title","Empty iframe");
  2382. _1a7.setAttribute("src",_1a8+"/common/images/spacer.gif");
  2383. _1a7.setAttribute("scrolling","no");
  2384. _1a7.setAttribute("frameborder","0");
  2385. _1a7.style.position="absolute";
  2386. _1a7.style.zIndex="6002";
  2387. _1a7.style.display="block";
  2388. return _1a7;
  2389. };
  2390. ViewerBaseWorkingDialog.prototype.updateCoords=function(_1aa,_1ab){
  2391. if(this.m_container!==null&&m_iframeBackground!==null){
  2392. var _1ac=0;
  2393. var _1ad=0;
  2394. if(typeof window.innerHeight!="undefined"){
  2395. _1ac=Math.round((window.innerHeight/2)-(_1aa.offsetHeight/2));
  2396. _1ad=Math.round((window.innerWidth/2)-(_1aa.offsetWidth/2));
  2397. }else{
  2398. _1ac=Math.round((document.body.clientHeight/2)-(_1aa.offsetHeight/2));
  2399. _1ad=Math.round((document.body.clientWidth/2)-(_1aa.offsetWidth/2));
  2400. }
  2401. _1aa.style.bottom=_1ac+"px";
  2402. _1aa.style.left=_1ad+"px";
  2403. _1ab.style.left=_1aa.style.left;
  2404. _1ab.style.bottom=_1aa.style.bottom;
  2405. _1ab.style.width=_1aa.offsetWidth+"px";
  2406. _1ab.style.height=_1aa.offsetHeight+"px";
  2407. }
  2408. };
  2409. ViewerBaseWorkingDialog.prototype.hide=function(){
  2410. var _1ae=document.getElementById(this.getContainerId());
  2411. if(_1ae){
  2412. _1ae.parentNode.removeChild(_1ae);
  2413. }
  2414. var _1af=document.getElementById(this.getContainerId()+"Iframe");
  2415. if(_1af){
  2416. _1af.parentNode.removeChild(_1af);
  2417. }
  2418. var _1b0=document.getElementById("reportBlocker"+this.m_oCV.getId());
  2419. if(_1b0){
  2420. _1b0.parentNode.removeChild(_1b0);
  2421. }
  2422. };
  2423. ViewerBaseWorkingDialog.prototype.isModal=function(){
  2424. var _1b1=this.m_oCV.getId();
  2425. var _1b2=document.getElementById("CVReport"+_1b1);
  2426. var _1b3=true;
  2427. if(_1b2&&_1b2.innerHTML===""){
  2428. _1b3=false;
  2429. }
  2430. return _1b3;
  2431. };
  2432. ViewerBaseWorkingDialog.prototype.disableCancelButton=function(_1b4){
  2433. };
  2434. ViewerBaseWorkingDialog.prototype.enableCancelButton=function(){
  2435. };
  2436. function FaultDialog(oCV){
  2437. this.m_oCV=oCV;
  2438. };
  2439. FaultDialog.prototype=new IFaultDialog();
  2440. FaultDialog.prototype.show=function(_1b6){
  2441. if(typeof console!="undefined"){
  2442. console.log("FaultDialog - an unhandled soap fault was returned: %o",_1b6);
  2443. }
  2444. };
  2445. FaultDialog.prototype.handleUnknownHTMLResponse=function(_1b7){
  2446. this.m_oCV.setTracking("");
  2447. this.m_oCV.setConversation("");
  2448. if(_1b7){
  2449. if(this.m_oCV.envParams["useAlternateErrorCodeRendering"]){
  2450. var _1b8=document.getElementsByTagName("head")[0];
  2451. var _1b9=_1b7.match(/<body[^>]*>([\s\S]*)<\/body>/im)[1];
  2452. var _1ba=/<script[^>]*>([\s\S]*?)<\/script>/igm;
  2453. var _1bb=_1ba.exec(_1b7);
  2454. while(_1bb!=null){
  2455. var _1bc=document.createElement("script");
  2456. _1bc.type="text/javascript";
  2457. var _1bd=_1bb[0].match(/src="([\s\S]*?)"/i);
  2458. if(_1bd==null){
  2459. _1bc.text=_1bb[1];
  2460. }else{
  2461. _1bc.src=_1bd[1];
  2462. }
  2463. _1b8.appendChild(_1bc);
  2464. _1bb=_1ba.exec(_1b7);
  2465. }
  2466. document.body.innerHTML=_1b9;
  2467. }else{
  2468. document.write(_1b7);
  2469. }
  2470. }
  2471. };
  2472. function LogOnDialog(oCV){
  2473. this.m_oCV=oCV;
  2474. };
  2475. LogOnDialog.prototype=new ILogOnDialog();
  2476. LogOnDialog.prototype.handleUnknownHTMLResponse=function(_1bf){
  2477. if(_1bf){
  2478. document.write(_1bf);
  2479. }
  2480. };
  2481. LogOnDialog.prototype.show=function(_1c0){
  2482. launchLogOnDialog(this.m_oCV.getId(),_1c0);
  2483. };
  2484. LogOnDialog.prototype.hide=function(){
  2485. };
  2486. function PromptDialog(oCV){
  2487. this.m_oCV=oCV;
  2488. this.m_dialogImpl=null;
  2489. };
  2490. PromptDialog.prototype=new IPromptDialog();
  2491. PromptDialog.prototype.initialize=function(url,_1c3,_1c4){
  2492. this.m_dialogImpl=new CModal("","",document.body,null,null,_1c3,_1c4,true,true,false,true,this.m_oCV.getWebContentRoot());
  2493. var _1c5=document.getElementById(CMODAL_CONTENT_ID);
  2494. _1c5.src=url;
  2495. };
  2496. PromptDialog.prototype.show=function(){
  2497. this.m_dialogImpl.show();
  2498. };
  2499. PromptDialog.prototype.hide=function(){
  2500. this.m_dialogImpl.hide();
  2501. destroyCModal();
  2502. };
  2503. function WorkingDialog(_1c6){
  2504. if(_1c6){
  2505. this.m_bSimpleWorkingDialog=false;
  2506. this.m_bShowCancelButton=(_1c6.getAdvancedServerProperty("VIEWER_JS_HIDE_CANCEL_BUTTON")=="true")?false:true;
  2507. WorkingDialog.baseConstructor.call(this,_1c6);
  2508. this.m_secondaryRequests=_1c6.getSecondaryRequests();
  2509. }
  2510. };
  2511. WorkingDialog.prototype=new ViewerBaseWorkingDialog();
  2512. WorkingDialog.baseConstructor=ViewerBaseWorkingDialog;
  2513. WorkingDialog.prototype.setSecondaryRequests=function(_1c7){
  2514. this.m_secondaryRequests=_1c7;
  2515. };
  2516. WorkingDialog.prototype._getSecondaryRequests=function(){
  2517. return this.m_secondaryRequests;
  2518. };
  2519. WorkingDialog.prototype.getIsSavedReport=function(){
  2520. return this.getCognosViewer().bIsSavedReport;
  2521. };
  2522. WorkingDialog.prototype.setSimpleWorkingDialogFlag=function(flag){
  2523. this.m_bSimpleWorkingDialog=flag;
  2524. };
  2525. WorkingDialog.prototype.getSimpleWorkingDialogFlag=function(){
  2526. return this.m_bSimpleWorkingDialog;
  2527. };
  2528. WorkingDialog.prototype.showDeliveryOptions=function(_1c9){
  2529. var _1ca=this.getNamespace();
  2530. var _1cb=document.getElementById("DeliveryOptionsVisible"+_1ca);
  2531. if(_1cb){
  2532. _1cb.style.display=(_1c9===false?"none":"block");
  2533. if(_1c9){
  2534. var _1cc=_1cb.getElementsByTagName("a");
  2535. for(var i=_1cc.length;i>0;i--){
  2536. if(_1cc[i]&&_1cc[i].getAttribute("tabIndex")=="0"){
  2537. _1cc[i].focus();
  2538. }
  2539. }
  2540. }
  2541. }
  2542. _1cb=document.getElementById("OptionsLinkSelected"+_1ca);
  2543. if(_1cb){
  2544. _1cb.style.display=(_1c9===false?"none":"block");
  2545. }
  2546. _1cb=document.getElementById("OptionsLinkUnselected"+_1ca);
  2547. if(_1cb){
  2548. _1cb.style.display=(_1c9===false?"block":"none");
  2549. }
  2550. };
  2551. WorkingDialog.prototype.renderHTML=function(){
  2552. var _1ce=this.getNamespace();
  2553. var _1cf=_1ce+"_workingMsg "+_1ce+"_workingMsg2";
  2554. var html="<table class=\"viewerWorkingDialog\" id=\"CVWaitTable"+_1ce+"\""+" role=\"presentation\">";
  2555. html+=("<tr>"+"<td align=\"center\">"+"<div tabIndex=\"0\" role=\"presentation\" aria-labelledby=\""+_1cf+"\""+" class=\"body_dialog_modal workingDialogDiv\">");
  2556. html+=this.renderFirstInnerTable();
  2557. html+=this.renderSecondInnerTable();
  2558. html+=("</div>"+"</td>"+"</tr>"+"</table>");
  2559. return html;
  2560. };
  2561. WorkingDialog.prototype.renderFirstInnerTable=function(){
  2562. var _1d1=this.getSimpleWorkingDialogFlag();
  2563. var _1d2=_1d1?RV_RES.GOTO_WORKING:RV_RES.RV_RUNNING;
  2564. var _1d3=this.m_sNamespace;
  2565. var _1d4="<table class=\"workingDialogInnerTable\" role=\"presentation\">"+"<tr>"+"<td valign=\"middle\">";
  2566. var _1d5=this.getCognosViewer().getSkin()+"/branding/";
  2567. _1d4+="<img src=\""+_1d5+"progress.gif\"";
  2568. if(isIE()){
  2569. _1d4+=" width=\"48\" height=\"48\" border=\"0\"";
  2570. }
  2571. _1d4+=" name=\"progress\"";
  2572. if(isIE()){
  2573. _1d4+=" align=\"top\"";
  2574. }
  2575. _1d4+=" alt=\"";
  2576. _1d4+=_1d2;
  2577. _1d4+="\"/></td>";
  2578. _1d4+="<td width=\"20\">&nbsp;</td>";
  2579. _1d4+="<td style=\"padding-top: 5px;\" class=\"tableText\">";
  2580. _1d4+="<span id=\""+_1d3+"_workingMsg\">";
  2581. _1d4+=_1d2;
  2582. _1d4+="</span>";
  2583. _1d4+="<br/><br/>";
  2584. var _1d6=this.getCognosViewer().envParams["cv.responseFormat"];
  2585. if(_1d1||this.isUIBlacklisted("RV_TOOLBAR_BUTTONS")||!this.deliverySectionIsNeeded()||(_1d6&&("qs"===_1d6||"fragment"===_1d6))){
  2586. _1d4+=RV_RES.RV_PLEASE_WAIT;
  2587. }else{
  2588. var _1d7=this.canShowDeliveryOptions();
  2589. if(_1d7){
  2590. _1d4+=this.optionLinkSelectedDiv();
  2591. _1d4+=this.optionLinkUnselectedDiv();
  2592. }else{
  2593. _1d4+=RV_RES.RV_PLEASE_WAIT;
  2594. }
  2595. }
  2596. _1d4+="</td></tr><tr><td colspan=\"3\">&nbsp;</td></tr></table>";
  2597. return _1d4;
  2598. };
  2599. WorkingDialog.prototype.optionLinkSelectedDiv=function(){
  2600. var _1d8="";
  2601. _1d8+="<div id=\"OptionsLinkSelected"+this.getNamespace()+"\" style=\"display: none\">";
  2602. _1d8+=RV_RES.RV_BUSY_OPTIONS_SELECTED;
  2603. _1d8+="</div>";
  2604. return _1d8;
  2605. };
  2606. WorkingDialog.prototype.optionLinkUnselectedDiv=function(){
  2607. var _1d9="";
  2608. var _1da=this.getNamespace();
  2609. var _1db="window.oCV"+_1da+".getWorkingDialog()";
  2610. _1d9+="<div id=\"OptionsLinkUnselected"+_1da+"\">";
  2611. _1d9+="<span id=\""+_1da+"_workingMsg2\">";
  2612. _1d9+=RV_RES.RV_BUSY_OPTIONS_UNSELECTED;
  2613. _1d9+="</span><br/>";
  2614. _1d9+="<a href=\"#\" class=\"deliveryOptionLink\" onclick=\"javascript:"+_1db+".showDeliveryOptions(true)\">";
  2615. _1d9+=RV_RES.RV_BUSY_OPTIONS_LINK;
  2616. _1d9+="</a></div>";
  2617. return _1d9;
  2618. };
  2619. WorkingDialog.prototype.canShowDeliveryOptions=function(){
  2620. var _1dc=this.getCognosViewer().envParams["ui.primaryAction"];
  2621. if("saveAs"!==_1dc&&"email"!==_1dc&&this.getIsSavedReport()){
  2622. return true;
  2623. }
  2624. return false;
  2625. };
  2626. WorkingDialog.prototype.isUIBlacklisted=function(item){
  2627. var _1de=this.getUIBlacklist();
  2628. for(var _1df in _1de){
  2629. if(_1de[_1df]===item){
  2630. return true;
  2631. }
  2632. }
  2633. return false;
  2634. };
  2635. WorkingDialog.prototype.getUIBlacklist=function(){
  2636. if(!this.m_UIBlacklist&&this.getCognosViewer().UIBlacklist){
  2637. this.m_UIBlacklist=this.getCognosViewer().UIBlacklist.split(" ");
  2638. }
  2639. return this.m_UIBlacklist;
  2640. };
  2641. WorkingDialog.prototype.deliverySectionIsNeeded=function(){
  2642. return !this._isSaveBlackListed()||!this._isSaveAsBlackListed()||!this._isEmailBlackListed();
  2643. };
  2644. WorkingDialog.prototype._isSaveBlackListed=function(){
  2645. return this.isUIBlacklisted("RV_TOOLBAR_BUTTONS_SAVE")||this.isUIBlacklisted("RV_WORKING_DIALOG_SAVE")||!this._hasSecondaryRequest("save");
  2646. };
  2647. WorkingDialog.prototype._isSaveAsBlackListed=function(){
  2648. return this.isUIBlacklisted("RV_TOOLBAR_BUTTONS_SAVEAS")||this.isUIBlacklisted("RV_WORKING_DIALOG_SAVEAS")||!this._hasSecondaryRequest("saveAs");
  2649. };
  2650. WorkingDialog.prototype._isEmailBlackListed=function(){
  2651. return this.isUIBlacklisted("RV_TOOLBAR_BUTTONS_SEND")||this.isUIBlacklisted("RV_WORKING_DIALOG_SEND")||!this._hasSecondaryRequest("email");
  2652. };
  2653. WorkingDialog.prototype.showCancelButton=function(){
  2654. return this.m_bShowCancelButton;
  2655. };
  2656. WorkingDialog.prototype._hasSecondaryRequest=function(_1e0){
  2657. var _1e1=this._getSecondaryRequests();
  2658. if(_1e1){
  2659. var _1e2=_1e1.length;
  2660. for(var i=0;i<_1e2;i++){
  2661. if(_1e1[i]==_1e0){
  2662. return true;
  2663. }
  2664. }
  2665. }
  2666. return false;
  2667. };
  2668. WorkingDialog.prototype.renderSecondInnerTable=function(){
  2669. var _1e4="";
  2670. var _1e5=this.getCognosViewer().getWebContentRoot();
  2671. _1e4+="<table width=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\">";
  2672. _1e4+="<tr id=\"DeliveryOptionsVisible"+this.getNamespace()+"\" class=\"workingDialogOptions\">";
  2673. _1e4+="<td align=\"left\">";
  2674. _1e4+="<table class=\"workingDialogInnerTable workingDialogLinks\" role=\"presentation\">";
  2675. var _1e6=this.canShowDeliveryOptions();
  2676. if(_1e6&&this.deliverySectionIsNeeded()){
  2677. if(!this._isSaveBlackListed()){
  2678. _1e4+=this.addDeliverOption("/rv/images/action_save_report_output.gif",RV_RES.RV_SAVE_REPORT,"SaveReport(true);");
  2679. }
  2680. if("reportView"!==this.getCognosViewer().envParams["ui.objectClass"]&&!this._isSaveAsBlackListed()){
  2681. _1e4+=this.addDeliverOption("/rv/images/action_save_report_view.gif",RV_RES.RV_SAVE_AS_REPORT_VIEW,"SaveAsReportView(true);");
  2682. }
  2683. if(!this.isUIBlacklisted("CC_RUN_OPTIONS_EMAIL_ATTACHMENT")&&!this._isEmailBlackListed()){
  2684. _1e4+=this.addDeliverOption("/rv/images/action_send_report.gif",RV_RES.RV_EMAIL_REPORT,"SendReport(true);");
  2685. }
  2686. }
  2687. _1e4+="</table></td></tr> ";
  2688. _1e4+="<tr style=\"padding-top: 5px\"> ";
  2689. _1e4+="<td align=\"left\" colspan=\"3\" id=\"cancelButtonContainer"+this.getNamespace()+"\"> ";
  2690. if(this.showCancelButton()){
  2691. _1e4+=this.addCancelButton();
  2692. }
  2693. _1e4+="</td></tr> ";
  2694. _1e4+="</table> ";
  2695. return _1e4;
  2696. };
  2697. WorkingDialog.prototype.addDeliverOption=function(_1e7,_1e8,_1e9){
  2698. var _1ea="";
  2699. var _1eb=this.getCognosViewer().getWebContentRoot();
  2700. var _1ec="javascript: window.oCV"+this.getNamespace()+".getRV().";
  2701. var _1ed=_1ec+_1e9;
  2702. _1ea+="<tr><td> ";
  2703. _1ea+="<a tabIndex=\"-1\" href=\""+_1e9+"\"> ";
  2704. _1ea+="<img border=\"0\" src=\""+_1eb+_1e7+"\" alt=\" "+html_encode(_1e8)+"\"/></a> ";
  2705. _1ea+="</td><td width=\"100%\" valign=\"middle\" class=\"tableText\"> ";
  2706. _1ea+="<a tabIndex=\"0\" role=\"link\" href=\"#\" onclick=\""+_1ed+"\" style=\"padding-left: 5px\" class=\"deliveryOptionLink\"> ";
  2707. _1ea+=(_1e8+"</a></td></tr>");
  2708. return _1ea;
  2709. };
  2710. WorkingDialog.prototype.addCancelButton=function(){
  2711. var _1ee="";
  2712. var _1ef=this.getCognosViewer().getWebContentRoot();
  2713. _1ee+="<table role=\"presentation\"><tr><td> ";
  2714. _1ee+="<table id=\"cvWorkingDialog"+this.getNamespace()+"\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" onmouseover=\"this.className = 'commandButtonOver'\" onmouseout=\"this.className = 'commandButton'\" onmousedown=\"this.className = 'commandButtonDown'\" class=\"commandButton\"> ";
  2715. _1ee+="<tr> ";
  2716. _1ee+="<td valign=\"middle\" align=\"center\" nowrap=\"nowrap\" class=\"workingDialogCancelButton\" ";
  2717. if(isIE()){
  2718. _1ee+="id=\"btnAnchorIE\" ";
  2719. }else{
  2720. _1ee+="id=\"btnAnchor\" ";
  2721. }
  2722. _1ee+="> ";
  2723. var _1f0="window.oCV"+this.m_sNamespace+".cancel(this)";
  2724. _1ee+="<a href=\"#\" onclick=\""+_1f0+"\"> ";
  2725. _1ee+=RV_RES.CANCEL;
  2726. _1ee+="</a> ";
  2727. _1ee+="</td></tr></table></td> ";
  2728. _1ee+="<td><img alt=\"\" height=\"1\" ";
  2729. if(isIE()){
  2730. _1ee+="width=\"10\" ";
  2731. }
  2732. _1ee+="src=\""+_1ef+"/ps/images/space.gif\"/></td> ";
  2733. _1ee+="</tr></table> ";
  2734. return _1ee;
  2735. };
  2736. WorkingDialog.prototype.disableCancelButton=function(_1f1){
  2737. this.cancelButtonDisabled=true;
  2738. var _1f2=document.getElementById("cvWorkingDialog"+this.getNamespace());
  2739. if(_1f2){
  2740. _1f2.style.cursor="default";
  2741. _1f2.className="commandButtonOver";
  2742. _1f2.removeAttribute("onmouseover");
  2743. _1f2.removeAttribute("onmouseout");
  2744. }
  2745. if(_1f1){
  2746. _1f1.removeAttribute("href");
  2747. _1f1.removeAttribute("onclick");
  2748. _1f1.style.cursor="default";
  2749. }
  2750. };
  2751. WorkingDialog.prototype.enableCancelButton=function(){
  2752. if(this.cancelButtonDisabled){
  2753. var _1f3=document.getElementById("cancelButtonContainer"+this.getNamespace());
  2754. if(_1f3){
  2755. _1f3.innerHTML=this.addCancelButton();
  2756. }
  2757. this.cancelButtonDisabled=false;
  2758. }
  2759. };
  2760. WorkingDialog.prototype.getContainerId=function(){
  2761. return "CVWait"+this.getNamespace();
  2762. };
  2763. function RequestExecutedIndicator(_1f4){
  2764. if(_1f4){
  2765. RequestExecutedIndicator.baseConstructor.call(this,_1f4);
  2766. }
  2767. };
  2768. RequestExecutedIndicator.baseConstructor=WorkingDialog;
  2769. RequestExecutedIndicator.prototype=new WorkingDialog();
  2770. RequestExecutedIndicator.prototype.renderHTML=function(){
  2771. var _1f5="<table id=\"CVWaitTable"+this.getNamespace()+"\" requestExecutionIndicator=\"true\" class=\"viewerWorkingDialog\" role=\"presentation\">";
  2772. _1f5+="<tr><td align=\"center\">";
  2773. _1f5+="<div class=\"body_dialog_modal\">";
  2774. _1f5+="<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" style=\"vertical-align:middle; text-align: left;\" role=\"presentation\">";
  2775. _1f5+="<tr><td rowspan=\"2\">";
  2776. _1f5+="<img alt=\""+RV_RES.GOTO_WORKING+"\" src=\""+this.getCognosViewer().getSkin()+"/branding/progress.gif\" style=\"margin:5px;\" width=\"48\" height=\"48\" name=\"progress\"/>";
  2777. _1f5+="</td><td nowrap=\"nowrap\"><span class=\"busyUpdatingStr\">";
  2778. _1f5+=RV_RES.GOTO_WORKING;
  2779. _1f5+="</span></td></tr><tr><td nowrap=\"nowrap\"><span class=\"busyUpdatingStr\">";
  2780. _1f5+=RV_RES.RV_PLEASE_WAIT;
  2781. _1f5+="</span></td></tr><tr><td style=\"height:7px;\" colspan=\"2\"></td></tr></table></div></td></tr></table>";
  2782. return _1f5;
  2783. };
  2784. RequestExecutedIndicator.prototype.getContainerId=function(){
  2785. return "CVWaitindicator"+this.getNamespace();
  2786. };
  2787. function RequestHandler(oCV){
  2788. if(oCV){
  2789. RequestHandler.baseConstructor.call(this,oCV);
  2790. }
  2791. };
  2792. RequestHandler.prototype=new BaseRequestHandler();
  2793. RequestHandler.baseConstructor=BaseRequestHandler;
  2794. RequestHandler.prototype.parent=BaseRequestHandler.prototype;
  2795. RequestHandler.prototype.resubmitInSafeMode=function(){
  2796. this.getViewer().resubmitInSafeMode(this.getDispatcherEntry());
  2797. };
  2798. RequestHandler.prototype.onComplete=function(_1f7){
  2799. this.parent.onComplete.call(this,_1f7);
  2800. this.processDATAReportResponse(_1f7);
  2801. this.postComplete();
  2802. };
  2803. RequestHandler.prototype.processInitialResponse=function(_1f8){
  2804. this.parent.processInitialResponse.call(this,_1f8);
  2805. var oCV=this.getViewer();
  2806. var _1fa=oCV.getStatus();
  2807. oCV.setMaxContentSize();
  2808. var _1fb=(oCV.isWorking(_1fa)||_1fa=="default");
  2809. if(_1fb){
  2810. if(oCV.getWorkingDialog()){
  2811. oCV.getWorkingDialog().show();
  2812. }
  2813. setTimeout(getCognosViewerObjectRefAsString(oCV.getId())+".executeCallback(\"wait\");",10);
  2814. }else{
  2815. if(_1fa=="fault"){
  2816. oCV.setSoapFault(_1f8.m_sSoapFault);
  2817. oCV.executeCallback("fault");
  2818. }else{
  2819. if(_1f8.status=="cancel"){
  2820. oCV.executeCallback("cancel");
  2821. }else{
  2822. oCV.updateSkipToReportLink();
  2823. if(oCV.envParams&&oCV.envParams["pinFreezeInfo"]){
  2824. var _1fc=oCV.getPinFreezeManager();
  2825. _1fc.fromJSONString(oCV.envParams["pinFreezeInfo"]);
  2826. delete oCV.envParams["pinFreezeInfo"];
  2827. }
  2828. if(_1fa!="prompting"||!oCV.executeCallback("prompt")){
  2829. this.postComplete();
  2830. }else{
  2831. oCV.updateSkipToNavigationLink(true);
  2832. }
  2833. }
  2834. }
  2835. }
  2836. this.showReport();
  2837. this.getViewer().renderTabs();
  2838. this.onAsynchStatusUpdate(_1fa);
  2839. };
  2840. RequestHandler.prototype.postComplete=function(){
  2841. this.parent.postComplete.call(this);
  2842. var oCV=this.getViewer();
  2843. var _1fe=document.getElementById("RVContent"+oCV.getId());
  2844. if(_1fe){
  2845. _1fe.scrollTop=0;
  2846. }
  2847. oCV.updateSkipToReportLink();
  2848. if(oCV.rvMainWnd){
  2849. oCV.updateLayout(oCV.getStatus());
  2850. if(!oCV.getUIConfig()||oCV.getUIConfig().getShowToolbar()){
  2851. var _1ff=oCV.rvMainWnd.getToolbar();
  2852. if(_1ff){
  2853. oCV.rvMainWnd.updateToolbar(oCV.outputFormat);
  2854. _1ff.draw();
  2855. }
  2856. }
  2857. if(!oCV.getUIConfig()||oCV.getUIConfig().getShowBanner()){
  2858. var _200=oCV.rvMainWnd.getBannerToolbar();
  2859. if(_200){
  2860. _200.draw();
  2861. }
  2862. }
  2863. }
  2864. if(oCV.getBrowser()=="moz"){
  2865. if(_1fe){
  2866. if(oCV.outputFormat=="XML"&&oCV.getStatus()!="prompting"){
  2867. _1fe.style.overflow="hidden";
  2868. }else{
  2869. _1fe.style.overflow="auto";
  2870. }
  2871. }
  2872. }
  2873. oCV.gbPromptRequestSubmitted=false;
  2874. this.showReport();
  2875. if(oCV.getPinFreezeManager()&&oCV.getPinFreezeManager().hasFrozenContainers()){
  2876. var _201=document.getElementById("CVReport"+oCV.getId());
  2877. if(_201){
  2878. setTimeout(function(){
  2879. oCV.getPinFreezeManager().renderReportWithFrozenContainers(_201);
  2880. if(isIE()){
  2881. oCV.repaintDiv(_1fe);
  2882. }
  2883. },1);
  2884. }
  2885. }
  2886. oCV.setMaxContentSize();
  2887. oCV.executeCallback("done");
  2888. oCV.doneLoading();
  2889. };
  2890. function ActionFormFields(_202){
  2891. this.m_dispatcherEntry=_202;
  2892. this.m_oCV=_202.getViewer();
  2893. };
  2894. ActionFormFields.prototype.addFormFields=function(){
  2895. var _203=this.m_dispatcherEntry;
  2896. var _204=_203.getAction();
  2897. _204.preProcess();
  2898. _203.addFormField("ui.action","modifyReport");
  2899. if(this.m_oCV.getModelPath()!==""){
  2900. _203.addFormField("modelPath",this.m_oCV.getModelPath());
  2901. if(typeof this.m_oCV.envParams["metaDataModelModificationTime"]!="undefined"){
  2902. _203.addFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
  2903. }
  2904. }
  2905. if(_204.doAddActionContext()===true){
  2906. var _205=_204.addActionContext();
  2907. _203.addFormField("cv.actionContext",_205);
  2908. if(window.gViewerLogger){
  2909. window.gViewerLogger.log("Action context",_205,"xml");
  2910. }
  2911. }
  2912. var _206=this.m_oCV.envParams["bux"]=="true";
  2913. if(_206){
  2914. _203.addFormField("cv.showFaultPage","false");
  2915. }else{
  2916. _203.addFormField("cv.showFaultPage","true");
  2917. }
  2918. _203.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  2919. _203.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  2920. _203.addDefinedFormField("modelPath",this.m_oCV.envParams["modelPath"]);
  2921. _203.addDefinedFormField("packageBase",this.m_oCV.envParams["packageBase"]);
  2922. _203.addDefinedFormField("rap.state",this.m_oCV.envParams["rap.state"]);
  2923. _203.addDefinedFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
  2924. _203.addDefinedFormField("ui.primaryAction",this.m_oCV.envParams["ui.primaryAction"]);
  2925. _203.addNonNullFormField("cv.debugDirectory",this.m_oCV.envParams["cv.debugDirectory"]);
  2926. _203.addNonNullFormField("ui.objectClass",this.m_oCV.envParams["ui.objectClass"]);
  2927. _203.addNonNullFormField("bux",this.m_oCV.envParams["bux"]);
  2928. _203.addNonNullFormField("baseReportModificationTime",this.m_oCV.envParams["baseReportModificationTime"]);
  2929. _203.addNonNullFormField("originalReport",this.m_oCV.envParams["originalReport"]);
  2930. var _207=this.m_oCV.getFlashChartOption();
  2931. if(_207!=null){
  2932. _203.addFormField("savedFlashChartOption",_207);
  2933. if(_207&&_204!=null&&typeof (_204.m_requestParams)!="undefined"&&typeof (_204.m_requestParams.targetType)!="undefined"){
  2934. var _208=false;
  2935. var _209=null;
  2936. if(typeof (_204.m_requestParams.targetType.targetType)!="undefined"){
  2937. _209=_204.m_requestParams.targetType.targetType;
  2938. }else{
  2939. _209=_204.m_requestParams.targetType;
  2940. }
  2941. if(_209.match("v2_")!=null||_209.match("_v2")!=null){
  2942. _208=true;
  2943. }else{
  2944. var _20a=this.m_oCV.getRAPReportInfo();
  2945. var _20b=_204.getSelectedReportInfo();
  2946. if(_20a&&_20b){
  2947. var _20c=_20a.getDisplayTypes(_20b.container);
  2948. if(_20c.match("v2_")!=null||_20c.match("_v2")!=null){
  2949. _208=true;
  2950. }
  2951. }
  2952. }
  2953. _203.addFormField("hasAVSChart",_208);
  2954. }else{
  2955. _203.addFormField("hasAVSChart",this.m_oCV.hasAVSChart());
  2956. }
  2957. }
  2958. var sEP=this.m_oCV.getExecutionParameters();
  2959. if(sEP){
  2960. _203.addFormField("executionParameters",encodeURIComponent(sEP));
  2961. }
  2962. _203.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
  2963. _203.addFormField("m_tracking",encodeURIComponent(this.m_oCV.getTracking()));
  2964. var sCAF=this.m_oCV.getCAFContext();
  2965. if(sCAF){
  2966. _203.addFormField("ui.cafcontextid",sCAF);
  2967. }
  2968. if(_204.forceRunSpecRequest()){
  2969. _203.addFormField("widget.forceRunSpec","true");
  2970. }
  2971. };
  2972. function ViewerDispatcher(){
  2973. this.m_activeRequest=null;
  2974. this.m_requestQueue=[];
  2975. this.m_bUsePageRequest=false;
  2976. };
  2977. ViewerDispatcher.prototype.getActiveRequest=function(){
  2978. return this.m_activeRequest;
  2979. };
  2980. ViewerDispatcher.prototype.setUsePageRequest=function(_20f){
  2981. this.m_bUsePageRequest=_20f;
  2982. };
  2983. ViewerDispatcher.prototype.getUsePageRequest=function(){
  2984. return this.m_bUsePageRequest;
  2985. };
  2986. ViewerDispatcher.prototype.dispatchRequest=function(_210){
  2987. if(this.m_activeRequest==null){
  2988. this.startRequest(_210);
  2989. }else{
  2990. if(_210.canBeQueued()==true){
  2991. this.m_requestQueue.push(_210);
  2992. }else{
  2993. if(window.cognosViewerDebug&&console&&console.warn){
  2994. console.warn("Warning! Dropped a dispatcher entry!");
  2995. }
  2996. }
  2997. }
  2998. };
  2999. ViewerDispatcher.prototype.startRequest=function(_211){
  3000. this.m_activeRequest=_211;
  3001. if(_211!=null){
  3002. _211.setUsePageRequest(this.m_bUsePageRequest);
  3003. _211.sendRequest();
  3004. }
  3005. };
  3006. ViewerDispatcher.prototype.cancelRequest=function(key){
  3007. for(var i=0;i<this.m_requestQueue.length;i++){
  3008. var _214=this.m_requestQueue[i];
  3009. if(_214.getKey()===key){
  3010. _214.setCallbacks({"onEntryComplete":null});
  3011. _214.cancelRequest(false);
  3012. this.m_requestQueue.splice(i,1);
  3013. i--;
  3014. }
  3015. }
  3016. if(this.m_activeRequest&&this.m_activeRequest.getKey()===key){
  3017. this.m_activeRequest.setCallbacks({"onEntryComplete":null});
  3018. this.m_activeRequest.cancelRequest(false);
  3019. this.requestComplete();
  3020. }
  3021. };
  3022. ViewerDispatcher.prototype.possibleUnloadEvent=function(){
  3023. if(this.m_activeRequest){
  3024. this.m_activeRequest.possibleUnloadEvent();
  3025. }
  3026. };
  3027. ViewerDispatcher.prototype.requestComplete=function(_215){
  3028. this.startRequest(this.nextRequest());
  3029. };
  3030. ViewerDispatcher.prototype.nextRequest=function(){
  3031. var _216=null;
  3032. if(this.m_requestQueue.length>0){
  3033. _216=this.m_requestQueue.shift();
  3034. if(_216.getKey()!=null){
  3035. while(this.m_requestQueue.length>0&&this.m_requestQueue[0].getKey()==_216.getKey()){
  3036. _216=this.m_requestQueue.shift();
  3037. }
  3038. }
  3039. }
  3040. return _216;
  3041. };
  3042. ViewerDispatcher.prototype.queueIsEmpty=function(){
  3043. return (this.m_requestQueue.length==0);
  3044. };
  3045. function DispatcherEntry(oCV){
  3046. this.m_oCV=oCV;
  3047. this.m_requestKey=null;
  3048. this.m_canBeQueued=false;
  3049. this.m_originalFormFields=null;
  3050. this.m_bUsePageRequest=false;
  3051. if(oCV){
  3052. if(!this.m_request){
  3053. this.m_request=new XmlHttpObject();
  3054. this.m_request.init("POST",this.m_oCV.getGateway(),"",true);
  3055. }
  3056. if(!this.m_requestHandler){
  3057. this.setRequestHandler(new BaseRequestHandler(oCV));
  3058. }
  3059. DispatcherEntry.prototype.setDefaultFormFields.call(this);
  3060. this.setCallbacks({"entryComplete":{"object":this,"method":this.onEntryComplete},"entryFault":{"object":this,"method":this.onEntryFault},"newRequest":{"object":this,"method":this.onNewRequest},"fault":{"object":this,"method":this.onFault},"error":{"object":this,"method":this.onError},"passportTimeout":{"object":this,"method":this.onPassportTimeout},"working":{"object":this,"method":this.onWorking},"prompting":{"object":this,"method":this.onPrompting},"preHttpRequest":{"object":this,"method":this.onPreHttpRequest},"postHttpRequest":{"object":this,"method":this.onPostHttpRequest},"postEntryComplete":{"object":this,"method":this.onPostEntryComplete}});
  3061. }
  3062. };
  3063. DispatcherEntry.prototype.setHeaders=function(_218){
  3064. this.m_request.setHeaders(_218);
  3065. };
  3066. DispatcherEntry.prototype.getHeaders=function(){
  3067. return this.m_request.getHeaders();
  3068. };
  3069. DispatcherEntry.prototype.setOriginalFormFields=function(_219){
  3070. this.m_originalFormFields=_219;
  3071. };
  3072. DispatcherEntry.prototype.getOriginalFormFields=function(){
  3073. return this.m_originalFormFields;
  3074. };
  3075. DispatcherEntry.prototype.setRequestHandler=function(_21a){
  3076. _21a.addCallbackHooks();
  3077. this.m_requestHandler=_21a;
  3078. };
  3079. DispatcherEntry.prototype.getRequestHandler=function(){
  3080. return this.m_requestHandler;
  3081. };
  3082. DispatcherEntry.prototype.setWorkingDialog=function(_21b){
  3083. if(this.getRequestHandler()){
  3084. this.m_requestHandler.setWorkingDialog(_21b);
  3085. }
  3086. };
  3087. DispatcherEntry.prototype.setRequestIndicator=function(_21c){
  3088. if(this.getRequestHandler()){
  3089. this.getRequestHandler().setRequestIndicator(_21c);
  3090. }
  3091. };
  3092. DispatcherEntry.prototype.forceSynchronous=function(){
  3093. this.getRequest().forceSynchronous();
  3094. };
  3095. DispatcherEntry.prototype.setUsePageRequest=function(_21d){
  3096. this.m_bUsePageRequest=_21d;
  3097. };
  3098. DispatcherEntry.prototype.getUsePageRequest=function(){
  3099. return this.m_bUsePageRequest;
  3100. };
  3101. DispatcherEntry.prototype.setDefaultFormFields=function(){
  3102. var _21e=this.getViewer().envParams;
  3103. this.addFormField("b_action","cognosViewer");
  3104. this.addFormField("cv.catchLogOnFault","true");
  3105. this.addDefinedNonNullFormField("protectParameters",_21e["protectParameters"]);
  3106. this.addDefinedNonNullFormField("ui.routingServerGroup",_21e["ui.routingServerGroup"]);
  3107. this.addDefinedNonNullFormField("cv.debugDirectory",_21e["cv.debugDirectory"]);
  3108. this.addDefinedNonNullFormField("cv.showFaultPage",_21e["cv.showFaultPage"]);
  3109. this.addDefinedNonNullFormField("cv.useRAPDrill",_21e["cv.useRAPDrill"]);
  3110. this.addDefinedNonNullFormField("container",_21e["container"]);
  3111. this.addNonEmptyStringFormField("cv.objectPermissions",_21e["cv.objectPermissions"]);
  3112. };
  3113. DispatcherEntry.prototype.getViewer=function(){
  3114. return this.m_oCV;
  3115. };
  3116. DispatcherEntry.prototype.prepareRequest=function(){
  3117. };
  3118. DispatcherEntry.addWidgetInfoToFormFields=function(_21f,_220){
  3119. if(_21f){
  3120. var _221=_21f.getBUXRTStateInfoMap();
  3121. if(_221){
  3122. _220.addFormField("cv.buxRTStateInfo",_221);
  3123. }
  3124. var _222=_21f.getDisplayName();
  3125. if(_222&&_222.length>0){
  3126. _220.addFormField("displayTitle",_222);
  3127. }
  3128. }
  3129. };
  3130. DispatcherEntry.prototype.canBeQueued=function(){
  3131. return this.m_canBeQueued;
  3132. };
  3133. DispatcherEntry.prototype.setCanBeQueued=function(_223){
  3134. this.m_canBeQueued=_223;
  3135. };
  3136. DispatcherEntry.prototype.getKey=function(){
  3137. return this.m_requestKey;
  3138. };
  3139. DispatcherEntry.prototype.setKey=function(key){
  3140. this.m_requestKey=key;
  3141. };
  3142. DispatcherEntry.prototype.setRequest=function(_225){
  3143. this.m_request=_225;
  3144. };
  3145. DispatcherEntry.prototype.getRequest=function(){
  3146. return this.m_request;
  3147. };
  3148. DispatcherEntry.prototype.setCallbacks=function(_226){
  3149. this.getRequest().setCallbacks(_226);
  3150. };
  3151. DispatcherEntry.prototype.getCallbacks=function(){
  3152. return this.getRequest().getCallbacks();
  3153. };
  3154. DispatcherEntry.prototype.sendRequest=function(){
  3155. this.prepareRequest();
  3156. var _227=this.getRequest().getFormFields();
  3157. var _228=_227.keys();
  3158. if(!this.m_originalFormFields){
  3159. this.m_originalFormFields=new CDictionary();
  3160. for(var _229=0;_229<_228.length;_229++){
  3161. this.m_originalFormFields.add(_228[_229],_227.get(_228[_229]));
  3162. }
  3163. }
  3164. this.getRequest().sendRequest();
  3165. };
  3166. DispatcherEntry.prototype.onNewRequest=function(_22a){
  3167. this.setRequest(_22a);
  3168. };
  3169. DispatcherEntry.prototype.retryRequest=function(){
  3170. var oCV=this.getViewer();
  3171. oCV.setRetryDispatcherEntry(null);
  3172. var _22c=this.getRequest().newRequest();
  3173. _22c.setHeaders(null);
  3174. this.setRequest(_22c);
  3175. var _22d=this.m_originalFormFields.keys();
  3176. for(var _22e=0;_22e<_22d.length;_22e++){
  3177. var _22f=_22d[_22e];
  3178. var _230=this.m_originalFormFields.get(_22f);
  3179. if(_22f=="cv.responseFormat"&&_230=="iWidget"){
  3180. this.addFormField("cv.responseFormat","data");
  3181. }else{
  3182. if(_22f=="ui.action"&&_230=="wait"){
  3183. this.addFormField("ui.action",this.m_originalFormFields.get("ui.primaryAction"));
  3184. }else{
  3185. if(_22f!="m_tracking"&&_22f!="cv.outputKey"){
  3186. this.addFormField(_22f,_230);
  3187. }
  3188. }
  3189. }
  3190. }
  3191. this.addFormField("widget.reloadToolbar","true");
  3192. if(this.m_oCV.getViewerWidget()){
  3193. this.addFormField("cv.buxCurrentUserRole",this.m_oCV.getViewerWidget().getUserRole());
  3194. }
  3195. this.addNonEmptyStringFormField("cv.objectPermissions",oCV.envParams["cv.objectPermissions"]);
  3196. this.addNonEmptyStringFormField("limitedInteractiveMode",oCV.envParams["limitedInteractiveMode"]);
  3197. this.m_oCV.getViewerDispatcher().dispatchRequest(this);
  3198. };
  3199. DispatcherEntry.prototype.abortHttpRequest=function(){
  3200. if(!this.m_bCancelCalled){
  3201. if(this.getRequestHandler()){
  3202. this.getRequestHandler().onCancel();
  3203. }
  3204. this.m_bCancelCalled=true;
  3205. this.getRequest().abortHttpRequest();
  3206. this.onEntryComplete();
  3207. }
  3208. };
  3209. DispatcherEntry.prototype.cancelRequest=function(_231){
  3210. if(!this.m_bCancelCalled){
  3211. this.m_bCancelCalled=true;
  3212. if(this.getRequestHandler()){
  3213. this.getRequestHandler().onCancel();
  3214. }
  3215. if(_231){
  3216. this.getRequest().forceSynchronous();
  3217. }
  3218. this.getRequest().cancel();
  3219. this.onEntryComplete();
  3220. }
  3221. };
  3222. DispatcherEntry.prototype.getFormFields=function(){
  3223. return this.m_request.getFormFields();
  3224. };
  3225. DispatcherEntry.prototype.getFormField=function(name){
  3226. if(this.m_request){
  3227. return this.m_request.getFormField(name);
  3228. }else{
  3229. return "";
  3230. }
  3231. };
  3232. DispatcherEntry.prototype.clearFormFields=function(){
  3233. this.m_request.clearFormFields();
  3234. };
  3235. DispatcherEntry.prototype.formFieldExists=function(name){
  3236. if(this.m_request){
  3237. return this.m_request.getFormFields().exists(name);
  3238. }
  3239. return false;
  3240. };
  3241. DispatcherEntry.prototype.removeFormField=function(name){
  3242. if(this.formFieldExists(name)){
  3243. this.m_request.getFormFields().remove(name);
  3244. }
  3245. };
  3246. DispatcherEntry.prototype.addFormField=function(name,_236){
  3247. this.m_request.addFormField(name,_236);
  3248. };
  3249. DispatcherEntry.prototype.addDefinedNonNullFormField=function(name,_238){
  3250. if(typeof _238!="undefined"&&_238!=null){
  3251. this.addFormField(name,_238);
  3252. }
  3253. };
  3254. DispatcherEntry.prototype.addDefinedFormField=function(name,_23a){
  3255. if(typeof _23a!="undefined"){
  3256. this.addFormField(name,_23a);
  3257. }
  3258. };
  3259. DispatcherEntry.prototype.addNonNullFormField=function(name,_23c){
  3260. if(_23c!=null){
  3261. this.addFormField(name,_23c);
  3262. }
  3263. };
  3264. DispatcherEntry.prototype.addNonEmptyStringFormField=function(name,_23e){
  3265. if(typeof _23e!="undefined"&&_23e!=null&&_23e!=""){
  3266. this.addFormField(name,_23e);
  3267. }
  3268. };
  3269. DispatcherEntry.prototype.onWorking=function(_23f,arg1){
  3270. if(this.getRequestHandler()){
  3271. this.getRequestHandler().onWorking(_23f);
  3272. }
  3273. };
  3274. DispatcherEntry.prototype.onFault=function(_241){
  3275. if(this.getRequestHandler()){
  3276. this.getRequestHandler().onFault(_241);
  3277. }
  3278. };
  3279. DispatcherEntry.prototype.onError=function(_242){
  3280. if(this.m_bCancelCalled){
  3281. return;
  3282. }
  3283. if(this.getRequestHandler()){
  3284. this.getRequestHandler().onError(_242);
  3285. }
  3286. };
  3287. DispatcherEntry.prototype.possibleUnloadEvent=function(){
  3288. this.setCallbacks({"error":{}});
  3289. };
  3290. DispatcherEntry.prototype.onPreHttpRequest=function(_243){
  3291. if(this.getRequestHandler()){
  3292. this.getRequestHandler().preHttpRequest(_243);
  3293. }
  3294. };
  3295. DispatcherEntry.prototype.onPostHttpRequest=function(_244){
  3296. if(this.getRequestHandler()){
  3297. this.getRequestHandler().postHttpRequest(_244);
  3298. }
  3299. };
  3300. DispatcherEntry.prototype.onPassportTimeout=function(_245){
  3301. if(this.getRequestHandler()){
  3302. this.getRequestHandler().onPassportTimeout(_245);
  3303. }
  3304. };
  3305. DispatcherEntry.prototype.onPrompting=function(_246){
  3306. if(this.getRequestHandler()){
  3307. this.getRequestHandler().onPrompting(_246);
  3308. }
  3309. };
  3310. DispatcherEntry.prototype.onEntryComplete=function(_247){
  3311. if(!this.m_oCV._beingDestroyed){
  3312. this.m_oCV.getViewerDispatcher().requestComplete(this);
  3313. }
  3314. };
  3315. DispatcherEntry.prototype.onEntryFault=function(_248){
  3316. this.m_oCV.setFaultDispatcherEntry(this);
  3317. this.m_oCV.resetViewerDispatcher();
  3318. if(!this.m_bCancelCalled){
  3319. this.m_oCV.setRetryDispatcherEntry(this);
  3320. }
  3321. };
  3322. DispatcherEntry.prototype.onCloseErrorDlg=function(){
  3323. var _249=this.getCallbacks();
  3324. if(_249["closeErrorDlg"]){
  3325. var _24a=GUtil.generateCallback(_249["closeErrorDlg"].method,[],_249["closeErrorDlg"].object);
  3326. _24a();
  3327. }
  3328. };
  3329. DispatcherEntry.prototype.onPostEntryComplete=function(){
  3330. if(this.getRequestHandler()){
  3331. this.getRequestHandler().onPostEntryComplete();
  3332. }
  3333. this.executeCallback("postComplete");
  3334. };
  3335. DispatcherEntry.prototype.executeCallback=function(_24b){
  3336. var _24c=this.getCallbacks();
  3337. if(_24c[_24b]){
  3338. var _24d=(_24c.customArguments)?[this,_24c.customArguments]:[this];
  3339. var _24e=GUtil.generateCallback(_24c[_24b].method,_24d,_24c[_24b].object);
  3340. _24e();
  3341. return true;
  3342. }
  3343. return false;
  3344. };
  3345. function DataDispatcherEntry(oCV){
  3346. if(oCV){
  3347. this.setRequest(new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot()));
  3348. }
  3349. DataDispatcherEntry.baseConstructor.call(this,oCV);
  3350. };
  3351. DataDispatcherEntry.prototype=new DispatcherEntry();
  3352. DataDispatcherEntry.baseConstructor=DispatcherEntry;
  3353. function JSONDispatcherEntry(oCV){
  3354. if(oCV){
  3355. this.setRequest(new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot()));
  3356. }
  3357. JSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
  3358. JSONDispatcherEntry.baseConstructor.call(this,oCV);
  3359. };
  3360. JSONDispatcherEntry.prototype=new DispatcherEntry();
  3361. JSONDispatcherEntry.baseConstructor=DispatcherEntry;
  3362. JSONDispatcherEntry.prototype.setDefaultFormFields=function(){
  3363. this.addFormField("cv.responseFormat","JSON");
  3364. };
  3365. function AsynchDataDispatcherEntry(oCV){
  3366. if(oCV){
  3367. var _252=new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot());
  3368. this.setRequest(_252);
  3369. AsynchDataDispatcherEntry.baseConstructor.call(this,oCV);
  3370. AsynchDataDispatcherEntry.prototype.setDefaultFormFields.call(this);
  3371. }
  3372. };
  3373. AsynchDataDispatcherEntry.prototype=new DispatcherEntry();
  3374. AsynchDataDispatcherEntry.baseConstructor=DispatcherEntry;
  3375. AsynchDataDispatcherEntry.prototype.setDefaultFormFields=function(){
  3376. this.addFormField("cv.responseFormat","data");
  3377. };
  3378. function AsynchJSONDispatcherEntry(oCV){
  3379. if(oCV){
  3380. var _254=new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot());
  3381. this.setRequest(_254);
  3382. AsynchJSONDispatcherEntry.baseConstructor.call(this,oCV);
  3383. AsynchJSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
  3384. }
  3385. };
  3386. AsynchJSONDispatcherEntry.prototype=new DispatcherEntry();
  3387. AsynchJSONDispatcherEntry.baseConstructor=DispatcherEntry;
  3388. AsynchJSONDispatcherEntry.prototype.setDefaultFormFields=function(){
  3389. this.addFormField("cv.responseFormat","asynchJSON");
  3390. };
  3391. function ReportDispatcherEntry(oCV){
  3392. ReportDispatcherEntry.baseConstructor.call(this,oCV);
  3393. if(oCV){
  3394. ReportDispatcherEntry.prototype.setDefaultFormFields.call(this);
  3395. this.setRequestHandler(new RequestHandler(oCV));
  3396. this.setWorkingDialog(oCV.getWorkingDialog());
  3397. this.setRequestIndicator(oCV.getRequestIndicator());
  3398. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onComplete}});
  3399. }
  3400. };
  3401. ReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
  3402. ReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
  3403. ReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
  3404. ReportDispatcherEntry.prototype.prepareRequest=function(){
  3405. var _256=this.getFormField("ui.action");
  3406. var _257=this.getViewer().getActionState();
  3407. if(_257!==""&&(_256=="wait"||_256=="forward"||_256=="back")){
  3408. this.addFormField("cv.actionState",_257);
  3409. }
  3410. var _258=["nextPage","previousPage","firstPage","lastPage","reportAction","cancel","wait"];
  3411. var _259=true;
  3412. for(var i=0;i<_258.length;i++){
  3413. if(_258[i]==_256){
  3414. _259=false;
  3415. break;
  3416. }
  3417. }
  3418. if(_259){
  3419. this.getViewer().clearTabs();
  3420. }
  3421. if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")&&this.getViewer().getStatus()!="prompting"){
  3422. this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
  3423. }
  3424. };
  3425. ReportDispatcherEntry.prototype.setDefaultFormFields=function(){
  3426. var oCV=this.getViewer();
  3427. var _25c=oCV.envParams;
  3428. this.addFormField("cv.id",oCV.getId());
  3429. if(_25c["cv.showFaultPage"]){
  3430. this.addFormField("cv.showFaultPage",_25c["cv.showFaultPage"]);
  3431. }else{
  3432. this.addFormField("cv.showFaultPage","false");
  3433. }
  3434. this.addDefinedNonNullFormField("ui.object",_25c["ui.object"]);
  3435. this.addDefinedNonNullFormField("ui.primaryAction",_25c["ui.primaryAction"]);
  3436. this.addDefinedNonNullFormField("ui.objectClass",_25c["ui.objectClass"]);
  3437. this.addNonEmptyStringFormField("specificationType",_25c["specificationType"]);
  3438. this.addNonEmptyStringFormField("cv.promptForDownload",_25c["cv.promptForDownload"]);
  3439. this.addNonEmptyStringFormField("ui.conversation",oCV.getConversation());
  3440. this.addNonEmptyStringFormField("m_tracking",oCV.getTracking());
  3441. var _25d=oCV.getExecutionParameters();
  3442. this.addNonEmptyStringFormField("executionParameters",_25d);
  3443. var sCAF=oCV.getCAFContext();
  3444. this.addDefinedNonNullFormField("ui.cafcontextid",sCAF);
  3445. };
  3446. ReportDispatcherEntry.prototype.onWorking=function(_25f,arg1){
  3447. var _261=_25f.getResponseState();
  3448. var _262=this.getRequestHandler();
  3449. if(_262){
  3450. var _263=_262.getWorkingDialog();
  3451. if(_263&&_263.setSecondaryRequests&&_261.m_aSecRequests){
  3452. _263.setSecondaryRequests(_261.m_aSecRequests);
  3453. }
  3454. }
  3455. DispatcherEntry.prototype.onWorking.call(this,_25f,arg1);
  3456. if(_262){
  3457. this.getRequestHandler().updateViewerState(_261);
  3458. }
  3459. };
  3460. ReportDispatcherEntry.prototype.onComplete=function(_264,arg1){
  3461. if(this.getRequestHandler()){
  3462. this.getRequestHandler().onComplete(_264);
  3463. }
  3464. };
  3465. function ViewerDispatcherEntry(oCV){
  3466. ViewerDispatcherEntry.baseConstructor.call(this,oCV);
  3467. if(oCV){
  3468. ViewerDispatcherEntry.prototype.setDefaultFormFields.call(this);
  3469. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting},"cancel":{"object":this,"method":this.onCancel}});
  3470. }
  3471. };
  3472. ViewerDispatcherEntry.prototype=new ReportDispatcherEntry();
  3473. ViewerDispatcherEntry.baseConstructor=ReportDispatcherEntry;
  3474. ViewerDispatcherEntry.prototype.parent=ReportDispatcherEntry.prototype;
  3475. ViewerDispatcherEntry.prototype.setDefaultFormFields=function(){
  3476. var oCV=this.getViewer();
  3477. var _268=oCV.envParams;
  3478. this.addFormField("cv.showFaultPage","true");
  3479. this.addDefinedNonNullFormField("cv.header",_268["cv.header"]);
  3480. this.addDefinedNonNullFormField("cv.toolbar",_268["cv.toolbar"]);
  3481. this.addDefinedNonNullFormField("ui.backURL",_268["ui.backURL"]);
  3482. this.addDefinedNonNullFormField("errURL",_268["ui.backURL"]);
  3483. this.addDefinedNonNullFormField("errURL",_268["ui.errURL"]);
  3484. this.addDefinedNonNullFormField("cv.catchLogOnFault","true");
  3485. this.addDefinedNonNullFormField("m_sessionConv",_268["m_sessionConv"]);
  3486. if(_268["m_session"]){
  3487. this.addFormField("m_session",_268["m_session"]);
  3488. this.addFormField("cv.ignoreState","true");
  3489. }
  3490. };
  3491. ViewerDispatcherEntry.prototype.prepareRequest=function(){
  3492. this.parent.prepareRequest.call(this);
  3493. if(this.getUsePageRequest()){
  3494. this.m_oCV.setKeepSessionAlive(true);
  3495. if(typeof this.m_oCV.envParams["cv.responseFormat"]!="undefined"&&this.m_oCV.envParams["cv.responseFormat"]!=null&&this.m_oCV.envParams["cv.responseFormat"]!=""){
  3496. this.addFormField("cv.responseFormat",this.m_oCV.envParams["cv.responseFormat"]);
  3497. }else{
  3498. if(this.getFormField("cv.responseFormat")!="view"){
  3499. this.addFormField("cv.responseFormat","page");
  3500. }
  3501. }
  3502. var _269=this.m_oCV.getPinFreezeManager();
  3503. if(_269&&_269.hasFrozenContainers()){
  3504. this.addFormField("pinFreezeInfo",_269.toJSONString());
  3505. }
  3506. if(this.m_oCV.envParams["cv.createCallback"]){
  3507. this.addFormField("cv.createCallback",this.m_oCV.envParams["cv.createCallback"]);
  3508. }
  3509. }
  3510. };
  3511. ViewerDispatcherEntry.prototype.sendRequest=function(){
  3512. if(this.getUsePageRequest()){
  3513. this.prepareRequest();
  3514. var _26a=this.buildRequestForm();
  3515. if(typeof document.progress!="undefined"){
  3516. setTimeout("document.progress.src=\""+this.m_oCV.getSkin()+"/branding/progress.gif"+"\";",1);
  3517. }
  3518. _26a.submit();
  3519. }else{
  3520. this.getViewer().closeContextMenuAndToolbarMenus();
  3521. this.parent.sendRequest.call(this);
  3522. }
  3523. };
  3524. ViewerDispatcherEntry.prototype.buildRequestForm=function(){
  3525. var oCV=this.getViewer();
  3526. var _26c=document.createElement("form");
  3527. _26c.setAttribute("id","requestForm");
  3528. _26c.setAttribute("name","requestForm");
  3529. _26c.setAttribute("method","post");
  3530. _26c.setAttribute("target","_self");
  3531. _26c.setAttribute("action",oCV.getGateway());
  3532. _26c.style.display="none";
  3533. document.body.appendChild(_26c);
  3534. var _26d=this.getRequest().getFormFields();
  3535. var _26e=_26d.keys();
  3536. for(var _26f=0;_26f<_26e.length;_26f++){
  3537. _26c.appendChild(this.createHiddenFormField(_26e[_26f],_26d.get(_26e[_26f])));
  3538. }
  3539. for(param in oCV.envParams){
  3540. if(!_26d.exists(param)&&param!="cv.actionState"){
  3541. _26c.appendChild(this.createHiddenFormField(param,oCV.envParams[param]));
  3542. }
  3543. }
  3544. return _26c;
  3545. };
  3546. ViewerDispatcherEntry.prototype.createHiddenFormField=function(name,_271){
  3547. var _272=document.createElement("input");
  3548. _272.setAttribute("type","hidden");
  3549. _272.setAttribute("name",name);
  3550. _272.setAttribute("id",name);
  3551. _272.setAttribute("value",_271);
  3552. return (_272);
  3553. };
  3554. ViewerDispatcherEntry.prototype.onCancel=function(){
  3555. var oCV=this.getViewer();
  3556. oCV.setStatus("complete");
  3557. if(this.getUsePageRequest()||!oCV.isReportRenderingDone()){
  3558. oCV.executeCallback("cancel");
  3559. }
  3560. };
  3561. ViewerDispatcherEntry.prototype.onFault=function(_274){
  3562. if(this.getViewer().callbackExists("fault")){
  3563. this.getViewer().setSoapFault(_274.getSoapFault());
  3564. this.getViewer().executeCallback("fault");
  3565. }else{
  3566. this.parent.onFault.call(this,_274);
  3567. }
  3568. };
  3569. ViewerDispatcherEntry.prototype.onComplete=function(_275){
  3570. var oCV=this.getViewer();
  3571. oCV.saveBackJaxInformation(_275);
  3572. if(oCV.isReportRenderingDone()){
  3573. this.getViewer().getSelectionController().resetSelections();
  3574. }
  3575. this.parent.onComplete.call(this,_275);
  3576. };
  3577. ViewerDispatcherEntry.prototype.onPrompting=function(_277){
  3578. var oCV=this.getViewer();
  3579. oCV.updateSkipToNavigationLink(true);
  3580. if(!oCV.executeCallback("prompt")){
  3581. this.onComplete(_277);
  3582. }
  3583. };
  3584. ViewerDispatcherEntry.prototype.onEntryComplete=function(_279){
  3585. if(this.getRequestHandler()){
  3586. this.getRequestHandler().setDispatcherEntry(this);
  3587. }
  3588. this.parent.onEntryComplete.call(this,_279);
  3589. };