12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069 |
- var CV_BACKGROUND_LAYER_ID = "CV_BACK";
- if (typeof window.gaRV_INSTANCES == "undefined")
- {
- window.gaRV_INSTANCES = [];
- }
- if (!window.gViewerLogger) {
- window.gViewerLogger = {
- log : function(hint, content, type) {},
- addContextInfo : function(selectionController) {}
- };
- }
- function CognosViewerSession(oCV)
- {
- this.m_sConversation = oCV.getConversation();
- this.m_sParameters = oCV.getExecutionParameters();
- this.m_envParams = {};
- applyJSONProperties(this.m_envParams, oCV.envParams);
- this.m_bRefreshPage = false;
- }
- function CCognosViewer(sId, sGateway)
- {
-
-
- if (typeof window.gCognosViewer == "undefined")
- {
- window.gCognosViewer = this;
- }
- if (typeof ViewerConfig == "function") {
- this.m_viewerConfig = new ViewerConfig();
- try {
- if (typeof window.getViewerConfiguration == "function") {
- this.m_viewerConfig.configure(window.getViewerConfiguration());
- }
- else if (window.parent && typeof window.parent.getViewerConfiguration == "function") {
- this.m_viewerConfig.configure(window.parent.getViewerConfiguration());
- }
- }
- catch(e) {
-
- }
- this.m_viewerUIConfig = this.m_viewerConfig.getUIConfig();
- }
- this.m_sActionState = "";
- this.m_bKeepSessionAlive = false;
-
- this.m_undoStack = [];
-
- this.m_aSecRequests = [];
-
- this.m_bDebug = false;
-
- this.m_sCAFContext = "";
-
- this.m_sContextInfoXML = "";
-
- this.m_sConversation = "";
-
- this.m_sStatus = "";
-
- this.m_sGateway = sGateway;
-
- this.m_sId = sId;
-
- this.m_sMetadataInfoXML = "";
-
- this.m_sParameters = "";
-
- this.m_sReportState = "";
- this.envParams = {};
-
- this.m_sTracking = "";
-
- this.m_sSoapFault = "";
-
- this.m_sWaitHTML = "";
-
- this.m_oDrillMgr = null;
-
- this.goDrillManager = null;
- this.m_oWorkingDialog = null;
- this.m_oRequestExecutedIndicator = null;
- this.m_bUseWorkingDialog = true;
-
- this.m_oSubscriptionManager = null;
-
- this.m_oCVMgr = null;
-
- this.m_bUseSafeMode = true;
- if (typeof CViewerManager == "function")
- {
- this.m_oCVMgr = new CViewerManager(this);
- }
- if (window.gaRV_INSTANCES)
- {
-
- var bFound = false;
- for (var iIndex=0; iIndex < window.gaRV_INSTANCES.length; iIndex++)
- {
- if (window.gaRV_INSTANCES[iIndex].m_sId == sId)
- {
- window.gaRV_INSTANCES[iIndex] = this;
- bFound = true;
- break;
- }
- }
- if (!bFound)
- {
- window.gaRV_INSTANCES = window.gaRV_INSTANCES.concat(this);
- }
- }
- this.m_bReportHasPrompts = false;
- this.m_viewerWidget = null;
- this.m_flashChartsObjectIds = [];
- this.m_raiseSharePromptEvent = true;
- this.m_actionFactory = null;
- this.m_calculationCache = {};
- this.m_drillTargets = [];
- this.m_reportRenderingDone = false;
- if (typeof PinFreezeManager !== "undefined") {
- this.m_pinFreezeManager = new PinFreezeManager(this);
- }
- if (typeof ViewerDispatcher !== "undefined") {
- this.m_viewerDispatcher = new ViewerDispatcher();
- }
- this.m_retryDispatcherEntry = null;
- this.m_RAPReportInfo=null;
- if (typeof ViewerState == "function") {
- this.m_viewerState = new ViewerState();
- }
- this.m_aInfoBar = null;
- }
- CCognosViewer.prototype.setScheduledMobileOutput = function(value) {
- this.m_mobileScheduledOutput = value;
- if (value) {
- this.m_sStatus = "complete";
- }
- };
- CCognosViewer.prototype.setTabInfo = function(tabsPaylaod) {
- this.m_tabsPayload = tabsPaylaod;
-
-
-
- if (this.m_tabsPayload && this.m_tabsPayload.tabs && this._keepTabSelected) {
- var found = false;
- for (var i=0; i < this.m_tabsPayload.tabs.length; i++) {
- var tab = this.m_tabsPayload.tabs[i];
- if (tab.id == this._keepTabSelected) {
- this.m_tabsPayload.currentTabId = this._keepTabSelected;
- break;
- }
- }
-
- this._keepTabSelected = null;
- }
- };
- CCognosViewer.prototype.setKeepTabSelected = function(tabId) {
- this._keepTabSelected = tabId;
- };
- CCognosViewer.prototype.getTabController = function() {
- return this.m_tabControl;
- };
- CCognosViewer.prototype.getCurrentlySelectedTab = function() {
- return this.m_currentlySelectedTab ? this.m_currentlySelectedTab : null;
- };
- CCognosViewer.prototype.deleteTabs = function() {
- if (this.m_tabControl) {
- this.m_tabControl.destroy();
- delete this.m_tabControl;
- this.m_tabControl = null;
- }
-
- this.m_tabsPayload = null;
- };
- CCognosViewer.prototype.renderTabs = function() {
- if (!this.m_tabsPayload) {
- return;
- }
-
- var viewingSavedOutput = this.isSavedOutput() && !this.m_mobileScheduledOutput;
-
- var navLinks = document.getElementById("CVNavLinks" + this.getId());
- if (navLinks || !this.shouldWriteNavLinks() || viewingSavedOutput) {
- var reportDiv = this.getReportDiv();
-
- this.m_bHasTabs = true;
-
-
-
- if (this.m_tabControl && this.m_tabControl.isSavedOutput() != viewingSavedOutput) {
- this.deleteTabs();
- }
-
- if (!this.m_tabControl) {
-
- if (this.getStatus() != "complete" && !viewingSavedOutput) {
- return;
- }
-
- var tr = document.createElement("tr");
- var containerTD = document.createElement("td");
- tr.appendChild(containerTD);
-
- var mainTR = document.getElementById("mainViewerTR" + this.getId());
- if (!mainTR) {
- return;
- }
-
- if (this.m_tabsPayload.position == "topLeft") {
- mainTR.parentNode.insertBefore(tr, mainTR);
- }
- else {
- mainTR.parentNode.appendChild(tr);
- }
-
-
- var tabContainer = null;
- if (this.m_viewerWidget) {
- tabContainer = this.m_viewerWidget.findContainerDiv().firstChild;
- }
- else {
- tabContainer = containerTD;
- }
-
- var oCV = this;
- if (viewingSavedOutput) {
- this.m_tabControl = new CognosTabControl(tabContainer, function(tabId) { oCV.switchSavedOutputTab(tabId, true); });
- this.switchSavedOutputTab(this.m_tabsPayload.currentTabId, false);
- }
- else {
- this.m_tabControl = new CognosTabControl(tabContainer, function(tabId) { oCV.switchTabs(tabId); });
- }
- if (this.m_viewerWidget) {
- this.m_tabControl.setSpaceSaverContainer(containerTD);
- this.m_tabControl.setScrollAttachNode(this.m_viewerWidget.findContainerDiv());
- this.m_tabControl.useAbsolutePosition(true);
- }
-
- this.m_tabControl.setIsSavedOutput(viewingSavedOutput);
-
-
-
-
- if (!window.gScriptLoader.m_bScriptLoaderCalled) {
- var content = document.getElementById("RVContent" + this.getId());
- var links = this._getNodesWithViewerId(content, "link", null);
- for (var i=0; i < links.length; i++) {
- window.gScriptLoader.moveLinks(links[i]);
- }
-
- window.gScriptLoader.loadStyles(content, this.getId());
-
- this.repaintDiv(content);
- }
- }
-
- if (this.getStatus() == "prompting") {
- this.previouslySelectedTab = null;
- this.m_tabControl.hide();
- }
- else {
- if (this.isHighContrast()) {
- this.m_tabControl.setHighContrast(true);
- }
- this.m_tabControl.render(this.m_tabsPayload);
-
- this.m_currentlySelectedTab = this.m_tabControl.getSelectedTabId();
-
-
- if (this.m_switchingToTabId && this.m_currentlySelectedTab != this.m_switchingToTabId) {
- this._removeTabContent(reportDiv.parentNode, this.m_switchingToTabId);
- this._removeTabContent(reportDiv.parentNode, this.m_currentlySelectedTab);
- if (navLinks) {
- this._removeTabContent(navLinks.parentNode, this.m_switchingToTabId);
- this._removeTabContent(navLinks.parentNode, this.m_currentlySelectedTab);
- }
- this.m_tabInfo = {};
- }
-
- this.m_switchingToTabId = null;
-
- reportDiv.setAttribute("tabId", this.m_currentlySelectedTab);
- if (navLinks) {
- navLinks.setAttribute("tabId", this.m_currentlySelectedTab);
- }
-
- if (isIE() && viewingSavedOutput && window.resizeIFrame && !this.m_viewerFragment && !this.m_viewerWidget) {
- window.resizeIFrame();
- }
- }
-
- this.setMaxContentSize();
- }
- else {
- var obj = this;
- setTimeout(function() { obj.renderTabs(); }, 100);
- }
-
- };
- CCognosViewer.prototype.cancelTabSwitch = function() {
- var reportDiv = this.getReportDiv();
- var tabCancelled = this.m_switchingToTabId;
- this.m_currentlySelectedTab = tabCancelled;
-
- this.m_tabControl.selectTab(this.previouslySelectedTab, false);
- this.switchTabs(this.previouslySelectedTab);
-
- if (reportDiv) {
- reportDiv.parentNode.removeChild(reportDiv);
- }
-
- if (this.m_tabInfo[this.m_currentlySelectedTab] && this.m_tabInfo[this.m_currentlySelectedTab].styles) {
- this._addTabStylesToHead(this.m_tabInfo[this.m_currentlySelectedTab].styles);
- }
-
- this.previouslySelectedTab = null;
- this.m_tabInfo[tabCancelled] = null;
- };
- CCognosViewer.prototype.switchSavedOutputTab = function(tabId, userInvoked) {
-
- var selectionController = this.getSelectionController();
- if (selectionController) {
- selectionController.clearSelectedObjects();
- }
-
- this.m_currentlySelectedTab = this.m_tabControl.getSelectedTabId();
-
- if (userInvoked) {
- this.notifyTabChange(tabId);
- }
-
- if (this.m_viewerWidget) {
- this.m_viewerWidget.getSavedOutput().switchSavedOutputTab(tabId, userInvoked);
- this.getTabController().resetPosition();
- }
- else {
- if (!this.savedOutputTabNodes) {
- var iframe = document.getElementById("CVIFrame" + this.getId());
- this.savedOutputTabNodes = getElementsByAttribute(iframe.contentWindow.document.body, "*", "tabid");
- }
-
- if (!this.savedOutputTabNodes) {
- return;
- }
-
-
- for (var i=0; i < this.savedOutputTabNodes.length; i++) {
- var table = this.savedOutputTabNodes[i];
- table.style.display = table.getAttribute("tabid") == tabId ? "" : "none";
- }
-
- this.setMaxContentSize();
- }
- };
- CCognosViewer.prototype.notifyTabChange = function(newTabId) {
-
- };
- CCognosViewer.prototype._getNodesWithViewerId = function(parentNode, nodeName, id) {
- var result = [];
-
- var nodes = parentNode.getElementsByTagName(nodeName);
-
-
- for (var i=0; i < nodes.length; i++) {
- var node = nodes[i];
- if (!id || (node.getAttribute && node.getAttribute("namespaceId") == id)) {
- node.parentNode.removeChild(node);
- result.push(node);
- i--;
- }
- }
- return result;
- };
- CCognosViewer.prototype._removeTabStylesFromHead = function() {
- var id = this.getId();
-
- return this._getNodesWithViewerId(document.getElementsByTagName("head").item(0), "style", id);
- };
-
- CCognosViewer.prototype._addTabStylesToHead = function(tabStyles) {
- if (!tabStyles) {
- return;
- }
-
- for (var i=0; i < tabStyles.length; i++) {
- document.getElementsByTagName("head").item(0).appendChild(tabStyles[i]);
- }
- };
- CCognosViewer.prototype.switchTabs = function(tabId) {
-
- if (this.m_currentlySelectedTab == tabId) {
- return;
- }
-
- var selectionController = this.getSelectionController();
- if (selectionController) {
- selectionController.clearSelectedObjects();
- }
- var reportDiv = this.getReportDiv();
-
- this.m_nReportDiv = null;
-
-
- var oldDivHeight = reportDiv.clientHeight;
-
-
- reportDiv.removeAttribute("id");
- reportDiv.style.display = "none";
-
- if (!this.m_tabInfo) {
- this.m_tabInfo = {};
- }
-
- var removedStyles = this._removeTabStylesFromHead();
- var dataManager = this.getSelectionController().getCCDManager();
- this.m_tabInfo[this.m_currentlySelectedTab] = {
- "conversation" : this.getConversation(),
- "metadata" : dataManager.getClonedMetadataArray(),
- "contextdata" : dataManager.getClonedContextdataArray(),
- "secondaryRequests" : this.getSecondaryRequests(),
- "styles" : removedStyles,
- "hasPromptControl" : this.getHasPrompts()
- };
- var tabContentDiv = this._findChildWithTabId(reportDiv.parentNode, tabId);
-
- this.previouslySelectedTab = this.m_currentlySelectedTab;
-
-
-
- if (tabContentDiv && this.m_tabInfo[tabId] && this.m_tabInfo[tabId].hasPromptControl) {
- if (tabContentDiv) {
- tabContentDiv.parentNode.removeChild(tabContentDiv);
- tabContentDiv = null;
- }
-
- delete this.m_tabInfo[tabId];
- this.m_tabInfo[tabId] = null;
- }
-
-
- if (tabContentDiv) {
- this.m_currentlySelectedTab = tabId;
-
- tabContentDiv.style.display = "block";
- tabContentDiv.setAttribute("id", "CVReport" + this.getId());
-
- if (this.m_tabInfo && this.m_tabInfo[tabId]) {
- var tabInfo = this.m_tabInfo[tabId];
- if (tabInfo.conversation) {
- this.setConversation(tabInfo.conversation);
- }
-
- if (tabInfo.metadata) {
- dataManager.SetMetadata(tabInfo.metadata);
- }
-
- if (tabInfo.contextdata) {
- dataManager.SetContextData(tabInfo.contextdata);
- }
-
- if (tabInfo.secondaryRequests) {
- this.setSecondaryRequests(tabInfo.secondaryRequests);
- }
-
- if (tabInfo.styles) {
- this._addTabStylesToHead(tabInfo.styles);
- }
-
- this.setHasPrompts(tabInfo.hasPromptControl);
- }
-
- if (this.shouldWriteNavLinks()) {
- this.writeNavLinks(this.getSecondaryRequests().join(" "));
- }
-
- if (this.getPinFreezeManager() && this.getPinFreezeManager().hasFrozenContainers()) {
- this.getPinFreezeManager().rePaint();
-
-
- if (isIE()) {
- var oRVContent = document.getElementById("RVContent" + this.getId());
- this.repaintDiv(oRVContent);
- }
- }
-
- if (this.m_viewerWidget) {
- this.m_viewerWidget.placeTabControlInView();
- }
-
-
- this._keepFocus = null;
-
- this.doneLoadingUpdateA11Y("complete");
- this.getTabController().resetPosition();
-
- this.setMaxContentSize();
- }
- else {
- this.m_switchingToTabId = tabId;
- var newReportDiv = reportDiv.cloneNode(false);
- newReportDiv.style.display = "block";
- newReportDiv.setAttribute("id", "CVReport" + this.getId());
- newReportDiv.removeAttribute("tabId");
- reportDiv.parentNode.appendChild(newReportDiv);
- newReportDiv.innerHTML = "<table height='" + oldDivHeight + "px'><tr><td height='100%'></td></tr></table>";
-
- var request = new ViewerDispatcherEntry(this);
- request.addFormField("ui.action", "reportAction");
- request.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup", tabId);
-
- if (this.m_viewerWidget) {
- this.m_viewerWidget.placeTabControlInView();
- }
-
- this.dispatchRequest(request);
- }
- };
- CCognosViewer.prototype._removeTabContent = function(parentNode, tabId) {
- var tabContentDiv = this._findChildWithTabId(parentNode, tabId);
- while(tabContentDiv) {
- tabContentDiv.parentNode.removeChild(tabContentDiv);
- tabContentDiv = this._findChildWithTabId(parentNode, tabId);
- }
- };
- CCognosViewer.prototype._findChildWithTabId = function(parentNode, tabId) {
- var matchedNode = null;
-
- for (var i=0; i < parentNode.childNodes.length; i++) {
- var childNode = parentNode.childNodes[i];
- if (childNode.getAttribute("tabId") == tabId) {
- matchedNode = childNode;
- break;
- }
- }
-
- return matchedNode;
- };
- CCognosViewer.prototype.clearTabs = function() {
- if (!this.m_bHasTabs) {
- return;
- }
-
- this.m_tabInfo = {};
-
- var reportDiv = this.getReportDiv();
- var parentNode = reportDiv.parentNode;
-
- for (var i=0; i < parentNode.childNodes.length; i++) {
- var node = parentNode.childNodes[i];
- if (node.getAttribute("id") != "CVReport" + this.m_sId) {
- parentNode.removeChild(node);
- i--;
- }
- }
- };
- CCognosViewer.prototype.isSavedOutput = function() {
- var action = this.envParams["ui.action"];
- return action === 'view' || action === 'buxView';
- };
- CCognosViewer.prototype.renderSavedOutputIFrame = function(url, title, renderTabs) {
- var reportDiv = document.getElementById("CVReport" + this.getId());
- var iframe = document.createElement("iframe");
- iframe.style.width = "100%";
- iframe.style.height = "99%";
- iframe.id = "CVIFrame" + this.getId();
- iframe.title = title;
- iframe.setAttribute("frameBorder", "0");
-
- reportDiv.appendChild(iframe);
-
- var obj = this;
- var func = function() {
- obj.renderTabs();
- };
- setTimeout(function() {
-
- if (renderTabs) {
- if(iframe.attachEvent) {
- iframe.attachEvent("onload", func);
- }
- else {
- iframe.addEventListener("load", func, true);
- }
- }
- iframe.src = url;
- }, 1);
- };
- CCognosViewer.prototype.updatePageState = function(pageState) {
- if (pageState && this.getState()) {
- this.getState().setPageState(pageState);
- }
- };
- CCognosViewer.prototype.getPageInfo = function() {
- if (this.m_viewerState && this.m_viewerState.getPageState()) {
- var pageState = this.m_viewerState.getPageState();
- return {
- "currentPage" : pageState.getCurrentPage(),
- "pageCount" : pageState.getPageCount()
- };
- }
- return {};
- };
- CCognosViewer.prototype.isIWidgetMobile = function() {
- return this.m_viewerWidget && this.m_viewerWidget.isMobile();
- };
- CCognosViewer.prototype.isInteractiveViewer = function() {
- return false;
- };
- CCognosViewer.prototype.launchGotoPageForIWidgetMobile = function(form) {
- if (this.isIWidgetMobile()) {
- this.m_viewerWidget.launchGotoPageForIWidgetMobile(form);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.executeDrillThroughForIWidgetMobile = function(form) {
- if (this.isIWidgetMobile()) {
- this.m_viewerWidget.executeDrillThroughForIWidgetMobile(form);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.getState = function() {
- return this.m_viewerState;
- };
- CCognosViewer.prototype.getConfig = function() {
- return this.m_viewerConfig;
- };
- CCognosViewer.prototype.getUIConfig = function() {
- return this.m_viewerUIConfig;
- };
- CCognosViewer.prototype.setCurrentNodeFocus = function(node) {
- this.m_currentNodeFocus = node;
- };
- CCognosViewer.prototype.getCurrentNodeFocus = function(node) {
- return this.m_currentNodeFocus;
- };
- CCognosViewer.prototype.setCurrentPromptControlFocus = function(node) {
- this.m_CurrentPromptControlFocus = node;
- };
- CCognosViewer.prototype.getCurrentPromptControlFocus = function(node) {
- return this.m_CurrentPromptControlFocus;
- };
- CCognosViewer.prototype.loadExtra = function() {};
- CCognosViewer.prototype.setRetryDispatcherEntry = function(dispatcherEntry) {
- this.m_retryDispatcherEntry = dispatcherEntry;
- };
- CCognosViewer.prototype.getRetryDispatcherEntry = function() {
- return this.m_retryDispatcherEntry;
- };
- CCognosViewer.prototype.resetViewerDispatcher = function() {
- if (this.m_viewerDispatcher !== null) {
- delete this.m_viewerDispatcher;
- this.m_viewerDispatcher = new ViewerDispatcher();
- }
- };
- CCognosViewer.prototype.getViewerDispatcher = function() {
- return this.m_viewerDispatcher;
- };
- CCognosViewer.prototype.setFaultDispatcherEntry = function(dispatcherEntry) {
- this.m_faultDispatcherEntry = dispatcherEntry;
- };
- CCognosViewer.prototype.getFaultDispatcherEntry = function() {
- return this.m_faultDispatcherEntry;
- };
- CCognosViewer.prototype.dispatchRequest = function(dispatcherEntry) {
- this.setFaultDispatcherEntry(null);
- this.getViewerDispatcher().dispatchRequest(dispatcherEntry);
- };
- CCognosViewer.prototype.getActiveRequest = function() {
- return this.getViewerDispatcher().getActiveRequest();
- };
- CCognosViewer.prototype.getProductLocale = function() {
- if (this.sProductLocale) {
- return this.sProductLocale;
- }
-
- return "en";
- };
- CCognosViewer.prototype.getDirection = function() {
- if (this.sDirection) {
- return this.sDirection;
- }
- return "ltr";
- };
- CCognosViewer.prototype.isBidiEnabled = function() {
- if (this.bIsBidiEnabled) {
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.getBaseTextDirection = function() {
- if(this.isBidiEnabled()){
- if (this.sBaseTextDirection) {
- return this.sBaseTextDirection;
- }
- }
- return "";
- };
- CCognosViewer.prototype.getActionFactory = function(){
- if (!this.m_actionFactory) {
- this.m_actionFactory = new ActionFactory(this);
- }
- return this.m_actionFactory;
- };
- CCognosViewer.prototype.getAction = function(action) {
- var action = this.getActionFactory().load(action);
- action.setCognosViewer(this);
- return action;
- };
- CCognosViewer.prototype.getCalculationCache = function(){
- return this.m_calculationCache;
- };
- CCognosViewer.prototype.updateOutputForA11ySupport = function() {
- this.updateBorderCollapse();
-
-
-
- if (this.getA11YHelper()) {
- this.getA11YHelper().addLabelledByForItemsOutsideOfContainers();
- }
- var v_sAgent = navigator.userAgent.toLowerCase();
- var v_bIsIPhone = v_sAgent.indexOf( "iphone" ) != -1;
- var v_bIsIPod = v_sAgent.indexOf( "ipod" ) != -1;
- var v_bIsIPad = v_sAgent.indexOf( "ipad" ) != -1;
- var v_bIsIOS = v_bIsIPhone || v_bIsIPod || v_bIsIPad;
- var v_bIsAndroid = v_sAgent.indexOf( "android") != -1;
- if ( v_bIsIOS || v_bIsAndroid )
- {
- document.body.classList.add( "clsViewerMobile" );
- }
- };
- CCognosViewer.prototype.checkForHighContrast = function()
- {
- if (this.isBux) {
- this.m_bHighContrast = dojo.hasClass(document.body, "dijit_a11y") ? true : false;
- }
- else {
- var tempDiv = document.createElement("div");
- tempDiv.id = this.m_sId + "hc";
- tempDiv.style.border = "1px solid";
- tempDiv.style.borderColor = "red green";
- tempDiv.style.height = "10px";
- tempDiv.style.top = "-999px";
- tempDiv.style.position = "absolute";
- document.body.appendChild(tempDiv);
- var computedStyle = null;
- if (isIE())
- {
- computedStyle = tempDiv.currentStyle;
- }
- else
- {
- computedStyle = tempDiv.ownerDocument.defaultView.getComputedStyle(tempDiv, null);
- }
- if (!computedStyle) {
- return;
- }
- this.m_bHighContrast = computedStyle.borderTopColor == computedStyle.borderRightColor;
- document.body.removeChild(tempDiv);
- }
- };
- CCognosViewer.prototype.isHighContrast = function()
- {
- if (typeof this.m_bHighContrast === "undefined") {
- this.checkForHighContrast();
- }
- return this.m_bHighContrast;
- };
- CCognosViewer.prototype.isLimitedInteractiveMode = function() {
- return this.envParams && this.envParams.limitedInteractiveMode && this.envParams.limitedInteractiveMode === "true";
- };
- CCognosViewer.prototype.updateBorderCollapse = function()
- {
- if (this.isHighContrast() == true)
- {
- var reportDiv = null;
- if (this.envParams["ui.action"] == "view" && !this.isBux)
- {
- var iframe = document.getElementById("CVIFrame" + this.getId());
- reportDiv = iframe.contentWindow.document;
- }
- else
- {
- reportDiv = document.getElementById("CVReport" + this.getId());
- }
- var tables = reportDiv.getElementsByTagName("table");
- for (var i = 0; i < tables.length; i++)
- {
- if (tables[i].style.borderCollapse == "collapse")
- {
- tables[i].style.borderCollapse = "separate";
- }
- }
- }
- };
- CCognosViewer.prototype.isAccessibleMode = function()
- {
- if (this.m_bAccessibleMode == true)
- {
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.isSinglePageReport = function()
- {
- for (var request in this.m_aSecRequests) {
- if (this.m_aSecRequests[request] == 'nextPage' || this.m_aSecRequests[request] == 'previousPage')
- {
- return false;
- }
- }
- return true;
- };
- CCognosViewer.prototype.hasNextPage = function()
- {
- for (var request in this.m_aSecRequests) {
- if (this.m_aSecRequests[request] == 'nextPage')
- {
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.hasPrevPage = function()
- {
- for (var request in this.m_aSecRequests) {
- if (this.m_aSecRequests[request] == 'previousPage')
- {
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.captureHotkeyPageNavigation = function(evt)
- {
- evt = (evt) ? evt : ((event) ? event : null);
- if(evt)
- {
- var node = getNodeFromEvent(evt);
- var nodeName = (node && node.nodeName) ? node.nodeName.toLowerCase() : null;
- if( (evt.keyCode == 8 && nodeName != "input" && nodeName != "textarea") || (evt.altKey == true && (evt.keyCode == 37 || evt.keyCode == 39)) )
- {
- evt.returnValue = false;
- evt.cancelBubble = true;
- if(typeof evt.stopPropagation != "undefined")
- {
- evt.stopPropagation();
- }
- if(typeof evt.preventDefault != "undefined")
- {
- evt.preventDefault();
- }
- return false;
- }
- }
- return true;
- };
- CCognosViewer.prototype.setUseWorkingDialog = function(bUseWorkingDialog) {
- this.m_bUseWorkingDialog = bUseWorkingDialog;
- };
- CCognosViewer.prototype.getWorkingDialog = function( ) {
- if (!this.m_oWorkingDialog && this.m_bUseWorkingDialog && typeof WorkingDialog !== "undefined") {
- if (this.getConfig() && this.getConfig().getHttpRequestConfig() && this.getConfig().getHttpRequestConfig().getWorkingDialog()) {
- this.m_oWorkingDialog = this.getConfig().getHttpRequestConfig().getWorkingDialog();
- }
- else {
- this.m_oWorkingDialog = new WorkingDialog(this);
- }
- }
- return this.m_oWorkingDialog;
- };
- CCognosViewer.prototype.getRequestIndicator = function() {
- if (this.m_bUseWorkingDialog && !this.m_oRequestExecutedIndicator && typeof RequestExecutedIndicator !== "undefined") {
- if (this.getConfig() && this.getConfig().getHttpRequestConfig() && this.getConfig().getHttpRequestConfig().getRequestIndicator()) {
- this.m_oRequestExecutedIndicator = this.getConfig().getHttpRequestConfig().getRequestIndicator();
- }
- else {
- this.m_oRequestExecutedIndicator = new RequestExecutedIndicator(this);
- }
- }
- return this.m_oRequestExecutedIndicator;
- };
- CCognosViewer.prototype.disableBrowserHotkeyPageNavigation = function() {
- if (document.attachEvent)
- {
- document.attachEvent("onkeydown", this.captureHotkeyPageNavigation);
- }
- else if (document.addEventListener)
- {
- document.addEventListener("keydown", this.captureHotkeyPageNavigation, false);
- }
- };
- CCognosViewer.prototype.setHasPrompts = function(hasPrompts)
- {
- if (!hasPrompts) {
- this.preProcessControlArray = [];
- }
- this.m_bReportHasPrompts = hasPrompts;
- };
- CCognosViewer.prototype.getHasPrompts = function() {
- return this.m_bReportHasPrompts;
- };
- CCognosViewer.prototype.setUsePageRequest = function(bPageRequest)
- {
- this.m_viewerDispatcher.setUsePageRequest(bPageRequest);
- };
- CCognosViewer.prototype.getUsePageRequest = function() {
- return this.m_viewerDispatcher.getUsePageRequest();
- };
- CCognosViewer.prototype.setKeepSessionAlive = function(bValue) {
- this.m_bKeepSessionAlive = bValue;
- };
- CCognosViewer.prototype.getKeepSessionAlive = function() {
- return this.m_bKeepSessionAlive;
- };
- CCognosViewer.prototype.getWebContentRoot = function()
- {
- if (typeof this.sWebContentRoot != "undefined")
- {
- return this.sWebContentRoot;
- }
- else
- {
- return "..";
- }
- };
- CCognosViewer.prototype.getSkin = function()
- {
- if (typeof this.sSkin != "undefined")
- {
- return this.sSkin;
- }
- else
- {
- return this.getWebContentRoot() + "/skins/corporate";
- }
- };
- CCognosViewer.prototype.getSelectionController = function()
- {
- var selectionController;
- try
- {
- selectionController = getCognosViewerSCObjectRef(this.m_sId);
- }
- catch(e)
- {
- selectionController = null;
- }
- return selectionController;
- };
- CCognosViewer.prototype.addCallback = function(sEventName, oFct, bCaptureEvent)
- {
- if (!this.m_aCallback)
- {
- this.m_aCallback = [];
- }
- this.m_aCallback = this.m_aCallback.concat({
- m_sEvent: sEventName,
- m_oCallback: oFct,
- m_bCaptureEvent: (bCaptureEvent===true)
- });
- };
- CCognosViewer.prototype.canDrillDown = function(sId)
- {
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- return (selectionController.canDrillDown(sCtx));
- }
- }
- return false;
- };
- CCognosViewer.prototype.canDrillUp = function(sId)
- {
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- return (selectionController.canDrillUp(sCtx));
- }
- }
- return false;
- };
- CCognosViewer.prototype.canSubmitPrompt = function()
- {
- var oPromptElement = null;
- if (this.preProcessControlArray && this.preProcessControlArray instanceof Array)
- {
- var kCount = this.preProcessControlArray.length;
- for ( var k=0; k < kCount; k++ )
- {
- oPromptElement = eval( this.preProcessControlArray[k] );
- if ( oPromptElement.isValid() === false )
- {
-
- if (!this.m_reportRenderingDone || !oPromptElement.getCascadeOnParameter || !oPromptElement.getCascadeOnParameter()) {
- return false;
- }
- }
- }
- }
- return true;
- };
- CCognosViewer.prototype.closeContextMenuAndToolbarMenus = function() {
- if (this.rvMainWnd) {
- this.rvMainWnd.closeContextMenuAndToolbarMenus();
- }
- };
- CCognosViewer.prototype.dcm = function(event, selectNode)
- {
- if (this.canDisplayContextMenu())
- {
- if (this.preSelectNode == true) {
- selectNode = false;
- this.preSelectNode = false;
- }
- if (this.rvMainWnd.displayContextMenu(event, selectNode) != false)
- {
- return stopEventBubble(event);
- }
- }
- };
- CCognosViewer.prototype.canDisplayContextMenu = function()
- {
- if (!this.getUIConfig() || this.getUIConfig().getShowContextMenu()) {
- return ( !this.isWorkingOrPrompting() && this.rvMainWnd != null && typeof this.bCanUseCognosViewerContextMenu != "undefined" && this.bCanUseCognosViewerContextMenu);
- }
- return false;
- };
- CCognosViewer.prototype.de = function(event)
- {
- var oDrillMgr = this.getDrillMgr();
- if (oDrillMgr)
- {
- oDrillMgr.singleClickDrillEvent(event, 'RV');
- }
- };
- CCognosViewer.prototype.debug = function(sMsg)
- {
- if (this.m_bDebug)
- {
- var sCallee = "";
- var oCaller = this.debug.caller;
- if (typeof oCaller == "object" && oCaller !== null)
- {
- sCallee = oCaller.toString().match(/function (\w*)/)[1];
- }
- if (!sCallee)
- {
- sCallee = '?';
- }
- alert(sCallee + ": " + sMsg);
- }
- };
- CCognosViewer.prototype.callbackExists = function(sEvent) {
- var bEventWasCaptured = false;
- if (this.m_aCallback && this.m_aCallback.length) {
- for (var idxCallback = 0; idxCallback < this.m_aCallback.length; ++idxCallback) {
- var oCB = this.m_aCallback[idxCallback];
- if (oCB.m_sEvent == sEvent) {
- return true;
- }
- }
- }
- return false;
- };
- CCognosViewer.prototype.executeCallback = function(sEvent)
- {
- var bEventWasCaptured = false;
- if (this.m_aCallback && this.m_aCallback.length)
- {
- for (var idxCallback = 0; idxCallback < this.m_aCallback.length; ++idxCallback)
- {
- var oCB = this.m_aCallback[idxCallback];
- if (oCB.m_sEvent == sEvent)
- {
- if (typeof oCB.m_oCallback == "function")
- {
- oCB.m_oCallback();
- }
- if (oCB.m_bCaptureEvent)
- {
- bEventWasCaptured = true;
- }
- }
- }
- }
- return bEventWasCaptured;
- };
- CCognosViewer.prototype.getCAFContext = function()
- {
- return this.m_sCAFContext;
- };
- CCognosViewer.prototype.getSoapFault = function()
- {
- return this.m_sSoapFault;
- };
- CCognosViewer.prototype.getColumnContextIds = function(sId)
- {
- return this.getContextIds(sId, 2);
- };
- CCognosViewer.prototype.getConversation = function()
- {
- return this.m_sConversation;
- };
- CCognosViewer.prototype.getStatus = function()
- {
- return (this.m_sStatus ? this.m_sStatus : "");
- };
- CCognosViewer.prototype.isWorking = function(sState)
- {
- if (typeof sState != "string") {
- sState = this.getStatus();
- }
- return ((""+sState).match(/^(working|stillWorking)$/) ? true : false);
- };
- CCognosViewer.prototype.isWorkingOrPrompting = function()
- {
- return (this.getStatus().match(/^(working|stillWorking|prompting)$/) ? true : false);
- };
- CCognosViewer.prototype.getActionState = function()
- {
- return this.m_sActionState;
- };
- CCognosViewer.prototype.getDataItemName = function(sId)
- {
- var sName = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aName = selectionController.getRefDataItem(sCtx);
- if (aName) {
- sName = aName;
- }
- }
- }
- return sName;
- };
- CCognosViewer.prototype.getDataType = function(sId)
- {
- var sType = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aType = selectionController.getDataType(sCtx);
- if (aType) {
- sType = aType;
- }
- }
- }
- return sType;
- };
- CCognosViewer.prototype.getDepth = function(sId)
- {
- var sLevel = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aLevel = selectionController.getDepth(sCtx);
- if (aLevel) {
- sLevel = aLevel;
- }
- }
- }
- return sLevel;
- };
- CCognosViewer.prototype.getDrillMgr = function()
- {
- if (!this.m_oDrillMgr) {
- this.loadExtra();
- if (typeof CDrillManager == "function") {
- this.m_oDrillMgr = new CDrillManager(this);
- this.goDrillManager = this.m_oDrillMgr;
- }
- }
- return this.m_oDrillMgr;
- };
- CCognosViewer.prototype.getSubscriptionManager = function()
- {
- if (!this.m_oSubscriptionManager) {
- this.loadExtra();
- if (typeof CSubscriptionManager == "function") {
- this.m_oSubscriptionManager = new CSubscriptionManager(this);
- }
- }
- return this.m_oSubscriptionManager;
- };
- CCognosViewer.prototype.updateGlobalParameters = function (globalParametersDelta) {
- var oReq = new ViewerDispatcherEntry(this);
- oReq.addFormField("ui.action", "forward");
- oReq.addFormField("generic.anyURI.runOptionEnum#globalParameters", globalParametersDelta);
- oReq.addFormField("run.prompt", true);
- oReq.addFormField("_promptControl", "reprompt");
- this.submitPromptValues(oReq);
-
- };
- CCognosViewer.prototype.getExecutionParameters = function()
- {
- return this.m_sParameters;
- };
- CCognosViewer.prototype.getGateway = function()
- {
- return this.m_sGateway;
- };
- CCognosViewer.prototype.getSpecification = function()
- {
- return this.envParams["ui.spec"];
- };
- CCognosViewer.prototype.getHierarchyUniqueName = function(sId)
- {
- var sHun = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aHUN = selectionController.getHun(sCtx);
- if (aHUN) {
- sHun = aHUN;
- }
- }
- }
- return sHun;
- };
- CCognosViewer.prototype.getDimensionUniqueName = function(sId)
- {
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aDUN = selectionController.getDun(sCtx);
- if (aDUN) {
- return aDUN;
- }
- }
- }
- return null;
- };
- CCognosViewer.prototype.getId = function()
- {
- return this.m_sId;
- };
- CCognosViewer.prototype.getLevelId = function(sId)
- {
- var sLevel = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aLUN = selectionController.getLun(sCtx);
- if (aLUN) {
- sLevel = aLUN;
- }
- }
- }
- return sLevel;
- };
- CCognosViewer.prototype.getMemberUniqueName = function(sId)
- {
- var sMUN = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aMUN = selectionController.getMun(sCtx);
- if (aMUN) {
- sMUN = aMUN;
- }
- }
- }
- return sMUN;
- };
- CCognosViewer.prototype.getObjectId = function()
- {
- var sObjId = "window";
- if (typeof this.getId() == "string") {
- sObjId = getCognosViewerObjectRefAsString(this.getId());
- }
- return sObjId;
- };
- CCognosViewer.prototype.getQueryModelId = function(sId)
- {
- var sQuery = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aQMID = selectionController.getQueryModelId(sCtx);
- if (aQMID) {
- sQuery = aQMID;
- }
- }
- }
- return sQuery;
- };
- CCognosViewer.prototype.getQueryName = function(sId)
- {
- var sQuery = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- var aQuery = selectionController.getRefQuery(sCtx);
- if (aQuery) {
- sQuery = aQuery;
- }
- }
- }
- return sQuery;
- };
- CCognosViewer.prototype.getContextIds = function(sId, index)
- {
- var aIds = [];
- var sCtx = this.findCtx(sId);
- if (sCtx)
- {
- var aIDparts = sCtx.split("::");
- if (aIDparts && aIDparts.length > 1 && index < aIDparts.length)
- {
- aIds = aIDparts[index].split(":");
- }
- }
- return aIds;
- };
- CCognosViewer.prototype.getRowContextIds = function(sId)
- {
- return this.getContextIds(sId, 1);
- };
- CCognosViewer.prototype.getPageContextIds = function(sId)
- {
- return this.getContextIds(sId, 3);
- };
- CCognosViewer.prototype.getString = function(sKey)
- {
- if (RV_RES && RV_RES[sKey]) {
- return RV_RES[sKey];
- }
- return sKey;
- };
- CCognosViewer.prototype.getRV = function()
- {
- if (typeof this.m_oCVMgr == "object")
- {
- return this.m_oCVMgr;
- }
- return window;
- };
- CCognosViewer.prototype.getSecondaryRequests = function()
- {
- return this.m_aSecRequests;
- };
- CCognosViewer.prototype.getTracking = function()
- {
- return this.m_sTracking;
- };
- CCognosViewer.prototype.findCtx = function(sId)
- {
- var sCtx = "";
- if (typeof sId == "string")
- {
-
- var aCtx = this.getReportContextHelper().processCtx(sId);
- var sRefDataItem = aCtx[0][0];
- var selectionController = this.getSelectionController();
- if (selectionController) {
- if (selectionController.isContextId(sRefDataItem))
- {
- sCtx = sId;
- }
- }
- }
- if (!sCtx)
- {
- var oHTMLElement = this.findElementWithCtx(sId);
- if (oHTMLElement)
- {
- sCtx = oHTMLElement.getAttribute("ctx");
- }
- }
- return sCtx;
- };
- CCognosViewer.prototype.findElementWithCtx = function(sId)
- {
- var oElement = sId;
- if (typeof sId == "string") {
- oElement = this.findElementWithCtx(document.getElementById(sId));
- }
- if (oElement)
- {
- if (oElement.getAttribute && oElement.getAttribute("ctx"))
- {
- return oElement;
- }
- for (var idxChild = 0; idxChild < oElement.childNodes.length; idxChild++)
- {
- var oChild = this.findElementWithCtx(oElement.childNodes[idxChild]);
- if (oChild) {
- return oChild;
- }
- }
- }
- return null;
- };
- CCognosViewer.prototype.getUseValue = function(sId)
- {
- var sVal = null;
- var sCtx = this.findCtx(sId).split("::")[0];
- if (sCtx) {
- var selectionController = this.getSelectionController();
- if (selectionController) {
- sVal = selectionController.getUseValue(sCtx);
- }
- }
- return sVal;
- };
- CCognosViewer.prototype.init = function(oProperties)
- {
- if (oProperties && typeof oProperties == "object")
- {
- for (var sProp in oProperties)
- {
- this[sProp] = oProperties[sProp];
- }
- }
- };
- CCognosViewer.prototype.initViewer = function(originalState) {
- var requestHandler = new RequestHandler(this);
- var backJaxForm = document.getElementById('formBackJax' + this.getId());
- if (backJaxForm && typeof backJaxForm.state != "undefined" && backJaxForm.state.value.length > 0) {
- requestHandler.loadReportHTML(backJaxForm.result.value);
- var oState = eval("(" + backJaxForm.state.value + ")");
- requestHandler.updateViewerState(oState);
- requestHandler.postComplete();
- }
- else {
-
-
-
-
- if (this.getUsePageRequest()) {
- var status = originalState ? originalState.m_sStatus : null;
-
-
-
-
- if (isIE()) {
- if (window.location.hash == '#working') {
- window.history.go(-2);
- return;
- }
- else if (status === "working" || status === "stillWorking") {
- window.location.hash = "#working";
- }
- }
- else if (backJaxForm && backJaxForm.working){
- if (backJaxForm.working.value == "true") {
- window.history.go(-1);
- return;
- }
- else if (status === "working" || status === "stillWorking") {
- backJaxForm.working.value = "true";
- }
- }
- }
- requestHandler.processInitialResponse(originalState);
- }
- };
- CCognosViewer.prototype.saveBackJaxInformation = function(dataResponse) {
- var backJaxForm = document.getElementById('formBackJax' + this.getId());
- if (backJaxForm) {
- if (typeof backJaxForm.state != "undefined") {
- backJaxForm.state.value = dataResponse.getResponseStateText();
- }
- if (typeof backJaxForm.result != "undefined") {
- backJaxForm.result.value = dataResponse.getResult();
- }
- }
- };
- CCognosViewer.prototype.pcc = function(evt)
- {
-
- if (evt && typeof evt.button != "undefined" && evt.button != "1")
- {
- this.preSelectNode = true;
- var selectionController = this.getSelectionController();
- if(selectionController) {
- selectionController.pageContextClicked(evt);
- }
- }
- };
- CCognosViewer.prototype.isValidAjaxResponse = function(responseXML)
- {
- return (responseXML && responseXML.childNodes && responseXML.childNodes.length > 0 && responseXML.childNodes[0].nodeName != "parsererror" ? true : false);
- };
- CCognosViewer.prototype.resubmitInSafeMode = function(dispatcherEntry)
- {
-
- if (this.m_bUseSafeMode) {
- this.resetViewerDispatcher();
- this.setUsePageRequest(true);
- this.envParams["cv.useAjax"] = "false";
- if (dispatcherEntry) {
- dispatcherEntry.retryRequest();
- }
- }
- };
- CCognosViewer.prototype.showLoadedContent = function(oRVContent)
- {
- if (oRVContent !== null && typeof oRVContent != "undefined") {
- oRVContent.style.display = "block";
- }
- this.m_resizeReady = true;
- this.doneLoading();
-
-
- var obj = this;
- setTimeout(function() { obj.renderTabs(); }, 1);
- };
- CCognosViewer.prototype.doneLoading = function()
- {
- var viewerIWidget = this.getViewerWidget();
- if (viewerIWidget) {
- if (window.IBM&&window.IBM.perf){window.IBM.perf.log("viewer_doneLoading", this);}
- var status = this.getStatus();
- if (!this.m_reportRenderingDone && this.m_resizeReady && this.m_stateSet) {
- var noAutoResize = status == "working" || status == "stillWorking" || status == "fault";
- viewerIWidget.fireEvent("com.ibm.bux.widget.render.done", null, {noAutoResize:noAutoResize});
- if (status == "complete") {
- if (window.IBM&&window.IBM.perf){window.IBM.perf.log("viewer_doneLoading", this);}
- if (typeof viewerIWidget.postLoadContent == 'function') {
- viewerIWidget.postLoadContent();
- }
- this.m_reportRenderingDone = true;
- if (!noAutoResize) {
- var thisObj = this;
-
- setTimeout(function() { thisObj.m_readyToRespondToResizeEvent = true; }, 20);
- }
- }
- }
- if (status != "fault") {
- viewerIWidget.clearErrorDlg();
- }
- this.doneLoadingUpdateA11Y(status);
- }
- else {
- var status = this.getStatus();
- if (status == "complete") {
- this.m_reportRenderingDone = true;
- this.JAWSTalk(RV_RES.IDS_JS_READY);
- }
- else if (status == "working") {
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- }
- }
- };
- CCognosViewer.prototype.doneLoadingUpdateA11Y = function(status) {
-
-
- if (this.getKeepFocus() !== false && this.getKeepFocus() != null) {
- var keepFocus = this.getKeepFocus();
-
- if (status == "complete") {
- this.setKeepFocus(false);
- }
- var focusOn = null;
- if (this.getVisibleDialog() !== null) {
- focusOn = this.getVisibleDialog().getDialogDiv();
- } else if (keepFocus === true) {
- focusOn = document.getElementById("CVReport" + this.getId());
- } else if (typeof keepFocus == "string") {
- focusOn = document.getElementById(keepFocus);
- } else if (keepFocus !== null) {
- focusOn = keepFocus;
- if (this.isBux) {
- dojo.window.scrollIntoView(focusOn);
- }
- }
-
- if (focusOn) {
- setFocusToFirstTabItem(focusOn);
- }
- if (status == "complete") {
- this.JAWSTalk(RV_RES.IDS_JS_READY);
- } else if (status == "working" || status == "stillWorking") {
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- }
- }
- };
- CCognosViewer.prototype.JAWSTalk = function(sString) {
-
- if (this.isMobile() || this.isIWidgetMobile()) {
- return;
- }
-
- var id = this.getId();
- var div = document.getElementById("JAWS_Alert_" + id);
- if (div) {
- div.parentNode.removeChild(div);
- }
- div = document.createElement("div");
- div.id = "JAWS_Alert_" + id;
- div.style.position = "absolute";
- div.style.top = "-9000px";
- div.style.display = "none";
- div.setAttribute("role", "alert");
- div.appendChild(document.createTextNode(sString));
- var content = document.getElementById("RVContent" + id);
- if (content) {
- content.appendChild(div);
- } else if (typeof console != "undefined" && console && console.log) {
- console.log("CCognosViewer: Could not find the Viewer div to append the JAWS alert.");
- }
- };
- CCognosViewer.prototype.canInsertExpandIconsForAllCrosstabs = function()
- {
- if( this.isLimitedInteractiveMode() || this.isBlacklisted("ExpandMember") || this.isIWidgetMobile() ) {
- return false;
- }
- var bServerSetting = this.getAdvancedServerProperty("VIEWER_JS_EXPAND_COLLAPSE_CONTROLS_DEFAULT");
- if( bServerSetting === null ){
- return false;
- }
- var bWidgetSetting = this.getViewerWidget().getProperties().getShowExpandCollapseIconFlag();
- return ( bServerSetting.toLowerCase() === 'on' && bWidgetSetting !== false )
- || ( bServerSetting.toLowerCase() === 'off' && bWidgetSetting === true );
- };
- CCognosViewer.prototype.setMaxContentSize = function() {
- if ("10" != window.getIEVersion()) {
- return;
- }
-
- if (document.body.className === "viewer") {
- var height = document.body.offsetHeight;
- var nonReportHeight = this.getNonReportHeight(document.getElementById("CVReport" + this.getId()));
-
- var viewerTable = document.getElementById("mainViewerTable" + this.getId());
- viewerTable.style.maxHeight = height - nonReportHeight - 2 + "px";
- var callback = GUtil.generateCallback(this.setMaxContentSize,[true], this);
- if (!this.attachedOnResize) {
- this.attachedOnResize = true;
- if (window.attachEvent) {
- window.attachEvent("onresize", callback);
- }
- else if (window.addEventListener) {
- window.addEventListener("resize", callback, false);
- }
- }
- }
- };
- CCognosViewer.prototype.getNonReportHeight = function(node) {
- var restOfPageHeight = 0;
- var parentNode = node.parentNode;
- if (!parentNode) {
- return restOfPageHeight;
- }
-
- if (parentNode.childNodes.length > 1) {
- for (var i=0; i < parentNode.childNodes.length; i++) {
- var childNode = parentNode.childNodes[i];
- if (childNode != node && !isNaN(childNode.clientHeight) && childNode.style.display != "none") {
- restOfPageHeight += childNode.clientHeight;
- }
- }
- }
-
-
- if (node.getAttribute("id") != ("mainViewerTable" + this.m_viewerId)) {
- restOfPageHeight += this.getNonReportHeight(parentNode);
- }
-
- return restOfPageHeight;
- };
- CCognosViewer.prototype.addPageAdornments = function()
- {
- this.m_layoutElements = null;
- this.m_lidToElement = null;
- this.initFlashCharts();
- this.insertSortIconsForAllLists();
- var widgetProperties = this.getViewerWidget().getProperties();
- if(this.canInsertExpandIconsForAllCrosstabs() ) {
- this.insertExpandIconsForAllCrosstabs();
- }
- var oReportDiv = document.getElementById("CVReport" + this.getId());
- if (oReportDiv) {
- var oCV = this;
-
-
-
-
- setTimeout(function() {
- if (oCV.getPinFreezeManager() && oCV.getPinFreezeManager().hasFrozenContainers()) {
- oCV.getPinFreezeManager().renderReportWithFrozenContainers(oReportDiv);
- }
- oCV.addInfoBar();
- }, 1);
- }
-
- this.getViewerWidget().reselectSelectionFilterObjects();
- this.getViewerWidget().addChromeWhitespaceHandler(this.getId());
- };
- CCognosViewer.prototype.addFlashChart = function(refId)
- {
- this.m_flashChartsObjectIds.push(refId);
- };
- CCognosViewer.prototype.flashChartError = function(parameters) {
-
- var cvWidget = this.getViewerWidget();
- var properties = cvWidget.getProperties();
- properties.setProperty("flashCharts", false);
- var redrawAction = this.getAction("Redraw");
- redrawAction.isUndoable = function() { return false; };
- redrawAction.execute();
- };
- CCognosViewer.prototype.initFlashCharts = function()
- {
- var viewerIWidget = this.getViewerWidget();
- if(this.m_flashChartsObjectIds.length > 0)
- {
- var reportTable = document.getElementById("rt" + this.getId());
- if (window.addEventListener) {
- reportTable.addEventListener("mousedown", onFlashChartRightClick, true);
- }
- else {
- var objectIds = {};
- var onmouseup = function() {
- this.releaseCapture();
- };
- var onmousedown = function() {
- onFlashChartRightClick(event);
- this.setCapture();
- };
- for (var i = 0; i < this.m_flashChartsObjectIds.length; ++i) {
- var objectId = this.m_flashChartsObjectIds[i];
- var flashObject = document.getElementById(objectId);
- objectIds[objectId] = 1;
- flashObject.parentNode.onmouseup = onmouseup;
- flashObject.parentNode.onmousedown = onmousedown;
- }
- if (this.m_flashChartsObjectIds.length > 0) {
- reportTable.attachEvent("oncontextmenu", function(){
- if (objectIds[window.event.srcElement.id]) {
- return false;
- }
- });
- }
- }
- if (viewerIWidget) {
- viewerIWidget.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive", null, true);
- }
- } else {
- if (viewerIWidget) {
- viewerIWidget.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive", null, false);
- }
- }
- };
- CCognosViewer.prototype.initializeLayoutElements = function() {
- var reportTable = document.getElementById("rt" + this.getId());
- var layoutElements = getElementsByAttribute(reportTable, "*", "lid");
- this.m_lidToElement = {};
- this.m_layoutElements=[];
- var elementIdx = 0;
- var pfManager = this.getPinFreezeManager();
- for(var i = 0; i < layoutElements.length; i++) {
- var e = layoutElements[i];
- if (!pfManager || !pfManager.getContainerElement(e) || pfManager.isElementInMainOutput(e)) {
- this.m_layoutElements[elementIdx]=e;
- this.m_lidToElement[e.getAttribute("lid")] = e;
- elementIdx++;
- }
- }
- };
- CCognosViewer.prototype.getLayoutElement = function(iLayoutIndex) {
- if (!this.m_layoutElements) {
- this.initializeLayoutElements();
- }
- if (this.m_layoutElements) {
- return this.m_layoutElements[iLayoutIndex];
- }
- return null;
- };
- CCognosViewer.prototype.getLayoutElementFromLid = function(lid) {
- if(!this.m_lidToElement) {
- this.initializeLayoutElements();
- }
- return this.m_lidToElement[lid];
- };
- CCognosViewer.prototype.getInfoBars = function() {
- return this.m_aInfoBar ? this.m_aInfoBar : null;
- };
- CCognosViewer.prototype.addInfoBar = function()
- {
- if (this.getAdvancedServerProperty("VIEWER_JS_HIDE_INFO_BAR") === "true") {
- return;
- }
- var oRAPReportInfo = this.getRAPReportInfo();
- if(oRAPReportInfo)
- {
- var reportTable = document.getElementById("rt" + this.getId());
- this.initializeLayoutElements();
- var aInfoBarIDs = [];
- this.m_aInfoBar = [];
- for(var layoutElementIdx = 0; layoutElementIdx < this.m_layoutElements.length; ++layoutElementIdx)
- {
- var layoutElement = this.m_layoutElements[layoutElementIdx];
- var lid = layoutElement.getAttribute("lid");
- if (lid) {
-
- if (lid.indexOf("RAP_NDH_") > -1) {
- lid = lid.substring(8);
- }
-
- lid = lid.substring(0, lid.indexOf(this.getId()));
- }
- var container = oRAPReportInfo.getContainer(lid);
- if (container && typeof container.parentContainer == "undefined") {
- var childContainers = this.collectChildContainers(container.container);
- if (this.getPinFreezeManager()) {
- oPinFreezeContainerElement=this.getPinFreezeManager().getContainerElement(layoutElement);
- layoutElement=(oPinFreezeContainerElement) ? oPinFreezeContainerElement : layoutElement;
- }
- var infoBar = new InfoBar(this, layoutElement, container, childContainers, layoutElementIdx);
- infoBar.setTimingDetails(oRAPReportInfo._getEventTimings());
- infoBar.render();
- if (infoBar.hasSomethingRendered() ) {
- aInfoBarIDs.push(infoBar.getId());
- }
- this.m_aInfoBar.push(infoBar);
- }
- }
- var oWidget = this.getViewerWidget();
- if (oWidget) {
- oWidget.refreshInfoBarRenderedState(aInfoBarIDs);
- }
- }
- };
- CCognosViewer.prototype.collectChildContainers = function(parentContainerId)
- {
- var childContainers = [];
- var oRAPReportInfo = this.getRAPReportInfo();
- if (oRAPReportInfo) {
- var containerCount = oRAPReportInfo.getContainerCount();
- for (var cidx = 0; cidx < containerCount; ++cidx) {
- var container = oRAPReportInfo.getContainerFromPos(cidx);
- if (typeof container.parentContainer != "undefined" && container.parentContainer == parentContainerId) {
- childContainers.push(container);
- }
- }
- }
- return childContainers;
- };
- CCognosViewer.prototype.addReportInfo = function()
- {
- var widget = this.getViewerWidget();
- if( typeof widget === "undefined" || widget === null) {
- return;
- }
-
-
- if (!widget.getAttributeValue("originalReport") || this.isIWidgetMobile()) {
- return;
- }
- var baseReportModificationTime = this.envParams["baseReportModificationTime"];
- var savedBaseReportModificationTime = widget.getAttributeValue( "baseReportModificationTime" );
- if( typeof baseReportModificationTime !== "undefined" &&
- typeof savedBaseReportModificationTime !== "undefined" &&
- savedBaseReportModificationTime &&
- savedBaseReportModificationTime != '<empty>' &&
- baseReportModificationTime !== savedBaseReportModificationTime )
- {
- var cvid = this.getId();
- var rvContent = document.getElementById("CVReport" + cvid);
- var rvContentParent = rvContent.parentNode;
- var id = "ReportInfo" + cvid;
- var divElement = document.createElement("div");
- divElement.setAttribute("id", id + "_container");
- divElement.setAttribute("cvid", cvid);
- divElement.className = "new-info-indicator BUXNoPrint";
-
- var imgElement = document.createElement( "img");
- var img = null;
- if(this.getDirection() === "rtl") {
- img = "/rv/images/action_show_info_rtl.png";
- } else {
- img = "/rv/images/action_show_info.png";
- }
- imgElement.src = this.getWebContentRoot() + img ;
- imgElement.className = 'reportInfoIcon';
- imgElement.setAttribute("tabIndex", "0");
- imgElement.setAttribute("alt", "");
- imgElement.setAttribute("title", "");
- imgElement.setAttribute("role", "presentation");
- var reportInfoTitle = RV_RES.IDS_JS_REPORT_INFO_TITLE;
- var reportInfoText = RV_RES.IDS_JS_REPORT_INFO_TEXT;
- var reportInfoLinkText = RV_RES.IDS_JS_REPORT_INFO_LINK_TEXT;
- divElement.appendChild( imgElement );
- rvContentParent.insertBefore( divElement, rvContent );
- this.m_reportInfoTooltip = new bux.reportViewer.ReportInfo({
- connectId: [id + "_container"],
- focusElement: imgElement,
- position: ["above","below"],
- title: reportInfoTitle,
- text: reportInfoText,
- linkText: reportInfoLinkText,
- linkScript: getCognosViewerObjectRefAsString(cvid) + ".reportInfoResetReport();",
- allowMouseOverToolTip: true
- });
- }
- };
- CCognosViewer.prototype.reportInfoResetReport = function()
- {
- this.executeAction( "ResetToOriginal" );
- };
- CCognosViewer.prototype.hideReportInfo = function()
- {
- var reportInfoContainerDiv = document.getElementById( "ReportInfo" + this.getId() + "_container" );
- if( typeof reportInfoContainerDiv !== "undefined" && reportInfoContainerDiv !== null )
- {
- reportInfoContainerDiv.style.visibility = "hidden";
- }
- };
- CCognosViewer.prototype.insertSortIcons = function()
- {
- var limitedInteractiveMode = this.envParams ? this.envParams.limitedInteractiveMode : true;
- if (typeof limitedInteractiveMode === "undefined" || limitedInteractiveMode === true) {
- return;
- }
-
-
- if (this.envParams["ui.action"] === "run" || this.envParams["ui.primaryAction"] === "run") {
- this.insertSortIconsForAllLists();
- }
- };
- CCognosViewer.prototype._getContainers = function(sContainerType) {
- var aNodes = [];
- var sLayoutType = "", sClassName = "";
- if(sContainerType === "list") {
- sLayoutType = "list";
- sClassName = "ls";
- } else if(sContainerType === "crosstab") {
- sLayoutType = "crosstab";
- sClassName = "xt";
- }
- var nReportDiv = document.getElementById("CVReport" + this.getId());
-
-
- if (this.getRAPReportInfo()) {
- var aContainerIds = this.getRAPReportInfo().getContainerIds(sLayoutType);
- for(var i = 0; i < aContainerIds.length; ++i) {
- var aContainerTables = getElementsByAttribute(nReportDiv, "table", "lid", aContainerIds[i] + this.getId(), 1);
- if (aContainerTables && aContainerTables.length > 0) {
- aNodes.push(aContainerTables[0]);
- }
- }
- } else {
- aNodes = getElementsByClassName(nReportDiv, "table", sClassName);
- }
- return aNodes;
- };
- CCognosViewer.prototype.insertSortIconsForAllLists = function()
- {
- var aListTableElements = this._getContainers("list");
- for (var i = 0; i < aListTableElements.length; ++i) {
- this.insertSortIconsToList(aListTableElements[i]);
- }
- };
- CCognosViewer.prototype.insertSortIconsToList = function(listTableElement)
- {
- var columnHeaderElements = getElementsByAttribute(listTableElement, '*', "type", 'columnTitle');
-
- for (var i = 0; i < columnHeaderElements.length; ++i) {
- var columnHeader = columnHeaderElements[i];
-
-
- this.getSelectionController().getSelectionObjectFactory().getSelectionObject(columnHeader);
-
- if (columnHeader.getAttribute("canSort") != "false" && columnHeader.getAttribute("CTNM") === null && columnHeader.getAttribute("CC") === null) {
- var sortImgAlreadyInserted = false;
- for (var iChild=0; iChild < columnHeader.childNodes.length; iChild++) {
- var child = columnHeader.childNodes[iChild];
- if (child.nodeName.toLowerCase() == "img" )
- {
-
- if( child.id && child.id.indexOf("sortimg") === 0)
- {
- sortImgAlreadyInserted = true;
- break;
- }
-
- var sLid = child.getAttribute( "lid");
- if(sLid && sLid.indexOf("SortIcon") !== -1)
- {
- columnHeader.removeChild( child );
- break;
- }
- }
- }
- if (!sortImgAlreadyInserted && this.canInsertSortIcon(columnHeader) ) {
- this.insertSortIconToColumnHeader(columnHeader);
- }
- }
- }
- };
- CCognosViewer.prototype.isDrillBlackListed = function() {
- if (typeof this.m_bDrillBlacklisted == "undefined") {
- this.m_bDrillBlacklisted = this.isBlacklisted("DrillDown") || this.isBlacklisted("DrillUp");
- }
-
- return this.m_bDrillBlacklisted;
- };
- CCognosViewer.prototype.isBlacklisted = function(item) {
- return this.UIBlacklist && this.UIBlacklist.indexOf(" " + item + " ") > 0;
- };
- CCognosViewer.prototype.canInsertSortIcon = function(oColumnHeaderElement) {
- var sortValue = oColumnHeaderElement.getAttribute('rp_sort');
- return ( (!this.isLimitedInteractiveMode() && !this.isBlacklisted("Sort")) || ( sortValue !== undefined && sortValue !== null && sortValue.length > 0 ) );
- };
- CCognosViewer.prototype.insertSortIconToColumnHeader = function(oColumnHeaderElement) {
- if (!oColumnHeaderElement.style.whiteSpace) {
- oColumnHeaderElement.style.whiteSpace='nowrap';
- }
- var imgElement = document.createElement("img");
- imgElement.setAttribute("id", 'sortimg' + Math.random());
- if( (!this.isLimitedInteractiveMode() && !this.isBlacklisted("Sort")) )
- {
- imgElement.onmouseover = function() {this.setAttribute("oldClassName", this.className); this.className += " sortIconOver";};
- imgElement.onmouseout = function() {this.className = this.getAttribute("oldClassName"); this.removeAttribute("oldClassName");};
- }
- imgElement.src = this.getImgSrc(oColumnHeaderElement );
- var sortInfo = this.getSortInfo(oColumnHeaderElement);
- var sSort = this.getSortOrder(sortInfo);
- imgElement.setAttribute( 'alt', this.getSortAltText( sSort ));
- imgElement.setAttribute( 'title', this.getSortAltText( sSort ));
- imgElement.className = this.getSortClass( sortInfo );
- imgElement.setAttribute('sortOrder', sSort);
- oColumnHeaderElement.appendChild( imgElement );
- };
- CCognosViewer.prototype.canInsertShowExpandCollapseIconForNode = function( oItemInfo, contextId )
- {
- var selectionController = this.getSelectionController();
- var bHasCalculationMetadata = selectionController.hasCalculationMetadata( contextId, [contextId], "crosstab" );
- return( ( selectionController.canDrillDown( contextId ) || oItemInfo.alwaysCanExpandCollapse )
- && !selectionController.isCalculationOrMeasure( contextId, bHasCalculationMetadata ));
- };
- CCognosViewer.prototype.insertExpandIconsForAllCrosstabs = function() {
- var aCrosstabTableElements = this._getContainers("crosstab");
- var _this = this;
- var oRAPReportInfo = this.getRAPReportInfo();
- var oContextHelper = this.getReportContextHelper();
- for(var i = 0; i < aCrosstabTableElements.length; i++) {
- var nCrosstabTable = aCrosstabTableElements[i];
- var sContainerLID = nCrosstabTable.getAttribute("lid");
-
- sContainerLID = sContainerLID.substring(0, sContainerLID.length - this.getId().length);
- var aHeaderNodes = getElementsByAttribute(nCrosstabTable, ["td","th"], "ctnm", "true");
- for(var j = 0; j < aHeaderNodes.length; j++) {
- var nHeaderNode = aHeaderNodes[j];
- var sCtx = this.findCtx(nHeaderNode);
- var sDataItemName = oContextHelper.getDataItemName(sCtx);
- if(sDataItemName) {
- var oItemInfo = oRAPReportInfo.getItemInfo(sContainerLID, sDataItemName);
- var aContextIds = oContextHelper.processCtx( sCtx );
- if( this.canInsertShowExpandCollapseIconForNode( oItemInfo, aContextIds[0][0] ) ) {
- var sMun = oContextHelper.getMun(sCtx);
- var bIsExpanded = sMun && oItemInfo.expandedMembers && oItemInfo.expandedMembers[sMun] === true;
- var nIcon = document.createElement("div");
- nIcon.setAttribute("skipSelection", "true");
- nIcon.className = "expandButton " + (bIsExpanded ? "collapse" : "expand");
- nHeaderNode.insertBefore(nIcon, nHeaderNode.firstChild);
- var nCaption = document.createElement("span");
- nCaption.className = "expandButtonCaption";
- nCaption.innerHTML = (bIsExpanded ? "[-]" : "[+]");
- nIcon.appendChild(nCaption);
- }
- }
- }
- }
- };
- CCognosViewer.prototype.removeExpandIconsForAllCrosstabs = function() {
- var aCrosstabTableElements = this._getContainers("crosstab");
- for(var i = 0; i < aCrosstabTableElements.length; i++) {
- var nCrosstabTable = aCrosstabTableElements[i];
- var sContainerLID = nCrosstabTable.getAttribute("lid");
-
- sContainerLID = sContainerLID.substring(0, sContainerLID.length - this.getId().length);
- var aHeaderNodes = getElementsByAttribute(nCrosstabTable, "td", "ctnm", "true");
- for(var j = 0; j < aHeaderNodes.length; j++) {
- var nHeaderNode = aHeaderNodes[j];
- if( nHeaderNode.firstChild.className === 'expandButton collapse'
- || nHeaderNode.firstChild.className === 'expandButton expand' )
- {
- nHeaderNode.removeChild( nHeaderNode.firstChild );
- }
- }
- }
- };
- CCognosViewer.prototype.fillInContextData = function() {
- if (!this.isLimitedInteractiveMode()) {
- var reportDiv = document.getElementById("CVReport" + this.getId());
- var listTableElements = getElementsByClassName(reportDiv, "table", 'ls');
- for (var i = 0; i < listTableElements.length; ++i) {
- var columnHeaderElements = getElementsByAttribute(listTableElements[i], '*', "type", 'columnTitle');
- for (var j = 0; j < columnHeaderElements.length; ++j) {
- this.getSelectionController().getSelectionObjectFactory().getSelectionObject(columnHeaderElements[j]);
- }
- }
- }
- };
- CCognosViewer.prototype.getSortAltText = function (sSort)
- {
- if( sSort === "ascending" )
- {
- return RV_RES.IDS_JS_SORT_ASCENDING;
- }
- else if( sSort === "descending")
- {
- return RV_RES.IDS_JS_SORT_DESCENDING;
- } else if (sSort === "nosort")
- {
- return RV_RES.IDS_JS_NOT_SORTED;
- }
- };
- CCognosViewer.prototype.getSortInfo = function (oColumnHeaderElement)
- {
- var sortInfo = oColumnHeaderElement.getAttribute('rp_sort');
- if (sortInfo)
- {
- sortInfo = sortInfo.split('.');
- }
- return sortInfo;
- };
- CCognosViewer.prototype.getSortClass = function( sortInfo )
- {
- var classname = 'sortIconHidden';
- if (sortInfo)
- {
- if( sortInfo[0] === 'd'|| sortInfo[0] === 'a')
- {
- classname = 'sortIconVisible';
- }
- }
- return classname;
- };
- CCognosViewer.prototype.getSortOrder = function( sortInfo )
- {
- var sortOrder = 'nosort';
- if( sortInfo )
- {
- if( sortInfo[0] === 'd')
- {
- sortOrder = 'descending';
- }
- else if( sortInfo[0] === 'a')
- {
- sortOrder = 'ascending';
- }
- }
- return sortOrder;
- };
- CCognosViewer.prototype.getImgSrc = function( oColumnHeaderElement )
- {
- var sortOrder = oColumnHeaderElement.getAttribute('rp_sort');
- var src = this.getWebContentRoot() + "/rv/images/" + this.getSortIconName( sortOrder );
- return src;
- };
- CCognosViewer.prototype.getSortIconName = function( sortOrder )
- {
- var iconName = 'sort_no.gif';
- if (sortOrder) {
- sortOrder = sortOrder.split('.');
- if( sortOrder[0] === 'd')
- {
- iconName = 'sort_descending.gif';
- }
- else if( sortOrder[0] === 'a')
- {
- iconName = 'sort_ascending.gif';
- }
- }
- return iconName;
- };
- CCognosViewer.prototype.shouldWriteNavLinks = function() {
- if (this.envParams["cv.navlinks"] == "false") {
- return false;
- }
- else if (!this.getUIConfig() || this.getUIConfig().getShowPageNavigation()) {
- if (this.rvMainWnd || (this.isBux && !this.isActiveReport()) ) {
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.isActiveReport = function() {
- if (this.envParams["cv.responseFormat"] === "activeReport" ) {
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.resetRaiseSharePromptEventFlag = function()
- {
- this.m_raiseSharePromptEvent = true;
- };
- CCognosViewer.prototype.resetbHasPromptFlag = function()
- {
- this.m_bHasPrompt = null;
- };
- CCognosViewer.prototype.disableRaiseSharePromptEvent = function()
- {
- this.m_raiseSharePromptEvent = false;
- };
- CCognosViewer.prototype.widgetHasPromptParameters = function()
- {
- var cvWidget = this.getViewerWidget();
- return (cvWidget && cvWidget.promptParametersRetrieved == true && this.envParams && typeof this.envParams["reportPrompts"] != "undefined" && this.envParams["reportPrompts"] != null && this.envParams["reportPrompts"].length > 0);
- };
- CCognosViewer.prototype.getPromptParametersInfo = function()
- {
- var result = null;
- if (this.widgetHasPromptParameters()) {
- result = "<widget><parameterValues>" + sXmlEncode(this.getExecutionParameters()) + "</parameterValues>" + this.envParams["reportPrompts"] + "</widget>" ;
- }
- return result;
- };
- CCognosViewer.prototype.raisePromptEvent = function(sharedPrompts, formFields,clearCascadePromptParams)
- {
- try
- {
- var cvWidget = this.getViewerWidget();
- cvWidget.getWidgetContextManager().raisePromptEvent(sharedPrompts, formFields, formFields.get("ui.action"), this.getModelPath(),clearCascadePromptParams);
- } catch ( e )
- {
- }
- };
- CCognosViewer.prototype.getModelPath = function() {
- var modelPath = this.getSelectionController().getModelPathForCurrentSelection();
- if (modelPath) {
- return modelPath;
- }
- else if (this.envParams.modelPath) {
- return this.envParams.modelPath;
- }
- else if(typeof document.forms["formWarpRequest" + this.getId()].modelPath !== "undefined") {
- return document.forms["formWarpRequest" + this.getId()].modelPath.value;
- }
-
- return "";
- };
- CCognosViewer.prototype.setKeepFocus = function(value) {
- this._keepFocus = value;
- };
- CCognosViewer.prototype.getKeepFocus = function() {
- if (typeof this._keepFocus != "undefined") {
- return this._keepFocus;
- }
- return false;
- };
- CCognosViewer.prototype.onFocus = function(evt) {
- var a11yHelper = this.getA11YHelper();
- if (a11yHelper) {
- a11yHelper.onFocus(evt);
- }
- };
- CCognosViewer.prototype.getA11YHelper = function() {
- if (!this.a11yHelper) {
- this.loadExtra();
- if (typeof ViewerA11YHelper == "function") {
- this.a11yHelper = new ViewerA11YHelper(this);
- }
- else {
- if (typeof console !== "undefined" && console.log) {
- console.log("CCognosViewer: Could not create ViewerA11YHelper object.");
- }
- return null;
- }
- }
- return this.a11yHelper;
- };
- CCognosViewer.prototype.onKeyDown = function(evt) {
- if (this.getA11YHelper()) {
- this.getA11YHelper().onKeyDown(evt);
- }
- };
- CCognosViewer.prototype.updateSkipToReportLink = function()
- {
- var status = this.getStatus();
- var oSkipToReport = document.getElementById("cvSkipToReport" + this.getId());
- if (oSkipToReport) {
- oSkipToReport.style.display = status == "prompting" ? "none" : "";
- }
- };
- CCognosViewer.prototype.updateSkipToNavigationLink = function(bHide)
- {
- var oSkipToNavigation = document.getElementById("cvSkipToNavigation" + this.getId());
- if (oSkipToNavigation)
- {
- oSkipToNavigation.style.display = bHide ? "none" : "";
- }
- };
- CCognosViewer.prototype.pageAction = function(pageAction) {
- this.setKeepFocus("CVNavLinks" + this.getId());
- var request = new ViewerDispatcherEntry(this);
- request.addFormField("ui.action", pageAction);
- if (this.getCurrentlySelectedTab()) {
- request.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup", this.getCurrentlySelectedTab());
- }
- this.dispatchRequest(request);
- };
- CCognosViewer.prototype.writeNavLink = function(oLink, sRequest, bActive, bSavedOutput)
- {
- var sPattern = "";
- if (bActive)
- {
- sPattern =
- '<td nowrap="nowrap">' +
- '<img src="LINK_IMG" width="15" height="15" alt="" style="vertical-align:middle;">' +
- '</td>' +
- '<td nowrap="nowrap">';
- if (bSavedOutput)
- {
- sPattern += '<a href="#" tabindex="0" onclick="' + getCognosViewerObjectRefAsString(this.getId()) + '.getViewerWidget().getSavedOutput().pageAction(\'LINK_REQUEST\');return false;"';
- }
- else
- {
- sPattern += '<a href="#" tabindex="0" onclick="' + getCognosViewerObjectRefAsString(this.getId()) + '.pageAction(\'LINK_REQUEST\');return false;"';
- }
- sPattern += '>LINK_TEXT</a> ' +
- '</td>';
- }
- else
- {
- sPattern =
- '<td nowrap="nowrap">' +
- '<img src="LINK_IMG" width="15" height="15" alt="" style="vertical-align:middle;">' +
- '</td>' +
- '<td nowrap="nowrap">LINK_TEXT </td>';
- }
- var sImg = this.sSkin + (!bActive && oLink.sImgDisabled ? oLink.sImgDisabled : oLink.sImg);
- return sPattern.replace(/LINK_REQUEST/g, sRequest).replace(/LINK_TEXT/g, oLink.sText).replace(/LINK_IMG/g, sImg);
- };
- CCognosViewer.prototype.loadNavLinks = function()
- {
-
- var sText = window.gScriptLoader.loadFile(this.getGateway(), "b_action=xts.run&m=portal/report-viewer-navlinks.xts");
- if (sText)
- {
- this.init(eval("(" + sText + ")"));
- }
- };
- CCognosViewer.prototype.writeNavLinks = function(sSR, bSavedOutput)
- {
- var oNavLinksDiv = document.getElementById("CVNavLinks" + this.getId());
- if (oNavLinksDiv)
- {
- var nNavLinksDivContainer = document.getElementById("CVNavLinks_Container" + this.getId());
- if (typeof this.oNavLinks != "object" || typeof sSR != "string" || !sSR.match(/\bfirstPage\b|\bpreviousPage\b|\bnextPage\b|\blastPage\b|\bplayback\b/i))
- {
- oNavLinksDiv.style.display = "none";
- if (nNavLinksDivContainer) {
- nNavLinksDivContainer.style.display = "none";
- }
- this.updateSkipToNavigationLink(true);
- return;
- }
- this.updateSkipToNavigationLink(false);
- if (nNavLinksDivContainer) {
- nNavLinksDivContainer.style.display = "";
- }
- oNavLinksDiv.style.display = (isIE() ? "block" : "table-cell");
- var sHTML = "";
- sHTML += '<table border="0" cellpadding="0" cellspacing="0" class="pageControls BUXNoPrint" role="presentation"><tbody><tr>';
- sHTML += this.writeNavLink(this.oNavLinks.oFirst, 'firstPage', sSR.match(/\bfirstPage\b/gi), bSavedOutput);
- sHTML += this.writeNavLink(this.oNavLinks.oPrevious, 'previousPage', sSR.match(/\bpreviousPage\b/gi), bSavedOutput);
- sHTML += this.writeNavLink(this.oNavLinks.oNext, 'nextPage', sSR.match(/\bnextPage\b/gi), bSavedOutput);
- sHTML += this.writeNavLink(this.oNavLinks.oLast, 'lastPage', sSR.match(/\blastPage\b/gi), bSavedOutput);
- sHTML += '</tr></tbody></table>';
-
- var oNavLinksLabel = document.getElementById("CVNavLinks_label" + this.getId());
- var navLinkLabel = "";
- if (oNavLinksLabel) {
- navLinkLabel += "<span id=\"CVNavLinks_label" + this.getId() + "\" style=\"visibilty:hidden; display:none;\">" + oNavLinksLabel.innerHTML + "</span>";
- }
- oNavLinksDiv.innerHTML = navLinkLabel + sHTML;
- }
- else if (this.shouldWriteNavLinks())
- {
- setTimeout(getCognosViewerObjectRefAsString(this.getId()) + '.writeNavLinks("' + sSR + '","' + bSavedOutput + '");', 100);
- }
- };
- function CVBackgroundLayer_ignoreMouseClick( e )
- {
- if (e.returnValue) { e.returnValue = false; }
- else if (e.preventDefault) { e.preventDefault(); }
- else { return false; }
- }
- CCognosViewer.prototype.createTransparentBackgroundLayer = function()
- {
- this.removeTransparentBackgroundLayer();
- var oBL = document.createElement( "div" );
- oBL.id = CV_BACKGROUND_LAYER_ID;
- oBL.style.display = "none";
- oBL.style.position = "absolute";
- oBL.setAttribute("role", "region");
- oBL.setAttribute("aria-label", RV_RES.IDS_JS_A11Y_BACKGROUND_TINT);
- oBL.style.top = "0px";
- oBL.style.left = "0px";
- oBL.style.zIndex = 98;
- oBL.style.width = "100%";
- oBL.style.height = "100%";
- oBL.style.backgroundColor = 'rgb(238, 238, 238)';
- oBL.style.opacity = '0';
- oBL.style.filter = 'alpha(opacity:0)';
- oBL.innerHTML = '<table tabindex="1" width="100%" height="100%"><tr><td role="presentation" onclick="CVBackgroundLayer_ignoreMouseClick(event)"></td></tr></table>';
- oBL.style.display = 'inline';
- document.body.appendChild( oBL );
- };
- CCognosViewer.prototype.removeTransparentBackgroundLayer = function()
- {
- var oBL = document.getElementById( CV_BACKGROUND_LAYER_ID );
- if( oBL )
- {
- oBL.parentNode.removeChild( oBL );
- }
- };
- CCognosViewer.prototype.closeActiveHTTPConnection = function()
- {
- var dispatcherEntry = this.getActiveRequest();
- if (dispatcherEntry) {
- dispatcherEntry.abortHttpRequest();
- }
- };
- CCognosViewer.prototype.canCancel = function()
- {
- var sTracking = this.getTracking();
- var sStatus = this.getStatus();
- return sTracking != "" && sStatus != "complete";
- };
- CCognosViewer.prototype.cancel = function(cancelLink)
- {
- if (this.getWorkingDialog() && this.getWorkingDialog().disableCancelButton) {
-
- this.getWorkingDialog().disableCancelButton(cancelLink);
- }
-
- this.removeTransparentBackgroundLayer();
- this.clearPrompts();
- if (this.m_viewerFragment && this.envParams["fragment.fireEventWhenComplete"]) {
- this.envParams["fragment.fireEventWhenComplete"] = "";
- }
- var cognosViewerUndo = null;
- if(this.m_undoStack.length > 0) {
- cognosViewerUndo = this.m_undoStack.pop();
- }
- var dispatcherEntry = this.getActiveRequest();
- if(this.canCancel() === true || dispatcherEntry) {
- if (dispatcherEntry) {
- dispatcherEntry.cancelRequest(true);
- }
- else {
-
-
- var request = null;
- var refreshPage = cognosViewerUndo != null && cognosViewerUndo.m_bRefreshPage;
- if (typeof this.getCancelDispatcherEntry == "function") {
- request = this.getCancelDispatcherEntry();
- }
-
-
-
- else if (refreshPage || this.m_viewerFragment) {
- request = new ViewerDispatcherEntry(this);
- }
- else {
- if (this.getId() == 'RS') {
- request = new ViewerDispatcherEntry(this);
- request.addFormField("cv.responseFormat", "rs");
- }
- else {
- request = new DispatcherEntry(this);
- request.addFormField("cv.responseFormat", "successfulRequest");
- }
- }
- request.forceSynchronous();
- request.addFormField("ui.action", "cancel");
- request.addFormField("m_tracking", this.getTracking());
-
-
-
- this.setTracking("");
-
-
-
- if (refreshPage) {
- var undoSpec = "<CognosViewerUndo><conversation>";
- undoSpec += cognosViewerUndo.m_sConversation;
- undoSpec += "</conversation></CognosViewerUndo>";
- request.addFormField("cv.previousSession", undoSpec);
- }
- this.dispatchRequest(request);
- if (!this.isBux && !this.m_viewerFragment && (this.getUsePageRequest() || !this.isReportRenderingDone())) {
- this.executeCallback("cancel");
- }
- }
- this.setStatus("complete");
- var action = this.envParams["ui.action"];
- var oriPageRequest = this.getUsePageRequest();
- var oriStackSize = this.m_undoStack.length;
- if(cognosViewerUndo != null) {
- this.m_sConversation = cognosViewerUndo.m_sConversation;
- this.m_sParameters = cognosViewerUndo.m_sParameters;
- this.envParams = {};
- applyJSONProperties(this.envParams, cognosViewerUndo.m_envParams);
- this.m_undoStack.push(cognosViewerUndo);
- }
- this.setTracking("");
- if (this.previouslySelectedTab) {
- this.cancelTabSwitch();
- }
- else if (action != "view" && oriStackSize <= 0 && this.rvMainWnd) {
-
-
- this.rvMainWnd.executePreviousReport(-1);
- }
-
- return true;
- }
- else if (this.rvMainWnd && typeof this.envParams != "undefined" && (this.envParams["ui.primaryAction"] == "authoredDrillThrough" || this.envParams["ui.primaryAction"] == "authoredDrillThrough2")) {
- this.rvMainWnd.executePreviousReport(-1);
- return true;
- }
- else {
- if (!this.isBux) {
- executeBackURL(this.getId());
- }
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.clearPrompts = function()
- {
- if (this.preProcessControlArray)
- {
- var kCount = this.preProcessControlArray.length;
- var k = 0;
- for (k=0; k<kCount; k++)
- {
- var oPrmtCtrl = eval(this.preProcessControlArray[k]);
- if (oPrmtCtrl)
- {
- if (oPrmtCtrl.clearSubmit) {
- oPrmtCtrl.clearSubmit();
- }
- }
- }
- }
- };
- CCognosViewer.prototype.wait = function()
- {
- if(this.isWorking())
- {
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- var request = new ViewerDispatcherEntry(this);
- request.addFormField("ui.action", "wait");
- request.addFormField("ui.primaryAction", this.envParams["ui.primaryAction"]);
- request.addFormField("cv.actionState", this.envParams["cv.actionState"]);
- request.addNonEmptyStringFormField("bux", this.envParams["bux"]);
- request.addNonEmptyStringFormField("ui.preserveRapTags", this.envParams["ui.preserveRapTags"]);
- this.dispatchRequest(request);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.setCAFContext = function(sValue)
- {
- this.m_sCAFContext = sValue;
- };
- CCognosViewer.prototype.setContextInfo = function(sXML)
- {
- this.m_sContextInfoXML = sXML;
- };
- CCognosViewer.prototype.setConversation = function(sValue)
- {
- this.m_sConversation = sValue;
- };
- CCognosViewer.prototype.setActionState = function(sValue)
- {
- this.m_sActionState = sValue;
- };
- CCognosViewer.prototype.setStatus = function(sStatus)
- {
- this.m_sStatus = sStatus;
- };
- CCognosViewer.prototype.setDebug = function(bDebug)
- {
- this.m_bDebug = bDebug;
- };
- CCognosViewer.prototype.setExecutionParameters = function(sValue)
- {
- this.m_sParameters = sValue;
- };
- CCognosViewer.prototype.setMetadataInfo = function(sXML)
- {
- this.m_sMetadataInfoXML = sXML;
- };
- CCognosViewer.prototype.setSecondaryRequests = function(aValue)
- {
- if (aValue) {
- this.m_aSecRequests = aValue;
- }
- else {
- this.m_aSecRequests = [];
- }
- };
- CCognosViewer.prototype.setTracking = function(sValue)
- {
- this.m_sTracking = sValue;
- };
- CCognosViewer.prototype.setSoapFault = function(sValue)
- {
- this.m_sSoapFault = sValue;
- };
- CCognosViewer.prototype.showOutputInNewWindow = function(sURL)
- {
- var formWarpRequest = document.getElementById("formWarpRequest" + this.getId());
- var doPostBack = formWarpRequest.elements["ui.postBack"];
- var backURL = formWarpRequest.elements["ui.backURL"];
-
-
-
- if (this.isAccessibleMode() && this.envParams["run.outputFormat"] == "PDF" && window.detachLeavingRV) {
- window.detachLeavingRV();
- }
-
- if (window.opener || doPostBack || (backURL && backURL.value !== 'javascript:window.close();')) {
- window.open(sURL, "", "");
- this.updateNewBrowserWindow();
- }
-
-
- else {
- window.location = sURL;
- }
- };
- CCognosViewer.prototype.hideToolbar = function(bHide) {
- this.m_bHideToolbar = bHide;
- };
- CCognosViewer.prototype.showExcel = function(sURL)
- {
- var currentWindowClosing = true;
- var formWarpRequest = document.getElementById("formWarpRequest" + this.getId());
- var backURL = formWarpRequest.elements["ui.backURL"];
- if (backURL && backURL.value.indexOf('javascript:window.close()') !== 0 && backURL.value.indexOf("close.html") === -1) {
- currentWindowClosing = false;
- }
-
-
- if (window.detachLeavingRV) {
- window.detachLeavingRV();
- }
- var windowObj = window;
-
-
-
- if (window.opener && (isIE() || isFF()) && currentWindowClosing) {
- windowObj = window.opener ? window.opener : window;
- }
-
-
- else if (!window.opener && currentWindowClosing) {
- window.location = sURL;
- return;
- }
-
- var popupDialog = null;
- var properties = "";
-
- try {
- if (this.envParams["cv.excelWindowOpenProperties"]) {
- properties=this.envParams["cv.excelWindowOpenProperties"];
- }
-
- popupDialog = windowObj.open(sURL, "",properties);
-
- } catch (e) {
-
-
- windowObj = window;
- popupDialog = windowObj.open(sURL, "",properties);
-
- }
-
- if (!popupDialog || popupDialog.closed || typeof popupDialog.closed == 'undefined') {
-
- alert(RV_RES.RV_BROWSER_POPUP_IS_ENABLED);
-
- }
- this.updateNewBrowserWindow();
- };
- CCognosViewer.prototype.updateNewBrowserWindow = function()
- {
- var id = this.getId();
- var doPostBack = document.forms["formWarpRequest" + id].elements["ui.postBack"];
- var backURL = document.forms["formWarpRequest" + id].elements["ui.backURL"];
- if (doPostBack && doPostBack.value)
- {
- setTimeout(getCognosViewerObjectRefAsString(id) + '.getRV().doPostBack();', 100);
- }
- else if (backURL && backURL.value)
- {
- if (backURL.value.length < 2048)
- {
- setTimeout('location.replace("' + backURL.value + '");', 100);
- }
- else
- {
- backURL = decodeURIComponent(backURL.value);
- var URLandParameters = backURL.split("?");
- var backURLForm = document.createElement("form");
- backURLForm.style.display = "none";
- backURLForm.setAttribute("target", "_self");
- backURLForm.setAttribute("method", "post");
- backURLForm.setAttribute("action", URLandParameters[0]);
- var parameterList = URLandParameters[1].split("&");
- for(var nextParameter = 0; nextParameter < parameterList.length; nextParameter++)
- {
-
-
- var equalsIndexPos = parameterList[nextParameter].indexOf("=");
- var parameterName = parameterList[nextParameter].substr(0, equalsIndexPos);
- var parameterValue = parameterList[nextParameter].substr(equalsIndexPos + 1);
- var urlFormField = document.createElement("img");
- urlFormField.setAttribute("type", "hidden");
- urlFormField.setAttribute("name", decodeURIComponent(parameterName));
- urlFormField.setAttribute("value", decodeURIComponent(parameterValue));
- backURLForm.appendChild(urlFormField);
- }
- document.body.appendChild(backURLForm);
- backURLForm.submit();
- }
- }
- else
- {
- window.close();
- }
- };
- CCognosViewer.prototype.showWaitPage = function() {};
- CCognosViewer.prototype.sendRequest = function(oCCognosViewerRequest) {
- var oDispEntry = new ViewerDispatcherEntry(this);
- oDispEntry.addFormField("ui.action", oCCognosViewerRequest.getAction());
- if (oCCognosViewerRequest.getCallback() != null) {
- oDispEntry.setCallbacks( { "complete" : {"object" : null, "method" : oCCognosViewerRequest.getCallback()}});
- }
- var aFormFields = oCCognosViewerRequest.getFormFields().keys();
- for (var idxFormField = 0; idxFormField < aFormFields.length; idxFormField++) {
- oDispEntry.addFormField(aFormFields[idxFormField], oCCognosViewerRequest.getFormFields().get(aFormFields[idxFormField]));
- }
- var aOptions = oCCognosViewerRequest.m_oOptions.keys();
- for (var idxOption = 0; idxOption < aOptions.length; idxOption++) {
- oDispEntry.addFormField(aOptions[idxOption], oCCognosViewerRequest.getOption(aOptions[idxOption]));
- }
- var aParameters = oCCognosViewerRequest.m_oParams.keys();
- for (var idxParameter = 0; idxParameter < aParameters.length; idxParameter++) {
- oDispEntry.addFormField(aParameters[idxParameter], oCCognosViewerRequest.getParameter(aParameters[idxParameter]));
- }
- this.dispatchRequest(oDispEntry);
- };
- CCognosViewer.prototype.promptAction = function(sAction, sUrl)
- {
-
- this.setKeepFocus(true);
- if ( typeof datePickerObserverNotify == "function" )
- {
- datePickerObserverNotify();
- }
- var widget = this.getViewerWidget();
- if (sAction == "cancel")
- {
- this.cancelPrompt(sUrl);
- if (widget)
- {
- if (!this.isReportRenderingDone())
- {
- var payload = { action: 'deleteWidget' };
- widget.fireEvent("com.ibm.bux.widget.action", null, payload);
- }
- }
- }
- else
- {
- var oReq = new ViewerDispatcherEntry(this);
- oReq.addFormField("ui.action", sAction == "back" ? "back" : "forward");
- if (sAction == "finish") {
- oReq.addFormField("run.prompt", false);
- }
- else if (sAction == "back" || sAction == "next") {
- oReq.addFormField("run.prompt", true);
- }
- if (sAction == "reprompt") {
- if ( typeof repromptObserverNotify == "function" )
- {
- repromptObserverNotify(this);
- }
- oReq.addFormField("_promptControl", sAction);
- }
- else {
- oReq.addFormField("_promptControl", "prompt");
- }
- if (widget) {
- widget.fireEvent("com.ibm.bux.widget.modified", null, {'modified':true});
- if (widget.isSelectionFilterEnabled) {
- widget.clearSelectionFilter();
- }
- }
- this.submitPromptValues(oReq);
- }
- };
- CCognosViewer.prototype.cancelPrompt = function(sUrl)
- {
- this.cancel();
- };
- CCognosViewer.prototype.notify = function(iState, oNotifier)
- {
- var kCount = 0, k = 0;
- var oPromptElement = null;
- if (this.rangeObserverArray && this.rangeObserverArray instanceof Array)
- {
- kCount = this.rangeObserverArray.length;
- for (k=0; k<kCount; k++)
- {
- oPromptElement = eval(this.rangeObserverArray[k]);
- if (oPromptElement && typeof oPromptElement == "object" && typeof oPromptElement.update == "function")
- {
- oPromptElement.update();
- }
- }
- }
- var bPageEnabled = true;
- if (this.preProcessControlArray && this.preProcessControlArray instanceof Array)
- {
- kCount = this.preProcessControlArray.length;
- for (k=0; k<kCount; k++)
- {
- oPromptElement = eval(this.preProcessControlArray[k]);
- if ((typeof oPromptElement.getValid == "function") && !oPromptElement.getValid())
- {
- bPageEnabled = false;
- break;
- }
- }
- }
- this.notifyPageNavEnabled(bPageEnabled);
- if (this.multipleObserverArray && this.multipleObserverArray instanceof Array)
- {
- kCount = this.multipleObserverArray.length;
- for (k=0; k<kCount; k++)
- {
- oPromptElement = eval(this.multipleObserverArray[k]);
- if (oPromptElement && typeof oPromptElement == "object" && typeof oPromptElement.checkInsertRemove == "function")
- {
- oPromptElement.checkInsertRemove();
- }
- }
- }
- for (var idxNotif = 0; idxNotif < gaNotifyTargets.length; idxNotif++)
- {
- var oTarget = gaNotifyTargets[idxNotif];
- if (typeof oTarget != "undefined" && typeof oTarget.notify == "function")
- {
- oTarget.notify(iState, oNotifier);
- }
- }
- };
- CCognosViewer.prototype.notifyPageNavEnabled = function(bEnabled)
- {
- if (this.pageNavigationObserverArray && this.pageNavigationObserverArray instanceof Array)
- {
- var kCount = this.pageNavigationObserverArray.length;
-
- var bFinishPresent = false;
- var oPromptElement = null;
- var iPromptElementType = null;
- var k = 0;
- for (k=0; k<kCount; k++)
- {
- try
- {
- oPromptElement = eval(this.pageNavigationObserverArray[k]);
- iPromptElementType = oPromptElement.getType();
- if (iPromptElementType == PROMPTBUTTON_FINISH)
- {
- bFinishPresent = true;
- break;
- }
- }
- catch(e)
- {
- }
- }
- for (k=0; k<kCount; k++)
- {
- try
- {
- oPromptElement = eval(this.pageNavigationObserverArray[k]);
- iPromptElementType = oPromptElement.getType();
- if (!bEnabled)
- {
- if ((iPromptElementType == PROMPTBUTTON_NEXT) || (iPromptElementType == PROMPTBUTTON_OK) || (iPromptElementType == PROMPTBUTTON_FINISH))
- {
- oPromptElement.setEnabled(false);
- }
- }
- else
- {
- if (iPromptElementType == PROMPTBUTTON_FINISH)
- {
- oPromptElement.setEnabled(this.bCanFinish);
- }
- else if (iPromptElementType == PROMPTBUTTON_NEXT)
- {
- oPromptElement.setEnabled(this.bNextPage || !bFinishPresent);
- }
- else if (iPromptElementType == PROMPTBUTTON_OK)
- {
- oPromptElement.setEnabled(true);
- }
- }
- }
- catch(e2)
- {
- }
- }
- }
- };
- CCognosViewer.prototype.getDrillResetHUNs = function(sharePromptEventPayload)
- {
- var drilledOnHUNs = null;
- if (this.getRAPReportInfo()) {
- drilledOnHUNs = this.getRAPReportInfo().getDrilledOnHUNs();
- }
- if( !drilledOnHUNs ){ return null; }
- var executionParameters = this.getExecutionParameters();
- if( !executionParameters ) { return null; }
- var changedPromptParamsList = this._getListOfChangedPromptParameters(sharePromptEventPayload);
- if (!changedPromptParamsList || changedPromptParamsList.length === 0) {
- return null;
- }
- var aDrillResetHUNs = [];
- for( var i = 0; i < drilledOnHUNs.length; i++ ){
- for (var j =0; j < changedPromptParamsList.length; j++) {
- if( changedPromptParamsList[j].indexOf( drilledOnHUNs[i] ) !== -1 ) {
- aDrillResetHUNs.push( drilledOnHUNs[i] );
- }
- }
- }
- return aDrillResetHUNs;
- };
- CCognosViewer.prototype.getOldParameters = function(){
- var oldParmValues = new CParameterValues();
- var documentNode = XMLBuilderLoadXMLFromString(this.getExecutionParameters());
- if (documentNode.childNodes.length == 1) {
- oldParmValues.loadWithOptions(documentNode.childNodes[0], false);
- }
- if( !oldParmValues || !oldParmValues.m_parameterValues || !oldParmValues.m_parameterValues.m_aValues){
- return null;
- }
- return oldParmValues.m_parameterValues.m_aValues;
- };
- CCognosViewer.prototype._createDummyRequest = function() {
- var dummyReq = new ViewerDispatcherEntry( this );
- return this.preparePromptValues(dummyReq);
- };
- CCognosViewer.prototype._getChangedPromptParametersValues = function( oldParmValueItems, newParmValue, changedPromptParamsList ) {
-
- var documentNode = XMLBuilderLoadXMLFromString( newParmValue );
- if( !documentNode) {
-
- for( var j=0; j < oldParmValueItems.length; j++ )
- {
- var oldParmValue = oldParmValueItems[j].m_useValue;
- if( newParmValue.indexOf( sXmlEncode( oldParmValue ) ) < 0 ){
- changedPromptParamsList.push(oldParmValue);
- }
- }
- return;
- }
-
- var newParameters = documentNode.getElementsByTagName( "selectOption");
- if( !newParameters )
- {
- return;
- }
- var noOfOldParameterValues = oldParmValueItems.length;
- var noOfNewParameterValues = newParameters.length;
-
- for( var i=0; i < noOfNewParameterValues; i++ )
- {
- var newParmValue = newParameters[i].attributes.getNamedItem("useValue").nodeValue;
- bMatchOldParam = false;
- for( var j=0; j < noOfOldParameterValues; j++ )
- {
- var oldParmValue = oldParmValueItems[j].m_useValue;
- if( newParmValue.indexOf( oldParmValue ) === 0 ){
- bMatchOldParam = true;
- break;
- }
- }
- if( !bMatchOldParam )
- {
- changedPromptParamsList.push( newParmValue )
- }
- }
- };
- CCognosViewer.prototype._getListOfChangedPromptParameters = function(sharePromptEventPayload)
- {
- var oldParameters = this.getOldParameters();
- if( !oldParameters ) { return null; }
- var changedPromptParamsList = [];
- if( !sharePromptEventPayload ){
-
- var oRequest = this._createDummyRequest();
- for (var oldParm in oldParameters){
- var oldParmValueItems = oldParameters[oldParm].m_parmValueItems;
- var newParmValue = oRequest.getRequest().getFormFields().get('p_' + oldParm);
- if (!newParmValue) { continue; }
- this._getChangedPromptParametersValues(oldParmValueItems, newParmValue, changedPromptParamsList);
- }
- } else {
- if( !sharePromptEventPayload.parameters ){ return null; }
- var newParameters = sharePromptEventPayload.parameters;
- for( var i = 0; i < newParameters.length; i++ ){
- var newParmName = newParameters[i].parmName;
- if( !newParmName || !oldParameters[newParmName] ){ continue; }
- var oldParmValueItems = oldParameters[newParmName].m_parmValueItems;
- if( !oldParmValueItems || oldParmValueItems.length == 0 ){ continue; }
- this._getChangedPromptParametersValues( oldParmValueItems, newParameters[i].parmValue, changedPromptParamsList );
- }
- }
- return changedPromptParamsList;
- };
- CCognosViewer.prototype.submitPromptValues = function(oReq)
- {
- if ( this.gbPromptRequestSubmitted === true )
- {
- return false;
- }
- this.gbPromptRequestSubmitted = true;
- if( this.isBux ) {
- var aDrillResetHUNs = this.getDrillResetHUNs(null);
- if(aDrillResetHUNs && aDrillResetHUNs.length !== 0 ){
- var parms = { 'drilledResetHUNs' : aDrillResetHUNs };
- this.executeAction( "DrillReset", parms );
- return;
- }
- }
- oReq = this.preparePromptValues(oReq);
- if (window.portletSharePrompt) {
- var portletPromptParams = this.portletPromptParams(oReq);
- if (portletPromptParams.length > 0) {
- portletSharePrompt(portletPromptParams);
- }
- }
- this.dispatchRequest(oReq);
- };
- CCognosViewer.prototype.portletPromptParams = function(oReq) {
- var result = [];
- var requestParam = null;
- var validSharePrompt = true;
- var aParameters = oReq.getFormFields().keys();
- for (var idxParameter = 0; idxParameter < aParameters.length; idxParameter++) {
- requestParam = aParameters[idxParameter];
-
- if (requestParam == "_promptControl" && oReq.getFormField(requestParam) == "search") {
- validSharePrompt = false;
- break;
- }
- else
- if (requestParam.indexOf("p_") === 0) {
- if (requestParam.indexOf("p_credential") === 0) {
- validSharePrompt = false;
- break;
- }
- else {
- result.push([requestParam, oReq.getFormField(requestParam)]);
- }
- }
- }
- if (result && !validSharePrompt) {
- result = [];
- }
- return result;
- };
- CCognosViewer.prototype.preparePromptValues = function(oReq)
- {
-
- var aInputSubmitted = [];
- if (this.preProcessControlArray)
- {
- var kCount = this.preProcessControlArray.length;
- var k = 0;
- for (k=0; k<kCount; k++)
- {
- var oPrmtCtrl = eval(this.preProcessControlArray[k]);
- var bPrmtEnabled = (typeof oPrmtCtrl.isEnabled == "function" ? oPrmtCtrl.isEnabled() : true);
- if (oPrmtCtrl && typeof oPrmtCtrl.preProcess == "function" && bPrmtEnabled)
- {
- oPrmtCtrl.preProcess();
- if (oPrmtCtrl.m_oSubmit)
- {
-
- if (oReq.addParameter) {
- oReq.addParameter(oPrmtCtrl.m_oSubmit.name, oPrmtCtrl.m_oSubmit.value);
- }
- else {
- oReq.addFormField(oPrmtCtrl.m_oSubmit.name, oPrmtCtrl.m_oSubmit.value);
- }
- aInputSubmitted.push(oPrmtCtrl.m_oSubmit);
- if (oPrmtCtrl.m_sPromptId && oPrmtCtrl.m_oForm && oPrmtCtrl.m_oForm.elements && typeof oPrmtCtrl.m_oForm.elements['p_' + oPrmtCtrl.m_sRef] == "object")
- {
-
- if (oReq.addParameter) {
- oReq.addParameter('p_' + oPrmtCtrl.m_sPromptId, oPrmtCtrl.m_oForm.elements['p_' + oPrmtCtrl.m_sRef].value);
- }
- else {
- oReq.addFormField('p_' + oPrmtCtrl.m_sPromptId, oPrmtCtrl.m_oForm.elements['p_' + oPrmtCtrl.m_sRef].value);
- }
- }
- }
- }
- }
- }
- var elFWR = document.getElementById("formWarpRequest" + this.getId());
- if (elFWR)
- {
- var aInputs = elFWR.elements;
- for (var idxInput = 0; idxInput < aInputs.length; idxInput++)
- {
- var elInput = aInputs[idxInput];
- if ( !elInput.name || !elInput.name.match(/^p_/) )
- {
- continue;
- }
- var bToAdd = true;
- for (var idxSubmitted = 0; idxSubmitted < aInputSubmitted.length; idxSubmitted++)
- {
- if (aInputSubmitted[idxSubmitted] == elInput)
- {
- bToAdd = false; break;
- }
- }
- if (bToAdd)
- {
- oReq.addFormField(elInput.name, elInput.value);
- aInputSubmitted.push(elInput);
- }
- }
- }
- var oRM = this['CognosReport'];
- if (oRM)
- {
- var aParams = oRM.prompt.getParameters();
- for (var i = 0; i < aParams.length; i++)
- {
- var sName = "p_" + aParams[i].getName();
- if ( !oReq.getFormField(sName) )
- {
- oReq.addFormField(sName, aParams[i].getXML());
- }
- }
- }
- return oReq;
- };
- CCognosViewer.prototype.setViewerWidget = function( cvWidget )
- {
- this.m_viewerWidget = cvWidget;
- };
- CCognosViewer.prototype.getViewerWidget = function()
- {
- return this.m_viewerWidget;
- };
- CCognosViewer.prototype.getFlashChartOption = function()
- {
- var cvWidget = this.getViewerWidget();
- var flashCharts = null;
- if (cvWidget) {
- var props = cvWidget.getProperties();
- if (props) {
- flashCharts = props.getFlashCharts();
- }
- }
- return flashCharts;
- };
- CCognosViewer.prototype.fireWidgetEvent = function( evt, payload )
- {
- var viewerIWidget = this.getViewerWidget();
- if (viewerIWidget != null) {
- viewerIWidget.fireEvent(evt, null, payload);
- }
- };
- CCognosViewer.prototype.isMobile = function() { return false; };
- CCognosViewer.prototype.setVisibleDialog = function(dialog) {
- this.m_visibleDialog = dialog;
- };
- CCognosViewer.prototype.getVisibleDialog = function() {
- if (typeof this.m_visibleDialog != "undefined") {
- return this.m_visibleDialog;
- }
- return null;
- };
- CCognosViewer.prototype.getContentLocale = function() {
- var formWarpRequest = document.getElementById("formWarpRequest" + this.getId());
- if (formWarpRequest && formWarpRequest["ui.contentLocale"] && formWarpRequest["reRunObj"] && formWarpRequest["reRunObj"].value.length > 0)
- {
- return formWarpRequest["ui.contentLocale"].value;
- }
- return null;
- };
- CCognosViewer.prototype.updateLayout = function(sState)
- {
- var cvid = this.getId();
- var oHeader = document.getElementById('CVHeader' + cvid);
- var oToolbar = document.getElementById('CVToolbar' + cvid);
- if (!oHeader && !oToolbar)
- {
- setTimeout(getCognosViewerObjectRefAsString(cvid) + '.updateLayout("' + sState + '");', 100);
- return;
- }
- if (oHeader) {
- var hideBannerConfig = this.getUIConfig() && !this.getUIConfig().getShowBanner();
- if ((sState == "prompting" && !this.bShowHeaderWithPrompts) || hideBannerConfig) {
- oHeader.parentNode.style.display = "none";
- }
- else {
- oHeader.parentNode.style.display = "";
- }
- }
- if (oToolbar) {
- if (sState == "prompting" || this.m_bHideToolbar == true) {
- oToolbar.parentNode.style.display = "none";
- }
- else {
- oToolbar.parentNode.style.display = "";
- }
- }
- };
- CCognosViewer.prototype.updateResponseSpecification = function(sResponseSpecification)
- {
- this.sResponseSpecification = sResponseSpecification;
- };
- CCognosViewer.prototype.getResponseSpecification = function()
- {
- return this.sResponseSpecification;
- };
- CCognosViewer.prototype.release = function(asynchronous)
- {
- if( this.getStatus() != 'fault' )
- {
- this._release(asynchronous);
- }
- };
- CCognosViewer.prototype._release = function(asynchronous)
- {
- var form = document.getElementById("formWarpRequest" + this.getId());
- var tracking = this.getTracking();
- if(!tracking && form && form["m_tracking"] && form["m_tracking"].value) {
- tracking = form["m_tracking"].value;
- form["m_tracking"].value = "";
- }
-
- this.setTracking("");
- if(tracking)
- {
- var request = new DispatcherEntry(this);
- if( this.isWorkingOrPrompting() ) {
- request.addFormField("ui.action", "cancel");
- }
- else {
- request.addFormField("ui.action", "release");
- }
- request.addFormField("cv.responseFormat", "successfulRequest");
- request.addNonEmptyStringFormField("ui.primaryAction", this.envParams["ui.primaryAction"]);
- request.addNonEmptyStringFormField("ui.objectClass", this.envParams["ui.objectClass"]);
- request.addFormField("m_tracking", tracking);
- if (asynchronous != true) {
- request.forceSynchronous();
- }
-
-
- var activeRequest = this.getActiveRequest() ? this.getActiveRequest() : this.getFaultDispatcherEntry();
- if (activeRequest && activeRequest.getFormField("cv.outputKey")) {
- request.addFormField("b_action", "cvx.high");
- request.addFormField("cv.outputKey", activeRequest.getFormField("cv.outputKey"));
- request.addFormField("cv.waitForResponse", "false");
- request.setHeaders(activeRequest.getHeaders());
- }
-
- var formFields = request.getRequest().getFormFields();
- var formFieldNames = formFields.keys();
-
- var data = new URLSearchParams();
- for (var index = 0; index < formFieldNames.length; index++) {
- data.append(formFieldNames[index], formFields.get(formFieldNames[index]));
- }
- if (!navigator.sendBeacon(this.getGateway(), data)) {
- if (typeof console !== "undefined" && console.log) {
- console.log("CCognosViewer: release sendBeacon failed.");
- }
- }
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.cleanupStyles = function() {
- if (this.getViewerWidget()) {
- this.getViewerWidget().cleanupStyles();
- }
- };
- CCognosViewer.prototype.destroy = function(asynchronous) {
- this.release(asynchronous);
- if (!this.m_destroyed)
- {
-
- if( typeof window.gaRV_INSTANCES != "undefined") {
- for (var iIndex=0; iIndex < window.gaRV_INSTANCES.length; iIndex++)
- {
- if (window.gaRV_INSTANCES[iIndex].m_sId == this.getId())
- {
- window.gaRV_INSTANCES.splice(iIndex, 1);
- this.m_destroyed = true;
- break;
- }
- }
- }
- if (this.m_layoutElements) {
- for (var i=0; i<this.m_layoutElements.length; i++) {
- var e = this.m_layoutElements[i];
- var j = e.getAttribute("lid");
- this.m_layoutElements.splice(i, 1);
- delete this.m_lidToElement[j];
- var parentNode = e.parentNode;
- if (parentNode) {
- parentNode.removeChild(e);
- }
- }
- delete this.m_layoutElements;
- delete this.m_lidToElement;
- }
- if (this.m_oDrillMgr) {
- this.m_oDrillMgr.setCV(null);
- }
- var selectionController = this.getSelectionController();
- if (selectionController) {
- GUtil.destroyProperties(selectionController);
- }
- var cvId = this.getId();
- this.m_viewerDispatcher = null;
- GUtil.destroyProperties(this, true);
- cleanupGlobalObjects(cvId);
- }
- };
- CCognosViewer.prototype.exit = function()
- {
- this.release();
- };
- CCognosViewer.prototype.executeAction = function(sAction, parms )
- {
- var action = this.getAction(sAction);
- action.setRequestParms( parms );
- return action.execute();
- };
- CCognosViewer.prototype.getCalculation = function(sCalculation){
- var calc = null;
- var calcCache = this.getCalculationCache();
- if (calcCache[sCalculation]) {
- calc = calcCache[sCalculation];
- } else {
- if (window[sCalculation] && typeof window[sCalculation] == "function") {
- calc = new window[sCalculation]();
- calc.setCognosViewer(this);
- }
- calcCache[sCalculation] = calc;
- }
- return calc;
- };
- CCognosViewer.prototype.findBlueDotMenu = function(aMenuItems)
- {
- var root = null;
- var items = (aMenuItems) ? aMenuItems : this.getToolbar();
- for(var idx = 0; idx < items.length; ++idx) {
- if (typeof items[idx]._root != "undefined") {
- root = items[idx]._root;
- break;
- }
- }
- return root;
- };
- CCognosViewer.prototype.findToolbarItem = function(itemName, toolbarSpec)
- {
- var spec = typeof toolbarSpec == "undefined" || toolbarSpec == null ? this.getToolbar() : toolbarSpec;
- var buttonSpec = null;
- for(var iIndex = 0; iIndex < spec.length; ++iIndex) {
- var name = spec[iIndex]["name"];
- if (typeof name != "undefined" && name == itemName) {
- buttonSpec = spec[iIndex];
- break;
- }
- }
- return buttonSpec;
- };
- CCognosViewer.prototype.findToolbarItemIndex = function(itemName, toolbarSpec)
- {
- var spec = typeof toolbarSpec == "undefined" || toolbarSpec == null ? this.getToolbar() : toolbarSpec;
- var buttonIndex = null;
- for(var iIndex = 0; iIndex < spec.length; ++iIndex) {
- var name = spec[iIndex]["name"];
- if (typeof name != "undefined" && name == itemName) {
- buttonIndex = iIndex;
- break;
- }
- }
- return buttonIndex;
- };
- CCognosViewer.prototype.addedButtonToToolbar = function(toolBarSpec, buttonToAdd, precedingButton, buttonLocation)
- {
- if (typeof buttonToAdd != "undefined" && buttonToAdd != null) {
- if (this.findToolbarItem(buttonToAdd.name, toolBarSpec) == null) {
-
- precedingButton = this.findToolbarItemIndex(precedingButton, toolBarSpec);
- if (typeof precedingButton != "undefined" && precedingButton != null) {
- toolBarSpec.splice(++precedingButton, 0, buttonToAdd);
- return true;
- }
-
- else if (typeof buttonLocation != "undefined" && buttonLocation != null) {
- toolBarSpec.splice(buttonLocation, 0, buttonToAdd);
- return true;
- }
- }
- }
- return false;
- };
- CCognosViewer.prototype.addDrillTargets = function(drillTargets)
- {
- this.m_drillTargets = drillTargets;
- };
- CCognosViewer.prototype.getDrillTargets = function()
- {
- if (this.m_drillTargets.length == 0 && this.envParams["ui.action"] == "view")
- {
- var iframe = document.getElementById("CVIFrame" + this.getId());
- if (typeof iframe != "undefined" && iframe != null)
- {
- if (iframe.contentWindow.drillTargets)
- {
- return iframe.contentWindow.drillTargets;
- }
- }
- }
- return this.m_drillTargets;
- };
- CCognosViewer.prototype.getDrillTarget = function(idx)
- {
- if(idx >= this.m_drillTargets.length)
- {
- return null;
- }
- return this.m_drillTargets[idx];
- };
- CCognosViewer.prototype.getNumberOfDrillTargets = function()
- {
- return this.m_drillTargets.length;
- };
- CCognosViewer.prototype.isReportRenderingDone = function()
- {
- return this.m_reportRenderingDone;
- };
- CCognosViewer.prototype.setReportRenderingDone = function(flag)
- {
- this.m_reportRenderingDone = flag;
- };
- CCognosViewer.prototype.hasAVSChart = function()
- {
- var oRAPReportInfo = this.getRAPReportInfo();
- if (oRAPReportInfo) {
- var sDisplayTypes = oRAPReportInfo.getDisplayTypes();
- return sDisplayTypes.match("_v2") != null || sDisplayTypes.match("v2_") != null;
- }
- return false;
- };
- CCognosViewer.prototype.getPinFreezeManager = function() {
- return this.m_pinFreezeManager;
- };
- CCognosViewer.prototype.getReportContextHelper = function() {
- if(!this.m_reportContextHelper) {
- this.m_reportContextHelper = new ReportContextHelper(this.getSelectionController().getCCDManager());
- }
- return this.m_reportContextHelper;
- };
- CCognosViewer.prototype.getRAPReportInfo = function() {
- return this.m_RAPReportInfo;
- };
- CCognosViewer.prototype.setRAPReportInfo = function(oRapReportInfo) {
- this.m_RAPReportInfo = oRapReportInfo;
- };
- CCognosViewer.prototype.isNodeVisible = function(node) {
- if(this.m_pinFreezeManager) {
- return this.m_pinFreezeManager.isNodeVisible(node);
- }
- return true;
- };
- CCognosViewer.prototype.getWarpRequestForm = function() {
- return document.getElementById("formWarpRequest" + this.getId());
- };
- CCognosViewer.prototype.getBrowser = function() {
- return this.sBrowser;
- };
- CCognosViewer.prototype.repaintDiv = function(oDiv) {
- var display = oDiv.style.display;
- oDiv.style.display = "none";
- oDiv.style.display = display;
- };
- CCognosViewer.prototype.isMetadataEmpty = function () {
- var oSC = this.getSelectionController();
- if (oSC) {
- var oCCDM = oSC.getCCDManager();
- if (oCCDM) {
- return oCCDM.isMetadataEmpty();
- }
- }
- return true;
- };
- CCognosViewer.prototype.setContextMenu = function(contextMenu) {
- this.m_contextMenu = contextMenu;
- };
- CCognosViewer.prototype.getContextMenu = function() {
- return this.m_contextMenu;
- };
- CCognosViewer.prototype.setToolbar = function(toolbar) {
- this.m_toolbar = toolbar;
- };
- CCognosViewer.prototype.getToolbar = function() {
- return this.m_toolbar;
- };
- CCognosViewer.prototype.getAdvancedServerProperty = function(property) {
- if(this.m_advancedProperties && this.m_advancedProperties[property] !== undefined &&
- this.m_advancedProperties[property] !== null) {
- return this.m_advancedProperties[property];
- } else {
- return null;
- }
- };
- CCognosViewer.prototype.hasPrompt = function() {
-
- if (typeof this.m_bHasPrompt === "undefined" || this.m_bHasPrompt === null) {
- var foundPrompt = false;
- if (this.getAdvancedServerProperty("VIEWER_JS_PROMPT_AGAIN_SHOW_ALWAYS") === "true" ||
- (this.envParams.reportPrompts && this.envParams.reportPrompts.length>0 )) {
- foundPrompt = true;
- } else {
-
- var paramValues = new CParameterValues();
- var documentNode = XMLBuilderLoadXMLFromString(this.getExecutionParameters());
- if (documentNode.childNodes.length == 1) {
- paramValues.loadWithOptions(documentNode.childNodes[0], true);
-
- var numberOfParameters = paramValues.length();
- for (var index = 0; index < numberOfParameters; ++index) {
- var parameter = paramValues.getAt(index);
- if (parameter !== null && parameter.length() > 0 &&
- parameter.name().indexOf("credential:") != -1) {
- foundPrompt = true;
- break;
- }
- }
- }
- }
-
- this.m_bHasPrompt = foundPrompt;
- }
- return this.m_bHasPrompt;
- };
- CCognosViewer.prototype.getDrillState = function() {
-
- return this.m_sStateData ? this.m_sStateData : "";
- };
- CCognosViewer.prototype.isSelectionFilterEnabled = function() {
- if (typeof this.m_bSelectionFilterSwitch == "undefined") {
- this.m_bSelectionFilterSwitch = false;
- }
- return this.m_bSelectionFilterSwitch;
- };
-
- CCognosViewer.prototype.broadcastContextChange = function(evt, payload) {
- if (this.getViewerWidget()) {
- this.getViewerWidget().broadcastContextChange(payload);
- }
-
- stopEventBubble(evt);
- };
- CCognosViewer.prototype.broadcastParameterChange = function(evt, payload) {
- if (this.getViewerWidget()) {
- this.getViewerWidget().broadcastParameterChange(payload);
- }
- stopEventBubble(evt);
- };
- CCognosViewer.prototype.getReportDiv = function() {
- if (!this.m_nReportDiv) {
- this.m_nReportDiv = document.getElementById("CVReport" + this.m_sId);
- }
- return this.m_nReportDiv;
- };
- function CDocumentWriter(sId, sScript)
- {
- this.m_sId = sId;
- this.m_sText = "";
- this.m_sScript = sScript;
- }
- CDocumentWriter.prototype.isValid = function()
- {
- if(typeof this.m_sScript != "undefined" && this.m_sScript && window.gScriptLoader)
- {
-
-
-
- return true;
- }
- return false;
- };
- CDocumentWriter.prototype.execute = function()
- {
- if(this.isValid() && window.gScriptLoader)
- {
- var reDocumentWrite = /document\.write(ln)?\s*\(/gi;
- var sScript = this.m_sScript.replace(reDocumentWrite, "this.write(").replace(window.gScriptLoader.m_reScriptTagOpen, "").replace(window.gScriptLoader.m_reScriptTagClose, "");
- try
- {
- eval(sScript);
- var placeHolderNode = document.getElementById(this.m_sId);
- if(placeHolderNode)
- {
- placeHolderNode.innerHTML = this.m_sText;
- return true;
- }
- }
- catch(e){}
- }
- return false;
- };
- CDocumentWriter.prototype.write = function(oArgument)
- {
- var sResult = "";
- if(typeof oArgument == "function")
- {
- sResult = eval(oArgument);
- }
- else if(typeof oArgument == "string")
- {
- sResult = oArgument;
- }
- this.m_sText += sResult;
- };
- function setFocusToFirstTabItem(container) {
- if (!window.dojo) {
- return;
- }
- var arrNodes = dojo.query("*", container);
- var nodesLen = arrNodes.length;
- for (var i = 0; i < nodesLen; i++) {
- var node = arrNodes[i];
-
- if (!node.style || (node.style.display != "none" && node.style.visibility != "hidden")) {
- if (node.getAttribute("tabIndex") == 0) {
- try {
- node.focus();
- }
- catch (e) {
-
- }
- break;
- }
- }
- }
- }
- function ReportContextHelper(oCDManager) {
- this.m_oCDManager = oCDManager;
- }
- ReportContextHelper.prototype.destroy = function() {
- if (this.m_oCDManager && this.m_oCDManager.destroy) {
- this.m_oCDManager.destroy();
- }
- delete this.m_oCDManager;
- };
- ReportContextHelper.prototype.processCtx = function(sCtx) {
- var aContextIds0 = sCtx.split("::");
- var aContextIds1 = [];
- for(var i = 0; i < aContextIds0.length; ++i) {
- aContextIds1[i] = aContextIds0[i].split(":");
- }
- if(aContextIds1 && aContextIds1.length && aContextIds1[0].length) {
- return aContextIds1;
- } else {
- return null;
- }
- };
- ReportContextHelper.prototype.getDataItemName = function(sCtx) {
- var aRefDataItem = this.processCtx(sCtx);
- if (aRefDataItem) {
- return this.getRefDataItem(aRefDataItem[0][0]);
- }
- return null;
- };
- ReportContextHelper.prototype.getRefDataItem = function(sCtxId) {
- var sRefDataItem = this.m_oCDManager.GetRDIValue(sCtxId);
- return (sRefDataItem == null) ? "" : sRefDataItem;
- };
- ReportContextHelper.prototype.getMun = function(oParam)
- {
- var aCtx = null;
- if(typeof oParam === "string") {
- aCtx = this.processCtx(oParam);
- } else if(typeof oParam === "number") {
- aCtx = this.processCtx(oParam.toString());
- } else {
- aCtx = oParam;
- }
- if (aCtx) {
- var sMun = this.m_oCDManager.GetMUN(aCtx[0][0]);
- return (sMun == null) ? "" : sMun;
- }
- return "";
- };
|