viewer.core.js 1014 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2014
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. function CViewerHelper(){
  13. this.m_oCV=null;
  14. };
  15. CViewerHelper.prototype.getCVObjectRef=function(){
  16. return this.getCV().getObjectId();
  17. };
  18. CViewerHelper.prototype.getCV=function(){
  19. if(this.m_oCV){
  20. return this.m_oCV;
  21. }
  22. return window;
  23. };
  24. CViewerHelper.prototype.getCVId=function(){
  25. var _1="";
  26. if(this.m_oCV){
  27. _1=this.m_oCV.getId();
  28. }
  29. return _1;
  30. };
  31. CViewerHelper.prototype.setCV=function(_2){
  32. this.m_oCV=_2;
  33. };
  34. function CObserver(_3){
  35. this.m_subject=_3;
  36. this.m_observers=[];
  37. };
  38. function CObserver_attach(_4,_5,_6){
  39. if(_4==null||typeof _4.update!="function"){
  40. alert("Notification Frame Work Error : attach failed");
  41. return false;
  42. }
  43. var _7=new CState(this.m_subject,_4,_5?_5:null,_6?_6:null);
  44. this.m_observers[this.m_observers.length]=_7;
  45. return true;
  46. };
  47. function CObserver_detach(_8){
  48. };
  49. function CObserver_hasObserver(_9){
  50. var _a=false;
  51. for(var _b=0;_b<this.m_observers.length;_b++){
  52. if(this.m_observers[_b].getObserver()==_9){
  53. _a=true;
  54. break;
  55. }
  56. }
  57. return _a;
  58. };
  59. function CObserver_notify(_c){
  60. var i=0;
  61. if(typeof _c!="undefined"&&_c!=null){
  62. for(i=0;i<this.m_observers.length;++i){
  63. if(this.m_observers[i].getEvt()==_c){
  64. var _e=this.m_observers[i].getObserver();
  65. var _f=this.m_observers[i].getCallback();
  66. var _10=_e.update;
  67. _e.update=_f;
  68. _e.update(this.m_observers[i]);
  69. _e.update=_10;
  70. }
  71. }
  72. }else{
  73. for(i=0;i<this.m_observers.length;++i){
  74. this.m_observers[i].getObserver().update(this.m_observers[i].getSubject());
  75. }
  76. }
  77. };
  78. CObserver.prototype.attach=CObserver_attach;
  79. CObserver.prototype.detach=CObserver_detach;
  80. CObserver.prototype.notify=CObserver_notify;
  81. CObserver.prototype.hasObserver=CObserver_hasObserver;
  82. function CState(_11,_12,_13,evt){
  83. this.m_subject=_11;
  84. this.m_observer=_12;
  85. this.m_callback=_13;
  86. this.m_evt=evt;
  87. };
  88. function CState_getObserver(){
  89. return this.m_observer;
  90. };
  91. function CState_getCallback(){
  92. return this.m_callback;
  93. };
  94. function CState_getSubject(){
  95. return this.m_subject;
  96. };
  97. function CState_getEvt(){
  98. return this.m_evt;
  99. };
  100. CState.prototype.getObserver=CState_getObserver;
  101. CState.prototype.getCallback=CState_getCallback;
  102. CState.prototype.getSubject=CState_getSubject;
  103. CState.prototype.getEvt=CState_getEvt;
  104. function CParameterValueStringOperators(_15,_16,_17,_18){
  105. this.m_sBetween=_15;
  106. this.m_sNotBetween=_16;
  107. this.m_sLessThan=_17;
  108. this.m_sGreaterThan=_18;
  109. };
  110. function CParameterValues(){
  111. this.m_parameterValues=new CDictionary();
  112. };
  113. CParameterValues.prototype.length=function(){
  114. var _19=this.m_parameterValues.keys();
  115. if(typeof _19=="undefined"||_19==null){
  116. return 0;
  117. }
  118. return _19.length;
  119. };
  120. CParameterValues.prototype.getParameterValue=function(_1a){
  121. if(typeof _1a!="string"||_1a==""){
  122. return null;
  123. }
  124. if(this.m_parameterValues.exists(_1a)){
  125. return this.m_parameterValues.get(_1a);
  126. }
  127. return null;
  128. };
  129. CParameterValues.prototype.getAt=function(_1b){
  130. if(_1b<this.length()){
  131. var _1c=this.m_parameterValues.keys();
  132. if(this.m_parameterValues.exists(_1c[_1b])){
  133. return this.m_parameterValues.get(_1c[_1b]);
  134. }
  135. }
  136. return null;
  137. };
  138. CParameterValues.prototype.addParameterValue=function(_1d,_1e){
  139. var _1f=this.getParameterValue(_1d);
  140. if(_1f==null){
  141. _1f=new CParameterValue();
  142. _1f.setName(_1d);
  143. }
  144. _1f.addParmValueItem(_1e);
  145. this.m_parameterValues.add(_1d,_1f);
  146. };
  147. CParameterValues.prototype.removeParameterValue=function(_20){
  148. return (this.m_parameterValues.remove(_20)!=null);
  149. };
  150. CParameterValues.prototype.removeSimpleParmValueItem=function(_21,_22){
  151. var _23=this.getParameterValue(_21);
  152. if(_23==null){
  153. return false;
  154. }
  155. return _23.removeSimpleParmValueItem(_22);
  156. };
  157. CParameterValues.prototype.addSimpleParmValueItem=function(_24,_25,_26,_27){
  158. if(typeof _24!="string"||_24==""){
  159. return null;
  160. }
  161. if(typeof _25!="string"||_25==""){
  162. return null;
  163. }
  164. if(typeof _26!="string"){
  165. return null;
  166. }
  167. if(typeof _27!="string"||(_27!="false"&&_27!="true")){
  168. return null;
  169. }
  170. var _28=null;
  171. if(this.m_parameterValues.exists(_24)==false){
  172. _28=new CParameterValue(_24);
  173. this.m_parameterValues.add(_24,_28);
  174. }
  175. _28=this.m_parameterValues.get(_24);
  176. if(typeof _28=="undefined"||_28==null){
  177. return null;
  178. }
  179. var _29=_28.getParmValueItems();
  180. for(var _2a=0;_2a<_29.length;++_2a){
  181. var _2b=_29[_2a];
  182. if(_2b.getDisplayValue()==_26&&_2b.getUseValue()==_25){
  183. return;
  184. }
  185. }
  186. return _28.addSimpleParmValueItem(_25,_26,_27);
  187. };
  188. CParameterValues.prototype.getSimpleParmValueItem=function(_2c,_2d){
  189. var _2e=this.getParameterValue(_2c);
  190. if(_2e!=null){
  191. return _2e.getSimpleParmValueItem(_2d);
  192. }
  193. return null;
  194. };
  195. CParameterValues.prototype.load=function(_2f){
  196. return this.loadWithOptions(_2f,true);
  197. };
  198. CParameterValues.prototype.loadWithOptions=function(_30,_31){
  199. try{
  200. var _32=_30.childNodes;
  201. for(var _33=0;_33<_32.length;++_33){
  202. var _34=_32[_33];
  203. if(_34.nodeType==3){
  204. continue;
  205. }
  206. var _35=new CParameterValue();
  207. if(_35.load(_34)){
  208. var _36=_35.name();
  209. if(_36!=""){
  210. if(_31==true||_36.indexOf("credential:")!=0){
  211. this.m_parameterValues.add(_36,_35);
  212. }
  213. }
  214. }else{
  215. delete _35;
  216. }
  217. }
  218. }
  219. catch(e){
  220. return false;
  221. }
  222. return true;
  223. };
  224. CParameterValues.prototype.buildXML=function(_37,_38,_39){
  225. var _3a=_38.createElement(_39);
  226. _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
  227. _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
  228. _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
  229. _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance");
  230. _37.XMLBuilderSetAttributeNodeNS(_3a,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
  231. _37.XMLBuilderSetAttributeNodeNS(_3a,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  232. _38.documentElement.appendChild(_3a);
  233. var _3b=this.m_parameterValues.keys();
  234. for(var _3c=0;_3c<_3b.length;++_3c){
  235. if(this.m_parameterValues.exists(_3b[_3c])){
  236. var _3d=this.m_parameterValues.get(_3b[_3c]);
  237. _3d.generateXML(_37,_3a);
  238. }
  239. }
  240. return _3a;
  241. };
  242. CParameterValues.prototype.generateXML=function(_3e,_3f,_40){
  243. var _41="parameterValues";
  244. if(typeof _40!="undefined"&&_40!=null){
  245. _41=_40;
  246. }
  247. XMLBuilderSerializeNode(this.buildXML(_3e,_3f,_41));
  248. return XMLBuilderSerializeNode(_3f);
  249. };
  250. function CParameterValue(_42){
  251. this.m_name=_42;
  252. this.m_parmValueItems=[];
  253. };
  254. CParameterValue.prototype.name=function(){
  255. return this.m_name;
  256. };
  257. CParameterValue.prototype.setName=function(_43){
  258. this.m_name=_43;
  259. };
  260. CParameterValue.prototype.getParmValueItems=function(){
  261. return this.m_parmValueItems;
  262. };
  263. CParameterValue.prototype.length=function(){
  264. return this.m_parmValueItems.length;
  265. };
  266. CParameterValue.prototype.addParmValueItem=function(_44){
  267. this.m_parmValueItems.push(_44);
  268. };
  269. CParameterValue.prototype.addSimpleParmValueItem=function(_45,_46,_47){
  270. if(typeof _45!="string"||_45==""){
  271. return null;
  272. }
  273. if(typeof _46!="string"){
  274. return null;
  275. }
  276. if(typeof _47!="string"||(_47!="false"&&_47!="true")){
  277. return null;
  278. }
  279. var _48=new CSimpleParmValueItem(_45,_46,_47);
  280. this.m_parmValueItems.push(_48);
  281. return _48;
  282. };
  283. CParameterValue.prototype.removeSimpleParmValueItem=function(_49){
  284. if(typeof _49!="string"||_49==""){
  285. return false;
  286. }
  287. var _4a=[];
  288. var _4b=false;
  289. for(var _4c=0;_4c<this.length();++_4c){
  290. var _4d=this.m_parmValueItems[_4c];
  291. if(_4d instanceof CSimpleParmValueItem){
  292. if(_4d.getUseValue()==_49){
  293. _4b=true;
  294. continue;
  295. }
  296. }
  297. _4a.push(_4d);
  298. }
  299. this.m_parmValueItems=_4a;
  300. return _4b;
  301. };
  302. CParameterValue.prototype.getSimpleParmValueItem=function(_4e){
  303. if(typeof _4e!="string"||_4e==""){
  304. return null;
  305. }
  306. for(var _4f=0;_4f<this.length();++_4f){
  307. var _50=this.m_parmValueItems[_4f];
  308. if(_50 instanceof CSimpleParmValueItem){
  309. if(_50.getUseValue()==_4e){
  310. return _50;
  311. }
  312. }
  313. }
  314. return null;
  315. };
  316. CParameterValue.prototype.load=function(_51){
  317. var _52=_51.getAttributeNode("xsi:type");
  318. if(_52==null||_52.nodeValue!="bus:parameterValue"){
  319. return false;
  320. }
  321. var _53=XMLHelper_FindChildByTagName(_51,"name",false);
  322. if(_53==null){
  323. return false;
  324. }
  325. this.m_name=XMLHelper_GetText(_53);
  326. if(this.m_name==""){
  327. return false;
  328. }
  329. var _54=XMLHelper_FindChildByTagName(_51,"value",false);
  330. if(_54==null){
  331. return false;
  332. }
  333. var _55=_54.getAttributeNode("xsi:type");
  334. if(_55==null||_55.nodeValue!="SOAP-ENC:Array"){
  335. return false;
  336. }
  337. var _56=_54.getAttributeNode("SOAP-ENC:arrayType");
  338. if(_56==null||_56.nodeValue.indexOf("bus:parmValueItem[")==-1){
  339. return false;
  340. }
  341. var _57=_54.childNodes;
  342. for(var _58=0;_58<_57.length;++_58){
  343. var _59=_57[_58];
  344. if(_59.nodeType==3){
  345. continue;
  346. }
  347. var _5a=_59.getAttributeNode("xsi:type");
  348. if(_5a!=null){
  349. var _5b;
  350. var _5c;
  351. switch(_5a.nodeValue){
  352. case "bus:simpleParmValueItem":
  353. _5b=new CSimpleParmValueItem("","","");
  354. break;
  355. case "bus:boundRangeParmValueItem":
  356. _5b=new CBoundRangeParmValueItem();
  357. break;
  358. case "bus:unboundedEndRangeParmValueItem":
  359. _5b=new CUnboundedEndRangeParmValueItem();
  360. break;
  361. case "bus:unboundedStartRangeParmValueItem":
  362. _5b=new CUnboundedStartRangeParmValueItem();
  363. break;
  364. case "bus:hierarchicalParmValueItem":
  365. _5b=new CHierarchicalParmValueItem();
  366. break;
  367. default:
  368. return false;
  369. }
  370. _5c=_5b.load(_59);
  371. if(_5c){
  372. this.m_parmValueItems.push(_5b);
  373. }else{
  374. delete _5b;
  375. }
  376. }
  377. }
  378. return true;
  379. };
  380. CParameterValue.prototype.generateXML=function(_5d,_5e){
  381. var _5f=_5e.ownerDocument;
  382. var _60=_5f.createElement("item");
  383. _5d.XMLBuilderSetAttributeNodeNS(_60,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
  384. _5e.appendChild(_60);
  385. var _61=_5d.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",_5f);
  386. _5d.XMLBuilderSetAttributeNodeNS(_61,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  387. _61.appendChild(_5f.createTextNode(this.m_name));
  388. _60.appendChild(_61);
  389. var _62=_5d.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_5f);
  390. _5d.XMLBuilderSetAttributeNodeNS(_62,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
  391. _5d.XMLBuilderSetAttributeNodeNS(_62,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  392. _60.appendChild(_62);
  393. for(var _63=0;_63<this.m_parmValueItems.length;++_63){
  394. if(typeof this.m_parmValueItems[_63].generateXML!="undefined"){
  395. this.m_parmValueItems[_63].generateXML(_5d,_62);
  396. }
  397. }
  398. };
  399. CParameterValue.prototype.toString=function(_64){
  400. var _65="";
  401. for(var _66=0;_66<this.m_parmValueItems.length;++_66){
  402. if(_65!=""){
  403. _65+=", ";
  404. }
  405. if(typeof this.m_parmValueItems[_66].toString!="undefined"){
  406. _65+=this.m_parmValueItems[_66].toString(_64);
  407. }
  408. }
  409. return _65;
  410. };
  411. function CParmValueItem(){
  412. this.initialize("true");
  413. };
  414. CParmValueItem.prototype.getInclusiveValue=function(){
  415. return this.m_inclusiveValue;
  416. };
  417. CParmValueItem.prototype.setInclusiveValue=function(_67){
  418. this.m_inclusiveValue=_67;
  419. };
  420. CParmValueItem.prototype.initialize=function(_68){
  421. this.m_inclusiveValue=_68;
  422. };
  423. CParmValueItem.prototype.load=function(_69){
  424. this.m_inclusiveValue="true";
  425. var _6a=XMLHelper_FindChildByTagName(_69,"inclusive",false);
  426. if(_6a!=null){
  427. var _6b=XMLHelper_GetText(_6a);
  428. if(_6b=="true"||_6b=="false"){
  429. this.m_inclusiveValue=_6b;
  430. }
  431. }
  432. };
  433. CParmValueItem.prototype.generateXML=function(_6c,_6d){
  434. var _6e=_6d.ownerDocument;
  435. var _6f=_6c.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:inclusive",_6e);
  436. _6c.XMLBuilderSetAttributeNodeNS(_6f,"xsi:type","xs:boolean","http://www.w3.org/2001/XMLSchema-instance");
  437. _6f.appendChild(_6e.createTextNode(this.m_inclusiveValue));
  438. _6d.appendChild(_6f);
  439. };
  440. function CSimpleParmValueItem(_70,_71,_72){
  441. CSimpleParmValueItem.baseclass.initialize.call(this,_72);
  442. this.m_useValue=_70;
  443. this.m_displayValue=_71;
  444. };
  445. CSimpleParmValueItem.prototype=new CParmValueItem();
  446. CSimpleParmValueItem.prototype.constructor=CSimpleParmValueItem;
  447. CSimpleParmValueItem.baseclass=CParmValueItem.prototype;
  448. CSimpleParmValueItem.prototype.getUseValue=function(){
  449. return this.m_useValue;
  450. };
  451. CSimpleParmValueItem.prototype.getDisplayValue=function(){
  452. return this.m_displayValue;
  453. };
  454. CSimpleParmValueItem.prototype.getParmValueItem=function(){
  455. return this.m_parmValueItem;
  456. };
  457. CSimpleParmValueItem.prototype.setDisplayValue=function(_73){
  458. this.m_displayValue=_73;
  459. };
  460. CSimpleParmValueItem.prototype.setUseValue=function(_74){
  461. this.m_useValue=_74;
  462. };
  463. CSimpleParmValueItem.prototype.toString=function(_75){
  464. return this.getDisplayValue();
  465. };
  466. CSimpleParmValueItem.prototype.load=function(_76){
  467. CSimpleParmValueItem.baseclass.load.call(this,_76);
  468. var _77=XMLHelper_FindChildByTagName(_76,"use",false);
  469. if(_77==null){
  470. return false;
  471. }
  472. var _78=XMLHelper_GetText(_77);
  473. if(_78==""){
  474. return false;
  475. }
  476. this.m_useValue=_78;
  477. var _79=XMLHelper_FindChildByTagName(_76,"display",false);
  478. if(_79!=null){
  479. this.m_displayValue=XMLHelper_GetText(_79);
  480. }
  481. return true;
  482. };
  483. CSimpleParmValueItem.prototype.generateXML=function(_7a,_7b){
  484. var _7c=_7b.ownerDocument;
  485. var _7d=_7c.createElement("item");
  486. _7a.XMLBuilderSetAttributeNodeNS(_7d,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  487. _7b.appendChild(_7d);
  488. CSimpleParmValueItem.baseclass.generateXML.call(this,_7a,_7d);
  489. var _7e=_7a.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",_7c);
  490. _7a.XMLBuilderSetAttributeNodeNS(_7e,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  491. _7e.appendChild(_7c.createTextNode(this.m_useValue));
  492. _7d.appendChild(_7e);
  493. var _7f=_7a.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",_7c);
  494. _7a.XMLBuilderSetAttributeNodeNS(_7f,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  495. _7f.appendChild(_7c.createTextNode(this.m_displayValue));
  496. _7d.appendChild(_7f);
  497. };
  498. function CBoundRangeParmValueItem(){
  499. CBoundRangeParmValueItem.baseclass.initialize.call(this,"true");
  500. this.m_start=null;
  501. this.m_end=null;
  502. };
  503. CBoundRangeParmValueItem.prototype=new CParmValueItem();
  504. CBoundRangeParmValueItem.prototype.constructor=CBoundRangeParmValueItem;
  505. CBoundRangeParmValueItem.baseclass=CParmValueItem.prototype;
  506. CBoundRangeParmValueItem.prototype.setStart=function(_80){
  507. this.m_start=_80;
  508. };
  509. CBoundRangeParmValueItem.prototype.getStart=function(){
  510. return this.m_start;
  511. };
  512. CBoundRangeParmValueItem.prototype.setEnd=function(end){
  513. this.m_end=end;
  514. };
  515. CBoundRangeParmValueItem.prototype.getEnd=function(){
  516. return this.m_end;
  517. };
  518. CBoundRangeParmValueItem.prototype.toString=function(_82){
  519. return CViewerCommon.getMessage(_82.m_sBetween,[this.m_start.getDisplayValue(),this.m_end.getDisplayValue()]);
  520. };
  521. CBoundRangeParmValueItem.prototype.load=function(_83){
  522. CBoundRangeParmValueItem.baseclass.load.call(this,_83);
  523. this.m_start=new CSimpleParmValueItem("","","");
  524. this.m_start.load(XMLHelper_FindChildByTagName(_83,"start",false));
  525. this.m_end=new CSimpleParmValueItem("","","");
  526. this.m_end.load(XMLHelper_FindChildByTagName(_83,"end",false));
  527. return true;
  528. };
  529. CBoundRangeParmValueItem.prototype.generateXML=function(_84,_85){
  530. var _86=_85.ownerDocument;
  531. var _87=_86.createElement("item");
  532. _84.XMLBuilderSetAttributeNodeNS(_87,"xsi:type","bus:boundRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  533. _85.appendChild(_87);
  534. CBoundRangeParmValueItem.baseclass.generateXML.call(this,_84,_87);
  535. var _88=_84.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:start",_86);
  536. _87.appendChild(_88);
  537. this.m_start.generateXML(_84,_88);
  538. var _89=_84.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:end",_86);
  539. _87.appendChild(_89);
  540. this.m_end.generateXML(_84,_89);
  541. };
  542. function CUnboundedStartRangeParmValueItem(){
  543. CUnboundedStartRangeParmValueItem.baseclass.initialize.call(this,"true");
  544. this.m_end=null;
  545. };
  546. CUnboundedStartRangeParmValueItem.prototype=new CParmValueItem();
  547. CUnboundedStartRangeParmValueItem.prototype.constructor=CUnboundedStartRangeParmValueItem;
  548. CUnboundedStartRangeParmValueItem.baseclass=CParmValueItem.prototype;
  549. CUnboundedStartRangeParmValueItem.prototype.setEnd=function(end){
  550. this.m_end=end;
  551. };
  552. CUnboundedStartRangeParmValueItem.prototype.getEnd=function(){
  553. return this.m_end;
  554. };
  555. CUnboundedStartRangeParmValueItem.prototype.load=function(_8b){
  556. CUnboundedStartRangeParmValueItem.baseclass.load.call(this,_8b);
  557. this.m_end=new CSimpleParmValueItem("","","");
  558. this.m_end.load(XMLHelper_FindChildByTagName(_8b,"end",false));
  559. return true;
  560. };
  561. CUnboundedStartRangeParmValueItem.prototype.generateXML=function(_8c,_8d){
  562. var _8e=_8d.ownerDocument;
  563. var _8f=_8e.createElement("item");
  564. _8c.XMLBuilderSetAttributeNodeNS(_8f,"xsi:type","bus:unboundedStartRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  565. _8d.appendChild(_8f);
  566. CUnboundedStartRangeParmValueItem.baseclass.generateXML.call(this,_8c,_8f);
  567. var _90=_8c.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:end",_8e);
  568. _8f.appendChild(_90);
  569. this.m_end.generateXML(_8c,_90);
  570. };
  571. CUnboundedStartRangeParmValueItem.prototype.toString=function(_91){
  572. return _91.m_sLessThan+" "+this.m_end.getDisplayValue();
  573. };
  574. function CUnboundedEndRangeParmValueItem(){
  575. CUnboundedEndRangeParmValueItem.baseclass.initialize.call(this,"true");
  576. this.m_start=null;
  577. };
  578. CUnboundedEndRangeParmValueItem.prototype=new CParmValueItem();
  579. CUnboundedEndRangeParmValueItem.prototype.constructor=CUnboundedEndRangeParmValueItem;
  580. CUnboundedEndRangeParmValueItem.baseclass=CParmValueItem.prototype;
  581. CUnboundedEndRangeParmValueItem.prototype.setStart=function(_92){
  582. this.m_start=_92;
  583. };
  584. CUnboundedEndRangeParmValueItem.prototype.getStart=function(){
  585. return this.m_start;
  586. };
  587. CUnboundedEndRangeParmValueItem.prototype.load=function(_93){
  588. CUnboundedEndRangeParmValueItem.baseclass.load.call(this,_93);
  589. this.m_start=new CSimpleParmValueItem("","","");
  590. this.m_start.load(XMLHelper_FindChildByTagName(_93,"start",false));
  591. return true;
  592. };
  593. CUnboundedEndRangeParmValueItem.prototype.generateXML=function(_94,_95){
  594. var _96=_95.ownerDocument;
  595. var _97=_96.createElement("item");
  596. _94.XMLBuilderSetAttributeNodeNS(_97,"xsi:type","bus:unboundedEndRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  597. _95.appendChild(_97);
  598. CUnboundedEndRangeParmValueItem.baseclass.generateXML.call(this,_94,_97);
  599. var _98=_94.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:start",_96);
  600. _97.appendChild(_98);
  601. this.m_start.generateXML(_94,_98);
  602. };
  603. CUnboundedEndRangeParmValueItem.prototype.toString=function(_99){
  604. return _99.m_sGreaterThan+" "+this.m_start.getDisplayValue();
  605. };
  606. function CHierarchicalParmValueItem(){
  607. CHierarchicalParmValueItem.baseclass.initialize.call(this,"true");
  608. this.m_value=null;
  609. this.m_subNodes=[];
  610. };
  611. CHierarchicalParmValueItem.prototype=new CParmValueItem();
  612. CHierarchicalParmValueItem.prototype.constructor=CHierarchicalParmValueItem;
  613. CHierarchicalParmValueItem.baseclass=CParmValueItem.prototype;
  614. CHierarchicalParmValueItem.prototype.getValue=function(){
  615. return this.m_value;
  616. };
  617. CHierarchicalParmValueItem.prototype.getSubNodes=function(){
  618. return this.m_subNodes;
  619. };
  620. CHierarchicalParmValueItem.prototype.setValue=function(_9a){
  621. this.m_value=_9a;
  622. };
  623. CHierarchicalParmValueItem.prototype.setSubNodes=function(_9b){
  624. this.m_subNodes=_9b;
  625. };
  626. CHierarchicalParmValueItem.prototype.load=function(_9c){
  627. CHierarchicalParmValueItem.baseclass.load.call(this,_9c);
  628. this.m_value=new CSimpleParmValueItem("","","");
  629. this.m_value.load(XMLHelper_FindChildByTagName(_9c,"value",false));
  630. var _9d=XMLHelper_FindChildByTagName(_9c,"subNodes",false);
  631. if(_9d==null){
  632. return false;
  633. }
  634. var _9e=_9d.getAttributeNode("xsi:type");
  635. if(_9e==null||_9e.nodeValue!="SOAP-ENC:Array"){
  636. return false;
  637. }
  638. var _9f=_9d.getAttributeNode("SOAP-ENC:arrayType");
  639. if(_9f==null||_9f.nodeValue!="bus:hierarchicalParmValueItem[]"){
  640. return false;
  641. }
  642. var _a0=_9d.childNodes;
  643. for(var _a1=0;_a1<_a0.length;++_a1){
  644. var _a2=new CHierarchicalParmValueItem();
  645. _a2.load(_a0[_a1]);
  646. this.m_subNodes.push(_a2);
  647. }
  648. return true;
  649. };
  650. CHierarchicalParmValueItem.prototype.generateXML=function(_a3,_a4){
  651. var _a5=_a4.ownerDocument;
  652. var _a6=_a5.createElement("item");
  653. _a3.XMLBuilderSetAttributeNodeNS(_a6,"xsi:type","bus:hierarchicalParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  654. _a4.appendChild(_a6);
  655. CHierarchicalParmValueItem.baseclass.generateXML.call(this,_a3,_a6);
  656. var _a7=_a3.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_a5);
  657. _a6.appendChild(_a7);
  658. this.m_value.generateXML(_a3,_a7);
  659. var _a8=_a3.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:subNodes",_a5);
  660. _a3.XMLBuilderSetAttributeNodeNS(_a8,"SOAP-ENC:arrayType","bus:hierarchicalParmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
  661. _a3.XMLBuilderSetAttributeNodeNS(_a8,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  662. _a6.appendChild(_a8);
  663. for(var _a9=0;_a9<this.m_subNodes.length;++_a9){
  664. this.m_subNodes[_a9].generateXML(_a3,_a8);
  665. }
  666. };
  667. CHierarchicalParmValueItem.prototype.toString=function(){
  668. return "";
  669. };
  670. function XMLParser(s,_ab){
  671. if(s==null){
  672. return null;
  673. }
  674. if(/^\s*</.test(s)){
  675. s=s.replace(/^\s*/,"");
  676. if(s.charAt(1)=="/"){
  677. var _ac=new RegExp("^</"+_ab.getName()+"\\s*>","gi");
  678. if(!_ac.test(s)){
  679. alert("invalid XML "+_ab.getName()+"\n"+s);
  680. return null;
  681. }
  682. return XMLParser(s.replace(RegExp.lastMatch,""),_ab.parentNode);
  683. }else{
  684. var _ad=/^\s*<([\w:\-_\.]+)/;
  685. if(_ad.test(s)){
  686. var _ae=RegExp.$1;
  687. var e=new XMLElement(_ae,_ab);
  688. var _b0=new RegExp("^<"+_ae+"[^>]*>");
  689. s=s.replace(_b0,"");
  690. var _b1=RegExp.lastMatch;
  691. var _b2=/([\w:\-_\.]+)="([^"]*)"/gi;
  692. var _b3=_b1.match(_b2);
  693. if(_b3!=null){
  694. for(var i=0;i<_b3.length;i++){
  695. var _b5=_b3[i];
  696. (/([\w:\-_\.]+)\s*=\s*"(.*)"/).test(_b5);
  697. e.setAttribute(RegExp.$1,RegExp.$2);
  698. }
  699. }
  700. if(!(/\/>$/).test(_b1)){
  701. XMLParser(s,e);
  702. return e;
  703. }else{
  704. XMLParser(s,_ab);
  705. return e;
  706. }
  707. }
  708. }
  709. }else{
  710. if(s&&_ab){
  711. var _b6=new RegExp("([^<]*)</"+_ab.getName()+"\\s*[^>]*>","gi");
  712. _b6.test(s);
  713. var _b7=RegExp.$1;
  714. _ab.setValue(_b7);
  715. return (XMLParser(s.replace(_b7,""),_ab));
  716. }
  717. }
  718. return null;
  719. };
  720. function XMLElement(s,_b9){
  721. this.nodeName=s;
  722. this.nodeValue="";
  723. this.attributes=[];
  724. this.childNodes=[];
  725. this.parentNode=_b9;
  726. if(this.parentNode){
  727. this.parentNode.appendChild(this);
  728. }
  729. };
  730. XMLElement.prototype.appendChild=function(e){
  731. this.childNodes[this.childNodes.length]=e;
  732. };
  733. XMLElement.prototype.hasChildNodes=function(){
  734. if(this.childNodes.length>0){
  735. return true;
  736. }else{
  737. return false;
  738. }
  739. };
  740. XMLElement.prototype.findChildByName=function(n,_bc){
  741. if(this.getName()==n){
  742. return (this);
  743. }
  744. for(var i=0;i<this.childNodes.length;i++){
  745. if(this.childNodes[i].getName()==n){
  746. return this.childNodes[i];
  747. }
  748. }
  749. if(_bc!=false){
  750. for(i=0;i<this.childNodes.length;i++){
  751. var _be=this.childNodes[i].findChildByName(n,_bc);
  752. if(_be){
  753. return _be;
  754. }
  755. }
  756. }
  757. return null;
  758. };
  759. XMLElement.prototype.findChildWithAttribute=function(_bf,val){
  760. for(var i=0;i<this.childNodes.length;i++){
  761. if(this.childNodes[i].getAttribute(_bf)==val){
  762. return this.childNodes[i];
  763. }
  764. }
  765. return null;
  766. };
  767. XMLElement.prototype.getElementsByTagName=function(s,_c3){
  768. var a=[];
  769. for(var i=0;i<this.childNodes.length;i++){
  770. if(this.childNodes[i].getName()==s){
  771. a[a.length]=this.childNodes[i];
  772. }
  773. }
  774. if(_c3!=false){
  775. for(i=0;i<this.childNodes.length;i++){
  776. var _c6=this.childNodes[i].getElementsByTagName(s);
  777. for(var j=0;j<_c6.length;j++){
  778. a[a.length]=_c6[j];
  779. }
  780. }
  781. }
  782. return a;
  783. };
  784. XMLElement.prototype.getName=function(){
  785. return this.nodeName;
  786. };
  787. XMLElement.prototype.getValue=function(){
  788. return this.nodeValue;
  789. };
  790. XMLElement.prototype.setAttribute=function(a,v){
  791. this.attributes["_"+a]=v;
  792. };
  793. XMLElement.prototype.setValue=function(v){
  794. this.nodeValue=v;
  795. };
  796. XMLElement.prototype.getAttribute=function(a){
  797. var _cc="";
  798. if(typeof sXmlDecode=="function"){
  799. _cc=sXmlDecode(this.attributes["_"+a]);
  800. }else{
  801. _cc=this.attributes["_"+a];
  802. }
  803. return (_cc==null?"":_cc);
  804. };
  805. XMLElement.prototype.toString=function(){
  806. var s="<"+this.getName();
  807. for(var i in this.attributes){
  808. s+=" "+i.substring(1)+"=\""+this.attributes[i]+"\"";
  809. }
  810. s+=">"+this.getValue();
  811. for(var j=0;j<this.childNodes.length;j++){
  812. s+=this.childNodes[j].toString();
  813. }
  814. s+="</"+this.getName()+">";
  815. return s;
  816. };
  817. function XMLBuilderLoadXMLFromString(_d0,_d1){
  818. var _d2=null;
  819. if(typeof DOMParser!="undefined"){
  820. _d2=new DOMParser().parseFromString(_d0,"application/xml");
  821. }else{
  822. if(typeof ActiveXObject!="undefined"){
  823. try{
  824. _d2=new ActiveXObject("Microsoft.XMLDOM");
  825. _d2.loadXML(_d0);
  826. }
  827. catch(e){
  828. }
  829. }
  830. }
  831. return _d2;
  832. };
  833. function XMLBuilderCreateXMLDocument(_d3,_d4,_d5){
  834. var _d6=null;
  835. _d4=_d4||"";
  836. _d5=_d5||null;
  837. if(document.implementation&&document.implementation.createDocument){
  838. if(typeof _d4=="undefined"){
  839. _d4="http://www.w3.org/2000/xmlns/";
  840. }
  841. _d6=document.implementation.createDocument(_d4,_d3,_d5);
  842. }else{
  843. if(typeof ActiveXObject!="undefined"){
  844. try{
  845. _d6=new ActiveXObject("Microsoft.XMLDOM");
  846. var _d7=_d6.createNode(1,_d3,_d4);
  847. _d6.appendChild(_d7);
  848. }
  849. catch(e){
  850. }
  851. }
  852. }
  853. return _d6;
  854. };
  855. function XMLBuilderCreateElementNS(_d8,_d9,_da){
  856. var _db=null;
  857. if(typeof _da.createElementNS!="undefined"){
  858. if(typeof _d8=="undefined"){
  859. _d8="http://www.w3.org/2000/xmlns/";
  860. }
  861. _db=_da.createElementNS(_d8,_d9);
  862. }else{
  863. if(typeof _da.createNode!="undefined"){
  864. _db=_da.createNode(1,_d9,_d8);
  865. }
  866. }
  867. return _db;
  868. };
  869. function XMLBuilderSetAttributeNodeNS(_dc,_dd,_de,_df){
  870. if(typeof _dc.setAttributeNS!="undefined"){
  871. if(typeof _df=="undefined"){
  872. _df="http://www.w3.org/2000/xmlns/";
  873. }
  874. _dc.setAttributeNS(_df,_dd,_de);
  875. }else{
  876. if(typeof _dc.ownerDocument!="undefined"&&typeof _dc.ownerDocument.createNode!="undefined"){
  877. var _e0=_dc.ownerDocument.createNode(2,_dd,_df);
  878. _e0.nodeValue=_de;
  879. _dc.setAttributeNode(_e0);
  880. }
  881. }
  882. };
  883. function XMLBuilderSerializeNode(_e1){
  884. var _e2="";
  885. if(typeof XMLSerializer!="undefined"){
  886. try{
  887. _e2=new XMLSerializer().serializeToString(_e1);
  888. }
  889. catch(e){
  890. }
  891. }else{
  892. if(typeof _e1=="object"&&typeof _e1.xml!="undefined"){
  893. _e2=_e1.xml;
  894. }
  895. }
  896. return _e2.replace(/^\s+/g,"").replace(/\s+$/g,"");
  897. };
  898. function XMLHelper_GetText(_e3,_e4){
  899. var _e5="";
  900. var _e6=_e3.childNodes;
  901. for(var i=0;i<_e6.length;++i){
  902. if(_e6[i].nodeType==3){
  903. _e5+=_e6[i].nodeValue;
  904. }else{
  905. if(_e6[i].nodeName=="Value"){
  906. _e5+=_e6[i].getAttribute("display");
  907. }else{
  908. if(_e4){
  909. _e5+=XMLHelper_GetText(_e6[i],true);
  910. }
  911. }
  912. }
  913. }
  914. return _e5;
  915. };
  916. function XMLHelper_GetLocalName(_e8){
  917. if(typeof _e8.baseName!="undefined"){
  918. return _e8.baseName;
  919. }
  920. return _e8.localName;
  921. };
  922. function XMLHelper_FindChildByTagName(_e9,_ea,_eb){
  923. if(typeof _eb=="undefined"||(_eb!=true&&_eb!=false)){
  924. _eb=true;
  925. }
  926. if(XMLHelper_GetLocalName(_e9)==_ea){
  927. return (_e9);
  928. }
  929. var i;
  930. for(i=0;i<_e9.childNodes.length;i++){
  931. if(XMLHelper_GetLocalName(_e9.childNodes[i])==_ea){
  932. return _e9.childNodes[i];
  933. }
  934. }
  935. if(_eb!=false){
  936. for(i=0;i<_e9.childNodes.length;i++){
  937. var _ed=XMLHelper_FindChildByTagName(_e9.childNodes[i],_ea,_eb);
  938. if(_ed){
  939. return _ed;
  940. }
  941. }
  942. }
  943. return null;
  944. };
  945. function XMLHelper_FindChildrenByTagName(_ee,_ef,_f0){
  946. if(typeof _f0=="undefined"||(_f0!=true&&_f0!=false)){
  947. _f0=true;
  948. }
  949. var _f1=[];
  950. var _f2=_ee.childNodes;
  951. for(var _f3=0;_f3<_f2.length;_f3++){
  952. if(XMLHelper_GetLocalName(_f2[_f3])==_ef){
  953. _f1[_f1.length]=_f2[_f3];
  954. }
  955. if(_f0===true){
  956. var _f4=XMLHelper_FindChildrenByTagName(_f2[_f3],_ef,_f0);
  957. if(_f4.length>0){
  958. _f1=_f1.concat(_f4);
  959. }
  960. }
  961. }
  962. return _f1;
  963. };
  964. function XMLHelper_GetFirstChildElement(oEl){
  965. var _f6=null;
  966. if(oEl&&oEl.childNodes&&oEl.childNodes.length){
  967. for(var i=0;i<oEl.childNodes.length;i++){
  968. if(oEl.childNodes[i].nodeType==1){
  969. _f6=oEl.childNodes[i];
  970. break;
  971. }
  972. }
  973. }
  974. return _f6;
  975. };
  976. function XMLHelper_FindChildrenByAttribute(_f8,_f9,_fa,_fb,_fc){
  977. if(typeof _fb=="undefined"||(_fb!=true&&_fb!=false)){
  978. _fb=true;
  979. }
  980. if(typeof _fa!="string"&&typeof _fa!="number"){
  981. _fa=null;
  982. }else{
  983. _fa=_fa.toString();
  984. }
  985. var _fd=[];
  986. var _fe=_f8.childNodes;
  987. for(var _ff=0;_ff<_fe.length;_ff++){
  988. var _100=_fe[_ff];
  989. if(_100.nodeType==1){
  990. var _101=_100.getAttribute(_f9);
  991. if(_101!==null){
  992. if(_fa===null||_101==_fa){
  993. if(_fc){
  994. return [_100];
  995. }else{
  996. _fd[_fd.length]=_100;
  997. }
  998. }
  999. }
  1000. if(_fb===true){
  1001. var _102=XMLHelper_FindChildrenByAttribute(_100,_f9,_fa,_fb,_fc);
  1002. if(_102.length>0){
  1003. if(_fc){
  1004. if(_102.length==1){
  1005. return _102;
  1006. }else{
  1007. return [_102[0]];
  1008. }
  1009. }else{
  1010. _fd=_fd.concat(_102);
  1011. }
  1012. }
  1013. }
  1014. }
  1015. }
  1016. return _fd;
  1017. };
  1018. var DICTIONARY_INVALID_KEY=-1;
  1019. var DICTIONARY_SUCCESS=1;
  1020. function CDictionary(){
  1021. this.m_aValues={};
  1022. };
  1023. function CDictionary_add(sKey,_104){
  1024. if(typeof sKey!="string"&&typeof sKey!="number"){
  1025. return DICTIONARY_INVALID_KEY;
  1026. }
  1027. this.m_aValues[sKey]=_104;
  1028. return DICTIONARY_SUCCESS;
  1029. };
  1030. function CDictionary_exists(sKey){
  1031. if(typeof sKey!="string"&&typeof sKey!="number"){
  1032. return false;
  1033. }
  1034. return (typeof this.m_aValues[sKey]!="undefined");
  1035. };
  1036. function CDictionary_get(sKey){
  1037. if(typeof sKey!="string"&&typeof sKey!="number"){
  1038. return null;
  1039. }
  1040. if(this.exists(sKey)===true){
  1041. return this.m_aValues[sKey];
  1042. }else{
  1043. return null;
  1044. }
  1045. };
  1046. function CDictionary_keys(){
  1047. var _107=[];
  1048. for(var _108 in this.m_aValues){
  1049. _107.push(_108);
  1050. }
  1051. return _107.sort();
  1052. };
  1053. function CDictionary_remove(sKey){
  1054. if(typeof sKey!="string"&&typeof sKey!="number"){
  1055. return DICTIONARY_INVALID_KEY;
  1056. }
  1057. var _10a=this.get(sKey);
  1058. delete this.m_aValues[sKey];
  1059. return _10a;
  1060. };
  1061. function CDictionary_removeAll(){
  1062. this.m_aValues=[];
  1063. return DICTIONARY_SUCCESS;
  1064. };
  1065. function CDictionary_append(_10b){
  1066. if(_10b instanceof CDictionary&&_10b.keys().length>0){
  1067. var _10c=_10b.keys();
  1068. for(var _10d=0;_10d<_10c.length;_10d++){
  1069. this.add(_10c[_10d],_10b.get(_10c[_10d]));
  1070. }
  1071. }
  1072. };
  1073. CDictionary.prototype.add=CDictionary_add;
  1074. CDictionary.prototype.exists=CDictionary_exists;
  1075. CDictionary.prototype.get=CDictionary_get;
  1076. CDictionary.prototype.keys=CDictionary_keys;
  1077. CDictionary.prototype.remove=CDictionary_remove;
  1078. CDictionary.prototype.removeAll=CDictionary_removeAll;
  1079. CDictionary.prototype.append=CDictionary_append;
  1080. function CognosTabControl(_10e,_10f){
  1081. this._init();
  1082. this._outsideContainer=_10e;
  1083. this._callback=_10f;
  1084. };
  1085. CognosTabControl.prototype._init=function(){
  1086. this._tabs=null;
  1087. this._tabControlNode=null;
  1088. this._scrollButtonsVisible=false;
  1089. this._scrollLeftButton=null;
  1090. this._scrollRightButton=null;
  1091. this._selectedTab=null;
  1092. this._wrapperDiv=null;
  1093. this._topContainer=null;
  1094. this._seperator=null;
  1095. this._isSavedOutput=false;
  1096. this._isHighContrast=false;
  1097. };
  1098. CognosTabControl.prototype.destroy=function(){
  1099. if(this._wrapperDiv){
  1100. this._wrapperDiv.parentNode.removeChild(this._wrapperDiv);
  1101. delete this._wrapperDiv;
  1102. this._wrapperDiv=null;
  1103. }
  1104. };
  1105. CognosTabControl.prototype.setHighContrast=function(_110){
  1106. this._isHighContrast=_110;
  1107. };
  1108. CognosTabControl.prototype.isHighContrast=function(){
  1109. return this._isHighContrast;
  1110. };
  1111. CognosTabControl.prototype.setSpaceSaverContainer=function(node){
  1112. this._spaceSaverContainer=node;
  1113. };
  1114. CognosTabControl.prototype.useAbsolutePosition=function(_112){
  1115. this._useAbsolutePosition=_112;
  1116. };
  1117. CognosTabControl.prototype.setScrollAttachNode=function(node){
  1118. this._scrollAttachNode=node;
  1119. };
  1120. CognosTabControl.prototype.setIsSavedOutput=function(_114){
  1121. this._isSavedOutput=_114;
  1122. };
  1123. CognosTabControl.prototype.isSavedOutput=function(){
  1124. return this._isSavedOutput;
  1125. };
  1126. CognosTabControl.prototype.getSelectedTabId=function(){
  1127. if(this._selectedTab){
  1128. return this._selectedTab.getId();
  1129. }
  1130. return null;
  1131. };
  1132. CognosTabControl.prototype.getSelectedTab=function(){
  1133. return this._selectedTab?this._selectedTab:null;
  1134. };
  1135. CognosTabControl.prototype.isTopAligned=function(){
  1136. return this._isTopAligned;
  1137. };
  1138. CognosTabControl.prototype.getWrapperDiv=function(){
  1139. return this._wrapperDiv;
  1140. };
  1141. CognosTabControl.prototype.getVisibleWidth=function(){
  1142. var _115=this._scrollRightButton?this._scrollRightButton.getWidth()+11:0;
  1143. return this._wrapperDiv.clientWidth-_115;
  1144. };
  1145. CognosTabControl.prototype.getMaxRightScroll=function(){
  1146. var _116=this._scrollRightButton?this._scrollRightButton.getWidth()+11:0;
  1147. return this._totalWrapperWidth+_116+8-this._wrapperDiv.clientWidth;
  1148. };
  1149. CognosTabControl.prototype.hide=function(){
  1150. this._topContainer.style.display="none";
  1151. };
  1152. CognosTabControl.prototype.resetPosition=function(){
  1153. if(this._useAbsolutePosition===true){
  1154. this._outsideContainer.srollLeft="0px";
  1155. this._outsideContainer.scrollTop="0px";
  1156. this._topContainer.style.top="";
  1157. this._topContainer.style.bottom="";
  1158. this._topContainer.style.left="0px";
  1159. if(this._isTopAligned){
  1160. this._topContainer.style.top="0px";
  1161. }else{
  1162. this._topContainer.style.bottom="0px";
  1163. }
  1164. }
  1165. };
  1166. CognosTabControl.prototype.render=function(_117){
  1167. this._updateTabInfo(_117);
  1168. if(!this._tabControlNode){
  1169. var _118=this;
  1170. var _119=this._scrollAttachNode?this._scrollAttachNode:this._outsideContainer;
  1171. if(window.attachEvent){
  1172. window.attachEvent("onresize",function(){
  1173. _118.onResize();
  1174. });
  1175. if(this._useAbsolutePosition===true){
  1176. _119.attachEvent("onscroll",function(){
  1177. _118.onContainerScroll();
  1178. });
  1179. }
  1180. }else{
  1181. window.addEventListener("resize",function(){
  1182. _118.onResize();
  1183. },false);
  1184. if(this._useAbsolutePosition===true){
  1185. _119.addEventListener("scroll",function(){
  1186. _118.onContainerScroll();
  1187. },false);
  1188. }
  1189. }
  1190. this._outsideContainer.originalClassName=this._outsideContainer.className;
  1191. this._outsideContainer.className=this._outsideContainer.className+(this._isTopAligned?" ct_controlTop":" ct_controlBottom");
  1192. this._topContainer=document.createElement("div");
  1193. this._topContainer.className="ct_wrapperDiv";
  1194. if(this._useAbsolutePosition===true){
  1195. this._topContainer.style.width="100%";
  1196. this._topContainer.style.position="absolute";
  1197. this._topContainer.style.left="0px";
  1198. if(this._isTopAligned){
  1199. this._topContainer.style.top="0px";
  1200. }else{
  1201. this._topContainer.style.bottom="0px";
  1202. }
  1203. }
  1204. if(this._isTopAligned&&this._outsideContainer.firstChild){
  1205. this._outsideContainer.insertBefore(this._topContainer,this._outsideContainer.firstChild);
  1206. }else{
  1207. this._outsideContainer.appendChild(this._topContainer);
  1208. }
  1209. this._wrapperDiv=document.createElement("div");
  1210. this._wrapperDiv.setAttribute("role","presentation");
  1211. this._wrapperDiv.className="ct_wrapperDiv";
  1212. this._topContainer.appendChild(this._wrapperDiv);
  1213. this._tabControlNode=document.createElement("div");
  1214. this._tabControlNode.setAttribute("role","tablist");
  1215. this._tabControlNode.className="ct_control";
  1216. this._wrapperDiv.appendChild(this._tabControlNode);
  1217. this._totalWrapperWidth=0;
  1218. for(var i=0;i<this._tabs.length;i++){
  1219. var tab=this._tabs[i];
  1220. tab.render(this._tabControlNode);
  1221. this._totalWrapperWidth+=this._tabs[i].getWidth();
  1222. }
  1223. var _11c=0;
  1224. if(this._tabs[0]){
  1225. _11c=this._tabs[0].getHeight();
  1226. }
  1227. this._wrapperDiv.style.height=_11c+5+"px";
  1228. if(this._spaceSaverContainer){
  1229. this.spaceSaverDiv=document.createElement("div");
  1230. this.spaceSaverDiv.style.height=_11c+5+"px";
  1231. this.spaceSaverDiv.style.position="relative";
  1232. this.spaceSaverDiv.style.display="block";
  1233. this._spaceSaverContainer.appendChild(this.spaceSaverDiv);
  1234. }
  1235. this._createSeperator();
  1236. }else{
  1237. this.resetPosition();
  1238. }
  1239. this._topContainer.style.display="";
  1240. this.onResize();
  1241. this.selectTab(_117.currentTabId,false);
  1242. if(this._selectedTab){
  1243. this._selectedTab.scrollIntoView();
  1244. this.updateScrollButtons();
  1245. }
  1246. };
  1247. CognosTabControl.prototype.onContainerScroll=function(){
  1248. var _11d=this._scrollAttachNode?this._scrollAttachNode:this._topContainer;
  1249. this._topContainer.style.left=_11d.scrollLeft+"px";
  1250. if(this._isTopAligned){
  1251. this._topContainer.style.top=_11d.scrollTop+"px";
  1252. }else{
  1253. this._topContainer.style.bottom=(-_11d.scrollTop)+"px";
  1254. }
  1255. };
  1256. CognosTabControl.prototype._resetTabControl=function(){
  1257. if(this._outsideContainer.originalClassName){
  1258. this._outsideContainer.className=this._outsideContainer.originalClassName;
  1259. }else{
  1260. this._outsideContainer.className="";
  1261. }
  1262. if(this._topContainer){
  1263. var node=this._outsideContainer.removeChild(this._topContainer);
  1264. node=null;
  1265. }
  1266. this._init();
  1267. };
  1268. CognosTabControl.prototype._updateTabInfo=function(_11f){
  1269. this._isTopAligned=_11f.position=="topLeft"?true:false;
  1270. var tabs=_11f.tabs;
  1271. if(this._tabs){
  1272. if(this._tabs.length!=tabs.length){
  1273. this._resetTabControl();
  1274. }else{
  1275. for(var i=0;i<this._tabs.length;i++){
  1276. if(tabs[i].id!=this._tabs[i].getId()){
  1277. this._resetTabControl();
  1278. break;
  1279. }
  1280. }
  1281. }
  1282. }
  1283. if(!this._tabs){
  1284. this._tabs=[];
  1285. if(!tabs){
  1286. return;
  1287. }
  1288. for(var ii=0;ii<tabs.length;ii++){
  1289. var tab=new CognosTab(tabs[ii],this,ii);
  1290. this._tabs.push(tab);
  1291. }
  1292. }
  1293. };
  1294. CognosTabControl.prototype.getScrollPos=function(){
  1295. return this._wrapperDiv.scrollLeft;
  1296. };
  1297. CognosTabControl.prototype.scrollTo=function(_124){
  1298. this._wrapperDiv.scrollLeft=_124;
  1299. this.updateScrollButtons();
  1300. };
  1301. CognosTabControl.prototype.onResize=function(evt){
  1302. if(this._wrapperDiv.offsetWidth<this._totalWrapperWidth){
  1303. this._showScrollButtons();
  1304. this.updateScrollButtons();
  1305. if(this._selectedTab){
  1306. this._selectedTab.scrollIntoView();
  1307. }
  1308. if(this._scrollRightButton.isDisabled()){
  1309. this.scrollTo(this.getMaxRightScroll());
  1310. }
  1311. }else{
  1312. this._hideScrollButtons();
  1313. this.scrollTo(0);
  1314. }
  1315. };
  1316. CognosTabControl.prototype._showScrollButtons=function(){
  1317. if(this._scrollButtonsVisible){
  1318. return;
  1319. }
  1320. if(!this._scrollLeftButton){
  1321. var _126=0;
  1322. if(this._tabs[0]){
  1323. _126=this._tabs[0].getHeight();
  1324. }
  1325. this._scrollLeftButton=new CognosScrollButton("left",_126,this);
  1326. this._scrollLeftButton.render(this._topContainer);
  1327. this._scrollRightButton=new CognosScrollButton("right",_126,this);
  1328. this._scrollRightButton.render(this._topContainer);
  1329. }
  1330. this._scrollButtonsVisible=true;
  1331. this._scrollLeftButton.show();
  1332. this._scrollRightButton.show();
  1333. this._tabControlNode.style.left=this._scrollLeftButton.getWidth()-2+"px";
  1334. };
  1335. CognosTabControl.prototype.updateScrollButtons=function(){
  1336. if(this._scrollLeftButton){
  1337. this._scrollLeftButton.update();
  1338. }
  1339. if(this._scrollRightButton){
  1340. this._scrollRightButton.update();
  1341. }
  1342. };
  1343. CognosTabControl.prototype._hideScrollButtons=function(){
  1344. if(!this._scrollButtonsVisible){
  1345. return;
  1346. }
  1347. this._scrollButtonsVisible=false;
  1348. this._tabControlNode.style.left="0px";
  1349. this._scrollLeftButton.hide();
  1350. this._scrollRightButton.hide();
  1351. };
  1352. CognosTabControl.prototype._createSeperator=function(){
  1353. this._seperator=document.createElement("div");
  1354. this._seperator.setAttribute("role","presendation");
  1355. this._seperator.setAttribute("style","");
  1356. this._seperator.className="ct_verticalLine";
  1357. this._seperator.setAttribute("role","presentation");
  1358. this._tabControlNode.appendChild(this._seperator);
  1359. };
  1360. CognosTabControl.prototype.selectTab=function(_127,_128,evt){
  1361. if(!evt){
  1362. evt=window.event;
  1363. }
  1364. for(var i=0;i<this._tabs.length;i++){
  1365. var tab=this._tabs[i];
  1366. var _12c=tab.getId()==_127;
  1367. tab.select(_12c);
  1368. if(_12c){
  1369. this._selectedTab=tab;
  1370. if(_128&&this._callback){
  1371. this._callback(_127);
  1372. }
  1373. }
  1374. if(_128){
  1375. tab.focus(_12c);
  1376. }
  1377. }
  1378. if(evt&&window.stopEventBubble){
  1379. window.stopEventBubble(evt);
  1380. }
  1381. return false;
  1382. };
  1383. CognosTabControl.prototype.handleKeyDown=function(evt,_12e){
  1384. if(!evt){
  1385. evt=window.event;
  1386. }
  1387. if(!evt){
  1388. return;
  1389. }
  1390. if(evt.keyCode=="39"||evt.keyCode=="37"){
  1391. if(evt.keyCode=="39"){
  1392. _12e++;
  1393. if(_12e>=this._tabs.length){
  1394. _12e=0;
  1395. }
  1396. }else{
  1397. _12e--;
  1398. if(_12e<0){
  1399. _12e=this._tabs.length-1;
  1400. }
  1401. }
  1402. this._tabs[_12e].focus();
  1403. this._tabs[_12e].scrollIntoView();
  1404. }else{
  1405. if(evt.keyCode=="32"||evt.keyCode=="13"){
  1406. var _12f=this._tabs[_12e].getId();
  1407. this.selectTab(_12f,true);
  1408. }
  1409. }
  1410. };
  1411. function CognosTab(_130,_131,_132){
  1412. if(!_130){
  1413. return;
  1414. }
  1415. this._id=_130.id;
  1416. this._label=_130.label;
  1417. this._position=_132;
  1418. this._contentClassName=_130.className;
  1419. this._imgURL=_130.img;
  1420. this._selected=false;
  1421. this._tabControl=_131;
  1422. this._outerTabDiv=null;
  1423. this._focusDiv=null;
  1424. };
  1425. CognosTab.prototype.getWidth=function(){
  1426. return this._outerTabDiv.offsetWidth+1;
  1427. };
  1428. CognosTab.prototype.getHeight=function(){
  1429. return this._outerTabDiv.clientHeight;
  1430. };
  1431. CognosTab.prototype.getId=function(){
  1432. return this._id;
  1433. };
  1434. CognosTab.prototype.select=function(_133){
  1435. if(_133!=this._selected){
  1436. this._selected=_133;
  1437. if(_133){
  1438. this.scrollIntoView();
  1439. }
  1440. if(this._outerTabDiv){
  1441. this._updateSelectedClass();
  1442. this._updateAriaSelected();
  1443. }
  1444. }
  1445. };
  1446. CognosTab.prototype.scrollIntoView=function(){
  1447. var _134=this._outerTabDiv.offsetLeft+this._outerTabDiv.clientWidth;
  1448. var _135=this._tabControl.getVisibleWidth();
  1449. var _136=this._tabControl.getScrollPos();
  1450. var _137=this._outerTabDiv.offsetLeft;
  1451. if(_137===0){
  1452. this._tabControl.scrollTo(0);
  1453. }else{
  1454. if((_137>=_136)&&(_134<=(_136+_135))){
  1455. }else{
  1456. if(_137<_136){
  1457. var _138=_137<3?0:_137-3;
  1458. this._tabControl.scrollTo(_138);
  1459. }else{
  1460. if(_134-_135>0||_134<_136){
  1461. this._tabControl.scrollTo(_134-_135+10);
  1462. }
  1463. }
  1464. }
  1465. }
  1466. };
  1467. CognosTab.prototype.render=function(_139){
  1468. if(!this._outerTabDiv){
  1469. var _13a=this._id;
  1470. var _13b=this._tabControl;
  1471. var tab=this;
  1472. this._outerTabDiv=document.createElement("div");
  1473. this._outerTabDiv.onmousedown=function(_13d){
  1474. _13b.selectTab(_13a,true,_13d);
  1475. };
  1476. this._outerTabDiv.onmouseover=function(){
  1477. this.className=this.className+" ct_highlight";
  1478. };
  1479. this._outerTabDiv.onmouseout=function(){
  1480. tab._updateSelectedClass();
  1481. };
  1482. this._outerTabDiv.setAttribute("style","");
  1483. this._outerTabDiv.setAttribute("role","presentation");
  1484. this._updateSelectedClass();
  1485. _139.appendChild(this._outerTabDiv);
  1486. var _13e=document.createElement("div");
  1487. _13e.className="ct_content";
  1488. _13e.setAttribute("role","presentation");
  1489. this._outerTabDiv.appendChild(_13e);
  1490. this._focusDiv=document.createElement("span");
  1491. this._focusDiv.innerHTML=this._label?this._label:"&nbsp;";
  1492. this._focusDiv.className="ct_text";
  1493. this._focusDiv.setAttribute("tabIndex",this._position===0?"0":"-1");
  1494. this._focusDiv.setAttribute("role","tab");
  1495. this._focusDiv.onkeydown=function(_13f){
  1496. _13b.handleKeyDown(_13f,tab._position);
  1497. };
  1498. this._updateAriaSelected();
  1499. _13e.appendChild(this._focusDiv);
  1500. if(this.isIE()&&this.getWidth()<75){
  1501. this._outerTabDiv.style.width="75px";
  1502. }
  1503. }else{
  1504. this._updateSelectedClass();
  1505. this._updateAriaSelected();
  1506. }
  1507. };
  1508. CognosTab.prototype.isIE=function(){
  1509. return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
  1510. };
  1511. CognosTab.prototype.getFocusableDiv=function(){
  1512. return this._focusDiv;
  1513. };
  1514. CognosTab.prototype.focus=function(_140){
  1515. if(typeof _140==="undefined"){
  1516. _140=true;
  1517. }
  1518. this._focusDiv.setAttribute("tabIndex",_140?"0":"-1");
  1519. if(_140&&this._focusDiv.focus){
  1520. this._focusDiv.focus();
  1521. }
  1522. };
  1523. CognosTab.prototype._updateSelectedClass=function(){
  1524. this._outerTabDiv.className=this._selected?"ct_outerDiv ct_highlight ct_selected":"ct_outerDiv";
  1525. };
  1526. CognosTab.prototype._updateAriaSelected=function(){
  1527. this._focusDiv.setAttribute("aria-selected",this._selected?"true":"false");
  1528. };
  1529. function CognosScrollButton(_141,_142,_143){
  1530. this._direction=_141;
  1531. this._height=_142;
  1532. this._tabControl=_143;
  1533. this._disabled=true;
  1534. this._scrolling=false;
  1535. };
  1536. CognosScrollButton.prototype.getWidth=function(){
  1537. return this._scrollButtonDiv.offsetWidth+1;
  1538. };
  1539. CognosScrollButton.prototype.show=function(){
  1540. this._wrapperDiv.style.display="block";
  1541. };
  1542. CognosScrollButton.prototype.hide=function(){
  1543. this._wrapperDiv.style.display="none";
  1544. };
  1545. CognosScrollButton.prototype.update=function(){
  1546. var _144=this._tabControl.getWrapperDiv();
  1547. var _145=false;
  1548. if(this._direction=="left"){
  1549. if(_144.scrollLeft===0){
  1550. _145=true;
  1551. }
  1552. }else{
  1553. if(_144.scrollLeft>=(this._tabControl.getMaxRightScroll()-2)){
  1554. _145=true;
  1555. }
  1556. }
  1557. if(_145){
  1558. this._disable();
  1559. }else{
  1560. this._enable();
  1561. }
  1562. };
  1563. CognosScrollButton.prototype.isDisabled=function(){
  1564. return this._disabled;
  1565. };
  1566. CognosScrollButton.prototype._disable=function(){
  1567. this._disabled=true;
  1568. this._outerDiv.className="ct_outerDiv ct_scrollDisabled";
  1569. };
  1570. CognosScrollButton.prototype._enable=function(){
  1571. this._disabled=false;
  1572. this._outerDiv.className="ct_outerDiv ct_scrollEnabled";
  1573. };
  1574. CognosScrollButton.prototype.scroll=function(){
  1575. if(!this._scrolling){
  1576. this._scrolling=true;
  1577. var _146=this._tabControl.getWrapperDiv().clientWidth;
  1578. this._doAnimateScroll(_146,this._tabControl.getMaxRightScroll());
  1579. }
  1580. };
  1581. CognosScrollButton.prototype._doAnimateScroll=function(_147,_148){
  1582. if(_147>0){
  1583. var _149=10;
  1584. var _14a=this._tabControl.getWrapperDiv();
  1585. if(this._direction=="left"){
  1586. if(_14a.scrollLeft>_149){
  1587. this._tabControl.scrollTo(_14a.scrollLeft-_149);
  1588. }else{
  1589. this._tabControl.scrollTo(0);
  1590. this._scrolling=false;
  1591. return;
  1592. }
  1593. }else{
  1594. if(_14a.scrollLeft+_149<_148){
  1595. this._tabControl.scrollTo(_14a.scrollLeft+_149);
  1596. }else{
  1597. this._scrolling=false;
  1598. this._tabControl.scrollTo(_148);
  1599. this._tabControl.updateScrollButtons();
  1600. return;
  1601. }
  1602. }
  1603. _147-=_149;
  1604. var _14b=this;
  1605. setTimeout(function(){
  1606. _14b._doAnimateScroll(_147,_148);
  1607. },3);
  1608. }else{
  1609. this._scrolling=false;
  1610. this._tabControl.updateScrollButtons();
  1611. }
  1612. };
  1613. CognosScrollButton.prototype.isIE=function(){
  1614. return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
  1615. };
  1616. CognosScrollButton.prototype.render=function(_14c){
  1617. this._scrollButtonDiv=document.createElement("div");
  1618. this._scrollButtonDiv.className="ct_scrollButton";
  1619. var _14d=-1;
  1620. if(this.isIE()&&document.compatMode!="CSS1Compat"){
  1621. _14d=1;
  1622. }
  1623. this._scrollButtonDiv.style.height=this._height+_14d+"px";
  1624. if(this._tabControl.isHighContrast()){
  1625. this._scrollButtonDiv.innerHTML=this._direction=="left"?"&laquo;":"&raquo;";
  1626. }
  1627. this._outerDiv=document.createElement("div");
  1628. this._outerDiv.className="ct_scrollDisabled";
  1629. this._outerDiv.appendChild(this._scrollButtonDiv);
  1630. this._outerDiv.style.height=this._height+"px";
  1631. var _14e=this;
  1632. this._outerDiv.onclick=function(){
  1633. _14e.scroll();
  1634. };
  1635. this._wrapperDiv=document.createElement("div");
  1636. this._wrapperDiv.style.height=this._height+"px";
  1637. this._wrapperDiv.className="ct_scroll "+(this._direction=="left"?"ct_left":"ct_right")+(this._tabControl.isHighContrast()?" a11y":"");
  1638. this._wrapperDiv.appendChild(this._outerDiv);
  1639. if(this._direction=="left"){
  1640. _14c.insertBefore(this._wrapperDiv,_14c.firstChild);
  1641. this._wrapperDiv.style.left="0px";
  1642. }else{
  1643. _14c.appendChild(this._wrapperDiv);
  1644. this._wrapperDiv.style.right="0px";
  1645. }
  1646. };
  1647. function ActionFactory(_14f){
  1648. this.m_cognosViewer=_14f;
  1649. };
  1650. ActionFactory.prototype.load=function(_150){
  1651. this.m_cognosViewer.loadExtra();
  1652. var _151=null;
  1653. try{
  1654. var _152=_150+"Action";
  1655. _151=eval("(typeof "+_152+"=='function'? new "+_152+"():null);");
  1656. if(_151){
  1657. _151.setCognosViewer(this.m_cognosViewer);
  1658. }
  1659. }
  1660. catch(exception){
  1661. _151=null;
  1662. }
  1663. return _151;
  1664. };
  1665. function ActionFactory_loadActionHandler(evt,_154){
  1666. var _155=getCtxNodeFromEvent(evt);
  1667. var _156=_154.getSelectionController();
  1668. var _157=null;
  1669. if(_155!==null){
  1670. var _158=_155.getAttribute("ctx");
  1671. _158=_158.split("::")[0].split(":")[0];
  1672. var _159=_155.getAttribute("type")!=null?_155:_155.parentNode;
  1673. var type=_159.getAttribute("type");
  1674. switch(type){
  1675. case "columnTitle":
  1676. var _15b=(_155.getAttribute("dttargets")!=null);
  1677. var _15c=(_159.getAttribute("CTNM")!=null&&_156.getMun(_158)!=""&&_156.getUsageInfo(_158)!="2");
  1678. if(_15b||_15c){
  1679. _157=_154.getAction("DrillUpDownOrThrough");
  1680. _157.init(_15b,_15c);
  1681. _157.updateDrillabilityInfo(_154,_155);
  1682. }else{
  1683. _157=_154.getAction("RenameDataItem");
  1684. }
  1685. break;
  1686. case "datavalue":
  1687. case "chartElement":
  1688. case "ordinalAxisLabel":
  1689. case "legendLabel":
  1690. case "legendTitle":
  1691. case "ordinalAxisTitle":
  1692. var _15b=(_155.getAttribute("dttargets")!=null);
  1693. var _15c=(_156.getHun(_158)!="");
  1694. if(_15b||_15c){
  1695. _157=_154.getAction("DrillUpDownOrThrough");
  1696. _157.init(_15b,_15c);
  1697. _157.updateDrillabilityInfo(_154,_155);
  1698. }
  1699. break;
  1700. }
  1701. }
  1702. if(_157===null){
  1703. _157=_154.getAction("Selection");
  1704. }
  1705. _157.setCognosViewer(_154);
  1706. return _157;
  1707. };
  1708. ActionFactory.prototype.destroy=function(){
  1709. delete this.m_cognosViewer;
  1710. };
  1711. function CSelectionDefaultStyles(_15d){
  1712. this.m_primarySelectionColor=null;
  1713. this.m_highContrastBorderStyle="solid";
  1714. this.m_secondarySelectionIsDisabled=false;
  1715. if(_15d){
  1716. this.m_selectionController=_15d;
  1717. this.m_oCognosViewer=_15d.m_oCognosViewer;
  1718. if(this.m_oCognosViewer){
  1719. var _15e=this.m_oCognosViewer.getUIConfig();
  1720. if(_15e){
  1721. if(_15e.getPrimarySelectionColor()){
  1722. this.m_primarySelectionColor=_15e.getPrimarySelectionColor();
  1723. }
  1724. if(!_15e.getShowSecondarySelection()){
  1725. this.m_secondarySelectionIsDisabledConfig=true;
  1726. }else{
  1727. if(_15e.getSeondarySelectionColor()){
  1728. this.m_secondarySelectionColor=_15e.getSeondarySelectionColor();
  1729. }
  1730. }
  1731. }
  1732. }
  1733. }
  1734. };
  1735. CSelectionDefaultStyles.prototype.getPrimarySelectionColor=function(_15f){
  1736. return this.m_primarySelectionColor;
  1737. };
  1738. CSelectionDefaultStyles.prototype.getSecondarySelectionColor=function(){
  1739. return this.m_secondarySelectionColor;
  1740. };
  1741. CSelectionDefaultStyles.prototype.getHighContrastBorderStyle=function(){
  1742. return this.m_highContrastBorderStyle;
  1743. };
  1744. CSelectionDefaultStyles.prototype.canApplyToSelection=function(_160){
  1745. return true;
  1746. };
  1747. CSelectionDefaultStyles.prototype.secondarySelectionIsDisabled=function(){
  1748. return this.m_secondarySelectionIsDisabled;
  1749. };
  1750. CSelectionDefaultStyles.prototype.setStyleForSelection=function(){
  1751. };
  1752. function CSelectionFilterStyles(_161){
  1753. this.m_selectionController=_161;
  1754. this.m_primarySelectionColor=this.m_primarySelectionFilterColor="#44BFDD";
  1755. this.m_primarySelectionFilterColorForMeasure=null;
  1756. this.m_secondarySelectionColor=null;
  1757. this.m_highContrastBorderStyle="dotted";
  1758. this.m_secondarySelectionIsDisabled=true;
  1759. };
  1760. CSelectionFilterStyles.prototype=new CSelectionDefaultStyles();
  1761. CSelectionFilterStyles.prototype.getPrimarySelectionColor=function(_162){
  1762. return this.m_primarySelectionColor;
  1763. };
  1764. CSelectionFilterStyles.prototype.getSecondarySelectionColor=function(){
  1765. return this.m_secondarySelectionColor;
  1766. };
  1767. CSelectionFilterStyles.prototype.getHighContrastBorderStyle=function(){
  1768. return this.m_highContrastBorderStyle;
  1769. };
  1770. CSelectionFilterStyles.prototype.secondarySelectionIsDisabled=function(){
  1771. return this.m_secondarySelectionIsDisabled;
  1772. };
  1773. CSelectionFilterStyles.prototype.canApplyToSelection=function(_163){
  1774. return !this.selectionHasOnlyMeasure(_163);
  1775. };
  1776. CSelectionFilterStyles.prototype.selectionHasOnlyMeasure=function(_164){
  1777. return (_164.length===1&&_164[0].length===1&&this.m_selectionController.isMeasure(_164[0][0]));
  1778. };
  1779. CSelectionFilterStyles.prototype.setStyleForSelection=function(_165){
  1780. this.m_primarySelectionColor=(this.selectionHasOnlyMeasure(_165))?null:this.m_primarySelectionFilterColor;
  1781. };
  1782. function CSelectionFilterContextMenuStyles(_166){
  1783. CSelectionDefaultStyles.call(this,_166);
  1784. this.m_secondarySelectionIsDisabled=true;
  1785. };
  1786. CSelectionFilterContextMenuStyles.prototype=new CSelectionDefaultStyles();
  1787. function CSelectionObject(){
  1788. this.initialize();
  1789. };
  1790. CSelectionObject.prototype.initialize=function(){
  1791. this.m_oCellRef={};
  1792. this.m_sColumnRef="";
  1793. this.m_sColumnName="";
  1794. this.m_aDataItems=[];
  1795. this.m_aUseValues=[];
  1796. this.m_aDisplayValues=[];
  1797. this.m_sCellTypeId="";
  1798. this.m_sLayoutType="";
  1799. this.m_sTag="";
  1800. this.m_aMuns=[];
  1801. this.m_aRefQueries=[];
  1802. this.m_aMetadataItems=[];
  1803. this.m_aDrillOptions=[];
  1804. this.m_selectionController={};
  1805. this.m_contextIds=[];
  1806. this.m_ctxAttributeString="";
  1807. this.m_fetchedContextIds=false;
  1808. this.m_selectedClass=[];
  1809. this.m_cutClass=[];
  1810. this.m_dataContainerType="";
  1811. this.m_oJsonContext=null;
  1812. };
  1813. CSelectionObject.prototype.isSelectionOnVizChart=function(){
  1814. return false;
  1815. };
  1816. CSelectionObject.prototype.getCellRef=function(){
  1817. return this.m_oCellRef;
  1818. };
  1819. CSelectionObject.prototype.getColumnRP_Name=function(){
  1820. if(this.m_oCellRef!=null){
  1821. return this.m_oCellRef.getAttribute("rp_name");
  1822. }
  1823. };
  1824. CSelectionObject.prototype.getColumnRef=function(){
  1825. return this.m_sColumnRef;
  1826. };
  1827. CSelectionObject.prototype.getColumnName=function(){
  1828. if(this.m_sColumnName==""){
  1829. if(this.m_selectionController.hasContextData()&&this.m_contextIds.length){
  1830. this.m_sColumnName=this.m_selectionController.getRefDataItem(this.m_contextIds[0][0]);
  1831. }
  1832. }
  1833. return this.m_sColumnName;
  1834. };
  1835. CSelectionObject.prototype.getDataItemDisplayValue=function(_167){
  1836. var _168=this.getDataItems();
  1837. var item="";
  1838. if(_168&&_168[0]&&_168[0][0]){
  1839. item=this.getDataItems()[0][0];
  1840. if(_167&&_167.itemInfo&&_167.itemInfo.length){
  1841. var _16a=_167.itemInfo;
  1842. for(var i=0;i<_16a.length;i++){
  1843. if(_16a[i].item===item&&_16a[i].itemLabel){
  1844. return _16a[i].itemLabel;
  1845. }
  1846. }
  1847. }
  1848. }
  1849. return item;
  1850. };
  1851. CSelectionObject.prototype.getDataItems=function(){
  1852. if(!this.m_aDataItems.length){
  1853. this.fetchContextIds();
  1854. for(var i=0;i<this.m_contextIds.length;++i){
  1855. this.m_aDataItems[this.m_aDataItems.length]=[];
  1856. for(var j=0;j<this.m_contextIds[i].length;++j){
  1857. var _16e=this.m_contextIds[i][j];
  1858. this.m_aDataItems[this.m_aDataItems.length-1].push(this.m_selectionController.isContextId(_16e)?this.m_selectionController.getRefDataItem(_16e):"");
  1859. }
  1860. }
  1861. }
  1862. return this.m_aDataItems;
  1863. };
  1864. CSelectionObject.prototype.getUseValues=function(){
  1865. if(!this.m_aUseValues.length){
  1866. this.fetchContextIds();
  1867. for(var i=0;i<this.m_contextIds.length;++i){
  1868. this.m_aUseValues[this.m_aUseValues.length]=[];
  1869. for(var j=0;j<this.m_contextIds[i].length;++j){
  1870. var _171=this.m_contextIds[i][j];
  1871. this.m_aUseValues[this.m_aUseValues.length-1].push(this.m_selectionController.isContextId(_171)?this.m_selectionController.getUseValue(_171):"");
  1872. }
  1873. }
  1874. }
  1875. return this.m_aUseValues;
  1876. };
  1877. CSelectionObject.prototype.getCellTypeId=function(){
  1878. return this.m_sCellTypeId;
  1879. };
  1880. CSelectionObject.prototype.getDisplayValues=function(){
  1881. return this.m_aDisplayValues;
  1882. };
  1883. CSelectionObject.prototype.getLayoutType=function(){
  1884. return this.m_sLayoutType;
  1885. };
  1886. CSelectionObject.prototype.getTag=function(){
  1887. return this.m_sTag;
  1888. };
  1889. CSelectionObject.prototype.getMuns=function(){
  1890. if(!this.m_aMuns.length){
  1891. this.fetchContextIds();
  1892. for(var i=0;i<this.m_contextIds.length;++i){
  1893. this.m_aMuns[this.m_aMuns.length]=[];
  1894. for(var j=0;j<this.m_contextIds[i].length;++j){
  1895. var _174=this.m_contextIds[i][j];
  1896. this.m_aMuns[this.m_aMuns.length-1].push(this.m_selectionController.isContextId(_174)?this.m_selectionController.getMun(_174):"");
  1897. }
  1898. }
  1899. }
  1900. return this.m_aMuns;
  1901. };
  1902. CSelectionObject.prototype.getRefQueries=function(){
  1903. if(!this.m_aRefQueries.length){
  1904. this.fetchContextIds();
  1905. for(var i=0;i<this.m_contextIds.length;++i){
  1906. this.m_aRefQueries[this.m_aRefQueries.length]=[];
  1907. for(var j=0;j<this.m_contextIds[i].length;++j){
  1908. var _177=this.m_contextIds[i][j];
  1909. this.m_aRefQueries[this.m_aRefQueries.length-1].push(this.m_selectionController.isContextId(_177)?this.m_selectionController.getRefQuery(_177):"");
  1910. }
  1911. }
  1912. }
  1913. return this.m_aRefQueries;
  1914. };
  1915. CSelectionObject.prototype.getDimensionalItems=function(_178){
  1916. var _179=[];
  1917. this.fetchContextIds();
  1918. for(var i=0;i<this.m_contextIds.length;++i){
  1919. _179[_179.length]=[];
  1920. for(var j=0;j<this.m_contextIds[i].length;++j){
  1921. var _17c=this.m_contextIds[i][j];
  1922. var _17d="";
  1923. if(this.m_selectionController.isContextId(_17c)){
  1924. switch(_178){
  1925. case "hun":
  1926. _17d=this.m_selectionController.getHun(_17c);
  1927. break;
  1928. case "lun":
  1929. _17d=this.m_selectionController.getLun(_17c);
  1930. break;
  1931. case "dun":
  1932. _17d=this.m_selectionController.getDun(_17c);
  1933. break;
  1934. }
  1935. }
  1936. _179[_179.length-1].push(_17d);
  1937. }
  1938. }
  1939. return _179;
  1940. };
  1941. CSelectionObject.prototype.getMetadataItems=function(){
  1942. if(!this.m_aMetadataItems.length){
  1943. this.fetchContextIds();
  1944. for(var i=0;i<this.m_contextIds.length;++i){
  1945. this.m_aMetadataItems[this.m_aMetadataItems.length]=[];
  1946. for(var j=0;j<this.m_contextIds[i].length;++j){
  1947. var _180=this.m_contextIds[i][j];
  1948. var _181="";
  1949. if(this.m_selectionController.isContextId(_180)){
  1950. var sLun=this.m_selectionController.getLun(_180);
  1951. var sHun=this.m_selectionController.getHun(_180);
  1952. if(sLun&&sLun!=""){
  1953. _181=sLun;
  1954. }else{
  1955. if(sHun&&sHun!=""){
  1956. _181=sHun;
  1957. }else{
  1958. _181=this.m_selectionController.getQueryModelId(_180);
  1959. }
  1960. }
  1961. }
  1962. this.m_aMetadataItems[this.m_aMetadataItems.length-1].push(_181);
  1963. }
  1964. }
  1965. }
  1966. return this.m_aMetadataItems;
  1967. };
  1968. CSelectionObject.prototype.getDrillOptions=function(){
  1969. if(!this.m_aDrillOptions.length){
  1970. this.fetchContextIds();
  1971. for(var i=0;i<this.m_contextIds.length;++i){
  1972. this.m_aDrillOptions[this.m_aDrillOptions.length]=[];
  1973. for(var j=0;j<this.m_contextIds[i].length;++j){
  1974. var _186=this.m_contextIds[i][j];
  1975. this.m_aDrillOptions[this.m_aDrillOptions.length-1].push(this.m_selectionController.isContextId(_186)?this.m_selectionController.getDrillFlag(_186):0);
  1976. }
  1977. }
  1978. }
  1979. return this.m_aDrillOptions;
  1980. };
  1981. CSelectionObject.prototype.getSelectedContextIds=function(){
  1982. return this.m_contextIds;
  1983. };
  1984. CSelectionObject.prototype.fetchContextIds=function(){
  1985. if(!this.m_fetchedContextIds&&this.m_contextIds.length&&this.m_selectionController.hasContextData()){
  1986. var _187=[];
  1987. for(var i=0;i<this.m_contextIds.length;i++){
  1988. for(var j=0;j<this.m_contextIds[i].length;j++){
  1989. _187.push(this.m_contextIds[i][j]);
  1990. }
  1991. }
  1992. this.m_selectionController.fetchContextData(_187);
  1993. this.m_fetchedContextIds=true;
  1994. }
  1995. };
  1996. CSelectionObject.prototype.setSelectionController=function(sc){
  1997. if(sc){
  1998. this.m_selectionController=sc;
  1999. }
  2000. };
  2001. CSelectionObject.prototype.getLayoutElementId=function(){
  2002. return this.m_layoutElementId;
  2003. };
  2004. CSelectionObject.prototype.hasContextInformation=function(){
  2005. for(var i=0;i<this.m_contextIds.length;i++){
  2006. for(var j=0;j<this.m_contextIds[i].length;j++){
  2007. if(this.m_contextIds[i][j].length>0){
  2008. return true;
  2009. }
  2010. }
  2011. }
  2012. return false;
  2013. };
  2014. CSelectionObject.prototype.isHomeCell=function(){
  2015. var _18d=this.getCellRef().className;
  2016. if(_18d&&(_18d=="xm"||_18d.indexOf("xm ")!=-1||_18d.indexOf(" xm")!=-1)){
  2017. return true;
  2018. }
  2019. return false;
  2020. };
  2021. CSelectionObject.prototype.getDataContainerType=function(){
  2022. return this.m_dataContainerType;
  2023. };
  2024. CSelectionObject.prototype.getContextJsonObject=function(_18e,_18f){
  2025. if(this.m_oJsonContext===null){
  2026. var _190={};
  2027. var _191=[];
  2028. var _192=null;
  2029. this.getDataItems();
  2030. this.getUseValues();
  2031. if(this.m_contextIds.length==0){
  2032. return null;
  2033. }
  2034. var i=0,j=0;
  2035. var _195=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_18e);
  2036. _192=_195;
  2037. this._populateJsonContextObj(_195,this.m_aUseValues[i][j],_18e.getDisplayValue(this.m_contextIds[i][j]),_18e.getMun(this.m_contextIds[i][j]),_190,_191);
  2038. j++;
  2039. for(;i<this.m_aDataItems.length;i++,j=0){
  2040. for(;j<this.m_aDataItems[i].length;j++){
  2041. _195=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_18e);
  2042. if(!_192){
  2043. _192=_195;
  2044. }
  2045. this._populateJsonContextObj(_195,this.m_aUseValues[i][j],_18e.getDisplayValue(this.m_contextIds[i][j]),_18e.getMun(this.m_contextIds[i][j]),_190,_191);
  2046. }
  2047. }
  2048. this.m_oJsonContext=this._createGenericPayloadStructureJson(_192,_190,_191,_18f);
  2049. }
  2050. return this.m_oJsonContext;
  2051. };
  2052. CSelectionObject.prototype._getBestPossibleItemName=function(_196,_197,_198){
  2053. var _199=null;
  2054. if(_198.isMeasure(_197)){
  2055. if(!_198.isValidColumnTitle(this.m_oCellRef)){
  2056. if(!_198.isRelational([_197])){
  2057. _199=_198.getCCDManager().GetBestPossibleDimensionMeasureName(_197);
  2058. }
  2059. return (_199)?_199:_196;
  2060. }
  2061. }
  2062. _199=_198.getCCDManager().GetBestPossibleItemName(_197);
  2063. return (_199)?_199:_196;
  2064. };
  2065. CSelectionObject.prototype._isTypeColumnTitle=function(){
  2066. if(this.m_oCellRef&&typeof this.m_oCellRef.getAttribute=="function"){
  2067. return (this.m_oCellRef.getAttribute("type")==="columnTitle");
  2068. }
  2069. return false;
  2070. };
  2071. CSelectionObject.prototype._populateJsonContextObj=function(_19a,_19b,_19c,mun,_19e,_19f){
  2072. if(_19e&&_19f&&_19a&&typeof _19e[_19a]=="undefined"){
  2073. var _1a0=_19c?_19c:_19b;
  2074. _19e[_19a]=[_1a0];
  2075. var _1a1={};
  2076. if(_19c){
  2077. _1a1["caption"]=_19c;
  2078. }
  2079. if(mun){
  2080. _1a1["mun"]=mun;
  2081. }
  2082. if(_19b){
  2083. _1a1["use"]=_19b;
  2084. }
  2085. _19f.push(_1a1);
  2086. }
  2087. };
  2088. CSelectionObject.prototype._createGenericPayloadStructureJson=function(_1a2,_1a3,_1a4,_1a5){
  2089. if(_1a2&&_1a3&&_1a4){
  2090. var _1a6=(_1a5)?_1a5:".";
  2091. var _1a7={};
  2092. _1a7[_1a6]={"values":_1a4};
  2093. var obj={"com.ibm.widget.context":{"values":_1a3},"com.ibm.widget.context.report.select":{"select":{"selectedItem":_1a2,"itemSpecification":_1a7}}};
  2094. return obj;
  2095. }
  2096. return null;
  2097. };
  2098. CSelectionObject.prototype.populateSelectionPayload=function(_1a9,_1aa,_1ab){
  2099. this.getDataItems();
  2100. this.getUseValues();
  2101. if(this.m_contextIds.length==0){
  2102. return false;
  2103. }
  2104. _1ab=((_1ab===undefined)?false:_1ab);
  2105. var _1ac=this.m_selectionController;
  2106. for(var i=0,j=0;i<this.m_aDataItems.length;i++,j=0){
  2107. var _1af=(_1ab?1:this.m_aDataItems[i].length);
  2108. for(;j<_1af;j++){
  2109. if(!_1ac.isMeasure(this.m_contextIds[i][j])){
  2110. var _1b0=this.m_aDataItems[i][j];
  2111. this._populateItemInSelectionPayload(_1b0,this.m_aUseValues[i][j],_1ac.getDisplayValue(this.m_contextIds[i][j]),_1ac.getMun(this.m_contextIds[i][j]),_1a9,_1aa);
  2112. }
  2113. }
  2114. }
  2115. return true;
  2116. };
  2117. CSelectionObject.prototype._populateItemInSelectionPayload=function(_1b1,_1b2,_1b3,mun,_1b5,_1b6){
  2118. if(_1b5&&_1b1){
  2119. var _1b7=_1b2?_1b2:_1b3;
  2120. if(_1b5[_1b1]){
  2121. _1b5[_1b1].push(_1b7);
  2122. }else{
  2123. _1b5[_1b1]=[_1b7];
  2124. }
  2125. var _1b8={};
  2126. _1b8["caption"]=_1b7;
  2127. if(mun){
  2128. _1b8["mun"]=mun;
  2129. }
  2130. var _1b9=_1b6[_1b1];
  2131. if(!_1b9){
  2132. _1b9={"values":[]};
  2133. _1b6[_1b1]=_1b9;
  2134. }
  2135. _1b9.values.push(_1b8);
  2136. }
  2137. };
  2138. CSelectionObject.prototype.getCtxAttributeString=function(){
  2139. return this.m_ctxAttributeString;
  2140. };
  2141. CSelectionObject.prototype.isDataValueOrChartElement=function(){
  2142. return (this.m_sLayoutType==="datavalue"||this.m_sLayoutType==="chartElement");
  2143. };
  2144. CSelectionObject.prototype.marshal=function(_1ba,_1bb){
  2145. if(!this.m_oJsonForMarshal){
  2146. var _1bc={};
  2147. var _1bd=[];
  2148. var _1be=null;
  2149. this.getDataItems();
  2150. this.getUseValues();
  2151. if(this.m_contextIds.length==0){
  2152. return null;
  2153. }
  2154. var i=0,j=0;
  2155. if(this.m_contextIds[i][j].length==0){
  2156. var _1c1=false;
  2157. do{
  2158. for(;j<this.m_contextIds[i].length;j++){
  2159. if(this.m_contextIds[i][j].length>0){
  2160. _1c1=true;
  2161. break;
  2162. }
  2163. }
  2164. if(!_1c1){
  2165. j=0;
  2166. i++;
  2167. }
  2168. }while(!_1c1);
  2169. }
  2170. var _1c2=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_1ba);
  2171. var _1c3=_1ba.isMeasure(this.m_contextIds[i][j]);
  2172. var _1c4=this._getBestPossibleItemReference(this.m_contextIds[i][j],_1c3,_1ba.getCCDManager());
  2173. var _1c5=_1ba.getCCDManager().GetQuery(this.m_contextIds[i][j]);
  2174. var _1c6=this.isDataValueOrChartElement();
  2175. var _1c7=this._populateJsonForMarshal(_1c2,_1c4,_1c3,this.m_aUseValues[i][j],_1ba.getDisplayValue(this.m_contextIds[i][j]),_1ba.getMun(this.m_contextIds[i][j]),_1c6);
  2176. j++;
  2177. var _1c8=[];
  2178. for(;i<this.m_aDataItems.length;i++,j=0){
  2179. for(;j<this.m_aDataItems[i].length;j++){
  2180. _1c2=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_1ba);
  2181. _1c3=_1ba.isMeasure(this.m_contextIds[i][j]);
  2182. _1c4=this._getBestPossibleItemReference(this.m_contextIds[i][j],_1c3,_1ba.getCCDManager());
  2183. var _1c9=this._populateJsonForMarshal(_1c2,_1c4,_1c3,this.m_aUseValues[i][j],_1ba.getDisplayValue(this.m_contextIds[i][j]),_1ba.getMun(this.m_contextIds[i][j]));
  2184. if(_1c9){
  2185. _1c8.push(_1c9);
  2186. }
  2187. }
  2188. }
  2189. var lid=(typeof this.getArea=="function")?getImmediateLayoutContainerId(this.getArea()):getImmediateLayoutContainerId(this.getCellRef());
  2190. if(lid&&lid.indexOf(_1bb)>0){
  2191. lid=lid.substring(0,lid.indexOf(_1bb)-1);
  2192. }
  2193. this.m_oJsonForMarshal={"lid":lid,"query":_1c5,"selectedItem":_1c7,"context":_1c8};
  2194. }
  2195. return this.m_oJsonForMarshal;
  2196. };
  2197. CSelectionObject.prototype._populateJsonForMarshal=function(_1cb,_1cc,_1cd,_1ce,_1cf,mun,_1d1){
  2198. if(_1cb){
  2199. var _1d2={};
  2200. _1d2["itemName"]=_1cb;
  2201. _1d2["isMeasure"]=_1cd?"true":"false";
  2202. _1d2["mdProperty"]=_1cc.mdProperty;
  2203. _1d2["mdValue"]=_1cc.mdValue;
  2204. _1d2["isDataValueOrChartElement"]=_1d1?"true":"false";
  2205. if(mun){
  2206. _1d2["mun"]=mun;
  2207. }
  2208. if(_1ce){
  2209. _1d2["use"]=_1ce;
  2210. }
  2211. return _1d2;
  2212. }
  2213. return null;
  2214. };
  2215. CSelectionObject.prototype._getBestPossibleItemReference=function(_1d3,_1d4,_1d5){
  2216. var _1d6=null;
  2217. var _1d7=null;
  2218. if(_1d4){
  2219. _1d7="i";
  2220. _1d6=_1d5.GetQMID(_1d3);
  2221. if(_1d6==null){
  2222. _1d7="m";
  2223. _1d6=_1d5.GetMUN(_1d3);
  2224. }
  2225. if(_1d6==null){
  2226. _1d7="r";
  2227. _1d6=_1d5.GetRDIValue(_1d3);
  2228. }
  2229. }else{
  2230. _1d7="l";
  2231. _1d6=_1d5.GetLUN(_1d3);
  2232. if(_1d6==null){
  2233. _1d7="h";
  2234. _1d6=_1d5.GetHUN(_1d3);
  2235. }
  2236. if(_1d6==null){
  2237. _1d7="i";
  2238. _1d6=_1d5.GetQMID(_1d3);
  2239. }
  2240. if(_1d6==null){
  2241. _1d7="r";
  2242. _1d6=_1d5.GetRDIValue(_1d3);
  2243. }
  2244. }
  2245. return {"mdProperty":_1d7,"mdValue":_1d6};
  2246. };
  2247. CSelectionChartObject.prototype=new CSelectionObject();
  2248. CSelectionChartObject.prototype.constructor=CSelectionChartObject;
  2249. CSelectionChartObject.baseclass=CSelectionObject.prototype;
  2250. function CSelectionChartObject(){
  2251. CSelectionChartObject.baseclass.initialize.call(this);
  2252. this.m_chartArea=null;
  2253. this.m_context="";
  2254. this.m_chartCtxAreas=[];
  2255. this.m_selectedVizChart=false;
  2256. };
  2257. CSelectionChartObject.prototype.isSelectionOnVizChart=function(){
  2258. return this.m_selectedVizChart;
  2259. };
  2260. CSelectionChartObject.prototype.setSelectionOnVizChart=function(_1d8){
  2261. var _1d9=this.m_selectionController.getSelectedChartImageFromChartArea(_1d8);
  2262. if(_1d9){
  2263. this.m_selectedVizChart=_1d9.parentNode.getAttribute("vizchart")=="true"?true:false;
  2264. }
  2265. };
  2266. CSelectionChartObject.prototype.getArea=function(){
  2267. return this.m_chartArea;
  2268. };
  2269. CSelectionChartObject.prototype.getContext=function(){
  2270. return this.m_context;
  2271. };
  2272. CSelectionChartObject.prototype.getCtxAreas=function(){
  2273. return this.m_chartCtxAreas;
  2274. };
  2275. CSelectionChartObject.prototype.setCtxAreas=function(_1da){
  2276. this.m_chartCtxAreas=_1da;
  2277. };
  2278. CSelectionChartObject.prototype.getCtxAttributeString=function(){
  2279. return this.m_context;
  2280. };
  2281. function CChartHelper(_1db,_1dc,_1dd){
  2282. var _1de=_1db.parentNode;
  2283. this.m_selectionObjectFactory=_1dc;
  2284. this.m_map=_1de;
  2285. _1dd.loadExtra();
  2286. this.imageMapHighlighter=new CImageMapHighlight(_1de,_1dd.sWebContentRoot);
  2287. this.initialize();
  2288. };
  2289. CChartHelper.prototype.initialize=function(){
  2290. this.buildMapCtxAreas();
  2291. this.m_chartCtxNodes={};
  2292. };
  2293. CChartHelper.prototype.buildMapCtxAreas=function(){
  2294. var _1df={};
  2295. var _1e0=this.m_map.childNodes;
  2296. var _1e1=_1e0.length;
  2297. var _1e2=null;
  2298. for(var i=0;i<_1e1;i++){
  2299. var a=_1e0[i];
  2300. _1e2=a.getAttribute("ctx");
  2301. if(_1e2){
  2302. if(_1df[_1e2]){
  2303. _1df[_1e2].push(a);
  2304. }else{
  2305. _1df[_1e2]=[a];
  2306. }
  2307. }
  2308. }
  2309. this.m_ctxAreas=_1df;
  2310. };
  2311. CChartHelper.prototype.getChartNode=function(_1e5){
  2312. if(!this.isAreaInitialized(_1e5)){
  2313. var _1e6=_1e5.parentNode;
  2314. this.m_map=_1e6;
  2315. this.initialize();
  2316. this.imageMapHighlighter.initialize(_1e6);
  2317. }
  2318. var _1e7=_1e5.getAttribute("ctx");
  2319. if(!this.m_chartCtxNodes[_1e7]){
  2320. this.m_chartCtxNodes[_1e7]=this.m_selectionObjectFactory.getSelectionChartObject(_1e5);
  2321. this.m_chartCtxNodes[_1e7].setCtxAreas(this.m_ctxAreas[_1e7]);
  2322. }
  2323. return this.m_chartCtxNodes[_1e7];
  2324. };
  2325. CChartHelper.prototype.isAreaInitialized=function(_1e8){
  2326. return this.imageMapHighlighter.isAreaInitialized(_1e8);
  2327. };
  2328. CChartHelper.prototype.getImageMapHighlighter=function(){
  2329. return this.imageMapHighlighter;
  2330. };
  2331. function CSelectionObjectFactory(_1e9){
  2332. this.m_selectionController=_1e9;
  2333. };
  2334. CSelectionObjectFactory.prototype.getSelectionController=function(){
  2335. return this.m_selectionController;
  2336. };
  2337. CSelectionObjectFactory.prototype.getChildSpans=function(_1ea){
  2338. var _1eb=[];
  2339. for(var i=0;i<_1ea.childNodes.length;i++){
  2340. var _1ed=_1ea.childNodes[i];
  2341. if(!_1ed.getAttribute||_1ed.getAttribute("skipSelection")!="true"){
  2342. _1eb.push(_1ea.childNodes[i]);
  2343. }
  2344. }
  2345. var _1ee=_1ea;
  2346. var _1ef="";
  2347. while(!_1ef&&_1ee){
  2348. _1ef=_1ee.attributes?_1ee.attributes["LID"]:"";
  2349. _1ee=_1ee.parentNode;
  2350. }
  2351. _1ef=_1ef?_1ef.value:"";
  2352. var _1f0=[];
  2353. while(_1eb.length>0){
  2354. var _1ed=_1eb.pop();
  2355. var lid=_1ed.attributes?_1ed.attributes["LID"]:"";
  2356. lid=lid?lid.value:"";
  2357. if(!lid||lid==_1ef){
  2358. if(_1ed.nodeName.toLowerCase()=="span"){
  2359. _1f0.push(_1ed);
  2360. }else{
  2361. for(i=0;i<_1ed.childNodes.length;i++){
  2362. _1eb.push(_1ed.childNodes[i]);
  2363. }
  2364. }
  2365. }
  2366. }
  2367. return _1f0;
  2368. };
  2369. CSelectionObjectFactory.prototype.getSelectionObject=function(_1f2,_1f3){
  2370. var _1f4=new CSelectionObject();
  2371. try{
  2372. _1f4.setSelectionController(this.getSelectionController());
  2373. _1f4.m_oCellRef=_1f2;
  2374. _1f4.m_sColumnRef=_1f2.getAttribute("cid");
  2375. _1f4.m_sCellTypeId=_1f2.getAttribute("uid");
  2376. _1f4.m_sLayoutType=_1f2.getAttribute("type");
  2377. _1f4.m_sTag=_1f2.getAttribute("tag");
  2378. _1f4.m_layoutElementId=this.getLayoutElementId(_1f2);
  2379. _1f4.m_dataContainerType=this.getContainerType(_1f2);
  2380. if(typeof cf!="undefined"){
  2381. var _1f5=cf.cfgGet("MiniQueryObj");
  2382. if(_1f5){
  2383. var _1f6=_1f5.findChildWithAttribute("tag",_1f4.m_sTag);
  2384. if(_1f6&&_1f6.getAttribute("id")!=null){
  2385. _1f4.m_sColumnName=_1f6.getAttribute("id");
  2386. }
  2387. }
  2388. }
  2389. var _1f7=this.getChildSpans(_1f2);
  2390. if(_1f7.length>0){
  2391. for(var i=0;i<_1f7.length;i++){
  2392. var _1f9=_1f7[i];
  2393. if(_1f9.nodeType==1&&_1f9.nodeName.toLowerCase()=="span"&&_1f9.style.visibility!="hidden"){
  2394. var _1fa=null;
  2395. if(_1f2.getAttribute("ctx")!=null&&_1f2.getAttribute("ctx")!=""){
  2396. _1fa=_1f2;
  2397. }else{
  2398. if(_1f9.getAttribute("ctx")!=null&&_1f9.getAttribute("ctx")!=""){
  2399. _1fa=_1f9;
  2400. }else{
  2401. if(_1f9.getAttribute("dtTargets")&&_1f9.childNodes&&_1f9.childNodes.length){
  2402. for(var _1fb=0;_1fb<_1f9.childNodes.length;_1fb++){
  2403. if(_1f9.childNodes[_1fb].nodeType==1&&_1f9.childNodes[_1fb].style.visibility!="hidden"){
  2404. _1fa=_1f9.childNodes[_1fb];
  2405. }
  2406. }
  2407. }else{
  2408. for(var _1fc=0;_1fc<_1f9.childNodes.length;_1fc++){
  2409. var _1fd=_1f9.childNodes[_1fc];
  2410. if(typeof _1fd.getAttribute!="undefined"&&_1fd.getAttribute("ctx")!=null&&_1fd.getAttribute("ctx")!=""){
  2411. _1fa=_1fd;
  2412. break;
  2413. }
  2414. }
  2415. }
  2416. }
  2417. }
  2418. var _1fe="";
  2419. if(_1fa&&_1fa.getAttribute("ctx")){
  2420. _1fe=_1fa.getAttribute("ctx");
  2421. }
  2422. _1f4.m_aDisplayValues[_1f4.m_aDisplayValues.length]=this.getSelectionController().getDisplayValue(_1fe,_1f2.parentNode);
  2423. if(typeof _1f3!="undefined"&&_1f3!=_1fe){
  2424. continue;
  2425. }
  2426. _1f4=this.processCTX(_1f4,_1fe);
  2427. }
  2428. }
  2429. }else{
  2430. if(_1f2.getAttribute("ctx")!=null&&_1f2.getAttribute("ctx")!=""&&_1f4.m_sLayoutType=="datavalue"){
  2431. _1f4=this.processCTX(_1f4,_1f2.getAttribute("ctx"));
  2432. }
  2433. }
  2434. this.getSelectionController().processColumnTitleNode(_1f4);
  2435. }
  2436. catch(ex){
  2437. }
  2438. return _1f4;
  2439. };
  2440. CSelectionObjectFactory.prototype.processCTX=function(_1ff,_200){
  2441. if(typeof _200!="string"||_200.length==0){
  2442. return _1ff;
  2443. }
  2444. var ctx;
  2445. if(typeof _1ff.m_contextIds=="object"&&_1ff.m_contextIds!==null&&_1ff.m_contextIds.length>0){
  2446. var _202=_200.split("::");
  2447. for(ctx=0;ctx<_1ff.m_contextIds.length;++ctx){
  2448. try{
  2449. if(_202[ctx]){
  2450. _1ff.m_contextIds[ctx]=_1ff.m_contextIds[ctx].concat(_202[ctx].split(":"));
  2451. }
  2452. }
  2453. catch(e){
  2454. }
  2455. }
  2456. }else{
  2457. _1ff.m_contextIds=this.m_selectionController.m_oCognosViewer.getReportContextHelper().processCtx(_200);
  2458. }
  2459. _1ff.m_ctxAttributeString=_200;
  2460. return _1ff;
  2461. };
  2462. CSelectionObjectFactory.prototype.getSecondarySelectionObject=function(tag,_204,_205){
  2463. if(!_205){
  2464. _205=document;
  2465. }
  2466. var _206=new CSelectionObject();
  2467. _206.setSelectionController(this.getSelectionController());
  2468. _206.m_oCellRef=null;
  2469. _206.m_sColumnRef=null;
  2470. _206.m_sCellTypeId=null;
  2471. _206.refQuery="";
  2472. var _207=_205.getElementsByTagName("td");
  2473. for(var i=0;i<_207.length;i++){
  2474. var _209=_207[i].getAttribute("tag");
  2475. if(_209!=null&&_209!=""){
  2476. if(tag==_209){
  2477. var _20a=_207[i].className;
  2478. if(_20a!=null&&_209!=""){
  2479. if((_204=="columnTitle"&&_20a=="lt")||(_204=="datavalue"&&_20a=="lc")){
  2480. _206.m_sColumnRef=_207[i].getAttribute("cid");
  2481. _206.m_sCellTypeId=_207[i].getAttribute("uid");
  2482. break;
  2483. }
  2484. }
  2485. }
  2486. }
  2487. }
  2488. if(_206.m_sCellTypeId==null){
  2489. return null;
  2490. }
  2491. return _206;
  2492. };
  2493. CSelectionObjectFactory.prototype.getSelectionChartObject=function(_20b){
  2494. var _20c="";
  2495. if(_20b.getAttribute("flashChart")!=null){
  2496. if(typeof _20b.getCtx!="undefined"){
  2497. try{
  2498. _20c=_20b.getCtx();
  2499. }
  2500. catch(e){
  2501. _20c="";
  2502. }
  2503. }
  2504. }else{
  2505. _20c=_20b.getAttribute("ctx");
  2506. }
  2507. var _20d=new CSelectionChartObject();
  2508. _20d.setSelectionController(this.getSelectionController());
  2509. if(_20c!=null){
  2510. _20d.m_contextIds=_20c.split("::");
  2511. for(var ctx=0;ctx<_20d.m_contextIds.length;++ctx){
  2512. _20d.m_contextIds[ctx]=_20d.m_contextIds[ctx].split(":");
  2513. }
  2514. }
  2515. _20d.m_layoutElementId=this.getLayoutElementId(_20b);
  2516. _20d.m_sLayoutType=_20b.getAttribute("type");
  2517. _20d.m_chartArea=_20b;
  2518. _20d.m_context=_20c;
  2519. _20d.setSelectionOnVizChart(_20b);
  2520. return _20d;
  2521. };
  2522. CSelectionObjectFactory.prototype.getContainerTypeFromClass=function(_20f){
  2523. var _210="";
  2524. switch(_20f){
  2525. case "ls":
  2526. _210="list";
  2527. break;
  2528. case "xt":
  2529. _210="crosstab";
  2530. break;
  2531. case "rt":
  2532. _210="repeaterTable";
  2533. break;
  2534. }
  2535. return _210;
  2536. };
  2537. CSelectionObjectFactory.prototype.getContainerType=function(el){
  2538. var type="";
  2539. if(el){
  2540. if(el.className){
  2541. type=this.getContainerTypeFromClass(el.className);
  2542. }
  2543. if(!type){
  2544. var _213=el.parentNode;
  2545. if(_213){
  2546. type=this.getContainerType(_213);
  2547. }
  2548. }
  2549. }
  2550. return type;
  2551. };
  2552. CSelectionObjectFactory.prototype.getLayoutElementId=function(el){
  2553. var id="";
  2554. var _216=this.getSelectionController().getNamespace();
  2555. if(el){
  2556. if(el.getAttribute&&el.getAttribute("chartcontainer")=="true"){
  2557. for(var _217=0;_217<el.childNodes.length;_217++){
  2558. var _218=el.childNodes[_217];
  2559. if(_218.nodeName.toLowerCase()=="img"&&_218.getAttribute("lid")!=null){
  2560. return _218.getAttribute("lid");
  2561. }
  2562. }
  2563. }
  2564. id=(el.getAttribute&&el.getAttribute("LID"))||"";
  2565. if(!id){
  2566. var _219=el.parentNode;
  2567. if(_219){
  2568. id=this.getLayoutElementId(_219);
  2569. }
  2570. }else{
  2571. if(el.tagName.toUpperCase()=="MAP"){
  2572. id=id.replace(_216,"");
  2573. id=_216+id;
  2574. var _21a="#"+id;
  2575. var _21b=getElementsByAttribute(el.parentNode,"IMG","usemap",_21a);
  2576. if(_21b.length>0){
  2577. id=_21b[0].getAttribute("LID");
  2578. }
  2579. }
  2580. }
  2581. }
  2582. return id;
  2583. };
  2584. function CSelectionController(_21c,_21d){
  2585. this.m_bSelectionBasedFeaturesEnabled=false;
  2586. this.m_bDrillUpDownEnabled=false;
  2587. this.m_bModelDrillThroughEnabled=false;
  2588. this.m_oCognosViewer=null;
  2589. this.m_bSavedSelections=false;
  2590. if(_21d){
  2591. this.m_oCognosViewer=_21d;
  2592. }
  2593. this.initialize(_21c);
  2594. this.FILTER_SELECTION_STYLE=0;
  2595. this.FILTER_SELECTION_CONTEXT_MENU_STYLE=1;
  2596. };
  2597. CSelectionController.prototype.initialize=function(_21e){
  2598. this.m_sNamespace=_21e;
  2599. this.m_aCutColumns=[];
  2600. this.m_aSelectedObjects=[];
  2601. this.m_selectedClass=[];
  2602. this.m_cutClass=[];
  2603. this.m_oObserver=new CObserver(this);
  2604. this.m_bSelectionArraysSetup=false;
  2605. this.m_aSelectionHoverNodes=[];
  2606. this.m_bUsingCCDManager=false;
  2607. this.m_aReportMetadataArray=[];
  2608. this.m_aReportContextDataArray=[];
  2609. this.m_oCDManager=new CCDManager();
  2610. this.m_oSelectionObjectFactory=new CSelectionObjectFactory(this);
  2611. this.m_selectedChartArea=null;
  2612. this.m_selectedChartNodes=[];
  2613. this.m_selectionContainerMap=null;
  2614. this.m_chartHelpers={};
  2615. if(this.m_oCognosViewer!=null){
  2616. this.m_oCDManager.SetCognosViewer(this.m_oCognosViewer);
  2617. }
  2618. this.m_maxSecondarySelection=-1;
  2619. this.c_usageMeasure="2";
  2620. this.m_ccl_dateTypes={59:"dateTime",60:"interval"};
  2621. this.m_selectionStyles=new CSelectionDefaultStyles(this);
  2622. this.m_originalSelectionStyles=this.m_selectionStyles;
  2623. this.m_bAllowHorizontalDataValueSelection=false;
  2624. };
  2625. CSelectionController.prototype.secondarySelectionIsDisabled=function(){
  2626. return this.m_selectionStyles.secondarySelectionIsDisabled();
  2627. };
  2628. CSelectionController.prototype.getPrimarySelectionColor=function(){
  2629. return this.m_selectionStyles.getPrimarySelectionColor();
  2630. };
  2631. CSelectionController.prototype.getHighContrastBorderStyle=function(){
  2632. return this.m_selectionStyles.getHighContrastBorderStyle();
  2633. };
  2634. CSelectionController.prototype.getSecondarySelectionColor=function(){
  2635. return this.m_selectionStyles.getSecondarySelectionColor();
  2636. };
  2637. CSelectionController.prototype.resetSelectionStyles=function(){
  2638. this.setSelectionStyles();
  2639. };
  2640. CSelectionController.prototype.setSelectionStyles=function(_21f){
  2641. switch(_21f){
  2642. case this.FILTER_SELECTION_STYLE:
  2643. if(!this.m_selectionFilterStyles){
  2644. this.m_selectionFilterStyles=new CSelectionFilterStyles(this);
  2645. }
  2646. this.m_selectionStyles=this.m_selectionFilterStyles;
  2647. break;
  2648. case this.FILTER_SELECTION_CONTEXT_MENU_STYLE:
  2649. if(!this.m_selectionFilterContextMenuStyles){
  2650. this.m_selectionFilterContextMenuStyles=new CSelectionFilterContextMenuStyles(this);
  2651. }
  2652. this.m_selectionStyles=this.m_selectionFilterContextMenuStyles;
  2653. break;
  2654. default:
  2655. this.m_selectionStyles=this.m_originalSelectionStyles;
  2656. }
  2657. };
  2658. CSelectionController.prototype.resetAllowHorizontalDataValueSelection=function(){
  2659. this.m_bAllowHorizontalDataValueSelection=false;
  2660. };
  2661. CSelectionController.prototype.setAllowHorizontalDataValueSelection=function(_220){
  2662. this.m_bAllowHorizontalDataValueSelection=_220;
  2663. };
  2664. CSelectionController.prototype.allowHorizontalDataValueSelection=function(){
  2665. return this.m_bAllowHorizontalDataValueSelection;
  2666. };
  2667. CSelectionController.prototype.clearSelectionData=function(){
  2668. this.m_aSelectedObjects=[];
  2669. this.m_selectedChartNodes=[];
  2670. this.m_oSelectedDrillThroughImage=null;
  2671. this.m_oSelectedDrillThroughSingleton=null;
  2672. };
  2673. CSelectionController.prototype.getCCDManager=function(){
  2674. return this.m_oCDManager;
  2675. };
  2676. CSelectionController.prototype.getCtxIdFromDisplayValue=function(_221){
  2677. if(!this.m_bUsingCCDManager){
  2678. var _222=this.getReportContextDataArray();
  2679. var _223=1;
  2680. for(var _224 in _222){
  2681. var _225=_222[_224];
  2682. if(_225[_223]==_221){
  2683. return _224;
  2684. }
  2685. }
  2686. return "";
  2687. }else{
  2688. var sId=this.m_oCDManager.GetContextIdForDisplayValue(_221);
  2689. return (sId==null)?"":sId;
  2690. }
  2691. };
  2692. CSelectionController.prototype.getCtxIdFromMetaData=function(sLun,sHun,_229){
  2693. return this.m_oCDManager.getContextIdForMetaData(sLun,sHun,_229);
  2694. };
  2695. CSelectionController.prototype.replaceNamespaceForSharedTM1DimensionOnly=function(lun,hun,mun){
  2696. var sLun=lun;
  2697. var sHun=hun;
  2698. if(mun&&mun.indexOf("->:[TM].")>0){
  2699. sLun=this.m_oCDManager._replaceNamespaceForSharedTM1DimensionOnly(lun);
  2700. sHun=this.m_oCDManager._replaceNamespaceForSharedTM1DimensionOnly(hun);
  2701. }
  2702. return {"lun":sLun,"hun":sHun};
  2703. };
  2704. CSelectionController.prototype.getCtxIdFromMun=function(sMun){
  2705. if(!this.m_bUsingCCDManager){
  2706. var _230=this.getReportMetadataArray();
  2707. var _231=0;
  2708. for(var sKey in _230){
  2709. var _233=_230[sKey];
  2710. if(_233[_231]==sMun){
  2711. var _234=2;
  2712. var _235=this.getReportContextDataArray();
  2713. for(var _236 in _235){
  2714. var _237=_235[_236];
  2715. if(_237[_234]==sKey){
  2716. return _236;
  2717. }
  2718. }
  2719. }
  2720. }
  2721. return "";
  2722. }else{
  2723. var sId=this.m_oCDManager.GetContextIdForMUN(sMun);
  2724. return (sId==null)?"":sId;
  2725. }
  2726. };
  2727. CSelectionController.prototype.canDrillDown=function(_239){
  2728. var _23a=this.getDrillFlagForMember(_239);
  2729. return (_23a==3||_23a==2);
  2730. };
  2731. CSelectionController.prototype.canDrillUp=function(_23b){
  2732. var _23c=this.getDrillFlagForMember(_23b);
  2733. return (_23c==3||_23c==1);
  2734. };
  2735. CSelectionController.prototype.getQueryModelId=function(_23d){
  2736. var qmid="";
  2737. if(!this.m_bUsingCCDManager){
  2738. var _23f=this.m_aReportContextDataArray[_23d];
  2739. if(_23f&&typeof _23f[3]!="undefined"){
  2740. var _240=_23f[3];
  2741. var _241=this.m_aReportMetadataArray[_240];
  2742. if(typeof _241!="undefined"&&typeof _241[1]!="undefined"&&_241[1]=="I"){
  2743. qmid=_241[0];
  2744. }
  2745. }
  2746. }else{
  2747. qmid=this.m_oCDManager.GetQMID(_23d);
  2748. }
  2749. return qmid;
  2750. };
  2751. CSelectionController.prototype.getRefQuery=function(_242){
  2752. if(!this.m_bUsingCCDManager){
  2753. return this.getMetaDataItemUseValue(4,_242);
  2754. }else{
  2755. var _243=this.m_oCDManager.GetQuery(_242);
  2756. return (_243==null)?"":_243;
  2757. }
  2758. };
  2759. CSelectionController.prototype.getRefDataItem=function(_244){
  2760. return this.m_oCognosViewer.getReportContextHelper().getRefDataItem(_244);
  2761. };
  2762. CSelectionController.prototype.getMun=function(_245){
  2763. return this.m_oCognosViewer.getReportContextHelper().getMun(_245);
  2764. };
  2765. CSelectionController.prototype.getHun=function(_246){
  2766. if(!this.m_bUsingCCDManager){
  2767. var sHun=null;
  2768. var _248=this.getRDI(_246);
  2769. if(_248&&_248.length>4&&_248[1]=="R"){
  2770. var _249=_248[4];
  2771. var _24a=this.getReportMetadataArray();
  2772. _248=_24a[_249];
  2773. }
  2774. if(_248&&_248.length>1&&_248[1]=="H"){
  2775. sHun=_248[0];
  2776. }
  2777. return sHun;
  2778. }else{
  2779. return this.m_oCDManager.GetHUN(_246);
  2780. }
  2781. };
  2782. CSelectionController.prototype.fetchContextData=function(_24b,_24c){
  2783. var _24d=0;
  2784. if(this.m_bUsingCCDManager){
  2785. _24d=this.m_oCDManager.FetchContextData(_24b,_24c);
  2786. }
  2787. return _24d;
  2788. };
  2789. CSelectionController.prototype.getMetaDataItem=function(sKey){
  2790. var _24f=this.getReportMetadataArray();
  2791. if(typeof _24f[sKey]!="undefined"){
  2792. return _24f[sKey];
  2793. }
  2794. return null;
  2795. };
  2796. CSelectionController.prototype.getContextDataItem=function(_250){
  2797. var _251=this.getReportContextDataArray();
  2798. if(typeof _251[_250]!="undefined"){
  2799. return _251[_250];
  2800. }
  2801. return null;
  2802. };
  2803. CSelectionController.prototype.getMetaDataItemUseValue=function(_252,_253){
  2804. var _254=this.getContextDataItem(_253);
  2805. if(_254!=null){
  2806. var _255=_254[_252];
  2807. if(_255!=""){
  2808. var _256=this.getMetaDataItem(_255);
  2809. if(_256!=null){
  2810. return _256[0];
  2811. }
  2812. }
  2813. }
  2814. return "";
  2815. };
  2816. CSelectionController.prototype.getRDI=function(_257){
  2817. var _258=this.getContextDataItem(_257);
  2818. if(_258!=null){
  2819. var _259=_258[0];
  2820. if(_259!=""){
  2821. var _25a=this.getMetaDataItem(_259);
  2822. if(_25a!=null){
  2823. return _25a;
  2824. }
  2825. }
  2826. }
  2827. };
  2828. CSelectionController.prototype.getNamespace=function(){
  2829. return this.m_sNamespace;
  2830. };
  2831. CSelectionController.prototype.setSelectionBasedFeaturesEnabled=function(_25b){
  2832. this.m_bSelectionBasedFeaturesEnabled=_25b;
  2833. };
  2834. CSelectionController.prototype.getSelectionBasedFeaturesEnabled=function(){
  2835. return this.m_bSelectionBasedFeaturesEnabled;
  2836. };
  2837. CSelectionController.prototype.setDrillUpDownEnabled=function(_25c){
  2838. this.m_bDrillUpDownEnabled=_25c;
  2839. };
  2840. CSelectionController.prototype.getDrillUpDownEnabled=function(){
  2841. return this.m_bDrillUpDownEnabled;
  2842. };
  2843. CSelectionController.prototype.setModelDrillThroughEnabled=function(_25d){
  2844. this.m_bModelDrillThroughEnabled=_25d;
  2845. };
  2846. CSelectionController.prototype.getBookletItemForCurrentSelection=function(){
  2847. var _25e=this.getAllSelectedObjects();
  2848. if(_25e&&_25e.length>0){
  2849. var _25f=_25e[0];
  2850. if(_25f.hasContextInformation()){
  2851. var _260=this.m_oCDManager.GetBIValue(_25f.m_contextIds[0][0]);
  2852. if(!_260){
  2853. return null;
  2854. }
  2855. return _260;
  2856. }
  2857. }
  2858. return null;
  2859. };
  2860. CSelectionController.prototype.getModelPathForCurrentSelection=function(){
  2861. var _261=null;
  2862. var _262=this.getBookletItemForCurrentSelection();
  2863. if(_262){
  2864. var _261=this.m_oCDManager.getModelPathFromBookletItem(_262);
  2865. }
  2866. return _261;
  2867. };
  2868. CSelectionController.prototype.getModelDrillThroughEnabled=function(){
  2869. var _263=this.getBookletItemForCurrentSelection();
  2870. if(_263){
  2871. var _264=this.m_oCDManager.GetBookletModelBasedDrillThru(_263);
  2872. return _264==1?true:false;
  2873. }else{
  2874. return this.m_bModelDrillThroughEnabled;
  2875. }
  2876. };
  2877. CSelectionController.prototype.clearSelectedObjects=function(_265){
  2878. try{
  2879. if(!_265){
  2880. _265=document;
  2881. }
  2882. this.updateUI(_265,this.getSelections(),true,false);
  2883. this.m_aSelectedObjects=[];
  2884. if(typeof this.onSelectionChange=="function"){
  2885. this.onSelectionChange();
  2886. }
  2887. return true;
  2888. }
  2889. catch(e){
  2890. return false;
  2891. }
  2892. };
  2893. CSelectionController.prototype.resetSelections=function(_266){
  2894. try{
  2895. if(!_266){
  2896. _266=document;
  2897. }
  2898. if(this.hasSelectedChartNodes()){
  2899. this.resetChartSelections(_266);
  2900. }
  2901. this.m_oSelectedDrillThroughImage=null;
  2902. this.m_oSelectedDrillThroughSingleton=null;
  2903. if(this.getSelections()){
  2904. this.updateUI(_266,this.getSelections(),true,false);
  2905. this.updateUI(_266,this.getCutColumns(),true,false);
  2906. this.m_aCutColumns=[];
  2907. this.m_aSelectedObjects=[];
  2908. this.m_selectedClass=[];
  2909. this.m_cutClass=[];
  2910. if(typeof this.onSelectionChange=="function"){
  2911. this.onSelectionChange();
  2912. }
  2913. }
  2914. return true;
  2915. }
  2916. catch(e){
  2917. return false;
  2918. }
  2919. };
  2920. CSelectionController.prototype.resetChartSelections=function(_267){
  2921. var _268=this.m_chartHelpers;
  2922. for(var _269 in _268){
  2923. if(_268[_269]){
  2924. var _26a=_268[_269].getImageMapHighlighter();
  2925. if(_26a.hideAllAreas){
  2926. _26a.hideAllAreas();
  2927. }
  2928. }
  2929. }
  2930. this.m_selectedChartNodes=[];
  2931. this.m_selectionContainerMap=null;
  2932. };
  2933. CSelectionController.prototype.addSelectionObject=function(_26b,_26c){
  2934. try{
  2935. if(!_26c){
  2936. _26c=document;
  2937. }
  2938. var _26d=_26b.getCellRef();
  2939. if(this.isCellSelected(_26d)!==true||(typeof _26d!="object"||_26d===null)){
  2940. if(this.isColumnCut(_26b.getTag())!==true){
  2941. this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_26b;
  2942. if(typeof this.onSelectionChange=="function"){
  2943. this.onSelectionChange();
  2944. }
  2945. this.updateUI(_26c,this.getSelections(),false,false);
  2946. }
  2947. }
  2948. return true;
  2949. }
  2950. catch(e){
  2951. return false;
  2952. }
  2953. };
  2954. CSelectionController.prototype.removeSelectionObject=function(_26e,_26f){
  2955. try{
  2956. if(!_26f){
  2957. _26f=document;
  2958. }
  2959. var _270=[];
  2960. var _271;
  2961. for(_271=0;_271<this.m_aSelectedObjects.length;_271++){
  2962. var _272=this.m_aSelectedObjects[_271].getCellRef();
  2963. var _273=_26e.getCellRef();
  2964. if(typeof _272=="object"&&typeof _273=="object"&&_272!==null&&_273!==null){
  2965. if(_272==_273){
  2966. _270[_270.length]=_271;
  2967. }
  2968. }
  2969. }
  2970. if(_270.length>0){
  2971. this.updateUI(_26f,this.getSelections(),true,false);
  2972. var _274=[];
  2973. for(_271=0;_271<this.m_aSelectedObjects.length;_271++){
  2974. var _275=true;
  2975. for(var j=0;j<_270.length;j++){
  2976. if(_271==_270[j]){
  2977. _275=false;
  2978. }
  2979. }
  2980. if(_275){
  2981. _274[_274.length]=this.m_aSelectedObjects[_271];
  2982. }
  2983. }
  2984. this.m_aSelectedObjects=_274;
  2985. this.updateUI(_26f,this.getSelections(),false,false);
  2986. }
  2987. if(typeof this.onSelectionChange=="function"){
  2988. this.onSelectionChange();
  2989. }
  2990. return true;
  2991. }
  2992. catch(e){
  2993. return false;
  2994. }
  2995. };
  2996. CSelectionController.prototype.isSavedCellSelected=function(_277){
  2997. return this.isCellSelectedHelper(_277,this.getSavedSelectedObjects());
  2998. };
  2999. CSelectionController.prototype.isCellSelected=function(_278){
  3000. return this.isCellSelectedHelper(_278,this.getSelections());
  3001. };
  3002. CSelectionController.prototype.isCellSelectedHelper=function(_279,_27a){
  3003. try{
  3004. for(var i=0;i<_27a.length;i++){
  3005. var _27c=_27a[i].getCellRef();
  3006. if(typeof _27c=="object"&&_27c!==null){
  3007. if(_27c==_279){
  3008. return true;
  3009. }
  3010. }
  3011. }
  3012. }
  3013. catch(e){
  3014. }
  3015. return false;
  3016. };
  3017. CSelectionController.prototype.isColumnSelected=function(_27d){
  3018. try{
  3019. for(var i=0;i<this.m_aSelectedObjects.length;i++){
  3020. if(this.m_aSelectedObjects[i].getTag()==_27d){
  3021. return true;
  3022. }
  3023. }
  3024. }
  3025. catch(e){
  3026. }
  3027. return false;
  3028. };
  3029. CSelectionController.prototype.isColumnCut=function(_27f){
  3030. try{
  3031. for(var i=0;i<this.m_aCutColumns.length;i++){
  3032. if(this.m_aCutColumns[i].getTag()==_27f){
  3033. return true;
  3034. }
  3035. }
  3036. }
  3037. catch(e){
  3038. }
  3039. return false;
  3040. };
  3041. CSelectionController.prototype.getSelections=function(){
  3042. return this.m_aSelectedObjects;
  3043. };
  3044. CSelectionController.prototype.selectSingleDomNode=function(_281){
  3045. this.clearSelectedObjects();
  3046. var _282=this.getSelectionObjectFactory().getSelectionObject(_281);
  3047. var _283=null;
  3048. if(isIE()){
  3049. _283=_281.document;
  3050. }else{
  3051. _283=_281.ownerDocument;
  3052. }
  3053. this.addSelectionObject(_282,_283);
  3054. };
  3055. CSelectionController.prototype.hasCutColumns=function(){
  3056. if(this.m_aCutColumns.length===0){
  3057. return false;
  3058. }else{
  3059. return true;
  3060. }
  3061. };
  3062. CSelectionController.prototype.setCutColumns=function(_284,_285){
  3063. try{
  3064. if(!_285){
  3065. _285=document;
  3066. }
  3067. this.updateUI(_285,this.getSelections(),true,false);
  3068. this.updateUI(_285,this.getCutColumns(),true,1);
  3069. this.m_aCutColumns=[];
  3070. if(_284===true){
  3071. for(var i=0;i<this.m_aSelectedObjects.length;i++){
  3072. this.m_aCutColumns[i]=this.m_aSelectedObjects[i];
  3073. }
  3074. this.m_aSelectedObjects=[];
  3075. }
  3076. this.updateUI(_285,this.getCutColumns(),false,2);
  3077. return true;
  3078. }
  3079. catch(e){
  3080. return false;
  3081. }
  3082. };
  3083. CSelectionController.prototype.getCutColumns=function(){
  3084. return this.m_aCutColumns;
  3085. };
  3086. CSelectionController.prototype.getObservers=function(){
  3087. return this.m_oObserver;
  3088. };
  3089. CSelectionController.prototype.attachObserver=function(_287){
  3090. this.m_oObserver.attach(_287);
  3091. };
  3092. CSelectionController.prototype.onSelectionChange=function(){
  3093. this.getObservers().notify();
  3094. };
  3095. CSelectionController.prototype.getSelectedColumns=function(_288){
  3096. var _289=[];
  3097. if(typeof _288=="undefined"){
  3098. _288=this.getSelections();
  3099. }
  3100. var _28a=_288.length;
  3101. for(var i=0;i<_28a;i++){
  3102. var _28c=_288[i];
  3103. var _28d=true;
  3104. for(var j=0;j<_289.length;j++){
  3105. if(_289[j][0]==_28c.getColumnRef()&&_289[j][1]==_28c.getCellTypeId()){
  3106. _28d=false;
  3107. break;
  3108. }
  3109. }
  3110. if(_28d){
  3111. _289[_289.length]=[_28c.getColumnRef(),_28c.getCellTypeId(),_28c.getLayoutType(),_28c.getTag(),_28c.getColumnName()];
  3112. }
  3113. }
  3114. return _289;
  3115. };
  3116. CSelectionController.prototype.getAllSelectedObjectsWithUniqueCTXIDs=function(){
  3117. var _28f=[];
  3118. var _290=this.getAllSelectedObjects();
  3119. for(var i=0;i<_290.length;i++){
  3120. var _292=false;
  3121. var _293=_290[i];
  3122. for(var ii=0;ii<_28f.length;ii++){
  3123. if(_293.m_contextIds[0][0]==_28f[ii].m_contextIds[0][0]){
  3124. _292=true;
  3125. break;
  3126. }
  3127. }
  3128. if(!_292){
  3129. _28f.push(_293);
  3130. }
  3131. }
  3132. return _28f;
  3133. };
  3134. CSelectionController.prototype.getAllSelectedObjects=function(){
  3135. var _295=this.getSelections();
  3136. if(this.hasSelectedChartNodes()){
  3137. _295=_295.concat(this.getSelectedChartNodes());
  3138. }
  3139. return _295;
  3140. };
  3141. CSelectionController.prototype.getSelectedColumnIds=function(_296){
  3142. var _297=[];
  3143. if(typeof _296=="undefined"){
  3144. _296=this.getSelections();
  3145. }
  3146. var _298=this.getSelectedColumns(_296);
  3147. for(var _299=0;_299<_298.length;_299++){
  3148. var _29a=true;
  3149. for(var _29b=0;_29b<_297.length;_29b++){
  3150. if(_297[_29b]==_298[_299][4]){
  3151. _29a=false;
  3152. break;
  3153. }
  3154. }
  3155. if(_29a){
  3156. _297[_297.length]=_298[_299][4];
  3157. }
  3158. }
  3159. return _297;
  3160. };
  3161. var STYLE_SELECTION={};
  3162. CSelectionController.prototype.selecting=function(c,_29d){
  3163. var _29e="."+c+_29d;
  3164. var doc=document;
  3165. var _2a0=document.getElementById("CVIFrame"+this.m_sNamespace);
  3166. if(_2a0){
  3167. doc=_2a0.contentWindow.document;
  3168. }
  3169. var _2a1=doc.createElement("style");
  3170. _2a1.setAttribute("type","text/css");
  3171. if(_2a1.styleSheet){
  3172. _2a1.styleSheet.cssText=_29e;
  3173. }else{
  3174. _2a1.appendChild(doc.createTextNode(_29e));
  3175. }
  3176. doc.getElementsByTagName("head").item(0).appendChild(_2a1);
  3177. STYLE_SELECTION[c]=_2a1;
  3178. };
  3179. CSelectionController.prototype.deselecting=function(_2a2){
  3180. for(var i=0;i<_2a2.length;++i){
  3181. if(STYLE_SELECTION[_2a2[i]]){
  3182. var node=STYLE_SELECTION[_2a2[i]];
  3183. node.parentNode.removeChild(node);
  3184. STYLE_SELECTION[_2a2[i]]=null;
  3185. }
  3186. }
  3187. if(isIE()&&typeof this.m_oCognosViewer.m_viewerFragment!="undefined"){
  3188. var _2a5=document.getElementById("CVReport"+this.m_oCognosViewer.getId());
  3189. if(_2a5!=null){
  3190. var _2a6=_2a5.style.display;
  3191. _2a5.style.display="none";
  3192. _2a5.style.display=_2a6;
  3193. }
  3194. }
  3195. };
  3196. CSelectionController.prototype.showViewerContextMenu=function(){
  3197. if(this.hasSelectedChartNodes()){
  3198. return true;
  3199. }
  3200. if(this.m_aSelectedObjects&&this.m_aSelectedObjects.length>0){
  3201. return true;
  3202. }
  3203. return false;
  3204. };
  3205. function getStyleFromClass(c){
  3206. for(var i=0;i<document.styleSheets.length;i++){
  3207. var ss=document.styleSheets[i];
  3208. var _2aa=(ss.cssRules?ss.cssRules:ss.rules);
  3209. for(var j=0;j<_2aa.length;j++){
  3210. var cr=_2aa[j];
  3211. var _2ad=new RegExp("\\b"+c+"\\b","g");
  3212. if(cr.selectorText&&cr.selectorText.match(_2ad)){
  3213. return cr;
  3214. }
  3215. }
  3216. }
  3217. return 0;
  3218. };
  3219. CSelectionController.prototype.canUpdateSelection=function(_2ae){
  3220. return this.m_selectionStyles.canApplyToSelection(_2ae);
  3221. };
  3222. CSelectionController.prototype.setStyleForSelection=function(_2af){
  3223. return this.m_selectionStyles.setStyleForSelection(_2af);
  3224. };
  3225. CSelectionController.prototype.updateUI=function(_2b0,_2b1,_2b2,_2b3){
  3226. if(!_2b0){
  3227. _2b0=document;
  3228. }
  3229. try{
  3230. if(_2b1&&_2b1.length>0){
  3231. var _2b4,_2b5,_2b6;
  3232. if(_2b3==1||_2b3==2){
  3233. if(_2b2){
  3234. this.deselecting(this.m_cutClass);
  3235. }else{
  3236. var _2b7=getStyleFromClass("cutSelection").style.color;
  3237. var _2b8=getStyleFromClass("cutSelection").style.backgroundColor;
  3238. _2b4=_2b1.length;
  3239. for(_2b5=0;_2b5<_2b4;_2b5++){
  3240. _2b6=_2b1[_2b5].getCellRef();
  3241. var _2b9="cutQS"+_2b6.getAttribute("cid");
  3242. this.selecting(_2b9,"\n{ background-color: "+_2b8+"; color: "+_2b7+";}\n");
  3243. this.m_cutClass.push(_2b9);
  3244. }
  3245. }
  3246. }else{
  3247. if(this.m_oCognosViewer){
  3248. this.findSelectionURLs();
  3249. _2b6="";
  3250. _2b4=_2b1.length;
  3251. for(_2b5=0;_2b5<_2b4;_2b5++){
  3252. _2b6=_2b1[_2b5].getCellRef();
  3253. if(_2b6.getAttribute("oldClassName")!=null){
  3254. _2b6.className=_2b6.getAttribute("oldClassName");
  3255. _2b6.removeAttribute("oldClassName");
  3256. }
  3257. this.setStyleForSelection(_2b1[_2b5].m_contextIds);
  3258. if(!this.secondarySelectionIsDisabled()||_2b2){
  3259. var _2ba=document.getElementById("CVReport"+this.getNamespace());
  3260. var _2bb=getElementsByAttribute(_2ba,["td","th"],"name",_2b6.getAttribute("name"),this.m_maxSecondarySelection);
  3261. for(var _2bc=0;_2bc<_2bb.length;_2bc++){
  3262. var cell=_2bb[_2bc];
  3263. if(_2b2){
  3264. this.restoreOldBackgroundImage(cell);
  3265. }else{
  3266. if(cell.getAttribute("oldBackgroundImageStyle")==null){
  3267. this.saveOldCellStyles(cell);
  3268. this.setSecondarySelectionStyles(cell);
  3269. }
  3270. }
  3271. }
  3272. }
  3273. this.saveOldCellStyles(_2b6);
  3274. if(_2b2){
  3275. this.restoreOldBackgroundImage(_2b6);
  3276. if(this.m_oCognosViewer.isHighContrast()){
  3277. this.restoreOldBorder(_2b6);
  3278. this.restoreOldPadding(_2b6);
  3279. }
  3280. }else{
  3281. this.setPrimarySelectionStyles(_2b6);
  3282. if(this.m_oCognosViewer.isHighContrast()){
  3283. var size=getBoxInfo(_2b6,true);
  3284. this.saveOldBorder(_2b6);
  3285. this.saveOldPadding(_2b6,size);
  3286. var _2bf=3;
  3287. var _2c0=size.borderTopWidth+size.paddingTop-_2bf;
  3288. var _2c1=size.borderBottomWidth+size.paddingBottom-_2bf;
  3289. var _2c2=size.borderLeftWidth+size.paddingLeft-_2bf;
  3290. var _2c3=size.borderRightWidth+size.paddingRight-_2bf;
  3291. _2b6.style.border=_2bf+"px "+this.getHighContrastBorderStyle()+" black";
  3292. _2b6.style.padding=_2c0+"px "+_2c3+"px "+_2c1+"px "+_2c2+"px";
  3293. }
  3294. }
  3295. }
  3296. }
  3297. }
  3298. }
  3299. return true;
  3300. }
  3301. catch(e){
  3302. return false;
  3303. }
  3304. };
  3305. CSelectionController.prototype.findSelectionURLs=function(){
  3306. if(!(this.sS_backgroundImageURL&&this.pS_backgroundImageURL)){
  3307. if(this.m_oCognosViewer.isBux||isSafari()||this.m_oCognosViewer.isMobile()){
  3308. this.pS_backgroundImageURL="url(../common/images/selection_primary.png)";
  3309. this.sS_backgroundImageURL="url(../common/images/selection_secondary.png)";
  3310. }else{
  3311. this.pS_backgroundImageURL=this.getBackgroundImage(getStyleFromClass("primarySelection"));
  3312. this.sS_backgroundImageURL=this.getBackgroundImage(getStyleFromClass("secondarySelection"));
  3313. }
  3314. }
  3315. };
  3316. CSelectionController.prototype.setSelectedChartImgArea=function(_2c4){
  3317. var _2c5=true;
  3318. var _2c6=_2c4.getAttribute("rsvpChart");
  3319. var _2c7=_2c4.parentNode.getAttribute("chartContainer");
  3320. if(_2c6!="true"&&_2c7!="true"){
  3321. this.m_selectedChartNodes=[];
  3322. _2c5=false;
  3323. }else{
  3324. var _2c8=this.getSelectionObjectFactory().getSelectionChartObject(_2c4);
  3325. this.m_selectedChartNodes=[_2c8];
  3326. }
  3327. return _2c5;
  3328. };
  3329. CSelectionController.prototype.setSelectedChartArea=function(_2c9,e){
  3330. var _2cb=typeof this.m_oCognosViewer.isBux!=="undefined";
  3331. var _2cc=false;
  3332. if(_2c9!==null){
  3333. if(_2c9.tagName=="IMG"){
  3334. _2cc=this.setSelectedChartImgArea(_2c9);
  3335. }else{
  3336. if(_2c9.nodeName=="AREA"&&_2c9.attributes["ctx"]){
  3337. _2cc=true;
  3338. if(_2cb){
  3339. this.setBuxSelectedChartArea(_2c9,e);
  3340. }else{
  3341. this.m_selectedChartNodes=[this.getSelectionObjectFactory().getSelectionChartObject(_2c9)];
  3342. }
  3343. }
  3344. }
  3345. if(_2cc){
  3346. this.getObservers().notify();
  3347. }
  3348. }
  3349. return _2cc;
  3350. };
  3351. CSelectionController.prototype.setBuxSelectedChartArea=function(_2cd,e){
  3352. var _2cf=this.getChartHelper(_2cd);
  3353. var _2d0=_2cf.getChartNode(_2cd);
  3354. this.setStyleForSelection(_2d0.m_contextIds);
  3355. var _2d1=_2cf.getImageMapHighlighter();
  3356. _2d1.setFillColour(this.getPrimarySelectionColor());
  3357. _2d1.setStrokeColour(this.getPrimarySelectionColor());
  3358. if(typeof e=="undefined"){
  3359. e={};
  3360. }
  3361. if(this.ctrlKeyPressed(e)||this.shiftKeyPressed(e)){
  3362. if(_2d1.isAreaHighlighted(_2cd)){
  3363. _2d1.hideAreas(_2d0.getCtxAreas());
  3364. var _2d2=_2cd.getAttribute("ctx");
  3365. var _2d3=this.m_selectedChartNodes.length;
  3366. for(var i=0;i<_2d3;i++){
  3367. var _2d5=this.m_selectedChartNodes[i];
  3368. if(_2d2==_2d5.getContext()){
  3369. this.m_selectedChartNodes.splice(i,1);
  3370. break;
  3371. }
  3372. }
  3373. }else{
  3374. this.updateSelectionContainer(_2cd);
  3375. _2d1.highlightAreas(_2d0.getCtxAreas(),true);
  3376. this.m_selectedChartNodes.push(_2d0);
  3377. }
  3378. }else{
  3379. if(this.hasSavedSelectedChartNodes()){
  3380. var _2d6=this.m_savedSelectedChartNodes.length;
  3381. var _2d7=this.m_savedSelectedChartNodes;
  3382. for(var i=0;i<_2d6;i++){
  3383. var area=_2d7[i].getArea();
  3384. var _2d9=this.getSavedChartHelper(area);
  3385. var _2da=_2d9.getImageMapHighlighter();
  3386. var _2db=_2da.getAreaId(area);
  3387. if(_2d1.getAreaId(_2cd)===_2db){
  3388. _2da.hideAreaById(_2db+this.m_savedPrimarySelectionColor);
  3389. break;
  3390. }
  3391. }
  3392. }
  3393. this.updateSelectionContainer(_2cd);
  3394. _2d1.highlightAreas(_2d0.getCtxAreas());
  3395. this.m_selectedChartNodes=[_2d0];
  3396. }
  3397. };
  3398. CSelectionController.prototype.updateSelectionContainer=function(_2dc){
  3399. var _2dd=_2dc.parentNode;
  3400. if(this.m_selectionContainerMap&&this.m_selectionContainerMap.name!=_2dd.name){
  3401. var _2de=this.getChartHelper(_2dc).getImageMapHighlighter();
  3402. _2de.hideAllAreas();
  3403. }
  3404. this.m_selectionContainerMap=_2dd;
  3405. };
  3406. CSelectionController.prototype.getChartHelper=function(_2df){
  3407. var _2e0=_2df.parentNode;
  3408. var _2e1=_2e0.name;
  3409. if(!this.m_chartHelpers[_2e1]){
  3410. this.m_chartHelpers[_2e1]=new CChartHelper(_2df,this.getSelectionObjectFactory(),this.m_oCognosViewer);
  3411. }
  3412. return this.m_chartHelpers[_2e1];
  3413. };
  3414. CSelectionController.prototype.getSavedChartHelper=function(_2e2){
  3415. var _2e3=_2e2.parentNode;
  3416. var _2e4=_2e3.name;
  3417. return this.m_savedChartHelpers[_2e4];
  3418. };
  3419. CSelectionController.prototype.getSelectedChartArea=function(){
  3420. return this.m_selectedChartArea;
  3421. };
  3422. CSelectionController.prototype.getSelectedChartNodes=function(){
  3423. return this.m_selectedChartNodes;
  3424. };
  3425. CSelectionController.prototype.hasSelectedChartNodes=function(){
  3426. return this.m_selectedChartNodes&&this.m_selectedChartNodes.length&&this.m_selectedChartNodes.length>0;
  3427. };
  3428. CSelectionController.prototype.getSelectedChartImage=function(){
  3429. var _2e5=null;
  3430. if(this.hasSelectedChartNodes()){
  3431. var _2e6=this.m_selectedChartNodes[0];
  3432. _2e5=_2e6.getArea();
  3433. }
  3434. if(_2e5===null){
  3435. return null;
  3436. }
  3437. if(_2e5.tagName=="IMG"){
  3438. return _2e5;
  3439. }
  3440. return this.getSelectedChartImageFromChartArea(_2e5);
  3441. };
  3442. CSelectionController.prototype.getSelectedChartImageFromChartArea=function(_2e7){
  3443. var _2e8=_2e7.parentNode;
  3444. var _2e9="#"+_2e8.getAttribute("name");
  3445. return this.checkChildrenForChart(_2e8.parentNode,_2e9);
  3446. };
  3447. CSelectionController.prototype.checkChildrenForChart=function(_2ea,_2eb){
  3448. var _2ec=_2ea.firstChild;
  3449. while(_2ec!==null){
  3450. if(!_2ec.tagName){
  3451. return null;
  3452. }else{
  3453. if(_2ec.tagName=="IMG"&&_2ec.getAttribute("usemap")==_2eb){
  3454. return _2ec;
  3455. }else{
  3456. if(_2ec.tagName==="DIV"||_2ec.tagName==="SPAN"){
  3457. var _2ed=this.checkChildrenForChart(_2ec,_2eb);
  3458. if(_2ed){
  3459. return _2ed;
  3460. }
  3461. }
  3462. }
  3463. }
  3464. _2ec=_2ec.nextSibling;
  3465. }
  3466. return null;
  3467. };
  3468. CSelectionController.prototype.downloadSelectedChartImage=function(_2ee){
  3469. var _2ef=this.getSelectedChartImage();
  3470. if(_2ef!==null){
  3471. var _2f0=this.getDocumentFromImage(_2ef);
  3472. var _2f1=_2ef.name.replace(".","_");
  3473. var _2f2=_2f1.substr(5);
  3474. var _2f3="?m_name=";
  3475. _2f3+=_2f2;
  3476. _2f3+="&format=png&b_action=xts.run&m=portal/download.xts&m_obj=";
  3477. if(isIE()){
  3478. _2f1=_2f0.parentWindow.eval("graphicSrc"+_2f2);
  3479. }else{
  3480. _2f1=_2f0.defaultView.eval("graphicSrc"+_2f2);
  3481. }
  3482. var _2f4="";
  3483. if(typeof _2f1!="undefined"&&_2f1!==null){
  3484. var _2f5=_2f1.split("&");
  3485. if(_2f5.length===0){
  3486. return;
  3487. }
  3488. if(_2f1.indexOf("/repository/")<0){
  3489. for(var i=0;i<_2f5.length;++i){
  3490. var _2f7=_2f5[i];
  3491. var _2f8=_2f7.indexOf("=");
  3492. if(_2f8!=-1){
  3493. var _2f9=_2f7.substr(0,_2f8);
  3494. var _2fa=_2f7.slice(_2f8+1);
  3495. if(_2f9=="search"){
  3496. _2f4+=_2fa;
  3497. break;
  3498. }
  3499. }
  3500. }
  3501. }
  3502. if(_2f4==""){
  3503. _2f3=_2ef.getAttribute("src");
  3504. if(_2f3.indexOf("?")!=-1){
  3505. _2f3+="&download=true";
  3506. }else{
  3507. _2f3+="?download=true";
  3508. }
  3509. }
  3510. if(typeof getConfigFrame=="function"){
  3511. _2f3+=_2f4;
  3512. _2f3=getConfigFrame().constructGETRequestParamsString(_2f3);
  3513. window.open(_2f3,"_blank","width=0,height=0");
  3514. }else{
  3515. _2f3=constructGETRequestParamsString(_2f3);
  3516. _2f3+=_2f4;
  3517. var _2fb=this.m_oCognosViewer.getGateway();
  3518. var _2fc=document.getElementById("CVIFrame"+this.m_sNamespace);
  3519. if(_2fc){
  3520. var _2fd=_2fc.src;
  3521. if(_2fd.indexOf("repository")>=0&&_2f3.indexOf("repository")<0){
  3522. var _2fe=_2fd.indexOf("content");
  3523. _2f3=_2fd.substring(0,_2fe)+_2f3;
  3524. }
  3525. }
  3526. if(_2f3.indexOf(_2fb)==-1){
  3527. var _2ff=document.forms["formWarpRequest"+_2ee];
  3528. _2f3=_2ff.action+_2f3;
  3529. }
  3530. if(typeof window.detachLeavingRV=="function"){
  3531. window.detachLeavingRV();
  3532. }
  3533. location.href=_2f3;
  3534. if(typeof window.attachLeavingRV=="function"){
  3535. setTimeout(window.attachLeavingRV,100);
  3536. }
  3537. }
  3538. }
  3539. }
  3540. };
  3541. CSelectionController.prototype.getDocumentFromImage=function(_300){
  3542. var _301=null;
  3543. if(_300.ownerDocument){
  3544. _301=_300.ownerDocument;
  3545. }else{
  3546. _301=_300.document;
  3547. }
  3548. return _301;
  3549. };
  3550. CSelectionController.prototype.shouldExecutePageClickedOnMouseDown=function(e){
  3551. var _303=this.getSelections();
  3552. if(_303.length>1){
  3553. if(this.m_oCognosViewer.envParams["ui.action"]!=="view"){
  3554. var node=getNodeFromEvent(e);
  3555. try{
  3556. while(node&&(node.nodeType==3||(node.getAttribute&&node.getAttribute("uid")===null))){
  3557. node=node.parentNode;
  3558. }
  3559. }
  3560. catch(ex){
  3561. }
  3562. var _305=this.getSelectionObjectFactory().getContainerType(node);
  3563. if(_305==="list"){
  3564. for(var i=0;i<_303.length;i++){
  3565. if(_303[i].m_oCellRef==node){
  3566. return false;
  3567. }
  3568. }
  3569. }
  3570. }
  3571. }
  3572. return true;
  3573. };
  3574. CSelectionController.prototype.getContainerType=function(){
  3575. var _307="";
  3576. if(this.hasSelectedChartNodes()){
  3577. _307="chart";
  3578. }else{
  3579. if(this.getDataContainerType()==="list"){
  3580. _307="list";
  3581. }else{
  3582. _307="crosstab";
  3583. }
  3584. }
  3585. return _307;
  3586. };
  3587. CSelectionController.prototype.getDisplayValues=function(){
  3588. var _308={};
  3589. var _309=this.getAllSelectedObjects()[0];
  3590. if(_309){
  3591. var _30a=_309.getSelectedContextIds();
  3592. if(_30a){
  3593. for(var axis=0;axis<_30a.length;axis++){
  3594. var _30c=[];
  3595. var _30d=_30a[axis];
  3596. for(var _30e=0;_30e<_30d.length;_30e++){
  3597. var _30f=_30d[_30e];
  3598. var _310=this.getDisplayValue(_30f);
  3599. _30c.push(_310);
  3600. if(axis===0){
  3601. break;
  3602. }
  3603. }
  3604. var _311="";
  3605. switch(axis){
  3606. case 0:
  3607. _311="selected";
  3608. break;
  3609. case 1:
  3610. _311="rows";
  3611. break;
  3612. default:
  3613. _311="columns";
  3614. }
  3615. _308[_311]=_30c;
  3616. }
  3617. }
  3618. }
  3619. return _308;
  3620. };
  3621. CSelectionController.prototype.getChartTooltip=function(){
  3622. var _312=this.getAllSelectedObjects()[0];
  3623. if(_312){
  3624. var area=_312.getArea();
  3625. if(area){
  3626. var _314=area.getAttribute("title");
  3627. if(_314&&_314.length>0){
  3628. return area.getAttribute("title");
  3629. }
  3630. }
  3631. }
  3632. return "";
  3633. };
  3634. CSelectionController.prototype.pageClickedForMobile=function(e){
  3635. this.pageClicked(e);
  3636. var _316=this.getAllSelectedObjects().length;
  3637. if(_316==0){
  3638. var node=getNodeFromEvent(e,true);
  3639. if(!node){
  3640. return false;
  3641. }
  3642. if(node.nodeName.toLowerCase()=="img"&&node.getAttribute("dttargets")){
  3643. this.selectDrillThroughImage(node);
  3644. return true;
  3645. }else{
  3646. if(node.getAttribute("dttargets")){
  3647. this.selectDrillThroughSingleton(node);
  3648. return true;
  3649. }else{
  3650. if(node.parentNode&&node.parentNode.getAttribute("dttargets")){
  3651. this.selectDrillThroughSingleton(node.parentNode);
  3652. return true;
  3653. }
  3654. }
  3655. }
  3656. return false;
  3657. }
  3658. return true;
  3659. };
  3660. CSelectionController.prototype.clearSavedSelections=function(){
  3661. this.m_bSavedSelections=false;
  3662. if(this.hasSavedSelectedObjects()){
  3663. this.updateUI(null,this.getSavedSelectedObjects(),true,false);
  3664. delete (this.m_aSavedSelectedObjects);
  3665. }
  3666. if(this.hasSavedSelectedChartNodes()){
  3667. var _318=this.m_savedChartHelpers;
  3668. for(var _319 in _318){
  3669. if(_318[_319]){
  3670. var _31a=_318[_319].getImageMapHighlighter();
  3671. if(_31a.hideAllAreas){
  3672. _31a.hideAllAreas();
  3673. }
  3674. }
  3675. }
  3676. delete this.m_savedChartHelpers;
  3677. delete this.m_savedSelectedChartNodes;
  3678. }
  3679. };
  3680. CSelectionController.prototype.hasSavedSelectedChartNodes=function(){
  3681. return (this.m_savedSelectedChartNodes&&this.m_savedSelectedChartNodes.length>0);
  3682. };
  3683. CSelectionController.prototype.getSavedSelectedChartNodes=function(){
  3684. return this.m_savedSelectedChartNodes;
  3685. };
  3686. CSelectionController.prototype.saveSelections=function(){
  3687. this.m_savedSelectionStyles=this.m_selectionStyles;
  3688. if(this.m_aSelectedObjects.length>0){
  3689. this.m_aSavedSelectedObjects=[];
  3690. var _31b=this.m_aSelectedObjects.length;
  3691. var temp=[];
  3692. for(var i=0;i<_31b;i++){
  3693. if(this.isMeasure(this.m_aSelectedObjects[i].m_contextIds[0][0])){
  3694. temp.push(this.m_aSelectedObjects[i]);
  3695. }else{
  3696. this.m_aSavedSelectedObjects.push(this.m_aSelectedObjects[i]);
  3697. }
  3698. }
  3699. this.m_aSelectedObjects=temp;
  3700. }
  3701. if(this.hasSelectedChartNodes()){
  3702. this.m_savedChartHelpers=this.m_chartHelpers;
  3703. this.m_chartHelpers={};
  3704. this.m_savedSelectedChartNodes=[];
  3705. var _31e=this.m_selectedChartNodes.length;
  3706. var temp=[];
  3707. for(var i=0;i<_31e;i++){
  3708. if(this.isMeasure(this.m_selectedChartNodes[i].m_contextIds[0][0])){
  3709. var _31f=this.m_selectedChartNodes[i].getArea();
  3710. var _320=this.getImageMapName(_31f);
  3711. this.m_chartHelpers[_320]=this.m_savedChartHelpers[_320];
  3712. delete this.m_savedChartHelpers[_320];
  3713. temp.push(this.m_selectedChartNodes[i]);
  3714. }else{
  3715. this.m_savedSelectedChartNodes.push(this.m_selectedChartNodes[i]);
  3716. }
  3717. }
  3718. this.m_selectedChartNodes=temp;
  3719. }
  3720. this.m_bSavedSelections=true;
  3721. };
  3722. CSelectionController.prototype.hasSavedSelections=function(){
  3723. return this.m_bSavedSelections;
  3724. };
  3725. CSelectionController.prototype.hasSavedSelectedObjects=function(){
  3726. return (this.m_aSavedSelectedObjects&&this.m_aSavedSelectedObjects.length>0)||this.hasSavedSelectedChartNodes();
  3727. };
  3728. CSelectionController.prototype.getSavedSelectedObjects=function(){
  3729. return this.m_aSavedSelectedObjects;
  3730. };
  3731. CSelectionController.prototype.getImageMapName=function(_321){
  3732. var _322=_321.parentNode;
  3733. return _322.name;
  3734. };
  3735. CSelectionController.prototype.repaintBUXSelectedChartArea=function(_323,_324,_325){
  3736. var _326={};
  3737. var _327=_323.length;
  3738. for(var i=0;i<_327;i++){
  3739. var _329=_323[i].getArea();
  3740. var _32a=this.getImageMapName(_329);
  3741. var _32b;
  3742. if(!_326[_32a]){
  3743. _32b=(_324)?this.getSavedChartHelper(_329):this.getChartHelper(_329);
  3744. _326[_32a]=_32b;
  3745. var _32c=_32b.getImageMapHighlighter();
  3746. _32c.hideAllAreas();
  3747. _32c.setFillColour(this.getPrimarySelectionColor());
  3748. _32c.setStrokeColour(this.getPrimarySelectionColor());
  3749. }else{
  3750. _32b=_326[_32a];
  3751. }
  3752. var _32d=_323[i].m_contextIds;
  3753. if(_325&&_32d.length===1&&_32d[0].length===1&&this.isMeasure(_32d[0][0])){
  3754. continue;
  3755. }
  3756. _32c.highlightAreas(_323[i].getCtxAreas(),1);
  3757. }
  3758. };
  3759. CSelectionController.prototype.repaintSavedSelections=function(){
  3760. var _32e=this.m_selectionStyles;
  3761. this.m_selectionStyles=this.m_savedSelectionStyles;
  3762. var _32f=this.getSavedSelectedChartNodes();
  3763. var _330=false;
  3764. if(_32f&&_32f.length>0){
  3765. bIsChart=true;
  3766. }else{
  3767. _32f=this.getSavedSelectedObjects();
  3768. }
  3769. this.repaintSelectionsHelper(_32f,true,_330);
  3770. this.resetSelectionStyles();
  3771. this.m_selectionStyles=_32e;
  3772. };
  3773. CSelectionController.prototype.repaintSelections=function(){
  3774. var _331=this.getSelectedChartNodes();
  3775. var _332=false;
  3776. if(_331&&_331.length>0){
  3777. _332=true;
  3778. }else{
  3779. _331=this.getSelections();
  3780. }
  3781. this.repaintSelectionsHelper(_331,false,_332);
  3782. };
  3783. CSelectionController.prototype.repaintSelectionsHelper=function(_333,_334,_335){
  3784. try{
  3785. if(_335){
  3786. this.repaintBUXSelectedChartArea(_333,_334);
  3787. }else{
  3788. this.updateUI(document,_333,true,false);
  3789. this.updateUI(document,_333,false,false);
  3790. }
  3791. }
  3792. catch(e){
  3793. return false;
  3794. }
  3795. };
  3796. CSelectionController.prototype.resetAll=function(){
  3797. this.resetSelectionStyles();
  3798. this.clearSavedSelections();
  3799. this.resetSelections();
  3800. this.resetAllowHorizontalDataValueSelection();
  3801. };
  3802. CSelectionController.prototype.pageClicked=function(e){
  3803. try{
  3804. var node=getNodeFromEvent(e);
  3805. if(this.m_aSelectedObjects.length>0&&!this.shiftKeyPressed(e)&&!this.ctrlKeyPressed(e)){
  3806. var _338=node;
  3807. if(!_338.getAttribute("uid")){
  3808. var _339=_338.parentNode;
  3809. if(_339&&_339.nodeType==1&&typeof _339.getAttribute!="undefined"&&_339.getAttribute("uid")!=null){
  3810. _338=_339;
  3811. }
  3812. }
  3813. if(this.isCellSelected(_338)){
  3814. if(typeof this.m_oCognosViewer.isBux!=="undefined"){
  3815. this.repaintSelections();
  3816. }
  3817. if(e.button!==0){
  3818. return false;
  3819. }
  3820. }
  3821. }
  3822. if(node.tagName&&node.tagName.toUpperCase()=="INPUT"){
  3823. return true;
  3824. }
  3825. if((e.keyCode!=null)&&(e.keyCode!=13)&&(e.keyCode!=32)&&(e.keyCode!=27)&&(e.keyCode!=0)&&(e.keyCode!=121)&&(e.keyCode!=93)){
  3826. return false;
  3827. }
  3828. var _33a=getDocumentFromEvent(e);
  3829. if(!this.hasContextData()||!this.hasMetadata()){
  3830. if(node.nodeName=="AREA"||node.nodeName=="IMG"||(typeof node.getAttribute=="function"&&node.getAttribute("flashChart")!=null)){
  3831. this.setSelectedChartArea(node,e);
  3832. }
  3833. this.getObservers().notify();
  3834. return false;
  3835. }
  3836. if(typeof node.selectedCell!="undefined"){
  3837. var _33b=node;
  3838. node=node.selectedCell;
  3839. _33b.removeAttribute("selectedCell");
  3840. }
  3841. if(typeof cf!="undefined"&&typeof cf.hidePickers=="function"){
  3842. cf.hidePickers();
  3843. }
  3844. if(e.keyCode==27){
  3845. if(typeof g_reportSelectionController!="undefined"){
  3846. g_reportSelectionController.clearSelections();
  3847. }
  3848. this.resetSelections(_33a);
  3849. }else{
  3850. if(node.nodeName=="AREA"||node.nodeName=="IMG"||(typeof node.getAttribute!="undefined"&&node.getAttribute("flashChart")!=null)){
  3851. if(e.button!==2||this.getAllSelectedObjects().length<=1||typeof this.m_oCognosViewer.isBux==="undefined"){
  3852. this.selectNode(node,e);
  3853. this.setSelectedChartArea(node,e);
  3854. }
  3855. }else{
  3856. if(!(node.firstChild==null&&node.cellIndex==0&&node.parentNode.rowIndex==0&&node.getAttribute("cid")==null)){
  3857. var _33c=this.m_oCognosViewer.getViewerWidget();
  3858. this.selectNode(node,e);
  3859. }
  3860. }
  3861. }
  3862. if(window.gViewerLogger){
  3863. window.gViewerLogger.addContextInfo(this);
  3864. }
  3865. }
  3866. catch(e){
  3867. }
  3868. };
  3869. CSelectionController.prototype.getSelectionObjectFactory=function(){
  3870. return this.m_oSelectionObjectFactory;
  3871. };
  3872. CSelectionController.prototype.isDrillLinkOnCrosstabCell=function(node){
  3873. return (node.getAttribute("ctx")==null&&node.parentNode.getAttribute("dtTargets")!=null);
  3874. };
  3875. CSelectionController.prototype.selectObject=function(sMun,sLun,sHun,_341){
  3876. var _342=this.getCtxIdFromMun(sMun);
  3877. if(_342==""){
  3878. _342=this.getCtxIdFromMetaData(sLun,sHun,_341);
  3879. }
  3880. if(_342!=null&&this.m_oCDManager.GetUsage(_342)!="2"){
  3881. var _343=document.getElementById("rt"+this.getNamespace());
  3882. if(_343!=null){
  3883. var _344=getElementsByAttribute(_343,"*","ctx",_342);
  3884. if(_344&&_344.length===0){
  3885. var _345=new RegExp("(^|:)"+_342+"(:|$)","i");
  3886. _344=getElementsByAttribute(_343,"*","ctx",_342,-1,_345);
  3887. }
  3888. var _346=null;
  3889. if(_344!=null&&_344.length>0){
  3890. _346=new CSelectionObject();
  3891. _346.setSelectionController(this);
  3892. _346.m_sColumnRef=_344[0].getAttribute("cid");
  3893. _346.m_sCellTypeId=_344[0].getAttribute("uid");
  3894. _346.m_sLayoutType=_344[0].getAttribute("type");
  3895. _346.m_sTag=_344[0].getAttribute("tag");
  3896. _346.m_layoutElementId=this.m_oSelectionObjectFactory.getLayoutElementId(_344[0]);
  3897. _346.m_dataContainerType=this.m_oSelectionObjectFactory.getContainerType(_344[0]);
  3898. _346.m_contextIds=[[_342]];
  3899. this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_346;
  3900. }else{
  3901. var _347=getElementsByAttribute(_343,"*","flashChart","true");
  3902. if(_347!=null){
  3903. for(var _348=0;_348<_347.length;++_348){
  3904. var ldx=_347[_348].getLDX();
  3905. if(ldx.indexOf("<ctx>"+_342+"</ctx>")!=-1){
  3906. _346=new CSelectionObject();
  3907. _346.setSelectionController(this);
  3908. var lid=_347[_348].getAttribute("lid");
  3909. _346.m_layoutElementId=lid.replace(this.m_oCognosViewer.getId(),"");
  3910. _346.m_dataContainerType="chart";
  3911. _346.m_contextIds=[[_342]];
  3912. this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_346;
  3913. }
  3914. }
  3915. }
  3916. }
  3917. }
  3918. }
  3919. };
  3920. CSelectionController.prototype.buildSelectionObject=function(node,e){
  3921. var _34d=null;
  3922. try{
  3923. while(node.nodeType==3){
  3924. node=node.parentNode;
  3925. }
  3926. if(this.isDrillLinkOnCrosstabCell(node)){
  3927. node=node.parentNode;
  3928. }
  3929. var ctx=node.getAttribute("ctx");
  3930. var uid=node.getAttribute("uid");
  3931. if((uid==null)&&((ctx!=null)||(node.parentNode&&node.parentNode.nodeType==1&&typeof node.parentNode.getAttribute!="undefined"&&node.parentNode.getAttribute("uid")!=null))){
  3932. if(node.nodeName=="IMG"&&(node.src.indexOf("SM=")>-1||(isIE()>-1&&node.src.indexOf("space.gif")>-1))){
  3933. return null;
  3934. }
  3935. node=node.parentNode;
  3936. if((node.className.toUpperCase()=="BLOCK"&&node.nodeName.toUpperCase()=="DIV")||(node.getAttribute("dtTargets")!=null)){
  3937. node=node.parentNode;
  3938. }
  3939. uid=node.getAttribute("uid");
  3940. }
  3941. if(uid!=null){
  3942. var _350=node.childNodes;
  3943. for(var i=0;i<_350.length;i++){
  3944. if(_350[i].nodeName.toUpperCase()=="TABLE"&&(_350[i].className=="ls"||_350[i].className=="xt")){
  3945. var trs=_350[i].rows;
  3946. for(var j=0;j<trs.length;j++){
  3947. var tds=trs[j].cells;
  3948. for(var k=0;k<tds.length;k++){
  3949. if(tds[k].getAttribute("uid")!=null){
  3950. return null;
  3951. }
  3952. }
  3953. }
  3954. }
  3955. }
  3956. if(node.className.toUpperCase()=="REPEATERTABLECELL"&&ctx!=null){
  3957. _34d=this.getSelectionObjectFactory().getSelectionObject(node,ctx);
  3958. }else{
  3959. _34d=this.getSelectionObjectFactory().getSelectionObject(node);
  3960. }
  3961. }
  3962. }
  3963. catch(e){
  3964. }
  3965. return _34d;
  3966. };
  3967. CSelectionController.prototype.shiftKeyPressed=function(e){
  3968. if(e.keyCode=="121"){
  3969. return false;
  3970. }
  3971. if(isSafari()){
  3972. if(e.button!=2){
  3973. return e.shiftKey?e.shiftKey:false;
  3974. }else{
  3975. return false;
  3976. }
  3977. }
  3978. return e.shiftKey?e.shiftKey:false;
  3979. };
  3980. CSelectionController.prototype.ctrlKeyPressed=function(e){
  3981. if(isSafari()){
  3982. if(e.button!=2){
  3983. return e.ctrlKey?e.ctrlKey:false;
  3984. }else{
  3985. return false;
  3986. }
  3987. }
  3988. return e.ctrlKey?e.ctrlKey:false;
  3989. };
  3990. CSelectionController.prototype.isSelectionsPreviouslySaved=function(_358){
  3991. var _359=false;
  3992. if(!this.m_aSavedSelectedObjects||!this.m_aSavedSelectedObjects.length||!_358||!_358.length){
  3993. return false;
  3994. }
  3995. for(var i=0;i<_358.length;i++){
  3996. if(this.isSavedCellSelected(_358[i].getCellRef())){
  3997. return true;
  3998. }
  3999. }
  4000. return false;
  4001. };
  4002. CSelectionController.prototype.selectNode=function(node,e){
  4003. try{
  4004. while(node.nodeType==3){
  4005. node=node.parentNode;
  4006. }
  4007. if(this.isDrillLinkOnCrosstabCell(node)){
  4008. node=node.parentNode;
  4009. }
  4010. var _35d=null;
  4011. if(isIE()){
  4012. _35d=node.document;
  4013. }else{
  4014. _35d=node.ownerDocument;
  4015. }
  4016. var ctx=node.getAttribute("ctx");
  4017. var uid=node.getAttribute("uid");
  4018. var _360=false;
  4019. if(typeof e=="undefined"){
  4020. e={};
  4021. }
  4022. var _361=false;
  4023. if(typeof g_reportSelectionController!="undefined"){
  4024. _361=this.checkForReportElementNode(node);
  4025. }
  4026. if((ctx==null&&uid==null&&node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")==null&&_361==false)||(!this.ctrlKeyPressed(e)&&!this.shiftKeyPressed(e))){
  4027. if(this.getSelections().length>0){
  4028. _360=true;
  4029. }
  4030. if(this.hasCutColumns()==true){
  4031. this.clearSelectedObjects(_35d);
  4032. }else{
  4033. this.resetSelections(_35d);
  4034. this.repaintSavedSelections();
  4035. if(typeof cf!="undefined"&&typeof cf.removeAllSelectionsFromCfgVariables=="function"){
  4036. cf.removeAllSelectionsFromCfgVariables();
  4037. }
  4038. this.m_oCognosViewer.setCurrentNodeFocus(null);
  4039. }
  4040. if(this.ctrlKeyPressed(e)||this.shiftKeyPressed(e)){
  4041. clearTextSelection(_35d);
  4042. }
  4043. if(typeof g_reportSelectionController!="undefined"&&_361==false){
  4044. if(g_reportSelectionController.getSelections().length>0){
  4045. _360=true;
  4046. }
  4047. g_reportSelectionController.clearSelections();
  4048. }
  4049. }
  4050. var _362=node.getAttribute("dtTargets")?node:null;
  4051. var _363=(node.nodeName.toLowerCase()==="area");
  4052. if((uid==null)&&((ctx!=null)||(node.parentNode&&node.parentNode.nodeType==1&&typeof node.parentNode.getAttribute!="undefined"))){
  4053. if(node.nodeName=="IMG"&&(node.src.indexOf("SM=")>-1||(isIE()>-1&&node.src.indexOf("space.gif")>-1))){
  4054. return false;
  4055. }
  4056. var _364;
  4057. var _365=3;
  4058. do{
  4059. node=node.parentNode;
  4060. if(node){
  4061. _362=(!_362&&typeof node.getAttribute!="undefined"&&node.getAttribute("dtTargets"))?node:_362;
  4062. uid=(typeof node.getAttribute!="undefined")?node.getAttribute("uid"):null;
  4063. _364=node.nodeName.toLowerCase();
  4064. }
  4065. }while((uid==null)&&node&&(--_365>0)&&(_364=="span"||_364=="div"));
  4066. }
  4067. if(uid!=null){
  4068. var _366=node.childNodes;
  4069. for(var i=0;i<_366.length;i++){
  4070. if(_366[i].nodeName.toUpperCase()=="TABLE"&&(_366[i].className=="ls"||_366[i].className=="xt")){
  4071. var trs=_366[i].rows;
  4072. for(var j=0;j<trs.length;j++){
  4073. var tds=trs[j].cells;
  4074. for(var k=0;k<tds.length;k++){
  4075. if(tds[k].getAttribute("uid")!=null){
  4076. return false;
  4077. }
  4078. }
  4079. }
  4080. }
  4081. }
  4082. var _36c;
  4083. if(node.className.toUpperCase()=="REPEATERTABLECELL"&&ctx!=null){
  4084. _36c=this.getSelectionObjectFactory().getSelectionObject(node,ctx);
  4085. }else{
  4086. _36c=this.getSelectionObjectFactory().getSelectionObject(node);
  4087. }
  4088. if(this.isCellSelected(node)==false){
  4089. if(this.shiftKeyPressed(e)){
  4090. var _36d=this.getSelections();
  4091. if(_36d.length>0){
  4092. var _36e=_36d[_36d.length-1];
  4093. if(_36e.getLayoutType()==_36c.getLayoutType()&&(_36e.getCellRef().parentNode.parentNode==_36c.getCellRef().parentNode.parentNode)){
  4094. if(this.cellsAreInSameColumn(_36e.getCellRef(),_36c.getCellRef())){
  4095. this.selectVertical(_36e,_36c,_35d);
  4096. }else{
  4097. if(_36e.getCellRef().parentNode.rowIndex==_36c.getCellRef().parentNode.rowIndex){
  4098. this.selectHorizontal(_36e,_36c,_35d);
  4099. }
  4100. }
  4101. }
  4102. }
  4103. clearTextSelection(_35d);
  4104. }else{
  4105. if(this.ctrlKeyPressed(e)){
  4106. clearTextSelection(_35d);
  4107. }
  4108. }
  4109. this.addSelectionObject(_36c,_35d);
  4110. if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
  4111. cf.addSelectionToCfgVariables(_36c.getColumnName());
  4112. }
  4113. this.m_oCognosViewer.setCurrentNodeFocus(node);
  4114. }else{
  4115. if(this.ctrlKeyPressed(e)){
  4116. this.removeSelectionObject(_36c,_35d);
  4117. if(typeof cf!="undefined"&&typeof cf.removeSelectionFromCfgVariables=="function"){
  4118. if(!this.isColumnSelected(_36c.getTag())){
  4119. cf.removeSelectionFromCfgVariables(_36c.getTag());
  4120. }
  4121. }
  4122. clearTextSelection(_35d);
  4123. }else{
  4124. if(this.shiftKeyPressed(e)){
  4125. clearTextSelection(_35d);
  4126. }
  4127. }
  4128. }
  4129. _360=true;
  4130. }else{
  4131. if(_361){
  4132. var _36f=null;
  4133. while((typeof node.id=="undefined"||node.id==null||node.id=="")&&node.parentNode!=null){
  4134. node=node.parentNode;
  4135. }
  4136. if(node.id=="reportTitle"){
  4137. _36f="TitleStyle";
  4138. }else{
  4139. if(node.id=="reportSubtitle"){
  4140. _36f="SubtitleStyle";
  4141. }else{
  4142. if(node.id.indexOf("reportFilter")==0){
  4143. _36f="FilterStyle";
  4144. }
  4145. }
  4146. }
  4147. if(_36f!=null){
  4148. selectReportElement(e,node.id,_36f);
  4149. _360=true;
  4150. }
  4151. }else{
  4152. if(_362!=null&&this.m_oCognosViewer&&this.m_oCognosViewer.isMobile()&&!_363){
  4153. var _36c=this.getSelectionObjectFactory().getSelectionObject(_362);
  4154. this.addSelectionObject(_36c,_35d);
  4155. }
  4156. }
  4157. }
  4158. if(_360==true&&(typeof cf!="undefined"&&typeof cf.refreshDialog=="function")){
  4159. cf.refreshDialog();
  4160. }
  4161. }
  4162. catch(ex){
  4163. }
  4164. };
  4165. CSelectionController.prototype.selectDrillThroughImage=function(node){
  4166. this.m_oSelectedDrillThroughImage=node;
  4167. };
  4168. CSelectionController.prototype.getSelectedDrillThroughImage=function(){
  4169. return this.m_oSelectedDrillThroughImage?this.m_oSelectedDrillThroughImage:null;
  4170. };
  4171. CSelectionController.prototype.selectDrillThroughSingleton=function(node){
  4172. this.m_oSelectedDrillThroughSingleton=node;
  4173. };
  4174. CSelectionController.prototype.getSelectDrillThroughSingleton=function(){
  4175. return this.m_oSelectedDrillThroughSingleton?this.m_oSelectedDrillThroughSingleton:null;
  4176. };
  4177. CSelectionController.prototype.getReportContextDataArray=function(){
  4178. return this.m_aReportContextDataArray;
  4179. };
  4180. CSelectionController.prototype.getReportMetadataArray=function(){
  4181. return this.m_aReportMetadataArray;
  4182. };
  4183. CSelectionController.prototype.setupContextDataArray=function(_372){
  4184. this.m_aReportContextDataArray=_372;
  4185. };
  4186. CSelectionController.prototype.setupMetaDataArray=function(_373){
  4187. this.m_aReportMetadataArray=_373;
  4188. };
  4189. CSelectionController.prototype.addContextData=function(_374){
  4190. this.m_aSelectedObjects=[];
  4191. this.m_oCDManager.SetContextData(_374);
  4192. if(!this.m_bUsingCCDManager){
  4193. this.m_bUsingCCDManager=true;
  4194. }
  4195. for(var i=0;i<this.m_selectedClass.length;++i){
  4196. this.deselecting(this.m_selectedClass);
  4197. }
  4198. };
  4199. CSelectionController.prototype.addMetaData=function(_376){
  4200. this.m_aSelectedObjects=[];
  4201. this.m_oCDManager.SetMetadata(_376);
  4202. if(!this.m_bUsingCCDManager){
  4203. this.m_bUsingCCDManager=true;
  4204. }
  4205. };
  4206. CSelectionController.prototype.getDrillFlag=function(_377){
  4207. var _378="";
  4208. if(!this.m_bUsingCCDManager){
  4209. var _379=this.m_aReportContextDataArray[_377];
  4210. var _37a=_379[0];
  4211. var _37b=this.m_aReportMetadataArray[_37a];
  4212. if(typeof _37b!="undefined"&&typeof _37b[3]!="undefined"){
  4213. _378=_37b[3];
  4214. }
  4215. }else{
  4216. _378=this.m_oCDManager.GetDrillFlag(_377);
  4217. }
  4218. return _378;
  4219. };
  4220. CSelectionController.prototype.getDrillFlagForMember=function(_37c){
  4221. var _37d="0";
  4222. if(!this.m_bUsingCCDManager){
  4223. var _37e=this.getContextDataItem(_37c);
  4224. if(_37e!=null){
  4225. var _37f=_37e[2];
  4226. if(_37f!=""){
  4227. var _380=_37e[0];
  4228. var _381=this.getMetaDataItem(_380);
  4229. if(_381!=null){
  4230. _37d=_381[3];
  4231. }
  4232. }
  4233. }
  4234. }else{
  4235. _37d=this.m_oCDManager.GetDrillFlagForMember(_37c);
  4236. }
  4237. return (_37d==null)?0:_37d;
  4238. };
  4239. CSelectionController.prototype.getDataType=function(_382){
  4240. var _383=null;
  4241. if(!this.m_bUsingCCDManager){
  4242. var _384=this.getRDI(_382);
  4243. if(_384&&_384.length>2){
  4244. _383=parseInt(_384[2],10);
  4245. }
  4246. }else{
  4247. _383=parseInt(this.m_oCDManager.GetDataType(_382),10);
  4248. }
  4249. return _383;
  4250. };
  4251. CSelectionController.prototype.getUsageInfo=function(_385){
  4252. if(this.m_bUsingCCDManager){
  4253. return this.m_oCDManager.GetUsage(_385);
  4254. }
  4255. };
  4256. CSelectionController.prototype.isMeasure=function(_386){
  4257. return (this.getUsageInfo(_386)==this.c_usageMeasure);
  4258. };
  4259. CSelectionController.prototype.getDepth=function(_387){
  4260. var _388=null;
  4261. if(!this.m_bUsingCCDManager){
  4262. var _389=this.getRDI(_387);
  4263. if(_389&&_389.length>5&&_389[1]=="R"){
  4264. _388=_389[5];
  4265. }
  4266. }else{
  4267. _388=this.m_oCDManager.GetDepth(_387);
  4268. }
  4269. return _388;
  4270. };
  4271. CSelectionController.prototype.getUseValue=function(_38a){
  4272. var _38b="";
  4273. if(!this.m_bUsingCCDManager){
  4274. var _38c=this.m_aReportContextDataArray[_38a];
  4275. if(typeof _38c[1]!="undefined"){
  4276. _38b=_38c[1];
  4277. }
  4278. }else{
  4279. _38b=this.m_oCDManager.GetDisplayValue(_38a);
  4280. }
  4281. return _38b;
  4282. };
  4283. CSelectionController.prototype.getTextValue=function(_38d){
  4284. var _38e=null;
  4285. for(var _38f=0;_38f<_38d.length;_38f++){
  4286. if(_38d[_38f].style.visisbility!="hidden"){
  4287. if(isIE()){
  4288. _38e=_38d[_38f].innerText;
  4289. }else{
  4290. _38e=_38d[_38f].textContent;
  4291. }
  4292. var _390=_38d[_38f].nextSibling;
  4293. while(_390!=null){
  4294. if(_390.nodeName.toUpperCase()=="SPAN"&&_390.style.visibility!="hidden"){
  4295. if(isIE()){
  4296. _38e+=_390.innerText;
  4297. }else{
  4298. _38e+=_390.textContent;
  4299. }
  4300. }
  4301. _390=_390.nextSibling;
  4302. }
  4303. break;
  4304. }
  4305. }
  4306. return _38e;
  4307. };
  4308. CSelectionController.prototype.getDisplayValueFromDOM=function(_391,_392){
  4309. var _393=null;
  4310. var _394;
  4311. var _395=new RegExp("(^|\\s)"+_391+"(\\s|$|:)","i");
  4312. if(typeof _392!="undefined"){
  4313. _394=getElementsByAttribute(_392,["span","td","th"],"ctx",_391,1,_395);
  4314. }else{
  4315. var _396=document.getElementById("CVIFrame"+this.m_sNamespace);
  4316. if(typeof _396=="undefined"||_396==null){
  4317. var _397=document.getElementById("RVContent"+this.m_sNamespace);
  4318. if(typeof _397=="undefined"||_397==null){
  4319. _394=getElementsByAttribute(document.body,["span","td","th"],"ctx",_391,1,_395);
  4320. }else{
  4321. _394=getElementsByAttribute(_397,["span","td","th"],"ctx",_391,1,_395);
  4322. }
  4323. }else{
  4324. _394=getElementsByAttribute(_396.contentWindow.document.body,["span","td","th"],"ctx",_391,1,_395);
  4325. }
  4326. }
  4327. var _398;
  4328. if(_394.length>0&&(_394[0].nodeName.toUpperCase()=="TD"||_394[0].nodeName.toUpperCase()=="TH")){
  4329. _398=_394[0].childNodes;
  4330. }else{
  4331. _398=_394;
  4332. }
  4333. if(_398.length==0||(_398[0].className.indexOf("chart_area")==-1&&_398[0].className.indexOf("bux-comment")==-1)){
  4334. _393=this.getTextValue(_398);
  4335. }
  4336. return _393;
  4337. };
  4338. CSelectionController.prototype.getDisplayValue=function(_399,_39a){
  4339. var _39b=this.getDisplayValueFromDOM(_399,_39a);
  4340. if(_39b==null){
  4341. _39b=this.getUseValue(_399);
  4342. }
  4343. return _39b;
  4344. };
  4345. CSelectionController.prototype.getDun=function(_39c){
  4346. if(this.m_bUsingCCDManager){
  4347. return this.m_oCDManager.GetDUN(_39c);
  4348. }else{
  4349. var _39d=this.m_aReportContextDataArray[_39c];
  4350. if(_39d&&typeof _39d[5]!="undefined"){
  4351. var _39e=_39d[5];
  4352. var _39f=this.m_aReportMetadataArray[_39e];
  4353. if(typeof _39f!="undefined"&&typeof _39f[1]!="undefined"&&_39f[1]=="D"){
  4354. return _39f[0];
  4355. }
  4356. }
  4357. }
  4358. };
  4359. CSelectionController.prototype.getPun=function(_3a0){
  4360. if(this.m_bUsingCCDManager){
  4361. return this.m_oCDManager.GetPUN(_3a0);
  4362. }
  4363. };
  4364. CSelectionController.prototype.getLun=function(_3a1){
  4365. var lun="";
  4366. if(!this.m_bUsingCCDManager){
  4367. var _3a3=this.m_aReportContextDataArray[_3a1];
  4368. if(_3a3&&typeof _3a3[3]!="undefined"){
  4369. var _3a4=_3a3[3];
  4370. var _3a5=this.m_aReportMetadataArray[_3a4];
  4371. if(typeof _3a5!="undefined"&&typeof _3a5[1]!="undefined"&&_3a5[1]=="L"){
  4372. lun=_3a5[0];
  4373. }
  4374. }
  4375. }else{
  4376. lun=this.m_oCDManager.GetLUN(_3a1);
  4377. }
  4378. return lun;
  4379. };
  4380. CSelectionController.prototype.isContextId=function(_3a6){
  4381. var _3a7=false;
  4382. if(!this.m_bUsingCCDManager){
  4383. var _3a8=this.m_aReportContextDataArray[_3a6];
  4384. _3a7=(typeof _3a8=="object");
  4385. }else{
  4386. this.m_oCDManager.FetchContextData([_3a6]);
  4387. _3a7=this.m_oCDManager.ContextIdExists(_3a6);
  4388. }
  4389. return _3a7;
  4390. };
  4391. CSelectionController.prototype.hasContextData=function(){
  4392. var _3a9=false;
  4393. if(!this.m_bUsingCCDManager){
  4394. if(this.m_aReportContextDataArray&&this.m_aReportContextDataArray.length&&this.m_aReportContextDataArray.length()>0){
  4395. return true;
  4396. }
  4397. }else{
  4398. _3a9=this.m_oCDManager.HasContextData();
  4399. }
  4400. return _3a9;
  4401. };
  4402. CSelectionController.prototype.hasMetadata=function(){
  4403. var _3aa=false;
  4404. if(!this.m_bUsingCCDManager){
  4405. if(this.m_aReportMetadataArray&&this.m_aReportMetadataArray.length&&this.m_aReportMetadataArray.length()>0){
  4406. return true;
  4407. }
  4408. }else{
  4409. _3aa=this.m_oCDManager.HasMetadata();
  4410. }
  4411. return _3aa;
  4412. };
  4413. CSelectionController.prototype.getDifferentCellIndex=function(_3ab,_3ac,_3ad){
  4414. for(var i=0;i<_3ab.cells.length;i++){
  4415. if(this.getSelectionObjectFactory().getSelectionObject(_3ab.cells[i]).getLayoutType()=="datavalue"){
  4416. break;
  4417. }
  4418. }
  4419. if(_3ad=="relative"){
  4420. return (_3ac-i);
  4421. }else{
  4422. if(_3ad=="actual"){
  4423. return (_3ac+i);
  4424. }
  4425. }
  4426. };
  4427. CSelectionController.prototype.cellsAreInSameColumn=function(_3af,_3b0){
  4428. if(_3af.parentNode.rowIndex==_3b0.parentNode.rowIndex){
  4429. return false;
  4430. }
  4431. if(_3af.getAttribute("cid")===null){
  4432. if(_3af.getAttribute("uid")===_3b0.getAttribute("uid")){
  4433. if(_3af.getAttribute("type")!="datavalue"){
  4434. return true;
  4435. }else{
  4436. if(this.getDifferentCellIndex(_3af.parentNode,_3af.cellIndex,"relative")==this.getDifferentCellIndex(_3b0.parentNode,_3b0.cellIndex,"relative")){
  4437. return true;
  4438. }
  4439. }
  4440. }else{
  4441. return false;
  4442. }
  4443. }else{
  4444. if(_3af.getAttribute("cid")===_3b0.getAttribute("cid")){
  4445. return true;
  4446. }else{
  4447. return false;
  4448. }
  4449. }
  4450. };
  4451. CSelectionController.prototype.selectVertical=function(_3b1,_3b2,_3b3){
  4452. if(!_3b3){
  4453. _3b3=document;
  4454. }
  4455. var _3b4=_3b1.getCellRef().parentNode;
  4456. var _3b5,i;
  4457. var _3b7=(_3b1.getCellRef().parentNode.rowIndex<_3b2.getCellRef().parentNode.rowIndex);
  4458. var _3b8=(_3b1.getCellRef().parentNode.cells.length-_3b1.getCellRef().cellIndex);
  4459. while(_3b4.rowIndex!=_3b2.getCellRef().parentNode.rowIndex){
  4460. if(_3b7){
  4461. _3b4=_3b4.nextSibling;
  4462. }else{
  4463. _3b4=_3b4.previousSibling;
  4464. }
  4465. if(_3b4==null){
  4466. break;
  4467. }
  4468. if(_3b4.cells.length>=_3b8){
  4469. for(i=0;i<_3b4.cells.length;i++){
  4470. if((_3b4.cells[i].getAttribute("type")==_3b1.getLayoutType())&&this.cellsAreInSameColumn(_3b1.getCellRef(),_3b4.cells[i])){
  4471. _3b5=this.getSelectionObjectFactory().getSelectionObject(_3b4.cells[i]);
  4472. if(this.addSelectionObject(_3b5,_3b3)){
  4473. if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
  4474. cf.addSelectionToCfgVariables(_3b5.getColumnName());
  4475. }
  4476. }
  4477. break;
  4478. }
  4479. }
  4480. }
  4481. }
  4482. };
  4483. CSelectionController.prototype.selectHorizontal=function(_3b9,_3ba,_3bb){
  4484. var _3bc="";
  4485. if(_3b9.getColumnRef()==null){
  4486. if(_3b9.getCellRef().getAttribute("uid")==_3ba.getCellRef().getAttribute("uid")){
  4487. _3bc=_3b9.getCellRef().getAttribute("uid");
  4488. }else{
  4489. return;
  4490. }
  4491. }
  4492. var _3bd,_3be;
  4493. var _3bf=_3ba.getCellRef().parentNode;
  4494. var _3c0;
  4495. if(_3ba.getCellRef().cellIndex<_3b9.getCellRef().cellIndex){
  4496. _3bd=_3ba.getCellRef().cellIndex;
  4497. _3be=_3b9.getCellRef().cellIndex;
  4498. }else{
  4499. _3be=_3ba.getCellRef().cellIndex;
  4500. _3bd=_3b9.getCellRef().cellIndex;
  4501. }
  4502. for(var i=_3bd+1;i<_3be;i++){
  4503. if(((_3b9.getColumnRef()!=null)&&(_3b9.getLayoutType()==_3ba.getLayoutType())&&(_3b9.getLayoutType()!="datavalue")||this.allowHorizontalDataValueSelection())||((_3b9.getColumnRef()==null)&&(_3bf.cells[i].getAttribute("uid")==_3bc))){
  4504. _3c0=this.getSelectionObjectFactory().getSelectionObject(_3bf.cells[i]);
  4505. if(this.addSelectionObject(_3c0,_3bb)){
  4506. if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
  4507. cf.addSelectionToCfgVariables(_3c0.getColumnName());
  4508. }
  4509. }
  4510. }
  4511. }
  4512. };
  4513. CSelectionController.prototype.pageDoubleClicked=function(e){
  4514. try{
  4515. var node=getNodeFromEvent(e);
  4516. if(typeof node.selectedCell!="undefined"){
  4517. var _3c4=node;
  4518. node=node.selectedCell;
  4519. _3c4.removeAttribute("selectedCell");
  4520. }
  4521. while(node.nodeType==3){
  4522. node=node.parentNode;
  4523. }
  4524. var ctx=node.getAttribute("ctx");
  4525. var uid=node.getAttribute("uid");
  4526. if((ctx!=null)||(node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
  4527. node=node.parentNode;
  4528. if(node.className.toUpperCase()=="BLOCK"&&node.nodeName.toUpperCase()=="DIV"){
  4529. node=node.parentNode;
  4530. }
  4531. uid=node.getAttribute("uid");
  4532. }
  4533. if(uid!=null&&node.firstChild!=null&&(node.getAttribute("type")=="columnTitle"||node.getAttribute("type")=="section")){
  4534. if(typeof goWindowManager!="undefined"&&goWindowManager&&typeof goWindowManager.getApplicationFrame=="function"){
  4535. goWindowManager.getFeatureManager().launchFeature("Rename");
  4536. }
  4537. }
  4538. if(typeof g_reportSelectionController!="undefined"){
  4539. g_reportSelectionController.clearSelections();
  4540. }
  4541. }
  4542. catch(ex){
  4543. }
  4544. };
  4545. CSelectionController.prototype.getSelectionHoverNodes=function(){
  4546. return this.m_aSelectionHoverNodes;
  4547. };
  4548. CSelectionController.prototype.setSelectionHoverNodes=function(_3c7){
  4549. this.m_aSelectionHoverNodes=_3c7;
  4550. };
  4551. CSelectionController.prototype.addSelectionHoverNode=function(node){
  4552. this.m_aSelectionHoverNodes[this.m_aSelectionHoverNodes.length]=node;
  4553. };
  4554. CSelectionController.prototype.pageHover=function(e){
  4555. try{
  4556. var node=getNodeFromEvent(e);
  4557. while(node.nodeType==3){
  4558. node=node.parentNode;
  4559. }
  4560. if((node.getAttribute("ctx")!=null)||(node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
  4561. if(node.parentNode.nodeName.toLowerCase()!="tr"){
  4562. node=node.parentNode;
  4563. }
  4564. }
  4565. var _3cb=this.getSelectionHoverNodes();
  4566. var _3cc=this.getAllSelectedObjects().length;
  4567. if(!(_3cb.length==1&&_3cb[0]==node)){
  4568. for(var i=0;i<_3cb.length;i++){
  4569. this.sortIconHover(_3cb[i],true);
  4570. if(_3cc==0){
  4571. this.pageChangeHover(_3cb[i],true);
  4572. }
  4573. }
  4574. this.setSelectionHoverNodes([]);
  4575. if(_3cc==0){
  4576. this.sortIconHover(node,false);
  4577. if(this.pageChangeHover(node,false)){
  4578. this.addSelectionHoverNode(node);
  4579. }
  4580. }else{
  4581. if(this.sortIconHover(node,false)){
  4582. this.addSelectionHoverNode(node);
  4583. }
  4584. }
  4585. }
  4586. }
  4587. catch(ex){
  4588. }
  4589. };
  4590. CSelectionController.prototype.sortIconHover=function(node,_3cf){
  4591. if(!this.isValidColumnTitle(node)){
  4592. return false;
  4593. }
  4594. var _3d0=this.getSortImgNode(node);
  4595. if(_3d0!=null&&_3d0!="undefined"){
  4596. if(_3d0.getAttribute("sortOrder")==="nosort"){
  4597. if(_3cf){
  4598. _3d0.style.visibility="hidden";
  4599. }else{
  4600. _3d0.style.visibility="visible";
  4601. }
  4602. }
  4603. return true;
  4604. }
  4605. return false;
  4606. };
  4607. CSelectionController.prototype.isValidColumnTitle=function(node){
  4608. if(node&&node.parentNode){
  4609. var uid=node.getAttribute("uid");
  4610. if(uid!=null&&(!(node.firstChild==null&&node.cellIndex==0&&node.parentNode.rowIndex==0&&node.getAttribute("cid")==null))&&(node.getAttribute("type")=="columnTitle"||node.getAttribute("type")=="section")){
  4611. return true;
  4612. }
  4613. }
  4614. return false;
  4615. };
  4616. CSelectionController.prototype.pageChangeHover=function(node,_3d4){
  4617. try{
  4618. if((node.getAttribute("ctx")!=null)||(node.parentNode&&node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
  4619. if(node.parentNode.nodeName.toLowerCase()!="tr"){
  4620. node=node.parentNode;
  4621. }
  4622. }
  4623. if(this.isValidColumnTitle(node)){
  4624. var _3d5=this.isColumnSelected(node.getAttribute("tag"));
  4625. if(!_3d5){
  4626. _3d5=this.isColumnCut(node.getAttribute("tag"));
  4627. }
  4628. if(!_3d5){
  4629. if(_3d4){
  4630. if(node.getAttribute("oldClassName")!=null){
  4631. node.className=node.getAttribute("oldClassName");
  4632. node.removeAttribute("oldClassName");
  4633. }
  4634. this.restoreOldBackgroundImage(node);
  4635. }else{
  4636. if(node.getAttribute("oldClassName")!=null){
  4637. node.className=node.getAttribute("oldClassName");
  4638. }else{
  4639. node.setAttribute("oldClassName",node.className);
  4640. }
  4641. if(node.getAttribute("oldBackgroundImageStyle")!=null){
  4642. node.style.backgroundImage=node.getAttribute("oldBackgroundImageStyle");
  4643. }else{
  4644. this.saveOldCellStyles(node);
  4645. }
  4646. node.className+=" hoverSelection";
  4647. return true;
  4648. }
  4649. }
  4650. }
  4651. }
  4652. catch(ex){
  4653. }
  4654. return false;
  4655. };
  4656. CSelectionController.prototype.getSortImgNode=function(node){
  4657. var _3d7=node.getElementsByTagName("img");
  4658. for(var i=0;i<_3d7.length;i++){
  4659. var sId=_3d7[i].id.toString();
  4660. if(sId!=null&&sId.length>0&&sId.indexOf("sortimg")>=0){
  4661. node=_3d7[i];
  4662. return node;
  4663. }
  4664. }
  4665. return null;
  4666. };
  4667. CSelectionController.prototype.restoreOldPadding=function(node){
  4668. if(node&&node.style&&node.getAttribute("oldPaddingStyle")!=null){
  4669. if(node.getAttribute("oldPaddingStyle").length>0){
  4670. node.style.padding=node.getAttribute("oldPaddingStyle");
  4671. }
  4672. node.removeAttribute("oldPaddingStyle");
  4673. }
  4674. };
  4675. CSelectionController.prototype.saveOldPadding=function(node,size){
  4676. if(node&&node.getAttribute("oldPaddingStyle")==null){
  4677. node.setAttribute("oldPaddingStyle",size.paddingTop+"px "+size.paddingRight+"px "+size.paddingBottom+"px "+size.paddingLeft+"px");
  4678. }
  4679. };
  4680. CSelectionController.prototype.saveOldBorder=function(node){
  4681. if(node&&node.getAttribute("oldBorderStyle")==null){
  4682. node.setAttribute("oldBorderStyle",node.style.border);
  4683. }
  4684. };
  4685. CSelectionController.prototype.restoreOldBorder=function(node){
  4686. if(node&&node.style&&node.getAttribute("oldBorderStyle")!=null){
  4687. if(node.getAttribute("oldBorderStyle").length>0){
  4688. node.style.border=node.getAttribute("oldBorderStyle");
  4689. }else{
  4690. node.style.borderColor=node.style.borderWidth=node.style.borderStyle="";
  4691. }
  4692. node.removeAttribute("oldBorderStyle");
  4693. }
  4694. };
  4695. CSelectionController.prototype.setPrimarySelectionStyles=function(cell){
  4696. if(this.getPrimarySelectionColor()){
  4697. cell.style.backgroundColor=this.getPrimarySelectionColor();
  4698. }else{
  4699. cell.style.backgroundImage=this.pS_backgroundImageURL;
  4700. cell.style.backgroundRepeat="repeat";
  4701. }
  4702. };
  4703. CSelectionController.prototype.setSecondarySelectionStyles=function(cell){
  4704. if(this.getSecondarySelectionColor()){
  4705. cell.style.backgroundColor=this.getSecondarySelectionColor();
  4706. }else{
  4707. cell.style.backgroundImage=this.sS_backgroundImageURL;
  4708. cell.style.backgroundRepeat="repeat";
  4709. }
  4710. };
  4711. CSelectionController.prototype.saveOldCellStyles=function(node){
  4712. if(node&&node.getAttribute("oldBackgroundImageStyle")==null){
  4713. node.setAttribute("oldBackgroundColor",this.getStyleProperty(node,"backgroundColor"));
  4714. node.setAttribute("oldBackgroundImageStyle",this.getBackgroundImage(node));
  4715. node.setAttribute("oldBackgroundRepeat",this.getStyleProperty(node,"backgroundRepeat"));
  4716. node.style.backgroundImage="";
  4717. node.style.backgroundRepeat="";
  4718. }
  4719. };
  4720. CSelectionController.prototype.restoreOldBackgroundImage=function(node){
  4721. if(node&&node.style&&node.getAttribute("oldBackgroundImageStyle")!=null){
  4722. node.style.backgroundImage=node.getAttribute("oldBackgroundImageStyle");
  4723. node.removeAttribute("oldBackgroundImageStyle");
  4724. node.style.backgroundRepeat=node.getAttribute("oldBackgroundRepeat");
  4725. node.removeAttribute("oldBackgroundRepeat");
  4726. node.style.backgroundColor=node.getAttribute("oldBackgroundColor");
  4727. node.removeAttribute("oldBackgroundColor");
  4728. }
  4729. };
  4730. CSelectionController.prototype.getStyleProperty=function(node,_3e4){
  4731. if(node&&node.style&&node.style[_3e4]){
  4732. return node.style[_3e4];
  4733. }
  4734. return "";
  4735. };
  4736. CSelectionController.prototype.getBackgroundImage=function(node){
  4737. if(node&&node.style){
  4738. return node.style.backgroundImage;
  4739. }
  4740. return "";
  4741. };
  4742. CSelectionController.prototype.pageContextClicked=function(e){
  4743. var node=getNodeFromEvent(e);
  4744. if(typeof node.selectedCell!="undefined"){
  4745. var _3e8=node;
  4746. node=node.selectedCell;
  4747. _3e8.removeAttribute("selectedCell");
  4748. }
  4749. while(node!=null&&node.tagName!="TD"){
  4750. node=node.parentNode;
  4751. }
  4752. if(node!=null){
  4753. var _3e9=this.getBackgroundImage(node);
  4754. this.findSelectionURLs();
  4755. if(this.getSelections().length==0||_3e9!=this.pS_backgroundImageURL){
  4756. this.pageClicked(e);
  4757. }
  4758. }
  4759. if(typeof populateContextMenu!="undefined"){
  4760. populateContextMenu();
  4761. moveContextMenu(e);
  4762. }
  4763. var _3ea=false;
  4764. if(this.showViewerContextMenu()){
  4765. if(typeof e.preventDefault=="function"){
  4766. e.preventDefault();
  4767. }
  4768. _3ea=true;
  4769. }
  4770. return _3ea;
  4771. };
  4772. CSelectionController.prototype.chartContextMenu=function(e){
  4773. if(!this.hasSelectedChartNodes()){
  4774. return;
  4775. }
  4776. if(typeof populateContextMenu!="undefined"){
  4777. populateContextMenu();
  4778. moveContextMenu(e);
  4779. }
  4780. if(typeof e.preventDefault=="function"){
  4781. e.preventDefault();
  4782. }
  4783. return false;
  4784. };
  4785. CSelectionController.prototype.titleAreaContextMenu=function(e,_3ed,sId){
  4786. if(typeof populateContextMenu!="undefined"){
  4787. goWindowManager.getApplicationFrame().cfgSet("contextMenuType",_3ed);
  4788. goWindowManager.getApplicationFrame().cfgSet("contextMenuId",sId);
  4789. populateContextMenu(_3ed.toUpperCase());
  4790. moveContextMenu(e,_3ed.toUpperCase());
  4791. }
  4792. if(typeof e.preventDefault=="function"){
  4793. e.preventDefault();
  4794. }
  4795. return false;
  4796. };
  4797. CSelectionController.prototype.selectionsAreAllSameType=function(){
  4798. var _3ef=this.getSelections();
  4799. if(_3ef.length>0){
  4800. var _3f0=_3ef[0].getLayoutType();
  4801. for(var i=1;i<_3ef.length;i++){
  4802. if(_3f0!=_3ef[i].getLayoutType()){
  4803. return 0;
  4804. }
  4805. }
  4806. return 1;
  4807. }
  4808. return -1;
  4809. };
  4810. CSelectionController.prototype.selectionsAreAllOnSameColumn=function(){
  4811. var _3f2=this.getSelections();
  4812. var i=0;
  4813. if(_3f2.length>0){
  4814. var _3f4=_3f2[0].getColumnRef();
  4815. if(_3f4!=null&&_3f4!=""){
  4816. for(i=1;i<_3f2.length;i++){
  4817. if(_3f4!=_3f2[i].getColumnRef()){
  4818. return false;
  4819. }
  4820. }
  4821. }else{
  4822. var _3f5=_3f2[0].getCellTypeId();
  4823. for(i=1;i<_3f2.length;i++){
  4824. if(_3f5!=_3f2[i].getCellTypeId()){
  4825. return false;
  4826. }
  4827. }
  4828. }
  4829. return true;
  4830. }
  4831. return false;
  4832. };
  4833. CSelectionController.prototype.checkForReportElementNode=function(node){
  4834. if(typeof node!="undefined"&&node!=null&&typeof node.className!="undefined"&&node.className!=null){
  4835. if(node.className=="tt"){
  4836. if(typeof node.parentNode!="undefined"&&node.parentNode!=null&&typeof node.parentNode.parentNode!="undefined"&&node.parentNode.parentNode!=null&&(node.parentNode.className=="reportSubtitleStyle"||node.parentNode.id=="reportTitleLink")){
  4837. node=node.parentNode.parentNode;
  4838. }else{
  4839. return false;
  4840. }
  4841. }else{
  4842. if(typeof node.parentNode!="undefined"&&node.parentNode!=null){
  4843. var _3f7=node.parentNode;
  4844. while(typeof _3f7!="undefined"&&_3f7!=null){
  4845. if(typeof _3f7.className!="undefined"&&_3f7.className!=null&&_3f7.className.substr(0,2)=="ft"){
  4846. node=_3f7;
  4847. break;
  4848. }else{
  4849. _3f7=_3f7.parentNode;
  4850. }
  4851. }
  4852. }else{
  4853. return false;
  4854. }
  4855. }
  4856. var _3f8=node.className.substr(0,2);
  4857. if(_3f8=="ta"||_3f8=="ts"||_3f8=="ft"){
  4858. return true;
  4859. }
  4860. }
  4861. return false;
  4862. };
  4863. CSelectionController.prototype.chartClicked=function(_3f9){
  4864. this.setSelectedChartArea(_3f9);
  4865. };
  4866. CSelectionController.prototype.processColumnTitleNode=function(_3fa){
  4867. if(!_3fa||!this.m_oCognosViewer.isBux){
  4868. return;
  4869. }
  4870. var _3fb=_3fa.getCellRef();
  4871. if(_3fb.getAttribute("contextAugmented")=="true"||"list"!=_3fa.getDataContainerType()||"columnTitle"!=_3fa.getLayoutType()){
  4872. return;
  4873. }
  4874. var _3fc=_3fa.getSelectedContextIds();
  4875. var _3fd=false;
  4876. if(typeof _3fc=="object"&&_3fc!=null&&_3fc.length>0){
  4877. if(this.isRelational(_3fc)&&this.getQueryModelId(_3fc[0][0])==null){
  4878. _3fd=true;
  4879. }else{
  4880. return;
  4881. }
  4882. }
  4883. var lid=_3fb.parentNode.parentNode.parentNode.getAttribute("lid");
  4884. var _3ff=_3fb.parentNode.nextSibling;
  4885. var _400=getChildElementsByAttribute(_3ff,"td","cid",_3fb.getAttribute("cid"));
  4886. var _401=null;
  4887. var _402=true;
  4888. var _403;
  4889. if(_400.length>0){
  4890. var _404=_400[0];
  4891. var _405=_404.childNodes.length;
  4892. for(var _406=0;_406<_405;_406++){
  4893. var _407=_404.childNodes[_406];
  4894. if(_407.getAttribute&&((_407.nodeName.toLowerCase()=="table"&&typeof _407.getAttribute("lid")=="string")||_407.nodeName.toLowerCase()=="map"||_407.nodeName.toLowerCase()=="img"||_407.getAttribute("chartcontainer")=="true")){
  4895. if(_406==0){
  4896. _402=false;
  4897. }
  4898. }else{
  4899. _403=[];
  4900. if(_407.nodeName.toLowerCase()=="span"){
  4901. _403.push(_407);
  4902. }
  4903. var _408=_407.getElementsByTagName?_407.getElementsByTagName("span"):[];
  4904. for(var _409=0;_409<_408.length;++_409){
  4905. if(lid==getImmediateLayoutContainerId(_408[_409])){
  4906. _403.push(_408[_409]);
  4907. }
  4908. }
  4909. for(var _40a=0;_40a<_403.length;++_40a){
  4910. var _40b=_403[_40a];
  4911. if(_40b.nodeType==1&&_40b.nodeName.toLowerCase()=="span"&&_40b.style.visibility!="hidden"){
  4912. if(_40b.getAttribute("ctx")!=null&&_40b.getAttribute("ctx")!=""){
  4913. _401=_40b.getAttribute("ctx");
  4914. break;
  4915. }
  4916. }
  4917. }
  4918. }
  4919. }
  4920. }
  4921. if(_401!=null){
  4922. var _40c=_401.split("::")[0].split(":")[0];
  4923. if(!_3fd){
  4924. _403=_3fb.getElementsByTagName("span");
  4925. if(_403.length!=0){
  4926. var _40d=this.m_oCDManager.m_cd[_40c];
  4927. var _40e=this.getTextValue(_403);
  4928. var _40f={"u":_40e===null?"":_40e};
  4929. if(typeof _40d!="undefined"){
  4930. if(typeof _40d["r"]!="undefined"){
  4931. _40f.r=_40d["r"];
  4932. }
  4933. if(typeof _40d["q"]!="undefined"){
  4934. _40f.q=_40d["q"];
  4935. }
  4936. if(typeof _40d["i"]!="undefined"){
  4937. _40f.i=_40d["i"];
  4938. }
  4939. }
  4940. var _410="cloned"+_40c;
  4941. this.m_oCDManager.m_cd[_410]=_40f;
  4942. _403[0].setAttribute("ctx",_410);
  4943. _3fa=this.getSelectionObjectFactory().processCTX(_3fa,_410);
  4944. }
  4945. }else{
  4946. var qmid=this.getQueryModelId(_40c);
  4947. if(qmid==null){
  4948. }
  4949. if(qmid!=null){
  4950. var _412=_3fc[0][0];
  4951. this.m_oCDManager.m_cd[_412].i=this.m_oCDManager.m_cd[_40c].i;
  4952. return false;
  4953. }
  4954. }
  4955. }else{
  4956. _402=false;
  4957. }
  4958. if(!_402){
  4959. _3fb.setAttribute("canSort","false");
  4960. }
  4961. _3fb.setAttribute("contextAugmented","true");
  4962. };
  4963. CSelectionController.prototype.selectionsInSameDataContainer=function(){
  4964. try{
  4965. var _413=this.getAllSelectedObjects();
  4966. var _414=_413[0].getLayoutElementId();
  4967. for(var _415=1;_415<_413.length;_415++){
  4968. if(_414!=_413[_415].getLayoutElementId()){
  4969. return false;
  4970. }
  4971. }
  4972. }
  4973. catch(e){
  4974. return false;
  4975. }
  4976. return true;
  4977. };
  4978. CSelectionController.prototype.selectionsFromSameDataItem=function(){
  4979. try{
  4980. var _416=this.getAllSelectedObjects();
  4981. var _417=_416[0].getDataItems()[0][0];
  4982. for(var _418=1;_418<_416.length;_418++){
  4983. if(_417!=_416[_418].getDataItems()[0][0]){
  4984. return false;
  4985. }
  4986. }
  4987. }
  4988. catch(e){
  4989. return false;
  4990. }
  4991. return true;
  4992. };
  4993. CSelectionController.prototype.isRelational=function(_419){
  4994. try{
  4995. if(!_419){
  4996. var _41a=this.getAllSelectedObjects()[0];
  4997. _419=_41a.getSelectedContextIds();
  4998. }
  4999. for(var _41b=0;_41b<_419.length;_41b++){
  5000. for(var _41c=0;_41c<_419[_41b].length;_41c++){
  5001. var ctx=_419[_41b][_41c];
  5002. var mun=this.getMun(ctx);
  5003. var lun=this.getLun(ctx);
  5004. var hun=this.getHun(ctx);
  5005. if(mun!=null&&typeof mun!="undefined"&&mun.length>0){
  5006. return false;
  5007. }
  5008. if(lun!=null&&typeof lun!="undefined"&&lun.length>0){
  5009. return false;
  5010. }
  5011. if(hun!=null&&typeof hun!="undefined"&&hun.length>0){
  5012. return false;
  5013. }
  5014. }
  5015. }
  5016. return true;
  5017. }
  5018. catch(e){
  5019. return true;
  5020. }
  5021. return true;
  5022. };
  5023. CSelectionController.prototype.getDataContainerType=function(){
  5024. try{
  5025. if(!this.getAllSelectedObjects()[0]){
  5026. return "";
  5027. }
  5028. return this.getAllSelectedObjects()[0].m_dataContainerType;
  5029. }
  5030. catch(e){
  5031. return "";
  5032. }
  5033. };
  5034. CSelectionController.prototype.areSelectionsColumnRowTitles=function(){
  5035. try{
  5036. var _421=this.getAllSelectedObjects();
  5037. for(var _422=0;_422<_421.length;_422++){
  5038. var _423=_421[_422];
  5039. if(_423.getLayoutType()!="columnTitle"||_423.isHomeCell()){
  5040. return false;
  5041. }
  5042. }
  5043. }
  5044. catch(e){
  5045. return false;
  5046. }
  5047. return true;
  5048. };
  5049. CSelectionController.prototype.selectionsAreMeasures=function(){
  5050. try{
  5051. var _424=this.getAllSelectedObjects();
  5052. for(var _425=0;_425<_424.length;_425++){
  5053. var _426=_424[_425];
  5054. if(this.getUsageInfo(_426.getSelectedContextIds()[0][0])!=this.c_usageMeasure){
  5055. return false;
  5056. }
  5057. }
  5058. }
  5059. catch(e){
  5060. return false;
  5061. }
  5062. return true;
  5063. };
  5064. CSelectionController.prototype.selectionsNonMeasureWithMUN=function(){
  5065. var _427=this.getAllSelectedObjects();
  5066. if(_427.length==0){
  5067. return false;
  5068. }
  5069. for(var _428=0;_428<_427.length;_428++){
  5070. var _429=_427[0];
  5071. if(_429.getSelectedContextIds().length==0){
  5072. return false;
  5073. }
  5074. var _42a=_429.getSelectedContextIds()[0][0];
  5075. var mun=this.getMun(_42a);
  5076. var _42c=this.getUsageInfo(_42a);
  5077. if(mun==null||typeof mun=="undefined"||mun.length==0||_42c==this.c_usageMeasure){
  5078. return false;
  5079. }
  5080. }
  5081. return true;
  5082. };
  5083. CSelectionController.prototype.areSelectionsMeasureOrCalculation=function(){
  5084. var _42d=this.getAllSelectedObjects();
  5085. if(_42d.length==0){
  5086. return false;
  5087. }
  5088. var _42e=this.selectionsHaveCalculationMetadata();
  5089. for(var _42f=0;_42f<_42d.length;_42f++){
  5090. var _430=_42d[_42f];
  5091. var _431=_430.getSelectedContextIds()[0][0];
  5092. if(!this.isCalculationOrMeasure(_431,_42e)){
  5093. return false;
  5094. }
  5095. }
  5096. return true;
  5097. };
  5098. CSelectionController.prototype.selectionsHaveCalculationMetadata=function(){
  5099. try{
  5100. var _432=this.getDataContainerType();
  5101. var _433=this.getAllSelectedObjects();
  5102. for(var _434=0;_434<_433.length;_434++){
  5103. var _435=_433[_434];
  5104. var _436=_435.getSelectedContextIds();
  5105. var _437=_436[0][0];
  5106. var sHun=this.getHun(_437);
  5107. if(!this.hasCalculationMetadata(_437,_436,_432)){
  5108. return false;
  5109. }
  5110. }
  5111. }
  5112. catch(e){
  5113. return false;
  5114. }
  5115. return true;
  5116. };
  5117. CSelectionController.prototype.isCalculationOrMeasure=function(_439,_43a){
  5118. var mun=this.getMun(_439);
  5119. var _43c=this.getUsageInfo(_439);
  5120. if(!(((mun==null||typeof mun=="undefined"||mun.length==0)&&_43a)||_43c==this.c_usageMeasure)){
  5121. return false;
  5122. }
  5123. return true;
  5124. };
  5125. CSelectionController.prototype.hasCalculationMetadata=function(_43d,_43e,_43f){
  5126. var sHun=this.getHun(_43d);
  5127. if(this.getUsageInfo(_43d)!=this.c_usageMeasure){
  5128. if((this.isRelational(_43e)&&this.getQueryModelId(_43d)!=null)||(!this.isRelational(_43e)&&_43f=="list"&&(sHun&&sHun!=""))){
  5129. return false;
  5130. }
  5131. }
  5132. return true;
  5133. };
  5134. CSelectionController.prototype.selectionsAreDateTime=function(){
  5135. try{
  5136. var _441=this.getAllSelectedObjects();
  5137. for(var _442=0;_442<_441.length;_442++){
  5138. var _443=_441[_442];
  5139. var _444=_443.getSelectedContextIds();
  5140. var _445=_444[0][0];
  5141. var _446=this.getDataType(_445);
  5142. if(_446&&typeof this.m_ccl_dateTypes[_446]!=="undefined"){
  5143. return true;
  5144. }
  5145. }
  5146. }
  5147. catch(e){
  5148. return false;
  5149. }
  5150. return false;
  5151. };
  5152. CSelectionController.prototype.getSelectedObjectsJsonContext=function(){
  5153. try{
  5154. var _447=this.getAllSelectedObjects();
  5155. if(_447===null||_447.length<=0){
  5156. return null;
  5157. }
  5158. var _448=this.m_oCognosViewer.getModelPath();
  5159. var _449=[];
  5160. for(var i=0;i<_447.length;i++){
  5161. var obj=_447[i].getContextJsonObject(this,_448);
  5162. _449.push(obj);
  5163. }
  5164. return _449;
  5165. }
  5166. catch(e){
  5167. }
  5168. };
  5169. CSelectionController.prototype.destroy=function(){
  5170. delete this.m_oCognosViewer;
  5171. delete this.m_aCutColumns;
  5172. delete this.m_aSelectedObjects;
  5173. delete this.m_selectedClass;
  5174. delete this.m_cutClass;
  5175. if(this.m_oObserver&&this.m_oObserver.destroy){
  5176. this.m_oObserver.destroy();
  5177. }
  5178. delete this.m_oObserver;
  5179. delete this.m_aReportMetadataArray;
  5180. delete this.m_aReportContextDataArray;
  5181. if(this.m_oCDManager&&this.m_oCDManager.destroy){
  5182. this.m_oCDManager.destroy();
  5183. }
  5184. delete this.m_oCDManager;
  5185. if(this.m_oSelectionObjectFactory&&this.m_oSelectionObjectFactory.destroy){
  5186. this.m_oSelectionObjectFactory.destroy();
  5187. }
  5188. delete this.m_oSelectionObjectFactory;
  5189. delete this.m_selectedChartArea;
  5190. delete this.m_selectedChartNodes;
  5191. delete this.m_selectionContainerMap;
  5192. delete this.m_chartHelpers;
  5193. delete this.m_oJsonForMarshal;
  5194. if(this.hasSavedSelections()){
  5195. this.clearSavedSelections();
  5196. }
  5197. };
  5198. function clearTextSelection(_44c){
  5199. if(!_44c){
  5200. _44c=document;
  5201. }
  5202. try{
  5203. if(typeof _44c.selection=="object"&&_44c.selection!==null){
  5204. _44c.selection.empty();
  5205. }else{
  5206. if(typeof window.getSelection=="function"&&typeof window.getSelection()=="object"&&window.getSelection()!==null){
  5207. window.getSelection().removeAllRanges();
  5208. }
  5209. }
  5210. }
  5211. catch(e){
  5212. }
  5213. };
  5214. function CDrillThroughTarget(_44d,_44e,_44f,_450,_451,path,_453,_454,_455,_456,_457,_458){
  5215. this.m_label=_44d;
  5216. this.m_outputFormat=_44e;
  5217. this.m_outputLocale=_44f;
  5218. this.m_showInNewWindow=_450;
  5219. this.m_method=_451;
  5220. this.m_path=path;
  5221. this.m_bookmark=_453;
  5222. this.m_parameters=_454;
  5223. this.m_objectPaths=_455;
  5224. this.m_prompt="false";
  5225. this.m_dynamicDrillThrough=false;
  5226. this.m_parameterProperties=_458;
  5227. if(typeof _456!="undefined"&&_456!=null){
  5228. if(_456=="yes"){
  5229. this.m_prompt="true";
  5230. }else{
  5231. if(_456=="target"){
  5232. this.m_prompt="";
  5233. }
  5234. }
  5235. }
  5236. if(typeof _457!="undefined"&&_457!=null){
  5237. if(typeof _457=="string"){
  5238. _457=_457=="true"?true:false;
  5239. }
  5240. this.m_dynamicDrillThrough=_457;
  5241. }
  5242. };
  5243. function CDrillThroughTarget_getParameterProperties(){
  5244. return this.m_parameterProperties;
  5245. };
  5246. function CDrillThroughTarget_getLabel(){
  5247. return this.m_label;
  5248. };
  5249. function CDrillThroughTarget_getOutputFormat(){
  5250. return this.m_outputFormat;
  5251. };
  5252. function CDrillThroughTarget_getOutputLocale(){
  5253. return this.m_outputLocale;
  5254. };
  5255. function CDrillThroughTarget_getShowInNewWindow(){
  5256. return this.m_showInNewWindow;
  5257. };
  5258. function CDrillThroughTarget_getMethod(){
  5259. return this.m_method;
  5260. };
  5261. function CDrillThroughTarget_getPath(){
  5262. return this.m_path;
  5263. };
  5264. function CDrillThroughTarget_getBookmark(){
  5265. return this.m_bookmark;
  5266. };
  5267. function CDrillThroughTarget_getParameters(){
  5268. return this.m_parameters;
  5269. };
  5270. function CDrillThroughTarget_getObjectPaths(){
  5271. return this.m_objectPaths;
  5272. };
  5273. function CDrillThroughTarget_getPrompt(){
  5274. return this.m_prompt;
  5275. };
  5276. function CDrillThroughTarget_isDynamicDrillThrough(){
  5277. return this.m_dynamicDrillThrough;
  5278. };
  5279. CDrillThroughTarget.prototype.getLabel=CDrillThroughTarget_getLabel;
  5280. CDrillThroughTarget.prototype.getOutputFormat=CDrillThroughTarget_getOutputFormat;
  5281. CDrillThroughTarget.prototype.getOutputLocale=CDrillThroughTarget_getOutputLocale;
  5282. CDrillThroughTarget.prototype.getShowInNewWindow=CDrillThroughTarget_getShowInNewWindow;
  5283. CDrillThroughTarget.prototype.getMethod=CDrillThroughTarget_getMethod;
  5284. CDrillThroughTarget.prototype.getPath=CDrillThroughTarget_getPath;
  5285. CDrillThroughTarget.prototype.getBookmark=CDrillThroughTarget_getBookmark;
  5286. CDrillThroughTarget.prototype.getParameters=CDrillThroughTarget_getParameters;
  5287. CDrillThroughTarget.prototype.getObjectPaths=CDrillThroughTarget_getObjectPaths;
  5288. CDrillThroughTarget.prototype.getPrompt=CDrillThroughTarget_getPrompt;
  5289. CDrillThroughTarget.prototype.isDynamicDrillThrough=CDrillThroughTarget_isDynamicDrillThrough;
  5290. CDrillThroughTarget.prototype.getParameterProperties=CDrillThroughTarget_getParameterProperties;
  5291. function sXmlEncode(_459){
  5292. var _45a=""+_459;
  5293. if((_45a=="0")||((_459!=null)&&(_459!=false))){
  5294. _45a=_45a.replace(/&/g,"&amp;");
  5295. _45a=_45a.replace(/</g,"&lt;");
  5296. _45a=_45a.replace(/>/g,"&gt;");
  5297. _45a=_45a.replace(/"/g,"&quot;");
  5298. _45a=_45a.replace(/'/g,"&apos;");
  5299. }else{
  5300. if(_459==null){
  5301. _45a="";
  5302. }
  5303. }
  5304. return _45a;
  5305. };
  5306. function createFormField(name,_45c){
  5307. var _45d=document.createElement("input");
  5308. _45d.setAttribute("type","hidden");
  5309. _45d.setAttribute("name",name);
  5310. _45d.setAttribute("value",_45c);
  5311. return (_45d);
  5312. };
  5313. function setBackURLToCloseWindow(_45e){
  5314. var _45f=_45e.childNodes;
  5315. if(_45f){
  5316. for(var _460=0;_460<_45f.length;++_460){
  5317. var _461=_45f[_460];
  5318. var _462=_461.getAttribute("name");
  5319. if(_462&&_462=="ui.backURL"){
  5320. _45e.removeChild(_461);
  5321. }
  5322. }
  5323. }
  5324. _45e.appendChild(createFormField("ui.backURL","javascript:window.close();"));
  5325. };
  5326. function doMultipleDrills(_463,cvId){
  5327. if(parent!=this&&parent.doMultipleDrills){
  5328. if(getCVId()!=""&&getCVId()!=cvId){
  5329. cvId=getCVId();
  5330. }
  5331. return parent.doMultipleDrills(_463,cvId);
  5332. }else{
  5333. if(window.gViewerLogger){
  5334. window.gViewerLogger.log("Drill Targets",_463,"text");
  5335. }
  5336. var oCV=null;
  5337. try{
  5338. oCV=getCognosViewerObjectRef(cvId);
  5339. }
  5340. catch(exception){
  5341. }
  5342. var _466=buildDrillForm(oCV);
  5343. addDrillEnvironmentFormFields(_466,oCV);
  5344. if(typeof oCV!="undefined"&&oCV!=null){
  5345. var _467=oCV.getModelPath();
  5346. _466.appendChild(createFormField("modelPath",_467));
  5347. var _468=oCV.getSelectionController();
  5348. var _469="";
  5349. if(typeof getViewerSelectionContext!="undefined"&&typeof CSelectionContext!="undefined"){
  5350. _469=getViewerSelectionContext(_468,new CSelectionContext(_467));
  5351. }
  5352. _466.appendChild(createFormField("drillContext",_469));
  5353. _466.appendChild(createFormField("modelDrillEnabled",_468.getModelDrillThroughEnabled()));
  5354. if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"&&document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value!=""){
  5355. _466.appendChild(createFormField("drillSource",document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value));
  5356. }else{
  5357. if(typeof oCV.envParams["ui.spec"]!="undefined"){
  5358. _466.appendChild(createFormField("sourceSpecification",oCV.envParams["ui.spec"]));
  5359. }
  5360. }
  5361. }
  5362. _466.setAttribute("launchGotoPage","true");
  5363. _466.appendChild(createFormField("drillTargets",_463));
  5364. _466.appendChild(createFormField("invokeGotoPage","true"));
  5365. _466.appendChild(createFormField("m","portal/drillthrough.xts"));
  5366. _466.appendChild(createFormField("b_action","xts.run"));
  5367. var _46a="winNAT_"+(new Date()).getTime();
  5368. var _46b="..";
  5369. if(oCV!=null){
  5370. _46b=oCV.getWebContentRoot();
  5371. var _46c=oCV.getExecutionParameters();
  5372. if(_46c!=""){
  5373. _466.appendChild(createFormField("encExecutionParameters",_46c));
  5374. }
  5375. }
  5376. if(!oCV||!oCV.launchGotoPageForIWidgetMobile(_466)){
  5377. if(oCV&&typeof oCV.launchGotoPage==="function"){
  5378. oCV.launchGotoPage(_466);
  5379. }else{
  5380. var _46d=_46b+"/rv/blankDrillWin.html";
  5381. _466.target=_46a;
  5382. window.open(_46d,_46a);
  5383. }
  5384. }
  5385. }
  5386. };
  5387. function buildDrillForm(oCV){
  5388. var _46f=document.getElementById("drillForm");
  5389. if(_46f){
  5390. document.body.removeChild(_46f);
  5391. }
  5392. _46f=document.createElement("form");
  5393. if(typeof oCV!="undefined"&&oCV!=null){
  5394. var _470=document.getElementById("formWarpRequest"+oCV.getId());
  5395. _46f.setAttribute("target",_470.getAttribute("target"));
  5396. _46f.setAttribute("action",_470.getAttribute("action"));
  5397. }else{
  5398. _46f.setAttribute("action",location.pathname);
  5399. }
  5400. _46f.setAttribute("id","drillForm");
  5401. _46f.setAttribute("name","drillForm");
  5402. _46f.setAttribute("method","post");
  5403. _46f.style.display="none";
  5404. document.body.appendChild(_46f);
  5405. return _46f;
  5406. };
  5407. function addDrillEnvironmentFormFields(_471,oCV){
  5408. if(window.g_dfEmail){
  5409. _471.appendChild(createFormField("dfemail",window.g_dfEmail));
  5410. }
  5411. if(oCV!=null){
  5412. _471.appendChild(createFormField("cv.id",oCV.getId()));
  5413. if(typeof oCV.envParams["ui.sh"]!="undefined"){
  5414. _471.appendChild(createFormField("ui.sh",oCV.envParams["ui.sh"]));
  5415. }
  5416. if(oCV.getViewerWidget()==null){
  5417. if(typeof oCV.envParams["cv.header"]!="undefined"){
  5418. _471.appendChild(createFormField("cv.header",oCV.envParams["cv.header"]));
  5419. }
  5420. if(typeof oCV.envParams["cv.toolbar"]!="undefined"){
  5421. _471.appendChild(createFormField("cv.toolbar",oCV.envParams["cv.toolbar"]));
  5422. }else{
  5423. var _473=oCV.getAdvancedServerProperty("VIEWER_PASS_PORTLET_TOOLBAR_STATE_ON_DRILLTHROUGH");
  5424. if(oCV.m_viewerFragment&&_473!=null&&_473===true){
  5425. var _474=oCV.m_viewerFragment.canShowToolbar()?"true":"false";
  5426. _471.appendChild(createFormField("cv.toolbar",_474));
  5427. }
  5428. }
  5429. }
  5430. if(typeof oCV.envParams["ui.backURL"]!="undefined"){
  5431. _471.appendChild(createFormField("ui.backURL",oCV.envParams["ui.backURL"]));
  5432. }
  5433. if(typeof oCV.envParams["ui.postBack"]!="undefined"){
  5434. _471.appendChild(createFormField("ui.postBack",oCV.envParams["ui.postBack"]));
  5435. }
  5436. if(typeof oCV.envParams["savedEnv"]!="undefined"){
  5437. _471.appendChild(createFormField("savedEnv",oCV.envParams["savedEnv"]));
  5438. }
  5439. if(typeof oCV.envParams["ui.navlinks"]!="undefined"){
  5440. _471.appendChild(createFormField("ui.navlinks",oCV.envParams["ui.navlinks"]));
  5441. }
  5442. if(typeof oCV.envParams["lang"]!="undefined"){
  5443. _471.appendChild(createFormField("lang",oCV.envParams["lang"]));
  5444. }
  5445. if(typeof oCV.envParams["ui.errURL"]!="undefined"){
  5446. _471.appendChild(createFormField("ui.errURL",oCV.envParams["ui.errURL"]));
  5447. }
  5448. var _475="";
  5449. if(oCV.envParams["ui.routingServerGroup"]){
  5450. _475=oCV.envParams["ui.routingServerGroup"];
  5451. }
  5452. _471.appendChild(createHiddenFormField("ui.routingServerGroup",_475));
  5453. }else{
  5454. _471.appendChild(createFormField("cv.header","false"));
  5455. _471.appendChild(createFormField("cv.toolbar","false"));
  5456. }
  5457. };
  5458. function appendReportHistoryObjects(oCV,_477){
  5459. if(oCV!=null&&typeof oCV.rvMainWnd!="undefined"&&_477!=null){
  5460. oCV.rvMainWnd.addCurrentReportToReportHistory();
  5461. var _478=oCV.rvMainWnd.saveReportHistoryAsXML();
  5462. _477.appendChild(createFormField("cv.previousReports",_478));
  5463. }
  5464. };
  5465. function doSingleDrill(_479,args,_47b,_47c,_47d,_47e,_47f,_480,cvId,_482,_483){
  5466. var _484="";
  5467. if(typeof cvId=="string"){
  5468. _484=cvId;
  5469. }
  5470. var oCV=null;
  5471. try{
  5472. oCV=getCognosViewerObjectRef(cvId);
  5473. }
  5474. catch(exception){
  5475. }
  5476. if(!oCV&&parent!=this&&parent.doSingleDrill){
  5477. if(getCVId()!=""&&getCVId()!=cvId){
  5478. cvId=getCVId();
  5479. }
  5480. return parent.doSingleDrill(_479,args,_47b,_47c,_47d,_47e,_47f,_480,cvId,_482,_483);
  5481. }else{
  5482. if(typeof _47b=="undefined"){
  5483. _47b="default";
  5484. }else{
  5485. if(_47b=="execute"){
  5486. _47b="run";
  5487. }
  5488. }
  5489. if(_47b=="edit"&&oCV!=null&&typeof oCV.m_viewerFragment){
  5490. _479="_blank";
  5491. }
  5492. var _486=buildDrillForm(oCV);
  5493. var _487="<authoredDrillRequest>";
  5494. _487+="<param name=\"action\">"+sXmlEncode(_47b)+"</param>";
  5495. _487+="<param name=\"target\">"+sXmlEncode(args[0][1])+"</param>";
  5496. _487+="<param name=\"format\">"+sXmlEncode(_47c)+"</param>";
  5497. _487+="<param name=\"locale\">"+sXmlEncode(_47d)+"</param>";
  5498. _487+="<param name=\"prompt\">"+sXmlEncode(_482)+"</param>";
  5499. _487+="<param name=\"dynamicDrill\">"+sXmlEncode(_483)+"</param>";
  5500. if(typeof oCV!="undefined"&&oCV!=null){
  5501. _487+="<param name=\"sourceTracking\">"+oCV.getTracking()+"</param>";
  5502. if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"){
  5503. _487+="<param name=\"source\">"+sXmlEncode(document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value)+"</param>";
  5504. }
  5505. var _488=oCV.getModelPath();
  5506. _487+="<param name=\"metadataModel\">"+sXmlEncode(_488)+"</param>";
  5507. _487+="<param name=\"selectionContext\">"+sXmlEncode(getViewerSelectionContext(oCV.getSelectionController(),new CSelectionContext(_488)))+"</param>";
  5508. if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"&&document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value!=""){
  5509. _487+="<param name=\"source\">"+sXmlEncode(document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value)+"</param>";
  5510. }else{
  5511. if(typeof oCV.envParams["ui.spec"]!="undefined"){
  5512. _487+="<param name=\"sourceSpecification\">"+sXmlEncode(oCV.envParams["ui.spec"])+"</param>";
  5513. }
  5514. }
  5515. }
  5516. if(_47e!=""){
  5517. _487+="<param name=\"bookmark\">"+_47e+"</param>";
  5518. }
  5519. if(_47b!="view"){
  5520. if(typeof _47f!="undefined"){
  5521. _487+="<param name=\"sourceContext\">"+sXmlEncode(_47f)+"</param>";
  5522. }
  5523. if(typeof _480!="undefined"){
  5524. _487+="<param name=\"objectPaths\">"+sXmlEncode(_480)+"</param>";
  5525. }
  5526. }
  5527. var _489=0;
  5528. _487+="<drillParameters>";
  5529. var _48a=[];
  5530. for(_489=1;_489<args.length;_489++){
  5531. var sSel=args[_489][1];
  5532. if(_47c=="HTML"&&(sSel.indexOf("<selectChoices")==0)){
  5533. var _48c=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(args[_489][1])));
  5534. if(_48c){
  5535. var sMun=_48c.getAttribute("mun");
  5536. if(sMun!=null&&sMun!=""){
  5537. _48c.setAttribute("useValue",sMun);
  5538. sSel="<selectChoices>"+XMLBuilderSerializeNode(_48c)+"</selectChoices>";
  5539. }
  5540. }
  5541. }
  5542. var _48e=args[_489][0];
  5543. var _48f=false;
  5544. for(var i=0;i<_48a.length;i++){
  5545. var _491=_48a[i];
  5546. if(_491.name===_48e&&_491.value===sSel){
  5547. _48f=true;
  5548. break;
  5549. }
  5550. }
  5551. if(!_48f){
  5552. _48a.push({"name":_48e,"value":sSel});
  5553. _487+="<param name=\""+sXmlEncode(_48e)+"\">"+sXmlEncode(sSel)+"</param>";
  5554. }
  5555. }
  5556. _487+="</drillParameters>";
  5557. _487+=getExecutionParamNode(oCV);
  5558. _487+="</authoredDrillRequest>";
  5559. _486.appendChild(createFormField("authoredDrill.request",_487));
  5560. _486.appendChild(createFormField("ui.action","authoredDrillThrough2"));
  5561. _486.appendChild(createFormField("b_action","cognosViewer"));
  5562. addDrillEnvironmentFormFields(_486,oCV);
  5563. if(!oCV||!oCV.executeDrillThroughForIWidgetMobile(_486)){
  5564. if(oCV&&typeof oCV.sendDrillThroughRequest==="function"){
  5565. oCV.sendDrillThroughRequest(_486);
  5566. }else{
  5567. if(_479==""&&oCV!=null&&typeof oCV.m_viewerFragment!="undefined"){
  5568. oCV.m_viewerFragment.raiseAuthoredDrillEvent(_487);
  5569. }else{
  5570. if((oCV!=null&&oCV.getViewerWidget()!=null)||_479!=""){
  5571. setBackURLToCloseWindow(_486);
  5572. var _492="winNAT_"+(new Date()).getTime();
  5573. var _493="..";
  5574. if(oCV!=null){
  5575. _493=oCV.getWebContentRoot();
  5576. }
  5577. var _494=_493+"/rv/blankDrillWin.html";
  5578. if(_484){
  5579. _494+="?cv.id="+_484;
  5580. }
  5581. if(oCV==null){
  5582. _494=window.location.href.substring(0,window.location.href.indexOf("/v1"));
  5583. _494+="/?perspective=classicviewer";
  5584. _494+="&altDrillFlag=true";
  5585. _494+="&format="+sXmlEncode(_47c);
  5586. var _495=_486.getAttribute("name")+Date.now().toString();
  5587. _486.setAttribute("name",_495);
  5588. if(typeof (Storage)!=="undefined"){
  5589. localStorage.setItem(_495,_486.outerHTML);
  5590. _494+="&drillFormLabel="+_495;
  5591. }else{
  5592. console.log("Sorry! No Web Storage support...");
  5593. }
  5594. }
  5595. if(window.gViewerLogger){
  5596. window.gViewerLogger.log("Drill Specification",_487,"xml");
  5597. }
  5598. _486.target=_492;
  5599. newWindow=window.open(_494,_492);
  5600. }else{
  5601. appendReportHistoryObjects(oCV,_486);
  5602. if(window.gViewerLogger){
  5603. window.gViewerLogger.log("Drill Specification",_487,"xml");
  5604. }
  5605. _486.target=(oCV&&oCV.getDrillFormTarget)?oCV.getDrillFormTarget():"_self";
  5606. _486.submit();
  5607. if(oCV!=null&&!oCV.getDrillFormTarget){
  5608. setTimeout(getCognosViewerObjectRefAsString(oCV.getId())+".getRequestIndicator().show()",10);
  5609. }
  5610. }
  5611. }
  5612. }
  5613. }
  5614. }
  5615. };
  5616. function getExecutionParamNode(oCV){
  5617. var _497="";
  5618. if(typeof oCV!="undefined"&&oCV!=null){
  5619. var _498=oCV.getExecutionParameters();
  5620. if(_498!=""){
  5621. _497+="<param name=\"executionParameters\">";
  5622. _497+=sXmlEncode(_498);
  5623. _497+="</param>";
  5624. }
  5625. }
  5626. return _497;
  5627. };
  5628. function doSingleDrillThrough(_499,_49a,cvId){
  5629. var _49c=_499[0][0];
  5630. if(typeof _49c=="undefined"||_49c==null){
  5631. return;
  5632. }
  5633. var _49d=cvId&&window[cvId+"drillTargets"]?window[cvId+"drillTargets"][_49c]:drillTargets[_49c];
  5634. if(typeof _49d=="undefined"){
  5635. return;
  5636. }
  5637. if(_49a!=""&&_49d.getPath()==""){
  5638. document.location="#"+_49a;
  5639. }else{
  5640. var args=[];
  5641. args[args.length]=["ui.object",_49d.getPath()];
  5642. for(var _49f=1;_49f<_499.length;++_49f){
  5643. args[args.length]=_499[_49f];
  5644. }
  5645. var _4a0="";
  5646. if(_49d.getShowInNewWindow()=="true"){
  5647. _4a0="_blank";
  5648. }
  5649. var _4a1=_49d.getParameters();
  5650. var _4a2=_49d.getObjectPaths();
  5651. var _4a3=cvId;
  5652. if(!cvId){
  5653. _4a3=getCVId();
  5654. }
  5655. doSingleDrill(_4a0,args,_49d.getMethod(),_49d.getOutputFormat(),_49d.getOutputLocale(),_49a,_4a1,_4a2,_4a3,_49d.getPrompt(),false);
  5656. }
  5657. };
  5658. function getCVId(){
  5659. var _4a4="";
  5660. try{
  5661. _4a4=this.frameElement.id.substring("CVIFrame".length);
  5662. }
  5663. catch(exception){
  5664. }
  5665. return _4a4;
  5666. };
  5667. function doMultipleDrillThrough(_4a5,cvId){
  5668. var _4a7="<rvDrillTargets>";
  5669. for(var _4a8=0;_4a8<_4a5.length;++_4a8){
  5670. var _4a9=_4a5[_4a8];
  5671. if(_4a9.length<3){
  5672. continue;
  5673. }
  5674. var _4aa=_4a9[0];
  5675. if(typeof _4aa=="undefined"||_4aa==null){
  5676. continue;
  5677. }
  5678. var _4ab=_4a9[1];
  5679. if(typeof _4ab=="undefined"||_4ab==null){
  5680. continue;
  5681. }
  5682. var _4ac=cvId&&window[cvId+"drillTargets"]?window[cvId+"drillTargets"][_4aa]:drillTargets[_4aa];
  5683. if(typeof _4ac=="undefined"||_4ac==null){
  5684. continue;
  5685. }
  5686. if(_4ab===null||_4ab===""){
  5687. _4ab=_4ac.getLabel();
  5688. }
  5689. _4a7+="<drillTarget ";
  5690. _4a7+="outputFormat=\"";
  5691. _4a7+=_4ac.getOutputFormat();
  5692. _4a7+="\" ";
  5693. _4a7+="outputLocale=\"";
  5694. _4a7+=_4ac.getOutputLocale();
  5695. _4a7+="\" ";
  5696. _4a7+="label=\"";
  5697. _4a7+=sXmlEncode(_4ab);
  5698. _4a7+="\" ";
  5699. _4a7+="path=\"";
  5700. _4a7+=sXmlEncode(_4ac.getPath());
  5701. _4a7+="\" ";
  5702. _4a7+="showInNewWindow=\"";
  5703. _4a7+=_4ac.getShowInNewWindow();
  5704. _4a7+="\" ";
  5705. _4a7+="method=\"";
  5706. _4a7+=_4ac.getMethod();
  5707. _4a7+="\" ";
  5708. _4a7+="prompt=\"";
  5709. _4a7+=_4ac.getPrompt();
  5710. _4a7+="\" ";
  5711. _4a7+="dynamicDrill=\"";
  5712. _4a7+=_4ac.isDynamicDrillThrough();
  5713. _4a7+="\">";
  5714. for(var _4ad=2;_4ad<_4a9.length;++_4ad){
  5715. _4a7+=_4a9[_4ad];
  5716. }
  5717. _4a7+=_4ac.getParameters();
  5718. _4a7+=_4ac.getObjectPaths();
  5719. _4a7+="</drillTarget>";
  5720. }
  5721. _4a7+="</rvDrillTargets>";
  5722. if(!cvId){
  5723. cvId=getCVId();
  5724. }
  5725. doMultipleDrills(_4a7,cvId);
  5726. };
  5727. function CScriptLoader(_4ae){
  5728. this.m_oFiles={};
  5729. this.m_aScripts=[];
  5730. this.m_aDocumentWriters=[];
  5731. this.m_ajaxWarnings=[];
  5732. this.m_bIgnoreAjaxWarnings=false;
  5733. this.m_bHandleStylesheetLimit=false;
  5734. this.m_iInterval=20;
  5735. this.m_reFindCssPath=new RegExp("<link[^>]*href=\"([^\"]*)\"","i");
  5736. this.m_reFindInlineStyle=/<style\b(\s|.)*?<\/style>/gi;
  5737. this.m_reHasCss=/<link .*?>/gi;
  5738. this.m_reIsCss=/\.css$/i;
  5739. this.m_reIsJavascript=/\.js$/i;
  5740. this.m_reIsPromptingLocaleJavascript=/prompting.res.[promptingStrings|promptLocale].*\.js$/i;
  5741. this.m_reScriptTagClose=/\s*<\/script>.*?$/i;
  5742. this.m_reScriptTagOpen=/^.*?<script[^>]*>\s*/i;
  5743. this.m_reStyleTagClose=/(-|>|\s)*<\/style>\s*$/gi;
  5744. this.m_reStyleTagOpen=/^\s*<style[^>]*>(\s|<|!|-)*/gi;
  5745. this.m_reEscapedCharacters=/\\[\\"']/g;
  5746. this.m_reStringLiterals=/("|')[\s\S]*?\1/g;
  5747. this.m_sWebContentRoot=_4ae;
  5748. this.m_bHasCompletedExecution=false;
  5749. this.m_aScriptLoadQueue=[];
  5750. this.m_bBlockScriptLoading=false;
  5751. this.m_bUseScriptBlocking=false;
  5752. this.m_bBlockPromptingLocaleScripts=false;
  5753. this.m_aBlockedPromptingLocaleFileQueue=[];
  5754. };
  5755. CScriptLoader.prototype.hasCompletedExecution=function(){
  5756. return this.m_bHasCompletedExecution;
  5757. };
  5758. CScriptLoader.prototype.setHandlerStylesheetLimit=function(_4af){
  5759. this.m_bHandleStylesheetLimit=_4af;
  5760. };
  5761. CScriptLoader.prototype.executeScripts=function(_4b0,_4b1){
  5762. if(this.isReadyToExecute()){
  5763. for(var _4b2=0;_4b2<this.m_aScripts.length;_4b2++){
  5764. if(this.m_aScripts[_4b2]){
  5765. var _4b3=document.createElement("script");
  5766. _4b3.setAttribute("language","javascript");
  5767. _4b3.setAttribute("type","text/javascript");
  5768. this.addNamespaceAttribute(_4b3,_4b1);
  5769. _4b3.text=this.m_aScripts[_4b2];
  5770. document.getElementsByTagName("head").item(0).appendChild(_4b3);
  5771. }
  5772. }
  5773. this.m_aScripts=[];
  5774. for(var idx=0;idx<this.m_aDocumentWriters.length;++idx){
  5775. var _4b5=this.m_aDocumentWriters[idx];
  5776. _4b5.execute();
  5777. }
  5778. this.m_aDocumentWriters=[];
  5779. if(!this.m_aScripts.length&&!this.m_aDocumentWriters.length){
  5780. if(typeof _4b0=="function"){
  5781. _4b0();
  5782. }
  5783. this.m_bHasCompletedExecution=true;
  5784. }else{
  5785. setTimeout(function(){
  5786. window.gScriptLoader.executeScripts(_4b0,_4b1);
  5787. },this.m_iInterval);
  5788. }
  5789. }else{
  5790. setTimeout(function(){
  5791. window.gScriptLoader.executeScripts(_4b0,_4b1);
  5792. },this.m_iInterval);
  5793. }
  5794. };
  5795. CScriptLoader.prototype.isReadyToExecute=function(){
  5796. for(var _4b6 in this.m_oFiles){
  5797. if(this.m_oFiles[_4b6]!="complete"){
  5798. return false;
  5799. }
  5800. }
  5801. if(this.m_aScriptLoadQueue.length>0){
  5802. return false;
  5803. }
  5804. return true;
  5805. };
  5806. CScriptLoader.prototype.loadCSS=function(_4b7,_4b8,_4b9,_4ba){
  5807. var aM=_4b7.match(this.m_reHasCss);
  5808. if(aM){
  5809. for(var i=0;i<aM.length;i++){
  5810. if(aM[i].match(this.m_reFindCssPath)){
  5811. var _4bd=RegExp.$1;
  5812. if(_4bd.indexOf("GlobalReportStyles")!=-1){
  5813. this.validateGlobalReportStyles(_4bd);
  5814. if(_4b9){
  5815. if(_4bd.indexOf("GlobalReportStyles.css")!=-1){
  5816. _4bd=_4bd.replace("GlobalReportStyles.css","GlobalReportStyles_10.css");
  5817. }
  5818. var _4be=this.getGlobalReportStylesClassPrefix(_4bd);
  5819. _4bd=_4bd.replace(".css","_NS.css");
  5820. if(_4b8){
  5821. _4b8.className="buxReport "+_4be;
  5822. }
  5823. }
  5824. }
  5825. this.loadObject(_4bd,_4ba);
  5826. }
  5827. _4b7=_4b7.replace(aM[i],"");
  5828. }
  5829. }
  5830. return _4b7;
  5831. };
  5832. CScriptLoader.prototype.getGlobalReportStylesClassPrefix=function(_4bf){
  5833. var _4c0=null;
  5834. if(_4bf.indexOf("GlobalReportStyles_11.4.css")!=-1){
  5835. _4c0="v114";
  5836. }
  5837. if(_4bf.indexOf("GlobalReportStyles_11.css")!=-1){
  5838. _4c0="v11";
  5839. }
  5840. if(_4bf.indexOf("GlobalReportStyles_10.css")!=-1){
  5841. _4c0="v10";
  5842. }else{
  5843. if(_4bf.indexOf("GlobalReportStyles_1.css")!=-1){
  5844. _4c0="v1";
  5845. }else{
  5846. if(_4bf.indexOf("GlobalReportStyles_none.css")!=-1){
  5847. _4c0="vnone";
  5848. }else{
  5849. if(_4bf.indexOf("GlobalReportStyles.css")!=-1){
  5850. _4c0="v8";
  5851. }
  5852. }
  5853. }
  5854. }
  5855. return _4c0;
  5856. };
  5857. CScriptLoader.prototype.validateGlobalReportStyles=function(_4c1){
  5858. var _4c2=document.getElementsByTagName("link");
  5859. for(var i=0;i<_4c2.length;++i){
  5860. var _4c4=_4c2[i];
  5861. if(_4c4.getAttribute("href").indexOf("GlobalReportStyles")!=-1){
  5862. if(_4c4.getAttribute("href").toLowerCase()!=_4c1.toLowerCase()){
  5863. var _4c5=_4c1.split("/");
  5864. var _4c6=_4c4.getAttribute("href").split("/");
  5865. if(_4c5[_4c5.length-1]!=_4c6[_4c6.length-1]){
  5866. this.m_ajaxWarnings.push("Ajax response contains different versions of the GlobalReportStyles.css.");
  5867. }
  5868. }
  5869. break;
  5870. }
  5871. }
  5872. };
  5873. CScriptLoader.prototype.loadFile=function(_4c7,_4c8,_4c9){
  5874. var sURL="";
  5875. if(_4c7){
  5876. sURL=_4c7;
  5877. }
  5878. var _4cb=null;
  5879. if(typeof _4c8=="string"){
  5880. _4cb=_4c8;
  5881. }
  5882. var _4cc="POST";
  5883. if(_4c9=="GET"){
  5884. _4cc="GET";
  5885. }
  5886. var _4cd=null;
  5887. if(typeof ActiveXObject!="undefined"){
  5888. _4cd=new ActiveXObject("Msxml2.XMLHTTP");
  5889. }else{
  5890. _4cd=new XMLHttpRequest();
  5891. }
  5892. _4cd.open(_4cc,sURL,false);
  5893. _4cd.send(_4cb);
  5894. return _4cd.responseText;
  5895. };
  5896. function CScriptLoader_onReadyStateChange(){
  5897. if(typeof this.readyState=="undefined"){
  5898. this.readyState="complete";
  5899. }
  5900. if(this.readyState=="loaded"||this.readyState=="complete"){
  5901. var path=this.sFilePath;
  5902. if(!path&&this.getAttribute){
  5903. path=this.getAttribute("href");
  5904. }
  5905. window.gScriptLoader.setFileState(path,"complete");
  5906. window.gScriptLoader.m_bBlockScriptLoading=false;
  5907. if(this.sFilePath&&window.gScriptLoader.m_bBlockPromptingLocaleScripts&&this.sFilePath.match(window.gScriptLoader.m_reIsPromptingLocaleJavascript)){
  5908. window.gScriptLoader.m_bBlockPromptingLocaleScripts=false;
  5909. if(window.gScriptLoader.m_aBlockedPromptingLocaleFileQueue.length>0){
  5910. var _4cf=window.gScriptLoader.m_aBlockedPromptingLocaleFileQueue.shift();
  5911. window.gScriptLoader.loadObject(_4cf.sName,_4cf.sNamespaceId);
  5912. }
  5913. }
  5914. if(window.gScriptLoader.m_aScriptLoadQueue.length>0){
  5915. window.gScriptLoader.loadObject();
  5916. }
  5917. }
  5918. };
  5919. CScriptLoader.prototype.moveLinks=function(node){
  5920. if(!node){
  5921. return;
  5922. }
  5923. var _4d1=node.getAttribute("href");
  5924. if(!_4d1||this.m_oFiles[_4d1]){
  5925. return;
  5926. }
  5927. this.m_oFiles[_4d1]="complete";
  5928. document.getElementsByTagName("head").item(0).appendChild(node);
  5929. };
  5930. CScriptLoader.prototype.loadObject=function(_4d2,_4d3){
  5931. var _4d4=null;
  5932. if(typeof _4d2==="undefined"){
  5933. if(this.m_aScriptLoadQueue.length>0){
  5934. var _4d5=this.m_aScriptLoadQueue.shift();
  5935. _4d2=_4d5.name;
  5936. _4d3=_4d5.namespaceId;
  5937. }else{
  5938. return;
  5939. }
  5940. }
  5941. if(this.m_oFiles[_4d2]){
  5942. return;
  5943. }
  5944. if(this.m_bBlockScriptLoading){
  5945. this.m_aScriptLoadQueue.push({"name":_4d2,"namespaceId":_4d3});
  5946. }else{
  5947. if(_4d2.match(this.m_reIsCss)){
  5948. _4d4=document.createElement("link");
  5949. _4d4.setAttribute("rel","stylesheet");
  5950. _4d4.setAttribute("type","text/css");
  5951. _4d4.setAttribute("href",_4d2);
  5952. if(window.isIE&&window.isIE()){
  5953. _4d4.onreadystatechange=CScriptLoader_onReadyStateChange;
  5954. _4d4.onload=CScriptLoader_onReadyStateChange;
  5955. _4d4.onerror=CScriptLoader_onReadyStateChange;
  5956. this.m_oFiles[_4d2]="new";
  5957. }else{
  5958. this.m_oFiles[_4d2]="complete";
  5959. }
  5960. }else{
  5961. if(_4d2.match(this.m_reIsJavascript)){
  5962. if(_4d2.match(this.m_reIsPromptingLocaleJavascript)){
  5963. if(this.m_bBlockPromptingLocaleScripts){
  5964. this.m_aBlockedPromptingLocaleFileQueue.push({"sName":_4d2,"sNamespaceId":_4d3});
  5965. return;
  5966. }
  5967. this.m_bBlockPromptingLocaleScripts=true;
  5968. }
  5969. this.m_bBlockScriptLoading=this.m_bUseScriptBlocking;
  5970. _4d4=document.createElement("script");
  5971. _4d4.setAttribute("language","javascript");
  5972. _4d4.setAttribute("type","text/javascript");
  5973. _4d4.setAttribute("src",_4d2);
  5974. _4d4.sFilePath=_4d2;
  5975. _4d4.onreadystatechange=CScriptLoader_onReadyStateChange;
  5976. _4d4.onload=CScriptLoader_onReadyStateChange;
  5977. _4d4.onerror=CScriptLoader_onReadyStateChange;
  5978. this.addNamespaceAttribute(_4d4,_4d3);
  5979. this.m_oFiles[_4d2]="new";
  5980. }
  5981. }
  5982. if(_4d4){
  5983. document.getElementsByTagName("head").item(0).appendChild(_4d4);
  5984. }
  5985. }
  5986. };
  5987. CScriptLoader.prototype.loadScriptsFromDOM=function(_4d6,_4d7,_4d8){
  5988. if(!_4d6){
  5989. return;
  5990. }
  5991. var _4d9=_4d6.getElementsByTagName("script");
  5992. while(_4d9.length>0){
  5993. var _4da=_4d9[0];
  5994. if(_4da.getAttribute("src")!=null&&_4da.getAttribute("src").length>0){
  5995. this.loadObject(_4da.getAttribute("src"),_4d7);
  5996. }else{
  5997. var _4db=_4da.innerHTML;
  5998. var _4dc=false;
  5999. if(_4db.indexOf("document.write")!=-1){
  6000. var _4dd=_4db.replace(this.m_reEscapedCharacters,"").replace(this.m_reStringLiterals,"");
  6001. _4dc=(_4dd.indexOf("document.write")!=-1);
  6002. }
  6003. if(_4dc){
  6004. if(_4d8){
  6005. var sId="CVScriptFromDOMPlaceHolder"+_4d9.length+_4d7;
  6006. var _4df=_4da.ownerDocument.createElement("span");
  6007. _4df.setAttribute("id",sId);
  6008. _4da.parentNode.insertBefore(_4df,_4da);
  6009. this.m_aDocumentWriters.push(new CDocumentWriter(sId,_4db));
  6010. }
  6011. }else{
  6012. if(_4db.length>0){
  6013. this.m_aScripts.push(_4db);
  6014. }
  6015. }
  6016. }
  6017. _4da.parentNode.removeChild(_4da);
  6018. }
  6019. };
  6020. CScriptLoader.prototype.loadStyles=function(_4e0,_4e1){
  6021. if(!_4e0||!_4e0.parentNode){
  6022. return;
  6023. }
  6024. var _4e2=_4e0.parentNode.getElementsByTagName("style");
  6025. while(_4e2.length>0){
  6026. var _4e3=_4e2[0];
  6027. if(_4e1){
  6028. this.addNamespaceAttribute(_4e3,_4e1);
  6029. }
  6030. if(window.isIE&&window.isIE()&&window.getNavVer()<10){
  6031. if((document.getElementsByTagName("style").length+document.getElementsByTagName("link").length)>=30){
  6032. if(this.m_bHandleStylesheetLimit){
  6033. if(typeof window.gaRV_INSTANCES!="undefined"){
  6034. for(var i=0;i<window.gaRV_INSTANCES.length;i++){
  6035. window.gaRV_INSTANCES[i].cleanupStyles();
  6036. }
  6037. }
  6038. }
  6039. if((document.getElementsByTagName("style").length+document.getElementsByTagName("link").length)>=30){
  6040. if(typeof console!="undefined"&&console&&console.log){
  6041. console.log("Stylesheet limit reached.");
  6042. }
  6043. this.m_ajaxWarnings.push("Stylesheet limit reached.");
  6044. return;
  6045. }
  6046. }
  6047. }
  6048. document.getElementsByTagName("head").item(0).appendChild(_4e3);
  6049. }
  6050. };
  6051. CScriptLoader.prototype.loadAll=function(_4e5,_4e6,_4e7,_4e8){
  6052. this.m_bScriptLoaderCalled=true;
  6053. this.m_bHasCompletedExecution=false;
  6054. this.loadScriptsFromDOM(_4e5,_4e7,_4e8);
  6055. if(this.containsAjaxWarnings()){
  6056. return false;
  6057. }
  6058. this.loadStyles(_4e5,_4e7);
  6059. if(this.containsAjaxWarnings()){
  6060. return false;
  6061. }
  6062. this.executeScripts(_4e6,_4e7);
  6063. return true;
  6064. };
  6065. CScriptLoader.prototype.setFileState=function(_4e9,_4ea){
  6066. this.m_oFiles[_4e9]=_4ea;
  6067. };
  6068. CScriptLoader.prototype.containsAjaxWarnings=function(){
  6069. if(this.m_bIgnoreAjaxWarnings){
  6070. return false;
  6071. }else{
  6072. return (this.m_ajaxWarnings.length>0);
  6073. }
  6074. };
  6075. CScriptLoader.prototype.addNamespaceAttribute=function(_4eb,_4ec){
  6076. if(typeof _4ec==="string"){
  6077. _4eb.setAttribute("namespaceId",_4ec);
  6078. }
  6079. };
  6080. if(typeof window.gScriptLoader=="undefined"){
  6081. window.gScriptLoader=new CScriptLoader();
  6082. }
  6083. var InfoBarHelper={};
  6084. InfoBarHelper.getContainerId=function(oCV,_4ee){
  6085. var _4ef=oCV.getLayoutElement(_4ee);
  6086. var lid=_4ef.getAttribute("lid");
  6087. var _4f1=lid===null?"":lid;
  6088. _4f1=_4f1.replace(oCV.getViewerWidget().getViewerId(),"").replace("RAP_NDH_","");
  6089. return _4f1;
  6090. };
  6091. InfoBarHelper.infoBarRemoveFilter=function(_4f2,_4f3,_4f4,_4f5){
  6092. var oCV=eval("window.oCV"+_4f2);
  6093. if(typeof oCV!="undefined"){
  6094. var _4f7=this.getContainerId(oCV,_4f3);
  6095. oCV.executeAction("Filter",{type:"remove",id:_4f7,item:_4f4,details:_4f5});
  6096. }
  6097. };
  6098. InfoBarHelper.infoBarRemoveSlider=function(_4f8,_4f9){
  6099. var oCV=eval("window.oCV"+_4f8);
  6100. var _4fb={};
  6101. _4fb[_4f9]={blockedEvents:["*"]};
  6102. oCV.fireWidgetEvent("com.ibm.bux.widget.updateEventFilter",_4fb);
  6103. if(typeof oCV!="undefined"){
  6104. oCV.executeAction("UpdateDataFilter",{"filterPayload":"{ \"clientId\" :\""+_4f9+"\"}"});
  6105. }
  6106. };
  6107. InfoBarHelper.infoBarRemoveSort=function(_4fc,_4fd,_4fe,_4ff){
  6108. var oCV=eval("window.oCV"+_4fc);
  6109. if(typeof oCV!="undefined"){
  6110. var _501=this.getContainerId(oCV,_4fd);
  6111. if(_4ff=="true"){
  6112. oCV.executeAction("Sort",{order:"none",id:_501,item:_4fe,type:"label"});
  6113. }else{
  6114. oCV.executeAction("Sort",{order:"none",id:_501,item:_4fe});
  6115. }
  6116. }
  6117. };
  6118. dojo.provide("InfoBarBase");
  6119. dojo.declare("InfoBarBase",null,{constructor:function(_502){
  6120. this.m_cognosViewer=_502;
  6121. this.m_parameterValues=new CParameterValues();
  6122. var _503=XMLBuilderLoadXMLFromString(this.m_cognosViewer.getExecutionParameters());
  6123. if(_503.childNodes.length==1){
  6124. this.m_parameterValues.loadWithOptions(_503.childNodes[0],false);
  6125. }
  6126. this.m_parameterStringOperators=new CParameterValueStringOperators(RV_RES.IDS_JS_FILTER_BETWEEN,RV_RES.IDS_JS_FILTER_NOT_BETWEEN,RV_RES.IDS_JS_FILTER_LESS_THAN,RV_RES.IDS_JS_FILTER_GREATER_THAN,RV_RES.IDS_JS_INFOBAR_AND_TEXT,RV_RES.IDS_JS_FILTER_EXCLUDE);
  6127. this.c_SliderCheckboxParameterPrefix="BusinessInsight.";
  6128. this.m_containerInfo=null;
  6129. this.m_editableFilters=null;
  6130. this.m_editableSorts=null;
  6131. this.m_editableSliders=null;
  6132. this.m_id=null;
  6133. this.m_layoutIndex=null;
  6134. this.m_timingDetails=null;
  6135. },setContainerInfo:function(_504){
  6136. this.m_containerInfo=_504;
  6137. },setTimingDetails:function(_505){
  6138. this.m_timingDetails=_505;
  6139. },setEditableFilters:function(_506){
  6140. this.m_editableFilters=_506;
  6141. },setId:function(_507){
  6142. this.m_id=_507;
  6143. },getId:function(){
  6144. return this.m_id;
  6145. },hasPrompts:function(){
  6146. var _508=this.m_parameterValues.length();
  6147. for(var _509=0;_509<_508;++_509){
  6148. var _50a=this.m_parameterValues.getAt(_509);
  6149. if(_50a!==null&&_50a.length()>0&&_50a.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
  6150. return true;
  6151. }
  6152. }
  6153. return false;
  6154. },addPromptDetails:function(_50b){
  6155. var _50c="";
  6156. var _50d=(_50b!==true);
  6157. if(this.hasPrompts()){
  6158. var _50e=this.m_id+"instructions "+this.m_id+"_promptString "+this.m_id+"_lockedString ";
  6159. for(var _50f=0,_510=this.m_parameterValues.length();_50f<_510;++_50f){
  6160. var _511=_50e+this.m_id+_50f+"_promptDetail";
  6161. var _512=this.m_parameterValues.getAt(_50f);
  6162. var _513=_512.length();
  6163. if(_512!==null&&_513>0&&_512.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
  6164. _50c+="<div class=\"infoBarDetailRow\" aria-labelledby=\""+_511+"\" role=\"listitem\""+(!_50d?">":" tabindex=\"-1\">");
  6165. _50c+="<table role=\"presentation\"><tr>";
  6166. _50c+=this.addInfoBarIcon("infobar_filter.gif",true);
  6167. _50c+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_50f+"_promptDetail\">";
  6168. _50c+="<span class=\"bibi\">";
  6169. _50c+=html_encode(_512.name());
  6170. _50c+="</span>";
  6171. _50c+=" : ";
  6172. _50c+=_512.toString(this.m_parameterStringOperators);
  6173. _50c+="</td>";
  6174. _50c+=(_50d?this.addInfoBarIcon("infobar_locked.gif",false):"");
  6175. _50c+="</tr></table></div>";
  6176. }
  6177. }
  6178. }
  6179. return _50c;
  6180. },getPromptDetailsInJSON:function(){
  6181. var _514=[];
  6182. if(this.hasPrompts()){
  6183. for(var _515=0,_516=this.m_parameterValues.length();_515<_516;++_515){
  6184. var _517=this.m_parameterValues.getAt(_515);
  6185. var _518=_517.length();
  6186. if(_517!==null&&_518>0&&_517.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
  6187. _514.push({"type":"prompt","label":_517.name(),"description":_517.toString(this.m_parameterStringOperators)});
  6188. }
  6189. }
  6190. }
  6191. return _514;
  6192. },addSliderDetails:function(_519){
  6193. var _51a="";
  6194. var _51b=(_519!==true);
  6195. if(this.m_containerInfo!==null&&this.m_editableSliders){
  6196. var _51c=this.m_id+"instructions "+this.m_id+"_sliderString ";
  6197. var _51d=this.m_editableSliders.length;
  6198. for(var _51e=0;_51e<_51d;++_51e){
  6199. var _51f=_51c+this.m_id+_51e+"_sliderDetail";
  6200. var _520=this.m_editableSliders[_51e];
  6201. if(_520&&_520.name){
  6202. _51a+="<div class=\"infoBarDetailRow\" type=\"slider\" aria-labelledby=\""+_51f+"\" role=\"listitem\""+(!_51b?">":" tabindex=\"-1\">");
  6203. _51a+="<table role=\"presentation\"><tr>";
  6204. if(typeof _520.controlType!="undefined"&&_520.controlType=="checkbox"){
  6205. _51a+=this.addInfoBarIcon("infobar_select.gif",true);
  6206. }else{
  6207. _51a+=this.addInfoBarIcon("infobar_slider.gif",true);
  6208. }
  6209. _51a+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_51e+"_sliderDetail\">";
  6210. _51a+="<span class=\"bibi\">";
  6211. _51a+=(_520.label?_520.label:_520.name);
  6212. _51a+=(_520.attributeName)?(" - "+_520.attributeName):"";
  6213. _51a+="</span>";
  6214. _51a+=" : ";
  6215. if(typeof _520.values!="undefined"){
  6216. _51a+=this.processFilterOperatorItems(_520.values);
  6217. }else{
  6218. if(_520.min==_520.max){
  6219. _51a+=_520.min;
  6220. }else{
  6221. _51a+=this.processFilterOperatorRange(RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT,_520.min,_520.max);
  6222. }
  6223. }
  6224. _51a+="</td>";
  6225. _51a+=(_51b?this.addRemoveSliderButton(_520.clientId):"");
  6226. _51a+="</tr></table></div>";
  6227. }
  6228. }
  6229. }
  6230. return _51a;
  6231. },getSliderDetailsInJSON:function(){
  6232. var _521=[];
  6233. if(this.m_containerInfo!==null&&this.m_editableSliders){
  6234. var _522=this.m_id+"instructions "+this.m_id+"_sliderString ";
  6235. var _523=this.m_editableSliders.length;
  6236. for(var _524=0;_524<_523;++_524){
  6237. var _525=this.m_editableSliders[_524];
  6238. if(_525&&_525.name){
  6239. var _526=(_525.label?_525.label:_525.name);
  6240. if(_525.attributeName){
  6241. _526+=(" "+_525.attributeName);
  6242. }
  6243. var _527="";
  6244. if(typeof _525.values!="undefined"){
  6245. _527+=this.processFilterOperatorItems(_525.values);
  6246. }else{
  6247. if(_525.min==_525.max){
  6248. _527+=_525.min;
  6249. }else{
  6250. _527+=this.processFilterOperatorRange(RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT,_525.min,_525.max);
  6251. }
  6252. }
  6253. _521.push({"type":"slider","label":_526,"description":_527});
  6254. }
  6255. }
  6256. }
  6257. return _521;
  6258. },hasLockedFilters:function(){
  6259. var _528=false;
  6260. if(this.m_containerInfo!==null&&typeof this.m_containerInfo.lockedFilters!=="undefined"){
  6261. var _529=this.m_containerInfo.lockedFilters.length;
  6262. for(var _52a=0;_52a<_529;++_52a){
  6263. var _52b=this.m_containerInfo.lockedFilters[_52a];
  6264. if(typeof _52b.staticText!="undefined"&&_52b.staticText.charAt(0)!==" "){
  6265. _528=true;
  6266. }
  6267. }
  6268. }
  6269. return _528;
  6270. },addLockedFilterDetails:function(_52c){
  6271. var _52d="";
  6272. var _52e=(_52c!==true);
  6273. if(this.m_containerInfo!==null&&typeof this.m_containerInfo.lockedFilters!=="undefined"){
  6274. var _52f=this.m_id+"instructions "+this.m_id+"_filterString "+this.m_id+"_lockedString ";
  6275. var _530=this.m_containerInfo.lockedFilters.length;
  6276. for(var _531=0;_531<_530;++_531){
  6277. var _532=_52f+this.m_id+_531+"_lockedFilterDetail";
  6278. var _533=this.m_containerInfo.lockedFilters[_531];
  6279. if(typeof _533.staticText!="undefined"&&_533.staticText.charAt(0)!==" "){
  6280. _52d+="<div class=\"infoBarDetailRow\" aria-labelledby=\""+_532+"\" role=\"listitem\""+(!_52e?">":" tabindex=\"-1\">");
  6281. _52d+="<table role=\"presentation\"><tr>";
  6282. _52d+=this.addInfoBarIcon("infobar_filter.gif",true);
  6283. _52d+="</td>";
  6284. _52d+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_531+"_lockedFilterDetail\">";
  6285. _52d+="<span class=\"bibi\">";
  6286. _52d+=html_encode(_533.staticText);
  6287. _52d+="</span>";
  6288. _52d+="</td>";
  6289. _52d+=(_52e?this.addInfoBarIcon("infobar_locked.gif",false):"");
  6290. _52d+="</tr></table></div>";
  6291. }
  6292. }
  6293. }
  6294. return _52d;
  6295. },addFilteredItemsDetails:function(_534){
  6296. var _535="";
  6297. var _536=(_534!==true);
  6298. if(this.m_editableFilters){
  6299. for(var _537=0,_538=this.m_editableFilters.length;_537<_538;++_537){
  6300. var _539=this.m_editableFilters[_537];
  6301. var _53a=this.m_id+"instructions "+this.m_id+"_filterString "+this.m_id+_537+"_filterDetail";
  6302. var _53b=(typeof _539.itemLabel=="string")?_539.itemLabel:_539.item;
  6303. _535+="<div class=\"infoBarDetailRow\" type=\"filter\" aria-labelledby=\""+_53a+"\" role=\"listitem\""+(!_536?">":" tabindex=\"-1\">");
  6304. _535+="<table role=\"presentation\"><tr>";
  6305. _535+=this.addInfoBarIcon("infobar_filter.gif",true);
  6306. _535+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_537+"_filterDetail\">";
  6307. _535+=this.createHiddenSpan(this.m_id+_537+"_filterPosition",getCurrentPosistionString(this.m_cognosViewer,_537+1,_538));
  6308. _535+=html_encode(enforceTextDir(_53b));
  6309. _535+=this.processFilterOperator(_539);
  6310. _535+="</td>";
  6311. _535+=(_536?this.addRemoveFilterButton(_539.item,this.processFilterDetails(_539)):"");
  6312. _535+="</tr></table></div>";
  6313. }
  6314. }
  6315. return _535;
  6316. },getFilteredItemsDetailsInJSON:function(){
  6317. var _53c=[];
  6318. if(this.m_editableFilters){
  6319. for(var _53d=0,_53e=this.m_editableFilters.length;_53d<_53e;++_53d){
  6320. var _53f=this.m_editableFilters[_53d];
  6321. var _540=(typeof _53f.itemLabel=="string")?_53f.itemLabel:_53f.item;
  6322. _53c.push({"type":"filter","label":enforceTextDir(_540)+this.processFilterOperator(_53f),"description":""});
  6323. }
  6324. }
  6325. return _53c;
  6326. },addSortDetails:function(_541){
  6327. var _542="";
  6328. var _543=(_541!==true);
  6329. if(this.m_editableSorts){
  6330. for(var _544=0,_545=this.m_editableSorts.length;_544<_545;++_544){
  6331. var _546=this.m_editableSorts[_544];
  6332. var _547=this.m_id+"instructions "+this.m_id+"_sortString "+this.m_id+_544+"_sortDetail";
  6333. _542+="<div class=\"infoBarDetailRow\" type=\"sort\" aria-labelledby=\""+_547+"\" role=\"listitem\""+(!_543?">":" tabindex=\"-1\">");
  6334. _542+="<table role=\"presentation\"><tr>";
  6335. _542+=this.addInfoBarIcon("infobar_sort.gif",true);
  6336. var _548;
  6337. if(typeof _546.labels=="string"||typeof _546.valuesOf=="string"){
  6338. var _549=(typeof _546.labels=="string")?_546.labels:_546.valuesOf;
  6339. _548=(typeof _546.itemLabel=="string")?_546.itemLabel:_549;
  6340. _542+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_544+"_sortDetail\">";
  6341. _542+=this.createHiddenSpan(this.m_id+_544+"_sortPosition",getCurrentPosistionString(this.m_cognosViewer,_544+1,_545));
  6342. _542+=html_encode(_548);
  6343. _542+=" : ";
  6344. if(_546.byItems instanceof Array){
  6345. for(var _54a=0;_54a<_546.byItems.length;++_54a){
  6346. _542+=(_54a>0)?" - ":"";
  6347. _542+=_546.byItems[_54a].item;
  6348. _542+=", ";
  6349. _542+=this.m_sortStrings[_546.byItems[_54a].order];
  6350. }
  6351. }else{
  6352. if(typeof _546.valuesOf=="string"){
  6353. _542+=this.m_sortStrings["byValue"];
  6354. }else{
  6355. _542+=this.m_sortStrings["byLabel"];
  6356. }
  6357. _542+=", ";
  6358. _542+=this.m_sortStrings[_546.order];
  6359. }
  6360. _542+="</td>";
  6361. _542+=(_543?this.addRemoveSortButton(_549,"true"):"");
  6362. }else{
  6363. if(_546.valuesOf instanceof Array){
  6364. if(_546.valuesOf.length>0&&typeof _546.valuesOf[0].item=="string"){
  6365. _542+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_544+"_sortDetail\">";
  6366. _542+=this.createHiddenSpan(this.m_id+_544+"_sortPosition",getCurrentPosistionString(this.m_cognosViewer,_544+1,_545));
  6367. _548="";
  6368. if(typeof _546.itemLabel=="string"){
  6369. _548=_546.itemLabel;
  6370. }else{
  6371. for(var _54b=0;_54b<_546.valuesOf.length;++_54b){
  6372. _548+=" - ";
  6373. _548+=_546.valuesOf[_54b].item;
  6374. }
  6375. _548=_548.substring(3);
  6376. }
  6377. _542+=_548;
  6378. _542+=" : ";
  6379. _542+=this.m_sortStrings["byValue"];
  6380. _542+=", ";
  6381. _542+=this.m_sortStrings[_546.order];
  6382. _542+="</td>";
  6383. _542+=(_543?this.addRemoveSortButton(_546.valuesOf[0].item,"false"):"");
  6384. }
  6385. }
  6386. }
  6387. _542+="</tr></table></div>";
  6388. }
  6389. }
  6390. return _542;
  6391. },addInfoBarIcon:function(_54c,_54d){
  6392. return "<td class=\"infoBar"+(_54d?"Left":"Right")+"Icon\">"+"<img alt=\"\" src=\""+this.m_cognosViewer.getWebContentRoot()+"/rv/images/"+_54c+"\"/>"+"</td>";
  6393. },createHiddenSpan:function(id,text){
  6394. return "<span style=\"display:none\" id=\""+id+"\"> "+text+" </span>";
  6395. },addRemoveFilterButton:function(item,_551){
  6396. var _552="";
  6397. var _553=this.m_cognosViewer.getViewerWidget();
  6398. if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!_553.isConsumeUser()){
  6399. var _554=RV_RES.IDS_JS_DELETE;
  6400. var _555=this.m_id+"_delete";
  6401. _552="<td class=\"infoBarRightIcon\" filterItem=\""+item+"\""+(_551?" details=\""+_551+"\"":"")+">"+"<button class=\"dijitStretch infoBarDeleteButton BUXNoPrint\" onclick=\"InfoBarHelper.infoBarRemoveFilter('"+this.m_cognosViewer.getId()+"',"+this.m_layoutIndex+",'"+item+"'"+(_551?",'"+_551+"'":"")+");\" aria-labelledby=\""+_555+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_554+"\">"+"<span class=\"dijitInline infoBarIconDelete\" title=\""+_554+"\"></span>"+"<span class=\"dijitInline dijitDisplayNone infoBarDeleteButtonText\">x</span>"+"</button>"+"</td>";
  6402. }
  6403. return _552;
  6404. },addRemoveSliderButton:function(_556){
  6405. var _557="";
  6406. var _558=this.m_cognosViewer.getViewerWidget();
  6407. if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!_558.isConsumeUser()){
  6408. var _559=RV_RES.IDS_JS_DELETE;
  6409. var _55a=this.m_id+"_delete";
  6410. _557="<td class=\"infoBarRightIcon\" slider=\""+_556+"\">"+"<button class=\"dijitStretch infoBarDeleteButton BUXNoPrint\" onclick=\"InfoBarHelper.infoBarRemoveSlider('"+this.m_cognosViewer.getId()+"','"+_556+"');\" aria-labelledby=\""+_55a+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_559+"\">"+"<span class=\"dijitInline infoBarIconDelete\" title=\""+_559+"\"></span>"+"<span class=\"dijitInline dijitDisplayNone infoBarDeleteButtonText\">x</span>"+"</button>"+"</td>";
  6411. }
  6412. return _557;
  6413. },addRemoveSortButton:function(item,_55c){
  6414. var _55d="";
  6415. var _55e=this.m_cognosViewer.getViewerWidget();
  6416. if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!this.m_cognosViewer.isBlacklisted("Sort")){
  6417. var _55f=RV_RES.IDS_JS_DELETE;
  6418. var _560=this.m_id+"_delete";
  6419. _55d="<td class=\"infoBarRightIcon\" sortItem=\""+item+"\" byLabel=\""+_55c+"\">"+"<button class=\"dijitStretch infoBarDeleteButton BUXNoPrint\" onclick=\"InfoBarHelper.infoBarRemoveSort('"+this.m_cognosViewer.getId()+"',"+this.m_layoutIndex+",'"+item+"','"+_55c+"');\" aria-labelledby=\""+_560+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_55f+"\">"+"<span class=\"dijitInline infoBarIconDelete\" title=\""+_55f+"\"></span>"+"<span class=\"dijitInline dijitDisplayNone infoBarDeleteButtonText\">x</span>"+"</button>"+"</td>";
  6420. }
  6421. return _55d;
  6422. },processFilterOperator:function(_561){
  6423. var _562="";
  6424. if(typeof _561["in"]!="undefined"){
  6425. _562+=" "+CViewerCommon.getMessage(RV_RES.IDS_JS_INFOBAR_INCLUDE_TEXT,this.processFilterOperatorItems(_561["in"]));
  6426. }else{
  6427. if(typeof _561["notIn"]!="undefined"){
  6428. _562+=" "+CViewerCommon.getMessage(RV_RES.IDS_JS_INFOBAR_EXCLUDE_TEXT,this.processFilterOperatorItems(_561["notIn"]));
  6429. }else{
  6430. if(typeof _561["range"]!="undefined"||typeof _561["notRange"]!="undefined"){
  6431. var _563=typeof _561["range"]!="undefined"?RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT:RV_RES.IDS_JS_INFOBAR_NOT_BETWEEN_TEXT;
  6432. var _564=typeof _561["range"]!="undefined"?_561["range"]:_561["notRange"];
  6433. for(var _565=0;_565<_564.length;++_565){
  6434. var _566=_564[_565];
  6435. _562+=" "+CViewerCommon.getMessage(_563,[_566.from,_566.to]);
  6436. }
  6437. }else{
  6438. if(typeof _561["lessThan"]!="undefined"){
  6439. _562+=" "+RV_RES.IDS_JS_FILTER_LESS_THAN+" "+_561["lessThan"];
  6440. }else{
  6441. if(typeof _561["lessThanEqual"]!="undefined"){
  6442. _562+=" "+RV_RES.IDS_JS_FILTER_LESS_THAN_EQUAL+" "+_561["lessThanEqual"];
  6443. }else{
  6444. if(typeof _561["greaterThan"]!="undefined"){
  6445. _562+=" "+RV_RES.IDS_JS_FILTER_GREATER_THAN+" "+_561["greaterThan"];
  6446. }else{
  6447. if(typeof _561["greaterThanEqual"]!="undefined"){
  6448. _562+=" "+RV_RES.IDS_JS_FILTER_GREATER_THAN_EQUAL+" "+_561["greaterThanEqual"];
  6449. }else{
  6450. if(typeof _561["not"]!="undefined"&&_561["not"]=="true"){
  6451. _562+=" "+RV_RES.IDS_JS_FILTER_IS_NOT;
  6452. }
  6453. if(typeof _561["endsWith"]!="undefined"){
  6454. _562+=" "+RV_RES.IDS_JS_FILTER_ENDS_WITH+" "+_561["endsWith"];
  6455. }else{
  6456. if(typeof _561["beginsWith"]!="undefined"){
  6457. _562+=" "+RV_RES.IDS_JS_FILTER_BEGINS_WITH+" "+_561["beginsWith"];
  6458. }else{
  6459. if(typeof _561["contains"]!="undefined"){
  6460. _562+=" "+RV_RES.IDS_JS_FILTER_CONTAINS+" "+_561["contains"];
  6461. }else{
  6462. if(typeof _561["isMatchesSQLPatternFilter"]!="undefined"){
  6463. _562+=" "+RV_RES.IDS_JS_FILTER_IS_MATCHES_SQLPATTERNFILTER+" "+_561["isMatchesSQLPatternFilter"];
  6464. }
  6465. }
  6466. }
  6467. }
  6468. }
  6469. }
  6470. }
  6471. }
  6472. }
  6473. }
  6474. }
  6475. return _562;
  6476. },processFilterDetails:function(_567){
  6477. return html_encode("["+dojo.toJson(_567)+"]");
  6478. },processFilterOperatorItems:function(_568){
  6479. var _569="";
  6480. for(var _56a=0;_56a<_568.length;++_56a){
  6481. if(_56a!==0){
  6482. _569+=(RV_RES.IDS_JS_LIST_SEPARATOR+" ");
  6483. }
  6484. _569+=enforceTextDir(_568[_56a]);
  6485. }
  6486. return _569;
  6487. },processFilterOperatorRange:function(_56b,_56c,_56d){
  6488. if(typeof _56c=="undefined"){
  6489. _56c=" ";
  6490. }
  6491. if(typeof _56d=="undefined"){
  6492. _56d=" ";
  6493. }
  6494. return CViewerCommon.getMessage(_56b,[_56c,_56d]);
  6495. }});
  6496. dojo.declare("InfoBar",InfoBarBase,{constructor:function(_56e,_56f,_570,_571,_572){
  6497. this.m_layoutElement=_56f;
  6498. this.m_containerInfo=_570;
  6499. this.m_bRendered=false;
  6500. this.initializeEditableSorts(_571);
  6501. this.initializeEditableFilters(_571);
  6502. this.initializeEditableSliders(_571);
  6503. this.m_id=_572+_56e.getId();
  6504. this.m_layoutIndex=_572;
  6505. this.m_sortStrings={byLabel:RV_RES.IDS_JS_SORTED_BY_LABEL,byValue:RV_RES.IDS_JS_SORTED_BY_VALUE,descending:RV_RES.IDS_JS_SORT_DESCENDING_ORDER,ascending:RV_RES.IDS_JS_SORT_ASCENDING_ORDER};
  6506. this.connections=[];
  6507. },getLayoutElement:function(){
  6508. var _573=this.m_layoutElement;
  6509. var _574=_573.getAttribute("lid");
  6510. if(_574==null){
  6511. _574=_573.getAttribute("pflid");
  6512. }
  6513. if(_574!==null){
  6514. if(_573.tagName.toUpperCase()=="MAP"){
  6515. var _575=_573.parentNode.childNodes;
  6516. for(var _576=0;_576<_575.length;++_576){
  6517. var _577=_575[_576].getAttribute("usemap");
  6518. if(_577!==null&&_577==("#"+this.m_cognosViewer.getId()+_574)){
  6519. return _575[_576];
  6520. }
  6521. }
  6522. }else{
  6523. if(_573.parentNode.getAttribute("chartcontainer")=="true"){
  6524. return _573.parentNode;
  6525. }
  6526. }
  6527. return _573;
  6528. }
  6529. return null;
  6530. },initializeEditableSorts:function(_578){
  6531. if(this.m_containerInfo!==null){
  6532. if(typeof this.m_containerInfo.sort!=="undefined"){
  6533. this.m_editableSorts=this.m_containerInfo.sort;
  6534. }
  6535. if(typeof _578!=="undefined"){
  6536. for(var i=0;i<_578.length;++i){
  6537. this.m_editableSorts=this.mergeChildInfo(this.m_editableSorts,_578[i].sort,"labels");
  6538. this.m_editableSorts=this.mergeChildInfo(this.m_editableSorts,_578[i].sort,"valuesOf");
  6539. }
  6540. }
  6541. }
  6542. },initializeEditableFilters:function(_57a){
  6543. if(typeof this.m_containerInfo!=="undefined"&&this.m_containerInfo!==null){
  6544. if(typeof this.m_containerInfo.filter!=="undefined"){
  6545. this.m_editableFilters=this.m_containerInfo.filter;
  6546. }
  6547. if(typeof _57a!=="undefined"){
  6548. for(var i=0;i<_57a.length;++i){
  6549. this.m_editableFilters=this.mergeChildInfo(this.m_editableFilters,_57a[i].filter,"item");
  6550. }
  6551. }
  6552. }
  6553. },initializeEditableSliders:function(_57c){
  6554. if(typeof this.m_containerInfo!=="undefined"&&this.m_containerInfo!==null){
  6555. if(typeof this.m_containerInfo.sliders!=="undefined"){
  6556. this.m_editableSliders=this.m_containerInfo.sliders;
  6557. }
  6558. if(typeof _57c!=="undefined"){
  6559. for(var i=0;i<_57c.length;++i){
  6560. this.m_editableSliders=this.mergeChildInfo(this.m_editableSliders,_57c[i].sliders,"name");
  6561. }
  6562. }
  6563. }
  6564. },mergeChildInfo:function(_57e,_57f,key){
  6565. if(typeof _57f!="undefined"){
  6566. if(typeof _57e==="undefined"||_57e===null){
  6567. _57e=_57f;
  6568. }else{
  6569. var _581=[];
  6570. for(var i=0;i<_57e.length;++i){
  6571. _581[_57e[i][key]]=_57e[i];
  6572. }
  6573. for(var j=0;j<_57f.length;++j){
  6574. var _584=_57f[j];
  6575. if(typeof _581[_584[key]]=="undefined"){
  6576. _57e.push(_584);
  6577. _581[_584.item]=_584;
  6578. }
  6579. }
  6580. }
  6581. }
  6582. return _57e;
  6583. },hasSomethingRendered:function(){
  6584. return this.m_bRendered;
  6585. },render:function(){
  6586. var _585=document.getElementById("infoBar"+this.m_id);
  6587. if(_585===null){
  6588. var _586=(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton")?true:false;
  6589. if(_586&&!this.m_editableFilters&&!this.m_editableSliders){
  6590. return;
  6591. }
  6592. if(this.m_timingDetails||this.m_editableSorts||this.m_editableFilters||this.m_editableSliders||this.hasPrompts()||this.hasLockedFilters()){
  6593. var _587=this.getLayoutElement();
  6594. var _588=document.createElement("div");
  6595. _588.setAttribute("dir",this.m_cognosViewer.getDirection()==="rtl"?"rtl":"ltr");
  6596. _585=document.createElement("div");
  6597. _585.className="infoBar";
  6598. _585.setAttribute("id","infoBar"+this.m_id);
  6599. _585.setAttribute("cvid",this.m_cognosViewer.getId());
  6600. _585.setAttribute("layoutid",this.m_id);
  6601. _585.setAttribute("containerid",this.m_layoutIndex);
  6602. _585.setAttribute("role","region");
  6603. _585.setAttribute("aria-label",RV_RES.IDS_JS_REPORT_INFO_TITLE);
  6604. if(_586){
  6605. dojo.style(_585,{opacity:"0.6"});
  6606. }
  6607. _585.appendChild(this.renderHeader());
  6608. _585.appendChild(this.renderDetails());
  6609. _588.appendChild(_585);
  6610. _587.parentNode.insertBefore(_588,_587);
  6611. this.connections.push(dojo.connect(_585,"onkeydown",this,this.onKeyDown));
  6612. this.connections.push(dojo.query(".infoBarHeader",_585).connect("onmousedown",this,this.toggle));
  6613. this.connections.push(dojo.query(".infoBarLeftIcon",_585).connect("onmousedown",this,this.ignoreEvent));
  6614. this.connections.push(dojo.query(".infoBarDetailsText",_585).connect("onmousedown",this,this.ignoreEvent));
  6615. this.connections.push(dojo.query(".infoBarLockedItems",_585).connect("onmousedown",this,this.ignoreEvent));
  6616. this.m_bRendered=true;
  6617. if(this.wasInfoBarExpanded(this.m_id)){
  6618. this.show();
  6619. }
  6620. }
  6621. }
  6622. },renderHeader:function(){
  6623. var _589=this.isFilterApplied();
  6624. var _58a=this.isSortApplied();
  6625. var _58b=document.createElement("div");
  6626. _58b.id="infoBarHeader"+this.m_id;
  6627. _58b.className="infoBarHeaderDiv";
  6628. var _58c="<div role=\"presentation\" class=\"infoBarHeader BUXNoPrint\" style=\"width:100%\">"+this.addHeaderCloseButton()+this.addHeaderNavigationButton(_589,_58a)+this.addHeaderText(_589,_58a)+"</div>";
  6629. _58b.innerHTML=_58c;
  6630. return _58b;
  6631. },addHeaderNavigationButton:function(_58d,_58e){
  6632. var _58f=RV_RES.IDS_JS_INFOBAR_EXPAND;
  6633. var _590="infoBarIcon"+(_58d?"Filter":"")+(_58e?"Sort":"")+"Applied";
  6634. var _591="infoBarHeaderButton"+this.m_id+" infoBarHeaderText"+this.m_id;
  6635. return "<button class=\"dijitStretch infoBarHeaderButton\" id=\"infoBarHeaderButton"+this.m_id+"\" aria-labelledby=\""+_591+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_58f+"\">"+"<span class=\"dijitInline "+_590+"\" title=\""+_58f+"\"></span>"+"<span class=\"dijitInline dijitDisplayNone infoBarHeaderButtonText\">!</span>"+"</button>";
  6636. },addHeaderText:function(_592,_593){
  6637. var _594=[];
  6638. if(_592){
  6639. _594.push(RV_RES.IDS_JS_FILTER_APPLIED);
  6640. }
  6641. if(_593){
  6642. _594.push(RV_RES.IDS_JS_SORT_APPLIED);
  6643. }
  6644. return "<span class=\"infoBarHeaderText\" id=\"infoBarHeaderText"+this.m_id+"\">"+_594.join(", ")+"</span>";
  6645. },addHeaderCloseButton:function(){
  6646. var _595=RV_RES.IDS_JS_INFOBAR_COLLAPSE;
  6647. var _596=this.m_id+"_collapse";
  6648. return "<button class=\"dijitStretch infoBarHeaderCloseButton\" id=\"infoBarHeaderCloseButton"+this.m_id+"\" aria-labelledby=\""+_596+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_595+"\">"+"<span class=\"dijitInline infoBarIconClose BUXNoPrint\" title=\""+_595+"\"></span>"+"<span class=\"dijitInline dijitDisplayNone infoBarCloseButtonText\">x</span>"+"</button>";
  6649. },isFilterApplied:function(){
  6650. if(this.m_editableFilters||this.m_editableSliders||typeof this.m_containerInfo.lockedFilters!=="undefined"||this.hasPrompts()){
  6651. return true;
  6652. }
  6653. return false;
  6654. },isSortApplied:function(){
  6655. if(this.m_editableSorts){
  6656. return true;
  6657. }
  6658. return false;
  6659. },renderDetails:function(){
  6660. var _597=document.getElementById("infoBarFlyout"+this.m_id);
  6661. var _598=document.getElementById(this.m_id+"instructions");
  6662. if(_597===null){
  6663. this.getLayoutElement();
  6664. _597=document.createElement("div");
  6665. _597.setAttribute("id","infoBarFlyout"+this.m_id);
  6666. _597.setAttribute("cvid",this.m_cognosViewer.getId());
  6667. _597.setAttribute("layoutid",this.m_id);
  6668. _597.setAttribute("containerid",this.m_layoutIndex);
  6669. _597.className="infoBarFlyout";
  6670. _597.style.display="none";
  6671. _597.innerHTML="<div class=\"infoBarFlyoutContent\" id=\"infoBarFlyoutContent"+this.m_id+"\" role=\"list\">"+this.addLockedInfoBarDetails()+this.addEditableInfoBarDetails()+this.addRAPTimingDetails()+"</div>"+this.createHiddenSpan(this.m_id+"_filterString",RV_RES.IDS_JS_FILTER)+this.createHiddenSpan(this.m_id+"_sortString",RV_RES.IDS_JS_SORT)+this.createHiddenSpan(this.m_id+"_promptString",RV_RES.IDS_JS_INFOBAR_PROMPT)+this.createHiddenSpan(this.m_id+"_sliderString",RV_RES.IDS_JS_INFOBAR_SLIDER)+this.createHiddenSpan(this.m_id+"_lockedString",RV_RES.IDS_JS_INFOBAR_LOCKED)+this.createHiddenSpan(this.m_id+"_collapse",RV_RES.IDS_JS_INFOBAR_COLLAPSE)+this.createHiddenSpan(this.m_id+"_delete",RV_RES.IDS_JS_DELETE);
  6672. this.connections.push(dojo.connect(_597,"onkeydown",this,this.onKeyDown));
  6673. this.connections.push(dojo.query(".infoBarDetailRow",_597).forEach(function(item,_59a,_59b){
  6674. dojo.attr(item,{"aria-setsize":_59b.length,"aria-posinset":_59a+1});
  6675. }).connect("onfocus",function(e){
  6676. dojo.query(e.currentTarget).addClass("infoBarDetailRowHover");
  6677. }).connect("onblur",function(e){
  6678. var el=typeof e.explicitOriginalTarget!=="undefined"?e.explicitOriginalTarget:document.activeElement;
  6679. if(dojo.hasClass(el,"infoBarDeleteButton")){
  6680. return true;
  6681. }
  6682. dojo.query(e.currentTarget).removeClass("infoBarDetailRowHover");
  6683. }).connect("onmouseover",this,function(e){
  6684. this.focusDetailRow(e.currentTarget);
  6685. }));
  6686. }
  6687. if(_598===null){
  6688. _598=document.createElement("span");
  6689. _598.id=this.m_id+"instructions";
  6690. _598.setAttribute("role","presentation");
  6691. _598.style.visibility="hidden";
  6692. _598.style.display="none";
  6693. document.body.appendChild(_598);
  6694. _598.innerHTML=RV_RES.IDS_JS_INFOBAR_EXPLANATION;
  6695. }
  6696. return _597;
  6697. },addRAPTimingDetails:function(){
  6698. if(this.m_timingDetails){
  6699. var _5a0=this.m_timingDetails.length-1;
  6700. var _5a1=this.m_timingDetails[_5a0].time-this.m_timingDetails[0].time;
  6701. return "<div><table role=\"presentation\" class=\"infoBarLockedItems\">"+"<tr>"+this.addTimingIcon(_5a1,250,500)+"<td colspan=\"2\" class=\"bibi inforBarDetailsText\" role=\"presentation\" id=\""+this.m_id+"_timingDetail\" style=\"background-color:LightGray\"><b>RAP Total Time: ("+_5a1+")</b></td>"+"</tr>"+this.addRAPTimingItemDetails()+"</table></div>";
  6702. }
  6703. return "";
  6704. },addRAPTimingItemDetails:function(){
  6705. var _5a2="";
  6706. if(this.m_timingDetails){
  6707. for(var _5a3=0;_5a3<=this.m_timingDetails.length-1;++_5a3){
  6708. var _5a4=this.m_timingDetails[_5a3];
  6709. var _5a5=this.getTimeDiff(_5a3);
  6710. _5a2+="<tr class=\"infoBarDetailRow\" type=\"filter\" tabindex=\"-1\">";
  6711. if(_5a4.level){
  6712. _5a2+="<td colspan=3><font size=\"1\">"+_5a5+":"+html_encode(_5a4.event)+"</font></td></tr>";
  6713. }else{
  6714. _5a2+=this.addTimingIcon(_5a5,100,500);
  6715. _5a2+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_5a3+"_timingDetail\">";
  6716. _5a2+=html_encode(_5a4.event);
  6717. _5a2+="</td><td align=\"right\">"+_5a5+"</td>";
  6718. }
  6719. _5a2+="</tr>";
  6720. }
  6721. }
  6722. return _5a2;
  6723. },getTimeDiff:function(_5a6){
  6724. var _5a7=_5a6+1;
  6725. if(_5a7>=this.m_timingDetails.length){
  6726. return 0;
  6727. }
  6728. var _5a8=this.m_timingDetails[_5a6].level;
  6729. if(!(_5a8==this.m_timingDetails[_5a7].level)){
  6730. while(_5a7<this.m_timingDetails.length&&this.m_timingDetails[_5a7].level!=_5a8&&typeof this.m_timingDetails[_5a7].level!="undefined"){
  6731. _5a7++;
  6732. }
  6733. }
  6734. return (this.m_timingDetails[_5a7].time-this.m_timingDetails[_5a6].time);
  6735. },addTimingIcon:function(_5a9,_5aa,red){
  6736. var _5ac="icon_excellent_traffic.gif";
  6737. if(_5a9>red){
  6738. _5ac="icon_poor_traffic.gif";
  6739. }else{
  6740. if(_5a9>_5aa){
  6741. _5ac="icon_average_traffic.gif";
  6742. }
  6743. }
  6744. return this.addInfoBarIcon(_5ac,true);
  6745. },addLockedInfoBarDetails:function(){
  6746. if(this.hasPrompts()||typeof this.m_containerInfo.lockedFilters!=="undefined"){
  6747. return "<div role=\"presentation\" class=\"infoBarLockedItems\">"+this.addPromptDetails()+this.addLockedFilterDetails()+"</div>";
  6748. }
  6749. return "";
  6750. },addEditableInfoBarDetails:function(){
  6751. if(this.m_editableFilters||this.m_editableSorts||this.m_editableSliders){
  6752. return "<div role=\"presentation\" class=\"infoBarEditableItems\">"+this.addFilteredItemsDetails()+this.addSliderDetails()+this.addSortDetails()+"</div>";
  6753. }
  6754. return "";
  6755. },onKeyDown:function(evt){
  6756. var _5ae=evt.target;
  6757. var cvId=this.m_cognosViewer.getId();
  6758. var _5b0=document.getElementById("infoBarHeaderButton"+this.m_id);
  6759. var _5b1=document.getElementById(this.m_id+"instructions");
  6760. var node;
  6761. if(evt.keyCode=="13"){
  6762. _5b1.innerHTML=RV_RES.IDS_JS_INFOBAR_EXPLANATION;
  6763. if(_5ae===_5b0){
  6764. this.toggle();
  6765. return stopEventBubble(evt);
  6766. }
  6767. }else{
  6768. if(evt.keyCode=="27"){
  6769. var _5b3=this.m_cognosViewer.getA11YHelper();
  6770. if(this.m_cognosViewer.getCurrentNodeFocus()){
  6771. node=this.m_cognosViewer.getCurrentNodeFocus();
  6772. if(node.nodeName.toLowerCase()!="span"){
  6773. var _5b4=node.getElementsByTagName("span");
  6774. for(var _5b5=0;_5b5<_5b4.length;_5b5++){
  6775. if(_5b4[_5b5].style.display!="hidden"){
  6776. node=_5b4[_5b5];
  6777. break;
  6778. }
  6779. }
  6780. }
  6781. this.hide(false);
  6782. _5b3.setFocusToNode(node);
  6783. }else{
  6784. this.hide();
  6785. }
  6786. return stopEventBubble(evt);
  6787. }else{
  6788. if(evt.keyCode=="46"){
  6789. if(dojo.hasClass(_5ae,"infoBarDetailRow")){
  6790. node=dojo.query("td.infoBarRightIcon",_5ae)[0];
  6791. if(typeof node!=="undefined"){
  6792. if(_5ae.getAttribute("type")=="filter"){
  6793. InfoBarHelper.infoBarRemoveFilter(cvId,this.m_layoutIndex,node.getAttribute("filterItem"),node.getAttribute("details"));
  6794. }else{
  6795. if(_5ae.getAttribute("type")=="sort"){
  6796. InfoBarHelper.infoBarRemoveSort(cvId,this.m_layoutIndex,node.getAttribute("sortItem"),node.getAttribute("byLabel"));
  6797. }else{
  6798. if(_5ae.getAttribute("type")=="slider"){
  6799. InfoBarHelper.infoBarRemoveSlider(cvId,node.getAttribute("slider"));
  6800. }
  6801. }
  6802. }
  6803. }
  6804. }
  6805. }else{
  6806. if(evt.keyCode=="38"){
  6807. if(dojo.hasClass(_5ae,"infoBarDetailRow")){
  6808. this.focusDetailRow(_5ae,"prev");
  6809. }else{
  6810. this.focusDetailRow();
  6811. }
  6812. _5b1.innerHTML="";
  6813. return stopEventBubble(evt);
  6814. }else{
  6815. if(evt.keyCode=="40"){
  6816. if(dojo.hasClass(_5ae,"infoBarDetailRow")){
  6817. this.focusDetailRow(_5ae,"next");
  6818. }else{
  6819. this.focusDetailRow();
  6820. }
  6821. _5b1.innerHTML="";
  6822. return stopEventBubble(evt);
  6823. }else{
  6824. if(evt.keyCode=="9"){
  6825. var _5b6=document.getElementById("infoBar"+this.m_id);
  6826. if(dojo.hasClass(_5b6,"infoBarExpanded")){
  6827. if(dojo.hasClass(_5ae,"infoBarDetailRow")){
  6828. dojo.byId("infoBarHeaderCloseButton"+this.m_id).focus();
  6829. }else{
  6830. this.focusDetailRow();
  6831. }
  6832. return stopEventBubble(evt);
  6833. }
  6834. }
  6835. }
  6836. }
  6837. }
  6838. }
  6839. }
  6840. },focusDetailRow:function(_5b7,dir){
  6841. var _5b9=document.getElementById("infoBarFlyout"+this.m_id);
  6842. var _5ba=document.getElementById("infoBar"+this.m_id);
  6843. if(!dojo.hasClass(_5ba,"infoBarExpanded")){
  6844. return;
  6845. }
  6846. if(typeof _5b7=="undefined"||_5b7===null){
  6847. var _5bb=dojo.query(".infoBarLockedItems .infoBarDetailRow, .infoBarEditableItems .infoBarDetailRow",_5b9);
  6848. _5b7=_5bb[0];
  6849. }
  6850. if(_5b7&&dojo.hasClass(_5b7,"infoBarDetailRow")){
  6851. var _5bc,rows,len,i;
  6852. if(dir==="prev"){
  6853. if(_5b7.parentNode.previousSibling){
  6854. _5bc=_5b7.parentNode.previousSibling.childNodes[1];
  6855. }else{
  6856. rows=dojo.query(".infoBarDetailRow",_5b9);
  6857. len=rows.length;
  6858. if(_5b7===rows[0]){
  6859. _5bc=rows[len-1];
  6860. }else{
  6861. for(i=1;i<len;i++){
  6862. if(_5b7===rows[i]){
  6863. _5bc=rows[i-1];
  6864. break;
  6865. }
  6866. }
  6867. }
  6868. }
  6869. }else{
  6870. if(dir==="next"){
  6871. if(_5b7.parentNode.nextSibling){
  6872. _5bc=_5b7.parentNode.nextSibling.childNodes[1];
  6873. }else{
  6874. rows=dojo.query(".infoBarDetailRow",_5b9);
  6875. len=rows.length;
  6876. if(_5b7===rows[len-1]){
  6877. _5bc=rows[0];
  6878. }else{
  6879. for(i=0;i<len-1;i++){
  6880. if(_5b7===rows[i]){
  6881. _5bc=rows[i+1];
  6882. break;
  6883. }
  6884. }
  6885. }
  6886. }
  6887. }else{
  6888. _5bc=_5b7;
  6889. }
  6890. }
  6891. _5bc.focus();
  6892. }
  6893. },toggle:function(evt){
  6894. var _5c1=document.getElementById("infoBar"+this.m_id);
  6895. if(dojo.hasClass(_5c1,"infoBarExpanded")){
  6896. this.hide();
  6897. }else{
  6898. this.show();
  6899. }
  6900. stopEventBubble(evt);
  6901. },ignoreEvent:function(evt){
  6902. stopEventBubble(evt);
  6903. },show:function(){
  6904. var _5c3=document.getElementById("infoBar"+this.m_id);
  6905. if(!dojo.hasClass(_5c3,"infoBarExpanded")){
  6906. var _5c4=document.getElementById("infoBarHeader"+this.m_id);
  6907. var _5c5=document.getElementById("infoBarFlyout"+this.m_id);
  6908. var _5c6=document.getElementById("infoBarHeaderButton"+this.m_id);
  6909. var _5c7,_5c8,_5c9;
  6910. var _5ca=dojo.fx.wipeIn({node:_5c5,duration:300,onEnd:dojo.hitch(this,function(){
  6911. this.focusDetailRow();
  6912. _5c6.setAttribute("title",RV_RES.IDS_JS_INFOBAR_COLLAPSE);
  6913. _5c6.childNodes[0].setAttribute("title",RV_RES.IDS_JS_INFOBAR_COLLAPSE);
  6914. })});
  6915. this.updateInfoBarRenderedState(this.m_id,"true");
  6916. dojo.addClass(_5c3,"infoBarExpanded");
  6917. if(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton"){
  6918. dojo.style(_5c3,{opacity:"1"});
  6919. }
  6920. dojo.style(_5c3,"width","auto");
  6921. _5ca.play();
  6922. var _5cb=document.getElementById("infoBarHeaderText"+this.m_id).innerHTML;
  6923. var _5cc=this._getTextWidth(_5cb)+40;
  6924. if(_5cc<500){
  6925. _5cc=500;
  6926. }
  6927. var _5cd=this.m_cognosViewer.getViewerWidget();
  6928. var _5ce=_5cd.findContainerDiv().clientWidth;
  6929. if(_5cc>_5ce){
  6930. _5cc=_5ce-5;
  6931. }
  6932. _5c3.style.width=_5cc+"px";
  6933. dojo.removeClass(_5c4,"BUXNoPrint");
  6934. }
  6935. },_getTextWidth:function(text){
  6936. var div=document.createElement("div");
  6937. div.className="infoBar infoBarHeader";
  6938. div.style.fontWeight="bold";
  6939. div.style.position="absolute";
  6940. div.style.visibility="hidden";
  6941. div.style.height="auto";
  6942. div.style.width="auto";
  6943. document.body.appendChild(div);
  6944. div.innerHTML=text;
  6945. var _5d1=div.clientWidth;
  6946. document.body.removeChild(div);
  6947. return _5d1;
  6948. },hide:function(_5d2){
  6949. var _5d3=document.getElementById("infoBar"+this.m_id);
  6950. if(dojo.hasClass(_5d3,"infoBarExpanded")){
  6951. this.updateInfoBarRenderedState(this.m_id,"false");
  6952. var _5d4=document.getElementById("infoBarHeader"+this.m_id);
  6953. var _5d5=document.getElementById("infoBarFlyout"+this.m_id);
  6954. var _5d6=document.getElementById("infoBarHeaderButton"+this.m_id);
  6955. dojo.addClass(_5d4,"BUXNoPrint");
  6956. dojo.fx.wipeOut({node:_5d5,duration:300,onEnd:dojo.hitch(this,function(){
  6957. dojo.removeClass(_5d3,"infoBarExpanded");
  6958. dojo.style(_5d3,"width","auto");
  6959. if(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton"){
  6960. dojo.style(_5d3,{opacity:"0.6"});
  6961. }
  6962. _5d6.setAttribute("title",RV_RES.IDS_JS_INFOBAR_EXPAND);
  6963. _5d6.childNodes[0].setAttribute("title",RV_RES.IDS_JS_INFOBAR_EXPAND);
  6964. if(!_5d2){
  6965. _5d6.focus();
  6966. }
  6967. })}).play();
  6968. }
  6969. },updateInfoBarRenderedState:function(_5d7,_5d8){
  6970. var _5d9=this.m_cognosViewer.getViewerWidget();
  6971. if(_5d9){
  6972. var _5da=_5d9.getInfoBarRenderedState();
  6973. _5da[_5d7]=_5d8;
  6974. }
  6975. },wasInfoBarExpanded:function(_5db){
  6976. var _5dc=this.m_cognosViewer.getViewerWidget();
  6977. if(_5dc){
  6978. var _5dd=_5dc.getInfoBarRenderedState();
  6979. if(_5dd){
  6980. if(_5dd[_5db]){
  6981. if("true"===_5dd[_5db]){
  6982. return true;
  6983. }
  6984. }
  6985. }
  6986. }
  6987. return false;
  6988. },destroy:function(){
  6989. for(var i=0;i<this.connections.length;i++){
  6990. var _5df=this.connections[i];
  6991. if(_5df&&_5df.remove){
  6992. dojo.disconnect(_5df);
  6993. }
  6994. }
  6995. var _5e0=document.getElementById("infoBar"+this.m_id);
  6996. if(_5e0){
  6997. var _5e1=_5e0.parentNode;
  6998. if(_5e1){
  6999. _5e1.removeChild(_5e0);
  7000. }
  7001. }
  7002. _5e0=document.getElementById(this.m_id+"instructions");
  7003. if(_5e0){
  7004. _5e0.parentNode.removeChild(_5e0);
  7005. }
  7006. delete this.m_layoutElement;
  7007. delete this.m_containerInfo;
  7008. }});
  7009. dojo.declare("AnnotationFilterContext",null,{m_parameterValuesString:null,m_parameterValuesSpec:null,m_slidersJSON:null,m_filterJSON:null,constructor:function(_5e2,_5e3,_5e4,_5e5){
  7010. this.m_parameterValuesString=_5e2;
  7011. this.m_parameterValuesSpec=_5e3;
  7012. this.m_slidersJSON=_5e4;
  7013. this.m_filterJSON=_5e5;
  7014. },setParameterValuesString:function(_5e6){
  7015. this.m_parameterValuesString=_5e6;
  7016. },setParameterValuesSpec:function(_5e7){
  7017. this.m_parameterValuesSpec=_5e7;
  7018. },setSlidersJSON:function(_5e8){
  7019. this.m_slidersJSON=_5e8;
  7020. },setFilterJSON:function(_5e9){
  7021. this.m_filterJSON=_5e9;
  7022. },getParameterValuesString:function(){
  7023. return this.m_parameterValuesString||null;
  7024. },getParameterValuesSpec:function(){
  7025. return this.m_parameterValuesSpec||null;
  7026. },getPromptsJSON:function(){
  7027. var _5ea=null;
  7028. if(this.m_parameterValuesString){
  7029. _5ea={};
  7030. _5ea.parameterValuesString=this.m_parameterValuesString;
  7031. }
  7032. if(this.m_parameterValuesString){
  7033. _5ea=_5ea||{};
  7034. _5ea.parameterValuesSpec=this.m_parameterValuesSpec;
  7035. }
  7036. return _5ea;
  7037. },getSlidersJSON:function(){
  7038. return this.m_slidersJSON||null;
  7039. },getFilterJSON:function(){
  7040. return this.m_filterJSON||null;
  7041. },isEmpty:function(){
  7042. if(this.m_parameterValuesString||this.m_parameterValuesSpec||this.m_slidersJSON||this.m_filterJSON){
  7043. return false;
  7044. }
  7045. return true;
  7046. }});
  7047. dojo.declare("AnnotationInfoBar",InfoBarBase,{constructor:function(_5eb,lid){
  7048. this.m_id="annoInfoBar_"+lid;
  7049. this.m_layoutElementId=lid;
  7050. },createFilterContext:function(){
  7051. var _5ed=null;
  7052. var _5ee=null;
  7053. var _5ef=null;
  7054. var _5f0=null;
  7055. if(this.m_cognosViewer.getRAPReportInfo()){
  7056. var _5f1=this.m_cognosViewer.getRAPReportInfo();
  7057. if(_5f1.getContainers()){
  7058. var _5f2=_5f1.getContainers();
  7059. if(_5f2[this.m_layoutElementId]){
  7060. var _5f3=_5f2[this.m_layoutElementId];
  7061. if(typeof _5f3.filter!=="undefined"){
  7062. _5ed=_5f3.filter;
  7063. }
  7064. if(typeof _5f3.sliders!=="undefined"){
  7065. _5ee=_5f3.sliders;
  7066. }
  7067. }
  7068. }
  7069. }
  7070. if(this.hasPrompts()){
  7071. _5ef=CViewerCommon.buildParameterValuesSpec(this.m_cognosViewer);
  7072. _5f0=this.m_cognosViewer.getExecutionParameters();
  7073. }
  7074. if(_5ed||_5ee||_5ef||_5f0){
  7075. return new AnnotationFilterContext(_5f0,_5ef,_5ee,_5ed);
  7076. }
  7077. return null;
  7078. }});
  7079. dojo.declare("AnnotationInfoBarRenderer",null,{m_AnnotationInfoBar:null,m_id:null,m_labelledByHideButton:"",miniCognosViewer:null,m_editableSliders:null,constructor:function(_5f4,lid,_5f6,_5f7){
  7080. this.m_AnnotationInfoBar=null;
  7081. this.miniCognosViewer={};
  7082. this.miniCognosViewer.m_sId=_5f4.id;
  7083. this.miniCognosViewer.getId=_5f4.getId;
  7084. this.miniCognosViewer.m_sParameters=(_5f6===null||_5f6.getParameterValuesString()===null)?"":_5f6.getParameterValuesString();
  7085. this.miniCognosViewer.getExecutionParameters=_5f4.getExecutionParameters;
  7086. this.miniCognosViewer.getWebContentRoot=_5f4.getWebContentRoot;
  7087. this.m_AnnotationInfoBar=new AnnotationInfoBar(this.miniCognosViewer,lid);
  7088. this.m_AnnotationInfoBar.setId("annoInfoBar_"+_5f7+lid);
  7089. this.m_id="annoInfoBar_"+_5f7+lid+"_renderer";
  7090. if(_5f6){
  7091. if(_5f6.getSlidersJSON()){
  7092. this.m_AnnotationInfoBar.setContainerInfo({"sliders":_5f6.getSlidersJSON()});
  7093. this.m_AnnotationInfoBar.m_editableSliders=_5f6.getSlidersJSON();
  7094. }
  7095. if(_5f6.getFilterJSON()){
  7096. this.m_AnnotationInfoBar.setEditableFilters(_5f6.getFilterJSON());
  7097. }
  7098. }
  7099. },render:function(){
  7100. var _5f8="<div class=\"infoBar infoBarCollapsed\" id=\"infoBarHeaderCollapsed"+this.m_id+"\" >"+this.renderHeader(false)+"</div>";
  7101. var _5f9="<div class=\"infoBar infoBarExpanded\" id=\"infoBarHeaderExpanded"+this.m_id+"\" style=\"display:none;\" >"+this.renderHeader(true)+this.renderDetails()+"</div>";
  7102. _5f9=this.updateHideButtonLabelledBy(_5f9);
  7103. var _5fa=document.getElementById("annotationInfoBarInstructions");
  7104. if(_5fa===null){
  7105. _5fa=document.createElement("span");
  7106. _5fa.id="annotationInfoBarInstructions";
  7107. _5fa.setAttribute("role","presentation");
  7108. _5fa.style.visibility="hidden";
  7109. _5fa.style.display="none";
  7110. var _5fb=this.m_AnnotationInfoBar.createHiddenSpan("annoInfoBarButtonInstruction",RV_RES.IDS_JS_ANNO_INFOBAR_BUTTON_EXPLANATION)+this.m_AnnotationInfoBar.createHiddenSpan("annoInfoBar_filterString",RV_RES.IDS_JS_FILTER)+this.m_AnnotationInfoBar.createHiddenSpan("annoInfoBar_promptString",RV_RES.IDS_JS_INFOBAR_PROMPT)+this.m_AnnotationInfoBar.createHiddenSpan("annoInfoBar_sliderString",RV_RES.IDS_JS_INFOBAR_SLIDER);
  7111. document.body.appendChild(_5fa);
  7112. _5fa.innerHTML=_5fb;
  7113. }
  7114. return _5f8+_5f9;
  7115. },renderInJSON:function(){
  7116. var _5fc=[];
  7117. return _5fc.concat(this.m_AnnotationInfoBar.getPromptDetailsInJSON(),this.m_AnnotationInfoBar.getFilteredItemsDetailsInJSON(),this.m_AnnotationInfoBar.getSliderDetailsInJSON());
  7118. },renderHeader:function(_5fd){
  7119. var mode=(_5fd)?"Hide":"Show";
  7120. var _5ff=(_5fd)?RV_RES.IDS_JS_ANNO_INFOBAR_HIDE:RV_RES.IDS_JS_ANNO_INFOBAR_SHOW;
  7121. var _600=(_5fd)?("XXREPLACEXX"):" annoInfoBarHeaderControlButtonText"+mode+this.m_id;
  7122. var _601="<table class=\"annoInfoBarHeader\" id=\"annoInfoBarHeader"+mode+this.m_id+"\" role=\"presentation\">"+"<tr>"+"<td class=\"annoInfoBarHeaderText\" id=\"infoBarHeaderText"+this.m_id+"\" >"+RV_RES.IDS_JS_FILTER_APPLIED+"</td>"+"<td class=\"annoInfoBarHeaderControl\" id=\"infoBarHeader"+mode+this.m_id+"\" >"+"<button id=\"annoInfoBarHeaderControl"+mode+this.m_id+"\" aria-labelledby=\""+_600+"\" type=\"button\" role=\"button\" tabindex=\"0\" value=\"\" title=\""+_5ff+"\""+" onmousedown=\"annotationInfoBarToggle('"+this.m_id+"', '"+mode+"');\">"+"<span id=\"annoInfoBarHeaderControlButtonText"+mode+this.m_id+"\"class=\"dijitInline annoInfoBarHeaderControlText\" title=\""+_5ff+"\" >"+_5ff+"</span>"+"</button>"+"</td>"+"</tr>"+"</table>";
  7123. return _601;
  7124. },renderDetails:function(){
  7125. var _602=this.m_AnnotationInfoBar.addPromptDetails(true);
  7126. var _603=this.m_AnnotationInfoBar.addFilteredItemsDetails(true);
  7127. var _604=this.m_AnnotationInfoBar.addSliderDetails(true);
  7128. var _605="<div class=\"annoInfoBarDetails\" id=\"annoInfoBarDetails"+this.m_id+"\" role=\"presentation\">"+_602+_603+_604+"</div>";
  7129. this.m_labelledByHideButton=(_602.length===0)?"":(" annoInfoBar_promptString "+this.m_AnnotationInfoBar.getId()+"0_promptDetail ");
  7130. this.m_labelledByHideButton+=(_603.length===0)?"":(" annoInfoBar_filterString "+this.m_AnnotationInfoBar.getId()+"0_filterDetail ");
  7131. this.m_labelledByHideButton+=(_604.length===0)?"":(" annoInfoBar_sliderString "+this.m_AnnotationInfoBar.getId()+"0_sliderDetail annoInfoBar_sliderString "+this.m_AnnotationInfoBar.getId()+"1_sliderDetail ");
  7132. this.m_labelledByHideButton+=" annoInfoBarHeaderControlButtonTextHide"+this.m_id;
  7133. return _605;
  7134. },updateHideButtonLabelledBy:function(_606){
  7135. return _606.replace("XXREPLACEXX",this.m_labelledByHideButton);
  7136. }});
  7137. function annotationInfoBarToggle(mId,_608){
  7138. var _609=document.getElementById("infoBarHeaderExpanded"+mId);
  7139. var _60a=document.getElementById("infoBarHeaderCollapsed"+mId);
  7140. var _60b=null;
  7141. if("Show"===_608){
  7142. dojo.style(_609,{display:""});
  7143. dojo.style(_60a,{display:"none"});
  7144. _60b=document.getElementById("annoInfoBarHeaderControlHide"+mId);
  7145. }else{
  7146. dojo.style(_60a,{display:""});
  7147. dojo.style(_609,{display:"none"});
  7148. _60b=document.getElementById("annoInfoBarHeaderControlShow"+mId);
  7149. }
  7150. if(_60b){
  7151. _60b.focus();
  7152. }
  7153. };
  7154. var CV_BACKGROUND_LAYER_ID="CV_BACK";
  7155. if(typeof window.gaRV_INSTANCES=="undefined"){
  7156. window.gaRV_INSTANCES=[];
  7157. }
  7158. if(!window.gViewerLogger){
  7159. window.gViewerLogger={log:function(hint,_60d,type){
  7160. },addContextInfo:function(_60f){
  7161. }};
  7162. }
  7163. function CognosViewerSession(oCV){
  7164. this.m_sConversation=oCV.getConversation();
  7165. this.m_sParameters=oCV.getExecutionParameters();
  7166. this.m_envParams={};
  7167. applyJSONProperties(this.m_envParams,oCV.envParams);
  7168. this.m_bRefreshPage=false;
  7169. };
  7170. function CCognosViewer(sId,_612){
  7171. if(typeof window.gCognosViewer=="undefined"){
  7172. window.gCognosViewer=this;
  7173. }
  7174. if(typeof ViewerConfig=="function"){
  7175. this.m_viewerConfig=new ViewerConfig();
  7176. try{
  7177. if(typeof window.getViewerConfiguration=="function"){
  7178. this.m_viewerConfig.configure(window.getViewerConfiguration());
  7179. }else{
  7180. if(window.parent&&typeof window.parent.getViewerConfiguration=="function"){
  7181. this.m_viewerConfig.configure(window.parent.getViewerConfiguration());
  7182. }
  7183. }
  7184. }
  7185. catch(e){
  7186. }
  7187. this.m_viewerUIConfig=this.m_viewerConfig.getUIConfig();
  7188. }
  7189. this.m_sActionState="";
  7190. this.m_bKeepSessionAlive=false;
  7191. this.m_undoStack=[];
  7192. this.m_aSecRequests=[];
  7193. this.m_bDebug=false;
  7194. this.m_sCAFContext="";
  7195. this.m_sContextInfoXML="";
  7196. this.m_sConversation="";
  7197. this.m_sStatus="";
  7198. this.m_sGateway=_612;
  7199. this.m_sId=sId;
  7200. this.m_sMetadataInfoXML="";
  7201. this.m_sParameters="";
  7202. this.m_sReportState="";
  7203. this.envParams={};
  7204. this.m_sTracking="";
  7205. this.m_sSoapFault="";
  7206. this.m_sWaitHTML="";
  7207. this.m_oDrillMgr=null;
  7208. this.goDrillManager=null;
  7209. this.m_oWorkingDialog=null;
  7210. this.m_oRequestExecutedIndicator=null;
  7211. this.m_bUseWorkingDialog=true;
  7212. this.m_oSubscriptionManager=null;
  7213. this.m_oCVMgr=null;
  7214. this.m_bUseSafeMode=true;
  7215. if(typeof CViewerManager=="function"){
  7216. this.m_oCVMgr=new CViewerManager(this);
  7217. }
  7218. if(window.gaRV_INSTANCES){
  7219. var _613=false;
  7220. for(var _614=0;_614<window.gaRV_INSTANCES.length;_614++){
  7221. if(window.gaRV_INSTANCES[_614].m_sId==sId){
  7222. window.gaRV_INSTANCES[_614]=this;
  7223. _613=true;
  7224. break;
  7225. }
  7226. }
  7227. if(!_613){
  7228. window.gaRV_INSTANCES=window.gaRV_INSTANCES.concat(this);
  7229. }
  7230. }
  7231. this.m_bReportHasPrompts=false;
  7232. this.m_viewerWidget=null;
  7233. this.m_flashChartsObjectIds=[];
  7234. this.m_raiseSharePromptEvent=true;
  7235. this.m_actionFactory=null;
  7236. this.m_calculationCache={};
  7237. this.m_drillTargets=[];
  7238. this.m_reportRenderingDone=false;
  7239. if(typeof PinFreezeManager!=="undefined"){
  7240. this.m_pinFreezeManager=new PinFreezeManager(this);
  7241. }
  7242. if(typeof ViewerDispatcher!=="undefined"){
  7243. this.m_viewerDispatcher=new ViewerDispatcher();
  7244. }
  7245. this.m_retryDispatcherEntry=null;
  7246. this.m_RAPReportInfo=null;
  7247. if(typeof ViewerState=="function"){
  7248. this.m_viewerState=new ViewerState();
  7249. }
  7250. this.m_aInfoBar=null;
  7251. };
  7252. CCognosViewer.prototype.setScheduledMobileOutput=function(_615){
  7253. this.m_mobileScheduledOutput=_615;
  7254. if(_615){
  7255. this.m_sStatus="complete";
  7256. }
  7257. };
  7258. CCognosViewer.prototype.setTabInfo=function(_616){
  7259. this.m_tabsPayload=_616;
  7260. if(this.m_tabsPayload&&this.m_tabsPayload.tabs&&this._keepTabSelected){
  7261. var _617=false;
  7262. for(var i=0;i<this.m_tabsPayload.tabs.length;i++){
  7263. var tab=this.m_tabsPayload.tabs[i];
  7264. if(tab.id==this._keepTabSelected){
  7265. this.m_tabsPayload.currentTabId=this._keepTabSelected;
  7266. break;
  7267. }
  7268. }
  7269. this._keepTabSelected=null;
  7270. }
  7271. };
  7272. CCognosViewer.prototype.setKeepTabSelected=function(_61a){
  7273. this._keepTabSelected=_61a;
  7274. };
  7275. CCognosViewer.prototype.getTabController=function(){
  7276. return this.m_tabControl;
  7277. };
  7278. CCognosViewer.prototype.getCurrentlySelectedTab=function(){
  7279. return this.m_currentlySelectedTab?this.m_currentlySelectedTab:null;
  7280. };
  7281. CCognosViewer.prototype.deleteTabs=function(){
  7282. if(this.m_tabControl){
  7283. this.m_tabControl.destroy();
  7284. delete this.m_tabControl;
  7285. this.m_tabControl=null;
  7286. }
  7287. this.m_tabsPayload=null;
  7288. };
  7289. CCognosViewer.prototype.renderTabs=function(){
  7290. if(!this.m_tabsPayload){
  7291. return;
  7292. }
  7293. var _61b=this.isSavedOutput()&&!this.m_mobileScheduledOutput;
  7294. var _61c=document.getElementById("CVNavLinks"+this.getId());
  7295. if(_61c||!this.shouldWriteNavLinks()||_61b){
  7296. var _61d=this.getReportDiv();
  7297. this.m_bHasTabs=true;
  7298. if(this.m_tabControl&&this.m_tabControl.isSavedOutput()!=_61b){
  7299. this.deleteTabs();
  7300. }
  7301. if(!this.m_tabControl){
  7302. if(this.getStatus()!="complete"&&!_61b){
  7303. return;
  7304. }
  7305. var tr=document.createElement("tr");
  7306. var _61f=document.createElement("td");
  7307. tr.appendChild(_61f);
  7308. var _620=document.getElementById("mainViewerTR"+this.getId());
  7309. if(!_620){
  7310. return;
  7311. }
  7312. if(this.m_tabsPayload.position=="topLeft"){
  7313. _620.parentNode.insertBefore(tr,_620);
  7314. }else{
  7315. _620.parentNode.appendChild(tr);
  7316. }
  7317. var _621=null;
  7318. if(this.m_viewerWidget){
  7319. _621=this.m_viewerWidget.findContainerDiv().firstChild;
  7320. }else{
  7321. _621=_61f;
  7322. }
  7323. var oCV=this;
  7324. if(_61b){
  7325. this.m_tabControl=new CognosTabControl(_621,function(_623){
  7326. oCV.switchSavedOutputTab(_623,true);
  7327. });
  7328. this.switchSavedOutputTab(this.m_tabsPayload.currentTabId,false);
  7329. }else{
  7330. this.m_tabControl=new CognosTabControl(_621,function(_624){
  7331. oCV.switchTabs(_624);
  7332. });
  7333. }
  7334. if(this.m_viewerWidget){
  7335. this.m_tabControl.setSpaceSaverContainer(_61f);
  7336. this.m_tabControl.setScrollAttachNode(this.m_viewerWidget.findContainerDiv());
  7337. this.m_tabControl.useAbsolutePosition(true);
  7338. }
  7339. this.m_tabControl.setIsSavedOutput(_61b);
  7340. if(!window.gScriptLoader.m_bScriptLoaderCalled){
  7341. var _625=document.getElementById("RVContent"+this.getId());
  7342. var _626=this._getNodesWithViewerId(_625,"link",null);
  7343. for(var i=0;i<_626.length;i++){
  7344. window.gScriptLoader.moveLinks(_626[i]);
  7345. }
  7346. window.gScriptLoader.loadStyles(_625,this.getId());
  7347. this.repaintDiv(_625);
  7348. }
  7349. }
  7350. if(this.getStatus()=="prompting"){
  7351. this.previouslySelectedTab=null;
  7352. this.m_tabControl.hide();
  7353. }else{
  7354. if(this.isHighContrast()){
  7355. this.m_tabControl.setHighContrast(true);
  7356. }
  7357. this.m_tabControl.render(this.m_tabsPayload);
  7358. this.m_currentlySelectedTab=this.m_tabControl.getSelectedTabId();
  7359. if(this.m_switchingToTabId&&this.m_currentlySelectedTab!=this.m_switchingToTabId){
  7360. this._removeTabContent(_61d.parentNode,this.m_switchingToTabId);
  7361. this._removeTabContent(_61d.parentNode,this.m_currentlySelectedTab);
  7362. if(_61c){
  7363. this._removeTabContent(_61c.parentNode,this.m_switchingToTabId);
  7364. this._removeTabContent(_61c.parentNode,this.m_currentlySelectedTab);
  7365. }
  7366. this.m_tabInfo={};
  7367. }
  7368. this.m_switchingToTabId=null;
  7369. _61d.setAttribute("tabId",this.m_currentlySelectedTab);
  7370. if(_61c){
  7371. _61c.setAttribute("tabId",this.m_currentlySelectedTab);
  7372. }
  7373. if(isIE()&&_61b&&window.resizeIFrame&&!this.m_viewerFragment&&!this.m_viewerWidget){
  7374. window.resizeIFrame();
  7375. }
  7376. }
  7377. this.setMaxContentSize();
  7378. }else{
  7379. var obj=this;
  7380. setTimeout(function(){
  7381. obj.renderTabs();
  7382. },100);
  7383. }
  7384. };
  7385. CCognosViewer.prototype.cancelTabSwitch=function(){
  7386. var _629=this.getReportDiv();
  7387. var _62a=this.m_switchingToTabId;
  7388. this.m_currentlySelectedTab=_62a;
  7389. this.m_tabControl.selectTab(this.previouslySelectedTab,false);
  7390. this.switchTabs(this.previouslySelectedTab);
  7391. if(_629){
  7392. _629.parentNode.removeChild(_629);
  7393. }
  7394. if(this.m_tabInfo[this.m_currentlySelectedTab]&&this.m_tabInfo[this.m_currentlySelectedTab].styles){
  7395. this._addTabStylesToHead(this.m_tabInfo[this.m_currentlySelectedTab].styles);
  7396. }
  7397. this.previouslySelectedTab=null;
  7398. this.m_tabInfo[_62a]=null;
  7399. };
  7400. CCognosViewer.prototype.switchSavedOutputTab=function(_62b,_62c){
  7401. var _62d=this.getSelectionController();
  7402. if(_62d){
  7403. _62d.clearSelectedObjects();
  7404. }
  7405. this.m_currentlySelectedTab=this.m_tabControl.getSelectedTabId();
  7406. if(_62c){
  7407. this.notifyTabChange(_62b);
  7408. }
  7409. if(this.m_viewerWidget){
  7410. this.m_viewerWidget.getSavedOutput().switchSavedOutputTab(_62b,_62c);
  7411. this.getTabController().resetPosition();
  7412. }else{
  7413. if(!this.savedOutputTabNodes){
  7414. var _62e=document.getElementById("CVIFrame"+this.getId());
  7415. this.savedOutputTabNodes=getElementsByAttribute(_62e.contentWindow.document.body,"*","tabid");
  7416. }
  7417. if(!this.savedOutputTabNodes){
  7418. return;
  7419. }
  7420. for(var i=0;i<this.savedOutputTabNodes.length;i++){
  7421. var _630=this.savedOutputTabNodes[i];
  7422. _630.style.display=_630.getAttribute("tabid")==_62b?"":"none";
  7423. }
  7424. this.setMaxContentSize();
  7425. }
  7426. };
  7427. CCognosViewer.prototype.notifyTabChange=function(_631){
  7428. };
  7429. CCognosViewer.prototype._getNodesWithViewerId=function(_632,_633,id){
  7430. var _635=[];
  7431. var _636=_632.getElementsByTagName(_633);
  7432. for(var i=0;i<_636.length;i++){
  7433. var node=_636[i];
  7434. if(!id||(node.getAttribute&&node.getAttribute("namespaceId")==id)){
  7435. node.parentNode.removeChild(node);
  7436. _635.push(node);
  7437. i--;
  7438. }
  7439. }
  7440. return _635;
  7441. };
  7442. CCognosViewer.prototype._removeTabStylesFromHead=function(){
  7443. var id=this.getId();
  7444. return this._getNodesWithViewerId(document.getElementsByTagName("head").item(0),"style",id);
  7445. };
  7446. CCognosViewer.prototype._addTabStylesToHead=function(_63a){
  7447. if(!_63a){
  7448. return;
  7449. }
  7450. for(var i=0;i<_63a.length;i++){
  7451. document.getElementsByTagName("head").item(0).appendChild(_63a[i]);
  7452. }
  7453. };
  7454. CCognosViewer.prototype.switchTabs=function(_63c){
  7455. if(this.m_currentlySelectedTab==_63c){
  7456. return;
  7457. }
  7458. var _63d=this.getSelectionController();
  7459. if(_63d){
  7460. _63d.clearSelectedObjects();
  7461. }
  7462. var _63e=this.getReportDiv();
  7463. this.m_nReportDiv=null;
  7464. var _63f=_63e.clientHeight;
  7465. _63e.removeAttribute("id");
  7466. _63e.style.display="none";
  7467. if(!this.m_tabInfo){
  7468. this.m_tabInfo={};
  7469. }
  7470. var _640=this._removeTabStylesFromHead();
  7471. var _641=this.getSelectionController().getCCDManager();
  7472. this.m_tabInfo[this.m_currentlySelectedTab]={"conversation":this.getConversation(),"metadata":_641.getClonedMetadataArray(),"contextdata":_641.getClonedContextdataArray(),"secondaryRequests":this.getSecondaryRequests(),"styles":_640,"hasPromptControl":this.getHasPrompts()};
  7473. var _642=this._findChildWithTabId(_63e.parentNode,_63c);
  7474. this.previouslySelectedTab=this.m_currentlySelectedTab;
  7475. if(_642&&this.m_tabInfo[_63c]&&this.m_tabInfo[_63c].hasPromptControl){
  7476. if(_642){
  7477. _642.parentNode.removeChild(_642);
  7478. _642=null;
  7479. }
  7480. delete this.m_tabInfo[_63c];
  7481. this.m_tabInfo[_63c]=null;
  7482. }
  7483. if(_642){
  7484. this.m_currentlySelectedTab=_63c;
  7485. _642.style.display="block";
  7486. _642.setAttribute("id","CVReport"+this.getId());
  7487. if(this.m_tabInfo&&this.m_tabInfo[_63c]){
  7488. var _643=this.m_tabInfo[_63c];
  7489. if(_643.conversation){
  7490. this.setConversation(_643.conversation);
  7491. }
  7492. if(_643.metadata){
  7493. _641.SetMetadata(_643.metadata);
  7494. }
  7495. if(_643.contextdata){
  7496. _641.SetContextData(_643.contextdata);
  7497. }
  7498. if(_643.secondaryRequests){
  7499. this.setSecondaryRequests(_643.secondaryRequests);
  7500. }
  7501. if(_643.styles){
  7502. this._addTabStylesToHead(_643.styles);
  7503. }
  7504. this.setHasPrompts(_643.hasPromptControl);
  7505. }
  7506. if(this.shouldWriteNavLinks()){
  7507. this.writeNavLinks(this.getSecondaryRequests().join(" "));
  7508. }
  7509. if(this.getPinFreezeManager()&&this.getPinFreezeManager().hasFrozenContainers()){
  7510. this.getPinFreezeManager().rePaint();
  7511. if(isIE()){
  7512. var _644=document.getElementById("RVContent"+this.getId());
  7513. this.repaintDiv(_644);
  7514. }
  7515. }
  7516. if(this.m_viewerWidget){
  7517. this.m_viewerWidget.placeTabControlInView();
  7518. }
  7519. this._keepFocus=null;
  7520. this.doneLoadingUpdateA11Y("complete");
  7521. this.getTabController().resetPosition();
  7522. this.setMaxContentSize();
  7523. }else{
  7524. this.m_switchingToTabId=_63c;
  7525. var _645=_63e.cloneNode(false);
  7526. _645.style.display="block";
  7527. _645.setAttribute("id","CVReport"+this.getId());
  7528. _645.removeAttribute("tabId");
  7529. _63e.parentNode.appendChild(_645);
  7530. _645.innerHTML="<table height='"+_63f+"px'><tr><td height='100%'></td></tr></table>";
  7531. var _646=new ViewerDispatcherEntry(this);
  7532. _646.addFormField("ui.action","reportAction");
  7533. _646.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",_63c);
  7534. if(this.m_viewerWidget){
  7535. this.m_viewerWidget.placeTabControlInView();
  7536. }
  7537. this.dispatchRequest(_646);
  7538. }
  7539. };
  7540. CCognosViewer.prototype._removeTabContent=function(_647,_648){
  7541. var _649=this._findChildWithTabId(_647,_648);
  7542. while(_649){
  7543. _649.parentNode.removeChild(_649);
  7544. _649=this._findChildWithTabId(_647,_648);
  7545. }
  7546. };
  7547. CCognosViewer.prototype._findChildWithTabId=function(_64a,_64b){
  7548. var _64c=null;
  7549. for(var i=0;i<_64a.childNodes.length;i++){
  7550. var _64e=_64a.childNodes[i];
  7551. if(_64e.getAttribute("tabId")==_64b){
  7552. _64c=_64e;
  7553. break;
  7554. }
  7555. }
  7556. return _64c;
  7557. };
  7558. CCognosViewer.prototype.clearTabs=function(){
  7559. if(!this.m_bHasTabs){
  7560. return;
  7561. }
  7562. this.m_tabInfo={};
  7563. var _64f=this.getReportDiv();
  7564. var _650=_64f.parentNode;
  7565. for(var i=0;i<_650.childNodes.length;i++){
  7566. var node=_650.childNodes[i];
  7567. if(node.getAttribute("id")!="CVReport"+this.m_sId){
  7568. _650.removeChild(node);
  7569. i--;
  7570. }
  7571. }
  7572. };
  7573. CCognosViewer.prototype.isSavedOutput=function(){
  7574. var _653=this.envParams["ui.action"];
  7575. return _653==="view"||_653==="buxView";
  7576. };
  7577. CCognosViewer.prototype.renderSavedOutputIFrame=function(url,_655,_656){
  7578. var _657=document.getElementById("CVReport"+this.getId());
  7579. var _658=document.createElement("iframe");
  7580. _658.style.width="100%";
  7581. _658.style.height="99%";
  7582. _658.id="CVIFrame"+this.getId();
  7583. _658.title=_655;
  7584. _658.setAttribute("frameBorder","0");
  7585. _657.appendChild(_658);
  7586. var obj=this;
  7587. var func=function(){
  7588. obj.renderTabs();
  7589. };
  7590. setTimeout(function(){
  7591. if(_656){
  7592. if(_658.attachEvent){
  7593. _658.attachEvent("onload",func);
  7594. }else{
  7595. _658.addEventListener("load",func,true);
  7596. }
  7597. }
  7598. _658.src=url;
  7599. },1);
  7600. };
  7601. CCognosViewer.prototype.updatePageState=function(_65b){
  7602. if(_65b&&this.getState()){
  7603. this.getState().setPageState(_65b);
  7604. }
  7605. };
  7606. CCognosViewer.prototype.getPageInfo=function(){
  7607. if(this.m_viewerState&&this.m_viewerState.getPageState()){
  7608. var _65c=this.m_viewerState.getPageState();
  7609. return {"currentPage":_65c.getCurrentPage(),"pageCount":_65c.getPageCount()};
  7610. }
  7611. return {};
  7612. };
  7613. CCognosViewer.prototype.isIWidgetMobile=function(){
  7614. return this.m_viewerWidget&&this.m_viewerWidget.isMobile();
  7615. };
  7616. CCognosViewer.prototype.isInteractiveViewer=function(){
  7617. return false;
  7618. };
  7619. CCognosViewer.prototype.launchGotoPageForIWidgetMobile=function(form){
  7620. if(this.isIWidgetMobile()){
  7621. this.m_viewerWidget.launchGotoPageForIWidgetMobile(form);
  7622. return true;
  7623. }
  7624. return false;
  7625. };
  7626. CCognosViewer.prototype.executeDrillThroughForIWidgetMobile=function(form){
  7627. if(this.isIWidgetMobile()){
  7628. this.m_viewerWidget.executeDrillThroughForIWidgetMobile(form);
  7629. return true;
  7630. }
  7631. return false;
  7632. };
  7633. CCognosViewer.prototype.getState=function(){
  7634. return this.m_viewerState;
  7635. };
  7636. CCognosViewer.prototype.getConfig=function(){
  7637. return this.m_viewerConfig;
  7638. };
  7639. CCognosViewer.prototype.getUIConfig=function(){
  7640. return this.m_viewerUIConfig;
  7641. };
  7642. CCognosViewer.prototype.setCurrentNodeFocus=function(node){
  7643. this.m_currentNodeFocus=node;
  7644. };
  7645. CCognosViewer.prototype.getCurrentNodeFocus=function(node){
  7646. return this.m_currentNodeFocus;
  7647. };
  7648. CCognosViewer.prototype.setCurrentPromptControlFocus=function(node){
  7649. this.m_CurrentPromptControlFocus=node;
  7650. };
  7651. CCognosViewer.prototype.getCurrentPromptControlFocus=function(node){
  7652. return this.m_CurrentPromptControlFocus;
  7653. };
  7654. CCognosViewer.prototype.loadExtra=function(){
  7655. };
  7656. CCognosViewer.prototype.setRetryDispatcherEntry=function(_663){
  7657. this.m_retryDispatcherEntry=_663;
  7658. };
  7659. CCognosViewer.prototype.getRetryDispatcherEntry=function(){
  7660. return this.m_retryDispatcherEntry;
  7661. };
  7662. CCognosViewer.prototype.resetViewerDispatcher=function(){
  7663. if(this.m_viewerDispatcher!==null){
  7664. delete this.m_viewerDispatcher;
  7665. this.m_viewerDispatcher=new ViewerDispatcher();
  7666. }
  7667. };
  7668. CCognosViewer.prototype.getViewerDispatcher=function(){
  7669. return this.m_viewerDispatcher;
  7670. };
  7671. CCognosViewer.prototype.setFaultDispatcherEntry=function(_664){
  7672. this.m_faultDispatcherEntry=_664;
  7673. };
  7674. CCognosViewer.prototype.getFaultDispatcherEntry=function(){
  7675. return this.m_faultDispatcherEntry;
  7676. };
  7677. CCognosViewer.prototype.dispatchRequest=function(_665){
  7678. this.setFaultDispatcherEntry(null);
  7679. this.getViewerDispatcher().dispatchRequest(_665);
  7680. };
  7681. CCognosViewer.prototype.getActiveRequest=function(){
  7682. return this.getViewerDispatcher().getActiveRequest();
  7683. };
  7684. CCognosViewer.prototype.getProductLocale=function(){
  7685. if(this.sProductLocale){
  7686. return this.sProductLocale;
  7687. }
  7688. return "en";
  7689. };
  7690. CCognosViewer.prototype.getDirection=function(){
  7691. if(this.sDirection){
  7692. return this.sDirection;
  7693. }
  7694. return "ltr";
  7695. };
  7696. CCognosViewer.prototype.isBidiEnabled=function(){
  7697. if(this.bIsBidiEnabled){
  7698. return true;
  7699. }
  7700. return false;
  7701. };
  7702. CCognosViewer.prototype.getBaseTextDirection=function(){
  7703. if(this.isBidiEnabled()){
  7704. if(this.sBaseTextDirection){
  7705. return this.sBaseTextDirection;
  7706. }
  7707. }
  7708. return "";
  7709. };
  7710. CCognosViewer.prototype.getActionFactory=function(){
  7711. if(!this.m_actionFactory){
  7712. this.m_actionFactory=new ActionFactory(this);
  7713. }
  7714. return this.m_actionFactory;
  7715. };
  7716. CCognosViewer.prototype.getAction=function(_666){
  7717. var _666=this.getActionFactory().load(_666);
  7718. _666.setCognosViewer(this);
  7719. return _666;
  7720. };
  7721. CCognosViewer.prototype.getCalculationCache=function(){
  7722. return this.m_calculationCache;
  7723. };
  7724. CCognosViewer.prototype.updateOutputForA11ySupport=function(){
  7725. this.updateBorderCollapse();
  7726. if(this.getA11YHelper()){
  7727. this.getA11YHelper().addLabelledByForItemsOutsideOfContainers();
  7728. }
  7729. var _667=navigator.userAgent.toLowerCase();
  7730. var _668=_667.indexOf("iphone")!=-1;
  7731. var _669=_667.indexOf("ipod")!=-1;
  7732. var _66a=_667.indexOf("ipad")!=-1;
  7733. var _66b=_668||_669||_66a;
  7734. var _66c=_667.indexOf("android")!=-1;
  7735. if(_66b||_66c){
  7736. document.body.classList.add("clsViewerMobile");
  7737. }
  7738. };
  7739. CCognosViewer.prototype.checkForHighContrast=function(){
  7740. if(this.isBux){
  7741. this.m_bHighContrast=dojo.hasClass(document.body,"dijit_a11y")?true:false;
  7742. }else{
  7743. var _66d=document.createElement("div");
  7744. _66d.id=this.m_sId+"hc";
  7745. _66d.style.border="1px solid";
  7746. _66d.style.borderColor="red green";
  7747. _66d.style.height="10px";
  7748. _66d.style.top="-999px";
  7749. _66d.style.position="absolute";
  7750. document.body.appendChild(_66d);
  7751. var _66e=null;
  7752. if(isIE()){
  7753. _66e=_66d.currentStyle;
  7754. }else{
  7755. _66e=_66d.ownerDocument.defaultView.getComputedStyle(_66d,null);
  7756. }
  7757. if(!_66e){
  7758. return;
  7759. }
  7760. this.m_bHighContrast=_66e.borderTopColor==_66e.borderRightColor;
  7761. document.body.removeChild(_66d);
  7762. }
  7763. };
  7764. CCognosViewer.prototype.isHighContrast=function(){
  7765. if(typeof this.m_bHighContrast==="undefined"){
  7766. this.checkForHighContrast();
  7767. }
  7768. return this.m_bHighContrast;
  7769. };
  7770. CCognosViewer.prototype.isLimitedInteractiveMode=function(){
  7771. return this.envParams&&this.envParams.limitedInteractiveMode&&this.envParams.limitedInteractiveMode==="true";
  7772. };
  7773. CCognosViewer.prototype.updateBorderCollapse=function(){
  7774. if(this.isHighContrast()==true){
  7775. var _66f=null;
  7776. if(this.envParams["ui.action"]=="view"&&!this.isBux){
  7777. var _670=document.getElementById("CVIFrame"+this.getId());
  7778. _66f=_670.contentWindow.document;
  7779. }else{
  7780. _66f=document.getElementById("CVReport"+this.getId());
  7781. }
  7782. var _671=_66f.getElementsByTagName("table");
  7783. for(var i=0;i<_671.length;i++){
  7784. if(_671[i].style.borderCollapse=="collapse"){
  7785. _671[i].style.borderCollapse="separate";
  7786. }
  7787. }
  7788. }
  7789. };
  7790. CCognosViewer.prototype.isAccessibleMode=function(){
  7791. if(this.m_bAccessibleMode==true){
  7792. return true;
  7793. }
  7794. return false;
  7795. };
  7796. CCognosViewer.prototype.isSinglePageReport=function(){
  7797. for(var _673 in this.m_aSecRequests){
  7798. if(this.m_aSecRequests[_673]=="nextPage"||this.m_aSecRequests[_673]=="previousPage"){
  7799. return false;
  7800. }
  7801. }
  7802. return true;
  7803. };
  7804. CCognosViewer.prototype.hasNextPage=function(){
  7805. for(var _674 in this.m_aSecRequests){
  7806. if(this.m_aSecRequests[_674]=="nextPage"){
  7807. return true;
  7808. }
  7809. }
  7810. return false;
  7811. };
  7812. CCognosViewer.prototype.hasPrevPage=function(){
  7813. for(var _675 in this.m_aSecRequests){
  7814. if(this.m_aSecRequests[_675]=="previousPage"){
  7815. return true;
  7816. }
  7817. }
  7818. return false;
  7819. };
  7820. CCognosViewer.prototype.captureHotkeyPageNavigation=function(evt){
  7821. evt=(evt)?evt:((event)?event:null);
  7822. if(evt){
  7823. var node=getNodeFromEvent(evt);
  7824. var _678=(node&&node.nodeName)?node.nodeName.toLowerCase():null;
  7825. if((evt.keyCode==8&&_678!="input"&&_678!="textarea")||(evt.altKey==true&&(evt.keyCode==37||evt.keyCode==39))){
  7826. evt.returnValue=false;
  7827. evt.cancelBubble=true;
  7828. if(typeof evt.stopPropagation!="undefined"){
  7829. evt.stopPropagation();
  7830. }
  7831. if(typeof evt.preventDefault!="undefined"){
  7832. evt.preventDefault();
  7833. }
  7834. return false;
  7835. }
  7836. }
  7837. return true;
  7838. };
  7839. CCognosViewer.prototype.setUseWorkingDialog=function(_679){
  7840. this.m_bUseWorkingDialog=_679;
  7841. };
  7842. CCognosViewer.prototype.getWorkingDialog=function(){
  7843. if(!this.m_oWorkingDialog&&this.m_bUseWorkingDialog&&typeof WorkingDialog!=="undefined"){
  7844. if(this.getConfig()&&this.getConfig().getHttpRequestConfig()&&this.getConfig().getHttpRequestConfig().getWorkingDialog()){
  7845. this.m_oWorkingDialog=this.getConfig().getHttpRequestConfig().getWorkingDialog();
  7846. }else{
  7847. this.m_oWorkingDialog=new WorkingDialog(this);
  7848. }
  7849. }
  7850. return this.m_oWorkingDialog;
  7851. };
  7852. CCognosViewer.prototype.getRequestIndicator=function(){
  7853. if(this.m_bUseWorkingDialog&&!this.m_oRequestExecutedIndicator&&typeof RequestExecutedIndicator!=="undefined"){
  7854. if(this.getConfig()&&this.getConfig().getHttpRequestConfig()&&this.getConfig().getHttpRequestConfig().getRequestIndicator()){
  7855. this.m_oRequestExecutedIndicator=this.getConfig().getHttpRequestConfig().getRequestIndicator();
  7856. }else{
  7857. this.m_oRequestExecutedIndicator=new RequestExecutedIndicator(this);
  7858. }
  7859. }
  7860. return this.m_oRequestExecutedIndicator;
  7861. };
  7862. CCognosViewer.prototype.disableBrowserHotkeyPageNavigation=function(){
  7863. if(document.attachEvent){
  7864. document.attachEvent("onkeydown",this.captureHotkeyPageNavigation);
  7865. }else{
  7866. if(document.addEventListener){
  7867. document.addEventListener("keydown",this.captureHotkeyPageNavigation,false);
  7868. }
  7869. }
  7870. };
  7871. CCognosViewer.prototype.setHasPrompts=function(_67a){
  7872. if(!_67a){
  7873. this.preProcessControlArray=[];
  7874. }
  7875. this.m_bReportHasPrompts=_67a;
  7876. };
  7877. CCognosViewer.prototype.getHasPrompts=function(){
  7878. return this.m_bReportHasPrompts;
  7879. };
  7880. CCognosViewer.prototype.setUsePageRequest=function(_67b){
  7881. this.m_viewerDispatcher.setUsePageRequest(_67b);
  7882. };
  7883. CCognosViewer.prototype.getUsePageRequest=function(){
  7884. return this.m_viewerDispatcher.getUsePageRequest();
  7885. };
  7886. CCognosViewer.prototype.setKeepSessionAlive=function(_67c){
  7887. this.m_bKeepSessionAlive=_67c;
  7888. };
  7889. CCognosViewer.prototype.getKeepSessionAlive=function(){
  7890. return this.m_bKeepSessionAlive;
  7891. };
  7892. CCognosViewer.prototype.getWebContentRoot=function(){
  7893. if(typeof this.sWebContentRoot!="undefined"){
  7894. return this.sWebContentRoot;
  7895. }else{
  7896. return "..";
  7897. }
  7898. };
  7899. CCognosViewer.prototype.getSkin=function(){
  7900. if(typeof this.sSkin!="undefined"){
  7901. return this.sSkin;
  7902. }else{
  7903. return this.getWebContentRoot()+"/skins/corporate";
  7904. }
  7905. };
  7906. CCognosViewer.prototype.getSelectionController=function(){
  7907. var _67d;
  7908. try{
  7909. _67d=getCognosViewerSCObjectRef(this.m_sId);
  7910. }
  7911. catch(e){
  7912. _67d=null;
  7913. }
  7914. return _67d;
  7915. };
  7916. CCognosViewer.prototype.addCallback=function(_67e,oFct,_680){
  7917. if(!this.m_aCallback){
  7918. this.m_aCallback=[];
  7919. }
  7920. this.m_aCallback=this.m_aCallback.concat({m_sEvent:_67e,m_oCallback:oFct,m_bCaptureEvent:(_680===true)});
  7921. };
  7922. CCognosViewer.prototype.canDrillDown=function(sId){
  7923. var sCtx=this.findCtx(sId).split("::")[0];
  7924. if(sCtx){
  7925. var _683=this.getSelectionController();
  7926. if(_683){
  7927. return (_683.canDrillDown(sCtx));
  7928. }
  7929. }
  7930. return false;
  7931. };
  7932. CCognosViewer.prototype.canDrillUp=function(sId){
  7933. var sCtx=this.findCtx(sId).split("::")[0];
  7934. if(sCtx){
  7935. var _686=this.getSelectionController();
  7936. if(_686){
  7937. return (_686.canDrillUp(sCtx));
  7938. }
  7939. }
  7940. return false;
  7941. };
  7942. CCognosViewer.prototype.canSubmitPrompt=function(){
  7943. var _687=null;
  7944. if(this.preProcessControlArray&&this.preProcessControlArray instanceof Array){
  7945. var _688=this.preProcessControlArray.length;
  7946. for(var k=0;k<_688;k++){
  7947. _687=eval(this.preProcessControlArray[k]);
  7948. if(_687.isValid()===false){
  7949. if(!this.m_reportRenderingDone||!_687.getCascadeOnParameter||!_687.getCascadeOnParameter()){
  7950. return false;
  7951. }
  7952. }
  7953. }
  7954. }
  7955. return true;
  7956. };
  7957. CCognosViewer.prototype.closeContextMenuAndToolbarMenus=function(){
  7958. if(this.rvMainWnd){
  7959. this.rvMainWnd.closeContextMenuAndToolbarMenus();
  7960. }
  7961. };
  7962. CCognosViewer.prototype.dcm=function(_68a,_68b){
  7963. if(this.canDisplayContextMenu()){
  7964. if(this.preSelectNode==true){
  7965. _68b=false;
  7966. this.preSelectNode=false;
  7967. }
  7968. if(this.rvMainWnd.displayContextMenu(_68a,_68b)!=false){
  7969. return stopEventBubble(_68a);
  7970. }
  7971. }
  7972. };
  7973. CCognosViewer.prototype.canDisplayContextMenu=function(){
  7974. if(!this.getUIConfig()||this.getUIConfig().getShowContextMenu()){
  7975. return (!this.isWorkingOrPrompting()&&this.rvMainWnd!=null&&typeof this.bCanUseCognosViewerContextMenu!="undefined"&&this.bCanUseCognosViewerContextMenu);
  7976. }
  7977. return false;
  7978. };
  7979. CCognosViewer.prototype.de=function(_68c){
  7980. var _68d=this.getDrillMgr();
  7981. if(_68d){
  7982. _68d.singleClickDrillEvent(_68c,"RV");
  7983. }
  7984. };
  7985. CCognosViewer.prototype.debug=function(sMsg){
  7986. if(this.m_bDebug){
  7987. var _68f="";
  7988. var _690=this.debug.caller;
  7989. if(typeof _690=="object"&&_690!==null){
  7990. _68f=_690.toString().match(/function (\w*)/)[1];
  7991. }
  7992. if(!_68f){
  7993. _68f="?";
  7994. }
  7995. alert(_68f+": "+sMsg);
  7996. }
  7997. };
  7998. CCognosViewer.prototype.callbackExists=function(_691){
  7999. var _692=false;
  8000. if(this.m_aCallback&&this.m_aCallback.length){
  8001. for(var _693=0;_693<this.m_aCallback.length;++_693){
  8002. var oCB=this.m_aCallback[_693];
  8003. if(oCB.m_sEvent==_691){
  8004. return true;
  8005. }
  8006. }
  8007. }
  8008. return false;
  8009. };
  8010. CCognosViewer.prototype.executeCallback=function(_695){
  8011. var _696=false;
  8012. if(this.m_aCallback&&this.m_aCallback.length){
  8013. for(var _697=0;_697<this.m_aCallback.length;++_697){
  8014. var oCB=this.m_aCallback[_697];
  8015. if(oCB.m_sEvent==_695){
  8016. if(typeof oCB.m_oCallback=="function"){
  8017. oCB.m_oCallback();
  8018. }
  8019. if(oCB.m_bCaptureEvent){
  8020. _696=true;
  8021. }
  8022. }
  8023. }
  8024. }
  8025. return _696;
  8026. };
  8027. CCognosViewer.prototype.getCAFContext=function(){
  8028. return this.m_sCAFContext;
  8029. };
  8030. CCognosViewer.prototype.getSoapFault=function(){
  8031. return this.m_sSoapFault;
  8032. };
  8033. CCognosViewer.prototype.getColumnContextIds=function(sId){
  8034. return this.getContextIds(sId,2);
  8035. };
  8036. CCognosViewer.prototype.getConversation=function(){
  8037. return this.m_sConversation;
  8038. };
  8039. CCognosViewer.prototype.getStatus=function(){
  8040. return (this.m_sStatus?this.m_sStatus:"");
  8041. };
  8042. CCognosViewer.prototype.isWorking=function(_69a){
  8043. if(typeof _69a!="string"){
  8044. _69a=this.getStatus();
  8045. }
  8046. return ((""+_69a).match(/^(working|stillWorking)$/)?true:false);
  8047. };
  8048. CCognosViewer.prototype.isWorkingOrPrompting=function(){
  8049. return (this.getStatus().match(/^(working|stillWorking|prompting)$/)?true:false);
  8050. };
  8051. CCognosViewer.prototype.getActionState=function(){
  8052. return this.m_sActionState;
  8053. };
  8054. CCognosViewer.prototype.getDataItemName=function(sId){
  8055. var _69c=null;
  8056. var sCtx=this.findCtx(sId).split("::")[0];
  8057. if(sCtx){
  8058. var _69e=this.getSelectionController();
  8059. if(_69e){
  8060. var _69f=_69e.getRefDataItem(sCtx);
  8061. if(_69f){
  8062. _69c=_69f;
  8063. }
  8064. }
  8065. }
  8066. return _69c;
  8067. };
  8068. CCognosViewer.prototype.getDataType=function(sId){
  8069. var _6a1=null;
  8070. var sCtx=this.findCtx(sId).split("::")[0];
  8071. if(sCtx){
  8072. var _6a3=this.getSelectionController();
  8073. if(_6a3){
  8074. var _6a4=_6a3.getDataType(sCtx);
  8075. if(_6a4){
  8076. _6a1=_6a4;
  8077. }
  8078. }
  8079. }
  8080. return _6a1;
  8081. };
  8082. CCognosViewer.prototype.getDepth=function(sId){
  8083. var _6a6=null;
  8084. var sCtx=this.findCtx(sId).split("::")[0];
  8085. if(sCtx){
  8086. var _6a8=this.getSelectionController();
  8087. if(_6a8){
  8088. var _6a9=_6a8.getDepth(sCtx);
  8089. if(_6a9){
  8090. _6a6=_6a9;
  8091. }
  8092. }
  8093. }
  8094. return _6a6;
  8095. };
  8096. CCognosViewer.prototype.getDrillMgr=function(){
  8097. if(!this.m_oDrillMgr){
  8098. this.loadExtra();
  8099. if(typeof CDrillManager=="function"){
  8100. this.m_oDrillMgr=new CDrillManager(this);
  8101. this.goDrillManager=this.m_oDrillMgr;
  8102. }
  8103. }
  8104. return this.m_oDrillMgr;
  8105. };
  8106. CCognosViewer.prototype.getSubscriptionManager=function(){
  8107. if(!this.m_oSubscriptionManager){
  8108. this.loadExtra();
  8109. if(typeof CSubscriptionManager=="function"){
  8110. this.m_oSubscriptionManager=new CSubscriptionManager(this);
  8111. }
  8112. }
  8113. return this.m_oSubscriptionManager;
  8114. };
  8115. CCognosViewer.prototype.updateGlobalParameters=function(_6aa){
  8116. var oReq=new ViewerDispatcherEntry(this);
  8117. oReq.addFormField("ui.action","forward");
  8118. oReq.addFormField("generic.anyURI.runOptionEnum#globalParameters",_6aa);
  8119. oReq.addFormField("run.prompt",true);
  8120. oReq.addFormField("_promptControl","reprompt");
  8121. this.submitPromptValues(oReq);
  8122. };
  8123. CCognosViewer.prototype.getExecutionParameters=function(){
  8124. return this.m_sParameters;
  8125. };
  8126. CCognosViewer.prototype.getGateway=function(){
  8127. return this.m_sGateway;
  8128. };
  8129. CCognosViewer.prototype.getSpecification=function(){
  8130. return this.envParams["ui.spec"];
  8131. };
  8132. CCognosViewer.prototype.getHierarchyUniqueName=function(sId){
  8133. var sHun=null;
  8134. var sCtx=this.findCtx(sId).split("::")[0];
  8135. if(sCtx){
  8136. var _6af=this.getSelectionController();
  8137. if(_6af){
  8138. var aHUN=_6af.getHun(sCtx);
  8139. if(aHUN){
  8140. sHun=aHUN;
  8141. }
  8142. }
  8143. }
  8144. return sHun;
  8145. };
  8146. CCognosViewer.prototype.getDimensionUniqueName=function(sId){
  8147. var sCtx=this.findCtx(sId).split("::")[0];
  8148. if(sCtx){
  8149. var _6b3=this.getSelectionController();
  8150. if(_6b3){
  8151. var aDUN=_6b3.getDun(sCtx);
  8152. if(aDUN){
  8153. return aDUN;
  8154. }
  8155. }
  8156. }
  8157. return null;
  8158. };
  8159. CCognosViewer.prototype.getId=function(){
  8160. return this.m_sId;
  8161. };
  8162. CCognosViewer.prototype.getLevelId=function(sId){
  8163. var _6b6=null;
  8164. var sCtx=this.findCtx(sId).split("::")[0];
  8165. if(sCtx){
  8166. var _6b8=this.getSelectionController();
  8167. if(_6b8){
  8168. var aLUN=_6b8.getLun(sCtx);
  8169. if(aLUN){
  8170. _6b6=aLUN;
  8171. }
  8172. }
  8173. }
  8174. return _6b6;
  8175. };
  8176. CCognosViewer.prototype.getMemberUniqueName=function(sId){
  8177. var sMUN=null;
  8178. var sCtx=this.findCtx(sId).split("::")[0];
  8179. if(sCtx){
  8180. var _6bd=this.getSelectionController();
  8181. if(_6bd){
  8182. var aMUN=_6bd.getMun(sCtx);
  8183. if(aMUN){
  8184. sMUN=aMUN;
  8185. }
  8186. }
  8187. }
  8188. return sMUN;
  8189. };
  8190. CCognosViewer.prototype.getObjectId=function(){
  8191. var _6bf="window";
  8192. if(typeof this.getId()=="string"){
  8193. _6bf=getCognosViewerObjectRefAsString(this.getId());
  8194. }
  8195. return _6bf;
  8196. };
  8197. CCognosViewer.prototype.getQueryModelId=function(sId){
  8198. var _6c1=null;
  8199. var sCtx=this.findCtx(sId).split("::")[0];
  8200. if(sCtx){
  8201. var _6c3=this.getSelectionController();
  8202. if(_6c3){
  8203. var _6c4=_6c3.getQueryModelId(sCtx);
  8204. if(_6c4){
  8205. _6c1=_6c4;
  8206. }
  8207. }
  8208. }
  8209. return _6c1;
  8210. };
  8211. CCognosViewer.prototype.getQueryName=function(sId){
  8212. var _6c6=null;
  8213. var sCtx=this.findCtx(sId).split("::")[0];
  8214. if(sCtx){
  8215. var _6c8=this.getSelectionController();
  8216. if(_6c8){
  8217. var _6c9=_6c8.getRefQuery(sCtx);
  8218. if(_6c9){
  8219. _6c6=_6c9;
  8220. }
  8221. }
  8222. }
  8223. return _6c6;
  8224. };
  8225. CCognosViewer.prototype.getContextIds=function(sId,_6cb){
  8226. var aIds=[];
  8227. var sCtx=this.findCtx(sId);
  8228. if(sCtx){
  8229. var _6ce=sCtx.split("::");
  8230. if(_6ce&&_6ce.length>1&&_6cb<_6ce.length){
  8231. aIds=_6ce[_6cb].split(":");
  8232. }
  8233. }
  8234. return aIds;
  8235. };
  8236. CCognosViewer.prototype.getRowContextIds=function(sId){
  8237. return this.getContextIds(sId,1);
  8238. };
  8239. CCognosViewer.prototype.getPageContextIds=function(sId){
  8240. return this.getContextIds(sId,3);
  8241. };
  8242. CCognosViewer.prototype.getString=function(sKey){
  8243. if(RV_RES&&RV_RES[sKey]){
  8244. return RV_RES[sKey];
  8245. }
  8246. return sKey;
  8247. };
  8248. CCognosViewer.prototype.getRV=function(){
  8249. if(typeof this.m_oCVMgr=="object"){
  8250. return this.m_oCVMgr;
  8251. }
  8252. return window;
  8253. };
  8254. CCognosViewer.prototype.getSecondaryRequests=function(){
  8255. return this.m_aSecRequests;
  8256. };
  8257. CCognosViewer.prototype.getTracking=function(){
  8258. return this.m_sTracking;
  8259. };
  8260. CCognosViewer.prototype.findCtx=function(sId){
  8261. var sCtx="";
  8262. if(typeof sId=="string"){
  8263. var aCtx=this.getReportContextHelper().processCtx(sId);
  8264. var _6d5=aCtx[0][0];
  8265. var _6d6=this.getSelectionController();
  8266. if(_6d6){
  8267. if(_6d6.isContextId(_6d5)){
  8268. sCtx=sId;
  8269. }
  8270. }
  8271. }
  8272. if(!sCtx){
  8273. var _6d7=this.findElementWithCtx(sId);
  8274. if(_6d7){
  8275. sCtx=_6d7.getAttribute("ctx");
  8276. }
  8277. }
  8278. return sCtx;
  8279. };
  8280. CCognosViewer.prototype.findElementWithCtx=function(sId){
  8281. var _6d9=sId;
  8282. if(typeof sId=="string"){
  8283. _6d9=this.findElementWithCtx(document.getElementById(sId));
  8284. }
  8285. if(_6d9){
  8286. if(_6d9.getAttribute&&_6d9.getAttribute("ctx")){
  8287. return _6d9;
  8288. }
  8289. for(var _6da=0;_6da<_6d9.childNodes.length;_6da++){
  8290. var _6db=this.findElementWithCtx(_6d9.childNodes[_6da]);
  8291. if(_6db){
  8292. return _6db;
  8293. }
  8294. }
  8295. }
  8296. return null;
  8297. };
  8298. CCognosViewer.prototype.getUseValue=function(sId){
  8299. var sVal=null;
  8300. var sCtx=this.findCtx(sId).split("::")[0];
  8301. if(sCtx){
  8302. var _6df=this.getSelectionController();
  8303. if(_6df){
  8304. sVal=_6df.getUseValue(sCtx);
  8305. }
  8306. }
  8307. return sVal;
  8308. };
  8309. CCognosViewer.prototype.init=function(_6e0){
  8310. if(_6e0&&typeof _6e0=="object"){
  8311. for(var _6e1 in _6e0){
  8312. this[_6e1]=_6e0[_6e1];
  8313. }
  8314. }
  8315. };
  8316. CCognosViewer.prototype.initViewer=function(_6e2){
  8317. var _6e3=new RequestHandler(this);
  8318. var _6e4=document.getElementById("formBackJax"+this.getId());
  8319. if(_6e4&&typeof _6e4.state!="undefined"&&_6e4.state.value.length>0){
  8320. _6e3.loadReportHTML(_6e4.result.value);
  8321. var _6e5=eval("("+_6e4.state.value+")");
  8322. _6e3.updateViewerState(_6e5);
  8323. _6e3.postComplete();
  8324. }else{
  8325. if(this.getUsePageRequest()){
  8326. var _6e6=_6e2?_6e2.m_sStatus:null;
  8327. if(isIE()){
  8328. if(window.location.hash=="#working"){
  8329. window.history.go(-2);
  8330. return;
  8331. }else{
  8332. if(_6e6==="working"||_6e6==="stillWorking"){
  8333. window.location.hash="#working";
  8334. }
  8335. }
  8336. }else{
  8337. if(_6e4&&_6e4.working){
  8338. if(_6e4.working.value=="true"){
  8339. window.history.go(-1);
  8340. return;
  8341. }else{
  8342. if(_6e6==="working"||_6e6==="stillWorking"){
  8343. _6e4.working.value="true";
  8344. }
  8345. }
  8346. }
  8347. }
  8348. }
  8349. _6e3.processInitialResponse(_6e2);
  8350. }
  8351. };
  8352. CCognosViewer.prototype.saveBackJaxInformation=function(_6e7){
  8353. var _6e8=document.getElementById("formBackJax"+this.getId());
  8354. if(_6e8){
  8355. if(typeof _6e8.state!="undefined"){
  8356. _6e8.state.value=_6e7.getResponseStateText();
  8357. }
  8358. if(typeof _6e8.result!="undefined"){
  8359. _6e8.result.value=_6e7.getResult();
  8360. }
  8361. }
  8362. };
  8363. CCognosViewer.prototype.pcc=function(evt){
  8364. if(evt&&typeof evt.button!="undefined"&&evt.button!="1"){
  8365. this.preSelectNode=true;
  8366. var _6ea=this.getSelectionController();
  8367. if(_6ea){
  8368. _6ea.pageContextClicked(evt);
  8369. }
  8370. }
  8371. };
  8372. CCognosViewer.prototype.isValidAjaxResponse=function(_6eb){
  8373. return (_6eb&&_6eb.childNodes&&_6eb.childNodes.length>0&&_6eb.childNodes[0].nodeName!="parsererror"?true:false);
  8374. };
  8375. CCognosViewer.prototype.resubmitInSafeMode=function(_6ec){
  8376. if(this.m_bUseSafeMode){
  8377. this.resetViewerDispatcher();
  8378. this.setUsePageRequest(true);
  8379. this.envParams["cv.useAjax"]="false";
  8380. if(_6ec){
  8381. _6ec.retryRequest();
  8382. }
  8383. }
  8384. };
  8385. CCognosViewer.prototype.showLoadedContent=function(_6ed){
  8386. if(_6ed!==null&&typeof _6ed!="undefined"){
  8387. _6ed.style.display="block";
  8388. }
  8389. this.m_resizeReady=true;
  8390. this.doneLoading();
  8391. var obj=this;
  8392. setTimeout(function(){
  8393. obj.renderTabs();
  8394. },1);
  8395. };
  8396. CCognosViewer.prototype.doneLoading=function(){
  8397. var _6ef=this.getViewerWidget();
  8398. if(_6ef){
  8399. if(window.IBM&&window.IBM.perf){
  8400. window.IBM.perf.log("viewer_doneLoading",this);
  8401. }
  8402. var _6f0=this.getStatus();
  8403. if(!this.m_reportRenderingDone&&this.m_resizeReady&&this.m_stateSet){
  8404. var _6f1=_6f0=="working"||_6f0=="stillWorking"||_6f0=="fault";
  8405. _6ef.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:_6f1});
  8406. if(_6f0=="complete"){
  8407. if(window.IBM&&window.IBM.perf){
  8408. window.IBM.perf.log("viewer_doneLoading",this);
  8409. }
  8410. if(typeof _6ef.postLoadContent=="function"){
  8411. _6ef.postLoadContent();
  8412. }
  8413. this.m_reportRenderingDone=true;
  8414. if(!_6f1){
  8415. var _6f2=this;
  8416. setTimeout(function(){
  8417. _6f2.m_readyToRespondToResizeEvent=true;
  8418. },20);
  8419. }
  8420. }
  8421. }
  8422. if(_6f0!="fault"){
  8423. _6ef.clearErrorDlg();
  8424. }
  8425. this.doneLoadingUpdateA11Y(_6f0);
  8426. }else{
  8427. var _6f0=this.getStatus();
  8428. if(_6f0=="complete"){
  8429. this.m_reportRenderingDone=true;
  8430. this.JAWSTalk(RV_RES.IDS_JS_READY);
  8431. }else{
  8432. if(_6f0=="working"){
  8433. this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
  8434. }
  8435. }
  8436. }
  8437. };
  8438. CCognosViewer.prototype.doneLoadingUpdateA11Y=function(_6f3){
  8439. if(this.getKeepFocus()!==false&&this.getKeepFocus()!=null){
  8440. var _6f4=this.getKeepFocus();
  8441. if(_6f3=="complete"){
  8442. this.setKeepFocus(false);
  8443. }
  8444. var _6f5=null;
  8445. if(this.getVisibleDialog()!==null){
  8446. _6f5=this.getVisibleDialog().getDialogDiv();
  8447. }else{
  8448. if(_6f4===true){
  8449. _6f5=document.getElementById("CVReport"+this.getId());
  8450. }else{
  8451. if(typeof _6f4=="string"){
  8452. _6f5=document.getElementById(_6f4);
  8453. }else{
  8454. if(_6f4!==null){
  8455. _6f5=_6f4;
  8456. if(this.isBux){
  8457. dojo.window.scrollIntoView(_6f5);
  8458. }
  8459. }
  8460. }
  8461. }
  8462. }
  8463. if(_6f5){
  8464. setFocusToFirstTabItem(_6f5);
  8465. }
  8466. if(_6f3=="complete"){
  8467. this.JAWSTalk(RV_RES.IDS_JS_READY);
  8468. }else{
  8469. if(_6f3=="working"||_6f3=="stillWorking"){
  8470. this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
  8471. }
  8472. }
  8473. }
  8474. };
  8475. CCognosViewer.prototype.JAWSTalk=function(_6f6){
  8476. if(this.isMobile()||this.isIWidgetMobile()){
  8477. return;
  8478. }
  8479. var id=this.getId();
  8480. var div=document.getElementById("JAWS_Alert_"+id);
  8481. if(div){
  8482. div.parentNode.removeChild(div);
  8483. }
  8484. div=document.createElement("div");
  8485. div.id="JAWS_Alert_"+id;
  8486. div.style.position="absolute";
  8487. div.style.top="-9000px";
  8488. div.style.display="none";
  8489. div.setAttribute("role","alert");
  8490. div.appendChild(document.createTextNode(_6f6));
  8491. var _6f9=document.getElementById("RVContent"+id);
  8492. if(_6f9){
  8493. _6f9.appendChild(div);
  8494. }else{
  8495. if(typeof console!="undefined"&&console&&console.log){
  8496. console.log("CCognosViewer: Could not find the Viewer div to append the JAWS alert.");
  8497. }
  8498. }
  8499. };
  8500. CCognosViewer.prototype.canInsertExpandIconsForAllCrosstabs=function(){
  8501. if(this.isLimitedInteractiveMode()||this.isBlacklisted("ExpandMember")||this.isIWidgetMobile()){
  8502. return false;
  8503. }
  8504. var _6fa=this.getAdvancedServerProperty("VIEWER_JS_EXPAND_COLLAPSE_CONTROLS_DEFAULT");
  8505. if(_6fa===null){
  8506. return false;
  8507. }
  8508. var _6fb=this.getViewerWidget().getProperties().getShowExpandCollapseIconFlag();
  8509. return (_6fa.toLowerCase()==="on"&&_6fb!==false)||(_6fa.toLowerCase()==="off"&&_6fb===true);
  8510. };
  8511. CCognosViewer.prototype.setMaxContentSize=function(){
  8512. if("10"!=window.getIEVersion()){
  8513. return;
  8514. }
  8515. if(document.body.className==="viewer"){
  8516. var _6fc=document.body.offsetHeight;
  8517. var _6fd=this.getNonReportHeight(document.getElementById("CVReport"+this.getId()));
  8518. var _6fe=document.getElementById("mainViewerTable"+this.getId());
  8519. _6fe.style.maxHeight=_6fc-_6fd-2+"px";
  8520. var _6ff=GUtil.generateCallback(this.setMaxContentSize,[true],this);
  8521. if(!this.attachedOnResize){
  8522. this.attachedOnResize=true;
  8523. if(window.attachEvent){
  8524. window.attachEvent("onresize",_6ff);
  8525. }else{
  8526. if(window.addEventListener){
  8527. window.addEventListener("resize",_6ff,false);
  8528. }
  8529. }
  8530. }
  8531. }
  8532. };
  8533. CCognosViewer.prototype.getNonReportHeight=function(node){
  8534. var _701=0;
  8535. var _702=node.parentNode;
  8536. if(!_702){
  8537. return _701;
  8538. }
  8539. if(_702.childNodes.length>1){
  8540. for(var i=0;i<_702.childNodes.length;i++){
  8541. var _704=_702.childNodes[i];
  8542. if(_704!=node&&!isNaN(_704.clientHeight)&&_704.style.display!="none"){
  8543. _701+=_704.clientHeight;
  8544. }
  8545. }
  8546. }
  8547. if(node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
  8548. _701+=this.getNonReportHeight(_702);
  8549. }
  8550. return _701;
  8551. };
  8552. CCognosViewer.prototype.addPageAdornments=function(){
  8553. this.m_layoutElements=null;
  8554. this.m_lidToElement=null;
  8555. this.initFlashCharts();
  8556. this.insertSortIconsForAllLists();
  8557. var _705=this.getViewerWidget().getProperties();
  8558. if(this.canInsertExpandIconsForAllCrosstabs()){
  8559. this.insertExpandIconsForAllCrosstabs();
  8560. }
  8561. var _706=document.getElementById("CVReport"+this.getId());
  8562. if(_706){
  8563. var oCV=this;
  8564. setTimeout(function(){
  8565. if(oCV.getPinFreezeManager()&&oCV.getPinFreezeManager().hasFrozenContainers()){
  8566. oCV.getPinFreezeManager().renderReportWithFrozenContainers(_706);
  8567. }
  8568. oCV.addInfoBar();
  8569. },1);
  8570. }
  8571. this.getViewerWidget().reselectSelectionFilterObjects();
  8572. this.getViewerWidget().addChromeWhitespaceHandler(this.getId());
  8573. };
  8574. CCognosViewer.prototype.addFlashChart=function(_708){
  8575. this.m_flashChartsObjectIds.push(_708);
  8576. };
  8577. CCognosViewer.prototype.flashChartError=function(_709){
  8578. var _70a=this.getViewerWidget();
  8579. var _70b=_70a.getProperties();
  8580. _70b.setProperty("flashCharts",false);
  8581. var _70c=this.getAction("Redraw");
  8582. _70c.isUndoable=function(){
  8583. return false;
  8584. };
  8585. _70c.execute();
  8586. };
  8587. CCognosViewer.prototype.initFlashCharts=function(){
  8588. var _70d=this.getViewerWidget();
  8589. if(this.m_flashChartsObjectIds.length>0){
  8590. var _70e=document.getElementById("rt"+this.getId());
  8591. if(window.addEventListener){
  8592. _70e.addEventListener("mousedown",onFlashChartRightClick,true);
  8593. }else{
  8594. var _70f={};
  8595. var _710=function(){
  8596. this.releaseCapture();
  8597. };
  8598. var _711=function(){
  8599. onFlashChartRightClick(event);
  8600. this.setCapture();
  8601. };
  8602. for(var i=0;i<this.m_flashChartsObjectIds.length;++i){
  8603. var _713=this.m_flashChartsObjectIds[i];
  8604. var _714=document.getElementById(_713);
  8605. _70f[_713]=1;
  8606. _714.parentNode.onmouseup=_710;
  8607. _714.parentNode.onmousedown=_711;
  8608. }
  8609. if(this.m_flashChartsObjectIds.length>0){
  8610. _70e.attachEvent("oncontextmenu",function(){
  8611. if(_70f[window.event.srcElement.id]){
  8612. return false;
  8613. }
  8614. });
  8615. }
  8616. }
  8617. if(_70d){
  8618. _70d.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,true);
  8619. }
  8620. }else{
  8621. if(_70d){
  8622. _70d.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,false);
  8623. }
  8624. }
  8625. };
  8626. CCognosViewer.prototype.initializeLayoutElements=function(){
  8627. var _715=document.getElementById("rt"+this.getId());
  8628. var _716=getElementsByAttribute(_715,"*","lid");
  8629. this.m_lidToElement={};
  8630. this.m_layoutElements=[];
  8631. var _717=0;
  8632. var _718=this.getPinFreezeManager();
  8633. for(var i=0;i<_716.length;i++){
  8634. var e=_716[i];
  8635. if(!_718||!_718.getContainerElement(e)||_718.isElementInMainOutput(e)){
  8636. this.m_layoutElements[_717]=e;
  8637. this.m_lidToElement[e.getAttribute("lid")]=e;
  8638. _717++;
  8639. }
  8640. }
  8641. };
  8642. CCognosViewer.prototype.getLayoutElement=function(_71b){
  8643. if(!this.m_layoutElements){
  8644. this.initializeLayoutElements();
  8645. }
  8646. if(this.m_layoutElements){
  8647. return this.m_layoutElements[_71b];
  8648. }
  8649. return null;
  8650. };
  8651. CCognosViewer.prototype.getLayoutElementFromLid=function(lid){
  8652. if(!this.m_lidToElement){
  8653. this.initializeLayoutElements();
  8654. }
  8655. return this.m_lidToElement[lid];
  8656. };
  8657. CCognosViewer.prototype.getInfoBars=function(){
  8658. return this.m_aInfoBar?this.m_aInfoBar:null;
  8659. };
  8660. CCognosViewer.prototype.addInfoBar=function(){
  8661. if(this.getAdvancedServerProperty("VIEWER_JS_HIDE_INFO_BAR")==="true"){
  8662. return;
  8663. }
  8664. var _71d=this.getRAPReportInfo();
  8665. if(_71d){
  8666. var _71e=document.getElementById("rt"+this.getId());
  8667. this.initializeLayoutElements();
  8668. var _71f=[];
  8669. this.m_aInfoBar=[];
  8670. for(var _720=0;_720<this.m_layoutElements.length;++_720){
  8671. var _721=this.m_layoutElements[_720];
  8672. var lid=_721.getAttribute("lid");
  8673. if(lid){
  8674. if(lid.indexOf("RAP_NDH_")>-1){
  8675. lid=lid.substring(8);
  8676. }
  8677. lid=lid.substring(0,lid.indexOf(this.getId()));
  8678. }
  8679. var _723=_71d.getContainer(lid);
  8680. if(_723&&typeof _723.parentContainer=="undefined"){
  8681. var _724=this.collectChildContainers(_723.container);
  8682. if(this.getPinFreezeManager()){
  8683. oPinFreezeContainerElement=this.getPinFreezeManager().getContainerElement(_721);
  8684. _721=(oPinFreezeContainerElement)?oPinFreezeContainerElement:_721;
  8685. }
  8686. var _725=new InfoBar(this,_721,_723,_724,_720);
  8687. _725.setTimingDetails(_71d._getEventTimings());
  8688. _725.render();
  8689. if(_725.hasSomethingRendered()){
  8690. _71f.push(_725.getId());
  8691. }
  8692. this.m_aInfoBar.push(_725);
  8693. }
  8694. }
  8695. var _726=this.getViewerWidget();
  8696. if(_726){
  8697. _726.refreshInfoBarRenderedState(_71f);
  8698. }
  8699. }
  8700. };
  8701. CCognosViewer.prototype.collectChildContainers=function(_727){
  8702. var _728=[];
  8703. var _729=this.getRAPReportInfo();
  8704. if(_729){
  8705. var _72a=_729.getContainerCount();
  8706. for(var cidx=0;cidx<_72a;++cidx){
  8707. var _72c=_729.getContainerFromPos(cidx);
  8708. if(typeof _72c.parentContainer!="undefined"&&_72c.parentContainer==_727){
  8709. _728.push(_72c);
  8710. }
  8711. }
  8712. }
  8713. return _728;
  8714. };
  8715. CCognosViewer.prototype.addReportInfo=function(){
  8716. var _72d=this.getViewerWidget();
  8717. if(typeof _72d==="undefined"||_72d===null){
  8718. return;
  8719. }
  8720. if(!_72d.getAttributeValue("originalReport")||this.isIWidgetMobile()){
  8721. return;
  8722. }
  8723. var _72e=this.envParams["baseReportModificationTime"];
  8724. var _72f=_72d.getAttributeValue("baseReportModificationTime");
  8725. if(typeof _72e!=="undefined"&&typeof _72f!=="undefined"&&_72f&&_72f!="<empty>"&&_72e!==_72f){
  8726. var cvid=this.getId();
  8727. var _731=document.getElementById("CVReport"+cvid);
  8728. var _732=_731.parentNode;
  8729. var id="ReportInfo"+cvid;
  8730. var _734=document.createElement("div");
  8731. _734.setAttribute("id",id+"_container");
  8732. _734.setAttribute("cvid",cvid);
  8733. _734.className="new-info-indicator BUXNoPrint";
  8734. var _735=document.createElement("img");
  8735. var img=null;
  8736. if(this.getDirection()==="rtl"){
  8737. img="/rv/images/action_show_info_rtl.png";
  8738. }else{
  8739. img="/rv/images/action_show_info.png";
  8740. }
  8741. _735.src=this.getWebContentRoot()+img;
  8742. _735.className="reportInfoIcon";
  8743. _735.setAttribute("tabIndex","0");
  8744. _735.setAttribute("alt","");
  8745. _735.setAttribute("title","");
  8746. _735.setAttribute("role","presentation");
  8747. var _737=RV_RES.IDS_JS_REPORT_INFO_TITLE;
  8748. var _738=RV_RES.IDS_JS_REPORT_INFO_TEXT;
  8749. var _739=RV_RES.IDS_JS_REPORT_INFO_LINK_TEXT;
  8750. _734.appendChild(_735);
  8751. _732.insertBefore(_734,_731);
  8752. this.m_reportInfoTooltip=new bux.reportViewer.ReportInfo({connectId:[id+"_container"],focusElement:_735,position:["above","below"],title:_737,text:_738,linkText:_739,linkScript:getCognosViewerObjectRefAsString(cvid)+".reportInfoResetReport();",allowMouseOverToolTip:true});
  8753. }
  8754. };
  8755. CCognosViewer.prototype.reportInfoResetReport=function(){
  8756. this.executeAction("ResetToOriginal");
  8757. };
  8758. CCognosViewer.prototype.hideReportInfo=function(){
  8759. var _73a=document.getElementById("ReportInfo"+this.getId()+"_container");
  8760. if(typeof _73a!=="undefined"&&_73a!==null){
  8761. _73a.style.visibility="hidden";
  8762. }
  8763. };
  8764. CCognosViewer.prototype.insertSortIcons=function(){
  8765. var _73b=this.envParams?this.envParams.limitedInteractiveMode:true;
  8766. if(typeof _73b==="undefined"||_73b===true){
  8767. return;
  8768. }
  8769. if(this.envParams["ui.action"]==="run"||this.envParams["ui.primaryAction"]==="run"){
  8770. this.insertSortIconsForAllLists();
  8771. }
  8772. };
  8773. CCognosViewer.prototype._getContainers=function(_73c){
  8774. var _73d=[];
  8775. var _73e="",_73f="";
  8776. if(_73c==="list"){
  8777. _73e="list";
  8778. _73f="ls";
  8779. }else{
  8780. if(_73c==="crosstab"){
  8781. _73e="crosstab";
  8782. _73f="xt";
  8783. }
  8784. }
  8785. var _740=document.getElementById("CVReport"+this.getId());
  8786. if(this.getRAPReportInfo()){
  8787. var _741=this.getRAPReportInfo().getContainerIds(_73e);
  8788. for(var i=0;i<_741.length;++i){
  8789. var _743=getElementsByAttribute(_740,"table","lid",_741[i]+this.getId(),1);
  8790. if(_743&&_743.length>0){
  8791. _73d.push(_743[0]);
  8792. }
  8793. }
  8794. }else{
  8795. _73d=getElementsByClassName(_740,"table",_73f);
  8796. }
  8797. return _73d;
  8798. };
  8799. CCognosViewer.prototype.insertSortIconsForAllLists=function(){
  8800. var _744=this._getContainers("list");
  8801. for(var i=0;i<_744.length;++i){
  8802. this.insertSortIconsToList(_744[i]);
  8803. }
  8804. };
  8805. CCognosViewer.prototype.insertSortIconsToList=function(_746){
  8806. var _747=getElementsByAttribute(_746,"*","type","columnTitle");
  8807. for(var i=0;i<_747.length;++i){
  8808. var _749=_747[i];
  8809. this.getSelectionController().getSelectionObjectFactory().getSelectionObject(_749);
  8810. if(_749.getAttribute("canSort")!="false"&&_749.getAttribute("CTNM")===null&&_749.getAttribute("CC")===null){
  8811. var _74a=false;
  8812. for(var _74b=0;_74b<_749.childNodes.length;_74b++){
  8813. var _74c=_749.childNodes[_74b];
  8814. if(_74c.nodeName.toLowerCase()=="img"){
  8815. if(_74c.id&&_74c.id.indexOf("sortimg")===0){
  8816. _74a=true;
  8817. break;
  8818. }
  8819. var sLid=_74c.getAttribute("lid");
  8820. if(sLid&&sLid.indexOf("SortIcon")!==-1){
  8821. _749.removeChild(_74c);
  8822. break;
  8823. }
  8824. }
  8825. }
  8826. if(!_74a&&this.canInsertSortIcon(_749)){
  8827. this.insertSortIconToColumnHeader(_749);
  8828. }
  8829. }
  8830. }
  8831. };
  8832. CCognosViewer.prototype.isDrillBlackListed=function(){
  8833. if(typeof this.m_bDrillBlacklisted=="undefined"){
  8834. this.m_bDrillBlacklisted=this.isBlacklisted("DrillDown")||this.isBlacklisted("DrillUp");
  8835. }
  8836. return this.m_bDrillBlacklisted;
  8837. };
  8838. CCognosViewer.prototype.isBlacklisted=function(item){
  8839. return this.UIBlacklist&&this.UIBlacklist.indexOf(" "+item+" ")>0;
  8840. };
  8841. CCognosViewer.prototype.canInsertSortIcon=function(_74f){
  8842. var _750=_74f.getAttribute("rp_sort");
  8843. return ((!this.isLimitedInteractiveMode()&&!this.isBlacklisted("Sort"))||(_750!==undefined&&_750!==null&&_750.length>0));
  8844. };
  8845. CCognosViewer.prototype.insertSortIconToColumnHeader=function(_751){
  8846. if(!_751.style.whiteSpace){
  8847. _751.style.whiteSpace="nowrap";
  8848. }
  8849. var _752=document.createElement("img");
  8850. _752.setAttribute("id","sortimg"+Math.random());
  8851. if((!this.isLimitedInteractiveMode()&&!this.isBlacklisted("Sort"))){
  8852. _752.onmouseover=function(){
  8853. this.setAttribute("oldClassName",this.className);
  8854. this.className+=" sortIconOver";
  8855. };
  8856. _752.onmouseout=function(){
  8857. this.className=this.getAttribute("oldClassName");
  8858. this.removeAttribute("oldClassName");
  8859. };
  8860. }
  8861. _752.src=this.getImgSrc(_751);
  8862. var _753=this.getSortInfo(_751);
  8863. var _754=this.getSortOrder(_753);
  8864. _752.setAttribute("alt",this.getSortAltText(_754));
  8865. _752.setAttribute("title",this.getSortAltText(_754));
  8866. _752.className=this.getSortClass(_753);
  8867. _752.setAttribute("sortOrder",_754);
  8868. _751.appendChild(_752);
  8869. };
  8870. CCognosViewer.prototype.canInsertShowExpandCollapseIconForNode=function(_755,_756){
  8871. var _757=this.getSelectionController();
  8872. var _758=_757.hasCalculationMetadata(_756,[_756],"crosstab");
  8873. return ((_757.canDrillDown(_756)||_755.alwaysCanExpandCollapse)&&!_757.isCalculationOrMeasure(_756,_758));
  8874. };
  8875. CCognosViewer.prototype.insertExpandIconsForAllCrosstabs=function(){
  8876. var _759=this._getContainers("crosstab");
  8877. var _75a=this;
  8878. var _75b=this.getRAPReportInfo();
  8879. var _75c=this.getReportContextHelper();
  8880. for(var i=0;i<_759.length;i++){
  8881. var _75e=_759[i];
  8882. var _75f=_75e.getAttribute("lid");
  8883. _75f=_75f.substring(0,_75f.length-this.getId().length);
  8884. var _760=getElementsByAttribute(_75e,["td","th"],"ctnm","true");
  8885. for(var j=0;j<_760.length;j++){
  8886. var _762=_760[j];
  8887. var sCtx=this.findCtx(_762);
  8888. var _764=_75c.getDataItemName(sCtx);
  8889. if(_764){
  8890. var _765=_75b.getItemInfo(_75f,_764);
  8891. var _766=_75c.processCtx(sCtx);
  8892. if(this.canInsertShowExpandCollapseIconForNode(_765,_766[0][0])){
  8893. var sMun=_75c.getMun(sCtx);
  8894. var _768=sMun&&_765.expandedMembers&&_765.expandedMembers[sMun]===true;
  8895. var _769=document.createElement("div");
  8896. _769.setAttribute("skipSelection","true");
  8897. _769.className="expandButton "+(_768?"collapse":"expand");
  8898. _762.insertBefore(_769,_762.firstChild);
  8899. var _76a=document.createElement("span");
  8900. _76a.className="expandButtonCaption";
  8901. _76a.innerHTML=(_768?"[-]":"[+]");
  8902. _769.appendChild(_76a);
  8903. }
  8904. }
  8905. }
  8906. }
  8907. };
  8908. CCognosViewer.prototype.removeExpandIconsForAllCrosstabs=function(){
  8909. var _76b=this._getContainers("crosstab");
  8910. for(var i=0;i<_76b.length;i++){
  8911. var _76d=_76b[i];
  8912. var _76e=_76d.getAttribute("lid");
  8913. _76e=_76e.substring(0,_76e.length-this.getId().length);
  8914. var _76f=getElementsByAttribute(_76d,"td","ctnm","true");
  8915. for(var j=0;j<_76f.length;j++){
  8916. var _771=_76f[j];
  8917. if(_771.firstChild.className==="expandButton collapse"||_771.firstChild.className==="expandButton expand"){
  8918. _771.removeChild(_771.firstChild);
  8919. }
  8920. }
  8921. }
  8922. };
  8923. CCognosViewer.prototype.fillInContextData=function(){
  8924. if(!this.isLimitedInteractiveMode()){
  8925. var _772=document.getElementById("CVReport"+this.getId());
  8926. var _773=getElementsByClassName(_772,"table","ls");
  8927. for(var i=0;i<_773.length;++i){
  8928. var _775=getElementsByAttribute(_773[i],"*","type","columnTitle");
  8929. for(var j=0;j<_775.length;++j){
  8930. this.getSelectionController().getSelectionObjectFactory().getSelectionObject(_775[j]);
  8931. }
  8932. }
  8933. }
  8934. };
  8935. CCognosViewer.prototype.getSortAltText=function(_777){
  8936. if(_777==="ascending"){
  8937. return RV_RES.IDS_JS_SORT_ASCENDING;
  8938. }else{
  8939. if(_777==="descending"){
  8940. return RV_RES.IDS_JS_SORT_DESCENDING;
  8941. }else{
  8942. if(_777==="nosort"){
  8943. return RV_RES.IDS_JS_NOT_SORTED;
  8944. }
  8945. }
  8946. }
  8947. };
  8948. CCognosViewer.prototype.getSortInfo=function(_778){
  8949. var _779=_778.getAttribute("rp_sort");
  8950. if(_779){
  8951. _779=_779.split(".");
  8952. }
  8953. return _779;
  8954. };
  8955. CCognosViewer.prototype.getSortClass=function(_77a){
  8956. var _77b="sortIconHidden";
  8957. if(_77a){
  8958. if(_77a[0]==="d"||_77a[0]==="a"){
  8959. _77b="sortIconVisible";
  8960. }
  8961. }
  8962. return _77b;
  8963. };
  8964. CCognosViewer.prototype.getSortOrder=function(_77c){
  8965. var _77d="nosort";
  8966. if(_77c){
  8967. if(_77c[0]==="d"){
  8968. _77d="descending";
  8969. }else{
  8970. if(_77c[0]==="a"){
  8971. _77d="ascending";
  8972. }
  8973. }
  8974. }
  8975. return _77d;
  8976. };
  8977. CCognosViewer.prototype.getImgSrc=function(_77e){
  8978. var _77f=_77e.getAttribute("rp_sort");
  8979. var src=this.getWebContentRoot()+"/rv/images/"+this.getSortIconName(_77f);
  8980. return src;
  8981. };
  8982. CCognosViewer.prototype.getSortIconName=function(_781){
  8983. var _782="sort_no.gif";
  8984. if(_781){
  8985. _781=_781.split(".");
  8986. if(_781[0]==="d"){
  8987. _782="sort_descending.gif";
  8988. }else{
  8989. if(_781[0]==="a"){
  8990. _782="sort_ascending.gif";
  8991. }
  8992. }
  8993. }
  8994. return _782;
  8995. };
  8996. CCognosViewer.prototype.shouldWriteNavLinks=function(){
  8997. if(this.envParams["cv.navlinks"]=="false"){
  8998. return false;
  8999. }else{
  9000. if(!this.getUIConfig()||this.getUIConfig().getShowPageNavigation()){
  9001. if(this.rvMainWnd||(this.isBux&&!this.isActiveReport())){
  9002. return true;
  9003. }
  9004. }
  9005. }
  9006. return false;
  9007. };
  9008. CCognosViewer.prototype.isActiveReport=function(){
  9009. if(this.envParams["cv.responseFormat"]==="activeReport"){
  9010. return true;
  9011. }
  9012. return false;
  9013. };
  9014. CCognosViewer.prototype.resetRaiseSharePromptEventFlag=function(){
  9015. this.m_raiseSharePromptEvent=true;
  9016. };
  9017. CCognosViewer.prototype.resetbHasPromptFlag=function(){
  9018. this.m_bHasPrompt=null;
  9019. };
  9020. CCognosViewer.prototype.disableRaiseSharePromptEvent=function(){
  9021. this.m_raiseSharePromptEvent=false;
  9022. };
  9023. CCognosViewer.prototype.widgetHasPromptParameters=function(){
  9024. var _783=this.getViewerWidget();
  9025. return (_783&&_783.promptParametersRetrieved==true&&this.envParams&&typeof this.envParams["reportPrompts"]!="undefined"&&this.envParams["reportPrompts"]!=null&&this.envParams["reportPrompts"].length>0);
  9026. };
  9027. CCognosViewer.prototype.getPromptParametersInfo=function(){
  9028. var _784=null;
  9029. if(this.widgetHasPromptParameters()){
  9030. _784="<widget><parameterValues>"+sXmlEncode(this.getExecutionParameters())+"</parameterValues>"+this.envParams["reportPrompts"]+"</widget>";
  9031. }
  9032. return _784;
  9033. };
  9034. CCognosViewer.prototype.raisePromptEvent=function(_785,_786,_787){
  9035. try{
  9036. var _788=this.getViewerWidget();
  9037. _788.getWidgetContextManager().raisePromptEvent(_785,_786,_786.get("ui.action"),this.getModelPath(),_787);
  9038. }
  9039. catch(e){
  9040. }
  9041. };
  9042. CCognosViewer.prototype.getModelPath=function(){
  9043. var _789=this.getSelectionController().getModelPathForCurrentSelection();
  9044. if(_789){
  9045. return _789;
  9046. }else{
  9047. if(this.envParams.modelPath){
  9048. return this.envParams.modelPath;
  9049. }else{
  9050. if(typeof document.forms["formWarpRequest"+this.getId()].modelPath!=="undefined"){
  9051. return document.forms["formWarpRequest"+this.getId()].modelPath.value;
  9052. }
  9053. }
  9054. }
  9055. return "";
  9056. };
  9057. CCognosViewer.prototype.setKeepFocus=function(_78a){
  9058. this._keepFocus=_78a;
  9059. };
  9060. CCognosViewer.prototype.getKeepFocus=function(){
  9061. if(typeof this._keepFocus!="undefined"){
  9062. return this._keepFocus;
  9063. }
  9064. return false;
  9065. };
  9066. CCognosViewer.prototype.onFocus=function(evt){
  9067. var _78c=this.getA11YHelper();
  9068. if(_78c){
  9069. _78c.onFocus(evt);
  9070. }
  9071. };
  9072. CCognosViewer.prototype.getA11YHelper=function(){
  9073. if(!this.a11yHelper){
  9074. this.loadExtra();
  9075. if(typeof ViewerA11YHelper=="function"){
  9076. this.a11yHelper=new ViewerA11YHelper(this);
  9077. }else{
  9078. if(typeof console!=="undefined"&&console.log){
  9079. console.log("CCognosViewer: Could not create ViewerA11YHelper object.");
  9080. }
  9081. return null;
  9082. }
  9083. }
  9084. return this.a11yHelper;
  9085. };
  9086. CCognosViewer.prototype.onKeyDown=function(evt){
  9087. if(this.getA11YHelper()){
  9088. this.getA11YHelper().onKeyDown(evt);
  9089. }
  9090. };
  9091. CCognosViewer.prototype.updateSkipToReportLink=function(){
  9092. var _78e=this.getStatus();
  9093. var _78f=document.getElementById("cvSkipToReport"+this.getId());
  9094. if(_78f){
  9095. _78f.style.display=_78e=="prompting"?"none":"";
  9096. }
  9097. };
  9098. CCognosViewer.prototype.updateSkipToNavigationLink=function(_790){
  9099. var _791=document.getElementById("cvSkipToNavigation"+this.getId());
  9100. if(_791){
  9101. _791.style.display=_790?"none":"";
  9102. }
  9103. };
  9104. CCognosViewer.prototype.pageAction=function(_792){
  9105. this.setKeepFocus("CVNavLinks"+this.getId());
  9106. var _793=new ViewerDispatcherEntry(this);
  9107. _793.addFormField("ui.action",_792);
  9108. if(this.getCurrentlySelectedTab()){
  9109. _793.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getCurrentlySelectedTab());
  9110. }
  9111. this.dispatchRequest(_793);
  9112. };
  9113. CCognosViewer.prototype.writeNavLink=function(_794,_795,_796,_797){
  9114. var _798="";
  9115. if(_796){
  9116. _798="<td nowrap=\"nowrap\">"+"<img src=\"LINK_IMG\" width=\"15\" height=\"15\" alt=\"\" style=\"vertical-align:middle;\">"+"</td>"+"<td nowrap=\"nowrap\">";
  9117. if(_797){
  9118. _798+="<a href=\"#\" tabindex=\"0\" onclick=\""+getCognosViewerObjectRefAsString(this.getId())+".getViewerWidget().getSavedOutput().pageAction('LINK_REQUEST');return false;\"";
  9119. }else{
  9120. _798+="<a href=\"#\" tabindex=\"0\" onclick=\""+getCognosViewerObjectRefAsString(this.getId())+".pageAction('LINK_REQUEST');return false;\"";
  9121. }
  9122. _798+=">LINK_TEXT</a>&#160;"+"</td>";
  9123. }else{
  9124. _798="<td nowrap=\"nowrap\">"+"<img src=\"LINK_IMG\" width=\"15\" height=\"15\" alt=\"\" style=\"vertical-align:middle;\">"+"</td>"+"<td nowrap=\"nowrap\">LINK_TEXT&#160;</td>";
  9125. }
  9126. var sImg=this.sSkin+(!_796&&_794.sImgDisabled?_794.sImgDisabled:_794.sImg);
  9127. return _798.replace(/LINK_REQUEST/g,_795).replace(/LINK_TEXT/g,_794.sText).replace(/LINK_IMG/g,sImg);
  9128. };
  9129. CCognosViewer.prototype.loadNavLinks=function(){
  9130. var _79a=window.gScriptLoader.loadFile(this.getGateway(),"b_action=xts.run&m=portal/report-viewer-navlinks.xts");
  9131. if(_79a){
  9132. this.init(eval("("+_79a+")"));
  9133. }
  9134. };
  9135. CCognosViewer.prototype.writeNavLinks=function(sSR,_79c){
  9136. var _79d=document.getElementById("CVNavLinks"+this.getId());
  9137. if(_79d){
  9138. var _79e=document.getElementById("CVNavLinks_Container"+this.getId());
  9139. if(typeof this.oNavLinks!="object"||typeof sSR!="string"||!sSR.match(/\bfirstPage\b|\bpreviousPage\b|\bnextPage\b|\blastPage\b|\bplayback\b/i)){
  9140. _79d.style.display="none";
  9141. if(_79e){
  9142. _79e.style.display="none";
  9143. }
  9144. this.updateSkipToNavigationLink(true);
  9145. return;
  9146. }
  9147. this.updateSkipToNavigationLink(false);
  9148. if(_79e){
  9149. _79e.style.display="";
  9150. }
  9151. _79d.style.display=(isIE()?"block":"table-cell");
  9152. var _79f="";
  9153. _79f+="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"pageControls BUXNoPrint\" role=\"presentation\"><tbody><tr>";
  9154. _79f+=this.writeNavLink(this.oNavLinks.oFirst,"firstPage",sSR.match(/\bfirstPage\b/gi),_79c);
  9155. _79f+=this.writeNavLink(this.oNavLinks.oPrevious,"previousPage",sSR.match(/\bpreviousPage\b/gi),_79c);
  9156. _79f+=this.writeNavLink(this.oNavLinks.oNext,"nextPage",sSR.match(/\bnextPage\b/gi),_79c);
  9157. _79f+=this.writeNavLink(this.oNavLinks.oLast,"lastPage",sSR.match(/\blastPage\b/gi),_79c);
  9158. _79f+="</tr></tbody></table>";
  9159. var _7a0=document.getElementById("CVNavLinks_label"+this.getId());
  9160. var _7a1="";
  9161. if(_7a0){
  9162. _7a1+="<span id=\"CVNavLinks_label"+this.getId()+"\" style=\"visibilty:hidden; display:none;\">"+_7a0.innerHTML+"</span>";
  9163. }
  9164. _79d.innerHTML=_7a1+_79f;
  9165. }else{
  9166. if(this.shouldWriteNavLinks()){
  9167. setTimeout(getCognosViewerObjectRefAsString(this.getId())+".writeNavLinks(\""+sSR+"\",\""+_79c+"\");",100);
  9168. }
  9169. }
  9170. };
  9171. function CVBackgroundLayer_ignoreMouseClick(e){
  9172. if(e.returnValue){
  9173. e.returnValue=false;
  9174. }else{
  9175. if(e.preventDefault){
  9176. e.preventDefault();
  9177. }else{
  9178. return false;
  9179. }
  9180. }
  9181. };
  9182. CCognosViewer.prototype.createTransparentBackgroundLayer=function(){
  9183. this.removeTransparentBackgroundLayer();
  9184. var oBL=document.createElement("div");
  9185. oBL.id=CV_BACKGROUND_LAYER_ID;
  9186. oBL.style.display="none";
  9187. oBL.style.position="absolute";
  9188. oBL.setAttribute("role","region");
  9189. oBL.setAttribute("aria-label",RV_RES.IDS_JS_A11Y_BACKGROUND_TINT);
  9190. oBL.style.top="0px";
  9191. oBL.style.left="0px";
  9192. oBL.style.zIndex=98;
  9193. oBL.style.width="100%";
  9194. oBL.style.height="100%";
  9195. oBL.style.backgroundColor="rgb(238, 238, 238)";
  9196. oBL.style.opacity="0";
  9197. oBL.style.filter="alpha(opacity:0)";
  9198. oBL.innerHTML="<table tabindex=\"1\" width=\"100%\" height=\"100%\"><tr><td role=\"presentation\" onclick=\"CVBackgroundLayer_ignoreMouseClick(event)\"></td></tr></table>";
  9199. oBL.style.display="inline";
  9200. document.body.appendChild(oBL);
  9201. };
  9202. CCognosViewer.prototype.removeTransparentBackgroundLayer=function(){
  9203. var oBL=document.getElementById(CV_BACKGROUND_LAYER_ID);
  9204. if(oBL){
  9205. oBL.parentNode.removeChild(oBL);
  9206. }
  9207. };
  9208. CCognosViewer.prototype.closeActiveHTTPConnection=function(){
  9209. var _7a5=this.getActiveRequest();
  9210. if(_7a5){
  9211. _7a5.abortHttpRequest();
  9212. }
  9213. };
  9214. CCognosViewer.prototype.canCancel=function(){
  9215. var _7a6=this.getTracking();
  9216. var _7a7=this.getStatus();
  9217. return _7a6!=""&&_7a7!="complete";
  9218. };
  9219. CCognosViewer.prototype.cancel=function(_7a8){
  9220. if(this.getWorkingDialog()&&this.getWorkingDialog().disableCancelButton){
  9221. this.getWorkingDialog().disableCancelButton(_7a8);
  9222. }
  9223. this.removeTransparentBackgroundLayer();
  9224. this.clearPrompts();
  9225. if(this.m_viewerFragment&&this.envParams["fragment.fireEventWhenComplete"]){
  9226. this.envParams["fragment.fireEventWhenComplete"]="";
  9227. }
  9228. var _7a9=null;
  9229. if(this.m_undoStack.length>0){
  9230. _7a9=this.m_undoStack.pop();
  9231. }
  9232. var _7aa=this.getActiveRequest();
  9233. if(this.canCancel()===true||_7aa){
  9234. if(_7aa){
  9235. _7aa.cancelRequest(true);
  9236. }else{
  9237. var _7ab=null;
  9238. var _7ac=_7a9!=null&&_7a9.m_bRefreshPage;
  9239. if(typeof this.getCancelDispatcherEntry=="function"){
  9240. _7ab=this.getCancelDispatcherEntry();
  9241. }else{
  9242. if(_7ac||this.m_viewerFragment){
  9243. _7ab=new ViewerDispatcherEntry(this);
  9244. }else{
  9245. if(this.getId()=="RS"){
  9246. _7ab=new ViewerDispatcherEntry(this);
  9247. _7ab.addFormField("cv.responseFormat","rs");
  9248. }else{
  9249. _7ab=new DispatcherEntry(this);
  9250. _7ab.addFormField("cv.responseFormat","successfulRequest");
  9251. }
  9252. }
  9253. }
  9254. _7ab.forceSynchronous();
  9255. _7ab.addFormField("ui.action","cancel");
  9256. _7ab.addFormField("m_tracking",this.getTracking());
  9257. this.setTracking("");
  9258. if(_7ac){
  9259. var _7ad="<CognosViewerUndo><conversation>";
  9260. _7ad+=_7a9.m_sConversation;
  9261. _7ad+="</conversation></CognosViewerUndo>";
  9262. _7ab.addFormField("cv.previousSession",_7ad);
  9263. }
  9264. this.dispatchRequest(_7ab);
  9265. if(!this.isBux&&!this.m_viewerFragment&&(this.getUsePageRequest()||!this.isReportRenderingDone())){
  9266. this.executeCallback("cancel");
  9267. }
  9268. }
  9269. this.setStatus("complete");
  9270. var _7ae=this.envParams["ui.action"];
  9271. var _7af=this.getUsePageRequest();
  9272. var _7b0=this.m_undoStack.length;
  9273. if(_7a9!=null){
  9274. this.m_sConversation=_7a9.m_sConversation;
  9275. this.m_sParameters=_7a9.m_sParameters;
  9276. this.envParams={};
  9277. applyJSONProperties(this.envParams,_7a9.m_envParams);
  9278. this.m_undoStack.push(_7a9);
  9279. }
  9280. this.setTracking("");
  9281. if(this.previouslySelectedTab){
  9282. this.cancelTabSwitch();
  9283. }else{
  9284. if(_7ae!="view"&&_7b0<=0&&this.rvMainWnd){
  9285. this.rvMainWnd.executePreviousReport(-1);
  9286. }
  9287. }
  9288. return true;
  9289. }else{
  9290. if(this.rvMainWnd&&typeof this.envParams!="undefined"&&(this.envParams["ui.primaryAction"]=="authoredDrillThrough"||this.envParams["ui.primaryAction"]=="authoredDrillThrough2")){
  9291. this.rvMainWnd.executePreviousReport(-1);
  9292. return true;
  9293. }else{
  9294. if(!this.isBux){
  9295. executeBackURL(this.getId());
  9296. }
  9297. return true;
  9298. }
  9299. }
  9300. return false;
  9301. };
  9302. CCognosViewer.prototype.clearPrompts=function(){
  9303. if(this.preProcessControlArray){
  9304. var _7b1=this.preProcessControlArray.length;
  9305. var k=0;
  9306. for(k=0;k<_7b1;k++){
  9307. var _7b3=eval(this.preProcessControlArray[k]);
  9308. if(_7b3){
  9309. if(_7b3.clearSubmit){
  9310. _7b3.clearSubmit();
  9311. }
  9312. }
  9313. }
  9314. }
  9315. };
  9316. CCognosViewer.prototype.wait=function(){
  9317. if(this.isWorking()){
  9318. this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
  9319. var _7b4=new ViewerDispatcherEntry(this);
  9320. _7b4.addFormField("ui.action","wait");
  9321. _7b4.addFormField("ui.primaryAction",this.envParams["ui.primaryAction"]);
  9322. _7b4.addFormField("cv.actionState",this.envParams["cv.actionState"]);
  9323. _7b4.addNonEmptyStringFormField("bux",this.envParams["bux"]);
  9324. _7b4.addNonEmptyStringFormField("ui.preserveRapTags",this.envParams["ui.preserveRapTags"]);
  9325. this.dispatchRequest(_7b4);
  9326. return true;
  9327. }
  9328. return false;
  9329. };
  9330. CCognosViewer.prototype.setCAFContext=function(_7b5){
  9331. this.m_sCAFContext=_7b5;
  9332. };
  9333. CCognosViewer.prototype.setContextInfo=function(sXML){
  9334. this.m_sContextInfoXML=sXML;
  9335. };
  9336. CCognosViewer.prototype.setConversation=function(_7b7){
  9337. this.m_sConversation=_7b7;
  9338. };
  9339. CCognosViewer.prototype.setActionState=function(_7b8){
  9340. this.m_sActionState=_7b8;
  9341. };
  9342. CCognosViewer.prototype.setStatus=function(_7b9){
  9343. this.m_sStatus=_7b9;
  9344. };
  9345. CCognosViewer.prototype.setDebug=function(_7ba){
  9346. this.m_bDebug=_7ba;
  9347. };
  9348. CCognosViewer.prototype.setExecutionParameters=function(_7bb){
  9349. this.m_sParameters=_7bb;
  9350. };
  9351. CCognosViewer.prototype.setMetadataInfo=function(sXML){
  9352. this.m_sMetadataInfoXML=sXML;
  9353. };
  9354. CCognosViewer.prototype.setSecondaryRequests=function(_7bd){
  9355. if(_7bd){
  9356. this.m_aSecRequests=_7bd;
  9357. }else{
  9358. this.m_aSecRequests=[];
  9359. }
  9360. };
  9361. CCognosViewer.prototype.setTracking=function(_7be){
  9362. this.m_sTracking=_7be;
  9363. };
  9364. CCognosViewer.prototype.setSoapFault=function(_7bf){
  9365. this.m_sSoapFault=_7bf;
  9366. };
  9367. CCognosViewer.prototype.showOutputInNewWindow=function(sURL){
  9368. var _7c1=document.getElementById("formWarpRequest"+this.getId());
  9369. var _7c2=_7c1.elements["ui.postBack"];
  9370. var _7c3=_7c1.elements["ui.backURL"];
  9371. if(this.isAccessibleMode()&&this.envParams["run.outputFormat"]=="PDF"&&window.detachLeavingRV){
  9372. window.detachLeavingRV();
  9373. }
  9374. if(window.opener||_7c2||(_7c3&&_7c3.value!=="javascript:window.close();")){
  9375. window.open(sURL,"","");
  9376. this.updateNewBrowserWindow();
  9377. }else{
  9378. window.location=sURL;
  9379. }
  9380. };
  9381. CCognosViewer.prototype.hideToolbar=function(_7c4){
  9382. this.m_bHideToolbar=_7c4;
  9383. };
  9384. CCognosViewer.prototype.showExcel=function(sURL){
  9385. var _7c6=true;
  9386. var _7c7=document.getElementById("formWarpRequest"+this.getId());
  9387. var _7c8=_7c7.elements["ui.backURL"];
  9388. if(_7c8&&_7c8.value.indexOf("javascript:window.close()")!==0&&_7c8.value.indexOf("close.html")===-1){
  9389. _7c6=false;
  9390. }
  9391. if(window.detachLeavingRV){
  9392. window.detachLeavingRV();
  9393. }
  9394. var _7c9=window;
  9395. if(window.opener&&(isIE()||isFF())&&_7c6){
  9396. _7c9=window.opener?window.opener:window;
  9397. }else{
  9398. if(!window.opener&&_7c6){
  9399. window.location=sURL;
  9400. return;
  9401. }
  9402. }
  9403. var _7ca=null;
  9404. var _7cb="";
  9405. try{
  9406. if(this.envParams["cv.excelWindowOpenProperties"]){
  9407. _7cb=this.envParams["cv.excelWindowOpenProperties"];
  9408. }
  9409. _7ca=_7c9.open(sURL,"",_7cb);
  9410. }
  9411. catch(e){
  9412. _7c9=window;
  9413. _7ca=_7c9.open(sURL,"",_7cb);
  9414. }
  9415. if(!_7ca||_7ca.closed||typeof _7ca.closed=="undefined"){
  9416. alert(RV_RES.RV_BROWSER_POPUP_IS_ENABLED);
  9417. }
  9418. this.updateNewBrowserWindow();
  9419. };
  9420. CCognosViewer.prototype.updateNewBrowserWindow=function(){
  9421. var id=this.getId();
  9422. var _7cd=document.forms["formWarpRequest"+id].elements["ui.postBack"];
  9423. var _7ce=document.forms["formWarpRequest"+id].elements["ui.backURL"];
  9424. if(_7cd&&_7cd.value){
  9425. setTimeout(getCognosViewerObjectRefAsString(id)+".getRV().doPostBack();",100);
  9426. }else{
  9427. if(_7ce&&_7ce.value){
  9428. if(_7ce.value.length<2048){
  9429. setTimeout("location.replace(\""+_7ce.value+"\");",100);
  9430. }else{
  9431. _7ce=decodeURIComponent(_7ce.value);
  9432. var _7cf=_7ce.split("?");
  9433. var _7d0=document.createElement("form");
  9434. _7d0.style.display="none";
  9435. _7d0.setAttribute("target","_self");
  9436. _7d0.setAttribute("method","post");
  9437. _7d0.setAttribute("action",_7cf[0]);
  9438. var _7d1=_7cf[1].split("&");
  9439. for(var _7d2=0;_7d2<_7d1.length;_7d2++){
  9440. var _7d3=_7d1[_7d2].indexOf("=");
  9441. var _7d4=_7d1[_7d2].substr(0,_7d3);
  9442. var _7d5=_7d1[_7d2].substr(_7d3+1);
  9443. var _7d6=document.createElement("img");
  9444. _7d6.setAttribute("type","hidden");
  9445. _7d6.setAttribute("name",decodeURIComponent(_7d4));
  9446. _7d6.setAttribute("value",decodeURIComponent(_7d5));
  9447. _7d0.appendChild(_7d6);
  9448. }
  9449. document.body.appendChild(_7d0);
  9450. _7d0.submit();
  9451. }
  9452. }else{
  9453. window.close();
  9454. }
  9455. }
  9456. };
  9457. CCognosViewer.prototype.showWaitPage=function(){
  9458. };
  9459. CCognosViewer.prototype.sendRequest=function(_7d7){
  9460. var _7d8=new ViewerDispatcherEntry(this);
  9461. _7d8.addFormField("ui.action",_7d7.getAction());
  9462. if(_7d7.getCallback()!=null){
  9463. _7d8.setCallbacks({"complete":{"object":null,"method":_7d7.getCallback()}});
  9464. }
  9465. var _7d9=_7d7.getFormFields().keys();
  9466. for(var _7da=0;_7da<_7d9.length;_7da++){
  9467. _7d8.addFormField(_7d9[_7da],_7d7.getFormFields().get(_7d9[_7da]));
  9468. }
  9469. var _7db=_7d7.m_oOptions.keys();
  9470. for(var _7dc=0;_7dc<_7db.length;_7dc++){
  9471. _7d8.addFormField(_7db[_7dc],_7d7.getOption(_7db[_7dc]));
  9472. }
  9473. var _7dd=_7d7.m_oParams.keys();
  9474. for(var _7de=0;_7de<_7dd.length;_7de++){
  9475. _7d8.addFormField(_7dd[_7de],_7d7.getParameter(_7dd[_7de]));
  9476. }
  9477. this.dispatchRequest(_7d8);
  9478. };
  9479. CCognosViewer.prototype.promptAction=function(_7df,sUrl){
  9480. this.setKeepFocus(true);
  9481. if(typeof datePickerObserverNotify=="function"){
  9482. datePickerObserverNotify();
  9483. }
  9484. var _7e1=this.getViewerWidget();
  9485. if(_7df=="cancel"){
  9486. this.cancelPrompt(sUrl);
  9487. if(_7e1){
  9488. if(!this.isReportRenderingDone()){
  9489. var _7e2={action:"deleteWidget"};
  9490. _7e1.fireEvent("com.ibm.bux.widget.action",null,_7e2);
  9491. }
  9492. }
  9493. }else{
  9494. var oReq=new ViewerDispatcherEntry(this);
  9495. oReq.addFormField("ui.action",_7df=="back"?"back":"forward");
  9496. if(_7df=="finish"){
  9497. oReq.addFormField("run.prompt",false);
  9498. }else{
  9499. if(_7df=="back"||_7df=="next"){
  9500. oReq.addFormField("run.prompt",true);
  9501. }
  9502. }
  9503. if(_7df=="reprompt"){
  9504. if(typeof repromptObserverNotify=="function"){
  9505. repromptObserverNotify(this);
  9506. }
  9507. oReq.addFormField("_promptControl",_7df);
  9508. }else{
  9509. oReq.addFormField("_promptControl","prompt");
  9510. }
  9511. if(_7e1){
  9512. _7e1.fireEvent("com.ibm.bux.widget.modified",null,{"modified":true});
  9513. if(_7e1.isSelectionFilterEnabled){
  9514. _7e1.clearSelectionFilter();
  9515. }
  9516. }
  9517. this.submitPromptValues(oReq);
  9518. }
  9519. };
  9520. CCognosViewer.prototype.cancelPrompt=function(sUrl){
  9521. this.cancel();
  9522. };
  9523. CCognosViewer.prototype.notify=function(_7e5,_7e6){
  9524. var _7e7=0,k=0;
  9525. var _7e9=null;
  9526. if(this.rangeObserverArray&&this.rangeObserverArray instanceof Array){
  9527. _7e7=this.rangeObserverArray.length;
  9528. for(k=0;k<_7e7;k++){
  9529. _7e9=eval(this.rangeObserverArray[k]);
  9530. if(_7e9&&typeof _7e9=="object"&&typeof _7e9.update=="function"){
  9531. _7e9.update();
  9532. }
  9533. }
  9534. }
  9535. var _7ea=true;
  9536. if(this.preProcessControlArray&&this.preProcessControlArray instanceof Array){
  9537. _7e7=this.preProcessControlArray.length;
  9538. for(k=0;k<_7e7;k++){
  9539. _7e9=eval(this.preProcessControlArray[k]);
  9540. if((typeof _7e9.getValid=="function")&&!_7e9.getValid()){
  9541. _7ea=false;
  9542. break;
  9543. }
  9544. }
  9545. }
  9546. this.notifyPageNavEnabled(_7ea);
  9547. if(this.multipleObserverArray&&this.multipleObserverArray instanceof Array){
  9548. _7e7=this.multipleObserverArray.length;
  9549. for(k=0;k<_7e7;k++){
  9550. _7e9=eval(this.multipleObserverArray[k]);
  9551. if(_7e9&&typeof _7e9=="object"&&typeof _7e9.checkInsertRemove=="function"){
  9552. _7e9.checkInsertRemove();
  9553. }
  9554. }
  9555. }
  9556. for(var _7eb=0;_7eb<gaNotifyTargets.length;_7eb++){
  9557. var _7ec=gaNotifyTargets[_7eb];
  9558. if(typeof _7ec!="undefined"&&typeof _7ec.notify=="function"){
  9559. _7ec.notify(_7e5,_7e6);
  9560. }
  9561. }
  9562. };
  9563. CCognosViewer.prototype.notifyPageNavEnabled=function(_7ed){
  9564. if(this.pageNavigationObserverArray&&this.pageNavigationObserverArray instanceof Array){
  9565. var _7ee=this.pageNavigationObserverArray.length;
  9566. var _7ef=false;
  9567. var _7f0=null;
  9568. var _7f1=null;
  9569. var k=0;
  9570. for(k=0;k<_7ee;k++){
  9571. try{
  9572. _7f0=eval(this.pageNavigationObserverArray[k]);
  9573. _7f1=_7f0.getType();
  9574. if(_7f1==PROMPTBUTTON_FINISH){
  9575. _7ef=true;
  9576. break;
  9577. }
  9578. }
  9579. catch(e){
  9580. }
  9581. }
  9582. for(k=0;k<_7ee;k++){
  9583. try{
  9584. _7f0=eval(this.pageNavigationObserverArray[k]);
  9585. _7f1=_7f0.getType();
  9586. if(!_7ed){
  9587. if((_7f1==PROMPTBUTTON_NEXT)||(_7f1==PROMPTBUTTON_OK)||(_7f1==PROMPTBUTTON_FINISH)){
  9588. _7f0.setEnabled(false);
  9589. }
  9590. }else{
  9591. if(_7f1==PROMPTBUTTON_FINISH){
  9592. _7f0.setEnabled(this.bCanFinish);
  9593. }else{
  9594. if(_7f1==PROMPTBUTTON_NEXT){
  9595. _7f0.setEnabled(this.bNextPage||!_7ef);
  9596. }else{
  9597. if(_7f1==PROMPTBUTTON_OK){
  9598. _7f0.setEnabled(true);
  9599. }
  9600. }
  9601. }
  9602. }
  9603. }
  9604. catch(e2){
  9605. }
  9606. }
  9607. }
  9608. };
  9609. CCognosViewer.prototype.getDrillResetHUNs=function(_7f3){
  9610. var _7f4=null;
  9611. if(this.getRAPReportInfo()){
  9612. _7f4=this.getRAPReportInfo().getDrilledOnHUNs();
  9613. }
  9614. if(!_7f4){
  9615. return null;
  9616. }
  9617. var _7f5=this.getExecutionParameters();
  9618. if(!_7f5){
  9619. return null;
  9620. }
  9621. var _7f6=this._getListOfChangedPromptParameters(_7f3);
  9622. if(!_7f6||_7f6.length===0){
  9623. return null;
  9624. }
  9625. var _7f7=[];
  9626. for(var i=0;i<_7f4.length;i++){
  9627. for(var j=0;j<_7f6.length;j++){
  9628. if(_7f6[j].indexOf(_7f4[i])!==-1){
  9629. _7f7.push(_7f4[i]);
  9630. }
  9631. }
  9632. }
  9633. return _7f7;
  9634. };
  9635. CCognosViewer.prototype.getOldParameters=function(){
  9636. var _7fa=new CParameterValues();
  9637. var _7fb=XMLBuilderLoadXMLFromString(this.getExecutionParameters());
  9638. if(_7fb.childNodes.length==1){
  9639. _7fa.loadWithOptions(_7fb.childNodes[0],false);
  9640. }
  9641. if(!_7fa||!_7fa.m_parameterValues||!_7fa.m_parameterValues.m_aValues){
  9642. return null;
  9643. }
  9644. return _7fa.m_parameterValues.m_aValues;
  9645. };
  9646. CCognosViewer.prototype._createDummyRequest=function(){
  9647. var _7fc=new ViewerDispatcherEntry(this);
  9648. return this.preparePromptValues(_7fc);
  9649. };
  9650. CCognosViewer.prototype._getChangedPromptParametersValues=function(_7fd,_7fe,_7ff){
  9651. var _800=XMLBuilderLoadXMLFromString(_7fe);
  9652. if(!_800){
  9653. for(var j=0;j<_7fd.length;j++){
  9654. var _802=_7fd[j].m_useValue;
  9655. if(_7fe.indexOf(sXmlEncode(_802))<0){
  9656. _7ff.push(_802);
  9657. }
  9658. }
  9659. return;
  9660. }
  9661. var _803=_800.getElementsByTagName("selectOption");
  9662. if(!_803){
  9663. return;
  9664. }
  9665. var _804=_7fd.length;
  9666. var _805=_803.length;
  9667. for(var i=0;i<_805;i++){
  9668. var _7fe=_803[i].attributes.getNamedItem("useValue").nodeValue;
  9669. bMatchOldParam=false;
  9670. for(var j=0;j<_804;j++){
  9671. var _802=_7fd[j].m_useValue;
  9672. if(_7fe.indexOf(_802)===0){
  9673. bMatchOldParam=true;
  9674. break;
  9675. }
  9676. }
  9677. if(!bMatchOldParam){
  9678. _7ff.push(_7fe);
  9679. }
  9680. }
  9681. };
  9682. CCognosViewer.prototype._getListOfChangedPromptParameters=function(_807){
  9683. var _808=this.getOldParameters();
  9684. if(!_808){
  9685. return null;
  9686. }
  9687. var _809=[];
  9688. if(!_807){
  9689. var _80a=this._createDummyRequest();
  9690. for(var _80b in _808){
  9691. var _80c=_808[_80b].m_parmValueItems;
  9692. var _80d=_80a.getRequest().getFormFields().get("p_"+_80b);
  9693. if(!_80d){
  9694. continue;
  9695. }
  9696. this._getChangedPromptParametersValues(_80c,_80d,_809);
  9697. }
  9698. }else{
  9699. if(!_807.parameters){
  9700. return null;
  9701. }
  9702. var _80e=_807.parameters;
  9703. for(var i=0;i<_80e.length;i++){
  9704. var _810=_80e[i].parmName;
  9705. if(!_810||!_808[_810]){
  9706. continue;
  9707. }
  9708. var _80c=_808[_810].m_parmValueItems;
  9709. if(!_80c||_80c.length==0){
  9710. continue;
  9711. }
  9712. this._getChangedPromptParametersValues(_80c,_80e[i].parmValue,_809);
  9713. }
  9714. }
  9715. return _809;
  9716. };
  9717. CCognosViewer.prototype.submitPromptValues=function(oReq){
  9718. if(this.gbPromptRequestSubmitted===true){
  9719. return false;
  9720. }
  9721. this.gbPromptRequestSubmitted=true;
  9722. if(this.isBux){
  9723. var _812=this.getDrillResetHUNs(null);
  9724. if(_812&&_812.length!==0){
  9725. var _813={"drilledResetHUNs":_812};
  9726. this.executeAction("DrillReset",_813);
  9727. return;
  9728. }
  9729. }
  9730. oReq=this.preparePromptValues(oReq);
  9731. if(window.portletSharePrompt){
  9732. var _814=this.portletPromptParams(oReq);
  9733. if(_814.length>0){
  9734. portletSharePrompt(_814);
  9735. }
  9736. }
  9737. this.dispatchRequest(oReq);
  9738. };
  9739. CCognosViewer.prototype.portletPromptParams=function(oReq){
  9740. var _816=[];
  9741. var _817=null;
  9742. var _818=true;
  9743. var _819=oReq.getFormFields().keys();
  9744. for(var _81a=0;_81a<_819.length;_81a++){
  9745. _817=_819[_81a];
  9746. if(_817=="_promptControl"&&oReq.getFormField(_817)=="search"){
  9747. _818=false;
  9748. break;
  9749. }else{
  9750. if(_817.indexOf("p_")===0){
  9751. if(_817.indexOf("p_credential")===0){
  9752. _818=false;
  9753. break;
  9754. }else{
  9755. _816.push([_817,oReq.getFormField(_817)]);
  9756. }
  9757. }
  9758. }
  9759. }
  9760. if(_816&&!_818){
  9761. _816=[];
  9762. }
  9763. return _816;
  9764. };
  9765. CCognosViewer.prototype.preparePromptValues=function(oReq){
  9766. var _81c=[];
  9767. if(this.preProcessControlArray){
  9768. var _81d=this.preProcessControlArray.length;
  9769. var k=0;
  9770. for(k=0;k<_81d;k++){
  9771. var _81f=eval(this.preProcessControlArray[k]);
  9772. var _820=(typeof _81f.isEnabled=="function"?_81f.isEnabled():true);
  9773. if(_81f&&typeof _81f.preProcess=="function"&&_820){
  9774. _81f.preProcess();
  9775. if(_81f.m_oSubmit){
  9776. if(oReq.addParameter){
  9777. oReq.addParameter(_81f.m_oSubmit.name,_81f.m_oSubmit.value);
  9778. }else{
  9779. oReq.addFormField(_81f.m_oSubmit.name,_81f.m_oSubmit.value);
  9780. }
  9781. _81c.push(_81f.m_oSubmit);
  9782. if(_81f.m_sPromptId&&_81f.m_oForm&&_81f.m_oForm.elements&&typeof _81f.m_oForm.elements["p_"+_81f.m_sRef]=="object"){
  9783. if(oReq.addParameter){
  9784. oReq.addParameter("p_"+_81f.m_sPromptId,_81f.m_oForm.elements["p_"+_81f.m_sRef].value);
  9785. }else{
  9786. oReq.addFormField("p_"+_81f.m_sPromptId,_81f.m_oForm.elements["p_"+_81f.m_sRef].value);
  9787. }
  9788. }
  9789. }
  9790. }
  9791. }
  9792. }
  9793. var _821=document.getElementById("formWarpRequest"+this.getId());
  9794. if(_821){
  9795. var _822=_821.elements;
  9796. for(var _823=0;_823<_822.length;_823++){
  9797. var _824=_822[_823];
  9798. if(!_824.name||!_824.name.match(/^p_/)){
  9799. continue;
  9800. }
  9801. var _825=true;
  9802. for(var _826=0;_826<_81c.length;_826++){
  9803. if(_81c[_826]==_824){
  9804. _825=false;
  9805. break;
  9806. }
  9807. }
  9808. if(_825){
  9809. oReq.addFormField(_824.name,_824.value);
  9810. _81c.push(_824);
  9811. }
  9812. }
  9813. }
  9814. var oRM=this["CognosReport"];
  9815. if(oRM){
  9816. var _828=oRM.prompt.getParameters();
  9817. for(var i=0;i<_828.length;i++){
  9818. var _82a="p_"+_828[i].getName();
  9819. if(!oReq.getFormField(_82a)){
  9820. oReq.addFormField(_82a,_828[i].getXML());
  9821. }
  9822. }
  9823. }
  9824. return oReq;
  9825. };
  9826. CCognosViewer.prototype.setViewerWidget=function(_82b){
  9827. this.m_viewerWidget=_82b;
  9828. };
  9829. CCognosViewer.prototype.getViewerWidget=function(){
  9830. return this.m_viewerWidget;
  9831. };
  9832. CCognosViewer.prototype.getFlashChartOption=function(){
  9833. var _82c=this.getViewerWidget();
  9834. var _82d=null;
  9835. if(_82c){
  9836. var _82e=_82c.getProperties();
  9837. if(_82e){
  9838. _82d=_82e.getFlashCharts();
  9839. }
  9840. }
  9841. return _82d;
  9842. };
  9843. CCognosViewer.prototype.fireWidgetEvent=function(evt,_830){
  9844. var _831=this.getViewerWidget();
  9845. if(_831!=null){
  9846. _831.fireEvent(evt,null,_830);
  9847. }
  9848. };
  9849. CCognosViewer.prototype.isMobile=function(){
  9850. return false;
  9851. };
  9852. CCognosViewer.prototype.setVisibleDialog=function(_832){
  9853. this.m_visibleDialog=_832;
  9854. };
  9855. CCognosViewer.prototype.getVisibleDialog=function(){
  9856. if(typeof this.m_visibleDialog!="undefined"){
  9857. return this.m_visibleDialog;
  9858. }
  9859. return null;
  9860. };
  9861. CCognosViewer.prototype.getContentLocale=function(){
  9862. var _833=document.getElementById("formWarpRequest"+this.getId());
  9863. if(_833&&_833["ui.contentLocale"]&&_833["reRunObj"]&&_833["reRunObj"].value.length>0){
  9864. return _833["ui.contentLocale"].value;
  9865. }
  9866. return null;
  9867. };
  9868. CCognosViewer.prototype.updateLayout=function(_834){
  9869. var cvid=this.getId();
  9870. var _836=document.getElementById("CVHeader"+cvid);
  9871. var _837=document.getElementById("CVToolbar"+cvid);
  9872. if(!_836&&!_837){
  9873. setTimeout(getCognosViewerObjectRefAsString(cvid)+".updateLayout(\""+_834+"\");",100);
  9874. return;
  9875. }
  9876. if(_836){
  9877. var _838=this.getUIConfig()&&!this.getUIConfig().getShowBanner();
  9878. if((_834=="prompting"&&!this.bShowHeaderWithPrompts)||_838){
  9879. _836.parentNode.style.display="none";
  9880. }else{
  9881. _836.parentNode.style.display="";
  9882. }
  9883. }
  9884. if(_837){
  9885. if(_834=="prompting"||this.m_bHideToolbar==true){
  9886. _837.parentNode.style.display="none";
  9887. }else{
  9888. _837.parentNode.style.display="";
  9889. }
  9890. }
  9891. };
  9892. CCognosViewer.prototype.updateResponseSpecification=function(_839){
  9893. this.sResponseSpecification=_839;
  9894. };
  9895. CCognosViewer.prototype.getResponseSpecification=function(){
  9896. return this.sResponseSpecification;
  9897. };
  9898. CCognosViewer.prototype.release=function(_83a){
  9899. if(this.getStatus()!="fault"){
  9900. this._release(_83a);
  9901. }
  9902. };
  9903. CCognosViewer.prototype._release=function(_83b){
  9904. var form=document.getElementById("formWarpRequest"+this.getId());
  9905. var _83d=this.getTracking();
  9906. if(!_83d&&form&&form["m_tracking"]&&form["m_tracking"].value){
  9907. _83d=form["m_tracking"].value;
  9908. form["m_tracking"].value="";
  9909. }
  9910. this.setTracking("");
  9911. if(_83d){
  9912. var _83e=new DispatcherEntry(this);
  9913. if(this.isWorkingOrPrompting()){
  9914. _83e.addFormField("ui.action","cancel");
  9915. }else{
  9916. _83e.addFormField("ui.action","release");
  9917. }
  9918. _83e.addFormField("cv.responseFormat","successfulRequest");
  9919. _83e.addNonEmptyStringFormField("ui.primaryAction",this.envParams["ui.primaryAction"]);
  9920. _83e.addNonEmptyStringFormField("ui.objectClass",this.envParams["ui.objectClass"]);
  9921. _83e.addFormField("m_tracking",_83d);
  9922. if(_83b!=true){
  9923. _83e.forceSynchronous();
  9924. }
  9925. var _83f=this.getActiveRequest()?this.getActiveRequest():this.getFaultDispatcherEntry();
  9926. if(_83f&&_83f.getFormField("cv.outputKey")){
  9927. _83e.addFormField("b_action","cvx.high");
  9928. _83e.addFormField("cv.outputKey",_83f.getFormField("cv.outputKey"));
  9929. _83e.addFormField("cv.waitForResponse","false");
  9930. _83e.setHeaders(_83f.getHeaders());
  9931. }
  9932. var _840=_83e.getRequest().getFormFields();
  9933. var _841=_840.keys();
  9934. var data=new URLSearchParams();
  9935. for(var _843=0;_843<_841.length;_843++){
  9936. data.append(_841[_843],_840.get(_841[_843]));
  9937. }
  9938. if(!navigator.sendBeacon(this.getGateway(),data)){
  9939. if(typeof console!=="undefined"&&console.log){
  9940. console.log("CCognosViewer: release sendBeacon failed.");
  9941. }
  9942. }
  9943. return true;
  9944. }
  9945. return false;
  9946. };
  9947. CCognosViewer.prototype.cleanupStyles=function(){
  9948. if(this.getViewerWidget()){
  9949. this.getViewerWidget().cleanupStyles();
  9950. }
  9951. };
  9952. CCognosViewer.prototype.destroy=function(_844){
  9953. this.release(_844);
  9954. if(!this.m_destroyed){
  9955. if(typeof window.gaRV_INSTANCES!="undefined"){
  9956. for(var _845=0;_845<window.gaRV_INSTANCES.length;_845++){
  9957. if(window.gaRV_INSTANCES[_845].m_sId==this.getId()){
  9958. window.gaRV_INSTANCES.splice(_845,1);
  9959. this.m_destroyed=true;
  9960. break;
  9961. }
  9962. }
  9963. }
  9964. if(this.m_layoutElements){
  9965. for(var i=0;i<this.m_layoutElements.length;i++){
  9966. var e=this.m_layoutElements[i];
  9967. var j=e.getAttribute("lid");
  9968. this.m_layoutElements.splice(i,1);
  9969. delete this.m_lidToElement[j];
  9970. var _849=e.parentNode;
  9971. if(_849){
  9972. _849.removeChild(e);
  9973. }
  9974. }
  9975. delete this.m_layoutElements;
  9976. delete this.m_lidToElement;
  9977. }
  9978. if(this.m_oDrillMgr){
  9979. this.m_oDrillMgr.setCV(null);
  9980. }
  9981. var _84a=this.getSelectionController();
  9982. if(_84a){
  9983. GUtil.destroyProperties(_84a);
  9984. }
  9985. var cvId=this.getId();
  9986. this.m_viewerDispatcher=null;
  9987. GUtil.destroyProperties(this,true);
  9988. cleanupGlobalObjects(cvId);
  9989. }
  9990. };
  9991. CCognosViewer.prototype.exit=function(){
  9992. this.release();
  9993. };
  9994. CCognosViewer.prototype.executeAction=function(_84c,_84d){
  9995. var _84e=this.getAction(_84c);
  9996. _84e.setRequestParms(_84d);
  9997. return _84e.execute();
  9998. };
  9999. CCognosViewer.prototype.getCalculation=function(_84f){
  10000. var calc=null;
  10001. var _851=this.getCalculationCache();
  10002. if(_851[_84f]){
  10003. calc=_851[_84f];
  10004. }else{
  10005. if(window[_84f]&&typeof window[_84f]=="function"){
  10006. calc=new window[_84f]();
  10007. calc.setCognosViewer(this);
  10008. }
  10009. _851[_84f]=calc;
  10010. }
  10011. return calc;
  10012. };
  10013. CCognosViewer.prototype.findBlueDotMenu=function(_852){
  10014. var root=null;
  10015. var _854=(_852)?_852:this.getToolbar();
  10016. for(var idx=0;idx<_854.length;++idx){
  10017. if(typeof _854[idx]._root!="undefined"){
  10018. root=_854[idx]._root;
  10019. break;
  10020. }
  10021. }
  10022. return root;
  10023. };
  10024. CCognosViewer.prototype.findToolbarItem=function(_856,_857){
  10025. var spec=typeof _857=="undefined"||_857==null?this.getToolbar():_857;
  10026. var _859=null;
  10027. for(var _85a=0;_85a<spec.length;++_85a){
  10028. var name=spec[_85a]["name"];
  10029. if(typeof name!="undefined"&&name==_856){
  10030. _859=spec[_85a];
  10031. break;
  10032. }
  10033. }
  10034. return _859;
  10035. };
  10036. CCognosViewer.prototype.findToolbarItemIndex=function(_85c,_85d){
  10037. var spec=typeof _85d=="undefined"||_85d==null?this.getToolbar():_85d;
  10038. var _85f=null;
  10039. for(var _860=0;_860<spec.length;++_860){
  10040. var name=spec[_860]["name"];
  10041. if(typeof name!="undefined"&&name==_85c){
  10042. _85f=_860;
  10043. break;
  10044. }
  10045. }
  10046. return _85f;
  10047. };
  10048. CCognosViewer.prototype.addedButtonToToolbar=function(_862,_863,_864,_865){
  10049. if(typeof _863!="undefined"&&_863!=null){
  10050. if(this.findToolbarItem(_863.name,_862)==null){
  10051. _864=this.findToolbarItemIndex(_864,_862);
  10052. if(typeof _864!="undefined"&&_864!=null){
  10053. _862.splice(++_864,0,_863);
  10054. return true;
  10055. }else{
  10056. if(typeof _865!="undefined"&&_865!=null){
  10057. _862.splice(_865,0,_863);
  10058. return true;
  10059. }
  10060. }
  10061. }
  10062. }
  10063. return false;
  10064. };
  10065. CCognosViewer.prototype.addDrillTargets=function(_866){
  10066. this.m_drillTargets=_866;
  10067. };
  10068. CCognosViewer.prototype.getDrillTargets=function(){
  10069. if(this.m_drillTargets.length==0&&this.envParams["ui.action"]=="view"){
  10070. var _867=document.getElementById("CVIFrame"+this.getId());
  10071. if(typeof _867!="undefined"&&_867!=null){
  10072. if(_867.contentWindow.drillTargets){
  10073. return _867.contentWindow.drillTargets;
  10074. }
  10075. }
  10076. }
  10077. return this.m_drillTargets;
  10078. };
  10079. CCognosViewer.prototype.getDrillTarget=function(idx){
  10080. if(idx>=this.m_drillTargets.length){
  10081. return null;
  10082. }
  10083. return this.m_drillTargets[idx];
  10084. };
  10085. CCognosViewer.prototype.getNumberOfDrillTargets=function(){
  10086. return this.m_drillTargets.length;
  10087. };
  10088. CCognosViewer.prototype.isReportRenderingDone=function(){
  10089. return this.m_reportRenderingDone;
  10090. };
  10091. CCognosViewer.prototype.setReportRenderingDone=function(flag){
  10092. this.m_reportRenderingDone=flag;
  10093. };
  10094. CCognosViewer.prototype.hasAVSChart=function(){
  10095. var _86a=this.getRAPReportInfo();
  10096. if(_86a){
  10097. var _86b=_86a.getDisplayTypes();
  10098. return _86b.match("_v2")!=null||_86b.match("v2_")!=null;
  10099. }
  10100. return false;
  10101. };
  10102. CCognosViewer.prototype.getPinFreezeManager=function(){
  10103. return this.m_pinFreezeManager;
  10104. };
  10105. CCognosViewer.prototype.getReportContextHelper=function(){
  10106. if(!this.m_reportContextHelper){
  10107. this.m_reportContextHelper=new ReportContextHelper(this.getSelectionController().getCCDManager());
  10108. }
  10109. return this.m_reportContextHelper;
  10110. };
  10111. CCognosViewer.prototype.getRAPReportInfo=function(){
  10112. return this.m_RAPReportInfo;
  10113. };
  10114. CCognosViewer.prototype.setRAPReportInfo=function(_86c){
  10115. this.m_RAPReportInfo=_86c;
  10116. };
  10117. CCognosViewer.prototype.isNodeVisible=function(node){
  10118. if(this.m_pinFreezeManager){
  10119. return this.m_pinFreezeManager.isNodeVisible(node);
  10120. }
  10121. return true;
  10122. };
  10123. CCognosViewer.prototype.getWarpRequestForm=function(){
  10124. return document.getElementById("formWarpRequest"+this.getId());
  10125. };
  10126. CCognosViewer.prototype.getBrowser=function(){
  10127. return this.sBrowser;
  10128. };
  10129. CCognosViewer.prototype.repaintDiv=function(oDiv){
  10130. var _86f=oDiv.style.display;
  10131. oDiv.style.display="none";
  10132. oDiv.style.display=_86f;
  10133. };
  10134. CCognosViewer.prototype.isMetadataEmpty=function(){
  10135. var oSC=this.getSelectionController();
  10136. if(oSC){
  10137. var _871=oSC.getCCDManager();
  10138. if(_871){
  10139. return _871.isMetadataEmpty();
  10140. }
  10141. }
  10142. return true;
  10143. };
  10144. CCognosViewer.prototype.setContextMenu=function(_872){
  10145. this.m_contextMenu=_872;
  10146. };
  10147. CCognosViewer.prototype.getContextMenu=function(){
  10148. return this.m_contextMenu;
  10149. };
  10150. CCognosViewer.prototype.setToolbar=function(_873){
  10151. this.m_toolbar=_873;
  10152. };
  10153. CCognosViewer.prototype.getToolbar=function(){
  10154. return this.m_toolbar;
  10155. };
  10156. CCognosViewer.prototype.getAdvancedServerProperty=function(_874){
  10157. if(this.m_advancedProperties&&this.m_advancedProperties[_874]!==undefined&&this.m_advancedProperties[_874]!==null){
  10158. return this.m_advancedProperties[_874];
  10159. }else{
  10160. return null;
  10161. }
  10162. };
  10163. CCognosViewer.prototype.hasPrompt=function(){
  10164. if(typeof this.m_bHasPrompt==="undefined"||this.m_bHasPrompt===null){
  10165. var _875=false;
  10166. if(this.getAdvancedServerProperty("VIEWER_JS_PROMPT_AGAIN_SHOW_ALWAYS")==="true"||(this.envParams.reportPrompts&&this.envParams.reportPrompts.length>0)){
  10167. _875=true;
  10168. }else{
  10169. var _876=new CParameterValues();
  10170. var _877=XMLBuilderLoadXMLFromString(this.getExecutionParameters());
  10171. if(_877.childNodes.length==1){
  10172. _876.loadWithOptions(_877.childNodes[0],true);
  10173. var _878=_876.length();
  10174. for(var _879=0;_879<_878;++_879){
  10175. var _87a=_876.getAt(_879);
  10176. if(_87a!==null&&_87a.length()>0&&_87a.name().indexOf("credential:")!=-1){
  10177. _875=true;
  10178. break;
  10179. }
  10180. }
  10181. }
  10182. }
  10183. this.m_bHasPrompt=_875;
  10184. }
  10185. return this.m_bHasPrompt;
  10186. };
  10187. CCognosViewer.prototype.getDrillState=function(){
  10188. return this.m_sStateData?this.m_sStateData:"";
  10189. };
  10190. CCognosViewer.prototype.isSelectionFilterEnabled=function(){
  10191. if(typeof this.m_bSelectionFilterSwitch=="undefined"){
  10192. this.m_bSelectionFilterSwitch=false;
  10193. }
  10194. return this.m_bSelectionFilterSwitch;
  10195. };
  10196. CCognosViewer.prototype.broadcastContextChange=function(evt,_87c){
  10197. if(this.getViewerWidget()){
  10198. this.getViewerWidget().broadcastContextChange(_87c);
  10199. }
  10200. stopEventBubble(evt);
  10201. };
  10202. CCognosViewer.prototype.broadcastParameterChange=function(evt,_87e){
  10203. if(this.getViewerWidget()){
  10204. this.getViewerWidget().broadcastParameterChange(_87e);
  10205. }
  10206. stopEventBubble(evt);
  10207. };
  10208. CCognosViewer.prototype.getReportDiv=function(){
  10209. if(!this.m_nReportDiv){
  10210. this.m_nReportDiv=document.getElementById("CVReport"+this.m_sId);
  10211. }
  10212. return this.m_nReportDiv;
  10213. };
  10214. function CDocumentWriter(sId,_880){
  10215. this.m_sId=sId;
  10216. this.m_sText="";
  10217. this.m_sScript=_880;
  10218. };
  10219. CDocumentWriter.prototype.isValid=function(){
  10220. if(typeof this.m_sScript!="undefined"&&this.m_sScript&&window.gScriptLoader){
  10221. return true;
  10222. }
  10223. return false;
  10224. };
  10225. CDocumentWriter.prototype.execute=function(){
  10226. if(this.isValid()&&window.gScriptLoader){
  10227. var _881=/document\.write(ln)?\s*\(/gi;
  10228. var _882=this.m_sScript.replace(_881,"this.write(").replace(window.gScriptLoader.m_reScriptTagOpen,"").replace(window.gScriptLoader.m_reScriptTagClose,"");
  10229. try{
  10230. eval(_882);
  10231. var _883=document.getElementById(this.m_sId);
  10232. if(_883){
  10233. _883.innerHTML=this.m_sText;
  10234. return true;
  10235. }
  10236. }
  10237. catch(e){
  10238. }
  10239. }
  10240. return false;
  10241. };
  10242. CDocumentWriter.prototype.write=function(_884){
  10243. var _885="";
  10244. if(typeof _884=="function"){
  10245. _885=eval(_884);
  10246. }else{
  10247. if(typeof _884=="string"){
  10248. _885=_884;
  10249. }
  10250. }
  10251. this.m_sText+=_885;
  10252. };
  10253. function setFocusToFirstTabItem(_886){
  10254. if(!window.dojo){
  10255. return;
  10256. }
  10257. var _887=dojo.query("*",_886);
  10258. var _888=_887.length;
  10259. for(var i=0;i<_888;i++){
  10260. var node=_887[i];
  10261. if(!node.style||(node.style.display!="none"&&node.style.visibility!="hidden")){
  10262. if(node.getAttribute("tabIndex")==0){
  10263. try{
  10264. node.focus();
  10265. }
  10266. catch(e){
  10267. }
  10268. break;
  10269. }
  10270. }
  10271. }
  10272. };
  10273. function ReportContextHelper(_88b){
  10274. this.m_oCDManager=_88b;
  10275. };
  10276. ReportContextHelper.prototype.destroy=function(){
  10277. if(this.m_oCDManager&&this.m_oCDManager.destroy){
  10278. this.m_oCDManager.destroy();
  10279. }
  10280. delete this.m_oCDManager;
  10281. };
  10282. ReportContextHelper.prototype.processCtx=function(sCtx){
  10283. var _88d=sCtx.split("::");
  10284. var _88e=[];
  10285. for(var i=0;i<_88d.length;++i){
  10286. _88e[i]=_88d[i].split(":");
  10287. }
  10288. if(_88e&&_88e.length&&_88e[0].length){
  10289. return _88e;
  10290. }else{
  10291. return null;
  10292. }
  10293. };
  10294. ReportContextHelper.prototype.getDataItemName=function(sCtx){
  10295. var _891=this.processCtx(sCtx);
  10296. if(_891){
  10297. return this.getRefDataItem(_891[0][0]);
  10298. }
  10299. return null;
  10300. };
  10301. ReportContextHelper.prototype.getRefDataItem=function(_892){
  10302. var _893=this.m_oCDManager.GetRDIValue(_892);
  10303. return (_893==null)?"":_893;
  10304. };
  10305. ReportContextHelper.prototype.getMun=function(_894){
  10306. var aCtx=null;
  10307. if(typeof _894==="string"){
  10308. aCtx=this.processCtx(_894);
  10309. }else{
  10310. if(typeof _894==="number"){
  10311. aCtx=this.processCtx(_894.toString());
  10312. }else{
  10313. aCtx=_894;
  10314. }
  10315. }
  10316. if(aCtx){
  10317. var sMun=this.m_oCDManager.GetMUN(aCtx[0][0]);
  10318. return (sMun==null)?"":sMun;
  10319. }
  10320. return "";
  10321. };
  10322. function ViewerConfig(){
  10323. this.uiConfig=new ViewerUIConfig();
  10324. this.findConfig=typeof ViewerFindActionConfig=="function"?new ViewerFindActionConfig():null;
  10325. this.httpRequestConfig=typeof ViewerHttpRequestConfig=="function"?new ViewerHttpRequestConfig():null;
  10326. this.eventsConfig=typeof ViewerEventsConfig=="function"?new ViewerEventsConfig():null;
  10327. };
  10328. ViewerConfig.prototype.configure=function(_897){
  10329. if(!_897){
  10330. return;
  10331. }
  10332. if(_897.findAction&&this.findConfig){
  10333. this.findConfig.configure(_897.findAction);
  10334. }
  10335. if(_897.UI){
  10336. this.uiConfig.configure(_897.UI);
  10337. }
  10338. if(_897.httpRequestCallbacks&&this.httpRequestConfig){
  10339. this.httpRequestConfig.configure(_897.httpRequestCallbacks);
  10340. }
  10341. if(_897.events&&this.eventsConfig){
  10342. this.eventsConfig.configure(_897.events);
  10343. }
  10344. };
  10345. ViewerConfig.prototype.getUIConfig=function(){
  10346. return this.uiConfig;
  10347. };
  10348. ViewerConfig.prototype.getFindActionConfig=function(){
  10349. return this.findConfig;
  10350. };
  10351. ViewerConfig.prototype.getHttpRequestConfig=function(){
  10352. return this.httpRequestConfig;
  10353. };
  10354. ViewerConfig.prototype.getEventsConfig=function(){
  10355. return this.eventsConfig;
  10356. };
  10357. function ViewerUIConfig(){
  10358. this.showBanner=true;
  10359. this.showToolbar=true;
  10360. this.showContextMenu=true;
  10361. this.showPageNavigation=true;
  10362. this.primarySelectionColor=null;
  10363. this.secondarySelectionColor=null;
  10364. this.showSecondarySelection=true;
  10365. };
  10366. ViewerUIConfig.prototype.configure=function(_898){
  10367. applyJSONProperties(this,_898);
  10368. };
  10369. ViewerUIConfig.prototype.getShowBanner=function(){
  10370. return this.showBanner;
  10371. };
  10372. ViewerUIConfig.prototype.getShowToolbar=function(){
  10373. return this.showToolbar;
  10374. };
  10375. ViewerUIConfig.prototype.getShowContextMenu=function(){
  10376. return this.showContextMenu;
  10377. };
  10378. ViewerUIConfig.prototype.getShowPageNavigation=function(){
  10379. return this.showPageNavigation;
  10380. };
  10381. ViewerUIConfig.prototype.getPrimarySelectionColor=function(){
  10382. return this.primarySelectionColor;
  10383. };
  10384. ViewerUIConfig.prototype.getSeondarySelectionColor=function(){
  10385. return this.secondarySelectionColor;
  10386. };
  10387. ViewerUIConfig.prototype.getShowSecondarySelection=function(){
  10388. return this.showSecondarySelection;
  10389. };
  10390. function ViewerHttpRequestConfig(){
  10391. this.reportStatus={};
  10392. this.UI={};
  10393. };
  10394. ViewerHttpRequestConfig.prototype.configure=function(_899){
  10395. applyJSONProperties(this,_899);
  10396. };
  10397. ViewerHttpRequestConfig.prototype.getRequestIndicator=function(){
  10398. if(this.UI){
  10399. return this.UI.requestIndicator?this.UI.requestIndicator:null;
  10400. }
  10401. };
  10402. ViewerHttpRequestConfig.prototype.getWorkingDialog=function(){
  10403. if(this.UI){
  10404. return this.UI.workingDialog?this.UI.workingDialog:null;
  10405. }
  10406. };
  10407. ViewerHttpRequestConfig.prototype.getReportStatusCallback=function(_89a){
  10408. if(this.reportStatus){
  10409. var _89b=this.reportStatus[_89a];
  10410. if(_89b){
  10411. return _89b;
  10412. }
  10413. if(_89a=="complete"&&this.reportStatus["initialComplete"]){
  10414. var _89c=this.reportStatus["initialComplete"];
  10415. this.reportStatus["initialComplete"]=null;
  10416. return _89c;
  10417. }
  10418. }
  10419. return null;
  10420. };
  10421. function ViewerState(){
  10422. this.findState=null;
  10423. this.pageState=null;
  10424. };
  10425. ViewerState.prototype.setFindState=function(_89d){
  10426. if(typeof ViewerFindState!="function"){
  10427. return;
  10428. }
  10429. if(!this.findState){
  10430. this.findState=new ViewerFindState();
  10431. }
  10432. this.findState.setState(_89d);
  10433. };
  10434. ViewerState.prototype.clearFindState=function(){
  10435. this.findState=null;
  10436. };
  10437. ViewerState.prototype.getFindState=function(){
  10438. return this.findState;
  10439. };
  10440. ViewerState.prototype.setPageState=function(_89e){
  10441. if(typeof ViewerPageState!="function"){
  10442. return;
  10443. }
  10444. if(!this.pageState){
  10445. this.pageState=new ViewerPageState();
  10446. }
  10447. this.pageState.setState(_89e);
  10448. };
  10449. ViewerState.prototype.clearPageState=function(){
  10450. this.pageState=null;
  10451. };
  10452. ViewerState.prototype.getPageState=function(){
  10453. return this.pageState;
  10454. };
  10455. function ViewerEventsConfig(){
  10456. this.showContextMenuOnClick=false;
  10457. };
  10458. ViewerEventsConfig.prototype.configure=function(_89f){
  10459. applyJSONProperties(this,_89f);
  10460. };
  10461. ViewerEventsConfig.prototype.getShowContextMenuOnClick=function(){
  10462. return this.showContextMenuOnClick;
  10463. };
  10464. CCognosViewer.prototype.loadExtra=function(){
  10465. var _8a0=this.getViewerWidget();
  10466. if(_8a0){
  10467. _8a0.loadExtraJavascriptFiles(this.getWebContentRoot());
  10468. }
  10469. };
  10470. function CCognosViewerToolbarHelper(){
  10471. };
  10472. CCognosViewerToolbarHelper.updateToolbarForCurrentSelection=function(oCV,_8a2){
  10473. if(_8a2){
  10474. var _8a3=oCV.getActionFactory();
  10475. for(var _8a4=0;_8a4<_8a2.length;++_8a4){
  10476. var name=_8a2[_8a4]["name"];
  10477. if(typeof name!="undefined"&&name!=null){
  10478. var _8a6=_8a3.load(name);
  10479. if(_8a6!=null&&typeof _8a6!="undefined"){
  10480. var _8a7=_8a6.updateMenu(_8a2[_8a4]);
  10481. if(_8a7.visible==false){
  10482. if(_8a7.save){
  10483. oCV.getViewerWidget().addButtonToSavedToolbarButtons(name,_8a2[_8a4],_8a4);
  10484. }
  10485. _8a2.splice(_8a4,1);
  10486. --_8a4;
  10487. }else{
  10488. _8a2[_8a4]=_8a7;
  10489. }
  10490. }
  10491. }else{
  10492. if(typeof _8a2[_8a4]._root!="undefined"){
  10493. CCognosViewerToolbarHelper.updateToolbarForCurrentSelection(oCV,_8a2[_8a4]._root);
  10494. }else{
  10495. if(_8a2[_8a4].separator){
  10496. if(_8a4==0||(_8a4>0&&_8a2[_8a4-1].separator)||_8a4==_8a2.length){
  10497. _8a2.splice(_8a4,1);
  10498. --_8a4;
  10499. }
  10500. }
  10501. }
  10502. }
  10503. }
  10504. }
  10505. };
  10506. CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection=function(oCV,_8a9){
  10507. var _8aa=[];
  10508. if(_8a9){
  10509. var _8ab=oCV.getActionFactory();
  10510. for(var _8ac=0;_8ac<_8a9.length;++_8ac){
  10511. var _8ad=_8a9[_8ac];
  10512. var name=_8a9[_8ac]["name"];
  10513. var _8af=true;
  10514. if(typeof name!="undefined"){
  10515. var _8b0=_8ab.load(name);
  10516. if(!_8b0){
  10517. if(name=="drillDown"){
  10518. _8b0=_8ab.load("DrillDown");
  10519. }else{
  10520. if(name=="drillUp"){
  10521. _8b0=_8ab.load("DrillUp");
  10522. }
  10523. }
  10524. }
  10525. if(_8b0!=null&&typeof _8b0!="undefined"){
  10526. if(typeof _8b0.buildMenu=="function"){
  10527. _8ad=_8b0.buildMenu(_8a9[_8ac]);
  10528. }else{
  10529. _8ad=_8b0.updateMenu(_8a9[_8ac]);
  10530. }
  10531. _8af=_8b0.isValidMenuItem();
  10532. }else{
  10533. if(typeof _8ad.items!="undefined"){
  10534. _8ad.items=CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(oCV,_8ad.items);
  10535. _8af=(_8ad.items&&_8ad.items.length>0)?true:false;
  10536. if(_8af&&_8ad.items.length==1){
  10537. _8ad=_8ad.items[0];
  10538. }
  10539. }
  10540. }
  10541. }
  10542. if(_8ad&&_8ad.visible!==false&&_8af){
  10543. if(_8ad.separator===true){
  10544. if(_8aa.length>0&&typeof _8aa[_8aa.length-1].separator=="undefined"){
  10545. _8aa[_8aa.length]=_8ad;
  10546. }
  10547. }else{
  10548. if(_8ad.useChildrenItems==true&&_8ad.items&&_8ad.items.length>0){
  10549. if(!_8ad.disabled){
  10550. for(var _8b1=0;_8b1<_8ad.items.length;_8b1++){
  10551. _8aa[_8aa.length]=_8ad.items[_8b1];
  10552. }
  10553. }
  10554. }else{
  10555. if(typeof _8ad._root!="undefined"){
  10556. _8aa[_8aa.length]={"_root":CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(oCV,_8ad._root)};
  10557. }else{
  10558. _8aa[_8aa.length]=_8ad;
  10559. }
  10560. }
  10561. }
  10562. }
  10563. }
  10564. if(_8aa.length>1){
  10565. if(_8aa[_8aa.length-1].separator){
  10566. _8aa=_8aa.splice(0,_8aa.length-1);
  10567. }
  10568. }
  10569. }
  10570. return _8aa;
  10571. };
  10572. function CCDManager(cv){
  10573. this.m_cd=null;
  10574. this.m_md=null;
  10575. this.m_oCV=null;
  10576. this.m_dataItemInfo=null;
  10577. };
  10578. CCDManager.prototype.SetContextData=function(CD){
  10579. if(this.m_cd){
  10580. this.m_cd=null;
  10581. }
  10582. this.m_cd=CD;
  10583. };
  10584. CCDManager.prototype.SetMetadata=function(MD){
  10585. if(this.m_md){
  10586. this.m_md=null;
  10587. }
  10588. this.m_md=MD;
  10589. };
  10590. CCDManager.prototype.AddContextData=function(CD){
  10591. if(!this.m_cd){
  10592. this.m_cd=CD;
  10593. }else{
  10594. for(var i in CD){
  10595. this.m_cd[i]=CD[i];
  10596. }
  10597. }
  10598. };
  10599. CCDManager.prototype.AddMetadata=function(MD){
  10600. if(!this.m_md){
  10601. this.m_md=MD;
  10602. }else{
  10603. for(var j in MD){
  10604. this.m_md[j]=MD[j];
  10605. }
  10606. }
  10607. };
  10608. CCDManager.prototype.getClonedMetadataArray=function(){
  10609. var _8b9={};
  10610. applyJSONProperties(_8b9,this.m_md);
  10611. return _8b9;
  10612. };
  10613. CCDManager.prototype.getClonedContextdataArray=function(){
  10614. var _8ba={};
  10615. applyJSONProperties(_8ba,this.m_cd);
  10616. return _8ba;
  10617. };
  10618. CCDManager.prototype.SetCognosViewer=function(_8bb){
  10619. if(_8bb){
  10620. this.m_oCV=_8bb;
  10621. }
  10622. };
  10623. CCDManager.prototype.onComplete_GetCDRequest=function(_8bc,_8bd){
  10624. if(_8bc){
  10625. var _8be=_8bc.getResult();
  10626. var _8bf=XMLBuilderLoadXMLFromString(_8be);
  10627. if(_8bf){
  10628. var _8c0=_8bf.getElementsByTagName("Block");
  10629. for(var i=0;i<_8c0.length;i++){
  10630. var _8c2="";
  10631. var _8c3=_8c0[i].firstChild;
  10632. while(_8c3){
  10633. _8c2+=_8c3.nodeValue;
  10634. _8c3=_8c3.nextSibling;
  10635. }
  10636. var cd=eval("("+_8c2+")");
  10637. this.AddContextData(cd);
  10638. }
  10639. }
  10640. }
  10641. if(_8bd&&typeof _8bd=="function"){
  10642. _8bd();
  10643. }
  10644. };
  10645. CCDManager.prototype.FetchContextData=function(_8c5,_8c6){
  10646. var _8c7=[];
  10647. var c=null,_8c9=_8c5.length;
  10648. for(var i=0;i<_8c9;++i){
  10649. c=_8c5[i];
  10650. if(c!=""&&!this.ContextIdExists(c)){
  10651. _8c7.push(c);
  10652. }
  10653. }
  10654. if(_8c7.length){
  10655. if(this.m_oCV){
  10656. this.getContextData(_8c7,_8c6);
  10657. }
  10658. }
  10659. return _8c7.length;
  10660. };
  10661. CCDManager.prototype.getContextData=function(_8cb,_8cc){
  10662. var oCV=this.m_oCV;
  10663. var _8ce=new AsynchDataDispatcherEntry(oCV);
  10664. _8ce.setCanBeQueued(false);
  10665. if(!oCV.isBux){
  10666. _8ce.forceSynchronous();
  10667. }
  10668. var form=document["formWarpRequest"+oCV.getId()];
  10669. var _8d0=oCV.getConversation();
  10670. var _8d1=oCV.getTracking();
  10671. if(!_8d1&&form&&form["m_tracking"]&&form["m_tracking"].value){
  10672. _8d1=form["m_tracking"].value;
  10673. }
  10674. if(oCV.m_viewerFragment){
  10675. var _8d2=oCV.getActiveRequest();
  10676. if(_8d2&&_8d2.getFormField("m_tracking")==_8d1){
  10677. return;
  10678. }
  10679. }
  10680. var _8d3={customArguments:[_8cc],"complete":{"object":this,"method":this.onComplete_GetCDRequest}};
  10681. if(oCV.getStatus()=="prompting"){
  10682. _8d3["prompting"]={"object":this,"method":this.onComplete_GetCDRequest};
  10683. }
  10684. _8ce.setCallbacks(_8d3);
  10685. if(_8d0&&oCV.envParams["ui.action"]!="view"){
  10686. _8ce.addFormField("ui.action","getContext");
  10687. _8ce.addFormField("ui.conversation",_8d0);
  10688. }else{
  10689. var _8d4=form["ui.object"];
  10690. if(typeof _8d4.length!="undefined"&&_8d4.length>1){
  10691. _8ce.addFormField("ui.object",form["ui.object"][0].value);
  10692. }else{
  10693. _8ce.addFormField("ui.object",form["ui.object"].value);
  10694. }
  10695. _8ce.addFormField("ui.action","getObjectContext");
  10696. }
  10697. _8ce.addFormField("cv.responseFormat","asynchDetailContext");
  10698. _8ce.addFormField("context.format","initializer");
  10699. _8ce.addFormField("context.type","reportService");
  10700. _8ce.addFormField("context.selection",_8cb.join(","));
  10701. _8ce.addNonEmptyStringFormField("m_tracking",_8d1);
  10702. oCV.dispatchRequest(_8ce);
  10703. };
  10704. CCDManager.prototype.ContextIdExists=function(_8d5){
  10705. return (this.m_cd&&this.m_cd[_8d5]?true:false);
  10706. };
  10707. CCDManager.prototype.HasContextData=function(){
  10708. return (this.m_cd?true:false);
  10709. };
  10710. CCDManager.prototype.HasMetadata=function(){
  10711. return (this.m_md?true:false);
  10712. };
  10713. CCDManager.prototype._getMDPropertyFromCD=function(_8d6,_8d7,_8d8){
  10714. var p=null;
  10715. this.FetchContextData([_8d6]);
  10716. var cd=this.m_cd&&this.m_cd[_8d6];
  10717. if(cd){
  10718. var md=this.m_md[cd[_8d7]];
  10719. if(md){
  10720. p=md[_8d8];
  10721. }
  10722. }
  10723. return p;
  10724. };
  10725. CCDManager.prototype.GetDrillFlag=function(_8dc){
  10726. return this._getMDPropertyFromCD(_8dc,"r","drill");
  10727. };
  10728. CCDManager.prototype.getModelPathFromBookletItem=function(_8dd){
  10729. var mp=null;
  10730. var md=this.m_md[_8dd];
  10731. if(md){
  10732. mp=md.mp;
  10733. if(mp&&this.m_md[mp]){
  10734. mp=this.m_md[mp].mp;
  10735. }
  10736. }
  10737. return mp?mp:null;
  10738. };
  10739. CCDManager.prototype.GetBookletModelBasedDrillThru=function(_8e0){
  10740. var p=null;
  10741. var md=this.m_md[_8e0];
  10742. if(md){
  10743. p=md.modelBasedDrillThru;
  10744. }
  10745. return p?p:0;
  10746. };
  10747. CCDManager.prototype.GetDrillFlagForMember=function(_8e3){
  10748. var _8e4=null;
  10749. var d=this._getMDPropertyFromCD(_8e3,"r","drill");
  10750. if(d!==null&&this.m_cd[_8e3].m){
  10751. _8e4=d;
  10752. }
  10753. return _8e4;
  10754. };
  10755. CCDManager.prototype.GetDataType=function(_8e6){
  10756. return this._getMDPropertyFromCD(_8e6,"r","dtype");
  10757. };
  10758. CCDManager.prototype.GetUsage=function(_8e7){
  10759. return this._getMDPropertyFromCD(_8e7,"r","usage");
  10760. };
  10761. CCDManager.prototype.GetHUN=function(_8e8){
  10762. var hun=this._getMDPropertyFromCD(_8e8,"h","h");
  10763. if(!hun){
  10764. var h=this._getMDPropertyFromCD(_8e8,"r","h");
  10765. if(h){
  10766. hun=this.m_md[h].h;
  10767. }
  10768. }
  10769. if(hun!=null&&hun.indexOf("[__ns_")==0){
  10770. hun=null;
  10771. }
  10772. return hun;
  10773. };
  10774. CCDManager.prototype.GetQuery=function(_8eb){
  10775. var qry=null;
  10776. var q=this._getMDPropertyFromCD(_8eb,"r","q");
  10777. if(q){
  10778. qry=this.m_md[q].q;
  10779. }
  10780. return qry;
  10781. };
  10782. CCDManager.prototype.GetDepth=function(_8ee){
  10783. return this._getMDPropertyFromCD(_8ee,"r","level");
  10784. };
  10785. CCDManager.prototype.GetDisplayValue=function(_8ef){
  10786. var _8f0=null;
  10787. this.FetchContextData([_8ef]);
  10788. if(this.ContextIdExists(_8ef)&&this.m_cd[_8ef]){
  10789. _8f0=this.m_cd[_8ef].u;
  10790. }
  10791. return _8f0;
  10792. };
  10793. CCDManager.prototype.GetPUN=function(_8f1){
  10794. return this._getMDPropertyFromCD(_8f1,"p","p");
  10795. };
  10796. CCDManager.prototype.GetLUN=function(_8f2){
  10797. return this._getMDPropertyFromCD(_8f2,"l","l");
  10798. };
  10799. CCDManager.prototype.GetMUN=function(_8f3){
  10800. return this._getMDPropertyFromCD(_8f3,"m","m");
  10801. };
  10802. CCDManager.prototype.GetDUN=function(_8f4){
  10803. return this._getMDPropertyFromCD(_8f4,"d","d");
  10804. };
  10805. CCDManager.prototype.GetQMID=function(_8f5){
  10806. return this._getMDPropertyFromCD(_8f5,"i","i");
  10807. };
  10808. CCDManager.prototype.GetRDIValue=function(_8f6){
  10809. return this._getMDPropertyFromCD(_8f6,"r","r");
  10810. };
  10811. CCDManager.prototype.GetBIValue=function(_8f7){
  10812. return this._getMDPropertyFromCD(_8f7,"r","bi");
  10813. };
  10814. CCDManager.prototype.getContextIdForMetaData=function(lun,hun,_8fa){
  10815. var _8fb=[{"expression":lun,"type":"l"},{"expression":hun,"type":"h"}];
  10816. for(var _8fc=0;_8fc<_8fb.length;++_8fc){
  10817. var _8fd=_8fb[_8fc].expression;
  10818. var _8fe=_8fb[_8fc].type;
  10819. if(_8fd==""){
  10820. continue;
  10821. }
  10822. for(var _8ff in this.m_md){
  10823. if(this.m_md[_8ff][_8fe]==_8fd){
  10824. for(var _900 in this.m_md){
  10825. if(this.m_md[_900].r&&this.m_md[_900][_8fe]==_8ff){
  10826. if(this.m_md[_900].drill!=0||_8fa==true){
  10827. for(var ctx in this.m_cd){
  10828. if(this.m_cd[ctx].r==_900&&this.m_cd[ctx].m){
  10829. return ctx;
  10830. }
  10831. }
  10832. }
  10833. }
  10834. }
  10835. }
  10836. }
  10837. }
  10838. return "";
  10839. };
  10840. CCDManager.prototype.GetContextIdForMUN=function(mun){
  10841. var _903=null;
  10842. var _904=null;
  10843. for(var i in this.m_md){
  10844. if(this.m_md[i].m==mun){
  10845. _903=i;
  10846. break;
  10847. }
  10848. }
  10849. if(_903!=null){
  10850. for(var j in this.m_cd){
  10851. if(this.m_cd[j].m==_903){
  10852. _904=j;
  10853. break;
  10854. }
  10855. }
  10856. }
  10857. return _904;
  10858. };
  10859. CCDManager.prototype.GetContextIdsForRDI=function(rdi){
  10860. var _908=[];
  10861. for(var i in this.m_md){
  10862. if(this.m_md[i].r==rdi){
  10863. _908.push(i);
  10864. }
  10865. }
  10866. return _908;
  10867. };
  10868. CCDManager.prototype.getMUNForRDIAndUseValue=function(rdi,_90b){
  10869. var _90c=this.GetContextIdsForRDI(rdi);
  10870. for(var i in this.m_cd){
  10871. for(var j in _90c){
  10872. if(this.m_cd[i].r==_90c[j]&&this.m_cd[i].u==_90b){
  10873. var _90f=this.m_cd[i].m;
  10874. if(_90f){
  10875. return this.m_md[_90f].m;
  10876. }
  10877. }
  10878. }
  10879. }
  10880. return null;
  10881. };
  10882. CCDManager.prototype.GetPageMinMaxForRDI=function(rdi){
  10883. var _911=null;
  10884. var _912=null;
  10885. var _913=this.GetContextIdsForRDI(rdi);
  10886. this.FetchContextData([0]);
  10887. for(var i in this.m_cd){
  10888. for(var j in _913){
  10889. if(this.m_cd[i].r==_913[j]){
  10890. var _916=parseFloat(this.m_cd[i].u);
  10891. if(_916==this.m_cd[i].u){
  10892. if(_911==null||_916<_911){
  10893. _911=_916;
  10894. }
  10895. if(_912==null||_916>_912){
  10896. _912=_916;
  10897. }
  10898. }
  10899. }
  10900. }
  10901. }
  10902. if(_911!=null&&_912!=null){
  10903. return eval("({ pageMin: "+_911+", pageMax: "+_912+"})");
  10904. }
  10905. };
  10906. CCDManager.prototype.GetContextIdForDisplayValue=function(_917){
  10907. var _918=null;
  10908. for(var i in this.m_cd){
  10909. if(this.m_cd[i].u==_917){
  10910. _918=i;
  10911. break;
  10912. }
  10913. }
  10914. return _918;
  10915. };
  10916. CCDManager.prototype.GetContextIdForUseValue=function(_91a){
  10917. var _91b=null;
  10918. var _91c=null;
  10919. var _91d=null;
  10920. for(var i in this.m_md){
  10921. var md=this.m_md[i];
  10922. for(var j in md){
  10923. if(md[j]==_91a){
  10924. _91b=i;
  10925. _91c=j;
  10926. break;
  10927. }
  10928. }
  10929. }
  10930. if(_91b!=null){
  10931. for(var k in this.m_cd){
  10932. if(this.m_cd[k][_91c]==_91b){
  10933. _91d=k;
  10934. break;
  10935. }
  10936. }
  10937. }
  10938. return _91d;
  10939. };
  10940. CCDManager.prototype.getDataItemInfo=function(){
  10941. if(this.m_cd){
  10942. var _922={};
  10943. this.m_dataItemInfo={};
  10944. for(var i in this.m_cd){
  10945. var _924=this.m_cd[i].r;
  10946. if(typeof _924!="undefined"){
  10947. var _925=this.m_md[_924].r;
  10948. if(this.m_dataItemInfo[_925]==null){
  10949. this.m_dataItemInfo[_925]=1;
  10950. }else{
  10951. this.m_dataItemInfo[_925]++;
  10952. }
  10953. }
  10954. }
  10955. return CViewerCommon.toJSON(this.m_dataItemInfo);
  10956. }
  10957. return "";
  10958. };
  10959. CCDManager.prototype.DataItemInfoToJSON=function(){
  10960. return this.getDataItemInfo();
  10961. };
  10962. CCDManager.prototype.MetadataToJSON=function(){
  10963. if(this.m_md){
  10964. return CViewerCommon.toJSON(this.m_md);
  10965. }
  10966. return "";
  10967. };
  10968. CCDManager.prototype.ContextDataToJSON=function(){
  10969. if(this.m_cd){
  10970. return CViewerCommon.toJSON(this.m_cd);
  10971. }
  10972. return "";
  10973. };
  10974. CCDManager.prototype.ContextDataSubsetToJSON=function(_926){
  10975. if(_926<=0){
  10976. return this.ContextDataToJSON();
  10977. }
  10978. if(this.m_cd){
  10979. var _927={};
  10980. var _928={};
  10981. for(var i in this.m_cd){
  10982. var _92a=this.m_cd[i].r;
  10983. if(typeof _92a!="undefined"){
  10984. if(_927[_92a]==null){
  10985. _927[_92a]=0;
  10986. }else{
  10987. _927[_92a]++;
  10988. }
  10989. if(_927[_92a]<_926){
  10990. _928[i]=this.m_cd[i];
  10991. }
  10992. }
  10993. }
  10994. return CViewerCommon.toJSON(_928);
  10995. }
  10996. return "";
  10997. };
  10998. CCDManager.prototype.GetHUNForRDI=function(rdi,_92c){
  10999. for(var i in this.m_md){
  11000. if(this.m_md[i].r==rdi&&this.m_md[i].q==_92c){
  11001. var _92e=this.m_md[i].h;
  11002. if(_92e){
  11003. return this.m_md[_92e].h;
  11004. }
  11005. }
  11006. }
  11007. return null;
  11008. };
  11009. CCDManager.prototype.GetMetadataIdForQueryName=function(_92f){
  11010. for(var i in this.m_md){
  11011. if(this.m_md[i].q===_92f){
  11012. return i;
  11013. }
  11014. }
  11015. return null;
  11016. };
  11017. CCDManager.prototype._isEmptyObject=function(obj){
  11018. for(var _932 in obj){
  11019. return false;
  11020. }
  11021. return true;
  11022. };
  11023. CCDManager.prototype.isMetadataEmpty=function(){
  11024. if(this.m_md){
  11025. return this._isEmptyObject(this.m_md);
  11026. }
  11027. return true;
  11028. };
  11029. CCDManager.prototype.GetBestPossibleItemName=function(_933){
  11030. var item=this.m_cd[_933];
  11031. if(!item){
  11032. return null;
  11033. }
  11034. if(item.l&&this.m_md[item.l].l){
  11035. return this._getStringInLastBracket(this.m_md[item.l].l);
  11036. }
  11037. if(item.r&&this.m_md[item.r].r){
  11038. return this._getStringInLastBracket(this.m_md[item.r].r);
  11039. }
  11040. if(item.h&&this.m_md[item.h].h){
  11041. return this._getStringInLastBracket(this.m_md[item.h].h);
  11042. }
  11043. if(item.i&&this.m_md[item.i].i){
  11044. return this._getStringInLastBracket(this.m_md[item.i].i);
  11045. }
  11046. return null;
  11047. };
  11048. CCDManager.prototype.GetBestPossibleDimensionMeasureName=function(_935){
  11049. var item=this.m_cd[_935];
  11050. if(item&&item.m&&this.m_md[item.m]&&this.m_md[item.m].m){
  11051. return this._getStringInLastBracket(this.m_md[item.m].m);
  11052. }
  11053. return null;
  11054. };
  11055. CCDManager.prototype._getStringInLastBracket=function(str){
  11056. if(str&&str.indexOf("].[")>0){
  11057. var _938=str.split("].[");
  11058. var _939=_938[_938.length-1];
  11059. return _939.substring(0,_939.length-1);
  11060. }
  11061. return str;
  11062. };
  11063. CCDManager.prototype._replaceNamespaceForSharedTM1DimensionOnly=function(_93a){
  11064. var _93b=this._getNamespaceAndDimensionFromUniqueName(_93a);
  11065. if(_93b&&this.m_md){
  11066. for(var _93c in this.m_md){
  11067. var sMun=this.m_md[_93c].m;
  11068. if(sMun&&sMun.length>0){
  11069. if(sMun.indexOf("->:[TM].")>0){
  11070. var oObj=this._getNamespaceAndDimensionFromUniqueName(sMun);
  11071. if(oObj.dimension&&oObj.dimension===_93b.dimension&&oObj.namespace!==_93b.namespace){
  11072. var _93f=_93a.indexOf(".");
  11073. return oObj.namespace+_93a.substr(_93f,_93a.length);
  11074. }
  11075. }else{
  11076. var _940=sMun.indexOf("->:[");
  11077. if(_940>0){
  11078. if(sMun.substr(_940+4,4)!=="TM]."){
  11079. return _93a;
  11080. }
  11081. }
  11082. }
  11083. }
  11084. }
  11085. }
  11086. return _93a;
  11087. };
  11088. CCDManager.prototype._getNamespaceAndDimensionFromUniqueName=function(_941){
  11089. if(_941&&_941.length>0&&_941.indexOf("].[")>0){
  11090. var _942=_941.split("].[");
  11091. if(_942.length>1){
  11092. return {"namespace":_942[0]+"]","dimension":"["+_942[1]+"]"};
  11093. }
  11094. }
  11095. return null;
  11096. };
  11097. CCDManager.prototype.destroy=function(){
  11098. delete this.m_cd;
  11099. delete this.m_md;
  11100. delete this.m_oCV;
  11101. delete this.m_dataItemInfo;
  11102. };
  11103. var GUtil={};
  11104. GUtil.createHiddenForm=function(name,_944,_945,_946){
  11105. var form=document.getElementById(name);
  11106. if(form){
  11107. document.body.removeChild(form);
  11108. }
  11109. form=document.createElement("form");
  11110. form.id=name;
  11111. form.name=name;
  11112. form.method=_944;
  11113. form.style.display="none";
  11114. form.action=document.forms["formWarpRequest"+_945].action;
  11115. form.target=_946+(new Date()).getTime();
  11116. document.body.appendChild(form);
  11117. return form;
  11118. };
  11119. GUtil.createFormField=function(el,name,_94a){
  11120. var _94b=document.createElement("input");
  11121. _94b.type="hidden";
  11122. _94b.name=name;
  11123. _94b.value=_94a;
  11124. el.appendChild(_94b);
  11125. };
  11126. GUtil.generateCallback=function(func,_94d,_94e){
  11127. if(func){
  11128. var _94f=_94e||this;
  11129. _94d=(_94d instanceof Array)?_94d:[];
  11130. return (function(_950){
  11131. if(typeof _950!="undefined"&&_94d.length==0){
  11132. _94d.push(_950);
  11133. }
  11134. return func.apply(_94f,_94d);
  11135. });
  11136. }else{
  11137. return (function(){
  11138. });
  11139. }
  11140. };
  11141. GUtil.destroyProperties=function(_951,_952){
  11142. var _953;
  11143. if(_951 instanceof Array){
  11144. for(var i=0;i<_951.length;i++){
  11145. _953=_951[i];
  11146. if(_953 instanceof String){
  11147. _953=null;
  11148. }else{
  11149. if(_953&&_953.destroy&&!_953._beingDestroyed){
  11150. _953.destroy();
  11151. }
  11152. GUtil.destroyProperties(_953);
  11153. }
  11154. }
  11155. }else{
  11156. if(_951 instanceof Object){
  11157. if(_951._beingDestroyed){
  11158. return;
  11159. }
  11160. var obj=_951;
  11161. obj._beingDestroyed=true;
  11162. for(var _956 in obj){
  11163. _953=obj[_956];
  11164. if(_956==="_beingDestroyed"||_956==="m_destroyed"||_956==="_destroyed"||typeof _953=="function"){
  11165. continue;
  11166. }
  11167. if(_953 instanceof Array){
  11168. GUtil.destroyProperties(_953);
  11169. }else{
  11170. if(_953 instanceof Object){
  11171. if(typeof _953.destroy=="function"&&!_953._destroyed&&(_953!==CCognosViewer||_952)){
  11172. _953.destroy();
  11173. }
  11174. }
  11175. }
  11176. delete obj[_956];
  11177. }
  11178. }
  11179. }
  11180. };
  11181. cvLoadDialog=function(_957,_958,_959,_95a,_95b,_95c){
  11182. _95c=((_95c===undefined)?true:_95c);
  11183. var _95d=document.getElementById("formWarpRequest"+_957.getId());
  11184. if(_95d&&_957){
  11185. _957.getWorkingDialog().hide();
  11186. var _95e="";
  11187. var _95f="";
  11188. var _960=null;
  11189. if(_957.isAccessibleMode()){
  11190. _95e="winNAT_"+(new Date()).getTime();
  11191. _95f=_957.getWebContentRoot()+"/"+"rv/blankNewWin.html?cv.id="+this.getCVId();
  11192. }else{
  11193. var _961=document.body;
  11194. _960=new CModal("","",_961,null,null,_95a,_959,true,true,false,true,_957.getWebContentRoot());
  11195. if(typeof _95b=="string"){
  11196. document.getElementById(CMODAL_CONTENT_ID).setAttribute("title",_95b);
  11197. }
  11198. document.getElementById(CMODAL_BACK_IFRAME_ID).setAttribute("title",RV_RES.IDS_JS_MODAL_BACK_IFRAME);
  11199. _95e=CMODAL_CONTENT_ID;
  11200. }
  11201. var _962=document.createElement("FORM");
  11202. _962.method="POST";
  11203. _962.action=_957.getGateway();
  11204. _962.target=_95e;
  11205. _962.style.margin="0px";
  11206. document.body.appendChild(_962);
  11207. for(var _963 in _958){
  11208. _962.appendChild(createHiddenFormField(_963,_958[_963]));
  11209. }
  11210. if(_95c){
  11211. _962.appendChild(createHiddenFormField("cv.id",_957.getId()));
  11212. _962.appendChild(createHiddenFormField("b_action","xts.run"));
  11213. _962.appendChild(createHiddenFormField("ui.action",_95d["ui.action"].value));
  11214. _962.appendChild(createHiddenFormField("ui.object",_95d["ui.object"].value));
  11215. if(typeof _957.rvMainWnd!="undefined"){
  11216. _962.appendChild(createHiddenFormField("run.outputFormat",_957.rvMainWnd.getCurrentFormat()));
  11217. }
  11218. if(typeof _95d["run.outputLocale"]!="undefined"){
  11219. _962.appendChild(createHiddenFormField("run.outputLocale",_95d["run.outputLocale"].value));
  11220. }
  11221. if(typeof _962["backURL"]=="undefined"&&typeof _962["ui.backURL"]=="undefined"&&typeof _95d["ui.backURL"]!="undefined"){
  11222. _962.appendChild(createHiddenFormField("ui.backURL",_95d["ui.backURL"].value));
  11223. }
  11224. if(typeof _957!="undefined"&&typeof _957.getConversation!="undefined"&&typeof _957.getTracking!="undefined"){
  11225. _962.appendChild(createHiddenFormField("ui.conversation",_957.getConversation()));
  11226. _962.appendChild(createHiddenFormField("m_tracking",_957.getTracking()));
  11227. if(_957.envParams["ui.name"]!="undefined"){
  11228. _962.appendChild(createHiddenFormField("ui.name",_957.envParams["ui.name"]));
  11229. }
  11230. }
  11231. }
  11232. var _964=window.onbeforeunload;
  11233. window.onbeforeunload=null;
  11234. if(_957.isAccessibleMode()){
  11235. window.open(_95f,_95e,"rv");
  11236. _962.submit();
  11237. }else{
  11238. _962.submit();
  11239. _960.show();
  11240. }
  11241. window.onbeforeunload=_964;
  11242. document.body.removeChild(_962);
  11243. _957.modalShown=true;
  11244. }
  11245. };
  11246. function createHiddenFormField(name,_966){
  11247. var _967=document.createElement("input");
  11248. _967.setAttribute("type","hidden");
  11249. _967.setAttribute("name",name);
  11250. _967.setAttribute("id",name);
  11251. _967.setAttribute("value",_966);
  11252. return (_967);
  11253. };
  11254. function isAuthenticationFault(_968){
  11255. if(_968!=null){
  11256. var _969=XMLHelper_FindChildByTagName(_968,"CAM",true);
  11257. return (_969!=null&&XMLHelper_FindChildByTagName(_969,"promptInfo",true)!=null);
  11258. }
  11259. };
  11260. function processAuthenticationFault(_96a,_96b){
  11261. if(isAuthenticationFault(_96a)){
  11262. launchLogOnDialog(_96b,_96a);
  11263. return true;
  11264. }
  11265. return false;
  11266. };
  11267. function isObjectEmpty(_96c){
  11268. for(var _96d in _96c){
  11269. if(_96c.hasOwnProperty(_96d)){
  11270. return false;
  11271. }
  11272. }
  11273. return true;
  11274. };
  11275. function launchLogOnDialog(cvID,_96f){
  11276. try{
  11277. var oCV=getCognosViewerObjectRef(cvID);
  11278. var _971={"b_action":"xts.run","m":"portal/close.xts","h_CAM_action":"logonAs"};
  11279. if(_96f!=null){
  11280. var _972=XMLHelper_FindChildrenByTagName(_96f,"namespace",true);
  11281. if(_972!=null){
  11282. for(var _973=0;_973<_972.length;++_973){
  11283. var _974=_972[_973];
  11284. if(_974!=null){
  11285. var _975=XMLHelper_FindChildByTagName(_974,"name",false);
  11286. var _976=XMLHelper_FindChildByTagName(_974,"value",false);
  11287. if(_975!=null&&_976!=null){
  11288. var _977=XMLHelper_GetText(_975);
  11289. var _978=XMLHelper_GetText(_976);
  11290. if(_977!=null&&_977.length>0){
  11291. _971[_977]=_978;
  11292. }
  11293. }
  11294. }
  11295. }
  11296. }
  11297. }
  11298. cvLoadDialog(oCV,_971,540,460,null,false);
  11299. }
  11300. catch(exception){
  11301. }
  11302. };
  11303. function getCVWaitingOnFault(){
  11304. var oCV=null;
  11305. for(var _97a=0;_97a<window.gaRV_INSTANCES.length;_97a++){
  11306. if(window.gaRV_INSTANCES[_97a].getRetryDispatcherEntry()!=null){
  11307. oCV=window.gaRV_INSTANCES[_97a];
  11308. break;
  11309. }
  11310. }
  11311. return oCV;
  11312. };
  11313. function ccModalCallBack(_97b,data){
  11314. var oCV=getCVWaitingOnFault();
  11315. destroyCModal();
  11316. if(typeof HiddenIframeDispatcherEntry=="function"&&HiddenIframeDispatcherEntry.hideIframe){
  11317. var oCV=window.gaRV_INSTANCES[0];
  11318. if(oCV){
  11319. HiddenIframeDispatcherEntry.hideIframe(oCV.getId());
  11320. }
  11321. }
  11322. if(oCV!=null){
  11323. if(typeof _97b!="undefined"&&_97b=="ok"){
  11324. var _97e=oCV.getRetryDispatcherEntry();
  11325. if(_97e){
  11326. _97e.retryRequest();
  11327. }
  11328. if(oCV.getRV()!=null){
  11329. oCV.getRV().updateUserName();
  11330. }
  11331. }else{
  11332. oCV.rvMainWnd.hideOpenMenus();
  11333. }
  11334. }
  11335. };
  11336. function closeErrorPage(){
  11337. var oCV=getCVWaitingOnFault();
  11338. destroyCModal();
  11339. if(oCV!=null){
  11340. oCV.setRetryDispatcherEntry(null);
  11341. oCV.rvMainWnd.hideOpenMenus();
  11342. }
  11343. };
  11344. function getCrossBrowserNode(evt,_981){
  11345. var node=null;
  11346. if(_981&&evt.explicitOriginalTarget){
  11347. node=evt.explicitOriginalTarget;
  11348. }else{
  11349. if(evt.originalTarget){
  11350. node=evt.originalTarget;
  11351. }else{
  11352. if(evt.target){
  11353. node=evt.target;
  11354. }else{
  11355. if(evt.srcElement){
  11356. node=evt.srcElement;
  11357. }
  11358. }
  11359. }
  11360. }
  11361. try{
  11362. if(node&&node.nodeType==3){
  11363. node=node.parentNode;
  11364. }
  11365. }
  11366. catch(ex){
  11367. }
  11368. return node;
  11369. };
  11370. function getNodeFromEvent(evt,_984){
  11371. var node=getCrossBrowserNode(evt,true);
  11372. if(node&&node.getAttribute&&node.getAttribute("name")=="primarySelectionDiv"){
  11373. node=node.parentNode.firstChild;
  11374. }
  11375. if(node&&node.getAttribute&&node.getAttribute("flashChartContainer")=="true"){
  11376. node=node.firstChild;
  11377. }
  11378. if(node&&node.getAttribute&&node.getAttribute("chartContainer")=="true"&&node.childNodes){
  11379. for(var i=0;i<node.childNodes.length;i++){
  11380. if(node.childNodes[i].nodeName.toLowerCase()=="img"){
  11381. node=node.childNodes[i];
  11382. break;
  11383. }
  11384. }
  11385. }else{
  11386. if(!_984&&node&&node.nodeName&&node.nodeName.toLowerCase()=="img"&&node.getAttribute("rsvpChart")!="true"){
  11387. node=node.parentNode;
  11388. }
  11389. }
  11390. return node;
  11391. };
  11392. function getCtxNodeFromEvent(evt){
  11393. try{
  11394. var node=getCrossBrowserNode(evt);
  11395. var _989=node.nodeName.toUpperCase();
  11396. if((_989=="SPAN"||_989=="AREA"||_989=="IMG")&&node.getAttribute("ctx")!=null){
  11397. return node;
  11398. }else{
  11399. if(_989=="SPAN"&&(node.parentNode.getAttribute("ctx")!=null)){
  11400. return node.parentNode;
  11401. }
  11402. }
  11403. }
  11404. catch(exception){
  11405. }
  11406. return null;
  11407. };
  11408. function getDocumentFromEvent(evt){
  11409. var node=getCrossBrowserNode(evt,true);
  11410. var _98c=node.document?node.document:node.ownerDocument;
  11411. return _98c;
  11412. };
  11413. function stopEventBubble(evt){
  11414. evt.returnValue=false;
  11415. evt.cancelBubble=true;
  11416. if(typeof evt.stopPropagation!="undefined"){
  11417. evt.stopPropagation();
  11418. }
  11419. if(typeof evt.preventDefault!="undefined"){
  11420. evt.preventDefault();
  11421. }
  11422. return false;
  11423. };
  11424. function setNodeFocus(evt){
  11425. evt=(evt)?evt:((event)?event:null);
  11426. var _98f=getNodeFromEvent(evt);
  11427. if(_98f&&_98f.nodeName){
  11428. var _990=_98f.nodeName.toLowerCase();
  11429. if((_990=="td"||_990=="span")&&_98f.childNodes&&_98f.childNodes.length>0&&_98f.childNodes[0].className=="textItem"){
  11430. try{
  11431. _98f.childNodes[0].focus();
  11432. }
  11433. catch(e){
  11434. if(typeof console!=="undefined"&&console.log){
  11435. console.log("CCognosViewer: Could not set focus to node. setNodeFocus method common.js");
  11436. }
  11437. }
  11438. }
  11439. }
  11440. };
  11441. function html_encode(str){
  11442. return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");
  11443. };
  11444. function replaceNewLine(_992){
  11445. var regX=/\r\n|\r|\n/g;
  11446. var _994="<br/>";
  11447. return _992.replace(regX,_994);
  11448. };
  11449. function xml_encode(_995){
  11450. var _996=""+_995;
  11451. if((_996=="0")||((_995!=null)&&(_995!=false))){
  11452. _996=_996.replace(/&/g,"&amp;");
  11453. _996=_996.replace(/</g,"&lt;");
  11454. _996=_996.replace(/>/g,"&gt;");
  11455. _996=_996.replace(/"/g,"&quot;");
  11456. _996=_996.replace(/'/g,"&apos;");
  11457. }else{
  11458. if(_995==null){
  11459. _996="";
  11460. }
  11461. }
  11462. return _996;
  11463. };
  11464. function xml_decodeParser(sAll,_998){
  11465. var _999=sAll;
  11466. switch(_998){
  11467. case "amp":
  11468. _999="&";
  11469. break;
  11470. case "lt":
  11471. _999="<";
  11472. break;
  11473. case "gt":
  11474. _999=">";
  11475. break;
  11476. case "quot":
  11477. _999="\"";
  11478. break;
  11479. case "apos":
  11480. _999="'";
  11481. break;
  11482. }
  11483. return _999;
  11484. };
  11485. function xml_decode(_99a){
  11486. var _99b=""+_99a;
  11487. if((_99b=="0")||((_99a!=null)&&(_99a!=false))){
  11488. _99b=_99b.replace(/&(amp|lt|gt|quot|apos);/g,xml_decodeParser);
  11489. }else{
  11490. if(_99a==null){
  11491. _99b="";
  11492. }
  11493. }
  11494. return _99b;
  11495. };
  11496. function xpath_attr_encode(_99c){
  11497. var _99d=null;
  11498. if(_99c.indexOf("'")>=0&&_99c.indexOf("\"")>=0){
  11499. var _99e=_99c.split("\"");
  11500. _99d="concat(";
  11501. for(var i=0;i<_99e.length;++i){
  11502. if(i>0){
  11503. _99d+=",";
  11504. }
  11505. if(_99e[i].length>0){
  11506. _99d+=("\""+_99e[i]+"\"");
  11507. }else{
  11508. _99d+="'\"'";
  11509. }
  11510. }
  11511. _99d+=")";
  11512. }else{
  11513. if(_99c.indexOf("'")>=0){
  11514. _99d="\""+_99c+"\"";
  11515. }else{
  11516. _99d="'"+_99c+"'";
  11517. }
  11518. }
  11519. return _99d;
  11520. };
  11521. function getCognosViewerObjectString(sId){
  11522. return "oCV"+sId;
  11523. };
  11524. function getCognosViewerObjectRefAsString(sId){
  11525. return "window."+getCognosViewerObjectString(sId);
  11526. };
  11527. function getCognosViewerObjectRef(sId){
  11528. return window[getCognosViewerObjectString(sId)];
  11529. };
  11530. function getCognosViewerSCObjectString(sId){
  11531. return "oCVSC"+sId;
  11532. };
  11533. function getCognosViewerSCObjectRefAsString(sId){
  11534. return "window."+getCognosViewerSCObjectString(sId);
  11535. };
  11536. function getCognosViewerSCObjectRef(sId){
  11537. return window[getCognosViewerSCObjectString(sId)];
  11538. };
  11539. function cleanupGlobalObjects(sId){
  11540. cleanupVariable(getCognosViewerObjectString(sId));
  11541. cleanupVariable(getCognosViewerSCObjectString(sId));
  11542. };
  11543. function cleanupVariable(_9a7){
  11544. if(typeof window[_9a7]!="undefined"&&window[_9a7]){
  11545. if(isIE()){
  11546. eval("delete "+_9a7);
  11547. }else{
  11548. delete window[_9a7];
  11549. }
  11550. }
  11551. };
  11552. function loadClass(_9a8){
  11553. try{
  11554. var _9a9=eval("new "+_9a8+"();");
  11555. return _9a9;
  11556. }
  11557. catch(e){
  11558. return null;
  11559. }
  11560. };
  11561. function getElementsByClassName(oElm,_9ab,_9ac){
  11562. var _9ad=(_9ab=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(_9ab);
  11563. var _9ae=[];
  11564. var _9af=new RegExp("(^|\\s)"+_9ac+"(\\s|$)");
  11565. var _9b0=_9ad.length;
  11566. for(var i=0;i<_9b0;i++){
  11567. var _9b2=_9ad[i];
  11568. if(_9af.test(_9b2.className)){
  11569. _9ae.push(_9b2);
  11570. }
  11571. }
  11572. return _9ae;
  11573. };
  11574. function getImmediateLayoutContainerId(node){
  11575. var _9b4=node;
  11576. while(_9b4!=null){
  11577. if(_9b4.getAttribute&&_9b4.getAttribute("lid")!=null){
  11578. return _9b4.getAttribute("lid");
  11579. }
  11580. _9b4=_9b4.parentNode;
  11581. }
  11582. return null;
  11583. };
  11584. function getChildElementsByAttribute(oElm,_9b6,_9b7,_9b8){
  11585. return getDescendantElementsByAttribute(oElm,_9b6,_9b7,_9b8,true);
  11586. };
  11587. function getElementsByAttribute(oElm,_9ba,_9bb,_9bc,_9bd,_9be){
  11588. return getDescendantElementsByAttribute(oElm,_9ba,_9bb,_9bc,false,_9bd,_9be);
  11589. };
  11590. function getDescendantElementsByAttribute(oElm,_9c0,_9c1,_9c2,_9c3,_9c4,_9c5){
  11591. var _9c6=[];
  11592. var _9c7=null;
  11593. if(typeof _9c5==="undefined"){
  11594. _9c7=(typeof _9c2!="undefined")?new RegExp("(^|\\s)"+_9c2+"(\\s|$)","i"):null;
  11595. }else{
  11596. _9c7=_9c5;
  11597. }
  11598. if(typeof _9c0=="string"){
  11599. _9c0=[_9c0];
  11600. }
  11601. var _9c8=(oElm?_9c0.length:0);
  11602. for(var _9c9=0;_9c9<_9c8;_9c9++){
  11603. var _9ca=null;
  11604. if(_9c3){
  11605. if(_9c0[_9c9]=="*"&&oElm.all){
  11606. _9ca=oElm.childNodes;
  11607. }else{
  11608. _9ca=[];
  11609. var _9cb=oElm.childNodes;
  11610. for(var i=0;i<_9cb.length;++i){
  11611. if(_9cb[i].nodeName.toLowerCase()==_9c0[_9c9].toLowerCase()){
  11612. _9ca.push(_9cb[i]);
  11613. }
  11614. }
  11615. }
  11616. }else{
  11617. _9ca=(_9c0[_9c9]=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(_9c0[_9c9]);
  11618. }
  11619. var _9cd=_9ca.length;
  11620. for(var idx=0;idx<_9cd;idx++){
  11621. var _9cf=_9ca[idx];
  11622. var _9d0=_9cf.getAttribute&&_9cf.getAttribute(_9c1);
  11623. if(_9d0!==null){
  11624. var _9d1=null;
  11625. if(typeof _9d0==="number"){
  11626. _9d1=String(_9d0);
  11627. }else{
  11628. if(typeof _9d0==="string"&&_9d0.length>0){
  11629. _9d1=_9d0;
  11630. }
  11631. }
  11632. if(_9d1!==null){
  11633. if(typeof _9c2=="undefined"||(_9c7&&_9c7.test(_9d1))){
  11634. _9c6.push(_9cf);
  11635. if(_9c4!=-1&&_9c6.length>_9c4){
  11636. return [];
  11637. }else{
  11638. if(_9c4==1&&_9c6.length==1){
  11639. return _9c6;
  11640. }
  11641. }
  11642. }
  11643. }
  11644. }
  11645. }
  11646. }
  11647. return _9c6;
  11648. };
  11649. function savedOutputDoneLoading(cvId,_9d3){
  11650. var oCV=window["oCV"+cvId];
  11651. var _9d5=(oCV&&oCV.getViewerWidget?oCV.getViewerWidget():null);
  11652. var _9d6=(_9d5?_9d5.getSavedOutput():null);
  11653. if(_9d6){
  11654. _9d6.outputDoneLoading();
  11655. }else{
  11656. if(_9d3<5){
  11657. _9d3++;
  11658. var _9d7=function(){
  11659. savedOutputDoneLoading(cvId,_9d3);
  11660. };
  11661. setTimeout(_9d7,100);
  11662. }
  11663. }
  11664. };
  11665. function getNavVer(){
  11666. var temp;
  11667. if(isIE()){
  11668. return getIEVersion();
  11669. }else{
  11670. temp=navigator.userAgent.split("/");
  11671. return parseFloat(temp[temp.length-1]);
  11672. }
  11673. };
  11674. function isSafari(){
  11675. return (navigator.userAgent.toLowerCase().indexOf("safari")!=-1&&navigator.userAgent.toLowerCase().indexOf("chrome")==-1);
  11676. };
  11677. function isIE(){
  11678. return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
  11679. };
  11680. function getIEVersion(){
  11681. var _9d9=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
  11682. return _9d9?parseFloat(_9d9[1]):null;
  11683. };
  11684. function isFF(){
  11685. return (navigator.userAgent.indexOf("Firefox")!=-1);
  11686. };
  11687. function isIOS(){
  11688. return navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1;
  11689. };
  11690. function displayChart(_9da,_9db,_9dc,_9dd){
  11691. if(_9db.length>1){
  11692. document.images[_9da].src=_9db;
  11693. }
  11694. };
  11695. function isFlashChartNode(evt){
  11696. var node=getNodeFromEvent(evt);
  11697. if(node!=null&&typeof node.getAttribute=="function"){
  11698. return node.getAttribute("flashChart")!=null;
  11699. }
  11700. return false;
  11701. };
  11702. function onFlashChartRightClick(evt){
  11703. if(evt&&evt.button&&evt.button!=0&&isFlashChartNode(evt)){
  11704. return onViewerChartFocus(evt);
  11705. }
  11706. };
  11707. function onViewerChartFocus(evt){
  11708. if(evt.stopPropagation){
  11709. evt.stopPropagation();
  11710. }
  11711. if(evt.preventDefault){
  11712. evt.preventDefault();
  11713. }
  11714. if(evt.preventCapture){
  11715. evt.preventCapture();
  11716. }
  11717. if(evt.preventBubble){
  11718. evt.preventBubble();
  11719. }
  11720. var node=getNodeFromEvent(evt);
  11721. var _9e3=node.getAttribute("viewerId");
  11722. if(!_9e3){
  11723. _9e3=node.parentNode.getAttribute("viewerId");
  11724. }
  11725. if(!_9e3){
  11726. return;
  11727. }
  11728. var oCV=window["oCV"+_9e3];
  11729. var _9e5=oCV.getAction("Selection");
  11730. _9e5.pageClicked(evt);
  11731. return stopEventBubble(evt);
  11732. };
  11733. function clientToScreenCoords(_9e6,_9e7){
  11734. var _9e8=_9e6;
  11735. var _9e9={topCoord:0,leftCoord:0};
  11736. while(_9e8!=null&&_9e8!=_9e7){
  11737. _9e9.topCoord+=_9e8.offsetTop;
  11738. _9e9.leftCoord+=_9e8.offsetLeft;
  11739. _9e8=_9e8.offsetParent;
  11740. }
  11741. return _9e9;
  11742. };
  11743. function getCurrentPosistionString(oCV,_9eb,_9ec){
  11744. var _9ed=RV_RES.IDS_JS_INFOBAR_ITEM_COUNT;
  11745. var _9ee=/\{0\}/;
  11746. var _9ef=/\{1\}/;
  11747. _9ed=_9ed.replace(_9ee,_9eb);
  11748. _9ed=" "+_9ed.replace(_9ef,_9ec)+" ";
  11749. return _9ed;
  11750. };
  11751. function applyJSONProperties(obj,_9f1){
  11752. for(property in _9f1){
  11753. if(typeof _9f1[property]=="object"&&!(_9f1[property] instanceof Array)){
  11754. if(typeof obj[property]=="undefined"){
  11755. obj[property]={};
  11756. }
  11757. applyJSONProperties(obj[property],_9f1[property]);
  11758. }else{
  11759. obj[property]=_9f1[property];
  11760. }
  11761. }
  11762. };
  11763. function CViewerCommon(){
  11764. };
  11765. CViewerCommon.openNewWindowOrTab=function(sURL,_9f3){
  11766. return window.open(sURL,_9f3);
  11767. };
  11768. CViewerCommon.toJSON=function(obj){
  11769. var type=typeof (obj);
  11770. if(type!="object"||type===null){
  11771. if(type==="string"){
  11772. obj="\""+obj+"\"";
  11773. }
  11774. return String(obj);
  11775. }else{
  11776. var _9f6;
  11777. var prop;
  11778. var json=[];
  11779. var _9f9=(obj&&obj.constructor==Array);
  11780. for(_9f6 in obj){
  11781. prop=obj[_9f6];
  11782. type=typeof (prop);
  11783. if(type==="string"){
  11784. prop="\""+prop+"\"";
  11785. }else{
  11786. if(type=="object"&&prop!==null){
  11787. prop=CViewerCommon.toJSON(prop);
  11788. }
  11789. }
  11790. json.push((_9f9?"":"\""+_9f6+"\":")+String(prop));
  11791. }
  11792. return (_9f9?"[":"{")+String(json)+(_9f9?"]":"}");
  11793. }
  11794. };
  11795. function resizePinnedContainers(){
  11796. var oCV=window.gaRV_INSTANCES[0];
  11797. if(oCV&&!oCV.m_viewerFragment){
  11798. var _9fb=oCV.getPinFreezeManager();
  11799. if(_9fb&&_9fb.hasFrozenContainers()){
  11800. var _9fc=document.getElementById("RVContent"+oCV.getId());
  11801. var _9fd=document.getElementById("mainViewerTable"+oCV.getId());
  11802. var _9fe=_9fc.clientWidth;
  11803. var _9ff=_9fd.clientHeight;
  11804. _9fb.resize(_9fe,_9ff);
  11805. if(isIE()){
  11806. oCV.repaintDiv(_9fc);
  11807. }
  11808. }
  11809. }
  11810. };
  11811. function setWindowHref(url){
  11812. var _a01=window.onbeforeunload;
  11813. window.onbeforeunload=null;
  11814. window.location.href=url;
  11815. window.onbeforeunload=_a01;
  11816. };
  11817. CViewerCommon.getMessage=function(msg,args){
  11818. if(typeof args=="undefined"){
  11819. return msg;
  11820. }else{
  11821. if(typeof args=="string"){
  11822. msg=msg.replace("{0}",args);
  11823. }else{
  11824. if(args.length){
  11825. for(var i=0;i<args.length;++i){
  11826. msg=msg.replace("{"+i+"}",args[i]);
  11827. }
  11828. }else{
  11829. msg=msg.replace("{0}",args);
  11830. }
  11831. }
  11832. }
  11833. return msg;
  11834. };
  11835. function getViewerDirection(){
  11836. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  11837. return gaRV_INSTANCES[0].getDirection();
  11838. }
  11839. return "ltr";
  11840. };
  11841. function isViewerBidiEnabled(){
  11842. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  11843. var _a05=gaRV_INSTANCES[0].isBidiEnabled();
  11844. if(_a05){
  11845. return true;
  11846. }
  11847. }
  11848. return false;
  11849. };
  11850. function getViewerBaseTextDirection(){
  11851. if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
  11852. return gaRV_INSTANCES[0].getBaseTextDirection();
  11853. }
  11854. return "";
  11855. };
  11856. function enforceTextDir(_a06){
  11857. if(isViewerBidiEnabled()&&_a06){
  11858. var sDir=getViewerBaseTextDirection();
  11859. var _a08=BidiUtils.getInstance();
  11860. if(sDir=="auto"){
  11861. sDir=_a08.resolveStrBtd(_a06);
  11862. }
  11863. var _a09=(!dojo._isBodyLtr())?_a08.RLM:_a08.LRM;
  11864. return _a09+((sDir==="rtl")?_a08.RLE:_a08.LRE)+_a06+_a08.PDF+_a09;
  11865. }
  11866. return _a06;
  11867. };
  11868. function getElementDirection(_a0a){
  11869. var dir=null;
  11870. if(_a0a.currentStyle){
  11871. dir=_a0a.currentStyle.direction;
  11872. }else{
  11873. if(window.getComputedStyle){
  11874. var _a0c=window.getComputedStyle(_a0a,null);
  11875. if(_a0c){
  11876. dir=_a0c.getPropertyValue("direction");
  11877. }
  11878. }
  11879. }
  11880. if(dir){
  11881. dir=dir.toLowerCase();
  11882. }
  11883. return dir;
  11884. };
  11885. function getScrollLeft(_a0d){
  11886. if(getElementDirection(_a0d)==="rtl"&&isFF()){
  11887. return _a0d.scrollWidth-_a0d.offsetWidth+_a0d.scrollLeft;
  11888. }
  11889. return _a0d.scrollLeft;
  11890. };
  11891. function setScrollLeft(_a0e,_a0f){
  11892. if(getElementDirection(_a0e)==="rtl"&&isFF()){
  11893. _a0e.scrollLeft=_a0e.offsetWidth+_a0f-_a0e.scrollWidth;
  11894. }else{
  11895. _a0e.scrollLeft=_a0f;
  11896. }
  11897. };
  11898. function setScrollRight(_a10,_a11){
  11899. if(getElementDirection(_a10)==="rtl"&&isFF()){
  11900. _a10.scrollLeft=-_a11;
  11901. }else{
  11902. _a10.scrollLeft=_a10.scrollWidth-_a10.offsetWidth-_a11;
  11903. }
  11904. };
  11905. function getBoxInfo(el,_a13){
  11906. if(!getBoxInfo.aStyles){
  11907. getBoxInfo.aStyles=[{name:"marginLeft",ie:"marginLeft",ff:"margin-left"},{name:"marginRight",ie:"marginRight",ff:"margin-right"},{name:"marginTop",ie:"marginTop",ff:"margin-top"},{name:"marginBottom",ie:"marginBottom",ff:"margin-bottom"},{name:"borderLeftWidth",ie:"borderLeftWidth",ff:"border-left-width"},{name:"borderRightWidth",ie:"borderRightWidth",ff:"border-right-width"},{name:"borderTopWidth",ie:"borderTopWidth",ff:"border-top-width"},{name:"borderBottomWidth",ie:"borderBottomWidth",ff:"border-bottom-width"},{name:"paddingLeft",ie:"paddingLeft",ff:"padding-left"},{name:"paddingRight",ie:"paddingRight",ff:"padding-right"},{name:"paddingTop",ie:"paddingTop",ff:"padding-top"},{name:"paddingBottom",ie:"paddingBottom",ff:"padding-bottom"}];
  11908. }
  11909. var _a14={};
  11910. var _a15=null;
  11911. if(el.currentStyle){
  11912. _a15=el.currentStyle;
  11913. }else{
  11914. if(window.getComputedStyle){
  11915. _a15=window.getComputedStyle(el,null);
  11916. }
  11917. }
  11918. if(!_a15){
  11919. return null;
  11920. }
  11921. for(i in getBoxInfo.aStyles){
  11922. var _a16=getBoxInfo.aStyles[i];
  11923. var size=null;
  11924. if(_a15.getPropertyValue){
  11925. size=_a15.getPropertyValue(_a16.ff);
  11926. }else{
  11927. size=_a15[_a16.ie];
  11928. }
  11929. if(size&&_a13){
  11930. size=Number(size.replace("px",""));
  11931. }
  11932. _a14[_a16.name]=size;
  11933. }
  11934. return _a14;
  11935. };
  11936. if(!CViewerCommon){
  11937. var CViewerCommon={};
  11938. }
  11939. CViewerCommon.buildParameterValuesSpec=function(oCV){
  11940. var _a19=XMLBuilderLoadXMLFromString(oCV.getExecutionParameters());
  11941. var _a1a=new CParameterValues();
  11942. if(_a19.childNodes.length==1){
  11943. _a1a.loadWithOptions(_a19.childNodes[0],false);
  11944. }
  11945. var _a1b=_a1a.length();
  11946. var _a1c="<pvs>";
  11947. if(_a1b>0){
  11948. var _a1d=new CParameterValueStringOperators(RV_RES.IDS_JS_FILTER_BETWEEN,RV_RES.IDS_JS_FILTER_NOT_BETWEEN,RV_RES.IDS_JS_FILTER_LESS_THAN,RV_RES.IDS_JS_FILTER_GREATER_THAN);
  11949. for(var _a1e=0;_a1e<_a1b;++_a1e){
  11950. var _a1f=_a1a.getAt(_a1e);
  11951. if(_a1f!=null){
  11952. _a1c+="<pv>";
  11953. _a1c+="<name>";
  11954. _a1c+=xml_encode(_a1f.name());
  11955. _a1c+="</name>";
  11956. _a1c+="<value>";
  11957. _a1c+=xml_encode(_a1f.toString(_a1d));
  11958. _a1c+="</value>";
  11959. _a1c+="</pv>";
  11960. }
  11961. }
  11962. }
  11963. _a1c+="</pvs>";
  11964. return _a1c;
  11965. };
  11966. function PinFreezeContainer(_a20,lid,_a22,_a23,_a24,_a25,_a26){
  11967. this.m_pinFreezeManager=_a20;
  11968. this.m_lid=lid;
  11969. this.m_lidNS=lid+_a22+_a26;
  11970. this.m_viewerId=_a22;
  11971. this.m_freezeTop=_a23;
  11972. this.m_freezeSide=_a24;
  11973. this.m_cachedReportDiv=null;
  11974. this.m_cachedPFContainer=null;
  11975. this.m_cachedBaseContainer=_a25;
  11976. this.m_containerMargin={"top":0,"left":0};
  11977. if(this.m_cachedBaseContainer&&this.m_cachedBaseContainer.style){
  11978. if(this.m_cachedBaseContainer.style.marginTop){
  11979. this.m_containerMargin.top=Number(this.m_cachedBaseContainer.style.marginTop.replace("px",""));
  11980. }
  11981. if(this.m_cachedBaseContainer.style.marginLeft){
  11982. this.m_containerMargin.left=Number(this.m_cachedBaseContainer.style.marginLeft.replace("px",""));
  11983. }
  11984. }
  11985. this.m_cachedContainerIndex=_a26;
  11986. this.m_sectionCache=null;
  11987. this.m_homeCellNodes={};
  11988. this.m_fixedWidth=null;
  11989. this.m_clientWidth=700;
  11990. this.m_scrollableClientWidth=700;
  11991. this.m_fixedHeight=null;
  11992. this.m_clientHeight=300;
  11993. this.m_scrollableClientHeight=300;
  11994. this.m_wrapFlag=false;
  11995. this.c_pageMargin=(this.m_freezeTop&&this.m_freezeSide)?50:20;
  11996. this.touchScrollSections=false;
  11997. this.touchPreviousX=-1;
  11998. this.touchPreviousY=-1;
  11999. };
  12000. PinFreezeContainer.prototype.toJSONString=function(){
  12001. var _a27="{";
  12002. _a27+="\"m_clientWidth\":"+this.m_clientWidth+"";
  12003. _a27+=",\"m_scrollableClientWidth\":"+this.m_scrollableClientWidth+"";
  12004. _a27+=",\"m_clientHeight\":"+this.m_clientHeight+"";
  12005. _a27+=",\"m_scrollableClientHeight\":"+this.m_scrollableClientHeight+"";
  12006. _a27+="}";
  12007. return _a27;
  12008. };
  12009. PinFreezeContainer.prototype.copyProperties=function(_a28){
  12010. this.m_clientWidth=_a28.m_clientWidth;
  12011. this.m_scrollableClientWidth=_a28.m_scrollableClientWidth;
  12012. this.m_clientHeight=_a28.m_clientHeight;
  12013. this.m_scrollableClientHeight=_a28.m_scrollableClientHeight;
  12014. };
  12015. PinFreezeContainer.prototype.setViewerId=function(id){
  12016. this.m_viewerId=id;
  12017. };
  12018. PinFreezeContainer.prototype.getLid=function(){
  12019. return this.m_lid;
  12020. };
  12021. PinFreezeContainer.prototype.createPFContainer=function(_a2a,_a2b){
  12022. var _a2c=document.createElement("temp");
  12023. if(this.m_cachedBaseContainer){
  12024. this.applyAuthoredFixedSizes(this.m_cachedBaseContainer);
  12025. this.m_cachedReportDiv=_a2a;
  12026. var _a2d=this.m_cachedBaseContainer.parentNode;
  12027. var _a2e=this.loadTemplateHTML();
  12028. if(_a2e){
  12029. _a2c.innerHTML=_a2e;
  12030. var _a2f=this.getContainerByLID(_a2c);
  12031. var _a30=this.getSectionByLID(_a2c.firstChild,"pfMainOutput");
  12032. if(_a30){
  12033. var i=this.getChildPosition(_a2d,this.m_cachedBaseContainer);
  12034. if(i!=-1){
  12035. var _a32=this.m_pinFreezeManager.m_oCV;
  12036. if(_a32&&_a32.envParams["freezeDefaultWrap"]){
  12037. if(this.m_cachedBaseContainer.style.whiteSpace===""&&_a32.envParams["freezeDefaultWrap"].toLowerCase()==="true"){
  12038. var _a33=this.m_cachedBaseContainer.getElementsByTagName("span");
  12039. if(_a33){
  12040. for(var k=0;k<_a33.length;k++){
  12041. _a33[k].style.whiteSpace="nowrap";
  12042. }
  12043. }
  12044. this.m_wrapFlag=true;
  12045. }
  12046. }
  12047. if(!_a2b){
  12048. if(!this._getFixedWidth()){
  12049. this.m_cachedBaseContainer.setAttribute("authoredFixedWidth","false");
  12050. this.m_addedFixedWidth=this.m_cachedBaseContainer.clientWidth+1;
  12051. this.m_cachedBaseContainer.style.width=this.m_addedFixedWidth+"px";
  12052. }
  12053. if(!this._getFixedHeight()){
  12054. this.m_cachedBaseContainer.setAttribute("authoredFixedHeight","false");
  12055. this.m_addedFixedHeight=this.m_cachedBaseContainer.clientHeight;
  12056. this.m_cachedBaseContainer.style.height=this.m_addedFixedHeight+"px";
  12057. }
  12058. _a30.style.width=this.m_cachedBaseContainer.clientWidth+2+"px";
  12059. _a30.style.height=this.m_cachedBaseContainer.clientHeight+2+"px";
  12060. }
  12061. _a30.appendChild(this.m_cachedBaseContainer);
  12062. this.insertAt(_a2d,_a2f,i);
  12063. }
  12064. if(this.m_cachedBaseContainer.style.border!==""){
  12065. _a2f.style.border=this.m_cachedBaseContainer.style.border;
  12066. this.m_cachedBaseContainer.style.border="";
  12067. }
  12068. }
  12069. }
  12070. }
  12071. };
  12072. PinFreezeContainer.prototype._getFixedWidth=function(_a35){
  12073. if(_a35&&_a35.style.width&&!_a35.getAttribute("authoredFixedWidth")){
  12074. var _a36=Number(_a35.style.width.split("px")[0]);
  12075. return isNaN(_a36)?null:_a36;
  12076. }
  12077. return null;
  12078. };
  12079. PinFreezeContainer.prototype._getFixedHeight=function(_a37){
  12080. if(_a37&&_a37.style.height&&!_a37.getAttribute("authoredFixedHeight")){
  12081. var _a38=Number(_a37.style.height.split("px")[0]);
  12082. return isNaN(_a38)?null:_a38;
  12083. }
  12084. return null;
  12085. };
  12086. PinFreezeContainer.prototype.applyAuthoredFixedSizes=function(_a39){
  12087. var _a3a=this._getFixedWidth(_a39);
  12088. if(_a3a){
  12089. this.m_fixedWidth=_a3a;
  12090. this.m_clientWidth=this.m_fixedWidth;
  12091. this.m_scrollableClientWidth=this.m_fixedWidth;
  12092. }
  12093. var _a3b=this._getFixedHeight(_a39);
  12094. if(_a3b){
  12095. this.m_fixedHeight=_a3b;
  12096. this.m_clientHeight=this.m_fixedHeight;
  12097. this.m_scrollableClientHeight=this.m_fixedHeight;
  12098. }
  12099. };
  12100. PinFreezeContainer.prototype.loadFreezeBothTemplateHTML=function(){
  12101. var _a3c="<table pflid=\""+this.m_lidNS+"\" pfclid=\"pfContainer_"+this.m_lidNS+"\" cellpadding=\"0\" style=\"white-space:nowrap; width:0px; height:0px;\" cellspacing=\"0\">"+"<tr class=\"BUXNoPrint\" templatePart=\"freezeTop\"><td align=\"center\" templatePart=\"freezeSide\"><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfHomeCell_"+this.m_lidNS+"\" style=\"overflow-x:hidden; overflow-y:hidden; width:100%; height:100%\"/></td>"+"<td valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfTopHeadings_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\"/></td><td templatePart=\"freezeTop\"></td></tr>"+"<tr><td class=\"BUXNoPrint\" valign=top templatePart=\"freezeSide\"><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfSideHeadings_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\"/></td>"+"<td valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfMainOutput_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\">"+"</div></td>"+"<td class=\"BUXNoPrint\" templatePart=\"freezeTop\">"+"<div style=\"padding-right:1px;overflow-x:hidden; overflow-y:scroll;\" pflid=\""+this.m_lidNS+"\" pfslid=\"pfVerticalScrollBar_"+this.m_lidNS+"\" tabIndex=\"-1\" onmouseup=\"stopEventBubble(event);\" onmousedown=\"stopEventBubble(event);\" onscroll=\""+getCognosViewerObjectRefAsString(this.m_viewerId)+".m_pinFreezeManager.getContainer('"+this.m_lid+"', "+this.m_cachedContainerIndex+").synchVScroll()\">"+"<div style=\"padding-right:1px;\"/>"+"</div>"+"</td>"+"</tr>"+"<tr class=\"BUXNoPrint\" templatePart=\"freezeSide\"><td></td><td>"+"<div style=\"overflow-x:scroll; overflow-y:hidden;\" pflid=\""+this.m_lidNS+"\" pfslid=\"pfHorizontalScrollBar_"+this.m_lidNS+"\" tabIndex=\"-1\" onmouseup=\"stopEventBubble(event);\" onmousedown=\"stopEventBubble(event);\" onscroll=\""+getCognosViewerObjectRefAsString(this.m_viewerId)+".m_pinFreezeManager.getContainer('"+this.m_lid+"', "+this.m_cachedContainerIndex+").synchScroll()\">"+"<div style=\"height:2px;\">&nbsp;</div>"+"</div>"+"</td><td></td></tr></table>";
  12102. return _a3c;
  12103. };
  12104. PinFreezeContainer.prototype.loadFreezeSideTemplateHTML=function(){
  12105. var _a3d="<table pflid=\""+this.m_lidNS+"\" pfclid=\"pfContainer_"+this.m_lidNS+"\" cellpadding=\"0\" style=\"white-space:nowrap; width:0px; height:0px;\" cellspacing=\"0\"><tr>"+"<td class=\"BUXNoPrint\" valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfSideHeadings_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\"/></td>"+"<td valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfMainOutput_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\">"+"</div></td>"+"</tr>"+"<tr class=\"BUXNoPrint\"><td></td><td>"+"<div style=\"overflow-x:scroll; overflow-y:hidden;\" pflid=\""+this.m_lidNS+"\" pfslid=\"pfHorizontalScrollBar_"+this.m_lidNS+"\" tabIndex=\"-1\" onmouseup=\"stopEventBubble(event);\" onmousedown=\"stopEventBubble(event);\" onscroll=\""+getCognosViewerObjectRefAsString(this.m_viewerId)+".m_pinFreezeManager.getContainer('"+this.m_lid+"', "+this.m_cachedContainerIndex+").synchScroll()\">"+"<div style=\"height:2px;\">&nbsp;</div>"+"</div>"+"</td></tr></table>";
  12106. return _a3d;
  12107. };
  12108. PinFreezeContainer.prototype.loadFreezeTopTemplateHTML=function(){
  12109. var _a3e="<table pflid=\""+this.m_lidNS+"\" pfclid=\"pfContainer_"+this.m_lidNS+"\" cellpadding=\"0\" style=\"white-space:nowrap; width:0px; height:0px;\" cellspacing=\"0\">"+"<tr class=\"BUXNoPrint\"><td valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfTopHeadings_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\"/></td><td></td></tr>"+"<tr><td valign=top><div pflid=\""+this.m_lidNS+"\" pfslid=\"pfMainOutput_"+this.m_lidNS+"\" style=\"width:0px; height:0px; overflow-x:hidden; overflow-y:hidden; position:relative;\"></div></td>"+"<td class=\"BUXNoPrint\">"+"<div style=\"padding-right:1px;overflow-x:hidden; overflow-y:scroll;\" pflid=\""+this.m_lidNS+"\" pfslid=\"pfVerticalScrollBar_"+this.m_lidNS+"\" tabIndex=\"-1\" onmouseup=\"stopEventBubble(event);\" onmousedown=\"stopEventBubble(event);\" onscroll=\""+getCognosViewerObjectRefAsString(this.m_viewerId)+".m_pinFreezeManager.getContainer('"+this.m_lid+"', "+this.m_cachedContainerIndex+").synchVScroll()\">"+"<div style=\"padding-right:1px;\"/>"+"</div>"+"</td>"+"</tr></table>";
  12110. return _a3e;
  12111. };
  12112. PinFreezeContainer.prototype.loadTemplateHTML=function(){
  12113. if(this.m_freezeSide&&this.m_freezeTop){
  12114. return this.loadFreezeBothTemplateHTML();
  12115. }else{
  12116. if(this.m_freezeSide){
  12117. return this.loadFreezeSideTemplateHTML();
  12118. }else{
  12119. if(this.m_freezeTop){
  12120. return this.loadFreezeTopTemplateHTML();
  12121. }
  12122. }
  12123. }
  12124. return null;
  12125. };
  12126. PinFreezeContainer.prototype.createSideHeadings=function(_a3f){
  12127. var _a40=this.getSection("pfMainOutput");
  12128. var _a41=_a40.getAttribute("pfslid");
  12129. var _a42=this.getSection("pfSideHeadings");
  12130. var _a43=_a42.getAttribute("pfslid");
  12131. var _a44=this.getMainOutputHomeCell();
  12132. if(!_a44){
  12133. return;
  12134. }
  12135. var _a45=_a3f;
  12136. var _a46=_a42;
  12137. var _a47=this.isA11yEnabled(_a45);
  12138. var _a48=this.m_pinFreezeManager.deepCloneNode(_a45);
  12139. _a46.appendChild(_a48);
  12140. var _a49=this.getSectionHomeCell(_a42);
  12141. if(!_a49){
  12142. return;
  12143. }
  12144. var _a4a=_a45.getElementsByTagName("tbody");
  12145. var _a4b=_a48.getElementsByTagName("tbody");
  12146. if(_a4a.length>0&&_a4b.length>0){
  12147. var _a4c=_a4a[0];
  12148. var _a4d=_a4b[0];
  12149. var _a4e=_a4c.firstChild;
  12150. var _a4f=_a4d.firstChild;
  12151. var _a50=_a44.rowSpan;
  12152. this.markAsCopy(_a44,_a49,_a41,_a43);
  12153. for(var r=0;r<_a50;++r){
  12154. var _a52=_a4d.rows[r];
  12155. this.removeCTX(_a52);
  12156. }
  12157. for(var r=_a50;r<_a4d.rows.length;++r){
  12158. var _a53=_a4c.rows[r];
  12159. var _a52=_a4d.rows[r];
  12160. _a52.style.visibility="hidden";
  12161. for(var c=0;c<_a52.cells.length;++c){
  12162. var _a55=_a52.cells[c];
  12163. if(_a47){
  12164. _a55=this.m_pinFreezeManager.removeIdAttribute(_a55);
  12165. }
  12166. if(_a55.getAttribute("type")=="datavalue"){
  12167. _a55.removeAttribute("ctx");
  12168. _a55.removeAttribute("uid");
  12169. _a55.removeAttribute("name");
  12170. }else{
  12171. var _a56=_a53.cells[c];
  12172. this.markAsCopy(_a56,_a55,_a41,_a43);
  12173. }
  12174. }
  12175. _a52.style.visibility="visible";
  12176. }
  12177. }
  12178. };
  12179. PinFreezeContainer.prototype.applyNeighbouringBorderStylesToHomeCell=function(_a57,_a58){
  12180. if(isFF()||isIE()){
  12181. if(_a57&&_a57.length&&_a57[0].cells&&_a57[0].cells.length>1){
  12182. if(this.m_freezeSide){
  12183. var _a59=this.getBorderInfo(_a57[0].cells[1],"right");
  12184. if(_a59){
  12185. _a58.style.borderRightWidth=_a59.borderRightWidth;
  12186. _a58.style.borderRightStyle=_a59.borderRightStyle;
  12187. _a58.style.borderRightColor=_a59.borderRightColor;
  12188. }
  12189. }
  12190. if(this.m_freezeTop){
  12191. var _a59=this.getBorderInfo(_a57[0].cells[1],"bottom");
  12192. if(_a59){
  12193. _a58.style.borderBottomWidth=_a59.borderBottomWidth;
  12194. _a58.style.borderBottomStyle=_a59.borderBottomStyle;
  12195. _a58.style.borderBottomColor=_a59.borderBottomColor;
  12196. }
  12197. }
  12198. }
  12199. }
  12200. };
  12201. PinFreezeContainer.prototype.createTopHeadings=function(_a5a){
  12202. var _a5b=this.getSection("pfMainOutput");
  12203. var _a5c=_a5b.getAttribute("pfslid");
  12204. var _a5d=this.getSection("pfTopHeadings");
  12205. var _a5e=_a5d.getAttribute("pfslid");
  12206. var _a5f=this.getMainOutputHomeCell();
  12207. if(!_a5f){
  12208. return;
  12209. }
  12210. var _a60=_a5a;
  12211. var _a61=_a5d;
  12212. var _a62=this.isA11yEnabled(_a60);
  12213. var _a63=this.m_pinFreezeManager.deepCloneNode(_a60);
  12214. _a63.setAttribute("clonednode","true");
  12215. _a61.appendChild(_a63);
  12216. var _a64=_a60.getElementsByTagName("tbody");
  12217. var _a65=_a63.getElementsByTagName("tbody");
  12218. if(_a64.length>0&&_a65.length>0){
  12219. var _a66=_a64[0];
  12220. var _a67=_a65[0];
  12221. var _a68=_a5f.rowSpan;
  12222. for(var r=0;r<_a67.rows.length;++r){
  12223. var _a6a=_a66.rows[r];
  12224. var _a6b=_a67.rows[r];
  12225. if(_a62){
  12226. _a6b=this.m_pinFreezeManager.removeIdAttribute(_a6b);
  12227. }
  12228. _a6b.style.visibility="hidden";
  12229. for(var c=0;c<_a6b.cells.length;++c){
  12230. var _a6d=_a6b.cells[c];
  12231. if(r>_a68||_a6d.getAttribute("type")=="datavalue"){
  12232. _a6d.removeAttribute("ctx");
  12233. _a6d.removeAttribute("uid");
  12234. _a6d.removeAttribute("name");
  12235. }else{
  12236. var _a6e=_a6a.cells[c];
  12237. this.markAsCopy(_a6e,_a6d,_a5c,_a5e);
  12238. if(_a6e===_a5f){
  12239. this.initializeHomeCellTabIndex(_a6d);
  12240. this.applyNeighbouringBorderStylesToHomeCell(_a66.rows,_a6d);
  12241. }
  12242. }
  12243. }
  12244. _a6b.style.visibility="visible";
  12245. }
  12246. }
  12247. };
  12248. PinFreezeContainer.prototype.createHomeCellHeading=function(){
  12249. var _a6f=this.getSection("pfMainOutput");
  12250. var _a70=_a6f.getAttribute("pfslid");
  12251. var _a71=this.getSection("pfHomeCell");
  12252. var _a72=_a71.parentNode;
  12253. var _a73=_a71.getAttribute("pfslid");
  12254. var _a74=this.getMainOutputHomeCell();
  12255. if(!_a74){
  12256. return;
  12257. }
  12258. _a72.style.height="100%";
  12259. var _a75=this.getTopHeadingSectionHeight(_a74);
  12260. _a71.style.height=_a75-this.m_containerMargin.top+"px";
  12261. _a71.style.width=this.getSideHeadingSectionWidth(_a74)-this.m_containerMargin.left+"px";
  12262. _a71.style.marginTop=this.m_containerMargin.top+"px";
  12263. _a71.style.marginLeft=this.m_containerMargin.left+"px";
  12264. var _a76=_a74.parentNode;
  12265. var _a77=_a76.cloneNode(false);
  12266. var _a78=this._findBestGuessHomeCell(_a74);
  12267. var _a79=document.createElement("div");
  12268. _a79.style.width="100%";
  12269. _a79.style.height="100%";
  12270. while(_a74.offsetLeft<=_a78.offsetLeft){
  12271. oTargetHomeCell=this.m_pinFreezeManager.deepCloneNode(_a74);
  12272. if(isFF()||isIE()){
  12273. _a74.appendChild(_a79);
  12274. oTargetHomeCell.style.width=_a79.clientWidth+"px";
  12275. _a74.removeChild(_a79);
  12276. }else{
  12277. oTargetHomeCell.style.width=_a74.clientWidth+1+"px";
  12278. }
  12279. oTargetHomeCell.style.borderBottomWidth="0px";
  12280. _a77.appendChild(oTargetHomeCell);
  12281. this.markAsCopy(_a74,oTargetHomeCell,_a70,_a73);
  12282. if(_a74.nextSibling){
  12283. _a74=_a74.nextSibling;
  12284. }else{
  12285. break;
  12286. }
  12287. }
  12288. if(oTargetHomeCell){
  12289. oTargetHomeCell.style.borderRightWidth="0px";
  12290. }
  12291. var _a7a=_a76.parentNode;
  12292. var _a7b=_a7a.cloneNode(false);
  12293. _a7b.appendChild(_a77);
  12294. var _a7c=_a7a.parentNode;
  12295. var _a7d=_a7c.cloneNode(false);
  12296. _a7d.appendChild(_a7b);
  12297. _a7d.style.width="100%";
  12298. _a7d.style.height="100%";
  12299. _a7d.style.marginLeft="";
  12300. _a7d.style.marginTop="";
  12301. _a71.appendChild(_a7d);
  12302. this.initializeHomeCellTabIndex(oTargetHomeCell);
  12303. this.applyNeighbouringBorderStylesToHomeCell(_a6f.firstChild.rows,_a71);
  12304. };
  12305. PinFreezeContainer.prototype.markAsCopy=function(main,copy,_a80,_a81){
  12306. if(!main.pfCopy){
  12307. main.setAttribute("pfslid",_a80);
  12308. main.pfCopy=[];
  12309. }
  12310. main.pfCopy.push(copy);
  12311. copy.pfMain=main;
  12312. copy.setAttribute("pfslid",_a81);
  12313. };
  12314. PinFreezeContainer.prototype.getCopy=function(_a82){
  12315. if(_a82.pfCopy){
  12316. var _a83={};
  12317. for(var i in _a82.pfCopy){
  12318. var copy=_a82.pfCopy[i];
  12319. if(copy.getAttribute){
  12320. var _a86=copy.getAttribute("pfslid");
  12321. if(_a86){
  12322. var _a87=PinFreezeContainer.getSectionNameFromSlid(_a86);
  12323. var _a88=this.getSection(_a87);
  12324. if(_a88&&PinFreezeContainer.isSectionVisible(_a88)){
  12325. _a83[_a87]=copy;
  12326. }
  12327. }
  12328. }
  12329. }
  12330. if(_a83["pfHomeCell"]){
  12331. return _a83["pfHomeCell"];
  12332. }
  12333. for(i in _a83){
  12334. return _a83[i];
  12335. }
  12336. }
  12337. return null;
  12338. };
  12339. PinFreezeContainer.prototype.getMain=function(_a89){
  12340. if(_a89.pfMain){
  12341. return _a89.pfMain;
  12342. }
  12343. return null;
  12344. };
  12345. PinFreezeContainer.isSectionVisible=function(_a8a){
  12346. var node=_a8a;
  12347. if(!node){
  12348. return false;
  12349. }
  12350. while(node.parentNode&&!node.getAttribute("pfclid")){
  12351. if(node.style&&node.style.display==="none"){
  12352. return false;
  12353. }
  12354. node=node.parentNode;
  12355. }
  12356. return (!node.style||node.style.display!=="none");
  12357. };
  12358. PinFreezeContainer.prototype.getSectionStructure=function(){
  12359. var _a8c={isSideFrozen:false,isTopFrozen:false};
  12360. if(this.m_freezeSide){
  12361. var side=this.getSection("pfSideHeadings");
  12362. if(side){
  12363. _a8c.isSideFrozen=PinFreezeContainer.isSectionVisible(side);
  12364. }
  12365. }
  12366. if(this.m_freezeTop){
  12367. var top=this.getSection("pfTopHeadings");
  12368. if(top){
  12369. _a8c.isTopFrozen=PinFreezeContainer.isSectionVisible(top);
  12370. }
  12371. }
  12372. return _a8c;
  12373. };
  12374. PinFreezeContainer.prototype.checkSectionStructureChange=function(_a8f,_a90){
  12375. if(_a8f.isSideFrozen!==_a90.isSideFrozen||_a8f.isTopFrozen!==_a90.isTopFrozen){
  12376. this.m_pinFreezeManager.sectionStructureChange();
  12377. }
  12378. };
  12379. PinFreezeContainer.prototype.freezeContainerInReport=function(_a91){
  12380. this.cacheContainerAndSections(this.getContainerByLID(_a91));
  12381. this.m_homeCellNodes={};
  12382. this.updateContainer();
  12383. };
  12384. PinFreezeContainer.prototype.frozenSectionsRequired=function(){
  12385. return (this.frozenSideHeadingsRequired()||this.frozenTopHeadingsRequired());
  12386. };
  12387. PinFreezeContainer.prototype.frozenSideHeadingsRequired=function(){
  12388. var _a92=this.getSection("pfMainOutput");
  12389. if(_a92){
  12390. if(this.m_freezeSide){
  12391. var _a93=_a92.scrollWidth;
  12392. return ((this.m_clientWidth<_a93)||_a93==0);
  12393. }
  12394. }
  12395. return false;
  12396. };
  12397. PinFreezeContainer.prototype.frozenTopHeadingsRequired=function(){
  12398. var _a94=this.getSection("pfMainOutput");
  12399. if(_a94){
  12400. if(this.m_freezeTop){
  12401. var _a95=_a94.scrollHeight;
  12402. return ((this.m_clientHeight<_a95)||_a95==0);
  12403. }
  12404. }
  12405. return false;
  12406. };
  12407. PinFreezeContainer.prototype.showTemplatePart=function(_a96,_a97){
  12408. var _a98=this.getContainer().rows;
  12409. for(var r=0;r<_a98.length;++r){
  12410. if(_a98[r].getAttribute("templatePart")===_a96){
  12411. _a98[r].style.display=((_a97)?"":"none");
  12412. }else{
  12413. var _a9a=_a98[r].cells;
  12414. for(var c=0;c<_a9a.length;++c){
  12415. if(_a9a[c].getAttribute("templatePart")===_a96){
  12416. _a9a[c].style.display=((_a97)?"":"none");
  12417. }
  12418. }
  12419. }
  12420. }
  12421. };
  12422. PinFreezeContainer.prototype.showFreezeTopOnly=function(_a9c){
  12423. if(!(this.m_freezeTop&&this.m_freezeSide)){
  12424. return;
  12425. }
  12426. var _a9d=(_a9c.scrollWidth==0)?_a9c.clientWidth:_a9c.scrollWidth;
  12427. this.updateMainOutputWidth(_a9d);
  12428. this.setScrollX(_a9c,0);
  12429. if(this.getSection("pfTopHeadings")){
  12430. this.getSection("pfTopHeadings").style.width=_a9d+"px";
  12431. this.setScrollX(this.getSection("pfTopHeadings"),0);
  12432. }
  12433. this.showTemplatePart("freezeSide",false);
  12434. };
  12435. PinFreezeContainer.prototype.showFreezeSideOnly=function(_a9e){
  12436. if(!(this.m_freezeTop&&this.m_freezeSide)){
  12437. return;
  12438. }
  12439. var _a9f=(_a9e.scrollHeight==0)?_a9e.clientHeight:_a9e.scrollHeight;
  12440. this.updateMainOutputHeight(_a9f);
  12441. this.setScrollY(_a9e,0);
  12442. if(this.getSection("pfSideHeadings")){
  12443. this.getSection("pfSideHeadings").style.height=_a9f+"px";
  12444. this.setScrollY(this.getSection("pfSideHeadings"),0);
  12445. }
  12446. this.showTemplatePart("freezeTop",false);
  12447. };
  12448. PinFreezeContainer.prototype.showAll=function(){
  12449. if(!(this.m_freezeTop&&this.m_freezeSide)){
  12450. return;
  12451. }
  12452. this.showTemplatePart("freezeTop",true);
  12453. this.showTemplatePart("freezeSide",true);
  12454. };
  12455. PinFreezeContainer.prototype.showMainOutputOnly=function(_aa0){
  12456. this.updateMainOutputWidth((_aa0.scrollWidth==0)?_aa0.clientWidth:_aa0.scrollWidth);
  12457. this.updateMainOutputHeight((_aa0.scrollHeight==0)?_aa0.clientHeight:_aa0.scrollHeight);
  12458. this.setInitialScrollPosition(_aa0,0,0);
  12459. if(this.m_freezeSide&&this.m_freezeTop){
  12460. this.getSection("pfHomeCell").style.display="none";
  12461. }
  12462. if(this.m_freezeSide){
  12463. this.getSection("pfSideHeadings").style.display="none";
  12464. this.getSection("pfHorizontalScrollBar").style.display="none";
  12465. }
  12466. if(this.m_freezeTop){
  12467. this.getSection("pfTopHeadings").style.display="none";
  12468. this.getSection("pfVerticalScrollBar").style.display="none";
  12469. }
  12470. };
  12471. PinFreezeContainer.prototype.getWrap=function(el){
  12472. if(el.currentStyle){
  12473. return el.currentStyle.whiteSpace;
  12474. }else{
  12475. if(window.getComputedStyle){
  12476. return window.getComputedStyle(el,null).getPropertyValue("white-space");
  12477. }else{
  12478. return el.style.whiteSpace;
  12479. }
  12480. }
  12481. };
  12482. PinFreezeContainer.prototype.getStyleDisplay=function(el){
  12483. if(el.currentStyle){
  12484. return el.currentStyle.display;
  12485. }else{
  12486. if(window.getComputedStyle){
  12487. return window.getComputedStyle(el,null).getPropertyValue("display");
  12488. }else{
  12489. return el.style.display;
  12490. }
  12491. }
  12492. };
  12493. PinFreezeContainer.prototype.headingsCreated=function(_aa3){
  12494. return _aa3.firstChild?true:false;
  12495. };
  12496. PinFreezeContainer.prototype.updateContainer=function(){
  12497. var _aa4=this.getSection("pfMainOutput");
  12498. var _aa5=this.getMainOutputHomeCell();
  12499. if(_aa5){
  12500. if(this.m_scrollableClientHeight===this.m_clientHeight||!this.m_scrollableClientHeight){
  12501. this.m_scrollableClientHeight-=_aa5.offsetHeight;
  12502. var _aa6=this.calculateMinCrossTabScrollableClientHeight();
  12503. if(_aa6>this.m_scrollableClientHeight){
  12504. this.m_scrollableClientHeight=_aa6;
  12505. }
  12506. }
  12507. if(this.m_scrollableClientWidth===this.m_clientWidth||!this.m_scrollableClientWidth){
  12508. this.m_scrollableClientWidth-=this.getHomeCellOffsetWidth(_aa5);
  12509. }
  12510. }
  12511. if(_aa4&&_aa5){
  12512. this.showAll();
  12513. if(this.frozenSectionsRequired()){
  12514. this.updateMainOutputSize();
  12515. this.initializeHomeCellTabIndex(_aa5);
  12516. if(this.m_freezeSide){
  12517. var _aa7=this.getSection("pfSideHeadings");
  12518. if(!this.headingsCreated(_aa7)){
  12519. this.createSideHeadings(this.m_cachedBaseContainer);
  12520. if(this.m_freezeTop){
  12521. this.initializeTouchScrolling(_aa7);
  12522. }
  12523. }
  12524. var _aa8=this.getSection("pfHorizontalScrollBar");
  12525. _aa8.scrollLeft="0px";
  12526. }
  12527. if(this.m_freezeTop){
  12528. var _aa9=this.getSection("pfTopHeadings");
  12529. if(!this.headingsCreated(_aa9)){
  12530. this.createTopHeadings(this.m_cachedBaseContainer);
  12531. if(this.m_freezeSide){
  12532. this.initializeTouchScrolling(_aa9);
  12533. }
  12534. }
  12535. var _aaa=this.getSection("pfVerticalScrollBar");
  12536. _aaa.scrollTop="0px";
  12537. }
  12538. if(this.m_freezeSide&&this.m_freezeTop){
  12539. var _aab=this.getSection("pfHomeCell");
  12540. if(!this.headingsCreated(_aab)){
  12541. this.createHomeCellHeading();
  12542. }
  12543. _aab.style.display="";
  12544. }
  12545. var _aac=this.updateSideHeadingSize(_aa5);
  12546. var _aad=this.updateTopHeadingSize(_aa5);
  12547. if(!this.frozenSectionsRequired()){
  12548. this.showMainOutputOnly(_aa4);
  12549. }
  12550. this.setInitialScrollPosition(_aa4,_aac,_aad);
  12551. if(this.m_freezeTop&&this.m_freezeSide){
  12552. this.setInitialScrollPosition(this.getSection("pfSideHeadings"),0,_aad);
  12553. this.setInitialScrollPosition(this.getSection("pfTopHeadings"),_aac,0);
  12554. }
  12555. this.initializeTouchScrolling(_aa4);
  12556. }else{
  12557. this.showMainOutputOnly(_aa4);
  12558. this.removeTouchScrolling();
  12559. }
  12560. this.updateTabIndexValues();
  12561. }
  12562. };
  12563. PinFreezeContainer.prototype.calculateMinCrossTabScrollableClientHeight=function(){
  12564. var _aae=0;
  12565. if(this.m_cachedPFContainer){
  12566. var _aaf=this.getElementByLID(this.m_cachedPFContainer,"table",this.m_lid+this.m_viewerId);
  12567. if(_aaf){
  12568. var _ab0=0;
  12569. for(var r=0;r<_aaf.rows.length;r++){
  12570. var row=_aaf.rows[r];
  12571. for(var c=0;c<row.cells.length;c++){
  12572. var cell=row.cells[c];
  12573. if(cell.getAttribute("type")=="datavalue"){
  12574. _ab0++;
  12575. if(cell.childNodes.length===1&&cell.childNodes[0].getAttribute&&cell.childNodes[0].getAttribute("class")==="textItem"){
  12576. _aae=_aae+cell.offsetHeight;
  12577. }else{
  12578. _ab0++;
  12579. var _ab5=this.getSection("pfVerticalScrollBar");
  12580. if(_ab5){
  12581. _aae=_ab5.offsetWidth*2;
  12582. }
  12583. }
  12584. break;
  12585. }
  12586. }
  12587. if(_ab0>=2){
  12588. break;
  12589. }
  12590. }
  12591. }
  12592. }
  12593. return _aae;
  12594. };
  12595. PinFreezeContainer.prototype.updateSideHeadingSize=function(_ab6){
  12596. var _ab7=0;
  12597. if(this.m_freezeSide){
  12598. var _ab8=this.getSection("pfMainOutput");
  12599. if(!_ab8){
  12600. return 0;
  12601. }
  12602. if(!this.frozenSideHeadingsRequired()){
  12603. this.showFreezeTopOnly(_ab8);
  12604. return 0;
  12605. }
  12606. var _ab9=this.getSection("pfSideHeadings");
  12607. _ab7=this.getSideHeadingSectionWidth(_ab6);
  12608. var _aba=this.getSection("pfHorizontalScrollBar");
  12609. var _abb=this.getSectionHomeCell(_ab9);
  12610. if(_ab9.style.display=="none"){
  12611. _ab9.style.display="";
  12612. _aba.style.display="";
  12613. }
  12614. _ab9.style.width=_ab7+"px";
  12615. _ab9.style.height=_ab8.clientHeight+"px";
  12616. }
  12617. return _ab7;
  12618. };
  12619. PinFreezeContainer.prototype.updateTopHeadingSize=function(_abc){
  12620. var _abd=0;
  12621. if(this.m_freezeTop){
  12622. var _abe=this.getSection("pfMainOutput");
  12623. if(!_abe){
  12624. return 0;
  12625. }
  12626. if(!this.frozenTopHeadingsRequired()){
  12627. this.showFreezeSideOnly(_abe);
  12628. return 0;
  12629. }
  12630. var _abf=this.getSection("pfTopHeadings");
  12631. _abd=this.getTopHeadingSectionHeight(_abc);
  12632. var _ac0=this.getSection("pfVerticalScrollBar");
  12633. var _ac1=this.getSectionHomeCell(_abf);
  12634. if(_abf.style.display=="none"){
  12635. _abf.style.display="";
  12636. _ac0.style.display="";
  12637. }
  12638. _abf.style.height=_abd+"px";
  12639. _abf.style.width=_abe.clientWidth+"px";
  12640. }
  12641. return _abd;
  12642. };
  12643. PinFreezeContainer.prototype.setScrollX=function(_ac2,_ac3){
  12644. if(getElementDirection(_ac2)==="rtl"){
  12645. setScrollRight(_ac2,_ac3);
  12646. }else{
  12647. setScrollLeft(_ac2,_ac3);
  12648. }
  12649. };
  12650. PinFreezeContainer.prototype.setScrollY=function(_ac4,_ac5){
  12651. _ac4.scrollTop=_ac5;
  12652. };
  12653. PinFreezeContainer.prototype.setInitialScrollPosition=function(_ac6,_ac7,_ac8){
  12654. if(getElementDirection(_ac6)==="rtl"){
  12655. setScrollRight(_ac6,_ac7);
  12656. }else{
  12657. setScrollLeft(_ac6,_ac7);
  12658. }
  12659. _ac6.scrollTop=_ac8;
  12660. };
  12661. PinFreezeContainer.prototype.getScrollableClientWidth=function(){
  12662. return this.m_scrollableClientWidth;
  12663. };
  12664. PinFreezeContainer.prototype.setScrollableClientWidth=function(_ac9){
  12665. this.m_scrollableClientWidth=_ac9;
  12666. };
  12667. PinFreezeContainer.prototype.getContainerWidth=function(){
  12668. return this.m_addedFixedWidth?this.m_addedFixedWidth:this.m_clientWidth;
  12669. };
  12670. PinFreezeContainer.prototype.getClientWidth=function(){
  12671. return this.m_clientWidth;
  12672. };
  12673. PinFreezeContainer.prototype.getScrollableClientHeight=function(){
  12674. return this.m_scrollableClientHeight;
  12675. };
  12676. PinFreezeContainer.prototype.setScrollableClientHeight=function(_aca){
  12677. this.m_scrollableClientHeight=_aca;
  12678. };
  12679. PinFreezeContainer.prototype.getClientHeight=function(){
  12680. return this.m_clientHeight;
  12681. };
  12682. PinFreezeContainer.prototype.clientHeight=function(_acb){
  12683. return _acb.clientHeight;
  12684. };
  12685. PinFreezeContainer.prototype.findBestContainerHeight=function(_acc){
  12686. if(this.m_freezeTop&&this.m_cachedReportDiv){
  12687. var _acd=this.m_cachedReportDiv.parentNode;
  12688. if(_acd){
  12689. var _ace=this._findRestOfPageHeight(this.getContainer());
  12690. return _acc-_ace-(this.c_pageMargin/2)-this.m_containerMargin.top;
  12691. }
  12692. }
  12693. return _acc-this.c_pageMargin;
  12694. };
  12695. PinFreezeContainer.prototype.findBestContainerWidth=function(_acf){
  12696. var node=this.getContainer();
  12697. while(node&&node.nodeName.toLowerCase()!="td"&&node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
  12698. node=node.parentNode;
  12699. }
  12700. if(!node){
  12701. return -1;
  12702. }
  12703. if(node.nodeName.toLowerCase()=="td"){
  12704. var _ad1=0;
  12705. var _ad2=node.parentNode.childNodes;
  12706. for(var i=0;i<_ad2.length;i++){
  12707. if(_ad2[i]!==node){
  12708. _ad1+=_ad2[i].clientWidth;
  12709. }
  12710. }
  12711. return _acf-_ad1-(this.c_pageMargin/2);
  12712. }
  12713. return _acf;
  12714. };
  12715. PinFreezeContainer.prototype._findRestOfPageHeight=function(node){
  12716. var _ad5=0;
  12717. var _ad6=node.parentNode;
  12718. if(!_ad6){
  12719. return _ad5;
  12720. }
  12721. if(_ad6.childNodes.length>1){
  12722. for(var i=0;i<_ad6.childNodes.length;i++){
  12723. var _ad8=_ad6.childNodes[i];
  12724. if(_ad8.nodeType==1){
  12725. var _ad9=this.getStyleDisplay(_ad8);
  12726. if(_ad8!=node&&!isNaN(_ad8.clientHeight)&&_ad9!="none"&&_ad9!="table-cell"){
  12727. _ad5+=this.clientHeight(_ad8);
  12728. }
  12729. }
  12730. }
  12731. }
  12732. if(node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
  12733. _ad5+=this._findRestOfPageHeight(_ad6);
  12734. }
  12735. return _ad5;
  12736. };
  12737. PinFreezeContainer.prototype.resize=function(_ada,_adb,_adc,_add){
  12738. if(this.m_fixedWidth&&this.m_fixedHeight){
  12739. return;
  12740. }
  12741. _ada=(this.m_fixedWidth)?this.m_fixedWidth:_ada;
  12742. _adb=(this.m_fixedHeight)?this.m_fixedHeight:_adb;
  12743. var _ade=this.getSectionStructure();
  12744. if(this.m_sectionCache&&this.m_cachedPFContainer){
  12745. var _adf=0;
  12746. if(_adb!==0){
  12747. _adf=this.findBestContainerHeight(_adb);
  12748. if(_adc&&_adf<300){
  12749. _adf=300;
  12750. }else{
  12751. if(_adf<100){
  12752. _adf=100;
  12753. }
  12754. }
  12755. }
  12756. this.m_clientHeight=_adf>0?_adf:this.m_clientHeight;
  12757. var _ae0=0;
  12758. if(_ada!==0){
  12759. _ae0=this.findBestContainerWidth(_ada);
  12760. }
  12761. this.m_clientWidth=(_ae0>0)?_ae0-5-(this.c_pageMargin/2):this.m_clientWidth;
  12762. var _ae1=this.getSection("pfMainOutput");
  12763. var _ae2=this.getSectionHomeCell(_ae1);
  12764. if(_ae2){
  12765. this.m_scrollableClientWidth=this.m_clientWidth-this.getSideHeadingSectionWidth(_ae2);
  12766. this.m_scrollableClientHeight=this.m_clientHeight-_ae2.offsetHeight;
  12767. }
  12768. if(_add){
  12769. var _ae3=getElementsByAttribute(this.m_cachedPFContainer,"div","pflid",_add.lid);
  12770. if(_ae3){
  12771. var node=_ae3[0];
  12772. while(node.nodeName.toLowerCase()!="table"){
  12773. node=node.parentNode;
  12774. }
  12775. node.style.width=_add.width+"px";
  12776. }
  12777. }
  12778. this.updateContainer();
  12779. }else{
  12780. this.m_clientWidth=_ada-this.c_pageMargin;
  12781. this.m_clientHeight=_adb-this.c_pageMargin;
  12782. }
  12783. var _ae5=this.getSectionStructure();
  12784. this.checkSectionStructureChange(_ade,_ae5);
  12785. };
  12786. PinFreezeContainer.prototype.updateMainOutputSize=function(){
  12787. if(this.m_freezeSide&&this.m_freezeTop){
  12788. if(this.frozenSideHeadingsRequired()){
  12789. this.updateMainOutputWidth(this.getScrollableClientWidth());
  12790. }
  12791. if(this.frozenTopHeadingsRequired()){
  12792. this.updateMainOutputHeight(this.getScrollableClientHeight());
  12793. }
  12794. }else{
  12795. if(this.m_freezeSide){
  12796. this.updateMainOutputWidth(this.getScrollableClientWidth());
  12797. }else{
  12798. if(this.m_freezeTop){
  12799. this.updateMainOutputHeight(this.getScrollableClientHeight());
  12800. }
  12801. }
  12802. }
  12803. };
  12804. PinFreezeContainer.prototype.updateMainOutputWidth=function(_ae6){
  12805. var _ae7=this.getSection("pfMainOutput");
  12806. if(!_ae7){
  12807. return;
  12808. }
  12809. if(this.m_freezeSide==true){
  12810. _ae7.style.width=(_ae6+"px");
  12811. if(this.m_freezeTop==false||!this.frozenTopHeadingsRequired()){
  12812. _ae7.style.height=_ae7.firstChild.clientHeight+"px";
  12813. }
  12814. var _ae8=this.getSection("pfHorizontalScrollBar");
  12815. if(_ae8){
  12816. _ae8.style.width=(_ae6+"px");
  12817. var _ae9=_ae8.firstChild;
  12818. if(_ae9){
  12819. var _aea=this.getSectionHomeCell(_ae7);
  12820. var _aeb=_ae7.scrollWidth-this.getHomeCellOffsetWidth(_aea);
  12821. _ae9.style.width=_aeb+"px";
  12822. }
  12823. }
  12824. }
  12825. };
  12826. PinFreezeContainer.prototype.updateMainOutputHeight=function(_aec){
  12827. var _aed=this.getSection("pfMainOutput");
  12828. if(!_aed){
  12829. return;
  12830. }
  12831. _aed.style.height=(_aec+"px");
  12832. if(!this.m_freezeSide||!this.frozenSideHeadingsRequired()){
  12833. _aed.style.width=_aed.firstChild.clientWidth+2+"px";
  12834. }
  12835. var _aee=this.getSection("pfVerticalScrollBar");
  12836. if(_aee){
  12837. _aee.style.height=(_aec+"px");
  12838. var _aef=_aee.firstChild;
  12839. if(_aef){
  12840. var _af0=this.getSectionHomeCell(_aed);
  12841. var _af1=_aed.scrollHeight-_af0.offsetHeight;
  12842. _aef.style.height=_af1+"px";
  12843. }
  12844. }
  12845. };
  12846. PinFreezeContainer.prototype.getElementByLID=function(_af2,tag,lid){
  12847. var _af5=getElementsByAttribute(_af2,tag,"lid",lid);
  12848. if(_af5.length>0){
  12849. return _af5[0];
  12850. }
  12851. return null;
  12852. };
  12853. PinFreezeContainer.prototype.getContainerByLID=function(_af6){
  12854. var _af7=getElementsByAttribute(_af6,"table","pfclid","pfContainer_"+this.m_lidNS);
  12855. if(_af7.length>0){
  12856. return _af7[0];
  12857. }
  12858. return null;
  12859. };
  12860. PinFreezeContainer.prototype.getSectionByLID=function(_af8,_af9){
  12861. var _afa=getElementsByAttribute(_af8,"div","pfslid",_af9+"_"+this.m_lidNS);
  12862. if(_afa.length>0){
  12863. return _afa[0];
  12864. }
  12865. return null;
  12866. };
  12867. PinFreezeContainer.getSectionNameFromSlid=function(slid){
  12868. return slid?slid.split("_")[0]:null;
  12869. };
  12870. PinFreezeContainer.getLidFromSlid=function(slid){
  12871. return slid.split("_")[1];
  12872. };
  12873. PinFreezeContainer.nodeToSlid=function(_afd){
  12874. while(_afd.parentNode&&!_afd.getAttribute("pfslid")){
  12875. _afd=_afd.parentNode;
  12876. }
  12877. if(_afd.getAttribute){
  12878. return _afd.getAttribute("pfslid");
  12879. }
  12880. return null;
  12881. };
  12882. PinFreezeContainer.prototype.cacheContainerAndSections=function(_afe){
  12883. if(!_afe){
  12884. return _afe;
  12885. }
  12886. this.m_cachedPFContainer=_afe;
  12887. var _aff=getElementsByAttribute(this.m_cachedPFContainer,"div","pflid",this.m_lidNS);
  12888. this.m_sectionCache={};
  12889. for(var i=0;i<_aff.length;++i){
  12890. var key=_aff[i].getAttribute("pfslid");
  12891. key=key.split("_",1);
  12892. this.m_sectionCache[key]=_aff[i];
  12893. }
  12894. return _afe;
  12895. };
  12896. PinFreezeContainer.prototype.getContainer=function(){
  12897. return this.m_cachedPFContainer;
  12898. };
  12899. PinFreezeContainer.prototype.getSection=function(key){
  12900. if(!this.m_sectionCache){
  12901. return null;
  12902. }
  12903. if(!this.m_sectionCache[key]){
  12904. this.m_sectionCache[key]=this.getSectionByLID(this.m_cachedPFContainer,key);
  12905. }
  12906. return this.m_sectionCache[key];
  12907. };
  12908. PinFreezeContainer.prototype.initializeHomeCellTabIndex=function(_b03){
  12909. var slid=PinFreezeContainer.nodeToSlid(_b03);
  12910. if(!this.m_homeCellNodes[slid]){
  12911. var _b05=getElementsByAttribute(_b03,"*","tabIndex","*");
  12912. for(var i in _b05){
  12913. if(!_b05[i].getAttribute("widgetid")){
  12914. this.m_homeCellNodes[slid]=_b05[i];
  12915. break;
  12916. }
  12917. }
  12918. }
  12919. };
  12920. PinFreezeContainer.prototype.updateTabIndexValues=function(){
  12921. if(this.isContainerFrozen()){
  12922. for(var slid in this.m_homeCellNodes){
  12923. var _b08=this.m_pinFreezeManager.isNodeVisible(this.m_homeCellNodes[slid])?"0":"-1";
  12924. this.m_homeCellNodes[slid].setAttribute("tabIndex",_b08);
  12925. }
  12926. }else{
  12927. for(var slid in this.m_homeCellNodes){
  12928. var _b08=(PinFreezeContainer.getSectionNameFromSlid(slid)==="pfMainOutput")?"0":"-1";
  12929. this.m_homeCellNodes[slid].setAttribute("tabIndex",_b08);
  12930. }
  12931. }
  12932. };
  12933. PinFreezeContainer.prototype.getSectionHomeCell=function(_b09){
  12934. if(_b09){
  12935. var _b0a=this.getElementByLID(_b09,"table",this.m_lid+this.m_viewerId);
  12936. if(_b0a&&_b0a.rows.length&&_b0a.rows[0].cells.length){
  12937. return _b0a.rows[0].cells[0];
  12938. }
  12939. }
  12940. return null;
  12941. };
  12942. PinFreezeContainer.prototype.getMainOutputHomeCell=function(){
  12943. var _b0b=this.getSection("pfMainOutput");
  12944. if(!_b0b){
  12945. _b0b=this.getSectionByLID(this.m_cachedPFContainer,"pfMainOutput");
  12946. }
  12947. return this.getSectionHomeCell(_b0b);
  12948. };
  12949. PinFreezeContainer.prototype.getChildPosition=function(_b0c,_b0d){
  12950. for(var i=0;i<_b0c.childNodes.length;++i){
  12951. if(_b0c.childNodes[i]==_b0d){
  12952. return i;
  12953. }
  12954. }
  12955. return -1;
  12956. };
  12957. PinFreezeContainer.prototype.insertAt=function(_b0f,_b10,_b11){
  12958. if(_b11==_b0f.childNodes.length){
  12959. _b0f.appendChild(_b10);
  12960. }else{
  12961. _b0f.insertBefore(_b10,_b0f.childNodes[_b11]);
  12962. }
  12963. };
  12964. PinFreezeContainer.prototype.synchScroll=function(){
  12965. if(!this.m_cachedPFContainer){
  12966. return;
  12967. }
  12968. var _b12=this.getMainOutputHomeCell();
  12969. var _b13=this.getSection("pfMainOutput");
  12970. var _b14=this.getSection("pfSideHeadings");
  12971. if(_b14!=null){
  12972. var _b15=this.getSection("pfHorizontalScrollBar");
  12973. if(_b15){
  12974. var _b16=this.getSideHeadingSectionWidth(_b12);
  12975. if(getElementDirection(_b13)==="rtl"){
  12976. _b16=0;
  12977. }
  12978. setScrollLeft(_b13,getScrollLeft(_b15)+_b16);
  12979. if(this.m_freezeTop){
  12980. setScrollLeft(this.getSection("pfTopHeadings"),getScrollLeft(_b15)+_b16);
  12981. }
  12982. }
  12983. }
  12984. };
  12985. PinFreezeContainer.prototype.updateScroll=function(_b17){
  12986. var slid=PinFreezeContainer.nodeToSlid(_b17);
  12987. if(!slid){
  12988. return;
  12989. }
  12990. var _b19=PinFreezeContainer.getSectionNameFromSlid(slid);
  12991. if(!_b19){
  12992. return;
  12993. }
  12994. var _b1a=document.getElementById("CVReport"+this.m_viewerId);
  12995. if(!_b1a){
  12996. return;
  12997. }
  12998. if(!this.m_cachedPFContainer){
  12999. return;
  13000. }
  13001. var _b1b=_b17.parentNode;
  13002. if(_b1b){
  13003. var _b1c=_b1b.tagName.toLowerCase();
  13004. if(_b1c==="td"||_b1c==="th"){
  13005. var _b1d=this.getMainOutputHomeCell();
  13006. var _b1e=this.getSection("pfMainOutput");
  13007. if(_b19==="pfMainOutput"||_b19==="pfTopHeadings"){
  13008. var _b1f=this.getSection("pfHorizontalScrollBar");
  13009. if(_b1f){
  13010. var _b20=PinFreezeContainer.calculateNewPosition(_b1b.offsetLeft,_b1b.offsetWidth,getScrollLeft(_b1e),_b1e.offsetWidth);
  13011. var _b21=this.getHomeCellOffsetWidth(_b1d);
  13012. if(getElementDirection(_b1e)==="rtl"){
  13013. _b21=0;
  13014. }
  13015. setScrollLeft(_b1f,_b20-_b21);
  13016. setScrollLeft(_b1e,_b20);
  13017. }
  13018. }
  13019. if(_b19==="pfMainOutput"||_b19==="pfSideHeadings"){
  13020. var _b22=this.getSection("pfVerticalScrollBar");
  13021. if(_b22){
  13022. var _b23=PinFreezeContainer.calculateNewPosition(_b1b.offsetTop,_b1b.offsetHeight,_b1e.scrollTop,_b1e.offsetHeight);
  13023. _b22.scrollTop=_b23-_b1d.offsetHeight;
  13024. _b1e.scrollTop=_b23;
  13025. }
  13026. }
  13027. }
  13028. }
  13029. };
  13030. PinFreezeContainer.calculateNewPosition=function(_b24,_b25,_b26,_b27){
  13031. var _b28=_b24+_b25;
  13032. var _b29=_b26+_b27;
  13033. if(_b26>_b24){
  13034. return _b24;
  13035. }else{
  13036. if(_b29<_b28){
  13037. if(_b25>_b27){
  13038. return _b24;
  13039. }
  13040. return _b28-_b27;
  13041. }
  13042. }
  13043. return _b26;
  13044. };
  13045. PinFreezeContainer.prototype.synchVScroll=function(){
  13046. if(!this.m_cachedPFContainer){
  13047. return;
  13048. }
  13049. var _b2a=this.getMainOutputHomeCell();
  13050. var _b2b=this.getSection("pfMainOutput");
  13051. var _b2c=this.getSection("pfTopHeadings");
  13052. if(_b2c!=null){
  13053. var _b2d=this.getSection("pfVerticalScrollBar");
  13054. if(_b2d){
  13055. _b2b.scrollTop=_b2d.scrollTop+this.getTopHeadingSectionHeight(_b2a);
  13056. if(this.m_freezeSide){
  13057. this.getSection("pfSideHeadings").scrollTop=_b2d.scrollTop+this.getTopHeadingSectionHeight(_b2a);
  13058. }
  13059. }
  13060. }
  13061. };
  13062. PinFreezeContainer.prototype.getTopHeadingSectionHeight=function(_b2e){
  13063. return _b2e.offsetHeight+_b2e.offsetTop+this.m_containerMargin.top;
  13064. };
  13065. PinFreezeContainer.prototype._findBestGuessHomeCell=function(_b2f){
  13066. if(this.m_bestGuessHomeCell){
  13067. return this.m_bestGuessHomeCell;
  13068. }
  13069. if(_b2f){
  13070. var _b30=_b2f.parentNode.parentNode;
  13071. var _b31=_b2f.rowSpan?(_b2f.rowSpan):1;
  13072. var tr=_b30.childNodes[_b31];
  13073. if(tr){
  13074. var _b33=tr.childNodes.length;
  13075. var _b34=null;
  13076. var td=null;
  13077. for(var i=0;i<_b33;i++){
  13078. td=tr.childNodes[i];
  13079. if(td.getAttribute("type")=="datavalue"){
  13080. break;
  13081. }
  13082. _b34=td;
  13083. }
  13084. if(_b34){
  13085. this.m_bestGuessHomeCell=_b34;
  13086. return this.m_bestGuessHomeCell;
  13087. }
  13088. }else{
  13089. return _b2f;
  13090. }
  13091. }
  13092. return null;
  13093. };
  13094. PinFreezeContainer.prototype.getHomeCellOffsetWidth=function(_b37){
  13095. var _b38=this._findBestGuessHomeCell(_b37);
  13096. return _b38?_b38.offsetWidth:0;
  13097. };
  13098. PinFreezeContainer.prototype.getSideHeadingSectionWidth=function(_b39){
  13099. var _b3a=this._findBestGuessHomeCell(_b39);
  13100. if(_b3a){
  13101. return _b3a.offsetWidth+_b3a.offsetLeft+this.m_containerMargin.left;
  13102. }else{
  13103. return _b39.offsetWidth+_b39.offsetLeft;
  13104. }
  13105. };
  13106. PinFreezeContainer.prototype.isContainerFrozen=function(){
  13107. return (this.m_freezeTop||this.m_freezeSide);
  13108. };
  13109. PinFreezeContainer.prototype.unfreeze=function(_b3b){
  13110. var _b3c=this.getContainerByLID(_b3b);
  13111. this.m_freezeTop=false;
  13112. this.m_freezeSide=false;
  13113. if(_b3c){
  13114. var _b3d=_b3c.parentNode;
  13115. pfMainOutput=this.getSectionByLID(_b3c,"pfMainOutput");
  13116. if(pfMainOutput&&_b3d){
  13117. if(_b3c.style.border!==""){
  13118. pfMainOutput.firstChild.style.border=_b3c.style.border;
  13119. _b3c.style.border="";
  13120. }
  13121. if(this.m_wrapFlag){
  13122. var _b3e=pfMainOutput.firstChild.getElementsByTagName("span");
  13123. if(_b3e){
  13124. for(var k=0;k<_b3e.length;k++){
  13125. _b3e[k].style.whiteSpace="";
  13126. }
  13127. }
  13128. this.m_wrapFlag=false;
  13129. }
  13130. this.updateTabIndexValues();
  13131. if(this.m_cachedBaseContainer.getAttribute("authoredFixedWidth")){
  13132. this.m_cachedBaseContainer.removeAttribute("authoredFixedWidth");
  13133. this.m_cachedBaseContainer.style.width="auto";
  13134. this.m_addedFixedWidth=null;
  13135. }
  13136. if(this.m_cachedBaseContainer.getAttribute("authoredFixedHeight")){
  13137. this.m_cachedBaseContainer.removeAttribute("authoredFixedHeight");
  13138. this.m_cachedBaseContainer.style.height="auto";
  13139. this.m_addedFixedHeight=null;
  13140. }
  13141. _b3d.replaceChild(this.m_pinFreezeManager.deepCloneNode(pfMainOutput.firstChild),_b3c);
  13142. }
  13143. }
  13144. };
  13145. PinFreezeContainer.prototype.getBorderInfo=function(el,_b41){
  13146. var _b42={};
  13147. var _b43="border-"+_b41+"-";
  13148. var _b44="border"+_b41.charAt(0).toUpperCase()+_b41.substring(1);
  13149. if(el.currentStyle){
  13150. _b42[_b44+"Width"]=el.currentStyle[_b44+"Width"];
  13151. _b42[_b44+"Style"]=el.currentStyle[_b44+"Style"];
  13152. _b42[_b44+"Color"]=el.currentStyle[_b44+"Color"];
  13153. }else{
  13154. if(window.getComputedStyle){
  13155. _b42[_b44+"Width"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"width");
  13156. _b42[_b44+"Style"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"style");
  13157. _b42[_b44+"Color"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"color");
  13158. }else{
  13159. return null;
  13160. }
  13161. }
  13162. return _b42;
  13163. };
  13164. PinFreezeContainer.prototype.isA11yEnabled=function(_b45){
  13165. return (_b45.getAttribute("role")==="grid");
  13166. };
  13167. PinFreezeContainer.isElementInMainOutput=function(_b46){
  13168. var _b47=PinFreezeContainer.nodeToSlid(_b46);
  13169. if(_b47){
  13170. return (_b47.indexOf("pfMainOutput_")===0);
  13171. }
  13172. return false;
  13173. };
  13174. PinFreezeContainer.prototype.removeCTX=function(_b48){
  13175. _b48.removeAttribute("ctx");
  13176. var _b49=getElementsByAttribute(_b48,"*","ctx","*");
  13177. if(_b49&&_b49.length){
  13178. for(var i=0;i<_b49.length;i++){
  13179. _b49[i].removeAttribute("ctx");
  13180. }
  13181. }
  13182. };
  13183. PinFreezeContainer.prototype.initializeTouchScrolling=function(_b4b){
  13184. if(!this.m_pinFreezeManager.isIWidgetMobile()){
  13185. return;
  13186. }
  13187. if(_b4b){
  13188. _b4b.m_pinFreezeContainer=this;
  13189. if(document.attachEvent){
  13190. _b4b.attachEvent("touchstart",this.touchStart);
  13191. _b4b.attachEvent("touchmove",this.touchMove);
  13192. _b4b.attachEvent("touchend",this.touchEnd);
  13193. }else{
  13194. _b4b.addEventListener("touchstart",this.touchStart,false);
  13195. _b4b.addEventListener("touchmove",this.touchMove,false);
  13196. _b4b.addEventListener("touchend",this.touchEnd,false);
  13197. }
  13198. }
  13199. };
  13200. PinFreezeContainer.prototype.removeTouchScrolling=function(){
  13201. if(!this.m_pinFreezeManager.isIWidgetMobile()){
  13202. return;
  13203. }
  13204. this.removeTouchScrollingEvents(this.getSection("pfMainOutput"));
  13205. this.removeTouchScrollingEvents(this.getSection("pfSideHeadings"));
  13206. this.removeTouchScrollingEvents(this.getSection("pfTopHeadings"));
  13207. };
  13208. PinFreezeContainer.prototype.removeTouchScrollingEvents=function(_b4c){
  13209. if(!this.m_pinFreezeManager.isIWidgetMobile()){
  13210. return;
  13211. }
  13212. if(_b4c){
  13213. if(document.detachEvent){
  13214. _b4c.detachEvent("touchstart",this.touchStart);
  13215. _b4c.detachEvent("touchmove",this.touchMove);
  13216. _b4c.detachEvent("touchend",this.touchEnd);
  13217. }else{
  13218. _b4c.removeEventListener("touchstart",this.touchStart,false);
  13219. _b4c.removeEventListener("touchmove",this.touchMove,false);
  13220. _b4c.removeEventListener("touchend",this.touchEnd,false);
  13221. }
  13222. }
  13223. };
  13224. PinFreezeContainer.prototype.touchMove=function(e){
  13225. if(this.m_pinFreezeContainer&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
  13226. var _b4e=e.changedTouches[0];
  13227. if(_b4e&&_b4e.clientX&&_b4e.clientY){
  13228. var _b4f=parseInt(_b4e.clientX);
  13229. var _b50=parseInt(_b4e.clientY);
  13230. if(this.m_pinFreezeContainer.touchMoveHandler(_b4f,_b50)){
  13231. return stopEventBubble(e);
  13232. }
  13233. }
  13234. }
  13235. };
  13236. PinFreezeContainer.prototype.touchStart=function(e){
  13237. if(this.m_pinFreezeContainer&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
  13238. var _b52=e.changedTouches[0];
  13239. if(_b52&&_b52.clientX&&_b52.clientY){
  13240. var _b53=parseInt(_b52.clientX);
  13241. var _b54=parseInt(_b52.clientY);
  13242. this.m_pinFreezeContainer.touchStartHandler(_b53,_b54);
  13243. }
  13244. }
  13245. };
  13246. PinFreezeContainer.prototype.touchStartHandler=function(_b55,_b56){
  13247. this.touchScrollSections=false;
  13248. this.touchPreviousX=_b55;
  13249. this.touchPreviousY=_b56;
  13250. };
  13251. PinFreezeContainer.prototype.touchEnd=function(e){
  13252. if(this.m_pinFreezeContainer&&this.m_pinFreezeContainer.touchEndHandler()){
  13253. stopEventBubble(e);
  13254. }
  13255. };
  13256. PinFreezeContainer.prototype.touchEndHandler=function(){
  13257. var _b58=this.touchScrollSections;
  13258. this.touchScrollSections=false;
  13259. this.touchPreviousX=-1;
  13260. this.touchPreviousY=-1;
  13261. return _b58;
  13262. };
  13263. PinFreezeContainer.prototype.touchMoveHandler=function(_b59,_b5a){
  13264. var _b5b=this.getSection("pfMainOutput");
  13265. if(!_b5b){
  13266. return;
  13267. }
  13268. var _b5c=this.getSectionHomeCell(_b5b);
  13269. var _b5d=this.getTopHeadingSectionHeight(_b5c);
  13270. var _b5e=this.getSideHeadingSectionWidth(_b5c);
  13271. var _b5f=_b5a-this.touchPreviousY;
  13272. var _b60=_b59-this.touchPreviousX;
  13273. if(this.touchScrollSections){
  13274. if(_b5f!=0){
  13275. var _b61=_b5b.scrollTop-_b5f;
  13276. _b61=(_b61>_b5d)?_b61:_b5d;
  13277. _b5b.scrollTop=_b61;
  13278. var _b62=this.getSection("pfSideHeadings");
  13279. if(_b62){
  13280. _b62.scrollTop=_b61;
  13281. }
  13282. }
  13283. if(_b60!=0){
  13284. var _b63=_b5b.scrollLeft-_b60;
  13285. _b63=(_b63>_b5e)?_b63:_b5e;
  13286. _b5b.scrollLeft=_b63;
  13287. var _b64=this.getSection("pfTopHeadings");
  13288. if(_b64){
  13289. _b64.scrollLeft=_b63;
  13290. }
  13291. }
  13292. }else{
  13293. this.firstTouchMove(_b5b,_b60,_b5f,_b5e,_b5d);
  13294. }
  13295. this.touchPreviousX=_b59;
  13296. this.touchPreviousY=_b5a;
  13297. return this.touchScrollSections;
  13298. };
  13299. PinFreezeContainer.prototype.firstTouchMove=function(_b65,_b66,_b67,_b68,_b69){
  13300. var _b6a=this.mostlyVerticalTouchMove(_b66,_b67);
  13301. var _b6b=PinFreezeContainer.isSectionVisible(this.getSection("pfTopHeadings"));
  13302. var _b6c=PinFreezeContainer.isSectionVisible(this.getSection("pfSideHeadings"));
  13303. if(_b6a&&(!_b6b||(_b67>0&&_b65.scrollTop<=_b69)||(_b67<0&&_b65.scrollTop+_b65.clientHeight>=_b65.scrollHeight))){
  13304. this.touchScrollSections=false;
  13305. }else{
  13306. if(!_b6a&&(!_b6c||(_b66>0&&_b65.scrollLeft<=_b68)||(_b66<0&&_b65.scrollLeft+_b65.clientWidth>=_b65.scrollWidth))){
  13307. this.touchScrollSections=false;
  13308. }else{
  13309. this.touchScrollSections=true;
  13310. }
  13311. }
  13312. };
  13313. PinFreezeContainer.prototype.mostlyVerticalTouchMove=function(_b6d,_b6e){
  13314. var _b6f=(_b6d>0)?_b6d:0-_b6d;
  13315. var _b70=(_b6e>0)?_b6e:0-_b6e;
  13316. return (_b70>_b6f);
  13317. };
  13318. PinFreezeContainer.prototype.destroy=function(){
  13319. this.removeTouchScrolling();
  13320. GUtil.destroyProperties(this);
  13321. };
  13322. function PinFreezeManager(oCV){
  13323. this.m_oCV=oCV;
  13324. this.m_viewerId=oCV.getId();
  13325. this.m_frozenInfo=null;
  13326. this.m_lastWidthProcessed=0;
  13327. this.m_lastHeightProcessed=0;
  13328. this.c_resizeTweekLimit=5;
  13329. this.m_repaintOnVisible=false;
  13330. };
  13331. PinFreezeManager.prototype.addContainerObject=function(lid,_b73,_b74,_b75,_b76){
  13332. if(_b73||_b74){
  13333. if(!this.m_frozenInfo){
  13334. this.m_frozenInfo={};
  13335. }
  13336. if(!this.m_frozenInfo[lid]){
  13337. this._createDefaultFrozenInfo(lid);
  13338. }
  13339. this.m_frozenInfo[lid].freezeTop=_b73;
  13340. this.m_frozenInfo[lid].freezeSide=_b74;
  13341. var _b77=this.newContainer(lid,_b73,_b74,_b75,_b76);
  13342. this.m_frozenInfo[lid].pinFreezeContainers.push(_b77);
  13343. return _b77;
  13344. }
  13345. return null;
  13346. };
  13347. PinFreezeManager.prototype.newContainer=function(lid,_b79,_b7a,_b7b,_b7c){
  13348. return new PinFreezeContainer(this,lid,this.m_viewerId,_b79,_b7a,_b7b,_b7c);
  13349. };
  13350. PinFreezeManager.prototype.clearPinInfo=function(lid){
  13351. if(!this.m_frozenInfo){
  13352. return;
  13353. }
  13354. if(lid){
  13355. if(this.m_frozenInfo[lid]){
  13356. delete this.m_frozenInfo[lid];
  13357. }
  13358. }else{
  13359. delete this.m_frozenInfo;
  13360. this.m_frozenInfo=null;
  13361. }
  13362. };
  13363. PinFreezeManager.prototype._createDefaultFrozenInfo=function(lid){
  13364. this.m_frozenInfo[lid]={"lid":lid,"freezeTop":false,"freezeSide":false,"pinFreezeContainers":[],"childContainers":{}};
  13365. };
  13366. PinFreezeManager.prototype._resetFrozenInfo=function(lid){
  13367. var _b80=this.m_frozenInfo[lid];
  13368. if(_b80){
  13369. delete _b80.pinFreezeContainers;
  13370. _b80.pinFreezeContainers=[];
  13371. _b80.freezeTop=false;
  13372. _b80.freezeSide=false;
  13373. }
  13374. };
  13375. PinFreezeManager.prototype.prepopulateFrozenInfo=function(_b81){
  13376. var _b82=getDescendantElementsByAttribute(_b81,"table","lid","",false,-1,new RegExp("[\\s\\S]*"));
  13377. if(_b82){
  13378. if(!this.m_frozenInfo){
  13379. this.m_frozenInfo={};
  13380. }
  13381. for(var i=0;i<_b82.length;i++){
  13382. var _b84=_b82[i];
  13383. if(_b84.getAttribute("id")=="rt"+this.m_viewerId){
  13384. continue;
  13385. }
  13386. var lid=this.removeNamespace(_b84.getAttribute("lid"));
  13387. if(this.m_frozenInfo[lid]&&this.m_frozenInfo[lid].childContainers){
  13388. continue;
  13389. }
  13390. if(!this.m_frozenInfo[lid]){
  13391. this._createDefaultFrozenInfo(lid);
  13392. }
  13393. if(!this.m_frozenInfo[lid].childContainers){
  13394. this.m_frozenInfo[lid].childContainers={};
  13395. }
  13396. var _b86=getDescendantElementsByAttribute(_b84,"table","lid","",false,-1,new RegExp("[\\s\\S]*"));
  13397. if(_b86){
  13398. for(var _b87=0;_b87<_b86.length;_b87++){
  13399. var _b88=_b86[_b87];
  13400. var _b89=this.removeNamespace(_b88.getAttribute("lid"));
  13401. if(!this.m_frozenInfo[lid].childContainers[_b89]){
  13402. var _b8a=_b88.parentNode;
  13403. while(_b8a&&!_b8a.getAttribute("lid")){
  13404. _b8a=_b8a.parentNode;
  13405. }
  13406. if(_b8a&&this.removeNamespace(_b8a.getAttribute("lid"))==lid){
  13407. this.m_frozenInfo[lid].childContainers[_b89]=true;
  13408. }
  13409. }
  13410. }
  13411. }
  13412. }
  13413. this._updateParentContainerInfo();
  13414. }
  13415. };
  13416. PinFreezeManager.prototype._updateParentContainerInfo=function(){
  13417. for(var _b8b in this.m_frozenInfo){
  13418. var _b8c=this.m_frozenInfo[_b8b].childContainers;
  13419. if(_b8c){
  13420. for(var _b8d in _b8c){
  13421. if(this.m_frozenInfo[_b8d]){
  13422. this.m_frozenInfo[_b8d].parentContainer=_b8b;
  13423. break;
  13424. }
  13425. }
  13426. }
  13427. }
  13428. };
  13429. PinFreezeManager.prototype.getTopLevelContainerLID=function(lid){
  13430. if(this.m_frozenInfo[lid]){
  13431. while(this.m_frozenInfo[lid].parentContainer){
  13432. lid=this.m_frozenInfo[lid].parentContainer;
  13433. }
  13434. }
  13435. return lid;
  13436. };
  13437. PinFreezeManager.prototype.freezeContainer=function(lid,_b90,_b91){
  13438. var _b92=document.getElementById("CVReport"+this.m_viewerId);
  13439. this.prepopulateFrozenInfo(_b92);
  13440. var _b93=this.getTopLevelContainerLID(lid);
  13441. this.unfreezeAllNestedContainers(_b93,_b92);
  13442. this.m_frozenInfo[lid].freezeTop=_b90;
  13443. this.m_frozenInfo[lid].freezeSide=_b91;
  13444. var _b94=this._createPinAndFreezeObject(_b92,_b93);
  13445. this.m_lastWidthProcessed=0;
  13446. this.m_lastHeightProcessed=0;
  13447. this._resizePinFreezeObjects(_b94);
  13448. this.sectionStructureChange();
  13449. if(isIE()){
  13450. var obj=this;
  13451. setTimeout(function(){
  13452. obj.refresh();
  13453. },1);
  13454. var _b96=document.getElementById("RVContent"+this.m_viewerId);
  13455. this.m_oCV.repaintDiv(_b96);
  13456. }
  13457. return _b94;
  13458. };
  13459. PinFreezeManager.prototype.getInitialWidthThreshold=function(){
  13460. return document.body.clientWidth*3/4;
  13461. };
  13462. PinFreezeManager.prototype.getInitialHeightThreshold=function(){
  13463. return document.body.clientWidth*9/10;
  13464. };
  13465. PinFreezeManager.prototype.hasFrozenContainers=function(){
  13466. return ((this.m_frozenInfo)?true:false);
  13467. };
  13468. PinFreezeManager.prototype.hasFrozenRowHeadings=function(lid){
  13469. if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
  13470. return this.m_frozenInfo[lid].freezeSide?this.m_frozenInfo[lid].freezeSide:false;
  13471. }
  13472. return false;
  13473. };
  13474. PinFreezeManager.prototype.hasFrozenColumnHeadings=function(lid){
  13475. if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
  13476. return this.m_frozenInfo[lid].freezeTop?this.m_frozenInfo[lid].freezeTop:false;
  13477. }
  13478. return false;
  13479. };
  13480. PinFreezeManager.prototype.removeNamespace=function(idNS){
  13481. if(idNS.length>this.m_viewerId.length){
  13482. if(idNS.indexOf(this.m_viewerId)>0){
  13483. return idNS.substring(0,idNS.indexOf(this.m_viewerId));
  13484. }
  13485. }
  13486. return idNS;
  13487. };
  13488. PinFreezeManager.prototype.getContainer=function(lid,_b9b){
  13489. if(this.m_frozenInfo&&this.m_frozenInfo[lid]&&this.m_frozenInfo[lid].pinFreezeContainers[0]){
  13490. _b9b=_b9b?_b9b:0;
  13491. return this.m_frozenInfo[lid].pinFreezeContainers[_b9b];
  13492. }
  13493. return null;
  13494. };
  13495. PinFreezeManager.prototype.nodeToContainer=function(node){
  13496. var slid=PinFreezeContainer.nodeToSlid(node);
  13497. var _b9e=null;
  13498. if(slid){
  13499. var lid=this.removeNamespace(PinFreezeContainer.getLidFromSlid(slid));
  13500. _b9e=this.getContainer(lid);
  13501. }
  13502. return _b9e;
  13503. };
  13504. PinFreezeManager.prototype.getContainerElement=function(_ba0){
  13505. var lid=this.removeNamespace(_ba0.getAttribute("lid"));
  13506. if(lid){
  13507. var _ba2=this.getContainer(lid);
  13508. if(_ba2){
  13509. return _ba2.getContainer();
  13510. }
  13511. }
  13512. return null;
  13513. };
  13514. PinFreezeManager.prototype._createPinAndFreezeObject=function(_ba3,lid){
  13515. var _ba5=null;
  13516. if(this.m_frozenInfo){
  13517. var _ba6=this.m_frozenInfo[lid];
  13518. var _ba7=_ba6.initialLoad;
  13519. if(_ba7){
  13520. delete _ba6.initialLoad;
  13521. }
  13522. var _ba8=_ba6.freezeTop;
  13523. var _ba9=_ba6.freezeSide;
  13524. var _baa=null;
  13525. if(_ba7&&_ba6.pinFreezeContainers&&(_ba8||_ba9)){
  13526. _baa=_ba6.pinFreezeContainers.slice(0);
  13527. }
  13528. var _bab=_ba3;
  13529. if(_ba6&&_ba6.parentContainer){
  13530. var _bac=getElementsByAttribute(_ba3,"table","lid",_ba6.parentContainer+this.m_viewerId);
  13531. if(_bac){
  13532. for(parentIndex=0;parentIndex<_bac.length;parentIndex++){
  13533. if(!_bac[parentIndex].getAttribute("clonednode")){
  13534. _bab=_bac[parentIndex];
  13535. break;
  13536. }
  13537. }
  13538. }
  13539. }
  13540. if(_ba6.childContainers){
  13541. for(var _bad in _ba6.childContainers){
  13542. var _bae=this._createPinAndFreezeObject(_bab,_bad);
  13543. _ba5=_ba5?_ba5:_bae;
  13544. }
  13545. }
  13546. var _baf=getElementsByAttribute(_bab,"table","lid",lid+this.m_viewerId);
  13547. if(_baf&&_baf.length>0){
  13548. delete _ba6.pinFreezeContainers;
  13549. _ba6.pinFreezeContainers=[];
  13550. }else{
  13551. return null;
  13552. }
  13553. if(_baf&&(_ba8||_ba9)){
  13554. var _bb0=(_ba5!==null);
  13555. for(var i=0;i<_baf.length;i++){
  13556. var _bb2=_baf[i];
  13557. if(_bb2.getAttribute("clonednode")=="true"){
  13558. continue;
  13559. }
  13560. _ba5=this.addContainerObject(lid,_ba8,_ba9,_bb2,i);
  13561. if(_ba5){
  13562. _ba5.createPFContainer(_bab,_bb0);
  13563. if(_ba7){
  13564. _ba5.copyProperties(_baa[0]);
  13565. }
  13566. _ba5.freezeContainerInReport(_ba3);
  13567. }
  13568. }
  13569. }
  13570. }
  13571. return _ba5;
  13572. };
  13573. PinFreezeManager.prototype.renderReportWithFrozenContainers=function(_bb3){
  13574. if(this.m_frozenInfo){
  13575. var _bb4=false;
  13576. var _bb5=null;
  13577. for(var _bb6 in this.m_frozenInfo){
  13578. var _bb7=this.m_frozenInfo[_bb6];
  13579. if(!_bb4){
  13580. _bb4=_bb7.initialLoad;
  13581. }
  13582. if(!_bb7.parentContainer){
  13583. var temp=this._createPinAndFreezeObject(_bb3,_bb7.lid);
  13584. _bb5=_bb5?_bb5:temp;
  13585. }
  13586. }
  13587. if(!_bb4&&_bb5){
  13588. this._resizePinFreezeObjects(_bb5);
  13589. }
  13590. this.refresh();
  13591. }
  13592. };
  13593. PinFreezeManager.prototype._resizePinFreezeObjects=function(_bb9){
  13594. var _bba,_bbb;
  13595. var _bbc=this.m_oCV.getViewerWidget();
  13596. if(_bbc){
  13597. var size=_bbc.getWidgetSize();
  13598. _bbb=(size&&size.w&&(size.w<this.getInitialWidthThreshold()))?size.w:_bb9.getClientWidth();
  13599. _bba=(size&&size.h&&(size.h<this.getInitialHeightThreshold()))?size.h:_bb9.getClientHeight();
  13600. }else{
  13601. var _bbe=document.getElementById("RVContent"+this.m_viewerId);
  13602. var _bbf=document.getElementById("mainViewerTable"+this.m_viewerId);
  13603. _bbb=_bbe.clientWidth;
  13604. _bba=_bbf.clientHeight;
  13605. }
  13606. this.m_lastWidthProcessed=0;
  13607. this.m_lastHeightProcessed=0;
  13608. this.resize(_bbb,_bba);
  13609. };
  13610. PinFreezeManager.prototype.resize=function(_bc0,_bc1){
  13611. var _bc2=(Math.abs(_bc0-this.m_lastWidthProcessed)<this.c_resizeTweekLimit);
  13612. var _bc3=(Math.abs(_bc1-this.m_lastHeightProcessed)<this.c_resizeTweekLimit);
  13613. if(_bc2&&_bc3){
  13614. return;
  13615. }
  13616. var _bc4=(Math.abs(_bc0-this.m_lastWidthProcessed)>2)?_bc0:0;
  13617. var _bc5=(Math.abs(_bc1-this.m_lastHeightProcessed)>2)?_bc1:0;
  13618. for(var lid in this.m_frozenInfo){
  13619. if(!this.m_frozenInfo[lid].parentContainer){
  13620. this.resizeContainer(lid,_bc4,_bc5);
  13621. }
  13622. }
  13623. this.m_lastWidthProcessed=_bc0;
  13624. this.m_lastHeightProcessed=_bc1;
  13625. };
  13626. PinFreezeManager.prototype.resizeContainer=function(lid,_bc8,_bc9){
  13627. var _bca=this.m_frozenInfo[lid];
  13628. if(_bca){
  13629. var _bcb=null;
  13630. if(_bca.childContainers){
  13631. var _bcc=_bc8>10?_bc8-10:_bc8;
  13632. var _bcd=_bc9>10?_bc9-10:_bc9;
  13633. for(var _bce in _bca.childContainers){
  13634. _bcb=this.resizeContainer(_bce,_bcc,_bcd);
  13635. }
  13636. }
  13637. var _bcf=_bca.pinFreezeContainers;
  13638. var _bd0=null;
  13639. var _bd1=null;
  13640. if(_bcf){
  13641. for(var i=0;i<_bcf.length;i++){
  13642. _bd0=_bcf[i];
  13643. _bd0.resize(_bc8,_bc9,_bca.parentContainer,_bcb);
  13644. var _bd3=_bd0.getContainer();
  13645. if(_bd3&&(!_bd1||(_bd1.width<_bd3.clientWidth))){
  13646. _bd1={"width":_bd3.clientWidth,"lid":_bd0.m_lidNS};
  13647. }
  13648. }
  13649. }
  13650. return _bd1;
  13651. }
  13652. };
  13653. PinFreezeManager.prototype.processAutoResize=function(_bd4,_bd5){
  13654. this.m_lastWidthProcessed=_bd4;
  13655. this.m_lastHeightProcessed=_bd5;
  13656. };
  13657. PinFreezeManager.prototype.onSetVisible=function(){
  13658. this.refresh();
  13659. if(this.m_repaintOnVisible){
  13660. this.rePaint();
  13661. this.m_repaintOnVisible=false;
  13662. }
  13663. };
  13664. PinFreezeManager.prototype.onResizeCanvas=function(_bd6){
  13665. if(_bd6){
  13666. this.rePaint();
  13667. }else{
  13668. this.m_repaintOnVisible=true;
  13669. }
  13670. };
  13671. PinFreezeManager.prototype.rePaint=function(){
  13672. for(var lid in this.m_frozenInfo){
  13673. if(!this.m_frozenInfo[lid].parentContainer){
  13674. this.resizeContainer(lid,this.m_lastWidthProcessed,this.m_lastHeightProcessed);
  13675. }
  13676. }
  13677. };
  13678. PinFreezeManager.prototype.refresh=function(){
  13679. for(var _bd8 in this.m_frozenInfo){
  13680. var _bd9=this.m_frozenInfo[_bd8].pinFreezeContainers;
  13681. if(_bd9){
  13682. for(var i=0;i<_bd9.length;i++){
  13683. var _bdb=_bd9[i];
  13684. _bdb.synchScroll();
  13685. _bdb.synchVScroll();
  13686. }
  13687. }
  13688. }
  13689. };
  13690. PinFreezeManager.prototype.freezeContainerRowHeadings=function(lid){
  13691. return this.freezeContainer(lid,this.hasFrozenColumnHeadings(lid),true);
  13692. };
  13693. PinFreezeManager.prototype.freezeSelectedRowHeadings=function(){
  13694. var lid=this.getValidSelectedContainerId(false);
  13695. if(lid){
  13696. this.m_oCV.getSelectionController().resetSelections();
  13697. return this.freezeContainerRowHeadings(lid);
  13698. }
  13699. return null;
  13700. };
  13701. PinFreezeManager.prototype.canFreezeSelectedRowHeadings=function(){
  13702. var lid=this.getValidSelectedContainerId(false);
  13703. if(lid){
  13704. return (!this.hasFrozenRowHeadings(lid));
  13705. }
  13706. return false;
  13707. };
  13708. PinFreezeManager.prototype.unfreezeContainerRowHeadings=function(lid){
  13709. this.freezeContainer(lid,this.hasFrozenColumnHeadings(lid),false);
  13710. };
  13711. PinFreezeManager.prototype.unfreezeSelectedRowHeadings=function(){
  13712. var lid=this.getValidSelectedContainerId(false);
  13713. if(lid){
  13714. this.m_oCV.getSelectionController().resetSelections();
  13715. this.unfreezeContainerRowHeadings(lid);
  13716. }
  13717. };
  13718. PinFreezeManager.prototype.canUnfreezeSelectedRowHeadings=function(){
  13719. var lid=this.getValidSelectedContainerId(false);
  13720. if(lid){
  13721. return (this.hasFrozenRowHeadings(lid));
  13722. }
  13723. return false;
  13724. };
  13725. PinFreezeManager.prototype.freezeContainerColumnHeadings=function(lid){
  13726. return this.freezeContainer(lid,true,this.hasFrozenRowHeadings(lid));
  13727. };
  13728. PinFreezeManager.prototype.freezeSelectedColumnHeadings=function(){
  13729. var lid=this.getValidSelectedContainerId(true);
  13730. if(lid){
  13731. this.m_oCV.getSelectionController().resetSelections();
  13732. return this.freezeContainerColumnHeadings(lid);
  13733. }
  13734. return null;
  13735. };
  13736. PinFreezeManager.prototype.canFreezeSelectedColumnHeadings=function(){
  13737. var lid=this.getValidSelectedContainerId(true);
  13738. if(lid){
  13739. return (!this.hasFrozenColumnHeadings(lid));
  13740. }
  13741. return false;
  13742. };
  13743. PinFreezeManager.prototype.unfreezeContainerColumnHeadings=function(lid){
  13744. this.freezeContainer(lid,false,this.hasFrozenRowHeadings(lid));
  13745. };
  13746. PinFreezeManager.prototype.unfreezeSelectedColumnHeadings=function(){
  13747. var lid=this.getValidSelectedContainerId(true);
  13748. if(lid){
  13749. this.m_oCV.getSelectionController().resetSelections();
  13750. this.unfreezeContainerColumnHeadings(lid);
  13751. }
  13752. };
  13753. PinFreezeManager.prototype.canUnfreezeSelectedColumnHeadings=function(){
  13754. var lid=this.getValidSelectedContainerId(true);
  13755. if(lid){
  13756. return (this.hasFrozenColumnHeadings(lid));
  13757. }
  13758. return false;
  13759. };
  13760. PinFreezeManager.prototype.getValidSelectedContainerId=function(_be8){
  13761. var _be9=this.m_oCV.getSelectionController().getAllSelectedObjects();
  13762. if(_be9&&_be9.length&&(_be9[0].getDataContainerType()==="crosstab"||(_be8&&_be9[0].getDataContainerType()==="list"))){
  13763. var lid=(_be9[0].getLayoutElementId());
  13764. if(lid){
  13765. if(!this.hasPromptControlsInFreezableCells(lid)){
  13766. return this.removeNamespace(lid);
  13767. }
  13768. }
  13769. }
  13770. return null;
  13771. };
  13772. PinFreezeManager.prototype.hasPromptControlsInFreezableCells=function(lid){
  13773. var _bec=this.m_oCV.getLayoutElementFromLid(lid);
  13774. var _bed=getElementsByAttribute(_bec,["td","th"],"type","columnTitle");
  13775. var _bee=new RegExp("(^|[W])clsPromptComponent($|[W])");
  13776. var _bef=isIE()?"className":"class";
  13777. for(var j in _bed){
  13778. if(_bed.hasOwnProperty(j)){
  13779. var _bf1=getElementsByAttribute(_bed[j],"*",_bef,null,1,_bee);
  13780. if(_bf1.length>0){
  13781. return true;
  13782. }
  13783. }
  13784. }
  13785. return false;
  13786. };
  13787. PinFreezeManager.prototype.unfreeze=function(lid,_bf3,_bf4){
  13788. if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
  13789. var _bf5=this.m_frozenInfo[lid].pinFreezeContainers;
  13790. if(_bf5){
  13791. for(var i=0;i<_bf5.length;i++){
  13792. var _bf7=_bf5[i];
  13793. _bf7.unfreeze(_bf3);
  13794. }
  13795. if(_bf4){
  13796. this._resetFrozenInfo(lid);
  13797. }
  13798. }
  13799. }
  13800. };
  13801. PinFreezeManager.prototype.unfreezeAllNestedContainers=function(lid,_bf9){
  13802. var _bfa=this.m_frozenInfo[lid];
  13803. if(_bfa){
  13804. if(_bfa.freezeTop||_bfa.freezeSide){
  13805. this.unfreeze(lid,_bf9,false);
  13806. }
  13807. if(_bfa.childContainers){
  13808. for(var _bfb in _bfa.childContainers){
  13809. this.unfreezeAllNestedContainers(_bfb,_bf9);
  13810. }
  13811. }
  13812. }
  13813. };
  13814. PinFreezeManager.prototype.isNodeVisible=function(node){
  13815. var slid=PinFreezeContainer.nodeToSlid(node);
  13816. if(!slid){
  13817. return true;
  13818. }
  13819. var lid=this.removeNamespace(PinFreezeContainer.getLidFromSlid(slid));
  13820. var _bff=this.getContainer(lid);
  13821. if(!_bff){
  13822. return true;
  13823. }
  13824. var _c00=PinFreezeContainer.getSectionNameFromSlid(slid);
  13825. var _c01=_bff.getSection(_c00);
  13826. var _c02=null,_c03=null;
  13827. var _c04=node;
  13828. var _c05=null;
  13829. while(_c04&&_c04!==_c01&&!_c02&&!_c03){
  13830. _c02=_bff.getMain(_c04);
  13831. _c03=_bff.getCopy(_c04);
  13832. _c05=_c04;
  13833. _c04=_c04.parentNode;
  13834. }
  13835. var _c06=_c02?true:false;
  13836. var _c07=_c03?true:false;
  13837. if(_c06){
  13838. return _bff.getCopy(_c02)===_c05;
  13839. }else{
  13840. if(_c07){
  13841. return _bff.getCopy(_c05)?false:true;
  13842. }else{
  13843. return true;
  13844. }
  13845. }
  13846. };
  13847. PinFreezeManager.prototype.sectionStructureChange=function(){
  13848. var _c08=this.m_oCV.getViewerWidget();
  13849. if(_c08&&_c08.getAnnotationHelper()){
  13850. _c08.getAnnotationHelper().repositionCommentIndicators();
  13851. }
  13852. };
  13853. PinFreezeManager.prototype.deepCloneNode=function(_c09){
  13854. var copy=_c09.cloneNode(true);
  13855. var _c0b=this.m_oCV.getViewerWidget();
  13856. if(_c0b){
  13857. if(_c0b.reportContainsDijits()){
  13858. var _c0c=getElementsByAttribute(copy,"*","widgetid","*");
  13859. if(_c0c&&_c0c.length){
  13860. for(var i=0;i<_c0c.length;i++){
  13861. _c0c[i].parentNode.removeChild(_c0c[i]);
  13862. }
  13863. }
  13864. }
  13865. }
  13866. return copy;
  13867. };
  13868. PinFreezeManager.prototype.toJSONString=function(){
  13869. var _c0e="";
  13870. var _c0f="";
  13871. for(var _c10 in this.m_frozenInfo){
  13872. if(_c0e.length>0){
  13873. _c0e+=",";
  13874. }
  13875. var _c11=this.m_frozenInfo[_c10];
  13876. _c0e+="{";
  13877. _c0e+="\"lid\":\""+_c11.lid.replace("\"","\\\"")+"\",";
  13878. _c0e+="\"freezeTop\":"+_c11.freezeTop+",";
  13879. _c0e+="\"freezeSide\":"+_c11.freezeSide+",";
  13880. if(_c11.parentContainer){
  13881. _c0e+="\"parentContainer\":\""+_c11.parentContainer+"\",";
  13882. }
  13883. if(_c11.pinFreezeContainers&&_c11.pinFreezeContainers.length>0){
  13884. _c0e+="\"properties\":"+_c11.pinFreezeContainers[0].toJSONString()+",";
  13885. }
  13886. _c0e+="\"childContainers\": {";
  13887. if(_c11.childContainers){
  13888. var _c12=true;
  13889. for(var _c13 in _c11.childContainers){
  13890. if(!_c12){
  13891. _c0e+=",";
  13892. }
  13893. _c0e+="\""+_c13+"\":true";
  13894. _c12=false;
  13895. }
  13896. }
  13897. _c0e+="}}";
  13898. }
  13899. if(_c0e.length>0){
  13900. _c0f="{\"version\":1, \"containers\":["+_c0e+"]}";
  13901. }
  13902. return _c0f;
  13903. };
  13904. PinFreezeManager.prototype.fromJSONString=function(_c14){
  13905. if(!_c14||_c14.length===0){
  13906. return;
  13907. }
  13908. var _c15=null;
  13909. try{
  13910. _c15=eval("("+_c14+")");
  13911. }
  13912. catch(e){
  13913. if(typeof console!="undefined"){
  13914. console.log("PinFreezeManager.prototype.fromJSON could not parse JSON - "+_c14);
  13915. console.log(e);
  13916. }
  13917. }
  13918. if(!_c15){
  13919. return;
  13920. }
  13921. var _c16=_c15.containers;
  13922. var _c17=_c15.version;
  13923. if(_c16.length>0){
  13924. this.m_frozenInfo={};
  13925. }
  13926. for(var _c18=0;_c18<_c16.length;_c18++){
  13927. var _c19=_c16[_c18];
  13928. var lid=_c19.lid;
  13929. var _c1b=_c19.freezeTop;
  13930. var _c1c=_c19.freezeSide;
  13931. var _c1d=document.getElementById("CVReport"+this.m_viewerId);
  13932. var _c1e=getElementsByAttribute(_c1d,"table","lid",lid+this.m_viewerId);
  13933. var _c1f=[];
  13934. if(_c1e&&(_c1b||_c1c)){
  13935. for(var i=0;i<_c1e.length;i++){
  13936. var _c21=_c1e[i];
  13937. var _c22=new PinFreezeContainer(this,lid,this.m_viewerId,_c19.freezeTop,_c19.freezeSide,_c21,i);
  13938. if(_c19.properties){
  13939. applyJSONProperties(_c22,_c19.properties);
  13940. }
  13941. _c1f.push(_c22);
  13942. }
  13943. }
  13944. this.m_frozenInfo[lid]={"lid":lid,"freezeTop":_c1b,"freezeSide":_c1c,"pinFreezeContainers":_c1f,"initialLoad":true};
  13945. if(_c17>=1){
  13946. if(_c19.childContainers){
  13947. this.m_frozenInfo[lid].childContainers=_c19.childContainers;
  13948. }
  13949. if(_c19.parentContainer){
  13950. this.m_frozenInfo[lid].parentContainer=_c19.parentContainer;
  13951. }
  13952. }
  13953. }
  13954. };
  13955. PinFreezeManager.prototype.removeIdAttribute=function(_c23){
  13956. var _c24=_c23.getAttribute("id");
  13957. if(_c24!==null&&_c24!==""){
  13958. _c23.removeAttribute("id");
  13959. }
  13960. var _c25=getElementsByAttribute(_c23,"*","id","*");
  13961. if(_c25&&_c25.length){
  13962. for(var i=0;i<_c25.length;i++){
  13963. _c25[i].removeAttribute("id");
  13964. }
  13965. }
  13966. return _c23;
  13967. };
  13968. PinFreezeManager.prototype.isElementInMainOutput=function(_c27){
  13969. return PinFreezeContainer.isElementInMainOutput(_c27);
  13970. };
  13971. PinFreezeManager.prototype.isIWidgetMobile=function(){
  13972. return (this.m_oCV&&this.m_oCV.isIWidgetMobile());
  13973. };
  13974. PinFreezeManager.prototype.destroy=function(){
  13975. GUtil.destroyProperties(this);
  13976. };
  13977. dojo.provide("WidgetContextManager");
  13978. dojo.declare("WidgetContextManager",null,{PP_WIDGET_CONTEXT:"com.ibm.widget.context",PP_REPORT_PROMPT_CONTEXT:"com.ibm.widget.context.report.prompt",PP_REPORT_DRILL_CONTEXT:"com.ibm.widget.context.report.drill",PP_VALUES:"values",PP_RANGES:"ranges",PP_MULTIVALUED:"multivalued",PP_MODELITEM:"modelItem",PP_MODELINFO:"modelInfo",PP_PROMPT:"prompt",PP_DRILL:"drill",PP_SELECT_CHOICES:"selectChoices",PP_BUX_SELECTVALUECONTROL_CONTEXT:"com.ibm.widget.context.bux.selectValueControl",PP_BUX_SELECTION_CONTEXT:"com.ibm.widget.context.bux.selection",PP_CASCADEPROMPT_CLEAR:"clearCascadePromptParams",EVENT_NAME_PROMPT:"com.ibm.widget.contextChanged.prompt",EVENT_NAME_DRILL:"com.ibm.widget.contextChanged.drill",EVENT_NAME_SELECTVALUECONTROL:"com.ibm.widget.contextChanged.selectValueControl",DEFAULT_MODEL_PATH:".",m_widget:null,m_oWidgetContextContainer:null,m_oPromptContextContainer:null,m_oDrillContextContainer:null,m_oPromptGenericContext:null,m_oDrillGenericContext:null,m_oFilterGenericContext:null,m_oSelectionFilterContext:null,m_oContextCollection:null,m_oWidgetContextObject:null,m_oPromptContextObject:null,m_oDrillContextObject:null,m_aSelectionFilterObjects:null,constructor:function(_c28){
  13979. this.m_widget=_c28;
  13980. this.m_oWidgetContextContainer={};
  13981. this.m_oPromptContextContainer={};
  13982. this.m_oDrillContextContainer={};
  13983. this.m_oPromptGenericContext={};
  13984. this.m_oDrillGenericContext={};
  13985. this.m_oFilterGenericContext={};
  13986. this.m_oSelectionFilterContext={};
  13987. this.m_oContextCollection={};
  13988. this.m_oWidgetContextObject={};
  13989. this.m_oPromptContextObject={};
  13990. this.m_oDrillContextObject={};
  13991. this.m_aSelectionFilterObjects=null;
  13992. },getWidgetContextObject:function(){
  13993. var _c29={};
  13994. if(this.m_oWidgetContextContainer){
  13995. _c29[this.PP_WIDGET_CONTEXT]=this.m_oWidgetContextContainer;
  13996. if(this.m_widget){
  13997. _c29.clientId=this.m_widget.getWidgetId();
  13998. }
  13999. }
  14000. return _c29;
  14001. },getFilterFirstItemName:function(){
  14002. var _c2a=this.m_oFilterGenericContext;
  14003. if(_c2a){
  14004. var _c2b=(_c2a.values?_c2a.values:_c2a.ranges);
  14005. for(_c2c in _c2b){
  14006. return _c2c;
  14007. }
  14008. }
  14009. for(var _c2c in _c2a){
  14010. return _c2c;
  14011. }
  14012. return null;
  14013. },getItemNames:function(_c2d){
  14014. var _c2e=[];
  14015. var _c2f=_c2d[this.PP_WIDGET_CONTEXT];
  14016. if(_c2f){
  14017. var _c30=(_c2f.values?_c2f.values:_c2f.ranges);
  14018. for(var _c31 in _c30){
  14019. _c2e.push(_c31);
  14020. }
  14021. return _c2e;
  14022. }
  14023. for(var _c31 in _c2f){
  14024. _c2e.push(_c31);
  14025. }
  14026. return _c2e;
  14027. },raisePromptEvent:function(_c32,_c33,_c34,_c35,_c36){
  14028. var _c37=this._buildGeneralizedPromptPayload(_c32,_c33,_c34,_c35,_c36);
  14029. if(_c37){
  14030. this.m_widget.fireEvent(this.EVENT_NAME_PROMPT,null,_c37);
  14031. this._updatePromptContext(_c37);
  14032. this._updateWidgetContextContainer();
  14033. }
  14034. },_updatePromptContext:function(_c38){
  14035. this._updatePromptGenericContext(_c38);
  14036. this._updatePromptContextContainer(_c38);
  14037. },_resetWorkingMembers:function(){
  14038. this.m_oWidgetContextObject={};
  14039. this.m_oPromptContextObject={};
  14040. this.m_oDrillContextObject={};
  14041. },updateFilterContext:function(_c39){
  14042. this.m_oFilterGenericContext=_c39[this.PP_WIDGET_CONTEXT];
  14043. this._updateWidgetContextContainer();
  14044. },getSelectValueControlTypeFromPayload:function(_c3a){
  14045. var _c3b=_c3a[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
  14046. if(_c3b&&_c3b["selectValueControl"]){
  14047. return _c3b["selectValueControl"]["controlType"];
  14048. }
  14049. return null;
  14050. },getSelectValuePropertyFromPayload:function(_c3c,_c3d){
  14051. var _c3e=_c3c[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
  14052. if(_c3e&&_c3e["selectValueControl"]){
  14053. return _c3e["selectValueControl"][_c3d];
  14054. }
  14055. return null;
  14056. },_updateWidgetContextContainer:function(){
  14057. this.m_oWidgetContextContainer={};
  14058. var _c3f=null;
  14059. if(this.m_oDrillGenericContext[this.PP_VALUES]){
  14060. _c3f=dojo.mixin(_c3f,this.m_oDrillGenericContext[this.PP_VALUES]);
  14061. }
  14062. if(this.m_oPromptGenericContext[this.PP_VALUES]){
  14063. _c3f=dojo.mixin(_c3f,this.m_oPromptGenericContext[this.PP_VALUES]);
  14064. }
  14065. if(this.m_oFilterGenericContext[this.PP_VALUES]){
  14066. _c3f=dojo.mixin(_c3f,this.m_oFilterGenericContext[this.PP_VALUES]);
  14067. }
  14068. if(this.m_oSelectionFilterContext[this.PP_VALUES]){
  14069. _c3f=dojo.mixin(_c3f,this.m_oSelectionFilterContext[this.PP_VALUES]);
  14070. }
  14071. if(_c3f){
  14072. this.m_oWidgetContextContainer[this.PP_VALUES]=_c3f;
  14073. }
  14074. var _c40=null;
  14075. if(this.m_oPromptGenericContext[this.PP_RANGES]){
  14076. _c40=dojo.mixin(_c40,this.m_oPromptGenericContext[this.PP_RANGES]);
  14077. }
  14078. if(this.m_oFilterGenericContext[this.PP_RANGES]){
  14079. _c40=dojo.mixin(_c40,this.m_oFilterGenericContext[this.PP_RANGES]);
  14080. }
  14081. if(_c40){
  14082. this.m_oWidgetContextContainer[this.PP_RANGES]=_c40;
  14083. }
  14084. },_updatePromptGenericContext:function(_c41){
  14085. if(_c41[this.PP_WIDGET_CONTEXT]){
  14086. this.m_oPromptGenericContext=_c41[this.PP_WIDGET_CONTEXT];
  14087. }
  14088. },_updatePromptContextContainer:function(_c42){
  14089. if(_c42[this.PP_REPORT_PROMPT_CONTEXT]&&_c42[this.PP_REPORT_PROMPT_CONTEXT][this.PP_PROMPT]){
  14090. this.m_oPromptContextContainer=_c42[this.PP_REPORT_PROMPT_CONTEXT][this.PP_PROMPT];
  14091. }
  14092. },_buildGeneralizedPromptPayload:function(_c43,_c44,_c45,_c46,_c47){
  14093. var _c48=null;
  14094. this._resetWorkingMembers();
  14095. var _c49=this._buildContextsFromPrompt(_c43,_c44);
  14096. if(_c49){
  14097. _c48={};
  14098. _c48[this.PP_WIDGET_CONTEXT]=this.m_oWidgetContextObject;
  14099. var _c4a={};
  14100. _c4a[_c46]=this.m_oPromptContextObject;
  14101. _c48[this.PP_REPORT_PROMPT_CONTEXT]={"prompt":{"id":this.m_widget.iContext.widgetId,"action":_c45,"itemSpecification":_c4a}};
  14102. _c48[this.PP_CASCADEPROMPT_CLEAR]=_c47;
  14103. }
  14104. return _c48;
  14105. },_getReportParameterNodes:function(_c4b){
  14106. var _c4c=XMLBuilderLoadXMLFromString(_c4b);
  14107. if(!_c4c){
  14108. return null;
  14109. }
  14110. var _c4d=_c4c.firstChild;
  14111. if(!_c4d){
  14112. return null;
  14113. }
  14114. var _c4e=XMLHelper_FindChildByTagName(_c4d,"reportParameters",true);
  14115. if(!_c4e){
  14116. return null;
  14117. }
  14118. var _c4f=XMLHelper_FindChildrenByTagName(_c4e,"reportParameter",false);
  14119. if(!_c4f){
  14120. return null;
  14121. }
  14122. return _c4f;
  14123. },_getSelectChoicesXMLString:function(_c50,_c51){
  14124. var _c52=null;
  14125. var _c53="p_"+_c50;
  14126. if(_c51.get(_c53)){
  14127. _c52=_c51.get(_c53);
  14128. }
  14129. return _c52;
  14130. },_getSelectChoicesNode:function(_c54){
  14131. var _c55=null;
  14132. if(_c54){
  14133. var _c56=XMLBuilderLoadXMLFromString(_c54,true);
  14134. if(_c56&&_c56.firstChild){
  14135. _c55=_c56.firstChild;
  14136. }
  14137. }
  14138. return _c55;
  14139. },_buildContextsFromPrompt:function(_c57,_c58){
  14140. var _c59=this._getReportParameterNodes(_c57);
  14141. if(_c59===null){
  14142. return false;
  14143. }
  14144. for(var i in _c59){
  14145. var _c5b=_c59[i];
  14146. var _c5c=_c5b.getAttribute("parameterName");
  14147. var _c5d=this._getSelectChoicesXMLString(_c5c,_c58);
  14148. var _c5e=this._getSelectChoicesNode(_c5d);
  14149. if(_c5e){
  14150. var _c5f,_c60,_c61;
  14151. if(!this._isPromptRangeType(_c5d)){
  14152. var _c62=this._buildReportContextValuesFromPromptSelectOption(_c5e);
  14153. _c5f=this._createPromptDetailObject(_c5d,_c5b.getAttribute("modelItem"),_c5b.getAttribute("multivalued"),_c62);
  14154. _c60=this._buildValuesArrayFromReportContextValueArray(_c62);
  14155. _c61=this.PP_VALUES;
  14156. }else{
  14157. _c60=this._buildMinMaxArrayFromRangePrompt(_c5e);
  14158. _c5f=this._createPromptDetailObject(_c5d,_c5b.getAttribute("modelItem"),_c5b.getAttribute("multivalued"),_c60);
  14159. _c61=this.PP_RANGES;
  14160. }
  14161. this.m_oPromptContextObject[_c5c]=_c5f;
  14162. if(!this.m_oWidgetContextObject[_c61]){
  14163. this.m_oWidgetContextObject[_c61]={};
  14164. }
  14165. this.m_oWidgetContextObject[_c61][_c5c]=_c60;
  14166. }
  14167. }
  14168. return true;
  14169. },_createPromptDetailObject:function(_c63,_c64,_c65,_c66){
  14170. var _c67={};
  14171. _c67[this.PP_SELECT_CHOICES]=_c63;
  14172. if(_c64!==null){
  14173. _c67[this.PP_MODELITEM]=_c64;
  14174. }
  14175. if(_c65!==null){
  14176. _c67[this.PP_MULTIVALUED]=true;
  14177. }
  14178. _c67[this.PP_VALUES]=_c66;
  14179. return _c67;
  14180. },_isPromptRangeType:function(_c68){
  14181. var _c69=new RegExp(/^<selectChoices><select[\s\S]*Range/);
  14182. return _c69.test(_c68);
  14183. },_buildReportContextValuesFromPromptSelectOption:function(_c6a){
  14184. var _c6b=[];
  14185. if(_c6a){
  14186. var _c6c=dojo.query("selectOption[displayValue]",_c6a);
  14187. if(_c6c.length>0){
  14188. for(var i=0;i<_c6c.length;i++){
  14189. var _c6e=_c6c[i].getAttribute("displayValue");
  14190. var _c6f=_c6c[i].getAttribute("useValue");
  14191. var _c70={"caption":_c6e,"use":_c6f};
  14192. _c6b.push(_c70);
  14193. }
  14194. }
  14195. }
  14196. return _c6b;
  14197. },_buildValuesArrayFromReportContextValueArray:function(_c71){
  14198. var _c72=[];
  14199. if(_c71&&_c71.length>0){
  14200. for(var i=0;i<_c71.length;i++){
  14201. var _c74=_c71[i].caption;
  14202. if(_c74){
  14203. _c72.push(_c74);
  14204. }
  14205. }
  14206. }
  14207. return _c72;
  14208. },_buildMinMaxArrayFromRangePrompt:function(_c75){
  14209. var _c76=[];
  14210. if(_c75&&_c75.childNodes&&_c75.childNodes.length>0){
  14211. var _c77=_c75.childNodes.length;
  14212. for(var i=0;i<_c77;i++){
  14213. var _c79=this._buildMinMaxFromSelectAnyRange(_c75.childNodes[i]);
  14214. if(_c79){
  14215. _c76.push(_c79);
  14216. }
  14217. }
  14218. }
  14219. return _c76;
  14220. },_buildMinMaxFromSelectAnyRange:function(_c7a){
  14221. var _c7b=null;
  14222. if(_c7a){
  14223. var _c7c=dojo.query("[displayValue]",_c7a);
  14224. if(_c7c.length>0){
  14225. _c7b={};
  14226. for(var i=0;i<_c7c.length;i++){
  14227. var node=_c7c[i];
  14228. var _c7f=(node.nodeName==="start")?"min":"max";
  14229. _c7b[_c7f]=node.getAttribute("useValue");
  14230. _c7b[_c7f+"Display"]=node.getAttribute("displayValue");
  14231. }
  14232. }
  14233. }
  14234. return _c7b;
  14235. },handleIncomingPromptEvent:function(evt){
  14236. if(!evt||!evt.payload){
  14237. return;
  14238. }
  14239. var _c81=this._convertToLegacyPromptPayload(evt.payload);
  14240. if(_c81){
  14241. var _c82={"payload":_c81};
  14242. this.m_widget.onPromptLegacyPayload(_c82);
  14243. }
  14244. },_convertToLegacyPromptPayload:function(_c83){
  14245. var _c84=null;
  14246. var _c85=_c83[this.PP_REPORT_PROMPT_CONTEXT];
  14247. if(_c85&&_c85.prompt){
  14248. _c85=_c85.prompt;
  14249. _c84={};
  14250. _c84.cv_id=_c85.id;
  14251. _c84.parameters=this._genLegacyPromptParameterArrayFromItemSpec(_c85.itemSpecification);
  14252. _c84.clearCascadePromptParams=_c83[this.PP_CASCADEPROMPT_CLEAR];
  14253. }else{
  14254. if(_c83[this.PP_WIDGET_CONTEXT]&&_c83[this.PP_WIDGET_CONTEXT].values){
  14255. _c84={};
  14256. _c84.parameters=[];
  14257. var _c86=_c83[this.PP_WIDGET_CONTEXT].values;
  14258. for(var _c87 in _c86){
  14259. var _c88=_c86[_c87];
  14260. if(_c88&&_c88.length>0){
  14261. if(_c88.length==1&&_c88[0].indexOf("<selectChoices>")===0){
  14262. _c84.parameters.push({"parmName":_c87,"parmValue":_c88[0]});
  14263. }else{
  14264. var _c89="<selectChoices>";
  14265. for(var i=0;i<_c88.length;i++){
  14266. _c89+="<selectOption useValue=\""+_c88[i]+"\" displayValue=\""+_c88[i]+"\"/>";
  14267. }
  14268. _c89+="</selectChoices>";
  14269. _c84.parameters.push({"parmName":_c87,"parmValue":_c89});
  14270. }
  14271. }
  14272. }
  14273. _c84.clearCascadePromptParams=_c83[this.PP_CASCADEPROMPT_CLEAR];
  14274. }
  14275. }
  14276. return _c84;
  14277. },_genLegacyPromptParameterArrayFromItemSpec:function(_c8b){
  14278. if(!_c8b){
  14279. return null;
  14280. }
  14281. var _c8c=this._getFirstPropertyOfObject(_c8b);
  14282. var _c8d=[];
  14283. for(var _c8e in _c8c){
  14284. var _c8f=_c8c[_c8e];
  14285. var _c90={parmName:_c8e,parmValue:_c8f[this.PP_SELECT_CHOICES],modelItem:_c8f[this.PP_MODELITEM]};
  14286. if(_c8f[this.PP_MULTIVALUES]!==null){
  14287. _c90.multivalued=true;
  14288. }
  14289. _c8d.push(_c90);
  14290. }
  14291. return _c8d;
  14292. },_isRangeTypeValues:function(_c91){
  14293. if(_c91){
  14294. if(_c91.min||_c91.max){
  14295. return true;
  14296. }
  14297. }
  14298. return false;
  14299. },_getFirstPropertyOfObject:function(_c92){
  14300. var _c93=null;
  14301. for(var _c94 in _c92){
  14302. _c93=_c92[_c94];
  14303. break;
  14304. }
  14305. return _c93;
  14306. },_getFirstPropertyNameOfObject:function(_c95){
  14307. var _c96=null;
  14308. for(var _c97 in _c95){
  14309. _c96=_c97;
  14310. break;
  14311. }
  14312. return _c96;
  14313. },extractWidgetContextObject:function(_c98){
  14314. if(_c98){
  14315. var _c99=_c98[this.PP_WIDGET_CONTEXT];
  14316. if(_c99){
  14317. var obj={};
  14318. obj[this.PP_WIDGET_CONTEXT]=_c99;
  14319. return obj;
  14320. }
  14321. }
  14322. return null;
  14323. },genMergedWidgetContextObject:function(){
  14324. var _c9b=null;
  14325. var _c9c=null;
  14326. for(var key in this.m_oContextCollection){
  14327. var _c9e=this.m_oContextCollection[key];
  14328. if(_c9e){
  14329. var _c9f=_c9e[this.PP_WIDGET_CONTEXT];
  14330. if(_c9f){
  14331. if(_c9f[this.PP_VALUES]){
  14332. _c9b=dojo.mixin(_c9b,_c9f[this.PP_VALUES]);
  14333. }
  14334. if(_c9f[this.PP_RANGES]){
  14335. _c9c=dojo.mixin(_c9c,this._convertRangeArrayToObjectForActiveReport(_c9f[this.PP_RANGES]));
  14336. }
  14337. }
  14338. }
  14339. }
  14340. if(_c9b||_c9c){
  14341. var obj={};
  14342. obj[this.PP_WIDGET_CONTEXT]={};
  14343. if(_c9b){
  14344. obj[this.PP_WIDGET_CONTEXT][this.PP_VALUES]=_c9b;
  14345. }
  14346. if(_c9c){
  14347. obj[this.PP_WIDGET_CONTEXT][this.PP_RANGES]=_c9c;
  14348. }
  14349. return obj;
  14350. }
  14351. return null;
  14352. },raiseDrillEvent:function(_ca1,_ca2,_ca3){
  14353. var _ca4=this._buildGeneralizedDrillPayload(_ca1,_ca2,_ca3);
  14354. if(_ca4){
  14355. this.m_widget.fireEvent(this.EVENT_NAME_DRILL,null,_ca4);
  14356. this._updateDrillContext(_ca4);
  14357. this._updateWidgetContextContainer();
  14358. }
  14359. },_updateDrillContext:function(_ca5){
  14360. this._updateDrillGenericContext(_ca5);
  14361. this._updateDrillContextContainer(_ca5);
  14362. },_updateDrillGenericContext:function(_ca6){
  14363. if(_ca6[this.PP_WIDGET_CONTEXT]){
  14364. this.m_oDrillGenericContext=_ca6[this.PP_WIDGET_CONTEXT];
  14365. }
  14366. },_updateDrillContextContainer:function(_ca7){
  14367. if(_ca7[this.PP_REPORT_DRILL_CONTEXT]&&_ca7[this.PP_REPORT_DRILL_CONTEXT][this.PP_DRILL]){
  14368. this.m_oDrillContextContainer=_ca7[this.PP_REPORT_DRILL_CONTEXT][this.PP_DRILL];
  14369. }
  14370. },_buildGeneralizedDrillPayload:function(_ca8,_ca9,_caa){
  14371. if(!_ca8||!_ca9){
  14372. return null;
  14373. }
  14374. var _cab={};
  14375. var _cac={};
  14376. for(var i in _ca8){
  14377. var _cae=_ca8[i];
  14378. var mun=(_cae.mun)?_cae.mun:"";
  14379. var lun=(_cae.lun)?_cae.lun:"";
  14380. var hun=(_cae.hun)?_cae.hun:"";
  14381. var _cb2={};
  14382. _cb2[this.PP_VALUES]=[{"caption":_cae.displayValue,"mun":mun,"lun":lun,"hun":hun}];
  14383. if(_cae.summary){
  14384. _cb2["summary"]=_cae.summary;
  14385. }
  14386. _cab[_cae.dataItem]=_cb2;
  14387. _cac[_cae.dataItem]=[_cae.displayValue];
  14388. }
  14389. var _cb3={};
  14390. _cb3[this.PP_VALUES]=_cac;
  14391. var _cb4={};
  14392. _cb4[_caa]=_cab;
  14393. var _cb5={};
  14394. _cb5[_ca9]={"id":this.m_widget.iContext.widgetId,"action":_ca9,"itemSpecification":_cb4};
  14395. var _cb6={};
  14396. _cb6[this.PP_WIDGET_CONTEXT]=_cb3;
  14397. _cb6[this.PP_REPORT_DRILL_CONTEXT]=_cb5;
  14398. return _cb6;
  14399. },genDrillSpecObjects:function(_cb7){
  14400. if(!_cb7||!_cb7[this.PP_REPORT_DRILL_CONTEXT]){
  14401. return null;
  14402. }
  14403. var _cb8=[];
  14404. var _cb9=_cb7[this.PP_REPORT_DRILL_CONTEXT];
  14405. var _cba=this._getFirstPropertyOfObject(_cb9);
  14406. var _cbb=this._getFirstPropertyOfObject(_cba.itemSpecification);
  14407. for(var _cbc in _cbb){
  14408. var _cbd=_cbb[_cbc];
  14409. var _cbe=_cbd[this.PP_VALUES];
  14410. if(_cbe&&_cbe.length>0){
  14411. var _cbf=_cbe[0];
  14412. var _cc0={"dataItem":_cbc,"displayValue":_cbf.caption,"mun":_cbf.mun,"lun":_cbf.lun,"hun":_cbf.hun};
  14413. if(_cbf.summary){
  14414. _cc0["summary"]=_cbf.summary;
  14415. }
  14416. _cb8.push(_cc0);
  14417. }
  14418. }
  14419. return (_cb8.length>0)?_cb8:null;
  14420. },getDrillActionType:function(_cc1){
  14421. if(!_cc1||!_cc1[this.PP_REPORT_DRILL_CONTEXT]){
  14422. return null;
  14423. }
  14424. return this._getFirstPropertyNameOfObject(_cc1[this.PP_REPORT_DRILL_CONTEXT]);
  14425. },_convertRangeArrayToObjectForActiveReport:function(_cc2){
  14426. if(_cc2){
  14427. var _cc3={};
  14428. for(var name in _cc2){
  14429. var _cc5=_cc2[name];
  14430. if(_cc5&&_cc5.length>0){
  14431. _cc3[name]=_cc5[0];
  14432. }else{
  14433. _cc3[name]=_cc5;
  14434. }
  14435. }
  14436. return _cc3;
  14437. }
  14438. return _cc2;
  14439. },getItemsInItemSpecification:function(_cc6){
  14440. var _cc7=_cc6[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
  14441. if(_cc7&&_cc7["selectValueControl"]&&_cc7["selectValueControl"]["itemSpecification"]){
  14442. return this._getFirstPropertyOfObject(_cc7["selectValueControl"]["itemSpecification"]);
  14443. }
  14444. return null;
  14445. },genRemoveDiscreteFilterPayload:function(_cc8){
  14446. var _cc9={"clientId":_cc8,"com.ibm.widget.context":{},"com.ibm.widget.context.bux.selectValueControl":{"selectValueControl":{"id":_cc8,"controlType":"selectValueFilter","type":"discrete","valueType":"string"}}};
  14447. return _cc9;
  14448. },genEmptySelectionPayload:function(oCV,_ccb){
  14449. var obj={"clientId":_ccb,"com.ibm.widget.context":{},"com.ibm.widget.context.bux.selection":{"selection":{"id":_ccb,"valueType":"string"}}};
  14450. this.m_oSelectionFilterContext={};
  14451. this._updateWidgetContextContainer();
  14452. this.setSelectionFilterObjects(null);
  14453. return obj;
  14454. },genSelectionPayload:function(oCV,_cce,_ccf){
  14455. var _cd0={};
  14456. var _cd1={"id":_cce,"valueType":"string"};
  14457. var obj={"clientId":_cce,"com.ibm.widget.context":_cd0,"com.ibm.widget.context.bux.selection":{"selection":_cd1}};
  14458. var _cd3=false;
  14459. var _cd4=[];
  14460. var oSC=oCV.getSelectionController();
  14461. var _cd6=oSC.getAllSelectedObjects();
  14462. if(_cd6&&_cd6.length>0){
  14463. var _cd7={};
  14464. var _cd8=null;
  14465. var _cd9={};
  14466. var _cda={};
  14467. for(var i=0;i<_cd6.length;i++){
  14468. if(_cd6[i].populateSelectionPayload(_cd9,_cda,_ccf)){
  14469. _cd3=true;
  14470. _cd8=_cd6[i].getCtxAttributeString();
  14471. if(typeof _cd7[_cd8]=="undefined"){
  14472. _cd7[_cd8]=true;
  14473. _cd4.push(_cd6[i].marshal(oSC,oCV.getId()));
  14474. }
  14475. }
  14476. }
  14477. if(_cd3){
  14478. _cd0.values=_cd9;
  14479. var _cdc={};
  14480. var _cdd=oCV.getModelPath();
  14481. var _cde=(_cdd)?_cdd:".";
  14482. _cdc[_cde]=_cda;
  14483. _cd1.itemSpecification=_cdc;
  14484. }
  14485. }
  14486. this.m_oSelectionFilterContext=obj[this.PP_WIDGET_CONTEXT];
  14487. this._updateWidgetContextContainer();
  14488. this.setSelectionFilterObjects(_cd4.length>0?_cd4:null);
  14489. return obj;
  14490. },isSelectionPayloadForReset:function(obj){
  14491. if(obj&&obj[this.PP_WIDGET_CONTEXT]){
  14492. return this.isEmptyObject(obj[this.PP_WIDGET_CONTEXT]);
  14493. }
  14494. return true;
  14495. },setSelectionFilterObjects:function(_ce0){
  14496. this.m_aSelectionFilterObjects=_ce0;
  14497. },getSelectionFilterObjects:function(){
  14498. return this.m_aSelectionFilterObjects;
  14499. },toStringSelectionFilterObjects:function(){
  14500. var str="";
  14501. for(var idx in this.m_aSelectionFilterObjects){
  14502. if(str.length>0){
  14503. str+=",";
  14504. }
  14505. str+=JSON.stringify(this.m_aSelectionFilterObjects[idx]);
  14506. }
  14507. return "["+str+"]";
  14508. },convertSelectionToSelectValueControlPayload:function(_ce3){
  14509. if(_ce3["com.ibm.widget.context.bux.selection"]){
  14510. var _ce4=_ce3["com.ibm.widget.context.bux.selection"]["selection"];
  14511. _ce4.controlType="selectValueFilter";
  14512. _ce4.type="discrete";
  14513. _ce3["com.ibm.widget.context.bux.selectValueControl"]={"selectValueControl":_ce4};
  14514. delete _ce3["com.ibm.widget.context.bux.selection"];
  14515. }
  14516. return _ce3;
  14517. },convertGenericToSelectValueControlPayload:function(_ce5){
  14518. if(this._hasItemSpecification(_ce5)){
  14519. return;
  14520. }
  14521. if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
  14522. var _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
  14523. for(dataItem in _ce6){
  14524. if(_ce6[dataItem].length==0){
  14525. delete _ce6[dataItem];
  14526. }
  14527. }
  14528. var _ce7=true;
  14529. for(dataItem in _ce6){
  14530. _ce7=false;
  14531. break;
  14532. }
  14533. if(_ce7){
  14534. delete _ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
  14535. }
  14536. }
  14537. if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES]){
  14538. var _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
  14539. var _ce7=true;
  14540. for(dataItem in _ce6){
  14541. _ce7=false;
  14542. break;
  14543. }
  14544. if(_ce7){
  14545. delete _ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
  14546. }
  14547. }
  14548. var _ce6=null;
  14549. if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
  14550. key=this.PP_VALUES;
  14551. _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
  14552. }else{
  14553. key=this.PP_RANGES;
  14554. _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
  14555. }
  14556. var cv=this.m_widget.getViewerObject();
  14557. var _ce9=null;
  14558. if(cv){
  14559. var sc=cv.getSelectionController();
  14560. _ce9=sc.getCCDManager();
  14561. }
  14562. for(dataItem in _ce6){
  14563. var _ceb=true;
  14564. var _cec={};
  14565. for(var _ced in _ce6){
  14566. var _cee=[];
  14567. for(var i=0;i<_ce6[_ced].length;i++){
  14568. var _cf0=_ce6[_ced][i];
  14569. var _cf1={"caption":_cf0};
  14570. if(_ceb){
  14571. var mun=_ce9?_ce9.getMUNForRDIAndUseValue(_ced,_cf0):null;
  14572. if(mun!=null){
  14573. _cf1.mun=mun;
  14574. }else{
  14575. _ceb=false;
  14576. for(var i=0;i<_cee.length;i++){
  14577. delete _cee[i].mun;
  14578. }
  14579. }
  14580. }
  14581. _cee.push(_cf1);
  14582. }
  14583. _cec[_ced]={"values":_cee};
  14584. }
  14585. var _cf3={};
  14586. var _cf4=cv?cv.getModelPath():null;
  14587. var _cf5=(_cf4)?_cf4:"unknown";
  14588. _cf3[_cf5]=_cec;
  14589. _ce5[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]={"selectValueControl":{"valueType":"string","type":"discrete","controlType":"selectValueFilter","id":_ce5.clientId?_ce5.clientId:"","itemSpecification":_cf3}};
  14590. }
  14591. },getMUNOfItemValueInItemSpecification:function(_cf6,_cf7){
  14592. var _cf8=this.getItemsInItemSpecification(_cf6);
  14593. if(_cf8&&_cf8[_cf7]){
  14594. var _cf9=_cf8[_cf7];
  14595. if(_cf9.values&&_cf9.values.length>0){
  14596. return _cf9.values[0].mun;
  14597. }
  14598. }
  14599. return null;
  14600. },_hasItemSpecification:function(_cfa){
  14601. if(_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]&&_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]&&_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["itemSpecification"]){
  14602. return true;
  14603. }
  14604. if(_cfa[this.PP_BUX_SELECTION_CONTEXT]&&_cfa[this.PP_BUX_SELECTION_CONTEXT]["selection"]&&_cfa[this.PP_BUX_SELECTION_CONTEXT]["selection"]["itemSpecification"]){
  14605. return true;
  14606. }
  14607. return false;
  14608. },getSourceUniqueId:function(_cfb,_cfc){
  14609. var id=null;
  14610. var _cfe=null;
  14611. if(_cfb["clientId"]){
  14612. id=_cfb["clientId"];
  14613. }
  14614. if(_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]){
  14615. _cfe="selectValueControl";
  14616. if(!id&&_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]&&_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["id"]){
  14617. id=_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["id"];
  14618. }
  14619. }else{
  14620. if(_cfb[this.PP_BUX_SELECTION_CONTEXT]){
  14621. _cfe="selection";
  14622. if(!id&&_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]&&_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]["id"]){
  14623. id=_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]["id"];
  14624. }
  14625. }else{
  14626. if(_cfb[this.PP_REPORT_PROMPT_CONTEXT]){
  14627. _cfe="prompt";
  14628. if(!id&&_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]&&_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]["id"]){
  14629. id=_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]["id"];
  14630. }
  14631. }else{
  14632. if(_cfb[this.PP_REPORT_DRILL_CONTEXT]){
  14633. _cfe="drill";
  14634. if(!id&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]["id"]){
  14635. id=_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]["id"];
  14636. }
  14637. }else{
  14638. if(_cfb[this.PP_REPORT_DRILL_CONTEXT]){
  14639. _cfe="drill";
  14640. if(!id&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]["id"]){
  14641. id=_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]["id"];
  14642. }
  14643. }
  14644. }
  14645. }
  14646. }
  14647. }
  14648. if(!id){
  14649. id="unknown";
  14650. }
  14651. if(!_cfe){
  14652. _cfe="unknown";
  14653. }
  14654. if(typeof _cfc=="string"){
  14655. _cfe=_cfc;
  14656. }
  14657. return id+"_"+_cfe;
  14658. },isWidgetContextEmpty:function(_cff){
  14659. return (this.isEmptyObject(_cff[this.PP_WIDGET_CONTEXT])||(this.isEmptyObject(_cff[this.PP_WIDGET_CONTEXT][this.PP_VALUES])&&this.isEmptyObject(_cff[this.PP_WIDGET_CONTEXT][this.PP_RANGES])));
  14660. },isEmptyObject:function(obj){
  14661. var _d01=true;
  14662. if(obj){
  14663. for(var _d02 in obj){
  14664. _d01=false;
  14665. break;
  14666. }
  14667. }
  14668. return _d01;
  14669. },updateContextCollection:function(_d03){
  14670. if(!this.isEmptyObject(_d03)){
  14671. var _d04=this.getSourceUniqueId(_d03);
  14672. if(this.isWidgetContextEmpty(_d03)){
  14673. if(this.m_oContextCollection[_d04]){
  14674. this.setEmptyArrayToWidgetContextValues(this.m_oContextCollection[_d04]);
  14675. }else{
  14676. var _d05=this.getSourceUniqueId(_d03,"unknown");
  14677. if(this.m_oContextCollection[_d05]){
  14678. this.setEmptyArrayToWidgetContextValues(this.m_oContextCollection[_d05]);
  14679. }
  14680. }
  14681. }else{
  14682. if(_d03[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
  14683. for(var name in _d03[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
  14684. for(var key in this.m_oContextCollection){
  14685. var _d08=this.m_oContextCollection[key];
  14686. if(_d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES]&&_d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES][name]){
  14687. delete _d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES][name];
  14688. }
  14689. }
  14690. }
  14691. }
  14692. this.m_oContextCollection[_d04]=dojo.clone(_d03);
  14693. }
  14694. return this.m_oContextCollection;
  14695. }
  14696. },setEmptyArrayToWidgetContextValues:function(_d09){
  14697. if(_d09&&_d09[this.PP_WIDGET_CONTEXT]&&_d09[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
  14698. var _d0a=_d09[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
  14699. for(var name in _d0a){
  14700. _d0a[name]=[];
  14701. }
  14702. }
  14703. }});
  14704. dojo.provide("viewer.AnnotationHelper");
  14705. dojo.declare("viewer.AnnotationHelper",null,{m_loadAnnotationsDfd:null,m_bCallGetAnnotations:true,m_bAnnotationsEnabled:null,constructor:function(_d0c){
  14706. this.m_viewerIWidget=_d0c;
  14707. this.m_bCallGetAnnotations=true;
  14708. this.m_bAnnotationsEnabled=null;
  14709. },getAnnotationStore:function(){
  14710. return this.m_viewerIWidget.getAnnotationStore();
  14711. },setCallGetAnnotations:function(flag){
  14712. this.m_bCallGetAnnotations=flag;
  14713. },isEnabled:function(){
  14714. if(this.m_bAnnotationsEnabled===null){
  14715. this.m_bAnnotationsEnabled=this.m_viewerIWidget.getViewerObject().bBuxAnnotationsAvailable;
  14716. }
  14717. return this.m_bAnnotationsEnabled;
  14718. },refreshAnnotationData:function(){
  14719. if(this.m_loadAnnotationsDfd){
  14720. return null;
  14721. }
  14722. this.m_loadAnnotationsDfd=new dojo.Deferred();
  14723. this.fetchAnnotationData();
  14724. return this.m_loadAnnotationsDfd;
  14725. },fetchAnnotationData:function(){
  14726. var _d0e=this.m_viewerIWidget;
  14727. if(!this.m_bCallGetAnnotations||!this.isEnabled()){
  14728. return;
  14729. }
  14730. dojo.when(_d0e.getWidgetStoreID(),dojo.hitch(this,function(_d0f){
  14731. if(!_d0f){
  14732. return;
  14733. }
  14734. this.m_viewerIWidget.getLoadManager().runWhenHasViewer(dojo.hitch(this,this._fetchAnnotationData,_d0f));
  14735. }));
  14736. },_fetchAnnotationData:function(_d10){
  14737. var _d11=this.m_viewerIWidget.getViewerObject();
  14738. var _d12=_d11.getSelectionController();
  14739. var _d13=_d12.getCCDManager().m_md;
  14740. if(!_d13){
  14741. _d13={};
  14742. }
  14743. _d13=dojo.toJson(_d13);
  14744. var _d14=_d12.getCCDManager().m_cd;
  14745. if(!_d14){
  14746. _d14={};
  14747. }
  14748. _d14=dojo.toJson(_d14);
  14749. var _d15={"complete":{},"fault":{}};
  14750. _d15.complete["object"]=this;
  14751. _d15.complete["method"]=this.fetchAnnotationDataResponse;
  14752. _d15.fault["object"]=this;
  14753. _d15.fault["method"]=this.fetchAnnotationDataResponseFault;
  14754. var _d16=new AsynchJSONDispatcherEntry(_d11);
  14755. _d16.setCallbacks(_d15);
  14756. _d16.addFormField("widgetStoreID",_d10);
  14757. _d16.addFormField("ui.action","getAnnotations");
  14758. _d16.addFormField("cv.metatdata",_d13);
  14759. _d16.addFormField("cv.context",_d14);
  14760. _d16.sendRequest();
  14761. },fetchAnnotationDataResponseFault:function(_d17){
  14762. this.m_bCallGetAnnotations=false;
  14763. var _d18=new FaultDialog(this.m_viewerIWidget.getViewerObject());
  14764. var _d19=_d17.getSoapFault();
  14765. var _d1a=null;
  14766. var _d1b=XMLHelper_FindChildByTagName(_d19,"exception",true);
  14767. if(_d1b){
  14768. var _d1c=XMLHelper_FindChildByTagName(_d1b,"errorCode",false);
  14769. if(_d1c){
  14770. _d1a=XMLHelper_GetText(_d1c);
  14771. }
  14772. }
  14773. if(_d1a==="0"){
  14774. var _d1d=null;
  14775. var _d1e=XMLHelper_FindChildByTagName(_d1b,"message",false);
  14776. if(_d1e){
  14777. var _d1f=XMLHelper_FindChildByTagName(_d1e,"messageString",true);
  14778. if(_d1f){
  14779. _d1d=XMLHelper_GetText(_d1f,false);
  14780. }
  14781. }
  14782. if(_d1d){
  14783. var _d20=/ANS-GEN-(\d{2,4})/;
  14784. var _d21=_d20.exec(_d1d);
  14785. if(_d21&&_d21.length&&_d21.length>1){
  14786. var _d22=_d21[1];
  14787. if(_d22==="0075"){
  14788. _d18.setErrorMessage(RV_RES.IDS_ANNOTATION_WIDGET_DELETED_ERROR);
  14789. }
  14790. }
  14791. }
  14792. }
  14793. this._cleanupPreviousAnnotations();
  14794. this.getAnnotationStore().clear();
  14795. _d18.show(_d19);
  14796. if(this.m_loadAnnotationsDfd){
  14797. this.m_loadAnnotationsDfd.errback();
  14798. this.m_loadAnnotationsDfd=null;
  14799. }
  14800. },fetchAnnotationDataResponse:function(_d23){
  14801. var _d24=window["CVEditContentActionInstance"];
  14802. var _d25=_d23.getResult();
  14803. this.m_bCallGetAnnotations=this.m_bCallGetAnnotations&&_d25!==null;
  14804. if(_d25===null){
  14805. _d25=[];
  14806. }
  14807. var _d26=this.m_viewerIWidget.getViewerObject();
  14808. _d26.envParams["cv.annotationData"]=_d25;
  14809. this._cleanupPreviousAnnotations();
  14810. if(_d25.length>0){
  14811. if(this.getAnnotationStore()){
  14812. var _d27=this._generateMatchedAnnotationsFromViewerObject();
  14813. this.getAnnotationStore().load(_d27);
  14814. this.displayCommentIndicators();
  14815. }
  14816. }
  14817. if(this.m_loadAnnotationsDfd){
  14818. this.m_loadAnnotationsDfd.callback();
  14819. this.m_loadAnnotationsDfd=null;
  14820. }
  14821. },_cleanupPreviousAnnotations:function(){
  14822. var _d28=this.getAnnotationStore();
  14823. if(_d28){
  14824. var _d29=_d28.getAll();
  14825. for(var _d2a in _d29){
  14826. var _d2b=this.m_viewerIWidget.getWidgetId()+"_"+_d2a+"_comment";
  14827. var _d2c=dijit.byId(_d2b);
  14828. if(typeof _d2c!="undefined"&&_d2c!=null){
  14829. _d2c.destroy();
  14830. delete _d2c;
  14831. }
  14832. _d28.clear(_d2a);
  14833. }
  14834. }
  14835. },_generateMatchedAnnotationsFromViewerObject:function(){
  14836. var _d2d=this.m_viewerIWidget.getViewerObject();
  14837. var _d2e=[];
  14838. if(_d2d&&_d2d.envParams&&_d2d.envParams["cv.annotationData"]){
  14839. _d2e=eval(_d2d.envParams["cv.annotationData"]);
  14840. }
  14841. var _d2f=this._generateAnnotationListWithoutORoperator(_d2e);
  14842. return this._updateAnnotationCtxWithMatchedCellCtx(_d2f,_d2d);
  14843. },_generateAnnotationListWithoutORoperator:function(_d30){
  14844. var _d31=[];
  14845. for(var i=0,len=_d30.length;i<len;i++){
  14846. var anno=_d30[i];
  14847. if(anno.ctx){
  14848. var _d35=bux.AnnotationHelper.generateCTXList(anno.ctx);
  14849. for(var j=0,jLen=_d35.length;j<jLen;j++){
  14850. var _d38={ann:anno.ann,lmt:anno.lmt,lmtf:anno.lmtf,ctx:anno.ctx,desc:anno.desc,fd:anno.fd,layoutElementId:anno.layoutElementId,owner:anno.owner,ownerSearchPath:anno.ownerSearchPath,pv:anno.pv,rdi:anno.rdi,sd:anno.sd,version:anno.version||1};
  14851. _d38.ctx=_d35[j];
  14852. _d31.splice(0,0,_d38);
  14853. }
  14854. }else{
  14855. _d31.splice(0,0,anno);
  14856. }
  14857. }
  14858. return _d31;
  14859. },_updateAnnotationCtxWithMatchedCellCtx:function(_d39,_d3a){
  14860. var _d3b=[];
  14861. var _d3c=new AnnotationCTXLookup(this.m_viewerIWidget.getViewerObject().getSelectionController().getCCDManager());
  14862. _d3c.populateCtxDetailsForAllAnnotations(_d39);
  14863. var _d3d=[];
  14864. for(var i=0,len=_d39.length;i<len;i++){
  14865. var anno=_d39[i];
  14866. if(anno.ctx){
  14867. if(_d3d.length===0){
  14868. _d3d=dojo.query("[ctx]",this.m_viewerIWidget.iContext.getRootElement());
  14869. }
  14870. for(var j=0,jLen=_d3d.length;j<jLen;j++){
  14871. var _d43=_d3d[j].getAttribute("ctx");
  14872. if(_d3c.isAnnotatedCell(anno,_d43)){
  14873. anno.ctx=_d43;
  14874. _d3b.splice(0,0,anno);
  14875. break;
  14876. }
  14877. }
  14878. }else{
  14879. _d3b.splice(0,0,anno);
  14880. }
  14881. }
  14882. return _d3b;
  14883. },displayCommentIndicators:function(){
  14884. var _d44=this.getAnnotationStore();
  14885. var _d45=_d44.getAll();
  14886. for(var cell in _d45){
  14887. var _d47=new bux.AnnotationIndicator({annotationStore:_d44,context:cell,iWidgetContainer:this.m_viewerIWidget,dir:this.m_viewerIWidget.getViewerObject().getDirection()});
  14888. _d47.addExistingCommentToCell();
  14889. }
  14890. },repositionCommentIndicators:function(){
  14891. var _d48=this.getAnnotationStore();
  14892. var _d49=_d48.getAll();
  14893. for(var id in _d49){
  14894. var _d4b=_d49[id];
  14895. var ctx=_d4b[0].getContext();
  14896. var _d4d=_d48.getIndicatorWidgetId(ctx);
  14897. if(_d4d!==null){
  14898. var _d4e=dijit.byId(_d4d);
  14899. _d4e.addToPage();
  14900. }
  14901. }
  14902. },promptForSave:function(_d4f){
  14903. dojo["require"]("bux.dialogs.InformationDialog");
  14904. var _d50=new bux.dialogs.InformationDialog({title:RV_RES.IDS_JS_COMMENT_DLG_TITLE,sMainMessage:RV_RES.IDS_JS_COMMENT_DLG_MESSAGE,sDescription:RV_RES.IDS_JS_COMMENT_DLG_DETAILS,sInfoIconClass:"bux-informationDialog-warning-icon",buttons:["YES","NO"],yesOKHandler:_d4f});
  14905. _d50.startup();
  14906. _d50.show();
  14907. },addComment:function(_d51,_d52){
  14908. if(this.m_viewerIWidget.isSaveNecessary()){
  14909. this.promptForSave(dojo.hitch(this,this.onCommentSaveAcknowledge,_d51,_d52));
  14910. }else{
  14911. this.addNewComment(_d51,_d52);
  14912. }
  14913. },editComment:function(_d53){
  14914. var _d54=bux.getComment(this.m_viewerIWidget.iContext,this.getAnnotationStore().getEffectiveIds(_d53));
  14915. if(_d54&&_d54.edit){
  14916. _d54.edit();
  14917. }
  14918. },deleteComment:function(_d55){
  14919. this.getAnnotationStore().deleteOneComment(_d55);
  14920. },addNewComment:function(_d56,_d57){
  14921. this.addAsNewComment(_d56,(_d57==null)?"":(_d57+" - "));
  14922. },addAsNewComment:function(_d58,text){
  14923. var _d5a=null;
  14924. var _d5b=(_d58===null)?this.getAnnotationStore().WIDGET_CONTEXT:_d58;
  14925. var _d5c=this.getAnnotationStore().getIndicatorWidgetId(_d5b);
  14926. if(_d5c!=null){
  14927. _d5a=dijit.byId(_d5c);
  14928. }
  14929. if(_d5a==null){
  14930. dojo["require"]("bux.AnnotationIndicator");
  14931. _d5a=new bux.AnnotationIndicator({annotationStore:this.getAnnotationStore(),context:_d5b,iWidgetContainer:this.m_viewerIWidget,dir:this.m_viewerIWidget.getViewerObject().getDirection()});
  14932. window.setTimeout(function(){
  14933. _d5a.addNewCommentToCell(text);
  14934. },0);
  14935. }else{
  14936. window.setTimeout(function(){
  14937. _d5a.comment.editNewComment(_d5b,text);
  14938. },0);
  14939. }
  14940. },onCommentSaveAcknowledge:function(_d5d,_d5e){
  14941. this.m_viewerIWidget._pendingContextId=_d5d;
  14942. this.m_viewerIWidget._pendingCellValue=_d5e;
  14943. this.m_viewerIWidget.fireEvent("com.ibm.bux.widget.action",null,{action:"canvas.save"});
  14944. },addWidgetComment:function(){
  14945. if(this.m_viewerIWidget.isSaveNecessary()){
  14946. this.promptForSave(dojo.hitch(this,this.onCommentSaveAcknowledge,null,this.m_viewerIWidget.getDisplayName()));
  14947. }else{
  14948. this.addNewComment(null,this.m_viewerIWidget.getDisplayName());
  14949. }
  14950. },editWidgetComment:function(){
  14951. var _d5f=bux.getComment(this.m_viewerIWidget.iContext,[this.getAnnotationStore().WIDGET_CONTEXT]);
  14952. if(_d5f&&_d5f.edit){
  14953. _d5f.edit();
  14954. }
  14955. },deleteWidgetComment:function(){
  14956. this.deleteComment(this.getAnnotationStore().WIDGET_CONTEXT);
  14957. },commitComment:function(_d60){
  14958. if(_d60.getContext()!==this.getAnnotationStore().WIDGET_CONTEXT){
  14959. return this.commitCellComment(_d60);
  14960. }else{
  14961. return this.commitWidgetComment(_d60,this.getAnnotationStore());
  14962. }
  14963. },commitCellComment:function(_d61){
  14964. var _d62=new dojo.Deferred();
  14965. var _d63=this.m_viewerIWidget.getViewerObject();
  14966. var _d64={customArguments:[_d61,_d62],"complete":{"object":this,"method":this.handleCellCommentSaveResponse},"fault":{"object":this,"method":this.handleCellCommentSaveErrorResponse},"error":{"object":this,"method":this.handleCellCommentSaveServerErrorResponse}};
  14967. var _d65=new AsynchJSONDispatcherEntry(_d63);
  14968. _d65.setCallbacks(_d64);
  14969. this.preparePostForCommitCellComment(_d65,_d61).then(function(){
  14970. _d63.dispatchRequest(_d65);
  14971. });
  14972. return _d62;
  14973. },preparePostForCommitCellComment:function(_d66,_d67){
  14974. var dfd=new dojo.Deferred();
  14975. dojo.when(this.m_viewerIWidget.getWidgetStoreID(),dojo.hitch(this,function(_d69){
  14976. var _d6a=this.m_viewerIWidget.getViewerObject();
  14977. var _d6b=_d6a.getSelectionController();
  14978. _d66.addFormField("widgetStoreID",_d69);
  14979. _d66.addFormField("ui.action","commentSave");
  14980. _d66.addFormField("cv.metatdata",dojo.toJson(_d6b.getCCDManager().m_md));
  14981. _d66.addFormField("cv.context",dojo.toJson(_d6b.getCCDManager().m_cd));
  14982. _d66.addFormField("cv.commentId",_d67.getContext());
  14983. _d66.addFormField("cv.commentDesc",xml_encode(_d67.getDescription()));
  14984. var lid=_d6b.getAllSelectedObjects()[0].getLayoutElementId();
  14985. if(lid){
  14986. lid=lid.replace(this.m_viewerIWidget.getViewerId(),"");
  14987. _d67.setParentId(lid);
  14988. _d66.addFormField("cv.commentLayoutId",_d67.getParentId());
  14989. var _d6d=new AnnotationInfoBar(_d6a,lid);
  14990. var _d6e=_d6d.createFilterContext();
  14991. if(_d6e!=null){
  14992. _d67.setFilterContext(_d6e);
  14993. if(_d6e.getPromptsJSON()){
  14994. _d66.addFormField("cv.filterContext_prompts",dojo.toJson(_d6e.getPromptsJSON()));
  14995. }
  14996. if(_d6e.getFilterJSON()){
  14997. _d66.addFormField("cv.filterContext_filter",dojo.toJson(_d6e.getFilterJSON()));
  14998. }
  14999. if(_d6e.getSlidersJSON()){
  15000. _d66.addFormField("cv.filterContext_sliders",dojo.toJson(_d6e.getSlidersJSON()));
  15001. }
  15002. }
  15003. }
  15004. dfd.callback();
  15005. }));
  15006. return dfd;
  15007. },commitWidgetComment:function(_d6f){
  15008. dojo["require"]("bux.Services");
  15009. var _d70=bux.Services.getGateway()+"/annotationService/creation";
  15010. var _d71={};
  15011. _d71["annotationName"]=_d6f.getName();
  15012. if(_d71["annotationName"]==null){
  15013. _d71["annotationName"]="";
  15014. }
  15015. _d71["annotationDescription"]=_d6f.getDescription();
  15016. var dfd=new dojo.Deferred();
  15017. dojo.when(this.m_viewerIWidget.getWidgetStoreID(),dojo.hitch(this,function(_d73){
  15018. _d71["annotationParentID"]=_d73;
  15019. bux.xhrPost({url:_d70,sync:true,content:_d71}).then(dojo.hitch(this,function(_d74){
  15020. this.handleCommentSaveDone(_d74,_d6f,this.getAnnotationStore(),this.m_viewerIWidget);
  15021. _d6f.loadDetails();
  15022. dfd.callback();
  15023. }));
  15024. }));
  15025. return dfd;
  15026. },handleCellCommentSaveResponse:function(_d75,_d76,_d77){
  15027. var _d78=_d75.getJSONResponseObject();
  15028. if(_d78){
  15029. var _d79=_d78.json;
  15030. if(_d79){
  15031. var _d7a=this.handleCommentSaveDone(_d79,_d76,this.getAnnotationStore(),this.m_viewerIWidget);
  15032. if(typeof _d7a!="Error"){
  15033. _d76.loadDetails();
  15034. }
  15035. }
  15036. }
  15037. _d77.callback(_d75);
  15038. },handleCellCommentSaveErrorResponse:function(_d7b,_d7c,_d7d){
  15039. _d7d.errback(new Error(_d7b.getSoapFaultDetailMessageString()));
  15040. },handleCellCommentSaveServerErrorResponse:function(_d7e,_d7f,_d80){
  15041. var _d81=new Error(_d7e.xmlHttp.statusText);
  15042. _d81.xhr=_d7e.xmlHttp;
  15043. _d80.errback(_d81);
  15044. },handleCommentSaveDone:function(_d82,_d83,_d84,_d85){
  15045. var _d86=XMLBuilderLoadXMLFromString(_d82);
  15046. if(_d86){
  15047. var _d87=_d86.firstChild;
  15048. var _d88=XMLHelper_FindChildByTagName(_d87,"annotation",false);
  15049. if(_d88){
  15050. var _d89=XMLHelper_FindChildByTagName(_d88,"id",false);
  15051. if(_d89){
  15052. var _d8a=XMLHelper_GetText(_d89);
  15053. _d83.setServiceId(_d8a);
  15054. _d83.setIWidgetContainer(_d85);
  15055. _d84.setWidgetContainer(_d85);
  15056. this.setCallGetAnnotations(true);
  15057. return _d82;
  15058. }
  15059. }
  15060. }
  15061. return new Error(_d82.toString());
  15062. }});
  15063. dojo.provide("bux.reportViewer");
  15064. dojo.require("dojo.buxViewer");
  15065. dojo.require("bux.AnnotationHelper");
  15066. dojo.require("bux.AnnotationIndicator");
  15067. dojo.require("viewer.AnnotationHelper");
  15068. dojo.require("bux.data.AnnotationStore");
  15069. dojo.require("bux.iwidget.common.MultilingualWidgetBase");
  15070. dojo.require("InfoBarBase");
  15071. dojo.require("WidgetContextManager");
  15072. var globalViewerIdentifier=1;
  15073. dojo.declare("bux.reportViewer",bux.iwidget.common.MultilingualWidgetBase,{annotationStore:null,annotationHelper:null,savedOutput:null,undoRedoQueue:null,dojoConnections:null,properties:null,promptParametersRetrieved:false,viewerId:null,xNodeId:null,namespacePrefix:"x",timer:null,timerInterval:20,GODASHBOARD_REPORT_VERSION:"1.0.0.0",BUX_REPORT_VERSION:"4.0.0.0.0",BUX_REPORT_CASPIAN_RP1_VERSION:"3.0.0.0.0",RAP_REPORT_INFO_VERSION:"1.0.0.0",viewerWidgetLastAction:null,sliderState:null,sViewerIWidgetId:null,bToolbarInitialized:false,m_oWidgetContextManager:null,m_oInfoBarRenderedState:{},m_bRunReportOption:null,m_oLoadManager:null,m_visible:null,m_debugDelayedViewerLoadingMode:0,m_delayedLoadingContext:null,m_doGetParametersOnLoad:null,widgetSize:null,copyPasteResource:null,_pastedWidget:false,ciPublishedReportPath:null,touchStartX:-1,touchPaging:false,_BUXDBInfoArray:null,m_bSelectionFilterSwitch:false,savedToolbarButtons:null,constructor:function(){
  15074. this.onUnloadInProgress=false;
  15075. this.annotationHelper=new viewer.AnnotationHelper(this);
  15076. this.savedOutput=new CIWidgetSavedOutput(this);
  15077. this.undoRedoQueue=new UndoRedoQueue(this);
  15078. this.viewerIdentifier=(globalViewerIdentifier++).toString();
  15079. this.m_oCV=null;
  15080. this.m_oLoadManager=new ViewerLoadManager(this);
  15081. this.m_doGetParametersOnLoad=false;
  15082. this._isMobile=false;
  15083. this.m_bSelectionFilterSwitch=false;
  15084. this.m_oWidgetContextManager=new WidgetContextManager(this);
  15085. this.addWindowEventListeners();
  15086. this.m_bReportDropped=false;
  15087. this.sliderState={};
  15088. this.savedToolbarButtons={};
  15089. },getWidgetId:function(){
  15090. return this.sViewerIWidgetId;
  15091. },getAnnotationHelper:function(){
  15092. return this.annotationHelper;
  15093. },getUndoRedoQueue:function(){
  15094. return this.undoRedoQueue;
  15095. },getDisplayName:function(){
  15096. var _d8b=this.iContext.getItemSet("buxrtstate",false);
  15097. if(_d8b){
  15098. var _d8c=_d8b.getItemValue("displayTitle");
  15099. return _d8c?_d8c:"";
  15100. }
  15101. return "";
  15102. },getSavedOutput:function(){
  15103. return this.savedOutput;
  15104. },getAttributeValue:function(name){
  15105. return this.iContext.getiWidgetAttributes().getItemValue(name);
  15106. },setAttributeValue:function(name,_d8f){
  15107. this.iContext.getiWidgetAttributes().setItemValue(name,_d8f);
  15108. },removeAttributeValue:function(name){
  15109. this.iContext.getiWidgetAttributes().removeItem(name);
  15110. },getViewerObject:function(){
  15111. if(!this.m_oCV){
  15112. try{
  15113. this.m_oCV=window["oCV"+this.getViewerId()];
  15114. }
  15115. catch(ex){
  15116. return null;
  15117. }
  15118. if(!this.m_oCV){
  15119. var _d91=this.getWidgetId();
  15120. for(var _d92=0;_d92<window.gaRV_INSTANCES.length;_d92++){
  15121. if(window.gaRV_INSTANCES[_d92].widgetId==_d91){
  15122. this.m_oCV=window.gaRV_INSTANCES[_d92];
  15123. var _d93=this.getViewerId();
  15124. var _d94=this.m_oCV.getId();
  15125. this.setViewerId(_d94);
  15126. var _d95=document.getElementsByTagName("head").item(0).childNodes;
  15127. for(var i=0;i<_d95.length;i++){
  15128. var node=_d95[i];
  15129. if(node.getAttribute&&node.getAttribute("namespaceId")==_d93){
  15130. node.setAttribute("namespaceId",_d94);
  15131. }
  15132. }
  15133. break;
  15134. }
  15135. }
  15136. }
  15137. }
  15138. return this.m_oCV;
  15139. },setViewerId:function(id){
  15140. this.viewerId=id;
  15141. },getViewerId:function(){
  15142. if(!this.viewerId){
  15143. this.viewerId=this.namespacePrefix+this.viewerIdentifier;
  15144. }
  15145. return this.viewerId;
  15146. },getLoadManager:function(){
  15147. return this.m_oLoadManager;
  15148. },getReportBlocker:function(){
  15149. if(!this.m_reportBlocker){
  15150. this.m_reportBlocker=new Blocker(this.m_oCV.getId());
  15151. }
  15152. return this.m_reportBlocker;
  15153. },placeTabControlInView:function(){
  15154. var oCV=this.getViewerObject();
  15155. if(oCV&&oCV.getTabController()){
  15156. if(oCV.getTabController().getSelectedTab()&&oCV.getTabController().getSelectedTab().getFocusableDiv()){
  15157. oCV.setKeepFocus(oCV.getTabController().getSelectedTab().getFocusableDiv());
  15158. }
  15159. dojo.window.scrollIntoView(oCV.getTabController().getWrapperDiv());
  15160. }
  15161. },setReportBlocker:function(_d9a){
  15162. this.m_reportBlocker=_d9a;
  15163. },isSavedOutput:function(){
  15164. var _d9b=this.getViewerObject();
  15165. if(typeof _d9b!=="undefined"&&_d9b!==null){
  15166. var _d9c=(_d9b.envParams["ui.action"]);
  15167. return (_d9c==="view"||_d9c==="buxView");
  15168. }
  15169. return false;
  15170. },isMobile:function(){
  15171. return this._isMobile;
  15172. },getEmbeddedMobileItem:function(){
  15173. var _d9d=false;
  15174. var _d9e=this.iContext.getItemSet("buxrtstate",false);
  15175. if(_d9e){
  15176. _d9d=_d9e.getItemValue("embeddedMobile")=="true"?true:false;
  15177. }
  15178. return _d9d;
  15179. },getBUXRTStateInfoMap:function(_d9f){
  15180. if(!window.icdConfig||!window.icdConfig.ZIPIMode||window.icdConfig.ZIPIMode==="0"){
  15181. return "";
  15182. }
  15183. var _da0=["<RTStateInfo>"];
  15184. if(_d9f&&_d9f.length>0){
  15185. _da0.push(_d9f);
  15186. }
  15187. var _da1=this.getDisplayName();
  15188. if(_da1&&_da1.length>0){
  15189. _da0.push("<widgetTitle>",xml_encode(_da1),"</widgetTitle>");
  15190. }
  15191. if(this._BUXDBInfoArray&&this._BUXDBInfoArray.length>0){
  15192. _da0=_da0.concat(this._BUXDBInfoArray);
  15193. }
  15194. _da0.push("</RTStateInfo>");
  15195. return _da0.length>2?_da0.join(""):"";
  15196. },getBUXDBInfoArray:function(_da2){
  15197. var _da3=null;
  15198. var _da4=null;
  15199. if(_da2){
  15200. _da3=_da2.dbTitle;
  15201. _da4=_da2.dbSearchPath;
  15202. }else{
  15203. var _da5=this.iContext.getItemSet("buxrtstate",false);
  15204. if(_da5){
  15205. _da3=_da5.getItemValue("dbTitle");
  15206. _da4=_da5.getItemValue("dbSearchPath");
  15207. }
  15208. }
  15209. var _da6=[];
  15210. if(_da3&&_da4&&_da4.length>0){
  15211. _da6.push("<dbTitle>",xml_encode(_da3),"</dbTitle><dbSearchPath>",xml_encode(_da4),"</dbSearchPath>");
  15212. }
  15213. return _da6;
  15214. },loadExtraJavascriptFiles:function(_da7){
  15215. if(typeof CSelectionContext=="undefined"){
  15216. this._loadFile("/drill/CSelectionContextBuilder.js",_da7);
  15217. }
  15218. this._loadFile("/mdsrv/lineage.js",_da7);
  15219. if(window.cognosViewerDebug){
  15220. this._loadFile("/rv/viewer.extra.debug.js",_da7);
  15221. }else{
  15222. this._loadFile("/rv/viewer.extra.js",_da7);
  15223. }
  15224. },_loadFile:function(_da8,_da9){
  15225. if(dojo.isIE||dojo.isTrident||_da9.indexOf("..")==0){
  15226. var _daa=window.gScriptLoader.loadFile(_da9+_da8,"","GET");
  15227. var _dab=document.createElement("script");
  15228. _dab.type="text/javascript";
  15229. _dab.text=_daa;
  15230. document.getElementsByTagName("head")[0].appendChild(_dab);
  15231. }else{
  15232. dojo._loadPath(_da9+_da8,null);
  15233. }
  15234. },_getCWALaunchInformation:function(){
  15235. var args={url:this.buildPostUrl(),sync:false,handleAs:"json",preventCache:true,content:{"b_action":"cognosViewer","ui.action":"noOp","cv.responseFormat":"getCWALaunchParameters"},error:dojo.hitch(this,function(_dad){
  15236. this.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
  15237. this.fireEvent("com.ibm.bux.widget.notification",null,{type:"error",message:_dad.message,description:_dad.description});
  15238. }),load:dojo.hitch(this,function(_dae,_daf){
  15239. var _db0=_daf.xhr.getResponseHeader("Content-Type");
  15240. if(_db0&&_db0.indexOf("text/html")!=-1&&_dae&&_dae.match(/<ERROR_CODE>CAM_PASSPORT_ERROR<\/ERROR_CODE>/)){
  15241. this.handlePassportErrorFromDispatcher();
  15242. }else{
  15243. this._launchCWA(_dae);
  15244. }
  15245. })};
  15246. dojo.xhrPost(args);
  15247. },_launchCWA:function(_db1){
  15248. if(_db1){
  15249. if(typeof NewReportAction=="undefined"){
  15250. this.loadExtraJavascriptFiles(_db1.webContentRoot);
  15251. if(_db1.productLocale!="en"){
  15252. this._loadFile("rv/res/viewer_"+_db1.productLocale+".js",_db1.webContentRoot);
  15253. }
  15254. }
  15255. var _db2=new NewReportAction();
  15256. _db2.setRequestParms({"packageSearchPath":this.getAttributeValue("packageSearchPath"),"viewerIWidget":this,"webContentRoot":_db1.webContentRoot,"gateway":_db1.gateway,"capabilitiesXml":_db1.capabilitiesXML,"cafContextId":_db1.cafContextId});
  15257. this.removeAttributeValue("packageSearchPath");
  15258. _db2.execute();
  15259. }
  15260. },setNewReportInfo:function(info){
  15261. this._newReportInfo=info;
  15262. },_handleFileDialogCancel:function(){
  15263. this.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
  15264. },_handleFileDialogOk:function(_db4){
  15265. this.removeAttributeValue("newReport");
  15266. this.setAttributeValue("packageSearchPath","storeID(\""+_db4+"\")");
  15267. this.onLoad();
  15268. },onLoad:function(){
  15269. this.sViewerIWidgetId=this.iContext.getRootElement().id;
  15270. if(this.getAttributeValue("packageSearchPath")){
  15271. this._getCWALaunchInformation();
  15272. return;
  15273. }else{
  15274. if(this.getAttributeValue("newReport")==="true"){
  15275. dojo["require"]("bux.dialogs.FileDialog");
  15276. var oDlg=new bux.dialogs.PackageDialog({onCancelHandler:dojo.hitch(this,this._handleFileDialogCancel),selectPackageHandler:dojo.hitch(this,this._handleFileDialogOk)});
  15277. oDlg.startup();
  15278. oDlg.show();
  15279. return;
  15280. }
  15281. }
  15282. var _db6=this.getAttributeValue("ViewerConcurrentRequestLimit");
  15283. if(_db6){
  15284. this.removeAttributeValue("ViewerConcurrentRequestLimit");
  15285. if(!window["gReportWidgetLoadQueue"]){
  15286. window["gReportWidgetLoadQueue"]=new ReportWidgetLoadQueue(_db6);
  15287. }
  15288. }
  15289. this._isMobile=this.getEmbeddedMobileItem();
  15290. this._BUXDBInfoArray=this.getBUXDBInfoArray();
  15291. var _db7=this.getAttributeValue("viewerProperties");
  15292. var _db8=this.getAttributeValue("promptParametersRetrieved");
  15293. if(_db8!==null&&_db8=="true"){
  15294. this.promptParametersRetrieved=true;
  15295. }
  15296. this.properties=this.createProperties(_db7);
  15297. this.savedOutput.setPagedOutput(!this.properties.getRetrieveAll());
  15298. this.setWidgetCopyPasteParameters();
  15299. this.m_bSelectionFilterSwitch=this.getAttributeValue("selectionFilterEnabled")=="true"?true:false;
  15300. if(this.isOpeningSavedDashboard()&&this.copyPasteResource==null){
  15301. this.disableListenToIfFullReportUpgraded();
  15302. this.enableFlashChartsToIfReportPartUpgraded();
  15303. this.disableListenToIfReportPartUpgraded();
  15304. if(this.isVisible()){
  15305. if(window["gReportWidgetLoadQueue"]){
  15306. window["gReportWidgetLoadQueue"].add(this);
  15307. }else{
  15308. this.postReport(null);
  15309. }
  15310. }
  15311. }else{
  15312. var _db9={action:"canvas.filters"};
  15313. this.fireEvent("com.ibm.bux.widget.action",null,_db9);
  15314. this.getLoadManager().viewerLoadInitiated();
  15315. this.m_visible=true;
  15316. }
  15317. this.addWidgetEventListeners();
  15318. this.iContext.iEvents.svc.addWire(this.iContext.widgetId,"com.ibm.widget.contextChanged","widgetBuxCanvasTabs","com.ibm.widget.contextChanged");
  15319. this.iContext.iEvents.svc.addWire(this.iContext.widgetId,"com.ibm.bux.data.filterCache.init","widgetBuxCanvasTabs","com.ibm.bux.data.filterCache.init");
  15320. this.fireEvent("com.ibm.bux.widget.updateStoreID",null,{});
  15321. },addWindowEventListeners:function(){
  15322. if(!this.dojoConnections){
  15323. this.dojoConnections=[];
  15324. }
  15325. this.dojoConnections.push(dojo.connect(window,"onresize",this,this.onBrowserResize));
  15326. this.dojoConnections.push(dojo.connect(window,"onbeforeunload",this,this.possibleUnloadEvent));
  15327. },addWidgetEventListeners:function(){
  15328. if(this.isMobile()){
  15329. this.dojoConnections.push(dojo.connect(this.iContext.getRootElement(),"touchstart",this,this.onTouchStart));
  15330. this.dojoConnections.push(dojo.connect(this.iContext.getRootElement(),"touchmove",this,this.onTouchMove));
  15331. }
  15332. },addChromeWhitespaceHandler:function(_dba){
  15333. if(isIE()){
  15334. var _dbb=document.getElementById("mainViewerTR"+_dba);
  15335. if(_dbb){
  15336. this.dojoConnections.push(dojo.connect(_dbb,"onmousedown",this,this.onMouseDownOnChromeDiv));
  15337. }
  15338. }
  15339. },onMouseDownOnChromeDiv:function(evt){
  15340. if(evt.srcElement.id.indexOf("PRMT",0)===0){
  15341. return;
  15342. }
  15343. var oCV=this.getViewerObject();
  15344. if(oCV){
  15345. var _dbe=oCV.getReportDiv();
  15346. if(_dbe){
  15347. var _dbf=_dbe.getBoundingClientRect();
  15348. var _dc0=_dbf.top+_dbe.offsetHeight;
  15349. if(evt.clientY>_dc0&&evt.button!==2){
  15350. if(oCV.getSelectionController()){
  15351. oCV.getSelectionController().clearSelectedObjects();
  15352. this.onSelectionChange();
  15353. stopEventBubble(evt);
  15354. }
  15355. }
  15356. }
  15357. }
  15358. },removeWindowEventListeners:function(){
  15359. if(this.dojoConnections){
  15360. for(var i=0;i<this.dojoConnections.length;++i){
  15361. dojo.disconnect(this.dojoConnections[i]);
  15362. }
  15363. delete this.dojoConnections;
  15364. }
  15365. },onBrowserResize:function(){
  15366. var oCV=this.getViewerObject();
  15367. if(oCV&&oCV.getPinFreezeManager()){
  15368. oCV.getPinFreezeManager().onResizeCanvas(this.isVisible());
  15369. }
  15370. },onTouchStart:function(e){
  15371. this.touchPaging=false;
  15372. if(this.m_oCV&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
  15373. var _dc4=e.changedTouches[0];
  15374. if(_dc4&&_dc4.clientX){
  15375. this.touchStartX=parseInt(_dc4.clientX);
  15376. }
  15377. }
  15378. },onTouchMove:function(e){
  15379. if(!this.touchPaging&&this.touchStartX!=-1&&this.m_oCV&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
  15380. var _dc6=e.changedTouches[0];
  15381. if(_dc6&&_dc6.clientX){
  15382. var _dc7=parseInt(_dc6.clientX);
  15383. if(this.m_oCV.hasNextPage()&&this.touchStartX-_dc7>10){
  15384. this.touchPaging=true;
  15385. this.m_oCV.pageAction("nextPage");
  15386. this.m_oCV.setKeepFocus(false);
  15387. }else{
  15388. if(this.m_oCV.hasPrevPage()&&_dc7-this.touchStartX>10){
  15389. this.touchPaging=true;
  15390. this.m_oCV.pageAction("previousPage");
  15391. this.m_oCV.setKeepFocus(false);
  15392. }else{
  15393. this.touchPaging=false;
  15394. this.touchStartX=-1;
  15395. }
  15396. }
  15397. }
  15398. }
  15399. if(this.touchStartX>0){
  15400. stopEventBubble(e);
  15401. }
  15402. },isLiveReport:function(){
  15403. return this.isSavedOutput()===false&&!this.isLimitedInteractiveMode();
  15404. },createProperties:function(_dc8){
  15405. return new bux.reportViewer.Properties(this,_dc8);
  15406. },disableListenToIfFullReportUpgraded:function(){
  15407. if(this.isGoDashboardReportUpgrade()){
  15408. if(this.getAttributeValue("flexParam_properties")==null){
  15409. var _dc9={};
  15410. _dc9["*"]={blockedEvents:["com.ibm.bux.data.filter","com.ibm.bux.filter.values.get","com.ibm.bux.filter.items.get"]};
  15411. this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_dc9);
  15412. }
  15413. }
  15414. },enableFlashChartsToIfReportPartUpgraded:function(){
  15415. if(this.isGoDashboardReportUpgrade()){
  15416. var _dca=this.getAttributeValue("originalReportPart");
  15417. if(typeof _dca!=="undefined"&&_dca!==null){
  15418. this.properties.setProperty("flashCharts","true");
  15419. }
  15420. }
  15421. },disableListenToIfReportPartUpgraded:function(){
  15422. if(this.isGoDashboardReportUpgrade()){
  15423. var _dcb=this.getAttributeValue("originalReportPart");
  15424. if(typeof _dcb!=="undefined"&&_dcb!==null){
  15425. var _dcc={};
  15426. _dcc["*"]={blockedEvents:["com.ibm.bux.viewer.drill","com.ibm.bux.viewer.prompt"]};
  15427. this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_dcc);
  15428. }
  15429. }
  15430. },possibleUnloadEvent:function(){
  15431. var oCV=this.getViewerObject();
  15432. if(oCV){
  15433. oCV.getViewerDispatcher().possibleUnloadEvent();
  15434. }
  15435. },onUnload:function(){
  15436. this.onUnloadInProgress=true;
  15437. this.destroy();
  15438. this.iContext=null;
  15439. },onGetFiltersDone:function(evt){
  15440. if(typeof this.filterRequiredAction!="undefined"&&this.filterRequiredAction!=null){
  15441. var _dcf=this.buildDataFiltersParam(evt.payload.filters);
  15442. var _dd0=new ActionFactory(this.getViewerObject());
  15443. var _dd1=_dd0.load(this.filterRequiredAction);
  15444. _dd1.dispatchRequest(_dcf,this.filterRequiredAction);
  15445. this.filterRequiredAction=null;
  15446. }else{
  15447. this.postReport(evt.payload.filters);
  15448. this.postSetWidgetCopyPasteParameters();
  15449. }
  15450. },getOriginalFormFields:function(){
  15451. return this.m_originalFormFields;
  15452. },setOriginalFormFields:function(_dd2){
  15453. this.m_originalFormFields=_dd2;
  15454. },getXNodeId:function(){
  15455. return this.xNodeId;
  15456. },setXNodeId:function(_dd3){
  15457. this.xNodeId=_dd3;
  15458. },postReport:function(_dd4){
  15459. this.getLoadManager().viewerLoadInitiated();
  15460. this.viewerWidgetLastAction={"functionName":"postReport","param":[_dd4]};
  15461. if(this.getRunReportOption()!==false){
  15462. this.m_oLoadManager.runningReport();
  15463. }
  15464. var _dd5=this.buildPostContent(_dd4);
  15465. if(_dd5["ui.reportDrop"]=="true"){
  15466. this.m_bReportDropped=true;
  15467. }
  15468. this.m_originalFormFields=new CDictionary();
  15469. for(var _dd6 in _dd5){
  15470. if(_dd6!="cv.outputKey"){
  15471. this.m_originalFormFields.add(_dd6,_dd5[_dd6]);
  15472. }
  15473. }
  15474. var _dd7={};
  15475. if(this.getAttributeValue("X-Node-ID")){
  15476. this.setXNodeId(this.getAttributeValue("X-Node-ID"));
  15477. _dd7["X-Node-ID"]=this.getAttributeValue("X-Node-ID");
  15478. this.removeAttributeValue("X-Node-ID");
  15479. }
  15480. var args={url:this.buildPostUrl(),sync:false,preventCache:true,content:_dd5,headers:_dd7,error:dojo.hitch(this,function(_dd9){
  15481. this.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
  15482. this.fireEvent("com.ibm.bux.widget.notification",null,{type:"error",message:_dd9.message,description:_dd9.description});
  15483. })};
  15484. if(typeof xhrMultiPart!=="undefined"&&xhrMultiPart.active){
  15485. args.load=dojo.hitch(this,function(_dda){
  15486. this.loadContent(_dda.responseText);
  15487. });
  15488. xhrMultiPart.Post(args);
  15489. }else{
  15490. args.load=dojo.hitch(this,function(_ddb,_ddc){
  15491. var _ddd=_ddc.xhr.getResponseHeader("Content-Type");
  15492. if(_ddd&&_ddd.indexOf("text/html")!=-1&&_ddb&&_ddb.match(/<ERROR_CODE>CAM_PASSPORT_ERROR<\/ERROR_CODE>/)){
  15493. this.handlePassportErrorFromDispatcher();
  15494. }else{
  15495. this.loadContent(_ddb);
  15496. }
  15497. });
  15498. dojo.xhrPost(args);
  15499. }
  15500. },isDropped:function(){
  15501. return this.m_bReportDropped;
  15502. },cleanupStyles:function(){
  15503. this._cssLimitReached=true;
  15504. if(!this.isVisible()){
  15505. if(!this._styles){
  15506. this._styles=[];
  15507. }
  15508. var id=this.getViewerId();
  15509. var _ddf=document.getElementsByTagName("head").item(0).getElementsByTagName("style");
  15510. for(var i=0;i<_ddf.length;i++){
  15511. var _de1=_ddf[i];
  15512. if(_de1.getAttribute&&_de1.getAttribute("namespaceId")==id){
  15513. _de1.parentNode.removeChild(_de1);
  15514. this._styles.push(_de1);
  15515. i--;
  15516. }
  15517. }
  15518. }
  15519. },reloadStyles:function(){
  15520. if(this._styles){
  15521. while(this._styles.length>0){
  15522. var _de2=this._styles.pop();
  15523. document.getElementsByTagName("head").item(0).appendChild(_de2);
  15524. }
  15525. }
  15526. },loadStylesAndScripts:function(_de3,_de4,_de5){
  15527. window.gScriptLoader.m_bIgnoreAjaxWarnings=true;
  15528. window.gScriptLoader.setHandlerStylesheetLimit(true);
  15529. var _de6=this.iContext.getRootElement();
  15530. if(!_de6){
  15531. return;
  15532. }
  15533. _de3=window.gScriptLoader.loadCSS(_de3,_de4,true,this.getViewerId());
  15534. if(dojo.isIE||dojo.isTrident){
  15535. _de3="<span style='display:none'>&nbsp;</span>"+_de3;
  15536. }
  15537. _de4.innerHTML=_de3;
  15538. if(this.isSelectionFilterEnabled()){
  15539. this.updateDrillThroughLinks();
  15540. }
  15541. var _de7=GUtil.generateCallback(this.fireResizeEvent,[],this);
  15542. this.m_sScriptLoaderNamespace=this.getViewerId();
  15543. window.gScriptLoader.loadAll(_de4,_de7,this.m_sScriptLoaderNamespace,_de5);
  15544. },fireResizeEvent:function(){
  15545. var _de8=this.getViewerObject();
  15546. if(_de8==null){
  15547. this.fireEvent("com.ibm.bux.widget.render.done",null,{});
  15548. }else{
  15549. var _de9=_de8.getViewerWidget();
  15550. if(_de9){
  15551. _de8.m_resizeReady=true;
  15552. _de8.doneLoading();
  15553. }else{
  15554. var _dea=this;
  15555. setTimeout(function(){
  15556. _dea.fireResizeEvent();
  15557. },100);
  15558. }
  15559. }
  15560. },getSavedReportSearchPath:function(_deb){
  15561. var _dec=this.getAttributeValue("savedReportPath");
  15562. if(_dec){
  15563. return _dec;
  15564. }
  15565. var _ded=this.getAttributeValue("dashboardID");
  15566. _ded=_ded.substr("$$dbid$$".length);
  15567. var _dee="storeID(\""+_ded+"\")/*[@name="+xpath_attr_encode(_deb)+"]";
  15568. return _dee;
  15569. },isSavedReport:function(_def,_df0){
  15570. return (typeof _df0!=="undefined"&&_df0!==null&&_df0.length>0&&_def!==_df0);
  15571. },getGlobalPromptsInfo:function(){
  15572. var _df1=null;
  15573. var oCV=null;
  15574. var _df3=[];
  15575. var _df4=null;
  15576. if(window.gaRV_INSTANCES){
  15577. for(var _df5=0;_df5<window.gaRV_INSTANCES.length;_df5++){
  15578. oCV=window.gaRV_INSTANCES[_df5];
  15579. _df4=oCV.getPromptParametersInfo();
  15580. if(_df4!=null){
  15581. _df3.push(_df4);
  15582. }
  15583. }
  15584. }
  15585. if(_df3.length>0){
  15586. _df1="<globalPromptInfo>"+_df3.join("")+"</globalPromptInfo>";
  15587. }
  15588. return _df1;
  15589. },buildPostUrl:function(){
  15590. return this.getAttributeValue("gateway");
  15591. },getSavedItem:function(){
  15592. var _df6=this.getAttributeValue("savedReportPath");
  15593. if(!_df6){
  15594. _df6=this.getAttributeValue("savedReportName");
  15595. }
  15596. return _df6;
  15597. },setRunReportOption:function(_df7){
  15598. this.m_bRunReportOption=_df7;
  15599. },getRunReportOption:function(){
  15600. return this.m_bRunReportOption;
  15601. },resetRunReportOption:function(){
  15602. this.m_bRunReportOption=null;
  15603. },buildPostContent:function(_df8){
  15604. var _df9=this.getAttributeValue("originalReport");
  15605. var _dfa=this.getSavedItem();
  15606. var _dfb=this.getAttributeValue("originalReportPart");
  15607. var _dfc=this.getAttributeValue("flexParam_properties");
  15608. var _dfd=this.getAttributeValue("flexParam_promptData");
  15609. var _dfe=this.isSavedReport(_df9,_dfa);
  15610. var _dff=this.getPromptRunOption(_dfd,_dfe);
  15611. var _e00=this.getAttributeValue("cv.outputKey")?"cvx.high":"cognosViewer";
  15612. var _e01={"b_action":_e00,"run.outputFormat":"HTML","bux":"true","cv.responseFormat":"iWidget","cv.id":this.getViewerId()};
  15613. if(this.isMobile()){
  15614. _e01["container"]="mobile";
  15615. }
  15616. if(this.getAttributeValue("cv.outputKey")){
  15617. _e01["cv.outputKey"]=this.getAttributeValue("cv.outputKey");
  15618. this.removeAttributeValue("cv.outputKey");
  15619. _e01["widget.id"]=this.getWidgetId();
  15620. }
  15621. if(this.getAttributeValue("gateway")){
  15622. _e01["cv.gateway"]=this.getAttributeValue("gateway");
  15623. }
  15624. if(this.getAttributeValue("webcontent")){
  15625. _e01["cv.webcontent"]=this.getAttributeValue("webcontent");
  15626. }
  15627. this.sInitialSpec=this.getAttributeValue("specification");
  15628. if(_dfe){
  15629. this.addUserParamsToContent(_e01);
  15630. }
  15631. if(!this.sInitialSpec||this.copyPasteResource){
  15632. if(_dfe){
  15633. _e01["ui.object"]=this.getSavedReportSearchPath(_dfa);
  15634. if(!this.getAttributeValue("savedReportPath")&&this.getAttributeValue("savedReportName")){
  15635. _e01["savedReportName"]=_dfa;
  15636. }
  15637. _e01["widget.isSavedReport"]="true";
  15638. _e01["ui.reRunObj"]=this.getSavedReportSearchPath(_dfa);
  15639. }else{
  15640. _e01["ui.object"]=_df9;
  15641. if(_dfc&&_dfc.length>0){
  15642. _e01["flexParamProperties"]=_dfc;
  15643. }
  15644. if(_dfd&&_dfd.length>0){
  15645. _e01["gdPromptAnswers"]=_dfd;
  15646. }
  15647. }
  15648. _e01["originalReport"]=_df9;
  15649. }
  15650. if(this.getAttributeValue("savedOutputSearchPath")!=null){
  15651. this.setSavedOutputSearchPath(this.getAttributeValue("savedOutputSearchPath"));
  15652. _e01["ui.savedOutputSearchPath"]=this.getAttributeValue("savedOutputSearchPath");
  15653. _e01["ui.action"]="buxView";
  15654. }else{
  15655. if(this.getAttributeValue("mostRecentSavedOutput")=="true"){
  15656. _e01["ui.action"]="buxView";
  15657. }else{
  15658. if(_dfe){
  15659. if(this.getAttributeValue("limitedInteractiveMode")==="true"){
  15660. _e01["limitedInteractiveMode"]="true";
  15661. _e01["ui.action"]="run";
  15662. _e01["run.xslURL"]="bux.xsl";
  15663. }else{
  15664. _e01["ui.action"]="bux";
  15665. }
  15666. if(this.getRunReportOption()!==null){
  15667. _e01["widget.runReport"]=(this.getRunReportOption())?"true":"false";
  15668. if(this.getDoGetParametersOnLoad()){
  15669. _e01["widget.globalPromptInfo"]="<globalPromptInfo></globalPromptInfo>";
  15670. }
  15671. this.resetRunReportOption();
  15672. }
  15673. }else{
  15674. if(_dfb&&_dfb.length>0&&this.copyPasteResource==null){
  15675. _e01["ui.reportDrop"]="true";
  15676. _e01["ui.action"]="bux";
  15677. _e01["reportpart_id"]=_dfb;
  15678. }else{
  15679. if(this.copyPasteResource){
  15680. if(this.ciPublishedReportPath!=null){
  15681. _e01["ui.object"]=this.ciPublishedReportPath;
  15682. }
  15683. var _e02=dojo.fromJson(this.copyPasteResource);
  15684. if(_e02[0]&&_e02[0].body){
  15685. var _e03=this.getAttributeValue("copy.conversation");
  15686. if(_e03){
  15687. _e01["ui.conversation"]=_e03;
  15688. }
  15689. if(_e02[0].body.specification){
  15690. _e01["ui.spec"]=_e02[0].body.specification;
  15691. _e01["ui.action"]="buxCopyPaste";
  15692. if(this.getAttributeValue("reportCreatedInCW")==="true"){
  15693. _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
  15694. }
  15695. }else{
  15696. _e01["ui.reportDrop"]="true";
  15697. _e01["ui.action"]="buxDropReportOnCanvas";
  15698. }
  15699. }
  15700. }else{
  15701. if(this.sInitialSpec){
  15702. _e01["ui.spec"]=this.sInitialSpec;
  15703. _e01["ui.action"]="buxRunSpecification";
  15704. _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
  15705. }else{
  15706. if(this._newReportInfo){
  15707. for(prop in this._newReportInfo){
  15708. _e01[prop]=this._newReportInfo[prop];
  15709. }
  15710. _e01["ui.reportDrop"]="true";
  15711. _e01["ui.action"]="bux";
  15712. _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
  15713. _e01["ui.objectClass"]="report";
  15714. _e01["openReportFromClipboard"]="true";
  15715. }else{
  15716. _e01["ui.reportDrop"]="true";
  15717. _e01["ui.action"]="buxDropReportOnCanvas";
  15718. }
  15719. }
  15720. }
  15721. }
  15722. }
  15723. }
  15724. }
  15725. if(_dff!==null){
  15726. _e01["run.prompt"]=(_dff?"true":"false");
  15727. }
  15728. if(this.getAttributeValue("lastLocaleSaved")!=null){
  15729. _e01["lastLocaleSaved"]=this.getAttributeValue("lastLocaleSaved");
  15730. }
  15731. var _e04="";
  15732. if(this.copyPasteResource){
  15733. _e04=this.updateCopyPasteFilters(_df8);
  15734. }else{
  15735. _e04=this.buildDataFiltersParam(_df8);
  15736. if(typeof _df8=="undefined"||_df8==null){
  15737. _e04=this.buildFiltersParamFromLoadedSliderState();
  15738. }
  15739. }
  15740. if(_e04!=""){
  15741. _e01["cv.updateDataFilters"]=_e04;
  15742. }
  15743. if(this.properties&&this.properties.getFlashCharts()!==null){
  15744. _e01["savedFlashChartOption"]=(this.properties.getFlashCharts()?"true":"false");
  15745. var _e05=this.getAttributeValue("hasAVSChart");
  15746. if(_e05=="true"){
  15747. _e01["hasAVSChart"]="true";
  15748. }else{
  15749. _e01["hasAVSChart"]="false";
  15750. }
  15751. }
  15752. if(this.properties.getRowsPerPage()!=null){
  15753. _e01["run.verticalElements"]=this.properties.getRowsPerPage();
  15754. }
  15755. var _e06=this.getAttributeValue("syncNewWidgets");
  15756. if(_e06===null||_e06==="true"){
  15757. _e06=true;
  15758. }else{
  15759. _e06=false;
  15760. }
  15761. if(!_dfe&&_e06){
  15762. var _e07=this.getGlobalPromptsInfo();
  15763. if(_e07!==null){
  15764. _e01["widget.globalPromptInfo"]=_e07;
  15765. }
  15766. }
  15767. if(this.isOpeningSavedDashboard()){
  15768. _e01["ui.preserveRapTags"]="true";
  15769. }
  15770. if(_dfe===true&&this.getAttributeValue("limitedInteractiveMode")!=="true"){
  15771. this.getUserId();
  15772. }
  15773. if(window.cognosViewerDebug){
  15774. _e01.debug=true;
  15775. }
  15776. _e01["cv.buxCurrentUserRole"]=this.getUserRole();
  15777. if(this.shouldUseSavedReportInfo()){
  15778. _e01["rap.getReportInfo"]="false";
  15779. }
  15780. if(window.icdConfig&&window.icdConfig.ZIPIMode!="0"){
  15781. this.addBUXRTStateInfoToContent(_e01);
  15782. }
  15783. this.addBUXWidgetTitleToContent(_e01);
  15784. return _e01;
  15785. },addBUXRTStateInfoToContent:function(_e08){
  15786. if(_e08!=null){
  15787. var _e09=this.getBUXRTStateInfoMap();
  15788. if(_e09&&_e09.length>0){
  15789. _e08["cv.buxRTStateInfo"]=_e09;
  15790. }
  15791. }
  15792. },addBUXWidgetTitleToContent:function(_e0a){
  15793. if(_e0a!=null){
  15794. var _e0b=this.getAttributeValue("widgetTitle");
  15795. if(_e0b&&_e0b.length>0){
  15796. _e0a["widgetTitle"]=_e0b;
  15797. }
  15798. var _e0c=this.getDisplayName();
  15799. if(_e0c&&_e0c.length>0){
  15800. _e0a["displayTitle"]=_e0c;
  15801. }
  15802. }
  15803. },addUserParamsToContent:function(_e0d){
  15804. var _e0e=this.getAttributeValue("userParams");
  15805. if(!_e0e){
  15806. return;
  15807. }
  15808. var doc=XMLBuilderLoadXMLFromString(_e0e);
  15809. if(!doc){
  15810. return;
  15811. }
  15812. var _e10=XMLHelper_FindChildrenByTagName(doc.documentElement,"item",false);
  15813. var _e11=_e10.length;
  15814. for(var i=0;i<_e11;i++){
  15815. if(!_e10[i]){
  15816. continue;
  15817. }
  15818. var _e13=XMLHelper_FindChildByTagName(_e10[i],"name",false);
  15819. if(!_e13){
  15820. continue;
  15821. }
  15822. var _e14=XMLHelper_FindChildByTagName(_e10[i],"value",false);
  15823. _e0d[XMLHelper_GetText(_e13)]=(!_e14?"":XMLHelper_GetText(_e14));
  15824. }
  15825. if(_e11>0){
  15826. _e0d["widget.userParameters"]="true";
  15827. if(this.getAttributeValue("viewerReportPrompts")){
  15828. _e0d["viewerReportPrompts"]=this.getAttributeValue("viewerReportPrompts");
  15829. }
  15830. }
  15831. this.removeAttributeValue("userParams");
  15832. },shouldUseSavedReportInfo:function(){
  15833. return this.getAttributeValue("rapReportInfoVersion")===this.RAP_REPORT_INFO_VERSION&&this.getAttributeValue("rapReportInfo")!=null;
  15834. },isConsumeUser:function(){
  15835. return this.getUserRole()==="consume";
  15836. },getUserRole:function(){
  15837. var _e15=null;
  15838. var _e16=this.iContext.getItemSet("buxuserprofile",false);
  15839. if(_e16){
  15840. _e15=_e16.getItemValue("currentUserRole");
  15841. }
  15842. return _e15==null?"assemble":_e15;
  15843. },getUserId:function(){
  15844. dojo["require"]("bux.UserAccount");
  15845. return bux.UserAccount.getUserAccount().then(dojo.hitch(this,function(_e17){
  15846. this.m_sUserId=_e17.cm$searchPath;
  15847. return this.m_sUserId;
  15848. }));
  15849. },_genMobileFormFieldPayload:function(form){
  15850. var _e19={};
  15851. var _e1a=form.getElementsByTagName("input");
  15852. if(_e1a){
  15853. for(var i=0;i<_e1a.length;i++){
  15854. var name=_e1a[i].getAttribute("name");
  15855. var _e1d=_e1a[i].getAttribute("value");
  15856. if(name&&_e1d){
  15857. _e19[name]=_e1d;
  15858. }
  15859. }
  15860. }
  15861. return _e19;
  15862. },launchGotoPageForIWidgetMobile:function(form){
  15863. var _e1f={"action":"goto","payload":this._genMobileFormFieldPayload(form)};
  15864. if(typeof console!="undefined"&&console&&console.log){
  15865. console.log(_e1f);
  15866. }
  15867. this.fireEvent("com.ibm.bux.widget.openView",null,_e1f);
  15868. },executeDrillThroughForIWidgetMobile:function(form){
  15869. var _e21=getChildElementsByAttribute(form,"input","name","ui.action");
  15870. if(_e21&&_e21.length>0){
  15871. _e21[0].setAttribute("value","authoredDrillThroughMobile");
  15872. }
  15873. var _e22={"action":"drillThrough","payload":this._genMobileFormFieldPayload(form)};
  15874. if(typeof console!="undefined"&&console&&console.log){
  15875. console.log(_e22);
  15876. }
  15877. this.fireEvent("com.ibm.bux.widget.openView",null,_e22);
  15878. },isBuxAvailable:function(){
  15879. return (this.bux&&this.bux._base?true:false);
  15880. },getDrillOptions:function(){
  15881. return this.properties.getDrillOptions();
  15882. },getPromptRunOption:function(_e23,_e24){
  15883. if(!_e24&&_e23&&_e23.length>0){
  15884. return false;
  15885. }else{
  15886. if(_e24){
  15887. return this.properties.getPromptUserOnLoad();
  15888. }else{
  15889. return null;
  15890. }
  15891. }
  15892. },buildDataFiltersParam:function(_e25){
  15893. var _e26="";
  15894. if(_e25&&_e25.length>0){
  15895. this.sliderState={};
  15896. _e26="<UpdateDataFilters>";
  15897. for(var _e27=0;_e27<_e25.length;++_e27){
  15898. var _e28=_e25[_e27];
  15899. var _e29=dojo.fromJson(_e28);
  15900. if(_e29.clientId==this.getWidgetId()){
  15901. continue;
  15902. }
  15903. if(!(_e29["com.ibm.widget.context.bux.selectValueControl"])){
  15904. this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_e29);
  15905. this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_e29);
  15906. _e28=dojo.toJson(_e29);
  15907. }
  15908. _e26+="<filter>"+xml_encode(_e28)+"</filter>";
  15909. this.sliderState[_e29.clientId]=_e28;
  15910. }
  15911. _e26+="</UpdateDataFilters>";
  15912. }
  15913. return _e26;
  15914. },updateCopyPasteFilters:function(_e2a){
  15915. this.loadSliderState();
  15916. if(this.sliderState){
  15917. for(var _e2b in this.sliderState){
  15918. this.sliderState[_e2b]="{'clientId':'"+_e2b+"',\t'com.ibm.widget.context':{},'com.ibm.widget.context.bux.selectValueControl':"+"{'selectValueControl':{'id':'"+_e2b+"','controlType':'slider','type':'discrete','valueType':'string'}}}";
  15919. }
  15920. }
  15921. if(_e2a&&_e2a.length>0){
  15922. for(var _e2c=0;_e2c<_e2a.length;++_e2c){
  15923. var _e2d=_e2a[_e2c];
  15924. var _e2e=dojo.fromJson(_e2d);
  15925. if(_e2e["com.ibm.widget.context.bux.selection"]){
  15926. this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_e2e);
  15927. this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_e2e);
  15928. _e2d=dojo.toJson(_e2e);
  15929. }
  15930. this.sliderState[_e2e.clientId]=_e2d;
  15931. }
  15932. }
  15933. return this.buildDataFiltersParam_fromState();
  15934. },buildFiltersParamFromLoadedSliderState:function(){
  15935. var _e2f="";
  15936. this.loadSliderState();
  15937. _e2f=this.buildDataFiltersParam_fromState();
  15938. return _e2f;
  15939. },loadSliderState:function(){
  15940. this.sliderState={};
  15941. var _e30=dojo.fromJson(this.getAttributeValue("sliderIDs"));
  15942. if(_e30){
  15943. for(var i=0;i<_e30.length;++i){
  15944. var _e32=_e30[i];
  15945. var _e33=this.getItemValue("sliderState_"+_e32);
  15946. if(_e33!=null&&_e33!=""){
  15947. this.sliderState[_e32]=_e33;
  15948. }
  15949. }
  15950. }
  15951. },buildDataFiltersParam_fromState:function(){
  15952. var _e34="";
  15953. if(this.sliderState){
  15954. for(var _e35 in this.sliderState){
  15955. _e34+="<filter>"+xml_encode(this.sliderState[_e35])+"</filter>";
  15956. }
  15957. if(_e34!==""){
  15958. return ("<UpdateDataFilters>"+_e34+"</UpdateDataFilters>");
  15959. }
  15960. }
  15961. return _e34;
  15962. },loadContent:function(_e36){
  15963. var _e37=dojo.byId("_"+this.iContext.widgetId+"_cv");
  15964. this.loadStylesAndScripts(_e36,_e37,true);
  15965. if(!window.gScriptLoader.hasCompletedExecution()){
  15966. var obj=this;
  15967. this.timer=setInterval(function(){
  15968. window.gInitializeViewer(obj);
  15969. },this.timerInterval);
  15970. }else{
  15971. window.gInitializeViewer(this);
  15972. }
  15973. this.viewerWidgetLastAction=null;
  15974. },executeAction:function(evt,_e3a){
  15975. var _e3b=this.getViewerObject();
  15976. if(evt&&_e3b){
  15977. var _e3c=_e3a?_e3a:evt.payload.name;
  15978. var _e3d=evt.payload;
  15979. if(_e3c&&typeof _e3d!="undefined"&&_e3d!=null){
  15980. if(evt.payload.payload){
  15981. _e3d=evt.payload.payload;
  15982. }
  15983. _e3b.executeAction(_e3c,_e3d);
  15984. }
  15985. }
  15986. },onContextMenuAction:function(evt){
  15987. this.executeAction(evt);
  15988. },onToolbarAction:function(evt){
  15989. this.executeAction(evt);
  15990. },updateToolbar:function(){
  15991. var _e40=this.getViewerObject();
  15992. if(!_e40||(!this.bToolbarInitialized&&typeof CognosViewerAction!="function")){
  15993. return;
  15994. }
  15995. if(_e40.getStatus()==="prompting"){
  15996. return;
  15997. }
  15998. var _e41=_e40.getToolbar();
  15999. CCognosViewerToolbarHelper.updateToolbarForCurrentSelection(_e40,_e41);
  16000. this.fireEvent("com.ibm.bux.widgetchrome.toolbar.init",null,_e40.getToolbar());
  16001. },onSelect:function(){
  16002. if(!this.bToolbarInitialized){
  16003. this.bToolbarInitialized=true;
  16004. var _e42=this.getViewerObject();
  16005. if(_e42){
  16006. var _e43=_e42.getStatus();
  16007. if(_e43!=="prompting"&&_e43!=="working"&&_e43!="stillWorking"){
  16008. this.updateToolbar();
  16009. }
  16010. }
  16011. }
  16012. this.fireEvent("com.ibm.bux.widget.select.done",null,{});
  16013. },hideToolbarAndContextMenu:function(){
  16014. this.fireEvent("com.ibm.bux.widget.contextMenu.update");
  16015. this.fireEvent("com.ibm.bux.widgetchrome.toolbar.init");
  16016. },updateSavedAttributes:function(_e44){
  16017. this.setAttributeValue("version",this.BUX_REPORT_VERSION);
  16018. this.setAttributeValue("viewerProperties",this.properties.toString());
  16019. if(this.m_oWidgetContextManager.getSelectionFilterObjects()){
  16020. this.setAttributeValue("selectionObjects",this.m_oWidgetContextManager.toStringSelectionFilterObjects());
  16021. }
  16022. if(_e44==="live"){
  16023. var oCV=this.getViewerObject();
  16024. var _e46=this.getEnvParam("reportPrompts");
  16025. if(this.promptParametersRetrieved==true&&_e46&&_e46.length>0){
  16026. this.setAttributeValue("viewerReportPrompts",this.getEnvParam("reportPrompts"));
  16027. }
  16028. this.setAttributeValue("promptParametersRetrieved",(this.promptParametersRetrieved?"true":"false"));
  16029. this.setAttributeValue("selectionFilterEnabled",this.m_bSelectionFilterSwitch?"true":"false");
  16030. if(this.getEnvParam("reportpart_id")&&this.getEnvParam("reportpart_id").length>0){
  16031. this.setAttributeValue("fromReportPart","true");
  16032. }
  16033. if(this.isLimitedInteractiveMode()){
  16034. this.setAttributeValue("limitedInteractiveMode","true");
  16035. }else{
  16036. this.setAttributeValue("baseReportModificationTime",oCV.envParams["baseReportModificationTime"]);
  16037. }
  16038. var _e47=oCV.envParams["contentLocale"];
  16039. if(_e47!=null){
  16040. this.saveSliderState();
  16041. this.setAttributeValue("lastLocaleSaved",_e47);
  16042. }
  16043. this.setAttributeValue("originalReportLocation",oCV.envParams["originalReportLocation"]);
  16044. this.setAttributeValue("hasAVSChart",oCV.hasAVSChart()?"true":"false");
  16045. this.setAttributeValue("displayTypes",this.getDisplayTypes());
  16046. this.setSavedOutputsCMResponse(null);
  16047. if(oCV.getPinFreezeManager()){
  16048. var _e48=oCV.getPinFreezeManager().toJSONString();
  16049. this.setAttributeValue("PinFreezeInfo",_e48);
  16050. }
  16051. if(oCV.envParams["rapReportInfo"]){
  16052. this.setAttributeValue("rapReportInfoVersion",this.RAP_REPORT_INFO_VERSION);
  16053. this.setAttributeValue("rapReportInfo",oCV.envParams["rapReportInfo"]);
  16054. }
  16055. }
  16056. if(_e44==="savedOutput"){
  16057. if(this.getSavedOutputSearchPath()==null){
  16058. this.setAttributeValue("mostRecentSavedOutput","true");
  16059. }else{
  16060. this.setAttributeValue("savedOutputSearchPath",this.getSavedOutputSearchPath());
  16061. }
  16062. this.setAttributeValue("selectionFilterEnabled",this.m_bSelectionFilterSwitch?"true":"false");
  16063. }
  16064. },onItemSetChanged:function(_e49){
  16065. if(this.getViewerObject()){
  16066. var _e4a=_e49.payload.changes;
  16067. for(var i in _e4a){
  16068. if(_e4a[i].id==="savedReportPath"&&_e4a[i].newVal){
  16069. this.updateCVEnvParam();
  16070. }
  16071. }
  16072. }
  16073. },updateCVEnvParam:function(){
  16074. var oCV=this.getViewerObject();
  16075. oCV.envParams["ui.objectClass"]=this.isSavedOutput()?"reportView":"report";
  16076. oCV.envParams["widget.isSavedReport"]="true";
  16077. var _e4d=this.getAttributeValue("savedReportName");
  16078. if(_e4d){
  16079. oCV.envParams["ui.object"]=_e4d;
  16080. oCV.envParams["savedReportName"]=_e4d;
  16081. }else{
  16082. oCV.envParams["ui.object"]=this.getAttributeValue("savedReportPath");
  16083. }
  16084. },onWidgetSave:function(evt){
  16085. var _e4f=this.getViewerObject();
  16086. var _e50={"status":false};
  16087. if(evt&&evt.payload&&evt.payload.isCopy===true){
  16088. this.setAttributeValue("copy.conversation",_e4f.getConversation());
  16089. }else{
  16090. this.removeItem("copy.conversation");
  16091. this.removeItem("copy.ciPublishedReportPath");
  16092. }
  16093. var _e51=evt&&evt.payload&&evt.payload.operation=="saveAs"?true:false;
  16094. if(!_e4f&&!_e51){
  16095. this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
  16096. return;
  16097. }
  16098. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16099. var _e52=this.getViewerObject();
  16100. _e52.loadExtra();
  16101. if(this.isSavedOutput()){
  16102. this.cleanSavedAttributes();
  16103. this.updateSavedAttributes("savedOutput");
  16104. _e50.status=true;
  16105. this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
  16106. }else{
  16107. if(this.sInitialSpec){
  16108. _e50.status=true;
  16109. this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
  16110. }else{
  16111. var _e53=this.getEnvParam("cv.objectPermissions");
  16112. var _e54=new ViewerIWidgetSave(this,evt.payload);
  16113. if(!_e54.canSave(_e53)){
  16114. this.showErrorMessage(RV_RES.IDS_CANNOT_SAVE_CONTENT_ERROR);
  16115. this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
  16116. return;
  16117. }
  16118. if(this.isLimitedInteractiveMode()||(_e52.envParams["ui.spec"]&&_e52.envParams["ui.spec"].length>0)){
  16119. this.cleanSavedAttributes();
  16120. this.updateSavedAttributes("live");
  16121. if(_e54.doGetSavePropertiesFromServer()){
  16122. _e54.getSavePropertiesFromServer();
  16123. }else{
  16124. this.doWidgetSaveDone(_e54);
  16125. }
  16126. }else{
  16127. if(!_e52.envParams["ui.spec"]){
  16128. _e54.setDoCWCopy(true);
  16129. this.doWidgetSaveDone(_e54);
  16130. }else{
  16131. this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
  16132. }
  16133. }
  16134. }
  16135. }
  16136. }),evt);
  16137. },doWidgetSaveDone:function(_e55){
  16138. var _e56=_e55.getPayload();
  16139. _e56.status=true;
  16140. if(window.icdConfig&&window.icdConfig.ZIPIMode!="0"){
  16141. var _e57=_e55.m_payload.dashboard;
  16142. if(_e57){
  16143. this._BUXDBInfoArray=this.getBUXDBInfoArray({dbTitle:_e57.title._text,dbSearchPath:_e57.cm$searchPath});
  16144. }
  16145. }
  16146. this.fireEvent("com.ibm.bux.widget.save.done",null,_e56);
  16147. },handleGetSavePropertiesFromServerResponse:function(_e58,_e59){
  16148. var _e5a=new ViewerIWidgetSave(this,_e59);
  16149. if(_e58&&_e58.getJSONResponseObject()){
  16150. applyJSONProperties(this.getViewerObject(),_e58.getJSONResponseObject());
  16151. }
  16152. this.doWidgetSaveDone(_e5a);
  16153. },isPreCaspianRP1BUXReport:function(){
  16154. var _e5b=this.getAttributeValue("version");
  16155. if(!_e5b||_e5b<this.BUX_REPORT_CASPIAN_RP1_VERSION){
  16156. return true;
  16157. }
  16158. return false;
  16159. },isGoDashboardReportUpgrade:function(){
  16160. var _e5c=this.getAttributeValue("version");
  16161. if(_e5c==this.GODASHBOARD_REPORT_VERSION){
  16162. return true;
  16163. }
  16164. return false;
  16165. },isOpeningSavedDashboard:function(){
  16166. var _e5d=this.getAttributeValue("viewerProperties");
  16167. if((_e5d&&_e5d.indexOf("{")===0)||this.isGoDashboardReportUpgrade()){
  16168. return true;
  16169. }
  16170. return false;
  16171. },cleanSavedAttributes:function(){
  16172. this.removeAttributeValue("savedOutputSearchPath");
  16173. this.removeAttributeValue("mostRecentSavedOutput");
  16174. this.removeAttributeValue("savedReportName");
  16175. this.removeAttributeValue("dashboardID");
  16176. this.removeAttributeValue("savedReportId");
  16177. this.removeAttributeValue("baseReportModificationTime");
  16178. this.removeAttributeValue("viewerReportPrompts");
  16179. this.removeAttributeValue("promptParametersRetrieved");
  16180. this.removeAttributeValue("selectionFilterEnabled");
  16181. this.removeAttributeValue("PinFreezeInfo");
  16182. this.removeAttributeValue("rapReportInfoVersion");
  16183. this.removeAttributeValue("rapReportInfo");
  16184. this.removeAttributeValue("selectionObjects");
  16185. if(this.isSavedOutput()){
  16186. this.removeAttributeValue("savedReportPath");
  16187. }
  16188. },handleWidgetSaveDone:function(_e5e){
  16189. var oCV=this.getViewerObject();
  16190. var _e60=_e5e.getResult();
  16191. if(_e60===null){
  16192. _e60={};
  16193. }
  16194. this.cleanSavedAttributes();
  16195. this.updateSavedAttributes("live");
  16196. var _e61=_e60.reportName;
  16197. var _e62=_e60.dashboard_id;
  16198. this.setAttributeValue("savedReportName",_e61);
  16199. this.setAttributeValue("dashboardID","$$dbid$$"+_e62);
  16200. if(_e60.permissions){
  16201. oCV.envParams["cv.objectPermissions"]=_e60.permissions;
  16202. }
  16203. if(_e60.objectClass){
  16204. oCV.envParams["ui.objectClass"]=_e60.objectClass;
  16205. }
  16206. if(this.getEnvParam("reportpart_id")&&this.getEnvParam("reportpart_id").length>0){
  16207. this.setAttributeValue("fromReportPart","true");
  16208. }
  16209. if(this.isLimitedInteractiveMode()){
  16210. this.setAttributeValue("limitedInteractiveMode","true");
  16211. }else{
  16212. this.setAttributeValue("baseReportModificationTime",oCV.envParams["baseReportModificationTime"]);
  16213. }
  16214. var _e63=oCV.envParams["contentLocale"];
  16215. if(_e63!=null){
  16216. this.saveSliderState();
  16217. this.setAttributeValue("lastLocaleSaved",_e63);
  16218. }
  16219. this.setAttributeValue("originalReportLocation",oCV.envParams["originalReportLocation"]);
  16220. oCV.envParams["ui.object"]=this.getSavedReportSearchPath(_e61);
  16221. oCV.envParams["savedReportName"]=_e61;
  16222. this.setAttributeValue("hasAVSChart",oCV.hasAVSChart()?"true":"false");
  16223. this.setAttributeValue("displayTypes",this.getDisplayTypes());
  16224. this.setSavedOutputsCMResponse(null);
  16225. var _e64={"status":true};
  16226. this.fireEvent("com.ibm.bux.widget.save.done",null,_e64);
  16227. },getDisplayTypes:function(){
  16228. var oCV=this.getViewerObject();
  16229. if(oCV.getRAPReportInfo()){
  16230. return oCV.getRAPReportInfo().getDisplayTypes();
  16231. }
  16232. },saveSliderState:function(){
  16233. var _e66=this.getViewerObject();
  16234. var _e67=_e66.getRAPReportInfo();
  16235. var _e68={};
  16236. if(_e67){
  16237. _e68=_e67.collectSliderSetFromReportInfo();
  16238. }
  16239. var i=0;
  16240. var _e6a=[];
  16241. for(var _e6b in this.sliderState){
  16242. if(typeof _e68[_e6b]!="undefined"){
  16243. this.setItemValue("sliderState_"+_e6b,this.sliderState[_e6b]);
  16244. _e6a[i++]=_e6b;
  16245. }else{
  16246. this.removeItem("sliderState_"+_e6b);
  16247. }
  16248. }
  16249. this.setAttributeValue("sliderIDs",dojo.toJson(_e6a));
  16250. },onWidgetRefresh:function(evt){
  16251. var _e6d={};
  16252. var _e6e=this.getViewerObject();
  16253. if(evt&&_e6e){
  16254. if(_e6e.envParams["ui.action"]=="view"||_e6e.envParams["ui.action"]=="buxView"){
  16255. _e6e.executeAction("RefreshViewEvent");
  16256. }else{
  16257. if(evt.payload&&evt.payload.refreshType=="preferencesChanged"){
  16258. this.clearRAPCache();
  16259. _e6e.executeAction("EditContent",{"preferencesChanged":true});
  16260. _e6e.executeAction("Reprompt",{"preferencesChanged":true});
  16261. }else{
  16262. if(!this.isVisible()){
  16263. this.getDelayedLoadingContext().setForceRunReport(true);
  16264. }else{
  16265. _e6e.executeAction("Refresh");
  16266. }
  16267. }
  16268. }
  16269. this.fireEvent("com.ibm.bux.widget.refresh.done",null,_e6d);
  16270. }
  16271. },invokeDisplayTypeDialog:function(_e6f,_e70){
  16272. if(!this.m_chart){
  16273. this.m_chart=new bux.reportViewer.chart();
  16274. }
  16275. var _e71=this.m_chart.getDisplayTypeDialogDefinition(_e6f);
  16276. var _e72={"supportedChartTypes":_e71,"suggestedDisplayTypes":_e70};
  16277. this.fireEvent("com.ibm.bux.widget.invokeDisplayTypeDialog",null,_e72);
  16278. },onChangeDisplayType:function(evt){
  16279. var _e74=this.getViewerObject();
  16280. if(evt&&_e74){
  16281. _e74.executeAction("ChangeDisplayType",evt.payload);
  16282. }
  16283. },onDisplayTypeDialogVariations:function(evt){
  16284. var _e76=this.getViewerObject();
  16285. if(evt&&_e76){
  16286. _e76.executeAction("ChangeDisplayVariations",evt.payload);
  16287. }
  16288. },updateDisplayTypeDialogVariations:function(_e77,_e78){
  16289. if(!this.m_chart){
  16290. this.m_chart=new bux.reportViewer.chart();
  16291. }
  16292. var _e79=this.m_chart.getDisplayTypeDialogDefinition(_e77);
  16293. var _e7a={"supportedChartTypes":_e79,"variationGroups":_e78};
  16294. this.fireEvent("com.ibm.bux.widget.updateDisplayTypeDialogVariations",null,_e7a);
  16295. },onGetDisplayTitleDone:function(evt){
  16296. if(evt&&evt.payload&&evt.payload.callback){
  16297. evt.payload.callback(evt.payload.title);
  16298. }
  16299. },getWidgetStoreID:function(){
  16300. if(typeof this.widgetStoreId==="undefined"){
  16301. if(!this.widgetStoreIdDfd){
  16302. this.widgetStoreIdDfd=new dojo.Deferred();
  16303. }
  16304. return this.widgetStoreIdDfd;
  16305. }
  16306. return this.widgetStoreId;
  16307. },setWidgetStoreID:function(_e7c){
  16308. this.widgetStoreId=_e7c;
  16309. if(this.widgetStoreIdDfd){
  16310. this.widgetStoreIdDfd.callback(this.widgetStoreId);
  16311. this.widgetStoreIdDfd=null;
  16312. }
  16313. },onUpdateWidgetStoreIDDone:function(evt){
  16314. var _e7e=evt.payload.storeID;
  16315. var _e7f="storeID(\"";
  16316. if(_e7e&&(_e7e.indexOf(_e7f)>-1)){
  16317. _e7e=_e7e.substr(_e7f.length,_e7e.length-_e7f.length-1);
  16318. }
  16319. dojo.when(this.getWidgetStoreID(),dojo.hitch(this,function(_e80){
  16320. if(_e80&&_e80!=_e7e){
  16321. this._copyComments(_e80,_e7e);
  16322. }
  16323. }));
  16324. this.setWidgetStoreID(_e7e);
  16325. },_copyComments:function(_e81,_e82){
  16326. var _e83=this.buildPostUrl();
  16327. if(_e83){
  16328. var _e84=new XmlHttpObject();
  16329. _e84.addFormField("b_action","cognosViewer");
  16330. _e84.addFormField("widgetOldStoreID",_e81);
  16331. _e84.addFormField("widgetStoreID",_e82);
  16332. _e84.addFormField("ui.action","cloneAnnotations");
  16333. _e84.addFormField("cv.responseFormat","json");
  16334. _e84.sendHtmlRequest("POST",_e83,"",true);
  16335. }
  16336. },onRemoveDone:function(evt){
  16337. this.destroy();
  16338. },onGetProperties:function(evt){
  16339. this.initializeProperties();
  16340. this.fireEvent("com.ibm.bux.widget.properties.get.done",null,this.properties.onGet());
  16341. },onSetProperties:function(evt){
  16342. if(evt&&evt.payload&&evt.payload.properties){
  16343. this.properties.onSet(evt.payload);
  16344. }
  16345. this.fireEvent("com.ibm.bux.widget.properties.set.done");
  16346. var _e88={"modified":true};
  16347. this.fireEvent("com.ibm.bux.widget.modified",null,_e88);
  16348. },getProperties:function(){
  16349. return this.properties;
  16350. },clearPropertiesDialog:function(){
  16351. if(this.properties){
  16352. this.properties.clearDialogSpec();
  16353. }
  16354. },onGenericSelectValueControl:function(evt,_e8a){
  16355. if(evt){
  16356. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16357. var _e8b=false;
  16358. var _e8c=this._getFilterPayload(evt);
  16359. var _e8d=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValueControlTypeFromPayload(_e8c):null;
  16360. if(_e8d&&_e8d!=="facet"){
  16361. var _e8e=dojo.clone(evt);
  16362. this.preProcessFilterValues(_e8e);
  16363. this.m_oWidgetContextManager.updateFilterContext(_e8e.payload);
  16364. _e8b=this.onFilter(_e8e,_e8a);
  16365. }else{
  16366. this.m_oWidgetContextManager.updateFilterContext(_e8c);
  16367. _e8b=this.onFilter(evt,_e8a);
  16368. }
  16369. return _e8b;
  16370. }),evt.source);
  16371. }
  16372. },onFilter:function(evt,_e90){
  16373. if(evt){
  16374. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16375. var _e91=false;
  16376. if(this.isLiveReport()===false){
  16377. return _e91;
  16378. }
  16379. var _e92=this._getFilterPayload(evt);
  16380. var _e93=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValueControlTypeFromPayload(_e92):null;
  16381. var _e94=null;
  16382. var _e95=this.m_oWidgetContextManager.getItemNames(_e92);
  16383. var _e96=false;
  16384. for(var i=0;!_e96&&i<_e95.length;i++){
  16385. _e94=_e95[i];
  16386. _e96=this.canFilter(_e92,_e94,_e93,evt);
  16387. }
  16388. if(_e94==null&&!_e96){
  16389. _e96=this.canFilter(_e92,_e94,_e93,evt);
  16390. }
  16391. if(_e96){
  16392. var _e98={};
  16393. var _e99=this._getDrillResetHUNForFacet(_e94,_e93);
  16394. if(_e99&&_e99.length>0){
  16395. _e98.drillResetHUN=_e99;
  16396. }
  16397. var _e9a=(evt.type=="string")?evt.payload:dojo.toJson(evt.payload);
  16398. this.sliderState[evt.source]=_e9a;
  16399. _e98.filterPayload=_e9a;
  16400. _e98.isFacet=("facet"===_e93);
  16401. if(_e90){
  16402. _e98.forceCleanup=this.m_oWidgetContextManager.genRemoveDiscreteFilterPayload(this.getWidgetId());
  16403. }
  16404. this.getViewerObject().executeAction("UpdateDataFilter",_e98);
  16405. if(!this.shouldReportBeRunOnAction()){
  16406. this.getLoadManager().getDelayedLoadingContext().setForceRunReport(true);
  16407. }
  16408. _e91=true;
  16409. }
  16410. return _e91;
  16411. }),evt.source);
  16412. }
  16413. },clearSelectionFilter:function(){
  16414. if(this.m_oWidgetContextManager){
  16415. var _e9b=this.m_oWidgetContextManager.genEmptySelectionPayload(this.getViewerObject(),this.getWidgetId());
  16416. this._fireContextChangedEvent(_e9b,false);
  16417. }
  16418. },broadcastSelectionFilter:function(){
  16419. this.onSelectionChange();
  16420. },onSelectionChange:function(){
  16421. if(this.isSelectionFilterEnabled()){
  16422. var _e9c=(this.getContainerTypeForSelection()==="list");
  16423. var _e9d=this.m_oWidgetContextManager.genSelectionPayload(this.getViewerObject(),this.getWidgetId(),_e9c);
  16424. this._fireContextChangedEvent(_e9d,!this.m_oWidgetContextManager.isSelectionPayloadForReset(_e9d));
  16425. }
  16426. },_fireContextChangedEvent:function(_e9e,_e9f){
  16427. this.setSelectionFilterSent(_e9f);
  16428. this.fireEvent("com.ibm.widget.contextChanged",null,_e9e);
  16429. },somethingSelected:function(){
  16430. var oCV=this.getViewerObject();
  16431. return (oCV&&oCV.getSelectionController()&&oCV.getSelectionController().getAllSelectedObjects().length>0);
  16432. },selectionFilterSent:function(){
  16433. return this.m_bSelectionFilterSent;
  16434. },setSelectionFilterSent:function(flag){
  16435. this.m_bSelectionFilterSent=flag;
  16436. },reselectSelectionFilterObjects:function(){
  16437. if(this.isSelectionFilterEnabled()){
  16438. var oCV=this.getViewerObject();
  16439. var _ea3=oCV.getSelectionController();
  16440. var _ea4=this.m_oWidgetContextManager.getSelectionFilterObjects();
  16441. if(!_ea4){
  16442. var str=this.getAttributeValue("selectionObjects");
  16443. if(str&&str.length>0){
  16444. _ea4=eval(str);
  16445. this.m_oWidgetContextManager.setSelectionFilterObjects(_ea4);
  16446. this.removeAttributeValue("selectionObjects");
  16447. }
  16448. }
  16449. if(_ea4&&_ea4.length>0){
  16450. var _ea6=new ReselectAction(oCV,_ea4);
  16451. _ea6.executeAction();
  16452. }
  16453. }
  16454. },_getFilterPayload:function(evt){
  16455. return (evt.type=="string"?dojo.fromJson(evt.payload):evt.payload);
  16456. },_getFilterPayloadItemName:function(_ea8){
  16457. var _ea9=_ea8.name;
  16458. if(!_ea8.name){
  16459. _ea9=this.m_oWidgetContextManager.getFilterFirstItemName();
  16460. }
  16461. return _ea9;
  16462. },canFilter:function(_eaa,_eab,_eac,evt){
  16463. var _eae;
  16464. var _eaf=this.getRAPCachedItem("filterableItems");
  16465. if(_eac!=="facet"&&typeof _eab!="undefined"&&_eab!=null&&_eaf!=null){
  16466. for(var type in _eaf){
  16467. for(_eae=0;_eae<_eaf[type].length;++_eae){
  16468. if(_eaf[type][_eae].name==_eab||_eaf[type][_eae].label==_eab){
  16469. return true;
  16470. }
  16471. }
  16472. }
  16473. }else{
  16474. var _eb1=this.getViewerObject();
  16475. var _eb2=_eb1.getRAPReportInfo();
  16476. if(_eb2){
  16477. var _eb3=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValuePropertyFromPayload(_eaa,"dimension"):null;
  16478. var _eb4=_eb2.getContainers();
  16479. for(var lid in _eb4){
  16480. var _eb6=_eb4[lid];
  16481. var _eb7=_eb6.sliders;
  16482. if(_eb7&&_eb7.length){
  16483. for(var _eb8=0;_eb8<_eb7.length;++_eb8){
  16484. var _eb9=_eb7[_eb8];
  16485. if(_eb9.clientId==_eaa.clientId||(_eb9.clientId==evt.source)||(_eb9.clientId==_eb9.name&&_eb9.name==_eab)){
  16486. return true;
  16487. }
  16488. }
  16489. }
  16490. var _eba=_eb6.itemInfo;
  16491. if(_eba&&_eba.length){
  16492. for(var _ebb=0;_ebb<_eba.length;++_ebb){
  16493. if(_eba[_ebb].item==_eab){
  16494. return true;
  16495. }
  16496. if(_eac==="facet"&&_eba[_ebb].dimensionName==_eab){
  16497. return true;
  16498. }
  16499. if(_eac==="facet"&&_eba[_ebb].dimensionName===_eb3){
  16500. return true;
  16501. }
  16502. }
  16503. }
  16504. if(_eac==="facet"){
  16505. var _ebc=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValuePropertyFromPayload(_eaa,"filterType"):null;
  16506. if(_eac==="facet"&&_ebc==="attribute"){
  16507. return true;
  16508. }
  16509. var _ebd=_eb6.filter;
  16510. if(_ebd&&_ebd.length){
  16511. for(var _ebe=0;_ebe<_ebd.length;++_ebe){
  16512. if(_ebd[_ebe].hierarchyName===_eab){
  16513. return true;
  16514. }
  16515. }
  16516. }
  16517. }else{
  16518. if(_eb2.getFilterObjectFromContainer(lid,_eab,false)){
  16519. return true;
  16520. }
  16521. }
  16522. }
  16523. if(_eb2.isReportLevel_nonVisibleFilterItem(_eab)){
  16524. return true;
  16525. }
  16526. }
  16527. }
  16528. return false;
  16529. },_getDrillResetHUNForFacet:function(_ebf,_ec0){
  16530. if(_ec0!=="facet"){
  16531. return null;
  16532. }
  16533. var _ec1=null;
  16534. var _ec2=this.getViewerObject();
  16535. if(_ec2.getRAPReportInfo()){
  16536. _ec1=_ec2.getRAPReportInfo().getDrilledOnHUNs();
  16537. }
  16538. if(!_ec1){
  16539. return null;
  16540. }
  16541. var _ec3=[];
  16542. for(var i=0;i<_ec1.length;i++){
  16543. if(_ec1[i].indexOf(_ebf)!==-1){
  16544. _ec3.push(_ec1[i]);
  16545. break;
  16546. }
  16547. }
  16548. return _ec3;
  16549. },preProcessFilterValues:function(evt){
  16550. var _ec6=evt.payload["com.ibm.widget.context"]["values"];
  16551. _ec6=(_ec6)?_ec6:evt.payload["com.ibm.widget.context"]["ranges"];
  16552. var _ec7=this.m_oWidgetContextManager.getItemsInItemSpecification(evt.payload);
  16553. var _ec8=(_ec6)?false:true;
  16554. if(_ec8){
  16555. _ec6=evt.payload["com.ibm.widget.context"];
  16556. }
  16557. var _ec9=this.getViewerObject();
  16558. if(_ec9){
  16559. var _eca=_ec9.getRAPReportInfo();
  16560. for(var _ecb in _ec6){
  16561. if(!_eca.isReferenced(_ecb)||_ec8){
  16562. delete _ec6[_ecb];
  16563. if(_ec7&&_ec7[_ecb]){
  16564. delete _ec7[_ecb];
  16565. }
  16566. }
  16567. }
  16568. }
  16569. if(isObjectEmpty(_ec6)){
  16570. evt.payload["com.ibm.widget.context"]={};
  16571. }
  16572. },isLimitedInteractiveMode:function(){
  16573. var _ecc=this.getViewerObject();
  16574. if(_ecc){
  16575. return _ecc.isLimitedInteractiveMode();
  16576. }
  16577. return false;
  16578. },onMouseOver:function(evt){
  16579. if(DragDropAction_isDragging(evt)==false&&this.getViewerObject().getStatus()=="complete"){
  16580. var _ece=ActionFactory_loadActionHandler(evt,this.getViewerObject());
  16581. if(_ece){
  16582. return _ece.onMouseOver(evt);
  16583. }
  16584. }
  16585. return true;
  16586. },onMouseOut:function(evt){
  16587. var _ed0=ActionFactory_loadActionHandler(evt,this.getViewerObject());
  16588. if(_ed0&&this.getViewerObject().getStatus()=="complete"){
  16589. return _ed0.onMouseOut(evt);
  16590. }
  16591. return true;
  16592. },onMouseOverRenamedItem:function(evt){
  16593. var node=getNodeFromEvent(evt);
  16594. if(node.getAttribute){
  16595. var _ed3=node.getAttribute("rp_name");
  16596. if(_ed3!=null){
  16597. var _ed4=this.getViewerObject().getSelectionController().getTextValue(node.childNodes);
  16598. if(_ed3!=_ed4){
  16599. var id=node.getAttribute("id");
  16600. node.m_tooltip=new bux.reportViewer.ReportInfo({connectId:[id],position:["above","below"],title:RV_RES.IDS_JS_RENAMED_ITEM,text:RV_RES.IDS_JS_RENAMED_ITEM_ORIGINAL_LABEL+" "+node.getAttribute("rp_name")});
  16601. node.m_tooltip.open();
  16602. }
  16603. }
  16604. }
  16605. },onMouseOutRenamedItem:function(evt){
  16606. var node=getNodeFromEvent(evt);
  16607. node.m_tooltip=null;
  16608. },onDoubleClick:function(evt){
  16609. var _ed9=ActionFactory_loadActionHandler(evt,this.getViewerObject());
  16610. if(_ed9&&this.getViewerObject().getStatus()=="complete"){
  16611. return _ed9.onDoubleClick(evt);
  16612. }
  16613. return true;
  16614. },onMouseDown:function(evt){
  16615. var oCV=this.getViewerObject();
  16616. var _edc=oCV.getActionFactory();
  16617. this._selectionAction=_edc.load("Selection");
  16618. if(this.isMobile()){
  16619. var _edd=oCV.getSelectionController();
  16620. var _ede=_edd.pageClickedForMobile(evt);
  16621. if(this.isSelectionFilterEnabled()){
  16622. this.onSelectionChange();
  16623. }else{
  16624. if(_ede){
  16625. this.onContextMenu(evt);
  16626. }
  16627. }
  16628. }else{
  16629. if(oCV.envParams["ui.action"]=="view"){
  16630. this._selectionAction.onMouseDown(evt);
  16631. }else{
  16632. if(oCV.getStatus()=="complete"){
  16633. if((evt.button==1||evt.button==0)){
  16634. if(!this._selectionAction.onMouseDown(evt)&&!_edc.load("RenameDataItem").onMouseDown(evt)){
  16635. this.initDragAndDrop();
  16636. _edc.load("DragDrop").onMouseDown(evt);
  16637. }
  16638. }else{
  16639. this._selectionAction.onMouseDown(evt);
  16640. }
  16641. }
  16642. }
  16643. }
  16644. },onMouseUp:function(evt){
  16645. if(this.isMobile()){
  16646. return;
  16647. }
  16648. var _ee0=getCrossBrowserNode(evt);
  16649. try{
  16650. var _ee1=_ee0.nodeName.toLowerCase();
  16651. if(_ee1=="input"||_ee1=="textarea"){
  16652. evt.cancelBubble=true;
  16653. return false;
  16654. }
  16655. }
  16656. catch(ex){
  16657. }
  16658. var _ee2=false;
  16659. if(this.getViewerObject().envParams["ui.action"]=="view"){
  16660. setNodeFocus(evt);
  16661. }else{
  16662. if(this.getViewerObject().getStatus()=="complete"){
  16663. _ee2|=DragDropAction_isDragging(evt);
  16664. DragDropAction_onmouseup(evt);
  16665. this.removeDragAndDrop();
  16666. setNodeFocus(evt);
  16667. }
  16668. }
  16669. if(!this._selectionAction){
  16670. var oCV=this.getViewerObject();
  16671. var _ee4=oCV.getActionFactory();
  16672. this._selectionAction=_ee4.load("Selection");
  16673. }
  16674. this._selectionAction.onMouseUp(evt,_ee2);
  16675. clearTextSelection();
  16676. },getContainerTypeForSelection:function(){
  16677. var _ee5=this.getViewerObject();
  16678. if(_ee5){
  16679. var _ee6=_ee5.getSelectionController();
  16680. return _ee6.getDataContainerType();
  16681. }
  16682. return null;
  16683. },onContextMenu:function(evt){
  16684. var _ee8=this.getViewerObject();
  16685. if(_ee8.getStatus()=="complete"||this.isSavedOutput()){
  16686. var _ee9=_ee8.getContextMenu();
  16687. var _eea=CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(_ee8,_ee9);
  16688. if(this.isMobile()){
  16689. var _eeb=_ee8.getSelectionController();
  16690. var _eec=_eeb.getContainerType();
  16691. var _eed=_eec==="chart"?_eeb.getChartTooltip():null;
  16692. if(this.getAnnotationStore()&&this.getAnnotationStore().hasAnnotation()){
  16693. var _eee=this._genMobileCommentMenuItem(_eeb);
  16694. if(_eee){
  16695. _eea.push(_eee);
  16696. }
  16697. var _eef=this._genMobileCommentMenuItem();
  16698. if(_eef){
  16699. var _ef0=_ee8.findBlueDotMenu(_eea);
  16700. if(_ef0){
  16701. _ef0.push(_eef);
  16702. }
  16703. }
  16704. }
  16705. var _ef1={"context":{"event":evt,"viewerContext":{"displayValues":_eeb.getDisplayValues(),"chartTooltip":_eed,"containerType":_eec}},"menuItems":_eea};
  16706. if(typeof console!="undefined"&&console&&console.log){
  16707. console.log(_ef1);
  16708. }
  16709. this.fireEvent("com.ibm.bux.widget.contextMenu.update",null,_ef1);
  16710. }else{
  16711. this.fireEvent("com.ibm.bux.widget.contextMenu.update",null,_eea);
  16712. }
  16713. }
  16714. },_genMobileCommentMenuItem:function(_ef2){
  16715. var ctx=null;
  16716. if(_ef2){
  16717. if(_ef2.getSelections().length==1){
  16718. ctx=_ef2.getSelections()[0].getCtxAttributeString();
  16719. }
  16720. if(!ctx){
  16721. return null;
  16722. }
  16723. }
  16724. var _ef4=this.getAnnotationStore().getAsJSON(ctx);
  16725. if(_ef4.length>0){
  16726. return {"name":RV_RES.IDS_JS_ANNOTATIONS,"label":RV_RES.IDS_JS_ANNOTATIONS,"flatten":false,"comments":_ef4};
  16727. }
  16728. return null;
  16729. },initDragAndDrop:function(){
  16730. if(window.attachEvent){
  16731. document.attachEvent("onmouseup",DragDropAction_onmouseup);
  16732. document.attachEvent("onmousemove",DragDropAction_onmousemove);
  16733. }else{
  16734. if(document.addEventListener){
  16735. document.addEventListener("mouseup",DragDropAction_onmouseup,false);
  16736. document.addEventListener("mousemove",DragDropAction_onmousemove,false);
  16737. }
  16738. }
  16739. },removeDragAndDrop:function(){
  16740. if(window.detachEvent){
  16741. document.detachEvent("onmouseup",DragDropAction_onmouseup);
  16742. document.detachEvent("onmousemove",DragDropAction_onmousemove);
  16743. }else{
  16744. if(document.removeEventListener){
  16745. document.removeEventListener("mouseup",DragDropAction_onmouseup,false);
  16746. document.removeEventListener("mousemove",DragDropAction_onmousemove,false);
  16747. }
  16748. }
  16749. },onWidgetResize:function(evt){
  16750. var _ef6=evt.payload.resize;
  16751. if(_ef6){
  16752. if(!this.m_visible||(this.widgetSize&&this.widgetSize.h===_ef6.h&&this.widgetSize.w===_ef6.w)){
  16753. return;
  16754. }
  16755. var _ef7=!this.widgetSize;
  16756. this.widgetSize={h:_ef6.h,w:_ef6.w};
  16757. if(_ef7){
  16758. return;
  16759. }
  16760. if(!_ef6.autoResize){
  16761. this.executeAction(evt,"ResizeChart");
  16762. }
  16763. var oCV=this.getViewerObject();
  16764. if(oCV&&oCV.getPinFreezeManager()){
  16765. if(_ef6.autoResize){
  16766. oCV.getPinFreezeManager().processAutoResize(_ef6.w,_ef6.h);
  16767. }
  16768. setTimeout(function(){
  16769. oCV.getPinFreezeManager().refresh();
  16770. },100);
  16771. }
  16772. if(oCV.getTabController()){
  16773. oCV.getTabController().onResize(evt);
  16774. }
  16775. }
  16776. },getWidgetSize:function(){
  16777. return this.widgetSize;
  16778. },refreshAnnotationData:function(){
  16779. return this.getAnnotationHelper().refreshAnnotationData();
  16780. },fetchAnnotationData:function(){
  16781. this.getAnnotationHelper().fetchAnnotationData();
  16782. },reportContainsDijits:function(){
  16783. var _ef9=this.getAnnotationStore();
  16784. var _efa=_ef9.getAll();
  16785. for(var key in _efa){
  16786. if(typeof _efa[key]!=="function"){
  16787. return true;
  16788. }
  16789. }
  16790. return false;
  16791. },isSaveNecessary:function(){
  16792. var _efc=false;
  16793. if(this.isSavedOutput()){
  16794. var _efd=this.getAttributeValue("mostRecentSavedOutput");
  16795. var _efe=_efd==="true"||_efd===true;
  16796. var _eff=this.getAttributeValue("savedOutputSearchPath");
  16797. _efc=!_efe&&_eff==null;
  16798. }else{
  16799. var _f00=this.getAttributeValue("originalReport");
  16800. var _f01=this.getAttributeValue("savedReportName")||this.getAttributeValue("savedReportPath");
  16801. if(!this.isSavedReport(_f00,_f01)){
  16802. _efc=true;
  16803. }
  16804. }
  16805. return _efc;
  16806. },addAsNewComment:function(_f02,text){
  16807. this.getAnnotationHelper().addAsNewComment(_f02,text);
  16808. },onWidgetActionDone:function(_f04){
  16809. if(_f04&&_f04.payload&&_f04.payload.status===true){
  16810. this.getAnnotationHelper().addNewComment(this._pendingContextId,this._pendingCellValue);
  16811. }
  16812. this._pendingContextId=null;
  16813. this._pendingCellValue=null;
  16814. },commitComment:function(_f05){
  16815. if(!_f05.isNew){
  16816. return null;
  16817. }
  16818. if(!_f05.isLoaded){
  16819. return this.getAnnotationHelper().commitComment(_f05);
  16820. }
  16821. return null;
  16822. },getAnnotationStore:function(){
  16823. if(!this.annotationStore){
  16824. dojo["require"]("bux.data.AnnotationStore");
  16825. this.annotationStore=new bux.data.AnnotationStore(this,this.commitComment,this);
  16826. }
  16827. return this.annotationStore;
  16828. },fireEvent:function(_f06,arg,_f08){
  16829. if(window.gViewerLogger){
  16830. var id=this.getViewerObject()?this.getViewerObject().getId()+" ":"";
  16831. window.gViewerLogger.log(id+_f06,_f08,"json");
  16832. }
  16833. this.iContext.iEvents.fireEvent(_f06,arg,_f08);
  16834. },onGetFilterableItems:function(evt){
  16835. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16836. var _f0b=false;
  16837. var _f0c=this.getRAPCachedItem("filterableItems");
  16838. if(_f0c==null&&this.isLiveReport()&&(this.getViewerObject().getStatus()=="complete"||this.isFaultStatusWithSpec())){
  16839. this.executeAction(evt,"GetFilterableItems");
  16840. _f0b=true;
  16841. }else{
  16842. if(!_f0c){
  16843. _f0c={visible:[],hidden:[]};
  16844. }
  16845. if(this.isLiveReport()){
  16846. this.fireEvent("com.ibm.bux.filter.items.get.done",null,_f0c);
  16847. }else{
  16848. this.savedOutputResponseHandler("com.ibm.bux.filter.items.get.done",_f0c);
  16849. }
  16850. }
  16851. return _f0b;
  16852. }));
  16853. },isFaultStatusWithSpec:function(){
  16854. var oVO=this.getViewerObject();
  16855. if(oVO.getStatus()==="fault"){
  16856. if(oVO.envParams["ui.spec"]){
  16857. return true;
  16858. }
  16859. }
  16860. return false;
  16861. },onGetFilterValues:function(oEvt){
  16862. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16863. var _f0f=oEvt.payload;
  16864. if(typeof oEvt.source!="undefined"&&typeof _f0f!="undefined"){
  16865. if(typeof _f0f.payload!="undefined"){
  16866. _f0f=_f0f.payload;
  16867. }
  16868. if(typeof _f0f.source=="undefined"){
  16869. _f0f.source=oEvt.source;
  16870. }
  16871. }
  16872. var _f10=false;
  16873. var _f11=this.isLiveReport();
  16874. var _f12=this.getViewerObject().getStatus();
  16875. var _f13=this.isFaultStatusWithSpec();
  16876. if(_f11&&(_f12==="complete"||_f13)){
  16877. var _f14=null;
  16878. if(!_f0f.forceRefresh&&_f0f.name){
  16879. _f14=this.getRAPCachedItem("filterValues."+_f0f.name);
  16880. }
  16881. if(_f14){
  16882. this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f14);
  16883. }else{
  16884. this.executeAction(oEvt,"GetFilterValues");
  16885. _f10=true;
  16886. }
  16887. }else{
  16888. if(this.getViewerObject().isWorking(_f12)){
  16889. var self=this;
  16890. var _f16=function(){
  16891. self.onGetFilterValues(oEvt);
  16892. };
  16893. setTimeout(_f16,10);
  16894. }else{
  16895. var _f17={};
  16896. if(_f0f.name){
  16897. _f17.name=_f0f.name;
  16898. }
  16899. this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f17);
  16900. }
  16901. }
  16902. return _f10;
  16903. }));
  16904. },onGetFilterValuesCancel:function(evt){
  16905. if(evt&&evt.payload){
  16906. var oCV=this.getViewerObject();
  16907. var _f1a=oCV.getAction("GetFilterValues");
  16908. _f1a.setRequestParms(evt);
  16909. var _f1b=_f1a.getActionKey();
  16910. if(_f1b){
  16911. oCV.getViewerDispatcher().cancelRequest(_f1b);
  16912. }
  16913. }
  16914. },savedOutputResponseHandler:function(_f1c,_f1d){
  16915. var oCV=this.getViewerObject();
  16916. var _f1f=dojo.toJson(_f1d);
  16917. var _f20="window[\"oCV"+oCV.getId()+"\"].getViewerWidget().fireEvent(\""+_f1c+"\", null, "+_f1f+");";
  16918. if(oCV){
  16919. var _f21=window["oCV"+oCV.getId()];
  16920. if(typeof _f21=="object"){
  16921. setTimeout(_f20,1);
  16922. }
  16923. }
  16924. return _f20;
  16925. },handleGetFilterableItemsResponse:function(_f22){
  16926. var _f23={};
  16927. var json=this.getJsonFromResponse(_f22);
  16928. if(json){
  16929. _f23=json.filterableItems;
  16930. if(!_f23){
  16931. _f23={"visible":[],"invisible":[]};
  16932. }
  16933. this.addToRAPCache("filterableItems",_f23);
  16934. }
  16935. this.fireEvent("com.ibm.bux.filter.items.get.done",null,_f23);
  16936. },handleGetFilterValuesResponse:function(_f25,_f26){
  16937. var _f27={};
  16938. var json=this.getJsonFromResponse(_f25);
  16939. if(json&&json.filterValues){
  16940. _f27=json.filterValues;
  16941. if(_f27&&_f27.name){
  16942. this.addToRAPCache("filterValues."+_f27.name,_f27);
  16943. }
  16944. }
  16945. if(_f26&&_f26.name&&!_f27.name){
  16946. _f27.name=_f26.name;
  16947. }
  16948. _f27=dojo.clone(_f27);
  16949. this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f27);
  16950. },getJsonFromResponse:function(_f29){
  16951. var json=null;
  16952. if(_f29&&_f29.m_jsonResponse&&_f29.m_jsonResponse.json){
  16953. json=dojo.eval("("+_f29.m_jsonResponse.json+")");
  16954. }else{
  16955. if(_f29&&_f29.responseText){
  16956. json=dojo.eval("["+_f29.responseText+"]");
  16957. if(json&&json[0]){
  16958. json=json[0];
  16959. }
  16960. }
  16961. }
  16962. return json;
  16963. },onContextChanged:function(evt){
  16964. if(evt){
  16965. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  16966. var _f2c=false;
  16967. var _f2d=dojo.clone(evt);
  16968. var _f2e=this._getFilterPayload(_f2d);
  16969. this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_f2e);
  16970. this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_f2e);
  16971. var _f2f=this.getViewerObject();
  16972. var _f30=_f2f.getRAPReportInfo();
  16973. if(_f30&&(_f30.containsFilters()||_f30.hasSlider())){
  16974. var _f31=_f2e["com.ibm.widget.context"].values;
  16975. var _f32=this.m_oWidgetContextManager.getItemsInItemSpecification(_f2e);
  16976. var _f33=dojo.clone(_f32);
  16977. for(var _f34 in _f33){
  16978. if(!_f30.isReferenced(_f34)&&_f32[_f34].values){
  16979. var mun=_f32[_f34].values[0].mun;
  16980. var _f36=_f30.hunHasFilterOrSlider(mun);
  16981. if(_f36&&!_f32[_f36]){
  16982. _f32[_f36]=_f32[_f34];
  16983. delete _f32[_f34];
  16984. _f31[_f36]=_f31[_f34];
  16985. delete _f31[_f34];
  16986. }
  16987. }
  16988. }
  16989. }
  16990. _f2d.payload=_f2e;
  16991. _f2c=this.onGenericSelectValueControl(_f2d,true);
  16992. return _f2c;
  16993. }),evt.source);
  16994. }
  16995. },broadcastParameterChange:function(_f37){
  16996. var _f38={"clientId":this.getWidgetId(),"com.ibm.widget.context":_f37};
  16997. this.fireEvent("com.ibm.widget.contextChanged.prompt",null,_f38);
  16998. },broadcastContextChange:function(_f39){
  16999. if(this.isSelectionFilterEnabled()){
  17000. var _f3a={"clientId":this.getWidgetId(),"com.ibm.widget.context":_f39,"com.ibm.widget.context.bux.selection":{"selection":{"id":this.getWidgetId(),"valueType":"string"}}};
  17001. this.m_oWidgetContextManager.updateFilterContext(_f3a);
  17002. this.m_oWidgetContextManager.setSelectionFilterObjects(null);
  17003. this._fireContextChangedEvent(_f3a,true);
  17004. }
  17005. },onGenericDrill:function(evt){
  17006. this.m_handleDrill=false;
  17007. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
  17008. var _f3c=false;
  17009. if(!(evt&&evt.payload)||this.isLimitedInteractiveMode()){
  17010. return _f3c;
  17011. }
  17012. if(evt.payload.cv_id===this.iContext.widgetId){
  17013. return _f3c;
  17014. }
  17015. var _f3d=this.m_oWidgetContextManager.getDrillActionType(evt.payload);
  17016. var _f3e=this.m_oWidgetContextManager.genDrillSpecObjects(evt.payload);
  17017. var _f3f=null;
  17018. if(_f3d==="DrillDown"){
  17019. _f3f=this.getViewerObject().getAction("DrillDown");
  17020. }else{
  17021. if(_f3d==="DrillUp"){
  17022. _f3f=this.getViewerObject().getAction("DrillUp");
  17023. }else{
  17024. return _f3c;
  17025. }
  17026. }
  17027. _f3f.setKeepFocusOnWidget(false);
  17028. if(this.getViewerObject().isMetadataEmpty()||!this.shouldReportBeRunOnAction()){
  17029. _f3f.setUseReportInfoSelection(true);
  17030. }
  17031. if(_f3f.parseDrillSpecObjects(_f3e)){
  17032. if(!this.shouldReportBeRunOnAction()){
  17033. this.getLoadManager().getDelayedLoadingContext().setForceRunReport(true);
  17034. }
  17035. _f3f.execute();
  17036. _f3c=true;
  17037. }
  17038. this.m_handleDrill=true;
  17039. return _f3c;
  17040. }));
  17041. },setDoGetParametersOnLoad:function(_f40){
  17042. this.m_doGetParametersOnLoad=_f40;
  17043. },getDoGetParametersOnLoad:function(){
  17044. return this.m_doGetParametersOnLoad;
  17045. },onPromptLegacyPayload:function(evt){
  17046. try{
  17047. if(evt.payload.cv_id===this.iContext.widgetId){
  17048. return false;
  17049. }
  17050. var _f42=null;
  17051. this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(_f43){
  17052. _f42=false;
  17053. if(this.isSavedOutput()){
  17054. return _f42;
  17055. }
  17056. if(this.promptParametersRetrieved===false){
  17057. var _f44=this.getViewerObject().getAction("GetParameters");
  17058. _f44.setRequestParms(evt.payload);
  17059. _f44.execute();
  17060. _f42=true;
  17061. }else{
  17062. _f42=this.sharePrompts(evt.payload);
  17063. }
  17064. return _f42;
  17065. }));
  17066. return _f42;
  17067. }
  17068. catch(e){
  17069. return false;
  17070. }
  17071. },sharePrompts:function(_f45){
  17072. var _f46=this.getViewerObject().getAction("SharePrompt");
  17073. _f46.setRequestParms(_f45);
  17074. if(this.shouldReportBeRunOnAction()){
  17075. var _f47=this.getViewerObject().getDrillResetHUNs(_f45);
  17076. if(!_f47||_f47.length===0){
  17077. return _f46.executePrompt();
  17078. }else{
  17079. var _f48={"drilledResetHUNs":_f47,"promptValues":_f46.getPromptValues()};
  17080. this.getViewerObject().executeAction("DrillReset",_f48);
  17081. }
  17082. return true;
  17083. }
  17084. var _f49=this.getLoadManager().getDelayedLoadingContext();
  17085. _f49.setPromptValues(_f46.getPromptValues());
  17086. _f49.setCascadingPromptParamsToClear(_f45.clearCascadePromptParams);
  17087. return false;
  17088. },onGenericPrompt:function(evt){
  17089. this.clearRAPCacheFilterValues();
  17090. this.m_oWidgetContextManager.handleIncomingPromptEvent(evt);
  17091. },setPromptParametersRetrieved:function(_f4b){
  17092. this.promptParametersRetrieved=_f4b;
  17093. },getEnvParam:function(_f4c){
  17094. return this.getViewerObject().envParams[_f4c];
  17095. },destroy:function(){
  17096. var _f4d=this.getViewerObject();
  17097. if(_f4d){
  17098. if(this.isSelectionFilterEnabled()){
  17099. if(this.selectionFilterSent()){
  17100. this.clearSelectionFilter();
  17101. }
  17102. }
  17103. if(this.onUnloadInProgress){
  17104. _f4d.destroy(false);
  17105. }else{
  17106. _f4d.destroy(true);
  17107. }
  17108. var _f4e=function(_f4f){
  17109. if(_f4f&&_f4f.parentNode&&_f4f.parentNode.removeChild){
  17110. _f4f.parentNode.removeChild(_f4f);
  17111. }
  17112. };
  17113. var _f50=dojo.query("[namespaceId='"+this.getViewerId()+"'],[namespaceId='"+this.m_sScriptLoaderNamespace+"']",document.getElementsByTagName("head").item(0));
  17114. if(_f50&&_f50.length>0){
  17115. _f50.forEach(_f4e);
  17116. }
  17117. _f50=dojo.query("> [namespaceId=\""+this.getViewerId()+"\"]",document.getElementsByTagName("body").item(0));
  17118. if(typeof _f50!="undefined"&&_f50&&_f50.length>0){
  17119. _f50.forEach(_f4e);
  17120. }
  17121. if(this.getAnnotationHelper()){
  17122. this.getAnnotationHelper()._cleanupPreviousAnnotations();
  17123. }
  17124. }
  17125. if(this.annotationHelper){
  17126. this.annotationHelper.m_viewerIWidget=null;
  17127. }
  17128. this.annotationHelper=null;
  17129. if(this.savedOutput){
  17130. this.savedOutput.iWidget=null;
  17131. }
  17132. this.savedOutput=null;
  17133. if(this.m_oLoadManager){
  17134. this.m_oLoadManager.m_oWidget=null;
  17135. }
  17136. this.m_oLoadManager=null;
  17137. if(this.m_oWidgetContextManager){
  17138. this.m_oWidgetContextManager.m_widget=null;
  17139. }
  17140. this.m_oWidgetContextManager=null;
  17141. this.removeWindowEventListeners();
  17142. if(this.undoRedoQueue){
  17143. GUtil.destroyProperties(this.undoRedoQueue);
  17144. delete this.undoRedoQueue;
  17145. }
  17146. GUtil.destroyProperties(this.getAnnotationStore());
  17147. delete this.getAnnotationStore();
  17148. GUtil.destroyProperties(this.savedOutput);
  17149. delete this.savedOutput;
  17150. delete this.m_oCV;
  17151. _f4d=null;
  17152. },setSavedOutputsCMResponse:function(_f51){
  17153. this.savedOutputsCMResponse=_f51;
  17154. if(_f51==null){
  17155. var _f52=this.getViewerObject().getActionFactory();
  17156. var _f53=_f52.load("Snapshots");
  17157. _f53.resetMenu();
  17158. }
  17159. },getSavedOutputsCMResponse:function(){
  17160. if(typeof this.savedOutputsCMResponse=="undefined"||this.savedOutputsCMResponse==null){
  17161. return null;
  17162. }
  17163. return this.savedOutputsCMResponse;
  17164. },setSavedOutputSearchPath:function(_f54){
  17165. this.m_savedOutputSearchPath=_f54;
  17166. },getSavedOutputSearchPath:function(){
  17167. if(typeof this.m_savedOutputSearchPath=="undefined"){
  17168. return null;
  17169. }
  17170. return this.m_savedOutputSearchPath;
  17171. },initializeProperties:function(){
  17172. if(this.properties){
  17173. var _f55=this.getViewerObject();
  17174. this.properties.initialize(_f55.envParams);
  17175. }
  17176. },addToRAPCache:function(name,_f57){
  17177. if(!this.m_RAPCache){
  17178. this.m_RAPCache={};
  17179. }
  17180. this.m_RAPCache[name]=_f57;
  17181. },getRAPCachedItem:function(name){
  17182. if(this.m_RAPCache&&typeof this.m_RAPCache[name]!="undefined"){
  17183. return this.m_RAPCache[name];
  17184. }
  17185. return null;
  17186. },clearRAPCacheFilterValues:function(){
  17187. for(var key in this.m_RAPCache){
  17188. if(key.indexOf("filterValues.")===0){
  17189. delete this.m_RAPCache[key];
  17190. }
  17191. }
  17192. },clearRAPCache:function(){
  17193. this.m_RAPCache=null;
  17194. },reset:function(){
  17195. this.m_bCallGetAnnotations=true;
  17196. this.promptParametersRetrieved=false;
  17197. this.getViewerObject().envParams["reportPrompts"]="";
  17198. this.setSavedOutputsCMResponse(null);
  17199. this.getUndoRedoQueue().clearQueue();
  17200. if(this.isSelectionFilterEnabled){
  17201. this.clearSelectionFilter();
  17202. }
  17203. this.m_bSelectionFilterSwitch=false;
  17204. },handleFault:function(){
  17205. if(typeof console!="undefined"&&console&&console.log){
  17206. console.log("ViewrIWidget:handle fault is deprecated and should not be used anymore.");
  17207. }
  17208. var _f5a=this.getViewerObject();
  17209. var _f5b=new RequestHandler(_f5a);
  17210. _f5b.onFault();
  17211. },disableListenToForGlobalPrompt:function(){
  17212. this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,{"*":{blockedEvents:["com.ibm.widget.contextChanged.prompt"]}});
  17213. var _f5c=this.getViewerObject();
  17214. if(window.gaRV_INSTANCES){
  17215. var _f5d={};
  17216. _f5d[this.iContext.widgetId]={blockedEvents:["com.ibm.widget.contextChanged.prompt"]};
  17217. for(var _f5e=0;_f5e<window.gaRV_INSTANCES.length;_f5e++){
  17218. if(window.gaRV_INSTANCES[_f5e].getId()!=_f5c.getId()){
  17219. var _f5f=window.gaRV_INSTANCES[_f5e].getViewerWidget();
  17220. if(_f5f){
  17221. _f5f.iContext.iEvents.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_f5d);
  17222. }
  17223. }
  17224. }
  17225. }
  17226. },disableListenToForEvent:function(_f60){
  17227. this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,{"*":{blockedEvents:_f60}});
  17228. var _f61=this.getViewerObject();
  17229. if(window.gaRV_INSTANCES){
  17230. var _f62={};
  17231. _f62[this.iContext.widgetId]={blockedEvents:_f60};
  17232. for(var _f63=0;_f63<window.gaRV_INSTANCES.length;_f63++){
  17233. if(window.gaRV_INSTANCES[_f63].getId()!=_f61.getId()){
  17234. var _f64=window.gaRV_INSTANCES[_f63].getViewerWidget();
  17235. if(_f64){
  17236. _f64.iContext.iEvents.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_f62);
  17237. }
  17238. }
  17239. }
  17240. }
  17241. },handlePassportErrorFromDispatcher:function(){
  17242. if(this.viewerWidgetLastAction){
  17243. var _f65=GUtil.generateCallback(this[this.viewerWidgetLastAction.functionName],this.viewerWidgetLastAction.param,this);
  17244. dojo["require"]("bux.dialogs.IFrameDialog");
  17245. var _f66=new bux.dialogs.LogonDialog({okHandler:_f65,cancelHandler:dojo.hitch(this,function(){
  17246. this.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
  17247. })});
  17248. _f66.startup();
  17249. _f66.show();
  17250. }
  17251. },showErrorMessage:function(_f67){
  17252. var _f68=this.getViewerObject();
  17253. if(_f68){
  17254. this.m_widgetErrorDlg=new FaultMessageDialog(_f68,_f67);
  17255. this.m_widgetErrorDlg.renderInlineDialog();
  17256. }
  17257. },getErrorDlg:function(){
  17258. if(this.m_widgetErrorDlg){
  17259. return this.m_widgetErrorDlg;
  17260. }
  17261. return null;
  17262. },setErrorDlg:function(dlg){
  17263. this.m_widgetErrorDlg=dlg;
  17264. },clearErrorDlg:function(dlg){
  17265. if(this.getErrorDlg()!==null){
  17266. this.m_widgetErrorDlg.ok();
  17267. }
  17268. },onOpen:function(evt){
  17269. if(evt&&evt.payload&&evt.payload.author){
  17270. this.m_sDashboardOwnerId=evt.payload.author.cm$searchPath;
  17271. }
  17272. },onNotifyPreviousEventsAreDone:function(evt){
  17273. this.m_resizeReady=true;
  17274. },isDashboardOwner:function(){
  17275. if(typeof this.m_sDashboardOwnerId!=="undefined"&&typeof this.m_sUserId!=="undefined"){
  17276. return this.m_sDashboardOwnerId===this.m_sUserId;
  17277. }
  17278. },isCurrentUser:function(user){
  17279. return this.m_sUserId===user;
  17280. },findContainerDiv:function(){
  17281. var _f6e=dojo.byId("RVContent"+this.getViewerObject().getId());
  17282. var _f6f=_f6e;
  17283. while(_f6f){
  17284. if(_f6f.style&&_f6f.style.height&&_f6f.style.height.indexOf("px")!=-1){
  17285. return _f6f;
  17286. }
  17287. _f6f=_f6f.parentNode;
  17288. }
  17289. if(typeof console!="undefined"&&console&&console.log){
  17290. console.log("ViewrIWidget: Could not find the container div.");
  17291. }
  17292. return _f6e;
  17293. },getPaneOnRight:function(){
  17294. return this.getAttributeValue("paneOnRight");
  17295. },getWidgetContextManager:function(){
  17296. return this.m_oWidgetContextManager;
  17297. },getInfoBarRenderedState:function(){
  17298. return this.m_oInfoBarRenderedState;
  17299. },refreshInfoBarRenderedState:function(_f70){
  17300. var len=_f70.length;
  17301. var _f72={};
  17302. for(var idx=0;idx<len;idx++){
  17303. var sId=_f70[idx];
  17304. if(this.m_oInfoBarRenderedState[sId]){
  17305. _f72[sId]=this.m_oInfoBarRenderedState[sId];
  17306. }
  17307. }
  17308. this.m_oInfoBarRenderedState=_f72;
  17309. },onGetWidgetContext:function(_f75){
  17310. var _f76=this.getWidgetContextManager().getWidgetContextObject();
  17311. if(!_f76){
  17312. _f76={};
  17313. }
  17314. this.fireEvent("com.ibm.widget.context.get.done",null,_f76);
  17315. },onGetCanvasContextDone:function(evt){
  17316. },onSetVisible:function(evt){
  17317. if(this.m_debugDelayedViewerLoadingMode===2){
  17318. return;
  17319. }
  17320. if(evt&&evt.payload){
  17321. this.m_visible=evt.payload.isVisible?true:false;
  17322. if(!this.m_visible){
  17323. if(this._cssLimitReached){
  17324. this.cleanupStyles();
  17325. }
  17326. return;
  17327. }
  17328. if(!this.getLoadManager().isViewerLoadInitiated()){
  17329. this.postReport(null);
  17330. }else{
  17331. this._updateOnVisible();
  17332. }
  17333. }
  17334. },_updateOnVisible:function(){
  17335. var _f79=this.getLoadManager();
  17336. if(_f79.isViewerReady()){
  17337. var oCV=this.getViewerObject();
  17338. if(this._cssLimitReached){
  17339. this.reloadStyles();
  17340. }
  17341. if(this.isSavedOutput()){
  17342. _f79.getDelayedLoadingContext().setForceRunReport(false);
  17343. return;
  17344. }
  17345. if(!_f79.getDelayedLoadingContext().isEmpty()){
  17346. _f79.runWhenHasViewer(function(){
  17347. _f79.runningReport();
  17348. var _f7b=oCV.getActionFactory();
  17349. var _f7c=_f7b.load("BuxRunReport");
  17350. var _f7d=_f79.getDelayedLoadingContext();
  17351. var _f7e={promptValues:_f7d.getPromptValues(),clearCascadeParamsList:_f7d.getCascadingPromptParamsToClear()};
  17352. _f7c.setRequestParams(_f7e);
  17353. if(!oCV.getConversation()){
  17354. _f7c.setSendParameterValues(true);
  17355. }
  17356. var _f7f=_f7c.execute();
  17357. _f79.getDelayedLoadingContext().reset();
  17358. return _f7f;
  17359. });
  17360. }else{
  17361. if(oCV.getPinFreezeManager()){
  17362. oCV.getPinFreezeManager().onSetVisible();
  17363. }
  17364. }
  17365. }else{
  17366. _f79.setOnEmptyCallback(dojo.hitch(this,function(){
  17367. if(this.isVisible()){
  17368. this._updateOnVisible();
  17369. }
  17370. }));
  17371. }
  17372. },shouldReportBeRunOnAction:function(){
  17373. return (this.isVisible()&&this.getLoadManager().isViewerLoaded()&&this.getLoadManager().canRunReports());
  17374. },isVisible:function(){
  17375. if(this.m_debugDelayedViewerLoadingMode===2){
  17376. return true;
  17377. }
  17378. if(this.m_visible===null){
  17379. var _f80=this.iContext.getItemSet("buxdelayedload",false);
  17380. if(_f80){
  17381. this.m_visible=(_f80.getItemValue("widgetVisible")==="true");
  17382. }else{
  17383. this.m_visible=true;
  17384. }
  17385. }
  17386. return this.m_visible;
  17387. },isPastedWidget:function(){
  17388. return this._pastedWidget;
  17389. },setWidgetCopyPasteParameters:function(){
  17390. this.copyPasteResource=this.getAttributeValue("resource");
  17391. if(this.copyPasteResource){
  17392. this._pastedWidget=true;
  17393. if(this.getAttributeValue("copy.ciPublishedReportPath")&&this.getAttributeValue("originalReport")==null&&this.getSavedItem()==null){
  17394. this.ciPublishedReportPath=this.getAttributeValue("copy.ciPublishedReportPath");
  17395. }else{
  17396. if(this.getAttributeValue("originalReport")==null){
  17397. this.ciPublishedReportPath=this.getSavedItem();
  17398. this.setAttributeValue("copy.ciPublishedReportPath",this.ciPublishedReportPath);
  17399. }
  17400. }
  17401. this.removeAttributeValue("savedReportPath");
  17402. this.removeAttributeValue("savedReportPath.resource");
  17403. this.removeAttributeValue("resource");
  17404. }
  17405. },postSetWidgetCopyPasteParameters:function(){
  17406. if(this.copyPasteResource){
  17407. this.removeAttributeValue("copy.conversation");
  17408. this.copyPasteResource=null;
  17409. }
  17410. },isSelectionFilterEnabled:function(){
  17411. return this.m_bSelectionFilterSwitch;
  17412. },toggleSelectionFilterSwitch:function(){
  17413. this.m_bSelectionFilterSwitch=!this.isSelectionFilterEnabled();
  17414. var _f81=this.getViewerObject().getSelectionController();
  17415. if(_f81){
  17416. if(this.isSelectionFilterEnabled()){
  17417. _f81.setSelectionStyles(_f81.FILTER_SELECTION_STYLE);
  17418. _f81.repaintSelections();
  17419. }else{
  17420. _f81.resetAll();
  17421. }
  17422. }
  17423. },preprocessPageClicked:function(_f82,evt){
  17424. if(!this.isSelectionFilterEnabled()){
  17425. return;
  17426. }
  17427. var _f84=this.getViewerObject().getSelectionController();
  17428. _f84.setAllowHorizontalDataValueSelection(true);
  17429. if(_f82){
  17430. if(!_f84.hasSavedSelections()){
  17431. _f84.saveSelections();
  17432. }
  17433. _f84.setSelectionStyles(_f84.FILTER_SELECTION_CONTEXT_MENU_STYLE);
  17434. }else{
  17435. _f84.setSelectionStyles(_f84.FILTER_SELECTION_STYLE);
  17436. _f84.clearSavedSelections();
  17437. }
  17438. },ignoreEvent:function(evt){
  17439. stopEventBubble(evt);
  17440. },updateDrillThroughLinks:function(){
  17441. var oCV=this.getViewerObject();
  17442. if(!oCV){
  17443. return;
  17444. }
  17445. var _f87=this.isSelectionFilterEnabled();
  17446. var _f88=oCV.envParams["ui.action"]=="view"||oCV.envParams["ui.action"]=="buxView";
  17447. var _f89=_f87?"":"_temp";
  17448. var _f8a=_f87?"_temp":"";
  17449. var _f8b=["onclick","onkeypress","style"];
  17450. var _f8c=_f88?"onclick"+_f89:"dttargets";
  17451. var _f8d=document.getElementById("RVContent"+oCV.getId());
  17452. var _f8e=getElementsByAttribute(_f8d,"*",_f8c);
  17453. if(!_f8e){
  17454. return;
  17455. }
  17456. for(var i=0;i<_f8e.length;i++){
  17457. var node=_f8e[i];
  17458. if(node.nodeName.toLowerCase()!=="area"){
  17459. if(_f88){
  17460. var _f91=node.getAttribute("onclick"+_f89);
  17461. if(!_f91||(_f91.indexOf("doSingleDrillThrough")==-1&&_f91.indexOf("doMultipleDrillThrough"))){
  17462. continue;
  17463. }
  17464. for(var ii=0;ii<_f8b.length;ii++){
  17465. var _f93=_f8b[ii];
  17466. if(node.getAttribute(_f93+_f89)){
  17467. this._renameAttribute(node,_f93+_f89,_f93+_f8a);
  17468. }
  17469. }
  17470. }
  17471. this._updateCellStyle(node,_f87);
  17472. }
  17473. }
  17474. },_updateCellStyle:function(node,_f95){
  17475. if(node.nodeType==3){
  17476. return;
  17477. }
  17478. if(_f95&&node.className==="hy"){
  17479. this._renameAttribute(node,"class","class_temp");
  17480. }else{
  17481. if(!_f95&&node.getAttribute("class_temp")){
  17482. this._renameAttribute(node,"class_temp","class");
  17483. }
  17484. }
  17485. if(node.childNodes){
  17486. for(i=0;i<node.childNodes.length;i++){
  17487. this._updateCellStyle(node.childNodes[i],_f95);
  17488. }
  17489. }
  17490. },_renameAttribute:function(node,_f97,_f98){
  17491. node.setAttribute(_f98,node.getAttribute(_f97));
  17492. node.removeAttribute(_f97);
  17493. },addButtonToSavedToolbarButtons:function(name,_f9a,_f9b){
  17494. if(typeof name!="undefined"&&name!=null){
  17495. this.savedToolbarButtons[name]={};
  17496. this.savedToolbarButtons[name]["button"]=_f9a;
  17497. this.savedToolbarButtons[name]["position"]=_f9b;
  17498. }
  17499. },getButtonFromSavedToolbarButtons:function(name){
  17500. return this.savedToolbarButtons[name];
  17501. },removeFromSavedToolbarButtons:function(name){
  17502. if(typeof this.savedToolbarButtons[name]!="undefined"&&this.savedToolbarButtons[name]!=null){
  17503. delete this.savedToolbarButtons[name];
  17504. }
  17505. }});
  17506. function UndoRedoQueue(_f9e){
  17507. this.m_queue=[];
  17508. this.m_queueLimit=20;
  17509. this.m_iCurrentPos=0;
  17510. this.m_widget=_f9e;
  17511. this.m_bUndoRedoCalled=false;
  17512. this.m_lastAction=null;
  17513. this.currentUndoObj=null;
  17514. this.beenUsed=false;
  17515. this.m_originalSpec=null;
  17516. };
  17517. UndoRedoQueue.prototype.setOriginalSpec=function(spec){
  17518. if(this.m_queue.length==0){
  17519. this.m_originalSpec=spec;
  17520. }
  17521. };
  17522. UndoRedoQueue.prototype.clearQueue=function(){
  17523. while(this.m_queue.length>0){
  17524. this.m_queue.pop();
  17525. }
  17526. this.m_iCurrentPos=0;
  17527. };
  17528. UndoRedoQueue.prototype.getPosition=function(){
  17529. return this.m_iCurrentPos;
  17530. };
  17531. UndoRedoQueue.prototype.hasBeenUsed=function(){
  17532. return this.beenUsed;
  17533. };
  17534. UndoRedoQueue.prototype.getLength=function(){
  17535. return this.m_queue.length;
  17536. };
  17537. UndoRedoQueue.prototype.initUndoObj=function(obj){
  17538. if(this.m_queue.length==0){
  17539. var oCV=this.m_widget.getViewerObject();
  17540. var spec=this.m_originalSpec==null?oCV.envParams["ui.spec"]:this.m_originalSpec;
  17541. this.m_originalSpec=null;
  17542. this.m_queue.push({"spec":spec,"parameters":oCV.getExecutionParameters(),"tooltip":obj.tooltip,"infoBar":oCV.envParams["rapReportInfo"],"widgetProperties":this.m_widget.getProperties().getOldProperties(),"hasAVSChart":oCV.hasAVSChart(),"undoType":"server"});
  17543. this.m_iCurrentPos=this.m_queue.length-1;
  17544. this.beenUsed=true;
  17545. }
  17546. this.currentUndoObj=obj;
  17547. };
  17548. UndoRedoQueue.prototype.add=function(obj){
  17549. if(this.m_bUndoRedoCalled){
  17550. this.m_bUndoRedoCalled=false;
  17551. return;
  17552. }else{
  17553. if(this.currentUndoObj==null){
  17554. return;
  17555. }else{
  17556. if(obj.reportUpdated==true){
  17557. while(this.m_queue.length>this.m_queueLimit){
  17558. this.m_queue.shift();
  17559. }
  17560. this.clearEnd();
  17561. var _fa4=this.m_widget.getViewerObject();
  17562. if(this.currentUndoObj.saveSpec==true||_fa4.envParams["ui.doNotUseConversationForUndo"]==="true"){
  17563. this.currentUndoObj.spec=_fa4.envParams["ui.spec"];
  17564. this.currentUndoObj.parameters=_fa4.getExecutionParameters();
  17565. }else{
  17566. this.currentUndoObj.conversation=_fa4.getConversation();
  17567. }
  17568. if(_fa4.envParams["rapReportInfo"]){
  17569. this.currentUndoObj.infoBar=_fa4.envParams["rapReportInfo"];
  17570. }
  17571. this.currentUndoObj.widgetProperties=this.m_widget.getProperties().getUndoInfo();
  17572. this.currentUndoObj.palette=_fa4.m_sPalette;
  17573. if(this.m_widget.getProperties().getFlashCharts()){
  17574. this.currentUndoObj.hasAVSChart=_fa4.hasAVSChart();
  17575. }
  17576. this.currentUndoObj.undoType="server";
  17577. this.finalizeAdd();
  17578. }
  17579. }
  17580. }
  17581. };
  17582. UndoRedoQueue.prototype.addClientSideUndo=function(obj){
  17583. if(this.m_bUndoRedoCalled){
  17584. this.m_bUndoRedoCalled=false;
  17585. return;
  17586. }
  17587. if(obj.undoCallback&&obj.redoCallback){
  17588. this.initUndoObj(obj);
  17589. this.currentUndoObj.undoType="client";
  17590. this.finalizeAdd();
  17591. }
  17592. };
  17593. UndoRedoQueue.prototype.finalizeAdd=function(){
  17594. this.m_queue.push(this.currentUndoObj);
  17595. this.m_iCurrentPos=this.m_queue.length-1;
  17596. this.m_bUndoRedoCalled=false;
  17597. this.m_lastAction="";
  17598. this.currentUndoObj=null;
  17599. this.beenUsed=true;
  17600. };
  17601. UndoRedoQueue.prototype.moveBack=function(){
  17602. if(this.m_iCurrentPos<=0){
  17603. return null;
  17604. }
  17605. var _fa6=this.m_queue[this.m_iCurrentPos].undoType;
  17606. this.m_bUndoRedoCalled=true;
  17607. this.m_lastAction="undo";
  17608. this.m_iCurrentPos--;
  17609. this.m_viewerState={"parameters":this.m_widget.getViewerObject().getExecutionParameters(),"spec":this.m_widget.getViewerObject().envParams["ui.spec"]};
  17610. if(typeof this.m_queue[this.m_iCurrentPos]!="undefined"){
  17611. this.m_widget.getViewerObject().m_sPalette=this.m_queue[this.m_iCurrentPos].palette;
  17612. if(_fa6=="client"){
  17613. return this.m_queue[this.m_iCurrentPos+1];
  17614. }
  17615. var _fa7=this.m_iCurrentPos;
  17616. while(_fa7>0&&this.m_queue[_fa7]&&this.m_queue[_fa7].undoType!="server"){
  17617. _fa7--;
  17618. }
  17619. return this.m_queue[_fa7];
  17620. }
  17621. return null;
  17622. };
  17623. UndoRedoQueue.prototype.moveForward=function(){
  17624. if(this.m_iCurrentPos>=this.m_queue.length){
  17625. return null;
  17626. }
  17627. this.m_bUndoRedoCalled=true;
  17628. this.m_iCurrentPos++;
  17629. this.m_lastAction="redo";
  17630. this.m_viewerState={"parameters":this.m_widget.getViewerObject().getExecutionParameters(),"spec":this.m_widget.getViewerObject().envParams["ui.spec"]};
  17631. if(typeof this.m_queue[this.m_iCurrentPos]!="undefined"){
  17632. this.m_widget.getViewerObject().m_sPalette=this.m_queue[this.m_iCurrentPos].palette;
  17633. return this.m_queue[this.m_iCurrentPos];
  17634. }
  17635. return null;
  17636. };
  17637. UndoRedoQueue.prototype.clearEnd=function(){
  17638. while(this.m_queue.length-1>this.m_iCurrentPos){
  17639. this.m_queue.pop();
  17640. }
  17641. };
  17642. UndoRedoQueue.prototype.handleCancel=function(){
  17643. if(this.m_lastAction=="undo"){
  17644. this.m_iCurrentPos++;
  17645. }else{
  17646. if(this.m_lastAction=="redo"){
  17647. this.m_iCurrentPos--;
  17648. }
  17649. }
  17650. if(this.m_lastAction=="redo"||this.m_lastAction=="undo"){
  17651. var _fa8=this.m_widget.getProperties();
  17652. var _fa9=this.m_queue[this.m_iCurrentPos];
  17653. if(_fa8&&_fa9&&_fa9.widgetProperties){
  17654. _fa8.doUndo(_fa9.widgetProperties);
  17655. }
  17656. }
  17657. this.m_lastAction="";
  17658. this.m_bUndoRedoCalled=false;
  17659. this.currentUndoObj=null;
  17660. };
  17661. UndoRedoQueue.prototype.handleFault=function(){
  17662. this.currentUndoObj=null;
  17663. this.m_bUndoRedoCalled=false;
  17664. };
  17665. UndoRedoQueue.prototype.getUndoTooltip=function(){
  17666. if(this.m_iCurrentPos>0){
  17667. return RV_RES.IDS_JS_UNDO+" "+this.m_queue[this.m_iCurrentPos].tooltip;
  17668. }
  17669. return RV_RES.IDS_JS_UNDO;
  17670. };
  17671. UndoRedoQueue.prototype.getRedoTooltip=function(){
  17672. if(this.m_iCurrentPos<(this.m_queue.length-1)){
  17673. return RV_RES.IDS_JS_REDO+" "+this.m_queue[this.m_iCurrentPos+1].tooltip;
  17674. }
  17675. return RV_RES.IDS_JS_REDO;
  17676. };
  17677. function CIWidgetSavedOutput(_faa){
  17678. this.iWidget=_faa;
  17679. this.bContainsChart=false;
  17680. this.bContainsDrillThrough=false;
  17681. this.bPagedOutput=true;
  17682. };
  17683. CIWidgetSavedOutput.prototype.getIWidget=function(){
  17684. return this.iWidget;
  17685. };
  17686. CIWidgetSavedOutput.prototype.isPagedOutput=function(){
  17687. return this.bPagedOutput;
  17688. };
  17689. CIWidgetSavedOutput.prototype.setPagedOutput=function(_fab){
  17690. this.bPagedOutput=_fab;
  17691. };
  17692. CIWidgetSavedOutput.prototype.getCognosViewer=function(){
  17693. return this.getIWidget().getViewerObject();
  17694. };
  17695. CIWidgetSavedOutput.prototype.getIframeWindow=function(){
  17696. return this.savedOutputWindow;
  17697. };
  17698. CIWidgetSavedOutput.prototype.getSavedOutputDiv=function(){
  17699. return this.savedOutputDiv;
  17700. };
  17701. CIWidgetSavedOutput.prototype.render=function(){
  17702. if(this.isPagedOutput()&&this.getFirstPage()){
  17703. this.currentPageIndex=0;
  17704. this._showPages([this.getFirstPage()]);
  17705. }else{
  17706. if(this.tabbedSavedOutput&&this.currentPageIndex&&this.pageNodes){
  17707. var _fac=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
  17708. this.switchSavedOutputTab(_fac);
  17709. }else{
  17710. if(this.getCognosViewer()&&this.getCognosViewer().getCurrentlySelectedTab()){
  17711. this.switchSavedOutputTab(this.getCognosViewer().getCurrentlySelectedTab());
  17712. }else{
  17713. this.showHTMLFragment(this.getIframeWindow().document.body.innerHTML);
  17714. }
  17715. }
  17716. }
  17717. };
  17718. CIWidgetSavedOutput.prototype.outputDoneLoading=function(){
  17719. if(window["gReportWidgetLoadQueue"]){
  17720. window["gReportWidgetLoadQueue"].widgetDoneLoading(this.getIWidget());
  17721. }
  17722. this.getIWidget().setOriginalFormFields(null);
  17723. var _fad=this.getCognosViewer();
  17724. var _fae=_fad.getId();
  17725. this.savedOutputWindow=dojo.byId("CVHiddenIFrame"+_fae).contentWindow;
  17726. this.savedOutputDiv=dojo.byId("CVSavedOutputDiv"+_fae);
  17727. var sc=_fad.getSelectionController();
  17728. if(!sc.hasContextData()&&this.savedOutputWindow.onLoadEvent){
  17729. this.savedOutputWindow.onLoadEvent();
  17730. }
  17731. this._populatePageNode();
  17732. var _fb0=dojo.byId("_"+this.iWidget.iContext.widgetId+"_cv");
  17733. this.loadStyleInfoFromIframe(_fb0);
  17734. this.bContainsChart=typeof this.savedOutputWindow.displayChart=="function"?true:false;
  17735. this.bContainsDrillThrough=typeof this.savedOutputWindow.drillThroughTarget!="undefined"?true:false;
  17736. this.render();
  17737. this.getMetaDataFromIFrame();
  17738. if(this.bContainsDrillThrough){
  17739. window[_fae+"drillTargets"]=this.getIframeWindow().drillTargets;
  17740. }
  17741. _fad.fillInContextData();
  17742. _fad.updateBorderCollapse();
  17743. this.getIWidget().updateToolbar();
  17744. _fad.setReportRenderingDone(true);
  17745. var _fb1=GUtil.generateCallback(this.getIWidget().fetchAnnotationData,[],this.getIWidget());
  17746. var _fb2=this.getPageContextData(_fb1);
  17747. if(_fb2==0){
  17748. this.getIWidget().fetchAnnotationData();
  17749. }
  17750. this.fixDuplicateFormFields();
  17751. this.getIWidget().getLoadManager().processQueue();
  17752. delete _fad.envParams["cv.outputKey"];
  17753. this.getIWidget().setXNodeId(null);
  17754. var _fb3=this.getIWidget();
  17755. var _fb4=function(){
  17756. _fb3.iContext.iEvents.fireEvent("com.ibm.bux.widget.render.done",null,{});
  17757. _fad.renderTabs();
  17758. if(_fad.getCurrentlySelectedTab()!=null){
  17759. _fb3.getSavedOutput().tabbedSavedOutput=true;
  17760. _fb3.getSavedOutput().switchSavedOutputTab(_fad.getCurrentlySelectedTab());
  17761. }
  17762. };
  17763. setTimeout(_fb4,100);
  17764. };
  17765. CIWidgetSavedOutput.prototype._populatePageNode=function(){
  17766. this.pageNodes=[];
  17767. var node=this.getIframeWindow().document.body.firstChild;
  17768. while(node){
  17769. if(node.nodeName.toLowerCase()=="table"){
  17770. this.pageNodes.push(node);
  17771. }
  17772. node=node.nextSibling;
  17773. }
  17774. };
  17775. CIWidgetSavedOutput.prototype.switchSavedOutputTab=function(_fb6,_fb7){
  17776. if(!this.pageNodes){
  17777. return;
  17778. }
  17779. if(_fb7){
  17780. if(!this.lastVisitedPage){
  17781. this.lastVisitedPage={};
  17782. }
  17783. if(this.isPagedOutput()){
  17784. var _fb8=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
  17785. this.lastVisitedPage[_fb8]=this.currentPageIndex;
  17786. if(this.lastVisitedPage[_fb6]){
  17787. this.currentPageIndex=this.lastVisitedPage[_fb6];
  17788. this._showPages([this.pageNodes[this.currentPageIndex]]);
  17789. return;
  17790. }
  17791. }
  17792. }
  17793. var _fb9=[];
  17794. for(var i=0;i<this.pageNodes.length;i++){
  17795. var node=this.pageNodes[i];
  17796. if(node&&node.getAttribute&&node.getAttribute("tabid")==_fb6){
  17797. _fb9.push(node);
  17798. this.currentPageIndex=i;
  17799. if(this.isPagedOutput()){
  17800. break;
  17801. }
  17802. }
  17803. }
  17804. this._showPages(_fb9);
  17805. };
  17806. CIWidgetSavedOutput.prototype.fixDuplicateFormFields=function(){
  17807. var _fbc=document.getElementById("formWarpRequest"+this.getCognosViewer().getId());
  17808. if(_fbc){
  17809. for(var _fbd=0;_fbd<_fbc.elements.length;_fbd++){
  17810. var name=_fbc.elements[_fbd].name;
  17811. if(name&&name.length>0){
  17812. if(_fbc[name].length>1){
  17813. var _fbf=_fbc[name][_fbc[name].length-1].value;
  17814. while(_fbc[name].length>1){
  17815. _fbc[name][1].parentNode.removeChild(_fbc[name][1]);
  17816. }
  17817. if(_fbc[name][0]){
  17818. _fbc[name][0].value=_fbf;
  17819. }
  17820. _fbc[name].value=_fbf;
  17821. }
  17822. }
  17823. }
  17824. }
  17825. };
  17826. CIWidgetSavedOutput.prototype.getPageContextData=function(_fc0){
  17827. var _fc1={};
  17828. dojo.query("[ctx]",this.getSavedOutputDiv()).forEach(function(item){
  17829. var ctx=item.getAttribute("ctx");
  17830. var _fc4=ctx.split(":");
  17831. for(var i=0;i<_fc4.length;i++){
  17832. var _fc6=_fc4[i];
  17833. if(_fc6&&_fc6.length>0){
  17834. _fc1[_fc6]=true;
  17835. }
  17836. }
  17837. });
  17838. var _fc7=[];
  17839. for(var item in _fc1){
  17840. _fc7.push(item);
  17841. }
  17842. return this.getCognosViewer().getSelectionController().fetchContextData(_fc7,_fc0);
  17843. };
  17844. CIWidgetSavedOutput.prototype.loadStyleInfoFromIframe=function(_fc9){
  17845. var _fca=null;
  17846. var _fcb=this.savedOutputWindow.document;
  17847. for(var _fcc=0;_fcc<_fcb.childNodes.length;_fcc++){
  17848. if(_fcb.childNodes[_fcc].childNodes&&_fcb.childNodes[_fcc].childNodes.length>0){
  17849. _fca=_fcb.childNodes[_fcc];
  17850. break;
  17851. }
  17852. }
  17853. window.gScriptLoader.loadStyles(_fca.firstChild,this.iWidget.getViewerId());
  17854. var _fcd=dojo.query("link",_fca);
  17855. var _fce="";
  17856. for(i=0;i<_fcd.length;i++){
  17857. var href=_fcd[i].getAttribute("href");
  17858. if(href){
  17859. _fce+="<link href=\""+href+"\" />";
  17860. }
  17861. }
  17862. window.gScriptLoader.loadCSS(_fce,_fc9,true,this.iWidget.getViewerId());
  17863. };
  17864. CIWidgetSavedOutput.prototype.getFirstPage=function(){
  17865. return this.pageNodes[0];
  17866. };
  17867. CIWidgetSavedOutput.prototype.getLastPage=function(){
  17868. return this.pageNodes?this.pageNodes[this.pageNodes.length-1]:null;
  17869. };
  17870. CIWidgetSavedOutput.prototype.writeNavLinks=function(){
  17871. var _fd0="";
  17872. if(this.isPagedOutput()){
  17873. if(this.tabbedSavedOutput&&!isNaN(this.currentPageIndex)){
  17874. var _fd1=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
  17875. if(this.currentPageIndex>0&&this.pageNodes[this.currentPageIndex-1].getAttribute("tabid")==_fd1){
  17876. _fd0+=" firstPage previousPage ";
  17877. }
  17878. if(this.currentPageIndex<(this.pageNodes.length-1)&&this.pageNodes[this.currentPageIndex+1].getAttribute("tabid")==_fd1){
  17879. _fd0+=" nextPage lastPage ";
  17880. }
  17881. }else{
  17882. if(this.currentPageIndex>0){
  17883. _fd0+=" firstPage previousPage ";
  17884. }
  17885. if(this.currentPageIndex<(this.pageNodes.length-1)){
  17886. _fd0+=" nextPage lastPage ";
  17887. }
  17888. }
  17889. }
  17890. this.getCognosViewer().writeNavLinks(_fd0,true);
  17891. };
  17892. CIWidgetSavedOutput.prototype.pageAction=function(_fd2){
  17893. switch(_fd2){
  17894. case "firstPage":
  17895. if(this.tabbedSavedOutput){
  17896. var _fd3=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
  17897. for(var i=0;i<this.pageNodes.length;i++){
  17898. var node=this.pageNodes[i];
  17899. if(node&&node.getAttribute&&node.getAttribute("tabid")==_fd3){
  17900. this.currentPageIndex=i;
  17901. break;
  17902. }
  17903. }
  17904. }else{
  17905. this.currentPageIndex=0;
  17906. }
  17907. break;
  17908. case "previousPage":
  17909. this.currentPageIndex=this.currentPageIndex-1;
  17910. break;
  17911. case "nextPage":
  17912. this.currentPageIndex=this.currentPageIndex+1;
  17913. break;
  17914. case "lastPage":
  17915. if(this.tabbedSavedOutput){
  17916. var _fd3=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
  17917. var _fd6=false;
  17918. for(var i=0;i<this.pageNodes.length;i++){
  17919. var node=this.pageNodes[i];
  17920. if(node&&node.getAttribute&&node.getAttribute("tabid")==_fd3){
  17921. _fd6=true;
  17922. }else{
  17923. if(_fd6){
  17924. this.currentPageIndex=i-1;
  17925. break;
  17926. }
  17927. }
  17928. }
  17929. }else{
  17930. this.currentPageIndex=this.pageNodes.length-1;
  17931. }
  17932. break;
  17933. }
  17934. this._showPages([this.pageNodes[this.currentPageIndex]]);
  17935. };
  17936. CIWidgetSavedOutput.prototype._showPages=function(_fd7){
  17937. var oCV=this.getCognosViewer();
  17938. oCV.getSelectionController().clearSelectedObjects();
  17939. if(_fd7.length==1){
  17940. this.showHTMLFragment(_fd7[0].innerHTML);
  17941. }else{
  17942. var _fd9="";
  17943. for(var i=0;i<_fd7.length;i++){
  17944. _fd9+=_fd7[i].innerHTML;
  17945. }
  17946. this.showHTMLFragment(_fd9);
  17947. }
  17948. this.writeNavLinks();
  17949. if(this.tabbedSavedOutput&&this.lastVisitedPage){
  17950. this.getIWidget().placeTabControlInView();
  17951. }else{
  17952. oCV.setKeepFocus(true);
  17953. }
  17954. oCV.doneLoadingUpdateA11Y("complete");
  17955. var _fdb=GUtil.generateCallback(this.getIWidget().fetchAnnotationData,[],this.getIWidget());
  17956. var _fdc=this.getPageContextData(_fdb);
  17957. if(_fdc==0){
  17958. this.getIWidget().fetchAnnotationData();
  17959. }
  17960. };
  17961. CIWidgetSavedOutput.prototype.getMetaDataFromIFrame=function(){
  17962. if(typeof this.getIframeWindow().getSelectionController=="function"){
  17963. var _fdd=this.getIframeWindow().getSelectionController();
  17964. if(_fdd){
  17965. var _fde=this.getCognosViewer().getSelectionController();
  17966. _fde.addMetaData(_fdd.getCCDManager().m_md);
  17967. _fde.addContextData(_fdd.getCCDManager().m_cd);
  17968. _fde.setSelectionBasedFeaturesEnabled(true);
  17969. }
  17970. }
  17971. };
  17972. CIWidgetSavedOutput.prototype.processDrillThrough=function(_fdf){
  17973. if(this.bContainsDrillThrough&&(typeof this.bOldOutput=="undefined"||this.bOldOutput==true)){
  17974. var _fe0=new RegExp("onclick=\"doSingleDrillThrough[^\"]*\"|onclick='doMultipleDrillThrough[^']*'","gim");
  17975. var aM=_fdf.match(_fe0);
  17976. if(aM){
  17977. if(typeof this.bOldOutput=="undefined"&&aM.length>0&&aM[0].indexOf("'_THIS_'")>0){
  17978. this.bOldOutput=false;
  17979. }else{
  17980. this.bOldOutput=true;
  17981. var _fe2="";
  17982. var quot="'";
  17983. if(aM.length>0){
  17984. _fe2=aM[0].charAt(aM[0].length-1);
  17985. }
  17986. if(_fe2=="'"){
  17987. quot="\"";
  17988. }
  17989. for(var i=0;i<aM.length;i++){
  17990. _fdf=_fdf.replace(aM[i],aM[i].substring(0,aM[i].length-3)+","+quot+this.getCognosViewer().getId()+quot+");"+_fe2);
  17991. }
  17992. }
  17993. }
  17994. }
  17995. return _fdf;
  17996. };
  17997. CIWidgetSavedOutput.prototype.processChart=function(_fe5){
  17998. if(isIE()){
  17999. _fe5=_fe5.replace(/preSelectNode\(event\);/g,getCognosViewerObjectRefAsString(this.getCognosViewer().getId())+".pcc(event);");
  18000. }else{
  18001. _fe5=_fe5.replace(/preSelectNode\(event\);/g,"");
  18002. }
  18003. var _fe6=this.getCognosViewer().getId();
  18004. var _fe7=document.getElementById("CVHiddenIFrame"+_fe6);
  18005. var _fe8=_fe7.src;
  18006. if(_fe8.indexOf("repository")>=0){
  18007. var _fe9=_fe8.indexOf("content");
  18008. var _fea=_fe8.substring(0,_fe9);
  18009. _fe5=_fe5.replace(/src\=\"images\//g,"src=\""+_fea+"images/");
  18010. }
  18011. _fe5=this.fixupChartUseMapValue(_fe5);
  18012. return _fe5.replace(/displayChart[^;].*;|var graphicSrc[^;].*;|var graphicName[^;].*;/g,"");
  18013. };
  18014. CIWidgetSavedOutput.prototype.fixupChartUseMapValue=function(_feb){
  18015. var re=/usemap\s*=\s*"*#(\w+)"*/gi;
  18016. var _fed,_fee=[];
  18017. while((_fed=re.exec(_feb))){
  18018. _fee.push(_fed[1]);
  18019. }
  18020. for(var i=0;i<_fee.length;i++){
  18021. var _ff0=new RegExp(_fee[i],"g");
  18022. _feb=_feb.replace(_ff0,_fee[i]+this.getCognosViewer().getId());
  18023. }
  18024. return _feb;
  18025. };
  18026. CIWidgetSavedOutput.prototype.showHTMLFragment=function(_ff1){
  18027. if(this.bContainsChart){
  18028. _ff1=this.processChart(_ff1);
  18029. }
  18030. _ff1=this.processDrillThrough(_ff1);
  18031. _ff1=_ff1.replace(/_THIS_/g,this.getCognosViewer().getId());
  18032. this.getIWidget().loadStylesAndScripts(_ff1,this.getSavedOutputDiv(),false);
  18033. this.getIWidget().reselectSelectionFilterObjects();
  18034. this.getIWidget().addChromeWhitespaceHandler(this.getCognosViewer().getId());
  18035. };
  18036. function gInitializeViewer(obj){
  18037. if(window.gScriptLoader.hasCompletedExecution()){
  18038. var _ff3=obj.getViewerObject();
  18039. if(_ff3&&_ff3.inlineScriptsDoneExecuting==true){
  18040. clearInterval(obj.timer);
  18041. if(typeof _ff3.errorOccured!="undefined"){
  18042. obj.fireEvent("com.ibm.bux.widget.render.done",null,{});
  18043. }else{
  18044. if(typeof _ff3.getToolbar()!="undefined"){
  18045. _ff3.setViewerWidget(obj);
  18046. if(obj.isSelectionFilterEnabled()){
  18047. obj.updateDrillThroughLinks();
  18048. }
  18049. if(obj.isDashboardOwner()){
  18050. _ff3.addReportInfo();
  18051. }
  18052. if(obj.promptParametersRetrieved==true){
  18053. var _ff4=obj.getAttributeValue("viewerReportPrompts");
  18054. _ff3.envParams["reportPrompts"]=_ff4;
  18055. }else{
  18056. if(_ff3.envParams&&_ff3.envParams["widget.promptParametersRetrievedOnDrop"]=="true"){
  18057. obj.promptParametersRetrieved=true;
  18058. }
  18059. }
  18060. var _ff5=obj.getAttributeValue("syncNewWidgets");
  18061. if(_ff5===null||_ff5==="true"){
  18062. _ff5=true;
  18063. }else{
  18064. _ff5=false;
  18065. }
  18066. if(!_ff5&&(obj.isPastedWidget()||obj.isOpeningSavedDashboard()==false)){
  18067. obj.disableListenToForEvent(["com.ibm.widget.contextChanged.drill","com.ibm.widget.contextChanged.prompt","com.ibm.widget.contextChanged"]);
  18068. }
  18069. obj.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,(_ff3.m_flashChartsObjectIds.length!==0));
  18070. }
  18071. }
  18072. }
  18073. }
  18074. };
  18075. function gVWEvent(sId,evt,_ff8){
  18076. var oCV=window["oCV"+sId];
  18077. if(oCV){
  18078. oCV.loadExtra();
  18079. var _ffa=oCV.getViewerWidget();
  18080. if(_ffa){
  18081. _ffa[_ff8](evt);
  18082. }
  18083. }
  18084. };
  18085. function ReportWidgetLoadQueue(_ffb){
  18086. this._concurrentLoadSetting=_ffb;
  18087. this._widgetsRunning=[];
  18088. this._queue=[];
  18089. };
  18090. ReportWidgetLoadQueue.prototype.add=function(_ffc){
  18091. this._queue.push(_ffc);
  18092. this.loadNextWidget();
  18093. };
  18094. ReportWidgetLoadQueue.prototype.widgetDoneLoading=function(_ffd){
  18095. for(var i=0;i<this._widgetsRunning.length;++i){
  18096. var _fff=this._widgetsRunning[i];
  18097. if(_fff==_ffd){
  18098. this._widgetsRunning.splice(i,1);
  18099. break;
  18100. }
  18101. }
  18102. this.loadNextWidget();
  18103. };
  18104. ReportWidgetLoadQueue.prototype.loadNextWidget=function(){
  18105. if(this._widgetsRunning.length<this._concurrentLoadSetting){
  18106. var _1000=this._queue.shift();
  18107. if(typeof _1000!="undefined"){
  18108. this._widgetsRunning.push(_1000);
  18109. _1000.postReport(null);
  18110. }
  18111. }
  18112. };
  18113. function CognosViewerAnnotation(){
  18114. this.m_oCV=null;
  18115. };
  18116. CognosViewerAnnotation.prototype.setCognosViewer=function(oCV){
  18117. this.m_oCV=oCV;
  18118. };
  18119. CognosViewerAnnotation.prototype.getCognosViewer=function(){
  18120. return this.m_oCV;
  18121. };
  18122. CognosViewerAnnotation.prototype.isEnabled=function(_1002){
  18123. };
  18124. CognosViewerAnnotation.prototype.areAnnotationsEnabled=function(){
  18125. var _1003=this.m_oCV.getViewerWidget();
  18126. return _1003.getAnnotationHelper().isEnabled();
  18127. };
  18128. CognosViewerAnnotation.prototype.getMenuItemBaseString=function(){
  18129. };
  18130. CognosViewerAnnotation.prototype.getMenuItemIconClass=function(){
  18131. };
  18132. CognosViewerAnnotation.prototype.getSelections=function(){
  18133. var _1004=[];
  18134. var _1005=this.getCognosViewer();
  18135. if(_1005){
  18136. var _1006=_1005.getSelectionController();
  18137. if(_1006){
  18138. _1004=_1006.getSelections();
  18139. }
  18140. }
  18141. return _1004;
  18142. };
  18143. CognosViewerAnnotation.prototype.hasAnnotation=function(){
  18144. var has=false;
  18145. var _1008=this.getCognosViewer();
  18146. if(_1008){
  18147. var _1009=_1008.getViewerWidget();
  18148. if(_1009){
  18149. var store=_1009.getAnnotationStore();
  18150. if(store){
  18151. has=store.hasAnnotation();
  18152. }
  18153. }
  18154. }
  18155. return has;
  18156. };
  18157. function CognosViewerCellAnnotation(){
  18158. };
  18159. CognosViewerCellAnnotation.prototype=new CognosViewerAnnotation();
  18160. CognosViewerCellAnnotation.prototype.getMenuItemString=function(_100b){
  18161. var _100c=_100b;
  18162. var _100d=this.getSelections();
  18163. if(_100d&&_100d.length==1){
  18164. var sel=_100d[0];
  18165. _100c=sel.getDisplayValues()[0];
  18166. }
  18167. var text=this.getMenuItemBaseString();
  18168. if(_100c&&_100c.length>0){
  18169. text+=" - "+enforceTextDir(_100c);
  18170. }
  18171. return text;
  18172. };
  18173. CognosViewerCellAnnotation.prototype.hasAnnotaionsOnSelectedCell=function(){
  18174. var _1010=this.getSelections();
  18175. if(_1010&&_1010.length==1){
  18176. var _1011=_1010[0].getCellRef();
  18177. var ctxId=this.getCognosViewer().findCtx(_1011);
  18178. var _1013=this.getCognosViewer().getViewerWidget();
  18179. if(_1013){
  18180. var _1014=_1013.getAnnotationStore();
  18181. if(_1014){
  18182. var _1015=_1014.get(ctxId);
  18183. if(_1015&&_1015.length>0){
  18184. return true;
  18185. }
  18186. }
  18187. }
  18188. }
  18189. return false;
  18190. };
  18191. CognosViewerCellAnnotation.prototype.getChangeableAnnotation=function(){
  18192. var _1016=this.getSelections();
  18193. if(_1016&&_1016.length==1){
  18194. var _1017=_1016[0].getCellRef();
  18195. var ctxId=this.getCognosViewer().findCtx(_1017);
  18196. var _1019=this.getCognosViewer().getViewerWidget();
  18197. if(_1019){
  18198. var _101a=_1019.getAnnotationStore();
  18199. if(_101a){
  18200. return _101a.getChangeableAnnotation(ctxId);
  18201. }
  18202. }
  18203. }
  18204. return null;
  18205. };
  18206. CognosViewerCellAnnotation.prototype.hasValidContextOnSelectedCell=function(){
  18207. var _101b=this.getSelections();
  18208. if(_101b&&_101b.length==1){
  18209. var _101c=_101b[0].getCellRef();
  18210. var ctxId=this.getCognosViewer().findCtx(_101c);
  18211. if(ctxId){
  18212. var ids=AnnotationCTXLookup.generateIDArrayFromCellCtxValue(ctxId);
  18213. for(var i=0;i<ids.length;i++){
  18214. var id=ids[i];
  18215. if(id!=="*"&&!(/^\d+$/).test(id)){
  18216. return false;
  18217. }
  18218. }
  18219. return true;
  18220. }
  18221. }
  18222. return false;
  18223. };
  18224. function NewAnnotation(){
  18225. };
  18226. NewAnnotation.prototype=new CognosViewerCellAnnotation();
  18227. NewAnnotation.prototype.isEnabled=function(_1021){
  18228. return this.areAnnotationsEnabled()&&(_1021!=="widgetActions")&&this.hasValidContextOnSelectedCell();
  18229. };
  18230. NewAnnotation.prototype.getMenuItemBaseString=function(){
  18231. return RV_RES.IDS_JS_ANNOTATION_NEW;
  18232. };
  18233. NewAnnotation.prototype.getMenuItemIconClass=function(){
  18234. return "NewAnnotation";
  18235. };
  18236. function EditAnnotation(){
  18237. };
  18238. EditAnnotation.prototype=new CognosViewerCellAnnotation();
  18239. EditAnnotation.prototype.isEnabled=function(_1022){
  18240. return this.areAnnotationsEnabled()&&(_1022!=="widgetActions")&&this.getChangeableAnnotation()!==null;
  18241. };
  18242. EditAnnotation.prototype.getMenuItemBaseString=function(){
  18243. return RV_RES.IDS_JS_ANNOTATION_EDIT;
  18244. };
  18245. EditAnnotation.prototype.getMenuItemIconClass=function(){
  18246. return "EditAnnotation";
  18247. };
  18248. function DeleteAnnotation(){
  18249. };
  18250. DeleteAnnotation.prototype=new CognosViewerCellAnnotation();
  18251. DeleteAnnotation.prototype.isEnabled=function(_1023){
  18252. return this.areAnnotationsEnabled()&&(_1023!=="widgetActions")&&this.getChangeableAnnotation()!==null;
  18253. };
  18254. DeleteAnnotation.prototype.getMenuItemString=function(_1024){
  18255. return this.getMenuItemBaseString();
  18256. };
  18257. DeleteAnnotation.prototype.getMenuItemBaseString=function(){
  18258. return RV_RES.IDS_JS_ANNOTATION_DELETE;
  18259. };
  18260. DeleteAnnotation.prototype.getMenuItemIconClass=function(){
  18261. return "DeleteAnnotation";
  18262. };
  18263. function CognosViewerWidgetAnnotation(){
  18264. };
  18265. CognosViewerWidgetAnnotation.prototype=new CognosViewerAnnotation();
  18266. CognosViewerWidgetAnnotation.prototype.getMenuItemString=function(){
  18267. var _1025=this.getCognosViewer().getViewerWidget().getDisplayName();
  18268. var text=this.getMenuItemBaseString();
  18269. if(_1025&&_1025.length>0){
  18270. _1025=enforceTextDir(_1025);
  18271. text+=" - "+_1025;
  18272. }
  18273. return text;
  18274. };
  18275. CognosViewerWidgetAnnotation.prototype.hasWidgetLevelAnnotations=function(){
  18276. var _1027=false;
  18277. var _1028=this.getCognosViewer().getViewerWidget();
  18278. if(_1028){
  18279. var _1029=_1028.getAnnotationStore();
  18280. var _102a=_1029.get(_1029.WIDGET_CONTEXT);
  18281. if(_102a&&_102a.length>0){
  18282. _1027=true;
  18283. }
  18284. }
  18285. return _1027;
  18286. };
  18287. CognosViewerWidgetAnnotation.prototype.getWidgetLevelChangeableAnnotation=function(){
  18288. var _102b=this.getCognosViewer().getViewerWidget();
  18289. if(_102b){
  18290. var _102c=_102b.getAnnotationStore();
  18291. if(_102c){
  18292. return _102c.getChangeableAnnotation(_102c.WIDGET_CONTEXT);
  18293. }
  18294. }
  18295. return null;
  18296. };
  18297. CognosViewerWidgetAnnotation.prototype.hasValidSelection=function(_102d){
  18298. var _102e=this.m_oCV.getSelectionController();
  18299. var _102f=_102e.getSelections();
  18300. var _1030=false;
  18301. if(_102e.hasSelectedChartNodes()){
  18302. _1030=(_102e.getSelectedChartNodes()[0].m_contextIds.length>0);
  18303. }
  18304. return (_102d==="widgetActions")||(_102f.length!=1&&!_1030);
  18305. };
  18306. function NewWidgetAnnotation(){
  18307. };
  18308. NewWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
  18309. NewWidgetAnnotation.prototype.isEnabled=function(_1031){
  18310. return this.areAnnotationsEnabled()&&(_1031!=="contextMenu")&&this.hasValidSelection(_1031);
  18311. };
  18312. NewWidgetAnnotation.prototype.getMenuItemBaseString=function(){
  18313. return RV_RES.IDS_JS_WIDGET_ANNOTATION_NEW;
  18314. };
  18315. NewWidgetAnnotation.prototype.getMenuItemIconClass=function(){
  18316. return "NewWidgetAnnotation";
  18317. };
  18318. function EditWidgetAnnotation(){
  18319. };
  18320. EditWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
  18321. EditWidgetAnnotation.prototype.isEnabled=function(_1032){
  18322. return (this.areAnnotationsEnabled()&&(_1032!=="contextMenu")&&this.hasValidSelection(_1032)&&this.getWidgetLevelChangeableAnnotation())?true:false;
  18323. };
  18324. EditWidgetAnnotation.prototype.getMenuItemBaseString=function(){
  18325. return RV_RES.IDS_JS_WIDGET_ANNOTATION_EDIT;
  18326. };
  18327. EditWidgetAnnotation.prototype.getMenuItemIconClass=function(){
  18328. return "EditWidgetAnnotation";
  18329. };
  18330. function DeleteWidgetAnnotation(){
  18331. };
  18332. DeleteWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
  18333. DeleteWidgetAnnotation.prototype.isEnabled=function(_1033){
  18334. return (this.areAnnotationsEnabled()&&(_1033!=="contextMenu")&&this.hasValidSelection(_1033)&&this.getWidgetLevelChangeableAnnotation())?true:false;
  18335. };
  18336. DeleteWidgetAnnotation.prototype.getMenuItemBaseString=function(){
  18337. return RV_RES.IDS_JS_WIDGET_ANNOTATION_DELETE;
  18338. };
  18339. DeleteWidgetAnnotation.prototype.getMenuItemIconClass=function(){
  18340. return "DeleteWidgetAnnotation";
  18341. };
  18342. function AnnotationCTXLookup(_1034){
  18343. this.m_ccdManager=_1034;
  18344. this.m_md=this.m_ccdManager.m_md;
  18345. this.m_cd=this.m_ccdManager.m_cd;
  18346. this.m_RDIVALUE_KEY="annotationHook";
  18347. this.m_oContextDetailsMap={};
  18348. };
  18349. AnnotationCTXLookup.prototype.populateCtxDetailsForAllAnnotations=function(_1035){
  18350. for(var i=0,len=_1035.length;i<len;i++){
  18351. var anno=_1035[i];
  18352. var ctx=anno.ctx;
  18353. if(ctx){
  18354. this._populateCtxDetailsForOneCtxValue(ctx);
  18355. }
  18356. }
  18357. };
  18358. AnnotationCTXLookup.prototype._populateCtxDetailsForOneCtxValue=function(_103a){
  18359. if(_103a){
  18360. var _103b=this.generateIDArrayFromCellCtxValue(_103a);
  18361. for(var i=0,len=_103b.length;i<len;i++){
  18362. var id=_103b[i];
  18363. this._populateCtxDetailsForOneId(id);
  18364. }
  18365. }
  18366. };
  18367. AnnotationCTXLookup.generateIDArrayFromCellCtxValue=function(_103f){
  18368. if(_103f){
  18369. return _103f.replace(/::/g,":").split(":");
  18370. }
  18371. return null;
  18372. };
  18373. AnnotationCTXLookup.prototype.generateIDArrayFromCellCtxValue=AnnotationCTXLookup.generateIDArrayFromCellCtxValue;
  18374. AnnotationCTXLookup.prototype._populateCtxDetailsForOneId=function(id){
  18375. if(id.match(/\*/)){
  18376. return;
  18377. }
  18378. var _1041=this.m_oContextDetailsMap[id];
  18379. if(_1041){
  18380. return;
  18381. }else{
  18382. _1041={};
  18383. var _1042=this.m_cd[id];
  18384. if(_1042){
  18385. if(_1042.u){
  18386. _1041["u"]=_1042.u;
  18387. }
  18388. if(_1042.r){
  18389. _1041["r"]=_1042.r;
  18390. var _1043=this.m_md[_1042.r];
  18391. if(_1043){
  18392. if(_1043.usage!=="undefined"){
  18393. _1041["usage"]=_1043.usage;
  18394. }
  18395. if(_1043.dtype){
  18396. _1041.dtype=_1043.dtype;
  18397. }
  18398. }
  18399. }
  18400. this._populateRdiValueInDetail(_1041,id);
  18401. this.m_oContextDetailsMap[id]=_1041;
  18402. }
  18403. }
  18404. };
  18405. AnnotationCTXLookup.prototype._getMDValue=function(item,key1,key2){
  18406. if(typeof key2=="undefined"){
  18407. key2=key1;
  18408. }
  18409. if(typeof item[key1]!="undefined"&&typeof this.m_md[item[key1]][key2]!="undefined"){
  18410. return this.m_md[item[key1]][key2];
  18411. }
  18412. return null;
  18413. };
  18414. AnnotationCTXLookup.prototype._findMDValue=function(item,aKeys){
  18415. for(var i=0;i<aKeys.length;i++){
  18416. var value=this._getMDValue(item,aKeys[i]);
  18417. if(value!==null){
  18418. return value;
  18419. }
  18420. }
  18421. return null;
  18422. };
  18423. AnnotationCTXLookup.prototype._populateRdiValueInDetail=function(_104b,id){
  18424. var item=this.m_cd[id];
  18425. var aKeys=[];
  18426. var oRdi={};
  18427. oRdi[1]=this._findMDValue(item,["l","h","i","r"]);
  18428. if(this._getMDValue(item,"r","usage")==2){
  18429. oRdi[2]=this._findMDValue(item,["i","m","r"]);
  18430. }
  18431. _104b[this.m_RDIVALUE_KEY]=oRdi;
  18432. };
  18433. AnnotationCTXLookup.prototype.getDetail=function(id){
  18434. if(!id){
  18435. return null;
  18436. }
  18437. return this.m_oContextDetailsMap[id];
  18438. };
  18439. AnnotationCTXLookup.prototype.isAnnotatedId=function(_1051,_1052,id){
  18440. if(!_1051||!id){
  18441. return false;
  18442. }
  18443. if(_1051.match(/\*/)){
  18444. var _1054=this.getDetail(id);
  18445. if(_1054&&_1054[this.m_RDIVALUE_KEY]){
  18446. var rdi=_1054[this.m_RDIVALUE_KEY][1];
  18447. if(_1052.version>=2&&_1054[this.m_RDIVALUE_KEY][2]){
  18448. rdi=_1054[this.m_RDIVALUE_KEY][2];
  18449. }
  18450. return this._compareWithoutNS(_1052.rdi,rdi);
  18451. }else{
  18452. return false;
  18453. }
  18454. }else{
  18455. return _1051===id;
  18456. }
  18457. };
  18458. AnnotationCTXLookup.prototype._compareWithoutNS=function(rdi1,rdi2){
  18459. if(!rdi1||!rdi2){
  18460. return false;
  18461. }
  18462. if(rdi1!==rdi2){
  18463. var _1058=rdi2.indexOf("].[");
  18464. if(_1058>0){
  18465. return rdi1.lastIndexOf(rdi2.substr(_1058))>0;
  18466. }
  18467. return false;
  18468. }
  18469. return true;
  18470. };
  18471. AnnotationCTXLookup.prototype.isAnnotatedCell=function(_1059,_105a){
  18472. if(!_1059||!_1059.ctx||!_105a){
  18473. return false;
  18474. }
  18475. this._populateCtxDetailsForOneCtxValue(_105a);
  18476. var _105b=this.generateIDArrayFromCellCtxValue(_1059.ctx);
  18477. var _105c=this.generateIDArrayFromCellCtxValue(_105a);
  18478. if(!this.isAnnotatedId(_105b[0],_1059,_105c[0])){
  18479. return false;
  18480. }
  18481. var _105d=this._generateDataItemIDArrayFromAnnotationIDs(_105b);
  18482. var _105e=this._generateDataItemIDArrayFromCellIDs(_105c);
  18483. if(_105d.length>_105e.length){
  18484. return false;
  18485. }
  18486. for(var i=0,len=_105d.length;i<len;i++){
  18487. for(var j=0,jLen=_105e.length;j<jLen;j++){
  18488. if(_105d[i]===_105e[j]){
  18489. _105d[i]=true;
  18490. _105e[j]=true;
  18491. break;
  18492. }
  18493. }
  18494. }
  18495. for(i=0,len=_105d.length;i<len;i++){
  18496. if(_105d[i]!==true){
  18497. return false;
  18498. }
  18499. }
  18500. for(i=0,len=_105e.length;i<len;i++){
  18501. if(_105e[i]!==true){
  18502. return false;
  18503. }
  18504. }
  18505. return true;
  18506. };
  18507. AnnotationCTXLookup.prototype._generateDataItemIDArrayFromCellIDs=function(_1063){
  18508. var _1064=[];
  18509. for(var i=1,len=_1063.length;i<len;i++){
  18510. var id=_1063[i];
  18511. var _1068=this.getDetail(id);
  18512. if(this._isDataItem(_1068)){
  18513. _1064.splice(0,0,id);
  18514. }
  18515. }
  18516. return _1064;
  18517. };
  18518. AnnotationCTXLookup.dtypeLookup={"1":true,"25":true,"26":true,"27":true,"28":true,"29":true,"30":true,"31":true,"32":true,"34":true,"35":true,"36":true,"43":true,"45":true,"55":true,"56":true};
  18519. AnnotationCTXLookup.prototype._isDataItem=function(_1069){
  18520. if(_1069){
  18521. var usage=_1069.usage;
  18522. var dtype=_1069.dtype;
  18523. if(usage===0||usage===1||(usage===3&&AnnotationCTXLookup.dtypeLookup[dtype]===true)){
  18524. return true;
  18525. }
  18526. }
  18527. return false;
  18528. };
  18529. AnnotationCTXLookup.prototype._generateDataItemIDArrayFromAnnotationIDs=function(_106c){
  18530. var _106d=[];
  18531. for(var i=1,len=_106c.length;i<len;i++){
  18532. var id=_106c[i];
  18533. if(id.match(/\*/)===null){
  18534. _106d.splice(0,0,id);
  18535. }
  18536. }
  18537. return _106d;
  18538. };
  18539. dojo.provide("bux.reportViewer.ReportInfo");
  18540. dojo.require("bux.Tooltip");
  18541. dojo.declare("bux.reportViewer.ReportInfo",bux.TooltipBase,{templateString:"<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\">\n\t<div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" waiRole='alert'></div>\n\t<div class=\"dijitTooltipConnector\"></div>\n</div>\n",title:"",text:"",linkText:null,linkScript:null,constructor:function(args){
  18542. if(args.focusElement){
  18543. dojo.connect(args.focusElement,"onfocus",this,"_onHover");
  18544. dojo.connect(args.focusElement,"onblur",this,"_onUnHover");
  18545. }
  18546. },createMarkup:function(){
  18547. var _1072=this.connectId+"_linkId";
  18548. var _1073=dojo.isIE||dojo.isTrident?"\"#\"":"\"javascript:void(0);\"";
  18549. var _1074="";
  18550. _1074+="<table role=\"presentation\" class=\"bux-tooltip-table\" cellspacing=\"0\" cellpadding=\"0\">";
  18551. _1074+="<tr>";
  18552. _1074+="<td class=\"bux-tooltip-title\">";
  18553. _1074+=html_encode(this.title);
  18554. _1074+="</td>";
  18555. _1074+="</tr>";
  18556. _1074+="<tr>";
  18557. _1074+="<td class=\"bux-tooltip-text\">";
  18558. _1074+=html_encode(this.text);
  18559. _1074+="</td>";
  18560. _1074+="</tr>";
  18561. _1074+="<tr>";
  18562. if(this.linkScript){
  18563. _1074+="<td class=\"bux-tooltip-text\">";
  18564. _1074+="<a role=\"link\" id=\""+_1072+"\" href="+_1073+" onmousedown=\""+this.linkScript+"\">"+html_encode(this.linkText)+"</a>";
  18565. _1074+="</td>";
  18566. }else{
  18567. _1074+="<td></td>";
  18568. }
  18569. _1074+="</tr>";
  18570. _1074+="</table>";
  18571. return _1074;
  18572. }});
  18573. dojo.provide("ViewerIWidgetInlineDialog");
  18574. dojo.require("dijit._base.focus");
  18575. dojo.declare("ViewerIWidgetInlineDialog",null,{constructor:function(oCV,sHTML,_1077,_1078){
  18576. this.initialize(oCV,sHTML);
  18577. this.m_aButtons=_1077;
  18578. this.m_sButtonContainerId=_1078;
  18579. },initialize:function(oCV,sHTML){
  18580. this.m_oCV=oCV;
  18581. this.m_html=sHTML;
  18582. this.m_viewerDiv=dojo.byId("RVContent"+this.m_oCV.getId());
  18583. this.positionOptions={horizontal:"center",vertical:"center"};
  18584. this.onScrollHandle=null;
  18585. this.m_dialogDiv=null;
  18586. if(this.m_oCV.getViewerWidget){
  18587. this.m_background=this.m_oCV.getViewerWidget().getReportBlocker();
  18588. }
  18589. },setVerticalPositionOption:function(_107b){
  18590. this.positionOptions.vertical=_107b;
  18591. },getDialogDiv:function(){
  18592. return this.m_dialogDiv;
  18593. },initializeDialog:function(){
  18594. this.m_dialogDiv=document.createElement("div");
  18595. dojo.addClass(this.m_dialogDiv,"inlineDialog");
  18596. this.m_dialogDiv.style.display="none";
  18597. this.m_dialogDiv.innerHTML=this.m_html;
  18598. dojo.place(this.m_dialogDiv,this.m_background.getNode().nextSibling,"before");
  18599. var _107c=dojo.byId(this.m_sButtonContainerId);
  18600. if(_107c&&this.m_aButtons&&this.m_aButtons.length>0){
  18601. dojo.forEach(this.m_aButtons,function(_107d){
  18602. var span=document.createElement("span");
  18603. _107c.appendChild(span);
  18604. var _107f=new dijit.form.Button(_107d,span);
  18605. });
  18606. }
  18607. },createBackgroundTabCatchDiv:function(){
  18608. if(this.m_tabCatch==null){
  18609. this.m_tabCatch=dojo.byId("BACKGROUND_TABCATCH"+this.m_oCV.getId());
  18610. if(!this.m_tabCatch){
  18611. this.m_tabCatch=document.createElement("div");
  18612. this.m_tabCatch.id="BACKGROUND_TABCATCH"+this.m_oCV.getId();
  18613. this.m_tabCatch.style.display="none";
  18614. this.m_tabCatch.style.position="absolute";
  18615. this.m_tabCatch.style.left="0";
  18616. this.m_tabCatch.style.top="0";
  18617. this.m_tabCatch.style.height="0px";
  18618. this.m_tabCatch.style.width="0px";
  18619. this.m_tabCatch.setAttribute("tabIndex","0");
  18620. if(this.m_viewerDiv.firstChild){
  18621. dojo.place(this.m_tabCatch,this.m_viewerDiv.firstChild,"before");
  18622. }else{
  18623. this.m_viewerDiv.appendChild(this.m_tabCatch);
  18624. }
  18625. }
  18626. }
  18627. },initializeBackground:function(){
  18628. this.createBackgroundTabCatchDiv();
  18629. },initializeKeyboardSupport:function(){
  18630. var _1080=dijit._getTabNavigable(this.m_dialogDiv);
  18631. var _1081=_1080.lowest||_1080.first;
  18632. var _1082=_1080.last||_1080.highest||_1081;
  18633. if(_1081){
  18634. this.m_tabCatch.onfocus=function(){
  18635. dijit.focus(_1081);
  18636. };
  18637. this.m_background.getNode().onfocus=function(){
  18638. dijit.focus(_1081);
  18639. };
  18640. }
  18641. if(_1082&&_1081){
  18642. _1082.onblur=function(){
  18643. dijit.focus(_1081);
  18644. };
  18645. }else{
  18646. if(_1081){
  18647. _1081.onblur=function(){
  18648. dijit.focus(_1081);
  18649. };
  18650. }
  18651. }
  18652. if(this.m_oCV.getKeepFocus()!=false&&_1081&&_1081.focus){
  18653. _1081.focus();
  18654. }
  18655. },show:function(){
  18656. this.m_oCV.setVisibleDialog(this);
  18657. if(this.m_tabCatch==null){
  18658. this.initializeBackground();
  18659. }
  18660. if(this.m_dialogDiv==null){
  18661. this.initializeDialog();
  18662. }
  18663. this.m_background.setClassNameOverride("inlineDialog-background-error");
  18664. this.m_background.show();
  18665. this.m_tabCatch.style.display="block";
  18666. this.m_dialogDiv.style.display="block";
  18667. this.initializeKeyboardSupport();
  18668. },hide:function(){
  18669. this.m_oCV.setVisibleDialog(null);
  18670. if(this.onScrollHandle!=null){
  18671. dojo.disconnect(this.onScrollHandle);
  18672. this.onScrollHandle=null;
  18673. }
  18674. if(this.m_background!=null){
  18675. this.m_background.hide();
  18676. }
  18677. if(this.m_tabCatch!=null){
  18678. this.m_tabCatch.style.display="none";
  18679. }
  18680. if(this.m_dialogDiv!=null){
  18681. this.m_dialogDiv.style.display="none";
  18682. }
  18683. },destroy:function(){
  18684. this.hide();
  18685. if(this.m_dialogDiv!=null){
  18686. this.m_dialogDiv.parentNode.removeChild(this.m_dialogDiv);
  18687. this.m_dialogDiv=null;
  18688. }
  18689. if(this.m_tabCatch!=null){
  18690. this.m_tabCatch.parentNode.removeChild(this.m_tabCatch);
  18691. this.m_tabCatch=null;
  18692. }
  18693. if(this.m_background!=null){
  18694. this.m_background.destroy();
  18695. this.m_background=null;
  18696. }
  18697. },setDebugHelper:function(_1083){
  18698. var _1084=document.createElement("div");
  18699. _1084.style.zIndex="100";
  18700. _1084.style.display="block";
  18701. _1084.style.position="relative";
  18702. _1084.style.backgroundColor="#FFFFFF";
  18703. _1084.innerHTML="<table><tr><td>"+"<a href=\"#\" onclick=\""+_1083+".show();\">show</a>"+" "+"<a href=\"#\" onclick=\""+_1083+".hide();\">hide</a></td></tr></table>";
  18704. document.body.insertBefore(_1084,document.body.firstChild);
  18705. }});
  18706. dojo.provide("bux.reportViewer.Properties");
  18707. dojo.declare("bux.reportViewer.Properties",null,{iWidget:null,masterDialogSpec:null,masterDialogSpecProperties:null,flashChartSpec:null,isFlashChartOptionEnabled:true,oldProperties:null,dialogDisplayValues:null,constructor:function(_1085,_1086){
  18708. this.isInitialized=false;
  18709. this.initializeDialogDisplayValues();
  18710. this.oldProperties={};
  18711. this.iWidget=_1085;
  18712. if(_1086==="<empty>"){
  18713. return;
  18714. }
  18715. var json=dojo.eval("["+_1086+"]");
  18716. if(json&&json[0]){
  18717. this.initializeWithSavedPropertyValues(json[0]);
  18718. }
  18719. },initializeDialogDisplayValues:function(){
  18720. this.dialogDisplayValues={flashCharts:{value:null,canUndo:true,runReport:true},rowsPerPage:{value:null,canUndo:true,runReport:true},promptUserOnLoad:{value:false},retrieveAll:{value:false,refreshSavedOutput:true},showExpandCollapseIcon:{value:null}};
  18721. },clearDialogSpec:function(){
  18722. this.masterDialogSpec=null;
  18723. this.masterDialogSpecProperties=null;
  18724. },initializeWithSavedPropertyValues:function(_1088){
  18725. for(var prop in _1088){
  18726. if(typeof prop!="undefined"&&prop!=null){
  18727. if(this.dialogDisplayValues[prop]){
  18728. this.dialogDisplayValues[prop].value=_1088[prop];
  18729. }else{
  18730. this.dialogDisplayValues[prop]={value:_1088[prop],canUndo:false};
  18731. }
  18732. }
  18733. }
  18734. },setProperty:function(_108a,value){
  18735. this.dialogDisplayValues[_108a].value=value;
  18736. },getProperty:function(_108c){
  18737. if(this.dialogDisplayValues[_108c]){
  18738. return this.dialogDisplayValues[_108c].value;
  18739. }
  18740. return null;
  18741. },getOldProperty:function(_108d){
  18742. if(this.oldProperties&&this.oldProperties[_108d]){
  18743. return this.oldProperties[_108d].value;
  18744. }
  18745. return null;
  18746. },getOldProperties:function(){
  18747. var _108e={};
  18748. for(var prop in this.oldProperties){
  18749. if(this.dialogDisplayValues[prop].canUndo===true){
  18750. _108e[prop]={};
  18751. _108e[prop].value=this.oldProperties[prop].value;
  18752. }
  18753. }
  18754. return _108e;
  18755. },onGet:function(){
  18756. this.copyPropertyValues(this.dialogDisplayValues,this.oldProperties);
  18757. if(!this.masterDialogSpec){
  18758. this.initializeDialogSpec();
  18759. }else{
  18760. this.updateDialogSpec();
  18761. }
  18762. var _1090={tabTitle:this._getReportWidgetTabTitle(),properties:this.dialogDisplayValues,propertiesDialogSpec:this.masterDialogSpec};
  18763. return _1090;
  18764. },_getReportWidgetTabTitle:function(){
  18765. var _1091;
  18766. if(this.iWidget&&this.iWidget.getViewerObject()){
  18767. _1091=RV_RES.IDS_REPORT_WIDGET_PROPERTY_TAB_TITLE;
  18768. }
  18769. return _1091;
  18770. },onSet:function(_1092){
  18771. if(this.isSavedOutput()){
  18772. this.updateSavedOutput();
  18773. }else{
  18774. if(!this.runReportWithNewOptions()){
  18775. this._updateReport();
  18776. }
  18777. }
  18778. },_updateReport:function(){
  18779. var _1093=this.getProperty("showExpandCollapseIcon");
  18780. if(this.getOldProperty("showExpandCollapseIcon")!=_1093){
  18781. var oCV=this.iWidget.getViewerObject();
  18782. if(_1093===true){
  18783. oCV.insertExpandIconsForAllCrosstabs();
  18784. }else{
  18785. oCV.removeExpandIconsForAllCrosstabs();
  18786. }
  18787. }
  18788. },copyPropertyValues:function(from,to){
  18789. for(var prop in from){
  18790. if(!to[prop]){
  18791. to[prop]={};
  18792. }
  18793. to[prop].value=from[prop].value;
  18794. }
  18795. },doUndo:function(_1098){
  18796. this.copyPropertyValues(_1098,this.dialogDisplayValues);
  18797. },getUndoInfo:function(){
  18798. if(!this.isInitialized){
  18799. var oCV=this.iWidget.getViewerObject();
  18800. this.initialize(oCV.envParams);
  18801. }
  18802. var _109a={};
  18803. for(var prop in this.dialogDisplayValues){
  18804. if(this.dialogDisplayValues[prop].canUndo===true){
  18805. _109a[prop]={value:this.getProperty(prop)};
  18806. }
  18807. }
  18808. return _109a;
  18809. },shouldUpdateReport:function(_109c){
  18810. for(var prop in this.dialogDisplayValues){
  18811. if(this.dialogDisplayValues[prop][_109c]==true&&this.getOldProperty(prop)!=this.getProperty(prop)){
  18812. return true;
  18813. }
  18814. }
  18815. return false;
  18816. },runReportWithNewOptions:function(){
  18817. if(this.shouldUpdateReport("runReport")){
  18818. var oCV=this.iWidget.getViewerObject();
  18819. var _109f=oCV.getAction("RunReport");
  18820. _109f.setReuseQuery(true);
  18821. _109f.execute();
  18822. this.iWidget.getUndoRedoQueue().initUndoObj({"tooltip":this.getUndoHint(),"saveSpec":this.saveSpecForUndo()});
  18823. return true;
  18824. }
  18825. return false;
  18826. },updateSavedOutput:function(){
  18827. if(this.shouldUpdateReport("refreshSavedOutput")){
  18828. var _10a0=this.iWidget.getSavedOutput();
  18829. _10a0.setPagedOutput(!this.getRetrieveAll());
  18830. _10a0.render();
  18831. }
  18832. },toString:function(){
  18833. var str="{";
  18834. for(var prop in this.dialogDisplayValues){
  18835. var _10a3=this.getProperty(prop);
  18836. if(_10a3!=null&&typeof _10a3!=="undefined"){
  18837. if(str!="{"){
  18838. str+=", ";
  18839. }
  18840. str+="\""+prop+"\": ";
  18841. str+=(typeof (_10a3)=="string")?_10a3.toString():dojo.toJson(_10a3);
  18842. }
  18843. }
  18844. str+="}";
  18845. return str;
  18846. },isSavedOutput:function(){
  18847. return this.iWidget.getViewerObject().envParams["ui.action"]==="view";
  18848. },getUndoHint:function(){
  18849. return RV_RES.IDS_JS_WIDGET_PROPERTIES;
  18850. },saveSpecForUndo:function(){
  18851. return false;
  18852. },getRetrieveAll:function(){
  18853. return this.getProperty("retrieveAll");
  18854. },getPromptUserOnLoad:function(){
  18855. return this.getProperty("promptUserOnLoad");
  18856. },getFlashCharts:function(){
  18857. return this.getProperty("flashCharts");
  18858. },getRowsPerPage:function(){
  18859. return this.getProperty("rowsPerPage");
  18860. },getOriginalReportLocation:function(_10a4){
  18861. if(_10a4.getAttributeValue&&!_10a4.getAttributeValue("originalReport")){
  18862. return RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION_UNAVAILABLE;
  18863. }
  18864. var _10a5=_10a4.getViewerObject().envParams["originalReportLocation"];
  18865. if(typeof _10a5=="undefined"||_10a5==null||_10a5=="Unavailable"){
  18866. return RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION_UNAVAILABLE;
  18867. }
  18868. return (RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+_10a5);
  18869. },getShowExpandCollapseIconFlag:function(){
  18870. return this.getProperty("showExpandCollapseIcon");
  18871. },getAdvancedServerProperty:function(_10a6){
  18872. if(!this.iWidget&&!this.iWidget.getViewerObject()){
  18873. return null;
  18874. }
  18875. return this.iWidget.getViewerObject().getAdvancedServerProperty(_10a6);
  18876. },initializeShowExpandCollapseIconFlag:function(){
  18877. var _10a7=this.getAdvancedServerProperty("VIEWER_JS_EXPAND_COLLAPSE_CONTROLS_DEFAULT");
  18878. this.bHideExpandCollapseOption=(!_10a7);
  18879. if(this.bHideExpandCollapseOption){
  18880. return;
  18881. }
  18882. if(this.getShowExpandCollapseIconFlag()===null){
  18883. this.setProperty("showExpandCollapseIcon",_10a7.toLowerCase()==="on");
  18884. }
  18885. },initialize:function(_10a8){
  18886. if(this.isInitialized){
  18887. return;
  18888. }
  18889. this.isInitialized=true;
  18890. this.initializeFlashChartSettings(_10a8.flashChartOption);
  18891. this.initializeShowExpandCollapseIconFlag();
  18892. if(this.getRowsPerPage()==null){
  18893. if(_10a8["run.verticalElements"]!=null){
  18894. this.setProperty("rowsPerPage",_10a8["run.verticalElements"]);
  18895. }else{
  18896. this.setProperty("rowsPerPage",20);
  18897. }
  18898. }
  18899. this.initializeDialogSpec();
  18900. },createViewReportSpecLink:function(){
  18901. var oCV=this.iWidget.getViewerObject();
  18902. var _10aa=oCV.envParams["ui.spec"];
  18903. if(oCV.bCanUseReportStudio&&_10aa&&_10aa.length>0&&oCV.envParams["ui.action"]!="view"){
  18904. return {columns:[{propertyName:"viewReportSpecification",uiElementType:"link",label:RV_RES.IDS_JS_SHOW_REPORT_SPEC,eventHandler:this,onClickAction:dojo.hitch(this,this.onClickViewReportSpecification)}]};
  18905. }else{
  18906. return {};
  18907. }
  18908. },isBlackListedOption:function(_10ab){
  18909. return this.iWidget.getViewerObject().isBlacklisted(_10ab);
  18910. },createFlashChartOption:function(){
  18911. var _10ac=[{columns:[{propertyName:"flashCharts",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_FLASHCHARTS}]},{columns:[{uiElementType:"hSpacer"}]}];
  18912. return _10ac;
  18913. },getShowExpandCollapseIconOptionSpec:function(){
  18914. var spec=[{columns:[{propertyName:"showExpandCollapseIcon",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_SHOW_EXPAND_COLLAPSE_ICON}]},{columns:[{uiElementType:"hspacer"}]}];
  18915. return spec;
  18916. },generateDialogSpec:function(role){
  18917. var _10af;
  18918. if(role=="consume"){
  18919. _10af=[{columns:[{propertyName:"rowsPerPage",uiElementType:"textBox",type:"number",label:RV_RES.IDS_JS_PROPERTY_ROWS_PER_PAGE}]}];
  18920. this.masterDialogSpec={rows:_10af};
  18921. }else{
  18922. var _10b0=this.createViewReportSpecLink();
  18923. _10af=[{columns:[{propertyName:"rowsPerPage",uiElementType:"textBox",type:"number",label:RV_RES.IDS_JS_PROPERTY_ROWS_PER_PAGE,constraints:{min:1,max:1000},required:true,invalidMessage:RV_RES.IDS_JS_PROPERTY_ROWS_PER_PAGE_ERROR}]},{columns:[{uiElementType:"hspacer"}]},{columns:[{propertyName:"promptUserOnLoad",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_PROMPT_ON_LOAD}]},{columns:[{propertyName:"retrieveAll",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_RETRIEVE_ENTIRE_REPORT}]},_10b0,{columns:[{propertyName:"originalReportLocation",uiElementType:"text",label:this.getOriginalReportLocation(this.iWidget),allowWrapping:true}]}];
  18924. if(this.isFlashChartOptionEnabled&&!this.hasAVSChart()&&role!=="consume"){
  18925. var _10b1=this.createFlashChartOption();
  18926. _10af=_10b1.concat(_10af);
  18927. }
  18928. if(!this.bHideExpandCollapseOption&&!this.isBlackListedOption("ExpandMember")){
  18929. _10af=this.getShowExpandCollapseIconOptionSpec().concat(_10af);
  18930. }
  18931. this.masterDialogSpec={rows:_10af};
  18932. }
  18933. if(this.masterDialogSpec&&this.masterDialogSpec.rows){
  18934. this.masterDialogSpecProperties={};
  18935. for(var r in this.masterDialogSpec.rows){
  18936. var row=this.masterDialogSpec.rows[r];
  18937. if(row.columns){
  18938. for(var c in row.columns){
  18939. var col=row.columns[c];
  18940. if(col.propertyName){
  18941. this.masterDialogSpecProperties[col.propertyName]=col;
  18942. }
  18943. }
  18944. }
  18945. }
  18946. }
  18947. },updateDialogSpec:function(){
  18948. if(this.masterDialogSpecProperties){
  18949. if(this.masterDialogSpecProperties.originalReportLocation){
  18950. this.masterDialogSpecProperties.originalReportLocation.label=this.getOriginalReportLocation(this.iWidget);
  18951. }
  18952. }
  18953. },initializeDialogSpec:function(){
  18954. var _10b6=this.iWidget.getUserRole();
  18955. this.generateDialogSpec(_10b6);
  18956. },hasAVSChart:function(){
  18957. if(this.iWidget==null||typeof this.iWidget.getViewerObject()=="undefined"){
  18958. return false;
  18959. }
  18960. var oCV=this.iWidget.getViewerObject();
  18961. if(typeof oCV=="undefined"){
  18962. return false;
  18963. }
  18964. return oCV.hasAVSChart();
  18965. },initializeFlashChartSettings:function(value){
  18966. if(!value){
  18967. return;
  18968. }
  18969. var json=(typeof value==="string")?(eval(value)):value;
  18970. var _10ba=json[0];
  18971. this.setProperty("flashCharts",_10ba.defaultValue);
  18972. this.isFlashChartOptionEnabled=!_10ba.isOptionDisabled;
  18973. },onClickViewReportSpecification:function(){
  18974. var _10bb=this.iWidget.getViewerObject().envParams["ui.spec"];
  18975. this._viewSpecInWindow(_10bb);
  18976. },_getWindowOptions:function(w,h){
  18977. var _10be="resizable=yes,scrollbars=yes,menubar=no,directories=no,location=no,status=no,toolbar=no,titlebar=no";
  18978. var left=(screen.width-w)/2;
  18979. var top=(screen.height-h)/2;
  18980. _10be+=",top="+top;
  18981. _10be+=",left="+left;
  18982. _10be+=",width="+w;
  18983. _10be+=",height="+h;
  18984. return _10be;
  18985. },_viewSpecInWindow:function(_10c1){
  18986. var _10c2=dijit.getViewport();
  18987. var _10c3="debugWindow"+this.iWidget.getViewerObject().getId();
  18988. var _10c4=this._getWindowOptions(_10c2.w,_10c2.h);
  18989. var _10c5=window.open("",_10c3,_10c4);
  18990. var head="<html><body><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"+"<tbody><tr><td>"+"<textarea wrap=\"off\" style=\"font-family:arial; font-size: 10px; overflow: auto; width:100%; height:";
  18991. head+=_10c2.h*0.95;
  18992. head+="px;\">";
  18993. var tail="</textarea></td></tr></tbody></table></body></html>";
  18994. _10c5.document.write(head+html_encode(_10c1)+tail);
  18995. }});
  18996. dojo.require("bux.reportViewer.Properties");
  18997. dojo.provide("ActiveReportIWidgetProperties");
  18998. dojo.declare("ActiveReportIWidgetProperties",[bux.reportViewer.Properties],{initializeDialogDisplayValues:function(){
  18999. this.dialogDisplayValues={activeReportState:{value:null,canUndo:false,runReport:false}};
  19000. },getActiveReportState:function(){
  19001. return this.getProperty("activeReportState");
  19002. },setActiveReportState:function(_10c8){
  19003. this.setProperty("activeReportState",_10c8);
  19004. },initialize:function(_10c9){
  19005. if(this.isInitialized){
  19006. return;
  19007. }
  19008. this.isInitialized=true;
  19009. this.initializeDialogSpec();
  19010. },initializeDialogSpec:function(){
  19011. var _10ca=[{columns:[{propertyName:"originalReportLocation",uiElementType:"text",label:this.getOriginalReportLocation(this.iWidget),allowWrapping:true}]},{columns:[{propertyName:"ActiveReportOutputVersion",uiElementType:"text",label:this._getAcitveReportOutputVersion(this.iWidget),allowWrapping:true}]}];
  19012. if(this.iWidget.isDebugMode()){
  19013. _10ca.push({columns:[{propertyName:"PublicVariables",uiElementType:"text",label:this._getPublicVariableNames(this.iWidget),allowWrapping:true}]});
  19014. }
  19015. this.masterDialogSpec={rows:_10ca};
  19016. },_getAcitveReportOutputVersion:function(_10cb){
  19017. var _10cc=_10cb.getActiveReportOutputVersion();
  19018. if(_10cc==null){
  19019. _10cc=RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION_UNAVAILABLE;
  19020. }
  19021. return (RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION+" "+_10cc);
  19022. },_getPublicVariableNames:function(_10cd){
  19023. var _10ce=_10cd.getPublicVariableNames();
  19024. var _10cf="";
  19025. for(var name in _10ce){
  19026. var sType=_10ce[name];
  19027. if(_10cf.length>0){
  19028. _10cf+=", ";
  19029. }
  19030. _10cf+=name;
  19031. _10cf+=(sType==="D")?" (Discrete)":"(Range)";
  19032. }
  19033. if(_10cf.length>0){
  19034. _10cf="Public Variables: "+_10cf;
  19035. }
  19036. return _10cf;
  19037. },_getReportWidgetTabTitle:function(){
  19038. var _10d2;
  19039. if(this.iWidget&&this.iWidget.getViewerObject()){
  19040. _10d2=RV_RES.IDS_ACTIVE_REPORT_WIDGET_PROPERTY_TAB_TITLE;
  19041. }
  19042. return _10d2;
  19043. }});
  19044. function RAPReportInfo(_10d3,oCV){
  19045. this.m_reportInfoJSON=_10d3;
  19046. this.m_containerInfoJSON={};
  19047. this.m_iContainerCount=0;
  19048. this.m_bPromptPart=null;
  19049. this.m_bSingleContainer=null;
  19050. this.m_bDetailFilteringDisabled=null;
  19051. this.m_aDrilledOnHUNs=null;
  19052. this.m_bPassTrackingToBUA=null;
  19053. this.m_sDisplayTypes=null;
  19054. this.m_bContainsInteractiveDataContainer=null;
  19055. this.m_bContainsFilters=false;
  19056. this.m_bContainsSlider=false;
  19057. this.m_referenceInfoObject={};
  19058. this.initializeContainerInfo();
  19059. this._addNonVisibleReferences(this.m_reportInfoJSON.reportLevelProperties);
  19060. this._populateHun(oCV);
  19061. };
  19062. RAPReportInfo.prototype.initializeContainerInfo=function(){
  19063. if(this.m_reportInfoJSON){
  19064. var _10d5=this.m_reportInfoJSON.containers;
  19065. if(_10d5){
  19066. this.m_iContainerCount=_10d5.length;
  19067. for(var _10d6=0;_10d6<this.m_iContainerCount;++_10d6){
  19068. var _10d7=_10d5[_10d6].container;
  19069. this.m_containerInfoJSON[_10d7]=_10d5[_10d6];
  19070. this.m_containerInfoJSON[_10d7].m_itemInfoJSON=this._initializeItemInfo(_10d5[_10d6].itemInfo);
  19071. this.m_containerInfoJSON[_10d7].m_drillabilityJSON=this._initializeDrillability(_10d5[_10d6].drillability);
  19072. this._addFilterReferences(_10d5[_10d6].filter);
  19073. this._addSliderReferences(_10d5[_10d6].sliders);
  19074. this.m_containerInfoJSON[_10d7].layoutIndex=_10d6;
  19075. if(_10d5[_10d6].filter){
  19076. this.m_bContainsFilters=true;
  19077. }
  19078. if(_10d5[_10d6].sliders){
  19079. this.m_bContainsSlider=true;
  19080. }
  19081. }
  19082. }
  19083. }
  19084. };
  19085. RAPReportInfo.prototype._initializeItemInfo=function(_10d8){
  19086. var _10d9={};
  19087. for(var idx in _10d8){
  19088. _10d9[_10d8[idx].item]=_10d8[idx];
  19089. this.m_referenceInfoObject[_10d8[idx].item]=true;
  19090. }
  19091. return _10d9;
  19092. };
  19093. RAPReportInfo.prototype._initializeDrillability=function(_10db){
  19094. var _10dc={};
  19095. for(var idx in _10db){
  19096. _10dc[_10db[idx].item]=_10db[idx];
  19097. this.m_referenceInfoObject[_10db[idx].item]=true;
  19098. }
  19099. return _10dc;
  19100. };
  19101. RAPReportInfo.prototype._addFilterReferences=function(_10de){
  19102. for(var idx in _10de){
  19103. this.m_referenceInfoObject[_10de[idx].item]=true;
  19104. if(_10de[idx].type==="contextSlice"&&_10de[idx].hierarchyName){
  19105. this.m_referenceInfoObject[_10de[idx].hierarchyName]=true;
  19106. }
  19107. }
  19108. };
  19109. RAPReportInfo.prototype._addSliderReferences=function(_10e0){
  19110. for(var idx in _10e0){
  19111. this.m_referenceInfoObject[_10e0[idx].name]=true;
  19112. }
  19113. };
  19114. RAPReportInfo.prototype._addNonVisibleReferences=function(_10e2){
  19115. if(_10e2&&_10e2.nonVisibleFiltersMemberItemInfo){
  19116. for(var i=0;i<_10e2.nonVisibleFiltersMemberItemInfo.length;i++){
  19117. this.m_referenceInfoObject[_10e2.nonVisibleFiltersMemberItemInfo[i]]=true;
  19118. }
  19119. }
  19120. };
  19121. RAPReportInfo.prototype.isReferenced=function(item){
  19122. return (this.m_referenceInfoObject[item])?true:false;
  19123. };
  19124. RAPReportInfo.prototype.getDrillability=function(_10e5,_10e6){
  19125. if(!_10e6){
  19126. return this.m_containerInfoJSON[_10e5].m_drillabilityJSON;
  19127. }else{
  19128. return this.m_containerInfoJSON[_10e5].m_drillabilityJSON[_10e6];
  19129. }
  19130. };
  19131. RAPReportInfo.prototype.getContainers=function(){
  19132. return this.m_containerInfoJSON;
  19133. };
  19134. RAPReportInfo.prototype.getContainer=function(lid){
  19135. return this.m_containerInfoJSON[lid];
  19136. };
  19137. RAPReportInfo.prototype.getContainerIds=function(_10e8){
  19138. var _10e9=[];
  19139. for(containerName in this.m_containerInfoJSON){
  19140. var _10ea=this.m_containerInfoJSON[containerName];
  19141. if(_10ea&&_10ea.displayTypeId==_10e8){
  19142. _10e9.push(_10ea.container);
  19143. }
  19144. }
  19145. return _10e9;
  19146. };
  19147. RAPReportInfo.prototype.getContainerFromPos=function(iPos){
  19148. return this.m_reportInfoJSON.containers[iPos];
  19149. };
  19150. RAPReportInfo.prototype.getReportLevelProperties=function(){
  19151. return this.m_reportInfoJSON.reportLevelProperties;
  19152. };
  19153. RAPReportInfo.prototype.getItemInfo=function(_10ec,_10ed){
  19154. if(!_10ed){
  19155. return this.m_containerInfoJSON[_10ec].m_itemInfoJSON;
  19156. }
  19157. if(this.m_containerInfoJSON[_10ec]){
  19158. return this.m_containerInfoJSON[_10ec].m_itemInfoJSON[_10ed];
  19159. }
  19160. return null;
  19161. };
  19162. RAPReportInfo.prototype.isReportLevel_nonVisibleFilterItem=function(_10ee){
  19163. if(_10ee&&_10ee.length>0){
  19164. var _10ef=this.m_reportInfoJSON.reportLevelProperties;
  19165. if(_10ef){
  19166. if(_10ef&&_10ef.nonVisibleFiltersMemberItemInfo){
  19167. for(var i=0;i<_10ef.nonVisibleFiltersMemberItemInfo.length;i++){
  19168. if(_10ee===_10ef.nonVisibleFiltersMemberItemInfo[i]){
  19169. return true;
  19170. }
  19171. }
  19172. }
  19173. }
  19174. }
  19175. return false;
  19176. };
  19177. RAPReportInfo.prototype.isChildContainer=function(lid){
  19178. return ((this.m_containerInfoJSON[lid]&&this.m_containerInfoJSON[lid].parentContainer)?true:false);
  19179. };
  19180. RAPReportInfo.prototype.getItemDetails=function(_10f2,sHun){
  19181. var obj=null;
  19182. for(var lid in this.m_containerInfoJSON){
  19183. var oItem=this.getItemInfo(lid,_10f2);
  19184. if(oItem&&oItem.hun===sHun){
  19185. obj={};
  19186. obj.item=oItem.item;
  19187. if(oItem.hun){
  19188. obj.hun=oItem.hun;
  19189. }
  19190. obj.lid=lid;
  19191. obj.queryName=oItem.queryName;
  19192. break;
  19193. }
  19194. }
  19195. return (obj)?obj:null;
  19196. };
  19197. RAPReportInfo.prototype.getItemDetailsByHun=function(sHun){
  19198. var _10f8=null;
  19199. for(var lid in this.m_containerInfoJSON){
  19200. var _10fa=this.getItemInfo(lid);
  19201. for(var sName in _10fa){
  19202. var oItem=_10fa[sName];
  19203. if(oItem.hun===sHun){
  19204. _10f8=sName;
  19205. break;
  19206. }
  19207. }
  19208. }
  19209. return (_10f8?this.getItemDetails(_10f8,sHun):null);
  19210. };
  19211. RAPReportInfo.prototype._populateHun=function(oCV){
  19212. if(oCV){
  19213. var _10fe=oCV.getSelectionController().getCCDManager();
  19214. var _10ff=oCV.envParams;
  19215. var _1100=oCV.getRAPReportInfo();
  19216. var _1101=false;
  19217. for(var lid in this.m_containerInfoJSON){
  19218. var _1103=this.m_containerInfoJSON[lid].m_itemInfoJSON;
  19219. for(var _1104 in _1103){
  19220. var oItem=_1103[_1104];
  19221. if(oItem.hun){
  19222. continue;
  19223. }
  19224. var sHun=this.getHUNForItem(oItem,_10fe,lid,_1100);
  19225. if(sHun){
  19226. oItem.hun=sHun;
  19227. _1101=true;
  19228. }
  19229. }
  19230. }
  19231. if(_1101&&typeof JSON!="undefined"&&JSON!=null&&JSON.stringify){
  19232. _10ff["rapReportInfo"]=JSON.stringify(this.m_reportInfoJSON);
  19233. }
  19234. }
  19235. };
  19236. RAPReportInfo.prototype.getHUNForItem=function(oItem,_1108,lid,_110a){
  19237. var sHun=this.getHUNFromCCDManager(_1108,oItem);
  19238. var _110c=null;
  19239. if(!sHun&&_110a){
  19240. _110c=_110a.getItemInfo(lid,oItem.item);
  19241. if(_110c){
  19242. sHun=_110c.hun;
  19243. }
  19244. }
  19245. return sHun;
  19246. };
  19247. RAPReportInfo.prototype.getHUNFromCCDManager=function(_110d,oItem){
  19248. var _110f={};
  19249. var sHUN=null;
  19250. var _1111=this._findQueryMetadataId(_110d,_110f,oItem.queryName);
  19251. if(_1111){
  19252. sHUN=_110d.GetHUNForRDI(oItem.item,_1111);
  19253. }
  19254. return sHUN;
  19255. };
  19256. RAPReportInfo.prototype._findQueryMetadataId=function(_1112,oMap,_1114){
  19257. if(oMap[_1114]){
  19258. return oMap[_1114];
  19259. }
  19260. var ctxId=_1112.GetMetadataIdForQueryName(_1114);
  19261. if(ctxId){
  19262. oMap[_1114]=ctxId;
  19263. return ctxId;
  19264. }
  19265. return null;
  19266. };
  19267. RAPReportInfo.prototype.isPromptPart=function(){
  19268. if(this.m_bPromptPart===null){
  19269. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.promptWidget===true){
  19270. this.m_bPromptPart=true;
  19271. }else{
  19272. this.m_bPromptPart=false;
  19273. }
  19274. }
  19275. return this.m_bPromptPart;
  19276. };
  19277. RAPReportInfo.prototype.getContainerCount=function(){
  19278. return this.m_iContainerCount;
  19279. };
  19280. RAPReportInfo.prototype.isSingleContainer=function(){
  19281. if(this.m_bSingleContainer===null){
  19282. if(this.m_iContainerCount===1&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.singleContainerReport===true){
  19283. this.m_bSingleContainer=true;
  19284. }else{
  19285. this.m_bSingleContainer=false;
  19286. }
  19287. }
  19288. return this.m_bSingleContainer;
  19289. };
  19290. RAPReportInfo.prototype.isDetailFilteringDisabled=function(){
  19291. if(this.m_bDetailFilteringDisabled===null){
  19292. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.detailFilteringDisabled===true){
  19293. this.m_bDetailFilteringDisabled=true;
  19294. }else{
  19295. this.m_bDetailFilteringDisabled=false;
  19296. }
  19297. }
  19298. return this.m_bDetailFilteringDisabled;
  19299. };
  19300. RAPReportInfo.prototype.getPassTrackingtoBUA=function(){
  19301. if(this.m_bPassTrackingToBUA===null){
  19302. if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.shouldNotPassTrackingtoBUA===true){
  19303. this.m_bPassTrackingToBUA=false;
  19304. }else{
  19305. this.m_bPassTrackingToBUA=true;
  19306. }
  19307. }
  19308. return this.m_bPassTrackingToBUA;
  19309. };
  19310. RAPReportInfo.prototype.getDrilledOnHUNs=function(){
  19311. if(!this.m_aDrilledOnHUNs&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs){
  19312. this.m_aDrilledOnHUNs=this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs;
  19313. }
  19314. return this.m_aDrilledOnHUNs;
  19315. };
  19316. RAPReportInfo.prototype.getDisplayTypes=function(_1116){
  19317. if(this.m_sDisplayTypes===null||_1116){
  19318. var _1117="";
  19319. var _1118=[];
  19320. for(var lid in this.m_containerInfoJSON){
  19321. if(!_1116||lid!=_1116){
  19322. _1118.push(this.m_containerInfoJSON[lid].displayTypeId);
  19323. }
  19324. }
  19325. _1117=_1118.join(",");
  19326. if(_1117==""&&this.isPromptPart()){
  19327. _1117="promptWidget";
  19328. }
  19329. if(!_1116){
  19330. this.m_sDisplayTypes=_1117;
  19331. }
  19332. return _1117;
  19333. }
  19334. return this.m_sDisplayTypes;
  19335. };
  19336. RAPReportInfo.prototype.isChart=function(lid){
  19337. var id=lid.toLowerCase();
  19338. return id!="mapchart"&&id.match("chart$")=="chart";
  19339. };
  19340. RAPReportInfo.prototype.isViz=function(lid){
  19341. if(this.m_containerInfoJSON[lid]){
  19342. var _111d=this.m_containerInfoJSON[lid].displayTypeId;
  19343. if(_111d){
  19344. return (_111d.toLowerCase()=="viz");
  19345. }
  19346. }
  19347. return false;
  19348. };
  19349. RAPReportInfo.prototype.isInteractiveDataContainer=function(lid){
  19350. var _111f=false;
  19351. if(this.m_containerInfoJSON[lid]){
  19352. var _1120=this.m_containerInfoJSON[lid].displayTypeId;
  19353. if(_1120){
  19354. var id=_1120.toLowerCase();
  19355. _111f=id=="crosstab"||id=="list"||id=="viz"||this.isChart(id);
  19356. }
  19357. }
  19358. return _111f;
  19359. };
  19360. RAPReportInfo.prototype.containsInteractiveDataContainer=function(){
  19361. if(this.m_bContainsInteractiveDataContainer==null){
  19362. this.m_bContainsInteractiveDataContainer=false;
  19363. for(var lid in this.m_containerInfoJSON){
  19364. if(this.isInteractiveDataContainer(lid)){
  19365. this.m_bContainsInteractiveDataContainer=true;
  19366. break;
  19367. }
  19368. }
  19369. }
  19370. return this.m_bContainsInteractiveDataContainer;
  19371. };
  19372. RAPReportInfo.prototype.containsFilters=function(){
  19373. return this.m_bContainsFilters;
  19374. };
  19375. RAPReportInfo.prototype.getFilterObject=function(_1123,_1124){
  19376. for(var lid in this.m_containerInfoJSON){
  19377. var _1126=this.getFilterObjectFromContainer(lid,_1123,_1124);
  19378. if(_1126){
  19379. return _1126;
  19380. }
  19381. }
  19382. return null;
  19383. };
  19384. RAPReportInfo.prototype.getFilterObjectFromContainer=function(lid,_1128,_1129){
  19385. var _112a=this.m_containerInfoJSON[lid];
  19386. if(_112a&&_112a.filter){
  19387. var _112b=_112a.filter.length;
  19388. for(var i=0;i<_112b;++i){
  19389. var _112d=_112a.filter[i];
  19390. if(_1128==_112d.item){
  19391. if(!_1129||(_112d.itemLabel&&_112d.itemLabel.length>0)){
  19392. return _112d;
  19393. }
  19394. }
  19395. }
  19396. }
  19397. return null;
  19398. };
  19399. RAPReportInfo.prototype.hunHasFilterOrSlider=function(_112e){
  19400. if(!_112e){
  19401. return null;
  19402. }
  19403. for(var lid in this.m_containerInfoJSON){
  19404. var _1130=this.m_containerInfoJSON[lid];
  19405. if(_1130&&_1130.filter){
  19406. var _1131=_1130.filter.length;
  19407. for(var i=0;i<_1131;++i){
  19408. var _1133=_1130.filter[i];
  19409. if(_1133.HUN&&_112e.indexOf(_1133.HUN)==0){
  19410. return _1133.item;
  19411. }
  19412. }
  19413. }
  19414. if(_1130&&_1130.sliders){
  19415. var _1131=_1130.sliders.length;
  19416. for(var i=0;i<_1131;++i){
  19417. var _1134=_1130.sliders[i];
  19418. if(_1134.hun&&_112e.indexOf(_1134.hun)==0){
  19419. return _1134.name;
  19420. }
  19421. }
  19422. }
  19423. }
  19424. return null;
  19425. };
  19426. RAPReportInfo.prototype.hasSlider=function(){
  19427. return this.m_bContainsSlider;
  19428. };
  19429. RAPReportInfo.prototype.collectSliderSetFromReportInfo=function(){
  19430. var _1135={};
  19431. for(var lid in this.m_containerInfoJSON){
  19432. var _1137=this.m_containerInfoJSON[lid].sliders;
  19433. if(_1137){
  19434. for(var _1138=0;_1138<_1137.length;++_1138){
  19435. var _1139=_1137[_1138].clientId;
  19436. _1135[_1139]=_1137[_1138];
  19437. }
  19438. }
  19439. }
  19440. return _1135;
  19441. };
  19442. RAPReportInfo.prototype._getEventTimings=function(){
  19443. return (this.m_reportInfoJSON&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.eventTimings)?this.m_reportInfoJSON.reportLevelProperties.eventTimings:null;
  19444. };
  19445. RAPReportInfo.prototype.destroy=function(){
  19446. GUtil.destroyProperties(this);
  19447. };
  19448. function DelayedLoadingContext(id){
  19449. this.widgetid=id;
  19450. this.m_promptValues=null;
  19451. };
  19452. DelayedLoadingContext.prototype.setPromptValues=function(_113b){
  19453. if(_113b===null){
  19454. this.m_promptValues=null;
  19455. return;
  19456. }
  19457. if(!this.m_promptValues){
  19458. this.m_promptValues={};
  19459. }
  19460. applyJSONProperties(this.m_promptValues,_113b);
  19461. };
  19462. DelayedLoadingContext.prototype.getPromptValues=function(){
  19463. return this.m_promptValues;
  19464. };
  19465. DelayedLoadingContext.prototype.setForceRunReport=function(_113c){
  19466. this.m_forceRunReport=_113c;
  19467. };
  19468. DelayedLoadingContext.prototype.getForceRunReport=function(){
  19469. return this.m_forceRunReport;
  19470. };
  19471. DelayedLoadingContext.prototype.isEmpty=function(){
  19472. return !(this.m_promptValues||this.m_forceRunReport);
  19473. };
  19474. DelayedLoadingContext.prototype.reset=function(){
  19475. delete (this.m_promptValues);
  19476. this.m_promptValues=null;
  19477. this.m_forceRunReport=false;
  19478. delete (this._cascadingPromptParamsToClear);
  19479. };
  19480. DelayedLoadingContext.prototype.setCascadingPromptParamsToClear=function(_113d){
  19481. this._cascadingPromptParamsToClear=_113d;
  19482. };
  19483. DelayedLoadingContext.prototype.getCascadingPromptParamsToClear=function(){
  19484. return this._cascadingPromptParamsToClear;
  19485. };
  19486. function ViewerLoadManager(_113e){
  19487. this.m_oWidget=_113e;
  19488. this.m_oDelayedLoadingContext=new DelayedLoadingContext();
  19489. this.m_aQueue=[];
  19490. this.m_fOnEmptyCallback=null;
  19491. this.m_bPendingRequest=false;
  19492. this.m_bViewerLoadInitiated=false;
  19493. this.m_bCanRunReports=false;
  19494. };
  19495. ViewerLoadManager.prototype.viewerLoadInitiated=function(){
  19496. this.m_bViewerLoadInitiated=true;
  19497. };
  19498. ViewerLoadManager.prototype.isViewerLoadInitiated=function(){
  19499. return this.m_bViewerLoadInitiated;
  19500. };
  19501. ViewerLoadManager.prototype.canRunReports=function(){
  19502. return this.m_bCanRunReports;
  19503. };
  19504. ViewerLoadManager.prototype.runningReport=function(){
  19505. if(!this.m_bCanRunReports){
  19506. this._queue({fCallback:dojo.hitch(this,function(){
  19507. this.m_bCanRunReports=true;
  19508. return false;
  19509. })});
  19510. }
  19511. };
  19512. ViewerLoadManager.prototype.isViewerReady=function(){
  19513. if(!this.isViewerLoaded()){
  19514. return false;
  19515. }
  19516. if(!this._isEmpty()||this.m_fOnEmptyCallback||this.m_bPendingRequest){
  19517. return false;
  19518. }
  19519. return true;
  19520. };
  19521. ViewerLoadManager.prototype.isViewerLoaded=function(){
  19522. var oCV=this.m_oWidget.getViewerObject();
  19523. if(!oCV){
  19524. return false;
  19525. }
  19526. if(this.m_oWidget.isLiveReport()){
  19527. var _1140=oCV.getStatus();
  19528. return _1140==="complete"||_1140==="prompting"||_1140==="fault";
  19529. }
  19530. return true;
  19531. };
  19532. ViewerLoadManager.prototype.runWhenHasViewer=function(f,_1142){
  19533. if(this.isViewerReady()){
  19534. this._run(f);
  19535. return true;
  19536. }else{
  19537. var _1143={fCallback:f};
  19538. if(_1142){
  19539. _1143.sGroupId=_1142;
  19540. }
  19541. this._queue(_1143);
  19542. if(!this.m_bViewerLoadInitiated){
  19543. this.getDelayedLoadingContext().setForceRunReport(true);
  19544. this.m_oWidget.setRunReportOption(false);
  19545. this.m_oWidget.postReport(null);
  19546. }
  19547. return false;
  19548. }
  19549. };
  19550. ViewerLoadManager.prototype.processQueue=function(){
  19551. this.m_bPendingRequest=false;
  19552. var _1144=false;
  19553. while(!_1144&&!this._isEmpty()){
  19554. var _1145=this.m_aQueue.shift();
  19555. while(_1145.sGroupId&&!this._isEmpty()&&this.m_aQueue[0].sGroupId===_1145.sGroupId){
  19556. _1145=this.m_aQueue.shift();
  19557. }
  19558. _1144=this._run(_1145.fCallback);
  19559. }
  19560. if(this._isEmpty()&&!_1144&&this.m_fOnEmptyCallback){
  19561. var _1146=this.m_fOnEmptyCallback;
  19562. this.m_fOnEmptyCallback=null;
  19563. _1146();
  19564. }
  19565. };
  19566. ViewerLoadManager.prototype._run=function(f){
  19567. var _1148=f.call();
  19568. if(_1148){
  19569. this.m_bPendingRequest=true;
  19570. }
  19571. return _1148;
  19572. };
  19573. ViewerLoadManager.prototype._isEmpty=function(){
  19574. return !this.m_aQueue.length;
  19575. };
  19576. ViewerLoadManager.prototype._queue=function(_1149){
  19577. this.m_aQueue.push(_1149);
  19578. };
  19579. ViewerLoadManager.prototype.setOnEmptyCallback=function(_114a){
  19580. this.m_fOnEmptyCallback=_114a;
  19581. };
  19582. ViewerLoadManager.prototype.getDelayedLoadingContext=function(){
  19583. return this.m_oDelayedLoadingContext;
  19584. };
  19585. function XmlHttpObject(){
  19586. this.m_formFields=new CDictionary();
  19587. this.xmlHttp=XmlHttpObject.createRequestObject();
  19588. this.m_requestIndicator=null;
  19589. this.m_httpCallbacks={};
  19590. this.m_asynch=true;
  19591. this.m_headers=null;
  19592. };
  19593. XmlHttpObject.prototype.setHeaders=function(_114b){
  19594. this.m_headers=_114b;
  19595. };
  19596. XmlHttpObject.prototype.getHeaders=function(){
  19597. return this.m_headers;
  19598. };
  19599. XmlHttpObject.prototype.newRequest=function(){
  19600. var _114c=new XmlHttpObject();
  19601. _114c.init(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
  19602. this.executeHttpCallback("newRequest");
  19603. return _114c;
  19604. };
  19605. XmlHttpObject.prototype.abortHttpRequest=function(){
  19606. if(this.xmlHttp!=null){
  19607. this.xmlHttp.abort();
  19608. this.xmlHttp=null;
  19609. this.executeHttpCallback("cancel");
  19610. this.m_httpCallbacks={};
  19611. }
  19612. };
  19613. XmlHttpObject.prototype.cancel=function(){
  19614. this.abortHttpRequest();
  19615. };
  19616. XmlHttpObject.prototype.executeHttpCallback=function(_114d){
  19617. if(this.m_httpCallbacks&&this.m_httpCallbacks[_114d]){
  19618. var _114e=this.concatResponseArguments(this.m_httpCallbacks.customArguments);
  19619. var _114f=GUtil.generateCallback(this.m_httpCallbacks[_114d].method,_114e,this.m_httpCallbacks[_114d].object);
  19620. _114f();
  19621. return true;
  19622. }
  19623. return false;
  19624. };
  19625. XmlHttpObject.prototype.setCallbacks=function(_1150){
  19626. if(!this.m_httpCallbacks){
  19627. this.m_httpCallbacks={};
  19628. }
  19629. for(callback in _1150){
  19630. this.m_httpCallbacks[callback]=_1150[callback];
  19631. }
  19632. };
  19633. XmlHttpObject.prototype.getCallbacks=function(){
  19634. return this.m_httpCallbacks;
  19635. };
  19636. XmlHttpObject.createRequestObject=function(){
  19637. var _1151=null;
  19638. if(window.XMLHttpRequest){
  19639. _1151=new XMLHttpRequest();
  19640. }else{
  19641. if(window.ActiveXObject){
  19642. _1151=new ActiveXObject("Msxml2.XMLHTTP");
  19643. }else{
  19644. }
  19645. }
  19646. return _1151;
  19647. };
  19648. XmlHttpObject.prototype.waitForXmlHttpResponse=function(){
  19649. var _1152=this.xmlHttp;
  19650. if(_1152&&_1152.readyState===4){
  19651. if(_1152.status===200){
  19652. this.httpSuccess();
  19653. }else{
  19654. this.httpError();
  19655. }
  19656. }else{
  19657. }
  19658. };
  19659. XmlHttpObject.prototype.init=function(_1153,_1154,url,_1156){
  19660. this.m_action=_1153;
  19661. this.m_gateway=_1154;
  19662. this.m_url=url;
  19663. this.m_asynch=_1156;
  19664. };
  19665. XmlHttpObject.prototype.httpSuccess=function(){
  19666. this.executeHttpCallback("postHttpRequest");
  19667. this.executeHttpCallback("entryComplete");
  19668. this.executeHttpCallback("complete");
  19669. this.m_httpCallbacks=null;
  19670. };
  19671. XmlHttpObject.prototype.httpError=function(){
  19672. this.executeHttpCallback("entryFault");
  19673. this.executeHttpCallback("fault");
  19674. this.m_httpCallbacks=null;
  19675. };
  19676. XmlHttpObject.prototype.forceSynchronous=function(){
  19677. this.m_asynch=false;
  19678. };
  19679. XmlHttpObject.prototype.sendRequest=function(){
  19680. this.sendHtmlRequest(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
  19681. };
  19682. XmlHttpObject.prototype.sendHtmlRequest=function(_1157,_1158,url,async){
  19683. var _115b=this.xmlHttp;
  19684. if(_115b){
  19685. _115b.open(_1157,_1158,async);
  19686. if(async){
  19687. _115b.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
  19688. }else{
  19689. _115b.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
  19690. if(!isIE()){
  19691. _115b.onload=GUtil.generateCallback(this.httpSuccess,[],this);
  19692. _115b.onerror=GUtil.generateCallback(this.httpError,[],this);
  19693. }
  19694. }
  19695. _115b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  19696. if(this.m_headers){
  19697. for(header in this.m_headers){
  19698. _115b.setRequestHeader(header,this.m_headers[header]);
  19699. }
  19700. }
  19701. this.executeHttpCallback("preHttpRequest");
  19702. var _115c=this.convertFormFieldsToUrl();
  19703. if(url){
  19704. _115c+=url;
  19705. }
  19706. _115b.send(_115c);
  19707. }
  19708. };
  19709. XmlHttpObject.prototype.getResponseXml=function(){
  19710. return (this.xmlHttp)?this.xmlHttp.responseXML:null;
  19711. };
  19712. XmlHttpObject.prototype.getResponseText=function(){
  19713. return (this.xmlHttp)?this.xmlHttp.responseText:"";
  19714. };
  19715. XmlHttpObject.prototype.getResponseHeader=function(item){
  19716. return (this.xmlHttp)?this.xmlHttp.getResponseHeader(item):null;
  19717. };
  19718. XmlHttpObject.prototype.getStatus=function(){
  19719. return this.xmlHttp.status;
  19720. };
  19721. XmlHttpObject.prototype.addFormField=function(name,value){
  19722. this.m_formFields.add(name,value);
  19723. };
  19724. XmlHttpObject.prototype.getFormFields=function(){
  19725. return this.m_formFields;
  19726. };
  19727. XmlHttpObject.prototype.getFormField=function(_1160){
  19728. return this.m_formFields.get(_1160);
  19729. };
  19730. XmlHttpObject.prototype.clearFormFields=function(){
  19731. this.m_formFields=new CDictionary();
  19732. };
  19733. XmlHttpObject.prototype.convertFormFieldsToUrl=function(){
  19734. var url="";
  19735. var _1162=this.m_formFields.keys();
  19736. for(var index=0;index<_1162.length;index++){
  19737. if(index>0){
  19738. url+="&";
  19739. }
  19740. url+=encodeURIComponent(_1162[index])+"="+encodeURIComponent(this.m_formFields.get(_1162[index]));
  19741. }
  19742. return url;
  19743. };
  19744. XmlHttpObject.prototype.concatResponseArguments=function(_1164){
  19745. var _1165=[this];
  19746. if(_1164){
  19747. _1165=_1165.concat(_1164);
  19748. }
  19749. return _1165;
  19750. };
  19751. function AsynchRequest(_1166,_1167){
  19752. AsynchRequest.baseConstructor.call(this);
  19753. this.m_gateway=_1166;
  19754. this.m_webContentRoot=_1167;
  19755. this.m_callbacks={};
  19756. this.m_soapFault=null;
  19757. this.m_faultDialog=null;
  19758. this.m_promptDialog=null;
  19759. this.m_logonDialog=null;
  19760. };
  19761. AsynchRequest.prototype=new XmlHttpObject();
  19762. AsynchRequest.baseConstructor=XmlHttpObject;
  19763. AsynchRequest.prototype.parent=XmlHttpObject.prototype;
  19764. AsynchRequest.prototype.getTracking=function(){
  19765. return "";
  19766. };
  19767. AsynchRequest.prototype.getConversation=function(){
  19768. return "";
  19769. };
  19770. AsynchRequest.prototype.getPrimaryAction=function(){
  19771. return "";
  19772. };
  19773. AsynchRequest.prototype.getActionState=function(){
  19774. return "";
  19775. };
  19776. AsynchRequest.prototype.getAsynchStatus=function(){
  19777. return "";
  19778. };
  19779. AsynchRequest.prototype.getResult=function(){
  19780. return null;
  19781. };
  19782. AsynchRequest.prototype.getSoapFault=function(){
  19783. return this.m_soapFault;
  19784. };
  19785. AsynchRequest.prototype.constructFaultEnvelope=function(){
  19786. return null;
  19787. };
  19788. AsynchRequest.prototype.getPromptHTMLFragment=function(){
  19789. return "";
  19790. };
  19791. AsynchRequest.prototype.isRAPWaitTrue=function(){
  19792. return false;
  19793. };
  19794. AsynchRequest.prototype.getRAPRequestCache=function(){
  19795. return null;
  19796. };
  19797. AsynchRequest.prototype.getMainConversation=function(){
  19798. return null;
  19799. };
  19800. AsynchRequest.prototype.getMainTracking=function(){
  19801. return null;
  19802. };
  19803. AsynchRequest.prototype.construct=function(){
  19804. };
  19805. AsynchRequest.prototype.executeCallback=function(_1168){
  19806. if(this.m_callbacks[_1168]){
  19807. var _1169=this.concatResponseArguments(this.m_callbacks.customArguments);
  19808. var _116a=GUtil.generateCallback(this.m_callbacks[_1168].method,_1169,this.m_callbacks[_1168].object);
  19809. _116a();
  19810. return true;
  19811. }
  19812. return false;
  19813. };
  19814. AsynchRequest.prototype.setCallbacks=function(_116b){
  19815. if(!this.m_callbacks){
  19816. this.m_callbacks={};
  19817. }
  19818. for(callback in _116b){
  19819. this.m_callbacks[callback]=_116b[callback];
  19820. }
  19821. };
  19822. AsynchRequest.prototype.getCallbacks=function(){
  19823. return this.m_callbacks;
  19824. };
  19825. AsynchRequest.prototype.newRequest=function(){
  19826. var _116c=this.construct();
  19827. _116c.setHeaders(this.getHeaders());
  19828. if(this.getFormFields().exists("b_action")){
  19829. _116c.addFormField("b_action",this.getFormField("b_action"));
  19830. }
  19831. if(this.getFormFields().exists("cv.catchLogOnFault")){
  19832. _116c.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
  19833. }
  19834. _116c.setPromptDialog(this.m_promptDialog);
  19835. _116c.setFaultDialog(this.m_faultDialog);
  19836. _116c.setLogonDialog(this.m_logonDialog);
  19837. _116c.m_asynch=this.m_asynch;
  19838. if(this.m_callbacks.newRequest){
  19839. var _116d=GUtil.generateCallback(this.m_callbacks.newRequest.method,[_116c],this.m_callbacks.newRequest.object);
  19840. _116d();
  19841. }
  19842. return _116c;
  19843. };
  19844. AsynchRequest.prototype.success=function(){
  19845. var _116e=this.getAsynchStatus();
  19846. switch(_116e){
  19847. case "stillWorking":
  19848. case "working":
  19849. this.working();
  19850. break;
  19851. case "prompting":
  19852. this.prompting();
  19853. break;
  19854. case "fault":
  19855. case "complete":
  19856. case "conversationComplete":
  19857. this.complete();
  19858. break;
  19859. default:
  19860. this.complete();
  19861. break;
  19862. }
  19863. };
  19864. AsynchRequest.prototype.setFaultDialog=function(_116f){
  19865. if(_116f instanceof IFaultDialog){
  19866. if(typeof console!="undefined"){
  19867. console.log("AsynchRequest.prototype.setFaultDialog is deprecated");
  19868. }
  19869. this.m_faultDialog=_116f;
  19870. }else{
  19871. if(_116f&&typeof console!="undefined"){
  19872. console.log("The parameter faultDialog must be an instance of IFaultDialog");
  19873. }
  19874. }
  19875. };
  19876. AsynchRequest.prototype.setPromptDialog=function(_1170){
  19877. if(_1170 instanceof IPromptDialog){
  19878. if(typeof console!="undefined"){
  19879. console.log("AsynchRequest.prototype.setPromptDialog is deprecated");
  19880. }
  19881. this.m_promptDialog=_1170;
  19882. }else{
  19883. if(_1170&&typeof console!="undefined"){
  19884. console.log("The parameter promptDialog must be an instance of IPromptDialog");
  19885. }
  19886. }
  19887. };
  19888. AsynchRequest.prototype.setLogonDialog=function(_1171){
  19889. if(_1171 instanceof ILogOnDialog){
  19890. if(typeof console!="undefined"){
  19891. console.log("AsynchRequest.prototype.setLogonDialog is deprecated");
  19892. }
  19893. this.m_logonDialog=_1171;
  19894. }else{
  19895. if(_1171&&typeof console!="undefined"){
  19896. console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
  19897. }
  19898. }
  19899. };
  19900. AsynchRequest.prototype.resubmitRequest=function(){
  19901. var _1172=this.newRequest();
  19902. _1172.m_formFields=this.m_formFields;
  19903. _1172.sendRequest();
  19904. return _1172;
  19905. };
  19906. AsynchRequest.prototype.sendRequest=function(){
  19907. var _1173=this;
  19908. var _1174={"complete":{"object":_1173,"method":_1173.successHandler},"fault":{"object":_1173,"method":_1173.errorHandler}};
  19909. this.init("POST",this.m_gateway,"",this.m_asynch);
  19910. this.executeCallback("preHttpRequest");
  19911. this.parent.setCallbacks.call(this,_1174);
  19912. this.parent.sendRequest.call(this);
  19913. };
  19914. AsynchRequest.prototype.errorHandler=function(){
  19915. this.executeCallback("postHttpRequest");
  19916. this.executeCallback("entryFault");
  19917. this.executeCallback("error");
  19918. };
  19919. AsynchRequest.prototype.successHandler=function(){
  19920. this.executeCallback("postHttpRequest");
  19921. if(typeof window["AsynchRequestPromptDialog"]!="undefined"&&window["AsynchRequestPromptDialog"]!=null){
  19922. window["AsynchRequestPromptDialog"].hide();
  19923. window["AsynchRequestPromptDialog"]=null;
  19924. }
  19925. if(this.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  19926. var _1175=this.getResponseText();
  19927. if(_1175.indexOf("<ERROR_CODE>CAM_PASSPORT_ERROR</ERROR_CODE>")!=-1){
  19928. this.passportTimeout();
  19929. }else{
  19930. if((_1175.indexOf("http-equiv=\"refresh\"")!=-1)||(_1175.indexOf("http-equiv='refresh'")!=-1)){
  19931. this.passportTimeout();
  19932. }else{
  19933. this.executeCallback("entryFault");
  19934. if(!this.executeCallback("fault")){
  19935. var _1176=window.open("","","height=400,width=500");
  19936. if(_1176!=null){
  19937. _1176.document.write(_1175);
  19938. }
  19939. }
  19940. }
  19941. }
  19942. }else{
  19943. this.m_soapFault=this.constructFaultEnvelope();
  19944. if(this.m_soapFault!=null){
  19945. var _1177=XMLHelper_FindChildByTagName(this.m_soapFault,"CAM",true);
  19946. if(_1177!=null&&XMLHelper_FindChildByTagName(_1177,"promptInfo",true)){
  19947. this.passportTimeout();
  19948. }else{
  19949. this.fault();
  19950. }
  19951. }else{
  19952. this.success();
  19953. }
  19954. }
  19955. };
  19956. AsynchRequest.prototype.cancel=function(){
  19957. this.parent.cancel.call(this);
  19958. var _1178=this.getFormField("m_tracking");
  19959. if(_1178){
  19960. var _1179=new XmlHttpObject();
  19961. _1179.init("POST",this.m_gateway,"",false);
  19962. if(this.getFormField("cv.outputKey")){
  19963. _1179.addFormField("b_action","cvx.high");
  19964. _1179.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
  19965. _1179.setHeaders(this.getHeaders());
  19966. }else{
  19967. _1179.addFormField("b_action","cognosViewer");
  19968. }
  19969. _1179.addFormField("cv.responseFormat","successfulRequest");
  19970. _1179.addFormField("ui.action","cancel");
  19971. _1179.addFormField("m_tracking",_1178);
  19972. if(this.getFormField("cv.debugDirectory")){
  19973. _1179.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
  19974. }
  19975. _1179.sendRequest();
  19976. this.executeCallback("cancel");
  19977. }
  19978. };
  19979. AsynchRequest.prototype.working=function(){
  19980. this.executeCallback("working");
  19981. var _117a=this.newRequest();
  19982. _117a.addFormField("m_tracking",this.getTracking());
  19983. if(this.getFormField("cv.outputKey")){
  19984. _117a.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
  19985. _117a.addFormField("b_action","cvx.high");
  19986. }
  19987. if(this.isRAPWaitTrue()){
  19988. _117a.m_formFields=this.m_formFields;
  19989. _117a.addFormField("m_tracking",this.getTracking());
  19990. _117a.addFormField("rapWait","true");
  19991. var _117b=this.getRAPRequestCache();
  19992. if(_117b!==null&&typeof _117b!="undefined"){
  19993. _117a.addFormField("rapRequestCache",_117b);
  19994. }
  19995. var _117c=this.getMainConversation();
  19996. if(_117c){
  19997. _117a.addFormField("mainConversation",_117c);
  19998. }
  19999. var _117d=this.getMainTracking();
  20000. if(_117d){
  20001. _117a.addFormField("mainTracking",_117d);
  20002. }
  20003. }else{
  20004. _117a.addFormField("ui.action","wait");
  20005. _117a.addFormField("ui.primaryAction",this.getPrimaryAction());
  20006. _117a.addFormField("cv.actionState",this.getActionState());
  20007. if(this.getFormField("ui.preserveRapTags")){
  20008. _117a.addFormField("ui.preserveRapTags",this.getFormField("ui.preserveRapTags"));
  20009. }
  20010. if(this.getFormField("ui.backURL")){
  20011. _117a.addFormField("ui.backURL",this.getFormField("ui.backURL"));
  20012. }
  20013. if(this.getFormField("errURL")){
  20014. _117a.addFormField("errURL",this.getFormField("errURL"));
  20015. }
  20016. if(this.getFormField("cv.showFaultPage")){
  20017. _117a.addFormField("cv.showFaultPage",this.getFormField("cv.showFaultPage"));
  20018. }
  20019. if(this.getFormField("cv.catchLogOnFault")){
  20020. _117a.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
  20021. }
  20022. }
  20023. if(this.getFormField("bux")){
  20024. _117a.addFormField("bux",this.getFormField("bux"));
  20025. }
  20026. if(this.getFormField("cv.debugDirectory")){
  20027. _117a.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
  20028. }
  20029. _117a.sendRequest();
  20030. };
  20031. AsynchRequest.prototype.prompting=function(){
  20032. this.executeCallback("entryComplete");
  20033. if(!this.executeCallback("prompting")){
  20034. if(this.m_promptDialog!=null){
  20035. this.showPromptPage();
  20036. }else{
  20037. if(typeof console!="undefined"){
  20038. console.log("An unhandled prompt response was returned: %o",this.xmlHttp);
  20039. }
  20040. }
  20041. }
  20042. this.executeCallback("postEntryComplete");
  20043. };
  20044. AsynchRequest.prototype.promptPageOkCallback=function(_117e){
  20045. var _117f=this.newRequest();
  20046. _117f.addFormField("ui.action","forward");
  20047. _117f.addFormField("m_tracking",this.getTracking());
  20048. _117f.addFormField("ui.conversation",this.getConversation());
  20049. _117f.addFormField("ui.primaryAction",this.getPrimaryAction());
  20050. _117f.addFormField("cv.actionState",this.getActionState());
  20051. for(var _1180 in _117e){
  20052. _117f.addFormField(_1180,_117e[_1180]);
  20053. }
  20054. _117f.sendRequest();
  20055. window["AsynchRequestObject"]=null;
  20056. };
  20057. AsynchRequest.prototype.promptPageCancelCallback=function(){
  20058. window["AsynchRequestPromptDialog"].hide();
  20059. this.complete();
  20060. };
  20061. AsynchRequest.prototype.showPromptPage=function(){
  20062. window["AsynchRequestObject"]=this;
  20063. window["AsynchRequestPromptDialog"]=this.m_promptDialog;
  20064. var _1181=this.m_promptDialog.getViewerId()==null?"":"?cv.id="+this.m_promptDialog.getViewerId();
  20065. window["AsynchRequestPromptDialog"].initialize(this.m_webContentRoot+"/rv/showStandalonePrompts.html"+_1181,400,400);
  20066. window["AsynchRequestPromptDialog"].show();
  20067. };
  20068. AsynchRequest.prototype.passportTimeout=function(){
  20069. this.executeCallback("entryFault");
  20070. if(!this.executeCallback("passportTimeout")){
  20071. if(this.m_logonDialog!=null){
  20072. this.m_logonDialog.show(response.getSoapFault());
  20073. }else{
  20074. if(typeof console!="undefined"){
  20075. console.log("An unhandled passport timeout fault was returned: %o",this.getSoapFault());
  20076. }
  20077. }
  20078. }
  20079. };
  20080. AsynchRequest.prototype.fault=function(){
  20081. this.executeCallback("entryFault");
  20082. if(!this.executeCallback("fault")){
  20083. if(this.m_faultDialog!=null){
  20084. this.m_faultDialog.show(this.getSoapFault());
  20085. }else{
  20086. if(typeof console!="undefined"){
  20087. console.log("An unhandled soap fault was returned: %o",this.getSoapFault());
  20088. }
  20089. }
  20090. }
  20091. };
  20092. AsynchRequest.prototype.complete=function(){
  20093. this.executeCallback("entryComplete");
  20094. this.executeCallback("complete");
  20095. this.executeCallback("postEntryComplete");
  20096. };
  20097. AsynchRequest.prototype.getSoapFaultCode=function(){
  20098. var _1182=this.constructFaultEnvelope();
  20099. if(_1182){
  20100. var _1183=XMLHelper_FindChildByTagName(_1182,"faultcode",true);
  20101. if(_1183!=null){
  20102. return XMLHelper_GetText(_1183);
  20103. }
  20104. }
  20105. return null;
  20106. };
  20107. AsynchRequest.prototype.getSoapFaultDetailMessageString=function(){
  20108. var _1184=this.constructFaultEnvelope();
  20109. if(_1184){
  20110. var entry=XMLHelper_FindChildByTagName(_1184,"messageString",true);
  20111. if(entry!=null){
  20112. return XMLHelper_GetText(entry);
  20113. }
  20114. }
  20115. return null;
  20116. };
  20117. function AsynchDATARequest(_1186,_1187){
  20118. AsynchDATARequest.baseConstructor.call(this,_1186,_1187);
  20119. this.m_oResponseState=null;
  20120. this.m_sResponseState=null;
  20121. this.m_endOfStateIdx=-1;
  20122. this.cStatePrefix="<xml><state>";
  20123. this.cStateSuffix="</state></xml>";
  20124. };
  20125. AsynchDATARequest.prototype=new AsynchRequest();
  20126. AsynchDATARequest.baseConstructor=AsynchRequest;
  20127. AsynchDATARequest.prototype.getEndOfStateIdx=function(){
  20128. if(this.m_endOfStateIdx==-1){
  20129. var _1188=this.getResponseText().substring(0,12);
  20130. if(_1188==this.cStatePrefix){
  20131. this.m_endOfStateIdx=this.getResponseText().indexOf(this.cStateSuffix);
  20132. if(this.m_endOfStateIdx!=-1){
  20133. this.m_endOfStateIdx+=this.cStateSuffix.length;
  20134. }
  20135. }
  20136. }
  20137. return this.m_endOfStateIdx;
  20138. };
  20139. AsynchDATARequest.prototype.getResponseStateText=function(){
  20140. if(!this.m_sResponseState){
  20141. this.getResponseState();
  20142. }
  20143. return this.m_sResponseState;
  20144. };
  20145. AsynchDATARequest.prototype.getResponseState=function(){
  20146. if(this.m_oResponseState==null&&this.getEndOfStateIdx()!=-1){
  20147. this.m_sResponseState=this.getResponseText().substring(this.cStatePrefix.length,this.getEndOfStateIdx()-this.cStateSuffix.length);
  20148. if(this.m_sResponseState!=null){
  20149. this.m_sResponseState=xml_decode(this.m_sResponseState);
  20150. this.m_oResponseState=eval("("+this.m_sResponseState+")");
  20151. }
  20152. }
  20153. return this.m_oResponseState;
  20154. };
  20155. AsynchDATARequest.prototype.getAsynchStatus=function(){
  20156. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sStatus!="undefined"){
  20157. return this.getResponseState().m_sStatus;
  20158. }
  20159. return "unknown";
  20160. };
  20161. AsynchDATARequest.prototype.getTracking=function(){
  20162. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sTracking!="undefined"){
  20163. return this.getResponseState().m_sTracking;
  20164. }
  20165. return "";
  20166. };
  20167. AsynchDATARequest.prototype.getConversation=function(){
  20168. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sConversation!="undefined"){
  20169. return this.getResponseState().m_sConversation;
  20170. }
  20171. return "";
  20172. };
  20173. AsynchDATARequest.prototype.getPrimaryAction=function(){
  20174. if(this.getResponseState()!=null&&typeof this.getResponseState().envParams!="undefined"&&this.getResponseState().envParams["ui.primaryAction"]!="undefined"){
  20175. return this.getResponseState().envParams["ui.primaryAction"];
  20176. }
  20177. return "";
  20178. };
  20179. AsynchDATARequest.prototype.getActionState=function(){
  20180. if(this.getResponseState()!=null&&typeof this.getResponseState().m_sActionState!="undefined"){
  20181. return this.getResponseState().m_sActionState;
  20182. }
  20183. return "";
  20184. };
  20185. AsynchDATARequest.prototype.getResult=function(){
  20186. if(this.getEndOfStateIdx()!=-1){
  20187. return this.getResponseText().substring(this.getEndOfStateIdx(),this.getResponseText().length);
  20188. }
  20189. return "";
  20190. };
  20191. AsynchDATARequest.prototype.getDebugLogs=function(){
  20192. if(this.getResponseState()!=null&&typeof this.getResponseState().debugLogs!="undefined"){
  20193. return this.getResponseState().debugLogs;
  20194. }
  20195. return "";
  20196. };
  20197. AsynchDATARequest.prototype.getPromptHTMLFragment=function(){
  20198. return this.getResult();
  20199. };
  20200. AsynchDATARequest.prototype.constructFaultEnvelope=function(){
  20201. if(this.m_soapFault==null){
  20202. var state=this.getResponseState();
  20203. if(state!=null){
  20204. if(state.m_sSoapFault){
  20205. var _118a=state.m_sSoapFault;
  20206. this.m_soapFault=XMLBuilderLoadXMLFromString(_118a);
  20207. }
  20208. }
  20209. }
  20210. return this.m_soapFault;
  20211. };
  20212. AsynchDATARequest.prototype.construct=function(){
  20213. var _118b=new AsynchDATARequest(this.m_gateway,this.m_webContentRoot);
  20214. _118b.setCallbacks(this.m_callbacks);
  20215. if(this.getFormFields().exists("cv.responseFormat")){
  20216. _118b.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
  20217. }else{
  20218. _118b.addFormField("cv.responseFormat","data");
  20219. }
  20220. return _118b;
  20221. };
  20222. AsynchDATARequest.prototype.getEnvParam=function(param){
  20223. var _118d=this.getResponseState();
  20224. if(_118d&&typeof _118d.envParams!="undefined"&&typeof _118d.envParams[param]!="undefined"){
  20225. return _118d.envParams[param];
  20226. }
  20227. return null;
  20228. };
  20229. AsynchDATARequest.prototype.isRAPWaitTrue=function(){
  20230. var _118e=this.getEnvParam("rapWait");
  20231. if(_118e!=null){
  20232. return _118e=="true"?true:false;
  20233. }
  20234. return false;
  20235. };
  20236. AsynchDATARequest.prototype.getRAPRequestCache=function(){
  20237. return this.getEnvParam("rapRequestCache");
  20238. };
  20239. AsynchDATARequest.prototype.getMainConversation=function(){
  20240. return this.getEnvParam("mainConversation");
  20241. };
  20242. AsynchDATARequest.prototype.getMainTracking=function(){
  20243. return this.getEnvParam("mainTracking");
  20244. };
  20245. function AsynchJSONRequest(_118f,_1190){
  20246. AsynchJSONRequest.baseConstructor.call(this,_118f,_1190);
  20247. this.m_jsonResponse=null;
  20248. };
  20249. AsynchJSONRequest.prototype=new AsynchRequest();
  20250. AsynchJSONRequest.baseConstructor=AsynchRequest;
  20251. AsynchJSONRequest.prototype.getJSONResponseObject=function(){
  20252. if(this.m_jsonResponse==null){
  20253. if(this.getResponseHeader("Content-type").indexOf("application/json")!=-1){
  20254. var text=this.getResponseText();
  20255. if(text!=null){
  20256. var _1192=this.removeInvalidCharacters(text);
  20257. this.m_jsonResponse=eval("("+_1192+")");
  20258. }
  20259. }
  20260. }
  20261. return this.m_jsonResponse;
  20262. };
  20263. AsynchJSONRequest.prototype.getTracking=function(){
  20264. var _1193=this.getJSONResponseObject();
  20265. if(_1193){
  20266. return _1193.tracking;
  20267. }
  20268. return "";
  20269. };
  20270. AsynchJSONRequest.prototype.getConversation=function(){
  20271. var _1194=this.getJSONResponseObject();
  20272. if(_1194){
  20273. return _1194.conversation;
  20274. }
  20275. return "";
  20276. };
  20277. AsynchJSONRequest.prototype.getAsynchStatus=function(){
  20278. var _1195=this.getJSONResponseObject();
  20279. if(_1195){
  20280. return _1195.status;
  20281. }
  20282. return "unknown";
  20283. };
  20284. AsynchJSONRequest.prototype.getPrimaryAction=function(){
  20285. var _1196=this.getJSONResponseObject();
  20286. if(_1196){
  20287. return _1196.primaryAction;
  20288. }
  20289. return "";
  20290. };
  20291. AsynchJSONRequest.prototype.getActionState=function(){
  20292. var _1197=this.getJSONResponseObject();
  20293. if(_1197){
  20294. return _1197.actionState;
  20295. }
  20296. return "";
  20297. };
  20298. AsynchJSONRequest.prototype.getDebugLogs=function(){
  20299. var _1198=this.getJSONResponseObject();
  20300. if(_1198){
  20301. return _1198.debugLogs;
  20302. }
  20303. return "";
  20304. };
  20305. AsynchJSONRequest.prototype.isRAPWaitTrue=function(){
  20306. var _1199=this.getJSONResponseObject();
  20307. if(_1199){
  20308. return (_1199.rapWait==="true");
  20309. }
  20310. return false;
  20311. };
  20312. AsynchJSONRequest.prototype.getRAPRequestCache=function(){
  20313. var _119a=this.getJSONResponseObject();
  20314. if(_119a){
  20315. var _119b=_119a.rapRequestCache;
  20316. if(_119b!==null&&typeof _119b!="undefined"){
  20317. return _119b;
  20318. }
  20319. }
  20320. return null;
  20321. };
  20322. AsynchJSONRequest.prototype.getMainConversation=function(){
  20323. var _119c=this.getJSONResponseObject();
  20324. if(_119c){
  20325. return _119c.mainConversation;
  20326. }
  20327. return null;
  20328. };
  20329. AsynchJSONRequest.prototype.getMainTracking=function(){
  20330. var _119d=this.getJSONResponseObject();
  20331. if(_119d){
  20332. return _119d.mainTracking;
  20333. }
  20334. return null;
  20335. };
  20336. AsynchJSONRequest.prototype.getResult=function(){
  20337. var _119e=this.getJSONResponseObject();
  20338. if(_119e&&_119e.json){
  20339. var _119f=this.removeInvalidCharacters(_119e.json);
  20340. return eval("("+_119f+")");
  20341. }
  20342. return null;
  20343. };
  20344. AsynchJSONRequest.prototype.removeInvalidCharacters=function(text){
  20345. if(text){
  20346. text=text.replace(/(\n|\r|\t)+/g,"");
  20347. }
  20348. return text;
  20349. };
  20350. AsynchJSONRequest.prototype.getPromptHTMLFragment=function(){
  20351. var _11a1=this.getJSONResponseObject();
  20352. if(_11a1&&_11a1.promptHTMLFragment){
  20353. return _11a1.promptHTMLFragment;
  20354. }
  20355. return "";
  20356. };
  20357. AsynchJSONRequest.prototype.constructFaultEnvelope=function(){
  20358. if(this.m_soapFault==null){
  20359. var _11a2=this.getJSONResponseObject();
  20360. if(_11a2.status=="fault"){
  20361. this.m_soapFault=XMLBuilderLoadXMLFromString(_11a2.fault);
  20362. }
  20363. }
  20364. return this.m_soapFault;
  20365. };
  20366. AsynchJSONRequest.prototype.construct=function(){
  20367. var _11a3=new AsynchJSONRequest(this.m_gateway,this.m_webContentRoot);
  20368. _11a3.setCallbacks(this.m_callbacks);
  20369. if(this.getFormFields().exists("cv.responseFormat")){
  20370. _11a3.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
  20371. }else{
  20372. _11a3.addFormField("cv.responseFormat","asynchJSON");
  20373. }
  20374. return _11a3;
  20375. };
  20376. function IFaultDialog(){
  20377. };
  20378. IFaultDialog.prototype.show=function(){
  20379. if(typeof console!="undefined"){
  20380. console.log("Required method IFaultDialog:show not implemented.");
  20381. }
  20382. };
  20383. IFaultDialog.prototype.handleUnknownHTMLResponse=function(){
  20384. if(typeof console!="undefined"){
  20385. console.log("Required method IFaultDialog:handlerUnknownHTMLResponse not implemented.");
  20386. }
  20387. };
  20388. function ILogOnDialog(){
  20389. };
  20390. ILogOnDialog.prototype.show=function(_11a4){
  20391. if(typeof console!="undefined"){
  20392. console.log("Required method ILogOnDialog:show not implemented.");
  20393. }
  20394. };
  20395. ILogOnDialog.prototype.handleUnknownHTMLResponse=function(_11a5){
  20396. if(typeof console!="undefined"){
  20397. console.log("Required method ILogOnDialog:handleUnknownHTMLResponse not implemented.");
  20398. }
  20399. };
  20400. function IPromptDialog(){
  20401. };
  20402. IPromptDialog.prototype.initialize=function(url,width,_11a8){
  20403. if(typeof console!="undefined"){
  20404. console.log("Required method IModalDialog:initialize not implemented.");
  20405. }
  20406. };
  20407. IPromptDialog.prototype.show=function(){
  20408. if(typeof console!="undefined"){
  20409. console.log("Required method IModalDialog:show not implemented.");
  20410. }
  20411. };
  20412. IPromptDialog.prototype.hide=function(){
  20413. if(typeof console!="undefined"){
  20414. console.log("Required method IModalDialog:hide not implemented.");
  20415. }
  20416. };
  20417. function IRequestHandler(){
  20418. };
  20419. IRequestHandler.prototype.preHttpRequest=function(_11a9){
  20420. if(typeof console!="undefined"){
  20421. console.log("Required method IRequestHandler:preHttpRequest not implemented.");
  20422. }
  20423. };
  20424. IRequestHandler.prototype.postHttpRequest=function(_11aa){
  20425. if(typeof console!="undefined"){
  20426. console.log("Required method IRequestHandler:postHttpRequest not implemented.");
  20427. }
  20428. };
  20429. IRequestHandler.prototype.postComplete=function(_11ab){
  20430. if(typeof console!="undefined"){
  20431. console.log("Required method IRequestHandler:postComplete not implemented.");
  20432. }
  20433. };
  20434. IRequestHandler.prototype.onComplete=function(_11ac){
  20435. if(typeof console!="undefined"){
  20436. console.log("Required method IRequestHandler:onComplete not implemented.");
  20437. }
  20438. };
  20439. IRequestHandler.prototype.onPostEntryComplete=function(_11ad){
  20440. if(typeof console!="undefined"){
  20441. console.log("Required method IRequestHandler:onPostEntryComplete not implemented.");
  20442. }
  20443. };
  20444. IRequestHandler.prototype.onFault=function(_11ae){
  20445. if(typeof console!="undefined"){
  20446. console.log("Required method IRequestHandler:onFault not implemented.");
  20447. }
  20448. };
  20449. IRequestHandler.prototype.onPrompting=function(_11af){
  20450. if(typeof console!="undefined"){
  20451. console.log("Required method IRequestHandler:onPrompting not implemented.");
  20452. }
  20453. };
  20454. IRequestHandler.prototype.onWorking=function(_11b0){
  20455. if(typeof console!="undefined"){
  20456. console.log("Required method IRequestHandler:onWorking not implemented.");
  20457. }
  20458. };
  20459. IRequestHandler.prototype.setWorkingDialog=function(_11b1){
  20460. if(typeof console!="undefined"){
  20461. console.log("Required method IRequestHandler:setWorkingDialog not implemented.");
  20462. }
  20463. };
  20464. IRequestHandler.prototype.setRequestIndicator=function(_11b2){
  20465. if(typeof console!="undefined"){
  20466. console.log("Required method IRequestHandler:setExecutionCursor not implemented.");
  20467. }
  20468. };
  20469. function IRequestIndicator(){
  20470. };
  20471. IRequestIndicator.prototype.show=function(){
  20472. if(typeof console!="undefined"){
  20473. console.log("Required method IRequestIndicator:show not implemented.");
  20474. }
  20475. };
  20476. IRequestIndicator.prototype.hide=function(){
  20477. if(typeof console!="undefined"){
  20478. console.log("Required method IRequestIndicator:hide not implemented.");
  20479. }
  20480. };
  20481. function BaseRequestHandler(oCV){
  20482. if(oCV){
  20483. this.m_oCV=oCV;
  20484. this.m_workingDialog=null;
  20485. this.m_requestIndicator=null;
  20486. this.m_faultDialog=null;
  20487. this.m_logOnDialog=null;
  20488. this.m_promptDialog=null;
  20489. this.m_httpRequestConfig=this.m_oCV.getConfig()&&this.m_oCV.getConfig().getHttpRequestConfig()?this.m_oCV.getConfig().getHttpRequestConfig():null;
  20490. }
  20491. };
  20492. BaseRequestHandler.prototype=new IRequestHandler();
  20493. BaseRequestHandler.prototype.onError=function(_11b4){
  20494. };
  20495. BaseRequestHandler.prototype.onComplete=function(){
  20496. };
  20497. BaseRequestHandler.prototype.onPrompting=function(){
  20498. };
  20499. BaseRequestHandler.prototype.resubmitInSafeMode=function(){
  20500. };
  20501. BaseRequestHandler.prototype.massageHtmlBeforeDisplayed=function(){
  20502. };
  20503. BaseRequestHandler.prototype.onPostEntryComplete=function(){
  20504. this._processDelayedLoadingQueue();
  20505. };
  20506. BaseRequestHandler.prototype.getViewer=function(){
  20507. return this.m_oCV;
  20508. };
  20509. BaseRequestHandler.prototype.setDispatcherEntry=function(_11b5){
  20510. this.m_oDispatcherEntry=_11b5;
  20511. };
  20512. BaseRequestHandler.prototype.getDispatcherEntry=function(){
  20513. return this.m_oDispatcherEntry;
  20514. };
  20515. BaseRequestHandler.prototype.processInitialResponse=function(_11b6){
  20516. this.updateViewerState(_11b6);
  20517. };
  20518. BaseRequestHandler.prototype.setLogOnDialog=function(_11b7){
  20519. if(_11b7==null){
  20520. this.m_logOnDialog=null;
  20521. }else{
  20522. if(_11b7 instanceof ILogOnDialog){
  20523. this.m_logOnDialog=_11b7;
  20524. }else{
  20525. if(_11b7&&typeof console!="undefined"){
  20526. console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
  20527. }
  20528. }
  20529. }
  20530. };
  20531. BaseRequestHandler.prototype.setWorkingDialog=function(_11b8){
  20532. if(_11b8==null){
  20533. this.m_workingDialog=null;
  20534. }else{
  20535. if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getWorkingDialog()){
  20536. this.m_workingDialog=this.m_httpRequestConfig.getWorkingDialog();
  20537. }else{
  20538. if(_11b8 instanceof IRequestIndicator){
  20539. this.m_workingDialog=_11b8;
  20540. }else{
  20541. if(_11b8&&typeof console!="undefined"){
  20542. console.log("The parameter workingDialog must be an instance of IRequestIndicator");
  20543. }
  20544. }
  20545. }
  20546. }
  20547. };
  20548. BaseRequestHandler.prototype.getWorkingDialog=function(){
  20549. return this.m_workingDialog;
  20550. };
  20551. BaseRequestHandler.prototype.setRequestIndicator=function(_11b9){
  20552. if(_11b9==null){
  20553. this.m_requestIndicator=null;
  20554. }else{
  20555. if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getRequestIndicator()){
  20556. this.m_requestIndicator=this.m_httpRequestConfig.getRequestIndicator();
  20557. }else{
  20558. if(_11b9 instanceof IRequestIndicator){
  20559. this.m_requestIndicator=_11b9;
  20560. }else{
  20561. if(_11b9&&typeof console!="undefined"){
  20562. console.log("The parameter requestIndicator must be an instance of IRequestIndicator");
  20563. }
  20564. }
  20565. }
  20566. }
  20567. };
  20568. BaseRequestHandler.prototype.getRequestIndicator=function(){
  20569. return this.m_requestIndicator;
  20570. };
  20571. BaseRequestHandler.prototype.setFaultDialog=function(_11ba){
  20572. if(_11ba==null){
  20573. this.m_faultDialog=null;
  20574. }else{
  20575. if(_11ba instanceof IFaultDialog){
  20576. this.m_faultDialog=_11ba;
  20577. }else{
  20578. if(_11ba&&typeof console!="undefined"){
  20579. console.log("The parameter faultDialog must be an instance of IFaultDialog");
  20580. }
  20581. }
  20582. }
  20583. };
  20584. BaseRequestHandler.prototype.setPromptDialog=function(_11bb){
  20585. if(_11bb==null){
  20586. this.m_promptDialog=null;
  20587. }else{
  20588. if(_11bb instanceof IPromptDialog){
  20589. this.m_promptDialog=_11bb;
  20590. }else{
  20591. if(_11bb&&typeof console!="undefined"){
  20592. console.log("The parameter promptDialog must be an instance of IPromptDialog");
  20593. }
  20594. }
  20595. }
  20596. };
  20597. BaseRequestHandler.prototype.preHttpRequest=function(_11bc){
  20598. if(_11bc&&typeof _11bc.getFormField=="function"){
  20599. if(_11bc.getFormField("ui.action")!="wait"&&_11bc.getFormField("rapWait")!="true"){
  20600. if(this.m_requestIndicator){
  20601. this.m_requestIndicator.show();
  20602. }
  20603. }
  20604. }
  20605. };
  20606. BaseRequestHandler.prototype.postHttpRequest=function(_11bd){
  20607. if(_11bd&&typeof _11bd.getAsynchStatus=="function"){
  20608. var _11be=_11bd.getAsynchStatus();
  20609. if(_11be!="working"&&_11be!="stillWorking"){
  20610. if(this.m_workingDialog){
  20611. this.m_workingDialog.hide();
  20612. }
  20613. if(this.m_requestIndicator){
  20614. this.m_requestIndicator.hide();
  20615. }
  20616. }
  20617. }else{
  20618. if(this.m_workingDialog){
  20619. this.m_workingDialog.hide();
  20620. }
  20621. if(this.m_requestIndicator){
  20622. this.m_requestIndicator.hide();
  20623. }
  20624. }
  20625. };
  20626. BaseRequestHandler.prototype.onFault=function(_11bf){
  20627. var oCV=this.getViewer();
  20628. if(this.m_workingDialog){
  20629. this.m_workingDialog.hide();
  20630. }
  20631. if(this.m_requestIndicator){
  20632. this.m_requestIndicator.hide();
  20633. }
  20634. if(typeof FaultDialog=="undefined"){
  20635. if(typeof console!="undefined"){
  20636. console.log("An unhandled fault was returned: %o",_11bf);
  20637. }
  20638. return;
  20639. }
  20640. if(!this.m_faultDialog){
  20641. this.m_faultDialog=new FaultDialog(this.getViewer());
  20642. }
  20643. if(_11bf&&_11bf.getResponseHeader&&_11bf.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  20644. this.m_faultDialog.handleUnknownHTMLResponse(_11bf.getResponseText());
  20645. }else{
  20646. if(_11bf&&_11bf.getSoapFault){
  20647. this.m_faultDialog.show(_11bf.getSoapFault());
  20648. }else{
  20649. if(oCV.getSoapFault()){
  20650. var _11c1=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  20651. this.m_faultDialog.show(_11c1);
  20652. oCV.setSoapFault("");
  20653. }else{
  20654. if(typeof console!="undefined"){
  20655. console.log("An unhandled fault was returned: %o",_11bf);
  20656. }
  20657. }
  20658. }
  20659. }
  20660. };
  20661. BaseRequestHandler.prototype.isAuthenticationFault=function(_11c2){
  20662. var oCV=this.getViewer();
  20663. var _11c4=null;
  20664. if(_11c2&&_11c2.getSoapFault){
  20665. _11c4=_11c2.getSoapFault();
  20666. }else{
  20667. if(oCV.getSoapFault()){
  20668. _11c4=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  20669. }
  20670. }
  20671. if(_11c4!=null){
  20672. var _11c5=XMLHelper_FindChildByTagName(_11c4,"CAM",true);
  20673. return (_11c5!=null&&XMLHelper_FindChildByTagName(_11c5,"promptInfo",true)!=null);
  20674. }
  20675. return false;
  20676. };
  20677. BaseRequestHandler.prototype.onPassportTimeout=function(_11c6){
  20678. var oCV=this.getViewer();
  20679. if(this.m_workingDialog){
  20680. this.m_workingDialog.hide();
  20681. }
  20682. if(this.m_requestIndicator){
  20683. this.m_requestIndicator.hide();
  20684. }
  20685. if(!this.m_logOnDialog){
  20686. this.m_logOnDialog=new LogOnDialog(this.getViewer());
  20687. }
  20688. if(_11c6&&_11c6.getResponseHeader&&_11c6.getResponseHeader("Content-type").indexOf("text/html")!=-1){
  20689. var _11c8="";
  20690. if(_11c6.getResponseText){
  20691. _11c8=_11c6.getResponseText();
  20692. }
  20693. if((_11c8.indexOf("http-equiv=\"refresh\"")!=-1)||(_11c8.indexOf("http-equiv='refresh'")!=-1)){
  20694. this.m_logOnDialog.show(null);
  20695. }else{
  20696. this.m_logOnDialog.handleUnknownHTMLResponse(_11c8);
  20697. }
  20698. }else{
  20699. if(_11c6&&_11c6.getSoapFault){
  20700. this.m_logOnDialog.show(_11c6.getSoapFault());
  20701. }else{
  20702. if(oCV.getSoapFault()){
  20703. var _11c9=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
  20704. this.m_logOnDialog.show(_11c9);
  20705. oCV.setSoapFault("");
  20706. }else{
  20707. if(typeof console!="undefined"){
  20708. console.log("BaseRequestHandler.prototype.onPassportTimeout: An unhandled authentication fault was returned: %o",_11c6);
  20709. }
  20710. }
  20711. }
  20712. }
  20713. };
  20714. BaseRequestHandler.prototype.onWorking=function(_11ca){
  20715. if(this.m_workingDialog){
  20716. var _11cb=_11ca&&typeof _11ca.getAsynchStatus=="function"&&_11ca.getAsynchStatus()=="stillWorking"?true:false;
  20717. if(!_11cb){
  20718. if(this.m_requestIndicator){
  20719. this.m_requestIndicator.hide();
  20720. }
  20721. this.m_workingDialog.show();
  20722. }
  20723. }
  20724. };
  20725. BaseRequestHandler.prototype.onCancel=function(){
  20726. if(this.m_workingDialog){
  20727. this.m_workingDialog.hide();
  20728. }
  20729. if(this.m_requestIndicator){
  20730. this.m_requestIndicator.hide();
  20731. }
  20732. var oCV=this.getViewer();
  20733. oCV.gbPromptRequestSubmitted=false;
  20734. this._processDelayedLoadingQueue();
  20735. };
  20736. BaseRequestHandler.prototype._processDelayedLoadingQueue=function(){
  20737. var oCV=this.getViewer();
  20738. if(oCV&&oCV.getViewerWidget()){
  20739. var _11ce=oCV.getViewerWidget();
  20740. if(_11ce.getLoadManager()){
  20741. _11ce.getLoadManager().processQueue();
  20742. }
  20743. }
  20744. };
  20745. BaseRequestHandler.prototype.onPrompting=function(_11cf){
  20746. var oCV=this.getViewer();
  20747. if(this.m_workingDialog){
  20748. this.m_workingDialog.hide();
  20749. }
  20750. if(this.m_requestIndicator){
  20751. this.m_requestIndicator.hide();
  20752. }
  20753. if(!this.m_promptDialog){
  20754. this.m_promptDialog=new PromptDialog(this.getViewer());
  20755. }
  20756. window["AsynchRequestObject"]=_11cf;
  20757. window["AsynchRequestPromptDialog"]=this.m_promptDialog;
  20758. var _11d1="?cv.id="+oCV.getId();
  20759. window["AsynchRequestPromptDialog"].initialize(oCV.getWebContentRoot()+"/rv/showStandalonePrompts.html"+_11d1,400,400);
  20760. window["AsynchRequestPromptDialog"].show();
  20761. };
  20762. BaseRequestHandler.prototype.processDATAReportResponse=function(_11d2){
  20763. var oCV=this.getViewer();
  20764. if(!oCV||oCV.m_destroyed){
  20765. if(console){
  20766. console.warn("Tried to process a data response on an invalid CCognosViewer",oCV);
  20767. }
  20768. return;
  20769. }
  20770. var _11d4=_11d2.getResponseState();
  20771. if(!_11d4){
  20772. this.resubmitInSafeMode();
  20773. }
  20774. if(this.loadReportHTML(_11d2.getResult())===false){
  20775. this.resubmitInSafeMode();
  20776. }
  20777. this.updateViewerState(_11d4);
  20778. };
  20779. BaseRequestHandler.prototype.updateViewerState=function(_11d5){
  20780. var oCV=this.getViewer();
  20781. applyJSONProperties(oCV,_11d5);
  20782. var _11d7=oCV.getStatus();
  20783. if(typeof oCV.envParams["ui.spec"]!="undefined"&&oCV.envParams["ui.spec"].indexOf("&lt;")===0){
  20784. oCV.envParams["ui.spec"]=xml_decode(oCV.envParams["ui.spec"]);
  20785. }
  20786. if(_11d7!="fault"){
  20787. if(oCV.envParams["rapReportInfo"]){
  20788. this._processRapReportInfo(oCV);
  20789. }
  20790. if(typeof _11d5.clientunencodedexecutionparameters!="undefined"){
  20791. var _11d8=document.getElementById("formWarpRequest"+oCV.getId());
  20792. if(_11d8!=null&&typeof _11d8["clientunencodedexecutionparameters"]!="undefined"){
  20793. _11d8["clientunencodedexecutionparameters"].value=_11d5.clientunencodedexecutionparameters;
  20794. }
  20795. if(typeof document.forms["formWarpRequest"]!="undefined"&&typeof document.forms["formWarpRequest"]["clientunencodedexecutionparameters"]!="undefined"){
  20796. document.forms["formWarpRequest"]["clientunencodedexecutionparameters"].value=_11d5.clientunencodedexecutionparameters;
  20797. }
  20798. }
  20799. }else{
  20800. oCV.setTracking("");
  20801. }
  20802. };
  20803. BaseRequestHandler.prototype._processRapReportInfo=function(oCV){
  20804. if(oCV.envParams["rapReportInfo"]){
  20805. var _11da=eval("("+oCV.envParams["rapReportInfo"]+")");
  20806. if(typeof RAPReportInfo!="undefined"){
  20807. var _11db=new RAPReportInfo(_11da,oCV);
  20808. oCV.setRAPReportInfo(_11db);
  20809. }
  20810. }
  20811. };
  20812. BaseRequestHandler.prototype.loadReportHTML=function(_11dc){
  20813. if(!_11dc){
  20814. return true;
  20815. }
  20816. var oCV=this.getViewer();
  20817. if(window.IBM&&window.IBM.perf){
  20818. window.IBM.perf.log("viewer_gotHtml",oCV);
  20819. }
  20820. if(oCV.m_undoStack.length>0){
  20821. oCV.m_undoStack[oCV.m_undoStack.length-1].m_bRefreshPage=true;
  20822. }
  20823. oCV.pageNavigationObserverArray=[];
  20824. oCV.m_flashChartsObjectIds=[];
  20825. var sHTML=_11dc.replace(/<form[^>]*>/gi,"").replace(/<\/form[^>]*>/gi,"");
  20826. oCV.m_sHTML=sHTML;
  20827. oCV.setHasPrompts(false);
  20828. var id=oCV.getId();
  20829. var _11e0=document.getElementById("RVContent"+id);
  20830. var _11e1=document.getElementById("CVReport"+id);
  20831. if(window.gScriptLoader){
  20832. var _11e2=oCV.getViewerWidget()?true:false;
  20833. var _11e3=oCV.getViewerWidget()?document.getElementById("_"+oCV.getViewerWidget().iContext.widgetId+"_cv"):_11e1;
  20834. sHTML=window.gScriptLoader.loadCSS(sHTML,_11e3,_11e2,id);
  20835. }
  20836. if(oCV.sBrowser=="ie"){
  20837. sHTML="<span style='display:none'>&nbsp;</span>"+sHTML;
  20838. }
  20839. _11e1.innerHTML=sHTML;
  20840. this.massageHtmlBeforeDisplayed();
  20841. if(window.gScriptLoader){
  20842. var _11e4=GUtil.generateCallback(oCV.showLoadedContent,[_11e0],oCV);
  20843. oCV.m_resizeReady=false;
  20844. if(!window.gScriptLoader.loadAll(_11e1,_11e4,id,true)){
  20845. if(window.gScriptLoader.containsAjaxWarnings()){
  20846. return false;
  20847. }
  20848. }
  20849. }else{
  20850. _11e0.style.display="block";
  20851. }
  20852. var _11e5=document.querySelectorAll("button");
  20853. var _11e6=_11e5.length;
  20854. for(var k=0;k<_11e6;k++){
  20855. var _11e8=_11e5[k];
  20856. var id=_11e8.id;
  20857. var _11e9=id.match(/reprompt/);
  20858. if(_11e9){
  20859. var _11ea=_11e8.outerHTML;
  20860. var _11eb=_11ea.match(/layoutname="\w+"/);
  20861. if(_11eb!==null){
  20862. var _11ec=_11eb[0];
  20863. var _11ed=/".*"/;
  20864. var _11ee=_11ed.exec(_11ec);
  20865. if(oCV.getCurrentPromptControlFocus()==_11ee){
  20866. _11e8.focus();
  20867. oCV.setCurrentPromptControlFocus(null);
  20868. _11e8=null;
  20869. }
  20870. }else{
  20871. oCV.setCurrentPromptControlFocus(null);
  20872. _11e8=null;
  20873. }
  20874. }
  20875. }
  20876. oCV.updateOutputForA11ySupport();
  20877. this._clearFindState();
  20878. return true;
  20879. };
  20880. BaseRequestHandler.prototype._clearFindState=function(){
  20881. var oCV=this.getViewer();
  20882. var _11f0=oCV.getState()&&oCV.getState().getFindState()?oCV.getState().getFindState():null;
  20883. if(_11f0&&!_11f0.findOnServerInProgress()){
  20884. oCV.getState().clearFindState();
  20885. }
  20886. };
  20887. BaseRequestHandler.prototype.showReport=function(){
  20888. var oCV=this.getViewer();
  20889. var _11f2=document.getElementById("CVReport"+oCV.getId());
  20890. if(_11f2){
  20891. _11f2.style.display="";
  20892. }
  20893. };
  20894. BaseRequestHandler.prototype.postComplete=function(){
  20895. var oCV=this.getViewer();
  20896. if(oCV.shouldWriteNavLinks()){
  20897. oCV.writeNavLinks(oCV.getSecondaryRequests().join(" "));
  20898. }
  20899. if(oCV.getStatus()==="complete"){
  20900. oCV.m_undoStack=[new CognosViewerSession(oCV)];
  20901. }
  20902. };
  20903. BaseRequestHandler.prototype.onAsynchStatusUpdate=function(_11f4){
  20904. if(this.m_httpRequestConfig){
  20905. var _11f5=this.m_httpRequestConfig.getReportStatusCallback(_11f4);
  20906. if(_11f5){
  20907. _11f5();
  20908. }
  20909. }
  20910. };
  20911. BaseRequestHandler.prototype.addCallbackHooks=function(){
  20912. if(!this.m_httpRequestConfig){
  20913. return;
  20914. }
  20915. this._addCallback("complete","onComplete");
  20916. this._addCallback("working","onWorking");
  20917. this._addCallback("prompting","onPrompting");
  20918. };
  20919. BaseRequestHandler.prototype._addCallback=function(_11f6,_11f7){
  20920. var _11f8=_11f6;
  20921. var _11f9=this[_11f7];
  20922. this[_11f7]=function(_11fa){
  20923. _11f9.apply(this,arguments);
  20924. var _11fb=null;
  20925. if(_11fa&&typeof _11fa.getAsynchStatus=="function"){
  20926. _11fb=_11fa.getAsynchStatus();
  20927. }else{
  20928. _11fb=_11f8=="complete"?this.getViewer().getStatus():_11f8;
  20929. }
  20930. if(_11fb=="stillWorking"){
  20931. return;
  20932. }
  20933. var _11fc=this.m_httpRequestConfig.getReportStatusCallback(_11fb);
  20934. if(typeof _11fc=="function"){
  20935. setTimeout(_11fc,10);
  20936. }
  20937. };
  20938. };
  20939. dojo.provide("FaultDialog");
  20940. dojo.declare("FaultDialog",IFaultDialog,{m_soapFault:null,m_errorMessage:null,m_oCV:null,constructor:function(oCV){
  20941. this.m_oCV=oCV;
  20942. },show:function(_11fe){
  20943. this.m_soapFault=_11fe;
  20944. this.m_oCV.m_resizeReady=true;
  20945. this.renderInlineDialog();
  20946. this.m_oCV.getViewerWidget().setErrorDlg(this);
  20947. },handleUnknownHTMLResponse:function(_11ff){
  20948. if(_11ff){
  20949. var _1200=window.open("","","height=400,width=500");
  20950. if(_1200!=null){
  20951. _1200.document.write(_11ff);
  20952. }
  20953. }
  20954. },canRetryRequest:function(){
  20955. var _1201=true;
  20956. var _1202=XMLHelper_FindChildrenByTagName(this.m_soapFault,"allowRetry",true);
  20957. if(_1202.length>0){
  20958. _1201=(XMLHelper_GetText(_1202[0],false)==="true");
  20959. }
  20960. return _1201;
  20961. },isWarningMessage:function(){
  20962. return false;
  20963. },getButtons:function(){
  20964. var _1203=[{label:RV_RES.IDS_JS_OK,action:dojo.hitch(this,this.ok)}];
  20965. if(this.canRetryRequest()){
  20966. _1203.push({label:RV_RES.IDS_JS_RETRY,action:dojo.hitch(this,this.retry)});
  20967. }
  20968. return _1203;
  20969. },renderInlineDialog:function(){
  20970. var _1204={"type":this.isWarningMessage()?"warning":"error","message":this.getErrorMessage(),"buttons":this.getButtons()};
  20971. var _1205=this.getDetails();
  20972. if(_1205&&_1205.length>0){
  20973. _1204.details=_1205;
  20974. }
  20975. this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.notification",null,_1204);
  20976. },setErrorMessage:function(_1206){
  20977. this.m_errorMessage=_1206;
  20978. },getErrorMessage:function(){
  20979. if(this.m_errorMessage==null){
  20980. var _1207=XMLHelper_FindChildrenByTagName(this.m_soapFault,"message",true);
  20981. if(_1207.length>0){
  20982. var _1208=XMLHelper_FindChildByTagName(_1207[0],"messageString",false);
  20983. this.checkAndSetErrorMessage(XMLHelper_GetText(_1208,false));
  20984. }
  20985. }
  20986. return this.m_errorMessage;
  20987. },checkAndSetErrorMessage:function(_1209){
  20988. this.m_detailMessageStartIndex=1;
  20989. if(_1209.indexOf("RSV-BBP-0038")==0){
  20990. _1209=RV_RES.IDS_CONV_CANCELED_ERROR;
  20991. this.m_detailMessageStartIndex=0;
  20992. }
  20993. this.m_errorMessage=_1209;
  20994. },getDetails:function(){
  20995. var _120a="";
  20996. var _120b=XMLHelper_FindChildrenByTagName(this.m_soapFault,"message",true);
  20997. if(_120b.length>0){
  20998. if(typeof this.m_detailMessageStartIndex==="undefined"||this.m_detailMessageStartIndex===null){
  20999. this.m_detailMessageStartIndex=1;
  21000. }
  21001. for(var _120c=this.m_detailMessageStartIndex;_120c<_120b.length;++_120c){
  21002. var _120d=XMLHelper_FindChildByTagName(_120b[_120c],"messageString",false);
  21003. _120a+=XMLHelper_GetText(_120d,false)+"\n";
  21004. }
  21005. }
  21006. return _120a;
  21007. },retry:function(){
  21008. var _120e=this.m_oCV.getRetryDispatcherEntry();
  21009. this.hide();
  21010. if(_120e){
  21011. _120e.retryRequest();
  21012. }else{
  21013. var _120f=this.m_oCV.getViewerWidget().getOriginalFormFields();
  21014. if(_120f&&(_120f.get("b_action")=="cvx"||_120f.get("b_action")=="cvx.high")){
  21015. _120f.add("b_action","cognosViewer");
  21016. }
  21017. this.m_oCV.executeAction("RetryRequest",_120f);
  21018. }
  21019. },ok:function(){
  21020. var _1210=this.m_oCV.getRetryDispatcherEntry();
  21021. this.hide();
  21022. if(_1210){
  21023. _1210.onCloseErrorDlg();
  21024. }
  21025. },hide:function(){
  21026. this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.notification",null,{remove:1});
  21027. this.m_oCV.getViewerWidget().setErrorDlg(null);
  21028. this.m_oCV.setRetryDispatcherEntry(null);
  21029. }});
  21030. function buxErrorPage_toggleErrorDetails(event,cvId,_1213){
  21031. if((event.button==0&&(event.keyCode=="0"||typeof event.keyCode=="undefined"))||event.keyCode=="32"||event.keyCode=="13"){
  21032. var _1214=document.getElementById("buxErrorPageDetailContentOuter"+cvId);
  21033. var _1215=document.getElementById("buxErrorPageDetails"+cvId);
  21034. var _1216=document.getElementById("titlePaneTitle"+cvId);
  21035. var _1217=(_1215.style.display=="none");
  21036. dojo.removeClass(_1214,_1217?"dijitTitlePaneContentOuterClosed":"dijitTitlePaneContentOuterOpen");
  21037. dojo.addClass(_1214,_1217?"dijitTitlePaneContentOuterOpen":"dijitTitlePaneContentOuterClosed");
  21038. dojo.removeClass(_1216,_1217?"dijitClose":"dijitOpen");
  21039. dojo.addClass(_1216,_1217?"dijitOpen":"dijitClose");
  21040. _1215.style.display=_1217?"":"none";
  21041. }
  21042. };
  21043. function ModalFaultDialog(){
  21044. };
  21045. ModalFaultDialog.prototype=new FaultDialog();
  21046. ModalFaultDialog.prototype.show=function(_1218){
  21047. var _1219="";
  21048. var _121a="",_121b="";
  21049. var _121c=XMLHelper_FindChildrenByTagName(_1218,"message",true);
  21050. if(_121c.length>0){
  21051. for(var _121d=1;_121d<_121c.length;++_121d){
  21052. _121b=XMLHelper_FindChildByTagName(_121c[_121d],"messageString",false);
  21053. _1219+=XMLHelper_GetText(_121b,false)+"\n";
  21054. }
  21055. _121b=XMLHelper_FindChildByTagName(_121c[0],"messageString",false);
  21056. _121a=XMLHelper_GetText(_121b,false);
  21057. }
  21058. bux.messageBox(bux.MB_ERROR,_121a,"",_1219);
  21059. };
  21060. dojo.provide("GlobalPromptFaultDialog");
  21061. dojo.require("FaultDialog");
  21062. dojo.declare("GlobalPromptFaultDialog",FaultDialog,{m_sendRequestOnOK:false,setSendRequestOnOK:function(_121e){
  21063. this.m_sendRequestOnOK=_121e;
  21064. },ok:function(){
  21065. this.hide();
  21066. this.m_oCV.getViewerWidget().disableListenToForGlobalPrompt();
  21067. if(this.m_sendRequestOnOK){
  21068. var _121f=this.m_oCV.getRetryDispatcherEntry();
  21069. var _1220=null;
  21070. if(_121f){
  21071. _1220=_121f.getOriginalFormFields();
  21072. }else{
  21073. _1220=this.m_oCV.getViewerWidget().getOriginalFormFields();
  21074. }
  21075. if(_1220&&_1220.exists("widget.globalPromptInfo")){
  21076. _1220.remove("widget.globalPromptInfo");
  21077. }
  21078. this.retry();
  21079. }
  21080. }});
  21081. dojo.provide("FaultMessageDialog");
  21082. dojo.declare("FaultMessageDialog",FaultDialog,{m_oCV:null,m_errorMessage:"",constructor:function(oCV,_1222){
  21083. this.m_errorMessage=_1222;
  21084. },getErrorMessage:function(){
  21085. return this.m_errorMessage;
  21086. },getDetails:function(){
  21087. return "";
  21088. },canRetryRequest:function(){
  21089. return false;
  21090. }});
  21091. dojo.provide("WarningMessageDialog");
  21092. dojo.declare("WarningMessageDialog",FaultMessageDialog,{constructor:function(oCV,_1224){
  21093. },isWarningMessage:function(){
  21094. return true;
  21095. }});
  21096. function LogOnDialog(oCV){
  21097. if(oCV){
  21098. this.m_oCV=oCV;
  21099. }
  21100. };
  21101. LogOnDialog.prototype=new ILogOnDialog();
  21102. LogOnDialog.prototype.getViewer=function(){
  21103. return this.m_oCV;
  21104. };
  21105. LogOnDialog.prototype.handleUnknownHTMLResponse=function(_1226){
  21106. this.show(null);
  21107. };
  21108. LogOnDialog.prototype.show=function(_1227){
  21109. var _1228=this.getPromptInfoNamespacesFromAuthenticationFault(_1227);
  21110. if(window["CVEditContentActionInstance"]){
  21111. window["CVEditContentActionInstance"].transitionFromBUA();
  21112. }
  21113. IWidgetLogonhandler.handleLogon(this.getViewer().getId(),_1228);
  21114. };
  21115. LogOnDialog.prototype.getPromptInfoNamespacesFromAuthenticationFault=function(_1229){
  21116. if(!_1229){
  21117. return null;
  21118. }
  21119. var _122a=XMLHelper_FindChildByTagName(_1229,"CAM",true);
  21120. if(_122a==null){
  21121. return null;
  21122. }
  21123. var _122b=XMLHelper_FindChildByTagName(_122a,"promptInfo",true);
  21124. if(_122b==null){
  21125. return null;
  21126. }
  21127. var _122c=XMLHelper_FindChildByTagName(_122a,"displayObjects",true);
  21128. if(_122c==null){
  21129. return null;
  21130. }
  21131. var items=XMLHelper_FindChildrenByTagName(_122c,"item",true);
  21132. if(items==null||items.length!=1){
  21133. return null;
  21134. }
  21135. var _122e=items[0];
  21136. if(_122e==null){
  21137. return null;
  21138. }
  21139. var _122f=XMLHelper_FindChildByTagName(_122e,"name",true);
  21140. var name=XMLHelper_GetText(_122f,false);
  21141. if(name==="CAMNamespace"){
  21142. var _1231=XMLHelper_FindChildByTagName(_122e,"value",true);
  21143. var value=XMLHelper_GetText(_1231,false);
  21144. if(value!=null){
  21145. return value;
  21146. }
  21147. }
  21148. return null;
  21149. };
  21150. dojo.provide("LogOnHandler");
  21151. dojo.declare("LogOnHandler",null,{constructor:function(){
  21152. this.m_cvIdList=[];
  21153. },handleLogon:function(cvId,_1234){
  21154. this.m_cvIdList.push(cvId);
  21155. if(this.m_cvIdList.length==1){
  21156. dojo["require"]("bux.dialogs.IFrameDialog");
  21157. var _1235=(_1234==null||_1234.length==0)?new bux.dialogs.LogonDialog({okHandler:GUtil.generateCallback(this.okHandler,[],this),cancelHandler:GUtil.generateCallback(this.cancelHandler,[],this)}):new bux.dialogs.LogonDialog({okHandler:GUtil.generateCallback(this.okHandler,[],this),cancelHandler:GUtil.generateCallback(this.cancelHandler,[],this),params:{"h_CAM_action":"logonAs","CAMNamespace":_1234}});
  21158. _1235.startup();
  21159. _1235.show();
  21160. }
  21161. },okHandler:function(){
  21162. for(var index=0;index<this.m_cvIdList.length;++index){
  21163. var cvId=this.m_cvIdList[index];
  21164. var oCV=window["oCV"+cvId];
  21165. if(index===0&&oCV.getViewerWidget){
  21166. oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.action",null,{action:"refreshAfterLogon"});
  21167. }
  21168. if(oCV.getRetryDispatcherEntry()){
  21169. oCV.getRetryDispatcherEntry().retryRequest();
  21170. }else{
  21171. var _1239=oCV.getViewerWidget().getOriginalFormFields();
  21172. if(_1239){
  21173. oCV.executeAction("RetryRequest",_1239);
  21174. }
  21175. }
  21176. }
  21177. this.m_cvIdList=[];
  21178. },cancelHandler:function(){
  21179. for(var index=0;index<this.m_cvIdList.length;++index){
  21180. var cvId=this.m_cvIdList[index];
  21181. var oCV=window["oCV"+cvId];
  21182. if(oCV.getRetryDispatcherEntry()){
  21183. oCV.getRetryDispatcherEntry().onCloseErrorDlg();
  21184. }
  21185. }
  21186. this.m_cvIdList=[];
  21187. }});
  21188. IWidgetLogonhandler=new LogOnHandler();
  21189. function PromptDialog(oCV){
  21190. this.m_oCV=oCV;
  21191. this.m_url="";
  21192. this.m_width=0;
  21193. this.m_height=0;
  21194. this.m_dialogImpl=null;
  21195. };
  21196. PromptDialog.prototype=new IPromptDialog();
  21197. PromptDialog.prototype.initialize=function(url,width,_1240){
  21198. this.m_url=url;
  21199. this.m_width=width;
  21200. this.m_height=_1240;
  21201. };
  21202. PromptDialog.prototype.show=function(){
  21203. this.m_dialogImpl=new bux.dialogs.IFrameDialog();
  21204. this.m_dialogImpl.src=this.m_url;
  21205. this.m_dialogImpl.width=this.m_width;
  21206. this.m_dialogImpl.height=this.m_height;
  21207. this.m_dialogImpl.startup();
  21208. this.m_dialogImpl.show();
  21209. };
  21210. PromptDialog.prototype.hide=function(){
  21211. this.m_dialogImpl.hide();
  21212. this.m_dialogImpl.destroy();
  21213. delete this.m_dialogImpl;
  21214. this.m_dialogImpl=null;
  21215. };
  21216. function RequestHandler(oCV){
  21217. if(oCV){
  21218. RequestHandler.baseConstructor.call(this,oCV);
  21219. this.m_originalFormFields=null;
  21220. this.m_forceRaiseSharePrompt=false;
  21221. }
  21222. };
  21223. RequestHandler.prototype=new BaseRequestHandler();
  21224. RequestHandler.baseConstructor=BaseRequestHandler;
  21225. RequestHandler.prototype.parent=BaseRequestHandler.prototype;
  21226. RequestHandler.prototype.postHttpRequest=function(_1242){
  21227. var oCV=this.getViewer();
  21228. this.parent.postHttpRequest.call(this,_1242);
  21229. };
  21230. RequestHandler.prototype.setForceRaiseSharePrompt=function(bFlag){
  21231. this.m_forceRaiseSharePrompt=bFlag;
  21232. };
  21233. RequestHandler.prototype.preHttpRequest=function(_1245){
  21234. var oCV=this.getViewer();
  21235. var _1247=oCV.getViewerWidget();
  21236. oCV.setCurrentNodeFocus(null);
  21237. if(this.doRaiseSharePromptEvent(_1245)){
  21238. if(oCV.widgetHasPromptParameters()){
  21239. this.setRequestIndicator(new BaseRequestExecutedIndicator(oCV));
  21240. var _1248=this.getListOfCascadingPromptParametersToReset(oCV,_1245);
  21241. oCV.raisePromptEvent(oCV.envParams["reportPrompts"],_1245.getFormFields(),_1248);
  21242. }else{
  21243. if(!(_1247&&_1247.promptParametersRetrieved==true)){
  21244. var _1249=oCV.getAction("GetParameters");
  21245. _1249.isPrimaryPromptWidget=true;
  21246. _1249.execute();
  21247. }
  21248. }
  21249. }
  21250. oCV.resetRaiseSharePromptEventFlag();
  21251. this.parent.preHttpRequest.call(this,_1245);
  21252. };
  21253. RequestHandler.prototype.getListOfChangedPromptParameters=function(oCV,_124b){
  21254. var _124c=oCV.getOldParameters();
  21255. if(!_124c){
  21256. return null;
  21257. }
  21258. var _124d=[];
  21259. for(var _124e in _124c){
  21260. oldParmValueItems=_124c[_124e].m_parmValueItems;
  21261. var _124f=_124b.getFormFields().get("p_"+_124e);
  21262. if(!_124f){
  21263. continue;
  21264. }
  21265. for(var j=0;j<oldParmValueItems.length;++j){
  21266. var _1251=sXmlEncode(oldParmValueItems[j].m_useValue);
  21267. if(_124f.indexOf(_1251)<0){
  21268. _124d.push("p_"+_124e);
  21269. }
  21270. }
  21271. }
  21272. return _124d;
  21273. };
  21274. RequestHandler.prototype.getListOfCascadingPromptParametersToReset=function(oCV,_1253){
  21275. if(!oCV.preProcessControlArray){
  21276. return null;
  21277. }
  21278. var _1254=this.getListOfChangedPromptParameters(oCV,_1253);
  21279. if(!_1254||!_1254.length){
  21280. return null;
  21281. }
  21282. var _1255=[];
  21283. var _1256=oCV.preProcessControlArray.length;
  21284. var _1257=_1254.slice();
  21285. for(var k=0;k<_1256;k++){
  21286. var _1259=(oCV.preProcessControlArray[k]);
  21287. if(!_1259.getCascadeOnParameter){
  21288. return;
  21289. }
  21290. var _125a=_1259.getCascadeOnParameter();
  21291. if(!_125a){
  21292. continue;
  21293. }
  21294. var _125b=_1259.getParameterName();
  21295. var _125c=_125a.getName();
  21296. if(this.contains(_1257,_125c)&&!this.contains(_1257,_125b)){
  21297. _1257.push(_125b);
  21298. _1255.push(_125b);
  21299. }
  21300. }
  21301. return _1255;
  21302. };
  21303. RequestHandler.prototype.contains=function(a,obj){
  21304. var i=a.length;
  21305. while(i--){
  21306. if(a[i]===obj){
  21307. return true;
  21308. }
  21309. }
  21310. return false;
  21311. };
  21312. RequestHandler.prototype.doRaiseSharePromptEvent=function(_1260){
  21313. var oCV=this.getViewer();
  21314. var _1262=false;
  21315. var _1263=_1260.getFormField("ui.action");
  21316. if(((typeof _1263!=="undefined"&&(_1263==="forward"||_1263==="back"))&&oCV.m_raiseSharePromptEvent)||this.m_forceRaiseSharePrompt){
  21317. _1262=true;
  21318. var _1264=null;
  21319. var _1265=false;
  21320. var _1266=0;
  21321. var _1267=_1260.getFormFields();
  21322. var keys=_1267.keys();
  21323. for(_1264 in keys){
  21324. _1264=keys[_1264];
  21325. if(_1264=="_promptControl"&&_1267.get(_1264)=="search"){
  21326. _1262=false;
  21327. break;
  21328. }else{
  21329. if(_1264.indexOf("p_")===0){
  21330. if(_1264.indexOf("p_credential:")===0){
  21331. _1265=true;
  21332. }else{
  21333. _1266+=1;
  21334. }
  21335. }
  21336. }
  21337. }
  21338. if(_1262&&_1265&&_1266===0){
  21339. _1262=false;
  21340. }
  21341. }
  21342. return _1262;
  21343. };
  21344. RequestHandler.prototype.onComplete=function(_1269){
  21345. var oCV=this.getViewer();
  21346. if(oCV&&!oCV.m_destroyed){
  21347. this.parent.onComplete.call(this,_1269);
  21348. this.processDATAReportResponse(_1269);
  21349. this.postComplete();
  21350. }else{
  21351. if(console){
  21352. console.warn("Tried to complete a request on an invalid CCognosViewer",oCV);
  21353. }
  21354. }
  21355. };
  21356. RequestHandler.prototype.onPrompting=function(_126b){
  21357. var oCV=this.getViewer();
  21358. if(oCV&&!oCV.m_destroyed){
  21359. var _126d=oCV.getViewerWidget();
  21360. _126d.hideToolbarAndContextMenu();
  21361. this.onComplete(_126b);
  21362. }else{
  21363. if(console){
  21364. console.warn("Tried to prompt on an invalid CCognosViewer",oCV);
  21365. }
  21366. }
  21367. };
  21368. RequestHandler.prototype.onError=function(_126e){
  21369. var oCV=this.getViewer();
  21370. if(_126e&&oCV){
  21371. var _1270=oCV.getViewerWidget();
  21372. if(typeof console!="undefined"&&console&&console.log){
  21373. console.log("Viewer http error: "+_126e.getResponseText()+" "+_126e.getStatus());
  21374. }
  21375. _1270.fireEvent("com.ibm.bux.widget.action",null,{action:"httpError",responseText:_126e.getResponseText(),status:_126e.getStatus()});
  21376. }
  21377. };
  21378. RequestHandler.prototype.onFault=function(_1271){
  21379. var oCV=this.getViewer();
  21380. var _1273=oCV.getViewerWidget();
  21381. var _1274=oCV.getRetryDispatcherEntry();
  21382. if(_1274&&_1274.getOriginalFormFields()){
  21383. this.m_originalFormFields=_1274.getOriginalFormFields();
  21384. }else{
  21385. this.m_originalFormFields=_1273.getOriginalFormFields();
  21386. }
  21387. if(window["gReportWidgetLoadQueue"]){
  21388. window["gReportWidgetLoadQueue"].widgetDoneLoading(_1273);
  21389. }
  21390. if(this.isGlobalPromptException()){
  21391. this.handleGlobalPromptException();
  21392. }
  21393. if(this.isMissingMemberException(oCV,_1271)){
  21394. this.handleMissingMemberException(oCV);
  21395. }
  21396. if(oCV.envParams&&oCV.envParams["updateToolbar"]==="true"){
  21397. _1273.savedOutputMenuUpdated=false;
  21398. _1273.updateToolbar();
  21399. }
  21400. if(oCV.envParams&&oCV.envParams["ui.action"]==="buxView"){
  21401. _1273.setSavedOutputsCMResponse(null);
  21402. }
  21403. if(typeof _1273.postOnFault=="function"){
  21404. _1273.postOnFault();
  21405. }
  21406. this.parent.onFault.call(this,_1271);
  21407. if(_1274&&_1271&&_1271.getResponseState){
  21408. var _1275=_1271.getResponseState();
  21409. if(_1275){
  21410. this.updateViewerState(_1275);
  21411. }
  21412. this.onPostEntryComplete();
  21413. }
  21414. };
  21415. RequestHandler.prototype.handleGlobalPromptException=function(){
  21416. var oCV=this.getViewer();
  21417. var _1277=new GlobalPromptFaultDialog(oCV);
  21418. oCV.disableRaiseSharePromptEvent();
  21419. if(this.m_originalFormFields&&!this.m_originalFormFields.exists("sharedPromptRequest")){
  21420. _1277.setSendRequestOnOK(true);
  21421. }
  21422. _1277.setErrorMessage(RV_RES.IDS_JS_GLOBAL_PROMPTS_NOT_RESPONDING_WARNING);
  21423. this.setFaultDialog(_1277);
  21424. };
  21425. RequestHandler.prototype.isGlobalPromptException=function(){
  21426. var oCV=this.getViewer();
  21427. if(this.m_originalFormFields){
  21428. if(this.m_originalFormFields.exists("sharedPromptRequest")||(this.m_originalFormFields.get("ui.reportDrop")==="true"&&this.m_originalFormFields.exists("widget.globalPromptInfo"))){
  21429. return true;
  21430. }
  21431. }
  21432. return false;
  21433. };
  21434. RequestHandler.prototype.postComplete=function(){
  21435. var oCV=this.getViewer();
  21436. if(oCV.getStatus()=="complete"&&!oCV.inlineScriptsDoneExecuting){
  21437. var _127a=this;
  21438. setTimeout(function(){
  21439. _127a.postComplete();
  21440. },10);
  21441. return;
  21442. }
  21443. this.parent.postComplete.call(this);
  21444. if(oCV&&oCV.m_destroyed){
  21445. if(console){
  21446. console.warn("Tried to postComplete on an invalid CCognosViewer",oCV);
  21447. }
  21448. return;
  21449. }
  21450. var _127b=oCV.getViewerWidget();
  21451. if(window["gReportWidgetLoadQueue"]){
  21452. window["gReportWidgetLoadQueue"].widgetDoneLoading(_127b);
  21453. }
  21454. this.showReport();
  21455. oCV.getSelectionController().clearSelectionData();
  21456. oCV.addPageAdornments();
  21457. _127b.savedOutputMenuUpdated=false;
  21458. if(oCV.getStatus()!="prompting"){
  21459. _127b.fetchAnnotationData();
  21460. _127b.getUndoRedoQueue().add({"reportUpdated":true});
  21461. }
  21462. _127b.updateToolbar();
  21463. oCV.m_stateSet=true;
  21464. oCV.doneLoading();
  21465. if(typeof _127b.postComplete=="function"){
  21466. _127b.postComplete();
  21467. }
  21468. };
  21469. RequestHandler.prototype.updateViewerState=function(_127c){
  21470. var oCV=this.getViewer();
  21471. if(oCV&&oCV.m_destroyed){
  21472. if(console){
  21473. console.warn("Tried to update state on an invalid CCognosViewer",oCV);
  21474. }
  21475. return;
  21476. }
  21477. this.parent.updateViewerState.call(this,_127c);
  21478. var _127e=oCV.getStatus();
  21479. if(_127e!="fault"){
  21480. if(oCV.envParams["buxToolbarPayload"]){
  21481. oCV.setToolbar(eval(oCV.envParams["buxToolbarPayload"]));
  21482. delete oCV.envParams["buxToolbarPayload"];
  21483. }
  21484. if(oCV.envParams["buxContextMenuPayload"]){
  21485. oCV.setContextMenu(eval(oCV.envParams["buxContextMenuPayload"]));
  21486. delete oCV.envParams["buxContextMenuPayload"];
  21487. }
  21488. if(oCV.envParams.reportPrompts){
  21489. oCV.getViewerWidget().setPromptParametersRetrieved(true);
  21490. }
  21491. if(oCV.envParams.reRunObject){
  21492. var _127f=document.getElementById("formWarpRequest"+oCV.getId());
  21493. if(_127f["reRunObj"]){
  21494. _127f["reRunObj"].value=oCV.envParams.reRunObject;
  21495. }else{
  21496. _127f.appendChild(createHiddenFormField("reRunObj",oCV.envParams.reRunObject));
  21497. }
  21498. }
  21499. }
  21500. };
  21501. RequestHandler.prototype.processInitialResponse=function(_1280){
  21502. var oCV=this.getViewer();
  21503. var _1282=oCV.getViewerWidget();
  21504. if(_1282!=null){
  21505. if(_1282.shouldUseSavedReportInfo()){
  21506. oCV.envParams["rapReportInfo"]=_1282.getAttributeValue("rapReportInfo");
  21507. }
  21508. this.parent.processInitialResponse.call(this,_1280);
  21509. _1282.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
  21510. this.getViewer().renderTabs();
  21511. oCV.getPinFreezeManager().fromJSONString(_1282.getAttributeValue("PinFreezeInfo"));
  21512. var _1283=oCV.getStatus();
  21513. if(_1283!="working"&&_1283!="stillWorking"){
  21514. delete oCV.envParams["cv.outputKey"];
  21515. _1282.setXNodeId(null);
  21516. }
  21517. switch(_1283){
  21518. case "complete":
  21519. _1282.setOriginalFormFields(null);
  21520. this.postComplete();
  21521. break;
  21522. case "working":
  21523. case "stillWorking":
  21524. oCV.getWorkingDialog().show();
  21525. setTimeout(getCognosViewerObjectRefAsString(oCV.getId())+".executeCallback(\"wait\");",10);
  21526. break;
  21527. case "prompting":
  21528. _1282.hideToolbarAndContextMenu();
  21529. break;
  21530. case "fault":
  21531. if(this.isAuthenticationFault()){
  21532. this.onPassportTimeout();
  21533. }else{
  21534. this.onFault();
  21535. }
  21536. }
  21537. this.showReport();
  21538. this.onPostEntryComplete();
  21539. oCV.m_stateSet=true;
  21540. this.onAsynchStatusUpdate(_1283);
  21541. }else{
  21542. var _1284=this;
  21543. setTimeout(function(){
  21544. _1284.processInitialResponse(_1280);
  21545. },100);
  21546. }
  21547. };
  21548. RequestHandler.prototype.onPostEntryComplete=function(){
  21549. var oCV=this.getViewer();
  21550. if(oCV&&oCV.getViewerWidget()){
  21551. var _1286=oCV.getViewerWidget();
  21552. _1286.getLoadManager().processQueue();
  21553. }
  21554. };
  21555. RequestHandler.prototype.isMissingMemberException=function(oCV,_1288){
  21556. if(oCV.bMissingMemberException){
  21557. return true;
  21558. }
  21559. if(_1288&&_1288.getResponseState){
  21560. var _1289=_1288.getResponseState();
  21561. if(_1289&&_1289.envParams&&_1289.envParams.bMissingMemberException){
  21562. this._populateMissingMemberDetails(oCV,_1289);
  21563. return true;
  21564. }
  21565. }
  21566. return false;
  21567. };
  21568. RequestHandler.prototype._populateMissingMemberDetails=function(oCV,_128b){
  21569. if(!oCV||!_128b||!_128b.envParams){
  21570. return;
  21571. }
  21572. oCV.bCanEditContent=_128b.envParams.bCanEditContent;
  21573. oCV.bHasParameters=_128b.envParams.bHasParameters;
  21574. if(_128b.envParams["ui.spec"]){
  21575. if(oCV.envParams){
  21576. if(!oCV.envParams["ui.spec"]){
  21577. oCV.envParams["ui.spec"]=xml_decode(_128b.envParams["ui.spec"]);
  21578. }
  21579. }
  21580. }
  21581. };
  21582. RequestHandler.prototype.handleMissingMemberException=function(oCV){
  21583. var _128d=null;
  21584. _128d=(oCV.bCanEditContent)?RV_RES.IDS_JS_MISSING_MEMBER_ERROR_MSG_FOR_SPEC_PARAM:RV_RES.IDS_JS_MISSING_MEMBER_ERROR_MSG_WITH_NO_BUA;
  21585. var _128e=new MissingMemberFaultDialog(oCV,_128d,oCV.bCanEditContent,oCV.bHasParameters);
  21586. this.setFaultDialog(_128e);
  21587. };
  21588. RequestHandler.prototype.massageHtmlBeforeDisplayed=function(){
  21589. var oCV=this.getViewer();
  21590. if(!oCV){
  21591. return;
  21592. }
  21593. var _1290=oCV.getViewerWidget();
  21594. if(!_1290){
  21595. return;
  21596. }
  21597. _1290.updateDrillThroughLinks();
  21598. };
  21599. function BaseRequestExecutedIndicator(oCV){
  21600. this.m_oCV=oCV;
  21601. if(oCV){
  21602. this.m_oCVId=oCV.getId();
  21603. if(oCV.getViewerWidget()){
  21604. this.m_background=oCV.getViewerWidget().getReportBlocker();
  21605. }
  21606. }
  21607. };
  21608. BaseRequestExecutedIndicator.prototype=new IRequestIndicator();
  21609. BaseRequestExecutedIndicator.prototype.getViewer=function(){
  21610. return this.m_oCV;
  21611. };
  21612. BaseRequestExecutedIndicator.prototype.show=function(){
  21613. this.m_background.setClassNameOverride("report-blocker");
  21614. this.m_background.show();
  21615. };
  21616. BaseRequestExecutedIndicator.prototype.hide=function(){
  21617. if(this.m_background){
  21618. this.m_background.hide();
  21619. }
  21620. };
  21621. function RequestExecutedIndicator(oCV){
  21622. RequestExecutedIndicator.baseConstructor.call(this,oCV);
  21623. };
  21624. RequestExecutedIndicator.prototype=new BaseRequestExecutedIndicator();
  21625. RequestExecutedIndicator.baseConstructor=BaseRequestExecutedIndicator;
  21626. RequestExecutedIndicator.prototype.parent=BaseRequestExecutedIndicator.prototype;
  21627. RequestExecutedIndicator.prototype.show=function(){
  21628. var oCV=this.getViewer();
  21629. var cvid=oCV.getId();
  21630. var _1295=document.getElementById("executionCursor"+cvid);
  21631. var _1296=document.getElementById("formWarpRequest"+cvid);
  21632. if(!_1295&&_1296){
  21633. _1295=document.createElement("span");
  21634. _1295.className="executionCursor";
  21635. _1295.setAttribute("id","executionCursor"+cvid);
  21636. var _1297="<img alt=\"\" src=\""+oCV.getWebContentRoot()+"/rv/images/action_busy_32x32.gif"+"\"/>";
  21637. _1295.innerHTML=_1297;
  21638. _1296.appendChild(_1295);
  21639. }
  21640. this.parent.show.call(this);
  21641. };
  21642. RequestExecutedIndicator.prototype.hide=function(){
  21643. var _1298=document.getElementById("executionCursor"+this.getViewer().getId());
  21644. if(_1298!=null){
  21645. _1298.parentNode.removeChild(_1298);
  21646. }
  21647. this.parent.hide.call(this);
  21648. };
  21649. dojo.provide("WorkingDialog");
  21650. dojo.declare("WorkingDialog",IRequestIndicator,{constructor:function(oCV){
  21651. this.m_oCV=oCV;
  21652. this.m_sNamespace=oCV.getId();
  21653. this.m_sGateway=oCV.getGateway();
  21654. try{
  21655. var _129a=[];
  21656. if(oCV.getAdvancedServerProperty("VIEWER_JS_HIDE_CANCEL_BUTTON")!="true"){
  21657. _129a.push({"class":"icdDialogButton",label:RV_RES.CANCEL,onClick:dojo.hitch(this,this.doCancel)});
  21658. }
  21659. this.m_waitPageDialog=new ViewerIWidgetInlineDialog(this.getCognosViewer(),this.getWaitPageHTML(),_129a,"waitButtonContainer_"+this.getCognosViewer().getId());
  21660. }
  21661. catch(e){
  21662. if(console&&console.log){
  21663. console.log(e);
  21664. }
  21665. }
  21666. },setSimpleWorkingDialogFlag:function(flag){
  21667. },getCognosViewer:function(){
  21668. return this.m_oCV;
  21669. },show:function(){
  21670. this.m_waitPageDialog.show();
  21671. },getWaitPageHTML:function(){
  21672. var id=this.getCognosViewer().getId();
  21673. return "<table cellspacing=\"4\" cellpadding=\"0\" border=\"0\" wairole=\"presentation\" role=\"presentation\" style=\"width:100%;height:100%\">"+"<tbody><tr><td align=\"center\">"+"<div class=\"dijitInline widget_load_background\" role=\"presentation\" tabindex=\"0\">"+"<div id=\"working"+id+"\" class=\"widget_load\" aria-labelledby=\"working"+id+"\">"+RV_RES.IDS_JS_WAIT_PAGE_LOADING+"</div>"+"<div id=\"waitButtonContainer_"+id+"\" class=\"icdDialogButtonBar\" style=\"text-align:center;padding-left:12px;padding-right:12px;\"></div>"+"</div>"+"</td></tr></tbody>"+"</table>";
  21674. },hide:function(){
  21675. this.m_waitPageDialog.hide();
  21676. this.m_cancelCallback=null;
  21677. },setCancelCallback:function(_129d){
  21678. this.m_cancelCallback=_129d;
  21679. },doCancel:function(){
  21680. var oCV=this.getCognosViewer();
  21681. if(this.m_cancelCallback){
  21682. this.m_cancelCallback();
  21683. this.m_cancelCallback=null;
  21684. }else{
  21685. var _129f=oCV.cancel();
  21686. if(_129f){
  21687. var _12a0=oCV.getViewerWidget().getUndoRedoQueue();
  21688. if(_12a0){
  21689. _12a0.handleCancel();
  21690. }
  21691. }
  21692. }
  21693. if(oCV.isReportRenderingDone()){
  21694. this.hide();
  21695. }else{
  21696. var _12a1={action:"deleteWidget"};
  21697. oCV.getViewerWidget().iContext.iEvents.fireEvent("com.ibm.bux.widget.action",null,_12a1);
  21698. }
  21699. }});
  21700. dojo.provide("ModalFaultMessageDialog");
  21701. dojo.declare("ModalFaultMessageDialog",IFaultDialog,{m_errorMessage:"",m_errorDetails:"",constructor:function(_12a2,_12a3){
  21702. this.m_errorMessage=_12a2;
  21703. this.m_errorDetails=_12a3;
  21704. },getErrorMessage:function(){
  21705. return this.m_errorMessage;
  21706. },getDetails:function(){
  21707. return this.m_errorDetails;
  21708. },show:function(){
  21709. bux.messageBox(bux.MB_ERROR,this.getErrorMessage(),"",this.getDetails());
  21710. }});
  21711. dojo.provide("MissingMemberFaultDialog");
  21712. dojo.declare("MissingMemberFaultDialog",FaultDialog,{m_oCV:null,m_errorMessage:null,m_bHasBUACapability:false,m_bHasParameters:false,constructor:function(oCV,_12a5,_12a6,_12a7){
  21713. this.m_errorMessage=_12a5;
  21714. this.m_bHasBUACapability=_12a6;
  21715. this.m_bHasParameters=_12a7;
  21716. },getErrorMessage:function(){
  21717. return this.m_errorMessage;
  21718. },canRetryRequest:function(){
  21719. return false;
  21720. },getButtons:function(){
  21721. var _12a8=[];
  21722. if(this.m_bHasBUACapability){
  21723. _12a8.push({label:RV_RES.IDS_JS_EDIT,action:dojo.hitch(this,this.invokeEditContentAction)});
  21724. }
  21725. _12a8.push({label:RV_RES.IDS_JS_CLOSE,action:dojo.hitch(this,this.ok)});
  21726. return _12a8;
  21727. },invokeEditContentAction:function(){
  21728. var _12a9={};
  21729. _12a9.oFaultDialog=this;
  21730. _12a9.bHasParameters=this.m_bHasParameters;
  21731. this.m_oCV.executeAction("EditContent",{"MissingMemberRecoveryMode":_12a9});
  21732. }});
  21733. function ViewerDispatcher(){
  21734. this.m_activeRequest=null;
  21735. this.m_requestQueue=[];
  21736. this.m_bUsePageRequest=false;
  21737. };
  21738. ViewerDispatcher.prototype.getActiveRequest=function(){
  21739. return this.m_activeRequest;
  21740. };
  21741. ViewerDispatcher.prototype.setUsePageRequest=function(_12aa){
  21742. this.m_bUsePageRequest=_12aa;
  21743. };
  21744. ViewerDispatcher.prototype.getUsePageRequest=function(){
  21745. return this.m_bUsePageRequest;
  21746. };
  21747. ViewerDispatcher.prototype.dispatchRequest=function(_12ab){
  21748. if(this.m_activeRequest==null){
  21749. this.startRequest(_12ab);
  21750. }else{
  21751. if(_12ab.canBeQueued()==true){
  21752. this.m_requestQueue.push(_12ab);
  21753. }else{
  21754. if(window.cognosViewerDebug&&console&&console.warn){
  21755. console.warn("Warning! Dropped a dispatcher entry!");
  21756. }
  21757. }
  21758. }
  21759. };
  21760. ViewerDispatcher.prototype.startRequest=function(_12ac){
  21761. this.m_activeRequest=_12ac;
  21762. if(_12ac!=null){
  21763. _12ac.setUsePageRequest(this.m_bUsePageRequest);
  21764. _12ac.sendRequest();
  21765. }
  21766. };
  21767. ViewerDispatcher.prototype.cancelRequest=function(key){
  21768. for(var i=0;i<this.m_requestQueue.length;i++){
  21769. var _12af=this.m_requestQueue[i];
  21770. if(_12af.getKey()===key){
  21771. _12af.setCallbacks({"onEntryComplete":null});
  21772. _12af.cancelRequest(false);
  21773. this.m_requestQueue.splice(i,1);
  21774. i--;
  21775. }
  21776. }
  21777. if(this.m_activeRequest&&this.m_activeRequest.getKey()===key){
  21778. this.m_activeRequest.setCallbacks({"onEntryComplete":null});
  21779. this.m_activeRequest.cancelRequest(false);
  21780. this.requestComplete();
  21781. }
  21782. };
  21783. ViewerDispatcher.prototype.possibleUnloadEvent=function(){
  21784. if(this.m_activeRequest){
  21785. this.m_activeRequest.possibleUnloadEvent();
  21786. }
  21787. };
  21788. ViewerDispatcher.prototype.requestComplete=function(_12b0){
  21789. this.startRequest(this.nextRequest());
  21790. };
  21791. ViewerDispatcher.prototype.nextRequest=function(){
  21792. var _12b1=null;
  21793. if(this.m_requestQueue.length>0){
  21794. _12b1=this.m_requestQueue.shift();
  21795. if(_12b1.getKey()!=null){
  21796. while(this.m_requestQueue.length>0&&this.m_requestQueue[0].getKey()==_12b1.getKey()){
  21797. _12b1=this.m_requestQueue.shift();
  21798. }
  21799. }
  21800. }
  21801. return _12b1;
  21802. };
  21803. ViewerDispatcher.prototype.queueIsEmpty=function(){
  21804. return (this.m_requestQueue.length==0);
  21805. };
  21806. function DispatcherEntry(oCV){
  21807. this.m_oCV=oCV;
  21808. this.m_requestKey=null;
  21809. this.m_canBeQueued=false;
  21810. this.m_originalFormFields=null;
  21811. this.m_bUsePageRequest=false;
  21812. if(oCV){
  21813. if(!this.m_request){
  21814. this.m_request=new XmlHttpObject();
  21815. this.m_request.init("POST",this.m_oCV.getGateway(),"",true);
  21816. }
  21817. if(!this.m_requestHandler){
  21818. this.setRequestHandler(new BaseRequestHandler(oCV));
  21819. }
  21820. DispatcherEntry.prototype.setDefaultFormFields.call(this);
  21821. this.setCallbacks({"entryComplete":{"object":this,"method":this.onEntryComplete},"entryFault":{"object":this,"method":this.onEntryFault},"newRequest":{"object":this,"method":this.onNewRequest},"fault":{"object":this,"method":this.onFault},"error":{"object":this,"method":this.onError},"passportTimeout":{"object":this,"method":this.onPassportTimeout},"working":{"object":this,"method":this.onWorking},"prompting":{"object":this,"method":this.onPrompting},"preHttpRequest":{"object":this,"method":this.onPreHttpRequest},"postHttpRequest":{"object":this,"method":this.onPostHttpRequest},"postEntryComplete":{"object":this,"method":this.onPostEntryComplete}});
  21822. }
  21823. };
  21824. DispatcherEntry.prototype.setHeaders=function(_12b3){
  21825. this.m_request.setHeaders(_12b3);
  21826. };
  21827. DispatcherEntry.prototype.getHeaders=function(){
  21828. return this.m_request.getHeaders();
  21829. };
  21830. DispatcherEntry.prototype.setOriginalFormFields=function(_12b4){
  21831. this.m_originalFormFields=_12b4;
  21832. };
  21833. DispatcherEntry.prototype.getOriginalFormFields=function(){
  21834. return this.m_originalFormFields;
  21835. };
  21836. DispatcherEntry.prototype.setRequestHandler=function(_12b5){
  21837. _12b5.addCallbackHooks();
  21838. this.m_requestHandler=_12b5;
  21839. };
  21840. DispatcherEntry.prototype.getRequestHandler=function(){
  21841. return this.m_requestHandler;
  21842. };
  21843. DispatcherEntry.prototype.setWorkingDialog=function(_12b6){
  21844. if(this.getRequestHandler()){
  21845. this.m_requestHandler.setWorkingDialog(_12b6);
  21846. }
  21847. };
  21848. DispatcherEntry.prototype.setRequestIndicator=function(_12b7){
  21849. if(this.getRequestHandler()){
  21850. this.getRequestHandler().setRequestIndicator(_12b7);
  21851. }
  21852. };
  21853. DispatcherEntry.prototype.forceSynchronous=function(){
  21854. this.getRequest().forceSynchronous();
  21855. };
  21856. DispatcherEntry.prototype.setUsePageRequest=function(_12b8){
  21857. this.m_bUsePageRequest=_12b8;
  21858. };
  21859. DispatcherEntry.prototype.getUsePageRequest=function(){
  21860. return this.m_bUsePageRequest;
  21861. };
  21862. DispatcherEntry.prototype.setDefaultFormFields=function(){
  21863. var _12b9=this.getViewer().envParams;
  21864. this.addFormField("b_action","cognosViewer");
  21865. this.addFormField("cv.catchLogOnFault","true");
  21866. this.addDefinedNonNullFormField("protectParameters",_12b9["protectParameters"]);
  21867. this.addDefinedNonNullFormField("ui.routingServerGroup",_12b9["ui.routingServerGroup"]);
  21868. this.addDefinedNonNullFormField("cv.debugDirectory",_12b9["cv.debugDirectory"]);
  21869. this.addDefinedNonNullFormField("cv.showFaultPage",_12b9["cv.showFaultPage"]);
  21870. this.addDefinedNonNullFormField("cv.useRAPDrill",_12b9["cv.useRAPDrill"]);
  21871. this.addDefinedNonNullFormField("container",_12b9["container"]);
  21872. this.addNonEmptyStringFormField("cv.objectPermissions",_12b9["cv.objectPermissions"]);
  21873. };
  21874. DispatcherEntry.prototype.getViewer=function(){
  21875. return this.m_oCV;
  21876. };
  21877. DispatcherEntry.prototype.prepareRequest=function(){
  21878. };
  21879. DispatcherEntry.addWidgetInfoToFormFields=function(_12ba,_12bb){
  21880. if(_12ba){
  21881. var _12bc=_12ba.getBUXRTStateInfoMap();
  21882. if(_12bc){
  21883. _12bb.addFormField("cv.buxRTStateInfo",_12bc);
  21884. }
  21885. var _12bd=_12ba.getDisplayName();
  21886. if(_12bd&&_12bd.length>0){
  21887. _12bb.addFormField("displayTitle",_12bd);
  21888. }
  21889. }
  21890. };
  21891. DispatcherEntry.prototype.canBeQueued=function(){
  21892. return this.m_canBeQueued;
  21893. };
  21894. DispatcherEntry.prototype.setCanBeQueued=function(_12be){
  21895. this.m_canBeQueued=_12be;
  21896. };
  21897. DispatcherEntry.prototype.getKey=function(){
  21898. return this.m_requestKey;
  21899. };
  21900. DispatcherEntry.prototype.setKey=function(key){
  21901. this.m_requestKey=key;
  21902. };
  21903. DispatcherEntry.prototype.setRequest=function(_12c0){
  21904. this.m_request=_12c0;
  21905. };
  21906. DispatcherEntry.prototype.getRequest=function(){
  21907. return this.m_request;
  21908. };
  21909. DispatcherEntry.prototype.setCallbacks=function(_12c1){
  21910. this.getRequest().setCallbacks(_12c1);
  21911. };
  21912. DispatcherEntry.prototype.getCallbacks=function(){
  21913. return this.getRequest().getCallbacks();
  21914. };
  21915. DispatcherEntry.prototype.sendRequest=function(){
  21916. this.prepareRequest();
  21917. var _12c2=this.getRequest().getFormFields();
  21918. var _12c3=_12c2.keys();
  21919. if(!this.m_originalFormFields){
  21920. this.m_originalFormFields=new CDictionary();
  21921. for(var index=0;index<_12c3.length;index++){
  21922. this.m_originalFormFields.add(_12c3[index],_12c2.get(_12c3[index]));
  21923. }
  21924. }
  21925. this.getRequest().sendRequest();
  21926. };
  21927. DispatcherEntry.prototype.onNewRequest=function(_12c5){
  21928. this.setRequest(_12c5);
  21929. };
  21930. DispatcherEntry.prototype.retryRequest=function(){
  21931. var oCV=this.getViewer();
  21932. oCV.setRetryDispatcherEntry(null);
  21933. var _12c7=this.getRequest().newRequest();
  21934. _12c7.setHeaders(null);
  21935. this.setRequest(_12c7);
  21936. var _12c8=this.m_originalFormFields.keys();
  21937. for(var index=0;index<_12c8.length;index++){
  21938. var _12ca=_12c8[index];
  21939. var _12cb=this.m_originalFormFields.get(_12ca);
  21940. if(_12ca=="cv.responseFormat"&&_12cb=="iWidget"){
  21941. this.addFormField("cv.responseFormat","data");
  21942. }else{
  21943. if(_12ca=="ui.action"&&_12cb=="wait"){
  21944. this.addFormField("ui.action",this.m_originalFormFields.get("ui.primaryAction"));
  21945. }else{
  21946. if(_12ca!="m_tracking"&&_12ca!="cv.outputKey"){
  21947. this.addFormField(_12ca,_12cb);
  21948. }
  21949. }
  21950. }
  21951. }
  21952. this.addFormField("widget.reloadToolbar","true");
  21953. if(this.m_oCV.getViewerWidget()){
  21954. this.addFormField("cv.buxCurrentUserRole",this.m_oCV.getViewerWidget().getUserRole());
  21955. }
  21956. this.addNonEmptyStringFormField("cv.objectPermissions",oCV.envParams["cv.objectPermissions"]);
  21957. this.addNonEmptyStringFormField("limitedInteractiveMode",oCV.envParams["limitedInteractiveMode"]);
  21958. this.m_oCV.getViewerDispatcher().dispatchRequest(this);
  21959. };
  21960. DispatcherEntry.prototype.abortHttpRequest=function(){
  21961. if(!this.m_bCancelCalled){
  21962. if(this.getRequestHandler()){
  21963. this.getRequestHandler().onCancel();
  21964. }
  21965. this.m_bCancelCalled=true;
  21966. this.getRequest().abortHttpRequest();
  21967. this.onEntryComplete();
  21968. }
  21969. };
  21970. DispatcherEntry.prototype.cancelRequest=function(_12cc){
  21971. if(!this.m_bCancelCalled){
  21972. this.m_bCancelCalled=true;
  21973. if(this.getRequestHandler()){
  21974. this.getRequestHandler().onCancel();
  21975. }
  21976. if(_12cc){
  21977. this.getRequest().forceSynchronous();
  21978. }
  21979. this.getRequest().cancel();
  21980. this.onEntryComplete();
  21981. }
  21982. };
  21983. DispatcherEntry.prototype.getFormFields=function(){
  21984. return this.m_request.getFormFields();
  21985. };
  21986. DispatcherEntry.prototype.getFormField=function(name){
  21987. if(this.m_request){
  21988. return this.m_request.getFormField(name);
  21989. }else{
  21990. return "";
  21991. }
  21992. };
  21993. DispatcherEntry.prototype.clearFormFields=function(){
  21994. this.m_request.clearFormFields();
  21995. };
  21996. DispatcherEntry.prototype.formFieldExists=function(name){
  21997. if(this.m_request){
  21998. return this.m_request.getFormFields().exists(name);
  21999. }
  22000. return false;
  22001. };
  22002. DispatcherEntry.prototype.removeFormField=function(name){
  22003. if(this.formFieldExists(name)){
  22004. this.m_request.getFormFields().remove(name);
  22005. }
  22006. };
  22007. DispatcherEntry.prototype.addFormField=function(name,value){
  22008. this.m_request.addFormField(name,value);
  22009. };
  22010. DispatcherEntry.prototype.addDefinedNonNullFormField=function(name,value){
  22011. if(typeof value!="undefined"&&value!=null){
  22012. this.addFormField(name,value);
  22013. }
  22014. };
  22015. DispatcherEntry.prototype.addDefinedFormField=function(name,value){
  22016. if(typeof value!="undefined"){
  22017. this.addFormField(name,value);
  22018. }
  22019. };
  22020. DispatcherEntry.prototype.addNonNullFormField=function(name,value){
  22021. if(value!=null){
  22022. this.addFormField(name,value);
  22023. }
  22024. };
  22025. DispatcherEntry.prototype.addNonEmptyStringFormField=function(name,value){
  22026. if(typeof value!="undefined"&&value!=null&&value!=""){
  22027. this.addFormField(name,value);
  22028. }
  22029. };
  22030. DispatcherEntry.prototype.onWorking=function(_12da,arg1){
  22031. if(this.getRequestHandler()){
  22032. this.getRequestHandler().onWorking(_12da);
  22033. }
  22034. };
  22035. DispatcherEntry.prototype.onFault=function(_12dc){
  22036. if(this.getRequestHandler()){
  22037. this.getRequestHandler().onFault(_12dc);
  22038. }
  22039. };
  22040. DispatcherEntry.prototype.onError=function(_12dd){
  22041. if(this.m_bCancelCalled){
  22042. return;
  22043. }
  22044. if(this.getRequestHandler()){
  22045. this.getRequestHandler().onError(_12dd);
  22046. }
  22047. };
  22048. DispatcherEntry.prototype.possibleUnloadEvent=function(){
  22049. this.setCallbacks({"error":{}});
  22050. };
  22051. DispatcherEntry.prototype.onPreHttpRequest=function(_12de){
  22052. if(this.getRequestHandler()){
  22053. this.getRequestHandler().preHttpRequest(_12de);
  22054. }
  22055. };
  22056. DispatcherEntry.prototype.onPostHttpRequest=function(_12df){
  22057. if(this.getRequestHandler()){
  22058. this.getRequestHandler().postHttpRequest(_12df);
  22059. }
  22060. };
  22061. DispatcherEntry.prototype.onPassportTimeout=function(_12e0){
  22062. if(this.getRequestHandler()){
  22063. this.getRequestHandler().onPassportTimeout(_12e0);
  22064. }
  22065. };
  22066. DispatcherEntry.prototype.onPrompting=function(_12e1){
  22067. if(this.getRequestHandler()){
  22068. this.getRequestHandler().onPrompting(_12e1);
  22069. }
  22070. };
  22071. DispatcherEntry.prototype.onEntryComplete=function(_12e2){
  22072. if(!this.m_oCV._beingDestroyed){
  22073. this.m_oCV.getViewerDispatcher().requestComplete(this);
  22074. }
  22075. };
  22076. DispatcherEntry.prototype.onEntryFault=function(_12e3){
  22077. this.m_oCV.setFaultDispatcherEntry(this);
  22078. this.m_oCV.resetViewerDispatcher();
  22079. if(!this.m_bCancelCalled){
  22080. this.m_oCV.setRetryDispatcherEntry(this);
  22081. }
  22082. };
  22083. DispatcherEntry.prototype.onCloseErrorDlg=function(){
  22084. var _12e4=this.getCallbacks();
  22085. if(_12e4["closeErrorDlg"]){
  22086. var _12e5=GUtil.generateCallback(_12e4["closeErrorDlg"].method,[],_12e4["closeErrorDlg"].object);
  22087. _12e5();
  22088. }
  22089. };
  22090. DispatcherEntry.prototype.onPostEntryComplete=function(){
  22091. if(this.getRequestHandler()){
  22092. this.getRequestHandler().onPostEntryComplete();
  22093. }
  22094. this.executeCallback("postComplete");
  22095. };
  22096. DispatcherEntry.prototype.executeCallback=function(_12e6){
  22097. var _12e7=this.getCallbacks();
  22098. if(_12e7[_12e6]){
  22099. var _12e8=(_12e7.customArguments)?[this,_12e7.customArguments]:[this];
  22100. var _12e9=GUtil.generateCallback(_12e7[_12e6].method,_12e8,_12e7[_12e6].object);
  22101. _12e9();
  22102. return true;
  22103. }
  22104. return false;
  22105. };
  22106. function DataDispatcherEntry(oCV){
  22107. if(oCV){
  22108. this.setRequest(new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot()));
  22109. }
  22110. DataDispatcherEntry.baseConstructor.call(this,oCV);
  22111. };
  22112. DataDispatcherEntry.prototype=new DispatcherEntry();
  22113. DataDispatcherEntry.baseConstructor=DispatcherEntry;
  22114. function JSONDispatcherEntry(oCV){
  22115. if(oCV){
  22116. this.setRequest(new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot()));
  22117. }
  22118. JSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
  22119. JSONDispatcherEntry.baseConstructor.call(this,oCV);
  22120. };
  22121. JSONDispatcherEntry.prototype=new DispatcherEntry();
  22122. JSONDispatcherEntry.baseConstructor=DispatcherEntry;
  22123. JSONDispatcherEntry.prototype.setDefaultFormFields=function(){
  22124. this.addFormField("cv.responseFormat","JSON");
  22125. };
  22126. function AsynchDataDispatcherEntry(oCV){
  22127. if(oCV){
  22128. var _12ed=new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot());
  22129. this.setRequest(_12ed);
  22130. AsynchDataDispatcherEntry.baseConstructor.call(this,oCV);
  22131. AsynchDataDispatcherEntry.prototype.setDefaultFormFields.call(this);
  22132. }
  22133. };
  22134. AsynchDataDispatcherEntry.prototype=new DispatcherEntry();
  22135. AsynchDataDispatcherEntry.baseConstructor=DispatcherEntry;
  22136. AsynchDataDispatcherEntry.prototype.setDefaultFormFields=function(){
  22137. this.addFormField("cv.responseFormat","data");
  22138. };
  22139. function AsynchJSONDispatcherEntry(oCV){
  22140. if(oCV){
  22141. var _12ef=new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot());
  22142. this.setRequest(_12ef);
  22143. AsynchJSONDispatcherEntry.baseConstructor.call(this,oCV);
  22144. AsynchJSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
  22145. }
  22146. };
  22147. AsynchJSONDispatcherEntry.prototype=new DispatcherEntry();
  22148. AsynchJSONDispatcherEntry.baseConstructor=DispatcherEntry;
  22149. AsynchJSONDispatcherEntry.prototype.setDefaultFormFields=function(){
  22150. this.addFormField("cv.responseFormat","asynchJSON");
  22151. };
  22152. function ReportDispatcherEntry(oCV){
  22153. ReportDispatcherEntry.baseConstructor.call(this,oCV);
  22154. if(oCV){
  22155. ReportDispatcherEntry.prototype.setDefaultFormFields.call(this);
  22156. this.setRequestHandler(new RequestHandler(oCV));
  22157. this.setWorkingDialog(oCV.getWorkingDialog());
  22158. this.setRequestIndicator(oCV.getRequestIndicator());
  22159. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onComplete}});
  22160. }
  22161. };
  22162. ReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
  22163. ReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
  22164. ReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
  22165. ReportDispatcherEntry.prototype.prepareRequest=function(){
  22166. var _12f1=this.getFormField("ui.action");
  22167. var _12f2=this.getViewer().getActionState();
  22168. if(_12f2!==""&&(_12f1=="wait"||_12f1=="forward"||_12f1=="back")){
  22169. this.addFormField("cv.actionState",_12f2);
  22170. }
  22171. var _12f3=["nextPage","previousPage","firstPage","lastPage","reportAction","cancel","wait"];
  22172. var _12f4=true;
  22173. for(var i=0;i<_12f3.length;i++){
  22174. if(_12f3[i]==_12f1){
  22175. _12f4=false;
  22176. break;
  22177. }
  22178. }
  22179. if(_12f4){
  22180. this.getViewer().clearTabs();
  22181. }
  22182. if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")&&this.getViewer().getStatus()!="prompting"){
  22183. this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
  22184. }
  22185. };
  22186. ReportDispatcherEntry.prototype.setDefaultFormFields=function(){
  22187. var oCV=this.getViewer();
  22188. var _12f7=oCV.envParams;
  22189. this.addFormField("cv.id",oCV.getId());
  22190. if(_12f7["cv.showFaultPage"]){
  22191. this.addFormField("cv.showFaultPage",_12f7["cv.showFaultPage"]);
  22192. }else{
  22193. this.addFormField("cv.showFaultPage","false");
  22194. }
  22195. this.addDefinedNonNullFormField("ui.object",_12f7["ui.object"]);
  22196. this.addDefinedNonNullFormField("ui.primaryAction",_12f7["ui.primaryAction"]);
  22197. this.addDefinedNonNullFormField("ui.objectClass",_12f7["ui.objectClass"]);
  22198. this.addNonEmptyStringFormField("specificationType",_12f7["specificationType"]);
  22199. this.addNonEmptyStringFormField("cv.promptForDownload",_12f7["cv.promptForDownload"]);
  22200. this.addNonEmptyStringFormField("ui.conversation",oCV.getConversation());
  22201. this.addNonEmptyStringFormField("m_tracking",oCV.getTracking());
  22202. var _12f8=oCV.getExecutionParameters();
  22203. this.addNonEmptyStringFormField("executionParameters",_12f8);
  22204. var sCAF=oCV.getCAFContext();
  22205. this.addDefinedNonNullFormField("ui.cafcontextid",sCAF);
  22206. };
  22207. ReportDispatcherEntry.prototype.onWorking=function(_12fa,arg1){
  22208. var _12fc=_12fa.getResponseState();
  22209. var _12fd=this.getRequestHandler();
  22210. if(_12fd){
  22211. var _12fe=_12fd.getWorkingDialog();
  22212. if(_12fe&&_12fe.setSecondaryRequests&&_12fc.m_aSecRequests){
  22213. _12fe.setSecondaryRequests(_12fc.m_aSecRequests);
  22214. }
  22215. }
  22216. DispatcherEntry.prototype.onWorking.call(this,_12fa,arg1);
  22217. if(_12fd){
  22218. this.getRequestHandler().updateViewerState(_12fc);
  22219. }
  22220. };
  22221. ReportDispatcherEntry.prototype.onComplete=function(_12ff,arg1){
  22222. if(this.getRequestHandler()){
  22223. this.getRequestHandler().onComplete(_12ff);
  22224. }
  22225. };
  22226. function ViewerDispatcherEntry(oCV){
  22227. ViewerDispatcherEntry.baseConstructor.call(this,oCV);
  22228. if(oCV){
  22229. ViewerDispatcherEntry.prototype.setDefaultFormFields.call(this);
  22230. this.setCallbacks({"prompting":{"object":this,"method":this.onPrompting}});
  22231. var _1302=oCV.getViewerWidget();
  22232. if(_1302.m_originalFormFields){
  22233. this.setOriginalFormFields(_1302.m_originalFormFields);
  22234. _1302.m_originalFormFields=null;
  22235. }
  22236. }
  22237. };
  22238. ViewerDispatcherEntry.prototype=new ReportDispatcherEntry();
  22239. ViewerDispatcherEntry.baseConstructor=ReportDispatcherEntry;
  22240. ViewerDispatcherEntry.prototype.parent=ReportDispatcherEntry.prototype;
  22241. ViewerDispatcherEntry.prototype.prepareRequest=function(){
  22242. this.parent.prepareRequest.call(this);
  22243. var _1303=this.getViewer().getViewerWidget();
  22244. if(this.getFormField("widget.reloadToolbar")){
  22245. this.addFormField("cv.buxCurrentUserRole",_1303.getUserRole());
  22246. }
  22247. if(_1303){
  22248. DispatcherEntry.addWidgetInfoToFormFields(_1303,this);
  22249. }
  22250. this.getViewer().inlineScriptsDoneExecuting=false;
  22251. };
  22252. ViewerDispatcherEntry.prototype.setDefaultFormFields=function(){
  22253. var oCV=this.getViewer();
  22254. var _1305=oCV.getViewerWidget();
  22255. var _1306=oCV.envParams;
  22256. this.addFormField("bux","true");
  22257. this.addFormField("cv.showFaultPage","false");
  22258. this.addDefinedNonNullFormField("baseReportModificationTime",_1306["baseReportModificationTime"]);
  22259. this.addDefinedNonNullFormField("originalReport",_1306["originalReport"]);
  22260. this.addDefinedNonNullFormField("ui.reportDrop",_1306["ui.reportDrop"]);
  22261. this.addDefinedNonNullFormField("ui.preserveRapTags",_1306["ui.preserveRapTags"]);
  22262. if(_1305.getProperties()){
  22263. var _1307=_1305.getProperties().getFlashCharts();
  22264. if(_1307!=null){
  22265. this.addDefinedNonNullFormField("savedFlashChartOption",_1307);
  22266. if(_1306.hasAVSChart){
  22267. this.addDefinedNonNullFormField("hasAVSChart",_1306.hasAVSChart);
  22268. }else{
  22269. this.addDefinedNonNullFormField("hasAVSChart",oCV.hasAVSChart());
  22270. }
  22271. }
  22272. }
  22273. var _1308=_1305.getAttributeValue("gateway");
  22274. if(_1308){
  22275. this.addDefinedNonNullFormField("cv.gateway",_1308);
  22276. }
  22277. var _1309=_1305.getAttributeValue("webcontent");
  22278. if(_1309){
  22279. this.addDefinedNonNullFormField("cv.webcontent",_1309);
  22280. }
  22281. if(oCV.envParams["cv.outputKey"]){
  22282. this.addFormField("cv.outputKey",oCV.envParams["cv.outputKey"]);
  22283. this.addFormField("b_action","cvx.high");
  22284. delete oCV.envParams["cv.outputKey"];
  22285. }
  22286. if(_1305.getXNodeId()){
  22287. this.setHeaders({"X-Node-ID":_1305.getXNodeId()});
  22288. _1305.setXNodeId(null);
  22289. }
  22290. };
  22291. ViewerDispatcherEntry.prototype.onPrompting=function(_130a){
  22292. if(this.getRequestHandler()){
  22293. this.getRequestHandler().onPrompting(_130a);
  22294. }
  22295. };
  22296. function Blocker(oCVId){
  22297. this.oCV_Id=oCVId;
  22298. this.m_viewerDiv=dojo.byId("RVContent"+this.oCV_Id);
  22299. this.m_containerDiv=this._findContainerDiv();
  22300. this.initialize();
  22301. };
  22302. Blocker.prototype._findContainerDiv=function(){
  22303. var _130c=null;
  22304. if(!this.m_containerDiv){
  22305. _130c=this.m_viewerDiv;
  22306. while(_130c){
  22307. if(_130c.style&&_130c.style.height&&_130c.style.height.indexOf("px")!=-1){
  22308. return _130c;
  22309. }
  22310. _130c=_130c.parentNode;
  22311. }
  22312. }
  22313. if(typeof console!="undefined"&&console&&console.log){
  22314. console.log("ViewerIWidgetInlineDialog: Could not find the container div for showing the dialog.");
  22315. }
  22316. return this.m_viewerDiv;
  22317. };
  22318. Blocker.prototype.setClassNameOverride=function(_130d){
  22319. if(!_130d){
  22320. return;
  22321. }
  22322. this.m_classNameOverride=_130d;
  22323. this.applyClassNameOverride();
  22324. };
  22325. Blocker.prototype.applyClassNameOverride=function(){
  22326. if(!this.m_classNameOverride||!this.m_background){
  22327. return;
  22328. }
  22329. dojo.removeClass(this.m_background);
  22330. dojo.addClass(this.m_background,this.m_classNameOverride);
  22331. };
  22332. Blocker.prototype.getNode=function(){
  22333. return this.m_background;
  22334. };
  22335. Blocker.prototype.initialize=function(){
  22336. if(!this.m_background){
  22337. this.m_background=dojo.byId("BACKGROUND"+this.oCV_Id);
  22338. if(!this.m_background){
  22339. this.m_background=document.createElement("div");
  22340. this.m_background.id="BACKGROUND"+this.oCV_Id;
  22341. this.m_background.className="report-blocker";
  22342. this.m_background.tabIndex="0";
  22343. dojo.place(this.m_background,this.m_containerDiv,"before");
  22344. }
  22345. }
  22346. };
  22347. Blocker.prototype.show=function(){
  22348. if(this.m_background){
  22349. this.m_background.style.display="block";
  22350. }
  22351. };
  22352. Blocker.prototype.hide=function(){
  22353. if(this.m_background){
  22354. this.m_background.style.display="none";
  22355. }
  22356. };
  22357. Blocker.prototype.destroy=function(){
  22358. if(this.m_background!=null){
  22359. this.m_background.parentNode.removeChild(this.m_background);
  22360. this.m_background=null;
  22361. }
  22362. };
  22363. function ReselectAction(oCV,_130f){
  22364. this.m_aSelectionFilterObjects=_130f;
  22365. this.m_oCV=oCV;
  22366. this.m_oSC=oCV.getSelectionController();
  22367. this.m_cd=this.m_oSC.getCCDManager().m_cd;
  22368. this.m_md=this.m_oSC.getCCDManager().m_md;
  22369. this.m_nReportDiv=oCV.getReportDiv();
  22370. this.m_oRAPReportContainers=oCV.getRAPReportInfo().getContainers();
  22371. };
  22372. ReselectAction.prototype.executeAction=function(){
  22373. this.mapCdMd();
  22374. if(this.show()){
  22375. var oVW=this.m_oCV.getViewerWidget();
  22376. if(oVW){
  22377. var _1311=oVW.m_oWidgetContextManager.genSelectionPayload(this.m_oCV,oVW.getWidgetId());
  22378. oVW.setSelectionFilterSent(true);
  22379. oVW.fireEvent("com.ibm.bux.data.filterCache.init",null,_1311);
  22380. if(oVW.isPastedWidget()&&!oVW.pastedSelectedBroadcasted){
  22381. oVW.pastedSelectedBroadcasted=true;
  22382. oVW.onSelectionChange();
  22383. }
  22384. }
  22385. }
  22386. };
  22387. ReselectAction.prototype.mapCdMd=function(){
  22388. var _1312=this.m_aSelectionFilterObjects;
  22389. for(var i in _1312){
  22390. var _1314=_1312[i];
  22391. var oItem=_1314.selectedItem;
  22392. var aCtx=[];
  22393. var _1317=null;
  22394. var _1318=this._findMdIndex("q",_1314.query);
  22395. _1317=this._setNewCtx(oItem,_1318);
  22396. if(_1317){
  22397. aCtx.push(_1317);
  22398. }else{
  22399. continue;
  22400. }
  22401. for(var j in _1314.context){
  22402. var _131a=_1314.context[j];
  22403. _1317=this._setNewCtx(_131a,_1318);
  22404. if(_1317){
  22405. aCtx.push(_1317);
  22406. }
  22407. }
  22408. _1314.ctxArray=aCtx;
  22409. }
  22410. };
  22411. ReselectAction.prototype._setNewCtx=function(oItem,_131c){
  22412. var _131d=null;
  22413. var ctxId=null;
  22414. if(oItem.isMeasure==="true"){
  22415. _131d=this._findMdIndex(oItem.mdProperty,oItem.mdValue,_131c);
  22416. if(_131d){
  22417. oItem.ctxRef={"property":oItem.mdProperty,"mdIndex":_131d};
  22418. return oItem.ctxRef;
  22419. }
  22420. }else{
  22421. if(oItem.mun){
  22422. _131d=this._findMdIndex("m",oItem.mun,_131c);
  22423. ctxId=this._getContextIdForCdProperty(_131c,"m",_131d);
  22424. }else{
  22425. _131d=this._findMdIndex(oItem.mdProperty,oItem.mdValue,_131c);
  22426. ctxId=this._getContextIdForCdPropertyAndMdProperty(_131c,"u",oItem.use,oItem.mdProperty,_131d);
  22427. }
  22428. if(ctxId){
  22429. oItem.ctxId=ctxId;
  22430. return oItem.ctxId;
  22431. }
  22432. }
  22433. return null;
  22434. };
  22435. ReselectAction.prototype._getContextIdForCdProperty=function(_131f,_1320,_1321){
  22436. var ctxid=null;
  22437. for(var j in this.m_cd){
  22438. if(this.m_cd[j].q==_131f&&this.m_cd[j][_1320]==_1321){
  22439. ctxid=j;
  22440. break;
  22441. }
  22442. }
  22443. return ctxid;
  22444. };
  22445. ReselectAction.prototype._getContextIdForCdPropertyAndMdProperty=function(_1324,_1325,_1326,_1327,_1328){
  22446. var ctxid=null;
  22447. for(var j in this.m_cd){
  22448. if(this.m_cd[j].q==_1324&&this.m_cd[j][_1327]==_1328&&this.m_cd[j][_1325]==_1326){
  22449. ctxid=j;
  22450. break;
  22451. }
  22452. }
  22453. return ctxid;
  22454. };
  22455. ReselectAction.prototype._findMdIndex=function(_132b,value,_132d){
  22456. var _132e=null;
  22457. for(var j in this.m_md){
  22458. if(this.m_md[j][_132b]===value){
  22459. if(this.m_md[j]["q"]&&_132d){
  22460. if(this.m_md[j]["q"]==_132d){
  22461. _132e=j;
  22462. break;
  22463. }
  22464. }else{
  22465. _132e=j;
  22466. break;
  22467. }
  22468. }
  22469. }
  22470. return _132e;
  22471. };
  22472. ReselectAction.prototype.show=function(){
  22473. var _1330=false;
  22474. var oCV=this.m_oCV;
  22475. var oVW=oCV.getViewerWidget();
  22476. var _1333=oCV.getReportDiv();
  22477. var _1334=null;
  22478. var _1335=null;
  22479. var _1336=null;
  22480. oVW.preprocessPageClicked(false);
  22481. if(oVW&&_1333){
  22482. for(var _1337 in this.m_aSelectionFilterObjects){
  22483. var _1338=this.m_aSelectionFilterObjects[_1337];
  22484. var _1339=(_1338.selectedItem.isMeasure==="true");
  22485. var _133a=true;
  22486. if(_1339){
  22487. var _133b=_1338.context;
  22488. for(var idx in _133b){
  22489. if(_133b[idx].isMeasure!=="true"){
  22490. _133a=false;
  22491. break;
  22492. }
  22493. }
  22494. if(_133a){
  22495. continue;
  22496. }
  22497. }
  22498. var aCtx=_1338.ctxArray;
  22499. if(aCtx&&aCtx.length>0){
  22500. _1334=this._getLayoutContainers(_1338.lid);
  22501. var _133e=false;
  22502. for(var _133f=0;!_133e&&_133f<_1334.length;_133f++){
  22503. if(/img|IMG/.test(_1334[_133f].tagName)){
  22504. var _1340=_1334[_133f];
  22505. for(_1336=null;!_1336&&_1340.parentNode;){
  22506. _1340=_1340.parentNode;
  22507. var _1341=_1340.getElementsByTagName("map");
  22508. if(_1341&&_1341.length>0){
  22509. _1336=_1341[0];
  22510. }
  22511. }
  22512. }else{
  22513. _1336=_1334[_133f].parentNode;
  22514. }
  22515. if(_1336){
  22516. var _1342=this._buildCtxQueryRegExp(aCtx);
  22517. _1335=getElementsByAttribute(_1336,"*","ctx",null,-1,_1342);
  22518. var _1343=_1338.selectedItem;
  22519. for(var idx in _1335){
  22520. if(_1335[idx].getAttribute){
  22521. if(_1339&&_1343.isDataValueOrChartElement==="false"&&(_1335[idx].getAttribute("type")==="datavalue"||_1335[idx].getAttribute("type")==="chartElement")){
  22522. continue;
  22523. }
  22524. if(this.isMatchingCell(aCtx,_1335[idx])){
  22525. var _1344=_1335[idx];
  22526. if(_1344.tagName==="SPAN"||_1344.tagName==="span"){
  22527. var _1345=_1344.parentNode.tagName;
  22528. if(_1345=="td"||_1345=="TD"||_1345=="TH"||_1345=="th"){
  22529. if(_1344.parentNode.getAttribute("ctx")==_1344.getAttribute("ctx")){
  22530. continue;
  22531. }
  22532. }
  22533. }
  22534. var evt={"target":_1344,"button":1,"ctrlKey":true};
  22535. this.m_oSC.pageClicked(evt);
  22536. _133e=true;
  22537. _1330=true;
  22538. }
  22539. }
  22540. }
  22541. }
  22542. }
  22543. }
  22544. }
  22545. }
  22546. return _1330;
  22547. };
  22548. ReselectAction.prototype.isMatchingCell=function(aCtx,_1348){
  22549. var _1349=_1348.getAttribute("ctx");
  22550. if(!_1349||_1349.length==0){
  22551. return false;
  22552. }
  22553. var _134a=_1349.replace(/::/g,":").split(":");
  22554. var _134b=0;
  22555. var _134c=null;
  22556. var _134d=0;
  22557. var _134e=null;
  22558. var _134f=0;
  22559. var _1350=false;
  22560. for(;_134b<_134a.length;_134b++){
  22561. if(_134a[_134b].length>0){
  22562. _134c=_134a[_134b++];
  22563. break;
  22564. }
  22565. }
  22566. _134e=aCtx[_134d];
  22567. if(typeof _134e=="string"){
  22568. if(_134e==_134c){
  22569. _134f++;
  22570. }
  22571. }else{
  22572. if(this.m_cd[_134c][_134e.property]==_134e.mdIndex){
  22573. _134f++;
  22574. }
  22575. }
  22576. if(_134f!=1){
  22577. return false;
  22578. }
  22579. if(aCtx.length==1){
  22580. _1350=true;
  22581. }
  22582. for(_134d=1;!_1350&&_134d<aCtx.length;_134d++){
  22583. _134e=aCtx[_134d];
  22584. if(typeof _134e=="string"){
  22585. for(_134b=1;_134b<_134a.length;_134b++){
  22586. if(_134a[_134b].length>0&&_134a[_134b]!="0"){
  22587. _134c=_134a[_134b];
  22588. if(_134e==_134c){
  22589. _134f++;
  22590. _134a[_134b]="0";
  22591. break;
  22592. }
  22593. }
  22594. }
  22595. }else{
  22596. for(_134b=1;_134b<_134a.length;_134b++){
  22597. if(_134a[_134b].length>0&&_134a[_134b]!="0"){
  22598. _134c=_134a[_134b];
  22599. if(this.m_cd[_134c][_134e.property]==_134e.mdIndex){
  22600. _134f++;
  22601. _134a[_134b]="0";
  22602. break;
  22603. }
  22604. }
  22605. }
  22606. }
  22607. if(aCtx.length==_134f){
  22608. _1350=true;
  22609. }
  22610. }
  22611. return _1350;
  22612. };
  22613. ReselectAction.prototype._buildCtxQueryRegExp=function(aCtx){
  22614. var _1352="";
  22615. var _1353=false;
  22616. var i=0;
  22617. if(typeof aCtx[i]=="string"){
  22618. _1352+="^"+aCtx[i];
  22619. }else{
  22620. _1352+="^[\\d:]+";
  22621. }
  22622. i++;
  22623. var _1355="";
  22624. for(;!_1353&&i<aCtx.length;i++){
  22625. if(typeof aCtx[i]=="string"){
  22626. if(_1355.length>0){
  22627. _1355+="+";
  22628. }
  22629. _1355+=aCtx[i];
  22630. _1353=true;
  22631. }else{
  22632. if(i<aCtx.length-1){
  22633. if(_1355.length>0){
  22634. _1355+="+";
  22635. }
  22636. _1355+="[\\d:]";
  22637. }
  22638. }
  22639. }
  22640. if(_1355.length>0){
  22641. _1352+=":{1,}"+_1355;
  22642. }
  22643. return new RegExp(_1352);
  22644. };
  22645. ReselectAction.prototype._getLayoutContainers=function(sLid){
  22646. var _1357="";
  22647. if(this.m_oRAPReportContainers&&this.m_oRAPReportContainers[sLid]){
  22648. _1357=sLid+".+";
  22649. }else{
  22650. for(var name in this.m_oRAPReportContainers){
  22651. if(_1357.length>0){
  22652. _1357+="|";
  22653. }
  22654. _1357+=name+".+";
  22655. }
  22656. }
  22657. return getElementsByAttribute(this.m_nReportDiv,"*","lid",null,-1,new RegExp(_1357));
  22658. };
  22659. function ViewerA11YHelper(oCV){
  22660. this.m_oCV=oCV;
  22661. };
  22662. ViewerA11YHelper.prototype.onFocus=function(evt){
  22663. var _135b=getCrossBrowserNode(evt);
  22664. _135b=ViewerA11YHelper.findChildOfTableCell(_135b);
  22665. this.updateCellAccessibility(_135b,false);
  22666. };
  22667. ViewerA11YHelper.prototype.onKeyDown=function(evt){
  22668. evt=(evt)?evt:((event)?event:null);
  22669. var _135d=getCrossBrowserNode(evt);
  22670. if(ViewerA11YHelper.isTableCell(_135d)){
  22671. for(var i=0;i<_135d.childNodes.length;i++){
  22672. if(_135d.childNodes[i].nodeName.toLowerCase()=="span"){
  22673. _135d=_135d.childNodes[i];
  22674. break;
  22675. }
  22676. }
  22677. }
  22678. if(!this.isValidNodeToSelect(_135d)){
  22679. return true;
  22680. }
  22681. _135d=ViewerA11YHelper.findChildOfTableCell(_135d);
  22682. if(_135d){
  22683. if(evt.keyCode=="39"){
  22684. if(this.m_oCV.getState()&&this.m_oCV.getState().getFindState()&&evt.ctrlKey&&evt.shiftKey){
  22685. this.m_oCV.executeAction("FindNext");
  22686. }else{
  22687. this.moveRight(_135d);
  22688. }
  22689. return stopEventBubble(evt);
  22690. }else{
  22691. if(evt.keyCode=="37"){
  22692. this.moveLeft(_135d);
  22693. return stopEventBubble(evt);
  22694. }else{
  22695. if(evt.keyCode=="38"){
  22696. this.moveUp(_135d);
  22697. return stopEventBubble(evt);
  22698. }else{
  22699. if(evt.keyCode=="40"){
  22700. this.moveDown(_135d);
  22701. return stopEventBubble(evt);
  22702. }else{
  22703. if(evt.keyCode=="13"){
  22704. if(this.m_oCV.isBux){
  22705. if(this.m_oCV.getViewerWidget().isSelectionFilterEnabled()){
  22706. this.m_oCV.getViewerWidget().preprocessPageClicked(false,evt);
  22707. if(this.m_oCV.getSelectionController().pageClicked(evt)!==false){
  22708. this.m_oCV.JAWSTalk(RV_RES.IDS_JS_SELECTION_FILTER_INFO_JAWS);
  22709. this.m_oCV.getViewerWidget().updateToolbar();
  22710. }
  22711. }else{
  22712. this.m_oCV.getSelectionController().pageClicked(evt);
  22713. var _135f=this.m_oCV.getActionFactory().load("Selection");
  22714. _135f.onKeyDown(evt);
  22715. }
  22716. this.m_oCV.getViewerWidget().onSelectionChange();
  22717. }else{
  22718. this.m_oCV.de(evt);
  22719. }
  22720. }else{
  22721. if(evt.keyCode=="32"){
  22722. if(this.m_oCV.isBux){
  22723. this.m_oCV.getViewerWidget().preprocessPageClicked(false);
  22724. if(this.m_oCV.getSelectionController().pageClicked(evt)!==false&&this.m_oCV.getViewerWidget().isSelectionFilterEnabled()){
  22725. this.m_oCV.JAWSTalk(RV_RES.IDS_JS_SELECTION_FILTER_INFO_JAWS);
  22726. }
  22727. this.m_oCV.getViewerWidget().updateToolbar();
  22728. this.m_oCV.getViewerWidget().onSelectionChange();
  22729. }else{
  22730. this.m_oCV.getSelectionController().pageClicked(evt);
  22731. }
  22732. return stopEventBubble(evt);
  22733. }else{
  22734. if(evt.keyCode=="46"&&this.m_oCV.isBux){
  22735. if(typeof this.m_oCV.envParams!="undefined"&&typeof this.m_oCV.envParams["ui.action"]!="undefined"&&this.m_oCV.envParams["ui.action"]!="view"&&!this.m_oCV.isLimitedInteractiveMode()){
  22736. var _1360=this.m_oCV.getActionFactory().load("Delete");
  22737. if(!this.m_oCV.isBlacklisted("Delete")&&_1360.canDelete()){
  22738. _1360.execute();
  22739. return stopEventBubble(evt);
  22740. }
  22741. }
  22742. }else{
  22743. if(this.m_oCV.isBux&&evt.ctrlKey==true&&evt.shiftKey==true&&evt.keyCode=="49"){
  22744. var lid=this.m_oCV.getSelectionController().getSelectionObjectFactory().getLayoutElementId(_135d);
  22745. if(lid!=""){
  22746. lid=lid.split(this.m_oCV.getId())[0];
  22747. var _1362=-1;
  22748. var _1363=this.m_oCV.getRAPReportInfo();
  22749. if(_1363){
  22750. var _1364=_1363.getContainer(lid);
  22751. if(typeof _1364.layoutIndex!="undefined"){
  22752. _1362=_1364.layoutIndex;
  22753. }
  22754. }
  22755. var _1365=document.getElementById("infoBarHeaderButton"+_1362+this.m_oCV.getId());
  22756. if(_1365!==null){
  22757. this.m_oCV.setCurrentNodeFocus(getCrossBrowserNode(evt));
  22758. _1365.focus();
  22759. }
  22760. }
  22761. return stopEventBubble(evt);
  22762. }else{
  22763. if(!this.m_oCV.isBux&&evt.shiftKey==true&&evt.keyCode=="121"){
  22764. var ocv=this.m_oCV;
  22765. var _1367=function(){
  22766. if(typeof evt.clientX=="undefined"||typeof evt.clientY=="undefined"){
  22767. var _1368=clientToScreenCoords(evt.target,document.body);
  22768. evt.clientX=_1368.leftCoord;
  22769. evt.clientY=_1368.topCoord;
  22770. }
  22771. ocv.dcm(evt,true);
  22772. };
  22773. if(isFF()){
  22774. setTimeout(_1367,0);
  22775. }else{
  22776. _1367.call();
  22777. }
  22778. return stopEventBubble(evt);
  22779. }else{
  22780. if(this.m_oCV.isBux&&(evt.keyCode=="93"||(evt.shiftKey==true&&evt.keyCode=="121"))){
  22781. var _1369=this.m_oCV.getViewerWidget();
  22782. var _136a=this.m_oCV.getSelectionController();
  22783. _1369.preprocessPageClicked(true);
  22784. _136a.pageClicked(evt);
  22785. _1369.updateToolbar();
  22786. _1369.onContextMenu(evt);
  22787. }
  22788. }
  22789. }
  22790. }
  22791. }
  22792. }
  22793. }
  22794. }
  22795. }
  22796. }
  22797. }
  22798. };
  22799. ViewerA11YHelper.prototype.isValidNodeToSelect=function(node){
  22800. return this.getValidNodeToSelect(node)?true:false;
  22801. };
  22802. ViewerA11YHelper.prototype.getValidNodeToSelect=function(node){
  22803. if(node&&node.style&&node.style.visibility!="hidden"&&node.style.display!="none"){
  22804. var _136d=node.nodeName.toLowerCase();
  22805. if((_136d=="span"&&(!node.getAttribute("class")||node.getAttribute("class").indexOf("expandButton")===-1))||(_136d=="div"&&node.getAttribute("flashchartcontainer")=="true")||(_136d=="div"&&node.getAttribute("chartcontainer")=="true")||(_136d=="img"&&(!node.id||node.id.indexOf("sortimg")!==0))){
  22806. return node;
  22807. }
  22808. if(ViewerA11YHelper.isSemanticNode(node)){
  22809. var child=node.childNodes&&node.childNodes.length?node.childNodes[0]:null;
  22810. if(child){
  22811. return this.getValidNodeToSelect(child);
  22812. }
  22813. }
  22814. }
  22815. return null;
  22816. };
  22817. ViewerA11YHelper.isSemanticNode=function(node){
  22818. if(!ViewerA11YHelper.isSemanticNode._semanticNodeNames){
  22819. ViewerA11YHelper.isSemanticNode._semanticNodeNames=["strong","em","h1","h2","h3","h4","h5","h6"];
  22820. }
  22821. var _1370=node.nodeName.toLowerCase();
  22822. for(var i=0;i<ViewerA11YHelper.isSemanticNode._semanticNodeNames.length;i++){
  22823. if(_1370===ViewerA11YHelper.isSemanticNode._semanticNodeNames[i]){
  22824. return true;
  22825. }
  22826. }
  22827. return false;
  22828. };
  22829. ViewerA11YHelper.isTableCell=function(node){
  22830. var _1373=node.nodeName.toLowerCase();
  22831. return _1373==="td"||_1373==="th";
  22832. };
  22833. ViewerA11YHelper.findChildOfTableCell=function(_1374){
  22834. var _1375=_1374;
  22835. while(_1375&&_1375.parentNode){
  22836. if(ViewerA11YHelper.getTableCell(_1375)){
  22837. break;
  22838. }
  22839. _1375=_1375.parentNode;
  22840. }
  22841. return _1375;
  22842. };
  22843. ViewerA11YHelper.getTableCell=function(node){
  22844. var _1377=node.parentNode;
  22845. if(ViewerA11YHelper.isTableCell(_1377)){
  22846. return _1377;
  22847. }
  22848. if(ViewerA11YHelper.isSemanticNode(_1377)&&ViewerA11YHelper.isTableCell(_1377.parentNode)){
  22849. return _1377.parentNode;
  22850. }
  22851. return null;
  22852. };
  22853. ViewerA11YHelper.prototype.moveRight=function(_1378){
  22854. var _1379=this.getNextNonTextSibling(_1378);
  22855. _1379=this.getValidNodeToSelect(_1379);
  22856. if(_1379){
  22857. this.setFocusToNode(_1379);
  22858. return true;
  22859. }
  22860. var _137a=ViewerA11YHelper.getTableCell(_1378);
  22861. _137a=this.getPfMainOutputCell(_137a);
  22862. while(_137a.nextSibling){
  22863. if(this.moveToTD(_137a.nextSibling)){
  22864. return true;
  22865. }
  22866. _137a=_137a.nextSibling;
  22867. }
  22868. var _137b=_137a.parentNode;
  22869. while(_137b.nextSibling){
  22870. var _137c=_137b.nextSibling;
  22871. if(this.moveToTD(_137c.childNodes[0])){
  22872. return true;
  22873. }
  22874. _137b=_137b.nextSibling;
  22875. }
  22876. return false;
  22877. };
  22878. ViewerA11YHelper.prototype.moveLeft=function(_137d){
  22879. var _137e=this.getPreviousNonTextSibling(_137d);
  22880. _137e=this.getValidNodeToSelect(_137e);
  22881. if(_137e){
  22882. this.setFocusToNode(_137e);
  22883. return true;
  22884. }
  22885. var _137f=ViewerA11YHelper.getTableCell(_137d);
  22886. _137f=this.getPfMainOutputCell(_137f);
  22887. while(_137f.previousSibling){
  22888. if(this.moveToTDFromTheRight(_137f.previousSibling)){
  22889. return true;
  22890. }
  22891. _137f=_137f.previousSibling;
  22892. }
  22893. var _1380=_137f.parentNode;
  22894. while(_1380.previousSibling){
  22895. var _1381=_1380.previousSibling;
  22896. if(this.moveToTDFromTheRight(_1381.lastChild)){
  22897. return true;
  22898. }
  22899. _1380=_1380.previousSibling;
  22900. }
  22901. return false;
  22902. };
  22903. ViewerA11YHelper.prototype.moveDown=function(_1382){
  22904. var _1383=ViewerA11YHelper.getTableCell(_1382);
  22905. _1383=this.getPfMainOutputCell(_1383);
  22906. var _1384=this.getColumnIndex(_1383);
  22907. _1384+=this.getColSpanFromRowSpans(_1383);
  22908. var _1385=_1383.parentNode;
  22909. if(_1383.rowSpan&&_1383.rowSpan>1){
  22910. var _1386=_1383.rowSpan;
  22911. for(var _1387=1;_1387<_1386;_1387++){
  22912. _1385=_1385.nextSibling;
  22913. }
  22914. }
  22915. var _1388=false;
  22916. while(_1385){
  22917. if(_1385.nextSibling){
  22918. _1385=_1385.nextSibling;
  22919. }else{
  22920. if(_1383.nextSibling&&!_1388){
  22921. _1385=_1385.parentNode.firstChild;
  22922. _1388=true;
  22923. _1384++;
  22924. }else{
  22925. return false;
  22926. }
  22927. }
  22928. if(this.doMoveUpDown(_1385,_1384)){
  22929. return true;
  22930. }
  22931. }
  22932. return false;
  22933. };
  22934. ViewerA11YHelper.prototype.moveUp=function(_1389){
  22935. var _138a=ViewerA11YHelper.getTableCell(_1389);
  22936. _138a=this.getPfMainOutputCell(_138a);
  22937. var _138b=_138a.parentNode;
  22938. var _138c=this.getColumnIndex(_138a);
  22939. _138c+=this.getColSpanFromRowSpans(_138a);
  22940. var _138d=false;
  22941. while(_138b){
  22942. if(_138b.previousSibling){
  22943. _138b=_138b.previousSibling;
  22944. }else{
  22945. if(_138a.previousSibling&&!_138d){
  22946. _138b=_138b.parentNode.lastChild;
  22947. _138d=true;
  22948. _138c--;
  22949. }else{
  22950. return false;
  22951. }
  22952. }
  22953. if(this.doMoveUpDown(_138b,_138c)){
  22954. return true;
  22955. }
  22956. }
  22957. return false;
  22958. };
  22959. ViewerA11YHelper.prototype.getNextNonTextSibling=function(node){
  22960. while(node.nextSibling){
  22961. node=node.nextSibling;
  22962. if(node.nodeName.toLowerCase()!="#text"){
  22963. return node;
  22964. }
  22965. }
  22966. if(ViewerA11YHelper.isSemanticNode(node.parentNode)){
  22967. return this.getNextNonTextSibling(node.parentNode);
  22968. }
  22969. return null;
  22970. };
  22971. ViewerA11YHelper.prototype.doMoveUpDown=function(_138f,_1390){
  22972. if(_138f!=null){
  22973. var _1391=_138f.firstChild;
  22974. var pos=this.getColSpanFromRowSpans(_1391);
  22975. while(_1391){
  22976. if(pos==_1390){
  22977. return this.moveToTDFromTheRight(_1391);
  22978. }else{
  22979. if(pos>_1390){
  22980. break;
  22981. }
  22982. }
  22983. var _1393=0;
  22984. if(_1391.colSpan){
  22985. _1393=_1391.colSpan;
  22986. }else{
  22987. _1393++;
  22988. }
  22989. pos+=_1393;
  22990. _1391=_1391.nextSibling;
  22991. }
  22992. }
  22993. };
  22994. ViewerA11YHelper.prototype.moveToTDFromTheRight=function(td){
  22995. td=this.getPfVisibleCell(td);
  22996. var _1395=td.childNodes;
  22997. for(var _1396=_1395.length-1;_1396>=0;_1396--){
  22998. var node=this.getValidNodeToSelect(_1395[_1396]);
  22999. if(node){
  23000. if(node.childNodes&&node.childNodes[0]&&node.childNodes[0].nodeName.toLowerCase()=="span"){
  23001. node=node.childNodes[0];
  23002. }
  23003. if(node.tabIndex!=-1&&node.tabIndex!=0){
  23004. node.tabIndex=-1;
  23005. }
  23006. this.setFocusToNode(node);
  23007. return true;
  23008. }
  23009. }
  23010. return false;
  23011. };
  23012. ViewerA11YHelper.prototype.moveToTD=function(td){
  23013. td=this.getPfVisibleCell(td);
  23014. var _1399=td.childNodes;
  23015. for(var _139a=0;_139a<_1399.length;_139a++){
  23016. var node=this.getValidNodeToSelect(_1399[_139a]);
  23017. if(node){
  23018. if(node.childNodes&&node.childNodes[0]&&node.childNodes[0].nodeName.toLowerCase()=="span"){
  23019. node=node.childNodes[0];
  23020. }
  23021. if(node.tabIndex!=-1&&node.tabIndex!=0){
  23022. node.tabIndex=-1;
  23023. }
  23024. this.setFocusToNode(node);
  23025. return true;
  23026. }
  23027. }
  23028. return false;
  23029. };
  23030. ViewerA11YHelper.prototype.setFocusToNode=function(node){
  23031. this.m_oCV.setCurrentNodeFocus(node);
  23032. this.updateCellAccessibility(node,false);
  23033. node.focus();
  23034. if(this.m_oCV.m_pinFreezeManager){
  23035. var _139d=this.m_oCV.m_pinFreezeManager.nodeToContainer(node);
  23036. if(_139d){
  23037. _139d.updateScroll(node);
  23038. }
  23039. }
  23040. };
  23041. ViewerA11YHelper.prototype.getPfMainOutputCell=function(_139e){
  23042. var main=null;
  23043. var slid=_139e.getAttribute("pfslid");
  23044. if(slid){
  23045. var lid=PinFreezeContainer.getLidFromSlid(slid);
  23046. if(lid&&this.m_oCV.m_pinFreezeManager){
  23047. lid=this.m_oCV.m_pinFreezeManager.removeNamespace(lid);
  23048. var _13a2=this.m_oCV.m_pinFreezeManager.getContainer(lid);
  23049. if(_13a2){
  23050. main=_13a2.getMain(_139e);
  23051. }
  23052. }
  23053. }
  23054. return main?main:_139e;
  23055. };
  23056. ViewerA11YHelper.prototype.getPreviousNonTextSibling=function(node){
  23057. while(node.previousSibling){
  23058. node=node.previousSibling;
  23059. if(node.nodeName.toLowerCase()!="#text"){
  23060. return node;
  23061. }
  23062. }
  23063. if(ViewerA11YHelper.isSemanticNode(node.parentNode)){
  23064. return this.getPreviousNonTextSibling(node.parentNode);
  23065. }
  23066. return null;
  23067. };
  23068. ViewerA11YHelper.prototype.getColumnIndex=function(node){
  23069. var _13a5=0;
  23070. while(node.previousSibling){
  23071. node=node.previousSibling;
  23072. if(node.rowSpan==1){
  23073. if(node.colSpan){
  23074. _13a5+=node.colSpan;
  23075. }else{
  23076. _13a5++;
  23077. }
  23078. }
  23079. }
  23080. return _13a5;
  23081. };
  23082. ViewerA11YHelper.prototype.getPfVisibleCell=function(_13a6){
  23083. var copy=null;
  23084. var slid=_13a6.getAttribute("pfslid");
  23085. if(slid){
  23086. var lid=PinFreezeContainer.getLidFromSlid(slid);
  23087. if(lid&&this.m_oCV.m_pinFreezeManager){
  23088. lid=this.m_oCV.m_pinFreezeManager.removeNamespace(lid);
  23089. var _13aa=this.m_oCV.m_pinFreezeManager.getContainer(lid);
  23090. if(_13aa){
  23091. copy=_13aa.getCopy(_13a6);
  23092. }
  23093. }
  23094. }
  23095. return copy?copy:_13a6;
  23096. };
  23097. ViewerA11YHelper.prototype.updateCellAccessibility=function(_13ab,force){
  23098. if(!_13ab){
  23099. return false;
  23100. }
  23101. var _13ad=false;
  23102. var _13ae=false;
  23103. var _13af=false;
  23104. var _13b0=_13ab.getAttribute("ctx")!=null?_13ab:_13ab.parentNode;
  23105. if(_13ab.getAttribute("flashChartContainer")!="true"){
  23106. if(_13b0.getAttribute("ctx")!=null){
  23107. if(this.m_oCV.isBux){
  23108. var _13b1=this.m_oCV.getAction("DrillUpDown");
  23109. _13b1.updateDrillability(this.m_oCV,_13b0);
  23110. _13ad=_13b1.canDrillDown();
  23111. _13ae=_13b1.canDrillUp();
  23112. }else{
  23113. var _13b2=_13b0.getAttribute("ctx");
  23114. var ctxID=_13b2.indexOf(":")==-1?_13b2:_13b2.substring(0,_13b2.indexOf(":"));
  23115. var _13b4=this.m_oCV.getSelectionController();
  23116. _13ad=_13b4.canDrillDown(ctxID);
  23117. _13ae=_13b4.canDrillUp(ctxID);
  23118. }
  23119. }
  23120. _13af=_13ab.parentNode.getAttribute("dtTargets")?true:false;
  23121. }
  23122. var _13b5=_13ab.nodeName.toLowerCase()=="img";
  23123. var _13b6=_13ab.parentNode.getAttribute("type")=="columnTitle";
  23124. if(!_13b5&&(force||((_13ab.getAttribute("aria-labelledby")!=null||_13b6||this.m_oCV.isAccessibleMode())))){
  23125. var _13b7="";
  23126. if(_13ab.parentNode.getAttribute("cc")=="true"){
  23127. _13b7+=" "+RV_RES.IDS_JS_CROSSTAB_CORNER;
  23128. }
  23129. if(_13ab.innerHTML.length===0){
  23130. _13ab.innerHTML="&nbsp;";
  23131. _13b7+=" "+RV_RES.IDS_JS_EMPTY_CELL;
  23132. }
  23133. if(_13ad&&_13ae){
  23134. _13b7+=" "+RV_RES.IDS_JS_DRILL_DOWN_UP_JAWS;
  23135. }else{
  23136. if(_13ad){
  23137. _13b7+=" "+RV_RES.IDS_JS_DRILL_DOWN_JAWS;
  23138. }else{
  23139. if(_13ae){
  23140. _13b7+=" "+RV_RES.IDS_JS_DRILL_UP_JAWS;
  23141. }
  23142. }
  23143. }
  23144. if(_13af){
  23145. _13b7+=" "+RV_RES.IDS_JS_DRILL_THROUGH_JAWS;
  23146. }
  23147. if(_13ab.altText&&_13ab.altText.length>0){
  23148. _13b7=_13ab.altText;
  23149. }else{
  23150. if(_13ab.getAttribute("flashChartContainer")=="true"){
  23151. _13b7=RV_RES.IDS_JS_CHART_IMAGE;
  23152. }
  23153. }
  23154. if(this.m_oCV.isBux){
  23155. var _13b8=_13ab.previousSibling;
  23156. if(_13b8){
  23157. var wid=_13b8.getAttribute("widgetid");
  23158. if(wid&&wid.indexOf("comment")){
  23159. _13b7+=" "+RV_RES.IDS_JS_ANNOTATION_JAWS;
  23160. }
  23161. }
  23162. if(_13ab.getAttribute("rp_name")||_13ab.parentNode.getAttribute("rp_name")){
  23163. _13b7+=" "+RV_RES.IDS_JS_LABEL_HAS_BEEN_RENAMED;
  23164. }
  23165. if(_13ab.nextSibling&&_13ab.nextSibling.getAttribute("class")=="sortIconVisible"){
  23166. _13b7+=" "+_13ab.nextSibling.getAttribute("alt");
  23167. }
  23168. }
  23169. if(_13b7.length>0){
  23170. this.addAriaLabelledByOnCell(_13ab,_13b7);
  23171. }
  23172. }
  23173. if(_13ae||_13ad||_13af){
  23174. this.addDrillAccessibilityAttributes(_13ab,_13af);
  23175. }
  23176. if(_13ab.attachEvent){
  23177. _13ab.attachEvent("onblur",this.onBlur);
  23178. }else{
  23179. _13ab.addEventListener("blur",this.onBlur,false);
  23180. }
  23181. if((isIE()&&_13ab.getAttribute("tabIndex")!=0)||_13b5){
  23182. _13ab.setAttribute("modifiedTabIndex","true");
  23183. _13ab.setAttribute("oldTabIndex",_13ab.getAttribute("tabIndex"));
  23184. _13ab.setAttribute("tabIndex",0);
  23185. }
  23186. };
  23187. ViewerA11YHelper.prototype.addAriaLabelledByOnCell=function(_13ba,_13bb){
  23188. var _13bc=0;
  23189. var _13bd=_13ba;
  23190. while(_13bd.previousSibling){
  23191. _13bc++;
  23192. _13bd=_13bd.previousSibling;
  23193. }
  23194. var _13be=_13ba.getAttribute("ariaHiddenSpanId");
  23195. if(_13be&&document.getElementById(_13be)){
  23196. document.getElementById(_13be).innerHTML=_13bb;
  23197. }else{
  23198. if(!_13ba.parentNode.id&&!_13ba.id){
  23199. _13ba.parentNode.id=Math.random();
  23200. }
  23201. var _13bf=document.createElement("span");
  23202. _13bf.style.visibility="hidden";
  23203. _13bf.style.display="none";
  23204. _13bf.id=(_13ba.id==""?_13ba.parentNode.id:_13ba.id)+"_"+_13bc;
  23205. _13bf.innerHTML=_13bb;
  23206. _13ba.parentNode.appendChild(_13bf);
  23207. var _13c0="";
  23208. if(_13ba.getAttribute("aria-labelledby")!=null){
  23209. _13c0+=_13ba.getAttribute("aria-labelledby");
  23210. }else{
  23211. if(_13ba.id==""){
  23212. _13ba.id=_13ba.parentNode.id+"_main_"+_13bc;
  23213. }
  23214. _13c0+=_13ba.id;
  23215. }
  23216. _13c0+=" "+_13bf.id;
  23217. _13ba.setAttribute("aria-labelledby",_13c0);
  23218. _13ba.setAttribute("ariaHiddenSpanId",_13bf.id);
  23219. }
  23220. };
  23221. ViewerA11YHelper.prototype.addDrillAccessibilityAttributes=function(_13c1,_13c2){
  23222. if(!_13c1.getAttribute("oldClassName")){
  23223. if(!_13c2){
  23224. _13c1.setAttribute("oldClassName",_13c1.className);
  23225. _13c1.className="dl "+_13c1.className;
  23226. }
  23227. if(!_13c1.getAttribute("role")){
  23228. _13c1.setAttribute("role","link");
  23229. }
  23230. }
  23231. };
  23232. ViewerA11YHelper.prototype.onBlur=function(evt){
  23233. var _13c4=null;
  23234. if(isIE()){
  23235. _13c4=getNodeFromEvent(evt,true);
  23236. }else{
  23237. _13c4=this;
  23238. }
  23239. _13c4=ViewerA11YHelper.findChildOfTableCell(_13c4);
  23240. if(_13c4){
  23241. if(_13c4.getAttribute("oldClassName")){
  23242. _13c4.className=_13c4.getAttribute("oldClassName");
  23243. _13c4.removeAttribute("oldClassName");
  23244. }
  23245. if(_13c4.getAttribute("modifiedTabIndex")=="true"){
  23246. _13c4.removeAttribute("modifiedTabIndex");
  23247. _13c4.removeAttribute("tabIndex");
  23248. if(_13c4.getAttribute("oldTabIndex")){
  23249. _13c4.setAttribute("tabIndex",_13c4.getAttribute("oldTabIndex"));
  23250. }
  23251. _13c4.removeAttribute("oldTabIndex");
  23252. }
  23253. var _13c5=_13c4.getAttribute("ariaHiddenSpanId");
  23254. if(_13c5){
  23255. var _13c6=document.getElementById(_13c5);
  23256. if(_13c6){
  23257. _13c6.innerHTML="";
  23258. }
  23259. }
  23260. }
  23261. };
  23262. ViewerA11YHelper.prototype.getColSpanFromRowSpans=function(_13c7){
  23263. var _13c8=0;
  23264. var _13c9=_13c7.parentNode;
  23265. var _13ca=0;
  23266. while(_13c9){
  23267. var _13cb=_13c9.firstChild;
  23268. var _13cc=this.getColumnCount(_13c9)-_13ca;
  23269. while(_13cb&&_13cb.rowSpan>1&&_13cc>0&&_13cb!=_13c7){
  23270. _13c8+=_13cb.colSpan;
  23271. _13cb=_13cb.nextSibling;
  23272. _13cc--;
  23273. }
  23274. if(_13c9.childNodes.length>_13ca){
  23275. _13ca=this.getColumnCount(_13c9);
  23276. }
  23277. _13c9=_13c9.previousSibling;
  23278. }
  23279. return _13c8;
  23280. };
  23281. ViewerA11YHelper.prototype.getColumnCount=function(_13cd){
  23282. var _13ce=0;
  23283. var node=_13cd.firstChild;
  23284. while(node){
  23285. _13ce+=node.colSpan;
  23286. node=node.nextSibling;
  23287. }
  23288. return _13ce;
  23289. };
  23290. ViewerA11YHelper.prototype.addLabelledByForItemsOutsideOfContainers=function(){
  23291. if(!this.m_oCV.isAccessibleMode()){
  23292. return;
  23293. }
  23294. var _13d0=document.getElementById("RVContent"+this.m_oCV.getId());
  23295. if(!_13d0){
  23296. return;
  23297. }
  23298. var _13d1=getElementsByAttribute(_13d0,"span","tabindex","0");
  23299. if(!_13d1){
  23300. return;
  23301. }
  23302. for(var i=0;i<_13d1.length;i++){
  23303. var span=_13d1[i];
  23304. this.updateCellAccessibility(span,false);
  23305. }
  23306. };
  23307. function CtxArrayPlaceHolder(){
  23308. };
  23309. var self=window;
  23310. function CDrillManager(oCV){
  23311. this.m_drawDrillTargets=false;
  23312. this.setCV(oCV);
  23313. };
  23314. CDrillManager.prototype=new CViewerHelper();
  23315. CDrillManager.prototype.getSelectionController=function(){
  23316. var _13d5;
  23317. try{
  23318. _13d5=getCognosViewerSCObjectRef(this.getCV().getId());
  23319. }
  23320. catch(e){
  23321. _13d5=null;
  23322. }
  23323. return _13d5;
  23324. };
  23325. CDrillManager.prototype.getSelectedObject=function(){
  23326. var _13d6=this.getSelectionController();
  23327. if(_13d6==null){
  23328. return null;
  23329. }
  23330. var _13d7=null;
  23331. var _13d8=null;
  23332. if(_13d6.hasSelectedChartNodes()){
  23333. _13d8=_13d6.getSelectedChartNodes();
  23334. }else{
  23335. _13d8=_13d6.getSelections();
  23336. }
  23337. if(_13d8&&_13d8.length==1){
  23338. _13d7=_13d8[0];
  23339. }
  23340. return _13d7;
  23341. };
  23342. CDrillManager.prototype.canDrillUp=function(){
  23343. if(this.getDrillOption("drillUp")==true&&this.hasMuns()){
  23344. return true;
  23345. }
  23346. return false;
  23347. };
  23348. CDrillManager.prototype.canDrillDown=function(){
  23349. if(this.getDrillOption("drillDown")==true){
  23350. return true;
  23351. }
  23352. return false;
  23353. };
  23354. CDrillManager.prototype.hasMuns=function(_13d9){
  23355. if(typeof _13d9=="undefined"){
  23356. _13d9=this.getSelectedObject();
  23357. }
  23358. if(_13d9==null){
  23359. return false;
  23360. }
  23361. var _13da=_13d9.getMuns();
  23362. var muns="";
  23363. for(var _13dc=0;_13dc<_13da.length&&muns=="";++_13dc){
  23364. if(typeof _13da[_13dc][0]!="undefined"){
  23365. muns+=_13da[_13dc][0];
  23366. }
  23367. }
  23368. return (muns!="");
  23369. };
  23370. CDrillManager.prototype.getRefQuery=function(){
  23371. var _13dd="";
  23372. var _13de=this.getSelectedObject();
  23373. if(_13de==null){
  23374. return "";
  23375. }
  23376. var _13df=_13de.getRefQueries();
  23377. for(var i=0;i<_13df.length;i++){
  23378. if(_13df[i]!=null){
  23379. for(var j=0;j<_13df[i].length;j++){
  23380. if(_13df[i][j]!=null&&_13df[i][j]!=""){
  23381. return _13df[i][j];
  23382. }
  23383. }
  23384. }
  23385. }
  23386. return _13dd;
  23387. };
  23388. CDrillManager.prototype.isIsolated=function(){
  23389. var _13e2=this.getSelectionController();
  23390. if(_13e2==null||_13e2.getDrillUpDownEnabled()==false){
  23391. return false;
  23392. }
  23393. var _13e3=this.getSelectedObject();
  23394. if(_13e3==null){
  23395. return false;
  23396. }
  23397. if(_13e3 instanceof CSelectionChartObject&&_13e2!=null){
  23398. var _13e4=_13e3.getArea();
  23399. if(_13e4!=null){
  23400. var _13e5=_13e4.getAttribute("isolated");
  23401. if(typeof _13e5!="undefined"&&_13e5!=null&&_13e5=="true"){
  23402. return true;
  23403. }
  23404. }
  23405. }else{
  23406. var _13e6=_13e3.getCellRef();
  23407. if(typeof _13e6=="object"&&_13e6!=null){
  23408. var _13e7=_13e6.getElementsByTagName("span");
  23409. if(_13e7!=null&&typeof _13e7!="undefined"&&_13e7.length>0){
  23410. var _13e8=_13e7[0].getAttribute("isolated");
  23411. if(_13e8!=null&&_13e8!="undefined"&&_13e8=="true"){
  23412. return true;
  23413. }
  23414. }
  23415. }
  23416. }
  23417. return false;
  23418. };
  23419. CDrillManager.prototype.getDrillOption=function(_13e9){
  23420. var _13ea=this.getSelectionController();
  23421. if(_13ea==null||_13ea.getDrillUpDownEnabled()==false||typeof _13e9=="undefined"){
  23422. return false;
  23423. }
  23424. var _13eb=this.getSelectedObject();
  23425. if(_13eb==null){
  23426. return false;
  23427. }
  23428. if(this.isIsolated()){
  23429. if(_13e9=="drillDown"){
  23430. return false;
  23431. }else{
  23432. if(_13e9=="drillUp"){
  23433. return true;
  23434. }
  23435. }
  23436. }
  23437. if(_13e9=="drillDown"){
  23438. if(_13eb instanceof CSelectionChartObject&&_13ea!=null){
  23439. var _13ec=_13eb.getArea();
  23440. if(_13ec!=null){
  23441. var _13ed=_13ec.getAttribute("isChartTitle");
  23442. if(typeof _13ed!="undefined"&&_13ed!=null&&_13ed=="true"){
  23443. return false;
  23444. }
  23445. }
  23446. }
  23447. }
  23448. var _13ee=_13eb.getDrillOptions();
  23449. var _13ef=(typeof DrillContextMenuHelper!=="undefined"&&DrillContextMenuHelper.needsDrillSubMenu(this.m_oCV));
  23450. for(var idx=0;idx<_13ee.length;++idx){
  23451. var _13f1=(_13ef)?_13ee[idx].length:1;
  23452. for(var level=0;level<_13f1;++level){
  23453. var _13f3=_13ee[idx][level];
  23454. if(_13f3=="3"){
  23455. return true;
  23456. }else{
  23457. if(_13e9=="drillUp"&&_13f3=="1"){
  23458. return true;
  23459. }else{
  23460. if(_13e9=="drillDown"&&_13f3=="2"){
  23461. return true;
  23462. }
  23463. }
  23464. }
  23465. }
  23466. }
  23467. return false;
  23468. };
  23469. CDrillManager.prototype.canDrillThrough=function(){
  23470. var _13f4=this.getSelectionController();
  23471. if(_13f4==null||_13f4.getModelDrillThroughEnabled()==false){
  23472. return false;
  23473. }
  23474. return true;
  23475. };
  23476. CDrillManager.prototype.singleClickDrillEvent=function(evt,app){
  23477. var _13f7=this.getSelectionController();
  23478. if(_13f7!=null){
  23479. if(this.getCV().bCanUseCognosViewerSelection==true){
  23480. _13f7.pageClicked(evt);
  23481. }
  23482. }
  23483. var node=getCrossBrowserNode(evt);
  23484. try{
  23485. if(node.className&&node.className.indexOf("dl")==0){
  23486. if(this.canDrillDown()){
  23487. this.singleClickDrillDown(evt,app);
  23488. return true;
  23489. }else{
  23490. if(this.canDrillUp()){
  23491. this.singleClickDrillUp(evt,app);
  23492. return true;
  23493. }
  23494. }
  23495. }
  23496. }
  23497. catch(e){
  23498. }
  23499. if(app=="RV"){
  23500. return this.getDrillThroughParameters("execute",evt);
  23501. }
  23502. return false;
  23503. };
  23504. CDrillManager.prototype.singleClickDrillDown=function(evt,app){
  23505. if(app=="QS"){
  23506. this.qsDrillDown();
  23507. }else{
  23508. this.rvDrillDown();
  23509. }
  23510. };
  23511. CDrillManager.prototype.singleClickDrillUp=function(evt,app){
  23512. if(app=="QS"){
  23513. this.qsDrillUp();
  23514. }else{
  23515. this.rvDrillUp();
  23516. }
  23517. };
  23518. CDrillManager.prototype.getDrillParameters=function(_13fd,_13fe,_13ff,_1400){
  23519. var _1401=[];
  23520. var _1402=this.getSelectedObject();
  23521. if(_1402==null){
  23522. return _1401;
  23523. }
  23524. if(typeof _13fe=="undefined"){
  23525. _13fe=true;
  23526. }
  23527. var _1403=_1402.getDataItems();
  23528. var _1404=_1402.getMuns();
  23529. var _1405=_1402.getDimensionalItems("lun");
  23530. var _1406=_1402.getDimensionalItems("hun");
  23531. var _1407=_1402.getDrillOptions();
  23532. if(typeof _1403=="undefined"||typeof _1404=="undefined"||typeof _1407=="undefined"||_1404==null||_1403==null||_1407==null){
  23533. return _1401;
  23534. }
  23535. if(_1404.length!=_1403.length){
  23536. return _1401;
  23537. }
  23538. var _1408=_1404.length;
  23539. for(var _1409=0;_1409<_1408;++_1409){
  23540. if(_1403[_1409].length!=0){
  23541. var _140a=(_1400)?this.findUserSelectedDrillItem(_1400,_1403[_1409]):0;
  23542. if(_140a<0){
  23543. continue;
  23544. }
  23545. if((_13ff===true)||this.getDrillOption(_13fd)){
  23546. if(_1404[_1409][_140a]==""||_1401.toString().indexOf(_1404[_1409][_140a],0)==-1){
  23547. _1401[_1401.length]=_1403[_1409][_140a];
  23548. _1401[_1401.length]=_1404[_1409][_140a];
  23549. if(_13fe===true){
  23550. _1401[_1401.length]=_1405[_1409][_140a];
  23551. _1401[_1401.length]=_1406[_1409][_140a];
  23552. }
  23553. }
  23554. }
  23555. }
  23556. }
  23557. return _1401;
  23558. };
  23559. CDrillManager.prototype.findUserSelectedDrillItem=function(_140b,_140c){
  23560. for(var _140d=0;_140d<_140c.length;++_140d){
  23561. if(_140b==_140c[_140d]){
  23562. return _140d;
  23563. }
  23564. }
  23565. return -1;
  23566. };
  23567. CDrillManager.prototype.getModelDrillThroughContext=function(_140e){
  23568. var _140f="";
  23569. if(this.canDrillThrough()===true){
  23570. if(typeof gUseNewSelectionContext=="undefined"){
  23571. var _1410="";
  23572. if(typeof getConfigFrame!="undefined"){
  23573. _1410=decodeURIComponent(getConfigFrame().cfgGet("PackageBase"));
  23574. }else{
  23575. if(this.getCV().getModelPath()!==""){
  23576. _1410=this.getCV().getModelPath();
  23577. }
  23578. }
  23579. _140f=getViewerSelectionContext(this.getSelectionController(),new CSelectionContext(_1410));
  23580. }else{
  23581. var _1411=new CParameterValues();
  23582. var _1412=this.getSelectionController();
  23583. if(_1412){
  23584. var _1413=_1412.getAllSelectedObjects();
  23585. for(var _1414=0;_1414<_1413.length;++_1414){
  23586. var _1415=_1413[_1414];
  23587. var _1416=_1415.getMuns();
  23588. var _1417=_1415.getMetadataItems();
  23589. var _1418=_1415.getUseValues();
  23590. for(var _1419=0;_1419<_1417.length;++_1419){
  23591. for(var idx=0;idx<_1417[_1419].length;++idx){
  23592. if(_1417[_1419][idx]==null||_1417[_1419][idx]==""){
  23593. continue;
  23594. }
  23595. var name=_1417[_1419][idx];
  23596. var _141c;
  23597. if(_1416[_1419][idx]!=null&&_1416[_1419][idx]!=""){
  23598. _141c=_1416[_1419][idx];
  23599. }else{
  23600. _141c=_1418[_1419][idx];
  23601. }
  23602. var _141d=_1418[_1419][idx];
  23603. _1411.addSimpleParmValueItem(name,_141c,_141d,"true");
  23604. }
  23605. }
  23606. }
  23607. }
  23608. var _141e=_140e.XMLBuilderCreateXMLDocument("context");
  23609. _140f=_1411.generateXML(_140e,_141e);
  23610. }
  23611. }
  23612. return _140f;
  23613. };
  23614. CDrillManager.prototype.rvDrillUp=function(_141f){
  23615. this.getCV().executeAction("DrillUp",_141f);
  23616. };
  23617. CDrillManager.prototype.rvDrillDown=function(_1420){
  23618. this.getCV().executeAction("DrillDown",_1420);
  23619. };
  23620. CDrillManager.prototype.rvBuildXMLDrillParameters=function(_1421,_1422){
  23621. var _1423=this.getDrillParameters(_1421,true,false,_1422);
  23622. if(_1423.length==0){
  23623. return drillParams;
  23624. }
  23625. return this.buildDrillParametersSpecification(_1423);
  23626. };
  23627. CDrillManager.prototype.buildDrillParametersSpecification=function(_1424){
  23628. var _1425="<DrillParameters>";
  23629. var idx=0;
  23630. while(idx<_1424.length){
  23631. _1425+="<DrillGroup>";
  23632. _1425+="<DataItem>";
  23633. _1425+=sXmlEncode(_1424[idx++]);
  23634. _1425+="</DataItem>";
  23635. _1425+="<MUN>";
  23636. _1425+=sXmlEncode(_1424[idx++]);
  23637. _1425+="</MUN>";
  23638. _1425+="<LUN>";
  23639. _1425+=sXmlEncode(_1424[idx++]);
  23640. _1425+="</LUN>";
  23641. _1425+="<HUN>";
  23642. _1425+=sXmlEncode(_1424[idx++]);
  23643. _1425+="</HUN>";
  23644. _1425+="</DrillGroup>";
  23645. }
  23646. _1425+="</DrillParameters>";
  23647. return _1425;
  23648. };
  23649. CDrillManager.prototype.getAuthoredDrillsForCurrentSelection=function(){
  23650. var _1427=null;
  23651. var _1428=this.getAuthoredDrillThroughTargets();
  23652. if(_1428.length>0){
  23653. var _1429="<AuthoredDrillTargets>";
  23654. for(var _142a=0;_142a<_1428.length;++_142a){
  23655. _1429+=eval("\""+_1428[_142a]+"\"");
  23656. }
  23657. _1429+="</AuthoredDrillTargets>";
  23658. var cv=this.getCV();
  23659. var _142c=cv.getAction("AuthoredDrill");
  23660. var _142d=cv.getDrillTargets();
  23661. if(_142d.length>0){
  23662. _1427=_142c.getAuthoredDrillThroughContext(_1429,_142d);
  23663. }
  23664. }
  23665. return _1427;
  23666. };
  23667. CDrillManager.prototype.getAuthoredDrillsForGotoPage=function(){
  23668. var _142e="";
  23669. var _142f=this.getAuthoredDrillsForCurrentSelection();
  23670. if(_142f){
  23671. _142e=XMLBuilderSerializeNode(_142f);
  23672. }
  23673. return _142e;
  23674. };
  23675. CDrillManager.prototype.launchGoToPage=function(_1430,_1431){
  23676. var _1432=this.getSelectionController();
  23677. if((_1432!=null&&_1432.getModelDrillThroughEnabled()==true)||(typeof _1430!="undefined"&&_1430!=null&&_1430!="")){
  23678. var _1433=this.getAuthoredDrillsForGotoPage();
  23679. var _1434=this.getModelDrillThroughContext(self);
  23680. var form=document.getElementById("drillForm");
  23681. if(form!=null){
  23682. document.body.removeChild(form);
  23683. }
  23684. form=document.createElement("form");
  23685. var cvid=this.getCVId();
  23686. var _1437=document.forms["formWarpRequest"+cvid];
  23687. form.setAttribute("id","drillForm");
  23688. form.setAttribute("name","drillForm");
  23689. form.setAttribute("target",_1437.getAttribute("target"));
  23690. form.setAttribute("method","post");
  23691. form.setAttribute("action",_1437.getAttribute("action"));
  23692. form.style.display="none";
  23693. document.body.appendChild(form);
  23694. if(this.getCV().getModelPath()!==""){
  23695. form.appendChild(createHiddenFormField("modelPath",this.getCV().getModelPath()));
  23696. }
  23697. if(typeof _1437["ui.object"]!="undefined"&&_1437["ui.object"].value!=""){
  23698. form.appendChild(createFormField("drillSource",_1437["ui.object"].value));
  23699. }else{
  23700. if(typeof this.getCV().envParams["ui.spec"]!="undefined"){
  23701. form.appendChild(createFormField("sourceSpecification",this.getCV().envParams["ui.spec"]));
  23702. }
  23703. }
  23704. if(_1433!=""){
  23705. form.appendChild(createHiddenFormField("m","portal/drillthrough.xts"));
  23706. form.appendChild(createFormField("invokeGotoPage","true"));
  23707. form.appendChild(createFormField("m","portal/drillthrough.xts"));
  23708. form.appendChild(createFormField("modelDrillEnabled",_1432.getModelDrillThroughEnabled()));
  23709. if(typeof gUseNewSelectionContext=="undefined"){
  23710. form.appendChild(createFormField("newSelectionContext","true"));
  23711. }
  23712. }else{
  23713. if(typeof gUseNewSelectionContext=="undefined"){
  23714. form.appendChild(createHiddenFormField("m","portal/goto2.xts"));
  23715. }else{
  23716. form.appendChild(createHiddenFormField("m","portal/goto.xts"));
  23717. }
  23718. }
  23719. form.appendChild(createHiddenFormField("b_action","xts.run"));
  23720. form.appendChild(createHiddenFormField("drillTargets",_1433));
  23721. if(typeof gUseNewSelectionContext=="undefined"){
  23722. form.appendChild(createHiddenFormField("drillContext",_1434));
  23723. }else{
  23724. form.appendChild(createHiddenFormField("modeledDrillthru",_1434));
  23725. }
  23726. form.appendChild(createHiddenFormField("errURL","javascript:window.close();"));
  23727. if(typeof _1431!="undefined"&&_1431==true){
  23728. form.appendChild(this.createFormField("directLaunch","true"));
  23729. }
  23730. var _1438="";
  23731. if(this.getCV().envParams["ui.routingServerGroup"]){
  23732. _1438=this.getCV().envParams["ui.routingServerGroup"];
  23733. }
  23734. form.appendChild(createHiddenFormField("ui.routingServerGroup",_1438));
  23735. if(this.getCV().getExecutionParameters()!=""){
  23736. form.appendChild(createHiddenFormField("encExecutionParameters",this.getCV().getExecutionParameters()));
  23737. }
  23738. if(_1437.lang&&_1437.lang.value!=""){
  23739. form.appendChild(createHiddenFormField("lang",_1437.lang.value));
  23740. }
  23741. if(!this.getCV()||!this.getCV().launchGotoPageForIWidgetMobile(drillForm)){
  23742. if(typeof this.getCV().launchGotoPage==="function"){
  23743. this.getCV().launchGotoPage(form);
  23744. }else{
  23745. var _1439="winNAT_"+(new Date()).getTime();
  23746. var sPath=this.getCV().getWebContentRoot()+"/rv/blankDrillWin.html?cv.id="+cvid;
  23747. window.open(sPath,_1439,"toolbar,location,status,menubar,resizable,scrollbars=1");
  23748. form.target=_1439;
  23749. }
  23750. }
  23751. }
  23752. };
  23753. CDrillManager.prototype.buildSearchPageXML=function(_143b,pkg,model,_143e,_143f,_1440,_1441){
  23754. var _1442=null;
  23755. if(typeof _143b.XMLElement=="function"){
  23756. _1442=_143b.XMLBuilderCreateXMLDocument("cognosSearch");
  23757. _143b.XMLBuilderSetAttributeNodeNS(_1442.documentElement,"xmlns:cs","http://developer.cognos.com/schemas/cs/1/");
  23758. var _1443=_1442.createElement("package");
  23759. if(typeof pkg=="string"&&pkg!==""){
  23760. _1443.appendChild(_1442.createTextNode(pkg));
  23761. }
  23762. _1442.documentElement.appendChild(_1443);
  23763. var _1444=_1442.createElement("model");
  23764. if(typeof model=="string"&&model!==""){
  23765. _1444.appendChild(_1442.createTextNode(model));
  23766. }
  23767. _1442.documentElement.appendChild(_1444);
  23768. var _1445=_1442.createElement("selectedContext");
  23769. _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
  23770. _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
  23771. _143b.XMLBuilderSetAttributeNodeNS(_1445,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
  23772. _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
  23773. _143b.XMLBuilderSetAttributeNodeNS(_1445,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  23774. _1442.documentElement.appendChild(_1445);
  23775. for(var _1446 in _143e){
  23776. var _1447=_1442.createElement("item");
  23777. _143b.XMLBuilderSetAttributeNodeNS(_1447,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
  23778. var _1448=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",_1442);
  23779. _143b.XMLBuilderSetAttributeNodeNS(_1448,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  23780. _1448.appendChild(_1442.createTextNode(_143e[_1446].name));
  23781. var _1449=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_1442);
  23782. _143b.XMLBuilderSetAttributeNodeNS(_1449,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  23783. _143b.XMLBuilderSetAttributeNodeNS(_1449,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
  23784. for(var j=0;j<_143e[_1446].values.length;j++){
  23785. var _144b=_1442.createElement("item");
  23786. _143b.XMLBuilderSetAttributeNodeNS(_144b,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  23787. var _144c=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",_1442);
  23788. _143b.XMLBuilderSetAttributeNodeNS(_144c,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  23789. _144c.appendChild(_1442.createTextNode(_143e[_1446].values[j][0]));
  23790. var _144d=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",_1442);
  23791. _143b.XMLBuilderSetAttributeNodeNS(_144d,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  23792. var _144e=_143e[_1446].values[j][1]==null?"":_143e[_1446].values[j][1];
  23793. _144d.appendChild(_1442.createTextNode(_144e));
  23794. _144b.appendChild(_144c);
  23795. _144b.appendChild(_144d);
  23796. _1449.appendChild(_144b);
  23797. }
  23798. _1447.appendChild(_1448);
  23799. _1447.appendChild(_1449);
  23800. _1445.appendChild(_1447);
  23801. }
  23802. var _144f=_1442.createElement("defaultMeasure");
  23803. _1442.documentElement.appendChild(_144f);
  23804. _1440.buildXML(_143b,_1442,"data");
  23805. var _1450=_1442.createElement("filter");
  23806. _1442.documentElement.appendChild(_1450);
  23807. }
  23808. return _1442;
  23809. };
  23810. CDrillManager.prototype.openSearchPage=function(_1451,_1452){
  23811. this.getModelDrillThroughContext(self);
  23812. var _1453=document.getElementById("searchPage");
  23813. if(_1453!=null){
  23814. document.body.removeChild(_1453);
  23815. }
  23816. _1453=document.createElement("form");
  23817. _1453.setAttribute("id","searchPage");
  23818. _1453.setAttribute("name","searchPage");
  23819. _1453.setAttribute("method","post");
  23820. _1453.setAttribute("target",_1453.name);
  23821. _1453.setAttribute("action",this.getCV().getGateway()+"/gosearch");
  23822. _1453.style.display="none";
  23823. document.body.appendChild(_1453);
  23824. _1453.appendChild(createHiddenFormField("csn.action","search"));
  23825. _1453.appendChild(createHiddenFormField("csn.drill",_1452));
  23826. var _1454=window.open("",_1453.name,"directories=no,location=no,status=no,toolbar=no,resizable=yes,scrollbars=yes,top=100,left=100,height=480,width=640");
  23827. _1454.focus();
  23828. _1453.submit();
  23829. };
  23830. CDrillManager.prototype.launchSearchPage=function(){
  23831. var _1455=this.getSelectionController();
  23832. var _1456=document.forms["formWarpRequest"+this.getCVId()];
  23833. var _1457=this.determineSelectionsForSearchPage(_1455);
  23834. var _1458=this.getSearchContextDataSpecfication(_1455);
  23835. var spXML=this.buildSearchPageXML(self,_1456.packageBase.value,this.getCV().getModelPath(),_1457,[],_1458,[]);
  23836. this.openSearchPage(_1456.packageBase.value,XMLBuilderSerializeNode(spXML));
  23837. };
  23838. CDrillManager.prototype.qsDrillDown=function(){
  23839. if(!this.canDrillDown()){
  23840. getConfigFrame().dlgGenericSelectionMessage(false);
  23841. return;
  23842. }
  23843. var _145a="DD:";
  23844. this.qsSendDrillCommand(_145a);
  23845. };
  23846. CDrillManager.prototype.qsDrillUp=function(){
  23847. if(!this.canDrillUp()){
  23848. getConfigFrame().dlgGenericSelectionMessage(false);
  23849. return;
  23850. }
  23851. var _145b="DU:";
  23852. this.qsSendDrillCommand(_145b);
  23853. };
  23854. CDrillManager.prototype.qsSendDrillCommand=function(_145c){
  23855. var _145d;
  23856. if(_145c=="DU:"){
  23857. _145d="drillUp";
  23858. }else{
  23859. _145d="drillDown";
  23860. }
  23861. var _145e=this.getDrillParameters(_145d,false,false);
  23862. if(_145e.length==0){
  23863. getConfigFrame().dlgGenericSelectionMessage(false);
  23864. return;
  23865. }
  23866. for(var idx=0;idx<_145e.length;++idx){
  23867. _145c+=getConfigFrame().escapeParam(_145e[idx]);
  23868. if(idx+1<_145e.length){
  23869. _145c+=",";
  23870. }
  23871. }
  23872. getConfigFrame().sendCmd(_145c,"",true);
  23873. };
  23874. CDrillManager.prototype.qsLaunchGoToPage=function(_1460){
  23875. var _1461=this.getSelectionController();
  23876. if(_1461!=null&&_1461.getModelDrillThroughEnabled()==true){
  23877. var _1462=this.getModelDrillThroughContext(cf);
  23878. if(_1462==""){
  23879. getConfigFrame().dlgGenericSelectionMessage(false);
  23880. return;
  23881. }
  23882. var _1463=document.getElementById("gotoPage");
  23883. if(_1463!=null){
  23884. document.body.removeChild(_1463);
  23885. }
  23886. _1463=document.createElement("form");
  23887. _1463.setAttribute("id","gotoPage");
  23888. _1463.setAttribute("name","gotoPage");
  23889. _1463.setAttribute("method","post");
  23890. _1463.style.display="none";
  23891. document.body.appendChild(_1463);
  23892. var _1464=getConfigFrame();
  23893. _1463.appendChild(this.createFormField("objpath",decodeURIComponent(_1464.cfgGet("PackageBase"))));
  23894. if(typeof gUseNewSelectionContext=="undefined"){
  23895. _1463.appendChild(this.createFormField("m","portal/goto2.xts"));
  23896. }else{
  23897. _1463.appendChild(this.createFormField("m","portal/goto.xts"));
  23898. }
  23899. _1463.appendChild(this.createFormField("b_action","xts.run"));
  23900. if(typeof gUseNewSelectionContext=="undefined"){
  23901. _1463.appendChild(this.createFormField("drillContext",_1462));
  23902. }else{
  23903. _1463.appendChild(this.createFormField("modeledDrillthru",_1462));
  23904. }
  23905. if(typeof getConfigFrame().routingServerGroup!="undefined"){
  23906. _1463.appendChild(this.createFormField("ui.routingServerGroup",getConfigFrame().routingServerGroup));
  23907. }
  23908. if(typeof _1460!="undefined"&&_1460==true){
  23909. _1463.appendChild(this.createFormField("directLaunch","true"));
  23910. }
  23911. var _1465=_1464.goApplicationManager.getReportManager().getParameterManager().getExecutionParameters();
  23912. if(_1465){
  23913. _1463.appendChild(this.createFormField("encExecutionParameters",_1465));
  23914. }
  23915. var _1466="winNAT_"+(new Date()).getTime();
  23916. var sPath=this.getCV().getWebContentRoot()+"/rv/blankDrillWin.html?cv.id="+this.getCVId();
  23917. window.open(sPath,_1466,"toolbar,location,status,menubar,resizable,scrollbars=1");
  23918. _1463.target=_1466;
  23919. }
  23920. };
  23921. CDrillManager.prototype.qsLaunchSearchPage=function(){
  23922. var cf=getConfigFrame();
  23923. var _1469=goWindowManager.getSelectionController();
  23924. var _146a=this.determineSelectionsForSearchPage(_1469);
  23925. var _146b=this.getSearchContextDataSpecfication(_1469);
  23926. var _146c=decodeURIComponent(cf.cfgGet("PackageBase"));
  23927. var spXML=this.buildSearchPageXML(cf,_146c,decodeURIComponent(cf.cfgGet("cmLastModel")),_146a,[],_146b,[]);
  23928. this.openSearchPage(_146c,cf.XMLBuilderSerializeNode(spXML));
  23929. };
  23930. CDrillManager.prototype.determineSelectionsForSearchPage=function(_146e){
  23931. var _146f=new CtxArrayPlaceHolder();
  23932. var _1470=_146e.getAllSelectedObjects();
  23933. for(var i=0;i<_1470.length;i++){
  23934. var _1472=_1470[i].getColumnName();
  23935. if(!this.containsByIndiceInArray(_146f,_1472)){
  23936. _146f[_1472]={};
  23937. _146f[_1472].name=_1472;
  23938. _146f[_1472].values=[];
  23939. }
  23940. var idx0="";
  23941. var muns=_1470[i].getMuns();
  23942. if(muns!=null&&muns.length>0){
  23943. idx0=muns[0][0];
  23944. }
  23945. var idx1=_1470[i].getDisplayValues()[0];
  23946. if(!(this.containsInArray(_146f[_1472].values,0,idx0)&&this.containsInArray(_146f[_1472].values,1,idx1))){
  23947. _146f[_1472].values[_146f[_1472].values.length]=[idx0,idx1];
  23948. }
  23949. }
  23950. return _146f;
  23951. };
  23952. CDrillManager.prototype.getSearchContextDataSpecfication=function(_1476){
  23953. var _1477=new CParameterValues();
  23954. var _1478=_1476.getCCDManager();
  23955. var _1479=_1478.m_cd;
  23956. for(var ctxId in _1479){
  23957. var _147b=_1478.GetUsage(ctxId);
  23958. if(_147b!="2"){
  23959. var _147c=_1478.GetRDIValue(ctxId);
  23960. var _147d=_1478.GetDisplayValue(ctxId);
  23961. _1477.addSimpleParmValueItem(_147c,_147c,_147d,"true");
  23962. }
  23963. }
  23964. return _1477;
  23965. };
  23966. CDrillManager.prototype.containsByIndiceInArray=function(a,v){
  23967. for(var i in a){
  23968. if(i==v){
  23969. return true;
  23970. }
  23971. }
  23972. return false;
  23973. };
  23974. CDrillManager.prototype.containsInArray=function(a,idx,v){
  23975. for(var i in a){
  23976. if(a[i][idx]==v){
  23977. return true;
  23978. }
  23979. }
  23980. return false;
  23981. };
  23982. CDrillManager.prototype.createFormField=function(name,value){
  23983. var _1487=document.createElement("input");
  23984. _1487.setAttribute("type","hidden");
  23985. _1487.setAttribute("name",name);
  23986. _1487.setAttribute("value",value);
  23987. return (_1487);
  23988. };
  23989. CDrillManager.prototype.getAuthoredDrillThroughTargets=function(){
  23990. var _1488=[];
  23991. var _1489=this.getSelectionController();
  23992. var _148a=null;
  23993. if(_1489!=null){
  23994. if(_1489.getSelectedColumnIds().length==1){
  23995. var _148b=_1489.getSelections();
  23996. for(var _148c=0;_148c<_148b.length;++_148c){
  23997. var _148d=_148b[_148c];
  23998. _148a=_148d.getCellRef();
  23999. while(_148a){
  24000. if(_148a.getAttribute("dtTargets")!=null){
  24001. _1488.push("<rvDrillTargets>"+_148a.getAttribute("dtTargets")+"</rvDrillTargets>");
  24002. break;
  24003. }else{
  24004. if(_148a.getAttribute("onclick")!=null){
  24005. var _148e=_148a.getAttribute("onclick");
  24006. var _148f=null;
  24007. if(_148e.indexOf("doSingleDrillThrough")!=-1){
  24008. _148f=_148e.replace("doSingleDrillThrough","this.buildRvTargetsForSingleDrillThrough");
  24009. }else{
  24010. if(_148e.indexOf("doMultipleDrillThrough")!=-1){
  24011. _148f=_148e.replace("doMultipleDrillThrough","this.buildRvTargetsForMultipleDrillThrough");
  24012. }
  24013. }
  24014. if(_148f!=null){
  24015. var _1490=eval(_148f);
  24016. if(_1490!=null){
  24017. _1488.push(_1490);
  24018. break;
  24019. }
  24020. }
  24021. }
  24022. }
  24023. _148a=XMLHelper_GetFirstChildElement(_148a);
  24024. }
  24025. }
  24026. }else{
  24027. if(_1489.hasSelectedChartNodes()){
  24028. var _1491=_1489.getSelectedChartNodes();
  24029. var _1492=_1491[0];
  24030. _148a=_1492.getArea();
  24031. if(_148a.getAttribute("dtTargets")!=null){
  24032. _1488.push("<rvDrillTargets>"+_148a.getAttribute("dtTargets")+"</rvDrillTargets>");
  24033. }
  24034. }else{
  24035. if(_1489.getSelectedDrillThroughImage()!=null){
  24036. var _1493=_1489.getSelectedDrillThroughImage();
  24037. if(_1493&&_1493.getAttribute("dtTargets")!=null){
  24038. _1488.push("<rvDrillTargets>"+_1493.getAttribute("dtTargets")+"</rvDrillTargets>");
  24039. }
  24040. }else{
  24041. if(_1489.getSelectDrillThroughSingleton()!=null){
  24042. var _1494=_1489.getSelectDrillThroughSingleton();
  24043. if(_1494&&_1494.getAttribute("dtTargets")!=null){
  24044. _1488.push("<rvDrillTargets>"+_1494.getAttribute("dtTargets")+"</rvDrillTargets>");
  24045. }
  24046. }
  24047. }
  24048. }
  24049. }
  24050. }
  24051. return _1488;
  24052. };
  24053. CDrillManager.prototype.getDrillThroughParameters=function(_1495,evt){
  24054. if(typeof _1495=="undefined"){
  24055. _1495="query";
  24056. }
  24057. var _1497=[];
  24058. if(typeof evt!="undefined"){
  24059. var _1498=getCrossBrowserNode(evt,true);
  24060. try{
  24061. while(_1498){
  24062. if(typeof _1498.getAttribute!="undefined"&&_1498.getAttribute("dtTargets")){
  24063. _1497.push("<rvDrillTargets>"+_1498.getAttribute("dtTargets")+"</rvDrillTargets>");
  24064. break;
  24065. }
  24066. _1498=_1498.parentNode;
  24067. }
  24068. }
  24069. catch(e){
  24070. return false;
  24071. }
  24072. }else{
  24073. var oCV=this.getCV();
  24074. var _149a=oCV.getDrillMgr();
  24075. var _149b=_149a.getSelectionController();
  24076. if(_149b!=null){
  24077. var _149c=null;
  24078. if(_149b.hasSelectedChartNodes()){
  24079. var _149d=_149b.getSelectedChartNodes();
  24080. var _149e=_149d[0];
  24081. _149c=_149e.getArea();
  24082. }
  24083. if(_149c!=null){
  24084. _1497.push("<rvDrillTargets>"+_149c.getAttribute("dtTargets")+"</rvDrillTargets>");
  24085. }else{
  24086. _1497=this.getAuthoredDrillThroughTargets();
  24087. }
  24088. }
  24089. }
  24090. if(_1497.length>0){
  24091. var _149f="<AuthoredDrillTargets>";
  24092. for(var _14a0=0;_14a0<_1497.length;++_14a0){
  24093. _149f+=eval("\""+_1497[_14a0]+"\"");
  24094. }
  24095. _149f+="</AuthoredDrillTargets>";
  24096. var _14a1=this.getCV().getAction("AuthoredDrill");
  24097. if(_1495=="query"){
  24098. _14a1.populateContextMenu(_149f);
  24099. this.showOtherMenuItems();
  24100. }else{
  24101. if(this.getCV().envParams["cv.id"]=="AA"){
  24102. this.getCV().m_viewerFragment.raiseAuthoredDrillClickEvent();
  24103. }else{
  24104. _14a1.execute(_149f);
  24105. }
  24106. }
  24107. return true;
  24108. }else{
  24109. if(_1495=="query"){
  24110. this.showOtherMenuItems();
  24111. return true;
  24112. }else{
  24113. return false;
  24114. }
  24115. }
  24116. };
  24117. CDrillManager.prototype.executeAuthoredDrill=function(_14a2){
  24118. var _14a3=decodeURIComponent(_14a2);
  24119. var _14a4=this.getCV().getAction("AuthoredDrill");
  24120. _14a4.executeDrillTarget(_14a3);
  24121. };
  24122. CDrillManager.prototype.doesMoreExist=function(_14a5){
  24123. for(var i=0;i<_14a5.getNumItems();i++){
  24124. var _14a7=_14a5.get(i);
  24125. if(_14a7!=null){
  24126. if((_14a7 instanceof CMenuItem)&&(_14a7.getLabel()==RV_RES.RV_MORE)&&(_14a7.getAction()==this.getCVObjectRef()+".getDrillMgr().launchGoToPage();")){
  24127. return true;
  24128. }
  24129. }
  24130. }
  24131. return false;
  24132. };
  24133. CDrillManager.prototype.showOtherMenuItems=function(){
  24134. var cv=this.getCV();
  24135. var _14a9=cv.rvMainWnd;
  24136. var _14aa=_14a9.getToolbarControl();
  24137. var _14ab=null;
  24138. var _14ac=null;
  24139. if(typeof _14aa!="undefined"&&_14aa!=null){
  24140. _14ab=_14aa.getItem("goto");
  24141. if(_14ab){
  24142. _14ac=_14ab.getMenu();
  24143. }
  24144. }
  24145. var _14ad=_14a9.getContextMenu();
  24146. var _14ae=_14a9.getUIHide();
  24147. var _14af=null;
  24148. if(typeof _14ad!="undefined"&&_14ad!=null&&_14ad.getGoToMenuItem()){
  24149. _14af=_14ad.getGoToMenuItem().getMenu();
  24150. }
  24151. var _14b0=null;
  24152. var _14b1=this.getSelectionController();
  24153. if(_14ac!=null){
  24154. if(this.doesMoreExist(_14ac)==false){
  24155. if(typeof gMenuSeperator!="undefined"&&_14ac.getNumItems()>0&&(cv.bCanUseCognosViewerIndexSearch||_14ae.indexOf(" RV_TOOLBAR_BUTTONS_GOTO_RELATED_LINKS ")==-1)){
  24156. _14ac.add(gMenuSeperator);
  24157. }
  24158. var _14b2=new CMenuItem(_14ac,RV_RES.RV_MORE,this.getCVObjectRef()+".getDrillMgr().launchGoToPage();","",gMenuItemStyle,cv.getWebContentRoot(),cv.getSkin());
  24159. if(_14ae.indexOf(" RV_TOOLBAR_BUTTONS_GOTO_RELATED_LINKS ")!=-1){
  24160. _14b2.hide();
  24161. }else{
  24162. if(_14b1==null||_14b1.getModelDrillThroughEnabled()==false){
  24163. _14b2.disable();
  24164. }
  24165. }
  24166. }
  24167. }
  24168. if(_14af!=null){
  24169. if(typeof gMenuSeperator!="undefined"&&_14af.getNumItems()>0&&(cv.bCanUseCognosViewerIndexSearch||_14ae.indexOf(" RV_CONTEXT_MENU_GOTO_RELATED_LINKS ")==-1)){
  24170. _14af.add(gMenuSeperator);
  24171. }
  24172. var _14b3=new CMenuItem(_14af,RV_RES.RV_MORE,this.getCVObjectRef()+".getDrillMgr().launchGoToPage();","",gMenuItemStyle,cv.getWebContentRoot(),cv.getSkin());
  24173. if(_14ae.indexOf(" RV_CONTEXT_MENU_GOTO_RELATED_LINKS ")!=-1){
  24174. _14b3.hide();
  24175. }else{
  24176. if(_14b1==null||_14b1.getModelDrillThroughEnabled()==false){
  24177. _14b3.disable();
  24178. }
  24179. }
  24180. }
  24181. if(_14b0!=null&&_14b1!=null){
  24182. var _14b4=_14b1.getAllSelectedObjects();
  24183. if(_14b4==null||_14b4.length===0){
  24184. _14b0.disable();
  24185. }
  24186. }
  24187. if(_14ac!=null){
  24188. _14ac.draw();
  24189. if(_14ac.isVisible()){
  24190. _14ac.show();
  24191. }
  24192. }
  24193. if(_14af!=null){
  24194. _14af.draw();
  24195. if(_14af.isVisible()){
  24196. _14af.show();
  24197. }
  24198. }
  24199. };
  24200. CDrillManager.prototype.ddc=function(evt){
  24201. var node=getNodeFromEvent(evt);
  24202. if(node!=null&&node.getAttribute("ddc")!=="1"){
  24203. node.setAttribute("ddc","1");
  24204. if(node.getAttribute("dtTargets")){
  24205. node.className="dl "+node.className;
  24206. node.setAttribute("href","#");
  24207. return;
  24208. }
  24209. var _14b7=this.getSelectionController();
  24210. if(_14b7!=null){
  24211. var _14b8=_14b7.getSelectionObjectFactory().getSelectionChartObject(node);
  24212. if(_14b8!=null){
  24213. var _14b9=_14b8.getDrillOptions();
  24214. for(var idx=0;idx<_14b9.length;++idx){
  24215. var _14bb=_14b9[idx][0];
  24216. if((node.getAttribute("isChartTitle")==="true"&&_14bb=="1")||_14bb=="3"||_14bb=="2"){
  24217. node.className="dl "+node.className;
  24218. node.setAttribute("href","#");
  24219. break;
  24220. }
  24221. }
  24222. }
  24223. }
  24224. }
  24225. };
  24226. CDrillManager.prototype.buildRvTargetsForSingleDrillThrough=function(_14bc){
  24227. if(typeof _14bc=="undefined"||_14bc==null){
  24228. return null;
  24229. }
  24230. var _14bd=this.getCV().getDrillTargets();
  24231. if(!_14bd||_14bd.length==0){
  24232. return null;
  24233. }
  24234. var _14be=_14bc[0][0];
  24235. if(typeof _14be=="undefined"||_14be==null){
  24236. return null;
  24237. }
  24238. var _14bf=_14bd[_14be];
  24239. if(typeof _14bf=="undefined"||_14bf==null){
  24240. return null;
  24241. }
  24242. var _14c0="<drillTarget drillIdx=\\\""+_14be+"\\\" label=\\\""+_14bf.getLabel()+"\\\"/>";
  24243. return "<rvDrillTargets>"+_14c0+"</rvDrillTargets>";
  24244. };
  24245. CDrillManager.prototype.buildRvTargetsForMultipleDrillThrough=function(_14c1){
  24246. if(typeof _14c1=="undefined"||_14c1==null){
  24247. return null;
  24248. }
  24249. var _14c2=this.getCV().getDrillTargets();
  24250. if(!_14c2||_14c2.length==0){
  24251. return null;
  24252. }
  24253. var _14c3="";
  24254. for(var _14c4=0;_14c4<_14c1.length;++_14c4){
  24255. var _14c5=_14c1[_14c4];
  24256. if(_14c5.length<2){
  24257. continue;
  24258. }
  24259. var _14c6=_14c5[0];
  24260. if(typeof _14c6=="undefined"||_14c6==null){
  24261. continue;
  24262. }
  24263. var _14c7=_14c5[1];
  24264. if(typeof _14c7=="undefined"||_14c7==null){
  24265. continue;
  24266. }
  24267. var _14c8=_14c2[_14c6];
  24268. if(typeof _14c8=="undefined"||_14c8==null){
  24269. continue;
  24270. }
  24271. if(_14c7===null||_14c7===""){
  24272. _14c7=_14c8.getLabel();
  24273. }
  24274. _14c3+="<drillTarget drillIdx=\\\""+_14c6+"\\\" label=\\\""+_14c7+"\\\"/>";
  24275. }
  24276. if(_14c3.length>0){
  24277. return "<rvDrillTargets>"+_14c3+"</rvDrillTargets>";
  24278. }
  24279. return null;
  24280. };
  24281. function CImageMapHighlight(map,_14ca){
  24282. this.m_webContentRoot=_14ca;
  24283. this.createHighlight=CImageMapHighlight.prototype.createHighlightElement;
  24284. this.initialize(map);
  24285. };
  24286. CImageMapHighlight.prototype.initialize=function(map){
  24287. this.m_map=map;
  24288. this.m_areas={};
  24289. this.m_areaNodes={};
  24290. this.m_visibleAreas=[];
  24291. this.initImageBlank();
  24292. this.m_divCanvas=null;
  24293. this.m_creationNode=null;
  24294. this._setMapAreasId();
  24295. this.m_sDefaultFillColour="#F7E1BC";
  24296. this.m_sDefaultStrokeColour="#F0A630";
  24297. this.m_sFillColour=this.m_sDefaultFillColour;
  24298. this.m_sStrokeColour=this.m_sDefaultStrokeColour;
  24299. };
  24300. CImageMapHighlight.prototype.setFillColour=function(_14cc){
  24301. this.m_sFillColour=(!_14cc)?this.m_sDefaultFillColour:_14cc;
  24302. };
  24303. CImageMapHighlight.prototype.getFillColour=function(){
  24304. return this.m_sFillColour;
  24305. };
  24306. CImageMapHighlight.prototype.setStrokeColour=function(_14cd){
  24307. this.m_sStrokeColour=(!_14cd)?this.m_sDefaultStrokeColour:_14cd;
  24308. };
  24309. CImageMapHighlight.prototype.getStrokeColour=function(){
  24310. return this.m_sStrokeColour;
  24311. };
  24312. CImageMapHighlight.prototype.resetColours=function(){
  24313. this.m_sStrokeColour=this.m_sDefaultStrokeColour;
  24314. this.m_sFillColour=this.m_sDefaultFillColour;
  24315. };
  24316. CImageMapHighlight.prototype.initImageBlank=function(){
  24317. var img=this._getChartImageFromMap();
  24318. if(img===null){
  24319. return;
  24320. }
  24321. this.m_img=img;
  24322. this.m_sImageHeight=img.offsetHeight+"px";
  24323. this.m_sImageWidth=img.offsetWidth+"px";
  24324. this.m_sUseMap=img.getAttribute("usemap");
  24325. this.m_imgLid=img.getAttribute("lid");
  24326. this.m_imgBlank=img.ownerDocument.createElement("IMG");
  24327. this.m_imgBlank.src=this.m_webContentRoot+"/rv/images/blank.gif";
  24328. this.m_imgBlank.style.height=this.m_sImageHeight;
  24329. this.m_imgBlank.style.width=this.m_sImageWidth;
  24330. this.m_imgBlank.style.position="absolute";
  24331. this.m_imgBlank.border="0";
  24332. this.m_imgBlank.useMap=this.m_sUseMap;
  24333. this.m_imgBlank.setAttribute("lid",this.m_imgLid);
  24334. this.m_imgBlank.setAttribute("rsvpchart",img.getAttribute("rsvpchart"));
  24335. this.m_imgBlank.alt=img.alt;
  24336. if(this.m_bShowPointer){
  24337. this.m_imgBlank.style.cursor="auto";
  24338. }
  24339. this.m_imgBlank.v_bIsBlankImageMapImg=true;
  24340. img.parentNode.insertBefore(this.m_imgBlank,img);
  24341. this.f_copyStyle(img,this.m_imgBlank);
  24342. this.m_imgBlank.style.borderColor="transparent";
  24343. };
  24344. CImageMapHighlight.prototype._getChartImageFromMap=function(){
  24345. var map=this.m_map;
  24346. var _14d0=null;
  24347. var _14d1=null;
  24348. var _14d2=map.nextSibling;
  24349. while(_14d2){
  24350. if(_14d2.tagName=="DIV"){
  24351. var _14d3=_14d2.firstChild;
  24352. while(_14d3){
  24353. if((_14d3.tagName=="SPAN"||_14d3.tagName=="DIV")&&_14d3.getAttribute("chartcontainer")=="true"){
  24354. _14d1=_14d3;
  24355. break;
  24356. }
  24357. _14d3=_14d3.nextSibling;
  24358. }
  24359. }
  24360. if(_14d1){
  24361. break;
  24362. }
  24363. _14d2=_14d2.nextSibling;
  24364. }
  24365. if(_14d1){
  24366. var _14d4=_14d1.children;
  24367. var _14d5=_14d4.length;
  24368. for(var i=0;i<_14d5;i++){
  24369. var el=_14d4[i];
  24370. if(el.tagName=="IMG"&&el.getAttribute("rsvpchart")=="true"&&el.getAttribute("usemap")=="#"+map.name){
  24371. _14d0=el;
  24372. break;
  24373. }
  24374. }
  24375. }
  24376. return _14d0;
  24377. };
  24378. CImageMapHighlight.prototype._AREA_ID="aid";
  24379. CImageMapHighlight.prototype._setMapAreasId=function(){
  24380. var _14d8=this.m_map.getAttribute("lid")+"_";
  24381. var areas=this.m_map.childNodes;
  24382. var _14da=areas.length;
  24383. for(var i=0;i<_14da;i++){
  24384. var a=areas[i];
  24385. var id=_14d8+i;
  24386. a.setAttribute(this._AREA_ID,id);
  24387. this.m_areaNodes[id]=a;
  24388. }
  24389. };
  24390. CImageMapHighlight.prototype.isAreaInitialized=function(area){
  24391. return (area.getAttribute(this._AREA_ID)===null?false:true);
  24392. };
  24393. CImageMapHighlight.prototype.getAreaId=function(area){
  24394. var _14e0=area.getAttribute(this._AREA_ID);
  24395. if(_14e0===null){
  24396. this.initialize(area.parentNode);
  24397. _14e0=area.getAttribute(this._AREA_ID);
  24398. }
  24399. return _14e0+this.getFillColour();
  24400. };
  24401. CImageMapHighlight.prototype.getAreaFromId=function(_14e1){
  24402. return this.m_areaNodes[_14e1];
  24403. };
  24404. CImageMapHighlight.prototype.highlightArea=function(area,_14e3){
  24405. var _14e4=this.getAreaId(area);
  24406. if(!_14e3){
  24407. var _14e5=this.m_visibleAreas;
  24408. var _14e6=_14e5.length;
  24409. for(var i=0;i<_14e6;i++){
  24410. if(_14e4!=_14e5[i]){
  24411. this.hideAreaById(_14e5[i]);
  24412. }
  24413. }
  24414. this.m_visibleAreas=[];
  24415. }
  24416. this._highlightArea(area);
  24417. };
  24418. CImageMapHighlight.prototype.highlightAreas=function(areas,_14e9){
  24419. if(!_14e9){
  24420. this.hideAllAreas();
  24421. }
  24422. this._highlightAreas(areas);
  24423. };
  24424. CImageMapHighlight.prototype._highlightAreas=function(areas){
  24425. var _14eb=areas.length;
  24426. for(var i=0;i<_14eb;i++){
  24427. this._highlightArea(areas[i]);
  24428. }
  24429. };
  24430. CImageMapHighlight.prototype._highlightArea=function(area){
  24431. var _14ee=this.getAreaId(area);
  24432. if(!this.highlightAreaExists(_14ee)){
  24433. var _14ef=this.createHighlight(area);
  24434. if(_14ef){
  24435. this.m_areas[_14ee]=_14ef;
  24436. _14ef.style.visibility="visible";
  24437. area.setAttribute("highlighted","true");
  24438. }
  24439. }else{
  24440. if(this.m_areas[_14ee].style.visibility=="hidden"){
  24441. this.m_areas[_14ee].style.visibility="visible";
  24442. area.setAttribute("highlighted","true");
  24443. }
  24444. }
  24445. this.m_visibleAreas.push(_14ee);
  24446. };
  24447. CImageMapHighlight.prototype.highlightAreaExists=function(_14f0){
  24448. return this.m_areas[_14f0]?true:false;
  24449. };
  24450. CImageMapHighlight.prototype.hideAreaById=function(_14f1){
  24451. if(this.m_areas[_14f1]&&this.m_areas[_14f1].style.visibility){
  24452. this.m_areas[_14f1].style.visibility="hidden";
  24453. }
  24454. };
  24455. CImageMapHighlight.prototype.hideAreas=function(areas){
  24456. var _14f3=areas.length;
  24457. for(var i=0;i<_14f3;i++){
  24458. this.hideArea(areas[i]);
  24459. }
  24460. };
  24461. CImageMapHighlight.prototype.hideArea=function(area){
  24462. this.hideAreaById(this.getAreaId(area));
  24463. area.setAttribute("highlighted","false");
  24464. };
  24465. CImageMapHighlight.prototype.hideAllAreas=function(){
  24466. var _14f6=this.m_visibleAreas;
  24467. var _14f7=_14f6.length;
  24468. for(var i=0;i<_14f7;i++){
  24469. this.hideAreaById(_14f6[i]);
  24470. var _14f9=this.getAreaFromId(_14f6[i]);
  24471. if(_14f9){
  24472. _14f9.setAttribute("highlighted","false");
  24473. }
  24474. }
  24475. this.m_visibleAreas=[];
  24476. };
  24477. CImageMapHighlight.prototype.isAreaHighlighted=function(area){
  24478. var _14fb=this.getAreaId(area);
  24479. return this.m_areas[_14fb]&&this.m_areas[_14fb].style.visibility=="visible";
  24480. };
  24481. CImageMapHighlight.prototype.removeAreaHighlights=function(areas){
  24482. };
  24483. CImageMapHighlight.prototype.removeAllAreaHighlights=function(){
  24484. };
  24485. CImageMapHighlight.prototype.destroy=function(area){
  24486. this.removeAllAreaHighlights();
  24487. };
  24488. CImageMapHighlight.prototype.createHighlightElement=function(_14fe,_14ff){
  24489. var doc=_14fe.ownerDocument;
  24490. if(!this.m_divCanvas){
  24491. for(var _1501=this.m_img.parentNode;_1501;_1501=_1501.parentNode){
  24492. if((_1501.nodeName=="DIV")&&(_1501.getAttribute("sSpecName")=="block")){
  24493. var _1502=doc.defaultView.getComputedStyle(_1501,null);
  24494. var _1503=_1502.overflow;
  24495. if((_1503=="auto")||(_1503=="scroll")&&(_1502.position!="relative")){
  24496. _1501.style.position="relative";
  24497. }
  24498. }
  24499. }
  24500. this.m_divCanvas=doc.createElementNS("http://www.w3.org/2000/svg","svg");
  24501. this.m_divCanvas.style.height=this.m_sImageHeight;
  24502. this.m_divCanvas.style.width=this.m_sImageWidth;
  24503. this.m_divCanvas.style.position="absolute";
  24504. this.m_img.parentNode.insertBefore(this.m_divCanvas,this.m_imgBlank);
  24505. this.f_copyStyle(this.m_imgBlank,this.m_divCanvas);
  24506. this.m_divCanvas.style.display=this.m_bHiddenCanvas?"none":"block";
  24507. }
  24508. var _1504=doc.createElementNS("http://www.w3.org/2000/svg","polyline");
  24509. var _1505=_14fe.getAttribute("coords");
  24510. _1504.setAttribute("points",_14fe.getAttribute("coords")+" "+_1505.substr(0,_1505.indexOf(",",_1505.indexOf(",")+1)));
  24511. _1504.style.position="absolute";
  24512. _1504.style.top="0px";
  24513. _1504.style.left="0px";
  24514. _1504.style.visibility="hidden";
  24515. _1504.setAttribute("stroke",_14ff?"#F7CB83":this.getStrokeColour());
  24516. _1504.setAttribute("stroke-width",(_14fe.getAttribute("type")=="legendLabel")?"1pt":"1.75pt");
  24517. _1504.setAttribute("fill",_14ff?"#F7E1BC":this.getFillColour());
  24518. _1504.setAttribute("fill-opacity","0.4");
  24519. this.m_divCanvas.appendChild(_1504);
  24520. return _1504;
  24521. };
  24522. CImageMapHighlight.prototype.f_copyStyle=function(_1506,_1507){
  24523. var a=["margin","marginTop","marginRight","marginBottom","marginLeft","border","borderTop","borderRight","borderBottom","borderLeft"];
  24524. var _1509=a.length;
  24525. for(var i=0;i<_1509;i++){
  24526. var _150b=a[i];
  24527. var _150c=_1506.style[_150b];
  24528. if(_150c){
  24529. _1507.style[_150b]=_150c;
  24530. }
  24531. }
  24532. };
  24533. function CSelectionXml(_150d,_150e,_150f){
  24534. this.queries={};
  24535. this.burstContext=_150d||"";
  24536. this.expressionLocale=_150e||"";
  24537. this.contentLocale=_150f||"";
  24538. };
  24539. function SC_SingleSelection(){
  24540. this.rows=[];
  24541. this.cols=[];
  24542. this.sections=[];
  24543. this.measures=[];
  24544. this.layoutElementId="";
  24545. };
  24546. function SC_SingleQuery(){
  24547. this.selections=[];
  24548. this.slicers=[];
  24549. this.filters=[];
  24550. };
  24551. function SC_SingleSlicer(){
  24552. };
  24553. function SC_SingleDetailFilter(){
  24554. };
  24555. function SC_SingleSummaryFilter(){
  24556. };
  24557. CSelectionXml.prototype.BuildSelectionFromController=function(sc){
  24558. if(sc){
  24559. var _1511=sc.getAllSelectedObjects();
  24560. for(var s=0;s<_1511.length;++s){
  24561. var _1513=_1511[s];
  24562. var _1514=_1513.getSelectedContextIds();
  24563. var muns=_1513.getMuns();
  24564. var _1516=muns.length;
  24565. var _1517=new SC_SingleSelection();
  24566. _1517.layoutElementId=_1513.getLayoutElementId();
  24567. var _1518=null;
  24568. for(var i=0;i<_1516;++i){
  24569. var j,ctxId,_151c;
  24570. if(i===0&&_1516===1){
  24571. for(j=0;j<muns[i].length;++j){
  24572. ctxId=_1514[i][j];
  24573. if(ctxId!=0){
  24574. if(j===0){
  24575. _1518=sc.getRefQuery(ctxId);
  24576. _151c=_1513.getDisplayValues()[j];
  24577. this._buildMeasureSelection(sc,ctxId,_1517.measures,_151c,j,_1513.getLayoutType());
  24578. }else{
  24579. if(sc.getUsageInfo(ctxId)!=2){
  24580. this._buildEdgeSelection(sc,ctxId,_1517.cols,j);
  24581. }
  24582. }
  24583. }
  24584. }
  24585. }else{
  24586. for(j=0;j<muns[i].length;++j){
  24587. ctxId=_1514[i][j];
  24588. if(ctxId!=0){
  24589. if(i===0){
  24590. _151c=_1513.getDisplayValues()[j];
  24591. _1518=sc.getRefQuery(ctxId);
  24592. this._buildMeasureSelection(sc,ctxId,_1517.measures,_151c,j,_1513.getLayoutType());
  24593. }else{
  24594. if(i===1){
  24595. this._buildEdgeSelection(sc,ctxId,_1517.rows,j);
  24596. }else{
  24597. if(i===2){
  24598. this._buildEdgeSelection(sc,ctxId,_1517.cols,j);
  24599. }else{
  24600. this._buildSectionSelection(sc,ctxId,_1517.sections,j);
  24601. }
  24602. }
  24603. }
  24604. }
  24605. }
  24606. }
  24607. }
  24608. this.AddSelection(_1518,_1517);
  24609. }
  24610. }
  24611. };
  24612. CSelectionXml.prototype.AddSelection=function(_151d,_151e){
  24613. if(!this.queries[_151d]){
  24614. this.queries[_151d]=new SC_SingleQuery();
  24615. }
  24616. this.queries[_151d].selections.push(_151e);
  24617. };
  24618. CSelectionXml.prototype._buildMeasureSelection=function(sc,ctxId,_1521,_1522,idx,_1524){
  24619. if(_1524==""||_1524==null){
  24620. _1524="datavalue";
  24621. }
  24622. if(ctxId){
  24623. _1521.push({name:sc.getRefDataItem(ctxId),values:[{use:sc.getUseValue(ctxId),display:_1522}],order:idx,hun:sc.getHun(ctxId),dataType:_1524,usage:sc.getUsageInfo(ctxId),dtype:sc.getDataType(ctxId),selection:"true"});
  24624. }
  24625. };
  24626. CSelectionXml.prototype._buildEdgeSelection=function(sc,ctxId,edges,idx){
  24627. if(ctxId){
  24628. edges.push({name:sc.getRefDataItem(ctxId),values:[{use:this.getUseValue(sc,ctxId),display:sc.getDisplayValue(ctxId)}],order:idx,lun:sc.getLun(ctxId),hun:sc.getHun(ctxId),dataType:"columnTitle",usage:sc.getUsageInfo(ctxId),dtype:sc.getDataType(ctxId)});
  24629. }
  24630. };
  24631. CSelectionXml.prototype._buildSectionSelection=function(sc,ctxId,_152b,idx){
  24632. if(ctxId){
  24633. _152b.push({name:sc.getRefDataItem(ctxId),values:[{use:this.getUseValue(sc,ctxId),display:sc.getDisplayValue(ctxId)}],order:idx,lun:sc.getLun(ctxId),hun:sc.getHun(ctxId),dataType:"section",usage:sc.getUsageInfo(ctxId),dtype:sc.getDataType(ctxId),queryRef:sc.getRefQuery(ctxId)});
  24634. }
  24635. };
  24636. CSelectionXml.prototype.getUseValue=function(sc,ctxId){
  24637. var _152f=sc.getMun(ctxId);
  24638. if(_152f==""){
  24639. _152f=sc.getUseValue(ctxId);
  24640. }
  24641. return _152f;
  24642. };
  24643. CSelectionXml.prototype.toXml=function(){
  24644. var _1530=XMLBuilderCreateXMLDocument("selections");
  24645. var _1531=_1530.documentElement;
  24646. XMLBuilderSetAttributeNodeNS(_1531,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
  24647. XMLBuilderSetAttributeNodeNS(_1531,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
  24648. XMLBuilderSetAttributeNodeNS(_1531,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
  24649. XMLBuilderSetAttributeNodeNS(_1531,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
  24650. XMLBuilderSetAttributeNodeNS(_1531,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  24651. _1531.setAttribute("contentLocale",this.contentLocale);
  24652. _1531.setAttribute("expressionLocale",this.expressionLocale);
  24653. for(var q in this.queries){
  24654. this._queryToXml(_1531,q,this.queries[q]);
  24655. }
  24656. this._burstToXml(_1531);
  24657. return XMLBuilderSerializeNode(_1530);
  24658. };
  24659. CSelectionXml.prototype._queryToXml=function(_1533,name,obj){
  24660. var _1536=_1533.ownerDocument.createElement("query");
  24661. _1536.setAttribute("name",name);
  24662. for(var _1537=0;_1537<obj.selections.length;++_1537){
  24663. this._selectionToXml(_1536,obj.selections[_1537]);
  24664. }
  24665. for(var _1538=0;_1538<obj.slicers.length;++_1538){
  24666. this._slicersToXml(_1536,obj.slicers[_1538]);
  24667. }
  24668. for(var _1539=0;_1539<obj.selections.length;++_1539){
  24669. this._filtersToXml(_1536,obj.selections[_1539]);
  24670. }
  24671. _1533.appendChild(_1536);
  24672. };
  24673. CSelectionXml.prototype._selectionToXml=function(_153a,_153b){
  24674. var doc=_153a.ownerDocument;
  24675. var _153d=doc.createElement("selection");
  24676. _153a.appendChild(_153d);
  24677. this._edgeToXml(_153d,"row",_153b.rows);
  24678. this._edgeToXml(_153d,"column",_153b.cols);
  24679. this._edgeToXml(_153d,"measure",_153b.measures);
  24680. this._edgeToXml(_153d,"section",_153b.sections);
  24681. var _153e=doc.createElement("layoutElementId");
  24682. _153e.appendChild(doc.createTextNode(_153b.layoutElementId));
  24683. _153d.appendChild(_153e);
  24684. };
  24685. CSelectionXml.prototype._edgeToXml=function(_153f,sEdge,_1541){
  24686. var doc=_153f.ownerDocument;
  24687. var _1543=doc.createElement(sEdge+"s");
  24688. _153f.appendChild(_1543);
  24689. for(var i=0;i<_1541.length;++i){
  24690. var _1545=doc.createElement(sEdge);
  24691. _1543.appendChild(_1545);
  24692. var edge=_1541[i];
  24693. for(var j in edge){
  24694. if(j!=="name"&&j!=="values"){
  24695. _1545.setAttribute(j,edge[j]!==null?edge[j]:"");
  24696. }
  24697. }
  24698. this._itemToXml(_1545,edge.name,edge.values);
  24699. }
  24700. };
  24701. CSelectionXml.prototype._itemToXml=function(_1548,name,_154a){
  24702. var doc=_1548.ownerDocument;
  24703. var _154c=doc.createElement("item");
  24704. XMLBuilderSetAttributeNodeNS(_154c,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
  24705. var _154d=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",doc);
  24706. XMLBuilderSetAttributeNodeNS(_154d,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  24707. _154d.appendChild(doc.createTextNode(name));
  24708. _154c.appendChild(_154d);
  24709. var _154e=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",doc);
  24710. XMLBuilderSetAttributeNodeNS(_154e,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  24711. XMLBuilderSetAttributeNodeNS(_154e,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
  24712. _154c.appendChild(_154e);
  24713. for(var j=0;j<_154a.length;j++){
  24714. var _1550=doc.createElement("item");
  24715. XMLBuilderSetAttributeNodeNS(_1550,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
  24716. var _1551=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",doc);
  24717. XMLBuilderSetAttributeNodeNS(_1551,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  24718. if(_154a[j].use){
  24719. _1551.appendChild(doc.createTextNode(_154a[j].use));
  24720. }else{
  24721. if(_154a[j].display){
  24722. _1551.appendChild(doc.createTextNode(_154a[j].display));
  24723. }else{
  24724. _1551.appendChild(doc.createTextNode(""));
  24725. }
  24726. }
  24727. var _1552=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",doc);
  24728. XMLBuilderSetAttributeNodeNS(_1552,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
  24729. if(_154a[j].display){
  24730. _1552.appendChild(doc.createTextNode(_154a[j].display));
  24731. }else{
  24732. _1552.appendChild(doc.createTextNode(""));
  24733. }
  24734. _1550.appendChild(_1551);
  24735. _1550.appendChild(_1552);
  24736. _154e.appendChild(_1550);
  24737. }
  24738. _1548.appendChild(_154c);
  24739. };
  24740. CSelectionXml.prototype._burstToXml=function(_1553){
  24741. var doc=_1553.ownerDocument;
  24742. var _1555=doc.createElement("burst-context");
  24743. _1555.appendChild(doc.createTextNode(this.burstContext));
  24744. _1553.appendChild(_1555);
  24745. };
  24746. CSelectionXml.prototype._slicersToXml=function(_1556,_1557){
  24747. };
  24748. CSelectionXml.prototype._filtersToXml=function(_1558,_1559){
  24749. };
  24750. CSubscriptionManager.k_SubscriptionWizardName="subscriptionWizard";
  24751. function CSubscriptionManager(cv){
  24752. this.m_cv=cv;
  24753. this.m_bInitialized=false;
  24754. this.m_aWatchRules=null;
  24755. this.m_sEmail="";
  24756. this.m_sAlertNewVersionConfirm="";
  24757. this.m_sQueryNotificationResponse="";
  24758. this.m_bAllowNotification=false;
  24759. this.m_bAllowSubscription=false;
  24760. this.m_bCanCreateNewWatchRule=false;
  24761. this.m_bCanGetNotified=false;
  24762. this.m_bAllowAnnotations=false;
  24763. this.m_bCanCreateAnnotations=false;
  24764. this.m_windowOptions="width=450,height=350,toolbar=0,location=0,status=0,menubar=0,resizable,scrollbars=1";
  24765. };
  24766. CSubscriptionManager.prototype.getViewer=function(){
  24767. return this.m_cv;
  24768. };
  24769. CSubscriptionManager.prototype.Initialize=function(_155b){
  24770. try{
  24771. var _155c=_155b.getJSONResponseObject();
  24772. var _155d=document.forms["formWarpRequest"+this.m_cv.getId()];
  24773. if(_155c["annotationInfo"]){
  24774. var _155e=_155c["annotationInfo"];
  24775. this.m_AnnotationsCount=_155e.annotations.length;
  24776. this.m_annotations=_155e.annotations;
  24777. this.m_bAllowAnnotations=_155e.allowAnnotations;
  24778. this.m_bCanCreateAnnotations=_155e.traverse=="true";
  24779. return true;
  24780. }
  24781. if(_155c["subscriptionInfo"]){
  24782. var _155f=_155c["subscriptionInfo"];
  24783. if(!this.m_bInitialized){
  24784. this.m_sEmail=_155f.sEmail;
  24785. this.m_bAllowNotification=_155f.bAllowNotification;
  24786. this.m_bAllowSubscription=_155f.bAllowSubscription;
  24787. this.m_sAlertNewVersionConfirm=_155f.sAlertNewVersionConfirm;
  24788. if(_155d["ui.action"]&&_155d["ui.action"].value=="view"){
  24789. if(_155d["ui.format"]){
  24790. this.m_bCanCreateNewWatchRule=(_155d["ui.format"].value=="HTML")&&this.m_cv.bCanUseCognosViewerConditionalSubscriptions&&this.m_bAllowSubscription;
  24791. }
  24792. this.m_bCanGetNotified=(!_155d["ui.burstKey"]||(_155d["ui.burstKey"]&&_155d["ui.burstKey"].value==""))&&this.m_bAllowNotification;
  24793. }
  24794. }
  24795. if(_155f.sQueryNotificationResponse){
  24796. this.m_sQueryNotificationResponse=_155f.sQueryNotificationResponse;
  24797. }
  24798. if(_155f.aWatchRules){
  24799. var _1560=_155f.aWatchRules;
  24800. this.m_aWatchRules=[];
  24801. for(var i=0;i<_1560.length;i++){
  24802. this.m_aWatchRules.push(_1560[i]);
  24803. }
  24804. }
  24805. this.m_bInitialized=true;
  24806. return true;
  24807. }
  24808. }
  24809. catch(exception){
  24810. return false;
  24811. }
  24812. return false;
  24813. };
  24814. CSubscriptionManager.prototype.IsValidSelectionForNewRule=function(){
  24815. var _1562=this.m_cv.getSelectionController();
  24816. if(_1562&&!_1562.hasSelectedChartNodes()){
  24817. var _1563=_1562.getAllSelectedObjects();
  24818. if(_1563.length===1){
  24819. if(_1563[0]!=null&&_1563[0].getLayoutType()!="columnTitle"){
  24820. return true;
  24821. }
  24822. }
  24823. }
  24824. return false;
  24825. };
  24826. CSubscriptionManager.prototype.CanCreateNewWatchRule=function(){
  24827. if(typeof this.m_cv.UIBlacklist!="undefined"&&this.m_cv.UIBlacklist.indexOf(" RV_TOOLBAR_BUTTONS_ALERT_USING_NEW_WATCH_RULE ")!=-1){
  24828. return false;
  24829. }
  24830. if(!this.m_bInitialized&&this.getViewer().envParams["ui.action"]=="view"){
  24831. var oCV=this.getViewer();
  24832. var _1565=new JSONDispatcherEntry(oCV);
  24833. _1565.setKey("subscriptionManager");
  24834. _1565.forceSynchronous();
  24835. _1565.addFormField("ui.action","getSubscriptionInfo");
  24836. _1565.addFormField("cv.responseFormat","subscriptionManager");
  24837. _1565.addFormField("contextMenu","true");
  24838. this.addCommonFormFields(_1565);
  24839. _1565.setCallbacks({"complete":{"object":this,"method":this.Initialize}});
  24840. oCV.dispatchRequest(_1565);
  24841. }
  24842. return this.m_bCanCreateNewWatchRule;
  24843. };
  24844. CSubscriptionManager.prototype.CanModifyWatchRule=function(){
  24845. return this.m_cv.bCanUseCognosViewerConditionalSubscriptions&&this.m_bAllowSubscription;
  24846. };
  24847. CSubscriptionManager.prototype.CanGetNotified=function(){
  24848. if(typeof this.m_cv.UIBlacklist!="undefined"&&this.m_cv.UIBlacklist.indexOf(" RV_TOOLBAR_BUTTONS_ALERT_ABOUT_NEW_VERSIONS ")!=-1){
  24849. return false;
  24850. }
  24851. return this.m_bCanGetNotified;
  24852. };
  24853. CSubscriptionManager.prototype.UpdateSubscribeMenu=function(){
  24854. var _1566=this.getStandaloneViewerToolbarControl();
  24855. var _1567=_1566?_1566.getItem("watchNewVersions"):null;
  24856. var _1568=this.m_cv.getWebContentRoot();
  24857. var sSkin=this.m_cv.getSkin();
  24858. if(_1567){
  24859. var _156a=_1567.getMenu();
  24860. this.ClearSubscriptionMenu();
  24861. var _156b=false;
  24862. if(this.CanGetNotified()){
  24863. if(this.m_sQueryNotificationResponse=="on"){
  24864. new CMenuItem(_156a,RV_RES.RV_DO_NOT_ALERT_NEW_VERSION,"javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().DeleteNotification();",_1568+"/rv/images/action_remove_from_list.gif",gMenuItemStyle,_1568,sSkin);
  24865. _156b=true;
  24866. }else{
  24867. if(this.m_sQueryNotificationResponse=="off"&&this.m_sEmail!=""){
  24868. new CMenuItem(_156a,RV_RES.RV_ALERT_NEW_VERSION,"javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().AddNotification();",_1568+"/rv/images/action_add_to_list.gif",gMenuItemStyle,_1568,sSkin);
  24869. _156b=true;
  24870. }
  24871. }
  24872. }
  24873. if(this.CanCreateNewWatchRule()){
  24874. if(_156b){
  24875. _156a.add(gMenuSeperator);
  24876. }
  24877. var _156c=new CMenuItem(_156a,RV_RES.RV_NEW_WATCH_RULE,"javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().NewSubscription();",_1568+"/rv/images/action_new_subscription.gif",gMenuItemStyle,_1568,sSkin);
  24878. if(!this.IsValidSelectionForNewRule()){
  24879. _156c.disable();
  24880. }
  24881. _156b=true;
  24882. }
  24883. var _156d="";
  24884. if(typeof this.m_cv.UIBlacklist!="undefined"){
  24885. _156d=this.m_cv.UIBlacklist;
  24886. }
  24887. var _156e;
  24888. if(_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES ")==-1){
  24889. if(_156b){
  24890. _156a.add(gMenuSeperator);
  24891. }
  24892. if(this.m_aWatchRules&&this.m_aWatchRules.length>0){
  24893. var _156f=this.CanModifyWatchRule();
  24894. for(var sub=0;sub<this.m_aWatchRules.length;++sub){
  24895. var menu=new CMenuItem(_156a,this.m_aWatchRules[sub].name,"",_1568+"/rv/images/icon_subscription.gif",gMenuItemStyle,_1568,sSkin);
  24896. var _1572=menu.createCascadedMenu(gMenuStyle);
  24897. _1572.m_oCV=this.m_cv;
  24898. if(_156f&&_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES_MODIFY ")==-1){
  24899. new CMenuItem(_1572,RV_RES.RV_MODIFY_WATCH_RULE,this.m_cv.getObjectId()+".getSubscriptionManager().ModifySubscription("+sub+");",_1568+"/rv/images/action_edit.gif",gMenuItemStyle,_1568,sSkin);
  24900. }
  24901. if(_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES_DELETE ")==-1){
  24902. new CMenuItem(_1572,RV_RES.RV_DELETE_WATCH_RULE,this.m_cv.getObjectId()+".getSubscriptionManager().DeleteSubscription("+sub+");",_1568+"/rv/images/action_delete.gif",gMenuItemStyle,_1568,sSkin);
  24903. }
  24904. }
  24905. }else{
  24906. _156e=new CMenuItem(_156a,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_1568,sSkin);
  24907. _156e.disable();
  24908. }
  24909. }
  24910. if(_156a.getNumItems()==0){
  24911. _156e=new CMenuItem(_156a,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_1568,sSkin);
  24912. _156e.disable();
  24913. }
  24914. _156a.setForceCallback(false);
  24915. _156a.draw();
  24916. if(_156a.isVisible()){
  24917. _156a.show();
  24918. }
  24919. _156a.setForceCallback(true);
  24920. }
  24921. };
  24922. CSubscriptionManager.prototype.UpdateAnnotationMenu=function(){
  24923. var _1573=this.getStandaloneViewerToolbarControl();
  24924. var _1574=_1573?_1573.getItem("addAnnotations"):null;
  24925. var _1575=this.m_cv.getWebContentRoot();
  24926. var sSkin=this.m_cv.getSkin();
  24927. var _1577=_1574.getMenu();
  24928. this.ClearAnnotationMenu();
  24929. var menu=new CMenuItem(_1577,RV_RES.RV_NEW_COMMENT,"javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().NewAnnotation();",_1575+"/rv/images/action_comment_add.gif",gMenuItemStyle,_1575,sSkin);
  24930. var _1579=this.m_annotations.length;
  24931. if(_1579>0){
  24932. _1577.add(gMenuSeperator);
  24933. }
  24934. if(!this.m_bAllowAnnotations||!this.m_bCanCreateAnnotations){
  24935. menu.disable();
  24936. }
  24937. var _157a;
  24938. var bidi=isViewerBidiEnabled()?BidiUtils.getInstance():null;
  24939. for(var i=0;i<_1579;i++){
  24940. var _157d=this.m_annotations[i].defaultName;
  24941. _157a=_157d.length>60?_157d.substring(0,60)+"...":_157d;
  24942. if(isViewerBidiEnabled()){
  24943. _157a=bidi.btdInjectUCCIntoStr(_157a,getViewerBaseTextDirection());
  24944. }
  24945. var _157e=Boolean(this.m_annotations[i].permissions.read);
  24946. var _157f=Boolean(this.m_annotations[i].permissions.write);
  24947. var _1580=Boolean(this.m_annotations[i].permissions.traverse)&&Boolean(this.m_annotations[i].permissions.write);
  24948. var _1581="javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().ViewAnnotation("+i+");";
  24949. var _1582="javascript:alert('Permission denied')";
  24950. _1581=_157e?_1581:_1582;
  24951. if(i>0&&this.m_annotations[i].layoutElementId!=this.m_annotations[i-1].layoutElementId){
  24952. _1577.add(gMenuSeperator);
  24953. }
  24954. var _1583="/rv/images/action_comment.gif";
  24955. if(this.m_annotations[i].layoutElementId!=""){
  24956. _1583="/rv/images/action_subscribe.gif";
  24957. }
  24958. menu=new CMenuItem(_1577,_157a,_1581,_1575+_1583,gMenuItemStyle,_1575,sSkin);
  24959. var _1584=menu.createCascadedMenu(gMenuStyle);
  24960. var _1585=new CInfoPanel("300px",_1575,_1584.getId()+"_comments");
  24961. _1585.setParent(_1584);
  24962. _157d=this.m_annotations[i].defaultName;
  24963. var _1586=_157d.length>60?_157d.substring(0,60)+"...":_157d;
  24964. if(isViewerBidiEnabled()){
  24965. _1586=bidi.btdInjectUCCIntoStr(_1586,getViewerBaseTextDirection());
  24966. }
  24967. _1585.addProperty(RV_RES.RV_VIEW_COMMENT_NAME,html_encode(_1586));
  24968. _1585.addSpacer(4);
  24969. var cmnt=this.m_annotations[i].description;
  24970. var _1588=cmnt.length>590?cmnt.substring(0,590)+"...":cmnt;
  24971. if(isViewerBidiEnabled()){
  24972. _1588=bidi.btdInjectUCCIntoStr(_1588,getViewerBaseTextDirection());
  24973. }
  24974. _1585.addProperty(RV_RES.RV_VIEW_COMMENT_CONTENTS,replaceNewLine(html_encode(_1588)));
  24975. _1585.addSpacer(4);
  24976. var _1589=this.m_annotations[i].modificationTime;
  24977. if(isViewerBidiEnabled()){
  24978. _1589=bidi.btdInjectUCCIntoStr(_1589,getViewerBaseTextDirection());
  24979. }
  24980. _1585.addProperty(RV_RES.RV_VIEW_COMMENT_MODTIME,_1589);
  24981. var _158a=this.m_annotations[i].owner.defaultName;
  24982. if(isViewerBidiEnabled()){
  24983. _158a=bidi.btdInjectUCCIntoStr(_158a,getViewerBaseTextDirection());
  24984. }
  24985. _1585.addProperty(RV_RES.RV_VIEW_COMMENT_OWNER,_158a);
  24986. _1584.add(_1585);
  24987. if(_157f||_1580){
  24988. _1584.add(gMenuSeperator);
  24989. }
  24990. new CMenuItem(_1584,RV_RES.RV_VIEW_COMMENT,this.m_cv.getObjectId()+".getSubscriptionManager().ViewAnnotation("+i+");",_1575+"/rv/images/action_comment_view.gif",gMenuItemStyle,_1575,sSkin);
  24991. if(_157f){
  24992. new CMenuItem(_1584,RV_RES.RV_MODIFY_WATCH_RULE,this.m_cv.getObjectId()+".getSubscriptionManager().ModifyAnnotation("+i+");",_1575+"/rv/images/action_comment_modify.gif",gMenuItemStyle,_1575,sSkin);
  24993. }
  24994. if(_1580){
  24995. new CMenuItem(_1584,RV_RES.RV_DELETE_WATCH_RULE,this.m_cv.getObjectId()+".getSubscriptionManager().DeleteAnnotation("+i+");",_1575+"/rv/images/action_comment_delete.gif",gMenuItemStyle,_1575,sSkin);
  24996. }
  24997. }
  24998. _1577.setForceCallback(false);
  24999. _1577.draw();
  25000. if(_1577.isVisible()){
  25001. _1577.show();
  25002. }
  25003. _1577.setForceCallback(true);
  25004. };
  25005. CSubscriptionManager.prototype.AddNotification=function(){
  25006. alert(this.m_sAlertNewVersionConfirm);
  25007. var oCV=this.getViewer();
  25008. var _158c=new DataDispatcherEntry(oCV);
  25009. _158c.setKey("subscriptionManager");
  25010. _158c.addFormField("ui.action","addNotification");
  25011. _158c.addFormField("cv.responseFormat","data");
  25012. this.addCommonFormFields(_158c);
  25013. oCV.dispatchRequest(_158c);
  25014. };
  25015. CSubscriptionManager.prototype.DeleteNotification=function(){
  25016. alert(RV_RES.RV_DO_NOT_ALERT_NEW_VERSION_CONFIRM);
  25017. var oCV=this.getViewer();
  25018. var _158e=new DataDispatcherEntry(oCV);
  25019. _158e.setKey("subscriptionManager");
  25020. _158e.addFormField("ui.action","deleteNotification");
  25021. _158e.addFormField("cv.responseFormat","data");
  25022. this.addCommonFormFields(_158e);
  25023. oCV.dispatchRequest(_158e);
  25024. };
  25025. CSubscriptionManager.prototype.NewAnnotation=function(){
  25026. var oFWR=document.forms["formWarpRequest"+this.m_cv.getId()];
  25027. var _1590=oFWR["ui.object"].value;
  25028. var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
  25029. GUtil.createFormField(form,"ui.object",_1590);
  25030. GUtil.createFormField(form,"b_action","xts.run");
  25031. GUtil.createFormField(form,"m","rv/annotation1.xts");
  25032. GUtil.createFormField(form,"backURL","javascript:window.close();");
  25033. GUtil.createFormField(form,"action_hint","create");
  25034. var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
  25035. window.open(sPath,form.target,this.m_windowOptions);
  25036. };
  25037. CSubscriptionManager.prototype.ViewAnnotation=function(idx){
  25038. var sub=this.m_annotations[idx];
  25039. var _1595=sub.searchPath;
  25040. var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
  25041. GUtil.createFormField(form,"ui.object",_1595);
  25042. GUtil.createFormField(form,"b_action","xts.run");
  25043. GUtil.createFormField(form,"m","rv/annotation1.xts");
  25044. GUtil.createFormField(form,"backURL","javascript:window.close();");
  25045. var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
  25046. window.open(sPath,form.target,this.m_windowOptions);
  25047. };
  25048. CSubscriptionManager.prototype.ModifyAnnotation=function(idx){
  25049. var sub=this.m_annotations[idx];
  25050. var _159a=this.m_annotations[idx].searchPath;
  25051. if(sub&&_159a){
  25052. var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
  25053. GUtil.createFormField(form,"ui.object",_159a);
  25054. GUtil.createFormField(form,"b_action","xts.run");
  25055. GUtil.createFormField(form,"m","rv/annotation1.xts");
  25056. GUtil.createFormField(form,"backURL","javascript:window.close();");
  25057. GUtil.createFormField(form,"action_hint","save");
  25058. var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
  25059. window.open(sPath,form.target,this.m_windowOptions);
  25060. }
  25061. };
  25062. CSubscriptionManager.prototype.DeleteAnnotation=function(idx){
  25063. var sub=this.m_annotations[idx];
  25064. if(sub&&sub.searchPath&&confirm(RV_RES.RV_CONFIRM_DELETE_WATCH_RULE)){
  25065. var oCV=this.getViewer();
  25066. var _15a0=new DataDispatcherEntry(oCV);
  25067. _15a0.setKey("subscriptionManager");
  25068. _15a0.addFormField("ui.action","deleteAnnotation");
  25069. _15a0.addFormField("cv.responseFormat","data");
  25070. this.addCommonFormFields(_15a0,sub.searchPath);
  25071. oCV.dispatchRequest(_15a0);
  25072. }
  25073. };
  25074. CSubscriptionManager.prototype.NewSubscription=function(){
  25075. var sc=this.m_cv.getSelectionController();
  25076. var oFWR=document.forms["formWarpRequest"+this.m_cv.getId()];
  25077. var _15a3=oFWR.reRunObj.value;
  25078. if(_15a3&&sc&&sc.getAllSelectedObjects().length===1){
  25079. var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
  25080. var fWR=document.getElementById("formWarpRequest"+this.m_cv.getId());
  25081. var _15a6=new CSelectionXml(fWR["ui.burstID"].value,fWR["ui.contentLocale"].value,fWR["ui.outputLocale"].value);
  25082. _15a6.BuildSelectionFromController(sc);
  25083. GUtil.createFormField(form,"rv.selectionSpecXML",_15a6.toXml());
  25084. GUtil.createFormField(form,"rv.periodicalProducer",_15a3);
  25085. GUtil.createFormField(form,"b_action","xts.run");
  25086. GUtil.createFormField(form,"m","subscribe/conditional_subscribe1.xts");
  25087. GUtil.createFormField(form,"backURL","javascript:window.close();");
  25088. var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
  25089. window.open(sPath,form.target,"toolbar,location,status,menubar,resizable,scrollbars=1");
  25090. }else{
  25091. }
  25092. };
  25093. CSubscriptionManager.prototype.DeleteSubscription=function(idx){
  25094. var sub=this.m_aWatchRules[idx];
  25095. if(sub&&sub.searchPath&&confirm(RV_RES.RV_CONFIRM_DELETE_WATCH_RULE)){
  25096. var oCV=this.getViewer();
  25097. var _15ab=new DataDispatcherEntry(oCV);
  25098. _15ab.setKey("subscriptionManager");
  25099. _15ab.addFormField("ui.action","deleteSubscription");
  25100. _15ab.addFormField("cv.responseFormat","data");
  25101. this.addCommonFormFields(_15ab,sub.searchPath);
  25102. oCV.dispatchRequest(_15ab);
  25103. }
  25104. };
  25105. CSubscriptionManager.prototype.ModifySubscription=function(idx){
  25106. var sub=this.m_aWatchRules[idx];
  25107. if(sub&&sub.searchPath){
  25108. var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
  25109. GUtil.createFormField(form,"m_obj",sub.searchPath);
  25110. GUtil.createFormField(form,"m_name",sub.name);
  25111. GUtil.createFormField(form,"b_action","xts.run");
  25112. GUtil.createFormField(form,"m_class","reportDataServiceAgentDefinition");
  25113. GUtil.createFormField(form,"m","portal/properties_subscription.xts");
  25114. GUtil.createFormField(form,"backURL","javascript:window.close();");
  25115. var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
  25116. window.open(sPath,form.target,"toolbar,location,status,menubar,resizable,scrollbars=1");
  25117. }
  25118. };
  25119. CSubscriptionManager.prototype.OpenSubscriptionMenu=function(){
  25120. var oCV=this.getViewer();
  25121. var _15b1=new JSONDispatcherEntry(oCV);
  25122. _15b1.setKey("subscriptionManager");
  25123. _15b1.addFormField("ui.action","getSubscriptionInfo");
  25124. _15b1.addFormField("cv.responseFormat","subscriptionManager");
  25125. this.addCommonFormFields(_15b1);
  25126. _15b1.setCallbacks({"complete":{"object":this,"method":this.OpenSubscriptionMenuResponse}});
  25127. oCV.dispatchRequest(_15b1);
  25128. };
  25129. CSubscriptionManager.prototype.OpenAnnotationMenu=function(){
  25130. var oCV=this.getViewer();
  25131. var _15b3=new JSONDispatcherEntry(oCV);
  25132. _15b3.setKey("subscriptionManager");
  25133. _15b3.addFormField("ui.action","getAnnotationInfo");
  25134. _15b3.addFormField("cv.responseFormat","getAnnotations");
  25135. var _15b4=oCV.envParams["ui.object"];
  25136. this.addCommonFormFields(_15b3,_15b4?_15b4:"");
  25137. _15b3.setCallbacks({"complete":{"object":this,"method":this.OpenAnnotationMenuResponse}});
  25138. oCV.dispatchRequest(_15b3);
  25139. };
  25140. CSubscriptionManager.prototype.OpenAnnotationMenuResponse=function(_15b5){
  25141. if(this.Initialize(_15b5)){
  25142. this.UpdateAnnotationMenu();
  25143. }else{
  25144. this.ClearAnnotationMenu();
  25145. }
  25146. };
  25147. CSubscriptionManager.prototype.OpenSubscriptionMenuResponse=function(_15b6){
  25148. if(this.Initialize(_15b6)){
  25149. this.UpdateSubscribeMenu();
  25150. }else{
  25151. this.AddEmptySubscriptionMenuItem();
  25152. }
  25153. };
  25154. CSubscriptionManager.prototype.addCommonFormFields=function(_15b7,_15b8){
  25155. if(_15b8&&_15b8!=""){
  25156. _15b7.addFormField("ui.object",_15b8);
  25157. }else{
  25158. var _15b9=document["formWarpRequest"+this.getViewer().getId()];
  25159. if(_15b9&&_15b9["reRunObj"]){
  25160. _15b7.addFormField("ui.object",_15b9["reRunObj"].value);
  25161. }
  25162. }
  25163. if(_15b7.getFormField("ui.action")=="getSubscriptionInfo"){
  25164. _15b7.addFormField("initialized",this.m_bInitialized?"true":"false");
  25165. }
  25166. _15b7.addFormField("cv.id",this.getViewer().getId());
  25167. };
  25168. CSubscriptionManager.prototype.AddEmptySubscriptionMenuItem=function(){
  25169. var _15ba=this.getStandaloneViewerToolbarControl();
  25170. if(_15ba){
  25171. var _15bb=_15ba.getItem("watchNewVersions");
  25172. if(_15bb){
  25173. _15bb.getMenu().clear();
  25174. }
  25175. var _15bc=this.m_cv.getWebContentRoot();
  25176. var sSkin=this.m_cv.getSkin();
  25177. var _15be=_15bb.getMenu();
  25178. var _15bf=new CMenuItem(_15be,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_15bc,sSkin);
  25179. _15bf.disable();
  25180. _15be.setForceCallback(false);
  25181. _15be.draw();
  25182. if(_15be.isVisible()){
  25183. _15be.show();
  25184. }
  25185. _15be.setForceCallback(true);
  25186. }
  25187. };
  25188. CSubscriptionManager.prototype.ClearSubscriptionMenu=function(){
  25189. var _15c0=this.getStandaloneViewerToolbarControl();
  25190. if(_15c0){
  25191. var _15c1=_15c0.getItem("watchNewVersions");
  25192. if(_15c1){
  25193. _15c1.getMenu().clear();
  25194. }
  25195. }
  25196. };
  25197. CSubscriptionManager.prototype.ClearAnnotationMenu=function(){
  25198. var _15c2=this.getStandaloneViewerToolbarControl();
  25199. if(_15c2){
  25200. var _15c3=_15c2.getItem("addAnnotations");
  25201. if(_15c3){
  25202. _15c3.getMenu().clear();
  25203. }
  25204. }
  25205. };
  25206. CSubscriptionManager.prototype.ClearContextAnnotationMenu=function(){
  25207. var _15c4=this.getStandaloneViewerContextMenu();
  25208. if(_15c4){
  25209. var _15c5=_15c4.getFindCommentMenuItem();
  25210. if(_15c5){
  25211. _15c5.getMenu().clear();
  25212. }
  25213. }
  25214. };
  25215. CSubscriptionManager.prototype.getStandaloneViewerToolbarControl=function(){
  25216. if(typeof this.m_cv.rvMainWnd!="undefined"&&this.m_cv.rvMainWnd!=null&&typeof this.m_cv.rvMainWnd.getToolbarControl=="function"){
  25217. return this.m_cv.rvMainWnd.getToolbarControl();
  25218. }else{
  25219. return null;
  25220. }
  25221. };
  25222. CSubscriptionManager.prototype.getStandaloneViewerContextMenu=function(){
  25223. if(typeof this.m_cv.rvMainWnd!="undefined"&&this.m_cv.rvMainWnd!=null&&typeof this.m_cv.rvMainWnd.getContextMenu=="function"){
  25224. return this.m_cv.rvMainWnd.getContextMenu();
  25225. }else{
  25226. return null;
  25227. }
  25228. };
  25229. function CSelectionMetadata(){
  25230. this.m_sContextId="";
  25231. this.m_sDataItem="";
  25232. this.m_sMetadataModelItem="";
  25233. this.m_sUseValue="";
  25234. this.m_sUseValueType="";
  25235. this.m_sType=null;
  25236. this.m_sDisplayValue="";
  25237. this.m_sUsage=null;
  25238. this.m_refQuery=null;
  25239. this.m_sHun=null;
  25240. this.m_sDun=null;
  25241. };
  25242. CSelectionMetadata.prototype.setContextId=function(_15c6){
  25243. this.m_sContextId=_15c6;
  25244. };
  25245. CSelectionMetadata.prototype.getContextId=function(){
  25246. return this.m_sContextId;
  25247. };
  25248. CSelectionMetadata.prototype.setRefQuery=function(_15c7){
  25249. this.m_refQuery=_15c7;
  25250. };
  25251. CSelectionMetadata.prototype.getRefQuery=function(){
  25252. return this.m_refQuery;
  25253. };
  25254. CSelectionMetadata.prototype.setDataItem=function(_15c8){
  25255. this.m_sDataItem=_15c8;
  25256. };
  25257. CSelectionMetadata.prototype.getDataItem=function(){
  25258. return this.m_sDataItem;
  25259. };
  25260. CSelectionMetadata.prototype.setMetadataModelItem=function(_15c9){
  25261. this.m_sMetadataModelItem=_15c9;
  25262. };
  25263. CSelectionMetadata.prototype.getMetadataModelItem=function(){
  25264. return this.m_sMetadataModelItem;
  25265. };
  25266. CSelectionMetadata.prototype.setUseValue=function(_15ca){
  25267. this.m_sUseValue=_15ca;
  25268. };
  25269. CSelectionMetadata.prototype.getUseValue=function(){
  25270. return this.m_sUseValue;
  25271. };
  25272. CSelectionMetadata.prototype.setUseValueType=function(_15cb){
  25273. this.m_sUseValueType=_15cb;
  25274. };
  25275. CSelectionMetadata.prototype.setType=function(sType){
  25276. this.m_sType=sType;
  25277. };
  25278. CSelectionMetadata.prototype.getType=function(){
  25279. var sType=null;
  25280. switch(this.m_sUseValueType){
  25281. case 25:
  25282. case 27:
  25283. case 30:
  25284. case 32:
  25285. sType="memberUniqueName";
  25286. break;
  25287. case 26:
  25288. sType="memberCaption";
  25289. break;
  25290. case 1:
  25291. case 55:
  25292. case 56:
  25293. sType="string";
  25294. break;
  25295. case 2:
  25296. case 3:
  25297. case 4:
  25298. case 5:
  25299. case 6:
  25300. case 7:
  25301. case 8:
  25302. case 9:
  25303. case 10:
  25304. case 11:
  25305. case 12:
  25306. case 16:
  25307. case 17:
  25308. case 18:
  25309. case 19:
  25310. case 20:
  25311. case 22:
  25312. case 21:
  25313. case 23:
  25314. case 24:
  25315. case 54:
  25316. sType=parseInt(this.m_sUseValueType,10);
  25317. break;
  25318. }
  25319. return sType;
  25320. };
  25321. CSelectionMetadata.prototype.getUseValueType=function(){
  25322. if(this.m_sType==null){
  25323. this.m_sType=this.getType();
  25324. }
  25325. return this.m_sType;
  25326. };
  25327. CSelectionMetadata.prototype.setDisplayValue=function(_15ce){
  25328. this.m_sDisplayValue=_15ce;
  25329. };
  25330. CSelectionMetadata.prototype.getDisplayValue=function(){
  25331. return this.m_sDisplayValue;
  25332. };
  25333. CSelectionMetadata.prototype.setUsage=function(_15cf){
  25334. this.m_sUsage=_15cf;
  25335. };
  25336. CSelectionMetadata.prototype.getUsage=function(){
  25337. if(this.m_sUsage=="2"){
  25338. return "measure";
  25339. }else{
  25340. return "nonMeasure";
  25341. }
  25342. };
  25343. CSelectionMetadata.prototype.setHun=function(sHun){
  25344. this.m_sHun=sHun;
  25345. };
  25346. CSelectionMetadata.prototype.getHun=function(){
  25347. return this.m_sHun;
  25348. };
  25349. CSelectionMetadata.prototype.setDun=function(sDun){
  25350. this.m_sDun=sDun;
  25351. };
  25352. CSelectionMetadata.prototype.getDun=function(){
  25353. return this.m_sDun;
  25354. };
  25355. function CSelectionMetadataIterator(_15d2,_15d3){
  25356. this.m_axisIndex=_15d3;
  25357. this.m_index=0;
  25358. this.m_selectionObject=_15d2;
  25359. };
  25360. CSelectionMetadataIterator.prototype.getSelectionAxis=function(){
  25361. var _15d4=null;
  25362. if(typeof this.m_selectionObject=="object"&&this.m_axisIndex<this.m_selectionObject.getSelectedContextIds().length){
  25363. _15d4=this.m_selectionObject.getSelectedContextIds()[this.m_axisIndex];
  25364. }
  25365. return _15d4;
  25366. };
  25367. CSelectionMetadataIterator.prototype.hasNext=function(){
  25368. var _15d5=this.getSelectionAxis();
  25369. if(_15d5!=null){
  25370. return (this.m_index<_15d5.length);
  25371. }else{
  25372. return false;
  25373. }
  25374. };
  25375. CSelectionMetadataIterator.prototype.next=function(){
  25376. var _15d6=null;
  25377. if(this.hasNext()){
  25378. _15d6=new CSelectionMetadata();
  25379. _15d6.setContextId(this.m_selectionObject.m_contextIds[this.m_axisIndex][this.m_index]);
  25380. _15d6.setDataItem(this.m_selectionObject.getDataItems()[this.m_axisIndex][this.m_index]);
  25381. _15d6.setMetadataModelItem(this.m_selectionObject.getMetadataItems()[this.m_axisIndex][this.m_index]);
  25382. if(this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]!=null&&this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]!=""){
  25383. _15d6.setUseValue(this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]);
  25384. _15d6.setType("memberUniqueName");
  25385. }else{
  25386. _15d6.setUseValue(this.m_selectionObject.getUseValues()[this.m_axisIndex][this.m_index]);
  25387. }
  25388. if(typeof this.m_selectionObject.m_selectionController=="object"){
  25389. var ctxId=this.m_selectionObject.getSelectedContextIds()[this.m_axisIndex][this.m_index];
  25390. if(this.m_selectionObject.useDisplayValueFromObject){
  25391. _15d6.setDisplayValue(this.m_selectionObject.getDisplayValues()[this.m_axisIndex]);
  25392. }else{
  25393. var _15d8=null;
  25394. var _15d9=null;
  25395. if(this.m_axisIndex===0){
  25396. var _15da=this.m_selectionObject.getCellRef();
  25397. if(_15da&&_15da.nodeName&&_15da.nodeName.toLowerCase()==="td"){
  25398. _15d9=this.m_selectionObject.m_selectionController.getDisplayValueFromDOM(ctxId,_15da.parentNode);
  25399. }
  25400. }
  25401. if(_15d9==null){
  25402. _15d9=this.m_selectionObject.m_selectionController.getDisplayValue(ctxId);
  25403. }
  25404. if(_15d9===""){
  25405. _15d9=this.m_selectionObject.m_selectionController.getUseValue(ctxId);
  25406. }
  25407. _15d6.setDisplayValue(_15d9);
  25408. }
  25409. _15d6.setUseValueType(this.m_selectionObject.m_selectionController.getDataType(ctxId));
  25410. _15d6.setUsage(this.m_selectionObject.m_selectionController.getUsageInfo(ctxId));
  25411. _15d6.setRefQuery(this.m_selectionObject.m_selectionController.getRefQuery(ctxId));
  25412. _15d6.setHun(this.m_selectionObject.m_selectionController.getHun(ctxId));
  25413. _15d6.setDun(this.m_selectionObject.m_selectionController.getDun(ctxId));
  25414. }
  25415. ++this.m_index;
  25416. }
  25417. return _15d6;
  25418. };
  25419. function CAxisSelectionIterator(_15db){
  25420. this.m_index=0;
  25421. this.m_selectionObject=_15db;
  25422. };
  25423. CAxisSelectionIterator.prototype.hasNext=function(){
  25424. return ((typeof this.m_selectionObject=="object")&&(this.m_index<this.m_selectionObject.getSelectedContextIds().length));
  25425. };
  25426. CAxisSelectionIterator.prototype.next=function(){
  25427. var _15dc=null;
  25428. if(this.hasNext()){
  25429. _15dc=new CSelectionMetadataIterator(this.m_selectionObject,this.m_index);
  25430. ++this.m_index;
  25431. }
  25432. return _15dc;
  25433. };
  25434. function getSelectionContextIds(_15dd){
  25435. var _15de=[];
  25436. var _15df=_15dd.getAllSelectedObjects();
  25437. if(_15df!=null&&_15df.length>0){
  25438. for(var index=0;index<_15df.length;++index){
  25439. var _15e1=_15df[index];
  25440. var _15e2=_15e1.getSelectedContextIds();
  25441. var _15e3=[];
  25442. for(var item=0;item<_15e2.length;++item){
  25443. var _15e5=_15e2[item].join(":");
  25444. _15e3.push(_15e5);
  25445. }
  25446. _15de.push(_15e3.join("::"));
  25447. }
  25448. }
  25449. return _15de;
  25450. };
  25451. function getViewerSelectionContext(_15e6,_15e7,_15e8){
  25452. var _15e9=_15e8==true?_15e6.getAllSelectedObjectsWithUniqueCTXIDs():_15e6.getAllSelectedObjects();
  25453. if(_15e9!=null&&_15e9.length>0){
  25454. for(var index=0;index<_15e9.length;++index){
  25455. var _15eb={};
  25456. var _15ec=new CAxisSelectionIterator(_15e9[index]);
  25457. if(_15ec.hasNext()){
  25458. var _15ed=_15ec.next();
  25459. if(_15ed.hasNext()){
  25460. var _15ee=_15ed.next();
  25461. var _15ef=_15ee.getContextId();
  25462. _15eb[_15ef]=true;
  25463. var _15f0=_15e7.addSelectedCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
  25464. if(_15ee.getHun()!=null){
  25465. _15f0.addProperty("HierarchyUniqueName",_15ee.getHun());
  25466. }
  25467. if(_15ee.getDun()!=null){
  25468. _15f0.addProperty("DimensionUniqueName",_15ee.getDun());
  25469. }
  25470. while(_15ed.hasNext()){
  25471. _15ee=_15ed.next();
  25472. _15ef=_15ee.getContextId();
  25473. if(typeof _15eb[_15ef]=="undefined"||_15ef===""){
  25474. _15eb[_15ef]=true;
  25475. var _15f1=_15f0.addDefiningCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
  25476. if(_15ee.getHun()!=null){
  25477. _15f1.addProperty("HierarchyUniqueName",_15ee.getHun());
  25478. }
  25479. if(_15ee.getDun()!=null){
  25480. _15f1.addProperty("DimensionUniqueName",_15ee.getDun());
  25481. }
  25482. }
  25483. }
  25484. while(_15ec.hasNext()){
  25485. _15ed=_15ec.next();
  25486. var _15f2=_15f0;
  25487. while(_15ed.hasNext()){
  25488. _15ee=_15ed.next();
  25489. _15ef=_15ee.getContextId();
  25490. if(typeof _15eb[_15ef]=="undefined"||_15ef===""){
  25491. _15eb[_15ef]=true;
  25492. _15f2=_15f2.addDefiningCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
  25493. if(_15ee.getHun()!=null){
  25494. _15f2.addProperty("HierarchyUniqueName",_15ee.getHun());
  25495. }
  25496. if(_15ee.getDun()!=null){
  25497. _15f2.addProperty("DimensionUniqueName",_15ee.getDun());
  25498. }
  25499. }
  25500. }
  25501. }
  25502. }
  25503. }
  25504. }
  25505. }
  25506. var _15f3=_15e7.toString();
  25507. if(window.gViewerLogger){
  25508. window.gViewerLogger.log("Selection context",_15f3,"xml");
  25509. }
  25510. return _15f3;
  25511. };
  25512. dojo.provide("bux.dialogs.CalculationDialog");
  25513. dojo.require("bux.dialogs.BaseCustomContentDialog");
  25514. dojo.require("bux.layout.TableContainer");
  25515. dojo.require("dijit.form.NumberTextBox");
  25516. dojo.require("dijit.form.Button");
  25517. dojo.declare("viewer.dialogs.CalculationDialog",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,sDescription:null,sContentLocale:null,okHandler:null,cancelHandler:null,startup:function(){
  25518. this.updateTitle(this.sTitle);
  25519. this.inherited(arguments);
  25520. var _15f4=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
  25521. var cell=null,row=null;
  25522. if(this.sDescription){
  25523. row=new bux.layout.TableContainerRow({parentContainer:_15f4});
  25524. cell=new bux.layout.TableContainerCell({classname:"bux-dialog-info",parentContainer:row});
  25525. cell.addContent(document.createTextNode(this.sDescription));
  25526. dijit.setWaiState(this._buxBaseDialog.domNode,"describedBy",cell.id);
  25527. }
  25528. row=new bux.layout.TableContainerRow({parentContainer:_15f4});
  25529. cell=new bux.layout.TableContainerCell({classname:"bux-dialog-label",parentContainer:row});
  25530. this._calculationField=new dijit.form.NumberTextBox({required:true,onBlur:function(){
  25531. if(!this._cancelled&&!this.isValid()){
  25532. this.focus();
  25533. }
  25534. },_setOKBtnDisabled:function(_15f7,_15f8){
  25535. if(_15f7&&_15f7[0]&&_15f7[0].label===RV_RES.IDS_JS_OK){
  25536. _15f7[0].set("disabled",_15f8);
  25537. }
  25538. },isValid:function(){
  25539. var _15f9=this.validator(this.get("displayedValue"),this.get("constraints"));
  25540. this._setOKBtnDisabled(this.oDlgBtns,!_15f9);
  25541. return _15f9;
  25542. }});
  25543. if(this.sContentLocale!=null){
  25544. dojo.requireLocalization("dojo.cldr","number",this.sContentLocale);
  25545. this._calculationField.constraints={locale:this.sContentLocale};
  25546. }
  25547. var _15fa=document.createElement("label");
  25548. _15fa.appendChild(document.createTextNode(this.sLabel));
  25549. _15fa.setAttribute("for",this._calculationField.id);
  25550. cell.addContent(_15fa);
  25551. row=new bux.layout.TableContainerRow({parentContainer:_15f4});
  25552. cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
  25553. cell.addContent(this._calculationField.domNode);
  25554. this._calculationField.oDlgBtns=this._buxBaseDialog._aButtonObjects;
  25555. },onOK:function(){
  25556. if(this._calculationField.state!="Error"){
  25557. this.inherited(arguments);
  25558. this.okHandler(this._calculationField.get("value"));
  25559. this.hide();
  25560. }
  25561. },onCancel:function(){
  25562. this._calculationField._cancelled=true;
  25563. this.inherited(arguments);
  25564. }});
  25565. dojo.provide("bux.dialogs.ConfirmationDialog");
  25566. viewer.dialogs.ConfirmationDialog=function(_15fb,_15fc,_15fd,_15fe,_15ff,_1600){
  25567. dojo["require"]("bux.dialogs.InformationDialog");
  25568. var _1601=new bux.dialogs.Confirm(_15fb,_15fc,_15fd,dojo.hitch(_15ff,_1600,_15ff),_15fe);
  25569. return _1601;
  25570. };
  25571. dojo.provide("bux.dialogs.SelectSnapshot");
  25572. dojo.require("bux.dialogs.BaseCustomContentDialog");
  25573. dojo.require("bux.layout.TableContainer");
  25574. dojo.require("dijit.form.NumberTextBox");
  25575. dojo.require("dijit.form.Button");
  25576. dojo.declare("viewer.dialogs.SelectSnapshot",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,okHandler:null,cancelHandler:null,startup:function(){
  25577. this.updateTitle(this.sTitle);
  25578. this.inherited(arguments);
  25579. var _1602=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
  25580. var row=new bux.layout.TableContainerRow({parentContainer:_1602});
  25581. var cell=new bux.layout.TableContainerCell({classname:"bux-dialog-label",parentContainer:row});
  25582. this.createSnapshotsControl();
  25583. var _1605=document.createElement("label");
  25584. _1605.appendChild(document.createTextNode(this.sLabel));
  25585. _1605.setAttribute("for",this._snapshots.id);
  25586. cell.addContent(_1605);
  25587. row=new bux.layout.TableContainerRow({parentContainer:_1602});
  25588. cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
  25589. cell.addContent(this._snapshots);
  25590. },onOK:function(){
  25591. this.inherited(arguments);
  25592. var _1606=this._snapshots.selectedIndex;
  25593. var _1607=this._snapshots.options[_1606];
  25594. this.okHandler(_1607.getAttribute("storeID"),_1607.value);
  25595. this.hide();
  25596. },createSnapshotsControl:function(){
  25597. this._snapshots=document.createElement("select");
  25598. this._snapshots.id=this.dialogId+"snapshots";
  25599. this._snapshots.setAttribute("size","8");
  25600. this._snapshots.setAttribute("name",this.dialogId+"snapshots");
  25601. var _1608=XMLHelper_FindChildByTagName(this.cmResponse,"result",true);
  25602. var _1609=XMLHelper_FindChildrenByTagName(_1608,"item",false);
  25603. for(var _160a=0;_160a<_1609.length;_160a++){
  25604. var _160b=_1609[_160a];
  25605. var _160c=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160b,"creationTime_localized",true));
  25606. var _160d=XMLHelper_FindChildByTagName(_160b,"storeID",true);
  25607. var _160e=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160d,"value",true));
  25608. var _160f=XMLHelper_FindChildByTagName(_160b,"creationTime",true);
  25609. var _1610=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160f,"value",true));
  25610. this._snapshots.options[_160a]=new Option(_160c,_1610);
  25611. this._snapshots.options[_160a].setAttribute("storeID",_160e);
  25612. if(this.currentSnapshotCreationTime==_1610){
  25613. this._snapshots.options[_160a].selected=true;
  25614. }
  25615. }
  25616. }});
  25617. function CognosViewerAction(){
  25618. this.m_oCV=null;
  25619. };
  25620. CognosViewerAction.prototype.setRequestParms=function(parms){
  25621. };
  25622. CognosViewerAction.prototype.onMouseOver=function(evt){
  25623. return false;
  25624. };
  25625. CognosViewerAction.prototype.onMouseOut=function(evt){
  25626. return false;
  25627. };
  25628. CognosViewerAction.prototype.onMouseDown=function(evt){
  25629. return false;
  25630. };
  25631. CognosViewerAction.prototype.onClick=function(evt){
  25632. return false;
  25633. };
  25634. CognosViewerAction.prototype.onDoubleClick=function(evt){
  25635. return false;
  25636. };
  25637. CognosViewerAction.prototype.updateMenu=function(_1617){
  25638. return _1617;
  25639. };
  25640. CognosViewerAction.prototype.addAdditionalOptions=function(_1618){
  25641. };
  25642. CognosViewerAction.prototype.genSelectionContextWithUniqueCTXIDs=function(){
  25643. return false;
  25644. };
  25645. CognosViewerAction.prototype.doUndo=function(){
  25646. if(typeof console!="undefined"){
  25647. console.log("Required method doUndo not implemented.");
  25648. }
  25649. };
  25650. CognosViewerAction.prototype.doRedo=function(){
  25651. if(typeof console!="undefined"){
  25652. console.log("Required method doRedo not implemented.");
  25653. }
  25654. };
  25655. CognosViewerAction.prototype.forceRunSpecRequest=function(){
  25656. return false;
  25657. };
  25658. CognosViewerAction.prototype.preProcess=function(){
  25659. };
  25660. CognosViewerAction.prototype.setCognosViewer=function(oCV){
  25661. this.m_oCV=oCV;
  25662. };
  25663. CognosViewerAction.prototype.getCognosViewer=function(){
  25664. return this.m_oCV;
  25665. };
  25666. CognosViewerAction.prototype.getUndoRedoQueue=function(){
  25667. if(this.getCognosViewer().getViewerWidget()){
  25668. return this.getCognosViewer().getViewerWidget().getUndoRedoQueue();
  25669. }
  25670. return null;
  25671. };
  25672. CognosViewerAction.prototype.getViewerWidget=function(){
  25673. return this.m_oCV.getViewerWidget();
  25674. };
  25675. CognosViewerAction.prototype.getObjectDisplayName=function(){
  25676. var _161a="";
  25677. if(this.m_oCV!=null){
  25678. if(typeof this.m_oCV.envParams["reportpart_id"]!="undefined"){
  25679. _161a=this.m_oCV.envParams["reportpart_id"];
  25680. }else{
  25681. if(typeof this.m_oCV.envParams["ui.name"]!="undefined"){
  25682. _161a=this.m_oCV.envParams["ui.name"];
  25683. }
  25684. }
  25685. }
  25686. return _161a;
  25687. };
  25688. CognosViewerAction.prototype.getContainerId=function(_161b){
  25689. var _161c="";
  25690. if(_161b&&_161b.getAllSelectedObjects){
  25691. var _161d=_161b.getAllSelectedObjects();
  25692. if(_161d){
  25693. var _161e=_161d[0];
  25694. if(_161e&&_161e.getLayoutElementId){
  25695. _161c=this.removeNamespace(_161e.getLayoutElementId());
  25696. }
  25697. }
  25698. }
  25699. return _161c;
  25700. };
  25701. CognosViewerAction.prototype.removeNamespace=function(value){
  25702. var _1620=value;
  25703. try{
  25704. if(value!=""){
  25705. var _1621=value.indexOf(this.m_oCV.getId());
  25706. if(_1621!=-1){
  25707. value=value.replace(this.m_oCV.getId(),"");
  25708. }
  25709. }
  25710. return value;
  25711. }
  25712. catch(e){
  25713. return _1620;
  25714. }
  25715. };
  25716. CognosViewerAction.prototype.doAddActionContext=function(){
  25717. return true;
  25718. };
  25719. CognosViewerAction.prototype.getSelectionContext=function(){
  25720. return getViewerSelectionContext(this.m_oCV.getSelectionController(),new CSelectionContext(this.m_oCV.envParams["ui.object"]),this.genSelectionContextWithUniqueCTXIDs());
  25721. };
  25722. CognosViewerAction.prototype.getNumberOfSelections=function(){
  25723. var _1622=-1;
  25724. if(this.m_oCV!=null&&this.m_oCV.getSelectionController()!=null){
  25725. _1622=this.m_oCV.getSelectionController().getSelections().length;
  25726. }
  25727. return _1622;
  25728. };
  25729. CognosViewerAction.prototype.buildDynamicMenuItem=function(_1623,_1624){
  25730. _1623.action={name:"LoadMenu",payload:{action:_1624}};
  25731. _1623.items=[{"name":"loading","label":RV_RES.GOTO_LOADING,iconClass:"loading"}];
  25732. return _1623;
  25733. };
  25734. CognosViewerAction.prototype.createCognosViewerDispatcherEntry=function(_1625){
  25735. var oReq=new ViewerDispatcherEntry(this.getCognosViewer());
  25736. oReq.addFormField("ui.action",_1625);
  25737. this.preProcess();
  25738. if(this.doAddActionContext()===true){
  25739. var _1627=this.addActionContext();
  25740. oReq.addFormField("cv.actionContext",_1627);
  25741. if(window.gViewerLogger){
  25742. window.gViewerLogger.log("Action context",_1627,"xml");
  25743. }
  25744. }
  25745. oReq.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  25746. if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
  25747. oReq.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  25748. }
  25749. if(this.m_oCV.getModelPath()!==""){
  25750. oReq.addFormField("modelPath",this.m_oCV.getModelPath());
  25751. }
  25752. if(typeof this.m_oCV.envParams["packageBase"]!="undefined"){
  25753. oReq.addFormField("packageBase",this.m_oCV.envParams["packageBase"]);
  25754. }
  25755. if(typeof this.m_oCV.envParams["rap.state"]!="undefined"){
  25756. oReq.addFormField("rap.state",this.m_oCV.envParams["rap.state"]);
  25757. }
  25758. if(typeof this.m_oCV.envParams["rapReportInfo"]!="undefined"){
  25759. oReq.addFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
  25760. }
  25761. this.addAdditionalOptions(oReq);
  25762. return oReq;
  25763. };
  25764. CognosViewerAction.prototype.fireModifiedReportEvent=function(){
  25765. try{
  25766. var _1628=this.getCognosViewer().getViewerWidget();
  25767. if(_1628){
  25768. var _1629={"modified":true};
  25769. _1628.fireEvent("com.ibm.bux.widget.modified",null,_1629);
  25770. }
  25771. }
  25772. catch(e){
  25773. }
  25774. };
  25775. CognosViewerAction.prototype.showCustomCursor=function(evt,id,_162c){
  25776. var _162d=document.getElementById(id);
  25777. if(_162d==null){
  25778. _162d=document.createElement("span");
  25779. _162d.className="customCursor";
  25780. _162d.setAttribute("id",id);
  25781. document.body.appendChild(_162d);
  25782. }
  25783. var _162e="<img src=\""+this.getCognosViewer().getWebContentRoot()+_162c+"\"/>";
  25784. _162d.innerHTML=_162e;
  25785. _162d.style.position="absolute";
  25786. _162d.style.left=(evt.clientX+15)+"px";
  25787. _162d.style.top=(evt.clientY+15)+"px";
  25788. _162d.style.display="inline";
  25789. };
  25790. CognosViewerAction.prototype.hideCustomCursor=function(id){
  25791. var _1630=document.getElementById(id);
  25792. if(_1630!=null){
  25793. _1630.style.display="none";
  25794. }
  25795. };
  25796. CognosViewerAction.prototype.selectionHasContext=function(){
  25797. var _1631=this.getCognosViewer().getSelectionController().getAllSelectedObjects();
  25798. var _1632=false;
  25799. if(_1631!=null&&_1631.length>0){
  25800. for(var i=0;i<_1631.length;i++){
  25801. if(_1631[i].hasContextInformation()){
  25802. _1632=true;
  25803. break;
  25804. }
  25805. }
  25806. }
  25807. return _1632;
  25808. };
  25809. CognosViewerAction.prototype.isInteractiveDataContainer=function(_1634){
  25810. var _1635=false;
  25811. if(typeof _1634!="undefined"&&_1634!=null){
  25812. var id=_1634.toLowerCase();
  25813. _1635=id=="crosstab"||id=="list"||this.getCognosViewer().getRAPReportInfo().isChart(id);
  25814. }
  25815. return _1635;
  25816. };
  25817. CognosViewerAction.prototype.getSelectedContainerId=function(){
  25818. var _1637=this.getCognosViewer();
  25819. var _1638=_1637.getSelectionController();
  25820. var _1639=null;
  25821. if(_1638!=null&&typeof _1638!="undefined"){
  25822. _1639=this.getContainerId(_1638);
  25823. }
  25824. return _1639;
  25825. };
  25826. CognosViewerAction.prototype.getSelectedReportInfo=function(){
  25827. var _163a=this.getCognosViewer();
  25828. var _163b=this.getSelectedContainerId();
  25829. var _163c=this.getReportInfo(_163b);
  25830. if(_163c==null){
  25831. var _163d=_163a.getRAPReportInfo();
  25832. if(_163d.getContainerCount()==1){
  25833. _163c=_163d.getContainerFromPos(0);
  25834. }
  25835. }
  25836. return _163c;
  25837. };
  25838. CognosViewerAction.prototype.getReportInfo=function(_163e){
  25839. var _163f=null;
  25840. if(_163e!=null&&_163e.length>0){
  25841. var _1640=this.getCognosViewer();
  25842. var _1641=_1640.getRAPReportInfo();
  25843. _163f=_1641.getContainer(_163e);
  25844. }
  25845. return _163f;
  25846. };
  25847. CognosViewerAction.prototype.isSelectionOnChart=function(){
  25848. var _1642=this.getCognosViewer();
  25849. if(_1642.getSelectionController().hasSelectedChartNodes()){
  25850. return true;
  25851. }
  25852. var _1643=this.getContainerId(_1642.getSelectionController());
  25853. if(typeof _1643!="undefined"){
  25854. var _1644=this.getReportInfo(_1643);
  25855. if(_1644!=null&&_1644.displayTypeId){
  25856. var _1645=_1644.displayTypeId.toLowerCase();
  25857. return _1642.getRAPReportInfo().isChart(_1645);
  25858. }
  25859. }
  25860. return false;
  25861. };
  25862. CognosViewerAction.prototype.ifContainsInteractiveDataContainer=function(){
  25863. var _1646=this.getCognosViewer().getRAPReportInfo();
  25864. if(_1646){
  25865. return _1646.containsInteractiveDataContainer();
  25866. }
  25867. return false;
  25868. };
  25869. CognosViewerAction.prototype.isPromptWidget=function(){
  25870. var oCV=this.getCognosViewer();
  25871. if(oCV.getRAPReportInfo()&&oCV.getRAPReportInfo().isPromptPart()){
  25872. return true;
  25873. }
  25874. return false;
  25875. };
  25876. CognosViewerAction.prototype.getLayoutComponents=function(){
  25877. var _1648=[];
  25878. var _1649=document.getElementById("rt"+this.m_oCV.getId());
  25879. if(_1649!=null){
  25880. _1648=getElementsByAttribute(_1649,"*","lid");
  25881. }
  25882. return _1648;
  25883. };
  25884. CognosViewerAction.prototype.addClientContextData=function(_164a){
  25885. var _164b=this.m_oCV.getSelectionController();
  25886. if(typeof _164b!="undefined"&&_164b!=null&&typeof _164b.getCCDManager!="undefined"&&_164b.getCCDManager()!=null){
  25887. var _164c=_164b.getCCDManager();
  25888. return ("<md>"+xml_encode(_164c.MetadataToJSON())+"</md>"+"<cd>"+xml_encode(_164c.ContextDataSubsetToJSON(_164a))+"</cd>");
  25889. }
  25890. return "";
  25891. };
  25892. CognosViewerAction.prototype.getDataItemInfoMap=function(){
  25893. var _164d=this.m_oCV.getSelectionController();
  25894. if(typeof _164d!="undefined"&&_164d!=null&&typeof _164d.getCCDManager!="undefined"&&_164d.getCCDManager()!=null){
  25895. var _164e=_164d.getCCDManager();
  25896. return ("<di>"+xml_encode(_164e.DataItemInfoToJSON())+"</di>");
  25897. }
  25898. return "";
  25899. };
  25900. CognosViewerAction.prototype.getRAPLayoutTag=function(_164f){
  25901. var _1650=null;
  25902. if(typeof _164f=="object"&&_164f!=null){
  25903. _1650=_164f.getAttribute("rap_layout_tag");
  25904. }
  25905. return _1650;
  25906. };
  25907. CognosViewerAction.prototype.addMenuItemChecked=function(_1651,_1652,_1653){
  25908. if(_1651){
  25909. if(this.getCognosViewer().isHighContrast()){
  25910. _1652["class"]="menuItemSelected";
  25911. }
  25912. _1652.iconClass="menuItemChecked";
  25913. }else{
  25914. if(_1653&&_1653.length>0){
  25915. _1652.iconClass=_1653;
  25916. }
  25917. }
  25918. };
  25919. CognosViewerAction.prototype.gatherFilterInfoBeforeAction=function(_1654){
  25920. var _1655=this.getCognosViewer().getViewerWidget();
  25921. _1655.filterRequiredAction=_1654;
  25922. _1655.clearRAPCache();
  25923. _1655.fireEvent("com.ibm.bux.widget.action",null,{action:"canvas.filters"});
  25924. };
  25925. CognosViewerAction.prototype.addClientSideUndo=function(_1656,_1657){
  25926. var _1658=GUtil.generateCallback(_1656.doUndo,_1657,_1656);
  25927. var _1659=GUtil.generateCallback(_1656.doRedo,_1657,_1656);
  25928. this.getUndoRedoQueue().addClientSideUndo({"tooltip":_1656.getUndoHint(),"undoCallback":_1658,"redoCallback":_1659});
  25929. this.getCognosViewer().getViewerWidget().updateToolbar();
  25930. };
  25931. CognosViewerAction.prototype.isValidMenuItem=function(){
  25932. var _165a=this.getCognosViewer();
  25933. var _165b=_165a.getViewerWidget();
  25934. if(this.isPromptWidget()){
  25935. return false;
  25936. }
  25937. return true;
  25938. };
  25939. CognosViewerAction.prototype.isPositiveInt=function(value){
  25940. if(typeof value==="undefined"||value===null){
  25941. return false;
  25942. }
  25943. var _165d=parseInt(value,10);
  25944. return value&&_165d===+value&&_165d>0&&value.indexOf(".")==-1;
  25945. };
  25946. CognosViewerAction.prototype.buildActionResponseObject=function(_165e,code,msg){
  25947. return {"status":_165e,"message":msg?msg:null,"code":code?code:null,getStatus:function(){
  25948. return this.status;
  25949. },getMessage:function(){
  25950. return this.message;
  25951. },getCode:function(){
  25952. return this.code;
  25953. }};
  25954. };
  25955. function LineageAction(){
  25956. };
  25957. LineageAction.prototype=new CognosViewerAction();
  25958. LineageAction.prototype.getCommonOptions=function(_1661){
  25959. _1661.addFormField("cv.responseFormat","asynchDetailMIMEAttachment");
  25960. _1661.addFormField("bux",this.m_oCV.getViewerWidget()?"true":"false");
  25961. _1661.addFormField("cv.id",this.m_oCV.envParams["cv.id"]);
  25962. };
  25963. LineageAction.prototype.getSelectionOptions=function(_1662){
  25964. var _1663=this.m_oCV.getSelectionController();
  25965. var _1664=getSelectionContextIds(_1663);
  25966. _1662.addFormField("context.format","initializer");
  25967. _1662.addFormField("context.type","reportService");
  25968. _1662.addFormField("context.selection","metadata,"+_1664.toString());
  25969. };
  25970. LineageAction.prototype.getPrimaryRequestOptions=function(_1665){
  25971. _1665.addFormField("specificationType","metadataServiceLineageSpecification");
  25972. _1665.addFormField("ui.action","runLineageSpecification");
  25973. _1665.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  25974. };
  25975. LineageAction.prototype.getSecondaryRequestOptions=function(_1666){
  25976. _1666.addFormField("ui.conversation",this.m_oCV.getConversation());
  25977. _1666.addFormField("m_tracking",this.m_oCV.getTracking());
  25978. _1666.addFormField("ui.action","lineage");
  25979. };
  25980. LineageAction.prototype.updateMenu=function(_1667){
  25981. if(!this.getCognosViewer().bCanUseLineage){
  25982. return "";
  25983. }
  25984. _1667.disabled=!this.selectionHasContext();
  25985. return _1667;
  25986. };
  25987. LineageAction.prototype.execute=function(){
  25988. var oCV=this.getCognosViewer();
  25989. var _1669=new AsynchDataDispatcherEntry(oCV);
  25990. this.getCommonOptions(_1669);
  25991. this.getSelectionOptions(_1669);
  25992. if(oCV.getConversation()==""){
  25993. this.getPrimaryRequestOptions(_1669);
  25994. }else{
  25995. this.getSecondaryRequestOptions(_1669);
  25996. }
  25997. _1669.setCallbacks({"complete":{"object":this,"method":this.handleLineageResponse}});
  25998. if(!oCV.m_viewerFragment){
  25999. _1669.setRequestIndicator(oCV.getRequestIndicator());
  26000. var _166a=new WorkingDialog(oCV);
  26001. _166a.setSimpleWorkingDialogFlag(true);
  26002. _1669.setWorkingDialog(_166a);
  26003. }
  26004. oCV.dispatchRequest(_1669);
  26005. };
  26006. LineageAction.prototype.handleLineageResponse=function(_166b){
  26007. var oCV=this.getCognosViewer();
  26008. oCV.loadExtra();
  26009. oCV.setStatus(_166b.getAsynchStatus());
  26010. oCV.setConversation(_166b.getConversation());
  26011. oCV.setTracking(_166b.getTracking());
  26012. var _166d=null;
  26013. if(typeof MDSRV_CognosConfiguration!="undefined"){
  26014. _166d=new MDSRV_CognosConfiguration();
  26015. var _166e="";
  26016. if(this.m_oCV.envParams["metadataInformationURI"]){
  26017. _166e=this.m_oCV.envParams["metadataInformationURI"];
  26018. }
  26019. _166d.addProperty("lineageURI",_166e);
  26020. _166d.addProperty("gatewayURI",this.m_oCV.getGateway());
  26021. }
  26022. var _166f=this.m_oCV.envParams["ui.object"];
  26023. var _1670=getViewerSelectionContext(this.m_oCV.getSelectionController(),new CSelectionContext(_166f));
  26024. var _1671=new MDSRV_LineageFragmentContext(_166d,_1670);
  26025. _1671.setExecutionParameters(this.m_oCV.getExecutionParameters());
  26026. if(typeof _166f=="string"){
  26027. _1671.setReportPath(_166f);
  26028. }
  26029. _1671.setReportLineage(_166b.getResult());
  26030. _1671.open();
  26031. };
  26032. function ModifyReportAction(){
  26033. this.m_reuseConversation=true;
  26034. };
  26035. ModifyReportAction.prototype=new CognosViewerAction();
  26036. ModifyReportAction.prototype.addActionContextAdditionalParms=function(){
  26037. };
  26038. ModifyReportAction.prototype.runReport=function(){
  26039. return true;
  26040. };
  26041. ModifyReportAction.prototype.updateRunReport=function(){
  26042. };
  26043. ModifyReportAction.prototype.reuseQuery=function(){
  26044. return false;
  26045. };
  26046. ModifyReportAction.prototype.reuseGetParameter=function(){
  26047. return true;
  26048. };
  26049. ModifyReportAction.prototype.reuseConversation=function(_1672){
  26050. if(typeof _1672!="undefined"){
  26051. this.m_reuseConversation=_1672;
  26052. }
  26053. return this.m_reuseConversation;
  26054. };
  26055. ModifyReportAction.prototype.updateInfoBar=function(){
  26056. return true;
  26057. };
  26058. ModifyReportAction.prototype.getUndoHint=function(){
  26059. return "";
  26060. };
  26061. ModifyReportAction.prototype.isUndoable=function(){
  26062. return true;
  26063. };
  26064. ModifyReportAction.prototype.saveSpecForUndo=function(){
  26065. return false;
  26066. };
  26067. ModifyReportAction.prototype.keepFocusOnWidget=function(){
  26068. return true;
  26069. };
  26070. ModifyReportAction.prototype.keepRAPCache=function(){
  26071. return true;
  26072. };
  26073. ModifyReportAction.prototype.getActionKey=function(){
  26074. return null;
  26075. };
  26076. ModifyReportAction.prototype.canBeQueued=function(){
  26077. return false;
  26078. };
  26079. ModifyReportAction.prototype.getPromptOption=function(){
  26080. return "false";
  26081. };
  26082. ModifyReportAction.prototype.createActionDispatcherEntry=function(){
  26083. var _1673=new ModifyReportDispatcherEntry(this.m_oCV);
  26084. _1673.initializeAction(this);
  26085. return _1673;
  26086. };
  26087. ModifyReportAction.prototype.isSelectSingleMember=function(_1674){
  26088. var _1675=this.m_oCV.getRAPReportInfo();
  26089. var _1676=_1674.getDataItems();
  26090. if(_1675&&_1676.length>0){
  26091. var _1677=this.getContainerId(this.m_oCV.getSelectionController());
  26092. var _1678=_1675.getItemInfo(_1677,_1676[0][0]);
  26093. if(_1678.single=="true"){
  26094. return true;
  26095. }
  26096. }
  26097. return false;
  26098. };
  26099. ModifyReportAction.prototype.execute=function(){
  26100. var oCV=this.getCognosViewer();
  26101. oCV.setKeepFocus(this.keepFocusOnWidget());
  26102. this.updateRunReport();
  26103. if(this.runReport()==true){
  26104. var _167a=this.createActionDispatcherEntry();
  26105. this.addAdditionalOptions(_167a);
  26106. oCV.dispatchRequest(_167a);
  26107. }else{
  26108. var _167b=this.createCognosViewerDispatcherEntry("modifyReport");
  26109. _167b.setCallbacks({"complete":{"object":this,"method":this.updateReportSpecCallback}});
  26110. oCV.dispatchRequest(_167b);
  26111. }
  26112. this.fireModifiedReportEvent();
  26113. };
  26114. ModifyReportAction.prototype.updateReportSpecCallback=function(_167c){
  26115. var state=_167c.getResponseState();
  26116. var _167e=new RequestHandler(this.m_oCV);
  26117. _167e.updateViewerState(state);
  26118. if(!this.m_bUndoAdded){
  26119. this.m_bUndoAdded=true;
  26120. var _167f=this.getUndoRedoQueue();
  26121. if(_167f){
  26122. _167f.initUndoObj({"tooltip":this.getUndoHint(),"saveSpec":true});
  26123. _167f.add({"reportUpdated":true});
  26124. }
  26125. var _1680=this.getCognosViewer().getViewerWidget();
  26126. if(_1680){
  26127. _1680.updateToolbar();
  26128. }
  26129. }
  26130. };
  26131. ModifyReportAction.prototype.addActionContext=function(){
  26132. var _1681="<reportActions";
  26133. if(this.runReport()==false){
  26134. _1681+=" run=\"false\"";
  26135. }
  26136. _1681+=">";
  26137. _1681+=this.getReportActionContext();
  26138. _1681+="</reportActions>";
  26139. return _1681;
  26140. };
  26141. ModifyReportAction.prototype.getReportActionContext=function(){
  26142. var _1682=this.getCognosViewer();
  26143. var _1683=_1682.getSelectionController();
  26144. var _1684="<"+this.m_sAction+">";
  26145. var _1685=this.getContainerId(_1683);
  26146. if(_1685!=""){
  26147. _1684+="<id>"+xml_encode(_1685)+"</id>";
  26148. }
  26149. _1684+=this.getRTStateInfo();
  26150. _1684+=this.getSelectionContext();
  26151. var _1686=this.addActionContextAdditionalParms();
  26152. if(_1686!=null&&_1686!="undefined"){
  26153. _1684+=_1686;
  26154. }
  26155. _1684+="</"+this.m_sAction+">";
  26156. if(this.updateInfoBar()){
  26157. _1684+=this.getGetInfoActionContext();
  26158. }
  26159. return _1684;
  26160. };
  26161. ModifyReportAction.prototype.getGetInfoActionContext=function(){
  26162. return "<GetInfo/>";
  26163. };
  26164. ModifyReportAction.prototype.getRTStateInfo=function(){
  26165. var _1687=this.getCognosViewer().getViewerWidget();
  26166. if(_1687&&_1687.getBUXRTStateInfoMap){
  26167. var _1688=_1687.getBUXRTStateInfoMap();
  26168. return _1688?_1688:"";
  26169. }
  26170. return "";
  26171. };
  26172. ModifyReportAction.prototype.createEmptyMenuItem=function(){
  26173. return {name:"None",label:"(empty)",iconClass:"",action:null,items:null};
  26174. };
  26175. ModifyReportAction.prototype.getStateFromResponse=function(_1689){
  26176. var _168a=null;
  26177. if(_1689&&typeof _1689!="undefined"&&_1689.responseText&&typeof _1689.responseText!="undefined"&&_1689.responseText.length>0){
  26178. var _168b=XMLBuilderLoadXMLFromString(_1689.responseText);
  26179. var _168c=_168b.getElementsByTagName("state");
  26180. if(_168c!=null&&_168c.length>0){
  26181. try{
  26182. if(typeof _168c[0].text!="undefined"){
  26183. _168a=eval("("+_168c[0].text+")");
  26184. }else{
  26185. _168a=eval("("+_168c[0].textContent+")");
  26186. }
  26187. }
  26188. catch(e){
  26189. if(typeof console!="undefined"&&console&&console.log){
  26190. console.log(e);
  26191. }
  26192. }
  26193. }
  26194. }
  26195. return _168a;
  26196. };
  26197. ModifyReportAction.prototype.getSelectedCellTags=function(){
  26198. var _168d="";
  26199. var _168e=this.getCognosViewer().getSelectionController().getSelections();
  26200. for(var i=0;i<_168e.length;++i){
  26201. var _1690=_168e[i].getCellRef();
  26202. var _1691=_168e[i].getDataItems()[0];
  26203. if(typeof _1691=="undefined"||_1691==null){
  26204. _1691="";
  26205. }
  26206. var tag=this.getRAPLayoutTag(_1690);
  26207. if(tag!=null){
  26208. _168d+="<tag><tagValue>"+xml_encode(tag)+"</tagValue><dataItem>"+xml_encode(_1691)+"</dataItem></tag>";
  26209. }else{
  26210. _168d+="<tag><tagValue/><dataItem>"+xml_encode(_1691)+"</dataItem></tag>";
  26211. }
  26212. }
  26213. if(_168d!=""){
  26214. _168d="<selectedCellTags>"+_168d+"</selectedCellTags>";
  26215. }
  26216. return _168d;
  26217. };
  26218. ModifyReportAction.prototype.getIsNumericFromReportInfo=function(_1693){
  26219. var _1694=this.getSelectedReportInfo();
  26220. if(_1694!=null&&typeof _1694.itemInfo!="undefined"){
  26221. for(var item=0;item<_1694.itemInfo.length;++item){
  26222. if(_1693==_1694.itemInfo[item].item&&typeof _1694.itemInfo[item].numeric!="undefined"){
  26223. return (_1694.itemInfo[item].numeric=="true");
  26224. }
  26225. }
  26226. }
  26227. return false;
  26228. };
  26229. function CognosViewerCalculation(){
  26230. this.m_oCV=null;
  26231. };
  26232. CognosViewerCalculation.prototype.setCognosViewer=function(oCV){
  26233. this.m_oCV=oCV;
  26234. };
  26235. CognosViewerCalculation.prototype.getCognosViewer=function(){
  26236. return this.m_oCV;
  26237. };
  26238. CognosViewerCalculation.prototype.validSelectionLength=function(_1697){
  26239. try{
  26240. return _1697.getAllSelectedObjects().length>0;
  26241. }
  26242. catch(e){
  26243. return false;
  26244. }
  26245. };
  26246. CognosViewerCalculation.prototype.getDisplayValueFromSelection=function(_1698){
  26247. var _1699="";
  26248. if(!_1698){
  26249. return _1699;
  26250. }
  26251. if(_1698.getLayoutType()=="columnTitle"){
  26252. _1699=_1698.getDisplayValues()[0];
  26253. }else{
  26254. if(_1698.getLayoutType()=="datavalue"){
  26255. var _169a=this.m_oCV.getAction("CognosViewer");
  26256. var _169b=this.m_oCV.getSelectionController();
  26257. var _169c=_169a.getContainerId(_169b);
  26258. _1699=_1698.getDataItemDisplayValue(_169a.getReportInfo(_169c));
  26259. }
  26260. }
  26261. if(_1699.indexOf("+")!=-1||_1699.indexOf("-")!=-1||_1699.indexOf("*")!=-1||_1699.indexOf("/")!=-1){
  26262. _1699="("+_1699+")";
  26263. }
  26264. return _1699;
  26265. };
  26266. CognosViewerCalculation.prototype.getCalcSymbol=function(){
  26267. };
  26268. CognosViewerCalculation.prototype.getMenuItemString=function(_169d){
  26269. var _169e=this.getCognosViewer();
  26270. var _169f=_169e.getSelectionController();
  26271. var _16a0="";
  26272. var _16a1,index;
  26273. if(_169d){
  26274. try{
  26275. var _16a3=_169f.getAllSelectedObjects().length;
  26276. if(_16a3==1){
  26277. _16a1=_169f.getAllSelectedObjects()[0];
  26278. if(this.m_bFlipSelection){
  26279. _16a0=RV_RES.IDS_JS_CALCULATE_NUMBER+" "+this.getCalcSymbol()+" "+this.getDisplayValueFromSelection(_16a1);
  26280. }else{
  26281. _16a0=this.getDisplayValueFromSelection(_16a1)+" "+this.getCalcSymbol()+" "+RV_RES.IDS_JS_CALCULATE_NUMBER;
  26282. }
  26283. }else{
  26284. if(this.m_bFlipSelection){
  26285. _16a3--;
  26286. for(index=_16a3;index>=0;index--){
  26287. _16a1=_169f.getAllSelectedObjects()[index];
  26288. if(index!=_16a3){
  26289. _16a0+=" "+this.getCalcSymbol()+" ";
  26290. }
  26291. _16a0+=this.getDisplayValueFromSelection(_16a1);
  26292. }
  26293. }else{
  26294. for(index=0;index<_16a3;index++){
  26295. _16a1=_169f.getAllSelectedObjects()[index];
  26296. if(index>0){
  26297. _16a0+=" "+this.getCalcSymbol()+" ";
  26298. }
  26299. _16a0+=this.getDisplayValueFromSelection(_16a1);
  26300. }
  26301. }
  26302. }
  26303. }
  26304. catch(e){
  26305. _16a0=this.getCalcSymbol();
  26306. }
  26307. }else{
  26308. _16a0=this.getCalcSymbol();
  26309. }
  26310. return _16a0;
  26311. };
  26312. function PercentDifferenceCalculation(){
  26313. };
  26314. PercentDifferenceCalculation.prototype=new CognosViewerCalculation();
  26315. PercentDifferenceCalculation.prototype.validSelectionLength=function(_16a4){
  26316. try{
  26317. return _16a4.getAllSelectedObjects().length==2;
  26318. }
  26319. catch(e){
  26320. return false;
  26321. }
  26322. };
  26323. PercentDifferenceCalculation.prototype.getMenuItemString=function(_16a5){
  26324. var _16a6=this.getCognosViewer().getSelectionController();
  26325. var _16a7=RV_RES.IDS_JS_CALCULATE_PERCENT_DIFFERENCE;
  26326. if(_16a5){
  26327. try{
  26328. var _16a8=_16a6.getAllSelectedObjects().length;
  26329. _16a7+=" (";
  26330. for(var index=0;index<_16a8;index++){
  26331. var _16aa=_16a6.getAllSelectedObjects()[index];
  26332. if(index>0){
  26333. _16a7+=", ";
  26334. }
  26335. _16a7+=this.getDisplayValueFromSelection(_16aa);
  26336. }
  26337. _16a7+=")";
  26338. }
  26339. catch(e){
  26340. }
  26341. }
  26342. return _16a7;
  26343. };
  26344. function PercentDifferenceCalculationSwapOrder(){
  26345. this.m_bFlipSelection=true;
  26346. };
  26347. PercentDifferenceCalculationSwapOrder.prototype=new PercentDifferenceCalculation();
  26348. PercentDifferenceCalculationSwapOrder.prototype.getMenuItemString=function(_16ab){
  26349. var _16ac=this.getCognosViewer().getSelectionController();
  26350. var _16ad=RV_RES.IDS_JS_CALCULATE_PERCENT_DIFFERENCE;
  26351. if(_16ab){
  26352. try{
  26353. var _16ae=_16ac.getAllSelectedObjects().length;
  26354. _16ad+=" (";
  26355. _16ae--;
  26356. for(var index=_16ae;index>=0;index--){
  26357. var _16b0=_16ac.getAllSelectedObjects()[index];
  26358. if(index<_16ae){
  26359. _16ad+=", ";
  26360. }
  26361. _16ad+=this.getDisplayValueFromSelection(_16b0);
  26362. }
  26363. _16ad+=")";
  26364. }
  26365. catch(e){
  26366. }
  26367. }
  26368. return _16ad;
  26369. };
  26370. function AdditionCalculation(){
  26371. };
  26372. AdditionCalculation.prototype=new CognosViewerCalculation();
  26373. AdditionCalculation.prototype.getCalcSymbol=function(){
  26374. return "+";
  26375. };
  26376. function SubtractionCalculation(){
  26377. };
  26378. SubtractionCalculation.prototype=new CognosViewerCalculation();
  26379. SubtractionCalculation.prototype.getCalcSymbol=function(){
  26380. return "-";
  26381. };
  26382. SubtractionCalculation.prototype.validSelectionLength=function(_16b1){
  26383. try{
  26384. var _16b2=_16b1.getAllSelectedObjects().length;
  26385. return _16b2>0&&_16b2<3;
  26386. }
  26387. catch(e){
  26388. return false;
  26389. }
  26390. };
  26391. function SubtractionCalculationSwapOrder(){
  26392. this.m_bFlipSelection=true;
  26393. };
  26394. SubtractionCalculationSwapOrder.prototype=new SubtractionCalculation();
  26395. function MultiplicationCalculation(){
  26396. };
  26397. MultiplicationCalculation.prototype=new CognosViewerCalculation();
  26398. MultiplicationCalculation.prototype.getCalcSymbol=function(){
  26399. return "*";
  26400. };
  26401. function DivisionCalculation(){
  26402. };
  26403. DivisionCalculation.prototype=new CognosViewerCalculation();
  26404. DivisionCalculation.prototype.getCalcSymbol=function(){
  26405. return "/";
  26406. };
  26407. DivisionCalculation.prototype.validSelectionLength=function(_16b3){
  26408. try{
  26409. var _16b4=_16b3.getAllSelectedObjects().length;
  26410. return (_16b4>0&&_16b4<3);
  26411. }
  26412. catch(e){
  26413. return false;
  26414. }
  26415. };
  26416. function DivisionCalculationSwapOrder(){
  26417. this.m_bFlipSelection=true;
  26418. };
  26419. DivisionCalculationSwapOrder.prototype=new DivisionCalculation();
  26420. function CalculationAction(){
  26421. this.m_payload="";
  26422. this.m_menuBuilderClass=null;
  26423. this.m_defaultName="";
  26424. this.m_constant=null;
  26425. };
  26426. CalculationAction.prototype=new ModifyReportAction();
  26427. CalculationAction.prototype.getUndoHint=function(){
  26428. return RV_RES.IDS_JS_CALCULATION;
  26429. };
  26430. CalculationAction.prototype.keepRAPCache=function(){
  26431. return false;
  26432. };
  26433. CalculationAction.prototype.listRules=function(){
  26434. var _16b5=this.getCognosViewer().getSelectionController();
  26435. var _16b6=_16b5.getSelections();
  26436. if(_16b6.length>1){
  26437. var tmp={};
  26438. for(var i=0;i<_16b6.length;++i){
  26439. var _16b9=_16b6[i].getColumnRef();
  26440. if(typeof tmp[_16b9]=="undefined"){
  26441. tmp[_16b9]=1;
  26442. }else{
  26443. return false;
  26444. }
  26445. }
  26446. }
  26447. return _16b5.selectionsHaveCalculationMetadata();
  26448. };
  26449. CalculationAction.prototype.crosstabRules=function(){
  26450. var _16ba=this.getCognosViewer().getSelectionController();
  26451. if(!_16ba.areSelectionsColumnRowTitles()){
  26452. return false;
  26453. }
  26454. if(_16ba.isRelational()){
  26455. if(!this.relationalCrosstabRules(_16ba)){
  26456. return false;
  26457. }
  26458. }else{
  26459. if(!this.olapCrosstabRules(_16ba)){
  26460. return false;
  26461. }
  26462. }
  26463. return true;
  26464. };
  26465. CalculationAction.prototype.relationalCrosstabRules=function(_16bb){
  26466. return _16bb.selectionsHaveCalculationMetadata();
  26467. };
  26468. CalculationAction.prototype.olapCrosstabRules=function(_16bc){
  26469. if(!_16bc.selectionsHaveCalculationMetadata()){
  26470. return false;
  26471. }
  26472. if(!this.sameDimension(_16bc)){
  26473. return (typeof this.m_oCV.aQoSFunctions!="undefined")&&this.m_oCV.aQoSFunctions.toString().indexOf("MULTIPLE_MEASURE_DIMENSION_CALCULATIONS")!=-1&&_16bc.selectionsAreMeasures();
  26474. }else{
  26475. if(this.sameHierarchy(_16bc)){
  26476. return true;
  26477. }else{
  26478. return (typeof this.m_oCV.aQoSFunctions!="undefined")&&this.m_oCV.aQoSFunctions.toString().indexOf("VALUE_EXPRESSIONS_REF_MULTIPLE_HIERARCHIES_OF_SAME_DIMENSION")!=-1;
  26479. }
  26480. }
  26481. };
  26482. CalculationAction.prototype.sameDimension=function(_16bd){
  26483. try{
  26484. var dim="";
  26485. var _16bf=_16bd.getAllSelectedObjects().length;
  26486. for(var _16c0=0;_16c0<_16bf;_16c0++){
  26487. if(dim.length==0){
  26488. dim=_16bd.getAllSelectedObjects()[_16c0].getDimensionalItems("dun")[0][0];
  26489. }else{
  26490. if(dim!=_16bd.getAllSelectedObjects()[_16c0].getDimensionalItems("dun")[0][0]){
  26491. return false;
  26492. }
  26493. }
  26494. }
  26495. return true;
  26496. }
  26497. catch(e){
  26498. return false;
  26499. }
  26500. };
  26501. CalculationAction.prototype.sameHierarchy=function(_16c1){
  26502. try{
  26503. var dim="";
  26504. var _16c3=_16c1.getAllSelectedObjects().length;
  26505. for(var _16c4=0;_16c4<_16c3;_16c4++){
  26506. if(dim.length==0){
  26507. dim=_16c1.getAllSelectedObjects()[_16c4].getDimensionalItems("hun")[0][0];
  26508. }else{
  26509. if(dim!=_16c1.getAllSelectedObjects()[_16c4].getDimensionalItems("hun")[0][0]){
  26510. return false;
  26511. }
  26512. }
  26513. }
  26514. return true;
  26515. }
  26516. catch(e){
  26517. return false;
  26518. }
  26519. };
  26520. CalculationAction.prototype.addActionContextAdditionalParms=function(){
  26521. var _16c5="";
  26522. if(this.m_constant!=null){
  26523. _16c5+="<constant>"+xml_encode(this.m_constant)+"</constant>";
  26524. if(this.m_swapSelectionOrder){
  26525. _16c5+="<constantFirst/>";
  26526. }
  26527. }
  26528. if(this.m_defaultName!=""){
  26529. _16c5+="<columnName>"+xml_encode(this.m_defaultName)+"</columnName>";
  26530. }
  26531. return _16c5;
  26532. };
  26533. CalculationAction.prototype.setRequestParms=function(parms){
  26534. if(parms!=null){
  26535. if(typeof parms.constant!=null){
  26536. this.m_constant=parms.constant;
  26537. }
  26538. }
  26539. };
  26540. CalculationAction.prototype.buildDefaultName=function(){
  26541. try{
  26542. var calc=this.getCognosViewer().getCalculation(this.m_menuBuilderClass);
  26543. this.m_defaultName=calc.getMenuItemString(true);
  26544. if(this.m_constant!=null){
  26545. var _16c8=""+this.m_constant;
  26546. var _16c9=this.getCognosViewer().envParams["contentDecimalSeparator"];
  26547. if(typeof _16c9!="undefined"&&_16c9!=null&&_16c9!="."){
  26548. _16c8=_16c8.replace(".",_16c9);
  26549. }
  26550. this.m_defaultName=this.m_defaultName.replace(RV_RES.IDS_JS_CALCULATE_NUMBER,_16c8);
  26551. }
  26552. }
  26553. catch(e){
  26554. this.m_defaultName="";
  26555. }
  26556. };
  26557. CalculationAction.prototype.preProcess=function(){
  26558. var _16ca=this.getNumberOfSelections();
  26559. this.buildDefaultName();
  26560. if(this.m_swapSelectionOrder&&_16ca==2){
  26561. var _16cb=this.getCognosViewer().getSelectionController();
  26562. var sel1=_16cb.getAllSelectedObjects()[0];
  26563. var sel2=_16cb.getAllSelectedObjects()[1];
  26564. _16cb.m_aSelectedObjects=[sel2,sel1];
  26565. }
  26566. };
  26567. CalculationAction.prototype.isFactCellOnCrosstabOrEmpty=function(){
  26568. var _16ce=this.m_oCV.getSelectionController();
  26569. var _16cf=_16ce.getAllSelectedObjects();
  26570. if(_16cf!=null&&typeof _16cf!="undefined"){
  26571. if(_16cf.length==0){
  26572. return true;
  26573. }else{
  26574. var _16d0=_16cf[0];
  26575. if(_16ce.getDataContainerType()=="crosstab"&&_16d0.getLayoutType()=="datavalue"){
  26576. return true;
  26577. }
  26578. }
  26579. }
  26580. return false;
  26581. };
  26582. CalculationAction.prototype.isSummaryOrAggregateCell=function(){
  26583. var _16d1=this.m_oCV.getSelectionController();
  26584. var _16d2=_16d1.getAllSelectedObjects();
  26585. if(_16d2!=null&&typeof _16d2!="undefined"){
  26586. var _16d3;
  26587. var _16d4=/\b(ol|il)\b/;
  26588. for(var i=0;i<_16d2.length;i++){
  26589. _16d3=_16d2[i].getCellRef();
  26590. if(_16d3!=null&&typeof _16d3!="undefined"){
  26591. if(_16d2[i].getLayoutType()=="summary"||(_16d3!=null&&_16d4.test(_16d3.className))){
  26592. return true;
  26593. }
  26594. }
  26595. _16d3=null;
  26596. }
  26597. }
  26598. return false;
  26599. };
  26600. CalculationAction.prototype.isLastSelectionSingleDimensionNested=function(){
  26601. var _16d6=this.m_oCV.getSelectionController();
  26602. var _16d7=_16d6.getAllSelectedObjects();
  26603. if(_16d7!=null&&typeof _16d7!="undefined"&&_16d7.length){
  26604. var _16d8=_16d7[_16d7.length-1];
  26605. var _16d9=_16d8.getDimensionalItems("dun")[0];
  26606. if(_16d9&&_16d9.length&&_16d9[0]){
  26607. for(var _16da=1;_16da<_16d9.length;++_16da){
  26608. if(_16d9[_16da]===_16d9[0]){
  26609. return true;
  26610. }
  26611. }
  26612. }
  26613. }
  26614. return false;
  26615. };
  26616. CalculationAction.prototype.areCalculationsPossible=function(){
  26617. var _16db=this.getCognosViewer().getSelectionController();
  26618. if(this.isFactCellOnCrosstabOrEmpty()){
  26619. return false;
  26620. }
  26621. if(this.isSelectionOnChart()){
  26622. return false;
  26623. }
  26624. if(this.isSummaryOrAggregateCell()){
  26625. return false;
  26626. }
  26627. if(!_16db.selectionsInSameDataContainer()){
  26628. return false;
  26629. }
  26630. if(_16db.getDataContainerType()=="list"){
  26631. return this.listRules(_16db);
  26632. }else{
  26633. if(_16db.getDataContainerType()=="crosstab"&&!this.isLastSelectionSingleDimensionNested()){
  26634. return this.crosstabRules(_16db);
  26635. }
  26636. }
  26637. return false;
  26638. };
  26639. CalculationAction.prototype.updateMenu=function(_16dc,_16dd){
  26640. _16dc.visible=this.ifContainsInteractiveDataContainer();
  26641. if(!_16dc.visible){
  26642. return _16dc;
  26643. }
  26644. if(!this.areCalculationsPossible()){
  26645. return this.toggleMenu(_16dc,false);
  26646. }
  26647. this.toggleMenu(_16dc,true);
  26648. if(this.m_oCV.aQoSFunctions){
  26649. _16dc=this.buildCalculationMenuItemsAgainstSelection(_16dc);
  26650. }else{
  26651. _16dc=this.buildDynamicMenuItem(_16dc,"Calculation");
  26652. }
  26653. return _16dc;
  26654. };
  26655. CalculationAction.prototype.toggleMenu=function(_16de,_16df){
  26656. if(_16df){
  26657. _16de.iconClass="calculate";
  26658. _16de.disabled=false;
  26659. }else{
  26660. _16de.iconClass="calculateDisabled";
  26661. _16de.disabled=true;
  26662. }
  26663. return _16de;
  26664. };
  26665. CalculationAction.prototype.buildMenu=function(_16e0,_16e1){
  26666. _16e0.visible=this.ifContainsInteractiveDataContainer();
  26667. if(!_16e0.visible){
  26668. return _16e0;
  26669. }
  26670. if(!this.areCalculationsPossible()){
  26671. return this.toggleMenu(_16e0,false);
  26672. }
  26673. this.toggleMenu(_16e0,true);
  26674. var _16e2=this.getCognosViewer();
  26675. if(typeof _16e2.aQoSFunctions=="undefined"){
  26676. this.fetchQoS(_16e0,_16e1,(typeof _16e1=="undefined")?false:true);
  26677. }
  26678. if(typeof _16e2.aQoSFunctions!="undefined"){
  26679. return this.buildCalculationMenuItemsAgainstSelection(_16e0);
  26680. }
  26681. };
  26682. CalculationAction.prototype.fetchQoS=function(_16e3,_16e4,_16e5){
  26683. var _16e6={customArguments:[_16e3,_16e4],"complete":{"object":this,"method":this.handleQoSResponse}};
  26684. var _16e7=new AsynchJSONDispatcherEntry(this.m_oCV);
  26685. _16e7.setCallbacks(_16e6);
  26686. _16e7.addFormField("ui.action","getQualityOfService");
  26687. _16e7.addFormField("parameterValues",this.m_oCV.getExecutionParameters());
  26688. _16e7.addFormField("bux","true");
  26689. _16e7.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
  26690. _16e7.addDefinedFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
  26691. if(!_16e5){
  26692. _16e7.forceSynchronous();
  26693. }
  26694. this.m_oCV.dispatchRequest(_16e7);
  26695. };
  26696. CalculationAction.prototype.handleQoSResponse=function(_16e8,_16e9,_16ea){
  26697. this.m_oCV.aQoSFunctions=_16e8.getResult();
  26698. this.buildCalculationMenuItemsAgainstSelection(_16e9,_16ea);
  26699. if(typeof _16ea=="function"){
  26700. _16ea();
  26701. }
  26702. };
  26703. CalculationAction.prototype.buildCalculationMenuItemsAgainstSelection=function(_16eb,_16ec){
  26704. var _16ed=this.m_oCV.aBuxCalculations;
  26705. var _16ee=[];
  26706. for(var _16ef=0;_16ef<_16ed.length;_16ef++){
  26707. var calc=this.m_oCV.getCalculation(_16ed[_16ef]);
  26708. if(this.m_oCV.aQoSFunctions==null||typeof this.m_oCV.aQoSFunctions=="undefined"){
  26709. _16eb.disabled=true;
  26710. _16eb.iconClass="calculate";
  26711. _16eb.items=null;
  26712. return _16eb;
  26713. }
  26714. if(calc&&calc.validSelectionLength(this.getCognosViewer().getSelectionController())&&this.m_oCV.aQoSFunctions.toString().indexOf(_16ed[_16ef])!=-1){
  26715. var _16f1={};
  26716. _16f1.name=_16ed[_16ef];
  26717. _16f1.label=calc.getMenuItemString(true);
  26718. _16f1.action={};
  26719. var _16f2="";
  26720. if(_16ed[_16ef].indexOf("SwapOrder")!=-1){
  26721. _16f2=_16ed[_16ef].substring(0,_16ed[_16ef].indexOf("SwapOrder"));
  26722. }else{
  26723. _16f2=_16ed[_16ef];
  26724. }
  26725. _16f1.iconClass=_16f2;
  26726. if(this.getNumberOfSelections()==1){
  26727. _16f1.action.name="ConstantOperandCalculation";
  26728. _16f1.action.payload=_16ed[_16ef];
  26729. }else{
  26730. _16f1.action.name=_16ed[_16ef];
  26731. _16f1.action.payload="";
  26732. }
  26733. if(_16f1.action.name=="PercentDifferenceCalculation"){
  26734. _16ee.push({separator:true});
  26735. }
  26736. _16f1.items=null;
  26737. _16ee.push(_16f1);
  26738. }
  26739. }
  26740. if(_16ee.length==0){
  26741. this.toggleMenu(_16eb,false);
  26742. _16ee.push({name:"None",label:RV_RES.IDS_JS_CALCULATION_SELECT_DATA,iconClass:"",action:null,items:null});
  26743. }else{
  26744. this.toggleMenu(_16eb,true);
  26745. }
  26746. _16eb.items=_16ee;
  26747. return _16eb;
  26748. };
  26749. function PercentDifferenceCalculationAction(){
  26750. this.m_sAction="PercentDifference";
  26751. this.m_menuBuilderClass="PercentDifferenceCalculation";
  26752. };
  26753. PercentDifferenceCalculationAction.prototype=new CalculationAction();
  26754. function PercentDifferenceCalculationSwapOrderAction(){
  26755. this.m_sAction="PercentDifference";
  26756. this.m_menuBuilderClass="PercentDifferenceCalculationSwapOrder";
  26757. this.m_swapSelectionOrder=true;
  26758. };
  26759. PercentDifferenceCalculationSwapOrderAction.prototype=new CalculationAction();
  26760. function AdditionCalculationAction(){
  26761. this.m_sAction="Addition";
  26762. this.m_menuBuilderClass="AdditionCalculation";
  26763. };
  26764. AdditionCalculationAction.prototype=new CalculationAction();
  26765. function SubtractionCalculationAction(){
  26766. this.m_sAction="Subtraction";
  26767. this.m_menuBuilderClass="SubtractionCalculation";
  26768. };
  26769. SubtractionCalculationAction.prototype=new CalculationAction();
  26770. function SubtractionCalculationSwapOrderAction(){
  26771. this.m_sAction="Subtraction";
  26772. this.m_menuBuilderClass="SubtractionCalculationSwapOrder";
  26773. this.m_swapSelectionOrder=true;
  26774. };
  26775. SubtractionCalculationSwapOrderAction.prototype=new CalculationAction();
  26776. function MultiplicationCalculationAction(){
  26777. this.m_sAction="Multiplication";
  26778. this.m_menuBuilderClass="MultiplicationCalculation";
  26779. };
  26780. MultiplicationCalculationAction.prototype=new CalculationAction();
  26781. function DivisionCalculationAction(){
  26782. this.m_sAction="Division";
  26783. this.m_menuBuilderClass="DivisionCalculation";
  26784. };
  26785. DivisionCalculationAction.prototype=new CalculationAction();
  26786. function DivisionCalculationSwapOrderAction(){
  26787. this.m_sAction="Division";
  26788. this.m_menuBuilderClass="DivisionCalculationSwapOrder";
  26789. this.m_swapSelectionOrder=true;
  26790. };
  26791. DivisionCalculationSwapOrderAction.prototype=new CalculationAction();
  26792. function ConstantOperandCalculationAction(){
  26793. this.m_action=null;
  26794. };
  26795. ConstantOperandCalculationAction.prototype=new CognosViewerAction();
  26796. ConstantOperandCalculationAction.prototype.setRequestParms=function(_16f3){
  26797. this.m_action=_16f3;
  26798. };
  26799. ConstantOperandCalculationAction.prototype.execute=function(){
  26800. var _16f4=getCognosViewerObjectString(this.m_oCV.getId());
  26801. var _16f5=this.m_action;
  26802. var _16f6=this.m_oCV.getCalculation(_16f5);
  26803. var _16f7=_16f6.getMenuItemString(true);
  26804. var _16f8=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER_TITLE;
  26805. var _16f9=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER_DESCRIPTION;
  26806. _16f9=_16f9.substring(0,_16f9.indexOf("{0}"))+_16f7+_16f9.substring(_16f9.indexOf("{0}")+3);
  26807. var _16fa=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER;
  26808. var _16fb=this.m_oCV.envParams["contentLocale"];
  26809. var _16fc=new viewer.dialogs.CalculationDialog({sTitle:_16f8,sLabel:_16fa,sDescription:_16f9,sContentLocale:_16fb,okHandler:function(value){
  26810. window[_16f4].executeAction(_16f5,{constant:value});
  26811. },cancelHandler:function(){
  26812. }});
  26813. _16fc.startup();
  26814. window.setTimeout(function(){
  26815. _16fc.show();
  26816. },0);
  26817. };
  26818. function FilterAction(){
  26819. this.m_sAction="Filter";
  26820. this.m_sType="";
  26821. this.m_sItem="";
  26822. this.m_sFormattedNumber="";
  26823. this.m_sFormattedEndNumber="";
  26824. this.m_jsonDetails="";
  26825. };
  26826. FilterAction.prototype=new ModifyReportAction();
  26827. FilterAction.prototype.execute=function(){
  26828. ModifyReportAction.prototype.execute.apply(this,arguments);
  26829. if(this.m_sType.indexOf("remove")!=-1){
  26830. this.getCognosViewer().getViewerWidget().clearRAPCache();
  26831. }
  26832. };
  26833. FilterAction.prototype.genSelectionContextWithUniqueCTXIDs=function(){
  26834. return true;
  26835. };
  26836. FilterAction.prototype.getUndoHint=function(){
  26837. if(this.m_sType.indexOf("remove")!=-1){
  26838. return RV_RES.IDS_JS_REMOVE_FILTER;
  26839. }else{
  26840. return RV_RES.IDS_JS_FILTER;
  26841. }
  26842. };
  26843. FilterAction.prototype.setRequestParms=function(parms){
  26844. if(parms.type!=null&&typeof parms.type!="undefined"){
  26845. this.m_sType=parms.type;
  26846. if(parms.id!=null&&typeof parms.id!="undefined"){
  26847. this.m_sId=parms.id;
  26848. }
  26849. if(parms.item!=null&&typeof parms.item!="undefined"){
  26850. this.m_sItem=parms.item;
  26851. }
  26852. if(parms.details){
  26853. this.m_jsonDetails=parms.details;
  26854. }
  26855. if(parms.formattedNumber!=null&&typeof parms.formattedNumber!="undefined"){
  26856. this.m_sFormattedNumber=parms.formattedNumber;
  26857. }
  26858. if(parms.formattedEndNumber!=null&&typeof parms.formattedEndNumber!="undefined"){
  26859. this.m_sFormattedEndNumber=parms.formattedEndNumber;
  26860. }
  26861. }else{
  26862. this.m_sType=parms;
  26863. }
  26864. };
  26865. FilterAction.prototype.addActionContextAdditionalParms=function(){
  26866. var parms="<type>"+this.m_sType+"</type>";
  26867. if(this.m_sId!=null&&typeof this.m_sId!="undefined"){
  26868. parms+=("<id>"+xml_encode(this.m_sId)+"</id>");
  26869. }
  26870. if(this.m_sItem!=null&&typeof this.m_sItem!="undefined"&&this.m_sItem!=""){
  26871. parms+=("<item>"+xml_encode(this.m_sItem)+"</item>");
  26872. }
  26873. if(this.m_jsonDetails&&this.m_jsonDetails!=""){
  26874. parms+="<details>"+xml_encode(this.m_jsonDetails)+"</details>";
  26875. }
  26876. if(this.m_sFormattedNumber!=null&&typeof this.m_sFormattedNumber!="undefined"&&this.m_sFormattedNumber!=""){
  26877. parms+=("<formattedNumber>"+this.m_sFormattedNumber+"</formattedNumber>");
  26878. }
  26879. if(this.m_sFormattedEndNumber!=null&&typeof this.m_sFormattedEndNumber!="undefined"&&this.m_sFormattedEndNumber!=""){
  26880. parms+=("<formattedEndNumber>"+this.m_sFormattedEndNumber+"</formattedEndNumber>");
  26881. }
  26882. return parms;
  26883. };
  26884. FilterAction.prototype.buildSelectedItemsString=function(_1700){
  26885. var _1701="";
  26886. var _1702=_1700.length;
  26887. var _1703=_1702>5?5:_1702;
  26888. for(var index=0;index<_1702;++index){
  26889. var value=this.getItemLabel(_1700[index]);
  26890. if(typeof value=="undefined"||value==""){
  26891. return "";
  26892. }
  26893. if((index)<_1703){
  26894. _1701+=value;
  26895. }
  26896. if((index+1)<_1703){
  26897. _1701+=", ";
  26898. }
  26899. }
  26900. if(_1702>5){
  26901. _1701+=", ++";
  26902. }
  26903. return _1701;
  26904. };
  26905. FilterAction.prototype.getItemLabel=function(_1706){
  26906. var value=_1706.getDisplayValues()[0];
  26907. if(typeof value=="undefined"){
  26908. value=_1706.getUseValues()[0][0];
  26909. }
  26910. return value;
  26911. };
  26912. FilterAction.prototype.toggleMenu=function(_1708,_1709){
  26913. if(_1709){
  26914. _1708.iconClass="filter";
  26915. _1708.disabled=false;
  26916. }else{
  26917. _1708.iconClass="filterDisabled";
  26918. _1708.disabled=true;
  26919. }
  26920. return _1708;
  26921. };
  26922. FilterAction.prototype.updateMenu=function(_170a){
  26923. _170a.visible=(this.ifContainsInteractiveDataContainer()&&!this.detailFilteringIsDisabled());
  26924. var _170b=_170a;
  26925. if(_170a.visible){
  26926. var _170c=(this.m_oCV.getSelectionController().getAllSelectedObjects().length>0||this.isSelectionFilterable()||this.isRemoveAllValid());
  26927. if(!_170c){
  26928. _170b=this.toggleMenu(_170a,false);
  26929. }else{
  26930. this.buildMenu(_170a);
  26931. if(_170a.disabled==true){
  26932. _170b=this.toggleMenu(_170a,false);
  26933. }else{
  26934. _170b=this.buildDynamicMenuItem(_170a,"Filter");
  26935. }
  26936. }
  26937. }
  26938. return _170b;
  26939. };
  26940. FilterAction.prototype.detailFilteringIsDisabled=function(){
  26941. var _170d=this.getCognosViewer().getRAPReportInfo();
  26942. if(_170d){
  26943. return _170d.isDetailFilteringDisabled();
  26944. }
  26945. return false;
  26946. };
  26947. FilterAction.prototype.buildMenu=function(_170e){
  26948. _170e.visible=(this.ifContainsInteractiveDataContainer()&&!this.detailFilteringIsDisabled());
  26949. if(!_170e.visible){
  26950. return _170e;
  26951. }
  26952. var _170f=this.isSelectionFilterable();
  26953. this.toggleMenu(_170e,_170f);
  26954. var _1710=[];
  26955. var _1711=false;
  26956. var _1712=false;
  26957. var _1713=this.m_oCV.getSelectionController();
  26958. var _1714=_1713.getAllSelectedObjects();
  26959. if(_1714.length>0&&_1713.selectionsInSameDataContainer()&&_1713.selectionsFromSameDataItem()){
  26960. var _1715=_1714[0].getDataItems()[0][0];
  26961. if(_170f){
  26962. _1711=this.addFilterValueActionsToMenu(_1713,_1710,_1715);
  26963. }
  26964. if(this.isRemoveItemFilterValid(_1715)){
  26965. if(_1711==true){
  26966. _1710.push({separator:true});
  26967. _1712=true;
  26968. }
  26969. var label=this.getRefDataItemLabel(_1715);
  26970. _1710.push({name:"RemoveFilterFor",label:RV_RES.IDS_JS_REMOVE_FILTER_FOR+" "+enforceTextDir(label),iconClass:"",action:{name:"Filter",payload:"remove"},items:null});
  26971. }
  26972. }
  26973. if(this.isRemoveAllValid()==true){
  26974. if(_1711&&!_1712){
  26975. _1710.push({separator:true});
  26976. }
  26977. _1710.push({name:"RemoveAllFiltersForWidget",label:RV_RES.IDS_JS_REMOVE_ALL_FILTERS_FOR_WIDGET,iconClass:"",action:{name:"Filter",payload:"removeAllForWidget"},items:null});
  26978. }
  26979. if(_1710.length==0){
  26980. return this.toggleMenu(_170e,false);
  26981. }else{
  26982. _170e.items=_1710;
  26983. this.toggleMenu(_170e,true);
  26984. return _170e;
  26985. }
  26986. };
  26987. FilterAction.prototype.getRefDataItemLabel=function(_1717){
  26988. var label=_1717;
  26989. var _1719=this.m_oCV.getRAPReportInfo();
  26990. if(_1719){
  26991. var _171a=_1719.getFilterObject(_1717,true);
  26992. if(_171a){
  26993. label=_171a.itemLabel;
  26994. }
  26995. }
  26996. return label;
  26997. };
  26998. FilterAction.prototype.addFilterValueActionsToMenu=function(_171b,_171c,_171d){
  26999. var _171e=_171b.getAllSelectedObjectsWithUniqueCTXIDs();
  27000. var _171f=_171e.length;
  27001. var sel=0;
  27002. if(_171e[0].m_dataContainerType=="list"){
  27003. for(sel=0;sel<_171e.length;++sel){
  27004. if(_171e[sel].m_sLayoutType=="columnTitle"){
  27005. _171f=0;
  27006. break;
  27007. }
  27008. }
  27009. }
  27010. if(_171f==0){
  27011. return false;
  27012. }
  27013. var _1721=this.buildSelectedItemsString(_171e);
  27014. if(_1721==""){
  27015. if(_171f==1&&_171e[0].getLayoutType()=="datavalue"){
  27016. _1721=RV_RES.IDS_JS_NULL;
  27017. _171c.push({name:"InFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_INCLUDE,_1721),iconClass:"",action:{name:"Filter",payload:"in"},items:null});
  27018. _171c.push({name:"NotInFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_EXCLUDE,_1721),iconClass:"",action:{name:"Filter",payload:"not"},items:null});
  27019. }
  27020. }else{
  27021. if(_171b.selectionsAreDateTime()||(_171b.selectionsHaveCalculationMetadata()&&!_171b.selectionsNonMeasureWithMUN())){
  27022. for(sel=0;sel<_171f;++sel){
  27023. if(_171e[sel].m_sLayoutType=="columnTitle"){
  27024. return false;
  27025. }
  27026. }
  27027. if(_171f==1){
  27028. if(_171e[0].getUseValues()[0][0]){
  27029. _171c.push({name:"LessFilter",label:RV_RES.IDS_JS_FILTER_LESS_THAN+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"lessThan",formattedNumber:_1721}},items:null});
  27030. _171c.push({name:"LessEqualFilter",label:RV_RES.IDS_JS_FILTER_LESS_THAN_EQUAL+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"lessThanEqual",formattedNumber:_1721}},items:null});
  27031. _171c.push({name:"GreaterEqualFilter",label:RV_RES.IDS_JS_FILTER_GREATER_THAN_EQUAL+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"greaterThanEqual",formattedNumber:_1721}},items:null});
  27032. _171c.push({name:"GreaterFilter",label:RV_RES.IDS_JS_FILTER_GREATER_THAN+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"greaterThan",formattedNumber:_1721}},items:null});
  27033. }
  27034. }else{
  27035. if(_171f==2){
  27036. if(_171e[0].getUseValues()[0][0]&&_171e[1].getUseValues()[0][0]){
  27037. var _1722=this.getItemLabel(_171e[0]);
  27038. var _1723=this.getItemLabel(_171e[1]);
  27039. _171c.push({name:"BetweenFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_BETWEEN,[_1722,_1723]),iconClass:"",action:{name:"Filter",payload:{type:"between",formattedNumber:_1722,formattedEndNumber:_1723}},items:null});
  27040. _171c.push({name:"NotBetweenFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_NOT_BETWEEN,[_1722,_1723]),iconClass:"",action:{name:"Filter",payload:{type:"notBetween",formattedNumber:_1722,formattedEndNumber:_1723}},items:null});
  27041. }
  27042. }else{
  27043. return false;
  27044. }
  27045. }
  27046. }else{
  27047. var _1724=_171b.getDataContainerType();
  27048. if(_1724=="crosstab"&&_171e[0].getLayoutType()=="columnTitle"){
  27049. if(this.isSelectSingleMember(_171e[0])==true){
  27050. return false;
  27051. }
  27052. }
  27053. _171c.push({name:"InFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_INCLUDE,enforceTextDir(_1721)),iconClass:"",action:{name:"Filter",payload:"in"},items:null});
  27054. _171c.push({name:"NotInFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_EXCLUDE,enforceTextDir(_1721)),iconClass:"",action:{name:"Filter",payload:"not"},items:null});
  27055. }
  27056. }
  27057. return true;
  27058. };
  27059. FilterAction.prototype.isRemoveAllValid=function(){
  27060. var _1725=this.m_oCV.getRAPReportInfo();
  27061. if(_1725){
  27062. return _1725.containsFilters();
  27063. }
  27064. return false;
  27065. };
  27066. FilterAction.prototype.isRemoveItemFilterValid=function(_1726){
  27067. var _1727=this.getContainerId(this.m_oCV.getSelectionController());
  27068. var _1728=this.m_oCV.getRAPReportInfo();
  27069. if(_1727!=null&&_1728){
  27070. var _1729=_1728.getFilterObjectFromContainer(_1727,_1726,false);
  27071. return _1729?true:false;
  27072. }
  27073. return false;
  27074. };
  27075. FilterAction.prototype.isSelectionFilterable=function(){
  27076. var _172a=this.m_oCV.getSelectionController();
  27077. var _172b=_172a.getAllSelectedObjects();
  27078. if(_172b.length>0){
  27079. var _172c=_172b[0].getCellRef();
  27080. if(_172c&&_172c.getAttribute&&_172c.getAttribute("no_data_item_column")==="true"){
  27081. return false;
  27082. }
  27083. if(_172a.hasSelectedChartNodes()){
  27084. var _172d=false;
  27085. if(_172a.selectionsAreDateTime()||(_172a.selectionsHaveCalculationMetadata()&&!_172a.selectionsNonMeasureWithMUN())){
  27086. _172d=true;
  27087. }
  27088. for(var sel=0;sel<_172b.length;++sel){
  27089. if(_172b[sel].getLayoutType()){
  27090. if(_172b[sel].getLayoutType().match("Title$")=="Title"){
  27091. return false;
  27092. }
  27093. if(_172d&&_172b[sel].getLayoutType().match("Label$")=="Label"){
  27094. return false;
  27095. }
  27096. }
  27097. }
  27098. }
  27099. }
  27100. return true;
  27101. };
  27102. function GetFilterInfoAction(){
  27103. this.m_requestParms=null;
  27104. };
  27105. GetFilterInfoAction.prototype=new ModifyReportAction();
  27106. GetFilterInfoAction.prototype.isUndoable=function(){
  27107. return false;
  27108. };
  27109. GetFilterInfoAction.prototype.canBeQueued=function(){
  27110. return true;
  27111. };
  27112. GetFilterInfoAction.prototype.setRequestParms=function(parms){
  27113. this.m_requestParms=parms;
  27114. };
  27115. GetFilterInfoAction.prototype.runReport=function(){
  27116. return false;
  27117. };
  27118. GetFilterInfoAction.prototype.updateInfoBar=function(){
  27119. return false;
  27120. };
  27121. GetFilterInfoAction.prototype.fireModifiedReportEvent=function(){
  27122. };
  27123. GetFilterInfoAction.prototype.buildActionContextAdditionalParmsXML=function(){
  27124. var _1730=XMLBuilderCreateXMLDocument("item");
  27125. var _1731=_1730.documentElement;
  27126. for(var parm in this.m_requestParms){
  27127. if(this.m_requestParms.hasOwnProperty(parm)){
  27128. var _1733=_1730.createElement(parm);
  27129. _1733.appendChild(_1730.createTextNode(this.m_requestParms[parm]));
  27130. _1731.appendChild(_1733);
  27131. }
  27132. }
  27133. return _1730;
  27134. };
  27135. GetFilterInfoAction.prototype.addActionContextAdditionalParms=function(){
  27136. if(this.m_requestParms===null){
  27137. return "";
  27138. }
  27139. return XMLBuilderSerializeNode(this.buildActionContextAdditionalParmsXML());
  27140. };
  27141. GetFilterInfoAction.prototype.createFilterInfoDispatcherEntry=function(){
  27142. var _1734=new ReportInfoDispatcherEntry(this.m_oCV);
  27143. _1734.initializeAction(this);
  27144. return _1734;
  27145. };
  27146. GetFilterInfoAction.prototype.execute=function(){
  27147. this.getCognosViewer().setKeepFocus(this.keepFocusOnWidget());
  27148. var _1735=this.createFilterInfoDispatcherEntry();
  27149. this.m_oCV.dispatchRequest(_1735);
  27150. this.fireModifiedReportEvent();
  27151. };
  27152. GetFilterInfoAction.prototype.getOnPromptingCallback=function(){
  27153. return this.getOnCompleteCallback();
  27154. };
  27155. function GetFilterValuesAction(){
  27156. this.m_sAction="CollectFilterValues";
  27157. this.m_sRetryClass="GetFilterValues";
  27158. };
  27159. GetFilterValuesAction.prototype=new GetFilterInfoAction();
  27160. GetFilterValuesAction.prototype.addActionContextAdditionalParms=function(){
  27161. if(this.m_requestParms===null){
  27162. return "";
  27163. }
  27164. var _1736=this.buildActionContextAdditionalParmsXML();
  27165. var _1737=_1736.documentElement;
  27166. for(var parm in this.m_requestParms){
  27167. if(parm=="name"){
  27168. var _1739=this.m_oCV.getSelectionController();
  27169. if(typeof _1739!="undefined"&&typeof _1739.getCCDManager()!="undefined"){
  27170. var _173a=_1739.getCCDManager().GetPageMinMaxForRDI(this.m_requestParms[parm]);
  27171. if(typeof _173a!="undefined"){
  27172. var _173b=_1736.createElement("pageMin");
  27173. _173b.appendChild(_1736.createTextNode(_173a.pageMin));
  27174. var _173c=_1736.createElement("pageMax");
  27175. _173c.appendChild(_1736.createTextNode(_173a.pageMax));
  27176. _1737.appendChild(_173b);
  27177. _1737.appendChild(_173c);
  27178. }
  27179. if(this.m_oCV.isSinglePageReport()==true){
  27180. var _173d=_1736.createElement("singlePageReport");
  27181. _1737.appendChild(_173d);
  27182. }
  27183. }
  27184. break;
  27185. }
  27186. }
  27187. var _173e=XMLBuilderSerializeNode(_1736);
  27188. return (_173e+this.addClientContextData(3));
  27189. };
  27190. GetFilterValuesAction.prototype.getOnCompleteCallback=function(){
  27191. var _173f=this.getCognosViewer();
  27192. var _1740=_173f.getViewerWidget();
  27193. var _1741=this.m_requestParms;
  27194. var _1742=function(_1743){
  27195. _1740.handleGetFilterValuesResponse(_1743,_1741);
  27196. };
  27197. return _1742;
  27198. };
  27199. GetFilterValuesAction.prototype.canBeQueued=function(){
  27200. return true;
  27201. };
  27202. GetFilterValuesAction.prototype.getActionKey=function(){
  27203. if(typeof this.m_requestParms!="undefined"&&typeof this.m_requestParms.source!="undefined"){
  27204. return this.m_sAction+this.m_requestParms.source;
  27205. }
  27206. return null;
  27207. };
  27208. function GetFilterableItemsAction(){
  27209. this.m_sAction="CollectFilterableItems";
  27210. };
  27211. GetFilterableItemsAction.prototype=new GetFilterInfoAction();
  27212. GetFilterableItemsAction.prototype.addActionContextAdditionalParms=function(){
  27213. return this.addClientContextData(3);
  27214. };
  27215. GetFilterableItemsAction.prototype.getOnCompleteCallback=function(){
  27216. var _1744=this.getCognosViewer();
  27217. var _1745=_1744.getViewerWidget();
  27218. var _1746=function(_1747){
  27219. _1745.handleGetFilterableItemsResponse(_1747);
  27220. };
  27221. return _1746;
  27222. };
  27223. function UpdateDataFilterAction(){
  27224. this.m_sAction="UpdateDataFilter";
  27225. this.m_bForceRunSpec=false;
  27226. };
  27227. UpdateDataFilterAction.prototype=new ModifyReportAction();
  27228. UpdateDataFilterAction.prototype.runReport=function(){
  27229. return this.getViewerWidget().shouldReportBeRunOnAction();
  27230. };
  27231. UpdateDataFilterAction.prototype.getActionKey=function(){
  27232. if(typeof this.m_requestParams!="undefined"){
  27233. try{
  27234. var parms=eval("("+this.m_requestParams+")");
  27235. if(parms.clientId!==null){
  27236. return this.m_sAction+parms.clientId;
  27237. }
  27238. }
  27239. catch(e){
  27240. }
  27241. }
  27242. return null;
  27243. };
  27244. UpdateDataFilterAction.prototype.canBeQueued=function(){
  27245. return true;
  27246. };
  27247. UpdateDataFilterAction.prototype.keepFocusOnWidget=function(){
  27248. return false;
  27249. };
  27250. UpdateDataFilterAction.prototype.isUndoable=function(){
  27251. return false;
  27252. };
  27253. UpdateDataFilterAction.prototype.setRequestParms=function(parms){
  27254. this.m_requestParams=parms.filterPayload;
  27255. this.m_drillResetHUN=parms.drillResetHUN;
  27256. this.m_isFacet=parms.isFacet;
  27257. if(parms.forceCleanup){
  27258. this.m_sForceCleanup=parms.forceCleanup;
  27259. }
  27260. };
  27261. UpdateDataFilterAction.prototype.forceRunSpecRequest=function(){
  27262. return this.m_bForceRunSpec;
  27263. };
  27264. UpdateDataFilterAction.prototype.preProcessContextValues=function(){
  27265. var _174a=[];
  27266. var _174b=dojo.fromJson(this.m_requestParams);
  27267. if(_174b&&_174b["com.ibm.widget.context"]&&(_174b["com.ibm.widget.context"]["values"]||_174b["com.ibm.widget.context"]["ranges"])){
  27268. var _174c=this.m_oCV.m_RAPReportInfo;
  27269. var _174d=_174c.getContainers();
  27270. if(!_174d){
  27271. _174a;
  27272. }
  27273. var key="";
  27274. var _174f="";
  27275. if(_174b["com.ibm.widget.context"]["values"]){
  27276. key="values";
  27277. _174f=_174b["com.ibm.widget.context"]["values"];
  27278. }else{
  27279. key="ranges";
  27280. _174f=_174b["com.ibm.widget.context"]["ranges"];
  27281. }
  27282. var _1750=_174c.collectSliderSetFromReportInfo();
  27283. for(dataItem in _174f){
  27284. if(_174c&&_174c.isReferenced(dataItem)){
  27285. var _1751=dojo.clone(_174b);
  27286. var _1752={};
  27287. _1752[dataItem]=_174b["com.ibm.widget.context"][key][dataItem];
  27288. _1751["com.ibm.widget.context"][key]=_1752;
  27289. if(_174b["com.ibm.widget.context.bux.selectValueControl"]&&_174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]&&_174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"]){
  27290. var _1753={};
  27291. _1751["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"]={};
  27292. var _1754=document.forms["formWarpRequest"+this.m_oCV.getId()].packageBase.value;
  27293. for(modelItem in _174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"]){
  27294. if(modelItem.indexOf(_1754)!=-1){
  27295. _1753[dataItem]=_174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"][modelItem][dataItem];
  27296. if(_1753[dataItem]){
  27297. _1751["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"][modelItem]=_1753;
  27298. break;
  27299. }
  27300. }
  27301. }
  27302. }
  27303. var _1755=_174f[dataItem]&&key!=="ranges"?_174f[dataItem].length:0;
  27304. if(this.checkIfFilterExpressionChanged(dataItem,_174b.clientId,_1755,_1750)){
  27305. this.m_bForceRunSpec=true;
  27306. }
  27307. _174a.push(dojo.toJson(_1751));
  27308. }
  27309. }
  27310. }else{
  27311. _174a.push(dojo.toJson(_174b));
  27312. }
  27313. return _174a;
  27314. };
  27315. UpdateDataFilterAction.prototype.checkIfFilterExpressionChanged=function(_1756,_1757,_1758,_1759){
  27316. if(!_1759||!_1759[_1757]||_1759[_1757].name!=_1756){
  27317. return true;
  27318. }
  27319. var _175a=_1759[_1757].values?_1759[_1757].values.length:0;
  27320. if(_1758==_175a){
  27321. return false;
  27322. }
  27323. return (_1758===1)!==(_175a===1);
  27324. };
  27325. UpdateDataFilterAction.prototype.addActionContext=function(){
  27326. var _175b="<reportActions";
  27327. var _175c="";
  27328. if(!this.runReport()){
  27329. _175b+=" run=\"false\"";
  27330. _175c="<inlineValues/>";
  27331. }
  27332. _175b+=">";
  27333. if(this.m_drillResetHUN&&this.m_drillResetHUN.length>0){
  27334. _175b+=this._getDrillResetActionContext();
  27335. }
  27336. if(this.m_sForceCleanup){
  27337. _175b+="<reportAction name=\""+this.m_sAction+"\">"+dojo.toJson(this.m_sForceCleanup)+"</reportAction>";
  27338. }
  27339. var _175d;
  27340. var _175e=(this.m_requestParams.charAt(0)==="<");
  27341. if(this.m_isFacet||_175e){
  27342. _175d=[this.m_requestParams];
  27343. }else{
  27344. _175d=this.preProcessContextValues();
  27345. }
  27346. for(var idx=0;idx<_175d.length;++idx){
  27347. var _1760=_175d[idx];
  27348. _175b+="<reportAction name=\""+this.m_sAction+"\">"+_175c;
  27349. _175b+=(_175e)?_1760:xml_encode(_1760);
  27350. if(idx>0){
  27351. _175b+="<augment>true</augment>";
  27352. }
  27353. if(!this.m_isFacet){
  27354. _175b+=this.addClientContextData(3);
  27355. }
  27356. _175b+="</reportAction>";
  27357. _175b+="<reportAction name=\"GetInfo\"><include><sliders/></include>";
  27358. _175b+="</reportAction>";
  27359. }
  27360. _175b+="</reportActions>";
  27361. return _175b;
  27362. };
  27363. UpdateDataFilterAction.prototype._getDrillResetActionContext=function(){
  27364. var _1761=new DrillResetAction();
  27365. _1761.setCognosViewer(this.getCognosViewer());
  27366. var _1762={drilledResetHUNs:this.m_drillResetHUN};
  27367. _1761.setRequestParms(_1762);
  27368. _1761.setUpdateInfoBar(false);
  27369. var _1763=_1761.getReportActionContext();
  27370. return _1763;
  27371. };
  27372. function CognosViewerSort(event,oCV){
  27373. this.m_oCV=oCV;
  27374. if(event){
  27375. this.m_oEvent=event;
  27376. this.m_oNode=getCrossBrowserNode(event,true);
  27377. }
  27378. };
  27379. CognosViewerSort.prototype.setNode=function(node){
  27380. this.m_oNode=node;
  27381. };
  27382. CognosViewerSort.prototype.getNode=function(){
  27383. return this.m_oNode;
  27384. };
  27385. CognosViewerSort.prototype.isSort=function(){
  27386. if(this.m_oNode&&this.m_oNode.nodeName=="IMG"&&(this.m_oNode.id).indexOf("sortimg")>=0){
  27387. return true;
  27388. }else{
  27389. return false;
  27390. }
  27391. };
  27392. CognosViewerSort.prototype.execute=function(){
  27393. var _1767=getCognosViewerSCObjectRef(this.m_oCV.getId());
  27394. _1767.selectSingleDomNode(this.m_oNode.parentNode);
  27395. var _1768=this.getSortAction();
  27396. _1768.setCognosViewer(this.m_oCV);
  27397. _1768.execute();
  27398. if(window.gViewerLogger){
  27399. window.gViewerLogger.addContextInfo(_1767);
  27400. }
  27401. };
  27402. CognosViewerSort.prototype.getSortAction=function(){
  27403. var _1769=this.m_oCV.getAction("Sort");
  27404. var _176a=this.m_oNode.getAttribute("sortOrder");
  27405. if(_176a.indexOf("nosort")!=-1){
  27406. _1769.setRequestParms({order:"ascending",type:"value"});
  27407. }else{
  27408. if(_176a.indexOf("ascending")!=-1){
  27409. _1769.setRequestParms({order:"descending",type:"value"});
  27410. }else{
  27411. if(_176a.indexOf("descending")!=-1){
  27412. _1769.setRequestParms({order:"none",type:"value"});
  27413. }
  27414. }
  27415. }
  27416. return _1769;
  27417. };
  27418. function SortAction(){
  27419. this.m_sAction="Sort";
  27420. this.m_sortOrder="none";
  27421. this.m_sortType="";
  27422. this.m_sItem="";
  27423. this.m_sId="";
  27424. };
  27425. SortAction.prototype=new ModifyReportAction();
  27426. SortAction.prototype.doExecute=function(){
  27427. if(this.m_sortOrder==="none"){
  27428. if(this.getContainerId(this.m_oCV.getSelectionController())){
  27429. var _176b=this.getCurrentSortFromSelection();
  27430. if(this.m_sortType==="value"&&_176b.indexOf("sortByValue")===-1){
  27431. return false;
  27432. }else{
  27433. if(this.m_sortType==="label"&&_176b.indexOf("sortByLabel")===-1){
  27434. return false;
  27435. }
  27436. }
  27437. }
  27438. }
  27439. return true;
  27440. };
  27441. SortAction.prototype.execute=function(){
  27442. if(this.doExecute()){
  27443. ModifyReportAction.prototype.execute.call(this);
  27444. }
  27445. };
  27446. SortAction.prototype.getUndoHint=function(){
  27447. if(this.m_sortOrder=="none"){
  27448. return RV_RES.IDS_JS_DONT_SORT;
  27449. }else{
  27450. return RV_RES.IDS_JS_SORT;
  27451. }
  27452. };
  27453. SortAction.prototype.setRequestParms=function(_176c){
  27454. this.m_sortOrder=_176c.order;
  27455. this.m_sortType=_176c.type;
  27456. if(_176c.id!=null&&typeof _176c.id!="undefined"){
  27457. this.m_sId=_176c.id;
  27458. }
  27459. if(_176c.item!=null&&typeof _176c.item!="undefined"){
  27460. this.m_sItem=_176c.item;
  27461. }
  27462. };
  27463. SortAction.prototype.addActionContextAdditionalParms=function(){
  27464. var _176d=this.m_oCV.getSelectionController();
  27465. var parms="<order>"+this.m_sortOrder+"</order>";
  27466. if(this.m_sortType=="label"){
  27467. parms+="<byLabel/>";
  27468. }
  27469. if(this.getContainerId(_176d)==""&&this.m_sId!=null&&typeof this.m_sId!="undefined"&&this.m_sId!=""){
  27470. parms+=("<id>"+xml_encode(this.m_sId)+"</id>");
  27471. }
  27472. if(this.m_sItem!=null&&typeof this.m_sItem!="undefined"&&this.m_sItem!=""){
  27473. parms+=("<item>"+xml_encode(this.m_sItem)+"</item>");
  27474. }
  27475. parms+=this.addClientContextData(3);
  27476. parms+=this.getSelectedCellTags();
  27477. return parms;
  27478. };
  27479. SortAction.prototype.toggleMenu=function(_176f,_1770){
  27480. if(_1770){
  27481. _176f.iconClass="sort";
  27482. _176f.disabled=false;
  27483. }else{
  27484. _176f.iconClass="sortDisabled";
  27485. _176f.disabled=true;
  27486. }
  27487. return _176f;
  27488. };
  27489. SortAction.prototype.updateMenu=function(_1771){
  27490. _1771.visible=this.ifContainsInteractiveDataContainer();
  27491. if(!_1771.visible){
  27492. return _1771;
  27493. }
  27494. this.buildMenu(_1771);
  27495. if(_1771.disabled==true){
  27496. return this.toggleMenu(_1771,false);
  27497. }
  27498. return this.buildDynamicMenuItem(this.toggleMenu(_1771,true),"Sort");
  27499. };
  27500. SortAction.prototype.buildSelectedItemsString=function(_1772,_1773,_1774){
  27501. try{
  27502. var _1775=_1772[_1772.length-1];
  27503. if(_1773){
  27504. var _1776=_1775.getDisplayValues()[0];
  27505. if(typeof _1776=="undefined"){
  27506. _1776=_1775.getUseValues()[0][0];
  27507. }
  27508. return _1776;
  27509. }else{
  27510. return _1775.getDataItemDisplayValue(_1774);
  27511. }
  27512. }
  27513. catch(e){
  27514. if(console&&console.log){
  27515. console.log(e);
  27516. }
  27517. }
  27518. };
  27519. SortAction.prototype.buildMenu=function(_1777){
  27520. _1777.visible=this.ifContainsInteractiveDataContainer();
  27521. if(!_1777.visible){
  27522. return _1777;
  27523. }
  27524. if(!this.isSelectionSortable()){
  27525. return this.toggleMenu(_1777,false);
  27526. }
  27527. _1777=this.toggleMenu(_1777,true);
  27528. var _1778=[];
  27529. var _1779=this.m_oCV.getSelectionController();
  27530. var _177a=_1779.getAllSelectedObjects();
  27531. if(_177a.length==1&&_177a[0].isHomeCell()==false){
  27532. var _177b=_1779.getDataContainerType();
  27533. var _177c=this.getContainerId(_1779);
  27534. var _177d=this.getReportInfo(_177c);
  27535. if(_177b==""&&!this.isSelectionOnChart()&&_177a[0].getLayoutType()=="section"){
  27536. if(_177d!=null){
  27537. _177b=_177d.displayTypeId;
  27538. }
  27539. }
  27540. var _177e,_177f,_1780;
  27541. var _1781=this.getCurrentSortFromSelection();
  27542. var _1782=this.isSelectionOnChart();
  27543. var _1783=_1781.indexOf("sortByValue")!=-1;
  27544. var _1784=_1781.indexOf("sortByValueAscending")!=-1;
  27545. var _1785=_1781.indexOf("sortByValueDescending")!=-1;
  27546. var _1786=this.m_oCV.isIWidgetMobile();
  27547. if(_177b=="list"){
  27548. var _1787={name:"SortAscending",label:RV_RES.IDS_JS_SORT_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"value"}},items:null};
  27549. this.addMenuItemChecked(_1784,_1787,"sortAscending");
  27550. _1778.push(_1787);
  27551. var _1788={name:"SortDescending",label:RV_RES.IDS_JS_SORT_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"value"}},items:null};
  27552. this.addMenuItemChecked(_1785,_1788,"sortDescending");
  27553. _1778.push(_1788);
  27554. var _1789={name:"DontSort",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"value"}},items:null};
  27555. this.addMenuItemChecked(!_1783,_1789,"sortNone");
  27556. _1778.push(_1789);
  27557. }else{
  27558. if(_177b=="crosstab"||_1782){
  27559. if(_177a[0].getLayoutType()=="columnTitle"||_1782){
  27560. _177e=this.m_oCV.getRAPReportInfo();
  27561. if(this.canSortByValueOnCrosstab(_177a[0],_177e)){
  27562. _177f=RV_RES.IDS_JS_SORT_BY_VALUE;
  27563. if(_1782){
  27564. _1780=this.buildSelectedItemsString(_177a,true,_177d);
  27565. if(typeof _1780!=="undefined"){
  27566. _177f+=":"+_1780;
  27567. }
  27568. }
  27569. var _178a={name:"SortByValue",label:_177f,action:null,items:[{name:"Ascending",label:RV_RES.IDS_JS_SORT_BY_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"value"}},items:null},{name:"Descending",label:RV_RES.IDS_JS_SORT_BY_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"value"}},items:null},{name:"SortNone",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"value"}},items:null}]};
  27570. this.addMenuItemChecked(_1783,_178a);
  27571. this.addMenuItemChecked(_1784,_178a.items[0],"sortAscending");
  27572. this.addMenuItemChecked(_1785,_178a.items[1],"sortDescending");
  27573. this.addMenuItemChecked(!_1783,_178a.items[2],"sortNone");
  27574. if(_1786){
  27575. _178a.flatten=true;
  27576. }
  27577. _1778.push(_178a);
  27578. }
  27579. if(this.canSortByLabelOnCrosstab(_177a[0])){
  27580. _177f=RV_RES.IDS_JS_SORT_BY_LABEL;
  27581. if(_1782){
  27582. _1780=this.buildSelectedItemsString(_177a,false,_177d);
  27583. if(typeof _1780!=="undefined"){
  27584. _177f+=":"+_1780;
  27585. }
  27586. }
  27587. var _178b={name:"SortByLabel",label:_177f,action:null,items:[{name:"Ascending",label:RV_RES.IDS_JS_SORT_BY_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"label"}},items:null},{name:"Descending",label:RV_RES.IDS_JS_SORT_BY_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"label"}},items:null},{name:"SortNone",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"label"}},items:null}]};
  27588. var _178c=_1781.indexOf("sortByLabel")!=-1;
  27589. this.addMenuItemChecked(_178c,_178b);
  27590. this.addMenuItemChecked(_1781.indexOf("sortByLabelAscending")!=-1,_178b.items[0],"sortAscending");
  27591. this.addMenuItemChecked(_1781.indexOf("sortByLabelDescending")!=-1,_178b.items[1],"sortDescending");
  27592. this.addMenuItemChecked(!_178c,_178b.items[2],"sortNone");
  27593. if(_1786){
  27594. _178b.flatten=true;
  27595. }
  27596. _1778.push(_178b);
  27597. }
  27598. }
  27599. }
  27600. }
  27601. }
  27602. if(_1778.length==0){
  27603. this.toggleMenu(_1777,false);
  27604. }else{
  27605. if(_1786){
  27606. if(_177b=="crosstab"||_1782){
  27607. _1777.useChildrenItems=true;
  27608. }else{
  27609. _1777.flatten=true;
  27610. }
  27611. }
  27612. _1777.items=_1778;
  27613. this.toggleMenu(_1777,true);
  27614. }
  27615. return _1777;
  27616. };
  27617. SortAction.prototype.isSelectionSortable=function(){
  27618. var _178d=this.m_oCV.getSelectionController();
  27619. var _178e=_178d.getAllSelectedObjects();
  27620. if(_178e.length==1){
  27621. var _178f=_178e[0];
  27622. if(_178d.getDataContainerType()=="crosstab"&&_178f.getLayoutType()=="datavalue"){
  27623. return false;
  27624. }
  27625. if(_178d.hasSelectedChartNodes()){
  27626. var node=_178f.getArea();
  27627. if(node.nodeName=="AREA"||node.nodeName=="IMG"){
  27628. return _178e[0].getLayoutType()=="ordinalAxisLabel"||_178e[0].getLayoutType()=="legendLabel";
  27629. }
  27630. }else{
  27631. var data=_178f.getDataItems();
  27632. if(_178f.getCellRef().getAttribute("type")=="datavalue"&&!(data&&data.length)){
  27633. return false;
  27634. }
  27635. var oCell=_178f.getCellRef();
  27636. if(oCell.getAttribute("no_data_item_column")==="true"){
  27637. return false;
  27638. }
  27639. if(oCell.getAttribute("canSort")!="false"){
  27640. return true;
  27641. }
  27642. }
  27643. }
  27644. return false;
  27645. };
  27646. SortAction.prototype.getCurrentSortFromSelection=function(){
  27647. var _1793=this.getContainerId(this.m_oCV.getSelectionController());
  27648. var _1794=this.m_oCV.getRAPReportInfo();
  27649. var _1795="";
  27650. if(_1793!=""&&_1794){
  27651. var _1796=_1794.getContainer(_1793);
  27652. if(typeof _1796.sort!="undefined"){
  27653. var _1797=this.m_oCV.getSelectionController();
  27654. var _1798=_1797.getAllSelectedObjects();
  27655. if(_1798.length==1){
  27656. var _1799=_1798[0].getDataItems();
  27657. if(_1799.length<1){
  27658. return _1795;
  27659. }
  27660. var _179a=_1799[0][0];
  27661. for(var index=0;index<_1796.sort.length;++index){
  27662. var _179c=_1796.sort[index];
  27663. if(typeof _179c.labels=="string"&&_179c.labels==_179a){
  27664. _1795+=_179c.order=="descending"?"sortByLabelDescending":"sortByLabelAscending";
  27665. }
  27666. if(typeof _179c.valuesOf=="string"&&(_179c.valuesOf==_179a||this.isSortedValueOnRenamedColumn(_1798[0],_179c))){
  27667. _1795+=_179c.order=="descending"?"sortByValueDescending":"sortByValueAscending";
  27668. }else{
  27669. if(_179c.valuesOf instanceof Array){
  27670. var match=true;
  27671. for(var _179e=0;_179e<_179c.valuesOf.length;++_179e){
  27672. if(_179e<_1798[0].m_contextIds[0].length){
  27673. var ctx=_1798[0].m_contextIds[0][_179e];
  27674. var _17a0=_1797.getDisplayValue(ctx);
  27675. var _17a1=this.findItemLabel(_1796,_179c.valuesOf[_179e].item);
  27676. if(_17a1!=_17a0){
  27677. match=false;
  27678. break;
  27679. }
  27680. }
  27681. }
  27682. if(match){
  27683. _1795+=_179c.valuesOf[0].order=="descending"?"sortByValueDescending":"sortByValueAscending";
  27684. }
  27685. }
  27686. }
  27687. }
  27688. }
  27689. }
  27690. }
  27691. return _1795;
  27692. };
  27693. SortAction.prototype.isSortedValueOnRenamedColumn=function(_17a2,_17a3){
  27694. if(_17a3&&_17a2){
  27695. return (_17a3.valuesOf===_17a2.getColumnRP_Name()&&_17a2.getLayoutType()==="columnTitle");
  27696. }
  27697. };
  27698. SortAction.prototype.findItemLabel=function(_17a4,item){
  27699. var _17a6=_17a4.itemInfo;
  27700. if(_17a6){
  27701. for(var i=0;i<_17a6.length;i++){
  27702. if(_17a6[i].item===item){
  27703. if(_17a6[i].itemLabel){
  27704. return _17a6[i].itemLabel;
  27705. }
  27706. break;
  27707. }
  27708. }
  27709. }
  27710. return item;
  27711. };
  27712. SortAction.prototype.canSortByValueOnCrosstab=function(_17a8,_17a9){
  27713. var _17aa=this.m_oCV.getSelectionController();
  27714. var _17ab=this.getContainerId(this.m_oCV.getSelectionController());
  27715. if(_17aa.isRelational()==true){
  27716. return false;
  27717. }
  27718. if(_17aa.selectionsHaveCalculationMetadata()&&this.selectedObjectIsLeaf(_17ab,_17a8,_17a9)){
  27719. var aMuns=_17a8.getMuns()[0];
  27720. for(var index=0;index<aMuns.length;++index){
  27721. if(aMuns[index]!=null&&aMuns[index].indexOf("uuid:")>=0){
  27722. return false;
  27723. }
  27724. }
  27725. return true;
  27726. }
  27727. return false;
  27728. };
  27729. SortAction.prototype.selectedObjectIsLeaf=function(_17ae,_17af,_17b0){
  27730. if(_17b0){
  27731. var _17b1=_17af.getDataItems();
  27732. if(_17b1!=null&&typeof _17b1!="undefined"&&_17b1.length>0){
  27733. var _17b2=_17b0.getDrillability(_17ae,_17b1[0][0]);
  27734. if(_17b2){
  27735. return _17b2.leaf==true;
  27736. }
  27737. }
  27738. }
  27739. return false;
  27740. };
  27741. SortAction.prototype.canSortByLabelOnCrosstab=function(_17b3){
  27742. var _17b4=this.m_oCV.getSelectionController();
  27743. var _17b5=_17b4.getAllSelectedObjects();
  27744. if(_17b5.length==1){
  27745. var _17b3=_17b5[0];
  27746. if(this.isSelectSingleMember(_17b3)==false){
  27747. if(_17b4.selectionsNonMeasureWithMUN()||!_17b4.selectionsHaveCalculationMetadata()){
  27748. return true;
  27749. }
  27750. }
  27751. }
  27752. return false;
  27753. };
  27754. function RedrawAction(){
  27755. this.m_specUpdated=false;
  27756. };
  27757. RedrawAction.prototype=new ModifyReportAction();
  27758. RedrawAction.prototype.reuseQuery=function(){
  27759. return true;
  27760. };
  27761. RedrawAction.prototype.keepRAPCache=function(){
  27762. return false;
  27763. };
  27764. RedrawAction.prototype.setSpecUpdated=function(flag){
  27765. this.m_specUpdated=flag;
  27766. };
  27767. RedrawAction.prototype.getUndoHint=function(){
  27768. return RV_RES.IDS_JS_ADVANCED_EDITING;
  27769. };
  27770. RedrawAction.prototype.addActionContext=function(){
  27771. if(this.m_specUpdated){
  27772. return "<reportActions><GetInfo><specUpdatedInBUA/></GetInfo></reportActions>";
  27773. }
  27774. return "<reportActions><GetInfo/></reportActions>";
  27775. };
  27776. function EditContentAction(){
  27777. this._oMissingMemberRecoveryMode=null;
  27778. };
  27779. EditContentAction.prototype=new CognosViewerAction();
  27780. EditContentAction.superclass=CognosViewerAction.prototype;
  27781. EditContentAction.prototype.execute=function(){
  27782. if(typeof this.preferencesChanged!="undefined"&&this.preferencesChanged!==null&&this.preferencesChanged===true){
  27783. this.deleteCWAContainer();
  27784. return;
  27785. }
  27786. window.CVEditContentActionInstance=this;
  27787. var _17b7=window.viewerCWAContainer?true:false;
  27788. if(!window.viewerCWAContainer){
  27789. this.createCWAContainer();
  27790. }
  27791. this.addWindowEventListeners();
  27792. this.buildBUAObjects();
  27793. window.viewerCWAContainer.show();
  27794. if(_17b7){
  27795. window.BUAEvent("appReady");
  27796. }
  27797. };
  27798. EditContentAction.prototype.createCWAContainer=function(){
  27799. this.deleteCWAContainer();
  27800. var _17b8=this.createCWAIFrame();
  27801. var _17b9=this.createBlocker();
  27802. window.viewerCWAContainer={"type":"iframe","containerDiv":_17b8,"blocker":_17b9,"iframePadding":"18","show":function(){
  27803. this.resize();
  27804. this.containerDiv.style.display="block";
  27805. this.blocker.style.display="block";
  27806. },"hide":function(){
  27807. this.blocker.style.display="none";
  27808. this.containerDiv.style.display="none";
  27809. },"resize":function(){
  27810. var _17ba=dojo.window.getBox();
  27811. this.containerDiv.style.height=_17ba.h-this.iframePadding+"px";
  27812. this.containerDiv.style.width=_17ba.w-this.iframePadding+"px";
  27813. }};
  27814. };
  27815. EditContentAction.prototype.deleteCWAContainer=function(){
  27816. var _17bb=window.viewerCWAContainer;
  27817. if(_17bb){
  27818. _17bb.hide();
  27819. document.body.removeChild(_17bb.containerDiv);
  27820. document.body.removeChild(_17bb.blocker);
  27821. delete window.viewerCWAContainer;
  27822. window.viewerCWAContainer=null;
  27823. }
  27824. };
  27825. EditContentAction.prototype.hideCWAContainer=function(){
  27826. this.removeWindowEventListeners();
  27827. if(window.viewerCWAContainer){
  27828. window.viewerCWAContainer.hide();
  27829. }
  27830. window.CVEditContentActionInstance=null;
  27831. };
  27832. EditContentAction.prototype.createCWAIFrame=function(){
  27833. var _17bc=document.createElement("div");
  27834. _17bc.className="buaContainer";
  27835. document.body.appendChild(_17bc);
  27836. var _17bd=document.createElement("iframe");
  27837. _17bd.setAttribute("id","buaIframe");
  27838. _17bd.setAttribute("src",this.getWebContent()+"/pat/rsapp.htm");
  27839. _17bd.setAttribute("name","buaIframe");
  27840. _17bd.setAttribute("frameborder","0");
  27841. _17bd.className="buaIframe";
  27842. _17bc.appendChild(_17bd);
  27843. return _17bc;
  27844. };
  27845. EditContentAction.prototype.createBlocker=function(){
  27846. var _17be=document.createElement("div");
  27847. _17be.setAttribute("id","reportBlocker");
  27848. _17be.setAttribute("name","reportBlocker");
  27849. _17be.setAttribute("tabIndex","1");
  27850. _17be.className="reportBlocker";
  27851. document.body.appendChild(_17be);
  27852. return _17be;
  27853. };
  27854. EditContentAction.prototype.buildBUAObjects=function(){
  27855. window.RSParameters={"rs_UIProfile":"BUA","ui.action":"edit","gateway":location.protocol+"//"+location.host+this.getGateway(),"theme":"corporate","capabilitiesXML":this.getCapabilitiesXml(),"cafcontextid":this.getCafContextId(),"paneOnRight":this.getViewerIWidget().getPaneOnRight()};
  27856. var _17bf=this.getViewerIWidget();
  27857. if(_17bf!==null){
  27858. var _17c0=_17bf.getAttributeValue("gateway");
  27859. if(_17c0){
  27860. window.RSParameters["cv.gateway"]=_17c0;
  27861. }
  27862. var _17c1=_17bf.getAttributeValue("webcontent");
  27863. if(_17c1){
  27864. window.RSParameters["cv.webcontent"]=_17c1;
  27865. }
  27866. }
  27867. this.addExtraLaunchParameters(window.RSParameters);
  27868. };
  27869. EditContentAction.prototype.getBUAIframe=function(){
  27870. return document.getElementById("buaIframe");
  27871. };
  27872. EditContentAction.prototype.getBUAWindow=function(){
  27873. var _17c2=null;
  27874. var _17c3=this.getBUAIframe();
  27875. if(_17c3!==null){
  27876. _17c2=_17c3.contentWindow;
  27877. }
  27878. return _17c2;
  27879. };
  27880. EditContentAction.prototype.setReportSettings=function(){
  27881. var oCV=this.getCognosViewer();
  27882. var _17c5=oCV.getViewerWidget();
  27883. _17c5.fireEvent("com.ibm.bux.widget.getDisplayTitle",null,{callback:function(_17c6){
  27884. window.CVEditContentActionInstance.openReportWithBUA(_17c6);
  27885. }});
  27886. };
  27887. EditContentAction.prototype.openReportWithBUA=function(_17c7){
  27888. var _17c8=this.m_oCV.envParams["ui.spec"].indexOf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
  27889. if(_17c8==-1){
  27890. _17c8=0;
  27891. }else{
  27892. _17c8="<?xml version=\"1.0\" encoding=\"UTF-8\"?>".length;
  27893. }
  27894. var _17c9=this.m_oCV.envParams["ui.spec"].substr(_17c8,this.m_oCV.envParams["ui.spec"].length);
  27895. var _17ca={"displayName":xml_decode(_17c7),"parameterValues":this.m_oCV.getExecutionParameters(),"reportXML":_17c9,"showOpenTransition":false};
  27896. if(this.ifPassTrackingtoBUA()){
  27897. _17ca.tracking=this.m_oCV.getTracking();
  27898. }
  27899. var _17cb=this.getBUAWindow();
  27900. _17cb.Application.SetBUAContext(_17ca);
  27901. };
  27902. EditContentAction.prototype.getViewerIWidget=function(){
  27903. return this.m_oCV.getViewerWidget();
  27904. };
  27905. EditContentAction.prototype.getGateway=function(){
  27906. return this.m_oCV.getGateway();
  27907. };
  27908. EditContentAction.prototype.getCapabilitiesXml=function(){
  27909. return this.m_oCV.capabilitiesXML;
  27910. };
  27911. EditContentAction.prototype.getCafContextId=function(){
  27912. return typeof this.m_oCV.cafContextId!="undefined"?this.m_oCV.cafContextId:"";
  27913. };
  27914. EditContentAction.prototype.getWebContent=function(){
  27915. return this.getCognosViewer().getWebContentRoot();
  27916. };
  27917. EditContentAction.prototype.addExtraLaunchParameters=function(_17cc){
  27918. };
  27919. EditContentAction.prototype.runUpdatedReportFromBUA=function(){
  27920. var _17cd=this.getBUAWindow();
  27921. var _17ce=this.m_oCV.envParams["ui.spec"];
  27922. var _17cf=_17cd.Application.GetBUAContext();
  27923. if(_17cf.isSpecModified){
  27924. this.m_oCV.envParams["ui.spec"]=_17cf.reportXML;
  27925. this.m_oCV.setTracking(_17cf.tracking);
  27926. this.m_oCV.setExecutionParameters(_17cf.parameterValues);
  27927. this._invokeRedrawAction(_17ce);
  27928. }
  27929. };
  27930. EditContentAction.prototype._invokeRedrawAction=function(_17d0){
  27931. this.getUndoRedoQueue().setOriginalSpec(_17d0);
  27932. var _17d1=this.m_oCV.getAction("Redraw");
  27933. _17d1.setSpecUpdated(true);
  27934. this.m_oCV.getViewerWidget().setPromptParametersRetrieved(false);
  27935. _17d1.execute();
  27936. };
  27937. EditContentAction.prototype.ifPassTrackingtoBUA=function(){
  27938. if(this.m_oCV.getRAPReportInfo()){
  27939. return this.m_oCV.getRAPReportInfo().getPassTrackingtoBUA();
  27940. }
  27941. return true;
  27942. };
  27943. EditContentAction.prototype.setRequestParms=function(_17d2){
  27944. EditContentAction.superclass.setRequestParms(_17d2);
  27945. if(_17d2){
  27946. if(_17d2.preferencesChanged){
  27947. this.preferencesChanged=_17d2.preferencesChanged;
  27948. }
  27949. if(_17d2.MissingMemberRecoveryMode){
  27950. this._oMissingMemberRecoveryMode=_17d2.MissingMemberRecoveryMode;
  27951. }
  27952. }
  27953. };
  27954. EditContentAction.prototype.runUpdatedReportFromBUA_MissingMemberRecoveryMode=function(){
  27955. var _17d3=this.getBUAWindow();
  27956. var _17d4=this.m_oCV.envParams["ui.spec"];
  27957. var _17d5=_17d3.Application.GetBUAContext();
  27958. this.m_oCV.setTracking(_17d5.tracking);
  27959. this.m_oCV.envParams["ui.spec"]=_17d5.reportXML;
  27960. this.m_oCV.setExecutionParameters(_17d5.parameterValues);
  27961. if(this._oMissingMemberRecoveryMode&&this._oMissingMemberRecoveryMode.oFaultDialog){
  27962. this._oMissingMemberRecoveryMode.oFaultDialog.hide();
  27963. }
  27964. this._invokeRedrawAction(_17d4);
  27965. };
  27966. EditContentAction.prototype.cancelPressed=function(){
  27967. };
  27968. EditContentAction.prototype.addWindowEventListeners=function(){
  27969. if(window.attachEvent){
  27970. window.attachEvent("onresize",window.CVEditContentActionInstance.onWindowResize);
  27971. }else{
  27972. window.addEventListener("resize",window.CVEditContentActionInstance.onWindowResize,false);
  27973. }
  27974. };
  27975. EditContentAction.prototype.removeWindowEventListeners=function(){
  27976. if(window.detachEvent){
  27977. window.detachEvent("onresize",window.CVEditContentActionInstance.onWindowResize);
  27978. }else{
  27979. window.removeEventListener("resize",window.CVEditContentActionInstance.onWindowResize,false);
  27980. }
  27981. };
  27982. EditContentAction.prototype.onWindowResize=function(){
  27983. var _17d6=window.viewerCWAContainer;
  27984. if(_17d6){
  27985. _17d6.resize();
  27986. }
  27987. };
  27988. function BUAEvent(_17d7){
  27989. var _17d8=window.CVEditContentActionInstance;
  27990. switch(_17d7){
  27991. case "appReady":
  27992. _17d8.setReportSettings();
  27993. break;
  27994. case "donePressed":
  27995. _17d8.hideCWAContainer();
  27996. if(_17d8._oMissingMemberRecoveryMode){
  27997. _17d8.runUpdatedReportFromBUA_MissingMemberRecoveryMode();
  27998. }else{
  27999. _17d8.runUpdatedReportFromBUA();
  28000. }
  28001. break;
  28002. case "cancelPressed":
  28003. _17d8.cancelPressed();
  28004. _17d8.hideCWAContainer();
  28005. break;
  28006. }
  28007. };
  28008. function NewReportAction(){
  28009. this._viewerIWidget=null;
  28010. this._packageSearchPath=null;
  28011. this._webContentRoot=null;
  28012. this._gateway=null;
  28013. this._capabilitiesXml=null;
  28014. this._cafContextId=null;
  28015. };
  28016. NewReportAction.prototype=new EditContentAction();
  28017. NewReportAction.prototype.parent=EditContentAction.prototype;
  28018. NewReportAction.prototype.clearSelections=function(){
  28019. };
  28020. NewReportAction.prototype.getCognosViewer=function(){
  28021. return this.getViewerIWidget().getViewerObject();
  28022. };
  28023. NewReportAction.prototype.setRequestParms=function(_17d9){
  28024. this.parent.setRequestParms.call(this,_17d9);
  28025. this._packageSearchPath=_17d9.packageSearchPath;
  28026. this._viewerIWidget=_17d9.viewerIWidget;
  28027. this._webContentRoot=_17d9.webContentRoot;
  28028. this._gateway=_17d9.gateway;
  28029. this._capabilitiesXml=_17d9.capabilitiesXml;
  28030. this._cafContextId=_17d9.cafContextId;
  28031. };
  28032. NewReportAction.prototype.getViewerIWidget=function(){
  28033. return this._viewerIWidget;
  28034. };
  28035. NewReportAction.prototype.getGateway=function(){
  28036. return this._gateway;
  28037. };
  28038. NewReportAction.prototype.getCapabilitiesXml=function(){
  28039. return this._capabilitiesXml;
  28040. };
  28041. NewReportAction.prototype.getCafContextId=function(){
  28042. return this._cafContextId?this._cafContextId:"";
  28043. };
  28044. NewReportAction.prototype.getWebContent=function(){
  28045. return this._webContentRoot;
  28046. };
  28047. NewReportAction.prototype.setReportSettings=function(){
  28048. var _17da={"showOpenTransition":false,"model":this._packageSearchPath};
  28049. var _17db=this.getBUAWindow();
  28050. _17db.Application.SetBUAContext(_17da);
  28051. };
  28052. NewReportAction.prototype.addExtraLaunchParameters=function(_17dc){
  28053. _17dc.model=this._packageSearchPath;
  28054. };
  28055. NewReportAction.prototype.cancelPressed=function(){
  28056. this.getViewerIWidget().iContext.iEvents.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
  28057. };
  28058. NewReportAction.prototype.runUpdatedReportFromBUA=function(){
  28059. var _17dd=this.getViewerIWidget();
  28060. _17dd.setAttributeValue("reportCreatedInCW","true");
  28061. var _17de=this.getBUAWindow().Application.GetBUAContext();
  28062. _17dd.setNewReportInfo({"ui.spec":_17de.reportXML,"m_tracking":_17de.tracking?_17de.tracking:"","parameterValues":_17de.parameterValues?_17de.parameterValues:""});
  28063. _17dd.onLoad();
  28064. };
  28065. function AuthoredDrillAction(){
  28066. this.m_drillTargetSpecification="";
  28067. };
  28068. AuthoredDrillAction.prototype=new CognosViewerAction();
  28069. AuthoredDrillAction.prototype.setRequestParms=function(_17df){
  28070. this.m_drillTargetSpecification=_17df;
  28071. };
  28072. AuthoredDrillAction.prototype.executeDrillTarget=function(_17e0){
  28073. var _17e1=XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(_17e0));
  28074. var _17e2=encodeURIComponent(_17e1.getAttribute("bookmarkRef"));
  28075. var _17e3=_17e1.getAttribute("path");
  28076. var _17e4=this._shouldShowInNewWindow(_17e1);
  28077. var oCV=this.getCognosViewer();
  28078. if((_17e2!==null&&_17e2!=="")&&(_17e3===null||_17e3==="")){
  28079. var _17e6=_17e1.getAttribute("bookmarkPage");
  28080. if(_17e6&&_17e6!==""){
  28081. oCV.executeAction("GotoPage",{"pageNumber":_17e6,"anchorName":_17e2});
  28082. }else{
  28083. document.location="#"+_17e2;
  28084. }
  28085. }else{
  28086. var _17e7="";
  28087. if(_17e4){
  28088. _17e7="_blank";
  28089. }
  28090. var _17e8=[];
  28091. var _17e9=[];
  28092. _17e9.push("obj");
  28093. _17e9.push(_17e3);
  28094. _17e8[_17e8.length]=_17e9;
  28095. var _17ea=false;
  28096. var _17eb,_17ec,_17ed,sName,sNil;
  28097. var _17f0=XMLHelper_FindChildrenByTagName(_17e1,"drillParameter",false);
  28098. for(var index=0;index<_17f0.length;++index){
  28099. _17eb=[];
  28100. _17ec=_17f0[index];
  28101. _17ed=_17ec.getAttribute("value");
  28102. sName=_17ec.getAttribute("name");
  28103. if(_17ed!==null&&_17ed!==""){
  28104. _17eb.push("p_"+sName);
  28105. _17eb.push(this.buildSelectionChoicesSpecification(_17ec));
  28106. }
  28107. sNil=_17ec.getAttribute("nil");
  28108. if(sNil!==null&&sNil!==""){
  28109. _17eb.push("p_"+sName);
  28110. _17eb.push(this.buildSelectionChoicesNilSpecification());
  28111. }
  28112. if(_17eb.length>0){
  28113. _17e8[_17e8.length]=_17eb;
  28114. }
  28115. if(!_17ea){
  28116. var _17f2=_17ec.getAttribute("propertyToPass");
  28117. _17ea=(_17f2&&_17f2.length>0)?true:false;
  28118. }
  28119. }
  28120. var _17f3=_17e1.getAttribute("method");
  28121. var _17f4=_17e1.getAttribute("outputFormat");
  28122. var _17f5=_17e1.getAttribute("outputLocale");
  28123. var _17f6=_17e1.getAttribute("prompt");
  28124. var _17f7=_17e1.getAttribute("dynamicDrill");
  28125. var _17f8=this.getXMLNodeAsString(_17e1,"parameters");
  28126. var _17f9=this.getXMLNodeAsString(_17e1,"objectPaths");
  28127. var oCVId=oCV.getId();
  28128. var _17fb=document.forms["formWarpRequest"+oCVId];
  28129. var _17fc=oCV.getAdvancedServerProperty("VIEWER_JS_CALL_FORWARD_DRILLTHROUGH_TO_SELF");
  28130. if((!_17fc||_17fc.toLowerCase()!=="false")&&_17f6!="true"&&this.isSameReport(_17fb,_17e3)&&this.isSameReportFormat(_17f4)&&!_17e4&&!_17ea){
  28131. var _17fd=new ViewerDispatcherEntry(oCV);
  28132. _17fd.addFormField("ui.action","forward");
  28133. if(oCV!==null&&typeof oCV.rvMainWnd!="undefined"){
  28134. oCV.rvMainWnd.addCurrentReportToReportHistory();
  28135. var _17fe=oCV.rvMainWnd.saveReportHistoryAsXML();
  28136. _17fd.addFormField("cv.previousReports",_17fe);
  28137. }
  28138. for(index=0;index<_17f0.length;++index){
  28139. _17eb=[];
  28140. _17ec=_17f0[index];
  28141. _17ed=_17ec.getAttribute("value");
  28142. sName=_17ec.getAttribute("name");
  28143. sNil=_17ec.getAttribute("nil");
  28144. if((sNil===null||sNil==="")&&(_17ed===null||_17ed==="")){
  28145. _17eb.push("p_"+sName);
  28146. _17eb.push(this.buildSelectionChoicesNilSpecification());
  28147. }
  28148. if(_17eb.length>0){
  28149. _17e8[_17e8.length]=_17eb;
  28150. }
  28151. }
  28152. for(index=1;index<_17e8.length;index++){
  28153. _17fd.addFormField(_17e8[index][0],_17e8[index][1]);
  28154. }
  28155. _17fd.addFormField("_drillThroughToSelf","true");
  28156. if(oCV.m_tabsPayload&&oCV.m_tabsPayload.tabs){
  28157. _17fd.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",oCV.m_tabsPayload.tabs[0].id);
  28158. }
  28159. oCV.setUsePageRequest(true);
  28160. oCV.dispatchRequest(_17fd);
  28161. if(typeof oCV.m_viewerFragment=="undefined"){
  28162. var _17ff=getCognosViewerObjectRefAsString(oCVId);
  28163. setTimeout(_17ff+".getRequestIndicator().show()",10);
  28164. }
  28165. }else{
  28166. doSingleDrill(_17e7,_17e8,_17f3,_17f4,_17f5,_17e2,_17f8,_17f9,this.getCognosViewer().getId(),_17f6,_17f7);
  28167. }
  28168. }
  28169. };
  28170. AuthoredDrillAction.prototype._shouldShowInNewWindow=function(_1800){
  28171. return _1800.getAttribute("showInNewWindow")=="true";
  28172. };
  28173. AuthoredDrillAction.prototype.isSameReport=function(_1801,_1802){
  28174. if(_1801["ui.object"]&&_1802==_1801["ui.object"].value){
  28175. return true;
  28176. }
  28177. return false;
  28178. };
  28179. AuthoredDrillAction.prototype.isSameReportFormat=function(_1803){
  28180. var _1804=this.getCognosViewer().envParams["run.outputFormat"];
  28181. if(_1804){
  28182. if(_1803==_1804){
  28183. return true;
  28184. }else{
  28185. if(_1804=="HTML"&&_1803=="HTMLFragment"){
  28186. return true;
  28187. }
  28188. }
  28189. }
  28190. return false;
  28191. };
  28192. AuthoredDrillAction.prototype.getXMLNodeAsString=function(_1805,_1806){
  28193. var sXML="";
  28194. if(_1805!=null){
  28195. var node=XMLHelper_FindChildByTagName(_1805,_1806,false);
  28196. if(node!=null){
  28197. sXML=XMLBuilderSerializeNode(node);
  28198. }
  28199. }
  28200. return sXML;
  28201. };
  28202. AuthoredDrillAction.prototype.execute=function(_1809){
  28203. if(this.m_drillTargetSpecification!=""){
  28204. this.executeDrillTarget(this.m_drillTargetSpecification);
  28205. }else{
  28206. if(typeof _1809!="undefined"){
  28207. var _180a=this.getCognosViewer().getDrillTargets();
  28208. var _180b=this.getAuthoredDrillThroughContext(_1809,_180a);
  28209. var _180c=_180b.childNodes;
  28210. if(_180c.length==1){
  28211. this.executeDrillTarget(XMLBuilderSerializeNode(_180c[0]));
  28212. }else{
  28213. doMultipleDrills(XMLBuilderSerializeNode(_180b),this.getCognosViewer().getId());
  28214. }
  28215. }
  28216. }
  28217. };
  28218. AuthoredDrillAction.prototype.showDrillTargets=function(_180d){
  28219. var _180e="<context>";
  28220. for(var index=0;index<_180d.length;++index){
  28221. var _1810=_180d[index];
  28222. _180e+="<member>";
  28223. var sName=_1810.getAttribute("label");
  28224. _180e+="<name>";
  28225. _180e+=sXmlEncode(sName);
  28226. _180e+="</name>";
  28227. var _1812=_1810.getAttribute("path");
  28228. _180e+="<drillThroughSearchPath>";
  28229. _180e+=sXmlEncode(_1812);
  28230. _180e+="</drillThroughSearchPath>";
  28231. var _1813=_1810.getAttribute("method");
  28232. _180e+="<drillThroughAction>";
  28233. _180e+=sXmlEncode(_1813);
  28234. _180e+="</drillThroughAction>";
  28235. var _1814=_1810.getAttribute("outputFormat");
  28236. _180e+="<drillThroughFormat>";
  28237. _180e+=sXmlEncode(_1814);
  28238. _180e+="</drillThroughFormat>";
  28239. var sData="parent."+this.getTargetReportRequestString(_1810);
  28240. _180e+="<data>";
  28241. _180e+=sXmlEncode(sData);
  28242. _180e+="</data>";
  28243. _180e+="</member>";
  28244. }
  28245. _180e+="</context>";
  28246. };
  28247. AuthoredDrillAction.prototype.populateContextMenu=function(_1816){
  28248. var _1817=this.getCognosViewer();
  28249. var _1818=_1817.rvMainWnd.getToolbarControl();
  28250. var _1819=null;
  28251. if(typeof _1818!="undefined"&&_1818!=null){
  28252. var _181a=_1818.getItem("goto");
  28253. if(_181a){
  28254. _1819=_181a.getMenu();
  28255. }
  28256. }
  28257. var _181b=_1817.rvMainWnd.getContextMenu();
  28258. var _181c=null;
  28259. if(typeof _181b!="undefined"&&_181b!=null){
  28260. _181c=_181b.getGoToMenuItem().getMenu();
  28261. }
  28262. if(_1819!=null||_181c!=null){
  28263. var _181d=this.getCognosViewer().getDrillTargets();
  28264. var _181e=this.getAuthoredDrillThroughContext(_1816,_181d);
  28265. var _181f=_181e.childNodes;
  28266. if(_181f.length>0){
  28267. for(var index=0;index<_181f.length;++index){
  28268. var _1821=_181f[index];
  28269. var _1822=getCognosViewerObjectRefAsString(this.getCognosViewer().getId())+".m_oDrillMgr.executeAuthoredDrill(\""+encodeURIComponent(XMLBuilderSerializeNode(_1821))+"\");";
  28270. var _1823=this.getTargetReportIconPath(_1821);
  28271. var _1824=_1821.getAttribute("label");
  28272. if(isViewerBidiEnabled()){
  28273. var bidi=BidiUtils.getInstance();
  28274. _1824=bidi.btdInjectUCCIntoStr(_1824,getViewerBaseTextDirection());
  28275. }
  28276. if(_1819!=null){
  28277. new CMenuItem(_1819,_1824,_1822,_1823,gMenuItemStyle,_1817.getWebContentRoot(),_1817.getSkin());
  28278. }
  28279. if(_181c!=null){
  28280. new CMenuItem(_181c,_1824,_1822,_1823,gMenuItemStyle,_1817.getWebContentRoot(),_1817.getSkin());
  28281. }
  28282. }
  28283. }
  28284. }
  28285. };
  28286. AuthoredDrillAction.prototype.buildSelectionChoicesNilSpecification=function(){
  28287. return "<selectChoices/>";
  28288. };
  28289. AuthoredDrillAction.prototype.buildSelectionChoicesSpecification=function(_1826){
  28290. var _1827="";
  28291. var _1828=_1826.getAttribute("value");
  28292. if(_1828!=null){
  28293. var _1829=_1826.getAttribute("propertyToPass");
  28294. _1827+="<selectChoices";
  28295. if(_1829!=null&&_1829!=""){
  28296. _1827+=" propertyToPass=\"";
  28297. _1827+=sXmlEncode(_1829);
  28298. _1827+="\"";
  28299. }
  28300. _1827+=">";
  28301. if(_1828.indexOf("<selectChoices>")!=-1){
  28302. _1827+=_1828.substring(_1828.indexOf("<selectChoices>")+15);
  28303. }else{
  28304. if(_1828!=""){
  28305. _1827+="<selectOption ";
  28306. var sMun=_1826.getAttribute("mun");
  28307. if(sMun!=null&&sMun!=""){
  28308. var _182b=sXmlEncode(sMun);
  28309. _1827+="useValue=\"";
  28310. _1827+=_182b;
  28311. _1827+="\" ";
  28312. _1827+="mun=\"";
  28313. _1827+=_182b;
  28314. _1827+="\" ";
  28315. _1827+="displayValue=\"";
  28316. _1827+=sXmlEncode(_1828);
  28317. _1827+="\"";
  28318. }else{
  28319. _1827+="useValue=\"";
  28320. _1827+=sXmlEncode(_1828);
  28321. _1827+="\" ";
  28322. var _182c=_1826.getAttribute("displayValue");
  28323. if(_182c==null||_182c==""){
  28324. _182c=_1828;
  28325. }
  28326. _1827+="displayValue=\"";
  28327. _1827+=sXmlEncode(_182c);
  28328. _1827+="\"";
  28329. }
  28330. _1827+="/>";
  28331. _1827+="</selectChoices>";
  28332. }
  28333. }
  28334. }
  28335. return _1827;
  28336. };
  28337. AuthoredDrillAction.prototype.getPropertyToPass=function(_182d,_182e){
  28338. if(_182d!=null&&_182d!=""&&_182e!=null){
  28339. var _182f=_182e.childNodes;
  28340. if(_182f!=null){
  28341. for(var index=0;index<_182f.length;++index){
  28342. var _1831=_182f[index];
  28343. var sName="";
  28344. if(_1831.getAttribute("name")!=null){
  28345. sName=_1831.getAttribute("name");
  28346. }
  28347. if(sName==_182d){
  28348. return _1831.getAttribute("propertyToPass");
  28349. }
  28350. }
  28351. }
  28352. }
  28353. return "";
  28354. };
  28355. AuthoredDrillAction.prototype.getTargetReportRequestString=function(_1833){
  28356. var _1834="";
  28357. var _1835=_1833.getAttribute("bookmarkRef");
  28358. var _1836=_1833.getAttribute("path");
  28359. var _1837=_1833.getAttribute("showInNewWindow");
  28360. if((_1835!=null&&_1835!="")&&(_1836==null||_1836=="")){
  28361. _1834+="document.location=\"#";
  28362. _1834+=_1835;
  28363. _1834+="\";";
  28364. }else{
  28365. _1834+="doSingleDrill(";
  28366. if(_1837=="true"){
  28367. _1834+="\"_blank\",";
  28368. }else{
  28369. _1834+="\"\",";
  28370. }
  28371. _1834+="[[\"obj\",\"";
  28372. _1834+=encodeURIComponent(_1836);
  28373. _1834+="\"]";
  28374. var _1838=XMLHelper_FindChildrenByTagName(_1833,"drillParameter",false);
  28375. for(var index=0;index<_1838.length;++index){
  28376. var _183a=_1838[index];
  28377. var _183b=_183a.getAttribute("value");
  28378. var sName=_183a.getAttribute("name");
  28379. if(_183b!=null&&_183b!=""){
  28380. _1834+=", [\"p_"+sName+"\",\""+encodeURIComponent(this.buildSelectionChoicesSpecification(_183a))+"\"]";
  28381. }
  28382. var sNil=_183a.getAttribute("nil");
  28383. if(sNil!=null&&sNil!=""){
  28384. _1834+="\", [\"p_"+sName+"\",\""+encodeURIComponent(this.buildSelectionChoicesNilSpecification())+"\"]";
  28385. }
  28386. }
  28387. _1834+="],";
  28388. var _183e=_1833.getAttribute("method");
  28389. _1834+="\""+encodeURIComponent(_183e)+"\",";
  28390. var _183f=_1833.getAttribute("outputFormat");
  28391. _1834+="\""+encodeURIComponent(_183f)+"\",";
  28392. var _1840=_1833.getAttribute("outputLocale");
  28393. _1834+="\""+encodeURIComponent(_1840)+"\",";
  28394. _1834+="\""+encodeURIComponent(_1835)+"\",";
  28395. var _1841=XMLBuilderSerializeNode(XMLHelper_FindChildByTagName(_1833,"parameters",false));
  28396. _1834+="\""+encodeURIComponent(_1841)+"\",";
  28397. var _1842=XMLBuilderSerializeNode(XMLHelper_FindChildByTagName(_1833,"objectPaths",false));
  28398. _1834+="\""+encodeURIComponent(_1842)+"\",";
  28399. _1834+="\""+encodeURIComponent(this.getCognosViewer().getId())+"\",";
  28400. var _1843=_1833.getAttribute("prompt");
  28401. _1834+="\""+encodeURIComponent(_1843)+"\",";
  28402. var _1844=_1833.getAttribute("dynamicDrill");
  28403. _1834+=" "+encodeURIComponent(_1844);
  28404. _1834+=");";
  28405. }
  28406. return _1834;
  28407. };
  28408. AuthoredDrillAction.prototype.getTargetReportIconPath=function(_1845){
  28409. var _1846="";
  28410. var _1847=_1845.getAttribute("bookmarkRef");
  28411. var _1848=XMLHelper_FindChildByTagName(_1845,"drillParameter",false);
  28412. if((_1847!=null&&_1847!="")&&_1848==null){
  28413. _1846="/common/images/spacer.gif";
  28414. }else{
  28415. var _1849=_1845.getAttribute("method");
  28416. switch(_1849){
  28417. case "editAnalysis":
  28418. _1846="/ps/portal/images/icon_ps_analysis.gif";
  28419. break;
  28420. case "editQuery":
  28421. _1846="/ps/portal/images/icon_qs_query.gif";
  28422. break;
  28423. case "execute":
  28424. _1846="/ps/portal/images/action_run.gif";
  28425. break;
  28426. case "view":
  28427. var _184a=_1845.getAttribute("outputFormat");
  28428. switch(_184a){
  28429. case "HTML":
  28430. case "XHTML":
  28431. case "HTMLFragment":
  28432. _1846="/ps/portal/images/icon_result_html.gif";
  28433. break;
  28434. case "PDF":
  28435. _1846="/ps/portal/images/icon_result_pdf.gif";
  28436. break;
  28437. case "XML":
  28438. _1846="/ps/portal/images/icon_result_xml.gif";
  28439. break;
  28440. case "CSV":
  28441. _1846="/ps/portal/images/icon_result_csv.gif";
  28442. break;
  28443. case "XLS":
  28444. _1846="/ps/portal/images/icon_result_excel.gif";
  28445. break;
  28446. case "SingleXLS":
  28447. _1846="/ps/portal/images/icon_result_excel_single.gif";
  28448. break;
  28449. case "XLWA":
  28450. _1846="/ps/portal/images/icon_result_excel_web_arch.gif";
  28451. break;
  28452. default:
  28453. _1846="/common/images/spacer.gif";
  28454. }
  28455. break;
  28456. default:
  28457. _1846="/common/images/spacer.gif";
  28458. }
  28459. }
  28460. return this.getCognosViewer().getWebContentRoot()+_1846;
  28461. };
  28462. AuthoredDrillAction.prototype.getAuthoredDrillThroughContext=function(_184b,_184c){
  28463. if(typeof _184b!="string"||typeof _184c!="object"){
  28464. return null;
  28465. }
  28466. var _184d=XMLBuilderLoadXMLFromString(_184b);
  28467. if(_184d==null||_184d.firstChild==null){
  28468. return null;
  28469. }
  28470. var _184e=XMLHelper_GetFirstChildElement(_184d);
  28471. if(XMLHelper_GetLocalName(_184e)!="AuthoredDrillTargets"){
  28472. return null;
  28473. }
  28474. var _184f=XMLHelper_GetFirstChildElement(_184e);
  28475. if(XMLHelper_GetLocalName(_184f)!="rvDrillTargets"){
  28476. return null;
  28477. }
  28478. var _1850=_184f.childNodes;
  28479. if(_1850===null||_1850.length===0){
  28480. return null;
  28481. }
  28482. var _1851=self.XMLBuilderCreateXMLDocument("rvDrillTargets");
  28483. for(var _1852=0;_1852<_1850.length;++_1852){
  28484. if(typeof _1850[_1852].getAttribute=="undefined"){
  28485. continue;
  28486. }
  28487. var _1853=_1851.createElement("drillTarget");
  28488. _1851.documentElement.appendChild(_1853);
  28489. var _1854=_1850[_1852].getAttribute("bookmarkRef");
  28490. if(_1854===null){
  28491. _1853.setAttribute("bookmarkRef","");
  28492. }else{
  28493. _1853.setAttribute("bookmarkRef",_1854);
  28494. }
  28495. var _1855=_1850[_1852].getAttribute("bookmarkPage");
  28496. if(_1855===null){
  28497. _1853.setAttribute("bookmarkPage","");
  28498. }else{
  28499. _1853.setAttribute("bookmarkPage",_1855);
  28500. }
  28501. var _1856=_1850[_1852].getAttribute("drillIdx");
  28502. if(_1856==null){
  28503. continue;
  28504. }
  28505. if(_1856>=_184c.length){
  28506. continue;
  28507. }
  28508. var _1857=_184c[_1856];
  28509. if(typeof _1857!="object"){
  28510. continue;
  28511. }
  28512. _1853.setAttribute("outputFormat",_1857.getOutputFormat());
  28513. _1853.setAttribute("outputLocale",_1857.getOutputLocale());
  28514. _1853.setAttribute("prompt",_1857.getPrompt());
  28515. _1853.setAttribute("dynamicDrill",_1857.isDynamicDrillThrough()?"true":"false");
  28516. var _1858=_1850[_1852].getAttribute("label");
  28517. if(_1858===null||_1858===""){
  28518. _1858=_1857.getLabel();
  28519. }
  28520. _1853.setAttribute("label",_1858);
  28521. _1853.setAttribute("path",_1857.getPath());
  28522. _1853.setAttribute("showInNewWindow",_1857.getShowInNewWindow());
  28523. _1853.setAttribute("method",_1857.getMethod());
  28524. var _1859=_184f;
  28525. var _185a="";
  28526. var _185b=_1857.getParameterProperties();
  28527. if(typeof _185b!="undefined"&&_185b!=null&&_185b!=""){
  28528. _185a=XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(_1857.getParameterProperties()));
  28529. }
  28530. while(_1859){
  28531. var _185c=_1859.childNodes[_1852].childNodes;
  28532. for(var _185d=0;_185d<_185c.length;++_185d){
  28533. var _185e=_185c[_185d].cloneNode(true);
  28534. if(_185a){
  28535. var _185f=this.getPropertyToPass(_185e.getAttribute("name"),_185a);
  28536. if(_185f!=null&&_185f!=""){
  28537. _185e.setAttribute("propertyToPass",_185f);
  28538. }
  28539. }
  28540. _1853.appendChild(_185e);
  28541. }
  28542. _1859=_1859.nextSibling;
  28543. }
  28544. var _1860="<root xmlns:bus=\"http://developer.cognos.com/schemas/bibus/3/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">";
  28545. var _1861="</root>";
  28546. var _1862=_1860+_1857.getParameters()+_1861;
  28547. var _1863=XMLBuilderLoadXMLFromString(_1862);
  28548. var _1864=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(_1863));
  28549. if(_1864){
  28550. _1853.appendChild(_1864.cloneNode(true));
  28551. }
  28552. var _1865=_1860+_1857.getObjectPaths()+_1861;
  28553. var _1866=XMLBuilderLoadXMLFromString(_1865);
  28554. _1864=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(_1866));
  28555. if(_1864){
  28556. _1853.appendChild(_1864.cloneNode(true));
  28557. }
  28558. }
  28559. return XMLHelper_GetFirstChildElement(_1851);
  28560. };
  28561. function ChangeDisplayTypeAction(){
  28562. this.m_requestParams=null;
  28563. this.m_sAction="ChangeDataContainerType";
  28564. this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES=5;
  28565. };
  28566. ChangeDisplayTypeAction.prototype=new ModifyReportAction();
  28567. ChangeDisplayTypeAction.prototype.getUndoHint=function(){
  28568. return RV_RES.IDS_JS_CHANGE_DISPLAY;
  28569. };
  28570. ChangeDisplayTypeAction.prototype.setRequestParms=function(parms){
  28571. this.m_requestParams=parms;
  28572. };
  28573. ChangeDisplayTypeAction.prototype.addActionContextAdditionalParms=function(){
  28574. this._cleaerPinAndFreeze();
  28575. var _1868=false;
  28576. if(this.m_requestParams.bestVisualization){
  28577. _1868=true;
  28578. }else{
  28579. if(((this.m_requestParams.targetType.targetType==undefined)||(this.m_requestParams.targetType.targetType=="undefined"))&&(this.m_requestParams.targetType.templateId==undefined)){
  28580. var _1869=eval("("+this.m_requestParams.targetType+")");
  28581. }else{
  28582. var _1869=this.m_requestParams.targetType;
  28583. }
  28584. }
  28585. var _186a=this.m_oCV.getViewerWidget().findContainerDiv();
  28586. var _186b="";
  28587. if(_186a){
  28588. _186b="<widgetWidth>"+(parseInt(_186a.style.width,10)-ResizeChartAction.PADDING.getWidth())+"px</widgetWidth>"+"<widgetHeight>"+(parseInt(_186a.style.height,10)-ResizeChartAction.PADDING.getHeight())+"px</widgetHeight>";
  28589. }
  28590. var _186c="";
  28591. if(_1868){
  28592. _186c+="<bestVisualization>true</bestVisualization>";
  28593. _186c+=this.getDataItemInfoMap();
  28594. }else{
  28595. _186c+="<target>";
  28596. _186c+=_1869.targetType;
  28597. _186c+="</target>";
  28598. if(_1869.templateId){
  28599. _186c+="<templateId>";
  28600. _186c+=((_1869.templateId)?_1869.templateId:"");
  28601. _186c+="</templateId>";
  28602. _186c+="<variationId>";
  28603. _186c+=((_1869.variationId)?_1869.variationId:"");
  28604. _186c+="</variationId>";
  28605. _186c+=this.getDataItemInfoMap();
  28606. }
  28607. _186c+="<label>";
  28608. _186c+=_1869.label;
  28609. _186c+="</label>";
  28610. }
  28611. _186c+=_186b;
  28612. _186c+=this.addClientContextData(3);
  28613. return (_186c);
  28614. };
  28615. ChangeDisplayTypeAction.prototype._cleaerPinAndFreeze=function(){
  28616. var _186d=this.m_oCV.getPinFreezeManager();
  28617. if(_186d){
  28618. var _186e=this.getContainerId(this.m_oCV.getSelectionController());
  28619. _186d.clearPinInfo(_186e);
  28620. }
  28621. };
  28622. ChangeDisplayTypeAction.prototype.updateMenu=function(_186f){
  28623. var _1870=this.getCognosViewer().getRAPReportInfo();
  28624. _186f.visible=(_1870)?_1870.containsInteractiveDataContainer():_186f.visible;
  28625. if(!_186f.visible){
  28626. return _186f;
  28627. }
  28628. var _1871=this.getSelectedReportInfo();
  28629. _186f.disabled=(_1871==null||_1871.displayTypeId==null||!this.isInteractiveDataContainer(_1871.displayTypeId));
  28630. if(_186f.disabled){
  28631. _186f.iconClass="chartTypesDisabled";
  28632. return _186f;
  28633. }
  28634. _186f.iconClass="chartTypes";
  28635. return this.buildDynamicMenuItem(_186f,"ChangeDisplayType");
  28636. };
  28637. ChangeDisplayTypeAction.prototype.createEmptyMenuItem=function(){
  28638. return {name:"None",label:RV_RES.IDS_JS_CHANGE_DISPLAY_SELECT_DATA,iconClass:"",action:null,items:null};
  28639. };
  28640. ChangeDisplayTypeAction.prototype.getActionContextString=function(_1872){
  28641. var _1873="<getInfoActions>";
  28642. _1873+="<getInfoAction name=\"GetInfo\">";
  28643. _1873+="<include><suggestedDisplayTypes/></include>";
  28644. _1873+=this.getDataItemInfoMap();
  28645. _1873+="<groupId>";
  28646. _1873+=_1872;
  28647. _1873+="</groupId>";
  28648. _1873+=this.addClientContextData(3);
  28649. _1873+="</getInfoAction>";
  28650. _1873+="</getInfoActions>";
  28651. return _1873;
  28652. };
  28653. ChangeDisplayTypeAction.prototype.fetchSuggestedDisplayTypes=function(_1874){
  28654. var oCV=this.getCognosViewer();
  28655. var _1876=new AsynchJSONDispatcherEntry(oCV);
  28656. _1876.addFormField("ui.action","getInfoFromReportSpec");
  28657. _1876.addFormField("bux","true");
  28658. _1876.addFormField("ui.object",oCV.envParams["ui.object"]);
  28659. _1876.addFormField("cv.actionContext",this.getActionContextString(_1874));
  28660. _1876.addDefinedFormField("ui.spec",oCV.envParams["ui.spec"]);
  28661. _1876.addNonEmptyStringFormField("modelPath",oCV.getModelPath());
  28662. if(_1874=="undefined"){
  28663. _1876.setCallbacks({"complete":{"object":this,"method":this.handleSuggestedDisplayTypesResponse}});
  28664. }else{
  28665. _1876.setCallbacks({"complete":{"object":this,"method":this.handleSuggestedDisplayVariationsResponse}});
  28666. }
  28667. oCV.dispatchRequest(_1876);
  28668. };
  28669. ChangeDisplayTypeAction.prototype.handleSuggestedDisplayTypesResponse=function(_1877){
  28670. var _1878=this.getCognosViewer();
  28671. var _1879=_1878.getViewerWidget();
  28672. this.addSuggestedDisplayTypesMenuItems(_1877.getResult());
  28673. };
  28674. ChangeDisplayTypeAction.prototype.addSuggestedDisplayTypesMenuItems=function(_187a){
  28675. var _187b=this.getCognosViewer().findToolbarItem("ChangeDisplayType");
  28676. if(_187b){
  28677. _187b.open=false;
  28678. }
  28679. var _187c=[];
  28680. var _187d=this.getSelectedReportInfo();
  28681. var _187e=undefined;
  28682. for(var x=0;x<_187a.containers.length;x++){
  28683. if(_187d.container==_187a.containers[x].container){
  28684. _187e=_187a.containers[x];
  28685. break;
  28686. }
  28687. }
  28688. if(_187e==undefined){
  28689. return;
  28690. }
  28691. var _1880=_187e.suggestedDisplayTypes.length<=this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES?_187e.suggestedDisplayTypes.length:this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES;
  28692. _187c.push({title:RV_RES.IDS_JS_CHANGE_DISPLAY_RECOMMENDED});
  28693. _187c.push({separator:true});
  28694. for(var i=0;i<_1880;i++){
  28695. _187c.push({name:_187e.suggestedDisplayTypes[i].name,label:_187e.suggestedDisplayTypes[i].title,description:_187e.suggestedDisplayTypes[i].description,iconClass:_187e.suggestedDisplayTypes[i].iconClass,action:{name:"ChangeDisplayType",payload:{targetType:{templateId:_187e.suggestedDisplayTypes[i].templateId},label:_187e.suggestedDisplayTypes[i].title}},items:null});
  28696. }
  28697. _187c.push({separator:true});
  28698. _187c.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:{}},items:null});
  28699. _187b.open=true;
  28700. _187b.items=_187c;
  28701. var _1882=[];
  28702. _1882.push(_187b);
  28703. this.getCognosViewer().getViewerWidget().fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1882);
  28704. return _187c;
  28705. };
  28706. ChangeDisplayTypeAction.prototype.buildMenu=function(_1883){
  28707. var _1884=this.getCognosViewer().getRAPReportInfo();
  28708. _1883.visible=(_1884)?_1884.containsInteractiveDataContainer():_1883.visible;
  28709. if(!_1883.visible){
  28710. return _1883;
  28711. }
  28712. var _1885=this.getSelectedReportInfo();
  28713. _1883.disabled=(_1885==null||_1885.displayTypeId==null||!this.isInteractiveDataContainer(_1885.displayTypeId));
  28714. if(_1883.disabled){
  28715. _1883.iconClass="chartTypesDisabled";
  28716. }else{
  28717. _1883.iconClass="chartTypes";
  28718. var _1886=this.getCognosViewer().getAdvancedServerProperty("VIEWER_JS_enableVisCoach");
  28719. if(_1886!=="false"&&(typeof _1885.suggestedDisplayTypesEnabled!="undefined")&&(_1885.suggestedDisplayTypesEnabled!=null)&&(_1885.suggestedDisplayTypesEnabled=="true")){
  28720. this.fetchSuggestedDisplayTypes("undefined");
  28721. return this.buildDynamicMenuItem(_1883,"ChangeDisplayType");
  28722. }else{
  28723. _1883.items=[];
  28724. var isV2=(_1885.displayTypeId.match("v2_")!=null||_1885.displayTypeId=="crosstab"||_1885.displayTypeId=="list");
  28725. if(isV2){
  28726. _1883.items.push({name:"ChangeDisplayBar",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_BAR,iconClass:"ChartTypeBar",action:{name:"ChangeDisplayType",payload:{targetType:"v2_bar_rectangle_clustered"}},items:null});
  28727. _1883.items.push({name:"ChangeDisplayColumn",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_COLUMN,iconClass:"ChartTypeColumn",action:{name:"ChangeDisplayType",payload:{targetType:"v2_column_rectangle_clustered"}},items:null});
  28728. _1883.items.push({name:"ChangeDisplayLine",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LINE,iconClass:"ChartTypeLine",action:{name:"ChangeDisplayType",payload:{targetType:"v2_line_clustered_markers"}},items:null});
  28729. _1883.items.push({name:"ChangeDisplayPie",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_PIE,iconClass:"ChartTypePie",action:{name:"ChangeDisplayType",payload:{targetType:"v2_pie"}},items:null});
  28730. _1883.items.push({name:"ChangeDisplayCrosstab",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_CROSSTAB,iconClass:"ChartTypeCrosstab",action:{name:"ChangeDisplayType",payload:{targetType:"Crosstab"}},items:null});
  28731. _1883.items.push({name:"ChangeDisplayList",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LIST,iconClass:"ChartTypeList",action:{name:"ChangeDisplayType",payload:{targetType:"List"}},items:null});
  28732. _1883.items.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:""},items:null});
  28733. }else{
  28734. _1883.items.push({name:"ChangeDisplayBar",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_BAR,iconClass:"ChartTypeBar",action:{name:"ChangeDisplayType",payload:{targetType:"bar_clustered_flat"}},items:null});
  28735. _1883.items.push({name:"ChangeDisplayColumn",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_COLUMN,iconClass:"ChartTypeColumn",action:{name:"ChangeDisplayType",payload:{targetType:"column_clustered_flat"}},items:null});
  28736. _1883.items.push({name:"ChangeDisplayLine",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LINE,iconClass:"ChartTypeLine",action:{name:"ChangeDisplayType",payload:{targetType:"line_clustered_flat_markers"}},items:null});
  28737. _1883.items.push({name:"ChangeDisplayPie",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_PIE,iconClass:"ChartTypePie",action:{name:"ChangeDisplayType",payload:{targetType:"pie_flat"}},items:null});
  28738. _1883.items.push({name:"ChangeDisplayCrosstab",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_CROSSTAB,iconClass:"ChartTypeCrosstab",action:{name:"ChangeDisplayType",payload:{targetType:"Crosstab"}},items:null});
  28739. _1883.items.push({name:"ChangeDisplayList",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LIST,iconClass:"ChartTypeList",action:{name:"ChangeDisplayType",payload:{targetType:"List"}},items:null});
  28740. _1883.items.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:""},items:null});
  28741. }
  28742. }
  28743. for(var i in _1883.items){
  28744. _1883.items[i].action.payload={targetType:_1883.items[i].action.payload};
  28745. _1883.items[i].action.payload.targetType.label=_1883.items[i].label;
  28746. }
  28747. }
  28748. return _1883;
  28749. };
  28750. function ChangeDisplayVariationsAction(){
  28751. };
  28752. ChangeDisplayVariationsAction.prototype=new CognosViewerAction();
  28753. function ChangeDisplayVariationsAction(){
  28754. this.m_requestParams=null;
  28755. };
  28756. ChangeDisplayVariationsAction.prototype.setRequestParms=function(parms){
  28757. this.m_requestParams=parms;
  28758. };
  28759. ChangeDisplayVariationsAction.prototype.execute=function(){
  28760. var _188a=this.m_requestParams.groupId;
  28761. var _188b=this.getCognosViewer();
  28762. var _188c=this.getSelectedReportInfo();
  28763. if(_188c){
  28764. var _188d=_188b.getViewerWidget();
  28765. if(typeof _188c.suggestedDisplayVariations=="undefined"){
  28766. var _188e=new AsynchJSONDispatcherEntry(this.m_oCV);
  28767. _188e.setCallbacks({"complete":{"object":this,"method":this.handleResponse}});
  28768. _188e.setRequestIndicator(_188b.getRequestIndicator());
  28769. _188e.addFormField("ui.action","getInfoFromReportSpec");
  28770. _188e.addFormField("bux","true");
  28771. _188e.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
  28772. _188e.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  28773. _188e.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  28774. _188e.addFormField("cv.actionContext",this.addActionContext(_188a));
  28775. _188b.dispatchRequest(_188e);
  28776. }else{
  28777. _188d.updateDisplayTypeDialogVariations(_188c.possibleDisplayTypes,_188c.suggestedDisplayVariations);
  28778. }
  28779. }
  28780. };
  28781. ChangeDisplayVariationsAction.prototype.handleResponse=function(_188f){
  28782. var _1890=this.getCognosViewer();
  28783. var _1891=_1890.getViewerWidget();
  28784. var _1892=_188f.getResult();
  28785. for(var i in _1892.containers){
  28786. var _1894=this.getReportInfo(_1892.containers[i].container);
  28787. _1894.possibleDisplayTypes=_1892.containers[i].possibleDisplayTypes;
  28788. _1894.variationGroups=_1892.containers[i].variationGroups;
  28789. }
  28790. var _1895=this.getSelectedReportInfo();
  28791. _1891.updateDisplayTypeDialogVariations(_1895.possibleDisplayTypes,_1895.variationGroups);
  28792. };
  28793. ChangeDisplayVariationsAction.prototype.addActionContext=function(_1896){
  28794. var _1897="<getInfoActions>";
  28795. _1897+="<getInfoAction name=\"GetInfo\">";
  28796. _1897+="<include><suggestedDisplayVariations/></include>";
  28797. _1897+=this.getDataItemInfoMap();
  28798. _1897+=this.addClientContextData(3);
  28799. _1897+="<groupId>";
  28800. _1897+=_1896;
  28801. _1897+="</groupId>";
  28802. _1897+="</getInfoAction>";
  28803. _1897+="</getInfoActions>";
  28804. return _1897;
  28805. };
  28806. function ChangePaletteAction(){
  28807. this.m_sAction="ChangePalette";
  28808. this.m_palette="";
  28809. this.m_runReport=true;
  28810. this.m_aPaletteNames=["Flow","Classic","Contemporary","Contrast","Corporate","Dynamic","Excel","Excel 2007","Gradients","Grey Scale","Jazz","Legacy","Metro","Mixed","Modern","Patterns"];
  28811. this.m_aPaletteIcons=["changePaletteFlow","changePaletteClassic","changePaletteContemporary","changePaletteContrast","changePaletteCorporate","changePaletteDynamic","changePaletteExcel","changePaletteExcel2007","changePaletteGradients","changePaletteGreyScale","changePaletteJazz","changePaletteLegacy","changePaletteMetro","changePaletteMixed","changePaletteModern","changePalettePatterns"];
  28812. };
  28813. ChangePaletteAction.prototype=new ModifyReportAction();
  28814. ChangePaletteAction.baseclass=ModifyReportAction.prototype;
  28815. ChangePaletteAction.prototype.reuseQuery=function(){
  28816. return true;
  28817. };
  28818. ChangePaletteAction.prototype.preProcess=function(){
  28819. this.updateRunReport();
  28820. if(this.m_runReport==false){
  28821. var _1898=this.getLayoutComponents();
  28822. for(var index=0;index<_1898.length;++index){
  28823. var _189a=_1898[index];
  28824. if(_189a.getAttribute("flashChart")!=null){
  28825. if(this.m_palette==""){
  28826. _189a.setPalette("Flow");
  28827. }else{
  28828. _189a.setPalette(this.m_palette);
  28829. }
  28830. }
  28831. }
  28832. }
  28833. };
  28834. ChangePaletteAction.prototype.updateRunReport=function(){
  28835. this.m_runReport=true;
  28836. var _189b=document.getElementById("rt"+this.m_oCV.getId());
  28837. if(_189b!=null){
  28838. var _189c=getElementsByAttribute(_189b,"*","chartcontainer","true");
  28839. if(_189c.length==0){
  28840. this.m_runReport=false;
  28841. }
  28842. }
  28843. };
  28844. ChangePaletteAction.prototype.runReport=function(){
  28845. return this.m_runReport;
  28846. };
  28847. ChangePaletteAction.prototype.updateInfoBar=function(){
  28848. return false;
  28849. };
  28850. ChangePaletteAction.prototype.getUndoHint=function(){
  28851. return RV_RES.IDS_JS_CHANGE_PALETTE;
  28852. };
  28853. ChangePaletteAction.prototype.setRequestParms=function(_189d){
  28854. if(typeof _189d=="string"){
  28855. this.m_palette=_189d;
  28856. if(this.m_oCV!=null&&typeof this.m_oCV!="undefined"){
  28857. this.m_oCV.m_sPalette=_189d;
  28858. }
  28859. }
  28860. };
  28861. ChangePaletteAction.prototype.addActionContextAdditionalParms=function(){
  28862. if(this.m_palette!=""){
  28863. return "<name>"+this.m_palette+"</name>";
  28864. }
  28865. return "";
  28866. };
  28867. ChangePaletteAction.prototype.updateMenu=function(_189e){
  28868. _189e.visible=this.ifContainsInteractiveDataContainer();
  28869. if(!_189e.visible){
  28870. return _189e;
  28871. }
  28872. var _189f=this.getSelectedReportInfo();
  28873. if(_189f!=null&&_189f.displayTypeId.indexOf("Chart")>=0){
  28874. _189e.disabled=false;
  28875. return _189e;
  28876. }
  28877. _189e.disabled=true;
  28878. return _189e;
  28879. };
  28880. ChangePaletteAction.reset=function(oCV){
  28881. delete (oCV.m_sPalette);
  28882. };
  28883. function DragDropAction(){
  28884. this.m_source=null;
  28885. this.m_target=null;
  28886. this.m_insertBefore=false;
  28887. this.m_sAction="Reorder";
  28888. };
  28889. DragDropAction.prototype=new ModifyReportAction();
  28890. DragDropAction.prototype.getUndoHint=function(){
  28891. return RV_RES.IDS_JS_MOVE;
  28892. };
  28893. DragDropAction.prototype.getOffsetCoords=function(_18a1){
  28894. var _18a2=document.getElementById("rt"+this.getCognosViewer().getId());
  28895. var _18a3=_18a1;
  28896. var _18a4=0;
  28897. var _18a5=0;
  28898. while(_18a3!=_18a2){
  28899. _18a4+=_18a3.offsetTop;
  28900. _18a5+=_18a3.offsetLeft;
  28901. _18a3=_18a3.offsetParent;
  28902. }
  28903. return {left:_18a5,top:_18a4};
  28904. };
  28905. DragDropAction.prototype.showDragDropCaret=function(evt,cell,_18a8){
  28906. var _18a9=document.getElementById("VDDC"+this.getCognosViewer().getId());
  28907. if(_18a9==null){
  28908. _18a9=document.createElement("span");
  28909. _18a9.setAttribute("id","VDDC"+this.getCognosViewer().getId());
  28910. _18a9.className="dropCaret";
  28911. if(_18a9.attachEvent){
  28912. _18a9.attachEvent("onmousemove",stopEventBubble);
  28913. }else{
  28914. _18a9.addEventListener("mousemove",stopEventBubble,false);
  28915. }
  28916. _18a9.style.width="8px";
  28917. _18a9.innerHTML="<img style=\"margin:1px;width:2px;height:100%;\" src=\""+this.getCognosViewer().getWebContentRoot()+"/rv/images/drop_caret.gif\"/>";
  28918. _18a8.appendChild(_18a9);
  28919. }
  28920. var _18aa=this.getOffsetCoords(_18a8);
  28921. _18a9.style.top=(_18aa.top-1)+"px";
  28922. var _18ab;
  28923. if(typeof evt.offsetX=="undefined"){
  28924. _18ab=evt.layerX;
  28925. }else{
  28926. _18aa=this.getOffsetCoords(evt.srcElement);
  28927. _18ab=evt.offsetX+_18aa.left;
  28928. }
  28929. _18aa=this.getOffsetCoords(cell);
  28930. var _18ac=_18aa.left+(cell.clientWidth/2);
  28931. this.m_insertBefore=(_18ab<_18ac);
  28932. _18a9.style.height=_18a8.clientHeight+"px";
  28933. if(this.m_insertBefore==false){
  28934. _18a9.style.left=(_18aa.left+cell.clientWidth+1)+"px";
  28935. }else{
  28936. _18a9.style.left=_18aa.left+"px";
  28937. }
  28938. _18a9.style.display="inline";
  28939. };
  28940. DragDropAction.prototype.showDragDropIndicators=function(evt){
  28941. if(this.m_target!=null){
  28942. var cell=this.m_target.getCellRef();
  28943. var _18af=cell;
  28944. while(_18af.getAttribute("lid")==null){
  28945. _18af=_18af.parentNode;
  28946. }
  28947. this.showDragDropCaret(evt,cell,_18af);
  28948. }
  28949. };
  28950. DragDropAction.prototype.showDragDropToolTip=function(evt){
  28951. var _18b1="";
  28952. if(this.canDrop()==true){
  28953. _18b1="/rv/images/cursor_move.gif";
  28954. }else{
  28955. _18b1="/rv/images/cursor_nodrop.gif";
  28956. }
  28957. this.showCustomCursor(evt,"viewerTooltipSpan",_18b1);
  28958. };
  28959. DragDropAction.prototype.canMove=function(){
  28960. if(this.m_oCV.isBlacklisted("Move")){
  28961. return false;
  28962. }
  28963. var _18b2=this.getCognosViewer().getSelectionController();
  28964. this.m_source=_18b2.getAllSelectedObjects();
  28965. if(this.m_source!=null&&this.m_source.length>0){
  28966. if(typeof this.m_source[0].m_dataContainerType!="undefined"&&this.m_source[0].m_dataContainerType=="list"&&this.m_source[0].getLayoutType()!="summary"){
  28967. return true;
  28968. }
  28969. }
  28970. return false;
  28971. };
  28972. DragDropAction.prototype.onDrag=function(evt){
  28973. clearTextSelection();
  28974. var _18b4=getNodeFromEvent(evt);
  28975. var _18b5=this.getCognosViewer().getSelectionController();
  28976. this.m_target=_18b5.buildSelectionObject(_18b4,evt);
  28977. this.showDragDropToolTip(evt);
  28978. if(this.canDrop()){
  28979. this.showDragDropIndicators(evt);
  28980. }else{
  28981. this.hideDropIndicators();
  28982. }
  28983. };
  28984. DragDropAction.prototype.hideDropIndicators=function(){
  28985. var _18b6=document.getElementById("VDDC"+this.getCognosViewer().getId());
  28986. if(_18b6!=null){
  28987. _18b6.style.display="none";
  28988. }
  28989. };
  28990. DragDropAction.prototype.onMouseDown=function(evt){
  28991. if(this.canMove()){
  28992. window.oCVDragDropObject={action:this,x:evt.clientX,y:evt.clientY,dragging:false};
  28993. }
  28994. };
  28995. DragDropAction.prototype.canDrop=function(){
  28996. return this.m_target!=null&&this.m_source!=null&&this.m_target.getLayoutType()!="summary"&&(this.m_target.getLayoutElementId()==this.m_source[0].getLayoutElementId());
  28997. };
  28998. DragDropAction.prototype.onDrop=function(evt){
  28999. this.hideCustomCursor("viewerTooltipSpan");
  29000. this.hideDropIndicators();
  29001. if(this.canDrop(evt)){
  29002. var _18b9=true;
  29003. var _18ba;
  29004. var first=parseInt(this.m_source[0].getColumnRef(),10);
  29005. var last=first;
  29006. var _18bd=true;
  29007. for(var index=0;index<this.m_source.length;++index){
  29008. _18ba=parseInt(this.m_source[index].getColumnRef(),10);
  29009. if(index>0&&_18ba!==last+1){
  29010. _18bd=false;
  29011. break;
  29012. }
  29013. last=_18ba;
  29014. }
  29015. if(_18bd){
  29016. var _18bf=parseInt(this.m_target.getColumnRef(),10);
  29017. _18bf+=this.m_insertBefore?0:1;
  29018. if(_18bf>=first&&_18bf<=last+1){
  29019. _18b9=false;
  29020. }
  29021. }
  29022. if(_18b9){
  29023. this.execute();
  29024. }
  29025. }
  29026. };
  29027. DragDropAction.prototype.addActionContextAdditionalParms=function(){
  29028. var tag=this.m_insertBefore==true?"before":"after";
  29029. var _18c1=this.m_target.getCellRef();
  29030. var _18c2=this.getRAPLayoutTag(_18c1);
  29031. _18c2=(_18c2!=null)?_18c2:this.m_target.getColumnName();
  29032. return this.getSelectedCellTags()+"<"+tag+">"+xml_encode(_18c2)+"</"+tag+">";
  29033. };
  29034. function DragDropAction_isDragging(evt){
  29035. var _18c4=window.oCVDragDropObject;
  29036. if(_18c4){
  29037. var _18c5=evt.clientX;
  29038. var _18c6=evt.clientY;
  29039. var _18c7=_18c4.x;
  29040. var _18c8=_18c4.y;
  29041. if((_18c5>=(_18c7+2))||(_18c5<=(_18c7-2))||(_18c6>=(_18c8+2))||(_18c6<=(_18c8-2))){
  29042. _18c4.dragging=true;
  29043. }
  29044. return _18c4.dragging;
  29045. }
  29046. return false;
  29047. };
  29048. function DragDropAction_onmouseup(evt){
  29049. if(DragDropAction_isDragging(evt)){
  29050. window.oCVDragDropObject.action.onDrop(evt);
  29051. }
  29052. window.oCVDragDropObject=null;
  29053. };
  29054. function DragDropAction_onmousemove(evt){
  29055. if(DragDropAction_isDragging(evt)){
  29056. window.oCVDragDropObject.action.onDrag(evt);
  29057. }
  29058. };
  29059. function DrillAction(){
  29060. this.m_bUseReportInfoSelection=false;
  29061. this.m_aDrillSelectedObjects=[];
  29062. this.m_useMARequest=false;
  29063. this.m_userSelectedDrillItem=null;
  29064. };
  29065. DrillAction.prototype=new ModifyReportAction();
  29066. DrillAction.prototype.getHoverClassName=function(){
  29067. return "";
  29068. };
  29069. DrillAction.prototype.setRequestParms=function(parms){
  29070. if(parms){
  29071. this.m_userSelectedDrillItem=parms.userSelectedDrillItem;
  29072. }
  29073. };
  29074. DrillAction.prototype.setKeepFocusOnWidget=function(_18cc){
  29075. this.m_bKeepFocusOnWidget=_18cc;
  29076. };
  29077. DrillAction.prototype.keepFocusOnWidget=function(){
  29078. if(typeof this.m_bKeepFocusOnWidget!="undefined"){
  29079. return this.m_bKeepFocusOnWidget;
  29080. }
  29081. return true;
  29082. };
  29083. DrillAction.prototype.getDrillabilityForItemFromReportInfo=function(_18cd){
  29084. if(!this.m_oCV){
  29085. return null;
  29086. }
  29087. var _18ce=this.m_oCV.getRAPReportInfo();
  29088. if(!_18ce){
  29089. return null;
  29090. }
  29091. var _18cf=_18ce.getContainers();
  29092. for(var _18d0 in _18cf){
  29093. var _18d1=_18ce.getDrillability(_18d0);
  29094. if(_18d1[_18cd]){
  29095. return _18d1[_18cd];
  29096. }
  29097. }
  29098. return null;
  29099. };
  29100. DrillAction.prototype.onDoubleClick=function(evt){
  29101. this.execute();
  29102. };
  29103. DrillAction.prototype.preProcess=function(){
  29104. if(typeof this.m_drillSpec==="undefined"||this.m_drillSpec===null){
  29105. var _18d3=this.generateDrillSpecObjects();
  29106. if(!_18d3){
  29107. return null;
  29108. }
  29109. var _18d4=this.getCognosViewer();
  29110. var _18d5=_18d4.getViewerWidget();
  29111. if(_18d5){
  29112. var _18d6=_18d4.getModelPath();
  29113. _18d5.getWidgetContextManager().raiseDrillEvent(_18d3,this.m_sAction,_18d6);
  29114. }
  29115. }
  29116. };
  29117. DrillAction.prototype.generateDrillSpecObjects=function(){
  29118. try{
  29119. var _18d7=[];
  29120. var oCV=this.getCognosViewer();
  29121. var _18d9=oCV.getDrillMgr();
  29122. var _18da=oCV.getSelectionController();
  29123. var _18db=true;
  29124. var _18dc=_18d9.getDrillParameters(this.m_drillOption,true,_18db,this.m_userSelectedDrillItem);
  29125. if(_18dc.length===0){
  29126. return null;
  29127. }
  29128. var _18dd=_18d9.getSelectedObject();
  29129. if(_18dc.length>3*4&&(_18dd.getDataContainerType()=="crosstab"||_18dd.getLayoutType()=="chartElement")){
  29130. _18dc.length=3*4;
  29131. }
  29132. var _18de=_18d9.getSelectedObject().getSelectedContextIds();
  29133. for(var i=0,_18e0=0;_18e0<_18de.length&&i<_18dc.length;++_18e0){
  29134. var _18e1=_18de[_18e0][0];
  29135. var _18e2=_18da.getRefDataItem(_18e1);
  29136. var sMUN=_18da.getMun(_18e1);
  29137. var _18e4=_18da.getDisplayValue(_18e1);
  29138. if(_18da.getDrillFlagForMember(_18e1)===0){
  29139. i=i+4;
  29140. continue;
  29141. }
  29142. var _18e5={"dataItem":_18dc[i++],"mun":_18dc[i++],"lun":_18dc[i++],"hun":_18dc[i++]};
  29143. if(_18e2!=""&&_18e4!=""){
  29144. if(_18e5.dataItem===_18e2){
  29145. _18e5.displayValue=_18e4;
  29146. }
  29147. }
  29148. var _18e6=_18da.getUsageInfo(_18e1);
  29149. _18e5.isMeasure=(_18e6==="2")?"true":"false";
  29150. var _18e7=false;
  29151. if(sMUN!=""&&_18e6!="2"){
  29152. var _18e8=this.getDrillabilityForItemFromReportInfo(_18e2);
  29153. if((_18e8!=null&&_18e8.disableDown==true)||this.m_oCV.getSelectionController().getDrillFlagForMember(_18e1)==1){
  29154. _18e7=true;
  29155. }
  29156. }
  29157. if(_18e7){
  29158. if(_18e5.dataItem===_18e2){
  29159. _18e5.summary="true";
  29160. }
  29161. }
  29162. _18d7.push(_18e5);
  29163. }
  29164. return (_18d7.length>0)?_18d7:null;
  29165. }
  29166. catch(e){
  29167. return null;
  29168. }
  29169. };
  29170. DrillAction.prototype.parseDrillSpec=function(evt){
  29171. try{
  29172. var oCV=this.getCognosViewer();
  29173. if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
  29174. return false;
  29175. }
  29176. this.m_drillSpec=evt.payload.drillSpec;
  29177. var _18eb=XMLBuilderLoadXMLFromString(this.m_drillSpec);
  29178. var _18ec=_18eb.firstChild;
  29179. var _18ed=getCognosViewerSCObjectRef(oCV.getId());
  29180. _18ed.m_aSelectedObjects=[];
  29181. if(_18ed.hasSelectedChartNodes()){
  29182. _18ed.clearSelectionData();
  29183. }
  29184. var _18ee=XMLHelper_FindChildrenByTagName(_18ec,"DrillGroup",false);
  29185. for(var _18ef=0;_18ef<_18ee.length;++_18ef){
  29186. var _18f0=XMLHelper_FindChildByTagName(_18ee[_18ef],"MUN",false);
  29187. var sMun=XMLHelper_GetText(_18f0);
  29188. var sLun="";
  29189. var sHun="";
  29190. var _18f4="";
  29191. var _18f5="";
  29192. var _18f6=XMLHelper_FindChildByTagName(_18ee[_18ef],"DisplayValue",false);
  29193. if(_18f6!=null){
  29194. _18f4=XMLHelper_GetText(_18f6);
  29195. }
  29196. var _18f7=XMLHelper_FindChildByTagName(_18ee[_18ef],"LUN",false);
  29197. if(_18f7!=null){
  29198. sLun=XMLHelper_GetText(_18f7);
  29199. }
  29200. var _18f8=XMLHelper_FindChildByTagName(_18ee[_18ef],"HUN",false);
  29201. if(_18f8!=null){
  29202. sHun=XMLHelper_GetText(_18f8);
  29203. }
  29204. var _18f9=XMLHelper_FindChildByTagName(_18ee[_18ef],"Summary",false);
  29205. if(_18f9!=null){
  29206. _18f5=XMLHelper_GetText(_18f9);
  29207. }
  29208. this.selectObject(sMun,sLun,sHun,_18f4,_18f5,_18ed);
  29209. }
  29210. }
  29211. catch(e){
  29212. return false;
  29213. }
  29214. return (_18ed.m_aSelectedObjects.length>0);
  29215. };
  29216. DrillAction.prototype.parseDrillSpecObjects=function(_18fa){
  29217. if(this.useReportInfoSelection()){
  29218. return this.parseDrillSpecObjectsWithReportInfo(_18fa);
  29219. }
  29220. try{
  29221. var oCV=this.getCognosViewer();
  29222. if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
  29223. return false;
  29224. }
  29225. this.m_drillSpec="";
  29226. var _18fc=getCognosViewerSCObjectRef(oCV.getId());
  29227. _18fc.m_aSelectedObjects=[];
  29228. if(_18fc.hasSelectedChartNodes()){
  29229. _18fc.clearSelectionData();
  29230. }
  29231. for(var i in _18fa){
  29232. var oSpec=_18fa[i];
  29233. var _18ff=(oSpec.summary)?oSpec.summary:"";
  29234. var _1900=true;
  29235. this.selectObject(oSpec.mun,oSpec.lun,oSpec.hun,oSpec.displayValue,_18ff,_18fc,_1900);
  29236. }
  29237. }
  29238. catch(e){
  29239. return false;
  29240. }
  29241. return (_18fc.m_aSelectedObjects.length>0);
  29242. };
  29243. DrillAction.prototype.getDrillabilityForCtxValue=function(_1901){
  29244. if(console&&console.log){
  29245. console.log("Required method, getDrillabilityForCtxValue, not implemented.");
  29246. }
  29247. };
  29248. DrillAction.prototype.setDrillabilityForSelectObject=function(_1902){
  29249. this.drillability=this.getDrillabilityForCtxValue(_1902);
  29250. };
  29251. DrillAction.prototype.canDrillDown=function(){
  29252. if(console&&console.log){
  29253. console.log("Required method, canDrillDown, not implemented.");
  29254. }
  29255. };
  29256. DrillAction.prototype.canDrilUp=function(){
  29257. if(console&&console.log){
  29258. console.log("Required method, canDrilUp, not implemented.");
  29259. }
  29260. };
  29261. DrillAction.prototype.selectObject=function(sMun,sLun,sHun,_1906,_1907,_1908,_1909){
  29262. var _190a=sHun;
  29263. var _190b=sLun;
  29264. var _190c=sMun;
  29265. var _190d=false;
  29266. var _190e=_1908.getCtxIdFromMun(sMun);
  29267. var _190f=_190e;
  29268. if(_190e===""){
  29269. var _1910=_1908.replaceNamespaceForSharedTM1DimensionOnly(sLun,sHun,sMun);
  29270. _190b=_1910.lun;
  29271. _190a=_1910.hun;
  29272. if(_190a!==sHun){
  29273. _190c=this._replaceNamespace(sMun,_190a);
  29274. }
  29275. _190d=(_1909==true);
  29276. _190e=_1908.getCtxIdFromMetaData(_190b,_190a,_190d);
  29277. if(_190e===""){
  29278. return false;
  29279. }
  29280. }
  29281. this.setDrillabilityForSelectObject(_190e);
  29282. if((_190d==true)||(this.m_sAction=="DrillDown"&&this.canDrillDown())||(this.m_sAction=="DrillUp"&&this.canDrillUp())){
  29283. var _1911=_1908.getSelections().length;
  29284. _1908.selectObject(_190c,_190b,_190a,_190d);
  29285. var _1912=_1908.getSelections();
  29286. if(_190f===""&&_1912.length>_1911){
  29287. var aMuns=_1912[_1912.length-1].m_aMuns;
  29288. aMuns[aMuns.length]=[];
  29289. aMuns[aMuns.length-1].push(_190c);
  29290. var _1914=_1912[_1912.length-1].m_aDisplayValues;
  29291. _1914.push(_1906);
  29292. _1912[_1912.length-1].useDisplayValueFromObject=true;
  29293. }
  29294. if(_1907=="true"){
  29295. _1912=_1908.getSelections();
  29296. _1912[_1912.length-1].onSummary=true;
  29297. }
  29298. }
  29299. };
  29300. DrillAction.prototype._replaceNamespace=function(mun,_1916){
  29301. var _1917=null;
  29302. if(_1916){
  29303. var _1918=_1916.substr(0,_1916.indexOf("].[")+1);
  29304. if(mun&&_1918&&!(mun.match("^"+_1918))){
  29305. var _1919=mun.indexOf("].[");
  29306. _1917=_1918+mun.substr(_1919+1,mun.length);
  29307. }
  29308. }
  29309. return _1917||mun;
  29310. };
  29311. DrillAction.prototype.addActionContextAdditionalParms=function(){
  29312. var _191a="";
  29313. var _191b=(this.useReportInfoSelection())?this.m_aDrillSelectedObjects:this.getCognosViewer().getSelectionController().getSelections();
  29314. var sItem=null;
  29315. for(var i=0;i<_191b.length;++i){
  29316. if(_191b[i].onSummary){
  29317. sItem=(this.useReportInfoSelection())?_191b[i].item:_191b[i].getDataItems()[0][0];
  29318. _191a+="<dataItem>"+xml_encode(sItem)+"</dataItem>";
  29319. }
  29320. }
  29321. if(_191a!=""){
  29322. _191a="<onSummary>"+_191a+"</onSummary>";
  29323. }
  29324. if(this.m_userSelectedDrillItem){
  29325. _191a+=("<userSelectedDrillItem>"+this.m_userSelectedDrillItem+"</userSelectedDrillItem>");
  29326. }
  29327. if(this.m_useMARequest===true){
  29328. _191a=_191a+"<useMAGetChildRequest>false</useMAGetChildRequest>";
  29329. _191a=_191a+"<useMAGetParentRequest>false</useMAGetParentRequest>";
  29330. }
  29331. _191a+=this.addClientContextData(3);
  29332. return _191a;
  29333. };
  29334. DrillAction.prototype.getDrillOptionsAsString=function(){
  29335. var _191e=this.getViewerWidget();
  29336. var _191f="";
  29337. if(_191e){
  29338. _191f="<addSummaryMembers>"+_191e.getDrillOptions().addSummaryMembers+"</addSummaryMembers>";
  29339. _191f=_191f+"<backwardsCompatible>"+_191e.getDrillOptions().backwardsCompatible+"</backwardsCompatible>";
  29340. }
  29341. return _191f;
  29342. };
  29343. DrillAction.prototype.getItemInfo=function(_1920,_1921){
  29344. var _1922=_1920.getRAPReportInfo();
  29345. if(!_1922){
  29346. return null;
  29347. }
  29348. var _1923=_1922.getContainers();
  29349. for(var _1924 in _1923){
  29350. var _1925=_1922.getItemInfo(_1924);
  29351. if(_1925[_1921]){
  29352. return _1925[_1921];
  29353. }
  29354. }
  29355. return null;
  29356. };
  29357. DrillAction.prototype.isSelectionFilterEnabled=function(){
  29358. var _1926=this.getViewerWidget();
  29359. if(!_1926){
  29360. return false;
  29361. }
  29362. return _1926.isSelectionFilterEnabled();
  29363. };
  29364. DrillAction.prototype.getHierarchyHasExpandedSet=function(_1927,_1928){
  29365. var _1929=this.getItemInfo(_1927,_1928);
  29366. return (_1929&&_1929.hierarchyHasExpandedMembers);
  29367. };
  29368. DrillAction.prototype.getIsRSDrillParent=function(_192a,_192b){
  29369. var _192c=this.getItemInfo(_192a,_192b);
  29370. return (_192c&&_192c.isRSDrillParent);
  29371. };
  29372. DrillAction.prototype.setUseReportInfoSelection=function(bFlag){
  29373. this.m_bUseReportInfoSelection=bFlag;
  29374. };
  29375. DrillAction.prototype.useReportInfoSelection=function(){
  29376. return this.m_bUseReportInfoSelection;
  29377. };
  29378. DrillAction.prototype.parseDrillSpecObjectsWithReportInfo=function(_192e){
  29379. try{
  29380. var _192f=this.m_oCV.getRAPReportInfo();
  29381. if(!_192f){
  29382. return null;
  29383. }
  29384. this.m_drillSpec="";
  29385. this.m_aDrillSelectedObjects=[];
  29386. for(var i in _192e){
  29387. this.populateSelectObjectWithReportInfo(_192e[i],_192f);
  29388. }
  29389. }
  29390. catch(e){
  29391. return false;
  29392. }
  29393. return (this.m_aDrillSelectedObjects.length>0);
  29394. };
  29395. DrillAction.prototype.populateSelectObjectWithReportInfo=function(oSpec,_1932){
  29396. var _1933=_1932.getItemDetails(oSpec.dataItem,oSpec.hun);
  29397. if(!_1933){
  29398. _1933=_1932.getItemDetailsByHun(oSpec.hun);
  29399. if(!_1933){
  29400. return null;
  29401. }
  29402. }
  29403. if(oSpec.mun){
  29404. _1933.mun=oSpec.mun;
  29405. }
  29406. if(oSpec.lun){
  29407. _1933.lun=oSpec.lun;
  29408. }
  29409. if(oSpec.displayValue){
  29410. _1933.displayValue=oSpec.displayValue;
  29411. }
  29412. if(oSpec.isMeasure==="true"){
  29413. _1933.isMeasure=true;
  29414. }
  29415. if(oSpec.summary==="true"){
  29416. _1933.onSummary=true;
  29417. }
  29418. this.m_aDrillSelectedObjects.push(_1933);
  29419. };
  29420. DrillAction.prototype.getSelectionContext=function(){
  29421. if(this.useReportInfoSelection()){
  29422. return this.genLeanSelection();
  29423. }else{
  29424. return CognosViewerAction.prototype.getSelectionContext.call(this);
  29425. }
  29426. };
  29427. DrillAction.prototype.genLeanSelection=function(){
  29428. if(this.m_aDrillSelectedObjects.length==0){
  29429. return "";
  29430. }
  29431. var _1934="";
  29432. for(var idx in this.m_aDrillSelectedObjects){
  29433. var obj=this.m_aDrillSelectedObjects[idx];
  29434. _1934+="<selectedCell>";
  29435. _1934+=("<name>"+obj.item+"</name>"+"<display>"+obj.displayValue+"</display>"+"<rapLayoutTag>"+obj.lid+"</rapLayoutTag>"+"<queryName>"+obj.queryName+"</queryName>");
  29436. if(obj.mun){
  29437. _1934+=("<nodeUse>"+obj.mun+"</nodeUse>");
  29438. _1934+=("<nodeType>memberUniqueName</nodeType>");
  29439. }
  29440. if(obj.hun){
  29441. _1934+=("<nodeHierarchyUniqueName>"+obj.hun+"</nodeHierarchyUniqueName>");
  29442. }
  29443. var _1937=(obj.isMeasure)?"measure":"nonMeasure";
  29444. _1934+=("<nodeUsage>"+_1937+"</nodeUsage>");
  29445. _1934+="</selectedCell>";
  29446. }
  29447. return ("<selection>"+_1934+"</selection>");
  29448. };
  29449. DrillAction.prototype.runReport=function(){
  29450. if(this.getViewerWidget()){
  29451. return this.getViewerWidget().shouldReportBeRunOnAction();
  29452. }else{
  29453. return true;
  29454. }
  29455. };
  29456. DrillAction.prototype.canBeQueued=function(){
  29457. if(this.getViewerWidget()){
  29458. return !(this.getViewerWidget().isVisible());
  29459. }else{
  29460. return false;
  29461. }
  29462. };
  29463. function DrillUpDownAction(){
  29464. this.m_sAction="DrillDown";
  29465. this.m_drillOption="drillDown";
  29466. this.undoTooltip="";
  29467. };
  29468. DrillUpDownAction.prototype=new DrillAction();
  29469. DrillUpDownAction.prototype.getHoverClassName=function(){
  29470. return "dl";
  29471. };
  29472. DrillUpDownAction.prototype.getUndoHint=function(){
  29473. return this.undoTooltip;
  29474. };
  29475. DrillUpDownAction.prototype.keepRAPCache=function(){
  29476. return false;
  29477. };
  29478. DrillUpDownAction.prototype.updateDrillability=function(_1938,_1939){
  29479. this.m_oCV=_1938;
  29480. var _193a=_1939.getAttribute("ctx");
  29481. this.drillability=0;
  29482. if(_193a){
  29483. var _193b=_193a.split("::");
  29484. if(_193b&&_193b.length>0){
  29485. if(_193b.length>2){
  29486. this.drillability=this.getDrillabilityForIntersection(_193b[1].split(":")[0],_193b[2].split(":")[0]);
  29487. }else{
  29488. if(_193b.length===2){
  29489. this.drillability=this.getDrillabilityForCtxValue(_193b[1].split(":")[0]);
  29490. }else{
  29491. this.drillability=this.getDrillabilityForCtxValue(_193b[0].split(":")[0]);
  29492. }
  29493. }
  29494. }
  29495. }
  29496. if(this.isDefaultDrillUp(_1939)){
  29497. this.m_sAction="DrillUp";
  29498. this.m_drillOption="drillUp";
  29499. this.undoTooltip=RV_RES.RV_DRILL_UP;
  29500. }else{
  29501. this.m_sAction="DrillDown";
  29502. this.m_drillOption="drillDown";
  29503. this.undoTooltip=RV_RES.RV_DRILL_DOWN;
  29504. }
  29505. return this.drillability;
  29506. };
  29507. DrillUpDownAction.prototype.updateDrillabilityFromSelections=function(){
  29508. var _193c=this.m_oCV.getSelectionController();
  29509. var _193d=_193c.getAllSelectedObjects();
  29510. this.drillability=0;
  29511. if(_193d!=null&&typeof _193d!="undefined"&&_193d.length==1&&_193d[0].m_contextIds!=null){
  29512. if(_193d[0].getLayoutType()=="section"){
  29513. this.drillability=0;
  29514. }else{
  29515. if(_193d[0].m_contextIds.length==0){
  29516. this.drillability=0;
  29517. }else{
  29518. if(typeof DrillContextMenuHelper!=="undefined"&&DrillContextMenuHelper.needsDrillSubMenu(this.m_oCV)){
  29519. this.drillability=this.getDrillabilityForAll(_193d[0].m_contextIds);
  29520. }else{
  29521. if(_193d[0].m_contextIds.length>2){
  29522. this.drillability=this.getDrillabilityForIntersection(_193d[0].m_contextIds[1][0],_193d[0].m_contextIds[2][0]);
  29523. }else{
  29524. this.drillability=this.getDrillabilityForCtxValue(_193d[0].m_contextIds[0][0]);
  29525. }
  29526. }
  29527. }
  29528. }
  29529. }
  29530. return this.drillability;
  29531. };
  29532. DrillUpDownAction.prototype.getDrillabilityForCtxValue=function(_193e){
  29533. var _193f=0;
  29534. var _1940=this.m_oCV.getSelectionController();
  29535. var _1941=_1940.getRefDataItem(_193e);
  29536. if(this.getHierarchyHasExpandedSet(this.m_oCV,_1941)&&this.getIsRSDrillParent(this.m_oCV,_1941)){
  29537. _193f=1;
  29538. return _193f;
  29539. }
  29540. if(_1940.getMun(_193e)!==""&&_1940.getUsageInfo(_193e)!=="2"){
  29541. _193f=(+_1940.getDrillFlagForMember(_193e));
  29542. var _1942=this.getDrillabilityForItemFromReportInfo(_1940.getRefDataItem(_193e));
  29543. if(_1942!=null){
  29544. if(_1942.disableDown==true||_1942.isolated==true){
  29545. if(_193f==1||_193f>=3||_1942.isolated==true){
  29546. _193f=1;
  29547. }else{
  29548. _193f=0;
  29549. }
  29550. }
  29551. if(_1942.disableUp==true){
  29552. if(_193f>=2){
  29553. _193f=2;
  29554. }else{
  29555. _193f=0;
  29556. }
  29557. }
  29558. }
  29559. }
  29560. return _193f;
  29561. };
  29562. DrillUpDownAction.prototype.getDrillabilityForIntersection=function(_1943,_1944){
  29563. var _1945=this.getDrillabilityForCtxValue(_1943);
  29564. return this.mergeDrillability(_1945,_1944);
  29565. };
  29566. DrillUpDownAction.prototype.getDrillabilityForAll=function(_1946){
  29567. var _1947=(_1946.length>=2)?1:0;
  29568. var _1948;
  29569. if(_1946.length==2){
  29570. _1948=1;
  29571. }else{
  29572. if(_1946.length>2){
  29573. _1948=2;
  29574. }else{
  29575. _1948=0;
  29576. }
  29577. }
  29578. var _1949=0;
  29579. for(var iDim=_1947;iDim<=_1948;++iDim){
  29580. for(var _194b=0;_194b<_1946[iDim].length;++_194b){
  29581. _1949=this.mergeDrillability(_1949,_1946[iDim][_194b]);
  29582. }
  29583. }
  29584. return _1949;
  29585. };
  29586. DrillUpDownAction.prototype.mergeDrillability=function(_194c,_194d){
  29587. var _194e=this.getDrillabilityForCtxValue(_194d);
  29588. if(_194c==_194e){
  29589. return _194c;
  29590. }
  29591. if(_194c>_194e){
  29592. var temp=_194c;
  29593. _194c=_194e;
  29594. _194e=temp;
  29595. }
  29596. if(_194c==1&&_194e==2){
  29597. return 3;
  29598. }
  29599. return _194e;
  29600. };
  29601. DrillUpDownAction.prototype.hasPermission=function(){
  29602. if(this.m_oCV){
  29603. if(this.m_oCV.isDrillBlackListed()){
  29604. return false;
  29605. }
  29606. var _1950=this.m_oCV.envParams;
  29607. if(_1950){
  29608. return !(this.m_oCV.isLimitedInteractiveMode()||(_1950["cv.objectPermissions"].indexOf("read")===-1));
  29609. }
  29610. }
  29611. return false;
  29612. };
  29613. DrillUpDownAction.prototype.canDrillUp=function(){
  29614. return ((this.drillability==1||this.drillability==3||this.drillability==4)&&this.hasPermission());
  29615. };
  29616. DrillUpDownAction.prototype.canDrillDown=function(){
  29617. return ((this.drillability==2||this.drillability==3||this.drillability==4)&&this.hasPermission());
  29618. };
  29619. DrillUpDownAction.prototype.isDefaultDrillUp=function(_1951){
  29620. if(this.drillability==1||this.drillability==4||(_1951&&_1951.getAttribute("ischarttitle")==="true")){
  29621. return true;
  29622. }else{
  29623. return false;
  29624. }
  29625. };
  29626. DrillUpDownAction.prototype.doOnMouseOver=function(evt){
  29627. if(this.drillability>0&&!this.getCognosViewer().isLimitedInteractiveMode()){
  29628. var _1953=getCtxNodeFromEvent(evt);
  29629. this.addDrillableClass(_1953);
  29630. if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
  29631. this.addDrillableClass(evt.toElement);
  29632. }
  29633. }
  29634. };
  29635. DrillUpDownAction.prototype.doOnMouseOut=function(evt){
  29636. var _1955=getCtxNodeFromEvent(evt);
  29637. if(_1955){
  29638. this.removeDrillableClass(_1955);
  29639. if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
  29640. this.removeDrillableClass(evt.toElement);
  29641. }
  29642. }
  29643. };
  29644. DrillUpDownAction.prototype.onMouseOver=function(evt){
  29645. this.doOnMouseOver(evt);
  29646. };
  29647. DrillUpDownAction.prototype.onMouseOut=function(evt){
  29648. this.doOnMouseOut(evt);
  29649. };
  29650. DrillUpDownAction.prototype.onDoubleClick=function(evt){
  29651. if(this.drillability>0&&this.hasPermission()&&!this.isSelectionFilterEnabled()){
  29652. this.execute();
  29653. var _1959=getCtxNodeFromEvent(evt);
  29654. if(_1959!=null){
  29655. this.removeDrillableClass(_1959);
  29656. }
  29657. }
  29658. };
  29659. DrillUpDownAction.prototype.addDrillableClass=function(node){
  29660. if(!node.className.match(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)"))){
  29661. node.className+=" "+this.getHoverClassName();
  29662. }
  29663. };
  29664. DrillUpDownAction.prototype.removeDrillableClass=function(node){
  29665. var _195c=node.className;
  29666. _195c=_195c.replace(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)")," ");
  29667. node.className=_195c.replace(/^\s*/,"").replace(/\s*$/,"");
  29668. };
  29669. function DrillUpDownOrThroughAction(){
  29670. this.m_hasAuthoredDrillTargets=false;
  29671. this.m_canDrillUpDown=false;
  29672. };
  29673. DrillUpDownOrThroughAction.prototype=new DrillUpDownAction();
  29674. DrillUpDownOrThroughAction.prototype.init=function(_195d,_195e){
  29675. if(this.getCognosViewer()){
  29676. var _195f=this.getCognosViewer().getViewerWidget();
  29677. if(_195f&&_195f.isSelectionFilterEnabled()){
  29678. return;
  29679. }else{
  29680. if(this.m_oCV.isDrillBlackListed()){
  29681. return;
  29682. }
  29683. }
  29684. }
  29685. this.m_hasAuthoredDrillTargets=_195d;
  29686. this.m_canDrillUpDown=_195e;
  29687. };
  29688. DrillUpDownOrThroughAction.prototype.updateDrillabilityInfo=function(_1960,_1961){
  29689. if(this.m_canDrillUpDown){
  29690. return this.updateDrillability(_1960,_1961);
  29691. }
  29692. return null;
  29693. };
  29694. DrillUpDownOrThroughAction.prototype.onMouseOver=function(evt){
  29695. if(this.m_hasAuthoredDrillTargets){
  29696. var _1963=getCtxNodeFromEvent(evt);
  29697. if(_1963){
  29698. this.addDrillableClass(_1963);
  29699. this._set_chartImage_drillThroughCursor_IE("pointer",evt);
  29700. }
  29701. }
  29702. if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
  29703. this.doOnMouseOver(evt);
  29704. }
  29705. };
  29706. DrillUpDownOrThroughAction.prototype.onMouseOut=function(evt){
  29707. if(this.m_hasAuthoredDrillTargets){
  29708. var _1965=getCtxNodeFromEvent(evt);
  29709. if(_1965){
  29710. this.removeDrillableClass(_1965);
  29711. this._set_chartImage_drillThroughCursor_IE("default",evt);
  29712. }
  29713. }
  29714. if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
  29715. this.doOnMouseOut(evt);
  29716. }
  29717. };
  29718. DrillUpDownOrThroughAction.prototype._getDrillThroughChartImage_from_chartArea=function(evt){
  29719. var _1967=getCrossBrowserNode(evt);
  29720. if(_1967){
  29721. var _1968=this.m_oCV.getSelectionController();
  29722. return _1968.getSelectedChartImageFromChartArea(_1967);
  29723. }
  29724. };
  29725. DrillUpDownOrThroughAction.prototype._set_chartImage_drillThroughCursor_IE=function(_1969,evt){
  29726. if(dojo.isIE||dojo.isTrident){
  29727. var oImg=this._getDrillThroughChartImage_from_chartArea(evt);
  29728. if(oImg){
  29729. oImg.style.cursor=_1969;
  29730. }
  29731. }
  29732. };
  29733. function DrillDownAction(){
  29734. this.m_sAction="DrillDown";
  29735. this.m_drillOption="drillDown";
  29736. };
  29737. DrillDownAction.prototype=new DrillUpDownAction();
  29738. DrillDownAction.prototype.getUndoHint=function(){
  29739. return RV_RES.RV_DRILL_DOWN;
  29740. };
  29741. DrillDownAction.prototype.getHoverClassName=function(){
  29742. return "dl";
  29743. };
  29744. DrillDownAction.prototype.updateMenu=function(_196c){
  29745. _196c.visible=this.ifContainsInteractiveDataContainer();
  29746. if(!_196c.visible){
  29747. return _196c;
  29748. }
  29749. this.updateDrillabilityFromSelections();
  29750. if(!this.canDrillDown()){
  29751. _196c.disabled=true;
  29752. }else{
  29753. _196c.disabled=false;
  29754. DrillContextMenuHelper.updateDrillMenuItems(_196c,this.m_oCV,this.m_sAction);
  29755. }
  29756. return _196c;
  29757. };
  29758. function DrillUpAction(){
  29759. this.m_sAction="DrillUp";
  29760. this.m_drillOption="drillUp";
  29761. };
  29762. DrillUpAction.prototype=new DrillUpDownAction();
  29763. DrillUpAction.prototype.getHoverClassName=function(){
  29764. return "dl";
  29765. };
  29766. DrillUpAction.prototype.getUndoHint=function(){
  29767. return RV_RES.RV_DRILL_UP;
  29768. };
  29769. DrillUpAction.prototype.updateMenu=function(_196d){
  29770. _196d.visible=this.ifContainsInteractiveDataContainer();
  29771. if(!_196d.visible){
  29772. return _196d;
  29773. }
  29774. this.updateDrillabilityFromSelections();
  29775. if(!this.canDrillUp()){
  29776. _196d.disabled=true;
  29777. }else{
  29778. _196d.disabled=false;
  29779. DrillContextMenuHelper.updateDrillMenuItems(_196d,this.m_oCV,this.m_sAction);
  29780. }
  29781. return _196d;
  29782. };
  29783. function DeleteAction(){
  29784. this.m_sAction="Delete";
  29785. };
  29786. DeleteAction.prototype=new ModifyReportAction();
  29787. DeleteAction.baseclass=ModifyReportAction.prototype;
  29788. DeleteAction.prototype.getUndoHint=function(){
  29789. return RV_RES.IDS_JS_DELETE;
  29790. };
  29791. DeleteAction.prototype.canDelete=function(){
  29792. if(!this.m_oCV.isLimitedInteractiveMode()){
  29793. var _196e=this.m_oCV.getSelectionController().getAllSelectedObjects();
  29794. if(_196e.length>0){
  29795. for(var i=0;i<_196e.length;++i){
  29796. var _1970=_196e[i];
  29797. var _1971=_1970.getCellRef();
  29798. if(!_1970.hasContextInformation()||_1970.isHomeCell()||(_1970.getLayoutType()!="columnTitle"&&_1970.getDataContainerType()!="list")||_1971.getAttribute("cc")=="true"){
  29799. return false;
  29800. }
  29801. }
  29802. return true;
  29803. }
  29804. }
  29805. return false;
  29806. };
  29807. DeleteAction.prototype.execute=function(){
  29808. DeleteAction.baseclass.execute.call(this);
  29809. this.m_oCV.getSelectionController().clearSelectionData();
  29810. this.m_oCV.getViewerWidget().onContextMenu(null);
  29811. };
  29812. DeleteAction.prototype.keepRAPCache=function(){
  29813. return false;
  29814. };
  29815. DeleteAction.prototype.updateMenu=function(_1972){
  29816. _1972.visible=this.ifContainsInteractiveDataContainer();
  29817. if(!_1972.visible){
  29818. return _1972;
  29819. }
  29820. _1972.disabled=!this.canDelete();
  29821. return _1972;
  29822. };
  29823. DeleteAction.prototype.addActionContextAdditionalParms=function(){
  29824. return this.getSelectedCellTags();
  29825. };
  29826. function UndoableClientActionBase(){
  29827. };
  29828. UndoableClientActionBase.prototype=new CognosViewerAction();
  29829. UndoableClientActionBase.prototype.setContainerId=function(_1973){
  29830. this.m_sContainerId=_1973;
  29831. };
  29832. UndoableClientActionBase.prototype.doRedo=function(_1974){
  29833. this.setContainerId(_1974);
  29834. this.execute();
  29835. };
  29836. UndoableClientActionBase.prototype.doUndo=function(_1975){
  29837. factory=this.getCognosViewer().getActionFactory();
  29838. var _1976=factory.load(this.getUndoClass());
  29839. _1976.setContainerId(_1975);
  29840. _1976.execute();
  29841. };
  29842. UndoableClientActionBase.prototype.getSelectedContainerId=function(){
  29843. var _1977=this.m_oCV.getSelectionController().getAllSelectedObjects();
  29844. if(_1977&&_1977.length){
  29845. var lid=_1977[0].getLayoutElementId();
  29846. if(lid){
  29847. return this.removeNamespace(lid);
  29848. }
  29849. }
  29850. return null;
  29851. };
  29852. function FreezeRowHeadingsAction(){
  29853. };
  29854. FreezeRowHeadingsAction.prototype=new UndoableClientActionBase();
  29855. FreezeRowHeadingsAction.superclass=UndoableClientActionBase.prototype;
  29856. FreezeRowHeadingsAction.prototype.execute=function(){
  29857. var _1979=this.m_sContainerId?this.m_sContainerId:this.getSelectedCrosstabContainerId();
  29858. if(_1979){
  29859. this.m_oCV.getSelectionController().resetSelections();
  29860. this.m_oCV.getPinFreezeManager().freezeContainerRowHeadings(_1979);
  29861. this.addClientSideUndo(this,[_1979]);
  29862. }
  29863. };
  29864. FreezeRowHeadingsAction.prototype.getUndoHint=function(){
  29865. return RV_RES.IDS_JS_FREEZEROWHEADINGS;
  29866. };
  29867. FreezeRowHeadingsAction.prototype.getUndoClass=function(){
  29868. return "UnfreezeRowHeadings";
  29869. };
  29870. FreezeRowHeadingsAction.prototype.getSelectedCrosstabContainerLid=function(){
  29871. var _197a=this.m_oCV.getSelectionController().getAllSelectedObjects();
  29872. if(_197a&&_197a.length&&_197a[0].getDataContainerType()=="crosstab"){
  29873. var lid=(_197a[0].getLayoutElementId());
  29874. if(lid){
  29875. return lid;
  29876. }
  29877. }
  29878. return null;
  29879. };
  29880. FreezeRowHeadingsAction.prototype.getSelectedCrosstabContainerId=function(){
  29881. var lid=this.getSelectedCrosstabContainerLid();
  29882. if(lid){
  29883. return this.removeNamespace(lid);
  29884. }
  29885. return null;
  29886. };
  29887. FreezeRowHeadingsAction.prototype.canFreezeRowHeadings=function(){
  29888. var _197d=this.m_oCV.getPinFreezeManager();
  29889. if(_197d){
  29890. var _197e=this.getSelectedCrosstabContainerId();
  29891. if(_197e){
  29892. if(!_197d.hasFrozenRowHeadings(_197e)&&_197d.getValidSelectedContainerId(false)){
  29893. return true;
  29894. }
  29895. }
  29896. }
  29897. return false;
  29898. };
  29899. FreezeRowHeadingsAction.prototype.updateMenu=function(_197f){
  29900. _197f.visible=this.canFreezeRowHeadings();
  29901. return _197f;
  29902. };
  29903. function UnfreezeRowHeadingsAction(){
  29904. };
  29905. UnfreezeRowHeadingsAction.prototype=new UndoableClientActionBase();
  29906. UnfreezeRowHeadingsAction.superclass=UndoableClientActionBase.prototype;
  29907. UnfreezeRowHeadingsAction.prototype.execute=function(){
  29908. if(this.m_oCV.getPinFreezeManager()){
  29909. var _1980=document.getElementById("CVReport"+this.m_oCV.getId());
  29910. var _1981=this.m_sContainerId?this.m_sContainerId:this.getSelectedContainerId();
  29911. this.m_oCV.getSelectionController().resetSelections();
  29912. this.m_oCV.getPinFreezeManager().unfreezeContainerRowHeadings(_1981,_1980);
  29913. this.addClientSideUndo(this,[_1981]);
  29914. }
  29915. };
  29916. UnfreezeRowHeadingsAction.prototype.getUndoHint=function(){
  29917. return RV_RES.IDS_JS_UNFREEZEROWHEADINGS;
  29918. };
  29919. UnfreezeRowHeadingsAction.prototype.getUndoClass=function(){
  29920. return "FreezeRowHeadings";
  29921. };
  29922. UnfreezeRowHeadingsAction.prototype.areRowHeadingsFrozen=function(){
  29923. if(this.m_oCV.getPinFreezeManager()&&this.m_oCV.getPinFreezeManager().hasFrozenRowHeadings(this.getSelectedContainerId())){
  29924. return true;
  29925. }
  29926. return false;
  29927. };
  29928. UnfreezeRowHeadingsAction.prototype.updateMenu=function(_1982){
  29929. _1982.visible=this.areRowHeadingsFrozen();
  29930. return _1982;
  29931. };
  29932. function FreezeColumnHeadingsAction(){
  29933. };
  29934. FreezeColumnHeadingsAction.prototype=new UndoableClientActionBase();
  29935. FreezeColumnHeadingsAction.superclass=UndoableClientActionBase.prototype;
  29936. FreezeColumnHeadingsAction.prototype.execute=function(){
  29937. var _1983=this.m_sContainerId?this.m_sContainerId:this.getSelectedCrosstabOrListContainerId();
  29938. if(_1983){
  29939. this.m_oCV.getSelectionController().resetSelections();
  29940. this.m_oCV.getPinFreezeManager().freezeContainerColumnHeadings(_1983);
  29941. this.addClientSideUndo(this,[_1983]);
  29942. }
  29943. };
  29944. FreezeColumnHeadingsAction.prototype.getUndoHint=function(){
  29945. return RV_RES.IDS_JS_FREEZECOLUMNHEADINGS;
  29946. };
  29947. FreezeColumnHeadingsAction.prototype.getUndoClass=function(){
  29948. return "UnfreezeColumnHeadings";
  29949. };
  29950. FreezeColumnHeadingsAction.prototype.getSelectedCrosstabOrListContainerLid=function(){
  29951. var _1984=this.m_oCV.getSelectionController().getAllSelectedObjects();
  29952. if(_1984&&_1984.length&&(_1984[0].getDataContainerType()=="crosstab"||_1984[0].getDataContainerType()=="list")){
  29953. var lid=(_1984[0].getLayoutElementId());
  29954. if(lid){
  29955. return lid;
  29956. }
  29957. }
  29958. return null;
  29959. };
  29960. FreezeColumnHeadingsAction.prototype.getSelectedCrosstabOrListContainerId=function(){
  29961. var lid=this.getSelectedCrosstabOrListContainerLid();
  29962. if(lid){
  29963. return this.removeNamespace(lid);
  29964. }
  29965. return null;
  29966. };
  29967. FreezeColumnHeadingsAction.prototype.canFreezeColumnHeadings=function(){
  29968. var _1987=this.m_oCV.getPinFreezeManager();
  29969. if(_1987){
  29970. var _1988=this.getSelectedCrosstabOrListContainerId();
  29971. if(_1988){
  29972. if(!_1987.hasFrozenColumnHeadings(_1988)&&_1987.getValidSelectedContainerId(true)){
  29973. return true;
  29974. }
  29975. }
  29976. return false;
  29977. }
  29978. };
  29979. FreezeColumnHeadingsAction.prototype.updateMenu=function(_1989){
  29980. _1989.visible=this.canFreezeColumnHeadings();
  29981. return _1989;
  29982. };
  29983. function UnfreezeColumnHeadingsAction(){
  29984. };
  29985. UnfreezeColumnHeadingsAction.prototype=new UndoableClientActionBase();
  29986. UnfreezeColumnHeadingsAction.superclass=UndoableClientActionBase.prototype;
  29987. UnfreezeColumnHeadingsAction.prototype.execute=function(){
  29988. if(this.m_oCV.getPinFreezeManager()){
  29989. var _198a=document.getElementById("CVReport"+this.m_oCV.getId());
  29990. var _198b=this.m_sContainerId?this.m_sContainerId:this.getSelectedContainerId();
  29991. this.m_oCV.getSelectionController().resetSelections();
  29992. this.m_oCV.getPinFreezeManager().unfreezeContainerColumnHeadings(_198b,_198a);
  29993. this.addClientSideUndo(this,[_198b]);
  29994. }
  29995. };
  29996. UnfreezeColumnHeadingsAction.prototype.getUndoHint=function(){
  29997. return RV_RES.IDS_JS_UNFREEZECOLUMNHEADINGS;
  29998. };
  29999. UnfreezeColumnHeadingsAction.prototype.getUndoClass=function(){
  30000. return "FreezeColumnHeadings";
  30001. };
  30002. UnfreezeColumnHeadingsAction.prototype.areColumnHeadingsFrozen=function(){
  30003. if(this.m_oCV.getPinFreezeManager()&&this.m_oCV.getPinFreezeManager().hasFrozenColumnHeadings(this.getSelectedContainerId())){
  30004. return true;
  30005. }
  30006. return false;
  30007. };
  30008. UnfreezeColumnHeadingsAction.prototype.updateMenu=function(_198c){
  30009. _198c.visible=this.areColumnHeadingsFrozen();
  30010. return _198c;
  30011. };
  30012. function GlossaryAction(){
  30013. };
  30014. GlossaryAction.prototype=new CognosViewerAction();
  30015. GlossaryAction.prototype.execute=function(){
  30016. var _198d=this.getCognosViewer();
  30017. _198d.loadExtra();
  30018. var _198e=_198d.getSelectionController();
  30019. var _198f=_198e.getAllSelectedObjects();
  30020. if(_198f.length>0){
  30021. var _1990=null;
  30022. if(typeof MDSRV_CognosConfiguration!="undefined"){
  30023. _1990=new MDSRV_CognosConfiguration();
  30024. var _1991="";
  30025. if(_198d.envParams["glossaryURI"]){
  30026. _1991=_198d.envParams["glossaryURI"];
  30027. }
  30028. _1990.addProperty("glossaryURI",_1991);
  30029. _1990.addProperty("gatewayURI",_198d.getGateway());
  30030. }
  30031. var _1992=_198d.envParams["ui.object"];
  30032. var _1993=getViewerSelectionContext(_198e,new CSelectionContext(_1992));
  30033. var _1994=new MDSRV_BusinessGlossary(_1990,_1993);
  30034. _1994.open();
  30035. }
  30036. };
  30037. GlossaryAction.prototype.updateMenu=function(_1995){
  30038. if(!this.getCognosViewer().bCanUseGlossary){
  30039. return "";
  30040. }
  30041. var _1996=this.selectionHasContext();
  30042. if(!_1996||this.getCognosViewer().envParams["glossaryURI"]==null||this.getCognosViewer().envParams["glossaryURI"]==""){
  30043. _1995.disabled=true;
  30044. }else{
  30045. _1995.disabled=false;
  30046. }
  30047. return _1995;
  30048. };
  30049. function GroupAction(){
  30050. this.m_sAction="GroupColumn";
  30051. };
  30052. GroupAction.prototype=new ModifyReportAction();
  30053. GroupAction.prototype.getUndoHint=function(){
  30054. return RV_RES.IDS_JS_GROUP_UNGROUP;
  30055. };
  30056. GroupAction.prototype.updateMenu=function(_1997){
  30057. _1997.visible=this.ifContainsInteractiveDataContainer();
  30058. if(!_1997.visible){
  30059. return _1997;
  30060. }
  30061. var _1998=this.m_oCV.getSelectionController();
  30062. var _1999=_1998.getAllSelectedObjects();
  30063. if(_1999.length===0||_1998.getDataContainerType()!="list"){
  30064. return this.disableMenuItem(_1997);
  30065. }
  30066. if(_1999[0].getCellRef().getAttribute("no_data_item_column")==="true"){
  30067. return this.disableMenuItem(_1997);
  30068. }
  30069. var _199a=!_1998.isRelational();
  30070. for(var index=0;index<_1999.length;++index){
  30071. if(_1998.getUsageInfo(_1999[index].getSelectedContextIds()[0][0])==_1998.c_usageMeasure&&(_199a||_1999[index].getLayoutType()==="summary")){
  30072. return this.disableMenuItem(_1997);
  30073. }
  30074. }
  30075. _1997.disabled=false;
  30076. _1997.iconClass="group";
  30077. return _1997;
  30078. };
  30079. GroupAction.prototype.disableMenuItem=function(_199c){
  30080. _199c.disabled=true;
  30081. _199c.iconClass="groupDisabled";
  30082. return _199c;
  30083. };
  30084. GroupAction.prototype.addActionContextAdditionalParms=function(){
  30085. return this.addClientContextData(3);
  30086. };
  30087. function LoadMenuAction(){
  30088. this.m_action=null;
  30089. };
  30090. LoadMenuAction.prototype=new CognosViewerAction();
  30091. LoadMenuAction.prototype.FROM_TOOLBAR="toolbar";
  30092. LoadMenuAction.prototype.FROM_TOOLBAR_BLUEDOTMENU="toolbarBlueDotMenu";
  30093. LoadMenuAction.prototype.FROM_CONTEXTMENU="contextMenu";
  30094. LoadMenuAction.prototype.FROM_CONTEXTMENU_MOREACTIONS="contextMenuMoreActions";
  30095. LoadMenuAction.prototype.TOOLBAR_UPDATE_EVENT="com.ibm.bux.widgetchrome.toolbar.update";
  30096. LoadMenuAction.prototype.CONTEXTMENU_UPDATE_EVENT="com.ibm.bux.widget.contextMenu.update";
  30097. LoadMenuAction.prototype.setRequestParms=function(_199d){
  30098. this.m_action=_199d.action;
  30099. this.m_sFrom=(_199d.from)?_199d.from:this.FROM_TOOLBAR;
  30100. };
  30101. LoadMenuAction.prototype.execute=function(){
  30102. var _199e=this.m_oCV.getActionFactory();
  30103. var _199f=_199e.load(this.m_action);
  30104. var _19a0=this.getMenuSpec();
  30105. var _19a1=GUtil.generateCallback(this.buildMenuCallback,[_19a0],this);
  30106. _19a0=_199f.buildMenu(_19a0,_19a1);
  30107. if(_19a0!=null){
  30108. this.buildMenuCallback(_19a0);
  30109. }
  30110. };
  30111. LoadMenuAction.prototype.buildMenuCallback=function(_19a2){
  30112. _19a2.open=true;
  30113. _19a2.action=null;
  30114. this.fireEvent(_19a2);
  30115. };
  30116. LoadMenuAction.prototype.getMenuSpec=function(){
  30117. var oCV=this.m_oCV;
  30118. var sFrom=this.m_sFrom;
  30119. if(!sFrom||!oCV){
  30120. return null;
  30121. }
  30122. var _19a5=null;
  30123. var _19a6=null;
  30124. switch(sFrom){
  30125. case this.FROM_TOOLBAR:
  30126. _19a5=oCV.getToolbar();
  30127. break;
  30128. case this.FROM_TOOLBAR_BLUEDOTMENU:
  30129. _19a5=oCV.findBlueDotMenu();
  30130. break;
  30131. case this.FROM_CONTEXTMENU_MOREACTIONS:
  30132. _19a5=oCV.findToolbarItem("MoreActions",oCV.getContextMenu());
  30133. break;
  30134. }
  30135. if(_19a5){
  30136. _19a6=oCV.findToolbarItem(this.m_action,_19a5);
  30137. }
  30138. if(_19a6){
  30139. _19a6.from=sFrom;
  30140. }
  30141. return _19a6;
  30142. };
  30143. LoadMenuAction.prototype.fireEvent=function(_19a7){
  30144. var _19a8=[];
  30145. if(_19a7){
  30146. _19a8.push(_19a7);
  30147. }
  30148. var _19a9=this.m_oCV.getViewerWidget();
  30149. var sFrom=_19a7.from;
  30150. switch(sFrom){
  30151. case this.FROM_TOOLBAR:
  30152. case this.FROM_TOOLBAR_BLUEDOTMENU:
  30153. _19a9.fireEvent(this.TOOLBAR_UPDATE_EVENT,null,_19a8);
  30154. break;
  30155. case this.FROM_CONTEXTMENU_MOREACTIONS:
  30156. _19a9.fireEvent(this.CONTEXTMENU_UPDATE_EVENT,null,_19a8);
  30157. break;
  30158. }
  30159. };
  30160. function MoveAction(){
  30161. this.m_sAction="Reorder";
  30162. };
  30163. MoveAction.prototype=new DragDropAction();
  30164. MoveAction.prototype.setRequestParms=function(_19ab){
  30165. this.m_order=_19ab.order;
  30166. };
  30167. MoveAction.prototype.canMoveLeftRight=function(_19ac){
  30168. var _19ad=this.m_oCV.getSelectionController();
  30169. if(_19ad&&_19ad.getAllSelectedObjects().length==1){
  30170. var _19ae=_19ad.getAllSelectedObjects()[0].getCellRef();
  30171. if(_19ac=="right"&&_19ae.nextSibling){
  30172. return true;
  30173. }else{
  30174. if(_19ac=="left"&&_19ae.previousSibling){
  30175. return true;
  30176. }
  30177. }
  30178. }
  30179. return false;
  30180. };
  30181. MoveAction.prototype.updateMenu=function(_19af){
  30182. if(!this.canMove()){
  30183. _19af="";
  30184. }else{
  30185. var _19b0=this.m_oCV.getSelectionController();
  30186. if(_19b0&&_19b0.getAllSelectedObjects().length>1){
  30187. _19af.disabled=true;
  30188. _19af.items=null;
  30189. }else{
  30190. _19af.disabled=false;
  30191. _19af.items=[];
  30192. _19af.items.push({disabled:!this.canMoveLeftRight("left"),name:"Move",label:RV_RES.IDS_JS_LEFT,iconClass:"moveLeft",action:{name:"Move",payload:{order:"left"}},items:null});
  30193. _19af.items.push({disabled:!this.canMoveLeftRight("right"),name:"Move",label:RV_RES.IDS_JS_RIGHT,iconClass:"moveRight",action:{name:"Move",payload:{order:"right"}},items:null});
  30194. }
  30195. }
  30196. return _19af;
  30197. };
  30198. MoveAction.prototype.addActionContextAdditionalParms=function(){
  30199. var _19b1=this.getCognosViewer().getSelectionController();
  30200. var _19b2=null;
  30201. if(this.m_order=="right"){
  30202. _19b2=_19b1.getAllSelectedObjects()[0].getCellRef().nextSibling;
  30203. }else{
  30204. _19b2=_19b1.getAllSelectedObjects()[0].getCellRef().previousSibling;
  30205. }
  30206. var _19b3=_19b1.buildSelectionObject(_19b2,null);
  30207. var tag=this.m_order=="right"?"after":"before";
  30208. var _19b5=this.getRAPLayoutTag(_19b2);
  30209. _19b5=(_19b5!=null)?_19b5:_19b3.getColumnName();
  30210. return this.getSelectedCellTags()+"<"+tag+">"+xml_encode(_19b5)+"</"+tag+">";
  30211. };
  30212. function RefreshViewAction(){
  30213. this.m_bCanvasRefreshEvent=false;
  30214. };
  30215. RefreshViewAction.prototype=new CognosViewerAction();
  30216. RefreshViewAction.prototype.addCommonOptions=function(_19b6){
  30217. var _19b7=this.getCognosViewer().getViewerWidget();
  30218. if(this.m_bCanvasRefreshEvent&&_19b7.getSavedOutputSearchPath()!=null){
  30219. _19b6.addFormField("ui.savedOutputSearchPath",encodeURIComponent(_19b7.getSavedOutputSearchPath()));
  30220. }else{
  30221. _19b7.setSavedOutputsCMResponse(null);
  30222. _19b7.setSavedOutputSearchPath(null);
  30223. }
  30224. _19b6.addFormField("run.outputFormat","HTML");
  30225. _19b6.addFormField("widget.reloadToolbar","true");
  30226. _19b7.clearPropertiesDialog();
  30227. var _19b8=document.getElementById("formWarpRequest"+this.getCognosViewer().getId());
  30228. _19b6.addFormField("ui.object",_19b8["reRunObj"].value);
  30229. };
  30230. RefreshViewAction.prototype.execute=function(){
  30231. var _19b9=this.createCognosViewerDispatcherEntry("buxDropReportOnCanvas");
  30232. this.addCommonOptions(_19b9);
  30233. var oCV=this.getCognosViewer();
  30234. var _19bb=oCV.getViewerWidget();
  30235. if(oCV.getCurrentlySelectedTab()&&_19bb.getSavedOutput()){
  30236. oCV.setKeepTabSelected(oCV.getCurrentlySelectedTab());
  30237. }
  30238. this.getCognosViewer().dispatchRequest(_19b9);
  30239. };
  30240. RefreshViewAction.prototype.doAddActionContext=function(){
  30241. return false;
  30242. };
  30243. RefreshViewAction.prototype.updateMenu=function(_19bc){
  30244. _19bc.disabled=false;
  30245. var oCV=this.getCognosViewer();
  30246. if(oCV){
  30247. var _19be=oCV.getViewerWidget();
  30248. if(_19be&&_19be.getSavedOutputSearchPath()!=null){
  30249. _19bc.disabled=true;
  30250. }
  30251. }
  30252. return _19bc;
  30253. };
  30254. function RefreshViewEventAction(){
  30255. this.m_bCanvasRefreshEvent=true;
  30256. };
  30257. RefreshViewEventAction.prototype=new RefreshViewAction();
  30258. function RenameDataItemAction(){
  30259. this.m_sAction="Rename";
  30260. this.m_newLabel="";
  30261. this.m_prevLabel="";
  30262. this.m_containerId="";
  30263. this.m_bUndoAdded=false;
  30264. };
  30265. RenameDataItemAction.prototype=new ModifyReportAction();
  30266. RenameDataItemAction.prototype.getUndoHint=function(){
  30267. return RV_RES.IDS_JS_RENAME;
  30268. };
  30269. RenameDataItemAction.prototype.saveSpecForUndo=function(){
  30270. return true;
  30271. };
  30272. RenameDataItemAction.prototype.getContainerId=function(){
  30273. return this.m_containerId;
  30274. };
  30275. RenameDataItemAction.prototype.addActionContextAdditionalParms=function(){
  30276. var _19bf=this.getSelectedCellTags();
  30277. return (_19bf+"<prevName>"+xml_encode(this.m_prevLabel)+"</prevName>"+"<toName>"+xml_encode(this.m_newLabel)+"</toName>");
  30278. };
  30279. RenameDataItemAction.prototype.onMouseOver=function(evt){
  30280. var _19c1=getCtxNodeFromEvent(evt);
  30281. _19c1.style.cursor=this.canRename()?"text":"default";
  30282. };
  30283. RenameDataItemAction.prototype.onMouseOut=function(evt){
  30284. var _19c3=getCtxNodeFromEvent(evt);
  30285. _19c3.style.cursor="default";
  30286. };
  30287. RenameDataItemAction.prototype.onDoubleClick=function(evt){
  30288. if(this.canRename()){
  30289. var _19c5=getCtxNodeFromEvent(evt);
  30290. this.insertTextArea(_19c5);
  30291. }
  30292. };
  30293. RenameDataItemAction.prototype.canRename=function(){
  30294. if(this.m_oCV.isBlacklisted("RenameFromContextMenu")){
  30295. return false;
  30296. }
  30297. var _19c6=this.m_oCV.getSelectionController();
  30298. var _19c7=_19c6.getAllSelectedObjects().length;
  30299. if(_19c7==1&&!this.m_oCV.isLimitedInteractiveMode()){
  30300. var _19c8=_19c6.getAllSelectedObjects()[0];
  30301. if(_19c8.hasContextInformation()){
  30302. var _19c9=_19c8.getSelectedContextIds()[0][0];
  30303. var _19ca=_19c8.getCellRef();
  30304. return this.checkRenamableConditions(_19c8,_19ca,_19c9,_19c6);
  30305. }
  30306. }
  30307. return false;
  30308. };
  30309. RenameDataItemAction.prototype.checkRenamableConditions=function(_19cb,_19cc,_19cd,_19ce){
  30310. if(_19cb.isHomeCell()){
  30311. return false;
  30312. }
  30313. if(_19cb.getLayoutType()=="columnTitle"&&_19ce.selectionsHaveCalculationMetadata()){
  30314. if(_19cb.getDataContainerType()=="crosstab"&&!_19ce.areSelectionsMeasureOrCalculation()){
  30315. return false;
  30316. }
  30317. return true;
  30318. }
  30319. if(_19cb.getLayoutType()=="columnTitle"&&_19cb.getDataContainerType()=="crosstab"){
  30320. return false;
  30321. }
  30322. if(_19cb.getLayoutType()!="columnTitle"){
  30323. return false;
  30324. }
  30325. if(_19cc.getAttribute("cc")=="true"){
  30326. return false;
  30327. }
  30328. if(_19cc.getAttribute("CTNM")!=null&&_19ce.getMun(_19cd)!=""){
  30329. return false;
  30330. }
  30331. return true;
  30332. };
  30333. RenameDataItemAction.prototype.insertTextArea=function(_19cf){
  30334. var label=document.createElement("label");
  30335. label.style.height="1px";
  30336. label.style.width="1px";
  30337. label.style.overflow="hidden";
  30338. label.style.position="absolute";
  30339. label.style.left="0px";
  30340. label.style.top="-500px";
  30341. label.setAttribute("for","rename"+this.m_oCV.getId());
  30342. label.id="renameLabel"+this.m_oCV.getId();
  30343. label.innerHTML=RV_RES.IDS_JS_RENAME_LABEL;
  30344. var input=document.createElement("input");
  30345. input.id="rename"+this.m_oCV.getId();
  30346. input.name="rename"+this.m_oCV.getId();
  30347. input.type="text";
  30348. input.value=_19cf.childNodes[0].nodeValue;
  30349. input.style.backgroundColor="transparent";
  30350. input.style.borderWidth="0px";
  30351. input.style.padding="0px";
  30352. input.style.margin="0px";
  30353. input.setAttribute("role","textbox");
  30354. input.setAttribute("aria-labelledby","renameLabel"+this.m_oCV.getId());
  30355. var width=_19cf.parentNode.scrollWidth-10;
  30356. var _19d3=_19cf.parentNode.firstChild;
  30357. while(_19d3){
  30358. if(_19d3!=_19cf){
  30359. width-=_19d3.scrollWidth;
  30360. }
  30361. _19d3=_19d3.nextSibling;
  30362. }
  30363. input.style.width=width+"px";
  30364. input.ctxNode=_19cf;
  30365. input.action=this;
  30366. input.originalLabel=_19cf.childNodes[0].nodeValue;
  30367. if(isIE()){
  30368. input.style.fontFamily=_19cf.currentStyle.fontFamily;
  30369. input.style.fontSize=_19cf.currentStyle.fontSize;
  30370. input.style.fontStyle=_19cf.currentStyle.fontStyle;
  30371. input.style.fontVariant=_19cf.currentStyle.fontVariant;
  30372. input.style.fontWeight=_19cf.currentStyle.fontWeight;
  30373. input.attachEvent("onblur",this.onBlur);
  30374. input.attachEvent("onkeydown",this.onKeyDown);
  30375. input.style.overflow="hidden";
  30376. }else{
  30377. input.style.font="inherit";
  30378. input.addEventListener("blur",this.onBlur,false);
  30379. input.addEventListener("keydown",this.onKeyDown,false);
  30380. input.style.overflow="visible";
  30381. }
  30382. _19cf.innerHTML="";
  30383. _19cf.appendChild(label);
  30384. _19cf.appendChild(input);
  30385. input.focus();
  30386. input.select();
  30387. };
  30388. RenameDataItemAction.prototype.onMouseDown=function(evt){
  30389. if(evt){
  30390. try{
  30391. var node=evt.originalTarget?evt.originalTarget:evt.srcElement;
  30392. if(node&&node.getAttribute("id")==="rename"+this.m_oCV.getId()){
  30393. return true;
  30394. }
  30395. }
  30396. catch(ex){
  30397. }
  30398. }
  30399. return false;
  30400. };
  30401. RenameDataItemAction.prototype.onBlur=function(evt){
  30402. var node;
  30403. if(isIE()){
  30404. node=getNodeFromEvent(evt);
  30405. }else{
  30406. node=this;
  30407. }
  30408. var _19d8=node.ctxNode;
  30409. var _19d9=node.action;
  30410. var _19da=node.value!=""?node.value:node.innerHTML;
  30411. _19d9.updateLabel(_19d8,_19da,node.originalLabel);
  30412. };
  30413. RenameDataItemAction.prototype.onKeyDown=function(evt){
  30414. var _19dc="";
  30415. var node=getNodeFromEvent(evt);
  30416. if(evt.keyCode=="13"){
  30417. _19dc=node.value!=""?node.value:node.originalLabel;
  30418. }else{
  30419. if(evt.keyCode=="27"){
  30420. _19dc=node.originalLabel;
  30421. }
  30422. }
  30423. if(_19dc!=""){
  30424. var _19de=node.ctxNode;
  30425. var _19df=node.action;
  30426. _19df.updateLabel(_19de,_19dc,node.originalLabel);
  30427. return stopEventBubble(evt);
  30428. }else{
  30429. return true;
  30430. }
  30431. };
  30432. RenameDataItemAction.prototype.updateLabel=function(_19e0,_19e1,_19e2){
  30433. this.m_newLabel=_19e1;
  30434. this.m_prevLabel=_19e2;
  30435. _19e0.innerHTML="";
  30436. _19e0.appendChild(document.createTextNode(_19e1));
  30437. var _19e3=this.m_oCV.getSelectionController();
  30438. if(_19e3!=null&&_19e1!=_19e2){
  30439. var _19e4=new CSelectionObjectFactory(_19e3);
  30440. this.m_containerId=this.removeNamespace(_19e4.getLayoutElementId(_19e0));
  30441. var _19e5=_19e4.getSelectionObject(_19e0.parentNode);
  30442. _19e3.m_aSelectedObjects[0]=_19e5;
  30443. var _19e6=_19e5.getCellRef().getElementsByTagName("span");
  30444. var span=null;
  30445. if(_19e6){
  30446. for(var i=0;i<_19e6.length;i++){
  30447. span=_19e6[i];
  30448. if(span.getAttribute("ctx")!=null&&span.style.visibility!="hidden"){
  30449. span.focus();
  30450. break;
  30451. }
  30452. }
  30453. }
  30454. this.execute();
  30455. }
  30456. };
  30457. RenameDataItemAction.prototype.buildUrl=function(){
  30458. var _19e9="b_action=cognosViewer&ui.action=modifyReport&cv.responseFormat=xml";
  30459. var _19ea=this.addActionContext();
  30460. _19e9+="&cv.actionContext="+encodeURIComponent(_19ea);
  30461. if(window.gViewerLogger){
  30462. window.gViewerLogger.log("Action context",_19ea,"xml");
  30463. }
  30464. _19e9+="&ui.object="+encodeURIComponent(this.m_oCV.envParams["ui.object"]);
  30465. if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
  30466. _19e9+="&ui.spec="+encodeURIComponent(this.m_oCV.envParams["ui.spec"]);
  30467. }
  30468. if(typeof this.m_oCV.getModelPath()!=""){
  30469. _19e9+="&modelPath="+encodeURIComponent(this.m_oCV.getModelPath());
  30470. }
  30471. return _19e9;
  30472. };
  30473. RenameDataItemAction.prototype.keepRAPCache=function(){
  30474. return false;
  30475. };
  30476. RenameDataItemAction.prototype.reuseQuery=function(){
  30477. return true;
  30478. };
  30479. function RenameFromContextMenuAction(){
  30480. };
  30481. RenameFromContextMenuAction.prototype=new RenameDataItemAction();
  30482. RenameFromContextMenuAction.prototype.canRename=function(_19eb){
  30483. if(!_19eb||_19eb.hasContextInformation()==false){
  30484. return false;
  30485. }
  30486. var _19ec=this.m_oCV.getSelectionController();
  30487. var _19ed=_19eb.getSelectedContextIds()[0][0];
  30488. var _19ee=_19eb.getCellRef();
  30489. return this.checkRenamableConditions(_19eb,_19ee,_19ed,_19ec);
  30490. };
  30491. RenameFromContextMenuAction.prototype.updateMenu=function(_19ef){
  30492. _19ef.visible=this.ifContainsInteractiveDataContainer();
  30493. if(!_19ef.visible){
  30494. return _19ef;
  30495. }
  30496. var _19f0=this.m_oCV.getSelectionController();
  30497. var _19f1=_19f0.getAllSelectedObjects().length;
  30498. if(_19f1!=1){
  30499. for(var _19f2=0;_19f2<_19f1;_19f2++){
  30500. if(!this.canRename(_19f0.getAllSelectedObjects()[_19f2])){
  30501. return "";
  30502. }
  30503. }
  30504. _19ef.disabled=true;
  30505. }else{
  30506. if(!this.canRename(_19f0.getAllSelectedObjects()[0])){
  30507. _19ef="";
  30508. }else{
  30509. _19ef.disabled=false;
  30510. }
  30511. }
  30512. return _19ef;
  30513. };
  30514. RenameFromContextMenuAction.prototype.getSpanFromCellRef=function(_19f3){
  30515. var _19f4=_19f3.getElementsByTagName("span");
  30516. var span=null;
  30517. if(_19f4){
  30518. for(var i=0;i<_19f4.length;i++){
  30519. span=_19f4[i];
  30520. if(span.getAttribute("ctx")!=null&&span.style.visibility!="hidden"){
  30521. break;
  30522. }
  30523. }
  30524. }
  30525. return span;
  30526. };
  30527. RenameFromContextMenuAction.prototype.execute=function(){
  30528. var _19f7=this.m_oCV.getSelectionController().getAllSelectedObjects()[0].getCellRef();
  30529. if(_19f7){
  30530. var span=this.getSpanFromCellRef(_19f7);
  30531. var _19f9=this.m_oCV.getAction("RenameDataItem");
  30532. _19f9.insertTextArea(span);
  30533. }
  30534. };
  30535. function ResetToOriginalAction(){
  30536. };
  30537. ResetToOriginalAction.prototype=new CognosViewerAction();
  30538. ResetToOriginalAction.prototype.updateMenu=function(_19fa){
  30539. var _19fb=this.getCognosViewer().envParams.baseReportAvailable;
  30540. _19fa.disabled=(_19fb==="false")?true:_19fa.disabled;
  30541. return _19fa;
  30542. };
  30543. ResetToOriginalAction.prototype.execute=function(){
  30544. var _19fc=viewer.dialogs.ConfirmationDialog(RV_RES.IDS_JS_RESET_TO_ORIGINAL,RV_RES.IDS_JS_RESET_TO_ORIGINAL_WARNING,RV_RES.IDS_JS_RESET_TO_ORIGINAL_WARNING_DESC,null,this,this.executeAction);
  30545. _19fc.startup();
  30546. _19fc.show();
  30547. };
  30548. ResetToOriginalAction.prototype.executeAction=function(_19fd){
  30549. this.gatherFilterInfoBeforeAction("ResetToOriginal");
  30550. ChangePaletteAction.reset(this.getCognosViewer());
  30551. };
  30552. ResetToOriginalAction.prototype.dispatchRequest=function(_19fe){
  30553. var _19ff=this.getCognosViewer();
  30554. var _1a00=_19ff.getViewerWidget();
  30555. _1a00.reset();
  30556. var _1a01=_1a00.getAttributeValue("originalReport");
  30557. if(!_1a01){
  30558. var _1a02=_1a00.getSavedItem();
  30559. if(_1a00.isSavedReport(_1a01,_1a02)){
  30560. _1a01=_1a02;
  30561. }
  30562. }
  30563. var _1a03=_1a00.getAttributeValue("originalReportPart");
  30564. var _1a04=_19ff.envParams["cv.objectPermissions"];
  30565. var _1a05=_19ff.envParams["bpmRestURI"];
  30566. var _1a06=_19ff.envParams["glossaryURI"];
  30567. var _1a07=_19ff.envParams["metadataInformationURI"];
  30568. var _1a08=_19ff.envParams["ui.routingServerGroup"];
  30569. delete _19ff.envParams;
  30570. _19ff.envParams={};
  30571. _19ff.envParams["ui.object"]=_1a01;
  30572. _19ff.envParams["originalReport"]=_1a01;
  30573. _19ff.envParams["bux"]="true";
  30574. _19ff.envParams["cv.objectPermissions"]=_1a04;
  30575. _19ff.envParams["ui.routingServerGroup"]=_1a08;
  30576. if(_1a05){
  30577. _19ff.envParams["bpmRestURI"]=_1a05;
  30578. }
  30579. if(_1a06){
  30580. _19ff.envParams["glossaryURI"]=_1a06;
  30581. }
  30582. if(_1a07){
  30583. _19ff.envParams["metadataInformationURI"]=_1a07;
  30584. }
  30585. var _1a09=this.createCognosViewerDispatcherEntry("resetToOriginal");
  30586. _1a09.addFormField("run.outputFormat","HTML");
  30587. _1a09.addFormField("widget.reloadToolbar","true");
  30588. _1a09.addFormField("ui.reportDrop","true");
  30589. _19ff.resetbHasPromptFlag();
  30590. _1a09.addFormField("widget.forceGetParameters","true");
  30591. if(_19fe!=""){
  30592. _1a09.addFormField("cv.updateDataFilters",_19fe);
  30593. }
  30594. _1a09.addFormField("run.prompt","false");
  30595. var _1a0a=(_1a03&&_1a03.length>0);
  30596. if(_1a0a){
  30597. _1a09.addFormField("reportpart_id",_1a03);
  30598. }
  30599. _19ff.hideReportInfo();
  30600. _19ff.dispatchRequest(_1a09);
  30601. this.fireModifiedReportEvent();
  30602. };
  30603. ResetToOriginalAction.prototype.doAddActionContext=function(){
  30604. return false;
  30605. };
  30606. ResetToOriginalAction.prototype.canShowMenuInGlobalArea=function(){
  30607. return true;
  30608. };
  30609. ResetToOriginalAction.prototype.isValidMenuItem=function(){
  30610. var _1a0b=this.getCognosViewer();
  30611. var _1a0c=_1a0b.getViewerWidget();
  30612. if(_1a0c.m_isInGlobalArea){
  30613. return (this.isPromptWidget()?true:false);
  30614. }else{
  30615. return (this.isPromptWidget()?false:true);
  30616. }
  30617. };
  30618. function ResizeChartAction(){
  30619. this.m_width=0;
  30620. this.m_height=0;
  30621. this.m_sAction="ChangeDataContainerSize";
  30622. this.m_bRunReport=true;
  30623. this.m_oChart=null;
  30624. };
  30625. ResizeChartAction.prototype=new ModifyReportAction();
  30626. ResizeChartAction.prototype.isUndoable=function(){
  30627. return false;
  30628. };
  30629. ResizeChartAction.superclass=ModifyReportAction.prototype;
  30630. ResizeChartAction.prototype.runReport=function(){
  30631. return this.m_bRunReport;
  30632. };
  30633. ResizeChartAction.prototype.canBeQueued=function(){
  30634. return true;
  30635. };
  30636. ResizeChartAction.prototype.reuseQuery=function(){
  30637. return true;
  30638. };
  30639. ResizeChartAction.PADDING={getWidth:function(){
  30640. return 2;
  30641. },getHeight:function(){
  30642. return 2;
  30643. }};
  30644. ResizeChartAction.prototype.getActionKey=function(){
  30645. return "ResizeChartAction";
  30646. };
  30647. ResizeChartAction.prototype.setRequestParms=function(_1a0d){
  30648. if(_1a0d&&_1a0d.resize){
  30649. this.m_width=parseInt(_1a0d.resize.w,10)-ResizeChartAction.PADDING.getWidth();
  30650. this.m_height=parseInt(_1a0d.resize.h,10)-ResizeChartAction.PADDING.getHeight();
  30651. }
  30652. };
  30653. ResizeChartAction.prototype.execute=function(){
  30654. if(this.m_oCV.m_readyToRespondToResizeEvent!==true){
  30655. return;
  30656. }
  30657. if(this.m_oCV.getPinFreezeManager()){
  30658. this.m_oCV.getPinFreezeManager().resize(this.m_width,this.m_height);
  30659. }
  30660. if(this.isActionApplicable()){
  30661. var _1a0e=this.getLayoutComponents();
  30662. if(_1a0e&&_1a0e.length>0){
  30663. for(var i=0;i<_1a0e.length;++i){
  30664. if(_1a0e[i].nodeName==="IMG"||_1a0e[0].getAttribute("flashChart")!==null){
  30665. this.m_oChart=_1a0e[i];
  30666. break;
  30667. }
  30668. }
  30669. if(this.m_oChart&&this.isNewSizeDifferent()){
  30670. if(_1a0e[0].getAttribute("flashChart")!==null){
  30671. this.m_bRunReport=false;
  30672. this.resizeFlashChart();
  30673. }else{
  30674. this.m_bRunReport=true;
  30675. this.resizeChart();
  30676. }
  30677. }
  30678. }
  30679. }
  30680. };
  30681. ResizeChartAction.prototype.isActionApplicable=function(){
  30682. var _1a10=this.m_oCV.getRAPReportInfo();
  30683. if(_1a10&&_1a10.isSingleContainer()){
  30684. return true;
  30685. }
  30686. return false;
  30687. };
  30688. ResizeChartAction.prototype.resizeFlashChart=function(){
  30689. var size=this.getNewChartSize();
  30690. this.m_oChart.setAttribute("width",size.w+"px");
  30691. this.m_oChart.setAttribute("height",size.h+"px");
  30692. this.resizeChart();
  30693. };
  30694. ResizeChartAction.prototype.resizeChart=function(){
  30695. ResizeChartAction.superclass.execute.call(this);
  30696. };
  30697. ResizeChartAction.prototype.addActionContextAdditionalParms=function(){
  30698. var _1a12="";
  30699. var size=this.getNewChartSize();
  30700. _1a12+="<height>"+size.h+"px</height>";
  30701. _1a12+="<width>"+size.w+"px</width>";
  30702. return _1a12;
  30703. };
  30704. ResizeChartAction.prototype.isNewSizeDifferent=function(){
  30705. var _1a14=(this.m_oChart.getAttribute("flashChart")!==null);
  30706. var _1a15=_1a14?this.m_oChart.getAttribute("width"):this.m_oChart.style.width;
  30707. var _1a16=_1a14?this.m_oChart.getAttribute("height"):this.m_oChart.style.height;
  30708. if(!_1a15||_1a15==""){
  30709. _1a15=this.m_oChart.width;
  30710. _1a16=this.m_oChart.height;
  30711. }
  30712. return parseInt(_1a15,10)!=this.m_width||parseInt(_1a16,10)!=this.m_height;
  30713. };
  30714. ResizeChartAction.prototype.getNewChartSize=function(){
  30715. var _1a17=this.m_oChart;
  30716. var _1a18=0;
  30717. var _1a19=0;
  30718. var _1a1a=0;
  30719. var _1a1b=0;
  30720. var _1a1c=0;
  30721. var _1a1d=0;
  30722. var _1a1e=0;
  30723. var _1a1f=0;
  30724. var _1a20=0;
  30725. var _1a21=0;
  30726. var _1a22=0;
  30727. var _1a23=0;
  30728. require(["dojo/dom-style"],function(_1a24){
  30729. _1a18=_1a24.get(_1a17,"marginLeft");
  30730. _1a19=_1a24.get(_1a17,"marginRight");
  30731. _1a1a=_1a24.get(_1a17,"marginTop");
  30732. _1a1b=_1a24.get(_1a17,"marginBottom");
  30733. _1a1c=_1a24.get(_1a17,"borderLeftWidth");
  30734. _1a1d=_1a24.get(_1a17,"borderRightWidth");
  30735. _1a1e=_1a24.get(_1a17,"borderTopWidth");
  30736. _1a1f=_1a24.get(_1a17,"borderBottomWidth");
  30737. _1a20=_1a24.get(_1a17,"paddingLeft");
  30738. _1a21=_1a24.get(_1a17,"paddingRight");
  30739. _1a22=_1a24.get(_1a17,"paddingTop");
  30740. _1a23=_1a24.get(_1a17,"paddingBottom");
  30741. });
  30742. this.m_width-=_1a1c+_1a1d+_1a18+_1a19+_1a20+_1a21;
  30743. this.m_height-=_1a1e+_1a1f+_1a1a+_1a1b+_1a22+_1a23;
  30744. if(this.m_keepRatio){
  30745. var ratio=parseInt(this.m_oChart.style.width,10)/parseInt(this.m_oChart.style.height,10);
  30746. var _1a26=ratio*this.m_height;
  30747. if(_1a26>this.m_width){
  30748. this.m_height=this.m_width/ratio;
  30749. }
  30750. var _1a27=this.m_width/ratio;
  30751. if(_1a27>this.m_height){
  30752. this.m_width=this.m_height*ratio;
  30753. }
  30754. }
  30755. return {w:this.m_width,h:this.m_height};
  30756. };
  30757. function RetryRequestAction(){
  30758. this.m_lastActionParams=null;
  30759. };
  30760. RetryRequestAction.prototype=new CognosViewerAction();
  30761. RetryRequestAction.prototype.setRequestParms=function(parms){
  30762. this.m_lastActionParams=parms;
  30763. };
  30764. RetryRequestAction.prototype.execute=function(){
  30765. if(this.m_lastActionParams){
  30766. var _1a29=new ViewerDispatcherEntry(this.m_oCV);
  30767. var _1a2a=this.m_lastActionParams.keys();
  30768. for(var index=0;index<_1a2a.length;index++){
  30769. _1a29.addFormField(_1a2a[index],this.m_lastActionParams.get(_1a2a[index]));
  30770. }
  30771. _1a29.addFormField("cv.responseFormat","data");
  30772. _1a29.addFormField("widget.reloadToolbar","true");
  30773. _1a29.addNonEmptyStringFormField("limitedInteractiveMode",this.m_oCV.envParams["limitedInteractiveMode"]);
  30774. this.m_oCV.dispatchRequest(_1a29);
  30775. this.m_oCV.getViewerWidget().setOriginalFormFields(null);
  30776. }
  30777. };
  30778. function RunReportAction(){
  30779. this.m_reuseQuery=false;
  30780. this.m_promptValues=null;
  30781. this.m_sendParameterValues=false;
  30782. this.m_clearCascadeParamsList=null;
  30783. };
  30784. RunReportAction.prototype=new CognosViewerAction();
  30785. RunReportAction.prototype.setRequestParams=function(_1a2c){
  30786. if(!_1a2c){
  30787. return;
  30788. }
  30789. this.m_promptValues=_1a2c.promptValues;
  30790. this.m_clearCascadeParamsList=_1a2c.clearCascadeParamsList;
  30791. };
  30792. RunReportAction.prototype.setSendParameterValues=function(_1a2d){
  30793. this.m_sendParameterValues=_1a2d;
  30794. };
  30795. RunReportAction.prototype.reuseQuery=function(){
  30796. return this.m_reuseQuery;
  30797. };
  30798. RunReportAction.prototype.setReuseQuery=function(value){
  30799. this.m_reuseQuery=value;
  30800. };
  30801. RunReportAction.prototype.getPromptOption=function(){
  30802. return "false";
  30803. };
  30804. RunReportAction.prototype.canBeQueued=function(){
  30805. return false;
  30806. };
  30807. RunReportAction.prototype.getAction=function(_1a2f){
  30808. return _1a2f?"run":"runSpecification";
  30809. };
  30810. RunReportAction.prototype.addAdditionalOptions=function(_1a30){
  30811. this._addCommonOptions(_1a30);
  30812. this._addRunOptionsFromProperties(_1a30);
  30813. this._addClearCascadeParams(_1a30);
  30814. this._addPromptValuesToRequest(_1a30);
  30815. };
  30816. RunReportAction.prototype._addClearCascadeParams=function(oReq){
  30817. if(!this.m_clearCascadeParamsList||this.m_clearCascadeParamsList.length==0){
  30818. return;
  30819. }
  30820. var _1a32=this.m_clearCascadeParamsList.length;
  30821. for(var i=0;i<_1a32;i++){
  30822. oReq.addFormField("c"+this.m_clearCascadeParamsList[i],"1");
  30823. }
  30824. };
  30825. RunReportAction.prototype._addPromptValuesToRequest=function(_1a34){
  30826. if(!this.m_promptValues){
  30827. return;
  30828. }
  30829. _1a34.addFormField("sharedPromptRequest","true");
  30830. for(var _1a35 in this.m_promptValues){
  30831. _1a34.addFormField(_1a35,this.m_promptValues[_1a35]);
  30832. }
  30833. };
  30834. RunReportAction.prototype._addCommonOptions=function(oReq){
  30835. var _1a37=this.getCognosViewer().isLimitedInteractiveMode();
  30836. if(typeof this.m_action==="undefined"){
  30837. this.m_action=this.getAction(_1a37);
  30838. }
  30839. oReq.addFormField("run.prompt",this.getPromptOption());
  30840. oReq.addFormField("ui.action",this.m_action);
  30841. if(_1a37){
  30842. oReq.addFormField("run.xslURL","bux.xsl");
  30843. }
  30844. oReq.addFormField("run.outputFormat","HTML");
  30845. if(this.reuseQuery()===true){
  30846. oReq.addFormField("reuseResults","true");
  30847. }
  30848. };
  30849. RunReportAction.prototype._addRunOptionsFromProperties=function(oReq){
  30850. var _1a39=this.getCognosViewer().getViewerWidget().getProperties();
  30851. if(_1a39.getRowsPerPage()!=null){
  30852. oReq.addFormField("run.verticalElements",_1a39.getRowsPerPage());
  30853. }
  30854. };
  30855. RunReportAction.prototype.execute=function(){
  30856. var oReq=this.createCognosViewerDispatcherEntry(this.m_action);
  30857. oReq.setCanBeQueued(this.canBeQueued());
  30858. if((this.m_action==="forward"||this.m_action==="back")&&(typeof this.m_bAbortAction==="undefined"||this.m_bAbortAction===true)){
  30859. return false;
  30860. }
  30861. var oCV=this.getCognosViewer();
  30862. if(this.m_sendParameterValues&&oCV.envParams["delayedLoadingExecutionParams"]){
  30863. oReq.addFormField("delayedLoadingExecutionParams",oCV.envParams["delayedLoadingExecutionParams"]);
  30864. delete oCV.envParams["delayedLoadingExecutionParams"];
  30865. }
  30866. this.getCognosViewer().dispatchRequest(oReq);
  30867. return true;
  30868. };
  30869. RunReportAction.prototype.doAddActionContext=function(){
  30870. return false;
  30871. };
  30872. RunReportAction.prototype.updateMenu=function(json){
  30873. json.visible=!this.isPromptWidget();
  30874. return json;
  30875. };
  30876. function BuxRunReportAction(){
  30877. BuxRunReportAction.baseConstructor.call();
  30878. };
  30879. BuxRunReportAction.prototype=new RunReportAction();
  30880. BuxRunReportAction.baseConstructor=RunReportAction;
  30881. BuxRunReportAction.prototype.canBeQueued=function(){
  30882. return true;
  30883. };
  30884. BuxRunReportAction.prototype.getAction=function(_1a3d){
  30885. return _1a3d?"runBux":"buxRunSpec";
  30886. };
  30887. function RefreshAction(){
  30888. this.m_sAction="Refresh";
  30889. };
  30890. RefreshAction.prototype=new RunReportAction();
  30891. RefreshAction.superclass=RunReportAction.prototype;
  30892. RefreshAction.prototype.execute=function(){
  30893. RefreshAction.superclass.execute.call(this);
  30894. };
  30895. function GetParametersAction(){
  30896. this.m_payload="";
  30897. this.isPrimaryPromptWidget=false;
  30898. this.m_requestParamsCopy=null;
  30899. };
  30900. GetParametersAction.prototype=new RunReportAction();
  30901. GetParametersAction.prototype.setRequestParms=function(_1a3e){
  30902. this.m_payload=_1a3e;
  30903. };
  30904. GetParametersAction.prototype.addRequestOptions=function(_1a3f){
  30905. _1a3f.addFormField("asynch.alwaysIncludePrimaryRequest","false");
  30906. _1a3f.addFormField("ui.action","getParameters");
  30907. _1a3f.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  30908. _1a3f.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  30909. _1a3f.addFormField("isPrimaryPromptWidget",this.isPrimaryPromptWidget?"true":"false");
  30910. _1a3f.addFormField("parameterValues",this.m_oCV.getExecutionParameters());
  30911. if(this.m_oCV.envParams["bux"]=="true"){
  30912. _1a3f.addFormField("bux","true");
  30913. }
  30914. };
  30915. GetParametersAction.prototype.execute=function(){
  30916. var oCV=this.getCognosViewer();
  30917. var _1a41=new AsynchJSONDispatcherEntry(oCV);
  30918. _1a41.setCallbacks({"complete":{"object":this,"method":this.handleGetParametersResponse}});
  30919. this.addRequestOptions(_1a41);
  30920. if(oCV.getActiveRequest()){
  30921. this.m_requestFormFieldsCopy=oCV.getActiveRequest().getFormFields();
  30922. }
  30923. _1a41.sendRequest();
  30924. };
  30925. GetParametersAction.prototype.handleGetParametersResponse=function(_1a42){
  30926. try{
  30927. var _1a43=_1a42.getResult();
  30928. var _1a44=_1a43.xml;
  30929. var _1a45=this.getCognosViewer();
  30930. var _1a46=_1a45.getViewerWidget();
  30931. if(typeof _1a44!="undefined"&&_1a44!=null){
  30932. var _1a47=xml_decode(_1a44);
  30933. this.m_oCV.envParams["reportPrompts"]=_1a47;
  30934. if(this.isPrimaryPromptWidget){
  30935. this.m_oCV.raisePromptEvent(_1a47,this.m_requestFormFieldsCopy);
  30936. }else{
  30937. _1a46.sharePrompts(this.m_payload);
  30938. }
  30939. }
  30940. if(typeof _1a46!="undefined"){
  30941. _1a46.promptParametersRetrieved=true;
  30942. var _1a48=_1a46.getButtonFromSavedToolbarButtons("Reprompt");
  30943. if(typeof _1a48!="undefined"&&_1a48!=null){
  30944. var _1a49=_1a45.findBlueDotMenu();
  30945. if(_1a45.addedButtonToToolbar(_1a49,_1a48.button,"Refresh",_1a48.position)){
  30946. _1a45.resetbHasPromptFlag();
  30947. _1a46.updateToolbar();
  30948. }
  30949. _1a46.removeFromSavedToolbarButtons("Reprompt");
  30950. }
  30951. }
  30952. }
  30953. catch(e){
  30954. }
  30955. };
  30956. function RepromptAction(){
  30957. this.m_repromptAction=null;
  30958. };
  30959. RepromptAction.prototype=new CognosViewerAction();
  30960. RepromptAction.superclass=CognosViewerAction.prototype;
  30961. RepromptAction.prototype.updateMenu=function(_1a4a){
  30962. var oCV=this.getCognosViewer();
  30963. _1a4a.visible=(!this.isPromptWidget()&&oCV.hasPrompt());
  30964. if(!_1a4a.visible){
  30965. _1a4a.save=true;
  30966. }else{
  30967. delete _1a4a.save;
  30968. }
  30969. return _1a4a;
  30970. };
  30971. RepromptAction.prototype.setRequestParms=function(_1a4c){
  30972. RepromptAction.superclass.setRequestParms(_1a4c);
  30973. if(_1a4c&&_1a4c["preferencesChanged"]){
  30974. this["preferencesChanged"]=_1a4c["preferencesChanged"];
  30975. }
  30976. };
  30977. RepromptAction.prototype.execute=function(){
  30978. var oCV=this.getCognosViewer();
  30979. if(oCV.isLimitedInteractiveMode()){
  30980. this.m_repromptAction=new RepromptRunAction();
  30981. }else{
  30982. this.m_repromptAction=new RepromptRAPAction();
  30983. }
  30984. this.m_repromptAction.setCognosViewer(oCV);
  30985. if(this["preferencesChanged"]){
  30986. this.m_repromptAction.reuseConversation(false);
  30987. }
  30988. this.m_repromptAction.execute();
  30989. };
  30990. function RepromptRAPAction(){
  30991. this.m_sAction="Reprompt";
  30992. };
  30993. RepromptRAPAction.prototype=new ModifyReportAction();
  30994. RepromptRAPAction.prototype.getPromptOption=function(){
  30995. return "true";
  30996. };
  30997. RepromptRAPAction.prototype.isUndoable=function(){
  30998. return false;
  30999. };
  31000. RepromptRAPAction.prototype.reuseQuery=function(){
  31001. return false;
  31002. };
  31003. RepromptRAPAction.prototype.reuseGetParameter=function(){
  31004. return false;
  31005. };
  31006. RepromptRAPAction.prototype.keepFocusOnWidget=function(){
  31007. return false;
  31008. };
  31009. RepromptRAPAction.prototype.preProcess=function(){
  31010. var cv=this.getCognosViewer();
  31011. cv.m_raiseSharePromptEvent=true;
  31012. };
  31013. RepromptRAPAction.prototype.addAdditionalOptions=function(_1a4f){
  31014. _1a4f.addFormField("run.outputFormat","HTML");
  31015. _1a4f.addFormField("bux","true");
  31016. };
  31017. function RepromptRunAction(){
  31018. };
  31019. RepromptRunAction.prototype=new RunReportAction();
  31020. RepromptRunAction.prototype.reuseQuery=function(){
  31021. return false;
  31022. };
  31023. RepromptRunAction.prototype.reuseGetParameter=function(){
  31024. return false;
  31025. };
  31026. RepromptRunAction.prototype.preProcess=function(){
  31027. var cv=this.getCognosViewer();
  31028. cv.m_raiseSharePromptEvent=true;
  31029. };
  31030. RepromptRunAction.prototype.getPromptOption=function(){
  31031. return "true";
  31032. };
  31033. function SelectionAction(){
  31034. };
  31035. SelectionAction.prototype=new CognosViewerAction();
  31036. SelectionAction.prototype.onMouseOver=function(evt){
  31037. if(DragDropAction_isDragging(evt)==false){
  31038. var _1a52=this.getCognosViewer().getSelectionController();
  31039. _1a52.pageHover(evt);
  31040. }
  31041. };
  31042. SelectionAction.prototype.onMouseOut=function(evt){
  31043. if(DragDropAction_isDragging(evt)==false){
  31044. var _1a54=this.getCognosViewer().getSelectionController();
  31045. _1a54.pageHover(evt);
  31046. }
  31047. };
  31048. SelectionAction.prototype.hasPermission=function(){
  31049. var oCV=this.getCognosViewer();
  31050. return !(oCV.isLimitedInteractiveMode()||oCV.envParams["cv.objectPermissions"].indexOf("read")===-1);
  31051. };
  31052. SelectionAction.prototype.executeDrillUpDown=function(evt){
  31053. var oCV=this.getCognosViewer();
  31054. var _1a58=oCV.getViewerWidget();
  31055. if(oCV.isDrillBlackListed()||(_1a58&&_1a58.isSelectionFilterEnabled())){
  31056. return false;
  31057. }
  31058. if(evt.button==0||evt.button==1||evt.keyCode=="13"){
  31059. var _1a59=getCtxNodeFromEvent(evt);
  31060. if(_1a59!=null){
  31061. var _1a5a=this.m_oCV.getSelectionController();
  31062. var _1a5b=_1a59.getAttribute("type")!=null?_1a59:_1a59.parentNode;
  31063. var type=_1a5b.getAttribute("type");
  31064. var _1a5d=_1a59.getAttribute("ctx");
  31065. _1a5d=_1a5d.split("::")[0].split(":")[0];
  31066. if((_1a5b.getAttribute("CTNM")!=null||type=="datavalue")&&_1a5a.getMun(_1a5d)!=""){
  31067. var _1a5e=_1a5a.getAllSelectedObjects();
  31068. for(var index=0;index<_1a5e.length;++index){
  31069. var _1a60=_1a5e[index];
  31070. if(_1a60.getCellRef()==_1a59.parentNode){
  31071. if(_1a5e.length>1){
  31072. _1a5a.clearSelectedObjects();
  31073. _1a5a.addSelectionObject(_1a60);
  31074. }
  31075. var _1a61=this.m_oCV.getActionFactory();
  31076. var _1a62=_1a61.load("DrillUpDown");
  31077. _1a62.updateDrillability(this.m_oCV,_1a59);
  31078. if(_1a62.drillability>0&&this.hasPermission()){
  31079. _1a62.execute();
  31080. return true;
  31081. }
  31082. }
  31083. }
  31084. }
  31085. }
  31086. }
  31087. return false;
  31088. };
  31089. SelectionAction.prototype.executeDrillThrough=function(evt){
  31090. var _1a64=this.getCognosViewer().getViewerWidget();
  31091. if(_1a64&&_1a64.isSelectionFilterEnabled()){
  31092. return;
  31093. }
  31094. var _1a65=this.getCognosViewer().getDrillMgr();
  31095. return _1a65.getDrillThroughParameters("execute",evt);
  31096. };
  31097. SelectionAction.prototype.pageClicked=function(evt){
  31098. var _1a67=false;
  31099. var _1a68=evt.which?evt.which==1:evt.button==1;
  31100. var _1a69=new CognosViewerSort(evt,this.m_oCV);
  31101. var _1a6a,_1a6b=getCrossBrowserNode(evt);
  31102. try{
  31103. _1a6a=(_1a6b&&_1a6b.className)||"";
  31104. }
  31105. catch(ex){
  31106. _1a6a="";
  31107. }
  31108. var oCV=this.getCognosViewer();
  31109. var _1a6d=null;
  31110. if(_1a68&&_1a69.isSort(evt)&&!oCV.isLimitedInteractiveMode()&&!oCV.isBlacklisted("Sort")){
  31111. _1a69.execute();
  31112. }else{
  31113. if(_1a68&&_1a6a.indexOf("expandButton")>-1){
  31114. var nNode=_1a6b;
  31115. if(_1a6a.indexOf("expandButtonCaption")>-1){
  31116. nNode=nNode.parentNode;
  31117. _1a6a=nNode.className;
  31118. }
  31119. _1a6d=getCognosViewerSCObjectRef(this.m_oCV.getId());
  31120. _1a6d.selectSingleDomNode(nNode.parentNode);
  31121. var _1a6f;
  31122. if(_1a6a.indexOf("collapse")===-1){
  31123. _1a6f=new ExpandMemberAction();
  31124. }else{
  31125. _1a6f=new CollapseMemberAction();
  31126. }
  31127. _1a6f.setCognosViewer(oCV);
  31128. _1a6f.execute();
  31129. }else{
  31130. _1a6d=this.m_oCV.getSelectionController();
  31131. if(this.executeDrillUpDown(evt)===false){
  31132. var _1a70=this.m_oCV.getViewerWidget();
  31133. if(_1a70.isSelectionFilterEnabled()){
  31134. if(_1a68||evt.keyCode===13){
  31135. _1a70.preprocessPageClicked(false,evt);
  31136. }else{
  31137. _1a70.preprocessPageClicked(true);
  31138. }
  31139. }
  31140. if(_1a6d.pageClicked(evt)!=false){
  31141. this.m_oCV.getViewerWidget().updateToolbar();
  31142. _1a6d.resetAllowHorizontalDataValueSelection();
  31143. }
  31144. setNodeFocus(evt);
  31145. }
  31146. if(_1a68||evt.keyCode===13){
  31147. _1a67=this.executeDrillThrough(evt);
  31148. }
  31149. if(_1a68&&this.m_oCV.getViewerWidget()&&this.m_oCV.getViewerWidget().onSelectionChange){
  31150. this.m_oCV.getViewerWidget().onSelectionChange();
  31151. }
  31152. }
  31153. }
  31154. return _1a67;
  31155. };
  31156. SelectionAction.prototype.mouseActionInvolvesSelection=function(evt){
  31157. var _1a72=evt.which?evt.which==1:evt.button==1;
  31158. var _1a73=new CognosViewerSort(evt,this.m_oCV);
  31159. if(_1a72&&_1a73.isSort(evt)){
  31160. return false;
  31161. }
  31162. if(this.executeDrillUpDown(evt)!==false){
  31163. return false;
  31164. }
  31165. return true;
  31166. };
  31167. SelectionAction.prototype.onMouseDown=function(evt){
  31168. this.delegateClickToMouseUp=false;
  31169. if(this.mouseActionInvolvesSelection(evt)&&!this.m_oCV.getSelectionController().shouldExecutePageClickedOnMouseDown(evt)){
  31170. this.delegateClickToMouseUp=true;
  31171. return false;
  31172. }
  31173. return this.pageClicked(evt);
  31174. };
  31175. SelectionAction.prototype.onMouseUp=function(evt,_1a76){
  31176. var ret=false;
  31177. if(!_1a76&&this.mouseActionInvolvesSelection(evt)&&this.delegateClickToMouseUp){
  31178. ret=this.pageClicked(evt);
  31179. }
  31180. this.delegateClickToMouseUp=false;
  31181. return ret;
  31182. };
  31183. SelectionAction.prototype.onKeyDown=function(evt){
  31184. this.pageClicked(evt);
  31185. };
  31186. SelectionAction.prototype.onDoubleClick=function(evt){
  31187. var _1a7a=this.m_oCV;
  31188. var _1a7b=_1a7a.getViewerWidget();
  31189. if(_1a7a.isDrillBlackListed()||(_1a7b&&_1a7b.isSelectionFilterEnabled())){
  31190. return;
  31191. }
  31192. if(_1a7a.getStatus()=="complete"){
  31193. var _1a7c=_1a7a.getDrillMgr();
  31194. var _1a7d="DrillDown";
  31195. var _1a7e="DrillDown";
  31196. var _1a7f=false;
  31197. var _1a80=false;
  31198. if(_1a7c!=null){
  31199. if(!this.hasPermission()){
  31200. return true;
  31201. }
  31202. var _1a81=_1a7c.getSelectedObject();
  31203. if(_1a81==null||(_1a81.m_dataContainerType=="list"&&_1a81.m_sLayoutType=="columnTitle")){
  31204. return true;
  31205. }
  31206. var _1a82=_1a81.getDrillOptions();
  31207. if(typeof _1a82=="undefined"||_1a82==null||!_1a82.length){
  31208. return true;
  31209. }
  31210. _1a7f=_1a7c.canDrillDown();
  31211. if(!_1a7f){
  31212. _1a80=_1a7c.canDrillUp();
  31213. if(_1a80){
  31214. _1a7d="DrillUp";
  31215. _1a7e="DrillUp";
  31216. }
  31217. }
  31218. if(_1a7f||_1a80){
  31219. _1a7a.executeAction(_1a7d,_1a7e);
  31220. }
  31221. }else{
  31222. return true;
  31223. }
  31224. }
  31225. };
  31226. function SelectionFilterSwitchAction(){
  31227. this.m_sAction="SelectionFilterSwitch";
  31228. };
  31229. SelectionFilterSwitchAction.prototype=new CognosViewerAction();
  31230. SelectionFilterSwitchAction.prototype.updateMenu=function(_1a83){
  31231. if(this.getCognosViewer().getViewerWidget().isSelectionFilterEnabled()){
  31232. _1a83.disabled=false;
  31233. _1a83.checked=true;
  31234. _1a83.iconClass="selectionFilterEnabled";
  31235. _1a83.label=RV_RES.IDS_JS_SELECTION_FILTER_SWITCH_DISABLE;
  31236. }else{
  31237. _1a83.disabled=false;
  31238. _1a83.checked=false;
  31239. _1a83.iconClass="selectionFilter";
  31240. _1a83.label=RV_RES.IDS_JS_SELECTION_FILTER_SWITCH;
  31241. }
  31242. return _1a83;
  31243. };
  31244. SelectionFilterSwitchAction.prototype.execute=function(){
  31245. var oCV=this.getCognosViewer();
  31246. var _1a85=oCV.getViewerWidget();
  31247. var _1a86=_1a85.isSelectionFilterEnabled();
  31248. if(_1a86){
  31249. if(_1a85.selectionFilterSent()){
  31250. _1a85.clearSelectionFilter();
  31251. }
  31252. }
  31253. _1a85.toggleSelectionFilterSwitch();
  31254. _1a85.updateToolbar();
  31255. _1a85.onContextMenu({});
  31256. if(!_1a86){
  31257. if(_1a85.somethingSelected()){
  31258. _1a85.broadcastSelectionFilter();
  31259. }
  31260. }
  31261. _1a85.updateDrillThroughLinks();
  31262. _1a85.fireEvent("com.ibm.bux.widget.modified",null,{"modified":true});
  31263. };
  31264. function SharePromptAction(){
  31265. this.m_bAbortAction=true;
  31266. };
  31267. SharePromptAction.prototype=new RunReportAction();
  31268. SharePromptAction.prototype.preProcess=function(){
  31269. var cv=this.getCognosViewer();
  31270. cv.disableRaiseSharePromptEvent();
  31271. };
  31272. SharePromptAction.prototype.setRequestParms=function(_1a88){
  31273. this.m_sharePromptParameters=_1a88.parameters;
  31274. this.m_action="forward";
  31275. };
  31276. SharePromptAction.prototype.parsePromptParameters=function(){
  31277. var _1a89=false;
  31278. var _1a8a=this.getReportParameterNodes();
  31279. if(_1a8a){
  31280. var _1a8b=this.m_sharePromptParameters;
  31281. var _1a8c={};
  31282. var _1a8d=[];
  31283. for(var i in _1a8b){
  31284. var _1a8f=_1a8b[i].parmName;
  31285. var _1a90=_1a8b[i].modelItem;
  31286. var sName=null;
  31287. var _1a92=null;
  31288. var _1a93=false;
  31289. var _1a94={};
  31290. for(var j in _1a8a){
  31291. var _1a96=_1a8a[j].getAttribute("parameterName");
  31292. var _1a97=_1a8a[j].getAttribute("modelItem");
  31293. if((typeof _1a96!=="undefined"&&_1a96===_1a8f)||(typeof _1a97!=="undefined"&&_1a90!=="undefined"&&_1a90!==""&&_1a97===_1a90&&!this.arrayContains(_1a8d,_1a97))){
  31294. _1a89=true;
  31295. sName="p_"+_1a96;
  31296. _1a92=this.getSharedPromptValue(_1a8b[i],_1a8a[j]);
  31297. if(_1a96===_1a8f){
  31298. _1a8c[sName]=_1a92;
  31299. _1a8d.push(_1a97);
  31300. _1a93=false;
  31301. break;
  31302. }else{
  31303. _1a94[sName]=_1a92;
  31304. _1a93=true;
  31305. }
  31306. }
  31307. }
  31308. if(_1a93){
  31309. for(var x in _1a94){
  31310. _1a8c[x]=_1a94[x];
  31311. }
  31312. }
  31313. }
  31314. if(_1a89){
  31315. this.m_bAbortAction=false;
  31316. this.m_promptValues=_1a8c;
  31317. }
  31318. }
  31319. return _1a89;
  31320. };
  31321. SharePromptAction.prototype.getSharedPromptValue=function(_1a99,_1a9a){
  31322. var _1a9b=null;
  31323. var _1a9c=_1a99.parmValue;
  31324. var _1a9d=this._isPromptParamMultiValued(_1a99.multivalued,_1a9c);
  31325. var _1a9e=new RegExp(/^<selectChoices><selectOption/);
  31326. if(_1a9d&&_1a9a.getAttribute("multivalued")==null&&_1a9c.match(_1a9e)){
  31327. var _1a9f=new RegExp(/^(<selectChoices><selectOption.*?><)/);
  31328. var _1aa0=_1a9f.exec(_1a9c);
  31329. _1a9b=_1aa0[1]+"/selectChoices>";
  31330. }else{
  31331. _1a9b=_1a9c;
  31332. }
  31333. return _1a9b;
  31334. };
  31335. SharePromptAction.prototype.arrayContains=function(array,value){
  31336. var found=false;
  31337. for(var i=0;i<array.length;i++){
  31338. if(array[i]===value){
  31339. found=true;
  31340. break;
  31341. }
  31342. }
  31343. return found;
  31344. };
  31345. SharePromptAction.prototype.getPromptValues=function(){
  31346. if(!this.m_promptValues){
  31347. this.parsePromptParameters();
  31348. }
  31349. return this.m_promptValues;
  31350. };
  31351. SharePromptAction.prototype._isPromptParamMultiValued=function(_1aa5,_1aa6){
  31352. var _1aa7=false;
  31353. if(_1aa5!="undefined"&&_1aa5){
  31354. _1aa7=true;
  31355. }else{
  31356. var _1aa8=new RegExp(/^<selectChoices><selectOption.*?>\s*<selectOption/);
  31357. if(_1aa6.match(_1aa8)){
  31358. _1aa7=true;
  31359. }
  31360. }
  31361. return _1aa7;
  31362. };
  31363. SharePromptAction.prototype.getReportParameterNodes=function(){
  31364. var cv=this.getCognosViewer();
  31365. var _1aaa=null;
  31366. try{
  31367. if(cv.envParams&&cv.envParams.reportPrompts){
  31368. var _1aab=cv.envParams.reportPrompts;
  31369. var _1aac=XMLBuilderLoadXMLFromString(_1aab);
  31370. if(!(_1aac&&_1aac.childNodes&&_1aac.childNodes.length>0&&_1aac.childNodes[0].nodeName==="parsererror")){
  31371. var _1aad=_1aac.firstChild;
  31372. var _1aae=XMLHelper_FindChildByTagName(_1aad,"reportParameters",true);
  31373. _1aaa=XMLHelper_FindChildrenByTagName(_1aae,"reportParameter",false);
  31374. }
  31375. }
  31376. }
  31377. catch(e){
  31378. }
  31379. return _1aaa;
  31380. };
  31381. SharePromptAction.prototype.executePrompt=function(){
  31382. if(this.getPromptValues()!==null){
  31383. this.execute();
  31384. return true;
  31385. }
  31386. return false;
  31387. };
  31388. function SnapshotsAction(){
  31389. };
  31390. SnapshotsAction.prototype=new CognosViewerAction();
  31391. SnapshotsAction.prototype.updateMenu=function(_1aaf){
  31392. var _1ab0=this.m_oCV.getViewerWidget();
  31393. _1aaf.disabled=(_1ab0.getAttributeValue("reportCreatedInCW")=="true")||(_1ab0.getAttributeValue("fromReportPart")=="true")||(this.m_oCV.envParams["reportpart_id"]&&this.m_oCV.envParams["reportpart_id"].length)>0?true:false;
  31394. _1aaf.visible=!this.isPromptWidget();
  31395. return _1aaf;
  31396. };
  31397. SnapshotsAction.prototype.execute=function(){
  31398. var oCV=this.getCognosViewer();
  31399. var _1ab2=oCV.getViewerWidget();
  31400. if(_1ab2.getSavedOutputsCMResponse()==null){
  31401. this.queryCMForSavedOutputs({"complete":{"object":this,"method":this.handleQueryResponse}});
  31402. }else{
  31403. if(typeof _1ab2.savedOutputMenuUpdated!="undefined"&&_1ab2.savedOutputMenuUpdated==false){
  31404. this.populateMenu(true);
  31405. _1ab2.savedOutputMenuUpdated=true;
  31406. }
  31407. }
  31408. };
  31409. SnapshotsAction.prototype.queryCMForSavedOutputs=function(_1ab3){
  31410. var oCV=this.getCognosViewer();
  31411. var _1ab5=oCV.getViewerWidget();
  31412. var _1ab6="";
  31413. var _1ab7=document.getElementById("formWarpRequest"+oCV.getId());
  31414. if(oCV.envParams["originalReport"]){
  31415. _1ab6=oCV.envParams["originalReport"];
  31416. }else{
  31417. if(_1ab7&&_1ab7["reRunObj"]!=null&&_1ab7["reRunObj"].value.length>0){
  31418. _1ab6=_1ab7["reRunObj"].value;
  31419. }else{
  31420. _1ab6=oCV.envParams["ui.object"];
  31421. }
  31422. }
  31423. _1ab6+="/reportVersion/*[@format='HTML' or @format='XHTML']/..";
  31424. var _1ab8="<CMRequest>"+"<searchPath>"+xml_encode(_1ab6)+"</searchPath>"+"<properties>"+"<property>searchPath</property>"+"<property>creationTime</property>"+"<property>storeID</property>"+"</properties>"+"<sortBy>"+"<sortItem>"+"<property>creationTime</property>"+"<order>descending</order>"+"</sortItem>"+"</sortBy>"+"</CMRequest>";
  31425. var _1ab9=new DataDispatcherEntry(oCV);
  31426. _1ab9.addFormField("ui.action","CMRequest");
  31427. _1ab9.addFormField("cv.responseFormat","CMRequest");
  31428. _1ab9.addFormField("ui.object",_1ab6);
  31429. _1ab9.addFormField("CMRequest",_1ab8);
  31430. _1ab9.setCallbacks(_1ab3);
  31431. oCV.dispatchRequest(_1ab9);
  31432. };
  31433. SnapshotsAction.prototype.setSavedOutputsCMResponse=function(_1aba){
  31434. var oCV=this.getCognosViewer();
  31435. var _1abc=oCV.getViewerWidget();
  31436. var _1abd=XMLBuilderLoadXMLFromString(_1aba.getResult());
  31437. _1abc.setSavedOutputsCMResponse(_1abd);
  31438. };
  31439. SnapshotsAction.prototype.handleQueryResponse=function(_1abe){
  31440. this.setSavedOutputsCMResponse(_1abe);
  31441. this.populateMenu(true);
  31442. };
  31443. SnapshotsAction.prototype.canShowLiveMenuItem=function(){
  31444. var oCV=this.getCognosViewer();
  31445. return (oCV.envParams["cv.responseFormat"]!=="activeReport"&&(oCV.isLimitedInteractiveMode()||(oCV.envParams["cv.objectPermissions"]&&oCV.envParams["cv.objectPermissions"].indexOf("execute")!=-1)));
  31446. };
  31447. SnapshotsAction.prototype.getMenuItemActionClassHandler=function(){
  31448. var oCV=this.getCognosViewer();
  31449. return oCV.envParams["cv.responseFormat"]==="activeReport"?"ViewActiveReport":"ViewSavedOutput";
  31450. };
  31451. SnapshotsAction.prototype.populateMenu=function(bOpen){
  31452. var oCV=this.getCognosViewer();
  31453. var _1ac3=oCV.getViewerWidget();
  31454. var _1ac4=oCV.envParams["ui.action"];
  31455. var _1ac5=_1ac3.savedOutputsCMResponse;
  31456. var root=oCV.findBlueDotMenu();
  31457. root.open=bOpen;
  31458. var _1ac7=oCV.findToolbarItem("Snapshots",root);
  31459. var _1ac8=XMLHelper_FindChildByTagName(_1ac5,"result",true);
  31460. var _1ac9=XMLHelper_FindChildrenByTagName(_1ac8,"item",false);
  31461. var _1aca=[];
  31462. var _1acb=null;
  31463. var _1acc=null;
  31464. var _1acd=null;
  31465. var _1ace;
  31466. if(this.canShowLiveMenuItem()){
  31467. _1ace=(_1ac4!="view"&&_1ac4!="buxView"&&oCV.getStatus()!=="fault");
  31468. _1acd={name:"live",label:RV_RES.IDS_JS_SNAPSHOTS_LIVE,action:_1ace?{}:{name:"RunSavedOutputReport",payload:{}},items:null};
  31469. this.addMenuItemChecked(_1ace,_1acd);
  31470. _1aca.push(_1acd);
  31471. if(_1ac9.length>0){
  31472. _1aca.push({separator:true});
  31473. }
  31474. }
  31475. if(_1ac9.length>0){
  31476. var _1acf=this.getMenuItemActionClassHandler();
  31477. var _1ad0=[];
  31478. for(var _1ad1=0;_1ad1<_1ac9.length;_1ad1++){
  31479. if(_1ad1<5){
  31480. var _1ad2=_1ac9[_1ad1];
  31481. var _1ad3=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad2,"creationTime_localized",true));
  31482. _1ad3=enforceTextDir(_1ad3);
  31483. var _1ad4=XMLHelper_FindChildByTagName(_1ad2,"storeID",true);
  31484. var _1ad5=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad4,"value",true));
  31485. var _1ad6=XMLHelper_FindChildByTagName(_1ad2,"creationTime",true);
  31486. var _1ad7=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad6,"value",true));
  31487. if(_1acb==null){
  31488. _1acb=_1ad7;
  31489. _1acc=_1ad5;
  31490. }
  31491. _1ace=(_1ac4=="view"||_1ac4=="buxView")&&oCV.envParams["creationTime"]==_1ad7&&_1ac3.getSavedOutputSearchPath()!=null;
  31492. _1acd={name:"savedOutput",label:_1ad3,action:_1ace?{}:{name:_1acf,payload:{obj:_1ad5,creationTime:_1ad7,mostRecent:false}},items:null};
  31493. this.addMenuItemChecked(_1ace,_1acd);
  31494. _1ad0.push(_1acd);
  31495. }else{
  31496. _1ad0.push({name:"viewAllSnapshots",label:RV_RES.IDS_JS_VIEW_ALL_SNAPSHOTS,action:{name:"ViewAllSnapshots",payload:{}},items:null});
  31497. break;
  31498. }
  31499. }
  31500. _1ace=false;
  31501. if(_1ac3.getSavedOutputSearchPath()==null&&(_1ac4=="view"||_1ac4=="buxView")){
  31502. _1ace=true;
  31503. }
  31504. _1acd={name:"savedOutput",label:RV_RES.IDS_JS_MOST_RECENT_SNAPSHOT,action:_1ace?{}:{name:_1acf,payload:{obj:_1acc,creationTime:_1acb,mostRecent:true}},items:null};
  31505. this.addMenuItemChecked(_1ace,_1acd);
  31506. _1aca.push(_1acd);
  31507. _1aca.push({separator:true});
  31508. _1aca=_1aca.concat(_1ad0);
  31509. }
  31510. _1ac7.open=bOpen;
  31511. _1ac7.items=_1aca;
  31512. var _1ad8=[];
  31513. _1ad8.push(_1ac7);
  31514. _1ac3.fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1ad8);
  31515. };
  31516. SnapshotsAction.prototype.resetMenu=function(bOpen){
  31517. var oCV=this.getCognosViewer();
  31518. var _1adb=oCV.getViewerWidget();
  31519. var root=oCV.findBlueDotMenu();
  31520. var _1add=oCV.findToolbarItem("Snapshots",root);
  31521. if(_1add){
  31522. _1add.open=false;
  31523. var _1ade=[{name:"loadng",label:RV_RES.GOTO_LOADING,iconClass:"loading"}];
  31524. _1add.items=_1ade;
  31525. var _1adf=[_1add];
  31526. _1adb.fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1adf);
  31527. }
  31528. };
  31529. function SwapRowsAndColumnsAction(){
  31530. this.m_sAction="SwapRowsAndColumns";
  31531. };
  31532. SwapRowsAndColumnsAction.prototype=new ModifyReportAction();
  31533. SwapRowsAndColumnsAction.prototype.getUndoHint=function(){
  31534. return RV_RES.IDS_JS_SWAP_ROWS_AND_COLUMNS;
  31535. };
  31536. SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported={winLossChart:true,progressiveChart:true,list:true};
  31537. SwapRowsAndColumnsAction.prototype.canSwap=function(){
  31538. if(this.reportHasOneObjectOnly()){
  31539. return this.isCurrentObject_singlePart_SupportedChartOrCrosstab();
  31540. }else{
  31541. return this.isSelectedObject_SupportedChartOrCrosstab();
  31542. }
  31543. };
  31544. SwapRowsAndColumnsAction.prototype.reportHasOneObjectOnly=function(){
  31545. var _1ae0=this.m_oCV.getRAPReportInfo();
  31546. if(_1ae0){
  31547. return (_1ae0.getContainerCount()==1);
  31548. }
  31549. return false;
  31550. };
  31551. SwapRowsAndColumnsAction.prototype.isSelectedObject_SupportedChartOrCrosstab=function(){
  31552. var _1ae1=this.getSelectedReportInfo();
  31553. return (_1ae1&&!SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported[_1ae1.displayTypeId]);
  31554. };
  31555. SwapRowsAndColumnsAction.prototype.isCurrentObject_singlePart_SupportedChartOrCrosstab=function(){
  31556. var _1ae2=this.m_oCV.getRAPReportInfo();
  31557. if(_1ae2){
  31558. if(_1ae2.getContainerCount()===1){
  31559. var _1ae3=_1ae2.getContainerFromPos(0).displayTypeId;
  31560. if(_1ae3&&!SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported[_1ae3]){
  31561. return true;
  31562. }
  31563. }
  31564. }
  31565. return false;
  31566. };
  31567. SwapRowsAndColumnsAction.prototype.keepRAPCache=function(){
  31568. return false;
  31569. };
  31570. SwapRowsAndColumnsAction.prototype.updateMenu=function(_1ae4){
  31571. _1ae4.visible=this.ifContainsInteractiveDataContainer();
  31572. if(!_1ae4.visible){
  31573. return _1ae4;
  31574. }
  31575. _1ae4.disabled=!this.canSwap();
  31576. _1ae4.iconClass=_1ae4.disabled?"disabledSwap":"swap";
  31577. return _1ae4;
  31578. };
  31579. function UndoRedoAction(){
  31580. };
  31581. UndoRedoAction.prototype=new CognosViewerAction();
  31582. UndoRedoAction.prototype.dispatchRequest=function(_1ae5,_1ae6){
  31583. var _1ae7=null;
  31584. var _1ae8=null;
  31585. var _1ae9=this.getUndoRedoQueue();
  31586. if(_1ae6=="Undo"){
  31587. _1ae8=_1ae9.moveBack();
  31588. }else{
  31589. _1ae8=_1ae9.moveForward();
  31590. }
  31591. if(_1ae6=="Undo"&&_1ae8&&_1ae8.undoCallback){
  31592. _1ae8.undoCallback();
  31593. this.getCognosViewer().getViewerWidget().updateToolbar();
  31594. }else{
  31595. if(_1ae6=="Redo"&&_1ae8&&_1ae8.redoCallback){
  31596. _1ae8.redoCallback();
  31597. this.getCognosViewer().getViewerWidget().updateToolbar();
  31598. }else{
  31599. var _1aea=this.getCognosViewer().getViewerWidget().getProperties();
  31600. if(_1aea&&_1ae8.widgetProperties){
  31601. _1aea.doUndo(_1ae8.widgetProperties);
  31602. }
  31603. var _1ae7=new ViewerDispatcherEntry(this.getCognosViewer());
  31604. if(typeof _1ae8.spec!="undefined"){
  31605. _1ae7.addFormField("ui.action","undoRedo");
  31606. _1ae7.addFormField("ui.spec",_1ae8.spec);
  31607. _1ae7.addFormField("executionParameters",_1ae8.parameters);
  31608. }else{
  31609. _1ae7.addFormField("ui.action","undoRedo");
  31610. _1ae7.addFormField("ui.conversation",_1ae8.conversation);
  31611. }
  31612. if(typeof _1ae8.hasAVSChart!="undefined"){
  31613. _1ae7.addFormField("hasAVSChart",_1ae8.hasAVSChart);
  31614. }
  31615. if(_1aea&&_1aea.getRowsPerPage()!=null){
  31616. _1ae7.addFormField("run.verticalElements",_1aea.getRowsPerPage());
  31617. }
  31618. if(_1ae5!=""){
  31619. _1ae7.addFormField("cv.updateDataFilters",_1ae5);
  31620. }
  31621. if(typeof _1ae8.infoBar=="string"){
  31622. _1ae7.addFormField("rap.reportInfo",_1ae8.infoBar);
  31623. }else{
  31624. _1ae7.addFormField("rap.reportInfo","{}");
  31625. }
  31626. _1ae7.addFormField("run.prompt","false");
  31627. _1ae7.setCallbacks({"closeErrorDlg":{"object":_1ae9,"method":_1ae9.handleCancel}});
  31628. this.getCognosViewer().dispatchRequest(_1ae7);
  31629. }
  31630. }
  31631. this.fireModifiedReportEvent();
  31632. };
  31633. UndoRedoAction.prototype.execute=function(){
  31634. this.gatherFilterInfoBeforeAction(this.m_sAction);
  31635. };
  31636. function UndoAction(){
  31637. this.m_sAction="Undo";
  31638. };
  31639. UndoAction.prototype=new UndoRedoAction();
  31640. UndoAction.prototype.updateMenu=function(_1aeb){
  31641. _1aeb.visible=this.getCognosViewer().isLimitedInteractiveMode()?true:this.ifContainsInteractiveDataContainer();
  31642. if(!_1aeb.visible){
  31643. return _1aeb;
  31644. }
  31645. if(this.getUndoRedoQueue().getPosition()>0){
  31646. _1aeb.iconClass="undo";
  31647. _1aeb.disabled=false;
  31648. }else{
  31649. _1aeb.iconClass="undoDisabled";
  31650. _1aeb.disabled=true;
  31651. }
  31652. _1aeb.label=this.getUndoRedoQueue().getUndoTooltip();
  31653. return _1aeb;
  31654. };
  31655. function RedoAction(){
  31656. this.m_sAction="Redo";
  31657. };
  31658. RedoAction.prototype=new UndoRedoAction();
  31659. RedoAction.prototype.updateMenu=function(_1aec){
  31660. _1aec.visible=this.getCognosViewer().isLimitedInteractiveMode()?true:this.ifContainsInteractiveDataContainer();
  31661. if(!_1aec.visible){
  31662. return _1aec;
  31663. }
  31664. if(this.getUndoRedoQueue().getPosition()<(this.getUndoRedoQueue().getLength()-1)){
  31665. _1aec.iconClass="redo";
  31666. _1aec.disabled=false;
  31667. }else{
  31668. _1aec.iconClass="redoDisabled";
  31669. _1aec.disabled=true;
  31670. }
  31671. _1aec.label=this.getUndoRedoQueue().getRedoTooltip();
  31672. return _1aec;
  31673. };
  31674. function ViewAllSnapshotsAction(){
  31675. };
  31676. ViewAllSnapshotsAction.prototype=new SnapshotsAction();
  31677. ViewAllSnapshotsAction.prototype.updateMenu=function(_1aed){
  31678. var oCV=this.getCognosViewer();
  31679. var _1aef=oCV.getViewerWidget();
  31680. if(_1aef.m_bNoSavedOutputs==true){
  31681. _1aed.disabled=true;
  31682. }
  31683. return _1aed;
  31684. };
  31685. ViewAllSnapshotsAction.prototype.execute=function(){
  31686. if(!this.getCognosViewer().getViewerWidget().getSavedOutputsCMResponse()){
  31687. this.queryCMForSavedOutputs({"complete":{"object":this,"method":this.handleQueryResponse}});
  31688. }else{
  31689. this.showDialog();
  31690. }
  31691. };
  31692. ViewAllSnapshotsAction.prototype.handleQueryResponse=function(_1af0){
  31693. this.setSavedOutputsCMResponse(_1af0);
  31694. this.showDialog();
  31695. };
  31696. ViewAllSnapshotsAction.prototype.showDialog=function(){
  31697. var oCV=this.getCognosViewer();
  31698. var _1af2=oCV.getViewerWidget();
  31699. var _1af3=_1af2.getSavedOutputsCMResponse();
  31700. var _1af4=null;
  31701. var _1af5=null;
  31702. if(_1af3){
  31703. _1af4=XMLHelper_FindChildByTagName(_1af3,"result",true);
  31704. if(_1af4){
  31705. _1af5=XMLHelper_FindChildrenByTagName(_1af4,"item",false);
  31706. }
  31707. }
  31708. if(!_1af3||!_1af5||_1af5.length==0){
  31709. _1af2.m_bNoSavedOutputs=true;
  31710. var _1af6=new WarningMessageDialog(oCV,RV_RES.IDS_JS_NO_SAVED_OUTPUTS);
  31711. _1af6.renderInlineDialog();
  31712. }else{
  31713. var _1af7=getCognosViewerObjectString(this.m_oCV.getId());
  31714. var _1af8=RV_RES.IDS_JS_SELECT_SNAPSHOT_DIALOG_TITLE;
  31715. var _1af9=RV_RES.IDS_JS_SELECT_SNAPSHOT_DIALOG_DESC;
  31716. var _1afa=this.getCognosViewer().envParams["creationTime"];
  31717. this.selectSnapshotDialog=new viewer.dialogs.SelectSnapshot({sTitle:_1af8,sLabel:_1af9,cmResponse:_1af3,currentSnapshotCreationTime:_1afa,okHandler:function(_1afb,_1afc){
  31718. window[_1af7].executeAction("ViewSavedOutput",{obj:_1afb,creationTime:_1afc});
  31719. },cancelHandler:function(){
  31720. }});
  31721. this.selectSnapshotDialog.startup();
  31722. this.selectSnapshotDialog.show();
  31723. }
  31724. };
  31725. function ViewOriginalLabelAction(){
  31726. };
  31727. ViewOriginalLabelAction.prototype=new CognosViewerAction();
  31728. ViewOriginalLabelAction.prototype.getCellRef=function(){
  31729. return this.m_oCV.getSelectionController().getSelections()[0].getCellRef();
  31730. };
  31731. ViewOriginalLabelAction.prototype.updateMenu=function(_1afd){
  31732. if(this.getNumberOfSelections()==1){
  31733. var _1afe=this.getCellRef();
  31734. if(_1afe.getAttribute("rp_name")){
  31735. var _1aff=[];
  31736. _1aff.push({name:"originalLabel",label:_1afe.getAttribute("rp_name"),iconClass:"",action:null,items:null});
  31737. _1afd.items=_1aff;
  31738. return _1afd;
  31739. }
  31740. }
  31741. return "";
  31742. };
  31743. function ViewSavedOutputAction(){
  31744. this.m_obj="";
  31745. this.creationTime="";
  31746. this.m_mostRecent=false;
  31747. };
  31748. ViewSavedOutputAction.prototype=new CognosViewerAction();
  31749. ViewSavedOutputAction.prototype.addAdditionalRequestParms=function(_1b00){
  31750. };
  31751. ViewSavedOutputAction.prototype.setRequestParms=function(_1b01){
  31752. this.m_obj=_1b01.obj;
  31753. this.creationTime=_1b01.creationTime;
  31754. this.m_mostRecent=_1b01.mostRecent;
  31755. };
  31756. ViewSavedOutputAction.prototype.updateMenu=function(){
  31757. var _1b02=this.getCognosViewer().getAction("Snapshots");
  31758. _1b02.populateMenu(false);
  31759. };
  31760. ViewSavedOutputAction.prototype.execute=function(){
  31761. var _1b03=this.getCognosViewer();
  31762. var _1b04=_1b03.getViewerWidget();
  31763. if(_1b03.getStatus()==="fault"){
  31764. _1b04.clearErrorDlg();
  31765. }
  31766. _1b03.getViewerWidget().setPromptParametersRetrieved(false);
  31767. _1b03.envParams["reportPrompts"]="";
  31768. var _1b05=_1b03.envParams["ui.action"];
  31769. var _1b06=document.getElementById("formWarpRequest"+_1b03.getId());
  31770. if(_1b05=="view"&&_1b06&&_1b06.reRunObj&&_1b06.reRunObj.value){
  31771. _1b03.envParams["ui.reRunObj"]=_1b06["reRunObj"].value;
  31772. }else{
  31773. if(_1b05!="view"){
  31774. _1b03.envParams["ui.reRunObj"]=_1b03.envParams["ui.object"];
  31775. }
  31776. }
  31777. var _1b07="storeID('"+this.m_obj+"')";
  31778. _1b03.envParams["ui.action"]="buxView";
  31779. _1b03.envParams["ui.object"]=_1b03.envParams["ui.reRunObj"];
  31780. _1b03.envParams["creationTime"]=this.creationTime;
  31781. if(this.m_mostRecent===true){
  31782. _1b04.setSavedOutputSearchPath(null);
  31783. }else{
  31784. _1b04.setSavedOutputSearchPath(_1b07);
  31785. }
  31786. this.updateMenu();
  31787. this.getUndoRedoQueue().clearQueue();
  31788. _1b03.getViewerWidget().clearPropertiesDialog();
  31789. if(_1b03.getCurrentlySelectedTab()&&_1b04.getSavedOutput()){
  31790. _1b03.setKeepTabSelected(_1b03.getCurrentlySelectedTab());
  31791. }
  31792. this.dispatchRequest(_1b07);
  31793. this.fireModifiedReportEvent();
  31794. };
  31795. ViewSavedOutputAction.prototype.dispatchRequest=function(_1b08){
  31796. this.m_request=new ViewerDispatcherEntry(this.m_oCV);
  31797. this.m_request.addFormField("ui.action","buxView");
  31798. this.m_request.addFormField("ui.name",this.m_oCV.envParams["ui.name"]);
  31799. this.m_request.addFormField("widget.reloadToolbar","true");
  31800. this.m_request.addFormField("cv.objectPermissions",this.m_oCV.envParams["cv.objectPermissions"]);
  31801. this.m_request.addFormField("ui.savedOutputSearchPath",_1b08);
  31802. this.m_request.setCallbacks({"complete":{"object":this,"method":this.onComplete}});
  31803. this.addAdditionalRequestParms(this.m_request);
  31804. this.m_oCV.dispatchRequest(this.m_request);
  31805. };
  31806. ViewSavedOutputAction.prototype.onComplete=function(_1b09,arg1){
  31807. this.m_oCV.setTracking("");
  31808. this.m_oCV.setConversation("");
  31809. this.m_request.onComplete(_1b09,arg1);
  31810. };
  31811. function WatchNewVersionsAction(){
  31812. this.m_requestParms={subAction:""};
  31813. };
  31814. WatchNewVersionsAction.prototype=new CognosViewerAction();
  31815. WatchNewVersionsAction.prototype.setRequestParms=function(_1b0b){
  31816. this.m_requestParms=_1b0b;
  31817. };
  31818. WatchNewVersionsAction.prototype.execute=function(){
  31819. var _1b0c=this.m_oCV.getSubscriptionManager();
  31820. switch(this.m_requestParms.subAction){
  31821. case "loadMenu":
  31822. this.loadMenu(this.m_requestParms.contextMenu);
  31823. break;
  31824. case "close":
  31825. this.closeMenu();
  31826. break;
  31827. case "DeleteNotification":
  31828. _1b0c.DeleteNotification();
  31829. break;
  31830. case "AddNotification":
  31831. _1b0c.AddNotification();
  31832. break;
  31833. case "NewSubscription":
  31834. _1b0c.NewSubscription();
  31835. break;
  31836. case "ModifySubscription":
  31837. _1b0c.ModifySubscription(this.m_requestParms.subscriptionId);
  31838. break;
  31839. case "DeleteSubscription":
  31840. _1b0c.DeleteSubscription(this.m_requestParms.subscriptionId);
  31841. break;
  31842. }
  31843. };
  31844. WatchNewVersionsAction.prototype.closeMenu=function(){
  31845. var _1b0d=this.m_oCV.findToolbarItem("WatchNewVersions");
  31846. this.resetMenu(_1b0d);
  31847. var _1b0e=getCognosViewerObjectRefAsString(this.m_oCV.getId());
  31848. setTimeout(_1b0e+".getViewerWidget().fireEvent(\"com.ibm.bux.widgetchrome.toolbar.update\", null, ["+_1b0e+".findToolbarItem(\"WatchNewVersions\")]);",1);
  31849. };
  31850. WatchNewVersionsAction.prototype.resetMenu=function(_1b0f){
  31851. _1b0f.open=false;
  31852. _1b0f.action={name:"WatchNewVersions",payload:{subAction:"loadMenu",contextMenu:false}};
  31853. _1b0f.closeAction=null;
  31854. var _1b10=[];
  31855. _1b10.push({name:"loadng",label:RV_RES.GOTO_LOADING,iconClass:"loading"});
  31856. _1b0f.items=_1b10;
  31857. };
  31858. WatchNewVersionsAction.prototype.updateMenu=function(_1b11){
  31859. var items=_1b11.items;
  31860. var _1b13=this.m_oCV.getSubscriptionManager();
  31861. if(!items||items.length===0){
  31862. _1b11.visible=_1b13.CanCreateNewWatchRule();
  31863. _1b11.disabled=!(_1b13.IsValidSelectionForNewRule());
  31864. }else{
  31865. this.resetMenu(_1b11);
  31866. }
  31867. return _1b11;
  31868. };
  31869. WatchNewVersionsAction.prototype.loadMenu=function(_1b14){
  31870. var _1b15=this.m_oCV.getSubscriptionManager();
  31871. var cvId=this.m_oCV.getId();
  31872. var oCV=this.m_oCV;
  31873. var _1b18=new JSONDispatcherEntry(oCV);
  31874. _1b18.addFormField("ui.action","getSubscriptionInfo");
  31875. _1b18.addFormField("cv.responseFormat","subscriptionManager");
  31876. _1b18.addFormField("contextMenu",_1b14==true?"true":"false");
  31877. _1b15.addCommonFormFields(_1b18,"");
  31878. _1b18.setCallbacks({"complete":{"object":this,"method":this.openSubscriptionMenuResponse}});
  31879. oCV.dispatchRequest(_1b18);
  31880. };
  31881. WatchNewVersionsAction.prototype.openSubscriptionMenuResponse=function(_1b19){
  31882. var _1b1a=this.m_oCV.getSubscriptionManager();
  31883. _1b1a.Initialize(_1b19);
  31884. var _1b1b=[];
  31885. _1b1a.ClearSubscriptionMenu();
  31886. var _1b1c=false;
  31887. if(_1b1a.CanGetNotified()){
  31888. if(_1b1a.m_sQueryNotificationResponse=="on"){
  31889. _1b1b.push({name:"DeleteNotification",label:RV_RES.RV_DO_NOT_ALERT_NEW_VERSION,iconClass:"deleteNotification",action:{name:"WatchNewVersions",payload:{subAction:"DeleteNotification"}},items:null});
  31890. _1b1c=true;
  31891. }else{
  31892. if(_1b1a.m_sQueryNotificationResponse=="off"&&_1b1a.m_sEmail!=""){
  31893. _1b1b.push({name:"AddNotification",label:RV_RES.RV_ALERT_NEW_VERSION,iconClass:"addNotification",action:{name:"WatchNewVersions",payload:{subAction:"AddNotification"}},items:null});
  31894. _1b1c=true;
  31895. }
  31896. }
  31897. }
  31898. if(_1b1a.CanCreateNewWatchRule()){
  31899. if(_1b1c){
  31900. _1b1b.push({separator:true});
  31901. }
  31902. var _1b1d={name:"NewSubscription",label:RV_RES.RV_NEW_WATCH_RULE,iconClass:"newSubscription",action:{name:"WatchNewVersions",payload:{subAction:"NewSubscription"}},items:null};
  31903. if(!_1b1a.IsValidSelectionForNewRule()){
  31904. _1b1d.disabled=true;
  31905. }
  31906. _1b1b.push(_1b1d);
  31907. _1b1c=true;
  31908. }
  31909. var _1b1e="";
  31910. if(typeof this.m_oCV.UIBlacklist!="undefined"){
  31911. _1b1e=this.m_oCV.UIBlacklist;
  31912. }
  31913. if(_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES ")==-1){
  31914. if(_1b1a.m_aWatchRules&&_1b1a.m_aWatchRules.length>0){
  31915. if(_1b1c){
  31916. _1b1b.push({separator:true});
  31917. }
  31918. var _1b1f=_1b1a.CanModifyWatchRule();
  31919. for(var sub=0;sub<_1b1a.m_aWatchRules.length;++sub){
  31920. var menu={name:"WatchRule"+sub,label:_1b1a.m_aWatchRules[sub].name,iconClass:"watchRule",action:null,items:[]};
  31921. if(_1b1f&&_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES_MODIFY ")==-1){
  31922. menu.items.push({name:"ModifySubscription"+sub,label:RV_RES.RV_MODIFY_WATCH_RULE,iconClass:"modifySubscription",action:{name:"WatchNewVersions",payload:{subAction:"ModifySubscription",subscriptionId:sub}},items:null});
  31923. }
  31924. if(_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES_DELETE ")==-1){
  31925. menu.items.push({name:"DeleteSubscription"+sub,label:RV_RES.RV_DELETE_WATCH_RULE,iconClass:"deleteSubscription",action:{name:"WatchNewVersions",payload:{subAction:"DeleteSubscription",subscriptionId:sub}},items:null});
  31926. }
  31927. _1b1b.push(menu);
  31928. }
  31929. }
  31930. }
  31931. if(_1b1b.length===0){
  31932. _1b1b.push({name:"NoWatchRules",label:RV_RES.RV_NO_WATCH_RULES,iconClass:"",action:null,items:null,disabled:true});
  31933. }
  31934. var _1b22=this.m_oCV.findToolbarItem("WatchNewVersions");
  31935. if(_1b22){
  31936. _1b22.items=_1b1b;
  31937. _1b22.action=null;
  31938. _1b22.open=true;
  31939. _1b22.closeAction={name:"WatchNewVersions",payload:{subAction:"close"}};
  31940. var _1b23=[];
  31941. _1b23.push(_1b22);
  31942. this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1b23);
  31943. }
  31944. };
  31945. function RunSavedOutputReportAction(){
  31946. };
  31947. RunSavedOutputReportAction.prototype=new CognosViewerAction();
  31948. RunSavedOutputReportAction.prototype.updateMenu=function(_1b24){
  31949. var _1b25=this.m_oCV.envParams["ui.action"];
  31950. var _1b26=(_1b25!="view"&&_1b25!="buxView"&&this.m_oCV.getStatus()!=="fault");
  31951. this.addMenuItemChecked(_1b26,_1b24);
  31952. return _1b24;
  31953. };
  31954. RunSavedOutputReportAction.prototype.dispatchRequest=function(_1b27){
  31955. var _1b28=this.getCognosViewer();
  31956. if(_1b28.envParams["savedReportName"]){
  31957. delete _1b28.envParams["savedReportName"];
  31958. }
  31959. if(_1b28.getStatus()==="fault"){
  31960. var _1b29=this.getCognosViewer().getViewerWidget();
  31961. _1b29.clearErrorDlg();
  31962. }
  31963. var _1b2a=_1b28.envParams["ui.action"];
  31964. var _1b2b=document.getElementById("formWarpRequest"+_1b28.getId());
  31965. if(_1b28.envParams["ui.reRunObj"]){
  31966. _1b28.envParams["ui.object"]=_1b28.envParams["ui.reRunObj"];
  31967. }else{
  31968. if(_1b2a=="view"&&_1b2b&&typeof _1b2b["reRunObj"]!="undefined"&&_1b2b["reRunObj"]!=null&&_1b2b["reRunObj"].value.length>0){
  31969. _1b28.envParams["ui.object"]=_1b2b["reRunObj"].value;
  31970. }
  31971. }
  31972. var oReq=new ViewerDispatcherEntry(_1b28);
  31973. oReq.addFormField("ui.action","bux");
  31974. oReq.addFormField("widget.runFromSavedOutput","true");
  31975. oReq.addFormField("ui.object",_1b28.envParams["ui.object"]);
  31976. oReq.addFormField("run.outputFormat","HTML");
  31977. oReq.addFormField("ui.primaryAction","");
  31978. oReq.addFormField("widget.reloadToolbar","true");
  31979. oReq.addDefinedNonNullFormField("cv.objectPermissions",_1b28.envParams["cv.objectPermissions"]);
  31980. oReq.addDefinedNonNullFormField("run.prompt",_1b28.envParams["promptOnRerun"]);
  31981. oReq.addDefinedNonNullFormField("limitedInteractiveMode",_1b28.envParams["limitedInteractiveMode"]);
  31982. oReq.addDefinedNonNullFormField("widget.globalPromptInfo",_1b28.getViewerWidget().getGlobalPromptsInfo());
  31983. oReq.addDefinedNonNullFormField("baseReportSearchPath",_1b28.envParams["baseReportSearchPath"]);
  31984. oReq.addNonEmptyStringFormField("cv.updateDataFilters",_1b27);
  31985. _1b28.getViewerWidget().clearPropertiesDialog();
  31986. _1b28.preparePromptValues(oReq);
  31987. _1b28.dispatchRequest(oReq);
  31988. this.fireModifiedReportEvent();
  31989. _1b28.envParams["ui.action"]="run";
  31990. };
  31991. RunSavedOutputReportAction.prototype.execute=function(){
  31992. this.gatherFilterInfoBeforeAction("RunSavedOutputReport");
  31993. };
  31994. function InvokeChangeDisplayTypeDialogAction(){
  31995. };
  31996. InvokeChangeDisplayTypeDialogAction.prototype=new CognosViewerAction();
  31997. InvokeChangeDisplayTypeDialogAction.prototype.execute=function(){
  31998. var _1b2d=this.getCognosViewer();
  31999. var _1b2e=this.getSelectedReportInfo();
  32000. if(_1b2e){
  32001. var _1b2f=_1b2d.getViewerWidget();
  32002. var _1b30=false;
  32003. if(_1b2e.suggestedDisplayTypesEnabled==true){
  32004. _1b30=(typeof _1b2e.possibleDisplayTypes=="undefined")||(typeof _1b2e.suggestedDisplayTypes=="undefined")?true:false;
  32005. }else{
  32006. _1b30=(typeof _1b2e.possibleDisplayTypes=="undefined");
  32007. }
  32008. if(_1b30){
  32009. var _1b31=new AsynchJSONDispatcherEntry(this.m_oCV);
  32010. _1b31.setCallbacks({"complete":{"object":this,"method":this.handleResponse}});
  32011. _1b31.setRequestIndicator(_1b2d.getRequestIndicator());
  32012. _1b31.addFormField("ui.action","getInfoFromReportSpec");
  32013. _1b31.addFormField("bux","true");
  32014. _1b31.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
  32015. _1b31.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  32016. _1b31.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  32017. _1b31.addFormField("cv.actionContext",this.addActionContext());
  32018. _1b31.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
  32019. _1b2d.dispatchRequest(_1b31);
  32020. }else{
  32021. _1b2f.invokeDisplayTypeDialog(_1b2e.possibleDisplayTypes,_1b2e.suggestedDisplayTypes);
  32022. }
  32023. }
  32024. };
  32025. InvokeChangeDisplayTypeDialogAction.prototype.handleResponse=function(_1b32){
  32026. var _1b33=this.getCognosViewer();
  32027. var _1b34=_1b33.getViewerWidget();
  32028. var _1b35=_1b32.getResult();
  32029. for(var i in _1b35.containers){
  32030. var _1b37=this.getReportInfo(_1b35.containers[i].container);
  32031. _1b37.possibleDisplayTypes=_1b35.containers[i].possibleDisplayTypes;
  32032. _1b37.suggestedDisplayTypes=_1b35.containers[i].suggestedDisplayTypes;
  32033. }
  32034. var _1b38=this.getSelectedReportInfo();
  32035. _1b34.invokeDisplayTypeDialog(_1b38.possibleDisplayTypes,_1b38.suggestedDisplayTypes);
  32036. };
  32037. InvokeChangeDisplayTypeDialogAction.prototype.addActionContext=function(){
  32038. var _1b39="<getInfoActions>";
  32039. _1b39+="<getInfoAction name=\"GetInfo\">";
  32040. _1b39+="<include><possibleDisplayTypes/></include>";
  32041. _1b39+="<include><suggestedDisplayTypes/></include>";
  32042. _1b39+=this.getDataItemInfoMap();
  32043. _1b39+=this.addClientContextData(3);
  32044. _1b39+="</getInfoAction>";
  32045. _1b39+="</getInfoActions>";
  32046. return _1b39;
  32047. };
  32048. InvokeChangeDisplayTypeDialogAction.prototype.updateMenu=function(_1b3a){
  32049. var _1b3b=this.getCognosViewer().getRAPReportInfo();
  32050. _1b3a.visible=_1b3b.containsInteractiveDataContainer();
  32051. if(!_1b3a.visible){
  32052. return _1b3a;
  32053. }
  32054. var _1b3c=this.getSelectedReportInfo();
  32055. _1b3a.disabled=(_1b3c==null||_1b3c.displayTypeId==null||!this.isInteractiveDataContainer(_1b3c.displayTypeId));
  32056. if(_1b3a.disabled){
  32057. _1b3a.iconClass="chartTypesDisabled";
  32058. return _1b3a;
  32059. }
  32060. _1b3a.iconClass="chartTypes";
  32061. return _1b3a;
  32062. };
  32063. function GotoAction(){
  32064. };
  32065. GotoAction.prototype=new CognosViewerAction();
  32066. GotoAction.prototype.execute=function(){
  32067. var _1b3d=this.m_oCV.getDrillMgr();
  32068. _1b3d.launchGoToPage();
  32069. };
  32070. GotoAction.prototype.updateMenu=function(_1b3e){
  32071. var items=[];
  32072. var _1b40=this.m_oCV.getDrillTargets();
  32073. var _1b41=this.m_oCV.getDrillMgr();
  32074. var _1b42=_1b41.getAuthoredDrillThroughTargets();
  32075. if(_1b42.length>0){
  32076. var _1b43="<AuthoredDrillTargets>";
  32077. for(var _1b44=0;_1b44<_1b42.length;++_1b44){
  32078. _1b43+=eval("\""+_1b42[_1b44]+"\"");
  32079. }
  32080. _1b43+="</AuthoredDrillTargets>";
  32081. var _1b45=this.m_oCV.getAction("AuthoredDrill");
  32082. var _1b46=_1b45.getAuthoredDrillThroughContext(_1b43,_1b40);
  32083. var _1b47=_1b46.childNodes;
  32084. if(_1b47.length>0){
  32085. for(var index=0;index<_1b47.length;++index){
  32086. var _1b49=_1b47[index];
  32087. var _1b4a=this.getTargetReportIconClass(_1b49);
  32088. var _1b4b=_1b49.getAttribute("label");
  32089. items.push({name:"AuthoredDrill",label:_1b4b,iconClass:_1b4a,action:{name:"AuthoredDrill",payload:XMLBuilderSerializeNode(_1b49)},items:null});
  32090. }
  32091. }
  32092. }
  32093. if(items.length>0){
  32094. items.push({separator:true});
  32095. }
  32096. var _1b4c=false;
  32097. if(this.m_oCV.getSelectionController()==null||this.m_oCV.getSelectionController().getModelDrillThroughEnabled()==false){
  32098. _1b4c=true;
  32099. }
  32100. items.push({name:"Goto",disabled:_1b4c,label:RV_RES.RV_MORE,iconClass:"",action:{name:"Goto",payload:""},items:null});
  32101. if(this.m_oCV.isIWidgetMobile()){
  32102. _1b3e.flatten="true";
  32103. }
  32104. _1b3e.items=items;
  32105. return _1b3e;
  32106. };
  32107. GotoAction.prototype.getTargetReportIconClass=function(_1b4d){
  32108. var _1b4e="";
  32109. var _1b4f=_1b4d.getAttribute("method");
  32110. switch(_1b4f){
  32111. case "edit":
  32112. _1b4e="editContent";
  32113. break;
  32114. case "execute":
  32115. _1b4e="runReport";
  32116. break;
  32117. case "view":
  32118. var _1b50=_1b4d.getAttribute("outputFormat");
  32119. switch(_1b50){
  32120. case "HTML":
  32121. case "XHTML":
  32122. case "HTMLFragment":
  32123. _1b4e="html";
  32124. break;
  32125. case "PDF":
  32126. _1b4e="pdf";
  32127. break;
  32128. case "XML":
  32129. _1b4e="xml";
  32130. break;
  32131. case "CSV":
  32132. _1b4e="csv";
  32133. break;
  32134. case "XLS":
  32135. _1b4e="excel2000";
  32136. break;
  32137. case "SingleXLS":
  32138. _1b4e="excelSingleSheet";
  32139. break;
  32140. case "XLWA":
  32141. _1b4e="excel2002";
  32142. break;
  32143. case "spreadsheetML":
  32144. _1b4e="excel2007";
  32145. break;
  32146. case "xlsxData":
  32147. _1b4e="excel2007";
  32148. break;
  32149. }
  32150. break;
  32151. }
  32152. return _1b4e;
  32153. };
  32154. function AnnotationAction(){
  32155. };
  32156. AnnotationAction.prototype=new CognosViewerAction();
  32157. AnnotationAction.prototype.updateMenu=function(_1b51){
  32158. var _1b52=this.m_oCV.getViewerWidget();
  32159. var _1b53=this.m_oCV.aBuxAnnotations;
  32160. var _1b54=[];
  32161. for(var _1b55=0;_1b55<_1b53.length;_1b55++){
  32162. var ann=eval("new "+_1b53[_1b55]+"()");
  32163. ann.setCognosViewer(this.m_oCV);
  32164. if(ann&&ann.isEnabled(_1b51.placeType)){
  32165. var _1b57={};
  32166. _1b57.name=_1b53[_1b55];
  32167. _1b57.label=ann.getMenuItemString(_1b52.getAttributeValue("itemName"));
  32168. _1b57.action={};
  32169. _1b57.action.name=_1b53[_1b55];
  32170. _1b57.action.payload="";
  32171. _1b57.items=null;
  32172. _1b57.iconClass=ann.getMenuItemIconClass();
  32173. _1b54.push(_1b57);
  32174. }
  32175. }
  32176. _1b51.items=_1b54;
  32177. _1b51.disabled=!(_1b51.items&&_1b51.items.length);
  32178. if(_1b51.disabled){
  32179. _1b51.iconClass="disabledAnnotation";
  32180. }else{
  32181. _1b51.iconClass="annotation";
  32182. }
  32183. return _1b51;
  32184. };
  32185. AnnotationAction.prototype.execute=function(){
  32186. var _1b58=this.getCognosViewer();
  32187. var _1b59=_1b58.getSelectionController();
  32188. var _1b5a=_1b59.getSelections();
  32189. if(_1b5a&&_1b5a.length==1){
  32190. var _1b5b=_1b58.getViewerWidget();
  32191. if(_1b5b){
  32192. this.executeAction(_1b58,_1b5b,_1b5a[0]);
  32193. }
  32194. }
  32195. };
  32196. AnnotationAction.prototype.executeAction=function(_1b5c,_1b5d,_1b5e){
  32197. };
  32198. function DeleteWidgetAnnotationAction(){
  32199. };
  32200. DeleteWidgetAnnotationAction.prototype=new AnnotationAction();
  32201. DeleteWidgetAnnotationAction.prototype.execute=function(){
  32202. var _1b5f=this.getCognosViewer();
  32203. var _1b60=_1b5f.getViewerWidget();
  32204. if(_1b60){
  32205. _1b60.getAnnotationHelper().deleteWidgetComment();
  32206. }
  32207. };
  32208. function EditWidgetAnnotationAction(){
  32209. };
  32210. EditWidgetAnnotationAction.prototype=new AnnotationAction();
  32211. EditWidgetAnnotationAction.prototype.execute=function(){
  32212. var _1b61=this.getCognosViewer();
  32213. var _1b62=_1b61.getViewerWidget();
  32214. if(_1b62){
  32215. window.setTimeout(function(){
  32216. _1b62.getAnnotationHelper().editWidgetComment();
  32217. },0);
  32218. }
  32219. };
  32220. function NewWidgetAnnotationAction(){
  32221. };
  32222. NewWidgetAnnotationAction.prototype=new AnnotationAction();
  32223. NewWidgetAnnotationAction.prototype.execute=function(){
  32224. var _1b63=this.getCognosViewer();
  32225. var _1b64=_1b63.getViewerWidget();
  32226. if(_1b64){
  32227. _1b64.getAnnotationHelper().addWidgetComment();
  32228. }
  32229. };
  32230. function DeleteAnnotationAction(){
  32231. };
  32232. DeleteAnnotationAction.prototype=new AnnotationAction();
  32233. DeleteAnnotationAction.prototype.executeAction=function(_1b65,_1b66,_1b67){
  32234. if(_1b65&&_1b66&&_1b67){
  32235. var _1b68=_1b67.getCellRef();
  32236. var ctxId=_1b65.findCtx(_1b68);
  32237. _1b66.getAnnotationHelper().deleteComment(ctxId);
  32238. }
  32239. };
  32240. function EditAnnotationAction(){
  32241. };
  32242. EditAnnotationAction.prototype=new AnnotationAction();
  32243. EditAnnotationAction.prototype.executeAction=function(_1b6a,_1b6b,_1b6c){
  32244. if(_1b6a&&_1b6b&&_1b6c){
  32245. var _1b6d=_1b6c.getCellRef();
  32246. var ctxId=_1b6a.findCtx(_1b6d);
  32247. window.setTimeout(function(){
  32248. _1b6b.getAnnotationHelper().editComment(ctxId);
  32249. },0);
  32250. }
  32251. };
  32252. function NewAnnotationAction(){
  32253. };
  32254. NewAnnotationAction.prototype=new AnnotationAction();
  32255. NewAnnotationAction.prototype.executeAction=function(_1b6f,_1b70,_1b71){
  32256. if(_1b6f&&_1b70&&_1b71){
  32257. var _1b72=_1b71.getCellRef();
  32258. var ctxId=_1b6f.findCtx(_1b72);
  32259. var value=_1b71.getDisplayValues()[0];
  32260. window.setTimeout(function(){
  32261. _1b70.getAnnotationHelper().addComment(ctxId,value);
  32262. },0);
  32263. }
  32264. };
  32265. function ExploreWithAAFAction(){
  32266. };
  32267. ExploreWithAAFAction.prototype=new CognosViewerAction();
  32268. ExploreWithAAFAction.prototype.execute=function(){
  32269. window.open(this.m_oCV.getGateway()+this.m_oCV.envParams.aafBaseURL,"_blank");
  32270. };
  32271. function ViewActiveReportAction(){
  32272. };
  32273. ViewActiveReportAction.prototype=new ViewSavedOutputAction();
  32274. ViewActiveReportAction.prototype.addAdditionalRequestParms=function(_1b75){
  32275. _1b75.addFormField("cv.responseFormat","CMRequest");
  32276. _1b75.setCallbacks({"complete":{"object":this,"method":this.handleQueryResponse}});
  32277. };
  32278. ViewActiveReportAction.prototype.handleQueryResponse=function(_1b76){
  32279. var _1b77=this.m_oCV.getViewerWidget();
  32280. _1b77.showLoading();
  32281. var _1b78=XMLBuilderLoadXMLFromString(_1b76.getResult());
  32282. var _1b79=XMLHelper_FindChildByTagName(_1b78,"storeID",true);
  32283. var _1b7a=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1b79,"value",true));
  32284. var _1b7b=dojo.byId(this.m_oCV.getViewerWidget().getIFrameId());
  32285. _1b7b.src=this.m_oCV.getGateway()+"/output/cm/"+_1b7a+"/";
  32286. };
  32287. function RefreshActiveReportAction(){
  32288. this.m_sAction="RefreshActiveReport";
  32289. };
  32290. RefreshActiveReportAction.prototype=new CognosViewerAction();
  32291. RefreshActiveReportAction.prototype.execute=function(){
  32292. var _1b7c=this.m_oCV.getViewerWidget();
  32293. var _1b7d=dojo.byId(_1b7c.getIFrameId());
  32294. var _1b7e=_1b7d.src;
  32295. _1b7d.src=_1b7e;
  32296. _1b7c.showLoading();
  32297. };
  32298. function ExportAction(){
  32299. this.m_format="";
  32300. this.m_responseFormat="";
  32301. };
  32302. ExportAction.prototype=new CognosViewerAction();
  32303. ExportAction.prototype.getWindowTitle=function(){
  32304. return "";
  32305. };
  32306. ExportAction.prototype.execute=function(){
  32307. if(!this.m_format){
  32308. return false;
  32309. }
  32310. this.initializeForm();
  32311. this.insertGenericFormElements();
  32312. this.insertSpecializedFormElements();
  32313. return this.sendRequest();
  32314. };
  32315. ExportAction.prototype.addFormField=function(sName,_1b80){
  32316. if(console){
  32317. console.log("Required method ExportAction.addFormField not implemented");
  32318. }
  32319. };
  32320. ExportAction.prototype.initializeForm=function(){
  32321. if(console){
  32322. console.log("Required method ExportAction.initializeForm not implemented");
  32323. }
  32324. };
  32325. ExportAction.prototype.sendRequest=function(){
  32326. if(console){
  32327. console.log("Required method ExportAction.sendRequest not implemented");
  32328. }
  32329. };
  32330. ExportAction.prototype.insertGenericFormElements=function(){
  32331. var _1b81="false";
  32332. var _1b82="cognosViewer";
  32333. this.addFormField("b_action",_1b82);
  32334. this.addFormField("cv.toolbar","false");
  32335. this.addFormField("cv.header","false");
  32336. this.addFormField("ui.windowtitleformat","chromeless_window_action_format");
  32337. this.addFormField("ui.name",this.getObjectDisplayName());
  32338. this.addFormField("cv.responseFormat",this.m_responseFormat);
  32339. this.addFormField("ui.reuseWindow","true");
  32340. var _1b83=this.m_oCV.envParams["ui.spec"];
  32341. var _1b84=this.m_oCV.getConversation();
  32342. this.addFormField("ui.action","export");
  32343. this.addFormField("ui.conversation",_1b84);
  32344. this.addFormField("run.prompt",_1b81);
  32345. this.addFormField("asynch.attachmentEncoding","base64");
  32346. this.addFormField("run.outputEncapsulation","URLQueryString");
  32347. this.addFormField("ui.spec",_1b83);
  32348. this.addFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
  32349. if(this.m_oCV.envParams["ui.routingServerGroup"]){
  32350. this.addFormField("ui.routingServerGroup",this.m_oCV.envParams["ui.routingServerGroup"]);
  32351. }
  32352. var _1b85=this.m_oCV.getViewerWidget();
  32353. if(_1b85!=null){
  32354. dojo.when(_1b85.getWidgetStoreID(),dojo.hitch(this,function(_1b86){
  32355. if(typeof _1b86!="undefined"&&_1b86!=null){
  32356. this.addFormField("widgetStoreID",_1b86);
  32357. }
  32358. }));
  32359. var _1b87=_1b85.getAttributeValue("gateway");
  32360. if(_1b87){
  32361. this.addFormField("cv.gateway",_1b87);
  32362. }
  32363. var _1b88=_1b85.getAttributeValue("webcontent");
  32364. if(_1b88){
  32365. this.addFormField("cv.webcontent",_1b88);
  32366. }
  32367. }
  32368. this.addFormField("rap.parametersInfo",CViewerCommon.buildParameterValuesSpec(this.m_oCV));
  32369. };
  32370. ExportAction.prototype.insertSpecializedFormElements=function(_1b89){
  32371. this.addFormField("run.outputFormat",this.m_format);
  32372. this.addFormField("ui.windowtitleaction",this.getWindowTitle());
  32373. };
  32374. ExportAction.prototype.updateMenu=function(json){
  32375. json.visible=!this.isPromptWidget();
  32376. if(this.m_oCV.isIWidgetMobile()){
  32377. json.flatten=true;
  32378. }
  32379. return json;
  32380. };
  32381. function ExportFromIframeAction(){
  32382. this.m_format="";
  32383. this.m_responseFormat="downloadObject";
  32384. };
  32385. ExportFromIframeAction.prototype=new ExportAction();
  32386. ExportFromIframeAction.prototype.initializeForm=function(){
  32387. this.oRequest=new HiddenIframeDispatcherEntry(this.getCognosViewer());
  32388. this.addFormField("cv.detachRelease","true");
  32389. };
  32390. ExportFromIframeAction.prototype.addFormField=function(sName,_1b8c){
  32391. this.oRequest.addFormField(sName,_1b8c);
  32392. };
  32393. ExportFromIframeAction.prototype.sendRequest=function(){
  32394. this.getCognosViewer().dispatchRequest(this.oRequest);
  32395. return true;
  32396. };
  32397. function ExportToCSVAction(){
  32398. this.m_format="CSV";
  32399. };
  32400. ExportToCSVAction.prototype=new ExportFromIframeAction();
  32401. ExportToCSVAction.prototype.getWindowTitle=function(){
  32402. return RV_RES.RV_CSV;
  32403. };
  32404. function ExportToExcel2000Action(){
  32405. this.m_format="XLS";
  32406. };
  32407. ExportToExcel2000Action.prototype=new ExportFromIframeAction();
  32408. ExportToExcel2000Action.prototype.getWindowTitle=function(){
  32409. return RV_RES.RV_EXCEL_2000;
  32410. };
  32411. function ExportToExcel2002Action(){
  32412. this.m_format="XLWA";
  32413. };
  32414. ExportToExcel2002Action.prototype=new ExportFromIframeAction();
  32415. ExportToExcel2002Action.prototype.getWindowTitle=function(){
  32416. return RV_RES.RV_EXCEL_2002;
  32417. };
  32418. function ExportToExcel2007Action(){
  32419. this.m_format="spreadsheetML";
  32420. };
  32421. ExportToExcel2007Action.prototype=new ExportFromIframeAction();
  32422. ExportToExcel2007Action.prototype.getWindowTitle=function(){
  32423. return RV_RES.RV_EXCEL_2007;
  32424. };
  32425. function ExportToExcel2007DataAction(){
  32426. this.m_format="xlsxData";
  32427. };
  32428. ExportToExcel2007DataAction.prototype=new ExportFromIframeAction();
  32429. ExportToExcel2007DataAction.prototype.getWindowTitle=function(){
  32430. return RV_RES.RV_EXCEL_2007_DATA;
  32431. };
  32432. function ExportToExcelSingleSheetAction(){
  32433. this.m_format="singleXLS";
  32434. };
  32435. ExportToExcelSingleSheetAction.prototype=new ExportFromIframeAction();
  32436. ExportToExcelSingleSheetAction.prototype.getWindowTitle=function(){
  32437. return RV_RES.RV_EXCEL_2000SF;
  32438. };
  32439. function ExportToPDFAction(){
  32440. this.m_format="PDF";
  32441. };
  32442. ExportToPDFAction.prototype=new ExportFromIframeAction();
  32443. ExportToPDFAction.prototype.getWindowTitle=function(){
  32444. return RV_RES.RV_PDF;
  32445. };
  32446. function ExportToXMLAction(){
  32447. this.m_format="XML";
  32448. };
  32449. ExportToXMLAction.prototype=new ExportFromIframeAction();
  32450. ExportToXMLAction.prototype.getWindowTitle=function(){
  32451. return RV_RES.RV_XML;
  32452. };
  32453. function PrintAsPDFAction(){
  32454. this.m_format="PDF";
  32455. this.m_responseFormat="page";
  32456. };
  32457. PrintAsPDFAction.prototype=new ExportAction();
  32458. PrintAsPDFAction.prototype.getWindowTitle=function(){
  32459. return RV_RES.IDS_PRINT_AS_PDF;
  32460. };
  32461. PrintAsPDFAction.prototype.initializeForm=function(){
  32462. this.nForm=document.createElement("form");
  32463. this.nForm.setAttribute("method","post");
  32464. var _1b8d=location.protocol+"//"+location.host+this.m_oCV.m_sGateway;
  32465. this.nForm.setAttribute("action",_1b8d);
  32466. };
  32467. PrintAsPDFAction.prototype.sendRequest=function(){
  32468. var _1b8e=this.m_oCV.getId();
  32469. var sName="get"+this.m_format+_1b8e;
  32470. this.nForm.setAttribute("id",sName);
  32471. this.nForm.setAttribute("name",sName);
  32472. this.nForm.setAttribute("target",this.m_format+"Window"+_1b8e);
  32473. document.body.appendChild(this.nForm);
  32474. var _1b90=this.nForm.getAttribute("target");
  32475. window.open("",_1b90,"resizable=yes,menubar=no,directories=no,location=no,status=no,toolbar=no,titlebar=no");
  32476. this.nForm.submit();
  32477. document.body.removeChild(this.nForm);
  32478. this.nForm=null;
  32479. return true;
  32480. };
  32481. PrintAsPDFAction.prototype.addFormField=function(sName,_1b92){
  32482. this.nForm.appendChild(createHiddenFormField(sName,_1b92));
  32483. };
  32484. function ExpandCollapseMemberAction(){
  32485. this.m_sAction="ExpandCollapseMember";
  32486. this.m_sExpandCollapseType=null;
  32487. this.m_RAPReportInfo=null;
  32488. this.m_itemInfo=null;
  32489. this.m_sPreviousDataItem=null;
  32490. };
  32491. ExpandCollapseMemberAction.prototype=new ModifyReportAction();
  32492. ExpandCollapseMemberAction.baseclass=ModifyReportAction.prototype;
  32493. ExpandCollapseMemberAction.prototype._getCanExpand=function(_1b93){
  32494. var _1b94=this._getItemInfo(_1b93);
  32495. return (_1b94&&_1b94.canExpand);
  32496. };
  32497. ExpandCollapseMemberAction.prototype._isExpanded=function(_1b95){
  32498. var sMUN=this._getSelectedMUN(_1b95);
  32499. if(!sMUN){
  32500. return false;
  32501. }
  32502. var _1b97=this._getItemInfo(_1b95);
  32503. return (_1b97&&_1b97.expandedMembers&&_1b97.expandedMembers[sMUN]===true);
  32504. };
  32505. ExpandCollapseMemberAction.prototype._getSelectedMUN=function(_1b98){
  32506. var sMun=null;
  32507. var aMuns=_1b98.getMuns();
  32508. if(aMuns&&aMuns.length>0&&aMuns[0].length>0){
  32509. sMun=aMuns[0][0];
  32510. }
  32511. return sMun;
  32512. };
  32513. ExpandCollapseMemberAction.prototype._getDataItem=function(_1b9b){
  32514. if(!_1b9b){
  32515. return null;
  32516. }
  32517. var _1b9c=null;
  32518. var _1b9d=_1b9b.getDataItems();
  32519. if(_1b9d&&_1b9d.length>0&&_1b9d[0].length>0){
  32520. _1b9c=_1b9d[0][0];
  32521. }
  32522. return _1b9c;
  32523. };
  32524. ExpandCollapseMemberAction.prototype._getItemInfo=function(_1b9e){
  32525. var _1b9f=this._getDataItem(_1b9e);
  32526. if(!_1b9f){
  32527. return null;
  32528. }
  32529. var _1ba0=this.removeNamespace(_1b9e.getLayoutElementId());
  32530. this.m_RAPReportInfo=this.m_oCV.getRAPReportInfo();
  32531. this.m_itemInfo=this.m_RAPReportInfo.getItemInfo(_1ba0,_1b9f);
  32532. this.m_sPreviousDataItem=_1b9f;
  32533. return this.m_itemInfo;
  32534. };
  32535. ExpandCollapseMemberAction.prototype._alwaysCanExpandCollapse=function(_1ba1){
  32536. var _1ba2=this._getItemInfo(_1ba1);
  32537. return (_1ba2&&_1ba2.alwaysCanExpandCollapse);
  32538. };
  32539. ExpandCollapseMemberAction.prototype._canShowMenu=function(_1ba3){
  32540. var _1ba4=this._getFirstSelectedObject(_1ba3);
  32541. return (_1ba4&&this._hasMUN(_1ba4)&&this._isCrosstab(_1ba4)&&this._isOnEdge(_1ba4)&&!_1ba3.areSelectionsMeasureOrCalculation());
  32542. };
  32543. ExpandCollapseMemberAction.prototype._getCtxId=function(_1ba5){
  32544. var _1ba6=_1ba5.getCellRef();
  32545. if(_1ba6&&_1ba6.getAttribute){
  32546. var _1ba7=_1ba6.getAttribute("ctx");
  32547. if(_1ba7){
  32548. _1ba7=_1ba7.split("::")[0].split(":")[0];
  32549. return _1ba7;
  32550. }
  32551. }
  32552. return "";
  32553. };
  32554. ExpandCollapseMemberAction.prototype._hasMUN=function(_1ba8){
  32555. var aMuns=_1ba8.getMuns();
  32556. return aMuns.length>0?true:false;
  32557. };
  32558. ExpandCollapseMemberAction.prototype._isCrosstab=function(_1baa){
  32559. return _1baa.getDataContainerType()==="crosstab"?true:false;
  32560. };
  32561. ExpandCollapseMemberAction.prototype._isOnEdge=function(_1bab){
  32562. return _1bab.getLayoutType()==="columnTitle"?true:false;
  32563. };
  32564. ExpandCollapseMemberAction.prototype.keepRAPCache=function(){
  32565. return false;
  32566. };
  32567. ExpandCollapseMemberAction.prototype.updateMenu=function(_1bac){
  32568. var _1bad=this.m_oCV.getSelectionController();
  32569. _1bac.visible=this._canShowMenu(_1bad);
  32570. if(!_1bac.visible){
  32571. return _1bac;
  32572. }
  32573. _1bac.disabled=!this._canEnableMenu(_1bad);
  32574. return _1bac;
  32575. };
  32576. ExpandCollapseMemberAction.prototype._canEnableMenu=function(_1bae){
  32577. return true;
  32578. };
  32579. ExpandCollapseMemberAction.prototype._getFirstSelectedObject=function(_1baf){
  32580. var _1bb0=_1baf.getAllSelectedObjects();
  32581. if(_1bb0.length>0){
  32582. return _1bb0[0];
  32583. }
  32584. return null;
  32585. };
  32586. ExpandCollapseMemberAction.prototype._isSingleSelection=function(_1bb1){
  32587. var _1bb2=_1bb1.getAllSelectedObjects();
  32588. return (_1bb2.length===1);
  32589. };
  32590. ExpandCollapseMemberAction.prototype.addActionContextAdditionalParms=function(){
  32591. var _1bb3=this.getCognosViewer().getSelectionController();
  32592. var _1bb4=this._getFirstSelectedObject(_1bb3);
  32593. var sPUN=_1bb3.getPun(this._getCtxId(_1bb4));
  32594. if(sPUN){
  32595. sPUN="<PUN>"+sXmlEncode(sPUN)+"</PUN>";
  32596. }
  32597. var sType="";
  32598. if(this.m_sExpandCollapseType){
  32599. sType="<ExpandCollapseType>"+this.m_sExpandCollapseType+"</ExpandCollapseType>";
  32600. }
  32601. return this.getSelectedCellTags()+sPUN+sType;
  32602. };
  32603. function ExpandMemberAction(){
  32604. this.m_sAction="ExpandCollapseMember";
  32605. this.m_sExpandCollapseType="ExpandMember";
  32606. };
  32607. ExpandMemberAction.prototype=new ExpandCollapseMemberAction();
  32608. ExpandMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
  32609. ExpandMemberAction.prototype.getUndoHint=function(){
  32610. return RV_RES.IDS_JS_EXPAND_MEMBER;
  32611. };
  32612. ExpandMemberAction.prototype._canEnableMenu=function(_1bb7){
  32613. if(!this._isSingleSelection(_1bb7)){
  32614. return false;
  32615. }
  32616. var _1bb8=this._getFirstSelectedObject(_1bb7);
  32617. if(this._alwaysCanExpandCollapse(_1bb8)){
  32618. return true;
  32619. }
  32620. var ctxId=this._getCtxId(_1bb8);
  32621. var _1bba=true;
  32622. if(_1bb7.getDrillUpDownEnabled()===true){
  32623. _1bba=_1bb7.canDrillDown(ctxId);
  32624. }
  32625. return (_1bba&&this._getCanExpand(_1bb8)&&!this._isExpanded(_1bb8));
  32626. };
  32627. function CollapseMemberAction(){
  32628. this.m_sAction="ExpandCollapseMember";
  32629. this.m_sExpandCollapseType="CollapseMember";
  32630. };
  32631. CollapseMemberAction.prototype=new ExpandCollapseMemberAction();
  32632. CollapseMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
  32633. CollapseMemberAction.prototype.getUndoHint=function(){
  32634. return RV_RES.IDS_JS_COLLAPSE_MEMBER;
  32635. };
  32636. CollapseMemberAction.prototype._canDisableMenu=function(_1bbb){
  32637. if(this._isSingleSelection(_1bbb)&&!this._isExpanded()){
  32638. return true;
  32639. }
  32640. return false;
  32641. };
  32642. CollapseMemberAction.prototype._canEnableMenu=function(_1bbc){
  32643. var _1bbd=this._getFirstSelectedObject(_1bbc);
  32644. if(this._alwaysCanExpandCollapse(_1bbd)){
  32645. return true;
  32646. }
  32647. return (this._isSingleSelection(_1bbc)&&this._isExpanded(_1bbd));
  32648. };
  32649. function OpenReportFromClipboardAction(){
  32650. this.m_action="bux";
  32651. this.m_cv=this.getCognosViewer();
  32652. };
  32653. OpenReportFromClipboardAction.prototype=new CognosViewerAction();
  32654. OpenReportFromClipboardAction.prototype.reuseQuery=function(){
  32655. return false;
  32656. };
  32657. OpenReportFromClipboardAction.prototype.reuseGetParameter=function(){
  32658. return false;
  32659. };
  32660. OpenReportFromClipboardAction.prototype.keepRAPCache=function(){
  32661. return false;
  32662. };
  32663. OpenReportFromClipboardAction.prototype.reuseConversation=function(){
  32664. return false;
  32665. };
  32666. OpenReportFromClipboardAction.prototype.runReport=function(){
  32667. return true;
  32668. };
  32669. OpenReportFromClipboardAction.prototype.isUndoable=function(){
  32670. return true;
  32671. };
  32672. OpenReportFromClipboardAction.prototype.execute=function(){
  32673. if(window.clipboardData){
  32674. this.openReportForIE();
  32675. }else{
  32676. this.openReportForNonIE();
  32677. }
  32678. };
  32679. OpenReportFromClipboardAction.prototype.openReportForNonIE=function(){
  32680. var _1bbe=this;
  32681. var _1bbf=new viewer.dialogs.ClipboardDialog({sTitle:RV_RES.IDS_JS_CLIPBOARD,okHandler:function(_1bc0){
  32682. _1bbe.executeAction(_1bc0);
  32683. },cancelHandler:function(){
  32684. }});
  32685. _1bbf.startup();
  32686. window.setTimeout(function(){
  32687. _1bbf.show();
  32688. },0);
  32689. };
  32690. OpenReportFromClipboardAction.prototype.openReportForIE=function(){
  32691. var _1bc1=window.clipboardData.getData("Text");
  32692. this.executeAction(_1bc1);
  32693. };
  32694. OpenReportFromClipboardAction.prototype.getDeleteEnvParamsList=function(){
  32695. var _1bc2=["modelPath","packageBase","rapReportInfo","rap.state"];
  32696. return _1bc2;
  32697. };
  32698. OpenReportFromClipboardAction.prototype.deleteEnvParams=function(){
  32699. var _1bc3=this.m_cv.envParams;
  32700. var _1bc4=this.getDeleteEnvParamsList();
  32701. for(var index in _1bc4){
  32702. if(_1bc3[_1bc4[index]]){
  32703. delete _1bc3[_1bc4[index]];
  32704. }
  32705. }
  32706. };
  32707. OpenReportFromClipboardAction.prototype.cleanUpCognosViewer=function(){
  32708. this.m_cv.setExecutionParameters("");
  32709. this.m_cv.setConversation("");
  32710. this.deleteEnvParams();
  32711. };
  32712. OpenReportFromClipboardAction.prototype.getRequestParams=function(){
  32713. var _1bc6={"run.outputFormat":"HTML","cv.id":this.m_cv.getId(),"widget.reloadToolbar":"true","openReportFromClipboard":"true","ui.reportDrop":"true"};
  32714. var _1bc7=this.m_cv.getViewerWidget().getGlobalPromptsInfo();
  32715. if(_1bc7!=null){
  32716. _1bc6["widget.globalPromptInfo"]=_1bc7;
  32717. }
  32718. if(this.m_filters!=""){
  32719. _1bc6["cv.updateDataFilters"]=this.m_filters;
  32720. }
  32721. var _1bc8=["cv.objectPermissions","limitedInteractiveMode"];
  32722. for(var index in _1bc8){
  32723. var _1bca=_1bc8[index];
  32724. var _1bcb=this.m_cv.envParams[_1bca];
  32725. if(_1bcb){
  32726. _1bc6[_1bca]=_1bcb;
  32727. }
  32728. }
  32729. return _1bc6;
  32730. };
  32731. OpenReportFromClipboardAction.prototype.addAdditionalOptions=function(_1bcc){
  32732. var _1bcd=this.getRequestParams();
  32733. for(var index in _1bcd){
  32734. _1bcc.addFormField(index,_1bcd[index]);
  32735. }
  32736. };
  32737. OpenReportFromClipboardAction.prototype.executeAction=function(_1bcf){
  32738. this.m_cv=this.getCognosViewer();
  32739. this.m_cv.envParams["ui.spec"]=_1bcf;
  32740. this.gatherFilterInfoBeforeAction("OpenReportFromClipboard");
  32741. ChangePaletteAction.reset(this.getCognosViewer());
  32742. };
  32743. OpenReportFromClipboardAction.prototype.dispatchRequest=function(_1bd0){
  32744. this.m_cv=this.getCognosViewer();
  32745. var _1bd1=this.m_cv.getViewerWidget();
  32746. _1bd1.reset();
  32747. this.m_filters=_1bd0;
  32748. this.cleanUpCognosViewer();
  32749. var _1bd2=this.createCognosViewerDispatcherEntry(this.m_action);
  32750. this.m_cv.hideReportInfo();
  32751. this.m_cv.dispatchRequest(_1bd2);
  32752. this.fireModifiedReportEvent();
  32753. };
  32754. OpenReportFromClipboardAction.prototype.doAddActionContext=function(){
  32755. return false;
  32756. };
  32757. OpenReportFromClipboardAction.prototype.updateMenu=function(json){
  32758. json.visible=(window.cognosViewerDebug===true);
  32759. return json;
  32760. };
  32761. function SaveAsReportAction(){
  32762. _progressDisplay=null;
  32763. };
  32764. SaveAsReportAction.prototype=new CognosViewerAction();
  32765. SaveAsReportAction.prototype.onSaveCallback=function(){
  32766. if(!this._progressDisplay){
  32767. dojo["require"]("bux.dialogs.InformationDialog");
  32768. this._progressDisplay=new bux.dialogs.Working(BUXMSG.CPN.IDS_CPN_SAVING);
  32769. this._progressDisplay.startup();
  32770. this._progressDisplay.show();
  32771. }
  32772. };
  32773. SaveAsReportAction.prototype.afterSaveCallback=function(){
  32774. if(this._progressDisplay){
  32775. this._progressDisplay.destroy();
  32776. this._progressDisplay=null;
  32777. }
  32778. };
  32779. SaveAsReportAction.prototype.execute=function(){
  32780. this.getCognosViewer().executeAction("RemoveAllDataFilter",{callback:{method:this.doSaveAs,object:this}});
  32781. };
  32782. SaveAsReportAction.prototype.updateMenu=function(_1bd4){
  32783. _1bd4.visible=this.hasEnvUISpec();
  32784. return _1bd4;
  32785. };
  32786. SaveAsReportAction.prototype.hasEnvUISpec=function(){
  32787. if(this.m_oCV){
  32788. var sSpec=this.m_oCV.envParams["ui.spec"];
  32789. return (sSpec&&sSpec.length>0);
  32790. }
  32791. return false;
  32792. };
  32793. SaveAsReportAction.prototype.doSaveAs=function(_1bd6){
  32794. dojo["require"]("bux.dialogs.FileDialog");
  32795. dojo["require"]("bux.iwidget.canvas.ReportIOHandler");
  32796. this.m_cv=this.getCognosViewer();
  32797. var _1bd7=_1bd6;
  32798. var _1bd8=this.m_cv.envParams["ui.objectClass"];
  32799. var _1bd9=this.onSaveCallback;
  32800. var _1bda=this.afterSaveCallback;
  32801. var _1bdb={filter:"content-report",title:RV_RES.IDS_JS_SAVE_AS_FDG_TITLE,sMainActionButtonLabel:RV_RES.IDS_JS_OK,"class":"bux-fileDialog"};
  32802. var _1bdc=new bux.iwidget.canvas.ReportIOHandler(_1bd7,_1bd8,_1bd9,_1bda,_1bdb);
  32803. _1bdc._doSaveAs();
  32804. };
  32805. function BusinessProcessAction(){
  32806. };
  32807. BusinessProcessAction.prototype=new CognosViewerAction();
  32808. BusinessProcessAction.prototype.updateMenu=function(_1bdd){
  32809. var _1bde=this.getCognosViewer().envParams["bpmRestURI"];
  32810. _1bdd.visible=(_1bde?true:false);
  32811. if(_1bdd.visible){
  32812. _1bdd.disabled=!this._hasAnyContextInSelectedObjects();
  32813. }
  32814. return _1bdd;
  32815. };
  32816. BusinessProcessAction.prototype._initBPMGateway=function(){
  32817. var _1bdf=this.getCognosViewer();
  32818. this.m_BPMGateway=_1bdf.envParams["bpmRestURI"];
  32819. var _1be0=this.m_BPMGateway.length;
  32820. if(this.m_BPMGateway[_1be0-1]!=="/"){
  32821. this.m_BPMGateway+="/";
  32822. }
  32823. };
  32824. BusinessProcessAction.prototype.execute=function(){
  32825. this._initBPMGateway();
  32826. var _1be1=this._getBPMProcesses();
  32827. };
  32828. BusinessProcessAction.prototype._getBPMProcesses=function(){
  32829. var _1be2={complete:{object:this,method:this.handleGetBPMProcessSuccess},fault:{object:this,method:this.handleGetBPMProcessFail}};
  32830. var url=this.m_BPMGateway+"exposed/process";
  32831. var _1be4=this._createBPMServerRequest("GET",_1be2,url);
  32832. _1be4.sendRequest();
  32833. };
  32834. BusinessProcessAction.prototype._createBPMServerRequest=function(_1be5,_1be6,url,_1be8){
  32835. var _1be9=new XmlHttpObject();
  32836. _1be9.init(_1be5,this._rewriteURL(url));
  32837. _1be9.setCallbacks(_1be6);
  32838. _1be9.setHeaders({Accept:"application/json"});
  32839. if(_1be8){
  32840. for(var i in _1be8){
  32841. _1be9.addFormField(_1be8[i].name,_1be8[i].value);
  32842. }
  32843. }
  32844. return _1be9;
  32845. };
  32846. BusinessProcessAction.prototype._rewriteURL=function(url){
  32847. if(bux&&bux.iwidget&&bux.iwidget.canvas&&bux.iwidget.canvas.Helper&&bux.iwidget.canvas.Helper.rewriteUrl){
  32848. return bux.iwidget.canvas.Helper.rewriteUrl(url);
  32849. }
  32850. return url;
  32851. };
  32852. BusinessProcessAction.prototype.handleGetBPMProcessFail=function(_1bec){
  32853. var _1bed=RV_RES.IDS_JS_BUSINESS_PROCESS_GET_PROCESSES_FAIL_MSG;
  32854. var _1bee=_1bec.getResponseText();
  32855. this._showErrorMessage(_1bed,_1bee);
  32856. };
  32857. BusinessProcessAction.prototype.handleGetBPMProcessSuccess=function(_1bef){
  32858. var _1bf0=_1bef.getResponseText();
  32859. if(!_1bf0){
  32860. return;
  32861. }
  32862. var _1bf1=dojo.fromJson(_1bf0);
  32863. var _1bf2=this._getBusinessProcessesInfo(_1bf1.data.exposedItemsList);
  32864. this._showDialog(_1bf2);
  32865. };
  32866. BusinessProcessAction.prototype._getBusinessProcessesInfo=function(_1bf3){
  32867. if(!_1bf3){
  32868. return;
  32869. }
  32870. var _1bf4=_1bf3.length;
  32871. var _1bf5=new Array();
  32872. var _1bf6={};
  32873. for(var i=0;i<_1bf4;i++){
  32874. var _1bf8=_1bf3[i].display;
  32875. var _1bf9=_1bf3[i].itemID;
  32876. var _1bfa=_1bf3[i].processAppID;
  32877. if(_1bf8&&!_1bf6[_1bf8]&&_1bf9&&_1bfa){
  32878. _1bf6[_1bf8]=true;
  32879. _1bf5.push({sCaption:_1bf8,sBPD_ID:_1bf9,sProcessAppID:_1bfa});
  32880. }
  32881. }
  32882. return _1bf5;
  32883. };
  32884. BusinessProcessAction.prototype._showDialog=function(_1bfb){
  32885. var _1bfc=this;
  32886. var _1bfd=new viewer.dialogs.SelectBusinessProcess({sTitle:RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_TITLE,sLabel:RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_DESC,okHandler:function(){
  32887. },cancelHandler:function(){
  32888. },BPMProcessesInfo:_1bfb,bpAction:_1bfc});
  32889. _1bfd.startup();
  32890. _1bfd.show();
  32891. };
  32892. BusinessProcessAction.prototype.getInputParameter=function(_1bfe){
  32893. var obj=null;
  32894. var _1c00=this.getCognosViewer();
  32895. var _1c01=_1c00.getSelectionController();
  32896. var _1c02=_1c01.getSelectedObjectsJsonContext();
  32897. if(_1c02){
  32898. var value=_1c02;
  32899. if(_1bfe){
  32900. value=dojo.toJson(value);
  32901. }
  32902. obj={"cognosParameter":value};
  32903. }
  32904. return obj;
  32905. };
  32906. BusinessProcessAction.prototype.startProcess=function(_1c04,_1c05,_1c06){
  32907. var _1c07={customArguments:[_1c06],complete:{object:this,method:this.handleGetStartProcessSuccessResponse},fault:{object:this,method:this.handleGetStartProcessFailResponse}};
  32908. var url=this.m_BPMGateway+"process";
  32909. var _1c09=new Array();
  32910. _1c09.push({name:"action",value:"start"});
  32911. _1c09.push({name:"parts",value:"data"});
  32912. if(_1c04){
  32913. _1c09.push({name:"bpdId",value:_1c04});
  32914. }
  32915. if(_1c05){
  32916. _1c09.push({name:"processAppId",value:_1c05});
  32917. }
  32918. var _1c0a=this.getInputParameter(true);
  32919. if(_1c0a){
  32920. _1c09.push({name:"params",value:dojo.toJson(_1c0a)});
  32921. }
  32922. var _1c0b=this._createBPMServerRequest("POST",_1c07,url,_1c09);
  32923. _1c0b.sendRequest();
  32924. };
  32925. BusinessProcessAction.prototype.handleGetStartProcessSuccessResponse=function(_1c0c,_1c0d){
  32926. var _1c0e=_1c0c.getResponseText();
  32927. if(_1c0e){
  32928. var _1c0f=dojo.fromJson(_1c0e);
  32929. if(_1c0f.status==="200"){
  32930. var sMsg=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_SUCCEED_MSG,_1c0d);
  32931. var _1c11=new ModalInfoMessageDialog({sTitle:RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_SUCCEED_MSG_TITLE,sMessage:sMsg,sDescription:RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_SUCCEED_MSG_DETAIL});
  32932. _1c11.show();
  32933. }
  32934. }
  32935. };
  32936. BusinessProcessAction.prototype.handleGetStartProcessFailResponse=function(_1c12,_1c13){
  32937. var _1c14=_1c12.getResponseXml();
  32938. if(_1c14&&_1c14.documentElement){
  32939. this._handleXMLErrorResponse(_1c14,_1c13);
  32940. return;
  32941. }
  32942. var _1c15=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_FAILED_MSG,_1c13);
  32943. var _1c16=_1c12.getResponseText();
  32944. try{
  32945. var _1c17=dojo.fromJson(_1c16);
  32946. _1c16=_1c17.Data.errorMessage;
  32947. }
  32948. catch(err){
  32949. }
  32950. this._showErrorMessage(_1c15,_1c16);
  32951. };
  32952. BusinessProcessAction.prototype._handleXMLErrorResponse=function(_1c18,_1c19){
  32953. var _1c1a=XMLHelper_FindChildrenByTagName(_1c18,"error");
  32954. var _1c1b="";
  32955. var _1c1c="";
  32956. if(_1c1a){
  32957. _1c1b=XMLHelper_FindChildrenByTagName(_1c1a,"message").childNodes[0].nodeValue;
  32958. _1c1c=XMLHelper_FindChildrenByTagName(_1c1a,"detail").childNodes[0].nodeValue;
  32959. }else{
  32960. _1c1b=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_FAILED_MSG,_1c19);
  32961. }
  32962. this._showErrorMessage(_1c1b,_1c1c);
  32963. };
  32964. BusinessProcessAction.prototype._showErrorMessage=function(_1c1d,_1c1e){
  32965. var _1c1f=new ModalFaultMessageDialog(_1c1d,_1c1e);
  32966. _1c1f.show();
  32967. };
  32968. BusinessProcessAction.prototype._hasAnyContextInSelectedObjects=function(){
  32969. var _1c20=false;
  32970. var _1c21=this.m_oCV.getSelectionController();
  32971. var _1c22=_1c21.getAllSelectedObjects();
  32972. for(var i=0;i<_1c22.length;i++){
  32973. var _1c24=_1c22[i].getSelectedContextIds();
  32974. if(_1c24&&_1c24.length>0){
  32975. _1c20=true;
  32976. break;
  32977. }
  32978. }
  32979. return _1c20;
  32980. };
  32981. function DrillResetAction(){
  32982. this.m_sAction="DrillDown";
  32983. this.m_sharePromptValues=null;
  32984. this.m_aDrilledResetHUNs=null;
  32985. this.m_updateInfoBar=true;
  32986. };
  32987. DrillResetAction.prototype=new ModifyReportAction();
  32988. DrillResetAction.prototype.setRequestParms=function(_1c25){
  32989. this.m_aDrilledResetHUNs=_1c25.drilledResetHUNs;
  32990. this.m_sharePromptValues=_1c25.promptValues;
  32991. };
  32992. DrillResetAction.prototype.addAdditionalOptions=function(oReq){
  32993. if(!this.m_oCV){
  32994. return;
  32995. }
  32996. if(!this.m_sharePromptValues){
  32997. this.m_oCV.preparePromptValues(oReq);
  32998. oReq.getRequestHandler().setForceRaiseSharePrompt(true);
  32999. }else{
  33000. if(!this.m_sharePromptValues){
  33001. return;
  33002. }
  33003. for(var _1c27 in this.m_sharePromptValues){
  33004. oReq.addFormField(_1c27,this.m_sharePromptValues[_1c27]);
  33005. }
  33006. }
  33007. };
  33008. DrillResetAction.prototype.addActionContextAdditionalParms=function(){
  33009. var _1c28="<HUNS>";
  33010. for(var i=0;i<this.m_aDrilledResetHUNs.length;i++){
  33011. _1c28+="<HUN>"+xml_encode(this.m_aDrilledResetHUNs[i])+"</HUN>";
  33012. }
  33013. _1c28+="</HUNS>";
  33014. _1c28+="<action>resetDimension</action>";
  33015. return _1c28;
  33016. };
  33017. DrillResetAction.prototype.setUpdateInfoBar=function(_1c2a){
  33018. this.m_updateInfoBar=_1c2a;
  33019. };
  33020. DrillResetAction.prototype.updateInfoBar=function(){
  33021. this.m_updateInfoBar;
  33022. };
  33023. function RemoveAllDataFilterAction(){
  33024. this.m_sAction="UpdateDataFilter";
  33025. };
  33026. RemoveAllDataFilterAction.prototype.setCognosViewer=function(oCV){
  33027. this.m_oCV=oCV;
  33028. };
  33029. RemoveAllDataFilterAction.prototype.getCognosViewer=function(oCV){
  33030. return this.m_oCV;
  33031. };
  33032. RemoveAllDataFilterAction.prototype.setRequestParms=function(_1c2d){
  33033. if(!_1c2d||!_1c2d.callback){
  33034. return;
  33035. }
  33036. this.m_callbackMethod=_1c2d.callback.method;
  33037. this.m_callbackObject=_1c2d.callback.object;
  33038. };
  33039. RemoveAllDataFilterAction.prototype.createJSONDispatcherEntry=function(_1c2e){
  33040. var oReq=new JSONDispatcherEntry(this.getCognosViewer());
  33041. oReq.addFormField("ui.action",_1c2e);
  33042. var _1c30=this.addActionContext();
  33043. oReq.addFormField("cv.actionContext",_1c30);
  33044. if(window.gViewerLogger){
  33045. window.gViewerLogger.log("Action context",_1c30,"xml");
  33046. }
  33047. if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
  33048. oReq.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  33049. }
  33050. oReq.addFormField("bux","true");
  33051. return oReq;
  33052. };
  33053. RemoveAllDataFilterAction.prototype.addActionContext=function(){
  33054. var _1c31="<reportActions";
  33055. var _1c32="";
  33056. _1c31+=" run=\"false\"";
  33057. _1c31+=">";
  33058. _1c31+="<reportAction name=\""+this.m_sAction+"\">";
  33059. var _1c33="{ \"removeAll\" :\"true\"}";
  33060. _1c31+=xml_encode(_1c33);
  33061. _1c31+="</reportAction>";
  33062. _1c31+="</reportActions>";
  33063. return _1c31;
  33064. };
  33065. RemoveAllDataFilterAction.prototype.executeCallback=function(_1c34){
  33066. var _1c35=GUtil.generateCallback(this.m_callbackMethod,[_1c34],this.m_callbackObject);
  33067. _1c35();
  33068. };
  33069. RemoveAllDataFilterAction.prototype.handleServerResponse=function(_1c36){
  33070. if(_1c36&&_1c36.getJSONResponseObject()){
  33071. this.executeCallback(_1c36.getJSONResponseObject().reportSpec);
  33072. }
  33073. };
  33074. RemoveAllDataFilterAction.prototype.execute=function(){
  33075. var oCV=this.getCognosViewer();
  33076. if(!oCV.getRAPReportInfo().hasSlider()){
  33077. this.executeCallback(oCV.envParams["ui.spec"]);
  33078. }else{
  33079. var _1c38=this.createJSONDispatcherEntry("modifyReport");
  33080. _1c38.setCallbacks({"complete":{"object":this,"method":this.handleServerResponse}});
  33081. oCV.dispatchRequest(_1c38);
  33082. }
  33083. };
  33084. CCognosViewer.prototype.loadExtra=function(){
  33085. };
  33086. function DrillContextMenuHelper(){
  33087. };
  33088. DrillContextMenuHelper.updateDrillMenuItems=function(_1c39,oCV,_1c3b){
  33089. var _1c3c=[];
  33090. if(DrillContextMenuHelper.needsDrillSubMenu(oCV)){
  33091. var _1c3d=oCV.getSelectionController();
  33092. var _1c3e=_1c3d.getAllSelectedObjects();
  33093. var _1c3f=_1c3e[0];
  33094. if(_1c3f.getUseValues().length>1&&typeof RV_RES!="undefined"){
  33095. var _1c40={name:_1c3b,label:RV_RES.RV_DRILL_DEFAULT,action:{name:_1c3b,payload:{}}};
  33096. _1c3c.push(_1c40);
  33097. }
  33098. var _1c41=(_1c3f.getUseValues().length>1)?1:0;
  33099. var _1c42=_1c3f.getUseValues().length-1;
  33100. _1c42=(_1c42>2)?2:_1c42;
  33101. for(var iDim=_1c41;iDim<=_1c42;++iDim){
  33102. DrillContextMenuHelper.addSubMenuItem(_1c3b,_1c3c,_1c3f,iDim,0);
  33103. }
  33104. var _1c44=false;
  33105. for(var iDim=_1c41;iDim<=_1c42;++iDim){
  33106. for(var _1c45=1;_1c45<_1c3f.getUseValues()[iDim].length;++_1c45){
  33107. if(_1c44==false){
  33108. _1c3c.push({separator:true});
  33109. _1c44=true;
  33110. }
  33111. DrillContextMenuHelper.addSubMenuItem(_1c3b,_1c3c,_1c3f,iDim,_1c45);
  33112. }
  33113. }
  33114. }
  33115. DrillContextMenuHelper.completeDrillMenu(_1c3b,_1c3c,_1c39);
  33116. };
  33117. DrillContextMenuHelper.needsDrillSubMenu=function(oCV){
  33118. var _1c47=(oCV&&oCV.getSelectionController());
  33119. if(_1c47){
  33120. var _1c48=_1c47.getAllSelectedObjects();
  33121. if(_1c48.length==1&&_1c48[0].isHomeCell&&_1c48[0].isHomeCell()==false){
  33122. var _1c49=_1c48[0].isSelectionOnVizChart();
  33123. if(!_1c49){
  33124. var _1c4a=oCV.getAdvancedServerProperty("VIEWER_JS_ENABLE_DRILL_SUBMENU");
  33125. _1c49=(_1c4a=="charts"&&_1c47.hasSelectedChartNodes());
  33126. }
  33127. if(_1c49){
  33128. var _1c4b=_1c48[0];
  33129. return (_1c49&&_1c4b.getUseValues()&&(_1c4b.getUseValues().length>1||_1c4b.getUseValues()[0].length>1));
  33130. }
  33131. }
  33132. }
  33133. return false;
  33134. };
  33135. DrillContextMenuHelper.addSubMenuItem=function(_1c4c,_1c4d,_1c4e,iDim,_1c50){
  33136. var _1c51=_1c4e.getDrillOptions()[iDim][_1c50];
  33137. if(DrillContextMenuHelper.isOptionDrillable(_1c4c,_1c51)){
  33138. var _1c52=DrillContextMenuHelper.getItemValue(_1c4e,iDim,_1c50);
  33139. if(_1c52){
  33140. var _1c53=_1c4e.getDataItems()[iDim][_1c50];
  33141. var _1c54={name:_1c4c,label:_1c52,action:{name:_1c4c,payload:{userSelectedDrillItem:_1c53}}};
  33142. _1c4d.push(_1c54);
  33143. }
  33144. }
  33145. };
  33146. DrillContextMenuHelper.completeDrillMenu=function(_1c55,_1c56,_1c57){
  33147. if(_1c56.length>0){
  33148. _1c57.items=_1c56;
  33149. }else{
  33150. _1c57.items=null;
  33151. if(_1c57.action==null){
  33152. _1c57.action={name:_1c55,action:{name:_1c55}};
  33153. }
  33154. }
  33155. };
  33156. DrillContextMenuHelper.isOptionDrillable=function(_1c58,_1c59){
  33157. return (_1c59>=3||(_1c58=="DrillDown"&&_1c59==2)||(_1c58=="DrillUp"&&_1c59==1));
  33158. };
  33159. DrillContextMenuHelper.getItemValue=function(_1c5a,iDim,_1c5c){
  33160. var _1c5d=(_1c5c==0)?_1c5a.getDisplayValues()[iDim]:null;
  33161. return ((_1c5d)?_1c5d:_1c5a.getUseValues()[iDim][_1c5c]);
  33162. };
  33163. dojo.provide("viewer.dialogs.ClipboardDialog");
  33164. dojo.require("bux.dialogs.BaseCustomContentDialog");
  33165. dojo.require("bux.layout.TableContainer");
  33166. dojo.require("dijit.form.Textarea");
  33167. dojo.require("dijit.form.Button");
  33168. dojo.declare("viewer.dialogs.ClipboardDialog",bux.dialogs.BaseCustomContentDialog,{sTitle:null,okHandler:null,cancelHandler:null,startup:function(){
  33169. this.updateTitle(this.sTitle);
  33170. this.inherited(arguments);
  33171. var _1c5e=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
  33172. var cell=null,row=null;
  33173. this._textField=new dijit.form.SimpleTextarea({required:true,rows:10,cols:50,style:"width:auto"});
  33174. row=new bux.layout.TableContainerRow({parentContainer:_1c5e});
  33175. cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
  33176. cell.addContent(this._textField.domNode);
  33177. },onOK:function(){
  33178. if(this._textField.state!="Error"){
  33179. this.inherited(arguments);
  33180. this.okHandler(this._textField.get("value"));
  33181. this.hide();
  33182. }
  33183. }});
  33184. dojo.provide("bux.reportViewer.chart");
  33185. dojo.declare("bux.reportViewer.chart",null,{m_displayTypeDialogDefinition:null,constructor:function(){
  33186. this.initialize();
  33187. },initialize:function(){
  33188. if(this.m_displayTypeDialogDefinition!==null){
  33189. return;
  33190. }
  33191. this.m_displayTypeDialogDefinition=[{label:RV_RES.IDS_JS_CHART_TABLE,image:"images/dialog/displayOptionsDialog/type_icons/table.gif",options:[{label:RV_RES.IDS_JS_CHART_CROSSTAB,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/crosstab_48.gif",value:"crosstab"},{label:RV_RES.IDS_JS_CHART_LIST_TABLE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/List_48.gif",value:"list"}]},{label:RV_RES.IDS_JS_CHART_COLUMN,image:"images/dialog/displayOptionsDialog/type_icons/column.gif",options:[{label:RV_RES.IDS_JS_CHART_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_clustered_flat.gif",value:"column_clustered_flat"},{label:RV_RES.IDS_JS_CHART_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_clustered.gif",value:"column_clustered"},{label:RV_RES.IDS_JS_CHART_STACKED_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_stacked_flat.gif",value:"column_stacked_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_stacked.gif",value:"column_stacked"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_percent_flat.gif",value:"column_percent_flat"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_percent.gif",value:"column_percent"},{label:RV_RES.IDS_JS_CHART_3D_AXIS_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_column_3daxis.gif",value:"column_3daxis"},{label:RV_RES.IDS_JS_CHART_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_rectangle_clustered.jpg",value:"v2_column_rectangle_clustered"},{label:RV_RES.IDS_JS_CHART_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_box_clustered_depth.jpg",value:"v2_column_box_clustered_depth"},{label:RV_RES.IDS_JS_CHART_STACKED_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_rectangle_stacked.jpg",value:"v2_column_rectangle_stacked"},{label:RV_RES.IDS_JS_CHART_STACKED_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_box_stacked_depth.jpg",value:"v2_column_box_stacked_depth"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_COLUMN,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_rectangle_percent.jpg",value:"v2_column_rectangle_percent"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_COLUMN_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_column_box_percent_depth.jpg",value:"v2_column_box_percent_depth"}]},{label:RV_RES.IDS_JS_CHART_BAR,image:"images/dialog/displayOptionsDialog/type_icons/bar.gif",options:[{label:RV_RES.IDS_JS_CHART_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_clustered_flat.gif",value:"bar_clustered_flat"},{label:RV_RES.IDS_JS_CHART_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_clustered.gif",value:"bar_clustered"},{label:RV_RES.IDS_JS_CHART_STACKED_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_stacked_flat.gif",value:"bar_stacked_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_stacked.gif",value:"bar_stacked"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_percent_flat.gif",value:"bar_percent_flat"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bar_percent.gif",value:"bar_percent"},{label:RV_RES.IDS_JS_CHART_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_rectangle_clustered.jpg",value:"v2_bar_rectangle_clustered"},{label:RV_RES.IDS_JS_CHART_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_box_clustered_depth.jpg",value:"v2_bar_box_clustered_depth"},{label:RV_RES.IDS_JS_CHART_STACKED_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_rectangle_stacked.jpg",value:"v2_bar_rectangle_stacked"},{label:RV_RES.IDS_JS_CHART_STACKED_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_box_stacked_depth.jpg",value:"v2_bar_box_stacked_depth"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_BAR,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_rectangle_percent.jpg",value:"v2_bar_rectangle_percent"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_BAR_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bar_box_percent_depth.jpg",value:"v2_bar_box_percent_depth"}]},{label:RV_RES.IDS_JS_CHART_LINE,image:"images/dialog/displayOptionsDialog/type_icons/line.gif",options:[{label:RV_RES.IDS_JS_CHART_LINE_WITH_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_clustered_flat_markers.gif",value:"line_clustered_flat_markers"},{label:RV_RES.IDS_JS_CHART_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_clustered_flat.gif",value:"line_clustered_flat"},{label:RV_RES.IDS_JS_CHART_LINE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_clustered.gif",value:"line_clustered"},{label:RV_RES.IDS_JS_CHART_STEP_LINE_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_stepAtPoint_clustered_flat_markers.gif",value:"line_stepAtPoint_clustered_flat_markers"},{label:RV_RES.IDS_JS_CHART_STEP_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_stepAtPoint_clustered_flat.gif",value:"line_stepAtPoint_clustered_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_LINE_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_stacked_flat_markers.gif",value:"line_stacked_flat_markers"},{label:RV_RES.IDS_JS_CHART_STACKED_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_stacked_flat.gif",value:"line_stacked_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_LINE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_stacked.gif",value:"line_stacked"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_LINE_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_percent_flat_markers.gif",value:"line_percent_flat_markers"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_percent_flat.gif",value:"line_percent_flat"},{label:RV_RES.IDS_JS_CHART_PERCENT_STACKED_LINE__3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_percent.gif",value:"line_percent"},{label:RV_RES.IDS_JS_CHART_3D_AXIS_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_line_3daxis.gif",value:"line_3daxis"},{label:RV_RES.IDS_JS_CHART_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_line_clustered.jpg",value:"v2_line_clustered"},{label:RV_RES.IDS_JS_CHART_LINE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_line_clustered_depth.jpg",value:"v2_line_clustered_depth"},{label:RV_RES.IDS_JS_CHART_LINE_WITH_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_line_clustered_markers.jpg",value:"v2_line_clustered_markers"},{label:RV_RES.IDS_JS_CHART_LINE_WITH_3D_MARKERS,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_line_clustered_3dmarkers.jpg",value:"v2_line_clustered_3dmarkers"},{label:RV_RES.IDS_JS_CHART_STEP_LINE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_stepped_line_at_points_clustered.jpg",value:"v2_stepped_line_at_points_clustered"},{label:RV_RES.IDS_JS_CHART_STEP_LINE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_stepped_line_at_points_clustered_depth.jpg",value:"v2_stepped_line_at_points_clustered_depth"}]},{label:RV_RES.IDS_JS_CHART_PIE_DONUT,image:"images/dialog/displayOptionsDialog/type_icons/pie.gif",options:[{label:RV_RES.IDS_JS_CHART_PIE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_pie_flat.gif",value:"pie_flat"},{label:RV_RES.IDS_JS_CHART_DONUT,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_pie_flat_hole.gif",value:"pie_flat_hole"},{label:RV_RES.IDS_JS_CHART_PIE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_pie.gif",value:"pie"},{label:RV_RES.IDS_JS_CHART_DONUT_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_pie_hole.gif",value:"pie_hole"},{label:RV_RES.IDS_JS_CHART_PIE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_pie_flat.jpg",value:"v2_pie"},{label:RV_RES.IDS_JS_CHART_PIE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_pie.jpg",value:"v2_pie_depth_round"},{label:RV_RES.IDS_JS_CHART_DONUT,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_pie_hole_flat.jpg",value:"v2_donut"},{label:RV_RES.IDS_JS_CHART_DONUT_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_pie_hole.jpg",value:"v2_donut_depth_round"}]},{label:RV_RES.IDS_JS_CHART_AREA,image:"images/dialog/displayOptionsDialog/type_icons/area.gif",options:[{label:RV_RES.IDS_JS_CHART_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_clustered_flat.gif",value:"area_clustered_flat"},{label:RV_RES.IDS_JS_CHART_AREA_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_clustered.gif",value:"area_clustered"},{label:RV_RES.IDS_JS_CHART_STACKED_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_stacked_flat.gif",value:"area_stacked_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_AREA_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_stacked.gif",value:"area_stacked"},{label:RV_RES.IDS_JS_CHART_PERCENT_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_percent_flat.gif",value:"area_percent_flat"},{label:RV_RES.IDS_JS_CHART_PERCENT_AREA_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_percent.gif",value:"area_percent"},{label:RV_RES.IDS_JS_CHART_3D_AXIS_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_area_3daxis.gif",value:"area_3daxis"},{label:RV_RES.IDS_JS_CHART_STACKED_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_area_flat_point_to_point.gif",value:"v2_area_stacked_flat"},{label:RV_RES.IDS_JS_CHART_STACKED_AREA_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_area_depth_point_to_point.gif",value:"v2_area_stacked"},{label:RV_RES.IDS_JS_CHART_PERCENT_AREA,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_area_flat_percent_point_to_point.gif",value:"v2_area_percent_flat"},{label:RV_RES.IDS_JS_CHART_PERCENT_AREA_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_area_depth_percent_point_to_point.gif",value:"v2_area_percent"}]},{label:RV_RES.IDS_JS_CHART_SCATTER_BUBBLE_POINT,image:"images/dialog/displayOptionsDialog/type_icons/scatter.gif",options:[{label:RV_RES.IDS_JS_CHART_SCATTER,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_scatter.gif",value:"scatter"},{label:RV_RES.IDS_JS_CHART_BUBBLE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bubble.gif",value:"bubble"},{label:RV_RES.IDS_JS_CHART_BUBBLE_WITH_EXCEL_BUBBLE_SIZING,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_bubble_excel.gif",value:"bubble_zeroBased"},{label:RV_RES.IDS_JS_CHART_POINT,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_point_clustered.gif",value:"point_clustered"},{label:RV_RES.IDS_JS_CHART_3D_SCATTER,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_scatter_3daxis.gif",value:"scatter_3daxis"},{label:RV_RES.IDS_JS_CHART_SCATTER,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_scatter.gif",value:"v2_scatter"},{label:RV_RES.IDS_JS_CHART_BUBBLE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bubble.gif",value:"v2_bubble"},{label:RV_RES.IDS_JS_CHART_BUBBLE_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_bubble_3dmarkers.gif",value:"v2_bubble_3d"},{label:RV_RES.IDS_JS_CHART_POINT,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_point_clustered_markers.jpg",value:"v2_point_clustered_markers"},{label:RV_RES.IDS_JS_CHART_POINT_3D,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_point_clustered_3dmarkers.jpg",value:"v2_point_clustered_3dmarkers"}]},{label:RV_RES.IDS_JS_CHART_GAUGE,image:"images/dialog/displayOptionsDialog/type_icons/gauge.gif",options:[{label:RV_RES.IDS_JS_CHART_DIAL_GAUGE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_gauge_dial.gif",value:"gauge_dial"},{label:RV_RES.IDS_JS_CHART_DIAL_GAUGE,Description:"",image:"images/dialog/displayOptionsDialog/chart_thumbnails/type_v2_gauge.gif",value:"v2_gauge"}]}];
  33192. },getDisplayTypeDialogDefinition:function(_1c61){
  33193. var _1c62=[];
  33194. for(var j in this.m_displayTypeDialogDefinition){
  33195. var _1c64=this.m_displayTypeDialogDefinition[j];
  33196. var _1c65={};
  33197. _1c65.image=this.m_displayTypeDialogDefinition[j].image;
  33198. _1c65.label=this.m_displayTypeDialogDefinition[j].label;
  33199. _1c65.options=[];
  33200. var _1c66=_1c64.options;
  33201. for(var k in _1c66){
  33202. var chart=_1c66[k];
  33203. for(var i in _1c61){
  33204. var _1c6a=_1c61[i];
  33205. if(chart.value===_1c6a){
  33206. var _1c6b={label:chart.label,Description:chart.Description,image:chart.image,value:"{targetType:'"+chart.value+"', label:'"+chart.label+"'}"};
  33207. _1c65.options.push(_1c6b);
  33208. }
  33209. }
  33210. }
  33211. if(_1c65.options.length>0){
  33212. _1c62.push(_1c65);
  33213. }
  33214. }
  33215. return _1c62;
  33216. }});
  33217. function ActionFormFields(_1c6c){
  33218. this.m_dispatcherEntry=_1c6c;
  33219. this.m_oCV=_1c6c.getViewer();
  33220. };
  33221. ActionFormFields.prototype.addFormFields=function(){
  33222. var _1c6d=this.m_dispatcherEntry;
  33223. var _1c6e=_1c6d.getAction();
  33224. _1c6e.preProcess();
  33225. _1c6d.addFormField("ui.action","modifyReport");
  33226. if(this.m_oCV.getModelPath()!==""){
  33227. _1c6d.addFormField("modelPath",this.m_oCV.getModelPath());
  33228. if(typeof this.m_oCV.envParams["metaDataModelModificationTime"]!="undefined"){
  33229. _1c6d.addFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
  33230. }
  33231. }
  33232. if(_1c6e.doAddActionContext()===true){
  33233. var _1c6f=_1c6e.addActionContext();
  33234. _1c6d.addFormField("cv.actionContext",_1c6f);
  33235. if(window.gViewerLogger){
  33236. window.gViewerLogger.log("Action context",_1c6f,"xml");
  33237. }
  33238. }
  33239. var isBux=this.m_oCV.envParams["bux"]=="true";
  33240. if(isBux){
  33241. _1c6d.addFormField("cv.showFaultPage","false");
  33242. }else{
  33243. _1c6d.addFormField("cv.showFaultPage","true");
  33244. }
  33245. _1c6d.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
  33246. _1c6d.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
  33247. _1c6d.addDefinedFormField("modelPath",this.m_oCV.envParams["modelPath"]);
  33248. _1c6d.addDefinedFormField("packageBase",this.m_oCV.envParams["packageBase"]);
  33249. _1c6d.addDefinedFormField("rap.state",this.m_oCV.envParams["rap.state"]);
  33250. _1c6d.addDefinedFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
  33251. _1c6d.addDefinedFormField("ui.primaryAction",this.m_oCV.envParams["ui.primaryAction"]);
  33252. _1c6d.addNonNullFormField("cv.debugDirectory",this.m_oCV.envParams["cv.debugDirectory"]);
  33253. _1c6d.addNonNullFormField("ui.objectClass",this.m_oCV.envParams["ui.objectClass"]);
  33254. _1c6d.addNonNullFormField("bux",this.m_oCV.envParams["bux"]);
  33255. _1c6d.addNonNullFormField("baseReportModificationTime",this.m_oCV.envParams["baseReportModificationTime"]);
  33256. _1c6d.addNonNullFormField("originalReport",this.m_oCV.envParams["originalReport"]);
  33257. var _1c71=this.m_oCV.getFlashChartOption();
  33258. if(_1c71!=null){
  33259. _1c6d.addFormField("savedFlashChartOption",_1c71);
  33260. if(_1c71&&_1c6e!=null&&typeof (_1c6e.m_requestParams)!="undefined"&&typeof (_1c6e.m_requestParams.targetType)!="undefined"){
  33261. var _1c72=false;
  33262. var _1c73=null;
  33263. if(typeof (_1c6e.m_requestParams.targetType.targetType)!="undefined"){
  33264. _1c73=_1c6e.m_requestParams.targetType.targetType;
  33265. }else{
  33266. _1c73=_1c6e.m_requestParams.targetType;
  33267. }
  33268. if(_1c73.match("v2_")!=null||_1c73.match("_v2")!=null){
  33269. _1c72=true;
  33270. }else{
  33271. var _1c74=this.m_oCV.getRAPReportInfo();
  33272. var _1c75=_1c6e.getSelectedReportInfo();
  33273. if(_1c74&&_1c75){
  33274. var _1c76=_1c74.getDisplayTypes(_1c75.container);
  33275. if(_1c76.match("v2_")!=null||_1c76.match("_v2")!=null){
  33276. _1c72=true;
  33277. }
  33278. }
  33279. }
  33280. _1c6d.addFormField("hasAVSChart",_1c72);
  33281. }else{
  33282. _1c6d.addFormField("hasAVSChart",this.m_oCV.hasAVSChart());
  33283. }
  33284. }
  33285. var sEP=this.m_oCV.getExecutionParameters();
  33286. if(sEP){
  33287. _1c6d.addFormField("executionParameters",encodeURIComponent(sEP));
  33288. }
  33289. _1c6d.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
  33290. _1c6d.addFormField("m_tracking",encodeURIComponent(this.m_oCV.getTracking()));
  33291. var sCAF=this.m_oCV.getCAFContext();
  33292. if(sCAF){
  33293. _1c6d.addFormField("ui.cafcontextid",sCAF);
  33294. }
  33295. if(_1c6e.forceRunSpecRequest()){
  33296. _1c6d.addFormField("widget.forceRunSpec","true");
  33297. }
  33298. };
  33299. HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX="viewerHiddenRequest";
  33300. HiddenIframeDispatcherEntry.FORM_NAME="viewerHiddenFormRequest";
  33301. function HiddenIframeDispatcherEntry(oCV){
  33302. HiddenIframeDispatcherEntry.baseConstructor.call(this,oCV);
  33303. if(oCV){
  33304. HiddenIframeDispatcherEntry.prototype.setDefaultFormFields.call(this);
  33305. this.setRequestHandler(new RequestHandler(oCV));
  33306. this.setWorkingDialog(oCV.getWorkingDialog());
  33307. this.setRequestIndicator(oCV.getRequestIndicator());
  33308. this.m_httpRequestConfig=oCV.getConfig()&&oCV.getConfig().getHttpRequestConfig()?oCV.getConfig().getHttpRequestConfig():null;
  33309. this.setIframeId(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+oCV.getId());
  33310. this.originalGetViewerConfiguration=null;
  33311. }
  33312. };
  33313. HiddenIframeDispatcherEntry.prototype=new DispatcherEntry();
  33314. HiddenIframeDispatcherEntry.baseConstructor=DispatcherEntry;
  33315. HiddenIframeDispatcherEntry.prototype.setDefaultFormFields=function(){
  33316. var oCV=this.getViewer();
  33317. var sCAF=oCV.getCAFContext();
  33318. this.addDefinedNonNullFormField("ui.cafcontextid",sCAF);
  33319. };
  33320. HiddenIframeDispatcherEntry.prototype.sendRequest=function(){
  33321. this._createHiddenIframe();
  33322. var form=this._createForm();
  33323. this._setupCallbacks();
  33324. this.onPreHttpRequest(this.getRequest());
  33325. form.submit();
  33326. };
  33327. HiddenIframeDispatcherEntry.prototype._iframeRequestComplete=function(){
  33328. window.getViewerConfiguration=this.originalGetViewerConfiguration;
  33329. this.onPostHttpRequest();
  33330. this.onEntryComplete();
  33331. };
  33332. HiddenIframeDispatcherEntry.prototype._setupCallbacks=function(){
  33333. this.originalGetViewerConfiguration=window.getViewerConfiguration;
  33334. if(this.getFormField("cv.useAjax")!="false"){
  33335. var _1c7d=this;
  33336. var _1c7e=this.getRequestHandler().getRequestIndicator();
  33337. var _1c7f=this.getRequestHandler().getWorkingDialog();
  33338. window.getViewerConfiguration=function(){
  33339. var _1c80={"httpRequestCallbacks":{"reportStatus":{"complete":function(){
  33340. _1c7d.onComplete();
  33341. },"working":function(){
  33342. _1c7d.onWorking();
  33343. },"prompting":function(){
  33344. _1c7d.onPrompting();
  33345. }}}};
  33346. return _1c80;
  33347. };
  33348. }
  33349. };
  33350. HiddenIframeDispatcherEntry.prototype.setIframeId=function(id){
  33351. this._iframeId=id;
  33352. };
  33353. HiddenIframeDispatcherEntry.prototype.getIframeId=function(){
  33354. return this._iframeId;
  33355. };
  33356. HiddenIframeDispatcherEntry.prototype._createForm=function(_1c82){
  33357. var oCV=this.getViewer();
  33358. var _1c84=HiddenIframeDispatcherEntry.FORM_NAME+oCV.getId();
  33359. var _1c85=document.getElementById(_1c84);
  33360. if(_1c85){
  33361. _1c85.parentNode.removeChild(_1c85);
  33362. _1c85=null;
  33363. }
  33364. var _1c86=location.protocol+"//"+location.host+oCV.m_sGateway;
  33365. _1c85=document.createElement("form");
  33366. _1c85.setAttribute("method","post");
  33367. _1c85.setAttribute("action",_1c86);
  33368. _1c85.setAttribute("target",this.getIframeId());
  33369. _1c85.setAttribute("id",_1c84);
  33370. _1c85.style.display="none";
  33371. var _1c87=this.getRequest().getFormFields();
  33372. var _1c88=_1c87.keys();
  33373. for(var index=0;index<_1c88.length;index++){
  33374. _1c85.appendChild(createHiddenFormField(_1c88[index],_1c87.get(_1c88[index])));
  33375. }
  33376. document.body.appendChild(_1c85);
  33377. return _1c85;
  33378. };
  33379. HiddenIframeDispatcherEntry.prototype._createHiddenIframe=function(){
  33380. var oCV=this.getViewer();
  33381. var _1c8b=this.getIframeId();
  33382. var _1c8c=document.getElementById(_1c8b);
  33383. if(_1c8c){
  33384. _1c8c.parentNode.parentNode.removeChild(_1c8c.parentNode);
  33385. }
  33386. var div=document.createElement("div");
  33387. div.style.position="absolute";
  33388. div.style.left="0px";
  33389. div.style.top="0px";
  33390. div.style.display="none";
  33391. document.body.appendChild(div);
  33392. div.innerHTML="<iframe frameborder=\"0\" id=\""+_1c8b+"\" name=\""+_1c8b+"\"></iframe>";
  33393. _1c8c=document.getElementById(_1c8b);
  33394. var _1c8e=this;
  33395. var func=function(){
  33396. HiddenIframeDispatcherEntry.handleIframeLoad(_1c8e);
  33397. };
  33398. if(_1c8c.attachEvent){
  33399. _1c8c.attachEvent("onload",func);
  33400. }else{
  33401. _1c8c.addEventListener("load",func,true);
  33402. }
  33403. };
  33404. HiddenIframeDispatcherEntry.hideIframe=function(cvId){
  33405. var _1c91=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
  33406. if(_1c91){
  33407. _1c91.parentNode.style.display="none";
  33408. }
  33409. };
  33410. HiddenIframeDispatcherEntry.showIframeContentsInWindow=function(cvId){
  33411. var _1c93=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
  33412. if(!_1c93){
  33413. return;
  33414. }
  33415. var html=_1c93.contentWindow.document.getElementsByTagName("html")[0].innerHTML;
  33416. var _1c95=window.open("","","height=400,width=500");
  33417. if(_1c95){
  33418. _1c95.document.write("<html>"+html+"</html>");
  33419. }
  33420. };
  33421. HiddenIframeDispatcherEntry.handleIframeLoad=function(_1c96){
  33422. if(!_1c96){
  33423. return;
  33424. }
  33425. var _1c97=document.getElementById(_1c96.getIframeId());
  33426. if(!_1c97){
  33427. return;
  33428. }
  33429. var oCV=_1c97.contentWindow.window.gaRV_INSTANCES?_1c97.contentWindow.window.gaRV_INSTANCES[0]:null;
  33430. var _1c99=oCV?oCV.getStatus():null;
  33431. if(_1c99=="complete"){
  33432. _1c96.onComplete();
  33433. }
  33434. if(_1c99=="working"){
  33435. _1c96.onWorking();
  33436. }
  33437. if(_1c99=="prompting"){
  33438. _1c96.onPrompting();
  33439. }
  33440. if(!oCV||_1c99=="fault"||_1c99==""){
  33441. _1c96.onFault();
  33442. }
  33443. };
  33444. HiddenIframeDispatcherEntry.prototype.onFault=function(){
  33445. this._iframeRequestComplete();
  33446. HiddenIframeDispatcherEntry.showIframeContentsInWindow(this.getViewer().getId());
  33447. };
  33448. HiddenIframeDispatcherEntry.prototype.onPrompting=function(){
  33449. this._iframeRequestComplete();
  33450. if(this.m_httpRequestConfig){
  33451. var _1c9a=this.m_httpRequestConfig.getReportStatusCallback("prompting");
  33452. if(typeof _1c9a=="function"){
  33453. _1c9a();
  33454. }
  33455. }
  33456. HiddenIframeDispatcherEntry.showIframeContentsInWindow(this.getViewer().getId());
  33457. };
  33458. HiddenIframeDispatcherEntry.prototype.onComplete=function(){
  33459. this._iframeRequestComplete();
  33460. if(this.m_httpRequestConfig){
  33461. var _1c9b=this.m_httpRequestConfig.getReportStatusCallback("complete");
  33462. if(typeof _1c9b=="function"){
  33463. _1c9b();
  33464. }
  33465. }
  33466. var _1c9c=document.getElementById(this.getIframeId());
  33467. if(typeof _1c9c.contentWindow.detachLeavingRV=="function"){
  33468. _1c9c.contentWindow.detachLeavingRV();
  33469. }
  33470. var _1c9d=_1c9c.parentNode;
  33471. _1c9d.style.display="none";
  33472. if(this.getCallbacks()&&this.getCallbacks()["complete"]){
  33473. HiddenIframeDispatcherEntry.executeCallback(this.getCallbacks()["complete"]);
  33474. }
  33475. };
  33476. HiddenIframeDispatcherEntry.prototype.cancelRequest=function(_1c9e){
  33477. this._iframeRequestComplete();
  33478. if(!this.m_bCancelCalled){
  33479. this.m_bCancelCalled=true;
  33480. var _1c9f=document.getElementById(this.getIframeId());
  33481. if(!_1c9f){
  33482. return;
  33483. }
  33484. var oCV=_1c9f.contentWindow[getCognosViewerObjectString(this.getViewer().getId())];
  33485. if(oCV){
  33486. oCV.cancel();
  33487. }
  33488. }
  33489. };
  33490. HiddenIframeDispatcherEntry.executeCallback=function(_1ca1){
  33491. if(_1ca1){
  33492. var _1ca2=GUtil.generateCallback(_1ca1.method,_1ca1.params,_1ca1.object);
  33493. _1ca2();
  33494. }
  33495. };
  33496. HiddenIframeDispatcherEntry.getIframe=function(cvId){
  33497. var _1ca4=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
  33498. return _1ca4;
  33499. };
  33500. function ReportInfoDispatcherEntry(oCV){
  33501. ReportInfoDispatcherEntry.baseConstructor.call(this,oCV);
  33502. if(oCV){
  33503. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting}});
  33504. this.getRequestHandler().setFaultDialog(new ModalFaultDialog(oCV));
  33505. }
  33506. };
  33507. ReportInfoDispatcherEntry.prototype=new AsynchJSONDispatcherEntry();
  33508. ReportInfoDispatcherEntry.baseConstructor=AsynchJSONDispatcherEntry;
  33509. ReportInfoDispatcherEntry.prototype.initializeAction=function(_1ca6){
  33510. this.setKey(_1ca6.getActionKey());
  33511. this.setCanBeQueued(_1ca6.canBeQueued());
  33512. this.m_action=_1ca6;
  33513. };
  33514. ReportInfoDispatcherEntry.prototype.getAction=function(){
  33515. return this.m_action;
  33516. };
  33517. ReportInfoDispatcherEntry.prototype.prepareRequest=function(){
  33518. var _1ca7=new ActionFormFields(this);
  33519. _1ca7.addFormFields();
  33520. };
  33521. ReportInfoDispatcherEntry.prototype.onComplete=function(_1ca8,arg1){
  33522. if(this.m_oCV.getViewerDispatcher().queueIsEmpty()==true){
  33523. var _1caa=this.m_action.getOnCompleteCallback();
  33524. _1caa(_1ca8);
  33525. }
  33526. };
  33527. ReportInfoDispatcherEntry.prototype.onPrompting=function(_1cab,arg1){
  33528. var _1cad=this.m_action.getOnPromptingCallback();
  33529. _1cad(_1cab);
  33530. };
  33531. ReportInfoDispatcherEntry.prototype.onPostEntryComplete=function(){
  33532. var oCV=this.getViewer();
  33533. if(oCV&&oCV.getViewerWidget()){
  33534. var _1caf=oCV.getViewerWidget();
  33535. _1caf.getLoadManager().processQueue();
  33536. }
  33537. };
  33538. function ModifyReportDispatcherEntry(oCV){
  33539. ModifyReportDispatcherEntry.baseConstructor.call(this,oCV);
  33540. this.m_action=null;
  33541. if(oCV){
  33542. this.m_viewerWidget=oCV.getViewerWidget();
  33543. this.setRequestHandler(new RequestHandler(oCV));
  33544. this.setWorkingDialog(oCV.getWorkingDialog());
  33545. this.setRequestIndicator(oCV.getRequestIndicator());
  33546. this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting}});
  33547. }
  33548. };
  33549. ModifyReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
  33550. ModifyReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
  33551. ModifyReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
  33552. ModifyReportDispatcherEntry.prototype.initializeAction=function(_1cb1){
  33553. this.setKey(_1cb1.getActionKey());
  33554. this.setCanBeQueued(_1cb1.canBeQueued());
  33555. this.m_action=_1cb1;
  33556. };
  33557. ModifyReportDispatcherEntry.prototype.getAction=function(){
  33558. return this.m_action;
  33559. };
  33560. ModifyReportDispatcherEntry.prototype.prepareRequest=function(){
  33561. if(this.m_viewerWidget){
  33562. DispatcherEntry.addWidgetInfoToFormFields(this.m_viewerWidget,this);
  33563. }
  33564. var _1cb2=new ActionFormFields(this);
  33565. _1cb2.addFormFields();
  33566. if(this.m_viewerWidget){
  33567. this.addFormField("cv.id",this.m_viewerWidget.getViewerId());
  33568. }
  33569. this.addFormField("keepIterators","true");
  33570. this.addFormField("run.prompt",this.m_action.getPromptOption());
  33571. if(this.m_action.reuseQuery()===true){
  33572. this.addFormField("reuseResults","true");
  33573. }else{
  33574. if(this.m_action.reuseGetParameter()===true){
  33575. this.addFormField("reuseResults","paramInfo");
  33576. }
  33577. }
  33578. if(this.m_action.keepRAPCache()===false&&this.m_viewerWidget){
  33579. this.m_viewerWidget.clearRAPCache();
  33580. }
  33581. if(this.m_action.reuseConversation()===true){
  33582. this.addFormField("cv.reuseConversation","true");
  33583. }
  33584. if(this.m_action.isUndoable()&&this.m_action.getUndoRedoQueue()){
  33585. this.m_action.getUndoRedoQueue().initUndoObj({"tooltip":this.m_action.getUndoHint(),"saveSpec":this.m_action.saveSpecForUndo()});
  33586. }
  33587. if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")){
  33588. this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
  33589. }
  33590. this.getViewer().clearTabs();
  33591. };
  33592. ModifyReportDispatcherEntry.prototype.onComplete=function(_1cb3,arg1){
  33593. if(this.getRequestHandler()){
  33594. this.getRequestHandler().onComplete(_1cb3);
  33595. }
  33596. };
  33597. ModifyReportDispatcherEntry.prototype.onPrompting=function(_1cb5){
  33598. if(this.getRequestHandler()){
  33599. this.getRequestHandler().onPrompting(_1cb5);
  33600. }
  33601. };
  33602. ModifyReportDispatcherEntry.prototype.onWorking=function(_1cb6,arg1){
  33603. this.parent.onWorking.call(this,_1cb6,arg1);
  33604. var _1cb8=_1cb6.getResponseState();
  33605. if(this.getRequestHandler()){
  33606. this.getRequestHandler().updateViewerState(_1cb8);
  33607. }
  33608. };
  33609. dojo.provide("ModalInfoMessageDialog");
  33610. dojo.declare("ModalInfoMessageDialog",null,{sMessage:"",sDescription:"",sTitle:"",constructor:function(args){
  33611. dojo.safeMixin(this,args);
  33612. },getMessage:function(){
  33613. return this.sMessage;
  33614. },getDescription:function(){
  33615. return this.sDescription;
  33616. },getTitle:function(){
  33617. return this.sTitle;
  33618. },show:function(){
  33619. dojo["require"]("bux.dialogs.InformationDialog");
  33620. var _1cba=new bux.dialogs.InformationDialog({title:this.getTitle(),sMainMessage:this.getMessage(),sDescription:this.getDescription(),sInfoIconClass:"bux-informationDialog-info-icon"});
  33621. _1cba.show();
  33622. }});
  33623. function CCognosViewerSaveReport(_1cbb,_1cbc){
  33624. this.m_cognosViewer=_1cbb;
  33625. this.m_params=null;
  33626. this.dashboardToSaveIn=_1cbc.cm$storeID;
  33627. this.m_doSaveAsOnFault=false;
  33628. };
  33629. CCognosViewerSaveReport.prototype.canSave=function(_1cbd){
  33630. return (this.doSaveAs()||_1cbd&&_1cbd.indexOf("write")!==-1);
  33631. };
  33632. CCognosViewerSaveReport.prototype.isSavedOutput=function(){
  33633. var _1cbe=this.m_cognosViewer.envParams["ui.action"];
  33634. return (typeof _1cbe!=="undefined"&&_1cbe==="view");
  33635. };
  33636. CCognosViewerSaveReport.prototype.doSaveAs=function(){
  33637. var _1cbf=(this.m_doSaveAsOnFault||!this.m_cognosViewer.envParams["savedReportName"]||!this.isSameDashboard());
  33638. return _1cbf;
  33639. };
  33640. CCognosViewerSaveReport.prototype.isSameDashboard=function(){
  33641. var _1cc0=(this.m_cognosViewer.envParams["ui.object"].indexOf(this.dashboardToSaveIn)!==-1);
  33642. return _1cc0;
  33643. };
  33644. CCognosViewerSaveReport.prototype.getUIAction=function(){
  33645. return (this.doSaveAs()?"saveInDashboard":"updateSavedReport");
  33646. };
  33647. CCognosViewerSaveReport.prototype.populateRequestParams=function(_1cc1){
  33648. _1cc1.addFormField("ui.action",this.getUIAction());
  33649. _1cc1.addFormField("cv.ignoreState","true");
  33650. _1cc1.addFormField("dashboard-id",this.dashboardToSaveIn);
  33651. _1cc1.addNonEmptyStringFormField("executionParameters",this.m_cognosViewer.m_sParameters);
  33652. for(var param in this.m_cognosViewer.envParams){
  33653. if(param.indexOf("frag-")==0||param=="cv.actionState"||param=="ui.primaryAction"||param=="dashboard"||param=="ui.action"||param=="cv.responseFormat"||param=="b_action"){
  33654. continue;
  33655. }
  33656. _1cc1.addFormField(param,this.m_cognosViewer.envParams[param]);
  33657. }
  33658. };
  33659. CCognosViewerSaveReport.prototype.getCognosViewer=function(){
  33660. return this.m_cognosViewer;
  33661. };
  33662. CCognosViewerSaveReport.prototype.getViewerWidget=function(){
  33663. return this.getCognosViewer().getViewerWidget();
  33664. };
  33665. CCognosViewerSaveReport.prototype.dispatchRequest=function(){
  33666. var _1cc3=this.m_cognosViewer;
  33667. var _1cc4=this.getViewerWidget();
  33668. var _1cc5={"complete":{"object":_1cc4,"method":_1cc4.handleWidgetSaveDone},"fault":{"object":this,"method":this.onFault}};
  33669. var _1cc6=new AsynchJSONDispatcherEntry(_1cc3);
  33670. _1cc6.setCallbacks(_1cc5);
  33671. this.populateRequestParams(_1cc6);
  33672. _1cc3.dispatchRequest(_1cc6);
  33673. };
  33674. CCognosViewerSaveReport.prototype.onFault=function(_1cc7,arg1){
  33675. var _1cc9=this.m_cognosViewer;
  33676. var _1cca=this.getViewerWidget();
  33677. var _1ccb=_1cc7.getSoapFault();
  33678. var _1ccc=XMLHelper_FindChildByTagName(_1ccb,"Fault",true);
  33679. if(this.ifIsEmptySelectionFault(_1ccc)){
  33680. this.handleEmptySelectionFault();
  33681. return;
  33682. }
  33683. var _1ccd=_1ccb.createElement("allowRetry");
  33684. _1ccd.appendChild(_1ccb.createTextNode("false"));
  33685. _1ccc.appendChild(_1ccd);
  33686. var _1cce=XMLBuilderSerializeNode(_1ccc);
  33687. _1cc9.setSoapFault(_1cce);
  33688. _1cca.handleFault();
  33689. var _1ccf={"status":false};
  33690. _1cca.iContext.iEvents.fireEvent("com.ibm.bux.widget.save.done",null,_1ccf);
  33691. };
  33692. CCognosViewerSaveReport.prototype.ifIsEmptySelectionFault=function(_1cd0){
  33693. if(_1cd0){
  33694. var _1cd1=XMLHelper_FindChildByTagName(_1cd0,"errorCode",true);
  33695. if(_1cd1){
  33696. var _1cd2=XMLHelper_GetText(_1cd1,false);
  33697. return (_1cd2==="cmEmptySelection");
  33698. }
  33699. }
  33700. return false;
  33701. };
  33702. CCognosViewerSaveReport.prototype.handleEmptySelectionFault=function(){
  33703. delete (this.m_cognosViewer.envParams["savedReportName"]);
  33704. this.m_doSaveAsOnFault=true;
  33705. this.dispatchRequest();
  33706. };
  33707. SAVE_REPORT_TYPE={reportView:"application/x-ibmcognos_v5reportview+xml",report:"application/x-ibmcognos_v5report+xml"};
  33708. function ViewerIWidgetSave(_1cd3,_1cd4){
  33709. this.m_ViewerWidget=_1cd3;
  33710. this.m_payload=_1cd4;
  33711. this._setIsSavedDashboard();
  33712. };
  33713. ViewerIWidgetSave.prototype.setDoCWCopy=function(value){
  33714. this._doCWCopy=value;
  33715. };
  33716. ViewerIWidgetSave.prototype._getSavedReport=function(){
  33717. var _1cd6=this._getWidgetAttributeValue("savedReportPath");
  33718. if(!_1cd6){
  33719. _1cd6=this._getWidgetAttributeValue("savedReportName");
  33720. }
  33721. return _1cd6;
  33722. };
  33723. ViewerIWidgetSave.prototype._setIsSavedDashboard=function(){
  33724. var _1cd7=this._getSavedReport();
  33725. this._bIsSavedDashboard=(_1cd7!==null&&_1cd7!==undefined&&_1cd7.length!==0);
  33726. };
  33727. ViewerIWidgetSave.prototype._isSavedDashboard=function(){
  33728. return this._bIsSavedDashboard;
  33729. };
  33730. ViewerIWidgetSave.prototype.canSave=function(_1cd8){
  33731. return (this._doSaveNewOrSaveAs()||_1cd8&&_1cd8.indexOf("write")!==-1||this.m_ViewerWidget.isDropped());
  33732. };
  33733. ViewerIWidgetSave.prototype.isSavedOutput=function(){
  33734. var _1cd9=this.m_cognosViewer.envParams["ui.action"];
  33735. return (typeof _1cd9!=="undefined"&&_1cd9==="view");
  33736. };
  33737. ViewerIWidgetSave.prototype._doSaveNewOrSaveAs=function(){
  33738. var _1cda=(this.m_payload.operation==="save"&&!this._isSavedDashboard())||(this.m_payload.operation==="saveAs");
  33739. return _1cda;
  33740. };
  33741. ViewerIWidgetSave.prototype._getWidgetAttributeValue=function(_1cdb){
  33742. return this._getViewerWidget().getAttributeValue(_1cdb);
  33743. };
  33744. ViewerIWidgetSave.prototype._getEnvParam=function(_1cdc){
  33745. return this._getViewerWidget().getEnvParam(_1cdc);
  33746. };
  33747. ViewerIWidgetSave.prototype._getViewerWidget=function(){
  33748. return this.m_ViewerWidget;
  33749. };
  33750. ViewerIWidgetSave.prototype._isLimitedInteractiveMode=function(){
  33751. return this._getViewerWidget().isLimitedInteractiveMode();
  33752. };
  33753. ViewerIWidgetSave.prototype._getDefaultReportName=function(){
  33754. return this._getEnvParam("ui.name");
  33755. };
  33756. ViewerIWidgetSave.prototype._getReportSpec=function(){
  33757. return this._getEnvParam("ui.spec");
  33758. };
  33759. ViewerIWidgetSave.prototype._getCurrentReportIsReportView=function(){
  33760. return (this._getEnvParam("ui.objectClass")==="reportView");
  33761. };
  33762. ViewerIWidgetSave.prototype.doGetSavePropertiesFromServer=function(){
  33763. this.delayedLoadingContext=this._getViewerWidget().getLoadManager().getDelayedLoadingContext();
  33764. if(this._getEnvParam("delayedLoadingExecutionParams")){
  33765. return true;
  33766. }
  33767. return (this.delayedLoadingContext&&this.delayedLoadingContext.getPromptValues()!==null);
  33768. };
  33769. ViewerIWidgetSave.prototype.getSavePropertiesFromServer=function(){
  33770. var oCV=this._getViewerWidget().getViewerObject();
  33771. var _1cde=new JSONDispatcherEntry(oCV);
  33772. var _1cdf=this._getViewerWidget();
  33773. _1cde.setCallbacks({customArguments:[this.m_payload],complete:{"object":_1cdf,"method":_1cdf.handleGetSavePropertiesFromServerResponse}});
  33774. this._addRequestOptions(_1cde);
  33775. _1cde.sendRequest();
  33776. };
  33777. ViewerIWidgetSave.prototype._addRequestOptions=function(_1ce0){
  33778. _1ce0.addFormField("ui.action","noOp");
  33779. _1ce0.addFormField("bux","true");
  33780. _1ce0.addFormField("cv.responseFormat","IWidgetSavePropertiesJSON");
  33781. if(this._getEnvParam("delayedLoadingExecutionParams")){
  33782. _1ce0.addFormField("delayedLoadingExecutionParams",this._getEnvParam("delayedLoadingExecutionParams"));
  33783. }else{
  33784. _1ce0.addFormField("ui.conversation",this._getViewerWidget().getViewerObject().getConversation());
  33785. }
  33786. var _1ce1=this.delayedLoadingContext.getPromptValues();
  33787. for(var _1ce2 in _1ce1){
  33788. _1ce0.addFormField(_1ce2,_1ce1[_1ce2]);
  33789. }
  33790. };
  33791. ViewerIWidgetSave.prototype._getExecutionParameters=function(){
  33792. return this._getViewerWidget().getViewerObject().getExecutionParameters();
  33793. };
  33794. ViewerIWidgetSave.prototype._setExecutionParameters=function(body){
  33795. var _1ce4=this._getExecutionParameters();
  33796. var doc=XMLBuilderLoadXMLFromString(_1ce4);
  33797. if(!doc.documentElement){
  33798. return;
  33799. }
  33800. var root=XMLBuilderCreateXMLDocument("root");
  33801. var _1ce7=root.createElement("parameters");
  33802. XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:SOAP-ENC","http://schemas.xmlsoap.org/soap/encoding/");
  33803. XMLBuilderSetAttributeNodeNS(_1ce7,"xsi:type","bus:parameterValueArrayProp","http://www.w3.org/2001/XMLSchema-instance");
  33804. XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
  33805. XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
  33806. root.documentElement.appendChild(_1ce7);
  33807. var _1ce8=XMLHelper_FindChildrenByTagName(doc.documentElement,"item",false);
  33808. var _1ce9=root.createElement("value");
  33809. XMLBuilderSetAttributeNodeNS(_1ce9,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
  33810. _1ce7.appendChild(_1ce9);
  33811. var _1cea=_1ce8.length;
  33812. for(var i=0;i<_1ce8.length;i++){
  33813. var eName=XMLHelper_FindChildByTagName(_1ce8[i],"name",false);
  33814. if(eName&&eName.childNodes[0].nodeValue.indexOf("credential:")!==-1){
  33815. _1cea--;
  33816. continue;
  33817. }
  33818. _1ce9.appendChild(_1ce8[i]);
  33819. }
  33820. XMLBuilderSetAttributeNodeNS(_1ce9,"SOAP-ENC:arrayType","bus:parameterValue["+_1cea+"]","http://schemas.xmlsoap.org/soap/encoding/");
  33821. body.parameters=XMLBuilderSerializeNode(_1ce7);
  33822. };
  33823. ViewerIWidgetSave.prototype._setSourceObject=function(_1ced,_1cee){
  33824. var _1cef=(_1cee===true)?this._getEnvParam("ui.object"):this._getEnvParam("originalReport");
  33825. if(_1cef){
  33826. _1ced.sourceObject=_1cef;
  33827. }
  33828. };
  33829. ViewerIWidgetSave.prototype._setReportTypeToReportView=function(_1cf0){
  33830. _1cf0.type=SAVE_REPORT_TYPE.reportView;
  33831. };
  33832. ViewerIWidgetSave.prototype._setReportTypeToReport=function(_1cf1){
  33833. _1cf1.type=SAVE_REPORT_TYPE.report;
  33834. };
  33835. ViewerIWidgetSave.prototype._setReportSpec=function(body){
  33836. body.specification=this._getReportSpec();
  33837. };
  33838. ViewerIWidgetSave.prototype._setResourceForSave=function(_1cf3){
  33839. if(!this._getCurrentReportIsReportView()&&!this._isLimitedInteractiveMode()){
  33840. this._setReportSpec(_1cf3.body);
  33841. this._setReportTypeToReport(_1cf3);
  33842. }
  33843. return _1cf3;
  33844. };
  33845. ViewerIWidgetSave.prototype._setResourceForCopy=function(_1cf4){
  33846. this._setReportSpec(_1cf4.body);
  33847. this._setReportTypeToReport(_1cf4);
  33848. return _1cf4;
  33849. };
  33850. ViewerIWidgetSave.prototype._setResourceForSaveNew=function(_1cf5){
  33851. var _1cf6=false;
  33852. if(this._getEnvParam("originalReport")==null){
  33853. _1cf6=true;
  33854. }
  33855. this._setSourceObject(_1cf5,_1cf6);
  33856. if(this._isLimitedInteractiveMode()){
  33857. this._setReportTypeToReportView(_1cf5);
  33858. }else{
  33859. this._setReportTypeToReport(_1cf5);
  33860. this._setReportSpec(_1cf5.body);
  33861. }
  33862. return _1cf5;
  33863. };
  33864. ViewerIWidgetSave.prototype._setResourceForSaveAs=function(_1cf7){
  33865. if(this._getCurrentReportIsReportView()){
  33866. this._setReportTypeToReportView(_1cf7);
  33867. this._setSourceObject(_1cf7);
  33868. }else{
  33869. if(this._isLimitedInteractiveMode()){
  33870. this._setReportTypeToReportView(_1cf7);
  33871. this._setSourceObject(_1cf7,true);
  33872. }else{
  33873. this._setReportTypeToReport(_1cf7);
  33874. this._setSourceObject(_1cf7,true);
  33875. this._setReportSpec(_1cf7.body);
  33876. }
  33877. }
  33878. return _1cf7;
  33879. };
  33880. ViewerIWidgetSave.prototype._getResource=function(){
  33881. var _1cf8={};
  33882. if(this._doCWCopy===true){
  33883. _1cf8.copyOnCreate=true;
  33884. }
  33885. _1cf8.body={};
  33886. var _1cf9=(this.m_payload.operation==="save");
  33887. var _1cfa=(this.m_payload.operation==="copy");
  33888. if(_1cfa){
  33889. this._setResourceForCopy(_1cf8);
  33890. }else{
  33891. if(_1cf9){
  33892. this._setResourceForSave(_1cf8);
  33893. }else{
  33894. if(this._isSavedDashboard()){
  33895. this._setResourceForSaveAs(_1cf8);
  33896. }else{
  33897. this._setResourceForSaveNew(_1cf8);
  33898. }
  33899. }
  33900. }
  33901. this._setExecutionParameters(_1cf8.body);
  33902. if(!_1cfa){
  33903. _1cf8.itemSetUpdate={name:"savedReportPath",type:"searchPath"};
  33904. }
  33905. return _1cf8;
  33906. };
  33907. ViewerIWidgetSave.prototype._getWidgetId=function(){
  33908. return this._getViewerWidget().getWidgetId();
  33909. };
  33910. ViewerIWidgetSave.prototype.getPayload=function(){
  33911. var _1cfb={};
  33912. _1cfb.resource=new Array();
  33913. _1cfb.widgetId=this._getWidgetId();
  33914. _1cfb.resource.push(this._getResource());
  33915. return _1cfb;
  33916. };
  33917. dojo.provide("viewer.dialogs.SelectBusinessProcess");
  33918. dojo.require("bux.dialogs.BaseCustomContentDialog");
  33919. dojo.require("bux.layout.TableContainer");
  33920. dojo.require("dijit.form.NumberTextBox");
  33921. dojo.require("dijit.form.Button");
  33922. dojo.declare("viewer.dialogs.SelectBusinessProcess",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,okHandler:null,cancelHanlder:null,buildRendering:function(){
  33923. this.aButtonsSpec=[{label:RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_START_BUTTON_LABEL,action:dojo.hitch(this,this.onOK),type:"button"},{label:RV_RES.CANCEL,action:dojo.hitch(this,this.onCancel),type:"button"}];
  33924. this.inherited(arguments);
  33925. if(!this.BPMProcessesInfo||this.BPMProcessesInfo.length===0){
  33926. this._buxBaseDialog._aButtonObjects[0].set("disabled",true);
  33927. }
  33928. },startup:function(){
  33929. this.updateTitle(this.sTitle);
  33930. this.inherited(arguments);
  33931. this.set("role","group");
  33932. var _1cfc=new bux.layout.TableContainer({classname:"bux-InformationDialog buxFilterConfigDiscreteValuesTable"},this.contentContainer);
  33933. var row=new bux.layout.TableContainerRow({classname:"bux-dialog-label",parentContainer:_1cfc});
  33934. var cell=new bux.layout.TableContainerCell({parentContainer:row});
  33935. this.generateSelectProcessSection(cell);
  33936. cell.addContent(document.createElement("br"));
  33937. this.generateViewInputValuesSection(cell);
  33938. cell.addContent(document.createElement("br"));
  33939. },addDivContainer:function(_1cff,sID,sRole){
  33940. var div=document.createElement("div");
  33941. dojo.attr(div,{"class":"buxFilterConfigFilterValue","aria-labelledby":sID,role:sRole});
  33942. _1cff.addContent(div);
  33943. return div;
  33944. },generateSelectProcessSection:function(_1d03){
  33945. var _1d04=this.id+"_selectProcess_a11ylabel";
  33946. this.addTableDescription(_1d03,this.sLabel,_1d04);
  33947. var div=this.addDivContainer(_1d03,_1d04,"radiogroup");
  33948. var _1d06=new bux.layout.TableContainer({classname:"buxFilterConfigFilterValueTable"});
  33949. dojo.style(_1d06.domNode,"width","325px");
  33950. this.addSelectProcessTableHeader(_1d06);
  33951. if(!this.BPMProcessesInfo||this.BPMProcessesInfo.length===0){
  33952. this.addEmptySelectProcessTableContent(_1d06);
  33953. }else{
  33954. this.addSelectProcessTableContent(_1d06);
  33955. }
  33956. div.appendChild(_1d06.domNode);
  33957. },addSelectProcessTableHeader:function(_1d07){
  33958. var _1d08=new bux.layout.TableContainerRow({classname:"buxFilterConfigFilterValueTableHeaderRow",parentContainer:_1d07});
  33959. var _1d09=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeaderLeft",width:"25px",parentContainer:_1d08});
  33960. var _1d0a=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeader",width:"300px",parentContainer:_1d08});
  33961. _1d0a.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_TABLE_HEADER));
  33962. },addEmptySelectProcessTableContent:function(_1d0b){
  33963. var _1d0c=this.id+"_processItemsRow_label_none";
  33964. var _1d0d=new bux.layout.TableContainerRow({parentContainer:_1d0b});
  33965. dojo.attr(_1d0d.domNode,{id:this.id+"_processItemsRow_none","aria-labelledby":_1d0c,tabindex:0});
  33966. var _1d0e=this.createA11yLabel(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_NO_PROCESS_A11Y,_1d0c,true);
  33967. _1d0d.domNode.appendChild(_1d0e);
  33968. var cell=new bux.layout.TableContainerCell({parentContainer:_1d0d});
  33969. cell.set("colspan",2);
  33970. cell.addContent(this.createLabelElement(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_NO_PROCESS));
  33971. },addSelectProcessTableContent:function(_1d10){
  33972. for(var i=0;i<this.BPMProcessesInfo.length;i++){
  33973. var _1d12=new dijit.form.RadioButton({checked:((i===0)?true:false),name:this.id+"_processItem",disabled:false});
  33974. var _1d13=html_encode(this.BPMProcessesInfo[i].sCaption);
  33975. var _1d14=this.BPMProcessesInfo[i].sBPD_ID;
  33976. var _1d15=this.BPMProcessesInfo[i].sProcessAppID;
  33977. _1d12.onChange=dojo.hitch(this,"getProcessItemRadioChangeFunction",_1d14,_1d15,_1d13,_1d12);
  33978. var _1d16=new bux.layout.TableContainerRow({parentContainer:_1d10,classname:((i===0)?"buxFilterConfigFilterValueRowSelected":"")});
  33979. _1d16.set("id",this.id+"_processItemsRow"+_1d12.id);
  33980. var _1d17=new bux.layout.TableContainerCell({align:"center",parentContainer:_1d16});
  33981. _1d17.addContent(_1d12.domNode);
  33982. _1d17.set("id",this.id+"_processItemsCell"+i);
  33983. var _1d18=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"300px",valign:"top",parentContainer:_1d16});
  33984. var _1d19=document.createElement("label");
  33985. _1d19.appendChild(document.createTextNode(_1d13));
  33986. _1d19.setAttribute("for",_1d12.id);
  33987. _1d18.addContent(_1d19);
  33988. }
  33989. this.setDefaultProcessSelectedInfo();
  33990. },setDefaultProcessSelectedInfo:function(){
  33991. this._selectedBPD_ID=this.BPMProcessesInfo[0].sBPD_ID;
  33992. this._selectedProcessAppId=this.BPMProcessesInfo[0].sProcessAppID;
  33993. this._selectedProcessName=html_encode(this.BPMProcessesInfo[0].sCaption);
  33994. },getProcessItemRadioChangeFunction:function(_1d1a,_1d1b,_1d1c,radio){
  33995. if(radio.get("value")==="on"){
  33996. dojo.byId(this.id+"_processItemsRow"+radio.id).className="buxFilterConfigFilterValueRowSelected";
  33997. this._selectedBPD_ID=_1d1a;
  33998. this._selectedProcessAppId=_1d1b;
  33999. this._selectedProcessName=_1d1c;
  34000. }else{
  34001. dojo.byId(this.id+"_processItemsRow"+radio.id).className="";
  34002. }
  34003. },generateViewInputValuesSection:function(_1d1e){
  34004. var _1d1f=this.id+"_viewInputValues_a11ylabel";
  34005. this.addTableDescription(_1d1e,RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_DESCRIPTION,_1d1f);
  34006. this.addViewInputValuesTable(_1d1e,_1d1f);
  34007. },addViewInputValuesTable:function(_1d20,_1d21){
  34008. _1d20.addContent(this.generateViewInputValuesTable(_1d21));
  34009. },addTableDescription:function(_1d22,_1d23,sID){
  34010. var div=document.createElement("div");
  34011. dojo.attr(div,{"class":"bux-label",id:sID});
  34012. div.appendChild(document.createTextNode(html_encode(_1d23)));
  34013. _1d22.addContent(div);
  34014. },generateViewInputValuesTable:function(_1d26){
  34015. var _1d27=this.bpAction.getInputParameter();
  34016. var div=document.createElement("div");
  34017. dojo.attr(div,{"class":"buxFilterConfigFilterValue",style:"height:80px",role:"group","aria-labelledby":_1d26});
  34018. var _1d29=new bux.layout.TableContainer({classname:"buxFilterConfigFilterValueTable"});
  34019. dojo.style(_1d29.domNode,"width","335px");
  34020. _1d29.set("role","list");
  34021. div.appendChild(_1d29.domNode);
  34022. var _1d2a=new bux.layout.TableContainerRow({classname:"buxFilterConfigFilterValueTableHeaderRow",parentContainer:_1d29});
  34023. var _1d2b=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeaderLeft",width:"40%",parentContainer:_1d2a});
  34024. _1d2b.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_COLUMN_HEADER_DATA_ITEM));
  34025. var _1d2c=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeader",width:"60%",parentContainer:_1d2a});
  34026. _1d2c.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_COLUMN_HEADER_DISPLAY_VALUE_HEADER));
  34027. var _1d2d=_1d27.cognosParameter;
  34028. var _1d2e=false;
  34029. for(var i=0;i<_1d2d.length;i++){
  34030. var _1d30=0;
  34031. var _1d31=this.getWidgetContextValues(_1d2d[i]);
  34032. for(var _1d32 in _1d31){
  34033. var row=new bux.layout.TableContainerRow({parentContainer:_1d29});
  34034. var _1d34={id:this.id+"_inputValueRow_"+_1d30,role:"listitem"};
  34035. if(!_1d2e){
  34036. _1d34.tabindex=0;
  34037. _1d2e=true;
  34038. }
  34039. dojo.attr(row.domNode,_1d34);
  34040. this.addRowAccessibility(row,_1d30,_1d32,_1d31[_1d32]);
  34041. var _1d35=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"40%",valign:"top",parentContainer:row});
  34042. _1d35.set("id",this.id+"_dataItem_"+i);
  34043. _1d35.addContent(this.createLabelElement(_1d32));
  34044. var _1d36=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"60%",valign:"top",parentContainer:row});
  34045. _1d36.set("id",this.id+"_displayValue_"+i);
  34046. _1d36.addContent(this.createLabelElement(_1d31[_1d32][0]));
  34047. _1d30++;
  34048. }
  34049. }
  34050. return div;
  34051. },getWidgetContextValues:function(_1d37){
  34052. return values=_1d37["com.ibm.widget.context"].values;
  34053. },addRowAccessibility:function(row,_1d39,_1d3a,_1d3b){
  34054. var _1d3c=this.id+"_inputValueRow_label_"+_1d39;
  34055. dojo.attr(row.domNode,{"aria-labelledby":_1d3c});
  34056. var _1d3d=RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_COLUMN_HEADER_DATA_ITEM+" "+_1d3a+" "+RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_A11Y_DESC_VALUE+" "+_1d3b;
  34057. row.domNode.appendChild(this.createA11yLabel(_1d3d,_1d3c,true));
  34058. dojo.connect(row.domNode,"onkeypress",dojo.hitch(this,this._rowOnKeyPress));
  34059. },_rowOnKeyPress:function(evt){
  34060. switch(evt.keyCode){
  34061. case dojo.keys.DOWN_ARROW:
  34062. this.changeNodeFocus(evt,evt.target,evt.target.nextSibling);
  34063. break;
  34064. case dojo.keys.UP_ARROW:
  34065. this.changeNodeFocus(evt,evt.target,evt.target.previousSibling);
  34066. break;
  34067. }
  34068. },changeNodeFocus:function(evt,_1d40,_1d41){
  34069. if(!_1d41||(_1d41&&_1d41.id&&_1d41.id.indexOf("_inputValueRow_")===-1)){
  34070. return;
  34071. }
  34072. dojo.attr(_1d40,{tabindex:-1});
  34073. dojo.attr(_1d41,{tabindex:0});
  34074. dijit.focus(_1d41);
  34075. if(dojo.isIE||dojo.isTrident){
  34076. evt.keyCode=0;
  34077. }
  34078. dojo.stopEvent(evt);
  34079. },createA11yLabel:function(_1d42,_1d43,_1d44){
  34080. var _1d45=this.createLabelElement(_1d42);
  34081. var _1d46={id:_1d43};
  34082. if(_1d44){
  34083. _1d46.style="visibility:hidden;display:none";
  34084. }
  34085. dojo.attr(_1d45,_1d46);
  34086. return _1d45;
  34087. },createLabelElement:function(_1d47){
  34088. var _1d48=document.createElement("span");
  34089. _1d48.appendChild(document.createTextNode(html_encode(_1d47)));
  34090. return _1d48;
  34091. },onOK:function(){
  34092. this.hide();
  34093. this.bpAction.startProcess(this._selectedBPD_ID,this._selectedProcessAppId,this._selectedProcessName);
  34094. }});