123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095 |
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Viewer
- *| (C) Copyright IBM Corp. 2014
- *|
- *| US Government Users Restricted Rights - Use, duplication or
- *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *|
- *+------------------------------------------------------------------------+
- */
- function CViewerHelper(){
- this.m_oCV=null;
- };
- CViewerHelper.prototype.getCVObjectRef=function(){
- return this.getCV().getObjectId();
- };
- CViewerHelper.prototype.getCV=function(){
- if(this.m_oCV){
- return this.m_oCV;
- }
- return window;
- };
- CViewerHelper.prototype.getCVId=function(){
- var _1="";
- if(this.m_oCV){
- _1=this.m_oCV.getId();
- }
- return _1;
- };
- CViewerHelper.prototype.setCV=function(_2){
- this.m_oCV=_2;
- };
- function CObserver(_3){
- this.m_subject=_3;
- this.m_observers=[];
- };
- function CObserver_attach(_4,_5,_6){
- if(_4==null||typeof _4.update!="function"){
- alert("Notification Frame Work Error : attach failed");
- return false;
- }
- var _7=new CState(this.m_subject,_4,_5?_5:null,_6?_6:null);
- this.m_observers[this.m_observers.length]=_7;
- return true;
- };
- function CObserver_detach(_8){
- };
- function CObserver_hasObserver(_9){
- var _a=false;
- for(var _b=0;_b<this.m_observers.length;_b++){
- if(this.m_observers[_b].getObserver()==_9){
- _a=true;
- break;
- }
- }
- return _a;
- };
- function CObserver_notify(_c){
- var i=0;
- if(typeof _c!="undefined"&&_c!=null){
- for(i=0;i<this.m_observers.length;++i){
- if(this.m_observers[i].getEvt()==_c){
- var _e=this.m_observers[i].getObserver();
- var _f=this.m_observers[i].getCallback();
- var _10=_e.update;
- _e.update=_f;
- _e.update(this.m_observers[i]);
- _e.update=_10;
- }
- }
- }else{
- for(i=0;i<this.m_observers.length;++i){
- this.m_observers[i].getObserver().update(this.m_observers[i].getSubject());
- }
- }
- };
- CObserver.prototype.attach=CObserver_attach;
- CObserver.prototype.detach=CObserver_detach;
- CObserver.prototype.notify=CObserver_notify;
- CObserver.prototype.hasObserver=CObserver_hasObserver;
- function CState(_11,_12,_13,evt){
- this.m_subject=_11;
- this.m_observer=_12;
- this.m_callback=_13;
- this.m_evt=evt;
- };
- function CState_getObserver(){
- return this.m_observer;
- };
- function CState_getCallback(){
- return this.m_callback;
- };
- function CState_getSubject(){
- return this.m_subject;
- };
- function CState_getEvt(){
- return this.m_evt;
- };
- CState.prototype.getObserver=CState_getObserver;
- CState.prototype.getCallback=CState_getCallback;
- CState.prototype.getSubject=CState_getSubject;
- CState.prototype.getEvt=CState_getEvt;
- function CParameterValueStringOperators(_15,_16,_17,_18){
- this.m_sBetween=_15;
- this.m_sNotBetween=_16;
- this.m_sLessThan=_17;
- this.m_sGreaterThan=_18;
- };
- function CParameterValues(){
- this.m_parameterValues=new CDictionary();
- };
- CParameterValues.prototype.length=function(){
- var _19=this.m_parameterValues.keys();
- if(typeof _19=="undefined"||_19==null){
- return 0;
- }
- return _19.length;
- };
- CParameterValues.prototype.getParameterValue=function(_1a){
- if(typeof _1a!="string"||_1a==""){
- return null;
- }
- if(this.m_parameterValues.exists(_1a)){
- return this.m_parameterValues.get(_1a);
- }
- return null;
- };
- CParameterValues.prototype.getAt=function(_1b){
- if(_1b<this.length()){
- var _1c=this.m_parameterValues.keys();
- if(this.m_parameterValues.exists(_1c[_1b])){
- return this.m_parameterValues.get(_1c[_1b]);
- }
- }
- return null;
- };
- CParameterValues.prototype.addParameterValue=function(_1d,_1e){
- var _1f=this.getParameterValue(_1d);
- if(_1f==null){
- _1f=new CParameterValue();
- _1f.setName(_1d);
- }
- _1f.addParmValueItem(_1e);
- this.m_parameterValues.add(_1d,_1f);
- };
- CParameterValues.prototype.removeParameterValue=function(_20){
- return (this.m_parameterValues.remove(_20)!=null);
- };
- CParameterValues.prototype.removeSimpleParmValueItem=function(_21,_22){
- var _23=this.getParameterValue(_21);
- if(_23==null){
- return false;
- }
- return _23.removeSimpleParmValueItem(_22);
- };
- CParameterValues.prototype.addSimpleParmValueItem=function(_24,_25,_26,_27){
- if(typeof _24!="string"||_24==""){
- return null;
- }
- if(typeof _25!="string"||_25==""){
- return null;
- }
- if(typeof _26!="string"){
- return null;
- }
- if(typeof _27!="string"||(_27!="false"&&_27!="true")){
- return null;
- }
- var _28=null;
- if(this.m_parameterValues.exists(_24)==false){
- _28=new CParameterValue(_24);
- this.m_parameterValues.add(_24,_28);
- }
- _28=this.m_parameterValues.get(_24);
- if(typeof _28=="undefined"||_28==null){
- return null;
- }
- var _29=_28.getParmValueItems();
- for(var _2a=0;_2a<_29.length;++_2a){
- var _2b=_29[_2a];
- if(_2b.getDisplayValue()==_26&&_2b.getUseValue()==_25){
- return;
- }
- }
- return _28.addSimpleParmValueItem(_25,_26,_27);
- };
- CParameterValues.prototype.getSimpleParmValueItem=function(_2c,_2d){
- var _2e=this.getParameterValue(_2c);
- if(_2e!=null){
- return _2e.getSimpleParmValueItem(_2d);
- }
- return null;
- };
- CParameterValues.prototype.load=function(_2f){
- return this.loadWithOptions(_2f,true);
- };
- CParameterValues.prototype.loadWithOptions=function(_30,_31){
- try{
- var _32=_30.childNodes;
- for(var _33=0;_33<_32.length;++_33){
- var _34=_32[_33];
- if(_34.nodeType==3){
- continue;
- }
- var _35=new CParameterValue();
- if(_35.load(_34)){
- var _36=_35.name();
- if(_36!=""){
- if(_31==true||_36.indexOf("credential:")!=0){
- this.m_parameterValues.add(_36,_35);
- }
- }
- }else{
- delete _35;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CParameterValues.prototype.buildXML=function(_37,_38,_39){
- var _3a=_38.createElement(_39);
- _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
- _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
- _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
- _37.XMLBuilderSetAttributeNodeNS(_3a,"xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance");
- _37.XMLBuilderSetAttributeNodeNS(_3a,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
- _37.XMLBuilderSetAttributeNodeNS(_3a,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _38.documentElement.appendChild(_3a);
- var _3b=this.m_parameterValues.keys();
- for(var _3c=0;_3c<_3b.length;++_3c){
- if(this.m_parameterValues.exists(_3b[_3c])){
- var _3d=this.m_parameterValues.get(_3b[_3c]);
- _3d.generateXML(_37,_3a);
- }
- }
- return _3a;
- };
- CParameterValues.prototype.generateXML=function(_3e,_3f,_40){
- var _41="parameterValues";
- if(typeof _40!="undefined"&&_40!=null){
- _41=_40;
- }
- XMLBuilderSerializeNode(this.buildXML(_3e,_3f,_41));
- return XMLBuilderSerializeNode(_3f);
- };
- function CParameterValue(_42){
- this.m_name=_42;
- this.m_parmValueItems=[];
- };
- CParameterValue.prototype.name=function(){
- return this.m_name;
- };
- CParameterValue.prototype.setName=function(_43){
- this.m_name=_43;
- };
- CParameterValue.prototype.getParmValueItems=function(){
- return this.m_parmValueItems;
- };
- CParameterValue.prototype.length=function(){
- return this.m_parmValueItems.length;
- };
- CParameterValue.prototype.addParmValueItem=function(_44){
- this.m_parmValueItems.push(_44);
- };
- CParameterValue.prototype.addSimpleParmValueItem=function(_45,_46,_47){
- if(typeof _45!="string"||_45==""){
- return null;
- }
- if(typeof _46!="string"){
- return null;
- }
- if(typeof _47!="string"||(_47!="false"&&_47!="true")){
- return null;
- }
- var _48=new CSimpleParmValueItem(_45,_46,_47);
- this.m_parmValueItems.push(_48);
- return _48;
- };
- CParameterValue.prototype.removeSimpleParmValueItem=function(_49){
- if(typeof _49!="string"||_49==""){
- return false;
- }
- var _4a=[];
- var _4b=false;
- for(var _4c=0;_4c<this.length();++_4c){
- var _4d=this.m_parmValueItems[_4c];
- if(_4d instanceof CSimpleParmValueItem){
- if(_4d.getUseValue()==_49){
- _4b=true;
- continue;
- }
- }
- _4a.push(_4d);
- }
- this.m_parmValueItems=_4a;
- return _4b;
- };
- CParameterValue.prototype.getSimpleParmValueItem=function(_4e){
- if(typeof _4e!="string"||_4e==""){
- return null;
- }
- for(var _4f=0;_4f<this.length();++_4f){
- var _50=this.m_parmValueItems[_4f];
- if(_50 instanceof CSimpleParmValueItem){
- if(_50.getUseValue()==_4e){
- return _50;
- }
- }
- }
- return null;
- };
- CParameterValue.prototype.load=function(_51){
- var _52=_51.getAttributeNode("xsi:type");
- if(_52==null||_52.nodeValue!="bus:parameterValue"){
- return false;
- }
- var _53=XMLHelper_FindChildByTagName(_51,"name",false);
- if(_53==null){
- return false;
- }
- this.m_name=XMLHelper_GetText(_53);
- if(this.m_name==""){
- return false;
- }
- var _54=XMLHelper_FindChildByTagName(_51,"value",false);
- if(_54==null){
- return false;
- }
- var _55=_54.getAttributeNode("xsi:type");
- if(_55==null||_55.nodeValue!="SOAP-ENC:Array"){
- return false;
- }
- var _56=_54.getAttributeNode("SOAP-ENC:arrayType");
- if(_56==null||_56.nodeValue.indexOf("bus:parmValueItem[")==-1){
- return false;
- }
- var _57=_54.childNodes;
- for(var _58=0;_58<_57.length;++_58){
- var _59=_57[_58];
- if(_59.nodeType==3){
- continue;
- }
- var _5a=_59.getAttributeNode("xsi:type");
- if(_5a!=null){
- var _5b;
- var _5c;
- switch(_5a.nodeValue){
- case "bus:simpleParmValueItem":
- _5b=new CSimpleParmValueItem("","","");
- break;
- case "bus:boundRangeParmValueItem":
- _5b=new CBoundRangeParmValueItem();
- break;
- case "bus:unboundedEndRangeParmValueItem":
- _5b=new CUnboundedEndRangeParmValueItem();
- break;
- case "bus:unboundedStartRangeParmValueItem":
- _5b=new CUnboundedStartRangeParmValueItem();
- break;
- case "bus:hierarchicalParmValueItem":
- _5b=new CHierarchicalParmValueItem();
- break;
- default:
- return false;
- }
- _5c=_5b.load(_59);
- if(_5c){
- this.m_parmValueItems.push(_5b);
- }else{
- delete _5b;
- }
- }
- }
- return true;
- };
- CParameterValue.prototype.generateXML=function(_5d,_5e){
- var _5f=_5e.ownerDocument;
- var _60=_5f.createElement("item");
- _5d.XMLBuilderSetAttributeNodeNS(_60,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
- _5e.appendChild(_60);
- var _61=_5d.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",_5f);
- _5d.XMLBuilderSetAttributeNodeNS(_61,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _61.appendChild(_5f.createTextNode(this.m_name));
- _60.appendChild(_61);
- var _62=_5d.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_5f);
- _5d.XMLBuilderSetAttributeNodeNS(_62,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
- _5d.XMLBuilderSetAttributeNodeNS(_62,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _60.appendChild(_62);
- for(var _63=0;_63<this.m_parmValueItems.length;++_63){
- if(typeof this.m_parmValueItems[_63].generateXML!="undefined"){
- this.m_parmValueItems[_63].generateXML(_5d,_62);
- }
- }
- };
- CParameterValue.prototype.toString=function(_64){
- var _65="";
- for(var _66=0;_66<this.m_parmValueItems.length;++_66){
- if(_65!=""){
- _65+=", ";
- }
- if(typeof this.m_parmValueItems[_66].toString!="undefined"){
- _65+=this.m_parmValueItems[_66].toString(_64);
- }
- }
- return _65;
- };
- function CParmValueItem(){
- this.initialize("true");
- };
- CParmValueItem.prototype.getInclusiveValue=function(){
- return this.m_inclusiveValue;
- };
- CParmValueItem.prototype.setInclusiveValue=function(_67){
- this.m_inclusiveValue=_67;
- };
- CParmValueItem.prototype.initialize=function(_68){
- this.m_inclusiveValue=_68;
- };
- CParmValueItem.prototype.load=function(_69){
- this.m_inclusiveValue="true";
- var _6a=XMLHelper_FindChildByTagName(_69,"inclusive",false);
- if(_6a!=null){
- var _6b=XMLHelper_GetText(_6a);
- if(_6b=="true"||_6b=="false"){
- this.m_inclusiveValue=_6b;
- }
- }
- };
- CParmValueItem.prototype.generateXML=function(_6c,_6d){
- var _6e=_6d.ownerDocument;
- var _6f=_6c.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:inclusive",_6e);
- _6c.XMLBuilderSetAttributeNodeNS(_6f,"xsi:type","xs:boolean","http://www.w3.org/2001/XMLSchema-instance");
- _6f.appendChild(_6e.createTextNode(this.m_inclusiveValue));
- _6d.appendChild(_6f);
- };
- function CSimpleParmValueItem(_70,_71,_72){
- CSimpleParmValueItem.baseclass.initialize.call(this,_72);
- this.m_useValue=_70;
- this.m_displayValue=_71;
- };
- CSimpleParmValueItem.prototype=new CParmValueItem();
- CSimpleParmValueItem.prototype.constructor=CSimpleParmValueItem;
- CSimpleParmValueItem.baseclass=CParmValueItem.prototype;
- CSimpleParmValueItem.prototype.getUseValue=function(){
- return this.m_useValue;
- };
- CSimpleParmValueItem.prototype.getDisplayValue=function(){
- return this.m_displayValue;
- };
- CSimpleParmValueItem.prototype.getParmValueItem=function(){
- return this.m_parmValueItem;
- };
- CSimpleParmValueItem.prototype.setDisplayValue=function(_73){
- this.m_displayValue=_73;
- };
- CSimpleParmValueItem.prototype.setUseValue=function(_74){
- this.m_useValue=_74;
- };
- CSimpleParmValueItem.prototype.toString=function(_75){
- return this.getDisplayValue();
- };
- CSimpleParmValueItem.prototype.load=function(_76){
- CSimpleParmValueItem.baseclass.load.call(this,_76);
- var _77=XMLHelper_FindChildByTagName(_76,"use",false);
- if(_77==null){
- return false;
- }
- var _78=XMLHelper_GetText(_77);
- if(_78==""){
- return false;
- }
- this.m_useValue=_78;
- var _79=XMLHelper_FindChildByTagName(_76,"display",false);
- if(_79!=null){
- this.m_displayValue=XMLHelper_GetText(_79);
- }
- return true;
- };
- CSimpleParmValueItem.prototype.generateXML=function(_7a,_7b){
- var _7c=_7b.ownerDocument;
- var _7d=_7c.createElement("item");
- _7a.XMLBuilderSetAttributeNodeNS(_7d,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- _7b.appendChild(_7d);
- CSimpleParmValueItem.baseclass.generateXML.call(this,_7a,_7d);
- var _7e=_7a.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",_7c);
- _7a.XMLBuilderSetAttributeNodeNS(_7e,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _7e.appendChild(_7c.createTextNode(this.m_useValue));
- _7d.appendChild(_7e);
- var _7f=_7a.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",_7c);
- _7a.XMLBuilderSetAttributeNodeNS(_7f,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _7f.appendChild(_7c.createTextNode(this.m_displayValue));
- _7d.appendChild(_7f);
- };
- function CBoundRangeParmValueItem(){
- CBoundRangeParmValueItem.baseclass.initialize.call(this,"true");
- this.m_start=null;
- this.m_end=null;
- };
- CBoundRangeParmValueItem.prototype=new CParmValueItem();
- CBoundRangeParmValueItem.prototype.constructor=CBoundRangeParmValueItem;
- CBoundRangeParmValueItem.baseclass=CParmValueItem.prototype;
- CBoundRangeParmValueItem.prototype.setStart=function(_80){
- this.m_start=_80;
- };
- CBoundRangeParmValueItem.prototype.getStart=function(){
- return this.m_start;
- };
- CBoundRangeParmValueItem.prototype.setEnd=function(end){
- this.m_end=end;
- };
- CBoundRangeParmValueItem.prototype.getEnd=function(){
- return this.m_end;
- };
- CBoundRangeParmValueItem.prototype.toString=function(_82){
- return CViewerCommon.getMessage(_82.m_sBetween,[this.m_start.getDisplayValue(),this.m_end.getDisplayValue()]);
- };
- CBoundRangeParmValueItem.prototype.load=function(_83){
- CBoundRangeParmValueItem.baseclass.load.call(this,_83);
- this.m_start=new CSimpleParmValueItem("","","");
- this.m_start.load(XMLHelper_FindChildByTagName(_83,"start",false));
- this.m_end=new CSimpleParmValueItem("","","");
- this.m_end.load(XMLHelper_FindChildByTagName(_83,"end",false));
- return true;
- };
- CBoundRangeParmValueItem.prototype.generateXML=function(_84,_85){
- var _86=_85.ownerDocument;
- var _87=_86.createElement("item");
- _84.XMLBuilderSetAttributeNodeNS(_87,"xsi:type","bus:boundRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- _85.appendChild(_87);
- CBoundRangeParmValueItem.baseclass.generateXML.call(this,_84,_87);
- var _88=_84.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:start",_86);
- _87.appendChild(_88);
- this.m_start.generateXML(_84,_88);
- var _89=_84.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:end",_86);
- _87.appendChild(_89);
- this.m_end.generateXML(_84,_89);
- };
- function CUnboundedStartRangeParmValueItem(){
- CUnboundedStartRangeParmValueItem.baseclass.initialize.call(this,"true");
- this.m_end=null;
- };
- CUnboundedStartRangeParmValueItem.prototype=new CParmValueItem();
- CUnboundedStartRangeParmValueItem.prototype.constructor=CUnboundedStartRangeParmValueItem;
- CUnboundedStartRangeParmValueItem.baseclass=CParmValueItem.prototype;
- CUnboundedStartRangeParmValueItem.prototype.setEnd=function(end){
- this.m_end=end;
- };
- CUnboundedStartRangeParmValueItem.prototype.getEnd=function(){
- return this.m_end;
- };
- CUnboundedStartRangeParmValueItem.prototype.load=function(_8b){
- CUnboundedStartRangeParmValueItem.baseclass.load.call(this,_8b);
- this.m_end=new CSimpleParmValueItem("","","");
- this.m_end.load(XMLHelper_FindChildByTagName(_8b,"end",false));
- return true;
- };
- CUnboundedStartRangeParmValueItem.prototype.generateXML=function(_8c,_8d){
- var _8e=_8d.ownerDocument;
- var _8f=_8e.createElement("item");
- _8c.XMLBuilderSetAttributeNodeNS(_8f,"xsi:type","bus:unboundedStartRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- _8d.appendChild(_8f);
- CUnboundedStartRangeParmValueItem.baseclass.generateXML.call(this,_8c,_8f);
- var _90=_8c.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:end",_8e);
- _8f.appendChild(_90);
- this.m_end.generateXML(_8c,_90);
- };
- CUnboundedStartRangeParmValueItem.prototype.toString=function(_91){
- return _91.m_sLessThan+" "+this.m_end.getDisplayValue();
- };
- function CUnboundedEndRangeParmValueItem(){
- CUnboundedEndRangeParmValueItem.baseclass.initialize.call(this,"true");
- this.m_start=null;
- };
- CUnboundedEndRangeParmValueItem.prototype=new CParmValueItem();
- CUnboundedEndRangeParmValueItem.prototype.constructor=CUnboundedEndRangeParmValueItem;
- CUnboundedEndRangeParmValueItem.baseclass=CParmValueItem.prototype;
- CUnboundedEndRangeParmValueItem.prototype.setStart=function(_92){
- this.m_start=_92;
- };
- CUnboundedEndRangeParmValueItem.prototype.getStart=function(){
- return this.m_start;
- };
- CUnboundedEndRangeParmValueItem.prototype.load=function(_93){
- CUnboundedEndRangeParmValueItem.baseclass.load.call(this,_93);
- this.m_start=new CSimpleParmValueItem("","","");
- this.m_start.load(XMLHelper_FindChildByTagName(_93,"start",false));
- return true;
- };
- CUnboundedEndRangeParmValueItem.prototype.generateXML=function(_94,_95){
- var _96=_95.ownerDocument;
- var _97=_96.createElement("item");
- _94.XMLBuilderSetAttributeNodeNS(_97,"xsi:type","bus:unboundedEndRangeParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- _95.appendChild(_97);
- CUnboundedEndRangeParmValueItem.baseclass.generateXML.call(this,_94,_97);
- var _98=_94.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:start",_96);
- _97.appendChild(_98);
- this.m_start.generateXML(_94,_98);
- };
- CUnboundedEndRangeParmValueItem.prototype.toString=function(_99){
- return _99.m_sGreaterThan+" "+this.m_start.getDisplayValue();
- };
- function CHierarchicalParmValueItem(){
- CHierarchicalParmValueItem.baseclass.initialize.call(this,"true");
- this.m_value=null;
- this.m_subNodes=[];
- };
- CHierarchicalParmValueItem.prototype=new CParmValueItem();
- CHierarchicalParmValueItem.prototype.constructor=CHierarchicalParmValueItem;
- CHierarchicalParmValueItem.baseclass=CParmValueItem.prototype;
- CHierarchicalParmValueItem.prototype.getValue=function(){
- return this.m_value;
- };
- CHierarchicalParmValueItem.prototype.getSubNodes=function(){
- return this.m_subNodes;
- };
- CHierarchicalParmValueItem.prototype.setValue=function(_9a){
- this.m_value=_9a;
- };
- CHierarchicalParmValueItem.prototype.setSubNodes=function(_9b){
- this.m_subNodes=_9b;
- };
- CHierarchicalParmValueItem.prototype.load=function(_9c){
- CHierarchicalParmValueItem.baseclass.load.call(this,_9c);
- this.m_value=new CSimpleParmValueItem("","","");
- this.m_value.load(XMLHelper_FindChildByTagName(_9c,"value",false));
- var _9d=XMLHelper_FindChildByTagName(_9c,"subNodes",false);
- if(_9d==null){
- return false;
- }
- var _9e=_9d.getAttributeNode("xsi:type");
- if(_9e==null||_9e.nodeValue!="SOAP-ENC:Array"){
- return false;
- }
- var _9f=_9d.getAttributeNode("SOAP-ENC:arrayType");
- if(_9f==null||_9f.nodeValue!="bus:hierarchicalParmValueItem[]"){
- return false;
- }
- var _a0=_9d.childNodes;
- for(var _a1=0;_a1<_a0.length;++_a1){
- var _a2=new CHierarchicalParmValueItem();
- _a2.load(_a0[_a1]);
- this.m_subNodes.push(_a2);
- }
- return true;
- };
- CHierarchicalParmValueItem.prototype.generateXML=function(_a3,_a4){
- var _a5=_a4.ownerDocument;
- var _a6=_a5.createElement("item");
- _a3.XMLBuilderSetAttributeNodeNS(_a6,"xsi:type","bus:hierarchicalParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- _a4.appendChild(_a6);
- CHierarchicalParmValueItem.baseclass.generateXML.call(this,_a3,_a6);
- var _a7=_a3.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_a5);
- _a6.appendChild(_a7);
- this.m_value.generateXML(_a3,_a7);
- var _a8=_a3.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:subNodes",_a5);
- _a3.XMLBuilderSetAttributeNodeNS(_a8,"SOAP-ENC:arrayType","bus:hierarchicalParmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
- _a3.XMLBuilderSetAttributeNodeNS(_a8,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _a6.appendChild(_a8);
- for(var _a9=0;_a9<this.m_subNodes.length;++_a9){
- this.m_subNodes[_a9].generateXML(_a3,_a8);
- }
- };
- CHierarchicalParmValueItem.prototype.toString=function(){
- return "";
- };
- function XMLParser(s,_ab){
- if(s==null){
- return null;
- }
- if(/^\s*</.test(s)){
- s=s.replace(/^\s*/,"");
- if(s.charAt(1)=="/"){
- var _ac=new RegExp("^</"+_ab.getName()+"\\s*>","gi");
- if(!_ac.test(s)){
- alert("invalid XML "+_ab.getName()+"\n"+s);
- return null;
- }
- return XMLParser(s.replace(RegExp.lastMatch,""),_ab.parentNode);
- }else{
- var _ad=/^\s*<([\w:\-_\.]+)/;
- if(_ad.test(s)){
- var _ae=RegExp.$1;
- var e=new XMLElement(_ae,_ab);
- var _b0=new RegExp("^<"+_ae+"[^>]*>");
- s=s.replace(_b0,"");
- var _b1=RegExp.lastMatch;
- var _b2=/([\w:\-_\.]+)="([^"]*)"/gi;
- var _b3=_b1.match(_b2);
- if(_b3!=null){
- for(var i=0;i<_b3.length;i++){
- var _b5=_b3[i];
- (/([\w:\-_\.]+)\s*=\s*"(.*)"/).test(_b5);
- e.setAttribute(RegExp.$1,RegExp.$2);
- }
- }
- if(!(/\/>$/).test(_b1)){
- XMLParser(s,e);
- return e;
- }else{
- XMLParser(s,_ab);
- return e;
- }
- }
- }
- }else{
- if(s&&_ab){
- var _b6=new RegExp("([^<]*)</"+_ab.getName()+"\\s*[^>]*>","gi");
- _b6.test(s);
- var _b7=RegExp.$1;
- _ab.setValue(_b7);
- return (XMLParser(s.replace(_b7,""),_ab));
- }
- }
- return null;
- };
- function XMLElement(s,_b9){
- this.nodeName=s;
- this.nodeValue="";
- this.attributes=[];
- this.childNodes=[];
- this.parentNode=_b9;
- if(this.parentNode){
- this.parentNode.appendChild(this);
- }
- };
- XMLElement.prototype.appendChild=function(e){
- this.childNodes[this.childNodes.length]=e;
- };
- XMLElement.prototype.hasChildNodes=function(){
- if(this.childNodes.length>0){
- return true;
- }else{
- return false;
- }
- };
- XMLElement.prototype.findChildByName=function(n,_bc){
- if(this.getName()==n){
- return (this);
- }
- for(var i=0;i<this.childNodes.length;i++){
- if(this.childNodes[i].getName()==n){
- return this.childNodes[i];
- }
- }
- if(_bc!=false){
- for(i=0;i<this.childNodes.length;i++){
- var _be=this.childNodes[i].findChildByName(n,_bc);
- if(_be){
- return _be;
- }
- }
- }
- return null;
- };
- XMLElement.prototype.findChildWithAttribute=function(_bf,val){
- for(var i=0;i<this.childNodes.length;i++){
- if(this.childNodes[i].getAttribute(_bf)==val){
- return this.childNodes[i];
- }
- }
- return null;
- };
- XMLElement.prototype.getElementsByTagName=function(s,_c3){
- var a=[];
- for(var i=0;i<this.childNodes.length;i++){
- if(this.childNodes[i].getName()==s){
- a[a.length]=this.childNodes[i];
- }
- }
- if(_c3!=false){
- for(i=0;i<this.childNodes.length;i++){
- var _c6=this.childNodes[i].getElementsByTagName(s);
- for(var j=0;j<_c6.length;j++){
- a[a.length]=_c6[j];
- }
- }
- }
- return a;
- };
- XMLElement.prototype.getName=function(){
- return this.nodeName;
- };
- XMLElement.prototype.getValue=function(){
- return this.nodeValue;
- };
- XMLElement.prototype.setAttribute=function(a,v){
- this.attributes["_"+a]=v;
- };
- XMLElement.prototype.setValue=function(v){
- this.nodeValue=v;
- };
- XMLElement.prototype.getAttribute=function(a){
- var _cc="";
- if(typeof sXmlDecode=="function"){
- _cc=sXmlDecode(this.attributes["_"+a]);
- }else{
- _cc=this.attributes["_"+a];
- }
- return (_cc==null?"":_cc);
- };
- XMLElement.prototype.toString=function(){
- var s="<"+this.getName();
- for(var i in this.attributes){
- s+=" "+i.substring(1)+"=\""+this.attributes[i]+"\"";
- }
- s+=">"+this.getValue();
- for(var j=0;j<this.childNodes.length;j++){
- s+=this.childNodes[j].toString();
- }
- s+="</"+this.getName()+">";
- return s;
- };
- function XMLBuilderLoadXMLFromString(_d0,_d1){
- var _d2=null;
- if(typeof DOMParser!="undefined"){
- _d2=new DOMParser().parseFromString(_d0,"application/xml");
- }else{
- if(typeof ActiveXObject!="undefined"){
- try{
- _d2=new ActiveXObject("Microsoft.XMLDOM");
- _d2.loadXML(_d0);
- }
- catch(e){
- }
- }
- }
- return _d2;
- };
- function XMLBuilderCreateXMLDocument(_d3,_d4,_d5){
- var _d6=null;
- _d4=_d4||"";
- _d5=_d5||null;
- if(document.implementation&&document.implementation.createDocument){
- if(typeof _d4=="undefined"){
- _d4="http://www.w3.org/2000/xmlns/";
- }
- _d6=document.implementation.createDocument(_d4,_d3,_d5);
- }else{
- if(typeof ActiveXObject!="undefined"){
- try{
- _d6=new ActiveXObject("Microsoft.XMLDOM");
- var _d7=_d6.createNode(1,_d3,_d4);
- _d6.appendChild(_d7);
- }
- catch(e){
- }
- }
- }
- return _d6;
- };
- function XMLBuilderCreateElementNS(_d8,_d9,_da){
- var _db=null;
- if(typeof _da.createElementNS!="undefined"){
- if(typeof _d8=="undefined"){
- _d8="http://www.w3.org/2000/xmlns/";
- }
- _db=_da.createElementNS(_d8,_d9);
- }else{
- if(typeof _da.createNode!="undefined"){
- _db=_da.createNode(1,_d9,_d8);
- }
- }
- return _db;
- };
- function XMLBuilderSetAttributeNodeNS(_dc,_dd,_de,_df){
- if(typeof _dc.setAttributeNS!="undefined"){
- if(typeof _df=="undefined"){
- _df="http://www.w3.org/2000/xmlns/";
- }
- _dc.setAttributeNS(_df,_dd,_de);
- }else{
- if(typeof _dc.ownerDocument!="undefined"&&typeof _dc.ownerDocument.createNode!="undefined"){
- var _e0=_dc.ownerDocument.createNode(2,_dd,_df);
- _e0.nodeValue=_de;
- _dc.setAttributeNode(_e0);
- }
- }
- };
- function XMLBuilderSerializeNode(_e1){
- var _e2="";
- if(typeof XMLSerializer!="undefined"){
- try{
- _e2=new XMLSerializer().serializeToString(_e1);
- }
- catch(e){
- }
- }else{
- if(typeof _e1=="object"&&typeof _e1.xml!="undefined"){
- _e2=_e1.xml;
- }
- }
- return _e2.replace(/^\s+/g,"").replace(/\s+$/g,"");
- };
- function XMLHelper_GetText(_e3,_e4){
- var _e5="";
- var _e6=_e3.childNodes;
- for(var i=0;i<_e6.length;++i){
- if(_e6[i].nodeType==3){
- _e5+=_e6[i].nodeValue;
- }else{
- if(_e6[i].nodeName=="Value"){
- _e5+=_e6[i].getAttribute("display");
- }else{
- if(_e4){
- _e5+=XMLHelper_GetText(_e6[i],true);
- }
- }
- }
- }
- return _e5;
- };
- function XMLHelper_GetLocalName(_e8){
- if(typeof _e8.baseName!="undefined"){
- return _e8.baseName;
- }
- return _e8.localName;
- };
- function XMLHelper_FindChildByTagName(_e9,_ea,_eb){
- if(typeof _eb=="undefined"||(_eb!=true&&_eb!=false)){
- _eb=true;
- }
- if(XMLHelper_GetLocalName(_e9)==_ea){
- return (_e9);
- }
- var i;
- for(i=0;i<_e9.childNodes.length;i++){
- if(XMLHelper_GetLocalName(_e9.childNodes[i])==_ea){
- return _e9.childNodes[i];
- }
- }
- if(_eb!=false){
- for(i=0;i<_e9.childNodes.length;i++){
- var _ed=XMLHelper_FindChildByTagName(_e9.childNodes[i],_ea,_eb);
- if(_ed){
- return _ed;
- }
- }
- }
- return null;
- };
- function XMLHelper_FindChildrenByTagName(_ee,_ef,_f0){
- if(typeof _f0=="undefined"||(_f0!=true&&_f0!=false)){
- _f0=true;
- }
- var _f1=[];
- var _f2=_ee.childNodes;
- for(var _f3=0;_f3<_f2.length;_f3++){
- if(XMLHelper_GetLocalName(_f2[_f3])==_ef){
- _f1[_f1.length]=_f2[_f3];
- }
- if(_f0===true){
- var _f4=XMLHelper_FindChildrenByTagName(_f2[_f3],_ef,_f0);
- if(_f4.length>0){
- _f1=_f1.concat(_f4);
- }
- }
- }
- return _f1;
- };
- function XMLHelper_GetFirstChildElement(oEl){
- var _f6=null;
- if(oEl&&oEl.childNodes&&oEl.childNodes.length){
- for(var i=0;i<oEl.childNodes.length;i++){
- if(oEl.childNodes[i].nodeType==1){
- _f6=oEl.childNodes[i];
- break;
- }
- }
- }
- return _f6;
- };
- function XMLHelper_FindChildrenByAttribute(_f8,_f9,_fa,_fb,_fc){
- if(typeof _fb=="undefined"||(_fb!=true&&_fb!=false)){
- _fb=true;
- }
- if(typeof _fa!="string"&&typeof _fa!="number"){
- _fa=null;
- }else{
- _fa=_fa.toString();
- }
- var _fd=[];
- var _fe=_f8.childNodes;
- for(var _ff=0;_ff<_fe.length;_ff++){
- var _100=_fe[_ff];
- if(_100.nodeType==1){
- var _101=_100.getAttribute(_f9);
- if(_101!==null){
- if(_fa===null||_101==_fa){
- if(_fc){
- return [_100];
- }else{
- _fd[_fd.length]=_100;
- }
- }
- }
- if(_fb===true){
- var _102=XMLHelper_FindChildrenByAttribute(_100,_f9,_fa,_fb,_fc);
- if(_102.length>0){
- if(_fc){
- if(_102.length==1){
- return _102;
- }else{
- return [_102[0]];
- }
- }else{
- _fd=_fd.concat(_102);
- }
- }
- }
- }
- }
- return _fd;
- };
- var DICTIONARY_INVALID_KEY=-1;
- var DICTIONARY_SUCCESS=1;
- function CDictionary(){
- this.m_aValues={};
- };
- function CDictionary_add(sKey,_104){
- if(typeof sKey!="string"&&typeof sKey!="number"){
- return DICTIONARY_INVALID_KEY;
- }
- this.m_aValues[sKey]=_104;
- return DICTIONARY_SUCCESS;
- };
- function CDictionary_exists(sKey){
- if(typeof sKey!="string"&&typeof sKey!="number"){
- return false;
- }
- return (typeof this.m_aValues[sKey]!="undefined");
- };
- function CDictionary_get(sKey){
- if(typeof sKey!="string"&&typeof sKey!="number"){
- return null;
- }
- if(this.exists(sKey)===true){
- return this.m_aValues[sKey];
- }else{
- return null;
- }
- };
- function CDictionary_keys(){
- var _107=[];
- for(var _108 in this.m_aValues){
- _107.push(_108);
- }
- return _107.sort();
- };
- function CDictionary_remove(sKey){
- if(typeof sKey!="string"&&typeof sKey!="number"){
- return DICTIONARY_INVALID_KEY;
- }
- var _10a=this.get(sKey);
- delete this.m_aValues[sKey];
- return _10a;
- };
- function CDictionary_removeAll(){
- this.m_aValues=[];
- return DICTIONARY_SUCCESS;
- };
- function CDictionary_append(_10b){
- if(_10b instanceof CDictionary&&_10b.keys().length>0){
- var _10c=_10b.keys();
- for(var _10d=0;_10d<_10c.length;_10d++){
- this.add(_10c[_10d],_10b.get(_10c[_10d]));
- }
- }
- };
- CDictionary.prototype.add=CDictionary_add;
- CDictionary.prototype.exists=CDictionary_exists;
- CDictionary.prototype.get=CDictionary_get;
- CDictionary.prototype.keys=CDictionary_keys;
- CDictionary.prototype.remove=CDictionary_remove;
- CDictionary.prototype.removeAll=CDictionary_removeAll;
- CDictionary.prototype.append=CDictionary_append;
- function CognosTabControl(_10e,_10f){
- this._init();
- this._outsideContainer=_10e;
- this._callback=_10f;
- };
- CognosTabControl.prototype._init=function(){
- this._tabs=null;
- this._tabControlNode=null;
- this._scrollButtonsVisible=false;
- this._scrollLeftButton=null;
- this._scrollRightButton=null;
- this._selectedTab=null;
- this._wrapperDiv=null;
- this._topContainer=null;
- this._seperator=null;
- this._isSavedOutput=false;
- this._isHighContrast=false;
- };
- CognosTabControl.prototype.destroy=function(){
- if(this._wrapperDiv){
- this._wrapperDiv.parentNode.removeChild(this._wrapperDiv);
- delete this._wrapperDiv;
- this._wrapperDiv=null;
- }
- };
- CognosTabControl.prototype.setHighContrast=function(_110){
- this._isHighContrast=_110;
- };
- CognosTabControl.prototype.isHighContrast=function(){
- return this._isHighContrast;
- };
- CognosTabControl.prototype.setSpaceSaverContainer=function(node){
- this._spaceSaverContainer=node;
- };
- CognosTabControl.prototype.useAbsolutePosition=function(_112){
- this._useAbsolutePosition=_112;
- };
- CognosTabControl.prototype.setScrollAttachNode=function(node){
- this._scrollAttachNode=node;
- };
- CognosTabControl.prototype.setIsSavedOutput=function(_114){
- this._isSavedOutput=_114;
- };
- CognosTabControl.prototype.isSavedOutput=function(){
- return this._isSavedOutput;
- };
- CognosTabControl.prototype.getSelectedTabId=function(){
- if(this._selectedTab){
- return this._selectedTab.getId();
- }
- return null;
- };
- CognosTabControl.prototype.getSelectedTab=function(){
- return this._selectedTab?this._selectedTab:null;
- };
- CognosTabControl.prototype.isTopAligned=function(){
- return this._isTopAligned;
- };
- CognosTabControl.prototype.getWrapperDiv=function(){
- return this._wrapperDiv;
- };
- CognosTabControl.prototype.getVisibleWidth=function(){
- var _115=this._scrollRightButton?this._scrollRightButton.getWidth()+11:0;
- return this._wrapperDiv.clientWidth-_115;
- };
- CognosTabControl.prototype.getMaxRightScroll=function(){
- var _116=this._scrollRightButton?this._scrollRightButton.getWidth()+11:0;
- return this._totalWrapperWidth+_116+8-this._wrapperDiv.clientWidth;
- };
- CognosTabControl.prototype.hide=function(){
- this._topContainer.style.display="none";
- };
- CognosTabControl.prototype.resetPosition=function(){
- if(this._useAbsolutePosition===true){
- this._outsideContainer.srollLeft="0px";
- this._outsideContainer.scrollTop="0px";
- this._topContainer.style.top="";
- this._topContainer.style.bottom="";
- this._topContainer.style.left="0px";
- if(this._isTopAligned){
- this._topContainer.style.top="0px";
- }else{
- this._topContainer.style.bottom="0px";
- }
- }
- };
- CognosTabControl.prototype.render=function(_117){
- this._updateTabInfo(_117);
- if(!this._tabControlNode){
- var _118=this;
- var _119=this._scrollAttachNode?this._scrollAttachNode:this._outsideContainer;
- if(window.attachEvent){
- window.attachEvent("onresize",function(){
- _118.onResize();
- });
- if(this._useAbsolutePosition===true){
- _119.attachEvent("onscroll",function(){
- _118.onContainerScroll();
- });
- }
- }else{
- window.addEventListener("resize",function(){
- _118.onResize();
- },false);
- if(this._useAbsolutePosition===true){
- _119.addEventListener("scroll",function(){
- _118.onContainerScroll();
- },false);
- }
- }
- this._outsideContainer.originalClassName=this._outsideContainer.className;
- this._outsideContainer.className=this._outsideContainer.className+(this._isTopAligned?" ct_controlTop":" ct_controlBottom");
- this._topContainer=document.createElement("div");
- this._topContainer.className="ct_wrapperDiv";
- if(this._useAbsolutePosition===true){
- this._topContainer.style.width="100%";
- this._topContainer.style.position="absolute";
- this._topContainer.style.left="0px";
- if(this._isTopAligned){
- this._topContainer.style.top="0px";
- }else{
- this._topContainer.style.bottom="0px";
- }
- }
- if(this._isTopAligned&&this._outsideContainer.firstChild){
- this._outsideContainer.insertBefore(this._topContainer,this._outsideContainer.firstChild);
- }else{
- this._outsideContainer.appendChild(this._topContainer);
- }
- this._wrapperDiv=document.createElement("div");
- this._wrapperDiv.setAttribute("role","presentation");
- this._wrapperDiv.className="ct_wrapperDiv";
- this._topContainer.appendChild(this._wrapperDiv);
- this._tabControlNode=document.createElement("div");
- this._tabControlNode.setAttribute("role","tablist");
- this._tabControlNode.className="ct_control";
- this._wrapperDiv.appendChild(this._tabControlNode);
- this._totalWrapperWidth=0;
- for(var i=0;i<this._tabs.length;i++){
- var tab=this._tabs[i];
- tab.render(this._tabControlNode);
- this._totalWrapperWidth+=this._tabs[i].getWidth();
- }
- var _11c=0;
- if(this._tabs[0]){
- _11c=this._tabs[0].getHeight();
- }
- this._wrapperDiv.style.height=_11c+5+"px";
- if(this._spaceSaverContainer){
- this.spaceSaverDiv=document.createElement("div");
- this.spaceSaverDiv.style.height=_11c+5+"px";
- this.spaceSaverDiv.style.position="relative";
- this.spaceSaverDiv.style.display="block";
- this._spaceSaverContainer.appendChild(this.spaceSaverDiv);
- }
- this._createSeperator();
- }else{
- this.resetPosition();
- }
- this._topContainer.style.display="";
- this.onResize();
- this.selectTab(_117.currentTabId,false);
- if(this._selectedTab){
- this._selectedTab.scrollIntoView();
- this.updateScrollButtons();
- }
- };
- CognosTabControl.prototype.onContainerScroll=function(){
- var _11d=this._scrollAttachNode?this._scrollAttachNode:this._topContainer;
- this._topContainer.style.left=_11d.scrollLeft+"px";
- if(this._isTopAligned){
- this._topContainer.style.top=_11d.scrollTop+"px";
- }else{
- this._topContainer.style.bottom=(-_11d.scrollTop)+"px";
- }
- };
- CognosTabControl.prototype._resetTabControl=function(){
- if(this._outsideContainer.originalClassName){
- this._outsideContainer.className=this._outsideContainer.originalClassName;
- }else{
- this._outsideContainer.className="";
- }
- if(this._topContainer){
- var node=this._outsideContainer.removeChild(this._topContainer);
- node=null;
- }
- this._init();
- };
- CognosTabControl.prototype._updateTabInfo=function(_11f){
- this._isTopAligned=_11f.position=="topLeft"?true:false;
- var tabs=_11f.tabs;
- if(this._tabs){
- if(this._tabs.length!=tabs.length){
- this._resetTabControl();
- }else{
- for(var i=0;i<this._tabs.length;i++){
- if(tabs[i].id!=this._tabs[i].getId()){
- this._resetTabControl();
- break;
- }
- }
- }
- }
- if(!this._tabs){
- this._tabs=[];
- if(!tabs){
- return;
- }
- for(var ii=0;ii<tabs.length;ii++){
- var tab=new CognosTab(tabs[ii],this,ii);
- this._tabs.push(tab);
- }
- }
- };
- CognosTabControl.prototype.getScrollPos=function(){
- return this._wrapperDiv.scrollLeft;
- };
- CognosTabControl.prototype.scrollTo=function(_124){
- this._wrapperDiv.scrollLeft=_124;
- this.updateScrollButtons();
- };
- CognosTabControl.prototype.onResize=function(evt){
- if(this._wrapperDiv.offsetWidth<this._totalWrapperWidth){
- this._showScrollButtons();
- this.updateScrollButtons();
- if(this._selectedTab){
- this._selectedTab.scrollIntoView();
- }
- if(this._scrollRightButton.isDisabled()){
- this.scrollTo(this.getMaxRightScroll());
- }
- }else{
- this._hideScrollButtons();
- this.scrollTo(0);
- }
- };
- CognosTabControl.prototype._showScrollButtons=function(){
- if(this._scrollButtonsVisible){
- return;
- }
- if(!this._scrollLeftButton){
- var _126=0;
- if(this._tabs[0]){
- _126=this._tabs[0].getHeight();
- }
- this._scrollLeftButton=new CognosScrollButton("left",_126,this);
- this._scrollLeftButton.render(this._topContainer);
- this._scrollRightButton=new CognosScrollButton("right",_126,this);
- this._scrollRightButton.render(this._topContainer);
- }
- this._scrollButtonsVisible=true;
- this._scrollLeftButton.show();
- this._scrollRightButton.show();
- this._tabControlNode.style.left=this._scrollLeftButton.getWidth()-2+"px";
- };
- CognosTabControl.prototype.updateScrollButtons=function(){
- if(this._scrollLeftButton){
- this._scrollLeftButton.update();
- }
- if(this._scrollRightButton){
- this._scrollRightButton.update();
- }
- };
- CognosTabControl.prototype._hideScrollButtons=function(){
- if(!this._scrollButtonsVisible){
- return;
- }
- this._scrollButtonsVisible=false;
- this._tabControlNode.style.left="0px";
- this._scrollLeftButton.hide();
- this._scrollRightButton.hide();
- };
- CognosTabControl.prototype._createSeperator=function(){
- this._seperator=document.createElement("div");
- this._seperator.setAttribute("role","presendation");
- this._seperator.setAttribute("style","");
- this._seperator.className="ct_verticalLine";
- this._seperator.setAttribute("role","presentation");
- this._tabControlNode.appendChild(this._seperator);
- };
- CognosTabControl.prototype.selectTab=function(_127,_128,evt){
- if(!evt){
- evt=window.event;
- }
- for(var i=0;i<this._tabs.length;i++){
- var tab=this._tabs[i];
- var _12c=tab.getId()==_127;
- tab.select(_12c);
- if(_12c){
- this._selectedTab=tab;
- if(_128&&this._callback){
- this._callback(_127);
- }
- }
- if(_128){
- tab.focus(_12c);
- }
- }
- if(evt&&window.stopEventBubble){
- window.stopEventBubble(evt);
- }
- return false;
- };
- CognosTabControl.prototype.handleKeyDown=function(evt,_12e){
- if(!evt){
- evt=window.event;
- }
- if(!evt){
- return;
- }
- if(evt.keyCode=="39"||evt.keyCode=="37"){
- if(evt.keyCode=="39"){
- _12e++;
- if(_12e>=this._tabs.length){
- _12e=0;
- }
- }else{
- _12e--;
- if(_12e<0){
- _12e=this._tabs.length-1;
- }
- }
- this._tabs[_12e].focus();
- this._tabs[_12e].scrollIntoView();
- }else{
- if(evt.keyCode=="32"||evt.keyCode=="13"){
- var _12f=this._tabs[_12e].getId();
- this.selectTab(_12f,true);
- }
- }
- };
- function CognosTab(_130,_131,_132){
- if(!_130){
- return;
- }
- this._id=_130.id;
- this._label=_130.label;
- this._position=_132;
- this._contentClassName=_130.className;
- this._imgURL=_130.img;
- this._selected=false;
- this._tabControl=_131;
- this._outerTabDiv=null;
- this._focusDiv=null;
- };
- CognosTab.prototype.getWidth=function(){
- return this._outerTabDiv.offsetWidth+1;
- };
- CognosTab.prototype.getHeight=function(){
- return this._outerTabDiv.clientHeight;
- };
- CognosTab.prototype.getId=function(){
- return this._id;
- };
- CognosTab.prototype.select=function(_133){
- if(_133!=this._selected){
- this._selected=_133;
- if(_133){
- this.scrollIntoView();
- }
- if(this._outerTabDiv){
- this._updateSelectedClass();
- this._updateAriaSelected();
- }
- }
- };
- CognosTab.prototype.scrollIntoView=function(){
- var _134=this._outerTabDiv.offsetLeft+this._outerTabDiv.clientWidth;
- var _135=this._tabControl.getVisibleWidth();
- var _136=this._tabControl.getScrollPos();
- var _137=this._outerTabDiv.offsetLeft;
- if(_137===0){
- this._tabControl.scrollTo(0);
- }else{
- if((_137>=_136)&&(_134<=(_136+_135))){
- }else{
- if(_137<_136){
- var _138=_137<3?0:_137-3;
- this._tabControl.scrollTo(_138);
- }else{
- if(_134-_135>0||_134<_136){
- this._tabControl.scrollTo(_134-_135+10);
- }
- }
- }
- }
- };
- CognosTab.prototype.render=function(_139){
- if(!this._outerTabDiv){
- var _13a=this._id;
- var _13b=this._tabControl;
- var tab=this;
- this._outerTabDiv=document.createElement("div");
- this._outerTabDiv.onmousedown=function(_13d){
- _13b.selectTab(_13a,true,_13d);
- };
- this._outerTabDiv.onmouseover=function(){
- this.className=this.className+" ct_highlight";
- };
- this._outerTabDiv.onmouseout=function(){
- tab._updateSelectedClass();
- };
- this._outerTabDiv.setAttribute("style","");
- this._outerTabDiv.setAttribute("role","presentation");
- this._updateSelectedClass();
- _139.appendChild(this._outerTabDiv);
- var _13e=document.createElement("div");
- _13e.className="ct_content";
- _13e.setAttribute("role","presentation");
- this._outerTabDiv.appendChild(_13e);
- this._focusDiv=document.createElement("span");
- this._focusDiv.innerHTML=this._label?this._label:" ";
- this._focusDiv.className="ct_text";
- this._focusDiv.setAttribute("tabIndex",this._position===0?"0":"-1");
- this._focusDiv.setAttribute("role","tab");
- this._focusDiv.onkeydown=function(_13f){
- _13b.handleKeyDown(_13f,tab._position);
- };
- this._updateAriaSelected();
- _13e.appendChild(this._focusDiv);
- if(this.isIE()&&this.getWidth()<75){
- this._outerTabDiv.style.width="75px";
- }
- }else{
- this._updateSelectedClass();
- this._updateAriaSelected();
- }
- };
- CognosTab.prototype.isIE=function(){
- return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
- };
- CognosTab.prototype.getFocusableDiv=function(){
- return this._focusDiv;
- };
- CognosTab.prototype.focus=function(_140){
- if(typeof _140==="undefined"){
- _140=true;
- }
- this._focusDiv.setAttribute("tabIndex",_140?"0":"-1");
- if(_140&&this._focusDiv.focus){
- this._focusDiv.focus();
- }
- };
- CognosTab.prototype._updateSelectedClass=function(){
- this._outerTabDiv.className=this._selected?"ct_outerDiv ct_highlight ct_selected":"ct_outerDiv";
- };
- CognosTab.prototype._updateAriaSelected=function(){
- this._focusDiv.setAttribute("aria-selected",this._selected?"true":"false");
- };
- function CognosScrollButton(_141,_142,_143){
- this._direction=_141;
- this._height=_142;
- this._tabControl=_143;
- this._disabled=true;
- this._scrolling=false;
- };
- CognosScrollButton.prototype.getWidth=function(){
- return this._scrollButtonDiv.offsetWidth+1;
- };
- CognosScrollButton.prototype.show=function(){
- this._wrapperDiv.style.display="block";
- };
- CognosScrollButton.prototype.hide=function(){
- this._wrapperDiv.style.display="none";
- };
- CognosScrollButton.prototype.update=function(){
- var _144=this._tabControl.getWrapperDiv();
- var _145=false;
- if(this._direction=="left"){
- if(_144.scrollLeft===0){
- _145=true;
- }
- }else{
- if(_144.scrollLeft>=(this._tabControl.getMaxRightScroll()-2)){
- _145=true;
- }
- }
- if(_145){
- this._disable();
- }else{
- this._enable();
- }
- };
- CognosScrollButton.prototype.isDisabled=function(){
- return this._disabled;
- };
- CognosScrollButton.prototype._disable=function(){
- this._disabled=true;
- this._outerDiv.className="ct_outerDiv ct_scrollDisabled";
- };
- CognosScrollButton.prototype._enable=function(){
- this._disabled=false;
- this._outerDiv.className="ct_outerDiv ct_scrollEnabled";
- };
- CognosScrollButton.prototype.scroll=function(){
- if(!this._scrolling){
- this._scrolling=true;
- var _146=this._tabControl.getWrapperDiv().clientWidth;
- this._doAnimateScroll(_146,this._tabControl.getMaxRightScroll());
- }
- };
- CognosScrollButton.prototype._doAnimateScroll=function(_147,_148){
- if(_147>0){
- var _149=10;
- var _14a=this._tabControl.getWrapperDiv();
- if(this._direction=="left"){
- if(_14a.scrollLeft>_149){
- this._tabControl.scrollTo(_14a.scrollLeft-_149);
- }else{
- this._tabControl.scrollTo(0);
- this._scrolling=false;
- return;
- }
- }else{
- if(_14a.scrollLeft+_149<_148){
- this._tabControl.scrollTo(_14a.scrollLeft+_149);
- }else{
- this._scrolling=false;
- this._tabControl.scrollTo(_148);
- this._tabControl.updateScrollButtons();
- return;
- }
- }
- _147-=_149;
- var _14b=this;
- setTimeout(function(){
- _14b._doAnimateScroll(_147,_148);
- },3);
- }else{
- this._scrolling=false;
- this._tabControl.updateScrollButtons();
- }
- };
- CognosScrollButton.prototype.isIE=function(){
- return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
- };
- CognosScrollButton.prototype.render=function(_14c){
- this._scrollButtonDiv=document.createElement("div");
- this._scrollButtonDiv.className="ct_scrollButton";
- var _14d=-1;
- if(this.isIE()&&document.compatMode!="CSS1Compat"){
- _14d=1;
- }
- this._scrollButtonDiv.style.height=this._height+_14d+"px";
- if(this._tabControl.isHighContrast()){
- this._scrollButtonDiv.innerHTML=this._direction=="left"?"«":"»";
- }
- this._outerDiv=document.createElement("div");
- this._outerDiv.className="ct_scrollDisabled";
- this._outerDiv.appendChild(this._scrollButtonDiv);
- this._outerDiv.style.height=this._height+"px";
- var _14e=this;
- this._outerDiv.onclick=function(){
- _14e.scroll();
- };
- this._wrapperDiv=document.createElement("div");
- this._wrapperDiv.style.height=this._height+"px";
- this._wrapperDiv.className="ct_scroll "+(this._direction=="left"?"ct_left":"ct_right")+(this._tabControl.isHighContrast()?" a11y":"");
- this._wrapperDiv.appendChild(this._outerDiv);
- if(this._direction=="left"){
- _14c.insertBefore(this._wrapperDiv,_14c.firstChild);
- this._wrapperDiv.style.left="0px";
- }else{
- _14c.appendChild(this._wrapperDiv);
- this._wrapperDiv.style.right="0px";
- }
- };
- function ActionFactory(_14f){
- this.m_cognosViewer=_14f;
- };
- ActionFactory.prototype.load=function(_150){
- this.m_cognosViewer.loadExtra();
- var _151=null;
- try{
- var _152=_150+"Action";
- _151=eval("(typeof "+_152+"=='function'? new "+_152+"():null);");
- if(_151){
- _151.setCognosViewer(this.m_cognosViewer);
- }
- }
- catch(exception){
- _151=null;
- }
- return _151;
- };
- function ActionFactory_loadActionHandler(evt,_154){
- var _155=getCtxNodeFromEvent(evt);
- var _156=_154.getSelectionController();
- var _157=null;
- if(_155!==null){
- var _158=_155.getAttribute("ctx");
- _158=_158.split("::")[0].split(":")[0];
- var _159=_155.getAttribute("type")!=null?_155:_155.parentNode;
- var type=_159.getAttribute("type");
- switch(type){
- case "columnTitle":
- var _15b=(_155.getAttribute("dttargets")!=null);
- var _15c=(_159.getAttribute("CTNM")!=null&&_156.getMun(_158)!=""&&_156.getUsageInfo(_158)!="2");
- if(_15b||_15c){
- _157=_154.getAction("DrillUpDownOrThrough");
- _157.init(_15b,_15c);
- _157.updateDrillabilityInfo(_154,_155);
- }else{
- _157=_154.getAction("RenameDataItem");
- }
- break;
- case "datavalue":
- case "chartElement":
- case "ordinalAxisLabel":
- case "legendLabel":
- case "legendTitle":
- case "ordinalAxisTitle":
- var _15b=(_155.getAttribute("dttargets")!=null);
- var _15c=(_156.getHun(_158)!="");
- if(_15b||_15c){
- _157=_154.getAction("DrillUpDownOrThrough");
- _157.init(_15b,_15c);
- _157.updateDrillabilityInfo(_154,_155);
- }
- break;
- }
- }
- if(_157===null){
- _157=_154.getAction("Selection");
- }
- _157.setCognosViewer(_154);
- return _157;
- };
- ActionFactory.prototype.destroy=function(){
- delete this.m_cognosViewer;
- };
- function CSelectionDefaultStyles(_15d){
- this.m_primarySelectionColor=null;
- this.m_highContrastBorderStyle="solid";
- this.m_secondarySelectionIsDisabled=false;
- if(_15d){
- this.m_selectionController=_15d;
- this.m_oCognosViewer=_15d.m_oCognosViewer;
- if(this.m_oCognosViewer){
- var _15e=this.m_oCognosViewer.getUIConfig();
- if(_15e){
- if(_15e.getPrimarySelectionColor()){
- this.m_primarySelectionColor=_15e.getPrimarySelectionColor();
- }
- if(!_15e.getShowSecondarySelection()){
- this.m_secondarySelectionIsDisabledConfig=true;
- }else{
- if(_15e.getSeondarySelectionColor()){
- this.m_secondarySelectionColor=_15e.getSeondarySelectionColor();
- }
- }
- }
- }
- }
- };
- CSelectionDefaultStyles.prototype.getPrimarySelectionColor=function(_15f){
- return this.m_primarySelectionColor;
- };
- CSelectionDefaultStyles.prototype.getSecondarySelectionColor=function(){
- return this.m_secondarySelectionColor;
- };
- CSelectionDefaultStyles.prototype.getHighContrastBorderStyle=function(){
- return this.m_highContrastBorderStyle;
- };
- CSelectionDefaultStyles.prototype.canApplyToSelection=function(_160){
- return true;
- };
- CSelectionDefaultStyles.prototype.secondarySelectionIsDisabled=function(){
- return this.m_secondarySelectionIsDisabled;
- };
- CSelectionDefaultStyles.prototype.setStyleForSelection=function(){
- };
- function CSelectionFilterStyles(_161){
- this.m_selectionController=_161;
- this.m_primarySelectionColor=this.m_primarySelectionFilterColor="#44BFDD";
- this.m_primarySelectionFilterColorForMeasure=null;
- this.m_secondarySelectionColor=null;
- this.m_highContrastBorderStyle="dotted";
- this.m_secondarySelectionIsDisabled=true;
- };
- CSelectionFilterStyles.prototype=new CSelectionDefaultStyles();
- CSelectionFilterStyles.prototype.getPrimarySelectionColor=function(_162){
- return this.m_primarySelectionColor;
- };
- CSelectionFilterStyles.prototype.getSecondarySelectionColor=function(){
- return this.m_secondarySelectionColor;
- };
- CSelectionFilterStyles.prototype.getHighContrastBorderStyle=function(){
- return this.m_highContrastBorderStyle;
- };
- CSelectionFilterStyles.prototype.secondarySelectionIsDisabled=function(){
- return this.m_secondarySelectionIsDisabled;
- };
- CSelectionFilterStyles.prototype.canApplyToSelection=function(_163){
- return !this.selectionHasOnlyMeasure(_163);
- };
- CSelectionFilterStyles.prototype.selectionHasOnlyMeasure=function(_164){
- return (_164.length===1&&_164[0].length===1&&this.m_selectionController.isMeasure(_164[0][0]));
- };
- CSelectionFilterStyles.prototype.setStyleForSelection=function(_165){
- this.m_primarySelectionColor=(this.selectionHasOnlyMeasure(_165))?null:this.m_primarySelectionFilterColor;
- };
- function CSelectionFilterContextMenuStyles(_166){
- CSelectionDefaultStyles.call(this,_166);
- this.m_secondarySelectionIsDisabled=true;
- };
- CSelectionFilterContextMenuStyles.prototype=new CSelectionDefaultStyles();
- function CSelectionObject(){
- this.initialize();
- };
- CSelectionObject.prototype.initialize=function(){
- this.m_oCellRef={};
- this.m_sColumnRef="";
- this.m_sColumnName="";
- this.m_aDataItems=[];
- this.m_aUseValues=[];
- this.m_aDisplayValues=[];
- this.m_sCellTypeId="";
- this.m_sLayoutType="";
- this.m_sTag="";
- this.m_aMuns=[];
- this.m_aRefQueries=[];
- this.m_aMetadataItems=[];
- this.m_aDrillOptions=[];
- this.m_selectionController={};
- this.m_contextIds=[];
- this.m_ctxAttributeString="";
- this.m_fetchedContextIds=false;
- this.m_selectedClass=[];
- this.m_cutClass=[];
- this.m_dataContainerType="";
- this.m_oJsonContext=null;
- };
- CSelectionObject.prototype.isSelectionOnVizChart=function(){
- return false;
- };
- CSelectionObject.prototype.getCellRef=function(){
- return this.m_oCellRef;
- };
- CSelectionObject.prototype.getColumnRP_Name=function(){
- if(this.m_oCellRef!=null){
- return this.m_oCellRef.getAttribute("rp_name");
- }
- };
- CSelectionObject.prototype.getColumnRef=function(){
- return this.m_sColumnRef;
- };
- CSelectionObject.prototype.getColumnName=function(){
- if(this.m_sColumnName==""){
- if(this.m_selectionController.hasContextData()&&this.m_contextIds.length){
- this.m_sColumnName=this.m_selectionController.getRefDataItem(this.m_contextIds[0][0]);
- }
- }
- return this.m_sColumnName;
- };
- CSelectionObject.prototype.getDataItemDisplayValue=function(_167){
- var _168=this.getDataItems();
- var item="";
- if(_168&&_168[0]&&_168[0][0]){
- item=this.getDataItems()[0][0];
- if(_167&&_167.itemInfo&&_167.itemInfo.length){
- var _16a=_167.itemInfo;
- for(var i=0;i<_16a.length;i++){
- if(_16a[i].item===item&&_16a[i].itemLabel){
- return _16a[i].itemLabel;
- }
- }
- }
- }
- return item;
- };
- CSelectionObject.prototype.getDataItems=function(){
- if(!this.m_aDataItems.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aDataItems[this.m_aDataItems.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _16e=this.m_contextIds[i][j];
- this.m_aDataItems[this.m_aDataItems.length-1].push(this.m_selectionController.isContextId(_16e)?this.m_selectionController.getRefDataItem(_16e):"");
- }
- }
- }
- return this.m_aDataItems;
- };
- CSelectionObject.prototype.getUseValues=function(){
- if(!this.m_aUseValues.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aUseValues[this.m_aUseValues.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _171=this.m_contextIds[i][j];
- this.m_aUseValues[this.m_aUseValues.length-1].push(this.m_selectionController.isContextId(_171)?this.m_selectionController.getUseValue(_171):"");
- }
- }
- }
- return this.m_aUseValues;
- };
- CSelectionObject.prototype.getCellTypeId=function(){
- return this.m_sCellTypeId;
- };
- CSelectionObject.prototype.getDisplayValues=function(){
- return this.m_aDisplayValues;
- };
- CSelectionObject.prototype.getLayoutType=function(){
- return this.m_sLayoutType;
- };
- CSelectionObject.prototype.getTag=function(){
- return this.m_sTag;
- };
- CSelectionObject.prototype.getMuns=function(){
- if(!this.m_aMuns.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aMuns[this.m_aMuns.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _174=this.m_contextIds[i][j];
- this.m_aMuns[this.m_aMuns.length-1].push(this.m_selectionController.isContextId(_174)?this.m_selectionController.getMun(_174):"");
- }
- }
- }
- return this.m_aMuns;
- };
- CSelectionObject.prototype.getRefQueries=function(){
- if(!this.m_aRefQueries.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aRefQueries[this.m_aRefQueries.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _177=this.m_contextIds[i][j];
- this.m_aRefQueries[this.m_aRefQueries.length-1].push(this.m_selectionController.isContextId(_177)?this.m_selectionController.getRefQuery(_177):"");
- }
- }
- }
- return this.m_aRefQueries;
- };
- CSelectionObject.prototype.getDimensionalItems=function(_178){
- var _179=[];
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- _179[_179.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _17c=this.m_contextIds[i][j];
- var _17d="";
- if(this.m_selectionController.isContextId(_17c)){
- switch(_178){
- case "hun":
- _17d=this.m_selectionController.getHun(_17c);
- break;
- case "lun":
- _17d=this.m_selectionController.getLun(_17c);
- break;
- case "dun":
- _17d=this.m_selectionController.getDun(_17c);
- break;
- }
- }
- _179[_179.length-1].push(_17d);
- }
- }
- return _179;
- };
- CSelectionObject.prototype.getMetadataItems=function(){
- if(!this.m_aMetadataItems.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aMetadataItems[this.m_aMetadataItems.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _180=this.m_contextIds[i][j];
- var _181="";
- if(this.m_selectionController.isContextId(_180)){
- var sLun=this.m_selectionController.getLun(_180);
- var sHun=this.m_selectionController.getHun(_180);
- if(sLun&&sLun!=""){
- _181=sLun;
- }else{
- if(sHun&&sHun!=""){
- _181=sHun;
- }else{
- _181=this.m_selectionController.getQueryModelId(_180);
- }
- }
- }
- this.m_aMetadataItems[this.m_aMetadataItems.length-1].push(_181);
- }
- }
- }
- return this.m_aMetadataItems;
- };
- CSelectionObject.prototype.getDrillOptions=function(){
- if(!this.m_aDrillOptions.length){
- this.fetchContextIds();
- for(var i=0;i<this.m_contextIds.length;++i){
- this.m_aDrillOptions[this.m_aDrillOptions.length]=[];
- for(var j=0;j<this.m_contextIds[i].length;++j){
- var _186=this.m_contextIds[i][j];
- this.m_aDrillOptions[this.m_aDrillOptions.length-1].push(this.m_selectionController.isContextId(_186)?this.m_selectionController.getDrillFlag(_186):0);
- }
- }
- }
- return this.m_aDrillOptions;
- };
- CSelectionObject.prototype.getSelectedContextIds=function(){
- return this.m_contextIds;
- };
- CSelectionObject.prototype.fetchContextIds=function(){
- if(!this.m_fetchedContextIds&&this.m_contextIds.length&&this.m_selectionController.hasContextData()){
- var _187=[];
- for(var i=0;i<this.m_contextIds.length;i++){
- for(var j=0;j<this.m_contextIds[i].length;j++){
- _187.push(this.m_contextIds[i][j]);
- }
- }
- this.m_selectionController.fetchContextData(_187);
- this.m_fetchedContextIds=true;
- }
- };
- CSelectionObject.prototype.setSelectionController=function(sc){
- if(sc){
- this.m_selectionController=sc;
- }
- };
- CSelectionObject.prototype.getLayoutElementId=function(){
- return this.m_layoutElementId;
- };
- CSelectionObject.prototype.hasContextInformation=function(){
- for(var i=0;i<this.m_contextIds.length;i++){
- for(var j=0;j<this.m_contextIds[i].length;j++){
- if(this.m_contextIds[i][j].length>0){
- return true;
- }
- }
- }
- return false;
- };
- CSelectionObject.prototype.isHomeCell=function(){
- var _18d=this.getCellRef().className;
- if(_18d&&(_18d=="xm"||_18d.indexOf("xm ")!=-1||_18d.indexOf(" xm")!=-1)){
- return true;
- }
- return false;
- };
- CSelectionObject.prototype.getDataContainerType=function(){
- return this.m_dataContainerType;
- };
- CSelectionObject.prototype.getContextJsonObject=function(_18e,_18f){
- if(this.m_oJsonContext===null){
- var _190={};
- var _191=[];
- var _192=null;
- this.getDataItems();
- this.getUseValues();
- if(this.m_contextIds.length==0){
- return null;
- }
- var i=0,j=0;
- var _195=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_18e);
- _192=_195;
- this._populateJsonContextObj(_195,this.m_aUseValues[i][j],_18e.getDisplayValue(this.m_contextIds[i][j]),_18e.getMun(this.m_contextIds[i][j]),_190,_191);
- j++;
- for(;i<this.m_aDataItems.length;i++,j=0){
- for(;j<this.m_aDataItems[i].length;j++){
- _195=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_18e);
- if(!_192){
- _192=_195;
- }
- this._populateJsonContextObj(_195,this.m_aUseValues[i][j],_18e.getDisplayValue(this.m_contextIds[i][j]),_18e.getMun(this.m_contextIds[i][j]),_190,_191);
- }
- }
- this.m_oJsonContext=this._createGenericPayloadStructureJson(_192,_190,_191,_18f);
- }
- return this.m_oJsonContext;
- };
- CSelectionObject.prototype._getBestPossibleItemName=function(_196,_197,_198){
- var _199=null;
- if(_198.isMeasure(_197)){
- if(!_198.isValidColumnTitle(this.m_oCellRef)){
- if(!_198.isRelational([_197])){
- _199=_198.getCCDManager().GetBestPossibleDimensionMeasureName(_197);
- }
- return (_199)?_199:_196;
- }
- }
- _199=_198.getCCDManager().GetBestPossibleItemName(_197);
- return (_199)?_199:_196;
- };
- CSelectionObject.prototype._isTypeColumnTitle=function(){
- if(this.m_oCellRef&&typeof this.m_oCellRef.getAttribute=="function"){
- return (this.m_oCellRef.getAttribute("type")==="columnTitle");
- }
- return false;
- };
- CSelectionObject.prototype._populateJsonContextObj=function(_19a,_19b,_19c,mun,_19e,_19f){
- if(_19e&&_19f&&_19a&&typeof _19e[_19a]=="undefined"){
- var _1a0=_19c?_19c:_19b;
- _19e[_19a]=[_1a0];
- var _1a1={};
- if(_19c){
- _1a1["caption"]=_19c;
- }
- if(mun){
- _1a1["mun"]=mun;
- }
- if(_19b){
- _1a1["use"]=_19b;
- }
- _19f.push(_1a1);
- }
- };
- CSelectionObject.prototype._createGenericPayloadStructureJson=function(_1a2,_1a3,_1a4,_1a5){
- if(_1a2&&_1a3&&_1a4){
- var _1a6=(_1a5)?_1a5:".";
- var _1a7={};
- _1a7[_1a6]={"values":_1a4};
- var obj={"com.ibm.widget.context":{"values":_1a3},"com.ibm.widget.context.report.select":{"select":{"selectedItem":_1a2,"itemSpecification":_1a7}}};
- return obj;
- }
- return null;
- };
- CSelectionObject.prototype.populateSelectionPayload=function(_1a9,_1aa,_1ab){
- this.getDataItems();
- this.getUseValues();
- if(this.m_contextIds.length==0){
- return false;
- }
- _1ab=((_1ab===undefined)?false:_1ab);
- var _1ac=this.m_selectionController;
- for(var i=0,j=0;i<this.m_aDataItems.length;i++,j=0){
- var _1af=(_1ab?1:this.m_aDataItems[i].length);
- for(;j<_1af;j++){
- if(!_1ac.isMeasure(this.m_contextIds[i][j])){
- var _1b0=this.m_aDataItems[i][j];
- this._populateItemInSelectionPayload(_1b0,this.m_aUseValues[i][j],_1ac.getDisplayValue(this.m_contextIds[i][j]),_1ac.getMun(this.m_contextIds[i][j]),_1a9,_1aa);
- }
- }
- }
- return true;
- };
- CSelectionObject.prototype._populateItemInSelectionPayload=function(_1b1,_1b2,_1b3,mun,_1b5,_1b6){
- if(_1b5&&_1b1){
- var _1b7=_1b2?_1b2:_1b3;
- if(_1b5[_1b1]){
- _1b5[_1b1].push(_1b7);
- }else{
- _1b5[_1b1]=[_1b7];
- }
- var _1b8={};
- _1b8["caption"]=_1b7;
- if(mun){
- _1b8["mun"]=mun;
- }
- var _1b9=_1b6[_1b1];
- if(!_1b9){
- _1b9={"values":[]};
- _1b6[_1b1]=_1b9;
- }
- _1b9.values.push(_1b8);
- }
- };
- CSelectionObject.prototype.getCtxAttributeString=function(){
- return this.m_ctxAttributeString;
- };
- CSelectionObject.prototype.isDataValueOrChartElement=function(){
- return (this.m_sLayoutType==="datavalue"||this.m_sLayoutType==="chartElement");
- };
- CSelectionObject.prototype.marshal=function(_1ba,_1bb){
- if(!this.m_oJsonForMarshal){
- var _1bc={};
- var _1bd=[];
- var _1be=null;
- this.getDataItems();
- this.getUseValues();
- if(this.m_contextIds.length==0){
- return null;
- }
- var i=0,j=0;
- if(this.m_contextIds[i][j].length==0){
- var _1c1=false;
- do{
- for(;j<this.m_contextIds[i].length;j++){
- if(this.m_contextIds[i][j].length>0){
- _1c1=true;
- break;
- }
- }
- if(!_1c1){
- j=0;
- i++;
- }
- }while(!_1c1);
- }
- var _1c2=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_1ba);
- var _1c3=_1ba.isMeasure(this.m_contextIds[i][j]);
- var _1c4=this._getBestPossibleItemReference(this.m_contextIds[i][j],_1c3,_1ba.getCCDManager());
- var _1c5=_1ba.getCCDManager().GetQuery(this.m_contextIds[i][j]);
- var _1c6=this.isDataValueOrChartElement();
- 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);
- j++;
- var _1c8=[];
- for(;i<this.m_aDataItems.length;i++,j=0){
- for(;j<this.m_aDataItems[i].length;j++){
- _1c2=this._getBestPossibleItemName(this.m_aDataItems[i][j],this.m_contextIds[i][j],_1ba);
- _1c3=_1ba.isMeasure(this.m_contextIds[i][j]);
- _1c4=this._getBestPossibleItemReference(this.m_contextIds[i][j],_1c3,_1ba.getCCDManager());
- 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]));
- if(_1c9){
- _1c8.push(_1c9);
- }
- }
- }
- var lid=(typeof this.getArea=="function")?getImmediateLayoutContainerId(this.getArea()):getImmediateLayoutContainerId(this.getCellRef());
- if(lid&&lid.indexOf(_1bb)>0){
- lid=lid.substring(0,lid.indexOf(_1bb)-1);
- }
- this.m_oJsonForMarshal={"lid":lid,"query":_1c5,"selectedItem":_1c7,"context":_1c8};
- }
- return this.m_oJsonForMarshal;
- };
- CSelectionObject.prototype._populateJsonForMarshal=function(_1cb,_1cc,_1cd,_1ce,_1cf,mun,_1d1){
- if(_1cb){
- var _1d2={};
- _1d2["itemName"]=_1cb;
- _1d2["isMeasure"]=_1cd?"true":"false";
- _1d2["mdProperty"]=_1cc.mdProperty;
- _1d2["mdValue"]=_1cc.mdValue;
- _1d2["isDataValueOrChartElement"]=_1d1?"true":"false";
- if(mun){
- _1d2["mun"]=mun;
- }
- if(_1ce){
- _1d2["use"]=_1ce;
- }
- return _1d2;
- }
- return null;
- };
- CSelectionObject.prototype._getBestPossibleItemReference=function(_1d3,_1d4,_1d5){
- var _1d6=null;
- var _1d7=null;
- if(_1d4){
- _1d7="i";
- _1d6=_1d5.GetQMID(_1d3);
- if(_1d6==null){
- _1d7="m";
- _1d6=_1d5.GetMUN(_1d3);
- }
- if(_1d6==null){
- _1d7="r";
- _1d6=_1d5.GetRDIValue(_1d3);
- }
- }else{
- _1d7="l";
- _1d6=_1d5.GetLUN(_1d3);
- if(_1d6==null){
- _1d7="h";
- _1d6=_1d5.GetHUN(_1d3);
- }
- if(_1d6==null){
- _1d7="i";
- _1d6=_1d5.GetQMID(_1d3);
- }
- if(_1d6==null){
- _1d7="r";
- _1d6=_1d5.GetRDIValue(_1d3);
- }
- }
- return {"mdProperty":_1d7,"mdValue":_1d6};
- };
- CSelectionChartObject.prototype=new CSelectionObject();
- CSelectionChartObject.prototype.constructor=CSelectionChartObject;
- CSelectionChartObject.baseclass=CSelectionObject.prototype;
- function CSelectionChartObject(){
- CSelectionChartObject.baseclass.initialize.call(this);
- this.m_chartArea=null;
- this.m_context="";
- this.m_chartCtxAreas=[];
- this.m_selectedVizChart=false;
- };
- CSelectionChartObject.prototype.isSelectionOnVizChart=function(){
- return this.m_selectedVizChart;
- };
- CSelectionChartObject.prototype.setSelectionOnVizChart=function(_1d8){
- var _1d9=this.m_selectionController.getSelectedChartImageFromChartArea(_1d8);
- if(_1d9){
- this.m_selectedVizChart=_1d9.parentNode.getAttribute("vizchart")=="true"?true:false;
- }
- };
- CSelectionChartObject.prototype.getArea=function(){
- return this.m_chartArea;
- };
- CSelectionChartObject.prototype.getContext=function(){
- return this.m_context;
- };
- CSelectionChartObject.prototype.getCtxAreas=function(){
- return this.m_chartCtxAreas;
- };
- CSelectionChartObject.prototype.setCtxAreas=function(_1da){
- this.m_chartCtxAreas=_1da;
- };
- CSelectionChartObject.prototype.getCtxAttributeString=function(){
- return this.m_context;
- };
- function CChartHelper(_1db,_1dc,_1dd){
- var _1de=_1db.parentNode;
- this.m_selectionObjectFactory=_1dc;
- this.m_map=_1de;
- _1dd.loadExtra();
- this.imageMapHighlighter=new CImageMapHighlight(_1de,_1dd.sWebContentRoot);
- this.initialize();
- };
- CChartHelper.prototype.initialize=function(){
- this.buildMapCtxAreas();
- this.m_chartCtxNodes={};
- };
- CChartHelper.prototype.buildMapCtxAreas=function(){
- var _1df={};
- var _1e0=this.m_map.childNodes;
- var _1e1=_1e0.length;
- var _1e2=null;
- for(var i=0;i<_1e1;i++){
- var a=_1e0[i];
- _1e2=a.getAttribute("ctx");
- if(_1e2){
- if(_1df[_1e2]){
- _1df[_1e2].push(a);
- }else{
- _1df[_1e2]=[a];
- }
- }
- }
- this.m_ctxAreas=_1df;
- };
- CChartHelper.prototype.getChartNode=function(_1e5){
- if(!this.isAreaInitialized(_1e5)){
- var _1e6=_1e5.parentNode;
- this.m_map=_1e6;
- this.initialize();
- this.imageMapHighlighter.initialize(_1e6);
- }
- var _1e7=_1e5.getAttribute("ctx");
- if(!this.m_chartCtxNodes[_1e7]){
- this.m_chartCtxNodes[_1e7]=this.m_selectionObjectFactory.getSelectionChartObject(_1e5);
- this.m_chartCtxNodes[_1e7].setCtxAreas(this.m_ctxAreas[_1e7]);
- }
- return this.m_chartCtxNodes[_1e7];
- };
- CChartHelper.prototype.isAreaInitialized=function(_1e8){
- return this.imageMapHighlighter.isAreaInitialized(_1e8);
- };
- CChartHelper.prototype.getImageMapHighlighter=function(){
- return this.imageMapHighlighter;
- };
- function CSelectionObjectFactory(_1e9){
- this.m_selectionController=_1e9;
- };
- CSelectionObjectFactory.prototype.getSelectionController=function(){
- return this.m_selectionController;
- };
- CSelectionObjectFactory.prototype.getChildSpans=function(_1ea){
- var _1eb=[];
- for(var i=0;i<_1ea.childNodes.length;i++){
- var _1ed=_1ea.childNodes[i];
- if(!_1ed.getAttribute||_1ed.getAttribute("skipSelection")!="true"){
- _1eb.push(_1ea.childNodes[i]);
- }
- }
- var _1ee=_1ea;
- var _1ef="";
- while(!_1ef&&_1ee){
- _1ef=_1ee.attributes?_1ee.attributes["LID"]:"";
- _1ee=_1ee.parentNode;
- }
- _1ef=_1ef?_1ef.value:"";
- var _1f0=[];
- while(_1eb.length>0){
- var _1ed=_1eb.pop();
- var lid=_1ed.attributes?_1ed.attributes["LID"]:"";
- lid=lid?lid.value:"";
- if(!lid||lid==_1ef){
- if(_1ed.nodeName.toLowerCase()=="span"){
- _1f0.push(_1ed);
- }else{
- for(i=0;i<_1ed.childNodes.length;i++){
- _1eb.push(_1ed.childNodes[i]);
- }
- }
- }
- }
- return _1f0;
- };
- CSelectionObjectFactory.prototype.getSelectionObject=function(_1f2,_1f3){
- var _1f4=new CSelectionObject();
- try{
- _1f4.setSelectionController(this.getSelectionController());
- _1f4.m_oCellRef=_1f2;
- _1f4.m_sColumnRef=_1f2.getAttribute("cid");
- _1f4.m_sCellTypeId=_1f2.getAttribute("uid");
- _1f4.m_sLayoutType=_1f2.getAttribute("type");
- _1f4.m_sTag=_1f2.getAttribute("tag");
- _1f4.m_layoutElementId=this.getLayoutElementId(_1f2);
- _1f4.m_dataContainerType=this.getContainerType(_1f2);
- if(typeof cf!="undefined"){
- var _1f5=cf.cfgGet("MiniQueryObj");
- if(_1f5){
- var _1f6=_1f5.findChildWithAttribute("tag",_1f4.m_sTag);
- if(_1f6&&_1f6.getAttribute("id")!=null){
- _1f4.m_sColumnName=_1f6.getAttribute("id");
- }
- }
- }
- var _1f7=this.getChildSpans(_1f2);
- if(_1f7.length>0){
- for(var i=0;i<_1f7.length;i++){
- var _1f9=_1f7[i];
- if(_1f9.nodeType==1&&_1f9.nodeName.toLowerCase()=="span"&&_1f9.style.visibility!="hidden"){
- var _1fa=null;
- if(_1f2.getAttribute("ctx")!=null&&_1f2.getAttribute("ctx")!=""){
- _1fa=_1f2;
- }else{
- if(_1f9.getAttribute("ctx")!=null&&_1f9.getAttribute("ctx")!=""){
- _1fa=_1f9;
- }else{
- if(_1f9.getAttribute("dtTargets")&&_1f9.childNodes&&_1f9.childNodes.length){
- for(var _1fb=0;_1fb<_1f9.childNodes.length;_1fb++){
- if(_1f9.childNodes[_1fb].nodeType==1&&_1f9.childNodes[_1fb].style.visibility!="hidden"){
- _1fa=_1f9.childNodes[_1fb];
- }
- }
- }else{
- for(var _1fc=0;_1fc<_1f9.childNodes.length;_1fc++){
- var _1fd=_1f9.childNodes[_1fc];
- if(typeof _1fd.getAttribute!="undefined"&&_1fd.getAttribute("ctx")!=null&&_1fd.getAttribute("ctx")!=""){
- _1fa=_1fd;
- break;
- }
- }
- }
- }
- }
- var _1fe="";
- if(_1fa&&_1fa.getAttribute("ctx")){
- _1fe=_1fa.getAttribute("ctx");
- }
- _1f4.m_aDisplayValues[_1f4.m_aDisplayValues.length]=this.getSelectionController().getDisplayValue(_1fe,_1f2.parentNode);
- if(typeof _1f3!="undefined"&&_1f3!=_1fe){
- continue;
- }
- _1f4=this.processCTX(_1f4,_1fe);
- }
- }
- }else{
- if(_1f2.getAttribute("ctx")!=null&&_1f2.getAttribute("ctx")!=""&&_1f4.m_sLayoutType=="datavalue"){
- _1f4=this.processCTX(_1f4,_1f2.getAttribute("ctx"));
- }
- }
- this.getSelectionController().processColumnTitleNode(_1f4);
- }
- catch(ex){
- }
- return _1f4;
- };
- CSelectionObjectFactory.prototype.processCTX=function(_1ff,_200){
- if(typeof _200!="string"||_200.length==0){
- return _1ff;
- }
- var ctx;
- if(typeof _1ff.m_contextIds=="object"&&_1ff.m_contextIds!==null&&_1ff.m_contextIds.length>0){
- var _202=_200.split("::");
- for(ctx=0;ctx<_1ff.m_contextIds.length;++ctx){
- try{
- if(_202[ctx]){
- _1ff.m_contextIds[ctx]=_1ff.m_contextIds[ctx].concat(_202[ctx].split(":"));
- }
- }
- catch(e){
- }
- }
- }else{
- _1ff.m_contextIds=this.m_selectionController.m_oCognosViewer.getReportContextHelper().processCtx(_200);
- }
- _1ff.m_ctxAttributeString=_200;
- return _1ff;
- };
- CSelectionObjectFactory.prototype.getSecondarySelectionObject=function(tag,_204,_205){
- if(!_205){
- _205=document;
- }
- var _206=new CSelectionObject();
- _206.setSelectionController(this.getSelectionController());
- _206.m_oCellRef=null;
- _206.m_sColumnRef=null;
- _206.m_sCellTypeId=null;
- _206.refQuery="";
- var _207=_205.getElementsByTagName("td");
- for(var i=0;i<_207.length;i++){
- var _209=_207[i].getAttribute("tag");
- if(_209!=null&&_209!=""){
- if(tag==_209){
- var _20a=_207[i].className;
- if(_20a!=null&&_209!=""){
- if((_204=="columnTitle"&&_20a=="lt")||(_204=="datavalue"&&_20a=="lc")){
- _206.m_sColumnRef=_207[i].getAttribute("cid");
- _206.m_sCellTypeId=_207[i].getAttribute("uid");
- break;
- }
- }
- }
- }
- }
- if(_206.m_sCellTypeId==null){
- return null;
- }
- return _206;
- };
- CSelectionObjectFactory.prototype.getSelectionChartObject=function(_20b){
- var _20c="";
- if(_20b.getAttribute("flashChart")!=null){
- if(typeof _20b.getCtx!="undefined"){
- try{
- _20c=_20b.getCtx();
- }
- catch(e){
- _20c="";
- }
- }
- }else{
- _20c=_20b.getAttribute("ctx");
- }
- var _20d=new CSelectionChartObject();
- _20d.setSelectionController(this.getSelectionController());
- if(_20c!=null){
- _20d.m_contextIds=_20c.split("::");
- for(var ctx=0;ctx<_20d.m_contextIds.length;++ctx){
- _20d.m_contextIds[ctx]=_20d.m_contextIds[ctx].split(":");
- }
- }
- _20d.m_layoutElementId=this.getLayoutElementId(_20b);
- _20d.m_sLayoutType=_20b.getAttribute("type");
- _20d.m_chartArea=_20b;
- _20d.m_context=_20c;
- _20d.setSelectionOnVizChart(_20b);
- return _20d;
- };
- CSelectionObjectFactory.prototype.getContainerTypeFromClass=function(_20f){
- var _210="";
- switch(_20f){
- case "ls":
- _210="list";
- break;
- case "xt":
- _210="crosstab";
- break;
- case "rt":
- _210="repeaterTable";
- break;
- }
- return _210;
- };
- CSelectionObjectFactory.prototype.getContainerType=function(el){
- var type="";
- if(el){
- if(el.className){
- type=this.getContainerTypeFromClass(el.className);
- }
- if(!type){
- var _213=el.parentNode;
- if(_213){
- type=this.getContainerType(_213);
- }
- }
- }
- return type;
- };
- CSelectionObjectFactory.prototype.getLayoutElementId=function(el){
- var id="";
- var _216=this.getSelectionController().getNamespace();
- if(el){
- if(el.getAttribute&&el.getAttribute("chartcontainer")=="true"){
- for(var _217=0;_217<el.childNodes.length;_217++){
- var _218=el.childNodes[_217];
- if(_218.nodeName.toLowerCase()=="img"&&_218.getAttribute("lid")!=null){
- return _218.getAttribute("lid");
- }
- }
- }
- id=(el.getAttribute&&el.getAttribute("LID"))||"";
- if(!id){
- var _219=el.parentNode;
- if(_219){
- id=this.getLayoutElementId(_219);
- }
- }else{
- if(el.tagName.toUpperCase()=="MAP"){
- id=id.replace(_216,"");
- id=_216+id;
- var _21a="#"+id;
- var _21b=getElementsByAttribute(el.parentNode,"IMG","usemap",_21a);
- if(_21b.length>0){
- id=_21b[0].getAttribute("LID");
- }
- }
- }
- }
- return id;
- };
- function CSelectionController(_21c,_21d){
- this.m_bSelectionBasedFeaturesEnabled=false;
- this.m_bDrillUpDownEnabled=false;
- this.m_bModelDrillThroughEnabled=false;
- this.m_oCognosViewer=null;
- this.m_bSavedSelections=false;
- if(_21d){
- this.m_oCognosViewer=_21d;
- }
- this.initialize(_21c);
- this.FILTER_SELECTION_STYLE=0;
- this.FILTER_SELECTION_CONTEXT_MENU_STYLE=1;
- };
- CSelectionController.prototype.initialize=function(_21e){
- this.m_sNamespace=_21e;
- this.m_aCutColumns=[];
- this.m_aSelectedObjects=[];
- this.m_selectedClass=[];
- this.m_cutClass=[];
- this.m_oObserver=new CObserver(this);
- this.m_bSelectionArraysSetup=false;
- this.m_aSelectionHoverNodes=[];
- this.m_bUsingCCDManager=false;
- this.m_aReportMetadataArray=[];
- this.m_aReportContextDataArray=[];
- this.m_oCDManager=new CCDManager();
- this.m_oSelectionObjectFactory=new CSelectionObjectFactory(this);
- this.m_selectedChartArea=null;
- this.m_selectedChartNodes=[];
- this.m_selectionContainerMap=null;
- this.m_chartHelpers={};
- if(this.m_oCognosViewer!=null){
- this.m_oCDManager.SetCognosViewer(this.m_oCognosViewer);
- }
- this.m_maxSecondarySelection=-1;
- this.c_usageMeasure="2";
- this.m_ccl_dateTypes={59:"dateTime",60:"interval"};
- this.m_selectionStyles=new CSelectionDefaultStyles(this);
- this.m_originalSelectionStyles=this.m_selectionStyles;
- this.m_bAllowHorizontalDataValueSelection=false;
- };
- CSelectionController.prototype.secondarySelectionIsDisabled=function(){
- return this.m_selectionStyles.secondarySelectionIsDisabled();
- };
- CSelectionController.prototype.getPrimarySelectionColor=function(){
- return this.m_selectionStyles.getPrimarySelectionColor();
- };
- CSelectionController.prototype.getHighContrastBorderStyle=function(){
- return this.m_selectionStyles.getHighContrastBorderStyle();
- };
- CSelectionController.prototype.getSecondarySelectionColor=function(){
- return this.m_selectionStyles.getSecondarySelectionColor();
- };
- CSelectionController.prototype.resetSelectionStyles=function(){
- this.setSelectionStyles();
- };
- CSelectionController.prototype.setSelectionStyles=function(_21f){
- switch(_21f){
- case this.FILTER_SELECTION_STYLE:
- if(!this.m_selectionFilterStyles){
- this.m_selectionFilterStyles=new CSelectionFilterStyles(this);
- }
- this.m_selectionStyles=this.m_selectionFilterStyles;
- break;
- case this.FILTER_SELECTION_CONTEXT_MENU_STYLE:
- if(!this.m_selectionFilterContextMenuStyles){
- this.m_selectionFilterContextMenuStyles=new CSelectionFilterContextMenuStyles(this);
- }
- this.m_selectionStyles=this.m_selectionFilterContextMenuStyles;
- break;
- default:
- this.m_selectionStyles=this.m_originalSelectionStyles;
- }
- };
- CSelectionController.prototype.resetAllowHorizontalDataValueSelection=function(){
- this.m_bAllowHorizontalDataValueSelection=false;
- };
- CSelectionController.prototype.setAllowHorizontalDataValueSelection=function(_220){
- this.m_bAllowHorizontalDataValueSelection=_220;
- };
- CSelectionController.prototype.allowHorizontalDataValueSelection=function(){
- return this.m_bAllowHorizontalDataValueSelection;
- };
- CSelectionController.prototype.clearSelectionData=function(){
- this.m_aSelectedObjects=[];
- this.m_selectedChartNodes=[];
- this.m_oSelectedDrillThroughImage=null;
- this.m_oSelectedDrillThroughSingleton=null;
- };
- CSelectionController.prototype.getCCDManager=function(){
- return this.m_oCDManager;
- };
- CSelectionController.prototype.getCtxIdFromDisplayValue=function(_221){
- if(!this.m_bUsingCCDManager){
- var _222=this.getReportContextDataArray();
- var _223=1;
- for(var _224 in _222){
- var _225=_222[_224];
- if(_225[_223]==_221){
- return _224;
- }
- }
- return "";
- }else{
- var sId=this.m_oCDManager.GetContextIdForDisplayValue(_221);
- return (sId==null)?"":sId;
- }
- };
- CSelectionController.prototype.getCtxIdFromMetaData=function(sLun,sHun,_229){
- return this.m_oCDManager.getContextIdForMetaData(sLun,sHun,_229);
- };
- CSelectionController.prototype.replaceNamespaceForSharedTM1DimensionOnly=function(lun,hun,mun){
- var sLun=lun;
- var sHun=hun;
- if(mun&&mun.indexOf("->:[TM].")>0){
- sLun=this.m_oCDManager._replaceNamespaceForSharedTM1DimensionOnly(lun);
- sHun=this.m_oCDManager._replaceNamespaceForSharedTM1DimensionOnly(hun);
- }
- return {"lun":sLun,"hun":sHun};
- };
- CSelectionController.prototype.getCtxIdFromMun=function(sMun){
- if(!this.m_bUsingCCDManager){
- var _230=this.getReportMetadataArray();
- var _231=0;
- for(var sKey in _230){
- var _233=_230[sKey];
- if(_233[_231]==sMun){
- var _234=2;
- var _235=this.getReportContextDataArray();
- for(var _236 in _235){
- var _237=_235[_236];
- if(_237[_234]==sKey){
- return _236;
- }
- }
- }
- }
- return "";
- }else{
- var sId=this.m_oCDManager.GetContextIdForMUN(sMun);
- return (sId==null)?"":sId;
- }
- };
- CSelectionController.prototype.canDrillDown=function(_239){
- var _23a=this.getDrillFlagForMember(_239);
- return (_23a==3||_23a==2);
- };
- CSelectionController.prototype.canDrillUp=function(_23b){
- var _23c=this.getDrillFlagForMember(_23b);
- return (_23c==3||_23c==1);
- };
- CSelectionController.prototype.getQueryModelId=function(_23d){
- var qmid="";
- if(!this.m_bUsingCCDManager){
- var _23f=this.m_aReportContextDataArray[_23d];
- if(_23f&&typeof _23f[3]!="undefined"){
- var _240=_23f[3];
- var _241=this.m_aReportMetadataArray[_240];
- if(typeof _241!="undefined"&&typeof _241[1]!="undefined"&&_241[1]=="I"){
- qmid=_241[0];
- }
- }
- }else{
- qmid=this.m_oCDManager.GetQMID(_23d);
- }
- return qmid;
- };
- CSelectionController.prototype.getRefQuery=function(_242){
- if(!this.m_bUsingCCDManager){
- return this.getMetaDataItemUseValue(4,_242);
- }else{
- var _243=this.m_oCDManager.GetQuery(_242);
- return (_243==null)?"":_243;
- }
- };
- CSelectionController.prototype.getRefDataItem=function(_244){
- return this.m_oCognosViewer.getReportContextHelper().getRefDataItem(_244);
- };
- CSelectionController.prototype.getMun=function(_245){
- return this.m_oCognosViewer.getReportContextHelper().getMun(_245);
- };
- CSelectionController.prototype.getHun=function(_246){
- if(!this.m_bUsingCCDManager){
- var sHun=null;
- var _248=this.getRDI(_246);
- if(_248&&_248.length>4&&_248[1]=="R"){
- var _249=_248[4];
- var _24a=this.getReportMetadataArray();
- _248=_24a[_249];
- }
- if(_248&&_248.length>1&&_248[1]=="H"){
- sHun=_248[0];
- }
- return sHun;
- }else{
- return this.m_oCDManager.GetHUN(_246);
- }
- };
- CSelectionController.prototype.fetchContextData=function(_24b,_24c){
- var _24d=0;
- if(this.m_bUsingCCDManager){
- _24d=this.m_oCDManager.FetchContextData(_24b,_24c);
- }
- return _24d;
- };
- CSelectionController.prototype.getMetaDataItem=function(sKey){
- var _24f=this.getReportMetadataArray();
- if(typeof _24f[sKey]!="undefined"){
- return _24f[sKey];
- }
- return null;
- };
- CSelectionController.prototype.getContextDataItem=function(_250){
- var _251=this.getReportContextDataArray();
- if(typeof _251[_250]!="undefined"){
- return _251[_250];
- }
- return null;
- };
- CSelectionController.prototype.getMetaDataItemUseValue=function(_252,_253){
- var _254=this.getContextDataItem(_253);
- if(_254!=null){
- var _255=_254[_252];
- if(_255!=""){
- var _256=this.getMetaDataItem(_255);
- if(_256!=null){
- return _256[0];
- }
- }
- }
- return "";
- };
- CSelectionController.prototype.getRDI=function(_257){
- var _258=this.getContextDataItem(_257);
- if(_258!=null){
- var _259=_258[0];
- if(_259!=""){
- var _25a=this.getMetaDataItem(_259);
- if(_25a!=null){
- return _25a;
- }
- }
- }
- };
- CSelectionController.prototype.getNamespace=function(){
- return this.m_sNamespace;
- };
- CSelectionController.prototype.setSelectionBasedFeaturesEnabled=function(_25b){
- this.m_bSelectionBasedFeaturesEnabled=_25b;
- };
- CSelectionController.prototype.getSelectionBasedFeaturesEnabled=function(){
- return this.m_bSelectionBasedFeaturesEnabled;
- };
- CSelectionController.prototype.setDrillUpDownEnabled=function(_25c){
- this.m_bDrillUpDownEnabled=_25c;
- };
- CSelectionController.prototype.getDrillUpDownEnabled=function(){
- return this.m_bDrillUpDownEnabled;
- };
- CSelectionController.prototype.setModelDrillThroughEnabled=function(_25d){
- this.m_bModelDrillThroughEnabled=_25d;
- };
- CSelectionController.prototype.getBookletItemForCurrentSelection=function(){
- var _25e=this.getAllSelectedObjects();
- if(_25e&&_25e.length>0){
- var _25f=_25e[0];
- if(_25f.hasContextInformation()){
- var _260=this.m_oCDManager.GetBIValue(_25f.m_contextIds[0][0]);
- if(!_260){
- return null;
- }
- return _260;
- }
- }
- return null;
- };
- CSelectionController.prototype.getModelPathForCurrentSelection=function(){
- var _261=null;
- var _262=this.getBookletItemForCurrentSelection();
- if(_262){
- var _261=this.m_oCDManager.getModelPathFromBookletItem(_262);
- }
- return _261;
- };
- CSelectionController.prototype.getModelDrillThroughEnabled=function(){
- var _263=this.getBookletItemForCurrentSelection();
- if(_263){
- var _264=this.m_oCDManager.GetBookletModelBasedDrillThru(_263);
- return _264==1?true:false;
- }else{
- return this.m_bModelDrillThroughEnabled;
- }
- };
- CSelectionController.prototype.clearSelectedObjects=function(_265){
- try{
- if(!_265){
- _265=document;
- }
- this.updateUI(_265,this.getSelections(),true,false);
- this.m_aSelectedObjects=[];
- if(typeof this.onSelectionChange=="function"){
- this.onSelectionChange();
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.resetSelections=function(_266){
- try{
- if(!_266){
- _266=document;
- }
- if(this.hasSelectedChartNodes()){
- this.resetChartSelections(_266);
- }
- this.m_oSelectedDrillThroughImage=null;
- this.m_oSelectedDrillThroughSingleton=null;
- if(this.getSelections()){
- this.updateUI(_266,this.getSelections(),true,false);
- this.updateUI(_266,this.getCutColumns(),true,false);
- this.m_aCutColumns=[];
- this.m_aSelectedObjects=[];
- this.m_selectedClass=[];
- this.m_cutClass=[];
- if(typeof this.onSelectionChange=="function"){
- this.onSelectionChange();
- }
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.resetChartSelections=function(_267){
- var _268=this.m_chartHelpers;
- for(var _269 in _268){
- if(_268[_269]){
- var _26a=_268[_269].getImageMapHighlighter();
- if(_26a.hideAllAreas){
- _26a.hideAllAreas();
- }
- }
- }
- this.m_selectedChartNodes=[];
- this.m_selectionContainerMap=null;
- };
- CSelectionController.prototype.addSelectionObject=function(_26b,_26c){
- try{
- if(!_26c){
- _26c=document;
- }
- var _26d=_26b.getCellRef();
- if(this.isCellSelected(_26d)!==true||(typeof _26d!="object"||_26d===null)){
- if(this.isColumnCut(_26b.getTag())!==true){
- this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_26b;
- if(typeof this.onSelectionChange=="function"){
- this.onSelectionChange();
- }
- this.updateUI(_26c,this.getSelections(),false,false);
- }
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.removeSelectionObject=function(_26e,_26f){
- try{
- if(!_26f){
- _26f=document;
- }
- var _270=[];
- var _271;
- for(_271=0;_271<this.m_aSelectedObjects.length;_271++){
- var _272=this.m_aSelectedObjects[_271].getCellRef();
- var _273=_26e.getCellRef();
- if(typeof _272=="object"&&typeof _273=="object"&&_272!==null&&_273!==null){
- if(_272==_273){
- _270[_270.length]=_271;
- }
- }
- }
- if(_270.length>0){
- this.updateUI(_26f,this.getSelections(),true,false);
- var _274=[];
- for(_271=0;_271<this.m_aSelectedObjects.length;_271++){
- var _275=true;
- for(var j=0;j<_270.length;j++){
- if(_271==_270[j]){
- _275=false;
- }
- }
- if(_275){
- _274[_274.length]=this.m_aSelectedObjects[_271];
- }
- }
- this.m_aSelectedObjects=_274;
- this.updateUI(_26f,this.getSelections(),false,false);
- }
- if(typeof this.onSelectionChange=="function"){
- this.onSelectionChange();
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.isSavedCellSelected=function(_277){
- return this.isCellSelectedHelper(_277,this.getSavedSelectedObjects());
- };
- CSelectionController.prototype.isCellSelected=function(_278){
- return this.isCellSelectedHelper(_278,this.getSelections());
- };
- CSelectionController.prototype.isCellSelectedHelper=function(_279,_27a){
- try{
- for(var i=0;i<_27a.length;i++){
- var _27c=_27a[i].getCellRef();
- if(typeof _27c=="object"&&_27c!==null){
- if(_27c==_279){
- return true;
- }
- }
- }
- }
- catch(e){
- }
- return false;
- };
- CSelectionController.prototype.isColumnSelected=function(_27d){
- try{
- for(var i=0;i<this.m_aSelectedObjects.length;i++){
- if(this.m_aSelectedObjects[i].getTag()==_27d){
- return true;
- }
- }
- }
- catch(e){
- }
- return false;
- };
- CSelectionController.prototype.isColumnCut=function(_27f){
- try{
- for(var i=0;i<this.m_aCutColumns.length;i++){
- if(this.m_aCutColumns[i].getTag()==_27f){
- return true;
- }
- }
- }
- catch(e){
- }
- return false;
- };
- CSelectionController.prototype.getSelections=function(){
- return this.m_aSelectedObjects;
- };
- CSelectionController.prototype.selectSingleDomNode=function(_281){
- this.clearSelectedObjects();
- var _282=this.getSelectionObjectFactory().getSelectionObject(_281);
- var _283=null;
- if(isIE()){
- _283=_281.document;
- }else{
- _283=_281.ownerDocument;
- }
- this.addSelectionObject(_282,_283);
- };
- CSelectionController.prototype.hasCutColumns=function(){
- if(this.m_aCutColumns.length===0){
- return false;
- }else{
- return true;
- }
- };
- CSelectionController.prototype.setCutColumns=function(_284,_285){
- try{
- if(!_285){
- _285=document;
- }
- this.updateUI(_285,this.getSelections(),true,false);
- this.updateUI(_285,this.getCutColumns(),true,1);
- this.m_aCutColumns=[];
- if(_284===true){
- for(var i=0;i<this.m_aSelectedObjects.length;i++){
- this.m_aCutColumns[i]=this.m_aSelectedObjects[i];
- }
- this.m_aSelectedObjects=[];
- }
- this.updateUI(_285,this.getCutColumns(),false,2);
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.getCutColumns=function(){
- return this.m_aCutColumns;
- };
- CSelectionController.prototype.getObservers=function(){
- return this.m_oObserver;
- };
- CSelectionController.prototype.attachObserver=function(_287){
- this.m_oObserver.attach(_287);
- };
- CSelectionController.prototype.onSelectionChange=function(){
- this.getObservers().notify();
- };
- CSelectionController.prototype.getSelectedColumns=function(_288){
- var _289=[];
- if(typeof _288=="undefined"){
- _288=this.getSelections();
- }
- var _28a=_288.length;
- for(var i=0;i<_28a;i++){
- var _28c=_288[i];
- var _28d=true;
- for(var j=0;j<_289.length;j++){
- if(_289[j][0]==_28c.getColumnRef()&&_289[j][1]==_28c.getCellTypeId()){
- _28d=false;
- break;
- }
- }
- if(_28d){
- _289[_289.length]=[_28c.getColumnRef(),_28c.getCellTypeId(),_28c.getLayoutType(),_28c.getTag(),_28c.getColumnName()];
- }
- }
- return _289;
- };
- CSelectionController.prototype.getAllSelectedObjectsWithUniqueCTXIDs=function(){
- var _28f=[];
- var _290=this.getAllSelectedObjects();
- for(var i=0;i<_290.length;i++){
- var _292=false;
- var _293=_290[i];
- for(var ii=0;ii<_28f.length;ii++){
- if(_293.m_contextIds[0][0]==_28f[ii].m_contextIds[0][0]){
- _292=true;
- break;
- }
- }
- if(!_292){
- _28f.push(_293);
- }
- }
- return _28f;
- };
- CSelectionController.prototype.getAllSelectedObjects=function(){
- var _295=this.getSelections();
- if(this.hasSelectedChartNodes()){
- _295=_295.concat(this.getSelectedChartNodes());
- }
- return _295;
- };
- CSelectionController.prototype.getSelectedColumnIds=function(_296){
- var _297=[];
- if(typeof _296=="undefined"){
- _296=this.getSelections();
- }
- var _298=this.getSelectedColumns(_296);
- for(var _299=0;_299<_298.length;_299++){
- var _29a=true;
- for(var _29b=0;_29b<_297.length;_29b++){
- if(_297[_29b]==_298[_299][4]){
- _29a=false;
- break;
- }
- }
- if(_29a){
- _297[_297.length]=_298[_299][4];
- }
- }
- return _297;
- };
- var STYLE_SELECTION={};
- CSelectionController.prototype.selecting=function(c,_29d){
- var _29e="."+c+_29d;
- var doc=document;
- var _2a0=document.getElementById("CVIFrame"+this.m_sNamespace);
- if(_2a0){
- doc=_2a0.contentWindow.document;
- }
- var _2a1=doc.createElement("style");
- _2a1.setAttribute("type","text/css");
- if(_2a1.styleSheet){
- _2a1.styleSheet.cssText=_29e;
- }else{
- _2a1.appendChild(doc.createTextNode(_29e));
- }
- doc.getElementsByTagName("head").item(0).appendChild(_2a1);
- STYLE_SELECTION[c]=_2a1;
- };
- CSelectionController.prototype.deselecting=function(_2a2){
- for(var i=0;i<_2a2.length;++i){
- if(STYLE_SELECTION[_2a2[i]]){
- var node=STYLE_SELECTION[_2a2[i]];
- node.parentNode.removeChild(node);
- STYLE_SELECTION[_2a2[i]]=null;
- }
- }
- if(isIE()&&typeof this.m_oCognosViewer.m_viewerFragment!="undefined"){
- var _2a5=document.getElementById("CVReport"+this.m_oCognosViewer.getId());
- if(_2a5!=null){
- var _2a6=_2a5.style.display;
- _2a5.style.display="none";
- _2a5.style.display=_2a6;
- }
- }
- };
- CSelectionController.prototype.showViewerContextMenu=function(){
- if(this.hasSelectedChartNodes()){
- return true;
- }
- if(this.m_aSelectedObjects&&this.m_aSelectedObjects.length>0){
- return true;
- }
- return false;
- };
- function getStyleFromClass(c){
- for(var i=0;i<document.styleSheets.length;i++){
- var ss=document.styleSheets[i];
- var _2aa=(ss.cssRules?ss.cssRules:ss.rules);
- for(var j=0;j<_2aa.length;j++){
- var cr=_2aa[j];
- var _2ad=new RegExp("\\b"+c+"\\b","g");
- if(cr.selectorText&&cr.selectorText.match(_2ad)){
- return cr;
- }
- }
- }
- return 0;
- };
- CSelectionController.prototype.canUpdateSelection=function(_2ae){
- return this.m_selectionStyles.canApplyToSelection(_2ae);
- };
- CSelectionController.prototype.setStyleForSelection=function(_2af){
- return this.m_selectionStyles.setStyleForSelection(_2af);
- };
- CSelectionController.prototype.updateUI=function(_2b0,_2b1,_2b2,_2b3){
- if(!_2b0){
- _2b0=document;
- }
- try{
- if(_2b1&&_2b1.length>0){
- var _2b4,_2b5,_2b6;
- if(_2b3==1||_2b3==2){
- if(_2b2){
- this.deselecting(this.m_cutClass);
- }else{
- var _2b7=getStyleFromClass("cutSelection").style.color;
- var _2b8=getStyleFromClass("cutSelection").style.backgroundColor;
- _2b4=_2b1.length;
- for(_2b5=0;_2b5<_2b4;_2b5++){
- _2b6=_2b1[_2b5].getCellRef();
- var _2b9="cutQS"+_2b6.getAttribute("cid");
- this.selecting(_2b9,"\n{ background-color: "+_2b8+"; color: "+_2b7+";}\n");
- this.m_cutClass.push(_2b9);
- }
- }
- }else{
- if(this.m_oCognosViewer){
- this.findSelectionURLs();
- _2b6="";
- _2b4=_2b1.length;
- for(_2b5=0;_2b5<_2b4;_2b5++){
- _2b6=_2b1[_2b5].getCellRef();
- if(_2b6.getAttribute("oldClassName")!=null){
- _2b6.className=_2b6.getAttribute("oldClassName");
- _2b6.removeAttribute("oldClassName");
- }
- this.setStyleForSelection(_2b1[_2b5].m_contextIds);
- if(!this.secondarySelectionIsDisabled()||_2b2){
- var _2ba=document.getElementById("CVReport"+this.getNamespace());
- var _2bb=getElementsByAttribute(_2ba,["td","th"],"name",_2b6.getAttribute("name"),this.m_maxSecondarySelection);
- for(var _2bc=0;_2bc<_2bb.length;_2bc++){
- var cell=_2bb[_2bc];
- if(_2b2){
- this.restoreOldBackgroundImage(cell);
- }else{
- if(cell.getAttribute("oldBackgroundImageStyle")==null){
- this.saveOldCellStyles(cell);
- this.setSecondarySelectionStyles(cell);
- }
- }
- }
- }
- this.saveOldCellStyles(_2b6);
- if(_2b2){
- this.restoreOldBackgroundImage(_2b6);
- if(this.m_oCognosViewer.isHighContrast()){
- this.restoreOldBorder(_2b6);
- this.restoreOldPadding(_2b6);
- }
- }else{
- this.setPrimarySelectionStyles(_2b6);
- if(this.m_oCognosViewer.isHighContrast()){
- var size=getBoxInfo(_2b6,true);
- this.saveOldBorder(_2b6);
- this.saveOldPadding(_2b6,size);
- var _2bf=3;
- var _2c0=size.borderTopWidth+size.paddingTop-_2bf;
- var _2c1=size.borderBottomWidth+size.paddingBottom-_2bf;
- var _2c2=size.borderLeftWidth+size.paddingLeft-_2bf;
- var _2c3=size.borderRightWidth+size.paddingRight-_2bf;
- _2b6.style.border=_2bf+"px "+this.getHighContrastBorderStyle()+" black";
- _2b6.style.padding=_2c0+"px "+_2c3+"px "+_2c1+"px "+_2c2+"px";
- }
- }
- }
- }
- }
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.findSelectionURLs=function(){
- if(!(this.sS_backgroundImageURL&&this.pS_backgroundImageURL)){
- if(this.m_oCognosViewer.isBux||isSafari()||this.m_oCognosViewer.isMobile()){
- this.pS_backgroundImageURL="url(../common/images/selection_primary.png)";
- this.sS_backgroundImageURL="url(../common/images/selection_secondary.png)";
- }else{
- this.pS_backgroundImageURL=this.getBackgroundImage(getStyleFromClass("primarySelection"));
- this.sS_backgroundImageURL=this.getBackgroundImage(getStyleFromClass("secondarySelection"));
- }
- }
- };
- CSelectionController.prototype.setSelectedChartImgArea=function(_2c4){
- var _2c5=true;
- var _2c6=_2c4.getAttribute("rsvpChart");
- var _2c7=_2c4.parentNode.getAttribute("chartContainer");
- if(_2c6!="true"&&_2c7!="true"){
- this.m_selectedChartNodes=[];
- _2c5=false;
- }else{
- var _2c8=this.getSelectionObjectFactory().getSelectionChartObject(_2c4);
- this.m_selectedChartNodes=[_2c8];
- }
- return _2c5;
- };
- CSelectionController.prototype.setSelectedChartArea=function(_2c9,e){
- var _2cb=typeof this.m_oCognosViewer.isBux!=="undefined";
- var _2cc=false;
- if(_2c9!==null){
- if(_2c9.tagName=="IMG"){
- _2cc=this.setSelectedChartImgArea(_2c9);
- }else{
- if(_2c9.nodeName=="AREA"&&_2c9.attributes["ctx"]){
- _2cc=true;
- if(_2cb){
- this.setBuxSelectedChartArea(_2c9,e);
- }else{
- this.m_selectedChartNodes=[this.getSelectionObjectFactory().getSelectionChartObject(_2c9)];
- }
- }
- }
- if(_2cc){
- this.getObservers().notify();
- }
- }
- return _2cc;
- };
- CSelectionController.prototype.setBuxSelectedChartArea=function(_2cd,e){
- var _2cf=this.getChartHelper(_2cd);
- var _2d0=_2cf.getChartNode(_2cd);
- this.setStyleForSelection(_2d0.m_contextIds);
- var _2d1=_2cf.getImageMapHighlighter();
- _2d1.setFillColour(this.getPrimarySelectionColor());
- _2d1.setStrokeColour(this.getPrimarySelectionColor());
- if(typeof e=="undefined"){
- e={};
- }
- if(this.ctrlKeyPressed(e)||this.shiftKeyPressed(e)){
- if(_2d1.isAreaHighlighted(_2cd)){
- _2d1.hideAreas(_2d0.getCtxAreas());
- var _2d2=_2cd.getAttribute("ctx");
- var _2d3=this.m_selectedChartNodes.length;
- for(var i=0;i<_2d3;i++){
- var _2d5=this.m_selectedChartNodes[i];
- if(_2d2==_2d5.getContext()){
- this.m_selectedChartNodes.splice(i,1);
- break;
- }
- }
- }else{
- this.updateSelectionContainer(_2cd);
- _2d1.highlightAreas(_2d0.getCtxAreas(),true);
- this.m_selectedChartNodes.push(_2d0);
- }
- }else{
- if(this.hasSavedSelectedChartNodes()){
- var _2d6=this.m_savedSelectedChartNodes.length;
- var _2d7=this.m_savedSelectedChartNodes;
- for(var i=0;i<_2d6;i++){
- var area=_2d7[i].getArea();
- var _2d9=this.getSavedChartHelper(area);
- var _2da=_2d9.getImageMapHighlighter();
- var _2db=_2da.getAreaId(area);
- if(_2d1.getAreaId(_2cd)===_2db){
- _2da.hideAreaById(_2db+this.m_savedPrimarySelectionColor);
- break;
- }
- }
- }
- this.updateSelectionContainer(_2cd);
- _2d1.highlightAreas(_2d0.getCtxAreas());
- this.m_selectedChartNodes=[_2d0];
- }
- };
- CSelectionController.prototype.updateSelectionContainer=function(_2dc){
- var _2dd=_2dc.parentNode;
- if(this.m_selectionContainerMap&&this.m_selectionContainerMap.name!=_2dd.name){
- var _2de=this.getChartHelper(_2dc).getImageMapHighlighter();
- _2de.hideAllAreas();
- }
- this.m_selectionContainerMap=_2dd;
- };
- CSelectionController.prototype.getChartHelper=function(_2df){
- var _2e0=_2df.parentNode;
- var _2e1=_2e0.name;
- if(!this.m_chartHelpers[_2e1]){
- this.m_chartHelpers[_2e1]=new CChartHelper(_2df,this.getSelectionObjectFactory(),this.m_oCognosViewer);
- }
- return this.m_chartHelpers[_2e1];
- };
- CSelectionController.prototype.getSavedChartHelper=function(_2e2){
- var _2e3=_2e2.parentNode;
- var _2e4=_2e3.name;
- return this.m_savedChartHelpers[_2e4];
- };
- CSelectionController.prototype.getSelectedChartArea=function(){
- return this.m_selectedChartArea;
- };
- CSelectionController.prototype.getSelectedChartNodes=function(){
- return this.m_selectedChartNodes;
- };
- CSelectionController.prototype.hasSelectedChartNodes=function(){
- return this.m_selectedChartNodes&&this.m_selectedChartNodes.length&&this.m_selectedChartNodes.length>0;
- };
- CSelectionController.prototype.getSelectedChartImage=function(){
- var _2e5=null;
- if(this.hasSelectedChartNodes()){
- var _2e6=this.m_selectedChartNodes[0];
- _2e5=_2e6.getArea();
- }
- if(_2e5===null){
- return null;
- }
- if(_2e5.tagName=="IMG"){
- return _2e5;
- }
- return this.getSelectedChartImageFromChartArea(_2e5);
- };
- CSelectionController.prototype.getSelectedChartImageFromChartArea=function(_2e7){
- var _2e8=_2e7.parentNode;
- var _2e9="#"+_2e8.getAttribute("name");
- return this.checkChildrenForChart(_2e8.parentNode,_2e9);
- };
- CSelectionController.prototype.checkChildrenForChart=function(_2ea,_2eb){
- var _2ec=_2ea.firstChild;
- while(_2ec!==null){
- if(!_2ec.tagName){
- return null;
- }else{
- if(_2ec.tagName=="IMG"&&_2ec.getAttribute("usemap")==_2eb){
- return _2ec;
- }else{
- if(_2ec.tagName==="DIV"||_2ec.tagName==="SPAN"){
- var _2ed=this.checkChildrenForChart(_2ec,_2eb);
- if(_2ed){
- return _2ed;
- }
- }
- }
- }
- _2ec=_2ec.nextSibling;
- }
- return null;
- };
- CSelectionController.prototype.downloadSelectedChartImage=function(_2ee){
- var _2ef=this.getSelectedChartImage();
- if(_2ef!==null){
- var _2f0=this.getDocumentFromImage(_2ef);
- var _2f1=_2ef.name.replace(".","_");
- var _2f2=_2f1.substr(5);
- var _2f3="?m_name=";
- _2f3+=_2f2;
- _2f3+="&format=png&b_action=xts.run&m=portal/download.xts&m_obj=";
- if(isIE()){
- _2f1=_2f0.parentWindow.eval("graphicSrc"+_2f2);
- }else{
- _2f1=_2f0.defaultView.eval("graphicSrc"+_2f2);
- }
- var _2f4="";
- if(typeof _2f1!="undefined"&&_2f1!==null){
- var _2f5=_2f1.split("&");
- if(_2f5.length===0){
- return;
- }
- if(_2f1.indexOf("/repository/")<0){
- for(var i=0;i<_2f5.length;++i){
- var _2f7=_2f5[i];
- var _2f8=_2f7.indexOf("=");
- if(_2f8!=-1){
- var _2f9=_2f7.substr(0,_2f8);
- var _2fa=_2f7.slice(_2f8+1);
- if(_2f9=="search"){
- _2f4+=_2fa;
- break;
- }
- }
- }
- }
- if(_2f4==""){
- _2f3=_2ef.getAttribute("src");
- if(_2f3.indexOf("?")!=-1){
- _2f3+="&download=true";
- }else{
- _2f3+="?download=true";
- }
- }
- if(typeof getConfigFrame=="function"){
- _2f3+=_2f4;
- _2f3=getConfigFrame().constructGETRequestParamsString(_2f3);
- window.open(_2f3,"_blank","width=0,height=0");
- }else{
- _2f3=constructGETRequestParamsString(_2f3);
- _2f3+=_2f4;
- var _2fb=this.m_oCognosViewer.getGateway();
- var _2fc=document.getElementById("CVIFrame"+this.m_sNamespace);
- if(_2fc){
- var _2fd=_2fc.src;
- if(_2fd.indexOf("repository")>=0&&_2f3.indexOf("repository")<0){
- var _2fe=_2fd.indexOf("content");
- _2f3=_2fd.substring(0,_2fe)+_2f3;
- }
- }
- if(_2f3.indexOf(_2fb)==-1){
- var _2ff=document.forms["formWarpRequest"+_2ee];
- _2f3=_2ff.action+_2f3;
- }
- if(typeof window.detachLeavingRV=="function"){
- window.detachLeavingRV();
- }
- location.href=_2f3;
- if(typeof window.attachLeavingRV=="function"){
- setTimeout(window.attachLeavingRV,100);
- }
- }
- }
- }
- };
- CSelectionController.prototype.getDocumentFromImage=function(_300){
- var _301=null;
- if(_300.ownerDocument){
- _301=_300.ownerDocument;
- }else{
- _301=_300.document;
- }
- return _301;
- };
- CSelectionController.prototype.shouldExecutePageClickedOnMouseDown=function(e){
- var _303=this.getSelections();
- if(_303.length>1){
- if(this.m_oCognosViewer.envParams["ui.action"]!=="view"){
- var node=getNodeFromEvent(e);
- try{
- while(node&&(node.nodeType==3||(node.getAttribute&&node.getAttribute("uid")===null))){
- node=node.parentNode;
- }
- }
- catch(ex){
- }
- var _305=this.getSelectionObjectFactory().getContainerType(node);
- if(_305==="list"){
- for(var i=0;i<_303.length;i++){
- if(_303[i].m_oCellRef==node){
- return false;
- }
- }
- }
- }
- }
- return true;
- };
- CSelectionController.prototype.getContainerType=function(){
- var _307="";
- if(this.hasSelectedChartNodes()){
- _307="chart";
- }else{
- if(this.getDataContainerType()==="list"){
- _307="list";
- }else{
- _307="crosstab";
- }
- }
- return _307;
- };
- CSelectionController.prototype.getDisplayValues=function(){
- var _308={};
- var _309=this.getAllSelectedObjects()[0];
- if(_309){
- var _30a=_309.getSelectedContextIds();
- if(_30a){
- for(var axis=0;axis<_30a.length;axis++){
- var _30c=[];
- var _30d=_30a[axis];
- for(var _30e=0;_30e<_30d.length;_30e++){
- var _30f=_30d[_30e];
- var _310=this.getDisplayValue(_30f);
- _30c.push(_310);
- if(axis===0){
- break;
- }
- }
- var _311="";
- switch(axis){
- case 0:
- _311="selected";
- break;
- case 1:
- _311="rows";
- break;
- default:
- _311="columns";
- }
- _308[_311]=_30c;
- }
- }
- }
- return _308;
- };
- CSelectionController.prototype.getChartTooltip=function(){
- var _312=this.getAllSelectedObjects()[0];
- if(_312){
- var area=_312.getArea();
- if(area){
- var _314=area.getAttribute("title");
- if(_314&&_314.length>0){
- return area.getAttribute("title");
- }
- }
- }
- return "";
- };
- CSelectionController.prototype.pageClickedForMobile=function(e){
- this.pageClicked(e);
- var _316=this.getAllSelectedObjects().length;
- if(_316==0){
- var node=getNodeFromEvent(e,true);
- if(!node){
- return false;
- }
- if(node.nodeName.toLowerCase()=="img"&&node.getAttribute("dttargets")){
- this.selectDrillThroughImage(node);
- return true;
- }else{
- if(node.getAttribute("dttargets")){
- this.selectDrillThroughSingleton(node);
- return true;
- }else{
- if(node.parentNode&&node.parentNode.getAttribute("dttargets")){
- this.selectDrillThroughSingleton(node.parentNode);
- return true;
- }
- }
- }
- return false;
- }
- return true;
- };
- CSelectionController.prototype.clearSavedSelections=function(){
- this.m_bSavedSelections=false;
- if(this.hasSavedSelectedObjects()){
- this.updateUI(null,this.getSavedSelectedObjects(),true,false);
- delete (this.m_aSavedSelectedObjects);
- }
- if(this.hasSavedSelectedChartNodes()){
- var _318=this.m_savedChartHelpers;
- for(var _319 in _318){
- if(_318[_319]){
- var _31a=_318[_319].getImageMapHighlighter();
- if(_31a.hideAllAreas){
- _31a.hideAllAreas();
- }
- }
- }
- delete this.m_savedChartHelpers;
- delete this.m_savedSelectedChartNodes;
- }
- };
- CSelectionController.prototype.hasSavedSelectedChartNodes=function(){
- return (this.m_savedSelectedChartNodes&&this.m_savedSelectedChartNodes.length>0);
- };
- CSelectionController.prototype.getSavedSelectedChartNodes=function(){
- return this.m_savedSelectedChartNodes;
- };
- CSelectionController.prototype.saveSelections=function(){
- this.m_savedSelectionStyles=this.m_selectionStyles;
- if(this.m_aSelectedObjects.length>0){
- this.m_aSavedSelectedObjects=[];
- var _31b=this.m_aSelectedObjects.length;
- var temp=[];
- for(var i=0;i<_31b;i++){
- if(this.isMeasure(this.m_aSelectedObjects[i].m_contextIds[0][0])){
- temp.push(this.m_aSelectedObjects[i]);
- }else{
- this.m_aSavedSelectedObjects.push(this.m_aSelectedObjects[i]);
- }
- }
- this.m_aSelectedObjects=temp;
- }
- if(this.hasSelectedChartNodes()){
- this.m_savedChartHelpers=this.m_chartHelpers;
- this.m_chartHelpers={};
- this.m_savedSelectedChartNodes=[];
- var _31e=this.m_selectedChartNodes.length;
- var temp=[];
- for(var i=0;i<_31e;i++){
- if(this.isMeasure(this.m_selectedChartNodes[i].m_contextIds[0][0])){
- var _31f=this.m_selectedChartNodes[i].getArea();
- var _320=this.getImageMapName(_31f);
- this.m_chartHelpers[_320]=this.m_savedChartHelpers[_320];
- delete this.m_savedChartHelpers[_320];
- temp.push(this.m_selectedChartNodes[i]);
- }else{
- this.m_savedSelectedChartNodes.push(this.m_selectedChartNodes[i]);
- }
- }
- this.m_selectedChartNodes=temp;
- }
- this.m_bSavedSelections=true;
- };
- CSelectionController.prototype.hasSavedSelections=function(){
- return this.m_bSavedSelections;
- };
- CSelectionController.prototype.hasSavedSelectedObjects=function(){
- return (this.m_aSavedSelectedObjects&&this.m_aSavedSelectedObjects.length>0)||this.hasSavedSelectedChartNodes();
- };
- CSelectionController.prototype.getSavedSelectedObjects=function(){
- return this.m_aSavedSelectedObjects;
- };
- CSelectionController.prototype.getImageMapName=function(_321){
- var _322=_321.parentNode;
- return _322.name;
- };
- CSelectionController.prototype.repaintBUXSelectedChartArea=function(_323,_324,_325){
- var _326={};
- var _327=_323.length;
- for(var i=0;i<_327;i++){
- var _329=_323[i].getArea();
- var _32a=this.getImageMapName(_329);
- var _32b;
- if(!_326[_32a]){
- _32b=(_324)?this.getSavedChartHelper(_329):this.getChartHelper(_329);
- _326[_32a]=_32b;
- var _32c=_32b.getImageMapHighlighter();
- _32c.hideAllAreas();
- _32c.setFillColour(this.getPrimarySelectionColor());
- _32c.setStrokeColour(this.getPrimarySelectionColor());
- }else{
- _32b=_326[_32a];
- }
- var _32d=_323[i].m_contextIds;
- if(_325&&_32d.length===1&&_32d[0].length===1&&this.isMeasure(_32d[0][0])){
- continue;
- }
- _32c.highlightAreas(_323[i].getCtxAreas(),1);
- }
- };
- CSelectionController.prototype.repaintSavedSelections=function(){
- var _32e=this.m_selectionStyles;
- this.m_selectionStyles=this.m_savedSelectionStyles;
- var _32f=this.getSavedSelectedChartNodes();
- var _330=false;
- if(_32f&&_32f.length>0){
- bIsChart=true;
- }else{
- _32f=this.getSavedSelectedObjects();
- }
- this.repaintSelectionsHelper(_32f,true,_330);
- this.resetSelectionStyles();
- this.m_selectionStyles=_32e;
- };
- CSelectionController.prototype.repaintSelections=function(){
- var _331=this.getSelectedChartNodes();
- var _332=false;
- if(_331&&_331.length>0){
- _332=true;
- }else{
- _331=this.getSelections();
- }
- this.repaintSelectionsHelper(_331,false,_332);
- };
- CSelectionController.prototype.repaintSelectionsHelper=function(_333,_334,_335){
- try{
- if(_335){
- this.repaintBUXSelectedChartArea(_333,_334);
- }else{
- this.updateUI(document,_333,true,false);
- this.updateUI(document,_333,false,false);
- }
- }
- catch(e){
- return false;
- }
- };
- CSelectionController.prototype.resetAll=function(){
- this.resetSelectionStyles();
- this.clearSavedSelections();
- this.resetSelections();
- this.resetAllowHorizontalDataValueSelection();
- };
- CSelectionController.prototype.pageClicked=function(e){
- try{
- var node=getNodeFromEvent(e);
- if(this.m_aSelectedObjects.length>0&&!this.shiftKeyPressed(e)&&!this.ctrlKeyPressed(e)){
- var _338=node;
- if(!_338.getAttribute("uid")){
- var _339=_338.parentNode;
- if(_339&&_339.nodeType==1&&typeof _339.getAttribute!="undefined"&&_339.getAttribute("uid")!=null){
- _338=_339;
- }
- }
- if(this.isCellSelected(_338)){
- if(typeof this.m_oCognosViewer.isBux!=="undefined"){
- this.repaintSelections();
- }
- if(e.button!==0){
- return false;
- }
- }
- }
- if(node.tagName&&node.tagName.toUpperCase()=="INPUT"){
- return true;
- }
- if((e.keyCode!=null)&&(e.keyCode!=13)&&(e.keyCode!=32)&&(e.keyCode!=27)&&(e.keyCode!=0)&&(e.keyCode!=121)&&(e.keyCode!=93)){
- return false;
- }
- var _33a=getDocumentFromEvent(e);
- if(!this.hasContextData()||!this.hasMetadata()){
- if(node.nodeName=="AREA"||node.nodeName=="IMG"||(typeof node.getAttribute=="function"&&node.getAttribute("flashChart")!=null)){
- this.setSelectedChartArea(node,e);
- }
- this.getObservers().notify();
- return false;
- }
- if(typeof node.selectedCell!="undefined"){
- var _33b=node;
- node=node.selectedCell;
- _33b.removeAttribute("selectedCell");
- }
- if(typeof cf!="undefined"&&typeof cf.hidePickers=="function"){
- cf.hidePickers();
- }
- if(e.keyCode==27){
- if(typeof g_reportSelectionController!="undefined"){
- g_reportSelectionController.clearSelections();
- }
- this.resetSelections(_33a);
- }else{
- if(node.nodeName=="AREA"||node.nodeName=="IMG"||(typeof node.getAttribute!="undefined"&&node.getAttribute("flashChart")!=null)){
- if(e.button!==2||this.getAllSelectedObjects().length<=1||typeof this.m_oCognosViewer.isBux==="undefined"){
- this.selectNode(node,e);
- this.setSelectedChartArea(node,e);
- }
- }else{
- if(!(node.firstChild==null&&node.cellIndex==0&&node.parentNode.rowIndex==0&&node.getAttribute("cid")==null)){
- var _33c=this.m_oCognosViewer.getViewerWidget();
- this.selectNode(node,e);
- }
- }
- }
- if(window.gViewerLogger){
- window.gViewerLogger.addContextInfo(this);
- }
- }
- catch(e){
- }
- };
- CSelectionController.prototype.getSelectionObjectFactory=function(){
- return this.m_oSelectionObjectFactory;
- };
- CSelectionController.prototype.isDrillLinkOnCrosstabCell=function(node){
- return (node.getAttribute("ctx")==null&&node.parentNode.getAttribute("dtTargets")!=null);
- };
- CSelectionController.prototype.selectObject=function(sMun,sLun,sHun,_341){
- var _342=this.getCtxIdFromMun(sMun);
- if(_342==""){
- _342=this.getCtxIdFromMetaData(sLun,sHun,_341);
- }
- if(_342!=null&&this.m_oCDManager.GetUsage(_342)!="2"){
- var _343=document.getElementById("rt"+this.getNamespace());
- if(_343!=null){
- var _344=getElementsByAttribute(_343,"*","ctx",_342);
- if(_344&&_344.length===0){
- var _345=new RegExp("(^|:)"+_342+"(:|$)","i");
- _344=getElementsByAttribute(_343,"*","ctx",_342,-1,_345);
- }
- var _346=null;
- if(_344!=null&&_344.length>0){
- _346=new CSelectionObject();
- _346.setSelectionController(this);
- _346.m_sColumnRef=_344[0].getAttribute("cid");
- _346.m_sCellTypeId=_344[0].getAttribute("uid");
- _346.m_sLayoutType=_344[0].getAttribute("type");
- _346.m_sTag=_344[0].getAttribute("tag");
- _346.m_layoutElementId=this.m_oSelectionObjectFactory.getLayoutElementId(_344[0]);
- _346.m_dataContainerType=this.m_oSelectionObjectFactory.getContainerType(_344[0]);
- _346.m_contextIds=[[_342]];
- this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_346;
- }else{
- var _347=getElementsByAttribute(_343,"*","flashChart","true");
- if(_347!=null){
- for(var _348=0;_348<_347.length;++_348){
- var ldx=_347[_348].getLDX();
- if(ldx.indexOf("<ctx>"+_342+"</ctx>")!=-1){
- _346=new CSelectionObject();
- _346.setSelectionController(this);
- var lid=_347[_348].getAttribute("lid");
- _346.m_layoutElementId=lid.replace(this.m_oCognosViewer.getId(),"");
- _346.m_dataContainerType="chart";
- _346.m_contextIds=[[_342]];
- this.m_aSelectedObjects[this.m_aSelectedObjects.length]=_346;
- }
- }
- }
- }
- }
- }
- };
- CSelectionController.prototype.buildSelectionObject=function(node,e){
- var _34d=null;
- try{
- while(node.nodeType==3){
- node=node.parentNode;
- }
- if(this.isDrillLinkOnCrosstabCell(node)){
- node=node.parentNode;
- }
- var ctx=node.getAttribute("ctx");
- var uid=node.getAttribute("uid");
- if((uid==null)&&((ctx!=null)||(node.parentNode&&node.parentNode.nodeType==1&&typeof node.parentNode.getAttribute!="undefined"&&node.parentNode.getAttribute("uid")!=null))){
- if(node.nodeName=="IMG"&&(node.src.indexOf("SM=")>-1||(isIE()>-1&&node.src.indexOf("space.gif")>-1))){
- return null;
- }
- node=node.parentNode;
- if((node.className.toUpperCase()=="BLOCK"&&node.nodeName.toUpperCase()=="DIV")||(node.getAttribute("dtTargets")!=null)){
- node=node.parentNode;
- }
- uid=node.getAttribute("uid");
- }
- if(uid!=null){
- var _350=node.childNodes;
- for(var i=0;i<_350.length;i++){
- if(_350[i].nodeName.toUpperCase()=="TABLE"&&(_350[i].className=="ls"||_350[i].className=="xt")){
- var trs=_350[i].rows;
- for(var j=0;j<trs.length;j++){
- var tds=trs[j].cells;
- for(var k=0;k<tds.length;k++){
- if(tds[k].getAttribute("uid")!=null){
- return null;
- }
- }
- }
- }
- }
- if(node.className.toUpperCase()=="REPEATERTABLECELL"&&ctx!=null){
- _34d=this.getSelectionObjectFactory().getSelectionObject(node,ctx);
- }else{
- _34d=this.getSelectionObjectFactory().getSelectionObject(node);
- }
- }
- }
- catch(e){
- }
- return _34d;
- };
- CSelectionController.prototype.shiftKeyPressed=function(e){
- if(e.keyCode=="121"){
- return false;
- }
- if(isSafari()){
- if(e.button!=2){
- return e.shiftKey?e.shiftKey:false;
- }else{
- return false;
- }
- }
- return e.shiftKey?e.shiftKey:false;
- };
- CSelectionController.prototype.ctrlKeyPressed=function(e){
- if(isSafari()){
- if(e.button!=2){
- return e.ctrlKey?e.ctrlKey:false;
- }else{
- return false;
- }
- }
- return e.ctrlKey?e.ctrlKey:false;
- };
- CSelectionController.prototype.isSelectionsPreviouslySaved=function(_358){
- var _359=false;
- if(!this.m_aSavedSelectedObjects||!this.m_aSavedSelectedObjects.length||!_358||!_358.length){
- return false;
- }
- for(var i=0;i<_358.length;i++){
- if(this.isSavedCellSelected(_358[i].getCellRef())){
- return true;
- }
- }
- return false;
- };
- CSelectionController.prototype.selectNode=function(node,e){
- try{
- while(node.nodeType==3){
- node=node.parentNode;
- }
- if(this.isDrillLinkOnCrosstabCell(node)){
- node=node.parentNode;
- }
- var _35d=null;
- if(isIE()){
- _35d=node.document;
- }else{
- _35d=node.ownerDocument;
- }
- var ctx=node.getAttribute("ctx");
- var uid=node.getAttribute("uid");
- var _360=false;
- if(typeof e=="undefined"){
- e={};
- }
- var _361=false;
- if(typeof g_reportSelectionController!="undefined"){
- _361=this.checkForReportElementNode(node);
- }
- if((ctx==null&&uid==null&&node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")==null&&_361==false)||(!this.ctrlKeyPressed(e)&&!this.shiftKeyPressed(e))){
- if(this.getSelections().length>0){
- _360=true;
- }
- if(this.hasCutColumns()==true){
- this.clearSelectedObjects(_35d);
- }else{
- this.resetSelections(_35d);
- this.repaintSavedSelections();
- if(typeof cf!="undefined"&&typeof cf.removeAllSelectionsFromCfgVariables=="function"){
- cf.removeAllSelectionsFromCfgVariables();
- }
- this.m_oCognosViewer.setCurrentNodeFocus(null);
- }
- if(this.ctrlKeyPressed(e)||this.shiftKeyPressed(e)){
- clearTextSelection(_35d);
- }
- if(typeof g_reportSelectionController!="undefined"&&_361==false){
- if(g_reportSelectionController.getSelections().length>0){
- _360=true;
- }
- g_reportSelectionController.clearSelections();
- }
- }
- var _362=node.getAttribute("dtTargets")?node:null;
- var _363=(node.nodeName.toLowerCase()==="area");
- if((uid==null)&&((ctx!=null)||(node.parentNode&&node.parentNode.nodeType==1&&typeof node.parentNode.getAttribute!="undefined"))){
- if(node.nodeName=="IMG"&&(node.src.indexOf("SM=")>-1||(isIE()>-1&&node.src.indexOf("space.gif")>-1))){
- return false;
- }
- var _364;
- var _365=3;
- do{
- node=node.parentNode;
- if(node){
- _362=(!_362&&typeof node.getAttribute!="undefined"&&node.getAttribute("dtTargets"))?node:_362;
- uid=(typeof node.getAttribute!="undefined")?node.getAttribute("uid"):null;
- _364=node.nodeName.toLowerCase();
- }
- }while((uid==null)&&node&&(--_365>0)&&(_364=="span"||_364=="div"));
- }
- if(uid!=null){
- var _366=node.childNodes;
- for(var i=0;i<_366.length;i++){
- if(_366[i].nodeName.toUpperCase()=="TABLE"&&(_366[i].className=="ls"||_366[i].className=="xt")){
- var trs=_366[i].rows;
- for(var j=0;j<trs.length;j++){
- var tds=trs[j].cells;
- for(var k=0;k<tds.length;k++){
- if(tds[k].getAttribute("uid")!=null){
- return false;
- }
- }
- }
- }
- }
- var _36c;
- if(node.className.toUpperCase()=="REPEATERTABLECELL"&&ctx!=null){
- _36c=this.getSelectionObjectFactory().getSelectionObject(node,ctx);
- }else{
- _36c=this.getSelectionObjectFactory().getSelectionObject(node);
- }
- if(this.isCellSelected(node)==false){
- if(this.shiftKeyPressed(e)){
- var _36d=this.getSelections();
- if(_36d.length>0){
- var _36e=_36d[_36d.length-1];
- if(_36e.getLayoutType()==_36c.getLayoutType()&&(_36e.getCellRef().parentNode.parentNode==_36c.getCellRef().parentNode.parentNode)){
- if(this.cellsAreInSameColumn(_36e.getCellRef(),_36c.getCellRef())){
- this.selectVertical(_36e,_36c,_35d);
- }else{
- if(_36e.getCellRef().parentNode.rowIndex==_36c.getCellRef().parentNode.rowIndex){
- this.selectHorizontal(_36e,_36c,_35d);
- }
- }
- }
- }
- clearTextSelection(_35d);
- }else{
- if(this.ctrlKeyPressed(e)){
- clearTextSelection(_35d);
- }
- }
- this.addSelectionObject(_36c,_35d);
- if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
- cf.addSelectionToCfgVariables(_36c.getColumnName());
- }
- this.m_oCognosViewer.setCurrentNodeFocus(node);
- }else{
- if(this.ctrlKeyPressed(e)){
- this.removeSelectionObject(_36c,_35d);
- if(typeof cf!="undefined"&&typeof cf.removeSelectionFromCfgVariables=="function"){
- if(!this.isColumnSelected(_36c.getTag())){
- cf.removeSelectionFromCfgVariables(_36c.getTag());
- }
- }
- clearTextSelection(_35d);
- }else{
- if(this.shiftKeyPressed(e)){
- clearTextSelection(_35d);
- }
- }
- }
- _360=true;
- }else{
- if(_361){
- var _36f=null;
- while((typeof node.id=="undefined"||node.id==null||node.id=="")&&node.parentNode!=null){
- node=node.parentNode;
- }
- if(node.id=="reportTitle"){
- _36f="TitleStyle";
- }else{
- if(node.id=="reportSubtitle"){
- _36f="SubtitleStyle";
- }else{
- if(node.id.indexOf("reportFilter")==0){
- _36f="FilterStyle";
- }
- }
- }
- if(_36f!=null){
- selectReportElement(e,node.id,_36f);
- _360=true;
- }
- }else{
- if(_362!=null&&this.m_oCognosViewer&&this.m_oCognosViewer.isMobile()&&!_363){
- var _36c=this.getSelectionObjectFactory().getSelectionObject(_362);
- this.addSelectionObject(_36c,_35d);
- }
- }
- }
- if(_360==true&&(typeof cf!="undefined"&&typeof cf.refreshDialog=="function")){
- cf.refreshDialog();
- }
- }
- catch(ex){
- }
- };
- CSelectionController.prototype.selectDrillThroughImage=function(node){
- this.m_oSelectedDrillThroughImage=node;
- };
- CSelectionController.prototype.getSelectedDrillThroughImage=function(){
- return this.m_oSelectedDrillThroughImage?this.m_oSelectedDrillThroughImage:null;
- };
- CSelectionController.prototype.selectDrillThroughSingleton=function(node){
- this.m_oSelectedDrillThroughSingleton=node;
- };
- CSelectionController.prototype.getSelectDrillThroughSingleton=function(){
- return this.m_oSelectedDrillThroughSingleton?this.m_oSelectedDrillThroughSingleton:null;
- };
- CSelectionController.prototype.getReportContextDataArray=function(){
- return this.m_aReportContextDataArray;
- };
- CSelectionController.prototype.getReportMetadataArray=function(){
- return this.m_aReportMetadataArray;
- };
- CSelectionController.prototype.setupContextDataArray=function(_372){
- this.m_aReportContextDataArray=_372;
- };
- CSelectionController.prototype.setupMetaDataArray=function(_373){
- this.m_aReportMetadataArray=_373;
- };
- CSelectionController.prototype.addContextData=function(_374){
- this.m_aSelectedObjects=[];
- this.m_oCDManager.SetContextData(_374);
- if(!this.m_bUsingCCDManager){
- this.m_bUsingCCDManager=true;
- }
- for(var i=0;i<this.m_selectedClass.length;++i){
- this.deselecting(this.m_selectedClass);
- }
- };
- CSelectionController.prototype.addMetaData=function(_376){
- this.m_aSelectedObjects=[];
- this.m_oCDManager.SetMetadata(_376);
- if(!this.m_bUsingCCDManager){
- this.m_bUsingCCDManager=true;
- }
- };
- CSelectionController.prototype.getDrillFlag=function(_377){
- var _378="";
- if(!this.m_bUsingCCDManager){
- var _379=this.m_aReportContextDataArray[_377];
- var _37a=_379[0];
- var _37b=this.m_aReportMetadataArray[_37a];
- if(typeof _37b!="undefined"&&typeof _37b[3]!="undefined"){
- _378=_37b[3];
- }
- }else{
- _378=this.m_oCDManager.GetDrillFlag(_377);
- }
- return _378;
- };
- CSelectionController.prototype.getDrillFlagForMember=function(_37c){
- var _37d="0";
- if(!this.m_bUsingCCDManager){
- var _37e=this.getContextDataItem(_37c);
- if(_37e!=null){
- var _37f=_37e[2];
- if(_37f!=""){
- var _380=_37e[0];
- var _381=this.getMetaDataItem(_380);
- if(_381!=null){
- _37d=_381[3];
- }
- }
- }
- }else{
- _37d=this.m_oCDManager.GetDrillFlagForMember(_37c);
- }
- return (_37d==null)?0:_37d;
- };
- CSelectionController.prototype.getDataType=function(_382){
- var _383=null;
- if(!this.m_bUsingCCDManager){
- var _384=this.getRDI(_382);
- if(_384&&_384.length>2){
- _383=parseInt(_384[2],10);
- }
- }else{
- _383=parseInt(this.m_oCDManager.GetDataType(_382),10);
- }
- return _383;
- };
- CSelectionController.prototype.getUsageInfo=function(_385){
- if(this.m_bUsingCCDManager){
- return this.m_oCDManager.GetUsage(_385);
- }
- };
- CSelectionController.prototype.isMeasure=function(_386){
- return (this.getUsageInfo(_386)==this.c_usageMeasure);
- };
- CSelectionController.prototype.getDepth=function(_387){
- var _388=null;
- if(!this.m_bUsingCCDManager){
- var _389=this.getRDI(_387);
- if(_389&&_389.length>5&&_389[1]=="R"){
- _388=_389[5];
- }
- }else{
- _388=this.m_oCDManager.GetDepth(_387);
- }
- return _388;
- };
- CSelectionController.prototype.getUseValue=function(_38a){
- var _38b="";
- if(!this.m_bUsingCCDManager){
- var _38c=this.m_aReportContextDataArray[_38a];
- if(typeof _38c[1]!="undefined"){
- _38b=_38c[1];
- }
- }else{
- _38b=this.m_oCDManager.GetDisplayValue(_38a);
- }
- return _38b;
- };
- CSelectionController.prototype.getTextValue=function(_38d){
- var _38e=null;
- for(var _38f=0;_38f<_38d.length;_38f++){
- if(_38d[_38f].style.visisbility!="hidden"){
- if(isIE()){
- _38e=_38d[_38f].innerText;
- }else{
- _38e=_38d[_38f].textContent;
- }
- var _390=_38d[_38f].nextSibling;
- while(_390!=null){
- if(_390.nodeName.toUpperCase()=="SPAN"&&_390.style.visibility!="hidden"){
- if(isIE()){
- _38e+=_390.innerText;
- }else{
- _38e+=_390.textContent;
- }
- }
- _390=_390.nextSibling;
- }
- break;
- }
- }
- return _38e;
- };
- CSelectionController.prototype.getDisplayValueFromDOM=function(_391,_392){
- var _393=null;
- var _394;
- var _395=new RegExp("(^|\\s)"+_391+"(\\s|$|:)","i");
- if(typeof _392!="undefined"){
- _394=getElementsByAttribute(_392,["span","td","th"],"ctx",_391,1,_395);
- }else{
- var _396=document.getElementById("CVIFrame"+this.m_sNamespace);
- if(typeof _396=="undefined"||_396==null){
- var _397=document.getElementById("RVContent"+this.m_sNamespace);
- if(typeof _397=="undefined"||_397==null){
- _394=getElementsByAttribute(document.body,["span","td","th"],"ctx",_391,1,_395);
- }else{
- _394=getElementsByAttribute(_397,["span","td","th"],"ctx",_391,1,_395);
- }
- }else{
- _394=getElementsByAttribute(_396.contentWindow.document.body,["span","td","th"],"ctx",_391,1,_395);
- }
- }
- var _398;
- if(_394.length>0&&(_394[0].nodeName.toUpperCase()=="TD"||_394[0].nodeName.toUpperCase()=="TH")){
- _398=_394[0].childNodes;
- }else{
- _398=_394;
- }
- if(_398.length==0||(_398[0].className.indexOf("chart_area")==-1&&_398[0].className.indexOf("bux-comment")==-1)){
- _393=this.getTextValue(_398);
- }
- return _393;
- };
- CSelectionController.prototype.getDisplayValue=function(_399,_39a){
- var _39b=this.getDisplayValueFromDOM(_399,_39a);
- if(_39b==null){
- _39b=this.getUseValue(_399);
- }
- return _39b;
- };
- CSelectionController.prototype.getDun=function(_39c){
- if(this.m_bUsingCCDManager){
- return this.m_oCDManager.GetDUN(_39c);
- }else{
- var _39d=this.m_aReportContextDataArray[_39c];
- if(_39d&&typeof _39d[5]!="undefined"){
- var _39e=_39d[5];
- var _39f=this.m_aReportMetadataArray[_39e];
- if(typeof _39f!="undefined"&&typeof _39f[1]!="undefined"&&_39f[1]=="D"){
- return _39f[0];
- }
- }
- }
- };
- CSelectionController.prototype.getPun=function(_3a0){
- if(this.m_bUsingCCDManager){
- return this.m_oCDManager.GetPUN(_3a0);
- }
- };
- CSelectionController.prototype.getLun=function(_3a1){
- var lun="";
- if(!this.m_bUsingCCDManager){
- var _3a3=this.m_aReportContextDataArray[_3a1];
- if(_3a3&&typeof _3a3[3]!="undefined"){
- var _3a4=_3a3[3];
- var _3a5=this.m_aReportMetadataArray[_3a4];
- if(typeof _3a5!="undefined"&&typeof _3a5[1]!="undefined"&&_3a5[1]=="L"){
- lun=_3a5[0];
- }
- }
- }else{
- lun=this.m_oCDManager.GetLUN(_3a1);
- }
- return lun;
- };
- CSelectionController.prototype.isContextId=function(_3a6){
- var _3a7=false;
- if(!this.m_bUsingCCDManager){
- var _3a8=this.m_aReportContextDataArray[_3a6];
- _3a7=(typeof _3a8=="object");
- }else{
- this.m_oCDManager.FetchContextData([_3a6]);
- _3a7=this.m_oCDManager.ContextIdExists(_3a6);
- }
- return _3a7;
- };
- CSelectionController.prototype.hasContextData=function(){
- var _3a9=false;
- if(!this.m_bUsingCCDManager){
- if(this.m_aReportContextDataArray&&this.m_aReportContextDataArray.length&&this.m_aReportContextDataArray.length()>0){
- return true;
- }
- }else{
- _3a9=this.m_oCDManager.HasContextData();
- }
- return _3a9;
- };
- CSelectionController.prototype.hasMetadata=function(){
- var _3aa=false;
- if(!this.m_bUsingCCDManager){
- if(this.m_aReportMetadataArray&&this.m_aReportMetadataArray.length&&this.m_aReportMetadataArray.length()>0){
- return true;
- }
- }else{
- _3aa=this.m_oCDManager.HasMetadata();
- }
- return _3aa;
- };
- CSelectionController.prototype.getDifferentCellIndex=function(_3ab,_3ac,_3ad){
- for(var i=0;i<_3ab.cells.length;i++){
- if(this.getSelectionObjectFactory().getSelectionObject(_3ab.cells[i]).getLayoutType()=="datavalue"){
- break;
- }
- }
- if(_3ad=="relative"){
- return (_3ac-i);
- }else{
- if(_3ad=="actual"){
- return (_3ac+i);
- }
- }
- };
- CSelectionController.prototype.cellsAreInSameColumn=function(_3af,_3b0){
- if(_3af.parentNode.rowIndex==_3b0.parentNode.rowIndex){
- return false;
- }
- if(_3af.getAttribute("cid")===null){
- if(_3af.getAttribute("uid")===_3b0.getAttribute("uid")){
- if(_3af.getAttribute("type")!="datavalue"){
- return true;
- }else{
- if(this.getDifferentCellIndex(_3af.parentNode,_3af.cellIndex,"relative")==this.getDifferentCellIndex(_3b0.parentNode,_3b0.cellIndex,"relative")){
- return true;
- }
- }
- }else{
- return false;
- }
- }else{
- if(_3af.getAttribute("cid")===_3b0.getAttribute("cid")){
- return true;
- }else{
- return false;
- }
- }
- };
- CSelectionController.prototype.selectVertical=function(_3b1,_3b2,_3b3){
- if(!_3b3){
- _3b3=document;
- }
- var _3b4=_3b1.getCellRef().parentNode;
- var _3b5,i;
- var _3b7=(_3b1.getCellRef().parentNode.rowIndex<_3b2.getCellRef().parentNode.rowIndex);
- var _3b8=(_3b1.getCellRef().parentNode.cells.length-_3b1.getCellRef().cellIndex);
- while(_3b4.rowIndex!=_3b2.getCellRef().parentNode.rowIndex){
- if(_3b7){
- _3b4=_3b4.nextSibling;
- }else{
- _3b4=_3b4.previousSibling;
- }
- if(_3b4==null){
- break;
- }
- if(_3b4.cells.length>=_3b8){
- for(i=0;i<_3b4.cells.length;i++){
- if((_3b4.cells[i].getAttribute("type")==_3b1.getLayoutType())&&this.cellsAreInSameColumn(_3b1.getCellRef(),_3b4.cells[i])){
- _3b5=this.getSelectionObjectFactory().getSelectionObject(_3b4.cells[i]);
- if(this.addSelectionObject(_3b5,_3b3)){
- if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
- cf.addSelectionToCfgVariables(_3b5.getColumnName());
- }
- }
- break;
- }
- }
- }
- }
- };
- CSelectionController.prototype.selectHorizontal=function(_3b9,_3ba,_3bb){
- var _3bc="";
- if(_3b9.getColumnRef()==null){
- if(_3b9.getCellRef().getAttribute("uid")==_3ba.getCellRef().getAttribute("uid")){
- _3bc=_3b9.getCellRef().getAttribute("uid");
- }else{
- return;
- }
- }
- var _3bd,_3be;
- var _3bf=_3ba.getCellRef().parentNode;
- var _3c0;
- if(_3ba.getCellRef().cellIndex<_3b9.getCellRef().cellIndex){
- _3bd=_3ba.getCellRef().cellIndex;
- _3be=_3b9.getCellRef().cellIndex;
- }else{
- _3be=_3ba.getCellRef().cellIndex;
- _3bd=_3b9.getCellRef().cellIndex;
- }
- for(var i=_3bd+1;i<_3be;i++){
- if(((_3b9.getColumnRef()!=null)&&(_3b9.getLayoutType()==_3ba.getLayoutType())&&(_3b9.getLayoutType()!="datavalue")||this.allowHorizontalDataValueSelection())||((_3b9.getColumnRef()==null)&&(_3bf.cells[i].getAttribute("uid")==_3bc))){
- _3c0=this.getSelectionObjectFactory().getSelectionObject(_3bf.cells[i]);
- if(this.addSelectionObject(_3c0,_3bb)){
- if(typeof cf!="undefined"&&typeof cf.addSelectionToCfgVariables=="function"){
- cf.addSelectionToCfgVariables(_3c0.getColumnName());
- }
- }
- }
- }
- };
- CSelectionController.prototype.pageDoubleClicked=function(e){
- try{
- var node=getNodeFromEvent(e);
- if(typeof node.selectedCell!="undefined"){
- var _3c4=node;
- node=node.selectedCell;
- _3c4.removeAttribute("selectedCell");
- }
- while(node.nodeType==3){
- node=node.parentNode;
- }
- var ctx=node.getAttribute("ctx");
- var uid=node.getAttribute("uid");
- if((ctx!=null)||(node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
- node=node.parentNode;
- if(node.className.toUpperCase()=="BLOCK"&&node.nodeName.toUpperCase()=="DIV"){
- node=node.parentNode;
- }
- uid=node.getAttribute("uid");
- }
- if(uid!=null&&node.firstChild!=null&&(node.getAttribute("type")=="columnTitle"||node.getAttribute("type")=="section")){
- if(typeof goWindowManager!="undefined"&&goWindowManager&&typeof goWindowManager.getApplicationFrame=="function"){
- goWindowManager.getFeatureManager().launchFeature("Rename");
- }
- }
- if(typeof g_reportSelectionController!="undefined"){
- g_reportSelectionController.clearSelections();
- }
- }
- catch(ex){
- }
- };
- CSelectionController.prototype.getSelectionHoverNodes=function(){
- return this.m_aSelectionHoverNodes;
- };
- CSelectionController.prototype.setSelectionHoverNodes=function(_3c7){
- this.m_aSelectionHoverNodes=_3c7;
- };
- CSelectionController.prototype.addSelectionHoverNode=function(node){
- this.m_aSelectionHoverNodes[this.m_aSelectionHoverNodes.length]=node;
- };
- CSelectionController.prototype.pageHover=function(e){
- try{
- var node=getNodeFromEvent(e);
- while(node.nodeType==3){
- node=node.parentNode;
- }
- if((node.getAttribute("ctx")!=null)||(node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
- if(node.parentNode.nodeName.toLowerCase()!="tr"){
- node=node.parentNode;
- }
- }
- var _3cb=this.getSelectionHoverNodes();
- var _3cc=this.getAllSelectedObjects().length;
- if(!(_3cb.length==1&&_3cb[0]==node)){
- for(var i=0;i<_3cb.length;i++){
- this.sortIconHover(_3cb[i],true);
- if(_3cc==0){
- this.pageChangeHover(_3cb[i],true);
- }
- }
- this.setSelectionHoverNodes([]);
- if(_3cc==0){
- this.sortIconHover(node,false);
- if(this.pageChangeHover(node,false)){
- this.addSelectionHoverNode(node);
- }
- }else{
- if(this.sortIconHover(node,false)){
- this.addSelectionHoverNode(node);
- }
- }
- }
- }
- catch(ex){
- }
- };
- CSelectionController.prototype.sortIconHover=function(node,_3cf){
- if(!this.isValidColumnTitle(node)){
- return false;
- }
- var _3d0=this.getSortImgNode(node);
- if(_3d0!=null&&_3d0!="undefined"){
- if(_3d0.getAttribute("sortOrder")==="nosort"){
- if(_3cf){
- _3d0.style.visibility="hidden";
- }else{
- _3d0.style.visibility="visible";
- }
- }
- return true;
- }
- return false;
- };
- CSelectionController.prototype.isValidColumnTitle=function(node){
- if(node&&node.parentNode){
- var uid=node.getAttribute("uid");
- 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")){
- return true;
- }
- }
- return false;
- };
- CSelectionController.prototype.pageChangeHover=function(node,_3d4){
- try{
- if((node.getAttribute("ctx")!=null)||(node.parentNode&&node.parentNode.nodeType==1&&node.parentNode.getAttribute("uid")!=null)){
- if(node.parentNode.nodeName.toLowerCase()!="tr"){
- node=node.parentNode;
- }
- }
- if(this.isValidColumnTitle(node)){
- var _3d5=this.isColumnSelected(node.getAttribute("tag"));
- if(!_3d5){
- _3d5=this.isColumnCut(node.getAttribute("tag"));
- }
- if(!_3d5){
- if(_3d4){
- if(node.getAttribute("oldClassName")!=null){
- node.className=node.getAttribute("oldClassName");
- node.removeAttribute("oldClassName");
- }
- this.restoreOldBackgroundImage(node);
- }else{
- if(node.getAttribute("oldClassName")!=null){
- node.className=node.getAttribute("oldClassName");
- }else{
- node.setAttribute("oldClassName",node.className);
- }
- if(node.getAttribute("oldBackgroundImageStyle")!=null){
- node.style.backgroundImage=node.getAttribute("oldBackgroundImageStyle");
- }else{
- this.saveOldCellStyles(node);
- }
- node.className+=" hoverSelection";
- return true;
- }
- }
- }
- }
- catch(ex){
- }
- return false;
- };
- CSelectionController.prototype.getSortImgNode=function(node){
- var _3d7=node.getElementsByTagName("img");
- for(var i=0;i<_3d7.length;i++){
- var sId=_3d7[i].id.toString();
- if(sId!=null&&sId.length>0&&sId.indexOf("sortimg")>=0){
- node=_3d7[i];
- return node;
- }
- }
- return null;
- };
- CSelectionController.prototype.restoreOldPadding=function(node){
- if(node&&node.style&&node.getAttribute("oldPaddingStyle")!=null){
- if(node.getAttribute("oldPaddingStyle").length>0){
- node.style.padding=node.getAttribute("oldPaddingStyle");
- }
- node.removeAttribute("oldPaddingStyle");
- }
- };
- CSelectionController.prototype.saveOldPadding=function(node,size){
- if(node&&node.getAttribute("oldPaddingStyle")==null){
- node.setAttribute("oldPaddingStyle",size.paddingTop+"px "+size.paddingRight+"px "+size.paddingBottom+"px "+size.paddingLeft+"px");
- }
- };
- CSelectionController.prototype.saveOldBorder=function(node){
- if(node&&node.getAttribute("oldBorderStyle")==null){
- node.setAttribute("oldBorderStyle",node.style.border);
- }
- };
- CSelectionController.prototype.restoreOldBorder=function(node){
- if(node&&node.style&&node.getAttribute("oldBorderStyle")!=null){
- if(node.getAttribute("oldBorderStyle").length>0){
- node.style.border=node.getAttribute("oldBorderStyle");
- }else{
- node.style.borderColor=node.style.borderWidth=node.style.borderStyle="";
- }
- node.removeAttribute("oldBorderStyle");
- }
- };
- CSelectionController.prototype.setPrimarySelectionStyles=function(cell){
- if(this.getPrimarySelectionColor()){
- cell.style.backgroundColor=this.getPrimarySelectionColor();
- }else{
- cell.style.backgroundImage=this.pS_backgroundImageURL;
- cell.style.backgroundRepeat="repeat";
- }
- };
- CSelectionController.prototype.setSecondarySelectionStyles=function(cell){
- if(this.getSecondarySelectionColor()){
- cell.style.backgroundColor=this.getSecondarySelectionColor();
- }else{
- cell.style.backgroundImage=this.sS_backgroundImageURL;
- cell.style.backgroundRepeat="repeat";
- }
- };
- CSelectionController.prototype.saveOldCellStyles=function(node){
- if(node&&node.getAttribute("oldBackgroundImageStyle")==null){
- node.setAttribute("oldBackgroundColor",this.getStyleProperty(node,"backgroundColor"));
- node.setAttribute("oldBackgroundImageStyle",this.getBackgroundImage(node));
- node.setAttribute("oldBackgroundRepeat",this.getStyleProperty(node,"backgroundRepeat"));
- node.style.backgroundImage="";
- node.style.backgroundRepeat="";
- }
- };
- CSelectionController.prototype.restoreOldBackgroundImage=function(node){
- if(node&&node.style&&node.getAttribute("oldBackgroundImageStyle")!=null){
- node.style.backgroundImage=node.getAttribute("oldBackgroundImageStyle");
- node.removeAttribute("oldBackgroundImageStyle");
- node.style.backgroundRepeat=node.getAttribute("oldBackgroundRepeat");
- node.removeAttribute("oldBackgroundRepeat");
- node.style.backgroundColor=node.getAttribute("oldBackgroundColor");
- node.removeAttribute("oldBackgroundColor");
- }
- };
- CSelectionController.prototype.getStyleProperty=function(node,_3e4){
- if(node&&node.style&&node.style[_3e4]){
- return node.style[_3e4];
- }
- return "";
- };
- CSelectionController.prototype.getBackgroundImage=function(node){
- if(node&&node.style){
- return node.style.backgroundImage;
- }
- return "";
- };
- CSelectionController.prototype.pageContextClicked=function(e){
- var node=getNodeFromEvent(e);
- if(typeof node.selectedCell!="undefined"){
- var _3e8=node;
- node=node.selectedCell;
- _3e8.removeAttribute("selectedCell");
- }
- while(node!=null&&node.tagName!="TD"){
- node=node.parentNode;
- }
- if(node!=null){
- var _3e9=this.getBackgroundImage(node);
- this.findSelectionURLs();
- if(this.getSelections().length==0||_3e9!=this.pS_backgroundImageURL){
- this.pageClicked(e);
- }
- }
- if(typeof populateContextMenu!="undefined"){
- populateContextMenu();
- moveContextMenu(e);
- }
- var _3ea=false;
- if(this.showViewerContextMenu()){
- if(typeof e.preventDefault=="function"){
- e.preventDefault();
- }
- _3ea=true;
- }
- return _3ea;
- };
- CSelectionController.prototype.chartContextMenu=function(e){
- if(!this.hasSelectedChartNodes()){
- return;
- }
- if(typeof populateContextMenu!="undefined"){
- populateContextMenu();
- moveContextMenu(e);
- }
- if(typeof e.preventDefault=="function"){
- e.preventDefault();
- }
- return false;
- };
- CSelectionController.prototype.titleAreaContextMenu=function(e,_3ed,sId){
- if(typeof populateContextMenu!="undefined"){
- goWindowManager.getApplicationFrame().cfgSet("contextMenuType",_3ed);
- goWindowManager.getApplicationFrame().cfgSet("contextMenuId",sId);
- populateContextMenu(_3ed.toUpperCase());
- moveContextMenu(e,_3ed.toUpperCase());
- }
- if(typeof e.preventDefault=="function"){
- e.preventDefault();
- }
- return false;
- };
- CSelectionController.prototype.selectionsAreAllSameType=function(){
- var _3ef=this.getSelections();
- if(_3ef.length>0){
- var _3f0=_3ef[0].getLayoutType();
- for(var i=1;i<_3ef.length;i++){
- if(_3f0!=_3ef[i].getLayoutType()){
- return 0;
- }
- }
- return 1;
- }
- return -1;
- };
- CSelectionController.prototype.selectionsAreAllOnSameColumn=function(){
- var _3f2=this.getSelections();
- var i=0;
- if(_3f2.length>0){
- var _3f4=_3f2[0].getColumnRef();
- if(_3f4!=null&&_3f4!=""){
- for(i=1;i<_3f2.length;i++){
- if(_3f4!=_3f2[i].getColumnRef()){
- return false;
- }
- }
- }else{
- var _3f5=_3f2[0].getCellTypeId();
- for(i=1;i<_3f2.length;i++){
- if(_3f5!=_3f2[i].getCellTypeId()){
- return false;
- }
- }
- }
- return true;
- }
- return false;
- };
- CSelectionController.prototype.checkForReportElementNode=function(node){
- if(typeof node!="undefined"&&node!=null&&typeof node.className!="undefined"&&node.className!=null){
- if(node.className=="tt"){
- 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")){
- node=node.parentNode.parentNode;
- }else{
- return false;
- }
- }else{
- if(typeof node.parentNode!="undefined"&&node.parentNode!=null){
- var _3f7=node.parentNode;
- while(typeof _3f7!="undefined"&&_3f7!=null){
- if(typeof _3f7.className!="undefined"&&_3f7.className!=null&&_3f7.className.substr(0,2)=="ft"){
- node=_3f7;
- break;
- }else{
- _3f7=_3f7.parentNode;
- }
- }
- }else{
- return false;
- }
- }
- var _3f8=node.className.substr(0,2);
- if(_3f8=="ta"||_3f8=="ts"||_3f8=="ft"){
- return true;
- }
- }
- return false;
- };
- CSelectionController.prototype.chartClicked=function(_3f9){
- this.setSelectedChartArea(_3f9);
- };
- CSelectionController.prototype.processColumnTitleNode=function(_3fa){
- if(!_3fa||!this.m_oCognosViewer.isBux){
- return;
- }
- var _3fb=_3fa.getCellRef();
- if(_3fb.getAttribute("contextAugmented")=="true"||"list"!=_3fa.getDataContainerType()||"columnTitle"!=_3fa.getLayoutType()){
- return;
- }
- var _3fc=_3fa.getSelectedContextIds();
- var _3fd=false;
- if(typeof _3fc=="object"&&_3fc!=null&&_3fc.length>0){
- if(this.isRelational(_3fc)&&this.getQueryModelId(_3fc[0][0])==null){
- _3fd=true;
- }else{
- return;
- }
- }
- var lid=_3fb.parentNode.parentNode.parentNode.getAttribute("lid");
- var _3ff=_3fb.parentNode.nextSibling;
- var _400=getChildElementsByAttribute(_3ff,"td","cid",_3fb.getAttribute("cid"));
- var _401=null;
- var _402=true;
- var _403;
- if(_400.length>0){
- var _404=_400[0];
- var _405=_404.childNodes.length;
- for(var _406=0;_406<_405;_406++){
- var _407=_404.childNodes[_406];
- if(_407.getAttribute&&((_407.nodeName.toLowerCase()=="table"&&typeof _407.getAttribute("lid")=="string")||_407.nodeName.toLowerCase()=="map"||_407.nodeName.toLowerCase()=="img"||_407.getAttribute("chartcontainer")=="true")){
- if(_406==0){
- _402=false;
- }
- }else{
- _403=[];
- if(_407.nodeName.toLowerCase()=="span"){
- _403.push(_407);
- }
- var _408=_407.getElementsByTagName?_407.getElementsByTagName("span"):[];
- for(var _409=0;_409<_408.length;++_409){
- if(lid==getImmediateLayoutContainerId(_408[_409])){
- _403.push(_408[_409]);
- }
- }
- for(var _40a=0;_40a<_403.length;++_40a){
- var _40b=_403[_40a];
- if(_40b.nodeType==1&&_40b.nodeName.toLowerCase()=="span"&&_40b.style.visibility!="hidden"){
- if(_40b.getAttribute("ctx")!=null&&_40b.getAttribute("ctx")!=""){
- _401=_40b.getAttribute("ctx");
- break;
- }
- }
- }
- }
- }
- }
- if(_401!=null){
- var _40c=_401.split("::")[0].split(":")[0];
- if(!_3fd){
- _403=_3fb.getElementsByTagName("span");
- if(_403.length!=0){
- var _40d=this.m_oCDManager.m_cd[_40c];
- var _40e=this.getTextValue(_403);
- var _40f={"u":_40e===null?"":_40e};
- if(typeof _40d!="undefined"){
- if(typeof _40d["r"]!="undefined"){
- _40f.r=_40d["r"];
- }
- if(typeof _40d["q"]!="undefined"){
- _40f.q=_40d["q"];
- }
- if(typeof _40d["i"]!="undefined"){
- _40f.i=_40d["i"];
- }
- }
- var _410="cloned"+_40c;
- this.m_oCDManager.m_cd[_410]=_40f;
- _403[0].setAttribute("ctx",_410);
- _3fa=this.getSelectionObjectFactory().processCTX(_3fa,_410);
- }
- }else{
- var qmid=this.getQueryModelId(_40c);
- if(qmid==null){
- }
- if(qmid!=null){
- var _412=_3fc[0][0];
- this.m_oCDManager.m_cd[_412].i=this.m_oCDManager.m_cd[_40c].i;
- return false;
- }
- }
- }else{
- _402=false;
- }
- if(!_402){
- _3fb.setAttribute("canSort","false");
- }
- _3fb.setAttribute("contextAugmented","true");
- };
- CSelectionController.prototype.selectionsInSameDataContainer=function(){
- try{
- var _413=this.getAllSelectedObjects();
- var _414=_413[0].getLayoutElementId();
- for(var _415=1;_415<_413.length;_415++){
- if(_414!=_413[_415].getLayoutElementId()){
- return false;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.selectionsFromSameDataItem=function(){
- try{
- var _416=this.getAllSelectedObjects();
- var _417=_416[0].getDataItems()[0][0];
- for(var _418=1;_418<_416.length;_418++){
- if(_417!=_416[_418].getDataItems()[0][0]){
- return false;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.isRelational=function(_419){
- try{
- if(!_419){
- var _41a=this.getAllSelectedObjects()[0];
- _419=_41a.getSelectedContextIds();
- }
- for(var _41b=0;_41b<_419.length;_41b++){
- for(var _41c=0;_41c<_419[_41b].length;_41c++){
- var ctx=_419[_41b][_41c];
- var mun=this.getMun(ctx);
- var lun=this.getLun(ctx);
- var hun=this.getHun(ctx);
- if(mun!=null&&typeof mun!="undefined"&&mun.length>0){
- return false;
- }
- if(lun!=null&&typeof lun!="undefined"&&lun.length>0){
- return false;
- }
- if(hun!=null&&typeof hun!="undefined"&&hun.length>0){
- return false;
- }
- }
- }
- return true;
- }
- catch(e){
- return true;
- }
- return true;
- };
- CSelectionController.prototype.getDataContainerType=function(){
- try{
- if(!this.getAllSelectedObjects()[0]){
- return "";
- }
- return this.getAllSelectedObjects()[0].m_dataContainerType;
- }
- catch(e){
- return "";
- }
- };
- CSelectionController.prototype.areSelectionsColumnRowTitles=function(){
- try{
- var _421=this.getAllSelectedObjects();
- for(var _422=0;_422<_421.length;_422++){
- var _423=_421[_422];
- if(_423.getLayoutType()!="columnTitle"||_423.isHomeCell()){
- return false;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.selectionsAreMeasures=function(){
- try{
- var _424=this.getAllSelectedObjects();
- for(var _425=0;_425<_424.length;_425++){
- var _426=_424[_425];
- if(this.getUsageInfo(_426.getSelectedContextIds()[0][0])!=this.c_usageMeasure){
- return false;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.selectionsNonMeasureWithMUN=function(){
- var _427=this.getAllSelectedObjects();
- if(_427.length==0){
- return false;
- }
- for(var _428=0;_428<_427.length;_428++){
- var _429=_427[0];
- if(_429.getSelectedContextIds().length==0){
- return false;
- }
- var _42a=_429.getSelectedContextIds()[0][0];
- var mun=this.getMun(_42a);
- var _42c=this.getUsageInfo(_42a);
- if(mun==null||typeof mun=="undefined"||mun.length==0||_42c==this.c_usageMeasure){
- return false;
- }
- }
- return true;
- };
- CSelectionController.prototype.areSelectionsMeasureOrCalculation=function(){
- var _42d=this.getAllSelectedObjects();
- if(_42d.length==0){
- return false;
- }
- var _42e=this.selectionsHaveCalculationMetadata();
- for(var _42f=0;_42f<_42d.length;_42f++){
- var _430=_42d[_42f];
- var _431=_430.getSelectedContextIds()[0][0];
- if(!this.isCalculationOrMeasure(_431,_42e)){
- return false;
- }
- }
- return true;
- };
- CSelectionController.prototype.selectionsHaveCalculationMetadata=function(){
- try{
- var _432=this.getDataContainerType();
- var _433=this.getAllSelectedObjects();
- for(var _434=0;_434<_433.length;_434++){
- var _435=_433[_434];
- var _436=_435.getSelectedContextIds();
- var _437=_436[0][0];
- var sHun=this.getHun(_437);
- if(!this.hasCalculationMetadata(_437,_436,_432)){
- return false;
- }
- }
- }
- catch(e){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.isCalculationOrMeasure=function(_439,_43a){
- var mun=this.getMun(_439);
- var _43c=this.getUsageInfo(_439);
- if(!(((mun==null||typeof mun=="undefined"||mun.length==0)&&_43a)||_43c==this.c_usageMeasure)){
- return false;
- }
- return true;
- };
- CSelectionController.prototype.hasCalculationMetadata=function(_43d,_43e,_43f){
- var sHun=this.getHun(_43d);
- if(this.getUsageInfo(_43d)!=this.c_usageMeasure){
- if((this.isRelational(_43e)&&this.getQueryModelId(_43d)!=null)||(!this.isRelational(_43e)&&_43f=="list"&&(sHun&&sHun!=""))){
- return false;
- }
- }
- return true;
- };
- CSelectionController.prototype.selectionsAreDateTime=function(){
- try{
- var _441=this.getAllSelectedObjects();
- for(var _442=0;_442<_441.length;_442++){
- var _443=_441[_442];
- var _444=_443.getSelectedContextIds();
- var _445=_444[0][0];
- var _446=this.getDataType(_445);
- if(_446&&typeof this.m_ccl_dateTypes[_446]!=="undefined"){
- return true;
- }
- }
- }
- catch(e){
- return false;
- }
- return false;
- };
- CSelectionController.prototype.getSelectedObjectsJsonContext=function(){
- try{
- var _447=this.getAllSelectedObjects();
- if(_447===null||_447.length<=0){
- return null;
- }
- var _448=this.m_oCognosViewer.getModelPath();
- var _449=[];
- for(var i=0;i<_447.length;i++){
- var obj=_447[i].getContextJsonObject(this,_448);
- _449.push(obj);
- }
- return _449;
- }
- catch(e){
- }
- };
- CSelectionController.prototype.destroy=function(){
- delete this.m_oCognosViewer;
- delete this.m_aCutColumns;
- delete this.m_aSelectedObjects;
- delete this.m_selectedClass;
- delete this.m_cutClass;
- if(this.m_oObserver&&this.m_oObserver.destroy){
- this.m_oObserver.destroy();
- }
- delete this.m_oObserver;
- delete this.m_aReportMetadataArray;
- delete this.m_aReportContextDataArray;
- if(this.m_oCDManager&&this.m_oCDManager.destroy){
- this.m_oCDManager.destroy();
- }
- delete this.m_oCDManager;
- if(this.m_oSelectionObjectFactory&&this.m_oSelectionObjectFactory.destroy){
- this.m_oSelectionObjectFactory.destroy();
- }
- delete this.m_oSelectionObjectFactory;
- delete this.m_selectedChartArea;
- delete this.m_selectedChartNodes;
- delete this.m_selectionContainerMap;
- delete this.m_chartHelpers;
- delete this.m_oJsonForMarshal;
- if(this.hasSavedSelections()){
- this.clearSavedSelections();
- }
- };
- function clearTextSelection(_44c){
- if(!_44c){
- _44c=document;
- }
- try{
- if(typeof _44c.selection=="object"&&_44c.selection!==null){
- _44c.selection.empty();
- }else{
- if(typeof window.getSelection=="function"&&typeof window.getSelection()=="object"&&window.getSelection()!==null){
- window.getSelection().removeAllRanges();
- }
- }
- }
- catch(e){
- }
- };
- function CDrillThroughTarget(_44d,_44e,_44f,_450,_451,path,_453,_454,_455,_456,_457,_458){
- this.m_label=_44d;
- this.m_outputFormat=_44e;
- this.m_outputLocale=_44f;
- this.m_showInNewWindow=_450;
- this.m_method=_451;
- this.m_path=path;
- this.m_bookmark=_453;
- this.m_parameters=_454;
- this.m_objectPaths=_455;
- this.m_prompt="false";
- this.m_dynamicDrillThrough=false;
- this.m_parameterProperties=_458;
- if(typeof _456!="undefined"&&_456!=null){
- if(_456=="yes"){
- this.m_prompt="true";
- }else{
- if(_456=="target"){
- this.m_prompt="";
- }
- }
- }
- if(typeof _457!="undefined"&&_457!=null){
- if(typeof _457=="string"){
- _457=_457=="true"?true:false;
- }
- this.m_dynamicDrillThrough=_457;
- }
- };
- function CDrillThroughTarget_getParameterProperties(){
- return this.m_parameterProperties;
- };
- function CDrillThroughTarget_getLabel(){
- return this.m_label;
- };
- function CDrillThroughTarget_getOutputFormat(){
- return this.m_outputFormat;
- };
- function CDrillThroughTarget_getOutputLocale(){
- return this.m_outputLocale;
- };
- function CDrillThroughTarget_getShowInNewWindow(){
- return this.m_showInNewWindow;
- };
- function CDrillThroughTarget_getMethod(){
- return this.m_method;
- };
- function CDrillThroughTarget_getPath(){
- return this.m_path;
- };
- function CDrillThroughTarget_getBookmark(){
- return this.m_bookmark;
- };
- function CDrillThroughTarget_getParameters(){
- return this.m_parameters;
- };
- function CDrillThroughTarget_getObjectPaths(){
- return this.m_objectPaths;
- };
- function CDrillThroughTarget_getPrompt(){
- return this.m_prompt;
- };
- function CDrillThroughTarget_isDynamicDrillThrough(){
- return this.m_dynamicDrillThrough;
- };
- CDrillThroughTarget.prototype.getLabel=CDrillThroughTarget_getLabel;
- CDrillThroughTarget.prototype.getOutputFormat=CDrillThroughTarget_getOutputFormat;
- CDrillThroughTarget.prototype.getOutputLocale=CDrillThroughTarget_getOutputLocale;
- CDrillThroughTarget.prototype.getShowInNewWindow=CDrillThroughTarget_getShowInNewWindow;
- CDrillThroughTarget.prototype.getMethod=CDrillThroughTarget_getMethod;
- CDrillThroughTarget.prototype.getPath=CDrillThroughTarget_getPath;
- CDrillThroughTarget.prototype.getBookmark=CDrillThroughTarget_getBookmark;
- CDrillThroughTarget.prototype.getParameters=CDrillThroughTarget_getParameters;
- CDrillThroughTarget.prototype.getObjectPaths=CDrillThroughTarget_getObjectPaths;
- CDrillThroughTarget.prototype.getPrompt=CDrillThroughTarget_getPrompt;
- CDrillThroughTarget.prototype.isDynamicDrillThrough=CDrillThroughTarget_isDynamicDrillThrough;
- CDrillThroughTarget.prototype.getParameterProperties=CDrillThroughTarget_getParameterProperties;
- function sXmlEncode(_459){
- var _45a=""+_459;
- if((_45a=="0")||((_459!=null)&&(_459!=false))){
- _45a=_45a.replace(/&/g,"&");
- _45a=_45a.replace(/</g,"<");
- _45a=_45a.replace(/>/g,">");
- _45a=_45a.replace(/"/g,""");
- _45a=_45a.replace(/'/g,"'");
- }else{
- if(_459==null){
- _45a="";
- }
- }
- return _45a;
- };
- function createFormField(name,_45c){
- var _45d=document.createElement("input");
- _45d.setAttribute("type","hidden");
- _45d.setAttribute("name",name);
- _45d.setAttribute("value",_45c);
- return (_45d);
- };
- function setBackURLToCloseWindow(_45e){
- var _45f=_45e.childNodes;
- if(_45f){
- for(var _460=0;_460<_45f.length;++_460){
- var _461=_45f[_460];
- var _462=_461.getAttribute("name");
- if(_462&&_462=="ui.backURL"){
- _45e.removeChild(_461);
- }
- }
- }
- _45e.appendChild(createFormField("ui.backURL","javascript:window.close();"));
- };
- function doMultipleDrills(_463,cvId){
- if(parent!=this&&parent.doMultipleDrills){
- if(getCVId()!=""&&getCVId()!=cvId){
- cvId=getCVId();
- }
- return parent.doMultipleDrills(_463,cvId);
- }else{
- if(window.gViewerLogger){
- window.gViewerLogger.log("Drill Targets",_463,"text");
- }
- var oCV=null;
- try{
- oCV=getCognosViewerObjectRef(cvId);
- }
- catch(exception){
- }
- var _466=buildDrillForm(oCV);
- addDrillEnvironmentFormFields(_466,oCV);
- if(typeof oCV!="undefined"&&oCV!=null){
- var _467=oCV.getModelPath();
- _466.appendChild(createFormField("modelPath",_467));
- var _468=oCV.getSelectionController();
- var _469="";
- if(typeof getViewerSelectionContext!="undefined"&&typeof CSelectionContext!="undefined"){
- _469=getViewerSelectionContext(_468,new CSelectionContext(_467));
- }
- _466.appendChild(createFormField("drillContext",_469));
- _466.appendChild(createFormField("modelDrillEnabled",_468.getModelDrillThroughEnabled()));
- if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"&&document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value!=""){
- _466.appendChild(createFormField("drillSource",document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value));
- }else{
- if(typeof oCV.envParams["ui.spec"]!="undefined"){
- _466.appendChild(createFormField("sourceSpecification",oCV.envParams["ui.spec"]));
- }
- }
- }
- _466.setAttribute("launchGotoPage","true");
- _466.appendChild(createFormField("drillTargets",_463));
- _466.appendChild(createFormField("invokeGotoPage","true"));
- _466.appendChild(createFormField("m","portal/drillthrough.xts"));
- _466.appendChild(createFormField("b_action","xts.run"));
- var _46a="winNAT_"+(new Date()).getTime();
- var _46b="..";
- if(oCV!=null){
- _46b=oCV.getWebContentRoot();
- var _46c=oCV.getExecutionParameters();
- if(_46c!=""){
- _466.appendChild(createFormField("encExecutionParameters",_46c));
- }
- }
- if(!oCV||!oCV.launchGotoPageForIWidgetMobile(_466)){
- if(oCV&&typeof oCV.launchGotoPage==="function"){
- oCV.launchGotoPage(_466);
- }else{
- var _46d=_46b+"/rv/blankDrillWin.html";
- _466.target=_46a;
- window.open(_46d,_46a);
- }
- }
- }
- };
- function buildDrillForm(oCV){
- var _46f=document.getElementById("drillForm");
- if(_46f){
- document.body.removeChild(_46f);
- }
- _46f=document.createElement("form");
- if(typeof oCV!="undefined"&&oCV!=null){
- var _470=document.getElementById("formWarpRequest"+oCV.getId());
- _46f.setAttribute("target",_470.getAttribute("target"));
- _46f.setAttribute("action",_470.getAttribute("action"));
- }else{
- _46f.setAttribute("action",location.pathname);
- }
- _46f.setAttribute("id","drillForm");
- _46f.setAttribute("name","drillForm");
- _46f.setAttribute("method","post");
- _46f.style.display="none";
- document.body.appendChild(_46f);
- return _46f;
- };
- function addDrillEnvironmentFormFields(_471,oCV){
- if(window.g_dfEmail){
- _471.appendChild(createFormField("dfemail",window.g_dfEmail));
- }
- if(oCV!=null){
- _471.appendChild(createFormField("cv.id",oCV.getId()));
- if(typeof oCV.envParams["ui.sh"]!="undefined"){
- _471.appendChild(createFormField("ui.sh",oCV.envParams["ui.sh"]));
- }
- if(oCV.getViewerWidget()==null){
- if(typeof oCV.envParams["cv.header"]!="undefined"){
- _471.appendChild(createFormField("cv.header",oCV.envParams["cv.header"]));
- }
- if(typeof oCV.envParams["cv.toolbar"]!="undefined"){
- _471.appendChild(createFormField("cv.toolbar",oCV.envParams["cv.toolbar"]));
- }else{
- var _473=oCV.getAdvancedServerProperty("VIEWER_PASS_PORTLET_TOOLBAR_STATE_ON_DRILLTHROUGH");
- if(oCV.m_viewerFragment&&_473!=null&&_473===true){
- var _474=oCV.m_viewerFragment.canShowToolbar()?"true":"false";
- _471.appendChild(createFormField("cv.toolbar",_474));
- }
- }
- }
- if(typeof oCV.envParams["ui.backURL"]!="undefined"){
- _471.appendChild(createFormField("ui.backURL",oCV.envParams["ui.backURL"]));
- }
- if(typeof oCV.envParams["ui.postBack"]!="undefined"){
- _471.appendChild(createFormField("ui.postBack",oCV.envParams["ui.postBack"]));
- }
- if(typeof oCV.envParams["savedEnv"]!="undefined"){
- _471.appendChild(createFormField("savedEnv",oCV.envParams["savedEnv"]));
- }
- if(typeof oCV.envParams["ui.navlinks"]!="undefined"){
- _471.appendChild(createFormField("ui.navlinks",oCV.envParams["ui.navlinks"]));
- }
- if(typeof oCV.envParams["lang"]!="undefined"){
- _471.appendChild(createFormField("lang",oCV.envParams["lang"]));
- }
- if(typeof oCV.envParams["ui.errURL"]!="undefined"){
- _471.appendChild(createFormField("ui.errURL",oCV.envParams["ui.errURL"]));
- }
- var _475="";
- if(oCV.envParams["ui.routingServerGroup"]){
- _475=oCV.envParams["ui.routingServerGroup"];
- }
- _471.appendChild(createHiddenFormField("ui.routingServerGroup",_475));
- }else{
- _471.appendChild(createFormField("cv.header","false"));
- _471.appendChild(createFormField("cv.toolbar","false"));
- }
- };
- function appendReportHistoryObjects(oCV,_477){
- if(oCV!=null&&typeof oCV.rvMainWnd!="undefined"&&_477!=null){
- oCV.rvMainWnd.addCurrentReportToReportHistory();
- var _478=oCV.rvMainWnd.saveReportHistoryAsXML();
- _477.appendChild(createFormField("cv.previousReports",_478));
- }
- };
- function doSingleDrill(_479,args,_47b,_47c,_47d,_47e,_47f,_480,cvId,_482,_483){
- var _484="";
- if(typeof cvId=="string"){
- _484=cvId;
- }
- var oCV=null;
- try{
- oCV=getCognosViewerObjectRef(cvId);
- }
- catch(exception){
- }
- if(!oCV&&parent!=this&&parent.doSingleDrill){
- if(getCVId()!=""&&getCVId()!=cvId){
- cvId=getCVId();
- }
- return parent.doSingleDrill(_479,args,_47b,_47c,_47d,_47e,_47f,_480,cvId,_482,_483);
- }else{
- if(typeof _47b=="undefined"){
- _47b="default";
- }else{
- if(_47b=="execute"){
- _47b="run";
- }
- }
- if(_47b=="edit"&&oCV!=null&&typeof oCV.m_viewerFragment){
- _479="_blank";
- }
- var _486=buildDrillForm(oCV);
- var _487="<authoredDrillRequest>";
- _487+="<param name=\"action\">"+sXmlEncode(_47b)+"</param>";
- _487+="<param name=\"target\">"+sXmlEncode(args[0][1])+"</param>";
- _487+="<param name=\"format\">"+sXmlEncode(_47c)+"</param>";
- _487+="<param name=\"locale\">"+sXmlEncode(_47d)+"</param>";
- _487+="<param name=\"prompt\">"+sXmlEncode(_482)+"</param>";
- _487+="<param name=\"dynamicDrill\">"+sXmlEncode(_483)+"</param>";
- if(typeof oCV!="undefined"&&oCV!=null){
- _487+="<param name=\"sourceTracking\">"+oCV.getTracking()+"</param>";
- if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"){
- _487+="<param name=\"source\">"+sXmlEncode(document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value)+"</param>";
- }
- var _488=oCV.getModelPath();
- _487+="<param name=\"metadataModel\">"+sXmlEncode(_488)+"</param>";
- _487+="<param name=\"selectionContext\">"+sXmlEncode(getViewerSelectionContext(oCV.getSelectionController(),new CSelectionContext(_488)))+"</param>";
- if(typeof document.forms["formWarpRequest"+oCV.getId()]["ui.object"]!="undefined"&&document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value!=""){
- _487+="<param name=\"source\">"+sXmlEncode(document.forms["formWarpRequest"+oCV.getId()]["ui.object"].value)+"</param>";
- }else{
- if(typeof oCV.envParams["ui.spec"]!="undefined"){
- _487+="<param name=\"sourceSpecification\">"+sXmlEncode(oCV.envParams["ui.spec"])+"</param>";
- }
- }
- }
- if(_47e!=""){
- _487+="<param name=\"bookmark\">"+_47e+"</param>";
- }
- if(_47b!="view"){
- if(typeof _47f!="undefined"){
- _487+="<param name=\"sourceContext\">"+sXmlEncode(_47f)+"</param>";
- }
- if(typeof _480!="undefined"){
- _487+="<param name=\"objectPaths\">"+sXmlEncode(_480)+"</param>";
- }
- }
- var _489=0;
- _487+="<drillParameters>";
- var _48a=[];
- for(_489=1;_489<args.length;_489++){
- var sSel=args[_489][1];
- if(_47c=="HTML"&&(sSel.indexOf("<selectChoices")==0)){
- var _48c=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(args[_489][1])));
- if(_48c){
- var sMun=_48c.getAttribute("mun");
- if(sMun!=null&&sMun!=""){
- _48c.setAttribute("useValue",sMun);
- sSel="<selectChoices>"+XMLBuilderSerializeNode(_48c)+"</selectChoices>";
- }
- }
- }
- var _48e=args[_489][0];
- var _48f=false;
- for(var i=0;i<_48a.length;i++){
- var _491=_48a[i];
- if(_491.name===_48e&&_491.value===sSel){
- _48f=true;
- break;
- }
- }
- if(!_48f){
- _48a.push({"name":_48e,"value":sSel});
- _487+="<param name=\""+sXmlEncode(_48e)+"\">"+sXmlEncode(sSel)+"</param>";
- }
- }
- _487+="</drillParameters>";
- _487+=getExecutionParamNode(oCV);
- _487+="</authoredDrillRequest>";
- _486.appendChild(createFormField("authoredDrill.request",_487));
- _486.appendChild(createFormField("ui.action","authoredDrillThrough2"));
- _486.appendChild(createFormField("b_action","cognosViewer"));
- addDrillEnvironmentFormFields(_486,oCV);
- if(!oCV||!oCV.executeDrillThroughForIWidgetMobile(_486)){
- if(oCV&&typeof oCV.sendDrillThroughRequest==="function"){
- oCV.sendDrillThroughRequest(_486);
- }else{
- if(_479==""&&oCV!=null&&typeof oCV.m_viewerFragment!="undefined"){
- oCV.m_viewerFragment.raiseAuthoredDrillEvent(_487);
- }else{
- if((oCV!=null&&oCV.getViewerWidget()!=null)||_479!=""){
- setBackURLToCloseWindow(_486);
- var _492="winNAT_"+(new Date()).getTime();
- var _493="..";
- if(oCV!=null){
- _493=oCV.getWebContentRoot();
- }
- var _494=_493+"/rv/blankDrillWin.html";
- if(_484){
- _494+="?cv.id="+_484;
- }
- if(oCV==null){
- _494=window.location.href.substring(0,window.location.href.indexOf("/v1"));
- _494+="/?perspective=classicviewer";
- _494+="&altDrillFlag=true";
- _494+="&format="+sXmlEncode(_47c);
- var _495=_486.getAttribute("name")+Date.now().toString();
- _486.setAttribute("name",_495);
- if(typeof (Storage)!=="undefined"){
- localStorage.setItem(_495,_486.outerHTML);
- _494+="&drillFormLabel="+_495;
- }else{
- console.log("Sorry! No Web Storage support...");
- }
- }
- if(window.gViewerLogger){
- window.gViewerLogger.log("Drill Specification",_487,"xml");
- }
- _486.target=_492;
- newWindow=window.open(_494,_492);
- }else{
- appendReportHistoryObjects(oCV,_486);
- if(window.gViewerLogger){
- window.gViewerLogger.log("Drill Specification",_487,"xml");
- }
- _486.target=(oCV&&oCV.getDrillFormTarget)?oCV.getDrillFormTarget():"_self";
- _486.submit();
- if(oCV!=null&&!oCV.getDrillFormTarget){
- setTimeout(getCognosViewerObjectRefAsString(oCV.getId())+".getRequestIndicator().show()",10);
- }
- }
- }
- }
- }
- }
- };
- function getExecutionParamNode(oCV){
- var _497="";
- if(typeof oCV!="undefined"&&oCV!=null){
- var _498=oCV.getExecutionParameters();
- if(_498!=""){
- _497+="<param name=\"executionParameters\">";
- _497+=sXmlEncode(_498);
- _497+="</param>";
- }
- }
- return _497;
- };
- function doSingleDrillThrough(_499,_49a,cvId){
- var _49c=_499[0][0];
- if(typeof _49c=="undefined"||_49c==null){
- return;
- }
- var _49d=cvId&&window[cvId+"drillTargets"]?window[cvId+"drillTargets"][_49c]:drillTargets[_49c];
- if(typeof _49d=="undefined"){
- return;
- }
- if(_49a!=""&&_49d.getPath()==""){
- document.location="#"+_49a;
- }else{
- var args=[];
- args[args.length]=["ui.object",_49d.getPath()];
- for(var _49f=1;_49f<_499.length;++_49f){
- args[args.length]=_499[_49f];
- }
- var _4a0="";
- if(_49d.getShowInNewWindow()=="true"){
- _4a0="_blank";
- }
- var _4a1=_49d.getParameters();
- var _4a2=_49d.getObjectPaths();
- var _4a3=cvId;
- if(!cvId){
- _4a3=getCVId();
- }
- doSingleDrill(_4a0,args,_49d.getMethod(),_49d.getOutputFormat(),_49d.getOutputLocale(),_49a,_4a1,_4a2,_4a3,_49d.getPrompt(),false);
- }
- };
- function getCVId(){
- var _4a4="";
- try{
- _4a4=this.frameElement.id.substring("CVIFrame".length);
- }
- catch(exception){
- }
- return _4a4;
- };
- function doMultipleDrillThrough(_4a5,cvId){
- var _4a7="<rvDrillTargets>";
- for(var _4a8=0;_4a8<_4a5.length;++_4a8){
- var _4a9=_4a5[_4a8];
- if(_4a9.length<3){
- continue;
- }
- var _4aa=_4a9[0];
- if(typeof _4aa=="undefined"||_4aa==null){
- continue;
- }
- var _4ab=_4a9[1];
- if(typeof _4ab=="undefined"||_4ab==null){
- continue;
- }
- var _4ac=cvId&&window[cvId+"drillTargets"]?window[cvId+"drillTargets"][_4aa]:drillTargets[_4aa];
- if(typeof _4ac=="undefined"||_4ac==null){
- continue;
- }
- if(_4ab===null||_4ab===""){
- _4ab=_4ac.getLabel();
- }
- _4a7+="<drillTarget ";
- _4a7+="outputFormat=\"";
- _4a7+=_4ac.getOutputFormat();
- _4a7+="\" ";
- _4a7+="outputLocale=\"";
- _4a7+=_4ac.getOutputLocale();
- _4a7+="\" ";
- _4a7+="label=\"";
- _4a7+=sXmlEncode(_4ab);
- _4a7+="\" ";
- _4a7+="path=\"";
- _4a7+=sXmlEncode(_4ac.getPath());
- _4a7+="\" ";
- _4a7+="showInNewWindow=\"";
- _4a7+=_4ac.getShowInNewWindow();
- _4a7+="\" ";
- _4a7+="method=\"";
- _4a7+=_4ac.getMethod();
- _4a7+="\" ";
- _4a7+="prompt=\"";
- _4a7+=_4ac.getPrompt();
- _4a7+="\" ";
- _4a7+="dynamicDrill=\"";
- _4a7+=_4ac.isDynamicDrillThrough();
- _4a7+="\">";
- for(var _4ad=2;_4ad<_4a9.length;++_4ad){
- _4a7+=_4a9[_4ad];
- }
- _4a7+=_4ac.getParameters();
- _4a7+=_4ac.getObjectPaths();
- _4a7+="</drillTarget>";
- }
- _4a7+="</rvDrillTargets>";
- if(!cvId){
- cvId=getCVId();
- }
- doMultipleDrills(_4a7,cvId);
- };
- function CScriptLoader(_4ae){
- this.m_oFiles={};
- this.m_aScripts=[];
- this.m_aDocumentWriters=[];
- this.m_ajaxWarnings=[];
- this.m_bIgnoreAjaxWarnings=false;
- this.m_bHandleStylesheetLimit=false;
- this.m_iInterval=20;
- this.m_reFindCssPath=new RegExp("<link[^>]*href=\"([^\"]*)\"","i");
- this.m_reFindInlineStyle=/<style\b(\s|.)*?<\/style>/gi;
- this.m_reHasCss=/<link .*?>/gi;
- this.m_reIsCss=/\.css$/i;
- this.m_reIsJavascript=/\.js$/i;
- this.m_reIsPromptingLocaleJavascript=/prompting.res.[promptingStrings|promptLocale].*\.js$/i;
- this.m_reScriptTagClose=/\s*<\/script>.*?$/i;
- this.m_reScriptTagOpen=/^.*?<script[^>]*>\s*/i;
- this.m_reStyleTagClose=/(-|>|\s)*<\/style>\s*$/gi;
- this.m_reStyleTagOpen=/^\s*<style[^>]*>(\s|<|!|-)*/gi;
- this.m_reEscapedCharacters=/\\[\\"']/g;
- this.m_reStringLiterals=/("|')[\s\S]*?\1/g;
- this.m_sWebContentRoot=_4ae;
- this.m_bHasCompletedExecution=false;
- this.m_aScriptLoadQueue=[];
- this.m_bBlockScriptLoading=false;
- this.m_bUseScriptBlocking=false;
- this.m_bBlockPromptingLocaleScripts=false;
- this.m_aBlockedPromptingLocaleFileQueue=[];
- };
- CScriptLoader.prototype.hasCompletedExecution=function(){
- return this.m_bHasCompletedExecution;
- };
- CScriptLoader.prototype.setHandlerStylesheetLimit=function(_4af){
- this.m_bHandleStylesheetLimit=_4af;
- };
- CScriptLoader.prototype.executeScripts=function(_4b0,_4b1){
- if(this.isReadyToExecute()){
- for(var _4b2=0;_4b2<this.m_aScripts.length;_4b2++){
- if(this.m_aScripts[_4b2]){
- var _4b3=document.createElement("script");
- _4b3.setAttribute("language","javascript");
- _4b3.setAttribute("type","text/javascript");
- this.addNamespaceAttribute(_4b3,_4b1);
- _4b3.text=this.m_aScripts[_4b2];
- document.getElementsByTagName("head").item(0).appendChild(_4b3);
- }
- }
- this.m_aScripts=[];
- for(var idx=0;idx<this.m_aDocumentWriters.length;++idx){
- var _4b5=this.m_aDocumentWriters[idx];
- _4b5.execute();
- }
- this.m_aDocumentWriters=[];
- if(!this.m_aScripts.length&&!this.m_aDocumentWriters.length){
- if(typeof _4b0=="function"){
- _4b0();
- }
- this.m_bHasCompletedExecution=true;
- }else{
- setTimeout(function(){
- window.gScriptLoader.executeScripts(_4b0,_4b1);
- },this.m_iInterval);
- }
- }else{
- setTimeout(function(){
- window.gScriptLoader.executeScripts(_4b0,_4b1);
- },this.m_iInterval);
- }
- };
- CScriptLoader.prototype.isReadyToExecute=function(){
- for(var _4b6 in this.m_oFiles){
- if(this.m_oFiles[_4b6]!="complete"){
- return false;
- }
- }
- if(this.m_aScriptLoadQueue.length>0){
- return false;
- }
- return true;
- };
- CScriptLoader.prototype.loadCSS=function(_4b7,_4b8,_4b9,_4ba){
- var aM=_4b7.match(this.m_reHasCss);
- if(aM){
- for(var i=0;i<aM.length;i++){
- if(aM[i].match(this.m_reFindCssPath)){
- var _4bd=RegExp.$1;
- if(_4bd.indexOf("GlobalReportStyles")!=-1){
- this.validateGlobalReportStyles(_4bd);
- if(_4b9){
- if(_4bd.indexOf("GlobalReportStyles.css")!=-1){
- _4bd=_4bd.replace("GlobalReportStyles.css","GlobalReportStyles_10.css");
- }
- var _4be=this.getGlobalReportStylesClassPrefix(_4bd);
- _4bd=_4bd.replace(".css","_NS.css");
- if(_4b8){
- _4b8.className="buxReport "+_4be;
- }
- }
- }
- this.loadObject(_4bd,_4ba);
- }
- _4b7=_4b7.replace(aM[i],"");
- }
- }
- return _4b7;
- };
- CScriptLoader.prototype.getGlobalReportStylesClassPrefix=function(_4bf){
- var _4c0=null;
- if(_4bf.indexOf("GlobalReportStyles_11.4.css")!=-1){
- _4c0="v114";
- }
- if(_4bf.indexOf("GlobalReportStyles_11.css")!=-1){
- _4c0="v11";
- }
- if(_4bf.indexOf("GlobalReportStyles_10.css")!=-1){
- _4c0="v10";
- }else{
- if(_4bf.indexOf("GlobalReportStyles_1.css")!=-1){
- _4c0="v1";
- }else{
- if(_4bf.indexOf("GlobalReportStyles_none.css")!=-1){
- _4c0="vnone";
- }else{
- if(_4bf.indexOf("GlobalReportStyles.css")!=-1){
- _4c0="v8";
- }
- }
- }
- }
- return _4c0;
- };
- CScriptLoader.prototype.validateGlobalReportStyles=function(_4c1){
- var _4c2=document.getElementsByTagName("link");
- for(var i=0;i<_4c2.length;++i){
- var _4c4=_4c2[i];
- if(_4c4.getAttribute("href").indexOf("GlobalReportStyles")!=-1){
- if(_4c4.getAttribute("href").toLowerCase()!=_4c1.toLowerCase()){
- var _4c5=_4c1.split("/");
- var _4c6=_4c4.getAttribute("href").split("/");
- if(_4c5[_4c5.length-1]!=_4c6[_4c6.length-1]){
- this.m_ajaxWarnings.push("Ajax response contains different versions of the GlobalReportStyles.css.");
- }
- }
- break;
- }
- }
- };
- CScriptLoader.prototype.loadFile=function(_4c7,_4c8,_4c9){
- var sURL="";
- if(_4c7){
- sURL=_4c7;
- }
- var _4cb=null;
- if(typeof _4c8=="string"){
- _4cb=_4c8;
- }
- var _4cc="POST";
- if(_4c9=="GET"){
- _4cc="GET";
- }
- var _4cd=null;
- if(typeof ActiveXObject!="undefined"){
- _4cd=new ActiveXObject("Msxml2.XMLHTTP");
- }else{
- _4cd=new XMLHttpRequest();
- }
- _4cd.open(_4cc,sURL,false);
- _4cd.send(_4cb);
- return _4cd.responseText;
- };
- function CScriptLoader_onReadyStateChange(){
- if(typeof this.readyState=="undefined"){
- this.readyState="complete";
- }
- if(this.readyState=="loaded"||this.readyState=="complete"){
- var path=this.sFilePath;
- if(!path&&this.getAttribute){
- path=this.getAttribute("href");
- }
- window.gScriptLoader.setFileState(path,"complete");
- window.gScriptLoader.m_bBlockScriptLoading=false;
- if(this.sFilePath&&window.gScriptLoader.m_bBlockPromptingLocaleScripts&&this.sFilePath.match(window.gScriptLoader.m_reIsPromptingLocaleJavascript)){
- window.gScriptLoader.m_bBlockPromptingLocaleScripts=false;
- if(window.gScriptLoader.m_aBlockedPromptingLocaleFileQueue.length>0){
- var _4cf=window.gScriptLoader.m_aBlockedPromptingLocaleFileQueue.shift();
- window.gScriptLoader.loadObject(_4cf.sName,_4cf.sNamespaceId);
- }
- }
- if(window.gScriptLoader.m_aScriptLoadQueue.length>0){
- window.gScriptLoader.loadObject();
- }
- }
- };
- CScriptLoader.prototype.moveLinks=function(node){
- if(!node){
- return;
- }
- var _4d1=node.getAttribute("href");
- if(!_4d1||this.m_oFiles[_4d1]){
- return;
- }
- this.m_oFiles[_4d1]="complete";
- document.getElementsByTagName("head").item(0).appendChild(node);
- };
- CScriptLoader.prototype.loadObject=function(_4d2,_4d3){
- var _4d4=null;
- if(typeof _4d2==="undefined"){
- if(this.m_aScriptLoadQueue.length>0){
- var _4d5=this.m_aScriptLoadQueue.shift();
- _4d2=_4d5.name;
- _4d3=_4d5.namespaceId;
- }else{
- return;
- }
- }
- if(this.m_oFiles[_4d2]){
- return;
- }
- if(this.m_bBlockScriptLoading){
- this.m_aScriptLoadQueue.push({"name":_4d2,"namespaceId":_4d3});
- }else{
- if(_4d2.match(this.m_reIsCss)){
- _4d4=document.createElement("link");
- _4d4.setAttribute("rel","stylesheet");
- _4d4.setAttribute("type","text/css");
- _4d4.setAttribute("href",_4d2);
- if(window.isIE&&window.isIE()){
- _4d4.onreadystatechange=CScriptLoader_onReadyStateChange;
- _4d4.onload=CScriptLoader_onReadyStateChange;
- _4d4.onerror=CScriptLoader_onReadyStateChange;
- this.m_oFiles[_4d2]="new";
- }else{
- this.m_oFiles[_4d2]="complete";
- }
- }else{
- if(_4d2.match(this.m_reIsJavascript)){
- if(_4d2.match(this.m_reIsPromptingLocaleJavascript)){
- if(this.m_bBlockPromptingLocaleScripts){
- this.m_aBlockedPromptingLocaleFileQueue.push({"sName":_4d2,"sNamespaceId":_4d3});
- return;
- }
- this.m_bBlockPromptingLocaleScripts=true;
- }
- this.m_bBlockScriptLoading=this.m_bUseScriptBlocking;
- _4d4=document.createElement("script");
- _4d4.setAttribute("language","javascript");
- _4d4.setAttribute("type","text/javascript");
- _4d4.setAttribute("src",_4d2);
- _4d4.sFilePath=_4d2;
- _4d4.onreadystatechange=CScriptLoader_onReadyStateChange;
- _4d4.onload=CScriptLoader_onReadyStateChange;
- _4d4.onerror=CScriptLoader_onReadyStateChange;
- this.addNamespaceAttribute(_4d4,_4d3);
- this.m_oFiles[_4d2]="new";
- }
- }
- if(_4d4){
- document.getElementsByTagName("head").item(0).appendChild(_4d4);
- }
- }
- };
- CScriptLoader.prototype.loadScriptsFromDOM=function(_4d6,_4d7,_4d8){
- if(!_4d6){
- return;
- }
- var _4d9=_4d6.getElementsByTagName("script");
- while(_4d9.length>0){
- var _4da=_4d9[0];
- if(_4da.getAttribute("src")!=null&&_4da.getAttribute("src").length>0){
- this.loadObject(_4da.getAttribute("src"),_4d7);
- }else{
- var _4db=_4da.innerHTML;
- var _4dc=false;
- if(_4db.indexOf("document.write")!=-1){
- var _4dd=_4db.replace(this.m_reEscapedCharacters,"").replace(this.m_reStringLiterals,"");
- _4dc=(_4dd.indexOf("document.write")!=-1);
- }
- if(_4dc){
- if(_4d8){
- var sId="CVScriptFromDOMPlaceHolder"+_4d9.length+_4d7;
- var _4df=_4da.ownerDocument.createElement("span");
- _4df.setAttribute("id",sId);
- _4da.parentNode.insertBefore(_4df,_4da);
- this.m_aDocumentWriters.push(new CDocumentWriter(sId,_4db));
- }
- }else{
- if(_4db.length>0){
- this.m_aScripts.push(_4db);
- }
- }
- }
- _4da.parentNode.removeChild(_4da);
- }
- };
- CScriptLoader.prototype.loadStyles=function(_4e0,_4e1){
- if(!_4e0||!_4e0.parentNode){
- return;
- }
- var _4e2=_4e0.parentNode.getElementsByTagName("style");
- while(_4e2.length>0){
- var _4e3=_4e2[0];
- if(_4e1){
- this.addNamespaceAttribute(_4e3,_4e1);
- }
- if(window.isIE&&window.isIE()&&window.getNavVer()<10){
- if((document.getElementsByTagName("style").length+document.getElementsByTagName("link").length)>=30){
- if(this.m_bHandleStylesheetLimit){
- if(typeof window.gaRV_INSTANCES!="undefined"){
- for(var i=0;i<window.gaRV_INSTANCES.length;i++){
- window.gaRV_INSTANCES[i].cleanupStyles();
- }
- }
- }
- if((document.getElementsByTagName("style").length+document.getElementsByTagName("link").length)>=30){
- if(typeof console!="undefined"&&console&&console.log){
- console.log("Stylesheet limit reached.");
- }
- this.m_ajaxWarnings.push("Stylesheet limit reached.");
- return;
- }
- }
- }
- document.getElementsByTagName("head").item(0).appendChild(_4e3);
- }
- };
- CScriptLoader.prototype.loadAll=function(_4e5,_4e6,_4e7,_4e8){
- this.m_bScriptLoaderCalled=true;
- this.m_bHasCompletedExecution=false;
- this.loadScriptsFromDOM(_4e5,_4e7,_4e8);
- if(this.containsAjaxWarnings()){
- return false;
- }
- this.loadStyles(_4e5,_4e7);
- if(this.containsAjaxWarnings()){
- return false;
- }
- this.executeScripts(_4e6,_4e7);
- return true;
- };
- CScriptLoader.prototype.setFileState=function(_4e9,_4ea){
- this.m_oFiles[_4e9]=_4ea;
- };
- CScriptLoader.prototype.containsAjaxWarnings=function(){
- if(this.m_bIgnoreAjaxWarnings){
- return false;
- }else{
- return (this.m_ajaxWarnings.length>0);
- }
- };
- CScriptLoader.prototype.addNamespaceAttribute=function(_4eb,_4ec){
- if(typeof _4ec==="string"){
- _4eb.setAttribute("namespaceId",_4ec);
- }
- };
- if(typeof window.gScriptLoader=="undefined"){
- window.gScriptLoader=new CScriptLoader();
- }
- var InfoBarHelper={};
- InfoBarHelper.getContainerId=function(oCV,_4ee){
- var _4ef=oCV.getLayoutElement(_4ee);
- var lid=_4ef.getAttribute("lid");
- var _4f1=lid===null?"":lid;
- _4f1=_4f1.replace(oCV.getViewerWidget().getViewerId(),"").replace("RAP_NDH_","");
- return _4f1;
- };
- InfoBarHelper.infoBarRemoveFilter=function(_4f2,_4f3,_4f4,_4f5){
- var oCV=eval("window.oCV"+_4f2);
- if(typeof oCV!="undefined"){
- var _4f7=this.getContainerId(oCV,_4f3);
- oCV.executeAction("Filter",{type:"remove",id:_4f7,item:_4f4,details:_4f5});
- }
- };
- InfoBarHelper.infoBarRemoveSlider=function(_4f8,_4f9){
- var oCV=eval("window.oCV"+_4f8);
- var _4fb={};
- _4fb[_4f9]={blockedEvents:["*"]};
- oCV.fireWidgetEvent("com.ibm.bux.widget.updateEventFilter",_4fb);
- if(typeof oCV!="undefined"){
- oCV.executeAction("UpdateDataFilter",{"filterPayload":"{ \"clientId\" :\""+_4f9+"\"}"});
- }
- };
- InfoBarHelper.infoBarRemoveSort=function(_4fc,_4fd,_4fe,_4ff){
- var oCV=eval("window.oCV"+_4fc);
- if(typeof oCV!="undefined"){
- var _501=this.getContainerId(oCV,_4fd);
- if(_4ff=="true"){
- oCV.executeAction("Sort",{order:"none",id:_501,item:_4fe,type:"label"});
- }else{
- oCV.executeAction("Sort",{order:"none",id:_501,item:_4fe});
- }
- }
- };
- dojo.provide("InfoBarBase");
- dojo.declare("InfoBarBase",null,{constructor:function(_502){
- this.m_cognosViewer=_502;
- this.m_parameterValues=new CParameterValues();
- var _503=XMLBuilderLoadXMLFromString(this.m_cognosViewer.getExecutionParameters());
- if(_503.childNodes.length==1){
- this.m_parameterValues.loadWithOptions(_503.childNodes[0],false);
- }
- 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);
- this.c_SliderCheckboxParameterPrefix="BusinessInsight.";
- this.m_containerInfo=null;
- this.m_editableFilters=null;
- this.m_editableSorts=null;
- this.m_editableSliders=null;
- this.m_id=null;
- this.m_layoutIndex=null;
- this.m_timingDetails=null;
- },setContainerInfo:function(_504){
- this.m_containerInfo=_504;
- },setTimingDetails:function(_505){
- this.m_timingDetails=_505;
- },setEditableFilters:function(_506){
- this.m_editableFilters=_506;
- },setId:function(_507){
- this.m_id=_507;
- },getId:function(){
- return this.m_id;
- },hasPrompts:function(){
- var _508=this.m_parameterValues.length();
- for(var _509=0;_509<_508;++_509){
- var _50a=this.m_parameterValues.getAt(_509);
- if(_50a!==null&&_50a.length()>0&&_50a.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
- return true;
- }
- }
- return false;
- },addPromptDetails:function(_50b){
- var _50c="";
- var _50d=(_50b!==true);
- if(this.hasPrompts()){
- var _50e=this.m_id+"instructions "+this.m_id+"_promptString "+this.m_id+"_lockedString ";
- for(var _50f=0,_510=this.m_parameterValues.length();_50f<_510;++_50f){
- var _511=_50e+this.m_id+_50f+"_promptDetail";
- var _512=this.m_parameterValues.getAt(_50f);
- var _513=_512.length();
- if(_512!==null&&_513>0&&_512.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
- _50c+="<div class=\"infoBarDetailRow\" aria-labelledby=\""+_511+"\" role=\"listitem\""+(!_50d?">":" tabindex=\"-1\">");
- _50c+="<table role=\"presentation\"><tr>";
- _50c+=this.addInfoBarIcon("infobar_filter.gif",true);
- _50c+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_50f+"_promptDetail\">";
- _50c+="<span class=\"bibi\">";
- _50c+=html_encode(_512.name());
- _50c+="</span>";
- _50c+=" : ";
- _50c+=_512.toString(this.m_parameterStringOperators);
- _50c+="</td>";
- _50c+=(_50d?this.addInfoBarIcon("infobar_locked.gif",false):"");
- _50c+="</tr></table></div>";
- }
- }
- }
- return _50c;
- },getPromptDetailsInJSON:function(){
- var _514=[];
- if(this.hasPrompts()){
- for(var _515=0,_516=this.m_parameterValues.length();_515<_516;++_515){
- var _517=this.m_parameterValues.getAt(_515);
- var _518=_517.length();
- if(_517!==null&&_518>0&&_517.name().indexOf(this.c_SliderCheckboxParameterPrefix)!==0){
- _514.push({"type":"prompt","label":_517.name(),"description":_517.toString(this.m_parameterStringOperators)});
- }
- }
- }
- return _514;
- },addSliderDetails:function(_519){
- var _51a="";
- var _51b=(_519!==true);
- if(this.m_containerInfo!==null&&this.m_editableSliders){
- var _51c=this.m_id+"instructions "+this.m_id+"_sliderString ";
- var _51d=this.m_editableSliders.length;
- for(var _51e=0;_51e<_51d;++_51e){
- var _51f=_51c+this.m_id+_51e+"_sliderDetail";
- var _520=this.m_editableSliders[_51e];
- if(_520&&_520.name){
- _51a+="<div class=\"infoBarDetailRow\" type=\"slider\" aria-labelledby=\""+_51f+"\" role=\"listitem\""+(!_51b?">":" tabindex=\"-1\">");
- _51a+="<table role=\"presentation\"><tr>";
- if(typeof _520.controlType!="undefined"&&_520.controlType=="checkbox"){
- _51a+=this.addInfoBarIcon("infobar_select.gif",true);
- }else{
- _51a+=this.addInfoBarIcon("infobar_slider.gif",true);
- }
- _51a+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_51e+"_sliderDetail\">";
- _51a+="<span class=\"bibi\">";
- _51a+=(_520.label?_520.label:_520.name);
- _51a+=(_520.attributeName)?(" - "+_520.attributeName):"";
- _51a+="</span>";
- _51a+=" : ";
- if(typeof _520.values!="undefined"){
- _51a+=this.processFilterOperatorItems(_520.values);
- }else{
- if(_520.min==_520.max){
- _51a+=_520.min;
- }else{
- _51a+=this.processFilterOperatorRange(RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT,_520.min,_520.max);
- }
- }
- _51a+="</td>";
- _51a+=(_51b?this.addRemoveSliderButton(_520.clientId):"");
- _51a+="</tr></table></div>";
- }
- }
- }
- return _51a;
- },getSliderDetailsInJSON:function(){
- var _521=[];
- if(this.m_containerInfo!==null&&this.m_editableSliders){
- var _522=this.m_id+"instructions "+this.m_id+"_sliderString ";
- var _523=this.m_editableSliders.length;
- for(var _524=0;_524<_523;++_524){
- var _525=this.m_editableSliders[_524];
- if(_525&&_525.name){
- var _526=(_525.label?_525.label:_525.name);
- if(_525.attributeName){
- _526+=(" "+_525.attributeName);
- }
- var _527="";
- if(typeof _525.values!="undefined"){
- _527+=this.processFilterOperatorItems(_525.values);
- }else{
- if(_525.min==_525.max){
- _527+=_525.min;
- }else{
- _527+=this.processFilterOperatorRange(RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT,_525.min,_525.max);
- }
- }
- _521.push({"type":"slider","label":_526,"description":_527});
- }
- }
- }
- return _521;
- },hasLockedFilters:function(){
- var _528=false;
- if(this.m_containerInfo!==null&&typeof this.m_containerInfo.lockedFilters!=="undefined"){
- var _529=this.m_containerInfo.lockedFilters.length;
- for(var _52a=0;_52a<_529;++_52a){
- var _52b=this.m_containerInfo.lockedFilters[_52a];
- if(typeof _52b.staticText!="undefined"&&_52b.staticText.charAt(0)!==" "){
- _528=true;
- }
- }
- }
- return _528;
- },addLockedFilterDetails:function(_52c){
- var _52d="";
- var _52e=(_52c!==true);
- if(this.m_containerInfo!==null&&typeof this.m_containerInfo.lockedFilters!=="undefined"){
- var _52f=this.m_id+"instructions "+this.m_id+"_filterString "+this.m_id+"_lockedString ";
- var _530=this.m_containerInfo.lockedFilters.length;
- for(var _531=0;_531<_530;++_531){
- var _532=_52f+this.m_id+_531+"_lockedFilterDetail";
- var _533=this.m_containerInfo.lockedFilters[_531];
- if(typeof _533.staticText!="undefined"&&_533.staticText.charAt(0)!==" "){
- _52d+="<div class=\"infoBarDetailRow\" aria-labelledby=\""+_532+"\" role=\"listitem\""+(!_52e?">":" tabindex=\"-1\">");
- _52d+="<table role=\"presentation\"><tr>";
- _52d+=this.addInfoBarIcon("infobar_filter.gif",true);
- _52d+="</td>";
- _52d+="<td class=\"infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_531+"_lockedFilterDetail\">";
- _52d+="<span class=\"bibi\">";
- _52d+=html_encode(_533.staticText);
- _52d+="</span>";
- _52d+="</td>";
- _52d+=(_52e?this.addInfoBarIcon("infobar_locked.gif",false):"");
- _52d+="</tr></table></div>";
- }
- }
- }
- return _52d;
- },addFilteredItemsDetails:function(_534){
- var _535="";
- var _536=(_534!==true);
- if(this.m_editableFilters){
- for(var _537=0,_538=this.m_editableFilters.length;_537<_538;++_537){
- var _539=this.m_editableFilters[_537];
- var _53a=this.m_id+"instructions "+this.m_id+"_filterString "+this.m_id+_537+"_filterDetail";
- var _53b=(typeof _539.itemLabel=="string")?_539.itemLabel:_539.item;
- _535+="<div class=\"infoBarDetailRow\" type=\"filter\" aria-labelledby=\""+_53a+"\" role=\"listitem\""+(!_536?">":" tabindex=\"-1\">");
- _535+="<table role=\"presentation\"><tr>";
- _535+=this.addInfoBarIcon("infobar_filter.gif",true);
- _535+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_537+"_filterDetail\">";
- _535+=this.createHiddenSpan(this.m_id+_537+"_filterPosition",getCurrentPosistionString(this.m_cognosViewer,_537+1,_538));
- _535+=html_encode(enforceTextDir(_53b));
- _535+=this.processFilterOperator(_539);
- _535+="</td>";
- _535+=(_536?this.addRemoveFilterButton(_539.item,this.processFilterDetails(_539)):"");
- _535+="</tr></table></div>";
- }
- }
- return _535;
- },getFilteredItemsDetailsInJSON:function(){
- var _53c=[];
- if(this.m_editableFilters){
- for(var _53d=0,_53e=this.m_editableFilters.length;_53d<_53e;++_53d){
- var _53f=this.m_editableFilters[_53d];
- var _540=(typeof _53f.itemLabel=="string")?_53f.itemLabel:_53f.item;
- _53c.push({"type":"filter","label":enforceTextDir(_540)+this.processFilterOperator(_53f),"description":""});
- }
- }
- return _53c;
- },addSortDetails:function(_541){
- var _542="";
- var _543=(_541!==true);
- if(this.m_editableSorts){
- for(var _544=0,_545=this.m_editableSorts.length;_544<_545;++_544){
- var _546=this.m_editableSorts[_544];
- var _547=this.m_id+"instructions "+this.m_id+"_sortString "+this.m_id+_544+"_sortDetail";
- _542+="<div class=\"infoBarDetailRow\" type=\"sort\" aria-labelledby=\""+_547+"\" role=\"listitem\""+(!_543?">":" tabindex=\"-1\">");
- _542+="<table role=\"presentation\"><tr>";
- _542+=this.addInfoBarIcon("infobar_sort.gif",true);
- var _548;
- if(typeof _546.labels=="string"||typeof _546.valuesOf=="string"){
- var _549=(typeof _546.labels=="string")?_546.labels:_546.valuesOf;
- _548=(typeof _546.itemLabel=="string")?_546.itemLabel:_549;
- _542+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_544+"_sortDetail\">";
- _542+=this.createHiddenSpan(this.m_id+_544+"_sortPosition",getCurrentPosistionString(this.m_cognosViewer,_544+1,_545));
- _542+=html_encode(_548);
- _542+=" : ";
- if(_546.byItems instanceof Array){
- for(var _54a=0;_54a<_546.byItems.length;++_54a){
- _542+=(_54a>0)?" - ":"";
- _542+=_546.byItems[_54a].item;
- _542+=", ";
- _542+=this.m_sortStrings[_546.byItems[_54a].order];
- }
- }else{
- if(typeof _546.valuesOf=="string"){
- _542+=this.m_sortStrings["byValue"];
- }else{
- _542+=this.m_sortStrings["byLabel"];
- }
- _542+=", ";
- _542+=this.m_sortStrings[_546.order];
- }
- _542+="</td>";
- _542+=(_543?this.addRemoveSortButton(_549,"true"):"");
- }else{
- if(_546.valuesOf instanceof Array){
- if(_546.valuesOf.length>0&&typeof _546.valuesOf[0].item=="string"){
- _542+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_544+"_sortDetail\">";
- _542+=this.createHiddenSpan(this.m_id+_544+"_sortPosition",getCurrentPosistionString(this.m_cognosViewer,_544+1,_545));
- _548="";
- if(typeof _546.itemLabel=="string"){
- _548=_546.itemLabel;
- }else{
- for(var _54b=0;_54b<_546.valuesOf.length;++_54b){
- _548+=" - ";
- _548+=_546.valuesOf[_54b].item;
- }
- _548=_548.substring(3);
- }
- _542+=_548;
- _542+=" : ";
- _542+=this.m_sortStrings["byValue"];
- _542+=", ";
- _542+=this.m_sortStrings[_546.order];
- _542+="</td>";
- _542+=(_543?this.addRemoveSortButton(_546.valuesOf[0].item,"false"):"");
- }
- }
- }
- _542+="</tr></table></div>";
- }
- }
- return _542;
- },addInfoBarIcon:function(_54c,_54d){
- return "<td class=\"infoBar"+(_54d?"Left":"Right")+"Icon\">"+"<img alt=\"\" src=\""+this.m_cognosViewer.getWebContentRoot()+"/rv/images/"+_54c+"\"/>"+"</td>";
- },createHiddenSpan:function(id,text){
- return "<span style=\"display:none\" id=\""+id+"\"> "+text+" </span>";
- },addRemoveFilterButton:function(item,_551){
- var _552="";
- var _553=this.m_cognosViewer.getViewerWidget();
- if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!_553.isConsumeUser()){
- var _554=RV_RES.IDS_JS_DELETE;
- var _555=this.m_id+"_delete";
- _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>";
- }
- return _552;
- },addRemoveSliderButton:function(_556){
- var _557="";
- var _558=this.m_cognosViewer.getViewerWidget();
- if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!_558.isConsumeUser()){
- var _559=RV_RES.IDS_JS_DELETE;
- var _55a=this.m_id+"_delete";
- _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>";
- }
- return _557;
- },addRemoveSortButton:function(item,_55c){
- var _55d="";
- var _55e=this.m_cognosViewer.getViewerWidget();
- if(!this.m_cognosViewer.isLimitedInteractiveMode()&&!this.m_cognosViewer.isBlacklisted("Sort")){
- var _55f=RV_RES.IDS_JS_DELETE;
- var _560=this.m_id+"_delete";
- _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>";
- }
- return _55d;
- },processFilterOperator:function(_561){
- var _562="";
- if(typeof _561["in"]!="undefined"){
- _562+=" "+CViewerCommon.getMessage(RV_RES.IDS_JS_INFOBAR_INCLUDE_TEXT,this.processFilterOperatorItems(_561["in"]));
- }else{
- if(typeof _561["notIn"]!="undefined"){
- _562+=" "+CViewerCommon.getMessage(RV_RES.IDS_JS_INFOBAR_EXCLUDE_TEXT,this.processFilterOperatorItems(_561["notIn"]));
- }else{
- if(typeof _561["range"]!="undefined"||typeof _561["notRange"]!="undefined"){
- var _563=typeof _561["range"]!="undefined"?RV_RES.IDS_JS_INFOBAR_BETWEEN_TEXT:RV_RES.IDS_JS_INFOBAR_NOT_BETWEEN_TEXT;
- var _564=typeof _561["range"]!="undefined"?_561["range"]:_561["notRange"];
- for(var _565=0;_565<_564.length;++_565){
- var _566=_564[_565];
- _562+=" "+CViewerCommon.getMessage(_563,[_566.from,_566.to]);
- }
- }else{
- if(typeof _561["lessThan"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_LESS_THAN+" "+_561["lessThan"];
- }else{
- if(typeof _561["lessThanEqual"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_LESS_THAN_EQUAL+" "+_561["lessThanEqual"];
- }else{
- if(typeof _561["greaterThan"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_GREATER_THAN+" "+_561["greaterThan"];
- }else{
- if(typeof _561["greaterThanEqual"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_GREATER_THAN_EQUAL+" "+_561["greaterThanEqual"];
- }else{
- if(typeof _561["not"]!="undefined"&&_561["not"]=="true"){
- _562+=" "+RV_RES.IDS_JS_FILTER_IS_NOT;
- }
- if(typeof _561["endsWith"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_ENDS_WITH+" "+_561["endsWith"];
- }else{
- if(typeof _561["beginsWith"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_BEGINS_WITH+" "+_561["beginsWith"];
- }else{
- if(typeof _561["contains"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_CONTAINS+" "+_561["contains"];
- }else{
- if(typeof _561["isMatchesSQLPatternFilter"]!="undefined"){
- _562+=" "+RV_RES.IDS_JS_FILTER_IS_MATCHES_SQLPATTERNFILTER+" "+_561["isMatchesSQLPatternFilter"];
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return _562;
- },processFilterDetails:function(_567){
- return html_encode("["+dojo.toJson(_567)+"]");
- },processFilterOperatorItems:function(_568){
- var _569="";
- for(var _56a=0;_56a<_568.length;++_56a){
- if(_56a!==0){
- _569+=(RV_RES.IDS_JS_LIST_SEPARATOR+" ");
- }
- _569+=enforceTextDir(_568[_56a]);
- }
- return _569;
- },processFilterOperatorRange:function(_56b,_56c,_56d){
- if(typeof _56c=="undefined"){
- _56c=" ";
- }
- if(typeof _56d=="undefined"){
- _56d=" ";
- }
- return CViewerCommon.getMessage(_56b,[_56c,_56d]);
- }});
- dojo.declare("InfoBar",InfoBarBase,{constructor:function(_56e,_56f,_570,_571,_572){
- this.m_layoutElement=_56f;
- this.m_containerInfo=_570;
- this.m_bRendered=false;
- this.initializeEditableSorts(_571);
- this.initializeEditableFilters(_571);
- this.initializeEditableSliders(_571);
- this.m_id=_572+_56e.getId();
- this.m_layoutIndex=_572;
- 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};
- this.connections=[];
- },getLayoutElement:function(){
- var _573=this.m_layoutElement;
- var _574=_573.getAttribute("lid");
- if(_574==null){
- _574=_573.getAttribute("pflid");
- }
- if(_574!==null){
- if(_573.tagName.toUpperCase()=="MAP"){
- var _575=_573.parentNode.childNodes;
- for(var _576=0;_576<_575.length;++_576){
- var _577=_575[_576].getAttribute("usemap");
- if(_577!==null&&_577==("#"+this.m_cognosViewer.getId()+_574)){
- return _575[_576];
- }
- }
- }else{
- if(_573.parentNode.getAttribute("chartcontainer")=="true"){
- return _573.parentNode;
- }
- }
- return _573;
- }
- return null;
- },initializeEditableSorts:function(_578){
- if(this.m_containerInfo!==null){
- if(typeof this.m_containerInfo.sort!=="undefined"){
- this.m_editableSorts=this.m_containerInfo.sort;
- }
- if(typeof _578!=="undefined"){
- for(var i=0;i<_578.length;++i){
- this.m_editableSorts=this.mergeChildInfo(this.m_editableSorts,_578[i].sort,"labels");
- this.m_editableSorts=this.mergeChildInfo(this.m_editableSorts,_578[i].sort,"valuesOf");
- }
- }
- }
- },initializeEditableFilters:function(_57a){
- if(typeof this.m_containerInfo!=="undefined"&&this.m_containerInfo!==null){
- if(typeof this.m_containerInfo.filter!=="undefined"){
- this.m_editableFilters=this.m_containerInfo.filter;
- }
- if(typeof _57a!=="undefined"){
- for(var i=0;i<_57a.length;++i){
- this.m_editableFilters=this.mergeChildInfo(this.m_editableFilters,_57a[i].filter,"item");
- }
- }
- }
- },initializeEditableSliders:function(_57c){
- if(typeof this.m_containerInfo!=="undefined"&&this.m_containerInfo!==null){
- if(typeof this.m_containerInfo.sliders!=="undefined"){
- this.m_editableSliders=this.m_containerInfo.sliders;
- }
- if(typeof _57c!=="undefined"){
- for(var i=0;i<_57c.length;++i){
- this.m_editableSliders=this.mergeChildInfo(this.m_editableSliders,_57c[i].sliders,"name");
- }
- }
- }
- },mergeChildInfo:function(_57e,_57f,key){
- if(typeof _57f!="undefined"){
- if(typeof _57e==="undefined"||_57e===null){
- _57e=_57f;
- }else{
- var _581=[];
- for(var i=0;i<_57e.length;++i){
- _581[_57e[i][key]]=_57e[i];
- }
- for(var j=0;j<_57f.length;++j){
- var _584=_57f[j];
- if(typeof _581[_584[key]]=="undefined"){
- _57e.push(_584);
- _581[_584.item]=_584;
- }
- }
- }
- }
- return _57e;
- },hasSomethingRendered:function(){
- return this.m_bRendered;
- },render:function(){
- var _585=document.getElementById("infoBar"+this.m_id);
- if(_585===null){
- var _586=(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton")?true:false;
- if(_586&&!this.m_editableFilters&&!this.m_editableSliders){
- return;
- }
- if(this.m_timingDetails||this.m_editableSorts||this.m_editableFilters||this.m_editableSliders||this.hasPrompts()||this.hasLockedFilters()){
- var _587=this.getLayoutElement();
- var _588=document.createElement("div");
- _588.setAttribute("dir",this.m_cognosViewer.getDirection()==="rtl"?"rtl":"ltr");
- _585=document.createElement("div");
- _585.className="infoBar";
- _585.setAttribute("id","infoBar"+this.m_id);
- _585.setAttribute("cvid",this.m_cognosViewer.getId());
- _585.setAttribute("layoutid",this.m_id);
- _585.setAttribute("containerid",this.m_layoutIndex);
- _585.setAttribute("role","region");
- _585.setAttribute("aria-label",RV_RES.IDS_JS_REPORT_INFO_TITLE);
- if(_586){
- dojo.style(_585,{opacity:"0.6"});
- }
- _585.appendChild(this.renderHeader());
- _585.appendChild(this.renderDetails());
- _588.appendChild(_585);
- _587.parentNode.insertBefore(_588,_587);
- this.connections.push(dojo.connect(_585,"onkeydown",this,this.onKeyDown));
- this.connections.push(dojo.query(".infoBarHeader",_585).connect("onmousedown",this,this.toggle));
- this.connections.push(dojo.query(".infoBarLeftIcon",_585).connect("onmousedown",this,this.ignoreEvent));
- this.connections.push(dojo.query(".infoBarDetailsText",_585).connect("onmousedown",this,this.ignoreEvent));
- this.connections.push(dojo.query(".infoBarLockedItems",_585).connect("onmousedown",this,this.ignoreEvent));
- this.m_bRendered=true;
- if(this.wasInfoBarExpanded(this.m_id)){
- this.show();
- }
- }
- }
- },renderHeader:function(){
- var _589=this.isFilterApplied();
- var _58a=this.isSortApplied();
- var _58b=document.createElement("div");
- _58b.id="infoBarHeader"+this.m_id;
- _58b.className="infoBarHeaderDiv";
- var _58c="<div role=\"presentation\" class=\"infoBarHeader BUXNoPrint\" style=\"width:100%\">"+this.addHeaderCloseButton()+this.addHeaderNavigationButton(_589,_58a)+this.addHeaderText(_589,_58a)+"</div>";
- _58b.innerHTML=_58c;
- return _58b;
- },addHeaderNavigationButton:function(_58d,_58e){
- var _58f=RV_RES.IDS_JS_INFOBAR_EXPAND;
- var _590="infoBarIcon"+(_58d?"Filter":"")+(_58e?"Sort":"")+"Applied";
- var _591="infoBarHeaderButton"+this.m_id+" infoBarHeaderText"+this.m_id;
- 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>";
- },addHeaderText:function(_592,_593){
- var _594=[];
- if(_592){
- _594.push(RV_RES.IDS_JS_FILTER_APPLIED);
- }
- if(_593){
- _594.push(RV_RES.IDS_JS_SORT_APPLIED);
- }
- return "<span class=\"infoBarHeaderText\" id=\"infoBarHeaderText"+this.m_id+"\">"+_594.join(", ")+"</span>";
- },addHeaderCloseButton:function(){
- var _595=RV_RES.IDS_JS_INFOBAR_COLLAPSE;
- var _596=this.m_id+"_collapse";
- 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>";
- },isFilterApplied:function(){
- if(this.m_editableFilters||this.m_editableSliders||typeof this.m_containerInfo.lockedFilters!=="undefined"||this.hasPrompts()){
- return true;
- }
- return false;
- },isSortApplied:function(){
- if(this.m_editableSorts){
- return true;
- }
- return false;
- },renderDetails:function(){
- var _597=document.getElementById("infoBarFlyout"+this.m_id);
- var _598=document.getElementById(this.m_id+"instructions");
- if(_597===null){
- this.getLayoutElement();
- _597=document.createElement("div");
- _597.setAttribute("id","infoBarFlyout"+this.m_id);
- _597.setAttribute("cvid",this.m_cognosViewer.getId());
- _597.setAttribute("layoutid",this.m_id);
- _597.setAttribute("containerid",this.m_layoutIndex);
- _597.className="infoBarFlyout";
- _597.style.display="none";
- _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);
- this.connections.push(dojo.connect(_597,"onkeydown",this,this.onKeyDown));
- this.connections.push(dojo.query(".infoBarDetailRow",_597).forEach(function(item,_59a,_59b){
- dojo.attr(item,{"aria-setsize":_59b.length,"aria-posinset":_59a+1});
- }).connect("onfocus",function(e){
- dojo.query(e.currentTarget).addClass("infoBarDetailRowHover");
- }).connect("onblur",function(e){
- var el=typeof e.explicitOriginalTarget!=="undefined"?e.explicitOriginalTarget:document.activeElement;
- if(dojo.hasClass(el,"infoBarDeleteButton")){
- return true;
- }
- dojo.query(e.currentTarget).removeClass("infoBarDetailRowHover");
- }).connect("onmouseover",this,function(e){
- this.focusDetailRow(e.currentTarget);
- }));
- }
- if(_598===null){
- _598=document.createElement("span");
- _598.id=this.m_id+"instructions";
- _598.setAttribute("role","presentation");
- _598.style.visibility="hidden";
- _598.style.display="none";
- document.body.appendChild(_598);
- _598.innerHTML=RV_RES.IDS_JS_INFOBAR_EXPLANATION;
- }
- return _597;
- },addRAPTimingDetails:function(){
- if(this.m_timingDetails){
- var _5a0=this.m_timingDetails.length-1;
- var _5a1=this.m_timingDetails[_5a0].time-this.m_timingDetails[0].time;
- 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>";
- }
- return "";
- },addRAPTimingItemDetails:function(){
- var _5a2="";
- if(this.m_timingDetails){
- for(var _5a3=0;_5a3<=this.m_timingDetails.length-1;++_5a3){
- var _5a4=this.m_timingDetails[_5a3];
- var _5a5=this.getTimeDiff(_5a3);
- _5a2+="<tr class=\"infoBarDetailRow\" type=\"filter\" tabindex=\"-1\">";
- if(_5a4.level){
- _5a2+="<td colspan=3><font size=\"1\">"+_5a5+":"+html_encode(_5a4.event)+"</font></td></tr>";
- }else{
- _5a2+=this.addTimingIcon(_5a5,100,500);
- _5a2+="<td class=\"bibi infoBarDetailsText\" role=\"presentation\" id=\""+this.m_id+_5a3+"_timingDetail\">";
- _5a2+=html_encode(_5a4.event);
- _5a2+="</td><td align=\"right\">"+_5a5+"</td>";
- }
- _5a2+="</tr>";
- }
- }
- return _5a2;
- },getTimeDiff:function(_5a6){
- var _5a7=_5a6+1;
- if(_5a7>=this.m_timingDetails.length){
- return 0;
- }
- var _5a8=this.m_timingDetails[_5a6].level;
- if(!(_5a8==this.m_timingDetails[_5a7].level)){
- while(_5a7<this.m_timingDetails.length&&this.m_timingDetails[_5a7].level!=_5a8&&typeof this.m_timingDetails[_5a7].level!="undefined"){
- _5a7++;
- }
- }
- return (this.m_timingDetails[_5a7].time-this.m_timingDetails[_5a6].time);
- },addTimingIcon:function(_5a9,_5aa,red){
- var _5ac="icon_excellent_traffic.gif";
- if(_5a9>red){
- _5ac="icon_poor_traffic.gif";
- }else{
- if(_5a9>_5aa){
- _5ac="icon_average_traffic.gif";
- }
- }
- return this.addInfoBarIcon(_5ac,true);
- },addLockedInfoBarDetails:function(){
- if(this.hasPrompts()||typeof this.m_containerInfo.lockedFilters!=="undefined"){
- return "<div role=\"presentation\" class=\"infoBarLockedItems\">"+this.addPromptDetails()+this.addLockedFilterDetails()+"</div>";
- }
- return "";
- },addEditableInfoBarDetails:function(){
- if(this.m_editableFilters||this.m_editableSorts||this.m_editableSliders){
- return "<div role=\"presentation\" class=\"infoBarEditableItems\">"+this.addFilteredItemsDetails()+this.addSliderDetails()+this.addSortDetails()+"</div>";
- }
- return "";
- },onKeyDown:function(evt){
- var _5ae=evt.target;
- var cvId=this.m_cognosViewer.getId();
- var _5b0=document.getElementById("infoBarHeaderButton"+this.m_id);
- var _5b1=document.getElementById(this.m_id+"instructions");
- var node;
- if(evt.keyCode=="13"){
- _5b1.innerHTML=RV_RES.IDS_JS_INFOBAR_EXPLANATION;
- if(_5ae===_5b0){
- this.toggle();
- return stopEventBubble(evt);
- }
- }else{
- if(evt.keyCode=="27"){
- var _5b3=this.m_cognosViewer.getA11YHelper();
- if(this.m_cognosViewer.getCurrentNodeFocus()){
- node=this.m_cognosViewer.getCurrentNodeFocus();
- if(node.nodeName.toLowerCase()!="span"){
- var _5b4=node.getElementsByTagName("span");
- for(var _5b5=0;_5b5<_5b4.length;_5b5++){
- if(_5b4[_5b5].style.display!="hidden"){
- node=_5b4[_5b5];
- break;
- }
- }
- }
- this.hide(false);
- _5b3.setFocusToNode(node);
- }else{
- this.hide();
- }
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="46"){
- if(dojo.hasClass(_5ae,"infoBarDetailRow")){
- node=dojo.query("td.infoBarRightIcon",_5ae)[0];
- if(typeof node!=="undefined"){
- if(_5ae.getAttribute("type")=="filter"){
- InfoBarHelper.infoBarRemoveFilter(cvId,this.m_layoutIndex,node.getAttribute("filterItem"),node.getAttribute("details"));
- }else{
- if(_5ae.getAttribute("type")=="sort"){
- InfoBarHelper.infoBarRemoveSort(cvId,this.m_layoutIndex,node.getAttribute("sortItem"),node.getAttribute("byLabel"));
- }else{
- if(_5ae.getAttribute("type")=="slider"){
- InfoBarHelper.infoBarRemoveSlider(cvId,node.getAttribute("slider"));
- }
- }
- }
- }
- }
- }else{
- if(evt.keyCode=="38"){
- if(dojo.hasClass(_5ae,"infoBarDetailRow")){
- this.focusDetailRow(_5ae,"prev");
- }else{
- this.focusDetailRow();
- }
- _5b1.innerHTML="";
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="40"){
- if(dojo.hasClass(_5ae,"infoBarDetailRow")){
- this.focusDetailRow(_5ae,"next");
- }else{
- this.focusDetailRow();
- }
- _5b1.innerHTML="";
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="9"){
- var _5b6=document.getElementById("infoBar"+this.m_id);
- if(dojo.hasClass(_5b6,"infoBarExpanded")){
- if(dojo.hasClass(_5ae,"infoBarDetailRow")){
- dojo.byId("infoBarHeaderCloseButton"+this.m_id).focus();
- }else{
- this.focusDetailRow();
- }
- return stopEventBubble(evt);
- }
- }
- }
- }
- }
- }
- }
- },focusDetailRow:function(_5b7,dir){
- var _5b9=document.getElementById("infoBarFlyout"+this.m_id);
- var _5ba=document.getElementById("infoBar"+this.m_id);
- if(!dojo.hasClass(_5ba,"infoBarExpanded")){
- return;
- }
- if(typeof _5b7=="undefined"||_5b7===null){
- var _5bb=dojo.query(".infoBarLockedItems .infoBarDetailRow, .infoBarEditableItems .infoBarDetailRow",_5b9);
- _5b7=_5bb[0];
- }
- if(_5b7&&dojo.hasClass(_5b7,"infoBarDetailRow")){
- var _5bc,rows,len,i;
- if(dir==="prev"){
- if(_5b7.parentNode.previousSibling){
- _5bc=_5b7.parentNode.previousSibling.childNodes[1];
- }else{
- rows=dojo.query(".infoBarDetailRow",_5b9);
- len=rows.length;
- if(_5b7===rows[0]){
- _5bc=rows[len-1];
- }else{
- for(i=1;i<len;i++){
- if(_5b7===rows[i]){
- _5bc=rows[i-1];
- break;
- }
- }
- }
- }
- }else{
- if(dir==="next"){
- if(_5b7.parentNode.nextSibling){
- _5bc=_5b7.parentNode.nextSibling.childNodes[1];
- }else{
- rows=dojo.query(".infoBarDetailRow",_5b9);
- len=rows.length;
- if(_5b7===rows[len-1]){
- _5bc=rows[0];
- }else{
- for(i=0;i<len-1;i++){
- if(_5b7===rows[i]){
- _5bc=rows[i+1];
- break;
- }
- }
- }
- }
- }else{
- _5bc=_5b7;
- }
- }
- _5bc.focus();
- }
- },toggle:function(evt){
- var _5c1=document.getElementById("infoBar"+this.m_id);
- if(dojo.hasClass(_5c1,"infoBarExpanded")){
- this.hide();
- }else{
- this.show();
- }
- stopEventBubble(evt);
- },ignoreEvent:function(evt){
- stopEventBubble(evt);
- },show:function(){
- var _5c3=document.getElementById("infoBar"+this.m_id);
- if(!dojo.hasClass(_5c3,"infoBarExpanded")){
- var _5c4=document.getElementById("infoBarHeader"+this.m_id);
- var _5c5=document.getElementById("infoBarFlyout"+this.m_id);
- var _5c6=document.getElementById("infoBarHeaderButton"+this.m_id);
- var _5c7,_5c8,_5c9;
- var _5ca=dojo.fx.wipeIn({node:_5c5,duration:300,onEnd:dojo.hitch(this,function(){
- this.focusDetailRow();
- _5c6.setAttribute("title",RV_RES.IDS_JS_INFOBAR_COLLAPSE);
- _5c6.childNodes[0].setAttribute("title",RV_RES.IDS_JS_INFOBAR_COLLAPSE);
- })});
- this.updateInfoBarRenderedState(this.m_id,"true");
- dojo.addClass(_5c3,"infoBarExpanded");
- if(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton"){
- dojo.style(_5c3,{opacity:"1"});
- }
- dojo.style(_5c3,"width","auto");
- _5ca.play();
- var _5cb=document.getElementById("infoBarHeaderText"+this.m_id).innerHTML;
- var _5cc=this._getTextWidth(_5cb)+40;
- if(_5cc<500){
- _5cc=500;
- }
- var _5cd=this.m_cognosViewer.getViewerWidget();
- var _5ce=_5cd.findContainerDiv().clientWidth;
- if(_5cc>_5ce){
- _5cc=_5ce-5;
- }
- _5c3.style.width=_5cc+"px";
- dojo.removeClass(_5c4,"BUXNoPrint");
- }
- },_getTextWidth:function(text){
- var div=document.createElement("div");
- div.className="infoBar infoBarHeader";
- div.style.fontWeight="bold";
- div.style.position="absolute";
- div.style.visibility="hidden";
- div.style.height="auto";
- div.style.width="auto";
- document.body.appendChild(div);
- div.innerHTML=text;
- var _5d1=div.clientWidth;
- document.body.removeChild(div);
- return _5d1;
- },hide:function(_5d2){
- var _5d3=document.getElementById("infoBar"+this.m_id);
- if(dojo.hasClass(_5d3,"infoBarExpanded")){
- this.updateInfoBarRenderedState(this.m_id,"false");
- var _5d4=document.getElementById("infoBarHeader"+this.m_id);
- var _5d5=document.getElementById("infoBarFlyout"+this.m_id);
- var _5d6=document.getElementById("infoBarHeaderButton"+this.m_id);
- dojo.addClass(_5d4,"BUXNoPrint");
- dojo.fx.wipeOut({node:_5d5,duration:300,onEnd:dojo.hitch(this,function(){
- dojo.removeClass(_5d3,"infoBarExpanded");
- dojo.style(_5d3,"width","auto");
- if(this.m_containerInfo&&this.m_containerInfo.displayTypeId==="singleton"){
- dojo.style(_5d3,{opacity:"0.6"});
- }
- _5d6.setAttribute("title",RV_RES.IDS_JS_INFOBAR_EXPAND);
- _5d6.childNodes[0].setAttribute("title",RV_RES.IDS_JS_INFOBAR_EXPAND);
- if(!_5d2){
- _5d6.focus();
- }
- })}).play();
- }
- },updateInfoBarRenderedState:function(_5d7,_5d8){
- var _5d9=this.m_cognosViewer.getViewerWidget();
- if(_5d9){
- var _5da=_5d9.getInfoBarRenderedState();
- _5da[_5d7]=_5d8;
- }
- },wasInfoBarExpanded:function(_5db){
- var _5dc=this.m_cognosViewer.getViewerWidget();
- if(_5dc){
- var _5dd=_5dc.getInfoBarRenderedState();
- if(_5dd){
- if(_5dd[_5db]){
- if("true"===_5dd[_5db]){
- return true;
- }
- }
- }
- }
- return false;
- },destroy:function(){
- for(var i=0;i<this.connections.length;i++){
- var _5df=this.connections[i];
- if(_5df&&_5df.remove){
- dojo.disconnect(_5df);
- }
- }
- var _5e0=document.getElementById("infoBar"+this.m_id);
- if(_5e0){
- var _5e1=_5e0.parentNode;
- if(_5e1){
- _5e1.removeChild(_5e0);
- }
- }
- _5e0=document.getElementById(this.m_id+"instructions");
- if(_5e0){
- _5e0.parentNode.removeChild(_5e0);
- }
- delete this.m_layoutElement;
- delete this.m_containerInfo;
- }});
- dojo.declare("AnnotationFilterContext",null,{m_parameterValuesString:null,m_parameterValuesSpec:null,m_slidersJSON:null,m_filterJSON:null,constructor:function(_5e2,_5e3,_5e4,_5e5){
- this.m_parameterValuesString=_5e2;
- this.m_parameterValuesSpec=_5e3;
- this.m_slidersJSON=_5e4;
- this.m_filterJSON=_5e5;
- },setParameterValuesString:function(_5e6){
- this.m_parameterValuesString=_5e6;
- },setParameterValuesSpec:function(_5e7){
- this.m_parameterValuesSpec=_5e7;
- },setSlidersJSON:function(_5e8){
- this.m_slidersJSON=_5e8;
- },setFilterJSON:function(_5e9){
- this.m_filterJSON=_5e9;
- },getParameterValuesString:function(){
- return this.m_parameterValuesString||null;
- },getParameterValuesSpec:function(){
- return this.m_parameterValuesSpec||null;
- },getPromptsJSON:function(){
- var _5ea=null;
- if(this.m_parameterValuesString){
- _5ea={};
- _5ea.parameterValuesString=this.m_parameterValuesString;
- }
- if(this.m_parameterValuesString){
- _5ea=_5ea||{};
- _5ea.parameterValuesSpec=this.m_parameterValuesSpec;
- }
- return _5ea;
- },getSlidersJSON:function(){
- return this.m_slidersJSON||null;
- },getFilterJSON:function(){
- return this.m_filterJSON||null;
- },isEmpty:function(){
- if(this.m_parameterValuesString||this.m_parameterValuesSpec||this.m_slidersJSON||this.m_filterJSON){
- return false;
- }
- return true;
- }});
- dojo.declare("AnnotationInfoBar",InfoBarBase,{constructor:function(_5eb,lid){
- this.m_id="annoInfoBar_"+lid;
- this.m_layoutElementId=lid;
- },createFilterContext:function(){
- var _5ed=null;
- var _5ee=null;
- var _5ef=null;
- var _5f0=null;
- if(this.m_cognosViewer.getRAPReportInfo()){
- var _5f1=this.m_cognosViewer.getRAPReportInfo();
- if(_5f1.getContainers()){
- var _5f2=_5f1.getContainers();
- if(_5f2[this.m_layoutElementId]){
- var _5f3=_5f2[this.m_layoutElementId];
- if(typeof _5f3.filter!=="undefined"){
- _5ed=_5f3.filter;
- }
- if(typeof _5f3.sliders!=="undefined"){
- _5ee=_5f3.sliders;
- }
- }
- }
- }
- if(this.hasPrompts()){
- _5ef=CViewerCommon.buildParameterValuesSpec(this.m_cognosViewer);
- _5f0=this.m_cognosViewer.getExecutionParameters();
- }
- if(_5ed||_5ee||_5ef||_5f0){
- return new AnnotationFilterContext(_5f0,_5ef,_5ee,_5ed);
- }
- return null;
- }});
- dojo.declare("AnnotationInfoBarRenderer",null,{m_AnnotationInfoBar:null,m_id:null,m_labelledByHideButton:"",miniCognosViewer:null,m_editableSliders:null,constructor:function(_5f4,lid,_5f6,_5f7){
- this.m_AnnotationInfoBar=null;
- this.miniCognosViewer={};
- this.miniCognosViewer.m_sId=_5f4.id;
- this.miniCognosViewer.getId=_5f4.getId;
- this.miniCognosViewer.m_sParameters=(_5f6===null||_5f6.getParameterValuesString()===null)?"":_5f6.getParameterValuesString();
- this.miniCognosViewer.getExecutionParameters=_5f4.getExecutionParameters;
- this.miniCognosViewer.getWebContentRoot=_5f4.getWebContentRoot;
- this.m_AnnotationInfoBar=new AnnotationInfoBar(this.miniCognosViewer,lid);
- this.m_AnnotationInfoBar.setId("annoInfoBar_"+_5f7+lid);
- this.m_id="annoInfoBar_"+_5f7+lid+"_renderer";
- if(_5f6){
- if(_5f6.getSlidersJSON()){
- this.m_AnnotationInfoBar.setContainerInfo({"sliders":_5f6.getSlidersJSON()});
- this.m_AnnotationInfoBar.m_editableSliders=_5f6.getSlidersJSON();
- }
- if(_5f6.getFilterJSON()){
- this.m_AnnotationInfoBar.setEditableFilters(_5f6.getFilterJSON());
- }
- }
- },render:function(){
- var _5f8="<div class=\"infoBar infoBarCollapsed\" id=\"infoBarHeaderCollapsed"+this.m_id+"\" >"+this.renderHeader(false)+"</div>";
- var _5f9="<div class=\"infoBar infoBarExpanded\" id=\"infoBarHeaderExpanded"+this.m_id+"\" style=\"display:none;\" >"+this.renderHeader(true)+this.renderDetails()+"</div>";
- _5f9=this.updateHideButtonLabelledBy(_5f9);
- var _5fa=document.getElementById("annotationInfoBarInstructions");
- if(_5fa===null){
- _5fa=document.createElement("span");
- _5fa.id="annotationInfoBarInstructions";
- _5fa.setAttribute("role","presentation");
- _5fa.style.visibility="hidden";
- _5fa.style.display="none";
- 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);
- document.body.appendChild(_5fa);
- _5fa.innerHTML=_5fb;
- }
- return _5f8+_5f9;
- },renderInJSON:function(){
- var _5fc=[];
- return _5fc.concat(this.m_AnnotationInfoBar.getPromptDetailsInJSON(),this.m_AnnotationInfoBar.getFilteredItemsDetailsInJSON(),this.m_AnnotationInfoBar.getSliderDetailsInJSON());
- },renderHeader:function(_5fd){
- var mode=(_5fd)?"Hide":"Show";
- var _5ff=(_5fd)?RV_RES.IDS_JS_ANNO_INFOBAR_HIDE:RV_RES.IDS_JS_ANNO_INFOBAR_SHOW;
- var _600=(_5fd)?("XXREPLACEXX"):" annoInfoBarHeaderControlButtonText"+mode+this.m_id;
- 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>";
- return _601;
- },renderDetails:function(){
- var _602=this.m_AnnotationInfoBar.addPromptDetails(true);
- var _603=this.m_AnnotationInfoBar.addFilteredItemsDetails(true);
- var _604=this.m_AnnotationInfoBar.addSliderDetails(true);
- var _605="<div class=\"annoInfoBarDetails\" id=\"annoInfoBarDetails"+this.m_id+"\" role=\"presentation\">"+_602+_603+_604+"</div>";
- this.m_labelledByHideButton=(_602.length===0)?"":(" annoInfoBar_promptString "+this.m_AnnotationInfoBar.getId()+"0_promptDetail ");
- this.m_labelledByHideButton+=(_603.length===0)?"":(" annoInfoBar_filterString "+this.m_AnnotationInfoBar.getId()+"0_filterDetail ");
- this.m_labelledByHideButton+=(_604.length===0)?"":(" annoInfoBar_sliderString "+this.m_AnnotationInfoBar.getId()+"0_sliderDetail annoInfoBar_sliderString "+this.m_AnnotationInfoBar.getId()+"1_sliderDetail ");
- this.m_labelledByHideButton+=" annoInfoBarHeaderControlButtonTextHide"+this.m_id;
- return _605;
- },updateHideButtonLabelledBy:function(_606){
- return _606.replace("XXREPLACEXX",this.m_labelledByHideButton);
- }});
- function annotationInfoBarToggle(mId,_608){
- var _609=document.getElementById("infoBarHeaderExpanded"+mId);
- var _60a=document.getElementById("infoBarHeaderCollapsed"+mId);
- var _60b=null;
- if("Show"===_608){
- dojo.style(_609,{display:""});
- dojo.style(_60a,{display:"none"});
- _60b=document.getElementById("annoInfoBarHeaderControlHide"+mId);
- }else{
- dojo.style(_60a,{display:""});
- dojo.style(_609,{display:"none"});
- _60b=document.getElementById("annoInfoBarHeaderControlShow"+mId);
- }
- if(_60b){
- _60b.focus();
- }
- };
- var CV_BACKGROUND_LAYER_ID="CV_BACK";
- if(typeof window.gaRV_INSTANCES=="undefined"){
- window.gaRV_INSTANCES=[];
- }
- if(!window.gViewerLogger){
- window.gViewerLogger={log:function(hint,_60d,type){
- },addContextInfo:function(_60f){
- }};
- }
- function CognosViewerSession(oCV){
- this.m_sConversation=oCV.getConversation();
- this.m_sParameters=oCV.getExecutionParameters();
- this.m_envParams={};
- applyJSONProperties(this.m_envParams,oCV.envParams);
- this.m_bRefreshPage=false;
- };
- function CCognosViewer(sId,_612){
- if(typeof window.gCognosViewer=="undefined"){
- window.gCognosViewer=this;
- }
- if(typeof ViewerConfig=="function"){
- this.m_viewerConfig=new ViewerConfig();
- try{
- if(typeof window.getViewerConfiguration=="function"){
- this.m_viewerConfig.configure(window.getViewerConfiguration());
- }else{
- if(window.parent&&typeof window.parent.getViewerConfiguration=="function"){
- this.m_viewerConfig.configure(window.parent.getViewerConfiguration());
- }
- }
- }
- catch(e){
- }
- this.m_viewerUIConfig=this.m_viewerConfig.getUIConfig();
- }
- this.m_sActionState="";
- this.m_bKeepSessionAlive=false;
- this.m_undoStack=[];
- this.m_aSecRequests=[];
- this.m_bDebug=false;
- this.m_sCAFContext="";
- this.m_sContextInfoXML="";
- this.m_sConversation="";
- this.m_sStatus="";
- this.m_sGateway=_612;
- this.m_sId=sId;
- this.m_sMetadataInfoXML="";
- this.m_sParameters="";
- this.m_sReportState="";
- this.envParams={};
- this.m_sTracking="";
- this.m_sSoapFault="";
- this.m_sWaitHTML="";
- this.m_oDrillMgr=null;
- this.goDrillManager=null;
- this.m_oWorkingDialog=null;
- this.m_oRequestExecutedIndicator=null;
- this.m_bUseWorkingDialog=true;
- this.m_oSubscriptionManager=null;
- this.m_oCVMgr=null;
- this.m_bUseSafeMode=true;
- if(typeof CViewerManager=="function"){
- this.m_oCVMgr=new CViewerManager(this);
- }
- if(window.gaRV_INSTANCES){
- var _613=false;
- for(var _614=0;_614<window.gaRV_INSTANCES.length;_614++){
- if(window.gaRV_INSTANCES[_614].m_sId==sId){
- window.gaRV_INSTANCES[_614]=this;
- _613=true;
- break;
- }
- }
- if(!_613){
- window.gaRV_INSTANCES=window.gaRV_INSTANCES.concat(this);
- }
- }
- this.m_bReportHasPrompts=false;
- this.m_viewerWidget=null;
- this.m_flashChartsObjectIds=[];
- this.m_raiseSharePromptEvent=true;
- this.m_actionFactory=null;
- this.m_calculationCache={};
- this.m_drillTargets=[];
- this.m_reportRenderingDone=false;
- if(typeof PinFreezeManager!=="undefined"){
- this.m_pinFreezeManager=new PinFreezeManager(this);
- }
- if(typeof ViewerDispatcher!=="undefined"){
- this.m_viewerDispatcher=new ViewerDispatcher();
- }
- this.m_retryDispatcherEntry=null;
- this.m_RAPReportInfo=null;
- if(typeof ViewerState=="function"){
- this.m_viewerState=new ViewerState();
- }
- this.m_aInfoBar=null;
- };
- CCognosViewer.prototype.setScheduledMobileOutput=function(_615){
- this.m_mobileScheduledOutput=_615;
- if(_615){
- this.m_sStatus="complete";
- }
- };
- CCognosViewer.prototype.setTabInfo=function(_616){
- this.m_tabsPayload=_616;
- if(this.m_tabsPayload&&this.m_tabsPayload.tabs&&this._keepTabSelected){
- var _617=false;
- for(var i=0;i<this.m_tabsPayload.tabs.length;i++){
- var tab=this.m_tabsPayload.tabs[i];
- if(tab.id==this._keepTabSelected){
- this.m_tabsPayload.currentTabId=this._keepTabSelected;
- break;
- }
- }
- this._keepTabSelected=null;
- }
- };
- CCognosViewer.prototype.setKeepTabSelected=function(_61a){
- this._keepTabSelected=_61a;
- };
- CCognosViewer.prototype.getTabController=function(){
- return this.m_tabControl;
- };
- CCognosViewer.prototype.getCurrentlySelectedTab=function(){
- return this.m_currentlySelectedTab?this.m_currentlySelectedTab:null;
- };
- CCognosViewer.prototype.deleteTabs=function(){
- if(this.m_tabControl){
- this.m_tabControl.destroy();
- delete this.m_tabControl;
- this.m_tabControl=null;
- }
- this.m_tabsPayload=null;
- };
- CCognosViewer.prototype.renderTabs=function(){
- if(!this.m_tabsPayload){
- return;
- }
- var _61b=this.isSavedOutput()&&!this.m_mobileScheduledOutput;
- var _61c=document.getElementById("CVNavLinks"+this.getId());
- if(_61c||!this.shouldWriteNavLinks()||_61b){
- var _61d=this.getReportDiv();
- this.m_bHasTabs=true;
- if(this.m_tabControl&&this.m_tabControl.isSavedOutput()!=_61b){
- this.deleteTabs();
- }
- if(!this.m_tabControl){
- if(this.getStatus()!="complete"&&!_61b){
- return;
- }
- var tr=document.createElement("tr");
- var _61f=document.createElement("td");
- tr.appendChild(_61f);
- var _620=document.getElementById("mainViewerTR"+this.getId());
- if(!_620){
- return;
- }
- if(this.m_tabsPayload.position=="topLeft"){
- _620.parentNode.insertBefore(tr,_620);
- }else{
- _620.parentNode.appendChild(tr);
- }
- var _621=null;
- if(this.m_viewerWidget){
- _621=this.m_viewerWidget.findContainerDiv().firstChild;
- }else{
- _621=_61f;
- }
- var oCV=this;
- if(_61b){
- this.m_tabControl=new CognosTabControl(_621,function(_623){
- oCV.switchSavedOutputTab(_623,true);
- });
- this.switchSavedOutputTab(this.m_tabsPayload.currentTabId,false);
- }else{
- this.m_tabControl=new CognosTabControl(_621,function(_624){
- oCV.switchTabs(_624);
- });
- }
- if(this.m_viewerWidget){
- this.m_tabControl.setSpaceSaverContainer(_61f);
- this.m_tabControl.setScrollAttachNode(this.m_viewerWidget.findContainerDiv());
- this.m_tabControl.useAbsolutePosition(true);
- }
- this.m_tabControl.setIsSavedOutput(_61b);
- if(!window.gScriptLoader.m_bScriptLoaderCalled){
- var _625=document.getElementById("RVContent"+this.getId());
- var _626=this._getNodesWithViewerId(_625,"link",null);
- for(var i=0;i<_626.length;i++){
- window.gScriptLoader.moveLinks(_626[i]);
- }
- window.gScriptLoader.loadStyles(_625,this.getId());
- this.repaintDiv(_625);
- }
- }
- if(this.getStatus()=="prompting"){
- this.previouslySelectedTab=null;
- this.m_tabControl.hide();
- }else{
- if(this.isHighContrast()){
- this.m_tabControl.setHighContrast(true);
- }
- this.m_tabControl.render(this.m_tabsPayload);
- this.m_currentlySelectedTab=this.m_tabControl.getSelectedTabId();
- if(this.m_switchingToTabId&&this.m_currentlySelectedTab!=this.m_switchingToTabId){
- this._removeTabContent(_61d.parentNode,this.m_switchingToTabId);
- this._removeTabContent(_61d.parentNode,this.m_currentlySelectedTab);
- if(_61c){
- this._removeTabContent(_61c.parentNode,this.m_switchingToTabId);
- this._removeTabContent(_61c.parentNode,this.m_currentlySelectedTab);
- }
- this.m_tabInfo={};
- }
- this.m_switchingToTabId=null;
- _61d.setAttribute("tabId",this.m_currentlySelectedTab);
- if(_61c){
- _61c.setAttribute("tabId",this.m_currentlySelectedTab);
- }
- if(isIE()&&_61b&&window.resizeIFrame&&!this.m_viewerFragment&&!this.m_viewerWidget){
- window.resizeIFrame();
- }
- }
- this.setMaxContentSize();
- }else{
- var obj=this;
- setTimeout(function(){
- obj.renderTabs();
- },100);
- }
- };
- CCognosViewer.prototype.cancelTabSwitch=function(){
- var _629=this.getReportDiv();
- var _62a=this.m_switchingToTabId;
- this.m_currentlySelectedTab=_62a;
- this.m_tabControl.selectTab(this.previouslySelectedTab,false);
- this.switchTabs(this.previouslySelectedTab);
- if(_629){
- _629.parentNode.removeChild(_629);
- }
- if(this.m_tabInfo[this.m_currentlySelectedTab]&&this.m_tabInfo[this.m_currentlySelectedTab].styles){
- this._addTabStylesToHead(this.m_tabInfo[this.m_currentlySelectedTab].styles);
- }
- this.previouslySelectedTab=null;
- this.m_tabInfo[_62a]=null;
- };
- CCognosViewer.prototype.switchSavedOutputTab=function(_62b,_62c){
- var _62d=this.getSelectionController();
- if(_62d){
- _62d.clearSelectedObjects();
- }
- this.m_currentlySelectedTab=this.m_tabControl.getSelectedTabId();
- if(_62c){
- this.notifyTabChange(_62b);
- }
- if(this.m_viewerWidget){
- this.m_viewerWidget.getSavedOutput().switchSavedOutputTab(_62b,_62c);
- this.getTabController().resetPosition();
- }else{
- if(!this.savedOutputTabNodes){
- var _62e=document.getElementById("CVIFrame"+this.getId());
- this.savedOutputTabNodes=getElementsByAttribute(_62e.contentWindow.document.body,"*","tabid");
- }
- if(!this.savedOutputTabNodes){
- return;
- }
- for(var i=0;i<this.savedOutputTabNodes.length;i++){
- var _630=this.savedOutputTabNodes[i];
- _630.style.display=_630.getAttribute("tabid")==_62b?"":"none";
- }
- this.setMaxContentSize();
- }
- };
- CCognosViewer.prototype.notifyTabChange=function(_631){
- };
- CCognosViewer.prototype._getNodesWithViewerId=function(_632,_633,id){
- var _635=[];
- var _636=_632.getElementsByTagName(_633);
- for(var i=0;i<_636.length;i++){
- var node=_636[i];
- if(!id||(node.getAttribute&&node.getAttribute("namespaceId")==id)){
- node.parentNode.removeChild(node);
- _635.push(node);
- i--;
- }
- }
- return _635;
- };
- CCognosViewer.prototype._removeTabStylesFromHead=function(){
- var id=this.getId();
- return this._getNodesWithViewerId(document.getElementsByTagName("head").item(0),"style",id);
- };
- CCognosViewer.prototype._addTabStylesToHead=function(_63a){
- if(!_63a){
- return;
- }
- for(var i=0;i<_63a.length;i++){
- document.getElementsByTagName("head").item(0).appendChild(_63a[i]);
- }
- };
- CCognosViewer.prototype.switchTabs=function(_63c){
- if(this.m_currentlySelectedTab==_63c){
- return;
- }
- var _63d=this.getSelectionController();
- if(_63d){
- _63d.clearSelectedObjects();
- }
- var _63e=this.getReportDiv();
- this.m_nReportDiv=null;
- var _63f=_63e.clientHeight;
- _63e.removeAttribute("id");
- _63e.style.display="none";
- if(!this.m_tabInfo){
- this.m_tabInfo={};
- }
- var _640=this._removeTabStylesFromHead();
- var _641=this.getSelectionController().getCCDManager();
- this.m_tabInfo[this.m_currentlySelectedTab]={"conversation":this.getConversation(),"metadata":_641.getClonedMetadataArray(),"contextdata":_641.getClonedContextdataArray(),"secondaryRequests":this.getSecondaryRequests(),"styles":_640,"hasPromptControl":this.getHasPrompts()};
- var _642=this._findChildWithTabId(_63e.parentNode,_63c);
- this.previouslySelectedTab=this.m_currentlySelectedTab;
- if(_642&&this.m_tabInfo[_63c]&&this.m_tabInfo[_63c].hasPromptControl){
- if(_642){
- _642.parentNode.removeChild(_642);
- _642=null;
- }
- delete this.m_tabInfo[_63c];
- this.m_tabInfo[_63c]=null;
- }
- if(_642){
- this.m_currentlySelectedTab=_63c;
- _642.style.display="block";
- _642.setAttribute("id","CVReport"+this.getId());
- if(this.m_tabInfo&&this.m_tabInfo[_63c]){
- var _643=this.m_tabInfo[_63c];
- if(_643.conversation){
- this.setConversation(_643.conversation);
- }
- if(_643.metadata){
- _641.SetMetadata(_643.metadata);
- }
- if(_643.contextdata){
- _641.SetContextData(_643.contextdata);
- }
- if(_643.secondaryRequests){
- this.setSecondaryRequests(_643.secondaryRequests);
- }
- if(_643.styles){
- this._addTabStylesToHead(_643.styles);
- }
- this.setHasPrompts(_643.hasPromptControl);
- }
- if(this.shouldWriteNavLinks()){
- this.writeNavLinks(this.getSecondaryRequests().join(" "));
- }
- if(this.getPinFreezeManager()&&this.getPinFreezeManager().hasFrozenContainers()){
- this.getPinFreezeManager().rePaint();
- if(isIE()){
- var _644=document.getElementById("RVContent"+this.getId());
- this.repaintDiv(_644);
- }
- }
- if(this.m_viewerWidget){
- this.m_viewerWidget.placeTabControlInView();
- }
- this._keepFocus=null;
- this.doneLoadingUpdateA11Y("complete");
- this.getTabController().resetPosition();
- this.setMaxContentSize();
- }else{
- this.m_switchingToTabId=_63c;
- var _645=_63e.cloneNode(false);
- _645.style.display="block";
- _645.setAttribute("id","CVReport"+this.getId());
- _645.removeAttribute("tabId");
- _63e.parentNode.appendChild(_645);
- _645.innerHTML="<table height='"+_63f+"px'><tr><td height='100%'></td></tr></table>";
- var _646=new ViewerDispatcherEntry(this);
- _646.addFormField("ui.action","reportAction");
- _646.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",_63c);
- if(this.m_viewerWidget){
- this.m_viewerWidget.placeTabControlInView();
- }
- this.dispatchRequest(_646);
- }
- };
- CCognosViewer.prototype._removeTabContent=function(_647,_648){
- var _649=this._findChildWithTabId(_647,_648);
- while(_649){
- _649.parentNode.removeChild(_649);
- _649=this._findChildWithTabId(_647,_648);
- }
- };
- CCognosViewer.prototype._findChildWithTabId=function(_64a,_64b){
- var _64c=null;
- for(var i=0;i<_64a.childNodes.length;i++){
- var _64e=_64a.childNodes[i];
- if(_64e.getAttribute("tabId")==_64b){
- _64c=_64e;
- break;
- }
- }
- return _64c;
- };
- CCognosViewer.prototype.clearTabs=function(){
- if(!this.m_bHasTabs){
- return;
- }
- this.m_tabInfo={};
- var _64f=this.getReportDiv();
- var _650=_64f.parentNode;
- for(var i=0;i<_650.childNodes.length;i++){
- var node=_650.childNodes[i];
- if(node.getAttribute("id")!="CVReport"+this.m_sId){
- _650.removeChild(node);
- i--;
- }
- }
- };
- CCognosViewer.prototype.isSavedOutput=function(){
- var _653=this.envParams["ui.action"];
- return _653==="view"||_653==="buxView";
- };
- CCognosViewer.prototype.renderSavedOutputIFrame=function(url,_655,_656){
- var _657=document.getElementById("CVReport"+this.getId());
- var _658=document.createElement("iframe");
- _658.style.width="100%";
- _658.style.height="99%";
- _658.id="CVIFrame"+this.getId();
- _658.title=_655;
- _658.setAttribute("frameBorder","0");
- _657.appendChild(_658);
- var obj=this;
- var func=function(){
- obj.renderTabs();
- };
- setTimeout(function(){
- if(_656){
- if(_658.attachEvent){
- _658.attachEvent("onload",func);
- }else{
- _658.addEventListener("load",func,true);
- }
- }
- _658.src=url;
- },1);
- };
- CCognosViewer.prototype.updatePageState=function(_65b){
- if(_65b&&this.getState()){
- this.getState().setPageState(_65b);
- }
- };
- CCognosViewer.prototype.getPageInfo=function(){
- if(this.m_viewerState&&this.m_viewerState.getPageState()){
- var _65c=this.m_viewerState.getPageState();
- return {"currentPage":_65c.getCurrentPage(),"pageCount":_65c.getPageCount()};
- }
- return {};
- };
- CCognosViewer.prototype.isIWidgetMobile=function(){
- return this.m_viewerWidget&&this.m_viewerWidget.isMobile();
- };
- CCognosViewer.prototype.isInteractiveViewer=function(){
- return false;
- };
- CCognosViewer.prototype.launchGotoPageForIWidgetMobile=function(form){
- if(this.isIWidgetMobile()){
- this.m_viewerWidget.launchGotoPageForIWidgetMobile(form);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.executeDrillThroughForIWidgetMobile=function(form){
- if(this.isIWidgetMobile()){
- this.m_viewerWidget.executeDrillThroughForIWidgetMobile(form);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.getState=function(){
- return this.m_viewerState;
- };
- CCognosViewer.prototype.getConfig=function(){
- return this.m_viewerConfig;
- };
- CCognosViewer.prototype.getUIConfig=function(){
- return this.m_viewerUIConfig;
- };
- CCognosViewer.prototype.setCurrentNodeFocus=function(node){
- this.m_currentNodeFocus=node;
- };
- CCognosViewer.prototype.getCurrentNodeFocus=function(node){
- return this.m_currentNodeFocus;
- };
- CCognosViewer.prototype.setCurrentPromptControlFocus=function(node){
- this.m_CurrentPromptControlFocus=node;
- };
- CCognosViewer.prototype.getCurrentPromptControlFocus=function(node){
- return this.m_CurrentPromptControlFocus;
- };
- CCognosViewer.prototype.loadExtra=function(){
- };
- CCognosViewer.prototype.setRetryDispatcherEntry=function(_663){
- this.m_retryDispatcherEntry=_663;
- };
- CCognosViewer.prototype.getRetryDispatcherEntry=function(){
- return this.m_retryDispatcherEntry;
- };
- CCognosViewer.prototype.resetViewerDispatcher=function(){
- if(this.m_viewerDispatcher!==null){
- delete this.m_viewerDispatcher;
- this.m_viewerDispatcher=new ViewerDispatcher();
- }
- };
- CCognosViewer.prototype.getViewerDispatcher=function(){
- return this.m_viewerDispatcher;
- };
- CCognosViewer.prototype.setFaultDispatcherEntry=function(_664){
- this.m_faultDispatcherEntry=_664;
- };
- CCognosViewer.prototype.getFaultDispatcherEntry=function(){
- return this.m_faultDispatcherEntry;
- };
- CCognosViewer.prototype.dispatchRequest=function(_665){
- this.setFaultDispatcherEntry(null);
- this.getViewerDispatcher().dispatchRequest(_665);
- };
- CCognosViewer.prototype.getActiveRequest=function(){
- return this.getViewerDispatcher().getActiveRequest();
- };
- CCognosViewer.prototype.getProductLocale=function(){
- if(this.sProductLocale){
- return this.sProductLocale;
- }
- return "en";
- };
- CCognosViewer.prototype.getDirection=function(){
- if(this.sDirection){
- return this.sDirection;
- }
- return "ltr";
- };
- CCognosViewer.prototype.isBidiEnabled=function(){
- if(this.bIsBidiEnabled){
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.getBaseTextDirection=function(){
- if(this.isBidiEnabled()){
- if(this.sBaseTextDirection){
- return this.sBaseTextDirection;
- }
- }
- return "";
- };
- CCognosViewer.prototype.getActionFactory=function(){
- if(!this.m_actionFactory){
- this.m_actionFactory=new ActionFactory(this);
- }
- return this.m_actionFactory;
- };
- CCognosViewer.prototype.getAction=function(_666){
- var _666=this.getActionFactory().load(_666);
- _666.setCognosViewer(this);
- return _666;
- };
- CCognosViewer.prototype.getCalculationCache=function(){
- return this.m_calculationCache;
- };
- CCognosViewer.prototype.updateOutputForA11ySupport=function(){
- this.updateBorderCollapse();
- if(this.getA11YHelper()){
- this.getA11YHelper().addLabelledByForItemsOutsideOfContainers();
- }
- var _667=navigator.userAgent.toLowerCase();
- var _668=_667.indexOf("iphone")!=-1;
- var _669=_667.indexOf("ipod")!=-1;
- var _66a=_667.indexOf("ipad")!=-1;
- var _66b=_668||_669||_66a;
- var _66c=_667.indexOf("android")!=-1;
- if(_66b||_66c){
- document.body.classList.add("clsViewerMobile");
- }
- };
- CCognosViewer.prototype.checkForHighContrast=function(){
- if(this.isBux){
- this.m_bHighContrast=dojo.hasClass(document.body,"dijit_a11y")?true:false;
- }else{
- var _66d=document.createElement("div");
- _66d.id=this.m_sId+"hc";
- _66d.style.border="1px solid";
- _66d.style.borderColor="red green";
- _66d.style.height="10px";
- _66d.style.top="-999px";
- _66d.style.position="absolute";
- document.body.appendChild(_66d);
- var _66e=null;
- if(isIE()){
- _66e=_66d.currentStyle;
- }else{
- _66e=_66d.ownerDocument.defaultView.getComputedStyle(_66d,null);
- }
- if(!_66e){
- return;
- }
- this.m_bHighContrast=_66e.borderTopColor==_66e.borderRightColor;
- document.body.removeChild(_66d);
- }
- };
- CCognosViewer.prototype.isHighContrast=function(){
- if(typeof this.m_bHighContrast==="undefined"){
- this.checkForHighContrast();
- }
- return this.m_bHighContrast;
- };
- CCognosViewer.prototype.isLimitedInteractiveMode=function(){
- return this.envParams&&this.envParams.limitedInteractiveMode&&this.envParams.limitedInteractiveMode==="true";
- };
- CCognosViewer.prototype.updateBorderCollapse=function(){
- if(this.isHighContrast()==true){
- var _66f=null;
- if(this.envParams["ui.action"]=="view"&&!this.isBux){
- var _670=document.getElementById("CVIFrame"+this.getId());
- _66f=_670.contentWindow.document;
- }else{
- _66f=document.getElementById("CVReport"+this.getId());
- }
- var _671=_66f.getElementsByTagName("table");
- for(var i=0;i<_671.length;i++){
- if(_671[i].style.borderCollapse=="collapse"){
- _671[i].style.borderCollapse="separate";
- }
- }
- }
- };
- CCognosViewer.prototype.isAccessibleMode=function(){
- if(this.m_bAccessibleMode==true){
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.isSinglePageReport=function(){
- for(var _673 in this.m_aSecRequests){
- if(this.m_aSecRequests[_673]=="nextPage"||this.m_aSecRequests[_673]=="previousPage"){
- return false;
- }
- }
- return true;
- };
- CCognosViewer.prototype.hasNextPage=function(){
- for(var _674 in this.m_aSecRequests){
- if(this.m_aSecRequests[_674]=="nextPage"){
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.hasPrevPage=function(){
- for(var _675 in this.m_aSecRequests){
- if(this.m_aSecRequests[_675]=="previousPage"){
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.captureHotkeyPageNavigation=function(evt){
- evt=(evt)?evt:((event)?event:null);
- if(evt){
- var node=getNodeFromEvent(evt);
- var _678=(node&&node.nodeName)?node.nodeName.toLowerCase():null;
- if((evt.keyCode==8&&_678!="input"&&_678!="textarea")||(evt.altKey==true&&(evt.keyCode==37||evt.keyCode==39))){
- evt.returnValue=false;
- evt.cancelBubble=true;
- if(typeof evt.stopPropagation!="undefined"){
- evt.stopPropagation();
- }
- if(typeof evt.preventDefault!="undefined"){
- evt.preventDefault();
- }
- return false;
- }
- }
- return true;
- };
- CCognosViewer.prototype.setUseWorkingDialog=function(_679){
- this.m_bUseWorkingDialog=_679;
- };
- CCognosViewer.prototype.getWorkingDialog=function(){
- if(!this.m_oWorkingDialog&&this.m_bUseWorkingDialog&&typeof WorkingDialog!=="undefined"){
- if(this.getConfig()&&this.getConfig().getHttpRequestConfig()&&this.getConfig().getHttpRequestConfig().getWorkingDialog()){
- this.m_oWorkingDialog=this.getConfig().getHttpRequestConfig().getWorkingDialog();
- }else{
- this.m_oWorkingDialog=new WorkingDialog(this);
- }
- }
- return this.m_oWorkingDialog;
- };
- CCognosViewer.prototype.getRequestIndicator=function(){
- if(this.m_bUseWorkingDialog&&!this.m_oRequestExecutedIndicator&&typeof RequestExecutedIndicator!=="undefined"){
- if(this.getConfig()&&this.getConfig().getHttpRequestConfig()&&this.getConfig().getHttpRequestConfig().getRequestIndicator()){
- this.m_oRequestExecutedIndicator=this.getConfig().getHttpRequestConfig().getRequestIndicator();
- }else{
- this.m_oRequestExecutedIndicator=new RequestExecutedIndicator(this);
- }
- }
- return this.m_oRequestExecutedIndicator;
- };
- CCognosViewer.prototype.disableBrowserHotkeyPageNavigation=function(){
- if(document.attachEvent){
- document.attachEvent("onkeydown",this.captureHotkeyPageNavigation);
- }else{
- if(document.addEventListener){
- document.addEventListener("keydown",this.captureHotkeyPageNavigation,false);
- }
- }
- };
- CCognosViewer.prototype.setHasPrompts=function(_67a){
- if(!_67a){
- this.preProcessControlArray=[];
- }
- this.m_bReportHasPrompts=_67a;
- };
- CCognosViewer.prototype.getHasPrompts=function(){
- return this.m_bReportHasPrompts;
- };
- CCognosViewer.prototype.setUsePageRequest=function(_67b){
- this.m_viewerDispatcher.setUsePageRequest(_67b);
- };
- CCognosViewer.prototype.getUsePageRequest=function(){
- return this.m_viewerDispatcher.getUsePageRequest();
- };
- CCognosViewer.prototype.setKeepSessionAlive=function(_67c){
- this.m_bKeepSessionAlive=_67c;
- };
- CCognosViewer.prototype.getKeepSessionAlive=function(){
- return this.m_bKeepSessionAlive;
- };
- CCognosViewer.prototype.getWebContentRoot=function(){
- if(typeof this.sWebContentRoot!="undefined"){
- return this.sWebContentRoot;
- }else{
- return "..";
- }
- };
- CCognosViewer.prototype.getSkin=function(){
- if(typeof this.sSkin!="undefined"){
- return this.sSkin;
- }else{
- return this.getWebContentRoot()+"/skins/corporate";
- }
- };
- CCognosViewer.prototype.getSelectionController=function(){
- var _67d;
- try{
- _67d=getCognosViewerSCObjectRef(this.m_sId);
- }
- catch(e){
- _67d=null;
- }
- return _67d;
- };
- CCognosViewer.prototype.addCallback=function(_67e,oFct,_680){
- if(!this.m_aCallback){
- this.m_aCallback=[];
- }
- this.m_aCallback=this.m_aCallback.concat({m_sEvent:_67e,m_oCallback:oFct,m_bCaptureEvent:(_680===true)});
- };
- CCognosViewer.prototype.canDrillDown=function(sId){
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _683=this.getSelectionController();
- if(_683){
- return (_683.canDrillDown(sCtx));
- }
- }
- return false;
- };
- CCognosViewer.prototype.canDrillUp=function(sId){
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _686=this.getSelectionController();
- if(_686){
- return (_686.canDrillUp(sCtx));
- }
- }
- return false;
- };
- CCognosViewer.prototype.canSubmitPrompt=function(){
- var _687=null;
- if(this.preProcessControlArray&&this.preProcessControlArray instanceof Array){
- var _688=this.preProcessControlArray.length;
- for(var k=0;k<_688;k++){
- _687=eval(this.preProcessControlArray[k]);
- if(_687.isValid()===false){
- if(!this.m_reportRenderingDone||!_687.getCascadeOnParameter||!_687.getCascadeOnParameter()){
- return false;
- }
- }
- }
- }
- return true;
- };
- CCognosViewer.prototype.closeContextMenuAndToolbarMenus=function(){
- if(this.rvMainWnd){
- this.rvMainWnd.closeContextMenuAndToolbarMenus();
- }
- };
- CCognosViewer.prototype.dcm=function(_68a,_68b){
- if(this.canDisplayContextMenu()){
- if(this.preSelectNode==true){
- _68b=false;
- this.preSelectNode=false;
- }
- if(this.rvMainWnd.displayContextMenu(_68a,_68b)!=false){
- return stopEventBubble(_68a);
- }
- }
- };
- CCognosViewer.prototype.canDisplayContextMenu=function(){
- if(!this.getUIConfig()||this.getUIConfig().getShowContextMenu()){
- return (!this.isWorkingOrPrompting()&&this.rvMainWnd!=null&&typeof this.bCanUseCognosViewerContextMenu!="undefined"&&this.bCanUseCognosViewerContextMenu);
- }
- return false;
- };
- CCognosViewer.prototype.de=function(_68c){
- var _68d=this.getDrillMgr();
- if(_68d){
- _68d.singleClickDrillEvent(_68c,"RV");
- }
- };
- CCognosViewer.prototype.debug=function(sMsg){
- if(this.m_bDebug){
- var _68f="";
- var _690=this.debug.caller;
- if(typeof _690=="object"&&_690!==null){
- _68f=_690.toString().match(/function (\w*)/)[1];
- }
- if(!_68f){
- _68f="?";
- }
- alert(_68f+": "+sMsg);
- }
- };
- CCognosViewer.prototype.callbackExists=function(_691){
- var _692=false;
- if(this.m_aCallback&&this.m_aCallback.length){
- for(var _693=0;_693<this.m_aCallback.length;++_693){
- var oCB=this.m_aCallback[_693];
- if(oCB.m_sEvent==_691){
- return true;
- }
- }
- }
- return false;
- };
- CCognosViewer.prototype.executeCallback=function(_695){
- var _696=false;
- if(this.m_aCallback&&this.m_aCallback.length){
- for(var _697=0;_697<this.m_aCallback.length;++_697){
- var oCB=this.m_aCallback[_697];
- if(oCB.m_sEvent==_695){
- if(typeof oCB.m_oCallback=="function"){
- oCB.m_oCallback();
- }
- if(oCB.m_bCaptureEvent){
- _696=true;
- }
- }
- }
- }
- return _696;
- };
- CCognosViewer.prototype.getCAFContext=function(){
- return this.m_sCAFContext;
- };
- CCognosViewer.prototype.getSoapFault=function(){
- return this.m_sSoapFault;
- };
- CCognosViewer.prototype.getColumnContextIds=function(sId){
- return this.getContextIds(sId,2);
- };
- CCognosViewer.prototype.getConversation=function(){
- return this.m_sConversation;
- };
- CCognosViewer.prototype.getStatus=function(){
- return (this.m_sStatus?this.m_sStatus:"");
- };
- CCognosViewer.prototype.isWorking=function(_69a){
- if(typeof _69a!="string"){
- _69a=this.getStatus();
- }
- return ((""+_69a).match(/^(working|stillWorking)$/)?true:false);
- };
- CCognosViewer.prototype.isWorkingOrPrompting=function(){
- return (this.getStatus().match(/^(working|stillWorking|prompting)$/)?true:false);
- };
- CCognosViewer.prototype.getActionState=function(){
- return this.m_sActionState;
- };
- CCognosViewer.prototype.getDataItemName=function(sId){
- var _69c=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _69e=this.getSelectionController();
- if(_69e){
- var _69f=_69e.getRefDataItem(sCtx);
- if(_69f){
- _69c=_69f;
- }
- }
- }
- return _69c;
- };
- CCognosViewer.prototype.getDataType=function(sId){
- var _6a1=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6a3=this.getSelectionController();
- if(_6a3){
- var _6a4=_6a3.getDataType(sCtx);
- if(_6a4){
- _6a1=_6a4;
- }
- }
- }
- return _6a1;
- };
- CCognosViewer.prototype.getDepth=function(sId){
- var _6a6=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6a8=this.getSelectionController();
- if(_6a8){
- var _6a9=_6a8.getDepth(sCtx);
- if(_6a9){
- _6a6=_6a9;
- }
- }
- }
- return _6a6;
- };
- CCognosViewer.prototype.getDrillMgr=function(){
- if(!this.m_oDrillMgr){
- this.loadExtra();
- if(typeof CDrillManager=="function"){
- this.m_oDrillMgr=new CDrillManager(this);
- this.goDrillManager=this.m_oDrillMgr;
- }
- }
- return this.m_oDrillMgr;
- };
- CCognosViewer.prototype.getSubscriptionManager=function(){
- if(!this.m_oSubscriptionManager){
- this.loadExtra();
- if(typeof CSubscriptionManager=="function"){
- this.m_oSubscriptionManager=new CSubscriptionManager(this);
- }
- }
- return this.m_oSubscriptionManager;
- };
- CCognosViewer.prototype.updateGlobalParameters=function(_6aa){
- var oReq=new ViewerDispatcherEntry(this);
- oReq.addFormField("ui.action","forward");
- oReq.addFormField("generic.anyURI.runOptionEnum#globalParameters",_6aa);
- oReq.addFormField("run.prompt",true);
- oReq.addFormField("_promptControl","reprompt");
- this.submitPromptValues(oReq);
- };
- CCognosViewer.prototype.getExecutionParameters=function(){
- return this.m_sParameters;
- };
- CCognosViewer.prototype.getGateway=function(){
- return this.m_sGateway;
- };
- CCognosViewer.prototype.getSpecification=function(){
- return this.envParams["ui.spec"];
- };
- CCognosViewer.prototype.getHierarchyUniqueName=function(sId){
- var sHun=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6af=this.getSelectionController();
- if(_6af){
- var aHUN=_6af.getHun(sCtx);
- if(aHUN){
- sHun=aHUN;
- }
- }
- }
- return sHun;
- };
- CCognosViewer.prototype.getDimensionUniqueName=function(sId){
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6b3=this.getSelectionController();
- if(_6b3){
- var aDUN=_6b3.getDun(sCtx);
- if(aDUN){
- return aDUN;
- }
- }
- }
- return null;
- };
- CCognosViewer.prototype.getId=function(){
- return this.m_sId;
- };
- CCognosViewer.prototype.getLevelId=function(sId){
- var _6b6=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6b8=this.getSelectionController();
- if(_6b8){
- var aLUN=_6b8.getLun(sCtx);
- if(aLUN){
- _6b6=aLUN;
- }
- }
- }
- return _6b6;
- };
- CCognosViewer.prototype.getMemberUniqueName=function(sId){
- var sMUN=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6bd=this.getSelectionController();
- if(_6bd){
- var aMUN=_6bd.getMun(sCtx);
- if(aMUN){
- sMUN=aMUN;
- }
- }
- }
- return sMUN;
- };
- CCognosViewer.prototype.getObjectId=function(){
- var _6bf="window";
- if(typeof this.getId()=="string"){
- _6bf=getCognosViewerObjectRefAsString(this.getId());
- }
- return _6bf;
- };
- CCognosViewer.prototype.getQueryModelId=function(sId){
- var _6c1=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6c3=this.getSelectionController();
- if(_6c3){
- var _6c4=_6c3.getQueryModelId(sCtx);
- if(_6c4){
- _6c1=_6c4;
- }
- }
- }
- return _6c1;
- };
- CCognosViewer.prototype.getQueryName=function(sId){
- var _6c6=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6c8=this.getSelectionController();
- if(_6c8){
- var _6c9=_6c8.getRefQuery(sCtx);
- if(_6c9){
- _6c6=_6c9;
- }
- }
- }
- return _6c6;
- };
- CCognosViewer.prototype.getContextIds=function(sId,_6cb){
- var aIds=[];
- var sCtx=this.findCtx(sId);
- if(sCtx){
- var _6ce=sCtx.split("::");
- if(_6ce&&_6ce.length>1&&_6cb<_6ce.length){
- aIds=_6ce[_6cb].split(":");
- }
- }
- return aIds;
- };
- CCognosViewer.prototype.getRowContextIds=function(sId){
- return this.getContextIds(sId,1);
- };
- CCognosViewer.prototype.getPageContextIds=function(sId){
- return this.getContextIds(sId,3);
- };
- CCognosViewer.prototype.getString=function(sKey){
- if(RV_RES&&RV_RES[sKey]){
- return RV_RES[sKey];
- }
- return sKey;
- };
- CCognosViewer.prototype.getRV=function(){
- if(typeof this.m_oCVMgr=="object"){
- return this.m_oCVMgr;
- }
- return window;
- };
- CCognosViewer.prototype.getSecondaryRequests=function(){
- return this.m_aSecRequests;
- };
- CCognosViewer.prototype.getTracking=function(){
- return this.m_sTracking;
- };
- CCognosViewer.prototype.findCtx=function(sId){
- var sCtx="";
- if(typeof sId=="string"){
- var aCtx=this.getReportContextHelper().processCtx(sId);
- var _6d5=aCtx[0][0];
- var _6d6=this.getSelectionController();
- if(_6d6){
- if(_6d6.isContextId(_6d5)){
- sCtx=sId;
- }
- }
- }
- if(!sCtx){
- var _6d7=this.findElementWithCtx(sId);
- if(_6d7){
- sCtx=_6d7.getAttribute("ctx");
- }
- }
- return sCtx;
- };
- CCognosViewer.prototype.findElementWithCtx=function(sId){
- var _6d9=sId;
- if(typeof sId=="string"){
- _6d9=this.findElementWithCtx(document.getElementById(sId));
- }
- if(_6d9){
- if(_6d9.getAttribute&&_6d9.getAttribute("ctx")){
- return _6d9;
- }
- for(var _6da=0;_6da<_6d9.childNodes.length;_6da++){
- var _6db=this.findElementWithCtx(_6d9.childNodes[_6da]);
- if(_6db){
- return _6db;
- }
- }
- }
- return null;
- };
- CCognosViewer.prototype.getUseValue=function(sId){
- var sVal=null;
- var sCtx=this.findCtx(sId).split("::")[0];
- if(sCtx){
- var _6df=this.getSelectionController();
- if(_6df){
- sVal=_6df.getUseValue(sCtx);
- }
- }
- return sVal;
- };
- CCognosViewer.prototype.init=function(_6e0){
- if(_6e0&&typeof _6e0=="object"){
- for(var _6e1 in _6e0){
- this[_6e1]=_6e0[_6e1];
- }
- }
- };
- CCognosViewer.prototype.initViewer=function(_6e2){
- var _6e3=new RequestHandler(this);
- var _6e4=document.getElementById("formBackJax"+this.getId());
- if(_6e4&&typeof _6e4.state!="undefined"&&_6e4.state.value.length>0){
- _6e3.loadReportHTML(_6e4.result.value);
- var _6e5=eval("("+_6e4.state.value+")");
- _6e3.updateViewerState(_6e5);
- _6e3.postComplete();
- }else{
- if(this.getUsePageRequest()){
- var _6e6=_6e2?_6e2.m_sStatus:null;
- if(isIE()){
- if(window.location.hash=="#working"){
- window.history.go(-2);
- return;
- }else{
- if(_6e6==="working"||_6e6==="stillWorking"){
- window.location.hash="#working";
- }
- }
- }else{
- if(_6e4&&_6e4.working){
- if(_6e4.working.value=="true"){
- window.history.go(-1);
- return;
- }else{
- if(_6e6==="working"||_6e6==="stillWorking"){
- _6e4.working.value="true";
- }
- }
- }
- }
- }
- _6e3.processInitialResponse(_6e2);
- }
- };
- CCognosViewer.prototype.saveBackJaxInformation=function(_6e7){
- var _6e8=document.getElementById("formBackJax"+this.getId());
- if(_6e8){
- if(typeof _6e8.state!="undefined"){
- _6e8.state.value=_6e7.getResponseStateText();
- }
- if(typeof _6e8.result!="undefined"){
- _6e8.result.value=_6e7.getResult();
- }
- }
- };
- CCognosViewer.prototype.pcc=function(evt){
- if(evt&&typeof evt.button!="undefined"&&evt.button!="1"){
- this.preSelectNode=true;
- var _6ea=this.getSelectionController();
- if(_6ea){
- _6ea.pageContextClicked(evt);
- }
- }
- };
- CCognosViewer.prototype.isValidAjaxResponse=function(_6eb){
- return (_6eb&&_6eb.childNodes&&_6eb.childNodes.length>0&&_6eb.childNodes[0].nodeName!="parsererror"?true:false);
- };
- CCognosViewer.prototype.resubmitInSafeMode=function(_6ec){
- if(this.m_bUseSafeMode){
- this.resetViewerDispatcher();
- this.setUsePageRequest(true);
- this.envParams["cv.useAjax"]="false";
- if(_6ec){
- _6ec.retryRequest();
- }
- }
- };
- CCognosViewer.prototype.showLoadedContent=function(_6ed){
- if(_6ed!==null&&typeof _6ed!="undefined"){
- _6ed.style.display="block";
- }
- this.m_resizeReady=true;
- this.doneLoading();
- var obj=this;
- setTimeout(function(){
- obj.renderTabs();
- },1);
- };
- CCognosViewer.prototype.doneLoading=function(){
- var _6ef=this.getViewerWidget();
- if(_6ef){
- if(window.IBM&&window.IBM.perf){
- window.IBM.perf.log("viewer_doneLoading",this);
- }
- var _6f0=this.getStatus();
- if(!this.m_reportRenderingDone&&this.m_resizeReady&&this.m_stateSet){
- var _6f1=_6f0=="working"||_6f0=="stillWorking"||_6f0=="fault";
- _6ef.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:_6f1});
- if(_6f0=="complete"){
- if(window.IBM&&window.IBM.perf){
- window.IBM.perf.log("viewer_doneLoading",this);
- }
- if(typeof _6ef.postLoadContent=="function"){
- _6ef.postLoadContent();
- }
- this.m_reportRenderingDone=true;
- if(!_6f1){
- var _6f2=this;
- setTimeout(function(){
- _6f2.m_readyToRespondToResizeEvent=true;
- },20);
- }
- }
- }
- if(_6f0!="fault"){
- _6ef.clearErrorDlg();
- }
- this.doneLoadingUpdateA11Y(_6f0);
- }else{
- var _6f0=this.getStatus();
- if(_6f0=="complete"){
- this.m_reportRenderingDone=true;
- this.JAWSTalk(RV_RES.IDS_JS_READY);
- }else{
- if(_6f0=="working"){
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- }
- }
- }
- };
- CCognosViewer.prototype.doneLoadingUpdateA11Y=function(_6f3){
- if(this.getKeepFocus()!==false&&this.getKeepFocus()!=null){
- var _6f4=this.getKeepFocus();
- if(_6f3=="complete"){
- this.setKeepFocus(false);
- }
- var _6f5=null;
- if(this.getVisibleDialog()!==null){
- _6f5=this.getVisibleDialog().getDialogDiv();
- }else{
- if(_6f4===true){
- _6f5=document.getElementById("CVReport"+this.getId());
- }else{
- if(typeof _6f4=="string"){
- _6f5=document.getElementById(_6f4);
- }else{
- if(_6f4!==null){
- _6f5=_6f4;
- if(this.isBux){
- dojo.window.scrollIntoView(_6f5);
- }
- }
- }
- }
- }
- if(_6f5){
- setFocusToFirstTabItem(_6f5);
- }
- if(_6f3=="complete"){
- this.JAWSTalk(RV_RES.IDS_JS_READY);
- }else{
- if(_6f3=="working"||_6f3=="stillWorking"){
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- }
- }
- }
- };
- CCognosViewer.prototype.JAWSTalk=function(_6f6){
- if(this.isMobile()||this.isIWidgetMobile()){
- return;
- }
- var id=this.getId();
- var div=document.getElementById("JAWS_Alert_"+id);
- if(div){
- div.parentNode.removeChild(div);
- }
- div=document.createElement("div");
- div.id="JAWS_Alert_"+id;
- div.style.position="absolute";
- div.style.top="-9000px";
- div.style.display="none";
- div.setAttribute("role","alert");
- div.appendChild(document.createTextNode(_6f6));
- var _6f9=document.getElementById("RVContent"+id);
- if(_6f9){
- _6f9.appendChild(div);
- }else{
- if(typeof console!="undefined"&&console&&console.log){
- console.log("CCognosViewer: Could not find the Viewer div to append the JAWS alert.");
- }
- }
- };
- CCognosViewer.prototype.canInsertExpandIconsForAllCrosstabs=function(){
- if(this.isLimitedInteractiveMode()||this.isBlacklisted("ExpandMember")||this.isIWidgetMobile()){
- return false;
- }
- var _6fa=this.getAdvancedServerProperty("VIEWER_JS_EXPAND_COLLAPSE_CONTROLS_DEFAULT");
- if(_6fa===null){
- return false;
- }
- var _6fb=this.getViewerWidget().getProperties().getShowExpandCollapseIconFlag();
- return (_6fa.toLowerCase()==="on"&&_6fb!==false)||(_6fa.toLowerCase()==="off"&&_6fb===true);
- };
- CCognosViewer.prototype.setMaxContentSize=function(){
- if("10"!=window.getIEVersion()){
- return;
- }
- if(document.body.className==="viewer"){
- var _6fc=document.body.offsetHeight;
- var _6fd=this.getNonReportHeight(document.getElementById("CVReport"+this.getId()));
- var _6fe=document.getElementById("mainViewerTable"+this.getId());
- _6fe.style.maxHeight=_6fc-_6fd-2+"px";
- var _6ff=GUtil.generateCallback(this.setMaxContentSize,[true],this);
- if(!this.attachedOnResize){
- this.attachedOnResize=true;
- if(window.attachEvent){
- window.attachEvent("onresize",_6ff);
- }else{
- if(window.addEventListener){
- window.addEventListener("resize",_6ff,false);
- }
- }
- }
- }
- };
- CCognosViewer.prototype.getNonReportHeight=function(node){
- var _701=0;
- var _702=node.parentNode;
- if(!_702){
- return _701;
- }
- if(_702.childNodes.length>1){
- for(var i=0;i<_702.childNodes.length;i++){
- var _704=_702.childNodes[i];
- if(_704!=node&&!isNaN(_704.clientHeight)&&_704.style.display!="none"){
- _701+=_704.clientHeight;
- }
- }
- }
- if(node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
- _701+=this.getNonReportHeight(_702);
- }
- return _701;
- };
- CCognosViewer.prototype.addPageAdornments=function(){
- this.m_layoutElements=null;
- this.m_lidToElement=null;
- this.initFlashCharts();
- this.insertSortIconsForAllLists();
- var _705=this.getViewerWidget().getProperties();
- if(this.canInsertExpandIconsForAllCrosstabs()){
- this.insertExpandIconsForAllCrosstabs();
- }
- var _706=document.getElementById("CVReport"+this.getId());
- if(_706){
- var oCV=this;
- setTimeout(function(){
- if(oCV.getPinFreezeManager()&&oCV.getPinFreezeManager().hasFrozenContainers()){
- oCV.getPinFreezeManager().renderReportWithFrozenContainers(_706);
- }
- oCV.addInfoBar();
- },1);
- }
- this.getViewerWidget().reselectSelectionFilterObjects();
- this.getViewerWidget().addChromeWhitespaceHandler(this.getId());
- };
- CCognosViewer.prototype.addFlashChart=function(_708){
- this.m_flashChartsObjectIds.push(_708);
- };
- CCognosViewer.prototype.flashChartError=function(_709){
- var _70a=this.getViewerWidget();
- var _70b=_70a.getProperties();
- _70b.setProperty("flashCharts",false);
- var _70c=this.getAction("Redraw");
- _70c.isUndoable=function(){
- return false;
- };
- _70c.execute();
- };
- CCognosViewer.prototype.initFlashCharts=function(){
- var _70d=this.getViewerWidget();
- if(this.m_flashChartsObjectIds.length>0){
- var _70e=document.getElementById("rt"+this.getId());
- if(window.addEventListener){
- _70e.addEventListener("mousedown",onFlashChartRightClick,true);
- }else{
- var _70f={};
- var _710=function(){
- this.releaseCapture();
- };
- var _711=function(){
- onFlashChartRightClick(event);
- this.setCapture();
- };
- for(var i=0;i<this.m_flashChartsObjectIds.length;++i){
- var _713=this.m_flashChartsObjectIds[i];
- var _714=document.getElementById(_713);
- _70f[_713]=1;
- _714.parentNode.onmouseup=_710;
- _714.parentNode.onmousedown=_711;
- }
- if(this.m_flashChartsObjectIds.length>0){
- _70e.attachEvent("oncontextmenu",function(){
- if(_70f[window.event.srcElement.id]){
- return false;
- }
- });
- }
- }
- if(_70d){
- _70d.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,true);
- }
- }else{
- if(_70d){
- _70d.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,false);
- }
- }
- };
- CCognosViewer.prototype.initializeLayoutElements=function(){
- var _715=document.getElementById("rt"+this.getId());
- var _716=getElementsByAttribute(_715,"*","lid");
- this.m_lidToElement={};
- this.m_layoutElements=[];
- var _717=0;
- var _718=this.getPinFreezeManager();
- for(var i=0;i<_716.length;i++){
- var e=_716[i];
- if(!_718||!_718.getContainerElement(e)||_718.isElementInMainOutput(e)){
- this.m_layoutElements[_717]=e;
- this.m_lidToElement[e.getAttribute("lid")]=e;
- _717++;
- }
- }
- };
- CCognosViewer.prototype.getLayoutElement=function(_71b){
- if(!this.m_layoutElements){
- this.initializeLayoutElements();
- }
- if(this.m_layoutElements){
- return this.m_layoutElements[_71b];
- }
- return null;
- };
- CCognosViewer.prototype.getLayoutElementFromLid=function(lid){
- if(!this.m_lidToElement){
- this.initializeLayoutElements();
- }
- return this.m_lidToElement[lid];
- };
- CCognosViewer.prototype.getInfoBars=function(){
- return this.m_aInfoBar?this.m_aInfoBar:null;
- };
- CCognosViewer.prototype.addInfoBar=function(){
- if(this.getAdvancedServerProperty("VIEWER_JS_HIDE_INFO_BAR")==="true"){
- return;
- }
- var _71d=this.getRAPReportInfo();
- if(_71d){
- var _71e=document.getElementById("rt"+this.getId());
- this.initializeLayoutElements();
- var _71f=[];
- this.m_aInfoBar=[];
- for(var _720=0;_720<this.m_layoutElements.length;++_720){
- var _721=this.m_layoutElements[_720];
- var lid=_721.getAttribute("lid");
- if(lid){
- if(lid.indexOf("RAP_NDH_")>-1){
- lid=lid.substring(8);
- }
- lid=lid.substring(0,lid.indexOf(this.getId()));
- }
- var _723=_71d.getContainer(lid);
- if(_723&&typeof _723.parentContainer=="undefined"){
- var _724=this.collectChildContainers(_723.container);
- if(this.getPinFreezeManager()){
- oPinFreezeContainerElement=this.getPinFreezeManager().getContainerElement(_721);
- _721=(oPinFreezeContainerElement)?oPinFreezeContainerElement:_721;
- }
- var _725=new InfoBar(this,_721,_723,_724,_720);
- _725.setTimingDetails(_71d._getEventTimings());
- _725.render();
- if(_725.hasSomethingRendered()){
- _71f.push(_725.getId());
- }
- this.m_aInfoBar.push(_725);
- }
- }
- var _726=this.getViewerWidget();
- if(_726){
- _726.refreshInfoBarRenderedState(_71f);
- }
- }
- };
- CCognosViewer.prototype.collectChildContainers=function(_727){
- var _728=[];
- var _729=this.getRAPReportInfo();
- if(_729){
- var _72a=_729.getContainerCount();
- for(var cidx=0;cidx<_72a;++cidx){
- var _72c=_729.getContainerFromPos(cidx);
- if(typeof _72c.parentContainer!="undefined"&&_72c.parentContainer==_727){
- _728.push(_72c);
- }
- }
- }
- return _728;
- };
- CCognosViewer.prototype.addReportInfo=function(){
- var _72d=this.getViewerWidget();
- if(typeof _72d==="undefined"||_72d===null){
- return;
- }
- if(!_72d.getAttributeValue("originalReport")||this.isIWidgetMobile()){
- return;
- }
- var _72e=this.envParams["baseReportModificationTime"];
- var _72f=_72d.getAttributeValue("baseReportModificationTime");
- if(typeof _72e!=="undefined"&&typeof _72f!=="undefined"&&_72f&&_72f!="<empty>"&&_72e!==_72f){
- var cvid=this.getId();
- var _731=document.getElementById("CVReport"+cvid);
- var _732=_731.parentNode;
- var id="ReportInfo"+cvid;
- var _734=document.createElement("div");
- _734.setAttribute("id",id+"_container");
- _734.setAttribute("cvid",cvid);
- _734.className="new-info-indicator BUXNoPrint";
- var _735=document.createElement("img");
- var img=null;
- if(this.getDirection()==="rtl"){
- img="/rv/images/action_show_info_rtl.png";
- }else{
- img="/rv/images/action_show_info.png";
- }
- _735.src=this.getWebContentRoot()+img;
- _735.className="reportInfoIcon";
- _735.setAttribute("tabIndex","0");
- _735.setAttribute("alt","");
- _735.setAttribute("title","");
- _735.setAttribute("role","presentation");
- var _737=RV_RES.IDS_JS_REPORT_INFO_TITLE;
- var _738=RV_RES.IDS_JS_REPORT_INFO_TEXT;
- var _739=RV_RES.IDS_JS_REPORT_INFO_LINK_TEXT;
- _734.appendChild(_735);
- _732.insertBefore(_734,_731);
- 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});
- }
- };
- CCognosViewer.prototype.reportInfoResetReport=function(){
- this.executeAction("ResetToOriginal");
- };
- CCognosViewer.prototype.hideReportInfo=function(){
- var _73a=document.getElementById("ReportInfo"+this.getId()+"_container");
- if(typeof _73a!=="undefined"&&_73a!==null){
- _73a.style.visibility="hidden";
- }
- };
- CCognosViewer.prototype.insertSortIcons=function(){
- var _73b=this.envParams?this.envParams.limitedInteractiveMode:true;
- if(typeof _73b==="undefined"||_73b===true){
- return;
- }
- if(this.envParams["ui.action"]==="run"||this.envParams["ui.primaryAction"]==="run"){
- this.insertSortIconsForAllLists();
- }
- };
- CCognosViewer.prototype._getContainers=function(_73c){
- var _73d=[];
- var _73e="",_73f="";
- if(_73c==="list"){
- _73e="list";
- _73f="ls";
- }else{
- if(_73c==="crosstab"){
- _73e="crosstab";
- _73f="xt";
- }
- }
- var _740=document.getElementById("CVReport"+this.getId());
- if(this.getRAPReportInfo()){
- var _741=this.getRAPReportInfo().getContainerIds(_73e);
- for(var i=0;i<_741.length;++i){
- var _743=getElementsByAttribute(_740,"table","lid",_741[i]+this.getId(),1);
- if(_743&&_743.length>0){
- _73d.push(_743[0]);
- }
- }
- }else{
- _73d=getElementsByClassName(_740,"table",_73f);
- }
- return _73d;
- };
- CCognosViewer.prototype.insertSortIconsForAllLists=function(){
- var _744=this._getContainers("list");
- for(var i=0;i<_744.length;++i){
- this.insertSortIconsToList(_744[i]);
- }
- };
- CCognosViewer.prototype.insertSortIconsToList=function(_746){
- var _747=getElementsByAttribute(_746,"*","type","columnTitle");
- for(var i=0;i<_747.length;++i){
- var _749=_747[i];
- this.getSelectionController().getSelectionObjectFactory().getSelectionObject(_749);
- if(_749.getAttribute("canSort")!="false"&&_749.getAttribute("CTNM")===null&&_749.getAttribute("CC")===null){
- var _74a=false;
- for(var _74b=0;_74b<_749.childNodes.length;_74b++){
- var _74c=_749.childNodes[_74b];
- if(_74c.nodeName.toLowerCase()=="img"){
- if(_74c.id&&_74c.id.indexOf("sortimg")===0){
- _74a=true;
- break;
- }
- var sLid=_74c.getAttribute("lid");
- if(sLid&&sLid.indexOf("SortIcon")!==-1){
- _749.removeChild(_74c);
- break;
- }
- }
- }
- if(!_74a&&this.canInsertSortIcon(_749)){
- this.insertSortIconToColumnHeader(_749);
- }
- }
- }
- };
- CCognosViewer.prototype.isDrillBlackListed=function(){
- if(typeof this.m_bDrillBlacklisted=="undefined"){
- this.m_bDrillBlacklisted=this.isBlacklisted("DrillDown")||this.isBlacklisted("DrillUp");
- }
- return this.m_bDrillBlacklisted;
- };
- CCognosViewer.prototype.isBlacklisted=function(item){
- return this.UIBlacklist&&this.UIBlacklist.indexOf(" "+item+" ")>0;
- };
- CCognosViewer.prototype.canInsertSortIcon=function(_74f){
- var _750=_74f.getAttribute("rp_sort");
- return ((!this.isLimitedInteractiveMode()&&!this.isBlacklisted("Sort"))||(_750!==undefined&&_750!==null&&_750.length>0));
- };
- CCognosViewer.prototype.insertSortIconToColumnHeader=function(_751){
- if(!_751.style.whiteSpace){
- _751.style.whiteSpace="nowrap";
- }
- var _752=document.createElement("img");
- _752.setAttribute("id","sortimg"+Math.random());
- if((!this.isLimitedInteractiveMode()&&!this.isBlacklisted("Sort"))){
- _752.onmouseover=function(){
- this.setAttribute("oldClassName",this.className);
- this.className+=" sortIconOver";
- };
- _752.onmouseout=function(){
- this.className=this.getAttribute("oldClassName");
- this.removeAttribute("oldClassName");
- };
- }
- _752.src=this.getImgSrc(_751);
- var _753=this.getSortInfo(_751);
- var _754=this.getSortOrder(_753);
- _752.setAttribute("alt",this.getSortAltText(_754));
- _752.setAttribute("title",this.getSortAltText(_754));
- _752.className=this.getSortClass(_753);
- _752.setAttribute("sortOrder",_754);
- _751.appendChild(_752);
- };
- CCognosViewer.prototype.canInsertShowExpandCollapseIconForNode=function(_755,_756){
- var _757=this.getSelectionController();
- var _758=_757.hasCalculationMetadata(_756,[_756],"crosstab");
- return ((_757.canDrillDown(_756)||_755.alwaysCanExpandCollapse)&&!_757.isCalculationOrMeasure(_756,_758));
- };
- CCognosViewer.prototype.insertExpandIconsForAllCrosstabs=function(){
- var _759=this._getContainers("crosstab");
- var _75a=this;
- var _75b=this.getRAPReportInfo();
- var _75c=this.getReportContextHelper();
- for(var i=0;i<_759.length;i++){
- var _75e=_759[i];
- var _75f=_75e.getAttribute("lid");
- _75f=_75f.substring(0,_75f.length-this.getId().length);
- var _760=getElementsByAttribute(_75e,["td","th"],"ctnm","true");
- for(var j=0;j<_760.length;j++){
- var _762=_760[j];
- var sCtx=this.findCtx(_762);
- var _764=_75c.getDataItemName(sCtx);
- if(_764){
- var _765=_75b.getItemInfo(_75f,_764);
- var _766=_75c.processCtx(sCtx);
- if(this.canInsertShowExpandCollapseIconForNode(_765,_766[0][0])){
- var sMun=_75c.getMun(sCtx);
- var _768=sMun&&_765.expandedMembers&&_765.expandedMembers[sMun]===true;
- var _769=document.createElement("div");
- _769.setAttribute("skipSelection","true");
- _769.className="expandButton "+(_768?"collapse":"expand");
- _762.insertBefore(_769,_762.firstChild);
- var _76a=document.createElement("span");
- _76a.className="expandButtonCaption";
- _76a.innerHTML=(_768?"[-]":"[+]");
- _769.appendChild(_76a);
- }
- }
- }
- }
- };
- CCognosViewer.prototype.removeExpandIconsForAllCrosstabs=function(){
- var _76b=this._getContainers("crosstab");
- for(var i=0;i<_76b.length;i++){
- var _76d=_76b[i];
- var _76e=_76d.getAttribute("lid");
- _76e=_76e.substring(0,_76e.length-this.getId().length);
- var _76f=getElementsByAttribute(_76d,"td","ctnm","true");
- for(var j=0;j<_76f.length;j++){
- var _771=_76f[j];
- if(_771.firstChild.className==="expandButton collapse"||_771.firstChild.className==="expandButton expand"){
- _771.removeChild(_771.firstChild);
- }
- }
- }
- };
- CCognosViewer.prototype.fillInContextData=function(){
- if(!this.isLimitedInteractiveMode()){
- var _772=document.getElementById("CVReport"+this.getId());
- var _773=getElementsByClassName(_772,"table","ls");
- for(var i=0;i<_773.length;++i){
- var _775=getElementsByAttribute(_773[i],"*","type","columnTitle");
- for(var j=0;j<_775.length;++j){
- this.getSelectionController().getSelectionObjectFactory().getSelectionObject(_775[j]);
- }
- }
- }
- };
- CCognosViewer.prototype.getSortAltText=function(_777){
- if(_777==="ascending"){
- return RV_RES.IDS_JS_SORT_ASCENDING;
- }else{
- if(_777==="descending"){
- return RV_RES.IDS_JS_SORT_DESCENDING;
- }else{
- if(_777==="nosort"){
- return RV_RES.IDS_JS_NOT_SORTED;
- }
- }
- }
- };
- CCognosViewer.prototype.getSortInfo=function(_778){
- var _779=_778.getAttribute("rp_sort");
- if(_779){
- _779=_779.split(".");
- }
- return _779;
- };
- CCognosViewer.prototype.getSortClass=function(_77a){
- var _77b="sortIconHidden";
- if(_77a){
- if(_77a[0]==="d"||_77a[0]==="a"){
- _77b="sortIconVisible";
- }
- }
- return _77b;
- };
- CCognosViewer.prototype.getSortOrder=function(_77c){
- var _77d="nosort";
- if(_77c){
- if(_77c[0]==="d"){
- _77d="descending";
- }else{
- if(_77c[0]==="a"){
- _77d="ascending";
- }
- }
- }
- return _77d;
- };
- CCognosViewer.prototype.getImgSrc=function(_77e){
- var _77f=_77e.getAttribute("rp_sort");
- var src=this.getWebContentRoot()+"/rv/images/"+this.getSortIconName(_77f);
- return src;
- };
- CCognosViewer.prototype.getSortIconName=function(_781){
- var _782="sort_no.gif";
- if(_781){
- _781=_781.split(".");
- if(_781[0]==="d"){
- _782="sort_descending.gif";
- }else{
- if(_781[0]==="a"){
- _782="sort_ascending.gif";
- }
- }
- }
- return _782;
- };
- CCognosViewer.prototype.shouldWriteNavLinks=function(){
- if(this.envParams["cv.navlinks"]=="false"){
- return false;
- }else{
- if(!this.getUIConfig()||this.getUIConfig().getShowPageNavigation()){
- if(this.rvMainWnd||(this.isBux&&!this.isActiveReport())){
- return true;
- }
- }
- }
- return false;
- };
- CCognosViewer.prototype.isActiveReport=function(){
- if(this.envParams["cv.responseFormat"]==="activeReport"){
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.resetRaiseSharePromptEventFlag=function(){
- this.m_raiseSharePromptEvent=true;
- };
- CCognosViewer.prototype.resetbHasPromptFlag=function(){
- this.m_bHasPrompt=null;
- };
- CCognosViewer.prototype.disableRaiseSharePromptEvent=function(){
- this.m_raiseSharePromptEvent=false;
- };
- CCognosViewer.prototype.widgetHasPromptParameters=function(){
- var _783=this.getViewerWidget();
- return (_783&&_783.promptParametersRetrieved==true&&this.envParams&&typeof this.envParams["reportPrompts"]!="undefined"&&this.envParams["reportPrompts"]!=null&&this.envParams["reportPrompts"].length>0);
- };
- CCognosViewer.prototype.getPromptParametersInfo=function(){
- var _784=null;
- if(this.widgetHasPromptParameters()){
- _784="<widget><parameterValues>"+sXmlEncode(this.getExecutionParameters())+"</parameterValues>"+this.envParams["reportPrompts"]+"</widget>";
- }
- return _784;
- };
- CCognosViewer.prototype.raisePromptEvent=function(_785,_786,_787){
- try{
- var _788=this.getViewerWidget();
- _788.getWidgetContextManager().raisePromptEvent(_785,_786,_786.get("ui.action"),this.getModelPath(),_787);
- }
- catch(e){
- }
- };
- CCognosViewer.prototype.getModelPath=function(){
- var _789=this.getSelectionController().getModelPathForCurrentSelection();
- if(_789){
- return _789;
- }else{
- if(this.envParams.modelPath){
- return this.envParams.modelPath;
- }else{
- if(typeof document.forms["formWarpRequest"+this.getId()].modelPath!=="undefined"){
- return document.forms["formWarpRequest"+this.getId()].modelPath.value;
- }
- }
- }
- return "";
- };
- CCognosViewer.prototype.setKeepFocus=function(_78a){
- this._keepFocus=_78a;
- };
- CCognosViewer.prototype.getKeepFocus=function(){
- if(typeof this._keepFocus!="undefined"){
- return this._keepFocus;
- }
- return false;
- };
- CCognosViewer.prototype.onFocus=function(evt){
- var _78c=this.getA11YHelper();
- if(_78c){
- _78c.onFocus(evt);
- }
- };
- CCognosViewer.prototype.getA11YHelper=function(){
- if(!this.a11yHelper){
- this.loadExtra();
- if(typeof ViewerA11YHelper=="function"){
- this.a11yHelper=new ViewerA11YHelper(this);
- }else{
- if(typeof console!=="undefined"&&console.log){
- console.log("CCognosViewer: Could not create ViewerA11YHelper object.");
- }
- return null;
- }
- }
- return this.a11yHelper;
- };
- CCognosViewer.prototype.onKeyDown=function(evt){
- if(this.getA11YHelper()){
- this.getA11YHelper().onKeyDown(evt);
- }
- };
- CCognosViewer.prototype.updateSkipToReportLink=function(){
- var _78e=this.getStatus();
- var _78f=document.getElementById("cvSkipToReport"+this.getId());
- if(_78f){
- _78f.style.display=_78e=="prompting"?"none":"";
- }
- };
- CCognosViewer.prototype.updateSkipToNavigationLink=function(_790){
- var _791=document.getElementById("cvSkipToNavigation"+this.getId());
- if(_791){
- _791.style.display=_790?"none":"";
- }
- };
- CCognosViewer.prototype.pageAction=function(_792){
- this.setKeepFocus("CVNavLinks"+this.getId());
- var _793=new ViewerDispatcherEntry(this);
- _793.addFormField("ui.action",_792);
- if(this.getCurrentlySelectedTab()){
- _793.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getCurrentlySelectedTab());
- }
- this.dispatchRequest(_793);
- };
- CCognosViewer.prototype.writeNavLink=function(_794,_795,_796,_797){
- var _798="";
- if(_796){
- _798="<td nowrap=\"nowrap\">"+"<img src=\"LINK_IMG\" width=\"15\" height=\"15\" alt=\"\" style=\"vertical-align:middle;\">"+"</td>"+"<td nowrap=\"nowrap\">";
- if(_797){
- _798+="<a href=\"#\" tabindex=\"0\" onclick=\""+getCognosViewerObjectRefAsString(this.getId())+".getViewerWidget().getSavedOutput().pageAction('LINK_REQUEST');return false;\"";
- }else{
- _798+="<a href=\"#\" tabindex=\"0\" onclick=\""+getCognosViewerObjectRefAsString(this.getId())+".pageAction('LINK_REQUEST');return false;\"";
- }
- _798+=">LINK_TEXT</a> "+"</td>";
- }else{
- _798="<td nowrap=\"nowrap\">"+"<img src=\"LINK_IMG\" width=\"15\" height=\"15\" alt=\"\" style=\"vertical-align:middle;\">"+"</td>"+"<td nowrap=\"nowrap\">LINK_TEXT </td>";
- }
- var sImg=this.sSkin+(!_796&&_794.sImgDisabled?_794.sImgDisabled:_794.sImg);
- return _798.replace(/LINK_REQUEST/g,_795).replace(/LINK_TEXT/g,_794.sText).replace(/LINK_IMG/g,sImg);
- };
- CCognosViewer.prototype.loadNavLinks=function(){
- var _79a=window.gScriptLoader.loadFile(this.getGateway(),"b_action=xts.run&m=portal/report-viewer-navlinks.xts");
- if(_79a){
- this.init(eval("("+_79a+")"));
- }
- };
- CCognosViewer.prototype.writeNavLinks=function(sSR,_79c){
- var _79d=document.getElementById("CVNavLinks"+this.getId());
- if(_79d){
- var _79e=document.getElementById("CVNavLinks_Container"+this.getId());
- if(typeof this.oNavLinks!="object"||typeof sSR!="string"||!sSR.match(/\bfirstPage\b|\bpreviousPage\b|\bnextPage\b|\blastPage\b|\bplayback\b/i)){
- _79d.style.display="none";
- if(_79e){
- _79e.style.display="none";
- }
- this.updateSkipToNavigationLink(true);
- return;
- }
- this.updateSkipToNavigationLink(false);
- if(_79e){
- _79e.style.display="";
- }
- _79d.style.display=(isIE()?"block":"table-cell");
- var _79f="";
- _79f+="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"pageControls BUXNoPrint\" role=\"presentation\"><tbody><tr>";
- _79f+=this.writeNavLink(this.oNavLinks.oFirst,"firstPage",sSR.match(/\bfirstPage\b/gi),_79c);
- _79f+=this.writeNavLink(this.oNavLinks.oPrevious,"previousPage",sSR.match(/\bpreviousPage\b/gi),_79c);
- _79f+=this.writeNavLink(this.oNavLinks.oNext,"nextPage",sSR.match(/\bnextPage\b/gi),_79c);
- _79f+=this.writeNavLink(this.oNavLinks.oLast,"lastPage",sSR.match(/\blastPage\b/gi),_79c);
- _79f+="</tr></tbody></table>";
- var _7a0=document.getElementById("CVNavLinks_label"+this.getId());
- var _7a1="";
- if(_7a0){
- _7a1+="<span id=\"CVNavLinks_label"+this.getId()+"\" style=\"visibilty:hidden; display:none;\">"+_7a0.innerHTML+"</span>";
- }
- _79d.innerHTML=_7a1+_79f;
- }else{
- if(this.shouldWriteNavLinks()){
- setTimeout(getCognosViewerObjectRefAsString(this.getId())+".writeNavLinks(\""+sSR+"\",\""+_79c+"\");",100);
- }
- }
- };
- function CVBackgroundLayer_ignoreMouseClick(e){
- if(e.returnValue){
- e.returnValue=false;
- }else{
- if(e.preventDefault){
- e.preventDefault();
- }else{
- return false;
- }
- }
- };
- CCognosViewer.prototype.createTransparentBackgroundLayer=function(){
- this.removeTransparentBackgroundLayer();
- var oBL=document.createElement("div");
- oBL.id=CV_BACKGROUND_LAYER_ID;
- oBL.style.display="none";
- oBL.style.position="absolute";
- oBL.setAttribute("role","region");
- oBL.setAttribute("aria-label",RV_RES.IDS_JS_A11Y_BACKGROUND_TINT);
- oBL.style.top="0px";
- oBL.style.left="0px";
- oBL.style.zIndex=98;
- oBL.style.width="100%";
- oBL.style.height="100%";
- oBL.style.backgroundColor="rgb(238, 238, 238)";
- oBL.style.opacity="0";
- oBL.style.filter="alpha(opacity:0)";
- oBL.innerHTML="<table tabindex=\"1\" width=\"100%\" height=\"100%\"><tr><td role=\"presentation\" onclick=\"CVBackgroundLayer_ignoreMouseClick(event)\"></td></tr></table>";
- oBL.style.display="inline";
- document.body.appendChild(oBL);
- };
- CCognosViewer.prototype.removeTransparentBackgroundLayer=function(){
- var oBL=document.getElementById(CV_BACKGROUND_LAYER_ID);
- if(oBL){
- oBL.parentNode.removeChild(oBL);
- }
- };
- CCognosViewer.prototype.closeActiveHTTPConnection=function(){
- var _7a5=this.getActiveRequest();
- if(_7a5){
- _7a5.abortHttpRequest();
- }
- };
- CCognosViewer.prototype.canCancel=function(){
- var _7a6=this.getTracking();
- var _7a7=this.getStatus();
- return _7a6!=""&&_7a7!="complete";
- };
- CCognosViewer.prototype.cancel=function(_7a8){
- if(this.getWorkingDialog()&&this.getWorkingDialog().disableCancelButton){
- this.getWorkingDialog().disableCancelButton(_7a8);
- }
- this.removeTransparentBackgroundLayer();
- this.clearPrompts();
- if(this.m_viewerFragment&&this.envParams["fragment.fireEventWhenComplete"]){
- this.envParams["fragment.fireEventWhenComplete"]="";
- }
- var _7a9=null;
- if(this.m_undoStack.length>0){
- _7a9=this.m_undoStack.pop();
- }
- var _7aa=this.getActiveRequest();
- if(this.canCancel()===true||_7aa){
- if(_7aa){
- _7aa.cancelRequest(true);
- }else{
- var _7ab=null;
- var _7ac=_7a9!=null&&_7a9.m_bRefreshPage;
- if(typeof this.getCancelDispatcherEntry=="function"){
- _7ab=this.getCancelDispatcherEntry();
- }else{
- if(_7ac||this.m_viewerFragment){
- _7ab=new ViewerDispatcherEntry(this);
- }else{
- if(this.getId()=="RS"){
- _7ab=new ViewerDispatcherEntry(this);
- _7ab.addFormField("cv.responseFormat","rs");
- }else{
- _7ab=new DispatcherEntry(this);
- _7ab.addFormField("cv.responseFormat","successfulRequest");
- }
- }
- }
- _7ab.forceSynchronous();
- _7ab.addFormField("ui.action","cancel");
- _7ab.addFormField("m_tracking",this.getTracking());
- this.setTracking("");
- if(_7ac){
- var _7ad="<CognosViewerUndo><conversation>";
- _7ad+=_7a9.m_sConversation;
- _7ad+="</conversation></CognosViewerUndo>";
- _7ab.addFormField("cv.previousSession",_7ad);
- }
- this.dispatchRequest(_7ab);
- if(!this.isBux&&!this.m_viewerFragment&&(this.getUsePageRequest()||!this.isReportRenderingDone())){
- this.executeCallback("cancel");
- }
- }
- this.setStatus("complete");
- var _7ae=this.envParams["ui.action"];
- var _7af=this.getUsePageRequest();
- var _7b0=this.m_undoStack.length;
- if(_7a9!=null){
- this.m_sConversation=_7a9.m_sConversation;
- this.m_sParameters=_7a9.m_sParameters;
- this.envParams={};
- applyJSONProperties(this.envParams,_7a9.m_envParams);
- this.m_undoStack.push(_7a9);
- }
- this.setTracking("");
- if(this.previouslySelectedTab){
- this.cancelTabSwitch();
- }else{
- if(_7ae!="view"&&_7b0<=0&&this.rvMainWnd){
- this.rvMainWnd.executePreviousReport(-1);
- }
- }
- return true;
- }else{
- if(this.rvMainWnd&&typeof this.envParams!="undefined"&&(this.envParams["ui.primaryAction"]=="authoredDrillThrough"||this.envParams["ui.primaryAction"]=="authoredDrillThrough2")){
- this.rvMainWnd.executePreviousReport(-1);
- return true;
- }else{
- if(!this.isBux){
- executeBackURL(this.getId());
- }
- return true;
- }
- }
- return false;
- };
- CCognosViewer.prototype.clearPrompts=function(){
- if(this.preProcessControlArray){
- var _7b1=this.preProcessControlArray.length;
- var k=0;
- for(k=0;k<_7b1;k++){
- var _7b3=eval(this.preProcessControlArray[k]);
- if(_7b3){
- if(_7b3.clearSubmit){
- _7b3.clearSubmit();
- }
- }
- }
- }
- };
- CCognosViewer.prototype.wait=function(){
- if(this.isWorking()){
- this.JAWSTalk(RV_RES.IDS_JS_WAIT_PAGE_LOADING);
- var _7b4=new ViewerDispatcherEntry(this);
- _7b4.addFormField("ui.action","wait");
- _7b4.addFormField("ui.primaryAction",this.envParams["ui.primaryAction"]);
- _7b4.addFormField("cv.actionState",this.envParams["cv.actionState"]);
- _7b4.addNonEmptyStringFormField("bux",this.envParams["bux"]);
- _7b4.addNonEmptyStringFormField("ui.preserveRapTags",this.envParams["ui.preserveRapTags"]);
- this.dispatchRequest(_7b4);
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.setCAFContext=function(_7b5){
- this.m_sCAFContext=_7b5;
- };
- CCognosViewer.prototype.setContextInfo=function(sXML){
- this.m_sContextInfoXML=sXML;
- };
- CCognosViewer.prototype.setConversation=function(_7b7){
- this.m_sConversation=_7b7;
- };
- CCognosViewer.prototype.setActionState=function(_7b8){
- this.m_sActionState=_7b8;
- };
- CCognosViewer.prototype.setStatus=function(_7b9){
- this.m_sStatus=_7b9;
- };
- CCognosViewer.prototype.setDebug=function(_7ba){
- this.m_bDebug=_7ba;
- };
- CCognosViewer.prototype.setExecutionParameters=function(_7bb){
- this.m_sParameters=_7bb;
- };
- CCognosViewer.prototype.setMetadataInfo=function(sXML){
- this.m_sMetadataInfoXML=sXML;
- };
- CCognosViewer.prototype.setSecondaryRequests=function(_7bd){
- if(_7bd){
- this.m_aSecRequests=_7bd;
- }else{
- this.m_aSecRequests=[];
- }
- };
- CCognosViewer.prototype.setTracking=function(_7be){
- this.m_sTracking=_7be;
- };
- CCognosViewer.prototype.setSoapFault=function(_7bf){
- this.m_sSoapFault=_7bf;
- };
- CCognosViewer.prototype.showOutputInNewWindow=function(sURL){
- var _7c1=document.getElementById("formWarpRequest"+this.getId());
- var _7c2=_7c1.elements["ui.postBack"];
- var _7c3=_7c1.elements["ui.backURL"];
- if(this.isAccessibleMode()&&this.envParams["run.outputFormat"]=="PDF"&&window.detachLeavingRV){
- window.detachLeavingRV();
- }
- if(window.opener||_7c2||(_7c3&&_7c3.value!=="javascript:window.close();")){
- window.open(sURL,"","");
- this.updateNewBrowserWindow();
- }else{
- window.location=sURL;
- }
- };
- CCognosViewer.prototype.hideToolbar=function(_7c4){
- this.m_bHideToolbar=_7c4;
- };
- CCognosViewer.prototype.showExcel=function(sURL){
- var _7c6=true;
- var _7c7=document.getElementById("formWarpRequest"+this.getId());
- var _7c8=_7c7.elements["ui.backURL"];
- if(_7c8&&_7c8.value.indexOf("javascript:window.close()")!==0&&_7c8.value.indexOf("close.html")===-1){
- _7c6=false;
- }
- if(window.detachLeavingRV){
- window.detachLeavingRV();
- }
- var _7c9=window;
- if(window.opener&&(isIE()||isFF())&&_7c6){
- _7c9=window.opener?window.opener:window;
- }else{
- if(!window.opener&&_7c6){
- window.location=sURL;
- return;
- }
- }
- var _7ca=null;
- var _7cb="";
- try{
- if(this.envParams["cv.excelWindowOpenProperties"]){
- _7cb=this.envParams["cv.excelWindowOpenProperties"];
- }
- _7ca=_7c9.open(sURL,"",_7cb);
- }
- catch(e){
- _7c9=window;
- _7ca=_7c9.open(sURL,"",_7cb);
- }
- if(!_7ca||_7ca.closed||typeof _7ca.closed=="undefined"){
- alert(RV_RES.RV_BROWSER_POPUP_IS_ENABLED);
- }
- this.updateNewBrowserWindow();
- };
- CCognosViewer.prototype.updateNewBrowserWindow=function(){
- var id=this.getId();
- var _7cd=document.forms["formWarpRequest"+id].elements["ui.postBack"];
- var _7ce=document.forms["formWarpRequest"+id].elements["ui.backURL"];
- if(_7cd&&_7cd.value){
- setTimeout(getCognosViewerObjectRefAsString(id)+".getRV().doPostBack();",100);
- }else{
- if(_7ce&&_7ce.value){
- if(_7ce.value.length<2048){
- setTimeout("location.replace(\""+_7ce.value+"\");",100);
- }else{
- _7ce=decodeURIComponent(_7ce.value);
- var _7cf=_7ce.split("?");
- var _7d0=document.createElement("form");
- _7d0.style.display="none";
- _7d0.setAttribute("target","_self");
- _7d0.setAttribute("method","post");
- _7d0.setAttribute("action",_7cf[0]);
- var _7d1=_7cf[1].split("&");
- for(var _7d2=0;_7d2<_7d1.length;_7d2++){
- var _7d3=_7d1[_7d2].indexOf("=");
- var _7d4=_7d1[_7d2].substr(0,_7d3);
- var _7d5=_7d1[_7d2].substr(_7d3+1);
- var _7d6=document.createElement("img");
- _7d6.setAttribute("type","hidden");
- _7d6.setAttribute("name",decodeURIComponent(_7d4));
- _7d6.setAttribute("value",decodeURIComponent(_7d5));
- _7d0.appendChild(_7d6);
- }
- document.body.appendChild(_7d0);
- _7d0.submit();
- }
- }else{
- window.close();
- }
- }
- };
- CCognosViewer.prototype.showWaitPage=function(){
- };
- CCognosViewer.prototype.sendRequest=function(_7d7){
- var _7d8=new ViewerDispatcherEntry(this);
- _7d8.addFormField("ui.action",_7d7.getAction());
- if(_7d7.getCallback()!=null){
- _7d8.setCallbacks({"complete":{"object":null,"method":_7d7.getCallback()}});
- }
- var _7d9=_7d7.getFormFields().keys();
- for(var _7da=0;_7da<_7d9.length;_7da++){
- _7d8.addFormField(_7d9[_7da],_7d7.getFormFields().get(_7d9[_7da]));
- }
- var _7db=_7d7.m_oOptions.keys();
- for(var _7dc=0;_7dc<_7db.length;_7dc++){
- _7d8.addFormField(_7db[_7dc],_7d7.getOption(_7db[_7dc]));
- }
- var _7dd=_7d7.m_oParams.keys();
- for(var _7de=0;_7de<_7dd.length;_7de++){
- _7d8.addFormField(_7dd[_7de],_7d7.getParameter(_7dd[_7de]));
- }
- this.dispatchRequest(_7d8);
- };
- CCognosViewer.prototype.promptAction=function(_7df,sUrl){
- this.setKeepFocus(true);
- if(typeof datePickerObserverNotify=="function"){
- datePickerObserverNotify();
- }
- var _7e1=this.getViewerWidget();
- if(_7df=="cancel"){
- this.cancelPrompt(sUrl);
- if(_7e1){
- if(!this.isReportRenderingDone()){
- var _7e2={action:"deleteWidget"};
- _7e1.fireEvent("com.ibm.bux.widget.action",null,_7e2);
- }
- }
- }else{
- var oReq=new ViewerDispatcherEntry(this);
- oReq.addFormField("ui.action",_7df=="back"?"back":"forward");
- if(_7df=="finish"){
- oReq.addFormField("run.prompt",false);
- }else{
- if(_7df=="back"||_7df=="next"){
- oReq.addFormField("run.prompt",true);
- }
- }
- if(_7df=="reprompt"){
- if(typeof repromptObserverNotify=="function"){
- repromptObserverNotify(this);
- }
- oReq.addFormField("_promptControl",_7df);
- }else{
- oReq.addFormField("_promptControl","prompt");
- }
- if(_7e1){
- _7e1.fireEvent("com.ibm.bux.widget.modified",null,{"modified":true});
- if(_7e1.isSelectionFilterEnabled){
- _7e1.clearSelectionFilter();
- }
- }
- this.submitPromptValues(oReq);
- }
- };
- CCognosViewer.prototype.cancelPrompt=function(sUrl){
- this.cancel();
- };
- CCognosViewer.prototype.notify=function(_7e5,_7e6){
- var _7e7=0,k=0;
- var _7e9=null;
- if(this.rangeObserverArray&&this.rangeObserverArray instanceof Array){
- _7e7=this.rangeObserverArray.length;
- for(k=0;k<_7e7;k++){
- _7e9=eval(this.rangeObserverArray[k]);
- if(_7e9&&typeof _7e9=="object"&&typeof _7e9.update=="function"){
- _7e9.update();
- }
- }
- }
- var _7ea=true;
- if(this.preProcessControlArray&&this.preProcessControlArray instanceof Array){
- _7e7=this.preProcessControlArray.length;
- for(k=0;k<_7e7;k++){
- _7e9=eval(this.preProcessControlArray[k]);
- if((typeof _7e9.getValid=="function")&&!_7e9.getValid()){
- _7ea=false;
- break;
- }
- }
- }
- this.notifyPageNavEnabled(_7ea);
- if(this.multipleObserverArray&&this.multipleObserverArray instanceof Array){
- _7e7=this.multipleObserverArray.length;
- for(k=0;k<_7e7;k++){
- _7e9=eval(this.multipleObserverArray[k]);
- if(_7e9&&typeof _7e9=="object"&&typeof _7e9.checkInsertRemove=="function"){
- _7e9.checkInsertRemove();
- }
- }
- }
- for(var _7eb=0;_7eb<gaNotifyTargets.length;_7eb++){
- var _7ec=gaNotifyTargets[_7eb];
- if(typeof _7ec!="undefined"&&typeof _7ec.notify=="function"){
- _7ec.notify(_7e5,_7e6);
- }
- }
- };
- CCognosViewer.prototype.notifyPageNavEnabled=function(_7ed){
- if(this.pageNavigationObserverArray&&this.pageNavigationObserverArray instanceof Array){
- var _7ee=this.pageNavigationObserverArray.length;
- var _7ef=false;
- var _7f0=null;
- var _7f1=null;
- var k=0;
- for(k=0;k<_7ee;k++){
- try{
- _7f0=eval(this.pageNavigationObserverArray[k]);
- _7f1=_7f0.getType();
- if(_7f1==PROMPTBUTTON_FINISH){
- _7ef=true;
- break;
- }
- }
- catch(e){
- }
- }
- for(k=0;k<_7ee;k++){
- try{
- _7f0=eval(this.pageNavigationObserverArray[k]);
- _7f1=_7f0.getType();
- if(!_7ed){
- if((_7f1==PROMPTBUTTON_NEXT)||(_7f1==PROMPTBUTTON_OK)||(_7f1==PROMPTBUTTON_FINISH)){
- _7f0.setEnabled(false);
- }
- }else{
- if(_7f1==PROMPTBUTTON_FINISH){
- _7f0.setEnabled(this.bCanFinish);
- }else{
- if(_7f1==PROMPTBUTTON_NEXT){
- _7f0.setEnabled(this.bNextPage||!_7ef);
- }else{
- if(_7f1==PROMPTBUTTON_OK){
- _7f0.setEnabled(true);
- }
- }
- }
- }
- }
- catch(e2){
- }
- }
- }
- };
- CCognosViewer.prototype.getDrillResetHUNs=function(_7f3){
- var _7f4=null;
- if(this.getRAPReportInfo()){
- _7f4=this.getRAPReportInfo().getDrilledOnHUNs();
- }
- if(!_7f4){
- return null;
- }
- var _7f5=this.getExecutionParameters();
- if(!_7f5){
- return null;
- }
- var _7f6=this._getListOfChangedPromptParameters(_7f3);
- if(!_7f6||_7f6.length===0){
- return null;
- }
- var _7f7=[];
- for(var i=0;i<_7f4.length;i++){
- for(var j=0;j<_7f6.length;j++){
- if(_7f6[j].indexOf(_7f4[i])!==-1){
- _7f7.push(_7f4[i]);
- }
- }
- }
- return _7f7;
- };
- CCognosViewer.prototype.getOldParameters=function(){
- var _7fa=new CParameterValues();
- var _7fb=XMLBuilderLoadXMLFromString(this.getExecutionParameters());
- if(_7fb.childNodes.length==1){
- _7fa.loadWithOptions(_7fb.childNodes[0],false);
- }
- if(!_7fa||!_7fa.m_parameterValues||!_7fa.m_parameterValues.m_aValues){
- return null;
- }
- return _7fa.m_parameterValues.m_aValues;
- };
- CCognosViewer.prototype._createDummyRequest=function(){
- var _7fc=new ViewerDispatcherEntry(this);
- return this.preparePromptValues(_7fc);
- };
- CCognosViewer.prototype._getChangedPromptParametersValues=function(_7fd,_7fe,_7ff){
- var _800=XMLBuilderLoadXMLFromString(_7fe);
- if(!_800){
- for(var j=0;j<_7fd.length;j++){
- var _802=_7fd[j].m_useValue;
- if(_7fe.indexOf(sXmlEncode(_802))<0){
- _7ff.push(_802);
- }
- }
- return;
- }
- var _803=_800.getElementsByTagName("selectOption");
- if(!_803){
- return;
- }
- var _804=_7fd.length;
- var _805=_803.length;
- for(var i=0;i<_805;i++){
- var _7fe=_803[i].attributes.getNamedItem("useValue").nodeValue;
- bMatchOldParam=false;
- for(var j=0;j<_804;j++){
- var _802=_7fd[j].m_useValue;
- if(_7fe.indexOf(_802)===0){
- bMatchOldParam=true;
- break;
- }
- }
- if(!bMatchOldParam){
- _7ff.push(_7fe);
- }
- }
- };
- CCognosViewer.prototype._getListOfChangedPromptParameters=function(_807){
- var _808=this.getOldParameters();
- if(!_808){
- return null;
- }
- var _809=[];
- if(!_807){
- var _80a=this._createDummyRequest();
- for(var _80b in _808){
- var _80c=_808[_80b].m_parmValueItems;
- var _80d=_80a.getRequest().getFormFields().get("p_"+_80b);
- if(!_80d){
- continue;
- }
- this._getChangedPromptParametersValues(_80c,_80d,_809);
- }
- }else{
- if(!_807.parameters){
- return null;
- }
- var _80e=_807.parameters;
- for(var i=0;i<_80e.length;i++){
- var _810=_80e[i].parmName;
- if(!_810||!_808[_810]){
- continue;
- }
- var _80c=_808[_810].m_parmValueItems;
- if(!_80c||_80c.length==0){
- continue;
- }
- this._getChangedPromptParametersValues(_80c,_80e[i].parmValue,_809);
- }
- }
- return _809;
- };
- CCognosViewer.prototype.submitPromptValues=function(oReq){
- if(this.gbPromptRequestSubmitted===true){
- return false;
- }
- this.gbPromptRequestSubmitted=true;
- if(this.isBux){
- var _812=this.getDrillResetHUNs(null);
- if(_812&&_812.length!==0){
- var _813={"drilledResetHUNs":_812};
- this.executeAction("DrillReset",_813);
- return;
- }
- }
- oReq=this.preparePromptValues(oReq);
- if(window.portletSharePrompt){
- var _814=this.portletPromptParams(oReq);
- if(_814.length>0){
- portletSharePrompt(_814);
- }
- }
- this.dispatchRequest(oReq);
- };
- CCognosViewer.prototype.portletPromptParams=function(oReq){
- var _816=[];
- var _817=null;
- var _818=true;
- var _819=oReq.getFormFields().keys();
- for(var _81a=0;_81a<_819.length;_81a++){
- _817=_819[_81a];
- if(_817=="_promptControl"&&oReq.getFormField(_817)=="search"){
- _818=false;
- break;
- }else{
- if(_817.indexOf("p_")===0){
- if(_817.indexOf("p_credential")===0){
- _818=false;
- break;
- }else{
- _816.push([_817,oReq.getFormField(_817)]);
- }
- }
- }
- }
- if(_816&&!_818){
- _816=[];
- }
- return _816;
- };
- CCognosViewer.prototype.preparePromptValues=function(oReq){
- var _81c=[];
- if(this.preProcessControlArray){
- var _81d=this.preProcessControlArray.length;
- var k=0;
- for(k=0;k<_81d;k++){
- var _81f=eval(this.preProcessControlArray[k]);
- var _820=(typeof _81f.isEnabled=="function"?_81f.isEnabled():true);
- if(_81f&&typeof _81f.preProcess=="function"&&_820){
- _81f.preProcess();
- if(_81f.m_oSubmit){
- if(oReq.addParameter){
- oReq.addParameter(_81f.m_oSubmit.name,_81f.m_oSubmit.value);
- }else{
- oReq.addFormField(_81f.m_oSubmit.name,_81f.m_oSubmit.value);
- }
- _81c.push(_81f.m_oSubmit);
- if(_81f.m_sPromptId&&_81f.m_oForm&&_81f.m_oForm.elements&&typeof _81f.m_oForm.elements["p_"+_81f.m_sRef]=="object"){
- if(oReq.addParameter){
- oReq.addParameter("p_"+_81f.m_sPromptId,_81f.m_oForm.elements["p_"+_81f.m_sRef].value);
- }else{
- oReq.addFormField("p_"+_81f.m_sPromptId,_81f.m_oForm.elements["p_"+_81f.m_sRef].value);
- }
- }
- }
- }
- }
- }
- var _821=document.getElementById("formWarpRequest"+this.getId());
- if(_821){
- var _822=_821.elements;
- for(var _823=0;_823<_822.length;_823++){
- var _824=_822[_823];
- if(!_824.name||!_824.name.match(/^p_/)){
- continue;
- }
- var _825=true;
- for(var _826=0;_826<_81c.length;_826++){
- if(_81c[_826]==_824){
- _825=false;
- break;
- }
- }
- if(_825){
- oReq.addFormField(_824.name,_824.value);
- _81c.push(_824);
- }
- }
- }
- var oRM=this["CognosReport"];
- if(oRM){
- var _828=oRM.prompt.getParameters();
- for(var i=0;i<_828.length;i++){
- var _82a="p_"+_828[i].getName();
- if(!oReq.getFormField(_82a)){
- oReq.addFormField(_82a,_828[i].getXML());
- }
- }
- }
- return oReq;
- };
- CCognosViewer.prototype.setViewerWidget=function(_82b){
- this.m_viewerWidget=_82b;
- };
- CCognosViewer.prototype.getViewerWidget=function(){
- return this.m_viewerWidget;
- };
- CCognosViewer.prototype.getFlashChartOption=function(){
- var _82c=this.getViewerWidget();
- var _82d=null;
- if(_82c){
- var _82e=_82c.getProperties();
- if(_82e){
- _82d=_82e.getFlashCharts();
- }
- }
- return _82d;
- };
- CCognosViewer.prototype.fireWidgetEvent=function(evt,_830){
- var _831=this.getViewerWidget();
- if(_831!=null){
- _831.fireEvent(evt,null,_830);
- }
- };
- CCognosViewer.prototype.isMobile=function(){
- return false;
- };
- CCognosViewer.prototype.setVisibleDialog=function(_832){
- this.m_visibleDialog=_832;
- };
- CCognosViewer.prototype.getVisibleDialog=function(){
- if(typeof this.m_visibleDialog!="undefined"){
- return this.m_visibleDialog;
- }
- return null;
- };
- CCognosViewer.prototype.getContentLocale=function(){
- var _833=document.getElementById("formWarpRequest"+this.getId());
- if(_833&&_833["ui.contentLocale"]&&_833["reRunObj"]&&_833["reRunObj"].value.length>0){
- return _833["ui.contentLocale"].value;
- }
- return null;
- };
- CCognosViewer.prototype.updateLayout=function(_834){
- var cvid=this.getId();
- var _836=document.getElementById("CVHeader"+cvid);
- var _837=document.getElementById("CVToolbar"+cvid);
- if(!_836&&!_837){
- setTimeout(getCognosViewerObjectRefAsString(cvid)+".updateLayout(\""+_834+"\");",100);
- return;
- }
- if(_836){
- var _838=this.getUIConfig()&&!this.getUIConfig().getShowBanner();
- if((_834=="prompting"&&!this.bShowHeaderWithPrompts)||_838){
- _836.parentNode.style.display="none";
- }else{
- _836.parentNode.style.display="";
- }
- }
- if(_837){
- if(_834=="prompting"||this.m_bHideToolbar==true){
- _837.parentNode.style.display="none";
- }else{
- _837.parentNode.style.display="";
- }
- }
- };
- CCognosViewer.prototype.updateResponseSpecification=function(_839){
- this.sResponseSpecification=_839;
- };
- CCognosViewer.prototype.getResponseSpecification=function(){
- return this.sResponseSpecification;
- };
- CCognosViewer.prototype.release=function(_83a){
- if(this.getStatus()!="fault"){
- this._release(_83a);
- }
- };
- CCognosViewer.prototype._release=function(_83b){
- var form=document.getElementById("formWarpRequest"+this.getId());
- var _83d=this.getTracking();
- if(!_83d&&form&&form["m_tracking"]&&form["m_tracking"].value){
- _83d=form["m_tracking"].value;
- form["m_tracking"].value="";
- }
- this.setTracking("");
- if(_83d){
- var _83e=new DispatcherEntry(this);
- if(this.isWorkingOrPrompting()){
- _83e.addFormField("ui.action","cancel");
- }else{
- _83e.addFormField("ui.action","release");
- }
- _83e.addFormField("cv.responseFormat","successfulRequest");
- _83e.addNonEmptyStringFormField("ui.primaryAction",this.envParams["ui.primaryAction"]);
- _83e.addNonEmptyStringFormField("ui.objectClass",this.envParams["ui.objectClass"]);
- _83e.addFormField("m_tracking",_83d);
- if(_83b!=true){
- _83e.forceSynchronous();
- }
- var _83f=this.getActiveRequest()?this.getActiveRequest():this.getFaultDispatcherEntry();
- if(_83f&&_83f.getFormField("cv.outputKey")){
- _83e.addFormField("b_action","cvx.high");
- _83e.addFormField("cv.outputKey",_83f.getFormField("cv.outputKey"));
- _83e.addFormField("cv.waitForResponse","false");
- _83e.setHeaders(_83f.getHeaders());
- }
- var _840=_83e.getRequest().getFormFields();
- var _841=_840.keys();
- var data=new URLSearchParams();
- for(var _843=0;_843<_841.length;_843++){
- data.append(_841[_843],_840.get(_841[_843]));
- }
- if(!navigator.sendBeacon(this.getGateway(),data)){
- if(typeof console!=="undefined"&&console.log){
- console.log("CCognosViewer: release sendBeacon failed.");
- }
- }
- return true;
- }
- return false;
- };
- CCognosViewer.prototype.cleanupStyles=function(){
- if(this.getViewerWidget()){
- this.getViewerWidget().cleanupStyles();
- }
- };
- CCognosViewer.prototype.destroy=function(_844){
- this.release(_844);
- if(!this.m_destroyed){
- if(typeof window.gaRV_INSTANCES!="undefined"){
- for(var _845=0;_845<window.gaRV_INSTANCES.length;_845++){
- if(window.gaRV_INSTANCES[_845].m_sId==this.getId()){
- window.gaRV_INSTANCES.splice(_845,1);
- this.m_destroyed=true;
- break;
- }
- }
- }
- if(this.m_layoutElements){
- for(var i=0;i<this.m_layoutElements.length;i++){
- var e=this.m_layoutElements[i];
- var j=e.getAttribute("lid");
- this.m_layoutElements.splice(i,1);
- delete this.m_lidToElement[j];
- var _849=e.parentNode;
- if(_849){
- _849.removeChild(e);
- }
- }
- delete this.m_layoutElements;
- delete this.m_lidToElement;
- }
- if(this.m_oDrillMgr){
- this.m_oDrillMgr.setCV(null);
- }
- var _84a=this.getSelectionController();
- if(_84a){
- GUtil.destroyProperties(_84a);
- }
- var cvId=this.getId();
- this.m_viewerDispatcher=null;
- GUtil.destroyProperties(this,true);
- cleanupGlobalObjects(cvId);
- }
- };
- CCognosViewer.prototype.exit=function(){
- this.release();
- };
- CCognosViewer.prototype.executeAction=function(_84c,_84d){
- var _84e=this.getAction(_84c);
- _84e.setRequestParms(_84d);
- return _84e.execute();
- };
- CCognosViewer.prototype.getCalculation=function(_84f){
- var calc=null;
- var _851=this.getCalculationCache();
- if(_851[_84f]){
- calc=_851[_84f];
- }else{
- if(window[_84f]&&typeof window[_84f]=="function"){
- calc=new window[_84f]();
- calc.setCognosViewer(this);
- }
- _851[_84f]=calc;
- }
- return calc;
- };
- CCognosViewer.prototype.findBlueDotMenu=function(_852){
- var root=null;
- var _854=(_852)?_852:this.getToolbar();
- for(var idx=0;idx<_854.length;++idx){
- if(typeof _854[idx]._root!="undefined"){
- root=_854[idx]._root;
- break;
- }
- }
- return root;
- };
- CCognosViewer.prototype.findToolbarItem=function(_856,_857){
- var spec=typeof _857=="undefined"||_857==null?this.getToolbar():_857;
- var _859=null;
- for(var _85a=0;_85a<spec.length;++_85a){
- var name=spec[_85a]["name"];
- if(typeof name!="undefined"&&name==_856){
- _859=spec[_85a];
- break;
- }
- }
- return _859;
- };
- CCognosViewer.prototype.findToolbarItemIndex=function(_85c,_85d){
- var spec=typeof _85d=="undefined"||_85d==null?this.getToolbar():_85d;
- var _85f=null;
- for(var _860=0;_860<spec.length;++_860){
- var name=spec[_860]["name"];
- if(typeof name!="undefined"&&name==_85c){
- _85f=_860;
- break;
- }
- }
- return _85f;
- };
- CCognosViewer.prototype.addedButtonToToolbar=function(_862,_863,_864,_865){
- if(typeof _863!="undefined"&&_863!=null){
- if(this.findToolbarItem(_863.name,_862)==null){
- _864=this.findToolbarItemIndex(_864,_862);
- if(typeof _864!="undefined"&&_864!=null){
- _862.splice(++_864,0,_863);
- return true;
- }else{
- if(typeof _865!="undefined"&&_865!=null){
- _862.splice(_865,0,_863);
- return true;
- }
- }
- }
- }
- return false;
- };
- CCognosViewer.prototype.addDrillTargets=function(_866){
- this.m_drillTargets=_866;
- };
- CCognosViewer.prototype.getDrillTargets=function(){
- if(this.m_drillTargets.length==0&&this.envParams["ui.action"]=="view"){
- var _867=document.getElementById("CVIFrame"+this.getId());
- if(typeof _867!="undefined"&&_867!=null){
- if(_867.contentWindow.drillTargets){
- return _867.contentWindow.drillTargets;
- }
- }
- }
- return this.m_drillTargets;
- };
- CCognosViewer.prototype.getDrillTarget=function(idx){
- if(idx>=this.m_drillTargets.length){
- return null;
- }
- return this.m_drillTargets[idx];
- };
- CCognosViewer.prototype.getNumberOfDrillTargets=function(){
- return this.m_drillTargets.length;
- };
- CCognosViewer.prototype.isReportRenderingDone=function(){
- return this.m_reportRenderingDone;
- };
- CCognosViewer.prototype.setReportRenderingDone=function(flag){
- this.m_reportRenderingDone=flag;
- };
- CCognosViewer.prototype.hasAVSChart=function(){
- var _86a=this.getRAPReportInfo();
- if(_86a){
- var _86b=_86a.getDisplayTypes();
- return _86b.match("_v2")!=null||_86b.match("v2_")!=null;
- }
- return false;
- };
- CCognosViewer.prototype.getPinFreezeManager=function(){
- return this.m_pinFreezeManager;
- };
- CCognosViewer.prototype.getReportContextHelper=function(){
- if(!this.m_reportContextHelper){
- this.m_reportContextHelper=new ReportContextHelper(this.getSelectionController().getCCDManager());
- }
- return this.m_reportContextHelper;
- };
- CCognosViewer.prototype.getRAPReportInfo=function(){
- return this.m_RAPReportInfo;
- };
- CCognosViewer.prototype.setRAPReportInfo=function(_86c){
- this.m_RAPReportInfo=_86c;
- };
- CCognosViewer.prototype.isNodeVisible=function(node){
- if(this.m_pinFreezeManager){
- return this.m_pinFreezeManager.isNodeVisible(node);
- }
- return true;
- };
- CCognosViewer.prototype.getWarpRequestForm=function(){
- return document.getElementById("formWarpRequest"+this.getId());
- };
- CCognosViewer.prototype.getBrowser=function(){
- return this.sBrowser;
- };
- CCognosViewer.prototype.repaintDiv=function(oDiv){
- var _86f=oDiv.style.display;
- oDiv.style.display="none";
- oDiv.style.display=_86f;
- };
- CCognosViewer.prototype.isMetadataEmpty=function(){
- var oSC=this.getSelectionController();
- if(oSC){
- var _871=oSC.getCCDManager();
- if(_871){
- return _871.isMetadataEmpty();
- }
- }
- return true;
- };
- CCognosViewer.prototype.setContextMenu=function(_872){
- this.m_contextMenu=_872;
- };
- CCognosViewer.prototype.getContextMenu=function(){
- return this.m_contextMenu;
- };
- CCognosViewer.prototype.setToolbar=function(_873){
- this.m_toolbar=_873;
- };
- CCognosViewer.prototype.getToolbar=function(){
- return this.m_toolbar;
- };
- CCognosViewer.prototype.getAdvancedServerProperty=function(_874){
- if(this.m_advancedProperties&&this.m_advancedProperties[_874]!==undefined&&this.m_advancedProperties[_874]!==null){
- return this.m_advancedProperties[_874];
- }else{
- return null;
- }
- };
- CCognosViewer.prototype.hasPrompt=function(){
- if(typeof this.m_bHasPrompt==="undefined"||this.m_bHasPrompt===null){
- var _875=false;
- if(this.getAdvancedServerProperty("VIEWER_JS_PROMPT_AGAIN_SHOW_ALWAYS")==="true"||(this.envParams.reportPrompts&&this.envParams.reportPrompts.length>0)){
- _875=true;
- }else{
- var _876=new CParameterValues();
- var _877=XMLBuilderLoadXMLFromString(this.getExecutionParameters());
- if(_877.childNodes.length==1){
- _876.loadWithOptions(_877.childNodes[0],true);
- var _878=_876.length();
- for(var _879=0;_879<_878;++_879){
- var _87a=_876.getAt(_879);
- if(_87a!==null&&_87a.length()>0&&_87a.name().indexOf("credential:")!=-1){
- _875=true;
- break;
- }
- }
- }
- }
- this.m_bHasPrompt=_875;
- }
- return this.m_bHasPrompt;
- };
- CCognosViewer.prototype.getDrillState=function(){
- return this.m_sStateData?this.m_sStateData:"";
- };
- CCognosViewer.prototype.isSelectionFilterEnabled=function(){
- if(typeof this.m_bSelectionFilterSwitch=="undefined"){
- this.m_bSelectionFilterSwitch=false;
- }
- return this.m_bSelectionFilterSwitch;
- };
- CCognosViewer.prototype.broadcastContextChange=function(evt,_87c){
- if(this.getViewerWidget()){
- this.getViewerWidget().broadcastContextChange(_87c);
- }
- stopEventBubble(evt);
- };
- CCognosViewer.prototype.broadcastParameterChange=function(evt,_87e){
- if(this.getViewerWidget()){
- this.getViewerWidget().broadcastParameterChange(_87e);
- }
- stopEventBubble(evt);
- };
- CCognosViewer.prototype.getReportDiv=function(){
- if(!this.m_nReportDiv){
- this.m_nReportDiv=document.getElementById("CVReport"+this.m_sId);
- }
- return this.m_nReportDiv;
- };
- function CDocumentWriter(sId,_880){
- this.m_sId=sId;
- this.m_sText="";
- this.m_sScript=_880;
- };
- CDocumentWriter.prototype.isValid=function(){
- if(typeof this.m_sScript!="undefined"&&this.m_sScript&&window.gScriptLoader){
- return true;
- }
- return false;
- };
- CDocumentWriter.prototype.execute=function(){
- if(this.isValid()&&window.gScriptLoader){
- var _881=/document\.write(ln)?\s*\(/gi;
- var _882=this.m_sScript.replace(_881,"this.write(").replace(window.gScriptLoader.m_reScriptTagOpen,"").replace(window.gScriptLoader.m_reScriptTagClose,"");
- try{
- eval(_882);
- var _883=document.getElementById(this.m_sId);
- if(_883){
- _883.innerHTML=this.m_sText;
- return true;
- }
- }
- catch(e){
- }
- }
- return false;
- };
- CDocumentWriter.prototype.write=function(_884){
- var _885="";
- if(typeof _884=="function"){
- _885=eval(_884);
- }else{
- if(typeof _884=="string"){
- _885=_884;
- }
- }
- this.m_sText+=_885;
- };
- function setFocusToFirstTabItem(_886){
- if(!window.dojo){
- return;
- }
- var _887=dojo.query("*",_886);
- var _888=_887.length;
- for(var i=0;i<_888;i++){
- var node=_887[i];
- if(!node.style||(node.style.display!="none"&&node.style.visibility!="hidden")){
- if(node.getAttribute("tabIndex")==0){
- try{
- node.focus();
- }
- catch(e){
- }
- break;
- }
- }
- }
- };
- function ReportContextHelper(_88b){
- this.m_oCDManager=_88b;
- };
- ReportContextHelper.prototype.destroy=function(){
- if(this.m_oCDManager&&this.m_oCDManager.destroy){
- this.m_oCDManager.destroy();
- }
- delete this.m_oCDManager;
- };
- ReportContextHelper.prototype.processCtx=function(sCtx){
- var _88d=sCtx.split("::");
- var _88e=[];
- for(var i=0;i<_88d.length;++i){
- _88e[i]=_88d[i].split(":");
- }
- if(_88e&&_88e.length&&_88e[0].length){
- return _88e;
- }else{
- return null;
- }
- };
- ReportContextHelper.prototype.getDataItemName=function(sCtx){
- var _891=this.processCtx(sCtx);
- if(_891){
- return this.getRefDataItem(_891[0][0]);
- }
- return null;
- };
- ReportContextHelper.prototype.getRefDataItem=function(_892){
- var _893=this.m_oCDManager.GetRDIValue(_892);
- return (_893==null)?"":_893;
- };
- ReportContextHelper.prototype.getMun=function(_894){
- var aCtx=null;
- if(typeof _894==="string"){
- aCtx=this.processCtx(_894);
- }else{
- if(typeof _894==="number"){
- aCtx=this.processCtx(_894.toString());
- }else{
- aCtx=_894;
- }
- }
- if(aCtx){
- var sMun=this.m_oCDManager.GetMUN(aCtx[0][0]);
- return (sMun==null)?"":sMun;
- }
- return "";
- };
- function ViewerConfig(){
- this.uiConfig=new ViewerUIConfig();
- this.findConfig=typeof ViewerFindActionConfig=="function"?new ViewerFindActionConfig():null;
- this.httpRequestConfig=typeof ViewerHttpRequestConfig=="function"?new ViewerHttpRequestConfig():null;
- this.eventsConfig=typeof ViewerEventsConfig=="function"?new ViewerEventsConfig():null;
- };
- ViewerConfig.prototype.configure=function(_897){
- if(!_897){
- return;
- }
- if(_897.findAction&&this.findConfig){
- this.findConfig.configure(_897.findAction);
- }
- if(_897.UI){
- this.uiConfig.configure(_897.UI);
- }
- if(_897.httpRequestCallbacks&&this.httpRequestConfig){
- this.httpRequestConfig.configure(_897.httpRequestCallbacks);
- }
- if(_897.events&&this.eventsConfig){
- this.eventsConfig.configure(_897.events);
- }
- };
- ViewerConfig.prototype.getUIConfig=function(){
- return this.uiConfig;
- };
- ViewerConfig.prototype.getFindActionConfig=function(){
- return this.findConfig;
- };
- ViewerConfig.prototype.getHttpRequestConfig=function(){
- return this.httpRequestConfig;
- };
- ViewerConfig.prototype.getEventsConfig=function(){
- return this.eventsConfig;
- };
- function ViewerUIConfig(){
- this.showBanner=true;
- this.showToolbar=true;
- this.showContextMenu=true;
- this.showPageNavigation=true;
- this.primarySelectionColor=null;
- this.secondarySelectionColor=null;
- this.showSecondarySelection=true;
- };
- ViewerUIConfig.prototype.configure=function(_898){
- applyJSONProperties(this,_898);
- };
- ViewerUIConfig.prototype.getShowBanner=function(){
- return this.showBanner;
- };
- ViewerUIConfig.prototype.getShowToolbar=function(){
- return this.showToolbar;
- };
- ViewerUIConfig.prototype.getShowContextMenu=function(){
- return this.showContextMenu;
- };
- ViewerUIConfig.prototype.getShowPageNavigation=function(){
- return this.showPageNavigation;
- };
- ViewerUIConfig.prototype.getPrimarySelectionColor=function(){
- return this.primarySelectionColor;
- };
- ViewerUIConfig.prototype.getSeondarySelectionColor=function(){
- return this.secondarySelectionColor;
- };
- ViewerUIConfig.prototype.getShowSecondarySelection=function(){
- return this.showSecondarySelection;
- };
- function ViewerHttpRequestConfig(){
- this.reportStatus={};
- this.UI={};
- };
- ViewerHttpRequestConfig.prototype.configure=function(_899){
- applyJSONProperties(this,_899);
- };
- ViewerHttpRequestConfig.prototype.getRequestIndicator=function(){
- if(this.UI){
- return this.UI.requestIndicator?this.UI.requestIndicator:null;
- }
- };
- ViewerHttpRequestConfig.prototype.getWorkingDialog=function(){
- if(this.UI){
- return this.UI.workingDialog?this.UI.workingDialog:null;
- }
- };
- ViewerHttpRequestConfig.prototype.getReportStatusCallback=function(_89a){
- if(this.reportStatus){
- var _89b=this.reportStatus[_89a];
- if(_89b){
- return _89b;
- }
- if(_89a=="complete"&&this.reportStatus["initialComplete"]){
- var _89c=this.reportStatus["initialComplete"];
- this.reportStatus["initialComplete"]=null;
- return _89c;
- }
- }
- return null;
- };
- function ViewerState(){
- this.findState=null;
- this.pageState=null;
- };
- ViewerState.prototype.setFindState=function(_89d){
- if(typeof ViewerFindState!="function"){
- return;
- }
- if(!this.findState){
- this.findState=new ViewerFindState();
- }
- this.findState.setState(_89d);
- };
- ViewerState.prototype.clearFindState=function(){
- this.findState=null;
- };
- ViewerState.prototype.getFindState=function(){
- return this.findState;
- };
- ViewerState.prototype.setPageState=function(_89e){
- if(typeof ViewerPageState!="function"){
- return;
- }
- if(!this.pageState){
- this.pageState=new ViewerPageState();
- }
- this.pageState.setState(_89e);
- };
- ViewerState.prototype.clearPageState=function(){
- this.pageState=null;
- };
- ViewerState.prototype.getPageState=function(){
- return this.pageState;
- };
- function ViewerEventsConfig(){
- this.showContextMenuOnClick=false;
- };
- ViewerEventsConfig.prototype.configure=function(_89f){
- applyJSONProperties(this,_89f);
- };
- ViewerEventsConfig.prototype.getShowContextMenuOnClick=function(){
- return this.showContextMenuOnClick;
- };
- CCognosViewer.prototype.loadExtra=function(){
- var _8a0=this.getViewerWidget();
- if(_8a0){
- _8a0.loadExtraJavascriptFiles(this.getWebContentRoot());
- }
- };
- function CCognosViewerToolbarHelper(){
- };
- CCognosViewerToolbarHelper.updateToolbarForCurrentSelection=function(oCV,_8a2){
- if(_8a2){
- var _8a3=oCV.getActionFactory();
- for(var _8a4=0;_8a4<_8a2.length;++_8a4){
- var name=_8a2[_8a4]["name"];
- if(typeof name!="undefined"&&name!=null){
- var _8a6=_8a3.load(name);
- if(_8a6!=null&&typeof _8a6!="undefined"){
- var _8a7=_8a6.updateMenu(_8a2[_8a4]);
- if(_8a7.visible==false){
- if(_8a7.save){
- oCV.getViewerWidget().addButtonToSavedToolbarButtons(name,_8a2[_8a4],_8a4);
- }
- _8a2.splice(_8a4,1);
- --_8a4;
- }else{
- _8a2[_8a4]=_8a7;
- }
- }
- }else{
- if(typeof _8a2[_8a4]._root!="undefined"){
- CCognosViewerToolbarHelper.updateToolbarForCurrentSelection(oCV,_8a2[_8a4]._root);
- }else{
- if(_8a2[_8a4].separator){
- if(_8a4==0||(_8a4>0&&_8a2[_8a4-1].separator)||_8a4==_8a2.length){
- _8a2.splice(_8a4,1);
- --_8a4;
- }
- }
- }
- }
- }
- }
- };
- CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection=function(oCV,_8a9){
- var _8aa=[];
- if(_8a9){
- var _8ab=oCV.getActionFactory();
- for(var _8ac=0;_8ac<_8a9.length;++_8ac){
- var _8ad=_8a9[_8ac];
- var name=_8a9[_8ac]["name"];
- var _8af=true;
- if(typeof name!="undefined"){
- var _8b0=_8ab.load(name);
- if(!_8b0){
- if(name=="drillDown"){
- _8b0=_8ab.load("DrillDown");
- }else{
- if(name=="drillUp"){
- _8b0=_8ab.load("DrillUp");
- }
- }
- }
- if(_8b0!=null&&typeof _8b0!="undefined"){
- if(typeof _8b0.buildMenu=="function"){
- _8ad=_8b0.buildMenu(_8a9[_8ac]);
- }else{
- _8ad=_8b0.updateMenu(_8a9[_8ac]);
- }
- _8af=_8b0.isValidMenuItem();
- }else{
- if(typeof _8ad.items!="undefined"){
- _8ad.items=CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(oCV,_8ad.items);
- _8af=(_8ad.items&&_8ad.items.length>0)?true:false;
- if(_8af&&_8ad.items.length==1){
- _8ad=_8ad.items[0];
- }
- }
- }
- }
- if(_8ad&&_8ad.visible!==false&&_8af){
- if(_8ad.separator===true){
- if(_8aa.length>0&&typeof _8aa[_8aa.length-1].separator=="undefined"){
- _8aa[_8aa.length]=_8ad;
- }
- }else{
- if(_8ad.useChildrenItems==true&&_8ad.items&&_8ad.items.length>0){
- if(!_8ad.disabled){
- for(var _8b1=0;_8b1<_8ad.items.length;_8b1++){
- _8aa[_8aa.length]=_8ad.items[_8b1];
- }
- }
- }else{
- if(typeof _8ad._root!="undefined"){
- _8aa[_8aa.length]={"_root":CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(oCV,_8ad._root)};
- }else{
- _8aa[_8aa.length]=_8ad;
- }
- }
- }
- }
- }
- if(_8aa.length>1){
- if(_8aa[_8aa.length-1].separator){
- _8aa=_8aa.splice(0,_8aa.length-1);
- }
- }
- }
- return _8aa;
- };
- function CCDManager(cv){
- this.m_cd=null;
- this.m_md=null;
- this.m_oCV=null;
- this.m_dataItemInfo=null;
- };
- CCDManager.prototype.SetContextData=function(CD){
- if(this.m_cd){
- this.m_cd=null;
- }
- this.m_cd=CD;
- };
- CCDManager.prototype.SetMetadata=function(MD){
- if(this.m_md){
- this.m_md=null;
- }
- this.m_md=MD;
- };
- CCDManager.prototype.AddContextData=function(CD){
- if(!this.m_cd){
- this.m_cd=CD;
- }else{
- for(var i in CD){
- this.m_cd[i]=CD[i];
- }
- }
- };
- CCDManager.prototype.AddMetadata=function(MD){
- if(!this.m_md){
- this.m_md=MD;
- }else{
- for(var j in MD){
- this.m_md[j]=MD[j];
- }
- }
- };
- CCDManager.prototype.getClonedMetadataArray=function(){
- var _8b9={};
- applyJSONProperties(_8b9,this.m_md);
- return _8b9;
- };
- CCDManager.prototype.getClonedContextdataArray=function(){
- var _8ba={};
- applyJSONProperties(_8ba,this.m_cd);
- return _8ba;
- };
- CCDManager.prototype.SetCognosViewer=function(_8bb){
- if(_8bb){
- this.m_oCV=_8bb;
- }
- };
- CCDManager.prototype.onComplete_GetCDRequest=function(_8bc,_8bd){
- if(_8bc){
- var _8be=_8bc.getResult();
- var _8bf=XMLBuilderLoadXMLFromString(_8be);
- if(_8bf){
- var _8c0=_8bf.getElementsByTagName("Block");
- for(var i=0;i<_8c0.length;i++){
- var _8c2="";
- var _8c3=_8c0[i].firstChild;
- while(_8c3){
- _8c2+=_8c3.nodeValue;
- _8c3=_8c3.nextSibling;
- }
- var cd=eval("("+_8c2+")");
- this.AddContextData(cd);
- }
- }
- }
- if(_8bd&&typeof _8bd=="function"){
- _8bd();
- }
- };
- CCDManager.prototype.FetchContextData=function(_8c5,_8c6){
- var _8c7=[];
- var c=null,_8c9=_8c5.length;
- for(var i=0;i<_8c9;++i){
- c=_8c5[i];
- if(c!=""&&!this.ContextIdExists(c)){
- _8c7.push(c);
- }
- }
- if(_8c7.length){
- if(this.m_oCV){
- this.getContextData(_8c7,_8c6);
- }
- }
- return _8c7.length;
- };
- CCDManager.prototype.getContextData=function(_8cb,_8cc){
- var oCV=this.m_oCV;
- var _8ce=new AsynchDataDispatcherEntry(oCV);
- _8ce.setCanBeQueued(false);
- if(!oCV.isBux){
- _8ce.forceSynchronous();
- }
- var form=document["formWarpRequest"+oCV.getId()];
- var _8d0=oCV.getConversation();
- var _8d1=oCV.getTracking();
- if(!_8d1&&form&&form["m_tracking"]&&form["m_tracking"].value){
- _8d1=form["m_tracking"].value;
- }
- if(oCV.m_viewerFragment){
- var _8d2=oCV.getActiveRequest();
- if(_8d2&&_8d2.getFormField("m_tracking")==_8d1){
- return;
- }
- }
- var _8d3={customArguments:[_8cc],"complete":{"object":this,"method":this.onComplete_GetCDRequest}};
- if(oCV.getStatus()=="prompting"){
- _8d3["prompting"]={"object":this,"method":this.onComplete_GetCDRequest};
- }
- _8ce.setCallbacks(_8d3);
- if(_8d0&&oCV.envParams["ui.action"]!="view"){
- _8ce.addFormField("ui.action","getContext");
- _8ce.addFormField("ui.conversation",_8d0);
- }else{
- var _8d4=form["ui.object"];
- if(typeof _8d4.length!="undefined"&&_8d4.length>1){
- _8ce.addFormField("ui.object",form["ui.object"][0].value);
- }else{
- _8ce.addFormField("ui.object",form["ui.object"].value);
- }
- _8ce.addFormField("ui.action","getObjectContext");
- }
- _8ce.addFormField("cv.responseFormat","asynchDetailContext");
- _8ce.addFormField("context.format","initializer");
- _8ce.addFormField("context.type","reportService");
- _8ce.addFormField("context.selection",_8cb.join(","));
- _8ce.addNonEmptyStringFormField("m_tracking",_8d1);
- oCV.dispatchRequest(_8ce);
- };
- CCDManager.prototype.ContextIdExists=function(_8d5){
- return (this.m_cd&&this.m_cd[_8d5]?true:false);
- };
- CCDManager.prototype.HasContextData=function(){
- return (this.m_cd?true:false);
- };
- CCDManager.prototype.HasMetadata=function(){
- return (this.m_md?true:false);
- };
- CCDManager.prototype._getMDPropertyFromCD=function(_8d6,_8d7,_8d8){
- var p=null;
- this.FetchContextData([_8d6]);
- var cd=this.m_cd&&this.m_cd[_8d6];
- if(cd){
- var md=this.m_md[cd[_8d7]];
- if(md){
- p=md[_8d8];
- }
- }
- return p;
- };
- CCDManager.prototype.GetDrillFlag=function(_8dc){
- return this._getMDPropertyFromCD(_8dc,"r","drill");
- };
- CCDManager.prototype.getModelPathFromBookletItem=function(_8dd){
- var mp=null;
- var md=this.m_md[_8dd];
- if(md){
- mp=md.mp;
- if(mp&&this.m_md[mp]){
- mp=this.m_md[mp].mp;
- }
- }
- return mp?mp:null;
- };
- CCDManager.prototype.GetBookletModelBasedDrillThru=function(_8e0){
- var p=null;
- var md=this.m_md[_8e0];
- if(md){
- p=md.modelBasedDrillThru;
- }
- return p?p:0;
- };
- CCDManager.prototype.GetDrillFlagForMember=function(_8e3){
- var _8e4=null;
- var d=this._getMDPropertyFromCD(_8e3,"r","drill");
- if(d!==null&&this.m_cd[_8e3].m){
- _8e4=d;
- }
- return _8e4;
- };
- CCDManager.prototype.GetDataType=function(_8e6){
- return this._getMDPropertyFromCD(_8e6,"r","dtype");
- };
- CCDManager.prototype.GetUsage=function(_8e7){
- return this._getMDPropertyFromCD(_8e7,"r","usage");
- };
- CCDManager.prototype.GetHUN=function(_8e8){
- var hun=this._getMDPropertyFromCD(_8e8,"h","h");
- if(!hun){
- var h=this._getMDPropertyFromCD(_8e8,"r","h");
- if(h){
- hun=this.m_md[h].h;
- }
- }
- if(hun!=null&&hun.indexOf("[__ns_")==0){
- hun=null;
- }
- return hun;
- };
- CCDManager.prototype.GetQuery=function(_8eb){
- var qry=null;
- var q=this._getMDPropertyFromCD(_8eb,"r","q");
- if(q){
- qry=this.m_md[q].q;
- }
- return qry;
- };
- CCDManager.prototype.GetDepth=function(_8ee){
- return this._getMDPropertyFromCD(_8ee,"r","level");
- };
- CCDManager.prototype.GetDisplayValue=function(_8ef){
- var _8f0=null;
- this.FetchContextData([_8ef]);
- if(this.ContextIdExists(_8ef)&&this.m_cd[_8ef]){
- _8f0=this.m_cd[_8ef].u;
- }
- return _8f0;
- };
- CCDManager.prototype.GetPUN=function(_8f1){
- return this._getMDPropertyFromCD(_8f1,"p","p");
- };
- CCDManager.prototype.GetLUN=function(_8f2){
- return this._getMDPropertyFromCD(_8f2,"l","l");
- };
- CCDManager.prototype.GetMUN=function(_8f3){
- return this._getMDPropertyFromCD(_8f3,"m","m");
- };
- CCDManager.prototype.GetDUN=function(_8f4){
- return this._getMDPropertyFromCD(_8f4,"d","d");
- };
- CCDManager.prototype.GetQMID=function(_8f5){
- return this._getMDPropertyFromCD(_8f5,"i","i");
- };
- CCDManager.prototype.GetRDIValue=function(_8f6){
- return this._getMDPropertyFromCD(_8f6,"r","r");
- };
- CCDManager.prototype.GetBIValue=function(_8f7){
- return this._getMDPropertyFromCD(_8f7,"r","bi");
- };
- CCDManager.prototype.getContextIdForMetaData=function(lun,hun,_8fa){
- var _8fb=[{"expression":lun,"type":"l"},{"expression":hun,"type":"h"}];
- for(var _8fc=0;_8fc<_8fb.length;++_8fc){
- var _8fd=_8fb[_8fc].expression;
- var _8fe=_8fb[_8fc].type;
- if(_8fd==""){
- continue;
- }
- for(var _8ff in this.m_md){
- if(this.m_md[_8ff][_8fe]==_8fd){
- for(var _900 in this.m_md){
- if(this.m_md[_900].r&&this.m_md[_900][_8fe]==_8ff){
- if(this.m_md[_900].drill!=0||_8fa==true){
- for(var ctx in this.m_cd){
- if(this.m_cd[ctx].r==_900&&this.m_cd[ctx].m){
- return ctx;
- }
- }
- }
- }
- }
- }
- }
- }
- return "";
- };
- CCDManager.prototype.GetContextIdForMUN=function(mun){
- var _903=null;
- var _904=null;
- for(var i in this.m_md){
- if(this.m_md[i].m==mun){
- _903=i;
- break;
- }
- }
- if(_903!=null){
- for(var j in this.m_cd){
- if(this.m_cd[j].m==_903){
- _904=j;
- break;
- }
- }
- }
- return _904;
- };
- CCDManager.prototype.GetContextIdsForRDI=function(rdi){
- var _908=[];
- for(var i in this.m_md){
- if(this.m_md[i].r==rdi){
- _908.push(i);
- }
- }
- return _908;
- };
- CCDManager.prototype.getMUNForRDIAndUseValue=function(rdi,_90b){
- var _90c=this.GetContextIdsForRDI(rdi);
- for(var i in this.m_cd){
- for(var j in _90c){
- if(this.m_cd[i].r==_90c[j]&&this.m_cd[i].u==_90b){
- var _90f=this.m_cd[i].m;
- if(_90f){
- return this.m_md[_90f].m;
- }
- }
- }
- }
- return null;
- };
- CCDManager.prototype.GetPageMinMaxForRDI=function(rdi){
- var _911=null;
- var _912=null;
- var _913=this.GetContextIdsForRDI(rdi);
- this.FetchContextData([0]);
- for(var i in this.m_cd){
- for(var j in _913){
- if(this.m_cd[i].r==_913[j]){
- var _916=parseFloat(this.m_cd[i].u);
- if(_916==this.m_cd[i].u){
- if(_911==null||_916<_911){
- _911=_916;
- }
- if(_912==null||_916>_912){
- _912=_916;
- }
- }
- }
- }
- }
- if(_911!=null&&_912!=null){
- return eval("({ pageMin: "+_911+", pageMax: "+_912+"})");
- }
- };
- CCDManager.prototype.GetContextIdForDisplayValue=function(_917){
- var _918=null;
- for(var i in this.m_cd){
- if(this.m_cd[i].u==_917){
- _918=i;
- break;
- }
- }
- return _918;
- };
- CCDManager.prototype.GetContextIdForUseValue=function(_91a){
- var _91b=null;
- var _91c=null;
- var _91d=null;
- for(var i in this.m_md){
- var md=this.m_md[i];
- for(var j in md){
- if(md[j]==_91a){
- _91b=i;
- _91c=j;
- break;
- }
- }
- }
- if(_91b!=null){
- for(var k in this.m_cd){
- if(this.m_cd[k][_91c]==_91b){
- _91d=k;
- break;
- }
- }
- }
- return _91d;
- };
- CCDManager.prototype.getDataItemInfo=function(){
- if(this.m_cd){
- var _922={};
- this.m_dataItemInfo={};
- for(var i in this.m_cd){
- var _924=this.m_cd[i].r;
- if(typeof _924!="undefined"){
- var _925=this.m_md[_924].r;
- if(this.m_dataItemInfo[_925]==null){
- this.m_dataItemInfo[_925]=1;
- }else{
- this.m_dataItemInfo[_925]++;
- }
- }
- }
- return CViewerCommon.toJSON(this.m_dataItemInfo);
- }
- return "";
- };
- CCDManager.prototype.DataItemInfoToJSON=function(){
- return this.getDataItemInfo();
- };
- CCDManager.prototype.MetadataToJSON=function(){
- if(this.m_md){
- return CViewerCommon.toJSON(this.m_md);
- }
- return "";
- };
- CCDManager.prototype.ContextDataToJSON=function(){
- if(this.m_cd){
- return CViewerCommon.toJSON(this.m_cd);
- }
- return "";
- };
- CCDManager.prototype.ContextDataSubsetToJSON=function(_926){
- if(_926<=0){
- return this.ContextDataToJSON();
- }
- if(this.m_cd){
- var _927={};
- var _928={};
- for(var i in this.m_cd){
- var _92a=this.m_cd[i].r;
- if(typeof _92a!="undefined"){
- if(_927[_92a]==null){
- _927[_92a]=0;
- }else{
- _927[_92a]++;
- }
- if(_927[_92a]<_926){
- _928[i]=this.m_cd[i];
- }
- }
- }
- return CViewerCommon.toJSON(_928);
- }
- return "";
- };
- CCDManager.prototype.GetHUNForRDI=function(rdi,_92c){
- for(var i in this.m_md){
- if(this.m_md[i].r==rdi&&this.m_md[i].q==_92c){
- var _92e=this.m_md[i].h;
- if(_92e){
- return this.m_md[_92e].h;
- }
- }
- }
- return null;
- };
- CCDManager.prototype.GetMetadataIdForQueryName=function(_92f){
- for(var i in this.m_md){
- if(this.m_md[i].q===_92f){
- return i;
- }
- }
- return null;
- };
- CCDManager.prototype._isEmptyObject=function(obj){
- for(var _932 in obj){
- return false;
- }
- return true;
- };
- CCDManager.prototype.isMetadataEmpty=function(){
- if(this.m_md){
- return this._isEmptyObject(this.m_md);
- }
- return true;
- };
- CCDManager.prototype.GetBestPossibleItemName=function(_933){
- var item=this.m_cd[_933];
- if(!item){
- return null;
- }
- if(item.l&&this.m_md[item.l].l){
- return this._getStringInLastBracket(this.m_md[item.l].l);
- }
- if(item.r&&this.m_md[item.r].r){
- return this._getStringInLastBracket(this.m_md[item.r].r);
- }
- if(item.h&&this.m_md[item.h].h){
- return this._getStringInLastBracket(this.m_md[item.h].h);
- }
- if(item.i&&this.m_md[item.i].i){
- return this._getStringInLastBracket(this.m_md[item.i].i);
- }
- return null;
- };
- CCDManager.prototype.GetBestPossibleDimensionMeasureName=function(_935){
- var item=this.m_cd[_935];
- if(item&&item.m&&this.m_md[item.m]&&this.m_md[item.m].m){
- return this._getStringInLastBracket(this.m_md[item.m].m);
- }
- return null;
- };
- CCDManager.prototype._getStringInLastBracket=function(str){
- if(str&&str.indexOf("].[")>0){
- var _938=str.split("].[");
- var _939=_938[_938.length-1];
- return _939.substring(0,_939.length-1);
- }
- return str;
- };
- CCDManager.prototype._replaceNamespaceForSharedTM1DimensionOnly=function(_93a){
- var _93b=this._getNamespaceAndDimensionFromUniqueName(_93a);
- if(_93b&&this.m_md){
- for(var _93c in this.m_md){
- var sMun=this.m_md[_93c].m;
- if(sMun&&sMun.length>0){
- if(sMun.indexOf("->:[TM].")>0){
- var oObj=this._getNamespaceAndDimensionFromUniqueName(sMun);
- if(oObj.dimension&&oObj.dimension===_93b.dimension&&oObj.namespace!==_93b.namespace){
- var _93f=_93a.indexOf(".");
- return oObj.namespace+_93a.substr(_93f,_93a.length);
- }
- }else{
- var _940=sMun.indexOf("->:[");
- if(_940>0){
- if(sMun.substr(_940+4,4)!=="TM]."){
- return _93a;
- }
- }
- }
- }
- }
- }
- return _93a;
- };
- CCDManager.prototype._getNamespaceAndDimensionFromUniqueName=function(_941){
- if(_941&&_941.length>0&&_941.indexOf("].[")>0){
- var _942=_941.split("].[");
- if(_942.length>1){
- return {"namespace":_942[0]+"]","dimension":"["+_942[1]+"]"};
- }
- }
- return null;
- };
- CCDManager.prototype.destroy=function(){
- delete this.m_cd;
- delete this.m_md;
- delete this.m_oCV;
- delete this.m_dataItemInfo;
- };
- var GUtil={};
- GUtil.createHiddenForm=function(name,_944,_945,_946){
- var form=document.getElementById(name);
- if(form){
- document.body.removeChild(form);
- }
- form=document.createElement("form");
- form.id=name;
- form.name=name;
- form.method=_944;
- form.style.display="none";
- form.action=document.forms["formWarpRequest"+_945].action;
- form.target=_946+(new Date()).getTime();
- document.body.appendChild(form);
- return form;
- };
- GUtil.createFormField=function(el,name,_94a){
- var _94b=document.createElement("input");
- _94b.type="hidden";
- _94b.name=name;
- _94b.value=_94a;
- el.appendChild(_94b);
- };
- GUtil.generateCallback=function(func,_94d,_94e){
- if(func){
- var _94f=_94e||this;
- _94d=(_94d instanceof Array)?_94d:[];
- return (function(_950){
- if(typeof _950!="undefined"&&_94d.length==0){
- _94d.push(_950);
- }
- return func.apply(_94f,_94d);
- });
- }else{
- return (function(){
- });
- }
- };
- GUtil.destroyProperties=function(_951,_952){
- var _953;
- if(_951 instanceof Array){
- for(var i=0;i<_951.length;i++){
- _953=_951[i];
- if(_953 instanceof String){
- _953=null;
- }else{
- if(_953&&_953.destroy&&!_953._beingDestroyed){
- _953.destroy();
- }
- GUtil.destroyProperties(_953);
- }
- }
- }else{
- if(_951 instanceof Object){
- if(_951._beingDestroyed){
- return;
- }
- var obj=_951;
- obj._beingDestroyed=true;
- for(var _956 in obj){
- _953=obj[_956];
- if(_956==="_beingDestroyed"||_956==="m_destroyed"||_956==="_destroyed"||typeof _953=="function"){
- continue;
- }
- if(_953 instanceof Array){
- GUtil.destroyProperties(_953);
- }else{
- if(_953 instanceof Object){
- if(typeof _953.destroy=="function"&&!_953._destroyed&&(_953!==CCognosViewer||_952)){
- _953.destroy();
- }
- }
- }
- delete obj[_956];
- }
- }
- }
- };
- cvLoadDialog=function(_957,_958,_959,_95a,_95b,_95c){
- _95c=((_95c===undefined)?true:_95c);
- var _95d=document.getElementById("formWarpRequest"+_957.getId());
- if(_95d&&_957){
- _957.getWorkingDialog().hide();
- var _95e="";
- var _95f="";
- var _960=null;
- if(_957.isAccessibleMode()){
- _95e="winNAT_"+(new Date()).getTime();
- _95f=_957.getWebContentRoot()+"/"+"rv/blankNewWin.html?cv.id="+this.getCVId();
- }else{
- var _961=document.body;
- _960=new CModal("","",_961,null,null,_95a,_959,true,true,false,true,_957.getWebContentRoot());
- if(typeof _95b=="string"){
- document.getElementById(CMODAL_CONTENT_ID).setAttribute("title",_95b);
- }
- document.getElementById(CMODAL_BACK_IFRAME_ID).setAttribute("title",RV_RES.IDS_JS_MODAL_BACK_IFRAME);
- _95e=CMODAL_CONTENT_ID;
- }
- var _962=document.createElement("FORM");
- _962.method="POST";
- _962.action=_957.getGateway();
- _962.target=_95e;
- _962.style.margin="0px";
- document.body.appendChild(_962);
- for(var _963 in _958){
- _962.appendChild(createHiddenFormField(_963,_958[_963]));
- }
- if(_95c){
- _962.appendChild(createHiddenFormField("cv.id",_957.getId()));
- _962.appendChild(createHiddenFormField("b_action","xts.run"));
- _962.appendChild(createHiddenFormField("ui.action",_95d["ui.action"].value));
- _962.appendChild(createHiddenFormField("ui.object",_95d["ui.object"].value));
- if(typeof _957.rvMainWnd!="undefined"){
- _962.appendChild(createHiddenFormField("run.outputFormat",_957.rvMainWnd.getCurrentFormat()));
- }
- if(typeof _95d["run.outputLocale"]!="undefined"){
- _962.appendChild(createHiddenFormField("run.outputLocale",_95d["run.outputLocale"].value));
- }
- if(typeof _962["backURL"]=="undefined"&&typeof _962["ui.backURL"]=="undefined"&&typeof _95d["ui.backURL"]!="undefined"){
- _962.appendChild(createHiddenFormField("ui.backURL",_95d["ui.backURL"].value));
- }
- if(typeof _957!="undefined"&&typeof _957.getConversation!="undefined"&&typeof _957.getTracking!="undefined"){
- _962.appendChild(createHiddenFormField("ui.conversation",_957.getConversation()));
- _962.appendChild(createHiddenFormField("m_tracking",_957.getTracking()));
- if(_957.envParams["ui.name"]!="undefined"){
- _962.appendChild(createHiddenFormField("ui.name",_957.envParams["ui.name"]));
- }
- }
- }
- var _964=window.onbeforeunload;
- window.onbeforeunload=null;
- if(_957.isAccessibleMode()){
- window.open(_95f,_95e,"rv");
- _962.submit();
- }else{
- _962.submit();
- _960.show();
- }
- window.onbeforeunload=_964;
- document.body.removeChild(_962);
- _957.modalShown=true;
- }
- };
- function createHiddenFormField(name,_966){
- var _967=document.createElement("input");
- _967.setAttribute("type","hidden");
- _967.setAttribute("name",name);
- _967.setAttribute("id",name);
- _967.setAttribute("value",_966);
- return (_967);
- };
- function isAuthenticationFault(_968){
- if(_968!=null){
- var _969=XMLHelper_FindChildByTagName(_968,"CAM",true);
- return (_969!=null&&XMLHelper_FindChildByTagName(_969,"promptInfo",true)!=null);
- }
- };
- function processAuthenticationFault(_96a,_96b){
- if(isAuthenticationFault(_96a)){
- launchLogOnDialog(_96b,_96a);
- return true;
- }
- return false;
- };
- function isObjectEmpty(_96c){
- for(var _96d in _96c){
- if(_96c.hasOwnProperty(_96d)){
- return false;
- }
- }
- return true;
- };
- function launchLogOnDialog(cvID,_96f){
- try{
- var oCV=getCognosViewerObjectRef(cvID);
- var _971={"b_action":"xts.run","m":"portal/close.xts","h_CAM_action":"logonAs"};
- if(_96f!=null){
- var _972=XMLHelper_FindChildrenByTagName(_96f,"namespace",true);
- if(_972!=null){
- for(var _973=0;_973<_972.length;++_973){
- var _974=_972[_973];
- if(_974!=null){
- var _975=XMLHelper_FindChildByTagName(_974,"name",false);
- var _976=XMLHelper_FindChildByTagName(_974,"value",false);
- if(_975!=null&&_976!=null){
- var _977=XMLHelper_GetText(_975);
- var _978=XMLHelper_GetText(_976);
- if(_977!=null&&_977.length>0){
- _971[_977]=_978;
- }
- }
- }
- }
- }
- }
- cvLoadDialog(oCV,_971,540,460,null,false);
- }
- catch(exception){
- }
- };
- function getCVWaitingOnFault(){
- var oCV=null;
- for(var _97a=0;_97a<window.gaRV_INSTANCES.length;_97a++){
- if(window.gaRV_INSTANCES[_97a].getRetryDispatcherEntry()!=null){
- oCV=window.gaRV_INSTANCES[_97a];
- break;
- }
- }
- return oCV;
- };
- function ccModalCallBack(_97b,data){
- var oCV=getCVWaitingOnFault();
- destroyCModal();
- if(typeof HiddenIframeDispatcherEntry=="function"&&HiddenIframeDispatcherEntry.hideIframe){
- var oCV=window.gaRV_INSTANCES[0];
- if(oCV){
- HiddenIframeDispatcherEntry.hideIframe(oCV.getId());
- }
- }
- if(oCV!=null){
- if(typeof _97b!="undefined"&&_97b=="ok"){
- var _97e=oCV.getRetryDispatcherEntry();
- if(_97e){
- _97e.retryRequest();
- }
- if(oCV.getRV()!=null){
- oCV.getRV().updateUserName();
- }
- }else{
- oCV.rvMainWnd.hideOpenMenus();
- }
- }
- };
- function closeErrorPage(){
- var oCV=getCVWaitingOnFault();
- destroyCModal();
- if(oCV!=null){
- oCV.setRetryDispatcherEntry(null);
- oCV.rvMainWnd.hideOpenMenus();
- }
- };
- function getCrossBrowserNode(evt,_981){
- var node=null;
- if(_981&&evt.explicitOriginalTarget){
- node=evt.explicitOriginalTarget;
- }else{
- if(evt.originalTarget){
- node=evt.originalTarget;
- }else{
- if(evt.target){
- node=evt.target;
- }else{
- if(evt.srcElement){
- node=evt.srcElement;
- }
- }
- }
- }
- try{
- if(node&&node.nodeType==3){
- node=node.parentNode;
- }
- }
- catch(ex){
- }
- return node;
- };
- function getNodeFromEvent(evt,_984){
- var node=getCrossBrowserNode(evt,true);
- if(node&&node.getAttribute&&node.getAttribute("name")=="primarySelectionDiv"){
- node=node.parentNode.firstChild;
- }
- if(node&&node.getAttribute&&node.getAttribute("flashChartContainer")=="true"){
- node=node.firstChild;
- }
- if(node&&node.getAttribute&&node.getAttribute("chartContainer")=="true"&&node.childNodes){
- for(var i=0;i<node.childNodes.length;i++){
- if(node.childNodes[i].nodeName.toLowerCase()=="img"){
- node=node.childNodes[i];
- break;
- }
- }
- }else{
- if(!_984&&node&&node.nodeName&&node.nodeName.toLowerCase()=="img"&&node.getAttribute("rsvpChart")!="true"){
- node=node.parentNode;
- }
- }
- return node;
- };
- function getCtxNodeFromEvent(evt){
- try{
- var node=getCrossBrowserNode(evt);
- var _989=node.nodeName.toUpperCase();
- if((_989=="SPAN"||_989=="AREA"||_989=="IMG")&&node.getAttribute("ctx")!=null){
- return node;
- }else{
- if(_989=="SPAN"&&(node.parentNode.getAttribute("ctx")!=null)){
- return node.parentNode;
- }
- }
- }
- catch(exception){
- }
- return null;
- };
- function getDocumentFromEvent(evt){
- var node=getCrossBrowserNode(evt,true);
- var _98c=node.document?node.document:node.ownerDocument;
- return _98c;
- };
- function stopEventBubble(evt){
- evt.returnValue=false;
- evt.cancelBubble=true;
- if(typeof evt.stopPropagation!="undefined"){
- evt.stopPropagation();
- }
- if(typeof evt.preventDefault!="undefined"){
- evt.preventDefault();
- }
- return false;
- };
- function setNodeFocus(evt){
- evt=(evt)?evt:((event)?event:null);
- var _98f=getNodeFromEvent(evt);
- if(_98f&&_98f.nodeName){
- var _990=_98f.nodeName.toLowerCase();
- if((_990=="td"||_990=="span")&&_98f.childNodes&&_98f.childNodes.length>0&&_98f.childNodes[0].className=="textItem"){
- try{
- _98f.childNodes[0].focus();
- }
- catch(e){
- if(typeof console!=="undefined"&&console.log){
- console.log("CCognosViewer: Could not set focus to node. setNodeFocus method common.js");
- }
- }
- }
- }
- };
- function html_encode(str){
- return str.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");
- };
- function replaceNewLine(_992){
- var regX=/\r\n|\r|\n/g;
- var _994="<br/>";
- return _992.replace(regX,_994);
- };
- function xml_encode(_995){
- var _996=""+_995;
- if((_996=="0")||((_995!=null)&&(_995!=false))){
- _996=_996.replace(/&/g,"&");
- _996=_996.replace(/</g,"<");
- _996=_996.replace(/>/g,">");
- _996=_996.replace(/"/g,""");
- _996=_996.replace(/'/g,"'");
- }else{
- if(_995==null){
- _996="";
- }
- }
- return _996;
- };
- function xml_decodeParser(sAll,_998){
- var _999=sAll;
- switch(_998){
- case "amp":
- _999="&";
- break;
- case "lt":
- _999="<";
- break;
- case "gt":
- _999=">";
- break;
- case "quot":
- _999="\"";
- break;
- case "apos":
- _999="'";
- break;
- }
- return _999;
- };
- function xml_decode(_99a){
- var _99b=""+_99a;
- if((_99b=="0")||((_99a!=null)&&(_99a!=false))){
- _99b=_99b.replace(/&(amp|lt|gt|quot|apos);/g,xml_decodeParser);
- }else{
- if(_99a==null){
- _99b="";
- }
- }
- return _99b;
- };
- function xpath_attr_encode(_99c){
- var _99d=null;
- if(_99c.indexOf("'")>=0&&_99c.indexOf("\"")>=0){
- var _99e=_99c.split("\"");
- _99d="concat(";
- for(var i=0;i<_99e.length;++i){
- if(i>0){
- _99d+=",";
- }
- if(_99e[i].length>0){
- _99d+=("\""+_99e[i]+"\"");
- }else{
- _99d+="'\"'";
- }
- }
- _99d+=")";
- }else{
- if(_99c.indexOf("'")>=0){
- _99d="\""+_99c+"\"";
- }else{
- _99d="'"+_99c+"'";
- }
- }
- return _99d;
- };
- function getCognosViewerObjectString(sId){
- return "oCV"+sId;
- };
- function getCognosViewerObjectRefAsString(sId){
- return "window."+getCognosViewerObjectString(sId);
- };
- function getCognosViewerObjectRef(sId){
- return window[getCognosViewerObjectString(sId)];
- };
- function getCognosViewerSCObjectString(sId){
- return "oCVSC"+sId;
- };
- function getCognosViewerSCObjectRefAsString(sId){
- return "window."+getCognosViewerSCObjectString(sId);
- };
- function getCognosViewerSCObjectRef(sId){
- return window[getCognosViewerSCObjectString(sId)];
- };
- function cleanupGlobalObjects(sId){
- cleanupVariable(getCognosViewerObjectString(sId));
- cleanupVariable(getCognosViewerSCObjectString(sId));
- };
- function cleanupVariable(_9a7){
- if(typeof window[_9a7]!="undefined"&&window[_9a7]){
- if(isIE()){
- eval("delete "+_9a7);
- }else{
- delete window[_9a7];
- }
- }
- };
- function loadClass(_9a8){
- try{
- var _9a9=eval("new "+_9a8+"();");
- return _9a9;
- }
- catch(e){
- return null;
- }
- };
- function getElementsByClassName(oElm,_9ab,_9ac){
- var _9ad=(_9ab=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(_9ab);
- var _9ae=[];
- var _9af=new RegExp("(^|\\s)"+_9ac+"(\\s|$)");
- var _9b0=_9ad.length;
- for(var i=0;i<_9b0;i++){
- var _9b2=_9ad[i];
- if(_9af.test(_9b2.className)){
- _9ae.push(_9b2);
- }
- }
- return _9ae;
- };
- function getImmediateLayoutContainerId(node){
- var _9b4=node;
- while(_9b4!=null){
- if(_9b4.getAttribute&&_9b4.getAttribute("lid")!=null){
- return _9b4.getAttribute("lid");
- }
- _9b4=_9b4.parentNode;
- }
- return null;
- };
- function getChildElementsByAttribute(oElm,_9b6,_9b7,_9b8){
- return getDescendantElementsByAttribute(oElm,_9b6,_9b7,_9b8,true);
- };
- function getElementsByAttribute(oElm,_9ba,_9bb,_9bc,_9bd,_9be){
- return getDescendantElementsByAttribute(oElm,_9ba,_9bb,_9bc,false,_9bd,_9be);
- };
- function getDescendantElementsByAttribute(oElm,_9c0,_9c1,_9c2,_9c3,_9c4,_9c5){
- var _9c6=[];
- var _9c7=null;
- if(typeof _9c5==="undefined"){
- _9c7=(typeof _9c2!="undefined")?new RegExp("(^|\\s)"+_9c2+"(\\s|$)","i"):null;
- }else{
- _9c7=_9c5;
- }
- if(typeof _9c0=="string"){
- _9c0=[_9c0];
- }
- var _9c8=(oElm?_9c0.length:0);
- for(var _9c9=0;_9c9<_9c8;_9c9++){
- var _9ca=null;
- if(_9c3){
- if(_9c0[_9c9]=="*"&&oElm.all){
- _9ca=oElm.childNodes;
- }else{
- _9ca=[];
- var _9cb=oElm.childNodes;
- for(var i=0;i<_9cb.length;++i){
- if(_9cb[i].nodeName.toLowerCase()==_9c0[_9c9].toLowerCase()){
- _9ca.push(_9cb[i]);
- }
- }
- }
- }else{
- _9ca=(_9c0[_9c9]=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(_9c0[_9c9]);
- }
- var _9cd=_9ca.length;
- for(var idx=0;idx<_9cd;idx++){
- var _9cf=_9ca[idx];
- var _9d0=_9cf.getAttribute&&_9cf.getAttribute(_9c1);
- if(_9d0!==null){
- var _9d1=null;
- if(typeof _9d0==="number"){
- _9d1=String(_9d0);
- }else{
- if(typeof _9d0==="string"&&_9d0.length>0){
- _9d1=_9d0;
- }
- }
- if(_9d1!==null){
- if(typeof _9c2=="undefined"||(_9c7&&_9c7.test(_9d1))){
- _9c6.push(_9cf);
- if(_9c4!=-1&&_9c6.length>_9c4){
- return [];
- }else{
- if(_9c4==1&&_9c6.length==1){
- return _9c6;
- }
- }
- }
- }
- }
- }
- }
- return _9c6;
- };
- function savedOutputDoneLoading(cvId,_9d3){
- var oCV=window["oCV"+cvId];
- var _9d5=(oCV&&oCV.getViewerWidget?oCV.getViewerWidget():null);
- var _9d6=(_9d5?_9d5.getSavedOutput():null);
- if(_9d6){
- _9d6.outputDoneLoading();
- }else{
- if(_9d3<5){
- _9d3++;
- var _9d7=function(){
- savedOutputDoneLoading(cvId,_9d3);
- };
- setTimeout(_9d7,100);
- }
- }
- };
- function getNavVer(){
- var temp;
- if(isIE()){
- return getIEVersion();
- }else{
- temp=navigator.userAgent.split("/");
- return parseFloat(temp[temp.length-1]);
- }
- };
- function isSafari(){
- return (navigator.userAgent.toLowerCase().indexOf("safari")!=-1&&navigator.userAgent.toLowerCase().indexOf("chrome")==-1);
- };
- function isIE(){
- return (navigator.userAgent.indexOf("MSIE")!=-1||navigator.userAgent.indexOf("Trident")!=-1);
- };
- function getIEVersion(){
- var _9d9=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
- return _9d9?parseFloat(_9d9[1]):null;
- };
- function isFF(){
- return (navigator.userAgent.indexOf("Firefox")!=-1);
- };
- function isIOS(){
- return navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1;
- };
- function displayChart(_9da,_9db,_9dc,_9dd){
- if(_9db.length>1){
- document.images[_9da].src=_9db;
- }
- };
- function isFlashChartNode(evt){
- var node=getNodeFromEvent(evt);
- if(node!=null&&typeof node.getAttribute=="function"){
- return node.getAttribute("flashChart")!=null;
- }
- return false;
- };
- function onFlashChartRightClick(evt){
- if(evt&&evt.button&&evt.button!=0&&isFlashChartNode(evt)){
- return onViewerChartFocus(evt);
- }
- };
- function onViewerChartFocus(evt){
- if(evt.stopPropagation){
- evt.stopPropagation();
- }
- if(evt.preventDefault){
- evt.preventDefault();
- }
- if(evt.preventCapture){
- evt.preventCapture();
- }
- if(evt.preventBubble){
- evt.preventBubble();
- }
- var node=getNodeFromEvent(evt);
- var _9e3=node.getAttribute("viewerId");
- if(!_9e3){
- _9e3=node.parentNode.getAttribute("viewerId");
- }
- if(!_9e3){
- return;
- }
- var oCV=window["oCV"+_9e3];
- var _9e5=oCV.getAction("Selection");
- _9e5.pageClicked(evt);
- return stopEventBubble(evt);
- };
- function clientToScreenCoords(_9e6,_9e7){
- var _9e8=_9e6;
- var _9e9={topCoord:0,leftCoord:0};
- while(_9e8!=null&&_9e8!=_9e7){
- _9e9.topCoord+=_9e8.offsetTop;
- _9e9.leftCoord+=_9e8.offsetLeft;
- _9e8=_9e8.offsetParent;
- }
- return _9e9;
- };
- function getCurrentPosistionString(oCV,_9eb,_9ec){
- var _9ed=RV_RES.IDS_JS_INFOBAR_ITEM_COUNT;
- var _9ee=/\{0\}/;
- var _9ef=/\{1\}/;
- _9ed=_9ed.replace(_9ee,_9eb);
- _9ed=" "+_9ed.replace(_9ef,_9ec)+" ";
- return _9ed;
- };
- function applyJSONProperties(obj,_9f1){
- for(property in _9f1){
- if(typeof _9f1[property]=="object"&&!(_9f1[property] instanceof Array)){
- if(typeof obj[property]=="undefined"){
- obj[property]={};
- }
- applyJSONProperties(obj[property],_9f1[property]);
- }else{
- obj[property]=_9f1[property];
- }
- }
- };
- function CViewerCommon(){
- };
- CViewerCommon.openNewWindowOrTab=function(sURL,_9f3){
- return window.open(sURL,_9f3);
- };
- CViewerCommon.toJSON=function(obj){
- var type=typeof (obj);
- if(type!="object"||type===null){
- if(type==="string"){
- obj="\""+obj+"\"";
- }
- return String(obj);
- }else{
- var _9f6;
- var prop;
- var json=[];
- var _9f9=(obj&&obj.constructor==Array);
- for(_9f6 in obj){
- prop=obj[_9f6];
- type=typeof (prop);
- if(type==="string"){
- prop="\""+prop+"\"";
- }else{
- if(type=="object"&&prop!==null){
- prop=CViewerCommon.toJSON(prop);
- }
- }
- json.push((_9f9?"":"\""+_9f6+"\":")+String(prop));
- }
- return (_9f9?"[":"{")+String(json)+(_9f9?"]":"}");
- }
- };
- function resizePinnedContainers(){
- var oCV=window.gaRV_INSTANCES[0];
- if(oCV&&!oCV.m_viewerFragment){
- var _9fb=oCV.getPinFreezeManager();
- if(_9fb&&_9fb.hasFrozenContainers()){
- var _9fc=document.getElementById("RVContent"+oCV.getId());
- var _9fd=document.getElementById("mainViewerTable"+oCV.getId());
- var _9fe=_9fc.clientWidth;
- var _9ff=_9fd.clientHeight;
- _9fb.resize(_9fe,_9ff);
- if(isIE()){
- oCV.repaintDiv(_9fc);
- }
- }
- }
- };
- function setWindowHref(url){
- var _a01=window.onbeforeunload;
- window.onbeforeunload=null;
- window.location.href=url;
- window.onbeforeunload=_a01;
- };
- CViewerCommon.getMessage=function(msg,args){
- if(typeof args=="undefined"){
- return msg;
- }else{
- if(typeof args=="string"){
- msg=msg.replace("{0}",args);
- }else{
- if(args.length){
- for(var i=0;i<args.length;++i){
- msg=msg.replace("{"+i+"}",args[i]);
- }
- }else{
- msg=msg.replace("{0}",args);
- }
- }
- }
- return msg;
- };
- function getViewerDirection(){
- if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
- return gaRV_INSTANCES[0].getDirection();
- }
- return "ltr";
- };
- function isViewerBidiEnabled(){
- if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
- var _a05=gaRV_INSTANCES[0].isBidiEnabled();
- if(_a05){
- return true;
- }
- }
- return false;
- };
- function getViewerBaseTextDirection(){
- if(window.gaRV_INSTANCES&&window.gaRV_INSTANCES.length){
- return gaRV_INSTANCES[0].getBaseTextDirection();
- }
- return "";
- };
- function enforceTextDir(_a06){
- if(isViewerBidiEnabled()&&_a06){
- var sDir=getViewerBaseTextDirection();
- var _a08=BidiUtils.getInstance();
- if(sDir=="auto"){
- sDir=_a08.resolveStrBtd(_a06);
- }
- var _a09=(!dojo._isBodyLtr())?_a08.RLM:_a08.LRM;
- return _a09+((sDir==="rtl")?_a08.RLE:_a08.LRE)+_a06+_a08.PDF+_a09;
- }
- return _a06;
- };
- function getElementDirection(_a0a){
- var dir=null;
- if(_a0a.currentStyle){
- dir=_a0a.currentStyle.direction;
- }else{
- if(window.getComputedStyle){
- var _a0c=window.getComputedStyle(_a0a,null);
- if(_a0c){
- dir=_a0c.getPropertyValue("direction");
- }
- }
- }
- if(dir){
- dir=dir.toLowerCase();
- }
- return dir;
- };
- function getScrollLeft(_a0d){
- if(getElementDirection(_a0d)==="rtl"&&isFF()){
- return _a0d.scrollWidth-_a0d.offsetWidth+_a0d.scrollLeft;
- }
- return _a0d.scrollLeft;
- };
- function setScrollLeft(_a0e,_a0f){
- if(getElementDirection(_a0e)==="rtl"&&isFF()){
- _a0e.scrollLeft=_a0e.offsetWidth+_a0f-_a0e.scrollWidth;
- }else{
- _a0e.scrollLeft=_a0f;
- }
- };
- function setScrollRight(_a10,_a11){
- if(getElementDirection(_a10)==="rtl"&&isFF()){
- _a10.scrollLeft=-_a11;
- }else{
- _a10.scrollLeft=_a10.scrollWidth-_a10.offsetWidth-_a11;
- }
- };
- function getBoxInfo(el,_a13){
- if(!getBoxInfo.aStyles){
- 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"}];
- }
- var _a14={};
- var _a15=null;
- if(el.currentStyle){
- _a15=el.currentStyle;
- }else{
- if(window.getComputedStyle){
- _a15=window.getComputedStyle(el,null);
- }
- }
- if(!_a15){
- return null;
- }
- for(i in getBoxInfo.aStyles){
- var _a16=getBoxInfo.aStyles[i];
- var size=null;
- if(_a15.getPropertyValue){
- size=_a15.getPropertyValue(_a16.ff);
- }else{
- size=_a15[_a16.ie];
- }
- if(size&&_a13){
- size=Number(size.replace("px",""));
- }
- _a14[_a16.name]=size;
- }
- return _a14;
- };
- if(!CViewerCommon){
- var CViewerCommon={};
- }
- CViewerCommon.buildParameterValuesSpec=function(oCV){
- var _a19=XMLBuilderLoadXMLFromString(oCV.getExecutionParameters());
- var _a1a=new CParameterValues();
- if(_a19.childNodes.length==1){
- _a1a.loadWithOptions(_a19.childNodes[0],false);
- }
- var _a1b=_a1a.length();
- var _a1c="<pvs>";
- if(_a1b>0){
- 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);
- for(var _a1e=0;_a1e<_a1b;++_a1e){
- var _a1f=_a1a.getAt(_a1e);
- if(_a1f!=null){
- _a1c+="<pv>";
- _a1c+="<name>";
- _a1c+=xml_encode(_a1f.name());
- _a1c+="</name>";
- _a1c+="<value>";
- _a1c+=xml_encode(_a1f.toString(_a1d));
- _a1c+="</value>";
- _a1c+="</pv>";
- }
- }
- }
- _a1c+="</pvs>";
- return _a1c;
- };
- function PinFreezeContainer(_a20,lid,_a22,_a23,_a24,_a25,_a26){
- this.m_pinFreezeManager=_a20;
- this.m_lid=lid;
- this.m_lidNS=lid+_a22+_a26;
- this.m_viewerId=_a22;
- this.m_freezeTop=_a23;
- this.m_freezeSide=_a24;
- this.m_cachedReportDiv=null;
- this.m_cachedPFContainer=null;
- this.m_cachedBaseContainer=_a25;
- this.m_containerMargin={"top":0,"left":0};
- if(this.m_cachedBaseContainer&&this.m_cachedBaseContainer.style){
- if(this.m_cachedBaseContainer.style.marginTop){
- this.m_containerMargin.top=Number(this.m_cachedBaseContainer.style.marginTop.replace("px",""));
- }
- if(this.m_cachedBaseContainer.style.marginLeft){
- this.m_containerMargin.left=Number(this.m_cachedBaseContainer.style.marginLeft.replace("px",""));
- }
- }
- this.m_cachedContainerIndex=_a26;
- this.m_sectionCache=null;
- this.m_homeCellNodes={};
- this.m_fixedWidth=null;
- this.m_clientWidth=700;
- this.m_scrollableClientWidth=700;
- this.m_fixedHeight=null;
- this.m_clientHeight=300;
- this.m_scrollableClientHeight=300;
- this.m_wrapFlag=false;
- this.c_pageMargin=(this.m_freezeTop&&this.m_freezeSide)?50:20;
- this.touchScrollSections=false;
- this.touchPreviousX=-1;
- this.touchPreviousY=-1;
- };
- PinFreezeContainer.prototype.toJSONString=function(){
- var _a27="{";
- _a27+="\"m_clientWidth\":"+this.m_clientWidth+"";
- _a27+=",\"m_scrollableClientWidth\":"+this.m_scrollableClientWidth+"";
- _a27+=",\"m_clientHeight\":"+this.m_clientHeight+"";
- _a27+=",\"m_scrollableClientHeight\":"+this.m_scrollableClientHeight+"";
- _a27+="}";
- return _a27;
- };
- PinFreezeContainer.prototype.copyProperties=function(_a28){
- this.m_clientWidth=_a28.m_clientWidth;
- this.m_scrollableClientWidth=_a28.m_scrollableClientWidth;
- this.m_clientHeight=_a28.m_clientHeight;
- this.m_scrollableClientHeight=_a28.m_scrollableClientHeight;
- };
- PinFreezeContainer.prototype.setViewerId=function(id){
- this.m_viewerId=id;
- };
- PinFreezeContainer.prototype.getLid=function(){
- return this.m_lid;
- };
- PinFreezeContainer.prototype.createPFContainer=function(_a2a,_a2b){
- var _a2c=document.createElement("temp");
- if(this.m_cachedBaseContainer){
- this.applyAuthoredFixedSizes(this.m_cachedBaseContainer);
- this.m_cachedReportDiv=_a2a;
- var _a2d=this.m_cachedBaseContainer.parentNode;
- var _a2e=this.loadTemplateHTML();
- if(_a2e){
- _a2c.innerHTML=_a2e;
- var _a2f=this.getContainerByLID(_a2c);
- var _a30=this.getSectionByLID(_a2c.firstChild,"pfMainOutput");
- if(_a30){
- var i=this.getChildPosition(_a2d,this.m_cachedBaseContainer);
- if(i!=-1){
- var _a32=this.m_pinFreezeManager.m_oCV;
- if(_a32&&_a32.envParams["freezeDefaultWrap"]){
- if(this.m_cachedBaseContainer.style.whiteSpace===""&&_a32.envParams["freezeDefaultWrap"].toLowerCase()==="true"){
- var _a33=this.m_cachedBaseContainer.getElementsByTagName("span");
- if(_a33){
- for(var k=0;k<_a33.length;k++){
- _a33[k].style.whiteSpace="nowrap";
- }
- }
- this.m_wrapFlag=true;
- }
- }
- if(!_a2b){
- if(!this._getFixedWidth()){
- this.m_cachedBaseContainer.setAttribute("authoredFixedWidth","false");
- this.m_addedFixedWidth=this.m_cachedBaseContainer.clientWidth+1;
- this.m_cachedBaseContainer.style.width=this.m_addedFixedWidth+"px";
- }
- if(!this._getFixedHeight()){
- this.m_cachedBaseContainer.setAttribute("authoredFixedHeight","false");
- this.m_addedFixedHeight=this.m_cachedBaseContainer.clientHeight;
- this.m_cachedBaseContainer.style.height=this.m_addedFixedHeight+"px";
- }
- _a30.style.width=this.m_cachedBaseContainer.clientWidth+2+"px";
- _a30.style.height=this.m_cachedBaseContainer.clientHeight+2+"px";
- }
- _a30.appendChild(this.m_cachedBaseContainer);
- this.insertAt(_a2d,_a2f,i);
- }
- if(this.m_cachedBaseContainer.style.border!==""){
- _a2f.style.border=this.m_cachedBaseContainer.style.border;
- this.m_cachedBaseContainer.style.border="";
- }
- }
- }
- }
- };
- PinFreezeContainer.prototype._getFixedWidth=function(_a35){
- if(_a35&&_a35.style.width&&!_a35.getAttribute("authoredFixedWidth")){
- var _a36=Number(_a35.style.width.split("px")[0]);
- return isNaN(_a36)?null:_a36;
- }
- return null;
- };
- PinFreezeContainer.prototype._getFixedHeight=function(_a37){
- if(_a37&&_a37.style.height&&!_a37.getAttribute("authoredFixedHeight")){
- var _a38=Number(_a37.style.height.split("px")[0]);
- return isNaN(_a38)?null:_a38;
- }
- return null;
- };
- PinFreezeContainer.prototype.applyAuthoredFixedSizes=function(_a39){
- var _a3a=this._getFixedWidth(_a39);
- if(_a3a){
- this.m_fixedWidth=_a3a;
- this.m_clientWidth=this.m_fixedWidth;
- this.m_scrollableClientWidth=this.m_fixedWidth;
- }
- var _a3b=this._getFixedHeight(_a39);
- if(_a3b){
- this.m_fixedHeight=_a3b;
- this.m_clientHeight=this.m_fixedHeight;
- this.m_scrollableClientHeight=this.m_fixedHeight;
- }
- };
- PinFreezeContainer.prototype.loadFreezeBothTemplateHTML=function(){
- 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;\"> </div>"+"</div>"+"</td><td></td></tr></table>";
- return _a3c;
- };
- PinFreezeContainer.prototype.loadFreezeSideTemplateHTML=function(){
- 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;\"> </div>"+"</div>"+"</td></tr></table>";
- return _a3d;
- };
- PinFreezeContainer.prototype.loadFreezeTopTemplateHTML=function(){
- 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>";
- return _a3e;
- };
- PinFreezeContainer.prototype.loadTemplateHTML=function(){
- if(this.m_freezeSide&&this.m_freezeTop){
- return this.loadFreezeBothTemplateHTML();
- }else{
- if(this.m_freezeSide){
- return this.loadFreezeSideTemplateHTML();
- }else{
- if(this.m_freezeTop){
- return this.loadFreezeTopTemplateHTML();
- }
- }
- }
- return null;
- };
- PinFreezeContainer.prototype.createSideHeadings=function(_a3f){
- var _a40=this.getSection("pfMainOutput");
- var _a41=_a40.getAttribute("pfslid");
- var _a42=this.getSection("pfSideHeadings");
- var _a43=_a42.getAttribute("pfslid");
- var _a44=this.getMainOutputHomeCell();
- if(!_a44){
- return;
- }
- var _a45=_a3f;
- var _a46=_a42;
- var _a47=this.isA11yEnabled(_a45);
- var _a48=this.m_pinFreezeManager.deepCloneNode(_a45);
- _a46.appendChild(_a48);
- var _a49=this.getSectionHomeCell(_a42);
- if(!_a49){
- return;
- }
- var _a4a=_a45.getElementsByTagName("tbody");
- var _a4b=_a48.getElementsByTagName("tbody");
- if(_a4a.length>0&&_a4b.length>0){
- var _a4c=_a4a[0];
- var _a4d=_a4b[0];
- var _a4e=_a4c.firstChild;
- var _a4f=_a4d.firstChild;
- var _a50=_a44.rowSpan;
- this.markAsCopy(_a44,_a49,_a41,_a43);
- for(var r=0;r<_a50;++r){
- var _a52=_a4d.rows[r];
- this.removeCTX(_a52);
- }
- for(var r=_a50;r<_a4d.rows.length;++r){
- var _a53=_a4c.rows[r];
- var _a52=_a4d.rows[r];
- _a52.style.visibility="hidden";
- for(var c=0;c<_a52.cells.length;++c){
- var _a55=_a52.cells[c];
- if(_a47){
- _a55=this.m_pinFreezeManager.removeIdAttribute(_a55);
- }
- if(_a55.getAttribute("type")=="datavalue"){
- _a55.removeAttribute("ctx");
- _a55.removeAttribute("uid");
- _a55.removeAttribute("name");
- }else{
- var _a56=_a53.cells[c];
- this.markAsCopy(_a56,_a55,_a41,_a43);
- }
- }
- _a52.style.visibility="visible";
- }
- }
- };
- PinFreezeContainer.prototype.applyNeighbouringBorderStylesToHomeCell=function(_a57,_a58){
- if(isFF()||isIE()){
- if(_a57&&_a57.length&&_a57[0].cells&&_a57[0].cells.length>1){
- if(this.m_freezeSide){
- var _a59=this.getBorderInfo(_a57[0].cells[1],"right");
- if(_a59){
- _a58.style.borderRightWidth=_a59.borderRightWidth;
- _a58.style.borderRightStyle=_a59.borderRightStyle;
- _a58.style.borderRightColor=_a59.borderRightColor;
- }
- }
- if(this.m_freezeTop){
- var _a59=this.getBorderInfo(_a57[0].cells[1],"bottom");
- if(_a59){
- _a58.style.borderBottomWidth=_a59.borderBottomWidth;
- _a58.style.borderBottomStyle=_a59.borderBottomStyle;
- _a58.style.borderBottomColor=_a59.borderBottomColor;
- }
- }
- }
- }
- };
- PinFreezeContainer.prototype.createTopHeadings=function(_a5a){
- var _a5b=this.getSection("pfMainOutput");
- var _a5c=_a5b.getAttribute("pfslid");
- var _a5d=this.getSection("pfTopHeadings");
- var _a5e=_a5d.getAttribute("pfslid");
- var _a5f=this.getMainOutputHomeCell();
- if(!_a5f){
- return;
- }
- var _a60=_a5a;
- var _a61=_a5d;
- var _a62=this.isA11yEnabled(_a60);
- var _a63=this.m_pinFreezeManager.deepCloneNode(_a60);
- _a63.setAttribute("clonednode","true");
- _a61.appendChild(_a63);
- var _a64=_a60.getElementsByTagName("tbody");
- var _a65=_a63.getElementsByTagName("tbody");
- if(_a64.length>0&&_a65.length>0){
- var _a66=_a64[0];
- var _a67=_a65[0];
- var _a68=_a5f.rowSpan;
- for(var r=0;r<_a67.rows.length;++r){
- var _a6a=_a66.rows[r];
- var _a6b=_a67.rows[r];
- if(_a62){
- _a6b=this.m_pinFreezeManager.removeIdAttribute(_a6b);
- }
- _a6b.style.visibility="hidden";
- for(var c=0;c<_a6b.cells.length;++c){
- var _a6d=_a6b.cells[c];
- if(r>_a68||_a6d.getAttribute("type")=="datavalue"){
- _a6d.removeAttribute("ctx");
- _a6d.removeAttribute("uid");
- _a6d.removeAttribute("name");
- }else{
- var _a6e=_a6a.cells[c];
- this.markAsCopy(_a6e,_a6d,_a5c,_a5e);
- if(_a6e===_a5f){
- this.initializeHomeCellTabIndex(_a6d);
- this.applyNeighbouringBorderStylesToHomeCell(_a66.rows,_a6d);
- }
- }
- }
- _a6b.style.visibility="visible";
- }
- }
- };
- PinFreezeContainer.prototype.createHomeCellHeading=function(){
- var _a6f=this.getSection("pfMainOutput");
- var _a70=_a6f.getAttribute("pfslid");
- var _a71=this.getSection("pfHomeCell");
- var _a72=_a71.parentNode;
- var _a73=_a71.getAttribute("pfslid");
- var _a74=this.getMainOutputHomeCell();
- if(!_a74){
- return;
- }
- _a72.style.height="100%";
- var _a75=this.getTopHeadingSectionHeight(_a74);
- _a71.style.height=_a75-this.m_containerMargin.top+"px";
- _a71.style.width=this.getSideHeadingSectionWidth(_a74)-this.m_containerMargin.left+"px";
- _a71.style.marginTop=this.m_containerMargin.top+"px";
- _a71.style.marginLeft=this.m_containerMargin.left+"px";
- var _a76=_a74.parentNode;
- var _a77=_a76.cloneNode(false);
- var _a78=this._findBestGuessHomeCell(_a74);
- var _a79=document.createElement("div");
- _a79.style.width="100%";
- _a79.style.height="100%";
- while(_a74.offsetLeft<=_a78.offsetLeft){
- oTargetHomeCell=this.m_pinFreezeManager.deepCloneNode(_a74);
- if(isFF()||isIE()){
- _a74.appendChild(_a79);
- oTargetHomeCell.style.width=_a79.clientWidth+"px";
- _a74.removeChild(_a79);
- }else{
- oTargetHomeCell.style.width=_a74.clientWidth+1+"px";
- }
- oTargetHomeCell.style.borderBottomWidth="0px";
- _a77.appendChild(oTargetHomeCell);
- this.markAsCopy(_a74,oTargetHomeCell,_a70,_a73);
- if(_a74.nextSibling){
- _a74=_a74.nextSibling;
- }else{
- break;
- }
- }
- if(oTargetHomeCell){
- oTargetHomeCell.style.borderRightWidth="0px";
- }
- var _a7a=_a76.parentNode;
- var _a7b=_a7a.cloneNode(false);
- _a7b.appendChild(_a77);
- var _a7c=_a7a.parentNode;
- var _a7d=_a7c.cloneNode(false);
- _a7d.appendChild(_a7b);
- _a7d.style.width="100%";
- _a7d.style.height="100%";
- _a7d.style.marginLeft="";
- _a7d.style.marginTop="";
- _a71.appendChild(_a7d);
- this.initializeHomeCellTabIndex(oTargetHomeCell);
- this.applyNeighbouringBorderStylesToHomeCell(_a6f.firstChild.rows,_a71);
- };
- PinFreezeContainer.prototype.markAsCopy=function(main,copy,_a80,_a81){
- if(!main.pfCopy){
- main.setAttribute("pfslid",_a80);
- main.pfCopy=[];
- }
- main.pfCopy.push(copy);
- copy.pfMain=main;
- copy.setAttribute("pfslid",_a81);
- };
- PinFreezeContainer.prototype.getCopy=function(_a82){
- if(_a82.pfCopy){
- var _a83={};
- for(var i in _a82.pfCopy){
- var copy=_a82.pfCopy[i];
- if(copy.getAttribute){
- var _a86=copy.getAttribute("pfslid");
- if(_a86){
- var _a87=PinFreezeContainer.getSectionNameFromSlid(_a86);
- var _a88=this.getSection(_a87);
- if(_a88&&PinFreezeContainer.isSectionVisible(_a88)){
- _a83[_a87]=copy;
- }
- }
- }
- }
- if(_a83["pfHomeCell"]){
- return _a83["pfHomeCell"];
- }
- for(i in _a83){
- return _a83[i];
- }
- }
- return null;
- };
- PinFreezeContainer.prototype.getMain=function(_a89){
- if(_a89.pfMain){
- return _a89.pfMain;
- }
- return null;
- };
- PinFreezeContainer.isSectionVisible=function(_a8a){
- var node=_a8a;
- if(!node){
- return false;
- }
- while(node.parentNode&&!node.getAttribute("pfclid")){
- if(node.style&&node.style.display==="none"){
- return false;
- }
- node=node.parentNode;
- }
- return (!node.style||node.style.display!=="none");
- };
- PinFreezeContainer.prototype.getSectionStructure=function(){
- var _a8c={isSideFrozen:false,isTopFrozen:false};
- if(this.m_freezeSide){
- var side=this.getSection("pfSideHeadings");
- if(side){
- _a8c.isSideFrozen=PinFreezeContainer.isSectionVisible(side);
- }
- }
- if(this.m_freezeTop){
- var top=this.getSection("pfTopHeadings");
- if(top){
- _a8c.isTopFrozen=PinFreezeContainer.isSectionVisible(top);
- }
- }
- return _a8c;
- };
- PinFreezeContainer.prototype.checkSectionStructureChange=function(_a8f,_a90){
- if(_a8f.isSideFrozen!==_a90.isSideFrozen||_a8f.isTopFrozen!==_a90.isTopFrozen){
- this.m_pinFreezeManager.sectionStructureChange();
- }
- };
- PinFreezeContainer.prototype.freezeContainerInReport=function(_a91){
- this.cacheContainerAndSections(this.getContainerByLID(_a91));
- this.m_homeCellNodes={};
- this.updateContainer();
- };
- PinFreezeContainer.prototype.frozenSectionsRequired=function(){
- return (this.frozenSideHeadingsRequired()||this.frozenTopHeadingsRequired());
- };
- PinFreezeContainer.prototype.frozenSideHeadingsRequired=function(){
- var _a92=this.getSection("pfMainOutput");
- if(_a92){
- if(this.m_freezeSide){
- var _a93=_a92.scrollWidth;
- return ((this.m_clientWidth<_a93)||_a93==0);
- }
- }
- return false;
- };
- PinFreezeContainer.prototype.frozenTopHeadingsRequired=function(){
- var _a94=this.getSection("pfMainOutput");
- if(_a94){
- if(this.m_freezeTop){
- var _a95=_a94.scrollHeight;
- return ((this.m_clientHeight<_a95)||_a95==0);
- }
- }
- return false;
- };
- PinFreezeContainer.prototype.showTemplatePart=function(_a96,_a97){
- var _a98=this.getContainer().rows;
- for(var r=0;r<_a98.length;++r){
- if(_a98[r].getAttribute("templatePart")===_a96){
- _a98[r].style.display=((_a97)?"":"none");
- }else{
- var _a9a=_a98[r].cells;
- for(var c=0;c<_a9a.length;++c){
- if(_a9a[c].getAttribute("templatePart")===_a96){
- _a9a[c].style.display=((_a97)?"":"none");
- }
- }
- }
- }
- };
- PinFreezeContainer.prototype.showFreezeTopOnly=function(_a9c){
- if(!(this.m_freezeTop&&this.m_freezeSide)){
- return;
- }
- var _a9d=(_a9c.scrollWidth==0)?_a9c.clientWidth:_a9c.scrollWidth;
- this.updateMainOutputWidth(_a9d);
- this.setScrollX(_a9c,0);
- if(this.getSection("pfTopHeadings")){
- this.getSection("pfTopHeadings").style.width=_a9d+"px";
- this.setScrollX(this.getSection("pfTopHeadings"),0);
- }
- this.showTemplatePart("freezeSide",false);
- };
- PinFreezeContainer.prototype.showFreezeSideOnly=function(_a9e){
- if(!(this.m_freezeTop&&this.m_freezeSide)){
- return;
- }
- var _a9f=(_a9e.scrollHeight==0)?_a9e.clientHeight:_a9e.scrollHeight;
- this.updateMainOutputHeight(_a9f);
- this.setScrollY(_a9e,0);
- if(this.getSection("pfSideHeadings")){
- this.getSection("pfSideHeadings").style.height=_a9f+"px";
- this.setScrollY(this.getSection("pfSideHeadings"),0);
- }
- this.showTemplatePart("freezeTop",false);
- };
- PinFreezeContainer.prototype.showAll=function(){
- if(!(this.m_freezeTop&&this.m_freezeSide)){
- return;
- }
- this.showTemplatePart("freezeTop",true);
- this.showTemplatePart("freezeSide",true);
- };
- PinFreezeContainer.prototype.showMainOutputOnly=function(_aa0){
- this.updateMainOutputWidth((_aa0.scrollWidth==0)?_aa0.clientWidth:_aa0.scrollWidth);
- this.updateMainOutputHeight((_aa0.scrollHeight==0)?_aa0.clientHeight:_aa0.scrollHeight);
- this.setInitialScrollPosition(_aa0,0,0);
- if(this.m_freezeSide&&this.m_freezeTop){
- this.getSection("pfHomeCell").style.display="none";
- }
- if(this.m_freezeSide){
- this.getSection("pfSideHeadings").style.display="none";
- this.getSection("pfHorizontalScrollBar").style.display="none";
- }
- if(this.m_freezeTop){
- this.getSection("pfTopHeadings").style.display="none";
- this.getSection("pfVerticalScrollBar").style.display="none";
- }
- };
- PinFreezeContainer.prototype.getWrap=function(el){
- if(el.currentStyle){
- return el.currentStyle.whiteSpace;
- }else{
- if(window.getComputedStyle){
- return window.getComputedStyle(el,null).getPropertyValue("white-space");
- }else{
- return el.style.whiteSpace;
- }
- }
- };
- PinFreezeContainer.prototype.getStyleDisplay=function(el){
- if(el.currentStyle){
- return el.currentStyle.display;
- }else{
- if(window.getComputedStyle){
- return window.getComputedStyle(el,null).getPropertyValue("display");
- }else{
- return el.style.display;
- }
- }
- };
- PinFreezeContainer.prototype.headingsCreated=function(_aa3){
- return _aa3.firstChild?true:false;
- };
- PinFreezeContainer.prototype.updateContainer=function(){
- var _aa4=this.getSection("pfMainOutput");
- var _aa5=this.getMainOutputHomeCell();
- if(_aa5){
- if(this.m_scrollableClientHeight===this.m_clientHeight||!this.m_scrollableClientHeight){
- this.m_scrollableClientHeight-=_aa5.offsetHeight;
- var _aa6=this.calculateMinCrossTabScrollableClientHeight();
- if(_aa6>this.m_scrollableClientHeight){
- this.m_scrollableClientHeight=_aa6;
- }
- }
- if(this.m_scrollableClientWidth===this.m_clientWidth||!this.m_scrollableClientWidth){
- this.m_scrollableClientWidth-=this.getHomeCellOffsetWidth(_aa5);
- }
- }
- if(_aa4&&_aa5){
- this.showAll();
- if(this.frozenSectionsRequired()){
- this.updateMainOutputSize();
- this.initializeHomeCellTabIndex(_aa5);
- if(this.m_freezeSide){
- var _aa7=this.getSection("pfSideHeadings");
- if(!this.headingsCreated(_aa7)){
- this.createSideHeadings(this.m_cachedBaseContainer);
- if(this.m_freezeTop){
- this.initializeTouchScrolling(_aa7);
- }
- }
- var _aa8=this.getSection("pfHorizontalScrollBar");
- _aa8.scrollLeft="0px";
- }
- if(this.m_freezeTop){
- var _aa9=this.getSection("pfTopHeadings");
- if(!this.headingsCreated(_aa9)){
- this.createTopHeadings(this.m_cachedBaseContainer);
- if(this.m_freezeSide){
- this.initializeTouchScrolling(_aa9);
- }
- }
- var _aaa=this.getSection("pfVerticalScrollBar");
- _aaa.scrollTop="0px";
- }
- if(this.m_freezeSide&&this.m_freezeTop){
- var _aab=this.getSection("pfHomeCell");
- if(!this.headingsCreated(_aab)){
- this.createHomeCellHeading();
- }
- _aab.style.display="";
- }
- var _aac=this.updateSideHeadingSize(_aa5);
- var _aad=this.updateTopHeadingSize(_aa5);
- if(!this.frozenSectionsRequired()){
- this.showMainOutputOnly(_aa4);
- }
- this.setInitialScrollPosition(_aa4,_aac,_aad);
- if(this.m_freezeTop&&this.m_freezeSide){
- this.setInitialScrollPosition(this.getSection("pfSideHeadings"),0,_aad);
- this.setInitialScrollPosition(this.getSection("pfTopHeadings"),_aac,0);
- }
- this.initializeTouchScrolling(_aa4);
- }else{
- this.showMainOutputOnly(_aa4);
- this.removeTouchScrolling();
- }
- this.updateTabIndexValues();
- }
- };
- PinFreezeContainer.prototype.calculateMinCrossTabScrollableClientHeight=function(){
- var _aae=0;
- if(this.m_cachedPFContainer){
- var _aaf=this.getElementByLID(this.m_cachedPFContainer,"table",this.m_lid+this.m_viewerId);
- if(_aaf){
- var _ab0=0;
- for(var r=0;r<_aaf.rows.length;r++){
- var row=_aaf.rows[r];
- for(var c=0;c<row.cells.length;c++){
- var cell=row.cells[c];
- if(cell.getAttribute("type")=="datavalue"){
- _ab0++;
- if(cell.childNodes.length===1&&cell.childNodes[0].getAttribute&&cell.childNodes[0].getAttribute("class")==="textItem"){
- _aae=_aae+cell.offsetHeight;
- }else{
- _ab0++;
- var _ab5=this.getSection("pfVerticalScrollBar");
- if(_ab5){
- _aae=_ab5.offsetWidth*2;
- }
- }
- break;
- }
- }
- if(_ab0>=2){
- break;
- }
- }
- }
- }
- return _aae;
- };
- PinFreezeContainer.prototype.updateSideHeadingSize=function(_ab6){
- var _ab7=0;
- if(this.m_freezeSide){
- var _ab8=this.getSection("pfMainOutput");
- if(!_ab8){
- return 0;
- }
- if(!this.frozenSideHeadingsRequired()){
- this.showFreezeTopOnly(_ab8);
- return 0;
- }
- var _ab9=this.getSection("pfSideHeadings");
- _ab7=this.getSideHeadingSectionWidth(_ab6);
- var _aba=this.getSection("pfHorizontalScrollBar");
- var _abb=this.getSectionHomeCell(_ab9);
- if(_ab9.style.display=="none"){
- _ab9.style.display="";
- _aba.style.display="";
- }
- _ab9.style.width=_ab7+"px";
- _ab9.style.height=_ab8.clientHeight+"px";
- }
- return _ab7;
- };
- PinFreezeContainer.prototype.updateTopHeadingSize=function(_abc){
- var _abd=0;
- if(this.m_freezeTop){
- var _abe=this.getSection("pfMainOutput");
- if(!_abe){
- return 0;
- }
- if(!this.frozenTopHeadingsRequired()){
- this.showFreezeSideOnly(_abe);
- return 0;
- }
- var _abf=this.getSection("pfTopHeadings");
- _abd=this.getTopHeadingSectionHeight(_abc);
- var _ac0=this.getSection("pfVerticalScrollBar");
- var _ac1=this.getSectionHomeCell(_abf);
- if(_abf.style.display=="none"){
- _abf.style.display="";
- _ac0.style.display="";
- }
- _abf.style.height=_abd+"px";
- _abf.style.width=_abe.clientWidth+"px";
- }
- return _abd;
- };
- PinFreezeContainer.prototype.setScrollX=function(_ac2,_ac3){
- if(getElementDirection(_ac2)==="rtl"){
- setScrollRight(_ac2,_ac3);
- }else{
- setScrollLeft(_ac2,_ac3);
- }
- };
- PinFreezeContainer.prototype.setScrollY=function(_ac4,_ac5){
- _ac4.scrollTop=_ac5;
- };
- PinFreezeContainer.prototype.setInitialScrollPosition=function(_ac6,_ac7,_ac8){
- if(getElementDirection(_ac6)==="rtl"){
- setScrollRight(_ac6,_ac7);
- }else{
- setScrollLeft(_ac6,_ac7);
- }
- _ac6.scrollTop=_ac8;
- };
- PinFreezeContainer.prototype.getScrollableClientWidth=function(){
- return this.m_scrollableClientWidth;
- };
- PinFreezeContainer.prototype.setScrollableClientWidth=function(_ac9){
- this.m_scrollableClientWidth=_ac9;
- };
- PinFreezeContainer.prototype.getContainerWidth=function(){
- return this.m_addedFixedWidth?this.m_addedFixedWidth:this.m_clientWidth;
- };
- PinFreezeContainer.prototype.getClientWidth=function(){
- return this.m_clientWidth;
- };
- PinFreezeContainer.prototype.getScrollableClientHeight=function(){
- return this.m_scrollableClientHeight;
- };
- PinFreezeContainer.prototype.setScrollableClientHeight=function(_aca){
- this.m_scrollableClientHeight=_aca;
- };
- PinFreezeContainer.prototype.getClientHeight=function(){
- return this.m_clientHeight;
- };
- PinFreezeContainer.prototype.clientHeight=function(_acb){
- return _acb.clientHeight;
- };
- PinFreezeContainer.prototype.findBestContainerHeight=function(_acc){
- if(this.m_freezeTop&&this.m_cachedReportDiv){
- var _acd=this.m_cachedReportDiv.parentNode;
- if(_acd){
- var _ace=this._findRestOfPageHeight(this.getContainer());
- return _acc-_ace-(this.c_pageMargin/2)-this.m_containerMargin.top;
- }
- }
- return _acc-this.c_pageMargin;
- };
- PinFreezeContainer.prototype.findBestContainerWidth=function(_acf){
- var node=this.getContainer();
- while(node&&node.nodeName.toLowerCase()!="td"&&node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
- node=node.parentNode;
- }
- if(!node){
- return -1;
- }
- if(node.nodeName.toLowerCase()=="td"){
- var _ad1=0;
- var _ad2=node.parentNode.childNodes;
- for(var i=0;i<_ad2.length;i++){
- if(_ad2[i]!==node){
- _ad1+=_ad2[i].clientWidth;
- }
- }
- return _acf-_ad1-(this.c_pageMargin/2);
- }
- return _acf;
- };
- PinFreezeContainer.prototype._findRestOfPageHeight=function(node){
- var _ad5=0;
- var _ad6=node.parentNode;
- if(!_ad6){
- return _ad5;
- }
- if(_ad6.childNodes.length>1){
- for(var i=0;i<_ad6.childNodes.length;i++){
- var _ad8=_ad6.childNodes[i];
- if(_ad8.nodeType==1){
- var _ad9=this.getStyleDisplay(_ad8);
- if(_ad8!=node&&!isNaN(_ad8.clientHeight)&&_ad9!="none"&&_ad9!="table-cell"){
- _ad5+=this.clientHeight(_ad8);
- }
- }
- }
- }
- if(node.getAttribute("id")!=("mainViewerTable"+this.m_viewerId)){
- _ad5+=this._findRestOfPageHeight(_ad6);
- }
- return _ad5;
- };
- PinFreezeContainer.prototype.resize=function(_ada,_adb,_adc,_add){
- if(this.m_fixedWidth&&this.m_fixedHeight){
- return;
- }
- _ada=(this.m_fixedWidth)?this.m_fixedWidth:_ada;
- _adb=(this.m_fixedHeight)?this.m_fixedHeight:_adb;
- var _ade=this.getSectionStructure();
- if(this.m_sectionCache&&this.m_cachedPFContainer){
- var _adf=0;
- if(_adb!==0){
- _adf=this.findBestContainerHeight(_adb);
- if(_adc&&_adf<300){
- _adf=300;
- }else{
- if(_adf<100){
- _adf=100;
- }
- }
- }
- this.m_clientHeight=_adf>0?_adf:this.m_clientHeight;
- var _ae0=0;
- if(_ada!==0){
- _ae0=this.findBestContainerWidth(_ada);
- }
- this.m_clientWidth=(_ae0>0)?_ae0-5-(this.c_pageMargin/2):this.m_clientWidth;
- var _ae1=this.getSection("pfMainOutput");
- var _ae2=this.getSectionHomeCell(_ae1);
- if(_ae2){
- this.m_scrollableClientWidth=this.m_clientWidth-this.getSideHeadingSectionWidth(_ae2);
- this.m_scrollableClientHeight=this.m_clientHeight-_ae2.offsetHeight;
- }
- if(_add){
- var _ae3=getElementsByAttribute(this.m_cachedPFContainer,"div","pflid",_add.lid);
- if(_ae3){
- var node=_ae3[0];
- while(node.nodeName.toLowerCase()!="table"){
- node=node.parentNode;
- }
- node.style.width=_add.width+"px";
- }
- }
- this.updateContainer();
- }else{
- this.m_clientWidth=_ada-this.c_pageMargin;
- this.m_clientHeight=_adb-this.c_pageMargin;
- }
- var _ae5=this.getSectionStructure();
- this.checkSectionStructureChange(_ade,_ae5);
- };
- PinFreezeContainer.prototype.updateMainOutputSize=function(){
- if(this.m_freezeSide&&this.m_freezeTop){
- if(this.frozenSideHeadingsRequired()){
- this.updateMainOutputWidth(this.getScrollableClientWidth());
- }
- if(this.frozenTopHeadingsRequired()){
- this.updateMainOutputHeight(this.getScrollableClientHeight());
- }
- }else{
- if(this.m_freezeSide){
- this.updateMainOutputWidth(this.getScrollableClientWidth());
- }else{
- if(this.m_freezeTop){
- this.updateMainOutputHeight(this.getScrollableClientHeight());
- }
- }
- }
- };
- PinFreezeContainer.prototype.updateMainOutputWidth=function(_ae6){
- var _ae7=this.getSection("pfMainOutput");
- if(!_ae7){
- return;
- }
- if(this.m_freezeSide==true){
- _ae7.style.width=(_ae6+"px");
- if(this.m_freezeTop==false||!this.frozenTopHeadingsRequired()){
- _ae7.style.height=_ae7.firstChild.clientHeight+"px";
- }
- var _ae8=this.getSection("pfHorizontalScrollBar");
- if(_ae8){
- _ae8.style.width=(_ae6+"px");
- var _ae9=_ae8.firstChild;
- if(_ae9){
- var _aea=this.getSectionHomeCell(_ae7);
- var _aeb=_ae7.scrollWidth-this.getHomeCellOffsetWidth(_aea);
- _ae9.style.width=_aeb+"px";
- }
- }
- }
- };
- PinFreezeContainer.prototype.updateMainOutputHeight=function(_aec){
- var _aed=this.getSection("pfMainOutput");
- if(!_aed){
- return;
- }
- _aed.style.height=(_aec+"px");
- if(!this.m_freezeSide||!this.frozenSideHeadingsRequired()){
- _aed.style.width=_aed.firstChild.clientWidth+2+"px";
- }
- var _aee=this.getSection("pfVerticalScrollBar");
- if(_aee){
- _aee.style.height=(_aec+"px");
- var _aef=_aee.firstChild;
- if(_aef){
- var _af0=this.getSectionHomeCell(_aed);
- var _af1=_aed.scrollHeight-_af0.offsetHeight;
- _aef.style.height=_af1+"px";
- }
- }
- };
- PinFreezeContainer.prototype.getElementByLID=function(_af2,tag,lid){
- var _af5=getElementsByAttribute(_af2,tag,"lid",lid);
- if(_af5.length>0){
- return _af5[0];
- }
- return null;
- };
- PinFreezeContainer.prototype.getContainerByLID=function(_af6){
- var _af7=getElementsByAttribute(_af6,"table","pfclid","pfContainer_"+this.m_lidNS);
- if(_af7.length>0){
- return _af7[0];
- }
- return null;
- };
- PinFreezeContainer.prototype.getSectionByLID=function(_af8,_af9){
- var _afa=getElementsByAttribute(_af8,"div","pfslid",_af9+"_"+this.m_lidNS);
- if(_afa.length>0){
- return _afa[0];
- }
- return null;
- };
- PinFreezeContainer.getSectionNameFromSlid=function(slid){
- return slid?slid.split("_")[0]:null;
- };
- PinFreezeContainer.getLidFromSlid=function(slid){
- return slid.split("_")[1];
- };
- PinFreezeContainer.nodeToSlid=function(_afd){
- while(_afd.parentNode&&!_afd.getAttribute("pfslid")){
- _afd=_afd.parentNode;
- }
- if(_afd.getAttribute){
- return _afd.getAttribute("pfslid");
- }
- return null;
- };
- PinFreezeContainer.prototype.cacheContainerAndSections=function(_afe){
- if(!_afe){
- return _afe;
- }
- this.m_cachedPFContainer=_afe;
- var _aff=getElementsByAttribute(this.m_cachedPFContainer,"div","pflid",this.m_lidNS);
- this.m_sectionCache={};
- for(var i=0;i<_aff.length;++i){
- var key=_aff[i].getAttribute("pfslid");
- key=key.split("_",1);
- this.m_sectionCache[key]=_aff[i];
- }
- return _afe;
- };
- PinFreezeContainer.prototype.getContainer=function(){
- return this.m_cachedPFContainer;
- };
- PinFreezeContainer.prototype.getSection=function(key){
- if(!this.m_sectionCache){
- return null;
- }
- if(!this.m_sectionCache[key]){
- this.m_sectionCache[key]=this.getSectionByLID(this.m_cachedPFContainer,key);
- }
- return this.m_sectionCache[key];
- };
- PinFreezeContainer.prototype.initializeHomeCellTabIndex=function(_b03){
- var slid=PinFreezeContainer.nodeToSlid(_b03);
- if(!this.m_homeCellNodes[slid]){
- var _b05=getElementsByAttribute(_b03,"*","tabIndex","*");
- for(var i in _b05){
- if(!_b05[i].getAttribute("widgetid")){
- this.m_homeCellNodes[slid]=_b05[i];
- break;
- }
- }
- }
- };
- PinFreezeContainer.prototype.updateTabIndexValues=function(){
- if(this.isContainerFrozen()){
- for(var slid in this.m_homeCellNodes){
- var _b08=this.m_pinFreezeManager.isNodeVisible(this.m_homeCellNodes[slid])?"0":"-1";
- this.m_homeCellNodes[slid].setAttribute("tabIndex",_b08);
- }
- }else{
- for(var slid in this.m_homeCellNodes){
- var _b08=(PinFreezeContainer.getSectionNameFromSlid(slid)==="pfMainOutput")?"0":"-1";
- this.m_homeCellNodes[slid].setAttribute("tabIndex",_b08);
- }
- }
- };
- PinFreezeContainer.prototype.getSectionHomeCell=function(_b09){
- if(_b09){
- var _b0a=this.getElementByLID(_b09,"table",this.m_lid+this.m_viewerId);
- if(_b0a&&_b0a.rows.length&&_b0a.rows[0].cells.length){
- return _b0a.rows[0].cells[0];
- }
- }
- return null;
- };
- PinFreezeContainer.prototype.getMainOutputHomeCell=function(){
- var _b0b=this.getSection("pfMainOutput");
- if(!_b0b){
- _b0b=this.getSectionByLID(this.m_cachedPFContainer,"pfMainOutput");
- }
- return this.getSectionHomeCell(_b0b);
- };
- PinFreezeContainer.prototype.getChildPosition=function(_b0c,_b0d){
- for(var i=0;i<_b0c.childNodes.length;++i){
- if(_b0c.childNodes[i]==_b0d){
- return i;
- }
- }
- return -1;
- };
- PinFreezeContainer.prototype.insertAt=function(_b0f,_b10,_b11){
- if(_b11==_b0f.childNodes.length){
- _b0f.appendChild(_b10);
- }else{
- _b0f.insertBefore(_b10,_b0f.childNodes[_b11]);
- }
- };
- PinFreezeContainer.prototype.synchScroll=function(){
- if(!this.m_cachedPFContainer){
- return;
- }
- var _b12=this.getMainOutputHomeCell();
- var _b13=this.getSection("pfMainOutput");
- var _b14=this.getSection("pfSideHeadings");
- if(_b14!=null){
- var _b15=this.getSection("pfHorizontalScrollBar");
- if(_b15){
- var _b16=this.getSideHeadingSectionWidth(_b12);
- if(getElementDirection(_b13)==="rtl"){
- _b16=0;
- }
- setScrollLeft(_b13,getScrollLeft(_b15)+_b16);
- if(this.m_freezeTop){
- setScrollLeft(this.getSection("pfTopHeadings"),getScrollLeft(_b15)+_b16);
- }
- }
- }
- };
- PinFreezeContainer.prototype.updateScroll=function(_b17){
- var slid=PinFreezeContainer.nodeToSlid(_b17);
- if(!slid){
- return;
- }
- var _b19=PinFreezeContainer.getSectionNameFromSlid(slid);
- if(!_b19){
- return;
- }
- var _b1a=document.getElementById("CVReport"+this.m_viewerId);
- if(!_b1a){
- return;
- }
- if(!this.m_cachedPFContainer){
- return;
- }
- var _b1b=_b17.parentNode;
- if(_b1b){
- var _b1c=_b1b.tagName.toLowerCase();
- if(_b1c==="td"||_b1c==="th"){
- var _b1d=this.getMainOutputHomeCell();
- var _b1e=this.getSection("pfMainOutput");
- if(_b19==="pfMainOutput"||_b19==="pfTopHeadings"){
- var _b1f=this.getSection("pfHorizontalScrollBar");
- if(_b1f){
- var _b20=PinFreezeContainer.calculateNewPosition(_b1b.offsetLeft,_b1b.offsetWidth,getScrollLeft(_b1e),_b1e.offsetWidth);
- var _b21=this.getHomeCellOffsetWidth(_b1d);
- if(getElementDirection(_b1e)==="rtl"){
- _b21=0;
- }
- setScrollLeft(_b1f,_b20-_b21);
- setScrollLeft(_b1e,_b20);
- }
- }
- if(_b19==="pfMainOutput"||_b19==="pfSideHeadings"){
- var _b22=this.getSection("pfVerticalScrollBar");
- if(_b22){
- var _b23=PinFreezeContainer.calculateNewPosition(_b1b.offsetTop,_b1b.offsetHeight,_b1e.scrollTop,_b1e.offsetHeight);
- _b22.scrollTop=_b23-_b1d.offsetHeight;
- _b1e.scrollTop=_b23;
- }
- }
- }
- }
- };
- PinFreezeContainer.calculateNewPosition=function(_b24,_b25,_b26,_b27){
- var _b28=_b24+_b25;
- var _b29=_b26+_b27;
- if(_b26>_b24){
- return _b24;
- }else{
- if(_b29<_b28){
- if(_b25>_b27){
- return _b24;
- }
- return _b28-_b27;
- }
- }
- return _b26;
- };
- PinFreezeContainer.prototype.synchVScroll=function(){
- if(!this.m_cachedPFContainer){
- return;
- }
- var _b2a=this.getMainOutputHomeCell();
- var _b2b=this.getSection("pfMainOutput");
- var _b2c=this.getSection("pfTopHeadings");
- if(_b2c!=null){
- var _b2d=this.getSection("pfVerticalScrollBar");
- if(_b2d){
- _b2b.scrollTop=_b2d.scrollTop+this.getTopHeadingSectionHeight(_b2a);
- if(this.m_freezeSide){
- this.getSection("pfSideHeadings").scrollTop=_b2d.scrollTop+this.getTopHeadingSectionHeight(_b2a);
- }
- }
- }
- };
- PinFreezeContainer.prototype.getTopHeadingSectionHeight=function(_b2e){
- return _b2e.offsetHeight+_b2e.offsetTop+this.m_containerMargin.top;
- };
- PinFreezeContainer.prototype._findBestGuessHomeCell=function(_b2f){
- if(this.m_bestGuessHomeCell){
- return this.m_bestGuessHomeCell;
- }
- if(_b2f){
- var _b30=_b2f.parentNode.parentNode;
- var _b31=_b2f.rowSpan?(_b2f.rowSpan):1;
- var tr=_b30.childNodes[_b31];
- if(tr){
- var _b33=tr.childNodes.length;
- var _b34=null;
- var td=null;
- for(var i=0;i<_b33;i++){
- td=tr.childNodes[i];
- if(td.getAttribute("type")=="datavalue"){
- break;
- }
- _b34=td;
- }
- if(_b34){
- this.m_bestGuessHomeCell=_b34;
- return this.m_bestGuessHomeCell;
- }
- }else{
- return _b2f;
- }
- }
- return null;
- };
- PinFreezeContainer.prototype.getHomeCellOffsetWidth=function(_b37){
- var _b38=this._findBestGuessHomeCell(_b37);
- return _b38?_b38.offsetWidth:0;
- };
- PinFreezeContainer.prototype.getSideHeadingSectionWidth=function(_b39){
- var _b3a=this._findBestGuessHomeCell(_b39);
- if(_b3a){
- return _b3a.offsetWidth+_b3a.offsetLeft+this.m_containerMargin.left;
- }else{
- return _b39.offsetWidth+_b39.offsetLeft;
- }
- };
- PinFreezeContainer.prototype.isContainerFrozen=function(){
- return (this.m_freezeTop||this.m_freezeSide);
- };
- PinFreezeContainer.prototype.unfreeze=function(_b3b){
- var _b3c=this.getContainerByLID(_b3b);
- this.m_freezeTop=false;
- this.m_freezeSide=false;
- if(_b3c){
- var _b3d=_b3c.parentNode;
- pfMainOutput=this.getSectionByLID(_b3c,"pfMainOutput");
- if(pfMainOutput&&_b3d){
- if(_b3c.style.border!==""){
- pfMainOutput.firstChild.style.border=_b3c.style.border;
- _b3c.style.border="";
- }
- if(this.m_wrapFlag){
- var _b3e=pfMainOutput.firstChild.getElementsByTagName("span");
- if(_b3e){
- for(var k=0;k<_b3e.length;k++){
- _b3e[k].style.whiteSpace="";
- }
- }
- this.m_wrapFlag=false;
- }
- this.updateTabIndexValues();
- if(this.m_cachedBaseContainer.getAttribute("authoredFixedWidth")){
- this.m_cachedBaseContainer.removeAttribute("authoredFixedWidth");
- this.m_cachedBaseContainer.style.width="auto";
- this.m_addedFixedWidth=null;
- }
- if(this.m_cachedBaseContainer.getAttribute("authoredFixedHeight")){
- this.m_cachedBaseContainer.removeAttribute("authoredFixedHeight");
- this.m_cachedBaseContainer.style.height="auto";
- this.m_addedFixedHeight=null;
- }
- _b3d.replaceChild(this.m_pinFreezeManager.deepCloneNode(pfMainOutput.firstChild),_b3c);
- }
- }
- };
- PinFreezeContainer.prototype.getBorderInfo=function(el,_b41){
- var _b42={};
- var _b43="border-"+_b41+"-";
- var _b44="border"+_b41.charAt(0).toUpperCase()+_b41.substring(1);
- if(el.currentStyle){
- _b42[_b44+"Width"]=el.currentStyle[_b44+"Width"];
- _b42[_b44+"Style"]=el.currentStyle[_b44+"Style"];
- _b42[_b44+"Color"]=el.currentStyle[_b44+"Color"];
- }else{
- if(window.getComputedStyle){
- _b42[_b44+"Width"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"width");
- _b42[_b44+"Style"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"style");
- _b42[_b44+"Color"]=window.getComputedStyle(el,null).getPropertyValue(_b43+"color");
- }else{
- return null;
- }
- }
- return _b42;
- };
- PinFreezeContainer.prototype.isA11yEnabled=function(_b45){
- return (_b45.getAttribute("role")==="grid");
- };
- PinFreezeContainer.isElementInMainOutput=function(_b46){
- var _b47=PinFreezeContainer.nodeToSlid(_b46);
- if(_b47){
- return (_b47.indexOf("pfMainOutput_")===0);
- }
- return false;
- };
- PinFreezeContainer.prototype.removeCTX=function(_b48){
- _b48.removeAttribute("ctx");
- var _b49=getElementsByAttribute(_b48,"*","ctx","*");
- if(_b49&&_b49.length){
- for(var i=0;i<_b49.length;i++){
- _b49[i].removeAttribute("ctx");
- }
- }
- };
- PinFreezeContainer.prototype.initializeTouchScrolling=function(_b4b){
- if(!this.m_pinFreezeManager.isIWidgetMobile()){
- return;
- }
- if(_b4b){
- _b4b.m_pinFreezeContainer=this;
- if(document.attachEvent){
- _b4b.attachEvent("touchstart",this.touchStart);
- _b4b.attachEvent("touchmove",this.touchMove);
- _b4b.attachEvent("touchend",this.touchEnd);
- }else{
- _b4b.addEventListener("touchstart",this.touchStart,false);
- _b4b.addEventListener("touchmove",this.touchMove,false);
- _b4b.addEventListener("touchend",this.touchEnd,false);
- }
- }
- };
- PinFreezeContainer.prototype.removeTouchScrolling=function(){
- if(!this.m_pinFreezeManager.isIWidgetMobile()){
- return;
- }
- this.removeTouchScrollingEvents(this.getSection("pfMainOutput"));
- this.removeTouchScrollingEvents(this.getSection("pfSideHeadings"));
- this.removeTouchScrollingEvents(this.getSection("pfTopHeadings"));
- };
- PinFreezeContainer.prototype.removeTouchScrollingEvents=function(_b4c){
- if(!this.m_pinFreezeManager.isIWidgetMobile()){
- return;
- }
- if(_b4c){
- if(document.detachEvent){
- _b4c.detachEvent("touchstart",this.touchStart);
- _b4c.detachEvent("touchmove",this.touchMove);
- _b4c.detachEvent("touchend",this.touchEnd);
- }else{
- _b4c.removeEventListener("touchstart",this.touchStart,false);
- _b4c.removeEventListener("touchmove",this.touchMove,false);
- _b4c.removeEventListener("touchend",this.touchEnd,false);
- }
- }
- };
- PinFreezeContainer.prototype.touchMove=function(e){
- if(this.m_pinFreezeContainer&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
- var _b4e=e.changedTouches[0];
- if(_b4e&&_b4e.clientX&&_b4e.clientY){
- var _b4f=parseInt(_b4e.clientX);
- var _b50=parseInt(_b4e.clientY);
- if(this.m_pinFreezeContainer.touchMoveHandler(_b4f,_b50)){
- return stopEventBubble(e);
- }
- }
- }
- };
- PinFreezeContainer.prototype.touchStart=function(e){
- if(this.m_pinFreezeContainer&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
- var _b52=e.changedTouches[0];
- if(_b52&&_b52.clientX&&_b52.clientY){
- var _b53=parseInt(_b52.clientX);
- var _b54=parseInt(_b52.clientY);
- this.m_pinFreezeContainer.touchStartHandler(_b53,_b54);
- }
- }
- };
- PinFreezeContainer.prototype.touchStartHandler=function(_b55,_b56){
- this.touchScrollSections=false;
- this.touchPreviousX=_b55;
- this.touchPreviousY=_b56;
- };
- PinFreezeContainer.prototype.touchEnd=function(e){
- if(this.m_pinFreezeContainer&&this.m_pinFreezeContainer.touchEndHandler()){
- stopEventBubble(e);
- }
- };
- PinFreezeContainer.prototype.touchEndHandler=function(){
- var _b58=this.touchScrollSections;
- this.touchScrollSections=false;
- this.touchPreviousX=-1;
- this.touchPreviousY=-1;
- return _b58;
- };
- PinFreezeContainer.prototype.touchMoveHandler=function(_b59,_b5a){
- var _b5b=this.getSection("pfMainOutput");
- if(!_b5b){
- return;
- }
- var _b5c=this.getSectionHomeCell(_b5b);
- var _b5d=this.getTopHeadingSectionHeight(_b5c);
- var _b5e=this.getSideHeadingSectionWidth(_b5c);
- var _b5f=_b5a-this.touchPreviousY;
- var _b60=_b59-this.touchPreviousX;
- if(this.touchScrollSections){
- if(_b5f!=0){
- var _b61=_b5b.scrollTop-_b5f;
- _b61=(_b61>_b5d)?_b61:_b5d;
- _b5b.scrollTop=_b61;
- var _b62=this.getSection("pfSideHeadings");
- if(_b62){
- _b62.scrollTop=_b61;
- }
- }
- if(_b60!=0){
- var _b63=_b5b.scrollLeft-_b60;
- _b63=(_b63>_b5e)?_b63:_b5e;
- _b5b.scrollLeft=_b63;
- var _b64=this.getSection("pfTopHeadings");
- if(_b64){
- _b64.scrollLeft=_b63;
- }
- }
- }else{
- this.firstTouchMove(_b5b,_b60,_b5f,_b5e,_b5d);
- }
- this.touchPreviousX=_b59;
- this.touchPreviousY=_b5a;
- return this.touchScrollSections;
- };
- PinFreezeContainer.prototype.firstTouchMove=function(_b65,_b66,_b67,_b68,_b69){
- var _b6a=this.mostlyVerticalTouchMove(_b66,_b67);
- var _b6b=PinFreezeContainer.isSectionVisible(this.getSection("pfTopHeadings"));
- var _b6c=PinFreezeContainer.isSectionVisible(this.getSection("pfSideHeadings"));
- if(_b6a&&(!_b6b||(_b67>0&&_b65.scrollTop<=_b69)||(_b67<0&&_b65.scrollTop+_b65.clientHeight>=_b65.scrollHeight))){
- this.touchScrollSections=false;
- }else{
- if(!_b6a&&(!_b6c||(_b66>0&&_b65.scrollLeft<=_b68)||(_b66<0&&_b65.scrollLeft+_b65.clientWidth>=_b65.scrollWidth))){
- this.touchScrollSections=false;
- }else{
- this.touchScrollSections=true;
- }
- }
- };
- PinFreezeContainer.prototype.mostlyVerticalTouchMove=function(_b6d,_b6e){
- var _b6f=(_b6d>0)?_b6d:0-_b6d;
- var _b70=(_b6e>0)?_b6e:0-_b6e;
- return (_b70>_b6f);
- };
- PinFreezeContainer.prototype.destroy=function(){
- this.removeTouchScrolling();
- GUtil.destroyProperties(this);
- };
- function PinFreezeManager(oCV){
- this.m_oCV=oCV;
- this.m_viewerId=oCV.getId();
- this.m_frozenInfo=null;
- this.m_lastWidthProcessed=0;
- this.m_lastHeightProcessed=0;
- this.c_resizeTweekLimit=5;
- this.m_repaintOnVisible=false;
- };
- PinFreezeManager.prototype.addContainerObject=function(lid,_b73,_b74,_b75,_b76){
- if(_b73||_b74){
- if(!this.m_frozenInfo){
- this.m_frozenInfo={};
- }
- if(!this.m_frozenInfo[lid]){
- this._createDefaultFrozenInfo(lid);
- }
- this.m_frozenInfo[lid].freezeTop=_b73;
- this.m_frozenInfo[lid].freezeSide=_b74;
- var _b77=this.newContainer(lid,_b73,_b74,_b75,_b76);
- this.m_frozenInfo[lid].pinFreezeContainers.push(_b77);
- return _b77;
- }
- return null;
- };
- PinFreezeManager.prototype.newContainer=function(lid,_b79,_b7a,_b7b,_b7c){
- return new PinFreezeContainer(this,lid,this.m_viewerId,_b79,_b7a,_b7b,_b7c);
- };
- PinFreezeManager.prototype.clearPinInfo=function(lid){
- if(!this.m_frozenInfo){
- return;
- }
- if(lid){
- if(this.m_frozenInfo[lid]){
- delete this.m_frozenInfo[lid];
- }
- }else{
- delete this.m_frozenInfo;
- this.m_frozenInfo=null;
- }
- };
- PinFreezeManager.prototype._createDefaultFrozenInfo=function(lid){
- this.m_frozenInfo[lid]={"lid":lid,"freezeTop":false,"freezeSide":false,"pinFreezeContainers":[],"childContainers":{}};
- };
- PinFreezeManager.prototype._resetFrozenInfo=function(lid){
- var _b80=this.m_frozenInfo[lid];
- if(_b80){
- delete _b80.pinFreezeContainers;
- _b80.pinFreezeContainers=[];
- _b80.freezeTop=false;
- _b80.freezeSide=false;
- }
- };
- PinFreezeManager.prototype.prepopulateFrozenInfo=function(_b81){
- var _b82=getDescendantElementsByAttribute(_b81,"table","lid","",false,-1,new RegExp("[\\s\\S]*"));
- if(_b82){
- if(!this.m_frozenInfo){
- this.m_frozenInfo={};
- }
- for(var i=0;i<_b82.length;i++){
- var _b84=_b82[i];
- if(_b84.getAttribute("id")=="rt"+this.m_viewerId){
- continue;
- }
- var lid=this.removeNamespace(_b84.getAttribute("lid"));
- if(this.m_frozenInfo[lid]&&this.m_frozenInfo[lid].childContainers){
- continue;
- }
- if(!this.m_frozenInfo[lid]){
- this._createDefaultFrozenInfo(lid);
- }
- if(!this.m_frozenInfo[lid].childContainers){
- this.m_frozenInfo[lid].childContainers={};
- }
- var _b86=getDescendantElementsByAttribute(_b84,"table","lid","",false,-1,new RegExp("[\\s\\S]*"));
- if(_b86){
- for(var _b87=0;_b87<_b86.length;_b87++){
- var _b88=_b86[_b87];
- var _b89=this.removeNamespace(_b88.getAttribute("lid"));
- if(!this.m_frozenInfo[lid].childContainers[_b89]){
- var _b8a=_b88.parentNode;
- while(_b8a&&!_b8a.getAttribute("lid")){
- _b8a=_b8a.parentNode;
- }
- if(_b8a&&this.removeNamespace(_b8a.getAttribute("lid"))==lid){
- this.m_frozenInfo[lid].childContainers[_b89]=true;
- }
- }
- }
- }
- }
- this._updateParentContainerInfo();
- }
- };
- PinFreezeManager.prototype._updateParentContainerInfo=function(){
- for(var _b8b in this.m_frozenInfo){
- var _b8c=this.m_frozenInfo[_b8b].childContainers;
- if(_b8c){
- for(var _b8d in _b8c){
- if(this.m_frozenInfo[_b8d]){
- this.m_frozenInfo[_b8d].parentContainer=_b8b;
- break;
- }
- }
- }
- }
- };
- PinFreezeManager.prototype.getTopLevelContainerLID=function(lid){
- if(this.m_frozenInfo[lid]){
- while(this.m_frozenInfo[lid].parentContainer){
- lid=this.m_frozenInfo[lid].parentContainer;
- }
- }
- return lid;
- };
- PinFreezeManager.prototype.freezeContainer=function(lid,_b90,_b91){
- var _b92=document.getElementById("CVReport"+this.m_viewerId);
- this.prepopulateFrozenInfo(_b92);
- var _b93=this.getTopLevelContainerLID(lid);
- this.unfreezeAllNestedContainers(_b93,_b92);
- this.m_frozenInfo[lid].freezeTop=_b90;
- this.m_frozenInfo[lid].freezeSide=_b91;
- var _b94=this._createPinAndFreezeObject(_b92,_b93);
- this.m_lastWidthProcessed=0;
- this.m_lastHeightProcessed=0;
- this._resizePinFreezeObjects(_b94);
- this.sectionStructureChange();
- if(isIE()){
- var obj=this;
- setTimeout(function(){
- obj.refresh();
- },1);
- var _b96=document.getElementById("RVContent"+this.m_viewerId);
- this.m_oCV.repaintDiv(_b96);
- }
- return _b94;
- };
- PinFreezeManager.prototype.getInitialWidthThreshold=function(){
- return document.body.clientWidth*3/4;
- };
- PinFreezeManager.prototype.getInitialHeightThreshold=function(){
- return document.body.clientWidth*9/10;
- };
- PinFreezeManager.prototype.hasFrozenContainers=function(){
- return ((this.m_frozenInfo)?true:false);
- };
- PinFreezeManager.prototype.hasFrozenRowHeadings=function(lid){
- if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
- return this.m_frozenInfo[lid].freezeSide?this.m_frozenInfo[lid].freezeSide:false;
- }
- return false;
- };
- PinFreezeManager.prototype.hasFrozenColumnHeadings=function(lid){
- if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
- return this.m_frozenInfo[lid].freezeTop?this.m_frozenInfo[lid].freezeTop:false;
- }
- return false;
- };
- PinFreezeManager.prototype.removeNamespace=function(idNS){
- if(idNS.length>this.m_viewerId.length){
- if(idNS.indexOf(this.m_viewerId)>0){
- return idNS.substring(0,idNS.indexOf(this.m_viewerId));
- }
- }
- return idNS;
- };
- PinFreezeManager.prototype.getContainer=function(lid,_b9b){
- if(this.m_frozenInfo&&this.m_frozenInfo[lid]&&this.m_frozenInfo[lid].pinFreezeContainers[0]){
- _b9b=_b9b?_b9b:0;
- return this.m_frozenInfo[lid].pinFreezeContainers[_b9b];
- }
- return null;
- };
- PinFreezeManager.prototype.nodeToContainer=function(node){
- var slid=PinFreezeContainer.nodeToSlid(node);
- var _b9e=null;
- if(slid){
- var lid=this.removeNamespace(PinFreezeContainer.getLidFromSlid(slid));
- _b9e=this.getContainer(lid);
- }
- return _b9e;
- };
- PinFreezeManager.prototype.getContainerElement=function(_ba0){
- var lid=this.removeNamespace(_ba0.getAttribute("lid"));
- if(lid){
- var _ba2=this.getContainer(lid);
- if(_ba2){
- return _ba2.getContainer();
- }
- }
- return null;
- };
- PinFreezeManager.prototype._createPinAndFreezeObject=function(_ba3,lid){
- var _ba5=null;
- if(this.m_frozenInfo){
- var _ba6=this.m_frozenInfo[lid];
- var _ba7=_ba6.initialLoad;
- if(_ba7){
- delete _ba6.initialLoad;
- }
- var _ba8=_ba6.freezeTop;
- var _ba9=_ba6.freezeSide;
- var _baa=null;
- if(_ba7&&_ba6.pinFreezeContainers&&(_ba8||_ba9)){
- _baa=_ba6.pinFreezeContainers.slice(0);
- }
- var _bab=_ba3;
- if(_ba6&&_ba6.parentContainer){
- var _bac=getElementsByAttribute(_ba3,"table","lid",_ba6.parentContainer+this.m_viewerId);
- if(_bac){
- for(parentIndex=0;parentIndex<_bac.length;parentIndex++){
- if(!_bac[parentIndex].getAttribute("clonednode")){
- _bab=_bac[parentIndex];
- break;
- }
- }
- }
- }
- if(_ba6.childContainers){
- for(var _bad in _ba6.childContainers){
- var _bae=this._createPinAndFreezeObject(_bab,_bad);
- _ba5=_ba5?_ba5:_bae;
- }
- }
- var _baf=getElementsByAttribute(_bab,"table","lid",lid+this.m_viewerId);
- if(_baf&&_baf.length>0){
- delete _ba6.pinFreezeContainers;
- _ba6.pinFreezeContainers=[];
- }else{
- return null;
- }
- if(_baf&&(_ba8||_ba9)){
- var _bb0=(_ba5!==null);
- for(var i=0;i<_baf.length;i++){
- var _bb2=_baf[i];
- if(_bb2.getAttribute("clonednode")=="true"){
- continue;
- }
- _ba5=this.addContainerObject(lid,_ba8,_ba9,_bb2,i);
- if(_ba5){
- _ba5.createPFContainer(_bab,_bb0);
- if(_ba7){
- _ba5.copyProperties(_baa[0]);
- }
- _ba5.freezeContainerInReport(_ba3);
- }
- }
- }
- }
- return _ba5;
- };
- PinFreezeManager.prototype.renderReportWithFrozenContainers=function(_bb3){
- if(this.m_frozenInfo){
- var _bb4=false;
- var _bb5=null;
- for(var _bb6 in this.m_frozenInfo){
- var _bb7=this.m_frozenInfo[_bb6];
- if(!_bb4){
- _bb4=_bb7.initialLoad;
- }
- if(!_bb7.parentContainer){
- var temp=this._createPinAndFreezeObject(_bb3,_bb7.lid);
- _bb5=_bb5?_bb5:temp;
- }
- }
- if(!_bb4&&_bb5){
- this._resizePinFreezeObjects(_bb5);
- }
- this.refresh();
- }
- };
- PinFreezeManager.prototype._resizePinFreezeObjects=function(_bb9){
- var _bba,_bbb;
- var _bbc=this.m_oCV.getViewerWidget();
- if(_bbc){
- var size=_bbc.getWidgetSize();
- _bbb=(size&&size.w&&(size.w<this.getInitialWidthThreshold()))?size.w:_bb9.getClientWidth();
- _bba=(size&&size.h&&(size.h<this.getInitialHeightThreshold()))?size.h:_bb9.getClientHeight();
- }else{
- var _bbe=document.getElementById("RVContent"+this.m_viewerId);
- var _bbf=document.getElementById("mainViewerTable"+this.m_viewerId);
- _bbb=_bbe.clientWidth;
- _bba=_bbf.clientHeight;
- }
- this.m_lastWidthProcessed=0;
- this.m_lastHeightProcessed=0;
- this.resize(_bbb,_bba);
- };
- PinFreezeManager.prototype.resize=function(_bc0,_bc1){
- var _bc2=(Math.abs(_bc0-this.m_lastWidthProcessed)<this.c_resizeTweekLimit);
- var _bc3=(Math.abs(_bc1-this.m_lastHeightProcessed)<this.c_resizeTweekLimit);
- if(_bc2&&_bc3){
- return;
- }
- var _bc4=(Math.abs(_bc0-this.m_lastWidthProcessed)>2)?_bc0:0;
- var _bc5=(Math.abs(_bc1-this.m_lastHeightProcessed)>2)?_bc1:0;
- for(var lid in this.m_frozenInfo){
- if(!this.m_frozenInfo[lid].parentContainer){
- this.resizeContainer(lid,_bc4,_bc5);
- }
- }
- this.m_lastWidthProcessed=_bc0;
- this.m_lastHeightProcessed=_bc1;
- };
- PinFreezeManager.prototype.resizeContainer=function(lid,_bc8,_bc9){
- var _bca=this.m_frozenInfo[lid];
- if(_bca){
- var _bcb=null;
- if(_bca.childContainers){
- var _bcc=_bc8>10?_bc8-10:_bc8;
- var _bcd=_bc9>10?_bc9-10:_bc9;
- for(var _bce in _bca.childContainers){
- _bcb=this.resizeContainer(_bce,_bcc,_bcd);
- }
- }
- var _bcf=_bca.pinFreezeContainers;
- var _bd0=null;
- var _bd1=null;
- if(_bcf){
- for(var i=0;i<_bcf.length;i++){
- _bd0=_bcf[i];
- _bd0.resize(_bc8,_bc9,_bca.parentContainer,_bcb);
- var _bd3=_bd0.getContainer();
- if(_bd3&&(!_bd1||(_bd1.width<_bd3.clientWidth))){
- _bd1={"width":_bd3.clientWidth,"lid":_bd0.m_lidNS};
- }
- }
- }
- return _bd1;
- }
- };
- PinFreezeManager.prototype.processAutoResize=function(_bd4,_bd5){
- this.m_lastWidthProcessed=_bd4;
- this.m_lastHeightProcessed=_bd5;
- };
- PinFreezeManager.prototype.onSetVisible=function(){
- this.refresh();
- if(this.m_repaintOnVisible){
- this.rePaint();
- this.m_repaintOnVisible=false;
- }
- };
- PinFreezeManager.prototype.onResizeCanvas=function(_bd6){
- if(_bd6){
- this.rePaint();
- }else{
- this.m_repaintOnVisible=true;
- }
- };
- PinFreezeManager.prototype.rePaint=function(){
- for(var lid in this.m_frozenInfo){
- if(!this.m_frozenInfo[lid].parentContainer){
- this.resizeContainer(lid,this.m_lastWidthProcessed,this.m_lastHeightProcessed);
- }
- }
- };
- PinFreezeManager.prototype.refresh=function(){
- for(var _bd8 in this.m_frozenInfo){
- var _bd9=this.m_frozenInfo[_bd8].pinFreezeContainers;
- if(_bd9){
- for(var i=0;i<_bd9.length;i++){
- var _bdb=_bd9[i];
- _bdb.synchScroll();
- _bdb.synchVScroll();
- }
- }
- }
- };
- PinFreezeManager.prototype.freezeContainerRowHeadings=function(lid){
- return this.freezeContainer(lid,this.hasFrozenColumnHeadings(lid),true);
- };
- PinFreezeManager.prototype.freezeSelectedRowHeadings=function(){
- var lid=this.getValidSelectedContainerId(false);
- if(lid){
- this.m_oCV.getSelectionController().resetSelections();
- return this.freezeContainerRowHeadings(lid);
- }
- return null;
- };
- PinFreezeManager.prototype.canFreezeSelectedRowHeadings=function(){
- var lid=this.getValidSelectedContainerId(false);
- if(lid){
- return (!this.hasFrozenRowHeadings(lid));
- }
- return false;
- };
- PinFreezeManager.prototype.unfreezeContainerRowHeadings=function(lid){
- this.freezeContainer(lid,this.hasFrozenColumnHeadings(lid),false);
- };
- PinFreezeManager.prototype.unfreezeSelectedRowHeadings=function(){
- var lid=this.getValidSelectedContainerId(false);
- if(lid){
- this.m_oCV.getSelectionController().resetSelections();
- this.unfreezeContainerRowHeadings(lid);
- }
- };
- PinFreezeManager.prototype.canUnfreezeSelectedRowHeadings=function(){
- var lid=this.getValidSelectedContainerId(false);
- if(lid){
- return (this.hasFrozenRowHeadings(lid));
- }
- return false;
- };
- PinFreezeManager.prototype.freezeContainerColumnHeadings=function(lid){
- return this.freezeContainer(lid,true,this.hasFrozenRowHeadings(lid));
- };
- PinFreezeManager.prototype.freezeSelectedColumnHeadings=function(){
- var lid=this.getValidSelectedContainerId(true);
- if(lid){
- this.m_oCV.getSelectionController().resetSelections();
- return this.freezeContainerColumnHeadings(lid);
- }
- return null;
- };
- PinFreezeManager.prototype.canFreezeSelectedColumnHeadings=function(){
- var lid=this.getValidSelectedContainerId(true);
- if(lid){
- return (!this.hasFrozenColumnHeadings(lid));
- }
- return false;
- };
- PinFreezeManager.prototype.unfreezeContainerColumnHeadings=function(lid){
- this.freezeContainer(lid,false,this.hasFrozenRowHeadings(lid));
- };
- PinFreezeManager.prototype.unfreezeSelectedColumnHeadings=function(){
- var lid=this.getValidSelectedContainerId(true);
- if(lid){
- this.m_oCV.getSelectionController().resetSelections();
- this.unfreezeContainerColumnHeadings(lid);
- }
- };
- PinFreezeManager.prototype.canUnfreezeSelectedColumnHeadings=function(){
- var lid=this.getValidSelectedContainerId(true);
- if(lid){
- return (this.hasFrozenColumnHeadings(lid));
- }
- return false;
- };
- PinFreezeManager.prototype.getValidSelectedContainerId=function(_be8){
- var _be9=this.m_oCV.getSelectionController().getAllSelectedObjects();
- if(_be9&&_be9.length&&(_be9[0].getDataContainerType()==="crosstab"||(_be8&&_be9[0].getDataContainerType()==="list"))){
- var lid=(_be9[0].getLayoutElementId());
- if(lid){
- if(!this.hasPromptControlsInFreezableCells(lid)){
- return this.removeNamespace(lid);
- }
- }
- }
- return null;
- };
- PinFreezeManager.prototype.hasPromptControlsInFreezableCells=function(lid){
- var _bec=this.m_oCV.getLayoutElementFromLid(lid);
- var _bed=getElementsByAttribute(_bec,["td","th"],"type","columnTitle");
- var _bee=new RegExp("(^|[W])clsPromptComponent($|[W])");
- var _bef=isIE()?"className":"class";
- for(var j in _bed){
- if(_bed.hasOwnProperty(j)){
- var _bf1=getElementsByAttribute(_bed[j],"*",_bef,null,1,_bee);
- if(_bf1.length>0){
- return true;
- }
- }
- }
- return false;
- };
- PinFreezeManager.prototype.unfreeze=function(lid,_bf3,_bf4){
- if(this.m_frozenInfo&&this.m_frozenInfo[lid]){
- var _bf5=this.m_frozenInfo[lid].pinFreezeContainers;
- if(_bf5){
- for(var i=0;i<_bf5.length;i++){
- var _bf7=_bf5[i];
- _bf7.unfreeze(_bf3);
- }
- if(_bf4){
- this._resetFrozenInfo(lid);
- }
- }
- }
- };
- PinFreezeManager.prototype.unfreezeAllNestedContainers=function(lid,_bf9){
- var _bfa=this.m_frozenInfo[lid];
- if(_bfa){
- if(_bfa.freezeTop||_bfa.freezeSide){
- this.unfreeze(lid,_bf9,false);
- }
- if(_bfa.childContainers){
- for(var _bfb in _bfa.childContainers){
- this.unfreezeAllNestedContainers(_bfb,_bf9);
- }
- }
- }
- };
- PinFreezeManager.prototype.isNodeVisible=function(node){
- var slid=PinFreezeContainer.nodeToSlid(node);
- if(!slid){
- return true;
- }
- var lid=this.removeNamespace(PinFreezeContainer.getLidFromSlid(slid));
- var _bff=this.getContainer(lid);
- if(!_bff){
- return true;
- }
- var _c00=PinFreezeContainer.getSectionNameFromSlid(slid);
- var _c01=_bff.getSection(_c00);
- var _c02=null,_c03=null;
- var _c04=node;
- var _c05=null;
- while(_c04&&_c04!==_c01&&!_c02&&!_c03){
- _c02=_bff.getMain(_c04);
- _c03=_bff.getCopy(_c04);
- _c05=_c04;
- _c04=_c04.parentNode;
- }
- var _c06=_c02?true:false;
- var _c07=_c03?true:false;
- if(_c06){
- return _bff.getCopy(_c02)===_c05;
- }else{
- if(_c07){
- return _bff.getCopy(_c05)?false:true;
- }else{
- return true;
- }
- }
- };
- PinFreezeManager.prototype.sectionStructureChange=function(){
- var _c08=this.m_oCV.getViewerWidget();
- if(_c08&&_c08.getAnnotationHelper()){
- _c08.getAnnotationHelper().repositionCommentIndicators();
- }
- };
- PinFreezeManager.prototype.deepCloneNode=function(_c09){
- var copy=_c09.cloneNode(true);
- var _c0b=this.m_oCV.getViewerWidget();
- if(_c0b){
- if(_c0b.reportContainsDijits()){
- var _c0c=getElementsByAttribute(copy,"*","widgetid","*");
- if(_c0c&&_c0c.length){
- for(var i=0;i<_c0c.length;i++){
- _c0c[i].parentNode.removeChild(_c0c[i]);
- }
- }
- }
- }
- return copy;
- };
- PinFreezeManager.prototype.toJSONString=function(){
- var _c0e="";
- var _c0f="";
- for(var _c10 in this.m_frozenInfo){
- if(_c0e.length>0){
- _c0e+=",";
- }
- var _c11=this.m_frozenInfo[_c10];
- _c0e+="{";
- _c0e+="\"lid\":\""+_c11.lid.replace("\"","\\\"")+"\",";
- _c0e+="\"freezeTop\":"+_c11.freezeTop+",";
- _c0e+="\"freezeSide\":"+_c11.freezeSide+",";
- if(_c11.parentContainer){
- _c0e+="\"parentContainer\":\""+_c11.parentContainer+"\",";
- }
- if(_c11.pinFreezeContainers&&_c11.pinFreezeContainers.length>0){
- _c0e+="\"properties\":"+_c11.pinFreezeContainers[0].toJSONString()+",";
- }
- _c0e+="\"childContainers\": {";
- if(_c11.childContainers){
- var _c12=true;
- for(var _c13 in _c11.childContainers){
- if(!_c12){
- _c0e+=",";
- }
- _c0e+="\""+_c13+"\":true";
- _c12=false;
- }
- }
- _c0e+="}}";
- }
- if(_c0e.length>0){
- _c0f="{\"version\":1, \"containers\":["+_c0e+"]}";
- }
- return _c0f;
- };
- PinFreezeManager.prototype.fromJSONString=function(_c14){
- if(!_c14||_c14.length===0){
- return;
- }
- var _c15=null;
- try{
- _c15=eval("("+_c14+")");
- }
- catch(e){
- if(typeof console!="undefined"){
- console.log("PinFreezeManager.prototype.fromJSON could not parse JSON - "+_c14);
- console.log(e);
- }
- }
- if(!_c15){
- return;
- }
- var _c16=_c15.containers;
- var _c17=_c15.version;
- if(_c16.length>0){
- this.m_frozenInfo={};
- }
- for(var _c18=0;_c18<_c16.length;_c18++){
- var _c19=_c16[_c18];
- var lid=_c19.lid;
- var _c1b=_c19.freezeTop;
- var _c1c=_c19.freezeSide;
- var _c1d=document.getElementById("CVReport"+this.m_viewerId);
- var _c1e=getElementsByAttribute(_c1d,"table","lid",lid+this.m_viewerId);
- var _c1f=[];
- if(_c1e&&(_c1b||_c1c)){
- for(var i=0;i<_c1e.length;i++){
- var _c21=_c1e[i];
- var _c22=new PinFreezeContainer(this,lid,this.m_viewerId,_c19.freezeTop,_c19.freezeSide,_c21,i);
- if(_c19.properties){
- applyJSONProperties(_c22,_c19.properties);
- }
- _c1f.push(_c22);
- }
- }
- this.m_frozenInfo[lid]={"lid":lid,"freezeTop":_c1b,"freezeSide":_c1c,"pinFreezeContainers":_c1f,"initialLoad":true};
- if(_c17>=1){
- if(_c19.childContainers){
- this.m_frozenInfo[lid].childContainers=_c19.childContainers;
- }
- if(_c19.parentContainer){
- this.m_frozenInfo[lid].parentContainer=_c19.parentContainer;
- }
- }
- }
- };
- PinFreezeManager.prototype.removeIdAttribute=function(_c23){
- var _c24=_c23.getAttribute("id");
- if(_c24!==null&&_c24!==""){
- _c23.removeAttribute("id");
- }
- var _c25=getElementsByAttribute(_c23,"*","id","*");
- if(_c25&&_c25.length){
- for(var i=0;i<_c25.length;i++){
- _c25[i].removeAttribute("id");
- }
- }
- return _c23;
- };
- PinFreezeManager.prototype.isElementInMainOutput=function(_c27){
- return PinFreezeContainer.isElementInMainOutput(_c27);
- };
- PinFreezeManager.prototype.isIWidgetMobile=function(){
- return (this.m_oCV&&this.m_oCV.isIWidgetMobile());
- };
- PinFreezeManager.prototype.destroy=function(){
- GUtil.destroyProperties(this);
- };
- dojo.provide("WidgetContextManager");
- 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){
- this.m_widget=_c28;
- this.m_oWidgetContextContainer={};
- this.m_oPromptContextContainer={};
- this.m_oDrillContextContainer={};
- this.m_oPromptGenericContext={};
- this.m_oDrillGenericContext={};
- this.m_oFilterGenericContext={};
- this.m_oSelectionFilterContext={};
- this.m_oContextCollection={};
- this.m_oWidgetContextObject={};
- this.m_oPromptContextObject={};
- this.m_oDrillContextObject={};
- this.m_aSelectionFilterObjects=null;
- },getWidgetContextObject:function(){
- var _c29={};
- if(this.m_oWidgetContextContainer){
- _c29[this.PP_WIDGET_CONTEXT]=this.m_oWidgetContextContainer;
- if(this.m_widget){
- _c29.clientId=this.m_widget.getWidgetId();
- }
- }
- return _c29;
- },getFilterFirstItemName:function(){
- var _c2a=this.m_oFilterGenericContext;
- if(_c2a){
- var _c2b=(_c2a.values?_c2a.values:_c2a.ranges);
- for(_c2c in _c2b){
- return _c2c;
- }
- }
- for(var _c2c in _c2a){
- return _c2c;
- }
- return null;
- },getItemNames:function(_c2d){
- var _c2e=[];
- var _c2f=_c2d[this.PP_WIDGET_CONTEXT];
- if(_c2f){
- var _c30=(_c2f.values?_c2f.values:_c2f.ranges);
- for(var _c31 in _c30){
- _c2e.push(_c31);
- }
- return _c2e;
- }
- for(var _c31 in _c2f){
- _c2e.push(_c31);
- }
- return _c2e;
- },raisePromptEvent:function(_c32,_c33,_c34,_c35,_c36){
- var _c37=this._buildGeneralizedPromptPayload(_c32,_c33,_c34,_c35,_c36);
- if(_c37){
- this.m_widget.fireEvent(this.EVENT_NAME_PROMPT,null,_c37);
- this._updatePromptContext(_c37);
- this._updateWidgetContextContainer();
- }
- },_updatePromptContext:function(_c38){
- this._updatePromptGenericContext(_c38);
- this._updatePromptContextContainer(_c38);
- },_resetWorkingMembers:function(){
- this.m_oWidgetContextObject={};
- this.m_oPromptContextObject={};
- this.m_oDrillContextObject={};
- },updateFilterContext:function(_c39){
- this.m_oFilterGenericContext=_c39[this.PP_WIDGET_CONTEXT];
- this._updateWidgetContextContainer();
- },getSelectValueControlTypeFromPayload:function(_c3a){
- var _c3b=_c3a[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
- if(_c3b&&_c3b["selectValueControl"]){
- return _c3b["selectValueControl"]["controlType"];
- }
- return null;
- },getSelectValuePropertyFromPayload:function(_c3c,_c3d){
- var _c3e=_c3c[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
- if(_c3e&&_c3e["selectValueControl"]){
- return _c3e["selectValueControl"][_c3d];
- }
- return null;
- },_updateWidgetContextContainer:function(){
- this.m_oWidgetContextContainer={};
- var _c3f=null;
- if(this.m_oDrillGenericContext[this.PP_VALUES]){
- _c3f=dojo.mixin(_c3f,this.m_oDrillGenericContext[this.PP_VALUES]);
- }
- if(this.m_oPromptGenericContext[this.PP_VALUES]){
- _c3f=dojo.mixin(_c3f,this.m_oPromptGenericContext[this.PP_VALUES]);
- }
- if(this.m_oFilterGenericContext[this.PP_VALUES]){
- _c3f=dojo.mixin(_c3f,this.m_oFilterGenericContext[this.PP_VALUES]);
- }
- if(this.m_oSelectionFilterContext[this.PP_VALUES]){
- _c3f=dojo.mixin(_c3f,this.m_oSelectionFilterContext[this.PP_VALUES]);
- }
- if(_c3f){
- this.m_oWidgetContextContainer[this.PP_VALUES]=_c3f;
- }
- var _c40=null;
- if(this.m_oPromptGenericContext[this.PP_RANGES]){
- _c40=dojo.mixin(_c40,this.m_oPromptGenericContext[this.PP_RANGES]);
- }
- if(this.m_oFilterGenericContext[this.PP_RANGES]){
- _c40=dojo.mixin(_c40,this.m_oFilterGenericContext[this.PP_RANGES]);
- }
- if(_c40){
- this.m_oWidgetContextContainer[this.PP_RANGES]=_c40;
- }
- },_updatePromptGenericContext:function(_c41){
- if(_c41[this.PP_WIDGET_CONTEXT]){
- this.m_oPromptGenericContext=_c41[this.PP_WIDGET_CONTEXT];
- }
- },_updatePromptContextContainer:function(_c42){
- if(_c42[this.PP_REPORT_PROMPT_CONTEXT]&&_c42[this.PP_REPORT_PROMPT_CONTEXT][this.PP_PROMPT]){
- this.m_oPromptContextContainer=_c42[this.PP_REPORT_PROMPT_CONTEXT][this.PP_PROMPT];
- }
- },_buildGeneralizedPromptPayload:function(_c43,_c44,_c45,_c46,_c47){
- var _c48=null;
- this._resetWorkingMembers();
- var _c49=this._buildContextsFromPrompt(_c43,_c44);
- if(_c49){
- _c48={};
- _c48[this.PP_WIDGET_CONTEXT]=this.m_oWidgetContextObject;
- var _c4a={};
- _c4a[_c46]=this.m_oPromptContextObject;
- _c48[this.PP_REPORT_PROMPT_CONTEXT]={"prompt":{"id":this.m_widget.iContext.widgetId,"action":_c45,"itemSpecification":_c4a}};
- _c48[this.PP_CASCADEPROMPT_CLEAR]=_c47;
- }
- return _c48;
- },_getReportParameterNodes:function(_c4b){
- var _c4c=XMLBuilderLoadXMLFromString(_c4b);
- if(!_c4c){
- return null;
- }
- var _c4d=_c4c.firstChild;
- if(!_c4d){
- return null;
- }
- var _c4e=XMLHelper_FindChildByTagName(_c4d,"reportParameters",true);
- if(!_c4e){
- return null;
- }
- var _c4f=XMLHelper_FindChildrenByTagName(_c4e,"reportParameter",false);
- if(!_c4f){
- return null;
- }
- return _c4f;
- },_getSelectChoicesXMLString:function(_c50,_c51){
- var _c52=null;
- var _c53="p_"+_c50;
- if(_c51.get(_c53)){
- _c52=_c51.get(_c53);
- }
- return _c52;
- },_getSelectChoicesNode:function(_c54){
- var _c55=null;
- if(_c54){
- var _c56=XMLBuilderLoadXMLFromString(_c54,true);
- if(_c56&&_c56.firstChild){
- _c55=_c56.firstChild;
- }
- }
- return _c55;
- },_buildContextsFromPrompt:function(_c57,_c58){
- var _c59=this._getReportParameterNodes(_c57);
- if(_c59===null){
- return false;
- }
- for(var i in _c59){
- var _c5b=_c59[i];
- var _c5c=_c5b.getAttribute("parameterName");
- var _c5d=this._getSelectChoicesXMLString(_c5c,_c58);
- var _c5e=this._getSelectChoicesNode(_c5d);
- if(_c5e){
- var _c5f,_c60,_c61;
- if(!this._isPromptRangeType(_c5d)){
- var _c62=this._buildReportContextValuesFromPromptSelectOption(_c5e);
- _c5f=this._createPromptDetailObject(_c5d,_c5b.getAttribute("modelItem"),_c5b.getAttribute("multivalued"),_c62);
- _c60=this._buildValuesArrayFromReportContextValueArray(_c62);
- _c61=this.PP_VALUES;
- }else{
- _c60=this._buildMinMaxArrayFromRangePrompt(_c5e);
- _c5f=this._createPromptDetailObject(_c5d,_c5b.getAttribute("modelItem"),_c5b.getAttribute("multivalued"),_c60);
- _c61=this.PP_RANGES;
- }
- this.m_oPromptContextObject[_c5c]=_c5f;
- if(!this.m_oWidgetContextObject[_c61]){
- this.m_oWidgetContextObject[_c61]={};
- }
- this.m_oWidgetContextObject[_c61][_c5c]=_c60;
- }
- }
- return true;
- },_createPromptDetailObject:function(_c63,_c64,_c65,_c66){
- var _c67={};
- _c67[this.PP_SELECT_CHOICES]=_c63;
- if(_c64!==null){
- _c67[this.PP_MODELITEM]=_c64;
- }
- if(_c65!==null){
- _c67[this.PP_MULTIVALUED]=true;
- }
- _c67[this.PP_VALUES]=_c66;
- return _c67;
- },_isPromptRangeType:function(_c68){
- var _c69=new RegExp(/^<selectChoices><select[\s\S]*Range/);
- return _c69.test(_c68);
- },_buildReportContextValuesFromPromptSelectOption:function(_c6a){
- var _c6b=[];
- if(_c6a){
- var _c6c=dojo.query("selectOption[displayValue]",_c6a);
- if(_c6c.length>0){
- for(var i=0;i<_c6c.length;i++){
- var _c6e=_c6c[i].getAttribute("displayValue");
- var _c6f=_c6c[i].getAttribute("useValue");
- var _c70={"caption":_c6e,"use":_c6f};
- _c6b.push(_c70);
- }
- }
- }
- return _c6b;
- },_buildValuesArrayFromReportContextValueArray:function(_c71){
- var _c72=[];
- if(_c71&&_c71.length>0){
- for(var i=0;i<_c71.length;i++){
- var _c74=_c71[i].caption;
- if(_c74){
- _c72.push(_c74);
- }
- }
- }
- return _c72;
- },_buildMinMaxArrayFromRangePrompt:function(_c75){
- var _c76=[];
- if(_c75&&_c75.childNodes&&_c75.childNodes.length>0){
- var _c77=_c75.childNodes.length;
- for(var i=0;i<_c77;i++){
- var _c79=this._buildMinMaxFromSelectAnyRange(_c75.childNodes[i]);
- if(_c79){
- _c76.push(_c79);
- }
- }
- }
- return _c76;
- },_buildMinMaxFromSelectAnyRange:function(_c7a){
- var _c7b=null;
- if(_c7a){
- var _c7c=dojo.query("[displayValue]",_c7a);
- if(_c7c.length>0){
- _c7b={};
- for(var i=0;i<_c7c.length;i++){
- var node=_c7c[i];
- var _c7f=(node.nodeName==="start")?"min":"max";
- _c7b[_c7f]=node.getAttribute("useValue");
- _c7b[_c7f+"Display"]=node.getAttribute("displayValue");
- }
- }
- }
- return _c7b;
- },handleIncomingPromptEvent:function(evt){
- if(!evt||!evt.payload){
- return;
- }
- var _c81=this._convertToLegacyPromptPayload(evt.payload);
- if(_c81){
- var _c82={"payload":_c81};
- this.m_widget.onPromptLegacyPayload(_c82);
- }
- },_convertToLegacyPromptPayload:function(_c83){
- var _c84=null;
- var _c85=_c83[this.PP_REPORT_PROMPT_CONTEXT];
- if(_c85&&_c85.prompt){
- _c85=_c85.prompt;
- _c84={};
- _c84.cv_id=_c85.id;
- _c84.parameters=this._genLegacyPromptParameterArrayFromItemSpec(_c85.itemSpecification);
- _c84.clearCascadePromptParams=_c83[this.PP_CASCADEPROMPT_CLEAR];
- }else{
- if(_c83[this.PP_WIDGET_CONTEXT]&&_c83[this.PP_WIDGET_CONTEXT].values){
- _c84={};
- _c84.parameters=[];
- var _c86=_c83[this.PP_WIDGET_CONTEXT].values;
- for(var _c87 in _c86){
- var _c88=_c86[_c87];
- if(_c88&&_c88.length>0){
- if(_c88.length==1&&_c88[0].indexOf("<selectChoices>")===0){
- _c84.parameters.push({"parmName":_c87,"parmValue":_c88[0]});
- }else{
- var _c89="<selectChoices>";
- for(var i=0;i<_c88.length;i++){
- _c89+="<selectOption useValue=\""+_c88[i]+"\" displayValue=\""+_c88[i]+"\"/>";
- }
- _c89+="</selectChoices>";
- _c84.parameters.push({"parmName":_c87,"parmValue":_c89});
- }
- }
- }
- _c84.clearCascadePromptParams=_c83[this.PP_CASCADEPROMPT_CLEAR];
- }
- }
- return _c84;
- },_genLegacyPromptParameterArrayFromItemSpec:function(_c8b){
- if(!_c8b){
- return null;
- }
- var _c8c=this._getFirstPropertyOfObject(_c8b);
- var _c8d=[];
- for(var _c8e in _c8c){
- var _c8f=_c8c[_c8e];
- var _c90={parmName:_c8e,parmValue:_c8f[this.PP_SELECT_CHOICES],modelItem:_c8f[this.PP_MODELITEM]};
- if(_c8f[this.PP_MULTIVALUES]!==null){
- _c90.multivalued=true;
- }
- _c8d.push(_c90);
- }
- return _c8d;
- },_isRangeTypeValues:function(_c91){
- if(_c91){
- if(_c91.min||_c91.max){
- return true;
- }
- }
- return false;
- },_getFirstPropertyOfObject:function(_c92){
- var _c93=null;
- for(var _c94 in _c92){
- _c93=_c92[_c94];
- break;
- }
- return _c93;
- },_getFirstPropertyNameOfObject:function(_c95){
- var _c96=null;
- for(var _c97 in _c95){
- _c96=_c97;
- break;
- }
- return _c96;
- },extractWidgetContextObject:function(_c98){
- if(_c98){
- var _c99=_c98[this.PP_WIDGET_CONTEXT];
- if(_c99){
- var obj={};
- obj[this.PP_WIDGET_CONTEXT]=_c99;
- return obj;
- }
- }
- return null;
- },genMergedWidgetContextObject:function(){
- var _c9b=null;
- var _c9c=null;
- for(var key in this.m_oContextCollection){
- var _c9e=this.m_oContextCollection[key];
- if(_c9e){
- var _c9f=_c9e[this.PP_WIDGET_CONTEXT];
- if(_c9f){
- if(_c9f[this.PP_VALUES]){
- _c9b=dojo.mixin(_c9b,_c9f[this.PP_VALUES]);
- }
- if(_c9f[this.PP_RANGES]){
- _c9c=dojo.mixin(_c9c,this._convertRangeArrayToObjectForActiveReport(_c9f[this.PP_RANGES]));
- }
- }
- }
- }
- if(_c9b||_c9c){
- var obj={};
- obj[this.PP_WIDGET_CONTEXT]={};
- if(_c9b){
- obj[this.PP_WIDGET_CONTEXT][this.PP_VALUES]=_c9b;
- }
- if(_c9c){
- obj[this.PP_WIDGET_CONTEXT][this.PP_RANGES]=_c9c;
- }
- return obj;
- }
- return null;
- },raiseDrillEvent:function(_ca1,_ca2,_ca3){
- var _ca4=this._buildGeneralizedDrillPayload(_ca1,_ca2,_ca3);
- if(_ca4){
- this.m_widget.fireEvent(this.EVENT_NAME_DRILL,null,_ca4);
- this._updateDrillContext(_ca4);
- this._updateWidgetContextContainer();
- }
- },_updateDrillContext:function(_ca5){
- this._updateDrillGenericContext(_ca5);
- this._updateDrillContextContainer(_ca5);
- },_updateDrillGenericContext:function(_ca6){
- if(_ca6[this.PP_WIDGET_CONTEXT]){
- this.m_oDrillGenericContext=_ca6[this.PP_WIDGET_CONTEXT];
- }
- },_updateDrillContextContainer:function(_ca7){
- if(_ca7[this.PP_REPORT_DRILL_CONTEXT]&&_ca7[this.PP_REPORT_DRILL_CONTEXT][this.PP_DRILL]){
- this.m_oDrillContextContainer=_ca7[this.PP_REPORT_DRILL_CONTEXT][this.PP_DRILL];
- }
- },_buildGeneralizedDrillPayload:function(_ca8,_ca9,_caa){
- if(!_ca8||!_ca9){
- return null;
- }
- var _cab={};
- var _cac={};
- for(var i in _ca8){
- var _cae=_ca8[i];
- var mun=(_cae.mun)?_cae.mun:"";
- var lun=(_cae.lun)?_cae.lun:"";
- var hun=(_cae.hun)?_cae.hun:"";
- var _cb2={};
- _cb2[this.PP_VALUES]=[{"caption":_cae.displayValue,"mun":mun,"lun":lun,"hun":hun}];
- if(_cae.summary){
- _cb2["summary"]=_cae.summary;
- }
- _cab[_cae.dataItem]=_cb2;
- _cac[_cae.dataItem]=[_cae.displayValue];
- }
- var _cb3={};
- _cb3[this.PP_VALUES]=_cac;
- var _cb4={};
- _cb4[_caa]=_cab;
- var _cb5={};
- _cb5[_ca9]={"id":this.m_widget.iContext.widgetId,"action":_ca9,"itemSpecification":_cb4};
- var _cb6={};
- _cb6[this.PP_WIDGET_CONTEXT]=_cb3;
- _cb6[this.PP_REPORT_DRILL_CONTEXT]=_cb5;
- return _cb6;
- },genDrillSpecObjects:function(_cb7){
- if(!_cb7||!_cb7[this.PP_REPORT_DRILL_CONTEXT]){
- return null;
- }
- var _cb8=[];
- var _cb9=_cb7[this.PP_REPORT_DRILL_CONTEXT];
- var _cba=this._getFirstPropertyOfObject(_cb9);
- var _cbb=this._getFirstPropertyOfObject(_cba.itemSpecification);
- for(var _cbc in _cbb){
- var _cbd=_cbb[_cbc];
- var _cbe=_cbd[this.PP_VALUES];
- if(_cbe&&_cbe.length>0){
- var _cbf=_cbe[0];
- var _cc0={"dataItem":_cbc,"displayValue":_cbf.caption,"mun":_cbf.mun,"lun":_cbf.lun,"hun":_cbf.hun};
- if(_cbf.summary){
- _cc0["summary"]=_cbf.summary;
- }
- _cb8.push(_cc0);
- }
- }
- return (_cb8.length>0)?_cb8:null;
- },getDrillActionType:function(_cc1){
- if(!_cc1||!_cc1[this.PP_REPORT_DRILL_CONTEXT]){
- return null;
- }
- return this._getFirstPropertyNameOfObject(_cc1[this.PP_REPORT_DRILL_CONTEXT]);
- },_convertRangeArrayToObjectForActiveReport:function(_cc2){
- if(_cc2){
- var _cc3={};
- for(var name in _cc2){
- var _cc5=_cc2[name];
- if(_cc5&&_cc5.length>0){
- _cc3[name]=_cc5[0];
- }else{
- _cc3[name]=_cc5;
- }
- }
- return _cc3;
- }
- return _cc2;
- },getItemsInItemSpecification:function(_cc6){
- var _cc7=_cc6[this.PP_BUX_SELECTVALUECONTROL_CONTEXT];
- if(_cc7&&_cc7["selectValueControl"]&&_cc7["selectValueControl"]["itemSpecification"]){
- return this._getFirstPropertyOfObject(_cc7["selectValueControl"]["itemSpecification"]);
- }
- return null;
- },genRemoveDiscreteFilterPayload:function(_cc8){
- var _cc9={"clientId":_cc8,"com.ibm.widget.context":{},"com.ibm.widget.context.bux.selectValueControl":{"selectValueControl":{"id":_cc8,"controlType":"selectValueFilter","type":"discrete","valueType":"string"}}};
- return _cc9;
- },genEmptySelectionPayload:function(oCV,_ccb){
- var obj={"clientId":_ccb,"com.ibm.widget.context":{},"com.ibm.widget.context.bux.selection":{"selection":{"id":_ccb,"valueType":"string"}}};
- this.m_oSelectionFilterContext={};
- this._updateWidgetContextContainer();
- this.setSelectionFilterObjects(null);
- return obj;
- },genSelectionPayload:function(oCV,_cce,_ccf){
- var _cd0={};
- var _cd1={"id":_cce,"valueType":"string"};
- var obj={"clientId":_cce,"com.ibm.widget.context":_cd0,"com.ibm.widget.context.bux.selection":{"selection":_cd1}};
- var _cd3=false;
- var _cd4=[];
- var oSC=oCV.getSelectionController();
- var _cd6=oSC.getAllSelectedObjects();
- if(_cd6&&_cd6.length>0){
- var _cd7={};
- var _cd8=null;
- var _cd9={};
- var _cda={};
- for(var i=0;i<_cd6.length;i++){
- if(_cd6[i].populateSelectionPayload(_cd9,_cda,_ccf)){
- _cd3=true;
- _cd8=_cd6[i].getCtxAttributeString();
- if(typeof _cd7[_cd8]=="undefined"){
- _cd7[_cd8]=true;
- _cd4.push(_cd6[i].marshal(oSC,oCV.getId()));
- }
- }
- }
- if(_cd3){
- _cd0.values=_cd9;
- var _cdc={};
- var _cdd=oCV.getModelPath();
- var _cde=(_cdd)?_cdd:".";
- _cdc[_cde]=_cda;
- _cd1.itemSpecification=_cdc;
- }
- }
- this.m_oSelectionFilterContext=obj[this.PP_WIDGET_CONTEXT];
- this._updateWidgetContextContainer();
- this.setSelectionFilterObjects(_cd4.length>0?_cd4:null);
- return obj;
- },isSelectionPayloadForReset:function(obj){
- if(obj&&obj[this.PP_WIDGET_CONTEXT]){
- return this.isEmptyObject(obj[this.PP_WIDGET_CONTEXT]);
- }
- return true;
- },setSelectionFilterObjects:function(_ce0){
- this.m_aSelectionFilterObjects=_ce0;
- },getSelectionFilterObjects:function(){
- return this.m_aSelectionFilterObjects;
- },toStringSelectionFilterObjects:function(){
- var str="";
- for(var idx in this.m_aSelectionFilterObjects){
- if(str.length>0){
- str+=",";
- }
- str+=JSON.stringify(this.m_aSelectionFilterObjects[idx]);
- }
- return "["+str+"]";
- },convertSelectionToSelectValueControlPayload:function(_ce3){
- if(_ce3["com.ibm.widget.context.bux.selection"]){
- var _ce4=_ce3["com.ibm.widget.context.bux.selection"]["selection"];
- _ce4.controlType="selectValueFilter";
- _ce4.type="discrete";
- _ce3["com.ibm.widget.context.bux.selectValueControl"]={"selectValueControl":_ce4};
- delete _ce3["com.ibm.widget.context.bux.selection"];
- }
- return _ce3;
- },convertGenericToSelectValueControlPayload:function(_ce5){
- if(this._hasItemSpecification(_ce5)){
- return;
- }
- if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
- var _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
- for(dataItem in _ce6){
- if(_ce6[dataItem].length==0){
- delete _ce6[dataItem];
- }
- }
- var _ce7=true;
- for(dataItem in _ce6){
- _ce7=false;
- break;
- }
- if(_ce7){
- delete _ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
- }
- }
- if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES]){
- var _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
- var _ce7=true;
- for(dataItem in _ce6){
- _ce7=false;
- break;
- }
- if(_ce7){
- delete _ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
- }
- }
- var _ce6=null;
- if(_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
- key=this.PP_VALUES;
- _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
- }else{
- key=this.PP_RANGES;
- _ce6=_ce5[this.PP_WIDGET_CONTEXT][this.PP_RANGES];
- }
- var cv=this.m_widget.getViewerObject();
- var _ce9=null;
- if(cv){
- var sc=cv.getSelectionController();
- _ce9=sc.getCCDManager();
- }
- for(dataItem in _ce6){
- var _ceb=true;
- var _cec={};
- for(var _ced in _ce6){
- var _cee=[];
- for(var i=0;i<_ce6[_ced].length;i++){
- var _cf0=_ce6[_ced][i];
- var _cf1={"caption":_cf0};
- if(_ceb){
- var mun=_ce9?_ce9.getMUNForRDIAndUseValue(_ced,_cf0):null;
- if(mun!=null){
- _cf1.mun=mun;
- }else{
- _ceb=false;
- for(var i=0;i<_cee.length;i++){
- delete _cee[i].mun;
- }
- }
- }
- _cee.push(_cf1);
- }
- _cec[_ced]={"values":_cee};
- }
- var _cf3={};
- var _cf4=cv?cv.getModelPath():null;
- var _cf5=(_cf4)?_cf4:"unknown";
- _cf3[_cf5]=_cec;
- _ce5[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]={"selectValueControl":{"valueType":"string","type":"discrete","controlType":"selectValueFilter","id":_ce5.clientId?_ce5.clientId:"","itemSpecification":_cf3}};
- }
- },getMUNOfItemValueInItemSpecification:function(_cf6,_cf7){
- var _cf8=this.getItemsInItemSpecification(_cf6);
- if(_cf8&&_cf8[_cf7]){
- var _cf9=_cf8[_cf7];
- if(_cf9.values&&_cf9.values.length>0){
- return _cf9.values[0].mun;
- }
- }
- return null;
- },_hasItemSpecification:function(_cfa){
- if(_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]&&_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]&&_cfa[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["itemSpecification"]){
- return true;
- }
- if(_cfa[this.PP_BUX_SELECTION_CONTEXT]&&_cfa[this.PP_BUX_SELECTION_CONTEXT]["selection"]&&_cfa[this.PP_BUX_SELECTION_CONTEXT]["selection"]["itemSpecification"]){
- return true;
- }
- return false;
- },getSourceUniqueId:function(_cfb,_cfc){
- var id=null;
- var _cfe=null;
- if(_cfb["clientId"]){
- id=_cfb["clientId"];
- }
- if(_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]){
- _cfe="selectValueControl";
- if(!id&&_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]&&_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["id"]){
- id=_cfb[this.PP_BUX_SELECTVALUECONTROL_CONTEXT]["selectValueControl"]["id"];
- }
- }else{
- if(_cfb[this.PP_BUX_SELECTION_CONTEXT]){
- _cfe="selection";
- if(!id&&_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]&&_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]["id"]){
- id=_cfb[this.PP_BUX_SELECTION_CONTEXT]["selection"]["id"];
- }
- }else{
- if(_cfb[this.PP_REPORT_PROMPT_CONTEXT]){
- _cfe="prompt";
- if(!id&&_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]&&_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]["id"]){
- id=_cfb[this.PP_REPORT_PROMPT_CONTEXT]["prompt"]["id"];
- }
- }else{
- if(_cfb[this.PP_REPORT_DRILL_CONTEXT]){
- _cfe="drill";
- if(!id&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]["id"]){
- id=_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillUp"]["id"];
- }
- }else{
- if(_cfb[this.PP_REPORT_DRILL_CONTEXT]){
- _cfe="drill";
- if(!id&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]&&_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]["id"]){
- id=_cfb[this.PP_REPORT_DRILL_CONTEXT]["DrillDown"]["id"];
- }
- }
- }
- }
- }
- }
- if(!id){
- id="unknown";
- }
- if(!_cfe){
- _cfe="unknown";
- }
- if(typeof _cfc=="string"){
- _cfe=_cfc;
- }
- return id+"_"+_cfe;
- },isWidgetContextEmpty:function(_cff){
- 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])));
- },isEmptyObject:function(obj){
- var _d01=true;
- if(obj){
- for(var _d02 in obj){
- _d01=false;
- break;
- }
- }
- return _d01;
- },updateContextCollection:function(_d03){
- if(!this.isEmptyObject(_d03)){
- var _d04=this.getSourceUniqueId(_d03);
- if(this.isWidgetContextEmpty(_d03)){
- if(this.m_oContextCollection[_d04]){
- this.setEmptyArrayToWidgetContextValues(this.m_oContextCollection[_d04]);
- }else{
- var _d05=this.getSourceUniqueId(_d03,"unknown");
- if(this.m_oContextCollection[_d05]){
- this.setEmptyArrayToWidgetContextValues(this.m_oContextCollection[_d05]);
- }
- }
- }else{
- if(_d03[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
- for(var name in _d03[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
- for(var key in this.m_oContextCollection){
- var _d08=this.m_oContextCollection[key];
- if(_d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES]&&_d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES][name]){
- delete _d08[this.PP_WIDGET_CONTEXT][this.PP_VALUES][name];
- }
- }
- }
- }
- this.m_oContextCollection[_d04]=dojo.clone(_d03);
- }
- return this.m_oContextCollection;
- }
- },setEmptyArrayToWidgetContextValues:function(_d09){
- if(_d09&&_d09[this.PP_WIDGET_CONTEXT]&&_d09[this.PP_WIDGET_CONTEXT][this.PP_VALUES]){
- var _d0a=_d09[this.PP_WIDGET_CONTEXT][this.PP_VALUES];
- for(var name in _d0a){
- _d0a[name]=[];
- }
- }
- }});
- dojo.provide("viewer.AnnotationHelper");
- dojo.declare("viewer.AnnotationHelper",null,{m_loadAnnotationsDfd:null,m_bCallGetAnnotations:true,m_bAnnotationsEnabled:null,constructor:function(_d0c){
- this.m_viewerIWidget=_d0c;
- this.m_bCallGetAnnotations=true;
- this.m_bAnnotationsEnabled=null;
- },getAnnotationStore:function(){
- return this.m_viewerIWidget.getAnnotationStore();
- },setCallGetAnnotations:function(flag){
- this.m_bCallGetAnnotations=flag;
- },isEnabled:function(){
- if(this.m_bAnnotationsEnabled===null){
- this.m_bAnnotationsEnabled=this.m_viewerIWidget.getViewerObject().bBuxAnnotationsAvailable;
- }
- return this.m_bAnnotationsEnabled;
- },refreshAnnotationData:function(){
- if(this.m_loadAnnotationsDfd){
- return null;
- }
- this.m_loadAnnotationsDfd=new dojo.Deferred();
- this.fetchAnnotationData();
- return this.m_loadAnnotationsDfd;
- },fetchAnnotationData:function(){
- var _d0e=this.m_viewerIWidget;
- if(!this.m_bCallGetAnnotations||!this.isEnabled()){
- return;
- }
- dojo.when(_d0e.getWidgetStoreID(),dojo.hitch(this,function(_d0f){
- if(!_d0f){
- return;
- }
- this.m_viewerIWidget.getLoadManager().runWhenHasViewer(dojo.hitch(this,this._fetchAnnotationData,_d0f));
- }));
- },_fetchAnnotationData:function(_d10){
- var _d11=this.m_viewerIWidget.getViewerObject();
- var _d12=_d11.getSelectionController();
- var _d13=_d12.getCCDManager().m_md;
- if(!_d13){
- _d13={};
- }
- _d13=dojo.toJson(_d13);
- var _d14=_d12.getCCDManager().m_cd;
- if(!_d14){
- _d14={};
- }
- _d14=dojo.toJson(_d14);
- var _d15={"complete":{},"fault":{}};
- _d15.complete["object"]=this;
- _d15.complete["method"]=this.fetchAnnotationDataResponse;
- _d15.fault["object"]=this;
- _d15.fault["method"]=this.fetchAnnotationDataResponseFault;
- var _d16=new AsynchJSONDispatcherEntry(_d11);
- _d16.setCallbacks(_d15);
- _d16.addFormField("widgetStoreID",_d10);
- _d16.addFormField("ui.action","getAnnotations");
- _d16.addFormField("cv.metatdata",_d13);
- _d16.addFormField("cv.context",_d14);
- _d16.sendRequest();
- },fetchAnnotationDataResponseFault:function(_d17){
- this.m_bCallGetAnnotations=false;
- var _d18=new FaultDialog(this.m_viewerIWidget.getViewerObject());
- var _d19=_d17.getSoapFault();
- var _d1a=null;
- var _d1b=XMLHelper_FindChildByTagName(_d19,"exception",true);
- if(_d1b){
- var _d1c=XMLHelper_FindChildByTagName(_d1b,"errorCode",false);
- if(_d1c){
- _d1a=XMLHelper_GetText(_d1c);
- }
- }
- if(_d1a==="0"){
- var _d1d=null;
- var _d1e=XMLHelper_FindChildByTagName(_d1b,"message",false);
- if(_d1e){
- var _d1f=XMLHelper_FindChildByTagName(_d1e,"messageString",true);
- if(_d1f){
- _d1d=XMLHelper_GetText(_d1f,false);
- }
- }
- if(_d1d){
- var _d20=/ANS-GEN-(\d{2,4})/;
- var _d21=_d20.exec(_d1d);
- if(_d21&&_d21.length&&_d21.length>1){
- var _d22=_d21[1];
- if(_d22==="0075"){
- _d18.setErrorMessage(RV_RES.IDS_ANNOTATION_WIDGET_DELETED_ERROR);
- }
- }
- }
- }
- this._cleanupPreviousAnnotations();
- this.getAnnotationStore().clear();
- _d18.show(_d19);
- if(this.m_loadAnnotationsDfd){
- this.m_loadAnnotationsDfd.errback();
- this.m_loadAnnotationsDfd=null;
- }
- },fetchAnnotationDataResponse:function(_d23){
- var _d24=window["CVEditContentActionInstance"];
- var _d25=_d23.getResult();
- this.m_bCallGetAnnotations=this.m_bCallGetAnnotations&&_d25!==null;
- if(_d25===null){
- _d25=[];
- }
- var _d26=this.m_viewerIWidget.getViewerObject();
- _d26.envParams["cv.annotationData"]=_d25;
- this._cleanupPreviousAnnotations();
- if(_d25.length>0){
- if(this.getAnnotationStore()){
- var _d27=this._generateMatchedAnnotationsFromViewerObject();
- this.getAnnotationStore().load(_d27);
- this.displayCommentIndicators();
- }
- }
- if(this.m_loadAnnotationsDfd){
- this.m_loadAnnotationsDfd.callback();
- this.m_loadAnnotationsDfd=null;
- }
- },_cleanupPreviousAnnotations:function(){
- var _d28=this.getAnnotationStore();
- if(_d28){
- var _d29=_d28.getAll();
- for(var _d2a in _d29){
- var _d2b=this.m_viewerIWidget.getWidgetId()+"_"+_d2a+"_comment";
- var _d2c=dijit.byId(_d2b);
- if(typeof _d2c!="undefined"&&_d2c!=null){
- _d2c.destroy();
- delete _d2c;
- }
- _d28.clear(_d2a);
- }
- }
- },_generateMatchedAnnotationsFromViewerObject:function(){
- var _d2d=this.m_viewerIWidget.getViewerObject();
- var _d2e=[];
- if(_d2d&&_d2d.envParams&&_d2d.envParams["cv.annotationData"]){
- _d2e=eval(_d2d.envParams["cv.annotationData"]);
- }
- var _d2f=this._generateAnnotationListWithoutORoperator(_d2e);
- return this._updateAnnotationCtxWithMatchedCellCtx(_d2f,_d2d);
- },_generateAnnotationListWithoutORoperator:function(_d30){
- var _d31=[];
- for(var i=0,len=_d30.length;i<len;i++){
- var anno=_d30[i];
- if(anno.ctx){
- var _d35=bux.AnnotationHelper.generateCTXList(anno.ctx);
- for(var j=0,jLen=_d35.length;j<jLen;j++){
- 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};
- _d38.ctx=_d35[j];
- _d31.splice(0,0,_d38);
- }
- }else{
- _d31.splice(0,0,anno);
- }
- }
- return _d31;
- },_updateAnnotationCtxWithMatchedCellCtx:function(_d39,_d3a){
- var _d3b=[];
- var _d3c=new AnnotationCTXLookup(this.m_viewerIWidget.getViewerObject().getSelectionController().getCCDManager());
- _d3c.populateCtxDetailsForAllAnnotations(_d39);
- var _d3d=[];
- for(var i=0,len=_d39.length;i<len;i++){
- var anno=_d39[i];
- if(anno.ctx){
- if(_d3d.length===0){
- _d3d=dojo.query("[ctx]",this.m_viewerIWidget.iContext.getRootElement());
- }
- for(var j=0,jLen=_d3d.length;j<jLen;j++){
- var _d43=_d3d[j].getAttribute("ctx");
- if(_d3c.isAnnotatedCell(anno,_d43)){
- anno.ctx=_d43;
- _d3b.splice(0,0,anno);
- break;
- }
- }
- }else{
- _d3b.splice(0,0,anno);
- }
- }
- return _d3b;
- },displayCommentIndicators:function(){
- var _d44=this.getAnnotationStore();
- var _d45=_d44.getAll();
- for(var cell in _d45){
- var _d47=new bux.AnnotationIndicator({annotationStore:_d44,context:cell,iWidgetContainer:this.m_viewerIWidget,dir:this.m_viewerIWidget.getViewerObject().getDirection()});
- _d47.addExistingCommentToCell();
- }
- },repositionCommentIndicators:function(){
- var _d48=this.getAnnotationStore();
- var _d49=_d48.getAll();
- for(var id in _d49){
- var _d4b=_d49[id];
- var ctx=_d4b[0].getContext();
- var _d4d=_d48.getIndicatorWidgetId(ctx);
- if(_d4d!==null){
- var _d4e=dijit.byId(_d4d);
- _d4e.addToPage();
- }
- }
- },promptForSave:function(_d4f){
- dojo["require"]("bux.dialogs.InformationDialog");
- 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});
- _d50.startup();
- _d50.show();
- },addComment:function(_d51,_d52){
- if(this.m_viewerIWidget.isSaveNecessary()){
- this.promptForSave(dojo.hitch(this,this.onCommentSaveAcknowledge,_d51,_d52));
- }else{
- this.addNewComment(_d51,_d52);
- }
- },editComment:function(_d53){
- var _d54=bux.getComment(this.m_viewerIWidget.iContext,this.getAnnotationStore().getEffectiveIds(_d53));
- if(_d54&&_d54.edit){
- _d54.edit();
- }
- },deleteComment:function(_d55){
- this.getAnnotationStore().deleteOneComment(_d55);
- },addNewComment:function(_d56,_d57){
- this.addAsNewComment(_d56,(_d57==null)?"":(_d57+" - "));
- },addAsNewComment:function(_d58,text){
- var _d5a=null;
- var _d5b=(_d58===null)?this.getAnnotationStore().WIDGET_CONTEXT:_d58;
- var _d5c=this.getAnnotationStore().getIndicatorWidgetId(_d5b);
- if(_d5c!=null){
- _d5a=dijit.byId(_d5c);
- }
- if(_d5a==null){
- dojo["require"]("bux.AnnotationIndicator");
- _d5a=new bux.AnnotationIndicator({annotationStore:this.getAnnotationStore(),context:_d5b,iWidgetContainer:this.m_viewerIWidget,dir:this.m_viewerIWidget.getViewerObject().getDirection()});
- window.setTimeout(function(){
- _d5a.addNewCommentToCell(text);
- },0);
- }else{
- window.setTimeout(function(){
- _d5a.comment.editNewComment(_d5b,text);
- },0);
- }
- },onCommentSaveAcknowledge:function(_d5d,_d5e){
- this.m_viewerIWidget._pendingContextId=_d5d;
- this.m_viewerIWidget._pendingCellValue=_d5e;
- this.m_viewerIWidget.fireEvent("com.ibm.bux.widget.action",null,{action:"canvas.save"});
- },addWidgetComment:function(){
- if(this.m_viewerIWidget.isSaveNecessary()){
- this.promptForSave(dojo.hitch(this,this.onCommentSaveAcknowledge,null,this.m_viewerIWidget.getDisplayName()));
- }else{
- this.addNewComment(null,this.m_viewerIWidget.getDisplayName());
- }
- },editWidgetComment:function(){
- var _d5f=bux.getComment(this.m_viewerIWidget.iContext,[this.getAnnotationStore().WIDGET_CONTEXT]);
- if(_d5f&&_d5f.edit){
- _d5f.edit();
- }
- },deleteWidgetComment:function(){
- this.deleteComment(this.getAnnotationStore().WIDGET_CONTEXT);
- },commitComment:function(_d60){
- if(_d60.getContext()!==this.getAnnotationStore().WIDGET_CONTEXT){
- return this.commitCellComment(_d60);
- }else{
- return this.commitWidgetComment(_d60,this.getAnnotationStore());
- }
- },commitCellComment:function(_d61){
- var _d62=new dojo.Deferred();
- var _d63=this.m_viewerIWidget.getViewerObject();
- var _d64={customArguments:[_d61,_d62],"complete":{"object":this,"method":this.handleCellCommentSaveResponse},"fault":{"object":this,"method":this.handleCellCommentSaveErrorResponse},"error":{"object":this,"method":this.handleCellCommentSaveServerErrorResponse}};
- var _d65=new AsynchJSONDispatcherEntry(_d63);
- _d65.setCallbacks(_d64);
- this.preparePostForCommitCellComment(_d65,_d61).then(function(){
- _d63.dispatchRequest(_d65);
- });
- return _d62;
- },preparePostForCommitCellComment:function(_d66,_d67){
- var dfd=new dojo.Deferred();
- dojo.when(this.m_viewerIWidget.getWidgetStoreID(),dojo.hitch(this,function(_d69){
- var _d6a=this.m_viewerIWidget.getViewerObject();
- var _d6b=_d6a.getSelectionController();
- _d66.addFormField("widgetStoreID",_d69);
- _d66.addFormField("ui.action","commentSave");
- _d66.addFormField("cv.metatdata",dojo.toJson(_d6b.getCCDManager().m_md));
- _d66.addFormField("cv.context",dojo.toJson(_d6b.getCCDManager().m_cd));
- _d66.addFormField("cv.commentId",_d67.getContext());
- _d66.addFormField("cv.commentDesc",xml_encode(_d67.getDescription()));
- var lid=_d6b.getAllSelectedObjects()[0].getLayoutElementId();
- if(lid){
- lid=lid.replace(this.m_viewerIWidget.getViewerId(),"");
- _d67.setParentId(lid);
- _d66.addFormField("cv.commentLayoutId",_d67.getParentId());
- var _d6d=new AnnotationInfoBar(_d6a,lid);
- var _d6e=_d6d.createFilterContext();
- if(_d6e!=null){
- _d67.setFilterContext(_d6e);
- if(_d6e.getPromptsJSON()){
- _d66.addFormField("cv.filterContext_prompts",dojo.toJson(_d6e.getPromptsJSON()));
- }
- if(_d6e.getFilterJSON()){
- _d66.addFormField("cv.filterContext_filter",dojo.toJson(_d6e.getFilterJSON()));
- }
- if(_d6e.getSlidersJSON()){
- _d66.addFormField("cv.filterContext_sliders",dojo.toJson(_d6e.getSlidersJSON()));
- }
- }
- }
- dfd.callback();
- }));
- return dfd;
- },commitWidgetComment:function(_d6f){
- dojo["require"]("bux.Services");
- var _d70=bux.Services.getGateway()+"/annotationService/creation";
- var _d71={};
- _d71["annotationName"]=_d6f.getName();
- if(_d71["annotationName"]==null){
- _d71["annotationName"]="";
- }
- _d71["annotationDescription"]=_d6f.getDescription();
- var dfd=new dojo.Deferred();
- dojo.when(this.m_viewerIWidget.getWidgetStoreID(),dojo.hitch(this,function(_d73){
- _d71["annotationParentID"]=_d73;
- bux.xhrPost({url:_d70,sync:true,content:_d71}).then(dojo.hitch(this,function(_d74){
- this.handleCommentSaveDone(_d74,_d6f,this.getAnnotationStore(),this.m_viewerIWidget);
- _d6f.loadDetails();
- dfd.callback();
- }));
- }));
- return dfd;
- },handleCellCommentSaveResponse:function(_d75,_d76,_d77){
- var _d78=_d75.getJSONResponseObject();
- if(_d78){
- var _d79=_d78.json;
- if(_d79){
- var _d7a=this.handleCommentSaveDone(_d79,_d76,this.getAnnotationStore(),this.m_viewerIWidget);
- if(typeof _d7a!="Error"){
- _d76.loadDetails();
- }
- }
- }
- _d77.callback(_d75);
- },handleCellCommentSaveErrorResponse:function(_d7b,_d7c,_d7d){
- _d7d.errback(new Error(_d7b.getSoapFaultDetailMessageString()));
- },handleCellCommentSaveServerErrorResponse:function(_d7e,_d7f,_d80){
- var _d81=new Error(_d7e.xmlHttp.statusText);
- _d81.xhr=_d7e.xmlHttp;
- _d80.errback(_d81);
- },handleCommentSaveDone:function(_d82,_d83,_d84,_d85){
- var _d86=XMLBuilderLoadXMLFromString(_d82);
- if(_d86){
- var _d87=_d86.firstChild;
- var _d88=XMLHelper_FindChildByTagName(_d87,"annotation",false);
- if(_d88){
- var _d89=XMLHelper_FindChildByTagName(_d88,"id",false);
- if(_d89){
- var _d8a=XMLHelper_GetText(_d89);
- _d83.setServiceId(_d8a);
- _d83.setIWidgetContainer(_d85);
- _d84.setWidgetContainer(_d85);
- this.setCallGetAnnotations(true);
- return _d82;
- }
- }
- }
- return new Error(_d82.toString());
- }});
- dojo.provide("bux.reportViewer");
- dojo.require("dojo.buxViewer");
- dojo.require("bux.AnnotationHelper");
- dojo.require("bux.AnnotationIndicator");
- dojo.require("viewer.AnnotationHelper");
- dojo.require("bux.data.AnnotationStore");
- dojo.require("bux.iwidget.common.MultilingualWidgetBase");
- dojo.require("InfoBarBase");
- dojo.require("WidgetContextManager");
- var globalViewerIdentifier=1;
- 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(){
- this.onUnloadInProgress=false;
- this.annotationHelper=new viewer.AnnotationHelper(this);
- this.savedOutput=new CIWidgetSavedOutput(this);
- this.undoRedoQueue=new UndoRedoQueue(this);
- this.viewerIdentifier=(globalViewerIdentifier++).toString();
- this.m_oCV=null;
- this.m_oLoadManager=new ViewerLoadManager(this);
- this.m_doGetParametersOnLoad=false;
- this._isMobile=false;
- this.m_bSelectionFilterSwitch=false;
- this.m_oWidgetContextManager=new WidgetContextManager(this);
- this.addWindowEventListeners();
- this.m_bReportDropped=false;
- this.sliderState={};
- this.savedToolbarButtons={};
- },getWidgetId:function(){
- return this.sViewerIWidgetId;
- },getAnnotationHelper:function(){
- return this.annotationHelper;
- },getUndoRedoQueue:function(){
- return this.undoRedoQueue;
- },getDisplayName:function(){
- var _d8b=this.iContext.getItemSet("buxrtstate",false);
- if(_d8b){
- var _d8c=_d8b.getItemValue("displayTitle");
- return _d8c?_d8c:"";
- }
- return "";
- },getSavedOutput:function(){
- return this.savedOutput;
- },getAttributeValue:function(name){
- return this.iContext.getiWidgetAttributes().getItemValue(name);
- },setAttributeValue:function(name,_d8f){
- this.iContext.getiWidgetAttributes().setItemValue(name,_d8f);
- },removeAttributeValue:function(name){
- this.iContext.getiWidgetAttributes().removeItem(name);
- },getViewerObject:function(){
- if(!this.m_oCV){
- try{
- this.m_oCV=window["oCV"+this.getViewerId()];
- }
- catch(ex){
- return null;
- }
- if(!this.m_oCV){
- var _d91=this.getWidgetId();
- for(var _d92=0;_d92<window.gaRV_INSTANCES.length;_d92++){
- if(window.gaRV_INSTANCES[_d92].widgetId==_d91){
- this.m_oCV=window.gaRV_INSTANCES[_d92];
- var _d93=this.getViewerId();
- var _d94=this.m_oCV.getId();
- this.setViewerId(_d94);
- var _d95=document.getElementsByTagName("head").item(0).childNodes;
- for(var i=0;i<_d95.length;i++){
- var node=_d95[i];
- if(node.getAttribute&&node.getAttribute("namespaceId")==_d93){
- node.setAttribute("namespaceId",_d94);
- }
- }
- break;
- }
- }
- }
- }
- return this.m_oCV;
- },setViewerId:function(id){
- this.viewerId=id;
- },getViewerId:function(){
- if(!this.viewerId){
- this.viewerId=this.namespacePrefix+this.viewerIdentifier;
- }
- return this.viewerId;
- },getLoadManager:function(){
- return this.m_oLoadManager;
- },getReportBlocker:function(){
- if(!this.m_reportBlocker){
- this.m_reportBlocker=new Blocker(this.m_oCV.getId());
- }
- return this.m_reportBlocker;
- },placeTabControlInView:function(){
- var oCV=this.getViewerObject();
- if(oCV&&oCV.getTabController()){
- if(oCV.getTabController().getSelectedTab()&&oCV.getTabController().getSelectedTab().getFocusableDiv()){
- oCV.setKeepFocus(oCV.getTabController().getSelectedTab().getFocusableDiv());
- }
- dojo.window.scrollIntoView(oCV.getTabController().getWrapperDiv());
- }
- },setReportBlocker:function(_d9a){
- this.m_reportBlocker=_d9a;
- },isSavedOutput:function(){
- var _d9b=this.getViewerObject();
- if(typeof _d9b!=="undefined"&&_d9b!==null){
- var _d9c=(_d9b.envParams["ui.action"]);
- return (_d9c==="view"||_d9c==="buxView");
- }
- return false;
- },isMobile:function(){
- return this._isMobile;
- },getEmbeddedMobileItem:function(){
- var _d9d=false;
- var _d9e=this.iContext.getItemSet("buxrtstate",false);
- if(_d9e){
- _d9d=_d9e.getItemValue("embeddedMobile")=="true"?true:false;
- }
- return _d9d;
- },getBUXRTStateInfoMap:function(_d9f){
- if(!window.icdConfig||!window.icdConfig.ZIPIMode||window.icdConfig.ZIPIMode==="0"){
- return "";
- }
- var _da0=["<RTStateInfo>"];
- if(_d9f&&_d9f.length>0){
- _da0.push(_d9f);
- }
- var _da1=this.getDisplayName();
- if(_da1&&_da1.length>0){
- _da0.push("<widgetTitle>",xml_encode(_da1),"</widgetTitle>");
- }
- if(this._BUXDBInfoArray&&this._BUXDBInfoArray.length>0){
- _da0=_da0.concat(this._BUXDBInfoArray);
- }
- _da0.push("</RTStateInfo>");
- return _da0.length>2?_da0.join(""):"";
- },getBUXDBInfoArray:function(_da2){
- var _da3=null;
- var _da4=null;
- if(_da2){
- _da3=_da2.dbTitle;
- _da4=_da2.dbSearchPath;
- }else{
- var _da5=this.iContext.getItemSet("buxrtstate",false);
- if(_da5){
- _da3=_da5.getItemValue("dbTitle");
- _da4=_da5.getItemValue("dbSearchPath");
- }
- }
- var _da6=[];
- if(_da3&&_da4&&_da4.length>0){
- _da6.push("<dbTitle>",xml_encode(_da3),"</dbTitle><dbSearchPath>",xml_encode(_da4),"</dbSearchPath>");
- }
- return _da6;
- },loadExtraJavascriptFiles:function(_da7){
- if(typeof CSelectionContext=="undefined"){
- this._loadFile("/drill/CSelectionContextBuilder.js",_da7);
- }
- this._loadFile("/mdsrv/lineage.js",_da7);
- if(window.cognosViewerDebug){
- this._loadFile("/rv/viewer.extra.debug.js",_da7);
- }else{
- this._loadFile("/rv/viewer.extra.js",_da7);
- }
- },_loadFile:function(_da8,_da9){
- if(dojo.isIE||dojo.isTrident||_da9.indexOf("..")==0){
- var _daa=window.gScriptLoader.loadFile(_da9+_da8,"","GET");
- var _dab=document.createElement("script");
- _dab.type="text/javascript";
- _dab.text=_daa;
- document.getElementsByTagName("head")[0].appendChild(_dab);
- }else{
- dojo._loadPath(_da9+_da8,null);
- }
- },_getCWALaunchInformation:function(){
- 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){
- this.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
- this.fireEvent("com.ibm.bux.widget.notification",null,{type:"error",message:_dad.message,description:_dad.description});
- }),load:dojo.hitch(this,function(_dae,_daf){
- var _db0=_daf.xhr.getResponseHeader("Content-Type");
- if(_db0&&_db0.indexOf("text/html")!=-1&&_dae&&_dae.match(/<ERROR_CODE>CAM_PASSPORT_ERROR<\/ERROR_CODE>/)){
- this.handlePassportErrorFromDispatcher();
- }else{
- this._launchCWA(_dae);
- }
- })};
- dojo.xhrPost(args);
- },_launchCWA:function(_db1){
- if(_db1){
- if(typeof NewReportAction=="undefined"){
- this.loadExtraJavascriptFiles(_db1.webContentRoot);
- if(_db1.productLocale!="en"){
- this._loadFile("rv/res/viewer_"+_db1.productLocale+".js",_db1.webContentRoot);
- }
- }
- var _db2=new NewReportAction();
- _db2.setRequestParms({"packageSearchPath":this.getAttributeValue("packageSearchPath"),"viewerIWidget":this,"webContentRoot":_db1.webContentRoot,"gateway":_db1.gateway,"capabilitiesXml":_db1.capabilitiesXML,"cafContextId":_db1.cafContextId});
- this.removeAttributeValue("packageSearchPath");
- _db2.execute();
- }
- },setNewReportInfo:function(info){
- this._newReportInfo=info;
- },_handleFileDialogCancel:function(){
- this.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
- },_handleFileDialogOk:function(_db4){
- this.removeAttributeValue("newReport");
- this.setAttributeValue("packageSearchPath","storeID(\""+_db4+"\")");
- this.onLoad();
- },onLoad:function(){
- this.sViewerIWidgetId=this.iContext.getRootElement().id;
- if(this.getAttributeValue("packageSearchPath")){
- this._getCWALaunchInformation();
- return;
- }else{
- if(this.getAttributeValue("newReport")==="true"){
- dojo["require"]("bux.dialogs.FileDialog");
- var oDlg=new bux.dialogs.PackageDialog({onCancelHandler:dojo.hitch(this,this._handleFileDialogCancel),selectPackageHandler:dojo.hitch(this,this._handleFileDialogOk)});
- oDlg.startup();
- oDlg.show();
- return;
- }
- }
- var _db6=this.getAttributeValue("ViewerConcurrentRequestLimit");
- if(_db6){
- this.removeAttributeValue("ViewerConcurrentRequestLimit");
- if(!window["gReportWidgetLoadQueue"]){
- window["gReportWidgetLoadQueue"]=new ReportWidgetLoadQueue(_db6);
- }
- }
- this._isMobile=this.getEmbeddedMobileItem();
- this._BUXDBInfoArray=this.getBUXDBInfoArray();
- var _db7=this.getAttributeValue("viewerProperties");
- var _db8=this.getAttributeValue("promptParametersRetrieved");
- if(_db8!==null&&_db8=="true"){
- this.promptParametersRetrieved=true;
- }
- this.properties=this.createProperties(_db7);
- this.savedOutput.setPagedOutput(!this.properties.getRetrieveAll());
- this.setWidgetCopyPasteParameters();
- this.m_bSelectionFilterSwitch=this.getAttributeValue("selectionFilterEnabled")=="true"?true:false;
- if(this.isOpeningSavedDashboard()&&this.copyPasteResource==null){
- this.disableListenToIfFullReportUpgraded();
- this.enableFlashChartsToIfReportPartUpgraded();
- this.disableListenToIfReportPartUpgraded();
- if(this.isVisible()){
- if(window["gReportWidgetLoadQueue"]){
- window["gReportWidgetLoadQueue"].add(this);
- }else{
- this.postReport(null);
- }
- }
- }else{
- var _db9={action:"canvas.filters"};
- this.fireEvent("com.ibm.bux.widget.action",null,_db9);
- this.getLoadManager().viewerLoadInitiated();
- this.m_visible=true;
- }
- this.addWidgetEventListeners();
- this.iContext.iEvents.svc.addWire(this.iContext.widgetId,"com.ibm.widget.contextChanged","widgetBuxCanvasTabs","com.ibm.widget.contextChanged");
- this.iContext.iEvents.svc.addWire(this.iContext.widgetId,"com.ibm.bux.data.filterCache.init","widgetBuxCanvasTabs","com.ibm.bux.data.filterCache.init");
- this.fireEvent("com.ibm.bux.widget.updateStoreID",null,{});
- },addWindowEventListeners:function(){
- if(!this.dojoConnections){
- this.dojoConnections=[];
- }
- this.dojoConnections.push(dojo.connect(window,"onresize",this,this.onBrowserResize));
- this.dojoConnections.push(dojo.connect(window,"onbeforeunload",this,this.possibleUnloadEvent));
- },addWidgetEventListeners:function(){
- if(this.isMobile()){
- this.dojoConnections.push(dojo.connect(this.iContext.getRootElement(),"touchstart",this,this.onTouchStart));
- this.dojoConnections.push(dojo.connect(this.iContext.getRootElement(),"touchmove",this,this.onTouchMove));
- }
- },addChromeWhitespaceHandler:function(_dba){
- if(isIE()){
- var _dbb=document.getElementById("mainViewerTR"+_dba);
- if(_dbb){
- this.dojoConnections.push(dojo.connect(_dbb,"onmousedown",this,this.onMouseDownOnChromeDiv));
- }
- }
- },onMouseDownOnChromeDiv:function(evt){
- if(evt.srcElement.id.indexOf("PRMT",0)===0){
- return;
- }
- var oCV=this.getViewerObject();
- if(oCV){
- var _dbe=oCV.getReportDiv();
- if(_dbe){
- var _dbf=_dbe.getBoundingClientRect();
- var _dc0=_dbf.top+_dbe.offsetHeight;
- if(evt.clientY>_dc0&&evt.button!==2){
- if(oCV.getSelectionController()){
- oCV.getSelectionController().clearSelectedObjects();
- this.onSelectionChange();
- stopEventBubble(evt);
- }
- }
- }
- }
- },removeWindowEventListeners:function(){
- if(this.dojoConnections){
- for(var i=0;i<this.dojoConnections.length;++i){
- dojo.disconnect(this.dojoConnections[i]);
- }
- delete this.dojoConnections;
- }
- },onBrowserResize:function(){
- var oCV=this.getViewerObject();
- if(oCV&&oCV.getPinFreezeManager()){
- oCV.getPinFreezeManager().onResizeCanvas(this.isVisible());
- }
- },onTouchStart:function(e){
- this.touchPaging=false;
- if(this.m_oCV&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
- var _dc4=e.changedTouches[0];
- if(_dc4&&_dc4.clientX){
- this.touchStartX=parseInt(_dc4.clientX);
- }
- }
- },onTouchMove:function(e){
- if(!this.touchPaging&&this.touchStartX!=-1&&this.m_oCV&&e&&e.changedTouches&&e.touches&&e.touches.length==1){
- var _dc6=e.changedTouches[0];
- if(_dc6&&_dc6.clientX){
- var _dc7=parseInt(_dc6.clientX);
- if(this.m_oCV.hasNextPage()&&this.touchStartX-_dc7>10){
- this.touchPaging=true;
- this.m_oCV.pageAction("nextPage");
- this.m_oCV.setKeepFocus(false);
- }else{
- if(this.m_oCV.hasPrevPage()&&_dc7-this.touchStartX>10){
- this.touchPaging=true;
- this.m_oCV.pageAction("previousPage");
- this.m_oCV.setKeepFocus(false);
- }else{
- this.touchPaging=false;
- this.touchStartX=-1;
- }
- }
- }
- }
- if(this.touchStartX>0){
- stopEventBubble(e);
- }
- },isLiveReport:function(){
- return this.isSavedOutput()===false&&!this.isLimitedInteractiveMode();
- },createProperties:function(_dc8){
- return new bux.reportViewer.Properties(this,_dc8);
- },disableListenToIfFullReportUpgraded:function(){
- if(this.isGoDashboardReportUpgrade()){
- if(this.getAttributeValue("flexParam_properties")==null){
- var _dc9={};
- _dc9["*"]={blockedEvents:["com.ibm.bux.data.filter","com.ibm.bux.filter.values.get","com.ibm.bux.filter.items.get"]};
- this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_dc9);
- }
- }
- },enableFlashChartsToIfReportPartUpgraded:function(){
- if(this.isGoDashboardReportUpgrade()){
- var _dca=this.getAttributeValue("originalReportPart");
- if(typeof _dca!=="undefined"&&_dca!==null){
- this.properties.setProperty("flashCharts","true");
- }
- }
- },disableListenToIfReportPartUpgraded:function(){
- if(this.isGoDashboardReportUpgrade()){
- var _dcb=this.getAttributeValue("originalReportPart");
- if(typeof _dcb!=="undefined"&&_dcb!==null){
- var _dcc={};
- _dcc["*"]={blockedEvents:["com.ibm.bux.viewer.drill","com.ibm.bux.viewer.prompt"]};
- this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_dcc);
- }
- }
- },possibleUnloadEvent:function(){
- var oCV=this.getViewerObject();
- if(oCV){
- oCV.getViewerDispatcher().possibleUnloadEvent();
- }
- },onUnload:function(){
- this.onUnloadInProgress=true;
- this.destroy();
- this.iContext=null;
- },onGetFiltersDone:function(evt){
- if(typeof this.filterRequiredAction!="undefined"&&this.filterRequiredAction!=null){
- var _dcf=this.buildDataFiltersParam(evt.payload.filters);
- var _dd0=new ActionFactory(this.getViewerObject());
- var _dd1=_dd0.load(this.filterRequiredAction);
- _dd1.dispatchRequest(_dcf,this.filterRequiredAction);
- this.filterRequiredAction=null;
- }else{
- this.postReport(evt.payload.filters);
- this.postSetWidgetCopyPasteParameters();
- }
- },getOriginalFormFields:function(){
- return this.m_originalFormFields;
- },setOriginalFormFields:function(_dd2){
- this.m_originalFormFields=_dd2;
- },getXNodeId:function(){
- return this.xNodeId;
- },setXNodeId:function(_dd3){
- this.xNodeId=_dd3;
- },postReport:function(_dd4){
- this.getLoadManager().viewerLoadInitiated();
- this.viewerWidgetLastAction={"functionName":"postReport","param":[_dd4]};
- if(this.getRunReportOption()!==false){
- this.m_oLoadManager.runningReport();
- }
- var _dd5=this.buildPostContent(_dd4);
- if(_dd5["ui.reportDrop"]=="true"){
- this.m_bReportDropped=true;
- }
- this.m_originalFormFields=new CDictionary();
- for(var _dd6 in _dd5){
- if(_dd6!="cv.outputKey"){
- this.m_originalFormFields.add(_dd6,_dd5[_dd6]);
- }
- }
- var _dd7={};
- if(this.getAttributeValue("X-Node-ID")){
- this.setXNodeId(this.getAttributeValue("X-Node-ID"));
- _dd7["X-Node-ID"]=this.getAttributeValue("X-Node-ID");
- this.removeAttributeValue("X-Node-ID");
- }
- var args={url:this.buildPostUrl(),sync:false,preventCache:true,content:_dd5,headers:_dd7,error:dojo.hitch(this,function(_dd9){
- this.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
- this.fireEvent("com.ibm.bux.widget.notification",null,{type:"error",message:_dd9.message,description:_dd9.description});
- })};
- if(typeof xhrMultiPart!=="undefined"&&xhrMultiPart.active){
- args.load=dojo.hitch(this,function(_dda){
- this.loadContent(_dda.responseText);
- });
- xhrMultiPart.Post(args);
- }else{
- args.load=dojo.hitch(this,function(_ddb,_ddc){
- var _ddd=_ddc.xhr.getResponseHeader("Content-Type");
- if(_ddd&&_ddd.indexOf("text/html")!=-1&&_ddb&&_ddb.match(/<ERROR_CODE>CAM_PASSPORT_ERROR<\/ERROR_CODE>/)){
- this.handlePassportErrorFromDispatcher();
- }else{
- this.loadContent(_ddb);
- }
- });
- dojo.xhrPost(args);
- }
- },isDropped:function(){
- return this.m_bReportDropped;
- },cleanupStyles:function(){
- this._cssLimitReached=true;
- if(!this.isVisible()){
- if(!this._styles){
- this._styles=[];
- }
- var id=this.getViewerId();
- var _ddf=document.getElementsByTagName("head").item(0).getElementsByTagName("style");
- for(var i=0;i<_ddf.length;i++){
- var _de1=_ddf[i];
- if(_de1.getAttribute&&_de1.getAttribute("namespaceId")==id){
- _de1.parentNode.removeChild(_de1);
- this._styles.push(_de1);
- i--;
- }
- }
- }
- },reloadStyles:function(){
- if(this._styles){
- while(this._styles.length>0){
- var _de2=this._styles.pop();
- document.getElementsByTagName("head").item(0).appendChild(_de2);
- }
- }
- },loadStylesAndScripts:function(_de3,_de4,_de5){
- window.gScriptLoader.m_bIgnoreAjaxWarnings=true;
- window.gScriptLoader.setHandlerStylesheetLimit(true);
- var _de6=this.iContext.getRootElement();
- if(!_de6){
- return;
- }
- _de3=window.gScriptLoader.loadCSS(_de3,_de4,true,this.getViewerId());
- if(dojo.isIE||dojo.isTrident){
- _de3="<span style='display:none'> </span>"+_de3;
- }
- _de4.innerHTML=_de3;
- if(this.isSelectionFilterEnabled()){
- this.updateDrillThroughLinks();
- }
- var _de7=GUtil.generateCallback(this.fireResizeEvent,[],this);
- this.m_sScriptLoaderNamespace=this.getViewerId();
- window.gScriptLoader.loadAll(_de4,_de7,this.m_sScriptLoaderNamespace,_de5);
- },fireResizeEvent:function(){
- var _de8=this.getViewerObject();
- if(_de8==null){
- this.fireEvent("com.ibm.bux.widget.render.done",null,{});
- }else{
- var _de9=_de8.getViewerWidget();
- if(_de9){
- _de8.m_resizeReady=true;
- _de8.doneLoading();
- }else{
- var _dea=this;
- setTimeout(function(){
- _dea.fireResizeEvent();
- },100);
- }
- }
- },getSavedReportSearchPath:function(_deb){
- var _dec=this.getAttributeValue("savedReportPath");
- if(_dec){
- return _dec;
- }
- var _ded=this.getAttributeValue("dashboardID");
- _ded=_ded.substr("$$dbid$$".length);
- var _dee="storeID(\""+_ded+"\")/*[@name="+xpath_attr_encode(_deb)+"]";
- return _dee;
- },isSavedReport:function(_def,_df0){
- return (typeof _df0!=="undefined"&&_df0!==null&&_df0.length>0&&_def!==_df0);
- },getGlobalPromptsInfo:function(){
- var _df1=null;
- var oCV=null;
- var _df3=[];
- var _df4=null;
- if(window.gaRV_INSTANCES){
- for(var _df5=0;_df5<window.gaRV_INSTANCES.length;_df5++){
- oCV=window.gaRV_INSTANCES[_df5];
- _df4=oCV.getPromptParametersInfo();
- if(_df4!=null){
- _df3.push(_df4);
- }
- }
- }
- if(_df3.length>0){
- _df1="<globalPromptInfo>"+_df3.join("")+"</globalPromptInfo>";
- }
- return _df1;
- },buildPostUrl:function(){
- return this.getAttributeValue("gateway");
- },getSavedItem:function(){
- var _df6=this.getAttributeValue("savedReportPath");
- if(!_df6){
- _df6=this.getAttributeValue("savedReportName");
- }
- return _df6;
- },setRunReportOption:function(_df7){
- this.m_bRunReportOption=_df7;
- },getRunReportOption:function(){
- return this.m_bRunReportOption;
- },resetRunReportOption:function(){
- this.m_bRunReportOption=null;
- },buildPostContent:function(_df8){
- var _df9=this.getAttributeValue("originalReport");
- var _dfa=this.getSavedItem();
- var _dfb=this.getAttributeValue("originalReportPart");
- var _dfc=this.getAttributeValue("flexParam_properties");
- var _dfd=this.getAttributeValue("flexParam_promptData");
- var _dfe=this.isSavedReport(_df9,_dfa);
- var _dff=this.getPromptRunOption(_dfd,_dfe);
- var _e00=this.getAttributeValue("cv.outputKey")?"cvx.high":"cognosViewer";
- var _e01={"b_action":_e00,"run.outputFormat":"HTML","bux":"true","cv.responseFormat":"iWidget","cv.id":this.getViewerId()};
- if(this.isMobile()){
- _e01["container"]="mobile";
- }
- if(this.getAttributeValue("cv.outputKey")){
- _e01["cv.outputKey"]=this.getAttributeValue("cv.outputKey");
- this.removeAttributeValue("cv.outputKey");
- _e01["widget.id"]=this.getWidgetId();
- }
- if(this.getAttributeValue("gateway")){
- _e01["cv.gateway"]=this.getAttributeValue("gateway");
- }
- if(this.getAttributeValue("webcontent")){
- _e01["cv.webcontent"]=this.getAttributeValue("webcontent");
- }
- this.sInitialSpec=this.getAttributeValue("specification");
- if(_dfe){
- this.addUserParamsToContent(_e01);
- }
- if(!this.sInitialSpec||this.copyPasteResource){
- if(_dfe){
- _e01["ui.object"]=this.getSavedReportSearchPath(_dfa);
- if(!this.getAttributeValue("savedReportPath")&&this.getAttributeValue("savedReportName")){
- _e01["savedReportName"]=_dfa;
- }
- _e01["widget.isSavedReport"]="true";
- _e01["ui.reRunObj"]=this.getSavedReportSearchPath(_dfa);
- }else{
- _e01["ui.object"]=_df9;
- if(_dfc&&_dfc.length>0){
- _e01["flexParamProperties"]=_dfc;
- }
- if(_dfd&&_dfd.length>0){
- _e01["gdPromptAnswers"]=_dfd;
- }
- }
- _e01["originalReport"]=_df9;
- }
- if(this.getAttributeValue("savedOutputSearchPath")!=null){
- this.setSavedOutputSearchPath(this.getAttributeValue("savedOutputSearchPath"));
- _e01["ui.savedOutputSearchPath"]=this.getAttributeValue("savedOutputSearchPath");
- _e01["ui.action"]="buxView";
- }else{
- if(this.getAttributeValue("mostRecentSavedOutput")=="true"){
- _e01["ui.action"]="buxView";
- }else{
- if(_dfe){
- if(this.getAttributeValue("limitedInteractiveMode")==="true"){
- _e01["limitedInteractiveMode"]="true";
- _e01["ui.action"]="run";
- _e01["run.xslURL"]="bux.xsl";
- }else{
- _e01["ui.action"]="bux";
- }
- if(this.getRunReportOption()!==null){
- _e01["widget.runReport"]=(this.getRunReportOption())?"true":"false";
- if(this.getDoGetParametersOnLoad()){
- _e01["widget.globalPromptInfo"]="<globalPromptInfo></globalPromptInfo>";
- }
- this.resetRunReportOption();
- }
- }else{
- if(_dfb&&_dfb.length>0&&this.copyPasteResource==null){
- _e01["ui.reportDrop"]="true";
- _e01["ui.action"]="bux";
- _e01["reportpart_id"]=_dfb;
- }else{
- if(this.copyPasteResource){
- if(this.ciPublishedReportPath!=null){
- _e01["ui.object"]=this.ciPublishedReportPath;
- }
- var _e02=dojo.fromJson(this.copyPasteResource);
- if(_e02[0]&&_e02[0].body){
- var _e03=this.getAttributeValue("copy.conversation");
- if(_e03){
- _e01["ui.conversation"]=_e03;
- }
- if(_e02[0].body.specification){
- _e01["ui.spec"]=_e02[0].body.specification;
- _e01["ui.action"]="buxCopyPaste";
- if(this.getAttributeValue("reportCreatedInCW")==="true"){
- _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
- }
- }else{
- _e01["ui.reportDrop"]="true";
- _e01["ui.action"]="buxDropReportOnCanvas";
- }
- }
- }else{
- if(this.sInitialSpec){
- _e01["ui.spec"]=this.sInitialSpec;
- _e01["ui.action"]="buxRunSpecification";
- _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
- }else{
- if(this._newReportInfo){
- for(prop in this._newReportInfo){
- _e01[prop]=this._newReportInfo[prop];
- }
- _e01["ui.reportDrop"]="true";
- _e01["ui.action"]="bux";
- _e01["cv.objectPermissions"]="read write execute setPolicy traverse";
- _e01["ui.objectClass"]="report";
- _e01["openReportFromClipboard"]="true";
- }else{
- _e01["ui.reportDrop"]="true";
- _e01["ui.action"]="buxDropReportOnCanvas";
- }
- }
- }
- }
- }
- }
- }
- if(_dff!==null){
- _e01["run.prompt"]=(_dff?"true":"false");
- }
- if(this.getAttributeValue("lastLocaleSaved")!=null){
- _e01["lastLocaleSaved"]=this.getAttributeValue("lastLocaleSaved");
- }
- var _e04="";
- if(this.copyPasteResource){
- _e04=this.updateCopyPasteFilters(_df8);
- }else{
- _e04=this.buildDataFiltersParam(_df8);
- if(typeof _df8=="undefined"||_df8==null){
- _e04=this.buildFiltersParamFromLoadedSliderState();
- }
- }
- if(_e04!=""){
- _e01["cv.updateDataFilters"]=_e04;
- }
- if(this.properties&&this.properties.getFlashCharts()!==null){
- _e01["savedFlashChartOption"]=(this.properties.getFlashCharts()?"true":"false");
- var _e05=this.getAttributeValue("hasAVSChart");
- if(_e05=="true"){
- _e01["hasAVSChart"]="true";
- }else{
- _e01["hasAVSChart"]="false";
- }
- }
- if(this.properties.getRowsPerPage()!=null){
- _e01["run.verticalElements"]=this.properties.getRowsPerPage();
- }
- var _e06=this.getAttributeValue("syncNewWidgets");
- if(_e06===null||_e06==="true"){
- _e06=true;
- }else{
- _e06=false;
- }
- if(!_dfe&&_e06){
- var _e07=this.getGlobalPromptsInfo();
- if(_e07!==null){
- _e01["widget.globalPromptInfo"]=_e07;
- }
- }
- if(this.isOpeningSavedDashboard()){
- _e01["ui.preserveRapTags"]="true";
- }
- if(_dfe===true&&this.getAttributeValue("limitedInteractiveMode")!=="true"){
- this.getUserId();
- }
- if(window.cognosViewerDebug){
- _e01.debug=true;
- }
- _e01["cv.buxCurrentUserRole"]=this.getUserRole();
- if(this.shouldUseSavedReportInfo()){
- _e01["rap.getReportInfo"]="false";
- }
- if(window.icdConfig&&window.icdConfig.ZIPIMode!="0"){
- this.addBUXRTStateInfoToContent(_e01);
- }
- this.addBUXWidgetTitleToContent(_e01);
- return _e01;
- },addBUXRTStateInfoToContent:function(_e08){
- if(_e08!=null){
- var _e09=this.getBUXRTStateInfoMap();
- if(_e09&&_e09.length>0){
- _e08["cv.buxRTStateInfo"]=_e09;
- }
- }
- },addBUXWidgetTitleToContent:function(_e0a){
- if(_e0a!=null){
- var _e0b=this.getAttributeValue("widgetTitle");
- if(_e0b&&_e0b.length>0){
- _e0a["widgetTitle"]=_e0b;
- }
- var _e0c=this.getDisplayName();
- if(_e0c&&_e0c.length>0){
- _e0a["displayTitle"]=_e0c;
- }
- }
- },addUserParamsToContent:function(_e0d){
- var _e0e=this.getAttributeValue("userParams");
- if(!_e0e){
- return;
- }
- var doc=XMLBuilderLoadXMLFromString(_e0e);
- if(!doc){
- return;
- }
- var _e10=XMLHelper_FindChildrenByTagName(doc.documentElement,"item",false);
- var _e11=_e10.length;
- for(var i=0;i<_e11;i++){
- if(!_e10[i]){
- continue;
- }
- var _e13=XMLHelper_FindChildByTagName(_e10[i],"name",false);
- if(!_e13){
- continue;
- }
- var _e14=XMLHelper_FindChildByTagName(_e10[i],"value",false);
- _e0d[XMLHelper_GetText(_e13)]=(!_e14?"":XMLHelper_GetText(_e14));
- }
- if(_e11>0){
- _e0d["widget.userParameters"]="true";
- if(this.getAttributeValue("viewerReportPrompts")){
- _e0d["viewerReportPrompts"]=this.getAttributeValue("viewerReportPrompts");
- }
- }
- this.removeAttributeValue("userParams");
- },shouldUseSavedReportInfo:function(){
- return this.getAttributeValue("rapReportInfoVersion")===this.RAP_REPORT_INFO_VERSION&&this.getAttributeValue("rapReportInfo")!=null;
- },isConsumeUser:function(){
- return this.getUserRole()==="consume";
- },getUserRole:function(){
- var _e15=null;
- var _e16=this.iContext.getItemSet("buxuserprofile",false);
- if(_e16){
- _e15=_e16.getItemValue("currentUserRole");
- }
- return _e15==null?"assemble":_e15;
- },getUserId:function(){
- dojo["require"]("bux.UserAccount");
- return bux.UserAccount.getUserAccount().then(dojo.hitch(this,function(_e17){
- this.m_sUserId=_e17.cm$searchPath;
- return this.m_sUserId;
- }));
- },_genMobileFormFieldPayload:function(form){
- var _e19={};
- var _e1a=form.getElementsByTagName("input");
- if(_e1a){
- for(var i=0;i<_e1a.length;i++){
- var name=_e1a[i].getAttribute("name");
- var _e1d=_e1a[i].getAttribute("value");
- if(name&&_e1d){
- _e19[name]=_e1d;
- }
- }
- }
- return _e19;
- },launchGotoPageForIWidgetMobile:function(form){
- var _e1f={"action":"goto","payload":this._genMobileFormFieldPayload(form)};
- if(typeof console!="undefined"&&console&&console.log){
- console.log(_e1f);
- }
- this.fireEvent("com.ibm.bux.widget.openView",null,_e1f);
- },executeDrillThroughForIWidgetMobile:function(form){
- var _e21=getChildElementsByAttribute(form,"input","name","ui.action");
- if(_e21&&_e21.length>0){
- _e21[0].setAttribute("value","authoredDrillThroughMobile");
- }
- var _e22={"action":"drillThrough","payload":this._genMobileFormFieldPayload(form)};
- if(typeof console!="undefined"&&console&&console.log){
- console.log(_e22);
- }
- this.fireEvent("com.ibm.bux.widget.openView",null,_e22);
- },isBuxAvailable:function(){
- return (this.bux&&this.bux._base?true:false);
- },getDrillOptions:function(){
- return this.properties.getDrillOptions();
- },getPromptRunOption:function(_e23,_e24){
- if(!_e24&&_e23&&_e23.length>0){
- return false;
- }else{
- if(_e24){
- return this.properties.getPromptUserOnLoad();
- }else{
- return null;
- }
- }
- },buildDataFiltersParam:function(_e25){
- var _e26="";
- if(_e25&&_e25.length>0){
- this.sliderState={};
- _e26="<UpdateDataFilters>";
- for(var _e27=0;_e27<_e25.length;++_e27){
- var _e28=_e25[_e27];
- var _e29=dojo.fromJson(_e28);
- if(_e29.clientId==this.getWidgetId()){
- continue;
- }
- if(!(_e29["com.ibm.widget.context.bux.selectValueControl"])){
- this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_e29);
- this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_e29);
- _e28=dojo.toJson(_e29);
- }
- _e26+="<filter>"+xml_encode(_e28)+"</filter>";
- this.sliderState[_e29.clientId]=_e28;
- }
- _e26+="</UpdateDataFilters>";
- }
- return _e26;
- },updateCopyPasteFilters:function(_e2a){
- this.loadSliderState();
- if(this.sliderState){
- for(var _e2b in this.sliderState){
- 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'}}}";
- }
- }
- if(_e2a&&_e2a.length>0){
- for(var _e2c=0;_e2c<_e2a.length;++_e2c){
- var _e2d=_e2a[_e2c];
- var _e2e=dojo.fromJson(_e2d);
- if(_e2e["com.ibm.widget.context.bux.selection"]){
- this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_e2e);
- this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_e2e);
- _e2d=dojo.toJson(_e2e);
- }
- this.sliderState[_e2e.clientId]=_e2d;
- }
- }
- return this.buildDataFiltersParam_fromState();
- },buildFiltersParamFromLoadedSliderState:function(){
- var _e2f="";
- this.loadSliderState();
- _e2f=this.buildDataFiltersParam_fromState();
- return _e2f;
- },loadSliderState:function(){
- this.sliderState={};
- var _e30=dojo.fromJson(this.getAttributeValue("sliderIDs"));
- if(_e30){
- for(var i=0;i<_e30.length;++i){
- var _e32=_e30[i];
- var _e33=this.getItemValue("sliderState_"+_e32);
- if(_e33!=null&&_e33!=""){
- this.sliderState[_e32]=_e33;
- }
- }
- }
- },buildDataFiltersParam_fromState:function(){
- var _e34="";
- if(this.sliderState){
- for(var _e35 in this.sliderState){
- _e34+="<filter>"+xml_encode(this.sliderState[_e35])+"</filter>";
- }
- if(_e34!==""){
- return ("<UpdateDataFilters>"+_e34+"</UpdateDataFilters>");
- }
- }
- return _e34;
- },loadContent:function(_e36){
- var _e37=dojo.byId("_"+this.iContext.widgetId+"_cv");
- this.loadStylesAndScripts(_e36,_e37,true);
- if(!window.gScriptLoader.hasCompletedExecution()){
- var obj=this;
- this.timer=setInterval(function(){
- window.gInitializeViewer(obj);
- },this.timerInterval);
- }else{
- window.gInitializeViewer(this);
- }
- this.viewerWidgetLastAction=null;
- },executeAction:function(evt,_e3a){
- var _e3b=this.getViewerObject();
- if(evt&&_e3b){
- var _e3c=_e3a?_e3a:evt.payload.name;
- var _e3d=evt.payload;
- if(_e3c&&typeof _e3d!="undefined"&&_e3d!=null){
- if(evt.payload.payload){
- _e3d=evt.payload.payload;
- }
- _e3b.executeAction(_e3c,_e3d);
- }
- }
- },onContextMenuAction:function(evt){
- this.executeAction(evt);
- },onToolbarAction:function(evt){
- this.executeAction(evt);
- },updateToolbar:function(){
- var _e40=this.getViewerObject();
- if(!_e40||(!this.bToolbarInitialized&&typeof CognosViewerAction!="function")){
- return;
- }
- if(_e40.getStatus()==="prompting"){
- return;
- }
- var _e41=_e40.getToolbar();
- CCognosViewerToolbarHelper.updateToolbarForCurrentSelection(_e40,_e41);
- this.fireEvent("com.ibm.bux.widgetchrome.toolbar.init",null,_e40.getToolbar());
- },onSelect:function(){
- if(!this.bToolbarInitialized){
- this.bToolbarInitialized=true;
- var _e42=this.getViewerObject();
- if(_e42){
- var _e43=_e42.getStatus();
- if(_e43!=="prompting"&&_e43!=="working"&&_e43!="stillWorking"){
- this.updateToolbar();
- }
- }
- }
- this.fireEvent("com.ibm.bux.widget.select.done",null,{});
- },hideToolbarAndContextMenu:function(){
- this.fireEvent("com.ibm.bux.widget.contextMenu.update");
- this.fireEvent("com.ibm.bux.widgetchrome.toolbar.init");
- },updateSavedAttributes:function(_e44){
- this.setAttributeValue("version",this.BUX_REPORT_VERSION);
- this.setAttributeValue("viewerProperties",this.properties.toString());
- if(this.m_oWidgetContextManager.getSelectionFilterObjects()){
- this.setAttributeValue("selectionObjects",this.m_oWidgetContextManager.toStringSelectionFilterObjects());
- }
- if(_e44==="live"){
- var oCV=this.getViewerObject();
- var _e46=this.getEnvParam("reportPrompts");
- if(this.promptParametersRetrieved==true&&_e46&&_e46.length>0){
- this.setAttributeValue("viewerReportPrompts",this.getEnvParam("reportPrompts"));
- }
- this.setAttributeValue("promptParametersRetrieved",(this.promptParametersRetrieved?"true":"false"));
- this.setAttributeValue("selectionFilterEnabled",this.m_bSelectionFilterSwitch?"true":"false");
- if(this.getEnvParam("reportpart_id")&&this.getEnvParam("reportpart_id").length>0){
- this.setAttributeValue("fromReportPart","true");
- }
- if(this.isLimitedInteractiveMode()){
- this.setAttributeValue("limitedInteractiveMode","true");
- }else{
- this.setAttributeValue("baseReportModificationTime",oCV.envParams["baseReportModificationTime"]);
- }
- var _e47=oCV.envParams["contentLocale"];
- if(_e47!=null){
- this.saveSliderState();
- this.setAttributeValue("lastLocaleSaved",_e47);
- }
- this.setAttributeValue("originalReportLocation",oCV.envParams["originalReportLocation"]);
- this.setAttributeValue("hasAVSChart",oCV.hasAVSChart()?"true":"false");
- this.setAttributeValue("displayTypes",this.getDisplayTypes());
- this.setSavedOutputsCMResponse(null);
- if(oCV.getPinFreezeManager()){
- var _e48=oCV.getPinFreezeManager().toJSONString();
- this.setAttributeValue("PinFreezeInfo",_e48);
- }
- if(oCV.envParams["rapReportInfo"]){
- this.setAttributeValue("rapReportInfoVersion",this.RAP_REPORT_INFO_VERSION);
- this.setAttributeValue("rapReportInfo",oCV.envParams["rapReportInfo"]);
- }
- }
- if(_e44==="savedOutput"){
- if(this.getSavedOutputSearchPath()==null){
- this.setAttributeValue("mostRecentSavedOutput","true");
- }else{
- this.setAttributeValue("savedOutputSearchPath",this.getSavedOutputSearchPath());
- }
- this.setAttributeValue("selectionFilterEnabled",this.m_bSelectionFilterSwitch?"true":"false");
- }
- },onItemSetChanged:function(_e49){
- if(this.getViewerObject()){
- var _e4a=_e49.payload.changes;
- for(var i in _e4a){
- if(_e4a[i].id==="savedReportPath"&&_e4a[i].newVal){
- this.updateCVEnvParam();
- }
- }
- }
- },updateCVEnvParam:function(){
- var oCV=this.getViewerObject();
- oCV.envParams["ui.objectClass"]=this.isSavedOutput()?"reportView":"report";
- oCV.envParams["widget.isSavedReport"]="true";
- var _e4d=this.getAttributeValue("savedReportName");
- if(_e4d){
- oCV.envParams["ui.object"]=_e4d;
- oCV.envParams["savedReportName"]=_e4d;
- }else{
- oCV.envParams["ui.object"]=this.getAttributeValue("savedReportPath");
- }
- },onWidgetSave:function(evt){
- var _e4f=this.getViewerObject();
- var _e50={"status":false};
- if(evt&&evt.payload&&evt.payload.isCopy===true){
- this.setAttributeValue("copy.conversation",_e4f.getConversation());
- }else{
- this.removeItem("copy.conversation");
- this.removeItem("copy.ciPublishedReportPath");
- }
- var _e51=evt&&evt.payload&&evt.payload.operation=="saveAs"?true:false;
- if(!_e4f&&!_e51){
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
- return;
- }
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _e52=this.getViewerObject();
- _e52.loadExtra();
- if(this.isSavedOutput()){
- this.cleanSavedAttributes();
- this.updateSavedAttributes("savedOutput");
- _e50.status=true;
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
- }else{
- if(this.sInitialSpec){
- _e50.status=true;
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
- }else{
- var _e53=this.getEnvParam("cv.objectPermissions");
- var _e54=new ViewerIWidgetSave(this,evt.payload);
- if(!_e54.canSave(_e53)){
- this.showErrorMessage(RV_RES.IDS_CANNOT_SAVE_CONTENT_ERROR);
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
- return;
- }
- if(this.isLimitedInteractiveMode()||(_e52.envParams["ui.spec"]&&_e52.envParams["ui.spec"].length>0)){
- this.cleanSavedAttributes();
- this.updateSavedAttributes("live");
- if(_e54.doGetSavePropertiesFromServer()){
- _e54.getSavePropertiesFromServer();
- }else{
- this.doWidgetSaveDone(_e54);
- }
- }else{
- if(!_e52.envParams["ui.spec"]){
- _e54.setDoCWCopy(true);
- this.doWidgetSaveDone(_e54);
- }else{
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e50);
- }
- }
- }
- }
- }),evt);
- },doWidgetSaveDone:function(_e55){
- var _e56=_e55.getPayload();
- _e56.status=true;
- if(window.icdConfig&&window.icdConfig.ZIPIMode!="0"){
- var _e57=_e55.m_payload.dashboard;
- if(_e57){
- this._BUXDBInfoArray=this.getBUXDBInfoArray({dbTitle:_e57.title._text,dbSearchPath:_e57.cm$searchPath});
- }
- }
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e56);
- },handleGetSavePropertiesFromServerResponse:function(_e58,_e59){
- var _e5a=new ViewerIWidgetSave(this,_e59);
- if(_e58&&_e58.getJSONResponseObject()){
- applyJSONProperties(this.getViewerObject(),_e58.getJSONResponseObject());
- }
- this.doWidgetSaveDone(_e5a);
- },isPreCaspianRP1BUXReport:function(){
- var _e5b=this.getAttributeValue("version");
- if(!_e5b||_e5b<this.BUX_REPORT_CASPIAN_RP1_VERSION){
- return true;
- }
- return false;
- },isGoDashboardReportUpgrade:function(){
- var _e5c=this.getAttributeValue("version");
- if(_e5c==this.GODASHBOARD_REPORT_VERSION){
- return true;
- }
- return false;
- },isOpeningSavedDashboard:function(){
- var _e5d=this.getAttributeValue("viewerProperties");
- if((_e5d&&_e5d.indexOf("{")===0)||this.isGoDashboardReportUpgrade()){
- return true;
- }
- return false;
- },cleanSavedAttributes:function(){
- this.removeAttributeValue("savedOutputSearchPath");
- this.removeAttributeValue("mostRecentSavedOutput");
- this.removeAttributeValue("savedReportName");
- this.removeAttributeValue("dashboardID");
- this.removeAttributeValue("savedReportId");
- this.removeAttributeValue("baseReportModificationTime");
- this.removeAttributeValue("viewerReportPrompts");
- this.removeAttributeValue("promptParametersRetrieved");
- this.removeAttributeValue("selectionFilterEnabled");
- this.removeAttributeValue("PinFreezeInfo");
- this.removeAttributeValue("rapReportInfoVersion");
- this.removeAttributeValue("rapReportInfo");
- this.removeAttributeValue("selectionObjects");
- if(this.isSavedOutput()){
- this.removeAttributeValue("savedReportPath");
- }
- },handleWidgetSaveDone:function(_e5e){
- var oCV=this.getViewerObject();
- var _e60=_e5e.getResult();
- if(_e60===null){
- _e60={};
- }
- this.cleanSavedAttributes();
- this.updateSavedAttributes("live");
- var _e61=_e60.reportName;
- var _e62=_e60.dashboard_id;
- this.setAttributeValue("savedReportName",_e61);
- this.setAttributeValue("dashboardID","$$dbid$$"+_e62);
- if(_e60.permissions){
- oCV.envParams["cv.objectPermissions"]=_e60.permissions;
- }
- if(_e60.objectClass){
- oCV.envParams["ui.objectClass"]=_e60.objectClass;
- }
- if(this.getEnvParam("reportpart_id")&&this.getEnvParam("reportpart_id").length>0){
- this.setAttributeValue("fromReportPart","true");
- }
- if(this.isLimitedInteractiveMode()){
- this.setAttributeValue("limitedInteractiveMode","true");
- }else{
- this.setAttributeValue("baseReportModificationTime",oCV.envParams["baseReportModificationTime"]);
- }
- var _e63=oCV.envParams["contentLocale"];
- if(_e63!=null){
- this.saveSliderState();
- this.setAttributeValue("lastLocaleSaved",_e63);
- }
- this.setAttributeValue("originalReportLocation",oCV.envParams["originalReportLocation"]);
- oCV.envParams["ui.object"]=this.getSavedReportSearchPath(_e61);
- oCV.envParams["savedReportName"]=_e61;
- this.setAttributeValue("hasAVSChart",oCV.hasAVSChart()?"true":"false");
- this.setAttributeValue("displayTypes",this.getDisplayTypes());
- this.setSavedOutputsCMResponse(null);
- var _e64={"status":true};
- this.fireEvent("com.ibm.bux.widget.save.done",null,_e64);
- },getDisplayTypes:function(){
- var oCV=this.getViewerObject();
- if(oCV.getRAPReportInfo()){
- return oCV.getRAPReportInfo().getDisplayTypes();
- }
- },saveSliderState:function(){
- var _e66=this.getViewerObject();
- var _e67=_e66.getRAPReportInfo();
- var _e68={};
- if(_e67){
- _e68=_e67.collectSliderSetFromReportInfo();
- }
- var i=0;
- var _e6a=[];
- for(var _e6b in this.sliderState){
- if(typeof _e68[_e6b]!="undefined"){
- this.setItemValue("sliderState_"+_e6b,this.sliderState[_e6b]);
- _e6a[i++]=_e6b;
- }else{
- this.removeItem("sliderState_"+_e6b);
- }
- }
- this.setAttributeValue("sliderIDs",dojo.toJson(_e6a));
- },onWidgetRefresh:function(evt){
- var _e6d={};
- var _e6e=this.getViewerObject();
- if(evt&&_e6e){
- if(_e6e.envParams["ui.action"]=="view"||_e6e.envParams["ui.action"]=="buxView"){
- _e6e.executeAction("RefreshViewEvent");
- }else{
- if(evt.payload&&evt.payload.refreshType=="preferencesChanged"){
- this.clearRAPCache();
- _e6e.executeAction("EditContent",{"preferencesChanged":true});
- _e6e.executeAction("Reprompt",{"preferencesChanged":true});
- }else{
- if(!this.isVisible()){
- this.getDelayedLoadingContext().setForceRunReport(true);
- }else{
- _e6e.executeAction("Refresh");
- }
- }
- }
- this.fireEvent("com.ibm.bux.widget.refresh.done",null,_e6d);
- }
- },invokeDisplayTypeDialog:function(_e6f,_e70){
- if(!this.m_chart){
- this.m_chart=new bux.reportViewer.chart();
- }
- var _e71=this.m_chart.getDisplayTypeDialogDefinition(_e6f);
- var _e72={"supportedChartTypes":_e71,"suggestedDisplayTypes":_e70};
- this.fireEvent("com.ibm.bux.widget.invokeDisplayTypeDialog",null,_e72);
- },onChangeDisplayType:function(evt){
- var _e74=this.getViewerObject();
- if(evt&&_e74){
- _e74.executeAction("ChangeDisplayType",evt.payload);
- }
- },onDisplayTypeDialogVariations:function(evt){
- var _e76=this.getViewerObject();
- if(evt&&_e76){
- _e76.executeAction("ChangeDisplayVariations",evt.payload);
- }
- },updateDisplayTypeDialogVariations:function(_e77,_e78){
- if(!this.m_chart){
- this.m_chart=new bux.reportViewer.chart();
- }
- var _e79=this.m_chart.getDisplayTypeDialogDefinition(_e77);
- var _e7a={"supportedChartTypes":_e79,"variationGroups":_e78};
- this.fireEvent("com.ibm.bux.widget.updateDisplayTypeDialogVariations",null,_e7a);
- },onGetDisplayTitleDone:function(evt){
- if(evt&&evt.payload&&evt.payload.callback){
- evt.payload.callback(evt.payload.title);
- }
- },getWidgetStoreID:function(){
- if(typeof this.widgetStoreId==="undefined"){
- if(!this.widgetStoreIdDfd){
- this.widgetStoreIdDfd=new dojo.Deferred();
- }
- return this.widgetStoreIdDfd;
- }
- return this.widgetStoreId;
- },setWidgetStoreID:function(_e7c){
- this.widgetStoreId=_e7c;
- if(this.widgetStoreIdDfd){
- this.widgetStoreIdDfd.callback(this.widgetStoreId);
- this.widgetStoreIdDfd=null;
- }
- },onUpdateWidgetStoreIDDone:function(evt){
- var _e7e=evt.payload.storeID;
- var _e7f="storeID(\"";
- if(_e7e&&(_e7e.indexOf(_e7f)>-1)){
- _e7e=_e7e.substr(_e7f.length,_e7e.length-_e7f.length-1);
- }
- dojo.when(this.getWidgetStoreID(),dojo.hitch(this,function(_e80){
- if(_e80&&_e80!=_e7e){
- this._copyComments(_e80,_e7e);
- }
- }));
- this.setWidgetStoreID(_e7e);
- },_copyComments:function(_e81,_e82){
- var _e83=this.buildPostUrl();
- if(_e83){
- var _e84=new XmlHttpObject();
- _e84.addFormField("b_action","cognosViewer");
- _e84.addFormField("widgetOldStoreID",_e81);
- _e84.addFormField("widgetStoreID",_e82);
- _e84.addFormField("ui.action","cloneAnnotations");
- _e84.addFormField("cv.responseFormat","json");
- _e84.sendHtmlRequest("POST",_e83,"",true);
- }
- },onRemoveDone:function(evt){
- this.destroy();
- },onGetProperties:function(evt){
- this.initializeProperties();
- this.fireEvent("com.ibm.bux.widget.properties.get.done",null,this.properties.onGet());
- },onSetProperties:function(evt){
- if(evt&&evt.payload&&evt.payload.properties){
- this.properties.onSet(evt.payload);
- }
- this.fireEvent("com.ibm.bux.widget.properties.set.done");
- var _e88={"modified":true};
- this.fireEvent("com.ibm.bux.widget.modified",null,_e88);
- },getProperties:function(){
- return this.properties;
- },clearPropertiesDialog:function(){
- if(this.properties){
- this.properties.clearDialogSpec();
- }
- },onGenericSelectValueControl:function(evt,_e8a){
- if(evt){
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _e8b=false;
- var _e8c=this._getFilterPayload(evt);
- var _e8d=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValueControlTypeFromPayload(_e8c):null;
- if(_e8d&&_e8d!=="facet"){
- var _e8e=dojo.clone(evt);
- this.preProcessFilterValues(_e8e);
- this.m_oWidgetContextManager.updateFilterContext(_e8e.payload);
- _e8b=this.onFilter(_e8e,_e8a);
- }else{
- this.m_oWidgetContextManager.updateFilterContext(_e8c);
- _e8b=this.onFilter(evt,_e8a);
- }
- return _e8b;
- }),evt.source);
- }
- },onFilter:function(evt,_e90){
- if(evt){
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _e91=false;
- if(this.isLiveReport()===false){
- return _e91;
- }
- var _e92=this._getFilterPayload(evt);
- var _e93=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValueControlTypeFromPayload(_e92):null;
- var _e94=null;
- var _e95=this.m_oWidgetContextManager.getItemNames(_e92);
- var _e96=false;
- for(var i=0;!_e96&&i<_e95.length;i++){
- _e94=_e95[i];
- _e96=this.canFilter(_e92,_e94,_e93,evt);
- }
- if(_e94==null&&!_e96){
- _e96=this.canFilter(_e92,_e94,_e93,evt);
- }
- if(_e96){
- var _e98={};
- var _e99=this._getDrillResetHUNForFacet(_e94,_e93);
- if(_e99&&_e99.length>0){
- _e98.drillResetHUN=_e99;
- }
- var _e9a=(evt.type=="string")?evt.payload:dojo.toJson(evt.payload);
- this.sliderState[evt.source]=_e9a;
- _e98.filterPayload=_e9a;
- _e98.isFacet=("facet"===_e93);
- if(_e90){
- _e98.forceCleanup=this.m_oWidgetContextManager.genRemoveDiscreteFilterPayload(this.getWidgetId());
- }
- this.getViewerObject().executeAction("UpdateDataFilter",_e98);
- if(!this.shouldReportBeRunOnAction()){
- this.getLoadManager().getDelayedLoadingContext().setForceRunReport(true);
- }
- _e91=true;
- }
- return _e91;
- }),evt.source);
- }
- },clearSelectionFilter:function(){
- if(this.m_oWidgetContextManager){
- var _e9b=this.m_oWidgetContextManager.genEmptySelectionPayload(this.getViewerObject(),this.getWidgetId());
- this._fireContextChangedEvent(_e9b,false);
- }
- },broadcastSelectionFilter:function(){
- this.onSelectionChange();
- },onSelectionChange:function(){
- if(this.isSelectionFilterEnabled()){
- var _e9c=(this.getContainerTypeForSelection()==="list");
- var _e9d=this.m_oWidgetContextManager.genSelectionPayload(this.getViewerObject(),this.getWidgetId(),_e9c);
- this._fireContextChangedEvent(_e9d,!this.m_oWidgetContextManager.isSelectionPayloadForReset(_e9d));
- }
- },_fireContextChangedEvent:function(_e9e,_e9f){
- this.setSelectionFilterSent(_e9f);
- this.fireEvent("com.ibm.widget.contextChanged",null,_e9e);
- },somethingSelected:function(){
- var oCV=this.getViewerObject();
- return (oCV&&oCV.getSelectionController()&&oCV.getSelectionController().getAllSelectedObjects().length>0);
- },selectionFilterSent:function(){
- return this.m_bSelectionFilterSent;
- },setSelectionFilterSent:function(flag){
- this.m_bSelectionFilterSent=flag;
- },reselectSelectionFilterObjects:function(){
- if(this.isSelectionFilterEnabled()){
- var oCV=this.getViewerObject();
- var _ea3=oCV.getSelectionController();
- var _ea4=this.m_oWidgetContextManager.getSelectionFilterObjects();
- if(!_ea4){
- var str=this.getAttributeValue("selectionObjects");
- if(str&&str.length>0){
- _ea4=eval(str);
- this.m_oWidgetContextManager.setSelectionFilterObjects(_ea4);
- this.removeAttributeValue("selectionObjects");
- }
- }
- if(_ea4&&_ea4.length>0){
- var _ea6=new ReselectAction(oCV,_ea4);
- _ea6.executeAction();
- }
- }
- },_getFilterPayload:function(evt){
- return (evt.type=="string"?dojo.fromJson(evt.payload):evt.payload);
- },_getFilterPayloadItemName:function(_ea8){
- var _ea9=_ea8.name;
- if(!_ea8.name){
- _ea9=this.m_oWidgetContextManager.getFilterFirstItemName();
- }
- return _ea9;
- },canFilter:function(_eaa,_eab,_eac,evt){
- var _eae;
- var _eaf=this.getRAPCachedItem("filterableItems");
- if(_eac!=="facet"&&typeof _eab!="undefined"&&_eab!=null&&_eaf!=null){
- for(var type in _eaf){
- for(_eae=0;_eae<_eaf[type].length;++_eae){
- if(_eaf[type][_eae].name==_eab||_eaf[type][_eae].label==_eab){
- return true;
- }
- }
- }
- }else{
- var _eb1=this.getViewerObject();
- var _eb2=_eb1.getRAPReportInfo();
- if(_eb2){
- var _eb3=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValuePropertyFromPayload(_eaa,"dimension"):null;
- var _eb4=_eb2.getContainers();
- for(var lid in _eb4){
- var _eb6=_eb4[lid];
- var _eb7=_eb6.sliders;
- if(_eb7&&_eb7.length){
- for(var _eb8=0;_eb8<_eb7.length;++_eb8){
- var _eb9=_eb7[_eb8];
- if(_eb9.clientId==_eaa.clientId||(_eb9.clientId==evt.source)||(_eb9.clientId==_eb9.name&&_eb9.name==_eab)){
- return true;
- }
- }
- }
- var _eba=_eb6.itemInfo;
- if(_eba&&_eba.length){
- for(var _ebb=0;_ebb<_eba.length;++_ebb){
- if(_eba[_ebb].item==_eab){
- return true;
- }
- if(_eac==="facet"&&_eba[_ebb].dimensionName==_eab){
- return true;
- }
- if(_eac==="facet"&&_eba[_ebb].dimensionName===_eb3){
- return true;
- }
- }
- }
- if(_eac==="facet"){
- var _ebc=(this.m_oWidgetContextManager)?this.m_oWidgetContextManager.getSelectValuePropertyFromPayload(_eaa,"filterType"):null;
- if(_eac==="facet"&&_ebc==="attribute"){
- return true;
- }
- var _ebd=_eb6.filter;
- if(_ebd&&_ebd.length){
- for(var _ebe=0;_ebe<_ebd.length;++_ebe){
- if(_ebd[_ebe].hierarchyName===_eab){
- return true;
- }
- }
- }
- }else{
- if(_eb2.getFilterObjectFromContainer(lid,_eab,false)){
- return true;
- }
- }
- }
- if(_eb2.isReportLevel_nonVisibleFilterItem(_eab)){
- return true;
- }
- }
- }
- return false;
- },_getDrillResetHUNForFacet:function(_ebf,_ec0){
- if(_ec0!=="facet"){
- return null;
- }
- var _ec1=null;
- var _ec2=this.getViewerObject();
- if(_ec2.getRAPReportInfo()){
- _ec1=_ec2.getRAPReportInfo().getDrilledOnHUNs();
- }
- if(!_ec1){
- return null;
- }
- var _ec3=[];
- for(var i=0;i<_ec1.length;i++){
- if(_ec1[i].indexOf(_ebf)!==-1){
- _ec3.push(_ec1[i]);
- break;
- }
- }
- return _ec3;
- },preProcessFilterValues:function(evt){
- var _ec6=evt.payload["com.ibm.widget.context"]["values"];
- _ec6=(_ec6)?_ec6:evt.payload["com.ibm.widget.context"]["ranges"];
- var _ec7=this.m_oWidgetContextManager.getItemsInItemSpecification(evt.payload);
- var _ec8=(_ec6)?false:true;
- if(_ec8){
- _ec6=evt.payload["com.ibm.widget.context"];
- }
- var _ec9=this.getViewerObject();
- if(_ec9){
- var _eca=_ec9.getRAPReportInfo();
- for(var _ecb in _ec6){
- if(!_eca.isReferenced(_ecb)||_ec8){
- delete _ec6[_ecb];
- if(_ec7&&_ec7[_ecb]){
- delete _ec7[_ecb];
- }
- }
- }
- }
- if(isObjectEmpty(_ec6)){
- evt.payload["com.ibm.widget.context"]={};
- }
- },isLimitedInteractiveMode:function(){
- var _ecc=this.getViewerObject();
- if(_ecc){
- return _ecc.isLimitedInteractiveMode();
- }
- return false;
- },onMouseOver:function(evt){
- if(DragDropAction_isDragging(evt)==false&&this.getViewerObject().getStatus()=="complete"){
- var _ece=ActionFactory_loadActionHandler(evt,this.getViewerObject());
- if(_ece){
- return _ece.onMouseOver(evt);
- }
- }
- return true;
- },onMouseOut:function(evt){
- var _ed0=ActionFactory_loadActionHandler(evt,this.getViewerObject());
- if(_ed0&&this.getViewerObject().getStatus()=="complete"){
- return _ed0.onMouseOut(evt);
- }
- return true;
- },onMouseOverRenamedItem:function(evt){
- var node=getNodeFromEvent(evt);
- if(node.getAttribute){
- var _ed3=node.getAttribute("rp_name");
- if(_ed3!=null){
- var _ed4=this.getViewerObject().getSelectionController().getTextValue(node.childNodes);
- if(_ed3!=_ed4){
- var id=node.getAttribute("id");
- 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")});
- node.m_tooltip.open();
- }
- }
- }
- },onMouseOutRenamedItem:function(evt){
- var node=getNodeFromEvent(evt);
- node.m_tooltip=null;
- },onDoubleClick:function(evt){
- var _ed9=ActionFactory_loadActionHandler(evt,this.getViewerObject());
- if(_ed9&&this.getViewerObject().getStatus()=="complete"){
- return _ed9.onDoubleClick(evt);
- }
- return true;
- },onMouseDown:function(evt){
- var oCV=this.getViewerObject();
- var _edc=oCV.getActionFactory();
- this._selectionAction=_edc.load("Selection");
- if(this.isMobile()){
- var _edd=oCV.getSelectionController();
- var _ede=_edd.pageClickedForMobile(evt);
- if(this.isSelectionFilterEnabled()){
- this.onSelectionChange();
- }else{
- if(_ede){
- this.onContextMenu(evt);
- }
- }
- }else{
- if(oCV.envParams["ui.action"]=="view"){
- this._selectionAction.onMouseDown(evt);
- }else{
- if(oCV.getStatus()=="complete"){
- if((evt.button==1||evt.button==0)){
- if(!this._selectionAction.onMouseDown(evt)&&!_edc.load("RenameDataItem").onMouseDown(evt)){
- this.initDragAndDrop();
- _edc.load("DragDrop").onMouseDown(evt);
- }
- }else{
- this._selectionAction.onMouseDown(evt);
- }
- }
- }
- }
- },onMouseUp:function(evt){
- if(this.isMobile()){
- return;
- }
- var _ee0=getCrossBrowserNode(evt);
- try{
- var _ee1=_ee0.nodeName.toLowerCase();
- if(_ee1=="input"||_ee1=="textarea"){
- evt.cancelBubble=true;
- return false;
- }
- }
- catch(ex){
- }
- var _ee2=false;
- if(this.getViewerObject().envParams["ui.action"]=="view"){
- setNodeFocus(evt);
- }else{
- if(this.getViewerObject().getStatus()=="complete"){
- _ee2|=DragDropAction_isDragging(evt);
- DragDropAction_onmouseup(evt);
- this.removeDragAndDrop();
- setNodeFocus(evt);
- }
- }
- if(!this._selectionAction){
- var oCV=this.getViewerObject();
- var _ee4=oCV.getActionFactory();
- this._selectionAction=_ee4.load("Selection");
- }
- this._selectionAction.onMouseUp(evt,_ee2);
- clearTextSelection();
- },getContainerTypeForSelection:function(){
- var _ee5=this.getViewerObject();
- if(_ee5){
- var _ee6=_ee5.getSelectionController();
- return _ee6.getDataContainerType();
- }
- return null;
- },onContextMenu:function(evt){
- var _ee8=this.getViewerObject();
- if(_ee8.getStatus()=="complete"||this.isSavedOutput()){
- var _ee9=_ee8.getContextMenu();
- var _eea=CCognosViewerToolbarHelper.updateContextMenuForCurrentSelection(_ee8,_ee9);
- if(this.isMobile()){
- var _eeb=_ee8.getSelectionController();
- var _eec=_eeb.getContainerType();
- var _eed=_eec==="chart"?_eeb.getChartTooltip():null;
- if(this.getAnnotationStore()&&this.getAnnotationStore().hasAnnotation()){
- var _eee=this._genMobileCommentMenuItem(_eeb);
- if(_eee){
- _eea.push(_eee);
- }
- var _eef=this._genMobileCommentMenuItem();
- if(_eef){
- var _ef0=_ee8.findBlueDotMenu(_eea);
- if(_ef0){
- _ef0.push(_eef);
- }
- }
- }
- var _ef1={"context":{"event":evt,"viewerContext":{"displayValues":_eeb.getDisplayValues(),"chartTooltip":_eed,"containerType":_eec}},"menuItems":_eea};
- if(typeof console!="undefined"&&console&&console.log){
- console.log(_ef1);
- }
- this.fireEvent("com.ibm.bux.widget.contextMenu.update",null,_ef1);
- }else{
- this.fireEvent("com.ibm.bux.widget.contextMenu.update",null,_eea);
- }
- }
- },_genMobileCommentMenuItem:function(_ef2){
- var ctx=null;
- if(_ef2){
- if(_ef2.getSelections().length==1){
- ctx=_ef2.getSelections()[0].getCtxAttributeString();
- }
- if(!ctx){
- return null;
- }
- }
- var _ef4=this.getAnnotationStore().getAsJSON(ctx);
- if(_ef4.length>0){
- return {"name":RV_RES.IDS_JS_ANNOTATIONS,"label":RV_RES.IDS_JS_ANNOTATIONS,"flatten":false,"comments":_ef4};
- }
- return null;
- },initDragAndDrop:function(){
- if(window.attachEvent){
- document.attachEvent("onmouseup",DragDropAction_onmouseup);
- document.attachEvent("onmousemove",DragDropAction_onmousemove);
- }else{
- if(document.addEventListener){
- document.addEventListener("mouseup",DragDropAction_onmouseup,false);
- document.addEventListener("mousemove",DragDropAction_onmousemove,false);
- }
- }
- },removeDragAndDrop:function(){
- if(window.detachEvent){
- document.detachEvent("onmouseup",DragDropAction_onmouseup);
- document.detachEvent("onmousemove",DragDropAction_onmousemove);
- }else{
- if(document.removeEventListener){
- document.removeEventListener("mouseup",DragDropAction_onmouseup,false);
- document.removeEventListener("mousemove",DragDropAction_onmousemove,false);
- }
- }
- },onWidgetResize:function(evt){
- var _ef6=evt.payload.resize;
- if(_ef6){
- if(!this.m_visible||(this.widgetSize&&this.widgetSize.h===_ef6.h&&this.widgetSize.w===_ef6.w)){
- return;
- }
- var _ef7=!this.widgetSize;
- this.widgetSize={h:_ef6.h,w:_ef6.w};
- if(_ef7){
- return;
- }
- if(!_ef6.autoResize){
- this.executeAction(evt,"ResizeChart");
- }
- var oCV=this.getViewerObject();
- if(oCV&&oCV.getPinFreezeManager()){
- if(_ef6.autoResize){
- oCV.getPinFreezeManager().processAutoResize(_ef6.w,_ef6.h);
- }
- setTimeout(function(){
- oCV.getPinFreezeManager().refresh();
- },100);
- }
- if(oCV.getTabController()){
- oCV.getTabController().onResize(evt);
- }
- }
- },getWidgetSize:function(){
- return this.widgetSize;
- },refreshAnnotationData:function(){
- return this.getAnnotationHelper().refreshAnnotationData();
- },fetchAnnotationData:function(){
- this.getAnnotationHelper().fetchAnnotationData();
- },reportContainsDijits:function(){
- var _ef9=this.getAnnotationStore();
- var _efa=_ef9.getAll();
- for(var key in _efa){
- if(typeof _efa[key]!=="function"){
- return true;
- }
- }
- return false;
- },isSaveNecessary:function(){
- var _efc=false;
- if(this.isSavedOutput()){
- var _efd=this.getAttributeValue("mostRecentSavedOutput");
- var _efe=_efd==="true"||_efd===true;
- var _eff=this.getAttributeValue("savedOutputSearchPath");
- _efc=!_efe&&_eff==null;
- }else{
- var _f00=this.getAttributeValue("originalReport");
- var _f01=this.getAttributeValue("savedReportName")||this.getAttributeValue("savedReportPath");
- if(!this.isSavedReport(_f00,_f01)){
- _efc=true;
- }
- }
- return _efc;
- },addAsNewComment:function(_f02,text){
- this.getAnnotationHelper().addAsNewComment(_f02,text);
- },onWidgetActionDone:function(_f04){
- if(_f04&&_f04.payload&&_f04.payload.status===true){
- this.getAnnotationHelper().addNewComment(this._pendingContextId,this._pendingCellValue);
- }
- this._pendingContextId=null;
- this._pendingCellValue=null;
- },commitComment:function(_f05){
- if(!_f05.isNew){
- return null;
- }
- if(!_f05.isLoaded){
- return this.getAnnotationHelper().commitComment(_f05);
- }
- return null;
- },getAnnotationStore:function(){
- if(!this.annotationStore){
- dojo["require"]("bux.data.AnnotationStore");
- this.annotationStore=new bux.data.AnnotationStore(this,this.commitComment,this);
- }
- return this.annotationStore;
- },fireEvent:function(_f06,arg,_f08){
- if(window.gViewerLogger){
- var id=this.getViewerObject()?this.getViewerObject().getId()+" ":"";
- window.gViewerLogger.log(id+_f06,_f08,"json");
- }
- this.iContext.iEvents.fireEvent(_f06,arg,_f08);
- },onGetFilterableItems:function(evt){
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _f0b=false;
- var _f0c=this.getRAPCachedItem("filterableItems");
- if(_f0c==null&&this.isLiveReport()&&(this.getViewerObject().getStatus()=="complete"||this.isFaultStatusWithSpec())){
- this.executeAction(evt,"GetFilterableItems");
- _f0b=true;
- }else{
- if(!_f0c){
- _f0c={visible:[],hidden:[]};
- }
- if(this.isLiveReport()){
- this.fireEvent("com.ibm.bux.filter.items.get.done",null,_f0c);
- }else{
- this.savedOutputResponseHandler("com.ibm.bux.filter.items.get.done",_f0c);
- }
- }
- return _f0b;
- }));
- },isFaultStatusWithSpec:function(){
- var oVO=this.getViewerObject();
- if(oVO.getStatus()==="fault"){
- if(oVO.envParams["ui.spec"]){
- return true;
- }
- }
- return false;
- },onGetFilterValues:function(oEvt){
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _f0f=oEvt.payload;
- if(typeof oEvt.source!="undefined"&&typeof _f0f!="undefined"){
- if(typeof _f0f.payload!="undefined"){
- _f0f=_f0f.payload;
- }
- if(typeof _f0f.source=="undefined"){
- _f0f.source=oEvt.source;
- }
- }
- var _f10=false;
- var _f11=this.isLiveReport();
- var _f12=this.getViewerObject().getStatus();
- var _f13=this.isFaultStatusWithSpec();
- if(_f11&&(_f12==="complete"||_f13)){
- var _f14=null;
- if(!_f0f.forceRefresh&&_f0f.name){
- _f14=this.getRAPCachedItem("filterValues."+_f0f.name);
- }
- if(_f14){
- this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f14);
- }else{
- this.executeAction(oEvt,"GetFilterValues");
- _f10=true;
- }
- }else{
- if(this.getViewerObject().isWorking(_f12)){
- var self=this;
- var _f16=function(){
- self.onGetFilterValues(oEvt);
- };
- setTimeout(_f16,10);
- }else{
- var _f17={};
- if(_f0f.name){
- _f17.name=_f0f.name;
- }
- this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f17);
- }
- }
- return _f10;
- }));
- },onGetFilterValuesCancel:function(evt){
- if(evt&&evt.payload){
- var oCV=this.getViewerObject();
- var _f1a=oCV.getAction("GetFilterValues");
- _f1a.setRequestParms(evt);
- var _f1b=_f1a.getActionKey();
- if(_f1b){
- oCV.getViewerDispatcher().cancelRequest(_f1b);
- }
- }
- },savedOutputResponseHandler:function(_f1c,_f1d){
- var oCV=this.getViewerObject();
- var _f1f=dojo.toJson(_f1d);
- var _f20="window[\"oCV"+oCV.getId()+"\"].getViewerWidget().fireEvent(\""+_f1c+"\", null, "+_f1f+");";
- if(oCV){
- var _f21=window["oCV"+oCV.getId()];
- if(typeof _f21=="object"){
- setTimeout(_f20,1);
- }
- }
- return _f20;
- },handleGetFilterableItemsResponse:function(_f22){
- var _f23={};
- var json=this.getJsonFromResponse(_f22);
- if(json){
- _f23=json.filterableItems;
- if(!_f23){
- _f23={"visible":[],"invisible":[]};
- }
- this.addToRAPCache("filterableItems",_f23);
- }
- this.fireEvent("com.ibm.bux.filter.items.get.done",null,_f23);
- },handleGetFilterValuesResponse:function(_f25,_f26){
- var _f27={};
- var json=this.getJsonFromResponse(_f25);
- if(json&&json.filterValues){
- _f27=json.filterValues;
- if(_f27&&_f27.name){
- this.addToRAPCache("filterValues."+_f27.name,_f27);
- }
- }
- if(_f26&&_f26.name&&!_f27.name){
- _f27.name=_f26.name;
- }
- _f27=dojo.clone(_f27);
- this.fireEvent("com.ibm.bux.filter.values.get.done",null,_f27);
- },getJsonFromResponse:function(_f29){
- var json=null;
- if(_f29&&_f29.m_jsonResponse&&_f29.m_jsonResponse.json){
- json=dojo.eval("("+_f29.m_jsonResponse.json+")");
- }else{
- if(_f29&&_f29.responseText){
- json=dojo.eval("["+_f29.responseText+"]");
- if(json&&json[0]){
- json=json[0];
- }
- }
- }
- return json;
- },onContextChanged:function(evt){
- if(evt){
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _f2c=false;
- var _f2d=dojo.clone(evt);
- var _f2e=this._getFilterPayload(_f2d);
- this.m_oWidgetContextManager.convertSelectionToSelectValueControlPayload(_f2e);
- this.m_oWidgetContextManager.convertGenericToSelectValueControlPayload(_f2e);
- var _f2f=this.getViewerObject();
- var _f30=_f2f.getRAPReportInfo();
- if(_f30&&(_f30.containsFilters()||_f30.hasSlider())){
- var _f31=_f2e["com.ibm.widget.context"].values;
- var _f32=this.m_oWidgetContextManager.getItemsInItemSpecification(_f2e);
- var _f33=dojo.clone(_f32);
- for(var _f34 in _f33){
- if(!_f30.isReferenced(_f34)&&_f32[_f34].values){
- var mun=_f32[_f34].values[0].mun;
- var _f36=_f30.hunHasFilterOrSlider(mun);
- if(_f36&&!_f32[_f36]){
- _f32[_f36]=_f32[_f34];
- delete _f32[_f34];
- _f31[_f36]=_f31[_f34];
- delete _f31[_f34];
- }
- }
- }
- }
- _f2d.payload=_f2e;
- _f2c=this.onGenericSelectValueControl(_f2d,true);
- return _f2c;
- }),evt.source);
- }
- },broadcastParameterChange:function(_f37){
- var _f38={"clientId":this.getWidgetId(),"com.ibm.widget.context":_f37};
- this.fireEvent("com.ibm.widget.contextChanged.prompt",null,_f38);
- },broadcastContextChange:function(_f39){
- if(this.isSelectionFilterEnabled()){
- var _f3a={"clientId":this.getWidgetId(),"com.ibm.widget.context":_f39,"com.ibm.widget.context.bux.selection":{"selection":{"id":this.getWidgetId(),"valueType":"string"}}};
- this.m_oWidgetContextManager.updateFilterContext(_f3a);
- this.m_oWidgetContextManager.setSelectionFilterObjects(null);
- this._fireContextChangedEvent(_f3a,true);
- }
- },onGenericDrill:function(evt){
- this.m_handleDrill=false;
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(){
- var _f3c=false;
- if(!(evt&&evt.payload)||this.isLimitedInteractiveMode()){
- return _f3c;
- }
- if(evt.payload.cv_id===this.iContext.widgetId){
- return _f3c;
- }
- var _f3d=this.m_oWidgetContextManager.getDrillActionType(evt.payload);
- var _f3e=this.m_oWidgetContextManager.genDrillSpecObjects(evt.payload);
- var _f3f=null;
- if(_f3d==="DrillDown"){
- _f3f=this.getViewerObject().getAction("DrillDown");
- }else{
- if(_f3d==="DrillUp"){
- _f3f=this.getViewerObject().getAction("DrillUp");
- }else{
- return _f3c;
- }
- }
- _f3f.setKeepFocusOnWidget(false);
- if(this.getViewerObject().isMetadataEmpty()||!this.shouldReportBeRunOnAction()){
- _f3f.setUseReportInfoSelection(true);
- }
- if(_f3f.parseDrillSpecObjects(_f3e)){
- if(!this.shouldReportBeRunOnAction()){
- this.getLoadManager().getDelayedLoadingContext().setForceRunReport(true);
- }
- _f3f.execute();
- _f3c=true;
- }
- this.m_handleDrill=true;
- return _f3c;
- }));
- },setDoGetParametersOnLoad:function(_f40){
- this.m_doGetParametersOnLoad=_f40;
- },getDoGetParametersOnLoad:function(){
- return this.m_doGetParametersOnLoad;
- },onPromptLegacyPayload:function(evt){
- try{
- if(evt.payload.cv_id===this.iContext.widgetId){
- return false;
- }
- var _f42=null;
- this.getLoadManager().runWhenHasViewer(dojo.hitch(this,function(_f43){
- _f42=false;
- if(this.isSavedOutput()){
- return _f42;
- }
- if(this.promptParametersRetrieved===false){
- var _f44=this.getViewerObject().getAction("GetParameters");
- _f44.setRequestParms(evt.payload);
- _f44.execute();
- _f42=true;
- }else{
- _f42=this.sharePrompts(evt.payload);
- }
- return _f42;
- }));
- return _f42;
- }
- catch(e){
- return false;
- }
- },sharePrompts:function(_f45){
- var _f46=this.getViewerObject().getAction("SharePrompt");
- _f46.setRequestParms(_f45);
- if(this.shouldReportBeRunOnAction()){
- var _f47=this.getViewerObject().getDrillResetHUNs(_f45);
- if(!_f47||_f47.length===0){
- return _f46.executePrompt();
- }else{
- var _f48={"drilledResetHUNs":_f47,"promptValues":_f46.getPromptValues()};
- this.getViewerObject().executeAction("DrillReset",_f48);
- }
- return true;
- }
- var _f49=this.getLoadManager().getDelayedLoadingContext();
- _f49.setPromptValues(_f46.getPromptValues());
- _f49.setCascadingPromptParamsToClear(_f45.clearCascadePromptParams);
- return false;
- },onGenericPrompt:function(evt){
- this.clearRAPCacheFilterValues();
- this.m_oWidgetContextManager.handleIncomingPromptEvent(evt);
- },setPromptParametersRetrieved:function(_f4b){
- this.promptParametersRetrieved=_f4b;
- },getEnvParam:function(_f4c){
- return this.getViewerObject().envParams[_f4c];
- },destroy:function(){
- var _f4d=this.getViewerObject();
- if(_f4d){
- if(this.isSelectionFilterEnabled()){
- if(this.selectionFilterSent()){
- this.clearSelectionFilter();
- }
- }
- if(this.onUnloadInProgress){
- _f4d.destroy(false);
- }else{
- _f4d.destroy(true);
- }
- var _f4e=function(_f4f){
- if(_f4f&&_f4f.parentNode&&_f4f.parentNode.removeChild){
- _f4f.parentNode.removeChild(_f4f);
- }
- };
- var _f50=dojo.query("[namespaceId='"+this.getViewerId()+"'],[namespaceId='"+this.m_sScriptLoaderNamespace+"']",document.getElementsByTagName("head").item(0));
- if(_f50&&_f50.length>0){
- _f50.forEach(_f4e);
- }
- _f50=dojo.query("> [namespaceId=\""+this.getViewerId()+"\"]",document.getElementsByTagName("body").item(0));
- if(typeof _f50!="undefined"&&_f50&&_f50.length>0){
- _f50.forEach(_f4e);
- }
- if(this.getAnnotationHelper()){
- this.getAnnotationHelper()._cleanupPreviousAnnotations();
- }
- }
- if(this.annotationHelper){
- this.annotationHelper.m_viewerIWidget=null;
- }
- this.annotationHelper=null;
- if(this.savedOutput){
- this.savedOutput.iWidget=null;
- }
- this.savedOutput=null;
- if(this.m_oLoadManager){
- this.m_oLoadManager.m_oWidget=null;
- }
- this.m_oLoadManager=null;
- if(this.m_oWidgetContextManager){
- this.m_oWidgetContextManager.m_widget=null;
- }
- this.m_oWidgetContextManager=null;
- this.removeWindowEventListeners();
- if(this.undoRedoQueue){
- GUtil.destroyProperties(this.undoRedoQueue);
- delete this.undoRedoQueue;
- }
- GUtil.destroyProperties(this.getAnnotationStore());
- delete this.getAnnotationStore();
- GUtil.destroyProperties(this.savedOutput);
- delete this.savedOutput;
- delete this.m_oCV;
- _f4d=null;
- },setSavedOutputsCMResponse:function(_f51){
- this.savedOutputsCMResponse=_f51;
- if(_f51==null){
- var _f52=this.getViewerObject().getActionFactory();
- var _f53=_f52.load("Snapshots");
- _f53.resetMenu();
- }
- },getSavedOutputsCMResponse:function(){
- if(typeof this.savedOutputsCMResponse=="undefined"||this.savedOutputsCMResponse==null){
- return null;
- }
- return this.savedOutputsCMResponse;
- },setSavedOutputSearchPath:function(_f54){
- this.m_savedOutputSearchPath=_f54;
- },getSavedOutputSearchPath:function(){
- if(typeof this.m_savedOutputSearchPath=="undefined"){
- return null;
- }
- return this.m_savedOutputSearchPath;
- },initializeProperties:function(){
- if(this.properties){
- var _f55=this.getViewerObject();
- this.properties.initialize(_f55.envParams);
- }
- },addToRAPCache:function(name,_f57){
- if(!this.m_RAPCache){
- this.m_RAPCache={};
- }
- this.m_RAPCache[name]=_f57;
- },getRAPCachedItem:function(name){
- if(this.m_RAPCache&&typeof this.m_RAPCache[name]!="undefined"){
- return this.m_RAPCache[name];
- }
- return null;
- },clearRAPCacheFilterValues:function(){
- for(var key in this.m_RAPCache){
- if(key.indexOf("filterValues.")===0){
- delete this.m_RAPCache[key];
- }
- }
- },clearRAPCache:function(){
- this.m_RAPCache=null;
- },reset:function(){
- this.m_bCallGetAnnotations=true;
- this.promptParametersRetrieved=false;
- this.getViewerObject().envParams["reportPrompts"]="";
- this.setSavedOutputsCMResponse(null);
- this.getUndoRedoQueue().clearQueue();
- if(this.isSelectionFilterEnabled){
- this.clearSelectionFilter();
- }
- this.m_bSelectionFilterSwitch=false;
- },handleFault:function(){
- if(typeof console!="undefined"&&console&&console.log){
- console.log("ViewrIWidget:handle fault is deprecated and should not be used anymore.");
- }
- var _f5a=this.getViewerObject();
- var _f5b=new RequestHandler(_f5a);
- _f5b.onFault();
- },disableListenToForGlobalPrompt:function(){
- this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,{"*":{blockedEvents:["com.ibm.widget.contextChanged.prompt"]}});
- var _f5c=this.getViewerObject();
- if(window.gaRV_INSTANCES){
- var _f5d={};
- _f5d[this.iContext.widgetId]={blockedEvents:["com.ibm.widget.contextChanged.prompt"]};
- for(var _f5e=0;_f5e<window.gaRV_INSTANCES.length;_f5e++){
- if(window.gaRV_INSTANCES[_f5e].getId()!=_f5c.getId()){
- var _f5f=window.gaRV_INSTANCES[_f5e].getViewerWidget();
- if(_f5f){
- _f5f.iContext.iEvents.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_f5d);
- }
- }
- }
- }
- },disableListenToForEvent:function(_f60){
- this.fireEvent("com.ibm.bux.widget.updateEventFilter",null,{"*":{blockedEvents:_f60}});
- var _f61=this.getViewerObject();
- if(window.gaRV_INSTANCES){
- var _f62={};
- _f62[this.iContext.widgetId]={blockedEvents:_f60};
- for(var _f63=0;_f63<window.gaRV_INSTANCES.length;_f63++){
- if(window.gaRV_INSTANCES[_f63].getId()!=_f61.getId()){
- var _f64=window.gaRV_INSTANCES[_f63].getViewerWidget();
- if(_f64){
- _f64.iContext.iEvents.fireEvent("com.ibm.bux.widget.updateEventFilter",null,_f62);
- }
- }
- }
- }
- },handlePassportErrorFromDispatcher:function(){
- if(this.viewerWidgetLastAction){
- var _f65=GUtil.generateCallback(this[this.viewerWidgetLastAction.functionName],this.viewerWidgetLastAction.param,this);
- dojo["require"]("bux.dialogs.IFrameDialog");
- var _f66=new bux.dialogs.LogonDialog({okHandler:_f65,cancelHandler:dojo.hitch(this,function(){
- this.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
- })});
- _f66.startup();
- _f66.show();
- }
- },showErrorMessage:function(_f67){
- var _f68=this.getViewerObject();
- if(_f68){
- this.m_widgetErrorDlg=new FaultMessageDialog(_f68,_f67);
- this.m_widgetErrorDlg.renderInlineDialog();
- }
- },getErrorDlg:function(){
- if(this.m_widgetErrorDlg){
- return this.m_widgetErrorDlg;
- }
- return null;
- },setErrorDlg:function(dlg){
- this.m_widgetErrorDlg=dlg;
- },clearErrorDlg:function(dlg){
- if(this.getErrorDlg()!==null){
- this.m_widgetErrorDlg.ok();
- }
- },onOpen:function(evt){
- if(evt&&evt.payload&&evt.payload.author){
- this.m_sDashboardOwnerId=evt.payload.author.cm$searchPath;
- }
- },onNotifyPreviousEventsAreDone:function(evt){
- this.m_resizeReady=true;
- },isDashboardOwner:function(){
- if(typeof this.m_sDashboardOwnerId!=="undefined"&&typeof this.m_sUserId!=="undefined"){
- return this.m_sDashboardOwnerId===this.m_sUserId;
- }
- },isCurrentUser:function(user){
- return this.m_sUserId===user;
- },findContainerDiv:function(){
- var _f6e=dojo.byId("RVContent"+this.getViewerObject().getId());
- var _f6f=_f6e;
- while(_f6f){
- if(_f6f.style&&_f6f.style.height&&_f6f.style.height.indexOf("px")!=-1){
- return _f6f;
- }
- _f6f=_f6f.parentNode;
- }
- if(typeof console!="undefined"&&console&&console.log){
- console.log("ViewrIWidget: Could not find the container div.");
- }
- return _f6e;
- },getPaneOnRight:function(){
- return this.getAttributeValue("paneOnRight");
- },getWidgetContextManager:function(){
- return this.m_oWidgetContextManager;
- },getInfoBarRenderedState:function(){
- return this.m_oInfoBarRenderedState;
- },refreshInfoBarRenderedState:function(_f70){
- var len=_f70.length;
- var _f72={};
- for(var idx=0;idx<len;idx++){
- var sId=_f70[idx];
- if(this.m_oInfoBarRenderedState[sId]){
- _f72[sId]=this.m_oInfoBarRenderedState[sId];
- }
- }
- this.m_oInfoBarRenderedState=_f72;
- },onGetWidgetContext:function(_f75){
- var _f76=this.getWidgetContextManager().getWidgetContextObject();
- if(!_f76){
- _f76={};
- }
- this.fireEvent("com.ibm.widget.context.get.done",null,_f76);
- },onGetCanvasContextDone:function(evt){
- },onSetVisible:function(evt){
- if(this.m_debugDelayedViewerLoadingMode===2){
- return;
- }
- if(evt&&evt.payload){
- this.m_visible=evt.payload.isVisible?true:false;
- if(!this.m_visible){
- if(this._cssLimitReached){
- this.cleanupStyles();
- }
- return;
- }
- if(!this.getLoadManager().isViewerLoadInitiated()){
- this.postReport(null);
- }else{
- this._updateOnVisible();
- }
- }
- },_updateOnVisible:function(){
- var _f79=this.getLoadManager();
- if(_f79.isViewerReady()){
- var oCV=this.getViewerObject();
- if(this._cssLimitReached){
- this.reloadStyles();
- }
- if(this.isSavedOutput()){
- _f79.getDelayedLoadingContext().setForceRunReport(false);
- return;
- }
- if(!_f79.getDelayedLoadingContext().isEmpty()){
- _f79.runWhenHasViewer(function(){
- _f79.runningReport();
- var _f7b=oCV.getActionFactory();
- var _f7c=_f7b.load("BuxRunReport");
- var _f7d=_f79.getDelayedLoadingContext();
- var _f7e={promptValues:_f7d.getPromptValues(),clearCascadeParamsList:_f7d.getCascadingPromptParamsToClear()};
- _f7c.setRequestParams(_f7e);
- if(!oCV.getConversation()){
- _f7c.setSendParameterValues(true);
- }
- var _f7f=_f7c.execute();
- _f79.getDelayedLoadingContext().reset();
- return _f7f;
- });
- }else{
- if(oCV.getPinFreezeManager()){
- oCV.getPinFreezeManager().onSetVisible();
- }
- }
- }else{
- _f79.setOnEmptyCallback(dojo.hitch(this,function(){
- if(this.isVisible()){
- this._updateOnVisible();
- }
- }));
- }
- },shouldReportBeRunOnAction:function(){
- return (this.isVisible()&&this.getLoadManager().isViewerLoaded()&&this.getLoadManager().canRunReports());
- },isVisible:function(){
- if(this.m_debugDelayedViewerLoadingMode===2){
- return true;
- }
- if(this.m_visible===null){
- var _f80=this.iContext.getItemSet("buxdelayedload",false);
- if(_f80){
- this.m_visible=(_f80.getItemValue("widgetVisible")==="true");
- }else{
- this.m_visible=true;
- }
- }
- return this.m_visible;
- },isPastedWidget:function(){
- return this._pastedWidget;
- },setWidgetCopyPasteParameters:function(){
- this.copyPasteResource=this.getAttributeValue("resource");
- if(this.copyPasteResource){
- this._pastedWidget=true;
- if(this.getAttributeValue("copy.ciPublishedReportPath")&&this.getAttributeValue("originalReport")==null&&this.getSavedItem()==null){
- this.ciPublishedReportPath=this.getAttributeValue("copy.ciPublishedReportPath");
- }else{
- if(this.getAttributeValue("originalReport")==null){
- this.ciPublishedReportPath=this.getSavedItem();
- this.setAttributeValue("copy.ciPublishedReportPath",this.ciPublishedReportPath);
- }
- }
- this.removeAttributeValue("savedReportPath");
- this.removeAttributeValue("savedReportPath.resource");
- this.removeAttributeValue("resource");
- }
- },postSetWidgetCopyPasteParameters:function(){
- if(this.copyPasteResource){
- this.removeAttributeValue("copy.conversation");
- this.copyPasteResource=null;
- }
- },isSelectionFilterEnabled:function(){
- return this.m_bSelectionFilterSwitch;
- },toggleSelectionFilterSwitch:function(){
- this.m_bSelectionFilterSwitch=!this.isSelectionFilterEnabled();
- var _f81=this.getViewerObject().getSelectionController();
- if(_f81){
- if(this.isSelectionFilterEnabled()){
- _f81.setSelectionStyles(_f81.FILTER_SELECTION_STYLE);
- _f81.repaintSelections();
- }else{
- _f81.resetAll();
- }
- }
- },preprocessPageClicked:function(_f82,evt){
- if(!this.isSelectionFilterEnabled()){
- return;
- }
- var _f84=this.getViewerObject().getSelectionController();
- _f84.setAllowHorizontalDataValueSelection(true);
- if(_f82){
- if(!_f84.hasSavedSelections()){
- _f84.saveSelections();
- }
- _f84.setSelectionStyles(_f84.FILTER_SELECTION_CONTEXT_MENU_STYLE);
- }else{
- _f84.setSelectionStyles(_f84.FILTER_SELECTION_STYLE);
- _f84.clearSavedSelections();
- }
- },ignoreEvent:function(evt){
- stopEventBubble(evt);
- },updateDrillThroughLinks:function(){
- var oCV=this.getViewerObject();
- if(!oCV){
- return;
- }
- var _f87=this.isSelectionFilterEnabled();
- var _f88=oCV.envParams["ui.action"]=="view"||oCV.envParams["ui.action"]=="buxView";
- var _f89=_f87?"":"_temp";
- var _f8a=_f87?"_temp":"";
- var _f8b=["onclick","onkeypress","style"];
- var _f8c=_f88?"onclick"+_f89:"dttargets";
- var _f8d=document.getElementById("RVContent"+oCV.getId());
- var _f8e=getElementsByAttribute(_f8d,"*",_f8c);
- if(!_f8e){
- return;
- }
- for(var i=0;i<_f8e.length;i++){
- var node=_f8e[i];
- if(node.nodeName.toLowerCase()!=="area"){
- if(_f88){
- var _f91=node.getAttribute("onclick"+_f89);
- if(!_f91||(_f91.indexOf("doSingleDrillThrough")==-1&&_f91.indexOf("doMultipleDrillThrough"))){
- continue;
- }
- for(var ii=0;ii<_f8b.length;ii++){
- var _f93=_f8b[ii];
- if(node.getAttribute(_f93+_f89)){
- this._renameAttribute(node,_f93+_f89,_f93+_f8a);
- }
- }
- }
- this._updateCellStyle(node,_f87);
- }
- }
- },_updateCellStyle:function(node,_f95){
- if(node.nodeType==3){
- return;
- }
- if(_f95&&node.className==="hy"){
- this._renameAttribute(node,"class","class_temp");
- }else{
- if(!_f95&&node.getAttribute("class_temp")){
- this._renameAttribute(node,"class_temp","class");
- }
- }
- if(node.childNodes){
- for(i=0;i<node.childNodes.length;i++){
- this._updateCellStyle(node.childNodes[i],_f95);
- }
- }
- },_renameAttribute:function(node,_f97,_f98){
- node.setAttribute(_f98,node.getAttribute(_f97));
- node.removeAttribute(_f97);
- },addButtonToSavedToolbarButtons:function(name,_f9a,_f9b){
- if(typeof name!="undefined"&&name!=null){
- this.savedToolbarButtons[name]={};
- this.savedToolbarButtons[name]["button"]=_f9a;
- this.savedToolbarButtons[name]["position"]=_f9b;
- }
- },getButtonFromSavedToolbarButtons:function(name){
- return this.savedToolbarButtons[name];
- },removeFromSavedToolbarButtons:function(name){
- if(typeof this.savedToolbarButtons[name]!="undefined"&&this.savedToolbarButtons[name]!=null){
- delete this.savedToolbarButtons[name];
- }
- }});
- function UndoRedoQueue(_f9e){
- this.m_queue=[];
- this.m_queueLimit=20;
- this.m_iCurrentPos=0;
- this.m_widget=_f9e;
- this.m_bUndoRedoCalled=false;
- this.m_lastAction=null;
- this.currentUndoObj=null;
- this.beenUsed=false;
- this.m_originalSpec=null;
- };
- UndoRedoQueue.prototype.setOriginalSpec=function(spec){
- if(this.m_queue.length==0){
- this.m_originalSpec=spec;
- }
- };
- UndoRedoQueue.prototype.clearQueue=function(){
- while(this.m_queue.length>0){
- this.m_queue.pop();
- }
- this.m_iCurrentPos=0;
- };
- UndoRedoQueue.prototype.getPosition=function(){
- return this.m_iCurrentPos;
- };
- UndoRedoQueue.prototype.hasBeenUsed=function(){
- return this.beenUsed;
- };
- UndoRedoQueue.prototype.getLength=function(){
- return this.m_queue.length;
- };
- UndoRedoQueue.prototype.initUndoObj=function(obj){
- if(this.m_queue.length==0){
- var oCV=this.m_widget.getViewerObject();
- var spec=this.m_originalSpec==null?oCV.envParams["ui.spec"]:this.m_originalSpec;
- this.m_originalSpec=null;
- 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"});
- this.m_iCurrentPos=this.m_queue.length-1;
- this.beenUsed=true;
- }
- this.currentUndoObj=obj;
- };
- UndoRedoQueue.prototype.add=function(obj){
- if(this.m_bUndoRedoCalled){
- this.m_bUndoRedoCalled=false;
- return;
- }else{
- if(this.currentUndoObj==null){
- return;
- }else{
- if(obj.reportUpdated==true){
- while(this.m_queue.length>this.m_queueLimit){
- this.m_queue.shift();
- }
- this.clearEnd();
- var _fa4=this.m_widget.getViewerObject();
- if(this.currentUndoObj.saveSpec==true||_fa4.envParams["ui.doNotUseConversationForUndo"]==="true"){
- this.currentUndoObj.spec=_fa4.envParams["ui.spec"];
- this.currentUndoObj.parameters=_fa4.getExecutionParameters();
- }else{
- this.currentUndoObj.conversation=_fa4.getConversation();
- }
- if(_fa4.envParams["rapReportInfo"]){
- this.currentUndoObj.infoBar=_fa4.envParams["rapReportInfo"];
- }
- this.currentUndoObj.widgetProperties=this.m_widget.getProperties().getUndoInfo();
- this.currentUndoObj.palette=_fa4.m_sPalette;
- if(this.m_widget.getProperties().getFlashCharts()){
- this.currentUndoObj.hasAVSChart=_fa4.hasAVSChart();
- }
- this.currentUndoObj.undoType="server";
- this.finalizeAdd();
- }
- }
- }
- };
- UndoRedoQueue.prototype.addClientSideUndo=function(obj){
- if(this.m_bUndoRedoCalled){
- this.m_bUndoRedoCalled=false;
- return;
- }
- if(obj.undoCallback&&obj.redoCallback){
- this.initUndoObj(obj);
- this.currentUndoObj.undoType="client";
- this.finalizeAdd();
- }
- };
- UndoRedoQueue.prototype.finalizeAdd=function(){
- this.m_queue.push(this.currentUndoObj);
- this.m_iCurrentPos=this.m_queue.length-1;
- this.m_bUndoRedoCalled=false;
- this.m_lastAction="";
- this.currentUndoObj=null;
- this.beenUsed=true;
- };
- UndoRedoQueue.prototype.moveBack=function(){
- if(this.m_iCurrentPos<=0){
- return null;
- }
- var _fa6=this.m_queue[this.m_iCurrentPos].undoType;
- this.m_bUndoRedoCalled=true;
- this.m_lastAction="undo";
- this.m_iCurrentPos--;
- this.m_viewerState={"parameters":this.m_widget.getViewerObject().getExecutionParameters(),"spec":this.m_widget.getViewerObject().envParams["ui.spec"]};
- if(typeof this.m_queue[this.m_iCurrentPos]!="undefined"){
- this.m_widget.getViewerObject().m_sPalette=this.m_queue[this.m_iCurrentPos].palette;
- if(_fa6=="client"){
- return this.m_queue[this.m_iCurrentPos+1];
- }
- var _fa7=this.m_iCurrentPos;
- while(_fa7>0&&this.m_queue[_fa7]&&this.m_queue[_fa7].undoType!="server"){
- _fa7--;
- }
- return this.m_queue[_fa7];
- }
- return null;
- };
- UndoRedoQueue.prototype.moveForward=function(){
- if(this.m_iCurrentPos>=this.m_queue.length){
- return null;
- }
- this.m_bUndoRedoCalled=true;
- this.m_iCurrentPos++;
- this.m_lastAction="redo";
- this.m_viewerState={"parameters":this.m_widget.getViewerObject().getExecutionParameters(),"spec":this.m_widget.getViewerObject().envParams["ui.spec"]};
- if(typeof this.m_queue[this.m_iCurrentPos]!="undefined"){
- this.m_widget.getViewerObject().m_sPalette=this.m_queue[this.m_iCurrentPos].palette;
- return this.m_queue[this.m_iCurrentPos];
- }
- return null;
- };
- UndoRedoQueue.prototype.clearEnd=function(){
- while(this.m_queue.length-1>this.m_iCurrentPos){
- this.m_queue.pop();
- }
- };
- UndoRedoQueue.prototype.handleCancel=function(){
- if(this.m_lastAction=="undo"){
- this.m_iCurrentPos++;
- }else{
- if(this.m_lastAction=="redo"){
- this.m_iCurrentPos--;
- }
- }
- if(this.m_lastAction=="redo"||this.m_lastAction=="undo"){
- var _fa8=this.m_widget.getProperties();
- var _fa9=this.m_queue[this.m_iCurrentPos];
- if(_fa8&&_fa9&&_fa9.widgetProperties){
- _fa8.doUndo(_fa9.widgetProperties);
- }
- }
- this.m_lastAction="";
- this.m_bUndoRedoCalled=false;
- this.currentUndoObj=null;
- };
- UndoRedoQueue.prototype.handleFault=function(){
- this.currentUndoObj=null;
- this.m_bUndoRedoCalled=false;
- };
- UndoRedoQueue.prototype.getUndoTooltip=function(){
- if(this.m_iCurrentPos>0){
- return RV_RES.IDS_JS_UNDO+" "+this.m_queue[this.m_iCurrentPos].tooltip;
- }
- return RV_RES.IDS_JS_UNDO;
- };
- UndoRedoQueue.prototype.getRedoTooltip=function(){
- if(this.m_iCurrentPos<(this.m_queue.length-1)){
- return RV_RES.IDS_JS_REDO+" "+this.m_queue[this.m_iCurrentPos+1].tooltip;
- }
- return RV_RES.IDS_JS_REDO;
- };
- function CIWidgetSavedOutput(_faa){
- this.iWidget=_faa;
- this.bContainsChart=false;
- this.bContainsDrillThrough=false;
- this.bPagedOutput=true;
- };
- CIWidgetSavedOutput.prototype.getIWidget=function(){
- return this.iWidget;
- };
- CIWidgetSavedOutput.prototype.isPagedOutput=function(){
- return this.bPagedOutput;
- };
- CIWidgetSavedOutput.prototype.setPagedOutput=function(_fab){
- this.bPagedOutput=_fab;
- };
- CIWidgetSavedOutput.prototype.getCognosViewer=function(){
- return this.getIWidget().getViewerObject();
- };
- CIWidgetSavedOutput.prototype.getIframeWindow=function(){
- return this.savedOutputWindow;
- };
- CIWidgetSavedOutput.prototype.getSavedOutputDiv=function(){
- return this.savedOutputDiv;
- };
- CIWidgetSavedOutput.prototype.render=function(){
- if(this.isPagedOutput()&&this.getFirstPage()){
- this.currentPageIndex=0;
- this._showPages([this.getFirstPage()]);
- }else{
- if(this.tabbedSavedOutput&&this.currentPageIndex&&this.pageNodes){
- var _fac=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
- this.switchSavedOutputTab(_fac);
- }else{
- if(this.getCognosViewer()&&this.getCognosViewer().getCurrentlySelectedTab()){
- this.switchSavedOutputTab(this.getCognosViewer().getCurrentlySelectedTab());
- }else{
- this.showHTMLFragment(this.getIframeWindow().document.body.innerHTML);
- }
- }
- }
- };
- CIWidgetSavedOutput.prototype.outputDoneLoading=function(){
- if(window["gReportWidgetLoadQueue"]){
- window["gReportWidgetLoadQueue"].widgetDoneLoading(this.getIWidget());
- }
- this.getIWidget().setOriginalFormFields(null);
- var _fad=this.getCognosViewer();
- var _fae=_fad.getId();
- this.savedOutputWindow=dojo.byId("CVHiddenIFrame"+_fae).contentWindow;
- this.savedOutputDiv=dojo.byId("CVSavedOutputDiv"+_fae);
- var sc=_fad.getSelectionController();
- if(!sc.hasContextData()&&this.savedOutputWindow.onLoadEvent){
- this.savedOutputWindow.onLoadEvent();
- }
- this._populatePageNode();
- var _fb0=dojo.byId("_"+this.iWidget.iContext.widgetId+"_cv");
- this.loadStyleInfoFromIframe(_fb0);
- this.bContainsChart=typeof this.savedOutputWindow.displayChart=="function"?true:false;
- this.bContainsDrillThrough=typeof this.savedOutputWindow.drillThroughTarget!="undefined"?true:false;
- this.render();
- this.getMetaDataFromIFrame();
- if(this.bContainsDrillThrough){
- window[_fae+"drillTargets"]=this.getIframeWindow().drillTargets;
- }
- _fad.fillInContextData();
- _fad.updateBorderCollapse();
- this.getIWidget().updateToolbar();
- _fad.setReportRenderingDone(true);
- var _fb1=GUtil.generateCallback(this.getIWidget().fetchAnnotationData,[],this.getIWidget());
- var _fb2=this.getPageContextData(_fb1);
- if(_fb2==0){
- this.getIWidget().fetchAnnotationData();
- }
- this.fixDuplicateFormFields();
- this.getIWidget().getLoadManager().processQueue();
- delete _fad.envParams["cv.outputKey"];
- this.getIWidget().setXNodeId(null);
- var _fb3=this.getIWidget();
- var _fb4=function(){
- _fb3.iContext.iEvents.fireEvent("com.ibm.bux.widget.render.done",null,{});
- _fad.renderTabs();
- if(_fad.getCurrentlySelectedTab()!=null){
- _fb3.getSavedOutput().tabbedSavedOutput=true;
- _fb3.getSavedOutput().switchSavedOutputTab(_fad.getCurrentlySelectedTab());
- }
- };
- setTimeout(_fb4,100);
- };
- CIWidgetSavedOutput.prototype._populatePageNode=function(){
- this.pageNodes=[];
- var node=this.getIframeWindow().document.body.firstChild;
- while(node){
- if(node.nodeName.toLowerCase()=="table"){
- this.pageNodes.push(node);
- }
- node=node.nextSibling;
- }
- };
- CIWidgetSavedOutput.prototype.switchSavedOutputTab=function(_fb6,_fb7){
- if(!this.pageNodes){
- return;
- }
- if(_fb7){
- if(!this.lastVisitedPage){
- this.lastVisitedPage={};
- }
- if(this.isPagedOutput()){
- var _fb8=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
- this.lastVisitedPage[_fb8]=this.currentPageIndex;
- if(this.lastVisitedPage[_fb6]){
- this.currentPageIndex=this.lastVisitedPage[_fb6];
- this._showPages([this.pageNodes[this.currentPageIndex]]);
- return;
- }
- }
- }
- var _fb9=[];
- for(var i=0;i<this.pageNodes.length;i++){
- var node=this.pageNodes[i];
- if(node&&node.getAttribute&&node.getAttribute("tabid")==_fb6){
- _fb9.push(node);
- this.currentPageIndex=i;
- if(this.isPagedOutput()){
- break;
- }
- }
- }
- this._showPages(_fb9);
- };
- CIWidgetSavedOutput.prototype.fixDuplicateFormFields=function(){
- var _fbc=document.getElementById("formWarpRequest"+this.getCognosViewer().getId());
- if(_fbc){
- for(var _fbd=0;_fbd<_fbc.elements.length;_fbd++){
- var name=_fbc.elements[_fbd].name;
- if(name&&name.length>0){
- if(_fbc[name].length>1){
- var _fbf=_fbc[name][_fbc[name].length-1].value;
- while(_fbc[name].length>1){
- _fbc[name][1].parentNode.removeChild(_fbc[name][1]);
- }
- if(_fbc[name][0]){
- _fbc[name][0].value=_fbf;
- }
- _fbc[name].value=_fbf;
- }
- }
- }
- }
- };
- CIWidgetSavedOutput.prototype.getPageContextData=function(_fc0){
- var _fc1={};
- dojo.query("[ctx]",this.getSavedOutputDiv()).forEach(function(item){
- var ctx=item.getAttribute("ctx");
- var _fc4=ctx.split(":");
- for(var i=0;i<_fc4.length;i++){
- var _fc6=_fc4[i];
- if(_fc6&&_fc6.length>0){
- _fc1[_fc6]=true;
- }
- }
- });
- var _fc7=[];
- for(var item in _fc1){
- _fc7.push(item);
- }
- return this.getCognosViewer().getSelectionController().fetchContextData(_fc7,_fc0);
- };
- CIWidgetSavedOutput.prototype.loadStyleInfoFromIframe=function(_fc9){
- var _fca=null;
- var _fcb=this.savedOutputWindow.document;
- for(var _fcc=0;_fcc<_fcb.childNodes.length;_fcc++){
- if(_fcb.childNodes[_fcc].childNodes&&_fcb.childNodes[_fcc].childNodes.length>0){
- _fca=_fcb.childNodes[_fcc];
- break;
- }
- }
- window.gScriptLoader.loadStyles(_fca.firstChild,this.iWidget.getViewerId());
- var _fcd=dojo.query("link",_fca);
- var _fce="";
- for(i=0;i<_fcd.length;i++){
- var href=_fcd[i].getAttribute("href");
- if(href){
- _fce+="<link href=\""+href+"\" />";
- }
- }
- window.gScriptLoader.loadCSS(_fce,_fc9,true,this.iWidget.getViewerId());
- };
- CIWidgetSavedOutput.prototype.getFirstPage=function(){
- return this.pageNodes[0];
- };
- CIWidgetSavedOutput.prototype.getLastPage=function(){
- return this.pageNodes?this.pageNodes[this.pageNodes.length-1]:null;
- };
- CIWidgetSavedOutput.prototype.writeNavLinks=function(){
- var _fd0="";
- if(this.isPagedOutput()){
- if(this.tabbedSavedOutput&&!isNaN(this.currentPageIndex)){
- var _fd1=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
- if(this.currentPageIndex>0&&this.pageNodes[this.currentPageIndex-1].getAttribute("tabid")==_fd1){
- _fd0+=" firstPage previousPage ";
- }
- if(this.currentPageIndex<(this.pageNodes.length-1)&&this.pageNodes[this.currentPageIndex+1].getAttribute("tabid")==_fd1){
- _fd0+=" nextPage lastPage ";
- }
- }else{
- if(this.currentPageIndex>0){
- _fd0+=" firstPage previousPage ";
- }
- if(this.currentPageIndex<(this.pageNodes.length-1)){
- _fd0+=" nextPage lastPage ";
- }
- }
- }
- this.getCognosViewer().writeNavLinks(_fd0,true);
- };
- CIWidgetSavedOutput.prototype.pageAction=function(_fd2){
- switch(_fd2){
- case "firstPage":
- if(this.tabbedSavedOutput){
- var _fd3=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
- for(var i=0;i<this.pageNodes.length;i++){
- var node=this.pageNodes[i];
- if(node&&node.getAttribute&&node.getAttribute("tabid")==_fd3){
- this.currentPageIndex=i;
- break;
- }
- }
- }else{
- this.currentPageIndex=0;
- }
- break;
- case "previousPage":
- this.currentPageIndex=this.currentPageIndex-1;
- break;
- case "nextPage":
- this.currentPageIndex=this.currentPageIndex+1;
- break;
- case "lastPage":
- if(this.tabbedSavedOutput){
- var _fd3=this.pageNodes[this.currentPageIndex].getAttribute("tabid");
- var _fd6=false;
- for(var i=0;i<this.pageNodes.length;i++){
- var node=this.pageNodes[i];
- if(node&&node.getAttribute&&node.getAttribute("tabid")==_fd3){
- _fd6=true;
- }else{
- if(_fd6){
- this.currentPageIndex=i-1;
- break;
- }
- }
- }
- }else{
- this.currentPageIndex=this.pageNodes.length-1;
- }
- break;
- }
- this._showPages([this.pageNodes[this.currentPageIndex]]);
- };
- CIWidgetSavedOutput.prototype._showPages=function(_fd7){
- var oCV=this.getCognosViewer();
- oCV.getSelectionController().clearSelectedObjects();
- if(_fd7.length==1){
- this.showHTMLFragment(_fd7[0].innerHTML);
- }else{
- var _fd9="";
- for(var i=0;i<_fd7.length;i++){
- _fd9+=_fd7[i].innerHTML;
- }
- this.showHTMLFragment(_fd9);
- }
- this.writeNavLinks();
- if(this.tabbedSavedOutput&&this.lastVisitedPage){
- this.getIWidget().placeTabControlInView();
- }else{
- oCV.setKeepFocus(true);
- }
- oCV.doneLoadingUpdateA11Y("complete");
- var _fdb=GUtil.generateCallback(this.getIWidget().fetchAnnotationData,[],this.getIWidget());
- var _fdc=this.getPageContextData(_fdb);
- if(_fdc==0){
- this.getIWidget().fetchAnnotationData();
- }
- };
- CIWidgetSavedOutput.prototype.getMetaDataFromIFrame=function(){
- if(typeof this.getIframeWindow().getSelectionController=="function"){
- var _fdd=this.getIframeWindow().getSelectionController();
- if(_fdd){
- var _fde=this.getCognosViewer().getSelectionController();
- _fde.addMetaData(_fdd.getCCDManager().m_md);
- _fde.addContextData(_fdd.getCCDManager().m_cd);
- _fde.setSelectionBasedFeaturesEnabled(true);
- }
- }
- };
- CIWidgetSavedOutput.prototype.processDrillThrough=function(_fdf){
- if(this.bContainsDrillThrough&&(typeof this.bOldOutput=="undefined"||this.bOldOutput==true)){
- var _fe0=new RegExp("onclick=\"doSingleDrillThrough[^\"]*\"|onclick='doMultipleDrillThrough[^']*'","gim");
- var aM=_fdf.match(_fe0);
- if(aM){
- if(typeof this.bOldOutput=="undefined"&&aM.length>0&&aM[0].indexOf("'_THIS_'")>0){
- this.bOldOutput=false;
- }else{
- this.bOldOutput=true;
- var _fe2="";
- var quot="'";
- if(aM.length>0){
- _fe2=aM[0].charAt(aM[0].length-1);
- }
- if(_fe2=="'"){
- quot="\"";
- }
- for(var i=0;i<aM.length;i++){
- _fdf=_fdf.replace(aM[i],aM[i].substring(0,aM[i].length-3)+","+quot+this.getCognosViewer().getId()+quot+");"+_fe2);
- }
- }
- }
- }
- return _fdf;
- };
- CIWidgetSavedOutput.prototype.processChart=function(_fe5){
- if(isIE()){
- _fe5=_fe5.replace(/preSelectNode\(event\);/g,getCognosViewerObjectRefAsString(this.getCognosViewer().getId())+".pcc(event);");
- }else{
- _fe5=_fe5.replace(/preSelectNode\(event\);/g,"");
- }
- var _fe6=this.getCognosViewer().getId();
- var _fe7=document.getElementById("CVHiddenIFrame"+_fe6);
- var _fe8=_fe7.src;
- if(_fe8.indexOf("repository")>=0){
- var _fe9=_fe8.indexOf("content");
- var _fea=_fe8.substring(0,_fe9);
- _fe5=_fe5.replace(/src\=\"images\//g,"src=\""+_fea+"images/");
- }
- _fe5=this.fixupChartUseMapValue(_fe5);
- return _fe5.replace(/displayChart[^;].*;|var graphicSrc[^;].*;|var graphicName[^;].*;/g,"");
- };
- CIWidgetSavedOutput.prototype.fixupChartUseMapValue=function(_feb){
- var re=/usemap\s*=\s*"*#(\w+)"*/gi;
- var _fed,_fee=[];
- while((_fed=re.exec(_feb))){
- _fee.push(_fed[1]);
- }
- for(var i=0;i<_fee.length;i++){
- var _ff0=new RegExp(_fee[i],"g");
- _feb=_feb.replace(_ff0,_fee[i]+this.getCognosViewer().getId());
- }
- return _feb;
- };
- CIWidgetSavedOutput.prototype.showHTMLFragment=function(_ff1){
- if(this.bContainsChart){
- _ff1=this.processChart(_ff1);
- }
- _ff1=this.processDrillThrough(_ff1);
- _ff1=_ff1.replace(/_THIS_/g,this.getCognosViewer().getId());
- this.getIWidget().loadStylesAndScripts(_ff1,this.getSavedOutputDiv(),false);
- this.getIWidget().reselectSelectionFilterObjects();
- this.getIWidget().addChromeWhitespaceHandler(this.getCognosViewer().getId());
- };
- function gInitializeViewer(obj){
- if(window.gScriptLoader.hasCompletedExecution()){
- var _ff3=obj.getViewerObject();
- if(_ff3&&_ff3.inlineScriptsDoneExecuting==true){
- clearInterval(obj.timer);
- if(typeof _ff3.errorOccured!="undefined"){
- obj.fireEvent("com.ibm.bux.widget.render.done",null,{});
- }else{
- if(typeof _ff3.getToolbar()!="undefined"){
- _ff3.setViewerWidget(obj);
- if(obj.isSelectionFilterEnabled()){
- obj.updateDrillThroughLinks();
- }
- if(obj.isDashboardOwner()){
- _ff3.addReportInfo();
- }
- if(obj.promptParametersRetrieved==true){
- var _ff4=obj.getAttributeValue("viewerReportPrompts");
- _ff3.envParams["reportPrompts"]=_ff4;
- }else{
- if(_ff3.envParams&&_ff3.envParams["widget.promptParametersRetrievedOnDrop"]=="true"){
- obj.promptParametersRetrieved=true;
- }
- }
- var _ff5=obj.getAttributeValue("syncNewWidgets");
- if(_ff5===null||_ff5==="true"){
- _ff5=true;
- }else{
- _ff5=false;
- }
- if(!_ff5&&(obj.isPastedWidget()||obj.isOpeningSavedDashboard()==false)){
- obj.disableListenToForEvent(["com.ibm.widget.contextChanged.drill","com.ibm.widget.contextChanged.prompt","com.ibm.widget.contextChanged"]);
- }
- obj.fireEvent("com.ibm.bux.widget.setShowBordersWhenInnactive",null,(_ff3.m_flashChartsObjectIds.length!==0));
- }
- }
- }
- }
- };
- function gVWEvent(sId,evt,_ff8){
- var oCV=window["oCV"+sId];
- if(oCV){
- oCV.loadExtra();
- var _ffa=oCV.getViewerWidget();
- if(_ffa){
- _ffa[_ff8](evt);
- }
- }
- };
- function ReportWidgetLoadQueue(_ffb){
- this._concurrentLoadSetting=_ffb;
- this._widgetsRunning=[];
- this._queue=[];
- };
- ReportWidgetLoadQueue.prototype.add=function(_ffc){
- this._queue.push(_ffc);
- this.loadNextWidget();
- };
- ReportWidgetLoadQueue.prototype.widgetDoneLoading=function(_ffd){
- for(var i=0;i<this._widgetsRunning.length;++i){
- var _fff=this._widgetsRunning[i];
- if(_fff==_ffd){
- this._widgetsRunning.splice(i,1);
- break;
- }
- }
- this.loadNextWidget();
- };
- ReportWidgetLoadQueue.prototype.loadNextWidget=function(){
- if(this._widgetsRunning.length<this._concurrentLoadSetting){
- var _1000=this._queue.shift();
- if(typeof _1000!="undefined"){
- this._widgetsRunning.push(_1000);
- _1000.postReport(null);
- }
- }
- };
- function CognosViewerAnnotation(){
- this.m_oCV=null;
- };
- CognosViewerAnnotation.prototype.setCognosViewer=function(oCV){
- this.m_oCV=oCV;
- };
- CognosViewerAnnotation.prototype.getCognosViewer=function(){
- return this.m_oCV;
- };
- CognosViewerAnnotation.prototype.isEnabled=function(_1002){
- };
- CognosViewerAnnotation.prototype.areAnnotationsEnabled=function(){
- var _1003=this.m_oCV.getViewerWidget();
- return _1003.getAnnotationHelper().isEnabled();
- };
- CognosViewerAnnotation.prototype.getMenuItemBaseString=function(){
- };
- CognosViewerAnnotation.prototype.getMenuItemIconClass=function(){
- };
- CognosViewerAnnotation.prototype.getSelections=function(){
- var _1004=[];
- var _1005=this.getCognosViewer();
- if(_1005){
- var _1006=_1005.getSelectionController();
- if(_1006){
- _1004=_1006.getSelections();
- }
- }
- return _1004;
- };
- CognosViewerAnnotation.prototype.hasAnnotation=function(){
- var has=false;
- var _1008=this.getCognosViewer();
- if(_1008){
- var _1009=_1008.getViewerWidget();
- if(_1009){
- var store=_1009.getAnnotationStore();
- if(store){
- has=store.hasAnnotation();
- }
- }
- }
- return has;
- };
- function CognosViewerCellAnnotation(){
- };
- CognosViewerCellAnnotation.prototype=new CognosViewerAnnotation();
- CognosViewerCellAnnotation.prototype.getMenuItemString=function(_100b){
- var _100c=_100b;
- var _100d=this.getSelections();
- if(_100d&&_100d.length==1){
- var sel=_100d[0];
- _100c=sel.getDisplayValues()[0];
- }
- var text=this.getMenuItemBaseString();
- if(_100c&&_100c.length>0){
- text+=" - "+enforceTextDir(_100c);
- }
- return text;
- };
- CognosViewerCellAnnotation.prototype.hasAnnotaionsOnSelectedCell=function(){
- var _1010=this.getSelections();
- if(_1010&&_1010.length==1){
- var _1011=_1010[0].getCellRef();
- var ctxId=this.getCognosViewer().findCtx(_1011);
- var _1013=this.getCognosViewer().getViewerWidget();
- if(_1013){
- var _1014=_1013.getAnnotationStore();
- if(_1014){
- var _1015=_1014.get(ctxId);
- if(_1015&&_1015.length>0){
- return true;
- }
- }
- }
- }
- return false;
- };
- CognosViewerCellAnnotation.prototype.getChangeableAnnotation=function(){
- var _1016=this.getSelections();
- if(_1016&&_1016.length==1){
- var _1017=_1016[0].getCellRef();
- var ctxId=this.getCognosViewer().findCtx(_1017);
- var _1019=this.getCognosViewer().getViewerWidget();
- if(_1019){
- var _101a=_1019.getAnnotationStore();
- if(_101a){
- return _101a.getChangeableAnnotation(ctxId);
- }
- }
- }
- return null;
- };
- CognosViewerCellAnnotation.prototype.hasValidContextOnSelectedCell=function(){
- var _101b=this.getSelections();
- if(_101b&&_101b.length==1){
- var _101c=_101b[0].getCellRef();
- var ctxId=this.getCognosViewer().findCtx(_101c);
- if(ctxId){
- var ids=AnnotationCTXLookup.generateIDArrayFromCellCtxValue(ctxId);
- for(var i=0;i<ids.length;i++){
- var id=ids[i];
- if(id!=="*"&&!(/^\d+$/).test(id)){
- return false;
- }
- }
- return true;
- }
- }
- return false;
- };
- function NewAnnotation(){
- };
- NewAnnotation.prototype=new CognosViewerCellAnnotation();
- NewAnnotation.prototype.isEnabled=function(_1021){
- return this.areAnnotationsEnabled()&&(_1021!=="widgetActions")&&this.hasValidContextOnSelectedCell();
- };
- NewAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_ANNOTATION_NEW;
- };
- NewAnnotation.prototype.getMenuItemIconClass=function(){
- return "NewAnnotation";
- };
- function EditAnnotation(){
- };
- EditAnnotation.prototype=new CognosViewerCellAnnotation();
- EditAnnotation.prototype.isEnabled=function(_1022){
- return this.areAnnotationsEnabled()&&(_1022!=="widgetActions")&&this.getChangeableAnnotation()!==null;
- };
- EditAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_ANNOTATION_EDIT;
- };
- EditAnnotation.prototype.getMenuItemIconClass=function(){
- return "EditAnnotation";
- };
- function DeleteAnnotation(){
- };
- DeleteAnnotation.prototype=new CognosViewerCellAnnotation();
- DeleteAnnotation.prototype.isEnabled=function(_1023){
- return this.areAnnotationsEnabled()&&(_1023!=="widgetActions")&&this.getChangeableAnnotation()!==null;
- };
- DeleteAnnotation.prototype.getMenuItemString=function(_1024){
- return this.getMenuItemBaseString();
- };
- DeleteAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_ANNOTATION_DELETE;
- };
- DeleteAnnotation.prototype.getMenuItemIconClass=function(){
- return "DeleteAnnotation";
- };
- function CognosViewerWidgetAnnotation(){
- };
- CognosViewerWidgetAnnotation.prototype=new CognosViewerAnnotation();
- CognosViewerWidgetAnnotation.prototype.getMenuItemString=function(){
- var _1025=this.getCognosViewer().getViewerWidget().getDisplayName();
- var text=this.getMenuItemBaseString();
- if(_1025&&_1025.length>0){
- _1025=enforceTextDir(_1025);
- text+=" - "+_1025;
- }
- return text;
- };
- CognosViewerWidgetAnnotation.prototype.hasWidgetLevelAnnotations=function(){
- var _1027=false;
- var _1028=this.getCognosViewer().getViewerWidget();
- if(_1028){
- var _1029=_1028.getAnnotationStore();
- var _102a=_1029.get(_1029.WIDGET_CONTEXT);
- if(_102a&&_102a.length>0){
- _1027=true;
- }
- }
- return _1027;
- };
- CognosViewerWidgetAnnotation.prototype.getWidgetLevelChangeableAnnotation=function(){
- var _102b=this.getCognosViewer().getViewerWidget();
- if(_102b){
- var _102c=_102b.getAnnotationStore();
- if(_102c){
- return _102c.getChangeableAnnotation(_102c.WIDGET_CONTEXT);
- }
- }
- return null;
- };
- CognosViewerWidgetAnnotation.prototype.hasValidSelection=function(_102d){
- var _102e=this.m_oCV.getSelectionController();
- var _102f=_102e.getSelections();
- var _1030=false;
- if(_102e.hasSelectedChartNodes()){
- _1030=(_102e.getSelectedChartNodes()[0].m_contextIds.length>0);
- }
- return (_102d==="widgetActions")||(_102f.length!=1&&!_1030);
- };
- function NewWidgetAnnotation(){
- };
- NewWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
- NewWidgetAnnotation.prototype.isEnabled=function(_1031){
- return this.areAnnotationsEnabled()&&(_1031!=="contextMenu")&&this.hasValidSelection(_1031);
- };
- NewWidgetAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_WIDGET_ANNOTATION_NEW;
- };
- NewWidgetAnnotation.prototype.getMenuItemIconClass=function(){
- return "NewWidgetAnnotation";
- };
- function EditWidgetAnnotation(){
- };
- EditWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
- EditWidgetAnnotation.prototype.isEnabled=function(_1032){
- return (this.areAnnotationsEnabled()&&(_1032!=="contextMenu")&&this.hasValidSelection(_1032)&&this.getWidgetLevelChangeableAnnotation())?true:false;
- };
- EditWidgetAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_WIDGET_ANNOTATION_EDIT;
- };
- EditWidgetAnnotation.prototype.getMenuItemIconClass=function(){
- return "EditWidgetAnnotation";
- };
- function DeleteWidgetAnnotation(){
- };
- DeleteWidgetAnnotation.prototype=new CognosViewerWidgetAnnotation();
- DeleteWidgetAnnotation.prototype.isEnabled=function(_1033){
- return (this.areAnnotationsEnabled()&&(_1033!=="contextMenu")&&this.hasValidSelection(_1033)&&this.getWidgetLevelChangeableAnnotation())?true:false;
- };
- DeleteWidgetAnnotation.prototype.getMenuItemBaseString=function(){
- return RV_RES.IDS_JS_WIDGET_ANNOTATION_DELETE;
- };
- DeleteWidgetAnnotation.prototype.getMenuItemIconClass=function(){
- return "DeleteWidgetAnnotation";
- };
- function AnnotationCTXLookup(_1034){
- this.m_ccdManager=_1034;
- this.m_md=this.m_ccdManager.m_md;
- this.m_cd=this.m_ccdManager.m_cd;
- this.m_RDIVALUE_KEY="annotationHook";
- this.m_oContextDetailsMap={};
- };
- AnnotationCTXLookup.prototype.populateCtxDetailsForAllAnnotations=function(_1035){
- for(var i=0,len=_1035.length;i<len;i++){
- var anno=_1035[i];
- var ctx=anno.ctx;
- if(ctx){
- this._populateCtxDetailsForOneCtxValue(ctx);
- }
- }
- };
- AnnotationCTXLookup.prototype._populateCtxDetailsForOneCtxValue=function(_103a){
- if(_103a){
- var _103b=this.generateIDArrayFromCellCtxValue(_103a);
- for(var i=0,len=_103b.length;i<len;i++){
- var id=_103b[i];
- this._populateCtxDetailsForOneId(id);
- }
- }
- };
- AnnotationCTXLookup.generateIDArrayFromCellCtxValue=function(_103f){
- if(_103f){
- return _103f.replace(/::/g,":").split(":");
- }
- return null;
- };
- AnnotationCTXLookup.prototype.generateIDArrayFromCellCtxValue=AnnotationCTXLookup.generateIDArrayFromCellCtxValue;
- AnnotationCTXLookup.prototype._populateCtxDetailsForOneId=function(id){
- if(id.match(/\*/)){
- return;
- }
- var _1041=this.m_oContextDetailsMap[id];
- if(_1041){
- return;
- }else{
- _1041={};
- var _1042=this.m_cd[id];
- if(_1042){
- if(_1042.u){
- _1041["u"]=_1042.u;
- }
- if(_1042.r){
- _1041["r"]=_1042.r;
- var _1043=this.m_md[_1042.r];
- if(_1043){
- if(_1043.usage!=="undefined"){
- _1041["usage"]=_1043.usage;
- }
- if(_1043.dtype){
- _1041.dtype=_1043.dtype;
- }
- }
- }
- this._populateRdiValueInDetail(_1041,id);
- this.m_oContextDetailsMap[id]=_1041;
- }
- }
- };
- AnnotationCTXLookup.prototype._getMDValue=function(item,key1,key2){
- if(typeof key2=="undefined"){
- key2=key1;
- }
- if(typeof item[key1]!="undefined"&&typeof this.m_md[item[key1]][key2]!="undefined"){
- return this.m_md[item[key1]][key2];
- }
- return null;
- };
- AnnotationCTXLookup.prototype._findMDValue=function(item,aKeys){
- for(var i=0;i<aKeys.length;i++){
- var value=this._getMDValue(item,aKeys[i]);
- if(value!==null){
- return value;
- }
- }
- return null;
- };
- AnnotationCTXLookup.prototype._populateRdiValueInDetail=function(_104b,id){
- var item=this.m_cd[id];
- var aKeys=[];
- var oRdi={};
- oRdi[1]=this._findMDValue(item,["l","h","i","r"]);
- if(this._getMDValue(item,"r","usage")==2){
- oRdi[2]=this._findMDValue(item,["i","m","r"]);
- }
- _104b[this.m_RDIVALUE_KEY]=oRdi;
- };
- AnnotationCTXLookup.prototype.getDetail=function(id){
- if(!id){
- return null;
- }
- return this.m_oContextDetailsMap[id];
- };
- AnnotationCTXLookup.prototype.isAnnotatedId=function(_1051,_1052,id){
- if(!_1051||!id){
- return false;
- }
- if(_1051.match(/\*/)){
- var _1054=this.getDetail(id);
- if(_1054&&_1054[this.m_RDIVALUE_KEY]){
- var rdi=_1054[this.m_RDIVALUE_KEY][1];
- if(_1052.version>=2&&_1054[this.m_RDIVALUE_KEY][2]){
- rdi=_1054[this.m_RDIVALUE_KEY][2];
- }
- return this._compareWithoutNS(_1052.rdi,rdi);
- }else{
- return false;
- }
- }else{
- return _1051===id;
- }
- };
- AnnotationCTXLookup.prototype._compareWithoutNS=function(rdi1,rdi2){
- if(!rdi1||!rdi2){
- return false;
- }
- if(rdi1!==rdi2){
- var _1058=rdi2.indexOf("].[");
- if(_1058>0){
- return rdi1.lastIndexOf(rdi2.substr(_1058))>0;
- }
- return false;
- }
- return true;
- };
- AnnotationCTXLookup.prototype.isAnnotatedCell=function(_1059,_105a){
- if(!_1059||!_1059.ctx||!_105a){
- return false;
- }
- this._populateCtxDetailsForOneCtxValue(_105a);
- var _105b=this.generateIDArrayFromCellCtxValue(_1059.ctx);
- var _105c=this.generateIDArrayFromCellCtxValue(_105a);
- if(!this.isAnnotatedId(_105b[0],_1059,_105c[0])){
- return false;
- }
- var _105d=this._generateDataItemIDArrayFromAnnotationIDs(_105b);
- var _105e=this._generateDataItemIDArrayFromCellIDs(_105c);
- if(_105d.length>_105e.length){
- return false;
- }
- for(var i=0,len=_105d.length;i<len;i++){
- for(var j=0,jLen=_105e.length;j<jLen;j++){
- if(_105d[i]===_105e[j]){
- _105d[i]=true;
- _105e[j]=true;
- break;
- }
- }
- }
- for(i=0,len=_105d.length;i<len;i++){
- if(_105d[i]!==true){
- return false;
- }
- }
- for(i=0,len=_105e.length;i<len;i++){
- if(_105e[i]!==true){
- return false;
- }
- }
- return true;
- };
- AnnotationCTXLookup.prototype._generateDataItemIDArrayFromCellIDs=function(_1063){
- var _1064=[];
- for(var i=1,len=_1063.length;i<len;i++){
- var id=_1063[i];
- var _1068=this.getDetail(id);
- if(this._isDataItem(_1068)){
- _1064.splice(0,0,id);
- }
- }
- return _1064;
- };
- 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};
- AnnotationCTXLookup.prototype._isDataItem=function(_1069){
- if(_1069){
- var usage=_1069.usage;
- var dtype=_1069.dtype;
- if(usage===0||usage===1||(usage===3&&AnnotationCTXLookup.dtypeLookup[dtype]===true)){
- return true;
- }
- }
- return false;
- };
- AnnotationCTXLookup.prototype._generateDataItemIDArrayFromAnnotationIDs=function(_106c){
- var _106d=[];
- for(var i=1,len=_106c.length;i<len;i++){
- var id=_106c[i];
- if(id.match(/\*/)===null){
- _106d.splice(0,0,id);
- }
- }
- return _106d;
- };
- dojo.provide("bux.reportViewer.ReportInfo");
- dojo.require("bux.Tooltip");
- 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){
- if(args.focusElement){
- dojo.connect(args.focusElement,"onfocus",this,"_onHover");
- dojo.connect(args.focusElement,"onblur",this,"_onUnHover");
- }
- },createMarkup:function(){
- var _1072=this.connectId+"_linkId";
- var _1073=dojo.isIE||dojo.isTrident?"\"#\"":"\"javascript:void(0);\"";
- var _1074="";
- _1074+="<table role=\"presentation\" class=\"bux-tooltip-table\" cellspacing=\"0\" cellpadding=\"0\">";
- _1074+="<tr>";
- _1074+="<td class=\"bux-tooltip-title\">";
- _1074+=html_encode(this.title);
- _1074+="</td>";
- _1074+="</tr>";
- _1074+="<tr>";
- _1074+="<td class=\"bux-tooltip-text\">";
- _1074+=html_encode(this.text);
- _1074+="</td>";
- _1074+="</tr>";
- _1074+="<tr>";
- if(this.linkScript){
- _1074+="<td class=\"bux-tooltip-text\">";
- _1074+="<a role=\"link\" id=\""+_1072+"\" href="+_1073+" onmousedown=\""+this.linkScript+"\">"+html_encode(this.linkText)+"</a>";
- _1074+="</td>";
- }else{
- _1074+="<td></td>";
- }
- _1074+="</tr>";
- _1074+="</table>";
- return _1074;
- }});
- dojo.provide("ViewerIWidgetInlineDialog");
- dojo.require("dijit._base.focus");
- dojo.declare("ViewerIWidgetInlineDialog",null,{constructor:function(oCV,sHTML,_1077,_1078){
- this.initialize(oCV,sHTML);
- this.m_aButtons=_1077;
- this.m_sButtonContainerId=_1078;
- },initialize:function(oCV,sHTML){
- this.m_oCV=oCV;
- this.m_html=sHTML;
- this.m_viewerDiv=dojo.byId("RVContent"+this.m_oCV.getId());
- this.positionOptions={horizontal:"center",vertical:"center"};
- this.onScrollHandle=null;
- this.m_dialogDiv=null;
- if(this.m_oCV.getViewerWidget){
- this.m_background=this.m_oCV.getViewerWidget().getReportBlocker();
- }
- },setVerticalPositionOption:function(_107b){
- this.positionOptions.vertical=_107b;
- },getDialogDiv:function(){
- return this.m_dialogDiv;
- },initializeDialog:function(){
- this.m_dialogDiv=document.createElement("div");
- dojo.addClass(this.m_dialogDiv,"inlineDialog");
- this.m_dialogDiv.style.display="none";
- this.m_dialogDiv.innerHTML=this.m_html;
- dojo.place(this.m_dialogDiv,this.m_background.getNode().nextSibling,"before");
- var _107c=dojo.byId(this.m_sButtonContainerId);
- if(_107c&&this.m_aButtons&&this.m_aButtons.length>0){
- dojo.forEach(this.m_aButtons,function(_107d){
- var span=document.createElement("span");
- _107c.appendChild(span);
- var _107f=new dijit.form.Button(_107d,span);
- });
- }
- },createBackgroundTabCatchDiv:function(){
- if(this.m_tabCatch==null){
- this.m_tabCatch=dojo.byId("BACKGROUND_TABCATCH"+this.m_oCV.getId());
- if(!this.m_tabCatch){
- this.m_tabCatch=document.createElement("div");
- this.m_tabCatch.id="BACKGROUND_TABCATCH"+this.m_oCV.getId();
- this.m_tabCatch.style.display="none";
- this.m_tabCatch.style.position="absolute";
- this.m_tabCatch.style.left="0";
- this.m_tabCatch.style.top="0";
- this.m_tabCatch.style.height="0px";
- this.m_tabCatch.style.width="0px";
- this.m_tabCatch.setAttribute("tabIndex","0");
- if(this.m_viewerDiv.firstChild){
- dojo.place(this.m_tabCatch,this.m_viewerDiv.firstChild,"before");
- }else{
- this.m_viewerDiv.appendChild(this.m_tabCatch);
- }
- }
- }
- },initializeBackground:function(){
- this.createBackgroundTabCatchDiv();
- },initializeKeyboardSupport:function(){
- var _1080=dijit._getTabNavigable(this.m_dialogDiv);
- var _1081=_1080.lowest||_1080.first;
- var _1082=_1080.last||_1080.highest||_1081;
- if(_1081){
- this.m_tabCatch.onfocus=function(){
- dijit.focus(_1081);
- };
- this.m_background.getNode().onfocus=function(){
- dijit.focus(_1081);
- };
- }
- if(_1082&&_1081){
- _1082.onblur=function(){
- dijit.focus(_1081);
- };
- }else{
- if(_1081){
- _1081.onblur=function(){
- dijit.focus(_1081);
- };
- }
- }
- if(this.m_oCV.getKeepFocus()!=false&&_1081&&_1081.focus){
- _1081.focus();
- }
- },show:function(){
- this.m_oCV.setVisibleDialog(this);
- if(this.m_tabCatch==null){
- this.initializeBackground();
- }
- if(this.m_dialogDiv==null){
- this.initializeDialog();
- }
- this.m_background.setClassNameOverride("inlineDialog-background-error");
- this.m_background.show();
- this.m_tabCatch.style.display="block";
- this.m_dialogDiv.style.display="block";
- this.initializeKeyboardSupport();
- },hide:function(){
- this.m_oCV.setVisibleDialog(null);
- if(this.onScrollHandle!=null){
- dojo.disconnect(this.onScrollHandle);
- this.onScrollHandle=null;
- }
- if(this.m_background!=null){
- this.m_background.hide();
- }
- if(this.m_tabCatch!=null){
- this.m_tabCatch.style.display="none";
- }
- if(this.m_dialogDiv!=null){
- this.m_dialogDiv.style.display="none";
- }
- },destroy:function(){
- this.hide();
- if(this.m_dialogDiv!=null){
- this.m_dialogDiv.parentNode.removeChild(this.m_dialogDiv);
- this.m_dialogDiv=null;
- }
- if(this.m_tabCatch!=null){
- this.m_tabCatch.parentNode.removeChild(this.m_tabCatch);
- this.m_tabCatch=null;
- }
- if(this.m_background!=null){
- this.m_background.destroy();
- this.m_background=null;
- }
- },setDebugHelper:function(_1083){
- var _1084=document.createElement("div");
- _1084.style.zIndex="100";
- _1084.style.display="block";
- _1084.style.position="relative";
- _1084.style.backgroundColor="#FFFFFF";
- _1084.innerHTML="<table><tr><td>"+"<a href=\"#\" onclick=\""+_1083+".show();\">show</a>"+" "+"<a href=\"#\" onclick=\""+_1083+".hide();\">hide</a></td></tr></table>";
- document.body.insertBefore(_1084,document.body.firstChild);
- }});
- dojo.provide("bux.reportViewer.Properties");
- dojo.declare("bux.reportViewer.Properties",null,{iWidget:null,masterDialogSpec:null,masterDialogSpecProperties:null,flashChartSpec:null,isFlashChartOptionEnabled:true,oldProperties:null,dialogDisplayValues:null,constructor:function(_1085,_1086){
- this.isInitialized=false;
- this.initializeDialogDisplayValues();
- this.oldProperties={};
- this.iWidget=_1085;
- if(_1086==="<empty>"){
- return;
- }
- var json=dojo.eval("["+_1086+"]");
- if(json&&json[0]){
- this.initializeWithSavedPropertyValues(json[0]);
- }
- },initializeDialogDisplayValues:function(){
- 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}};
- },clearDialogSpec:function(){
- this.masterDialogSpec=null;
- this.masterDialogSpecProperties=null;
- },initializeWithSavedPropertyValues:function(_1088){
- for(var prop in _1088){
- if(typeof prop!="undefined"&&prop!=null){
- if(this.dialogDisplayValues[prop]){
- this.dialogDisplayValues[prop].value=_1088[prop];
- }else{
- this.dialogDisplayValues[prop]={value:_1088[prop],canUndo:false};
- }
- }
- }
- },setProperty:function(_108a,value){
- this.dialogDisplayValues[_108a].value=value;
- },getProperty:function(_108c){
- if(this.dialogDisplayValues[_108c]){
- return this.dialogDisplayValues[_108c].value;
- }
- return null;
- },getOldProperty:function(_108d){
- if(this.oldProperties&&this.oldProperties[_108d]){
- return this.oldProperties[_108d].value;
- }
- return null;
- },getOldProperties:function(){
- var _108e={};
- for(var prop in this.oldProperties){
- if(this.dialogDisplayValues[prop].canUndo===true){
- _108e[prop]={};
- _108e[prop].value=this.oldProperties[prop].value;
- }
- }
- return _108e;
- },onGet:function(){
- this.copyPropertyValues(this.dialogDisplayValues,this.oldProperties);
- if(!this.masterDialogSpec){
- this.initializeDialogSpec();
- }else{
- this.updateDialogSpec();
- }
- var _1090={tabTitle:this._getReportWidgetTabTitle(),properties:this.dialogDisplayValues,propertiesDialogSpec:this.masterDialogSpec};
- return _1090;
- },_getReportWidgetTabTitle:function(){
- var _1091;
- if(this.iWidget&&this.iWidget.getViewerObject()){
- _1091=RV_RES.IDS_REPORT_WIDGET_PROPERTY_TAB_TITLE;
- }
- return _1091;
- },onSet:function(_1092){
- if(this.isSavedOutput()){
- this.updateSavedOutput();
- }else{
- if(!this.runReportWithNewOptions()){
- this._updateReport();
- }
- }
- },_updateReport:function(){
- var _1093=this.getProperty("showExpandCollapseIcon");
- if(this.getOldProperty("showExpandCollapseIcon")!=_1093){
- var oCV=this.iWidget.getViewerObject();
- if(_1093===true){
- oCV.insertExpandIconsForAllCrosstabs();
- }else{
- oCV.removeExpandIconsForAllCrosstabs();
- }
- }
- },copyPropertyValues:function(from,to){
- for(var prop in from){
- if(!to[prop]){
- to[prop]={};
- }
- to[prop].value=from[prop].value;
- }
- },doUndo:function(_1098){
- this.copyPropertyValues(_1098,this.dialogDisplayValues);
- },getUndoInfo:function(){
- if(!this.isInitialized){
- var oCV=this.iWidget.getViewerObject();
- this.initialize(oCV.envParams);
- }
- var _109a={};
- for(var prop in this.dialogDisplayValues){
- if(this.dialogDisplayValues[prop].canUndo===true){
- _109a[prop]={value:this.getProperty(prop)};
- }
- }
- return _109a;
- },shouldUpdateReport:function(_109c){
- for(var prop in this.dialogDisplayValues){
- if(this.dialogDisplayValues[prop][_109c]==true&&this.getOldProperty(prop)!=this.getProperty(prop)){
- return true;
- }
- }
- return false;
- },runReportWithNewOptions:function(){
- if(this.shouldUpdateReport("runReport")){
- var oCV=this.iWidget.getViewerObject();
- var _109f=oCV.getAction("RunReport");
- _109f.setReuseQuery(true);
- _109f.execute();
- this.iWidget.getUndoRedoQueue().initUndoObj({"tooltip":this.getUndoHint(),"saveSpec":this.saveSpecForUndo()});
- return true;
- }
- return false;
- },updateSavedOutput:function(){
- if(this.shouldUpdateReport("refreshSavedOutput")){
- var _10a0=this.iWidget.getSavedOutput();
- _10a0.setPagedOutput(!this.getRetrieveAll());
- _10a0.render();
- }
- },toString:function(){
- var str="{";
- for(var prop in this.dialogDisplayValues){
- var _10a3=this.getProperty(prop);
- if(_10a3!=null&&typeof _10a3!=="undefined"){
- if(str!="{"){
- str+=", ";
- }
- str+="\""+prop+"\": ";
- str+=(typeof (_10a3)=="string")?_10a3.toString():dojo.toJson(_10a3);
- }
- }
- str+="}";
- return str;
- },isSavedOutput:function(){
- return this.iWidget.getViewerObject().envParams["ui.action"]==="view";
- },getUndoHint:function(){
- return RV_RES.IDS_JS_WIDGET_PROPERTIES;
- },saveSpecForUndo:function(){
- return false;
- },getRetrieveAll:function(){
- return this.getProperty("retrieveAll");
- },getPromptUserOnLoad:function(){
- return this.getProperty("promptUserOnLoad");
- },getFlashCharts:function(){
- return this.getProperty("flashCharts");
- },getRowsPerPage:function(){
- return this.getProperty("rowsPerPage");
- },getOriginalReportLocation:function(_10a4){
- if(_10a4.getAttributeValue&&!_10a4.getAttributeValue("originalReport")){
- return RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION_UNAVAILABLE;
- }
- var _10a5=_10a4.getViewerObject().envParams["originalReportLocation"];
- if(typeof _10a5=="undefined"||_10a5==null||_10a5=="Unavailable"){
- return RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION_UNAVAILABLE;
- }
- return (RV_RES.IDS_JS_PROPERTY_ORIGINAL_REPORT_LOCATION+" "+_10a5);
- },getShowExpandCollapseIconFlag:function(){
- return this.getProperty("showExpandCollapseIcon");
- },getAdvancedServerProperty:function(_10a6){
- if(!this.iWidget&&!this.iWidget.getViewerObject()){
- return null;
- }
- return this.iWidget.getViewerObject().getAdvancedServerProperty(_10a6);
- },initializeShowExpandCollapseIconFlag:function(){
- var _10a7=this.getAdvancedServerProperty("VIEWER_JS_EXPAND_COLLAPSE_CONTROLS_DEFAULT");
- this.bHideExpandCollapseOption=(!_10a7);
- if(this.bHideExpandCollapseOption){
- return;
- }
- if(this.getShowExpandCollapseIconFlag()===null){
- this.setProperty("showExpandCollapseIcon",_10a7.toLowerCase()==="on");
- }
- },initialize:function(_10a8){
- if(this.isInitialized){
- return;
- }
- this.isInitialized=true;
- this.initializeFlashChartSettings(_10a8.flashChartOption);
- this.initializeShowExpandCollapseIconFlag();
- if(this.getRowsPerPage()==null){
- if(_10a8["run.verticalElements"]!=null){
- this.setProperty("rowsPerPage",_10a8["run.verticalElements"]);
- }else{
- this.setProperty("rowsPerPage",20);
- }
- }
- this.initializeDialogSpec();
- },createViewReportSpecLink:function(){
- var oCV=this.iWidget.getViewerObject();
- var _10aa=oCV.envParams["ui.spec"];
- if(oCV.bCanUseReportStudio&&_10aa&&_10aa.length>0&&oCV.envParams["ui.action"]!="view"){
- return {columns:[{propertyName:"viewReportSpecification",uiElementType:"link",label:RV_RES.IDS_JS_SHOW_REPORT_SPEC,eventHandler:this,onClickAction:dojo.hitch(this,this.onClickViewReportSpecification)}]};
- }else{
- return {};
- }
- },isBlackListedOption:function(_10ab){
- return this.iWidget.getViewerObject().isBlacklisted(_10ab);
- },createFlashChartOption:function(){
- var _10ac=[{columns:[{propertyName:"flashCharts",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_FLASHCHARTS}]},{columns:[{uiElementType:"hSpacer"}]}];
- return _10ac;
- },getShowExpandCollapseIconOptionSpec:function(){
- var spec=[{columns:[{propertyName:"showExpandCollapseIcon",uiElementType:"checkBox",label:RV_RES.IDS_JS_PROPERTY_SHOW_EXPAND_COLLAPSE_ICON}]},{columns:[{uiElementType:"hspacer"}]}];
- return spec;
- },generateDialogSpec:function(role){
- var _10af;
- if(role=="consume"){
- _10af=[{columns:[{propertyName:"rowsPerPage",uiElementType:"textBox",type:"number",label:RV_RES.IDS_JS_PROPERTY_ROWS_PER_PAGE}]}];
- this.masterDialogSpec={rows:_10af};
- }else{
- var _10b0=this.createViewReportSpecLink();
- _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}]}];
- if(this.isFlashChartOptionEnabled&&!this.hasAVSChart()&&role!=="consume"){
- var _10b1=this.createFlashChartOption();
- _10af=_10b1.concat(_10af);
- }
- if(!this.bHideExpandCollapseOption&&!this.isBlackListedOption("ExpandMember")){
- _10af=this.getShowExpandCollapseIconOptionSpec().concat(_10af);
- }
- this.masterDialogSpec={rows:_10af};
- }
- if(this.masterDialogSpec&&this.masterDialogSpec.rows){
- this.masterDialogSpecProperties={};
- for(var r in this.masterDialogSpec.rows){
- var row=this.masterDialogSpec.rows[r];
- if(row.columns){
- for(var c in row.columns){
- var col=row.columns[c];
- if(col.propertyName){
- this.masterDialogSpecProperties[col.propertyName]=col;
- }
- }
- }
- }
- }
- },updateDialogSpec:function(){
- if(this.masterDialogSpecProperties){
- if(this.masterDialogSpecProperties.originalReportLocation){
- this.masterDialogSpecProperties.originalReportLocation.label=this.getOriginalReportLocation(this.iWidget);
- }
- }
- },initializeDialogSpec:function(){
- var _10b6=this.iWidget.getUserRole();
- this.generateDialogSpec(_10b6);
- },hasAVSChart:function(){
- if(this.iWidget==null||typeof this.iWidget.getViewerObject()=="undefined"){
- return false;
- }
- var oCV=this.iWidget.getViewerObject();
- if(typeof oCV=="undefined"){
- return false;
- }
- return oCV.hasAVSChart();
- },initializeFlashChartSettings:function(value){
- if(!value){
- return;
- }
- var json=(typeof value==="string")?(eval(value)):value;
- var _10ba=json[0];
- this.setProperty("flashCharts",_10ba.defaultValue);
- this.isFlashChartOptionEnabled=!_10ba.isOptionDisabled;
- },onClickViewReportSpecification:function(){
- var _10bb=this.iWidget.getViewerObject().envParams["ui.spec"];
- this._viewSpecInWindow(_10bb);
- },_getWindowOptions:function(w,h){
- var _10be="resizable=yes,scrollbars=yes,menubar=no,directories=no,location=no,status=no,toolbar=no,titlebar=no";
- var left=(screen.width-w)/2;
- var top=(screen.height-h)/2;
- _10be+=",top="+top;
- _10be+=",left="+left;
- _10be+=",width="+w;
- _10be+=",height="+h;
- return _10be;
- },_viewSpecInWindow:function(_10c1){
- var _10c2=dijit.getViewport();
- var _10c3="debugWindow"+this.iWidget.getViewerObject().getId();
- var _10c4=this._getWindowOptions(_10c2.w,_10c2.h);
- var _10c5=window.open("",_10c3,_10c4);
- 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:";
- head+=_10c2.h*0.95;
- head+="px;\">";
- var tail="</textarea></td></tr></tbody></table></body></html>";
- _10c5.document.write(head+html_encode(_10c1)+tail);
- }});
- dojo.require("bux.reportViewer.Properties");
- dojo.provide("ActiveReportIWidgetProperties");
- dojo.declare("ActiveReportIWidgetProperties",[bux.reportViewer.Properties],{initializeDialogDisplayValues:function(){
- this.dialogDisplayValues={activeReportState:{value:null,canUndo:false,runReport:false}};
- },getActiveReportState:function(){
- return this.getProperty("activeReportState");
- },setActiveReportState:function(_10c8){
- this.setProperty("activeReportState",_10c8);
- },initialize:function(_10c9){
- if(this.isInitialized){
- return;
- }
- this.isInitialized=true;
- this.initializeDialogSpec();
- },initializeDialogSpec:function(){
- 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}]}];
- if(this.iWidget.isDebugMode()){
- _10ca.push({columns:[{propertyName:"PublicVariables",uiElementType:"text",label:this._getPublicVariableNames(this.iWidget),allowWrapping:true}]});
- }
- this.masterDialogSpec={rows:_10ca};
- },_getAcitveReportOutputVersion:function(_10cb){
- var _10cc=_10cb.getActiveReportOutputVersion();
- if(_10cc==null){
- _10cc=RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION_UNAVAILABLE;
- }
- return (RV_RES.IDS_JS_PROPERTY_ACTIVEREPORT_OUTPUT_VERSION+" "+_10cc);
- },_getPublicVariableNames:function(_10cd){
- var _10ce=_10cd.getPublicVariableNames();
- var _10cf="";
- for(var name in _10ce){
- var sType=_10ce[name];
- if(_10cf.length>0){
- _10cf+=", ";
- }
- _10cf+=name;
- _10cf+=(sType==="D")?" (Discrete)":"(Range)";
- }
- if(_10cf.length>0){
- _10cf="Public Variables: "+_10cf;
- }
- return _10cf;
- },_getReportWidgetTabTitle:function(){
- var _10d2;
- if(this.iWidget&&this.iWidget.getViewerObject()){
- _10d2=RV_RES.IDS_ACTIVE_REPORT_WIDGET_PROPERTY_TAB_TITLE;
- }
- return _10d2;
- }});
- function RAPReportInfo(_10d3,oCV){
- this.m_reportInfoJSON=_10d3;
- this.m_containerInfoJSON={};
- this.m_iContainerCount=0;
- this.m_bPromptPart=null;
- this.m_bSingleContainer=null;
- this.m_bDetailFilteringDisabled=null;
- this.m_aDrilledOnHUNs=null;
- this.m_bPassTrackingToBUA=null;
- this.m_sDisplayTypes=null;
- this.m_bContainsInteractiveDataContainer=null;
- this.m_bContainsFilters=false;
- this.m_bContainsSlider=false;
- this.m_referenceInfoObject={};
- this.initializeContainerInfo();
- this._addNonVisibleReferences(this.m_reportInfoJSON.reportLevelProperties);
- this._populateHun(oCV);
- };
- RAPReportInfo.prototype.initializeContainerInfo=function(){
- if(this.m_reportInfoJSON){
- var _10d5=this.m_reportInfoJSON.containers;
- if(_10d5){
- this.m_iContainerCount=_10d5.length;
- for(var _10d6=0;_10d6<this.m_iContainerCount;++_10d6){
- var _10d7=_10d5[_10d6].container;
- this.m_containerInfoJSON[_10d7]=_10d5[_10d6];
- this.m_containerInfoJSON[_10d7].m_itemInfoJSON=this._initializeItemInfo(_10d5[_10d6].itemInfo);
- this.m_containerInfoJSON[_10d7].m_drillabilityJSON=this._initializeDrillability(_10d5[_10d6].drillability);
- this._addFilterReferences(_10d5[_10d6].filter);
- this._addSliderReferences(_10d5[_10d6].sliders);
- this.m_containerInfoJSON[_10d7].layoutIndex=_10d6;
- if(_10d5[_10d6].filter){
- this.m_bContainsFilters=true;
- }
- if(_10d5[_10d6].sliders){
- this.m_bContainsSlider=true;
- }
- }
- }
- }
- };
- RAPReportInfo.prototype._initializeItemInfo=function(_10d8){
- var _10d9={};
- for(var idx in _10d8){
- _10d9[_10d8[idx].item]=_10d8[idx];
- this.m_referenceInfoObject[_10d8[idx].item]=true;
- }
- return _10d9;
- };
- RAPReportInfo.prototype._initializeDrillability=function(_10db){
- var _10dc={};
- for(var idx in _10db){
- _10dc[_10db[idx].item]=_10db[idx];
- this.m_referenceInfoObject[_10db[idx].item]=true;
- }
- return _10dc;
- };
- RAPReportInfo.prototype._addFilterReferences=function(_10de){
- for(var idx in _10de){
- this.m_referenceInfoObject[_10de[idx].item]=true;
- if(_10de[idx].type==="contextSlice"&&_10de[idx].hierarchyName){
- this.m_referenceInfoObject[_10de[idx].hierarchyName]=true;
- }
- }
- };
- RAPReportInfo.prototype._addSliderReferences=function(_10e0){
- for(var idx in _10e0){
- this.m_referenceInfoObject[_10e0[idx].name]=true;
- }
- };
- RAPReportInfo.prototype._addNonVisibleReferences=function(_10e2){
- if(_10e2&&_10e2.nonVisibleFiltersMemberItemInfo){
- for(var i=0;i<_10e2.nonVisibleFiltersMemberItemInfo.length;i++){
- this.m_referenceInfoObject[_10e2.nonVisibleFiltersMemberItemInfo[i]]=true;
- }
- }
- };
- RAPReportInfo.prototype.isReferenced=function(item){
- return (this.m_referenceInfoObject[item])?true:false;
- };
- RAPReportInfo.prototype.getDrillability=function(_10e5,_10e6){
- if(!_10e6){
- return this.m_containerInfoJSON[_10e5].m_drillabilityJSON;
- }else{
- return this.m_containerInfoJSON[_10e5].m_drillabilityJSON[_10e6];
- }
- };
- RAPReportInfo.prototype.getContainers=function(){
- return this.m_containerInfoJSON;
- };
- RAPReportInfo.prototype.getContainer=function(lid){
- return this.m_containerInfoJSON[lid];
- };
- RAPReportInfo.prototype.getContainerIds=function(_10e8){
- var _10e9=[];
- for(containerName in this.m_containerInfoJSON){
- var _10ea=this.m_containerInfoJSON[containerName];
- if(_10ea&&_10ea.displayTypeId==_10e8){
- _10e9.push(_10ea.container);
- }
- }
- return _10e9;
- };
- RAPReportInfo.prototype.getContainerFromPos=function(iPos){
- return this.m_reportInfoJSON.containers[iPos];
- };
- RAPReportInfo.prototype.getReportLevelProperties=function(){
- return this.m_reportInfoJSON.reportLevelProperties;
- };
- RAPReportInfo.prototype.getItemInfo=function(_10ec,_10ed){
- if(!_10ed){
- return this.m_containerInfoJSON[_10ec].m_itemInfoJSON;
- }
- if(this.m_containerInfoJSON[_10ec]){
- return this.m_containerInfoJSON[_10ec].m_itemInfoJSON[_10ed];
- }
- return null;
- };
- RAPReportInfo.prototype.isReportLevel_nonVisibleFilterItem=function(_10ee){
- if(_10ee&&_10ee.length>0){
- var _10ef=this.m_reportInfoJSON.reportLevelProperties;
- if(_10ef){
- if(_10ef&&_10ef.nonVisibleFiltersMemberItemInfo){
- for(var i=0;i<_10ef.nonVisibleFiltersMemberItemInfo.length;i++){
- if(_10ee===_10ef.nonVisibleFiltersMemberItemInfo[i]){
- return true;
- }
- }
- }
- }
- }
- return false;
- };
- RAPReportInfo.prototype.isChildContainer=function(lid){
- return ((this.m_containerInfoJSON[lid]&&this.m_containerInfoJSON[lid].parentContainer)?true:false);
- };
- RAPReportInfo.prototype.getItemDetails=function(_10f2,sHun){
- var obj=null;
- for(var lid in this.m_containerInfoJSON){
- var oItem=this.getItemInfo(lid,_10f2);
- if(oItem&&oItem.hun===sHun){
- obj={};
- obj.item=oItem.item;
- if(oItem.hun){
- obj.hun=oItem.hun;
- }
- obj.lid=lid;
- obj.queryName=oItem.queryName;
- break;
- }
- }
- return (obj)?obj:null;
- };
- RAPReportInfo.prototype.getItemDetailsByHun=function(sHun){
- var _10f8=null;
- for(var lid in this.m_containerInfoJSON){
- var _10fa=this.getItemInfo(lid);
- for(var sName in _10fa){
- var oItem=_10fa[sName];
- if(oItem.hun===sHun){
- _10f8=sName;
- break;
- }
- }
- }
- return (_10f8?this.getItemDetails(_10f8,sHun):null);
- };
- RAPReportInfo.prototype._populateHun=function(oCV){
- if(oCV){
- var _10fe=oCV.getSelectionController().getCCDManager();
- var _10ff=oCV.envParams;
- var _1100=oCV.getRAPReportInfo();
- var _1101=false;
- for(var lid in this.m_containerInfoJSON){
- var _1103=this.m_containerInfoJSON[lid].m_itemInfoJSON;
- for(var _1104 in _1103){
- var oItem=_1103[_1104];
- if(oItem.hun){
- continue;
- }
- var sHun=this.getHUNForItem(oItem,_10fe,lid,_1100);
- if(sHun){
- oItem.hun=sHun;
- _1101=true;
- }
- }
- }
- if(_1101&&typeof JSON!="undefined"&&JSON!=null&&JSON.stringify){
- _10ff["rapReportInfo"]=JSON.stringify(this.m_reportInfoJSON);
- }
- }
- };
- RAPReportInfo.prototype.getHUNForItem=function(oItem,_1108,lid,_110a){
- var sHun=this.getHUNFromCCDManager(_1108,oItem);
- var _110c=null;
- if(!sHun&&_110a){
- _110c=_110a.getItemInfo(lid,oItem.item);
- if(_110c){
- sHun=_110c.hun;
- }
- }
- return sHun;
- };
- RAPReportInfo.prototype.getHUNFromCCDManager=function(_110d,oItem){
- var _110f={};
- var sHUN=null;
- var _1111=this._findQueryMetadataId(_110d,_110f,oItem.queryName);
- if(_1111){
- sHUN=_110d.GetHUNForRDI(oItem.item,_1111);
- }
- return sHUN;
- };
- RAPReportInfo.prototype._findQueryMetadataId=function(_1112,oMap,_1114){
- if(oMap[_1114]){
- return oMap[_1114];
- }
- var ctxId=_1112.GetMetadataIdForQueryName(_1114);
- if(ctxId){
- oMap[_1114]=ctxId;
- return ctxId;
- }
- return null;
- };
- RAPReportInfo.prototype.isPromptPart=function(){
- if(this.m_bPromptPart===null){
- if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.promptWidget===true){
- this.m_bPromptPart=true;
- }else{
- this.m_bPromptPart=false;
- }
- }
- return this.m_bPromptPart;
- };
- RAPReportInfo.prototype.getContainerCount=function(){
- return this.m_iContainerCount;
- };
- RAPReportInfo.prototype.isSingleContainer=function(){
- if(this.m_bSingleContainer===null){
- if(this.m_iContainerCount===1&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.singleContainerReport===true){
- this.m_bSingleContainer=true;
- }else{
- this.m_bSingleContainer=false;
- }
- }
- return this.m_bSingleContainer;
- };
- RAPReportInfo.prototype.isDetailFilteringDisabled=function(){
- if(this.m_bDetailFilteringDisabled===null){
- if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.detailFilteringDisabled===true){
- this.m_bDetailFilteringDisabled=true;
- }else{
- this.m_bDetailFilteringDisabled=false;
- }
- }
- return this.m_bDetailFilteringDisabled;
- };
- RAPReportInfo.prototype.getPassTrackingtoBUA=function(){
- if(this.m_bPassTrackingToBUA===null){
- if(this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.shouldNotPassTrackingtoBUA===true){
- this.m_bPassTrackingToBUA=false;
- }else{
- this.m_bPassTrackingToBUA=true;
- }
- }
- return this.m_bPassTrackingToBUA;
- };
- RAPReportInfo.prototype.getDrilledOnHUNs=function(){
- if(!this.m_aDrilledOnHUNs&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs){
- this.m_aDrilledOnHUNs=this.m_reportInfoJSON.reportLevelProperties.drilledOnHUNs;
- }
- return this.m_aDrilledOnHUNs;
- };
- RAPReportInfo.prototype.getDisplayTypes=function(_1116){
- if(this.m_sDisplayTypes===null||_1116){
- var _1117="";
- var _1118=[];
- for(var lid in this.m_containerInfoJSON){
- if(!_1116||lid!=_1116){
- _1118.push(this.m_containerInfoJSON[lid].displayTypeId);
- }
- }
- _1117=_1118.join(",");
- if(_1117==""&&this.isPromptPart()){
- _1117="promptWidget";
- }
- if(!_1116){
- this.m_sDisplayTypes=_1117;
- }
- return _1117;
- }
- return this.m_sDisplayTypes;
- };
- RAPReportInfo.prototype.isChart=function(lid){
- var id=lid.toLowerCase();
- return id!="mapchart"&&id.match("chart$")=="chart";
- };
- RAPReportInfo.prototype.isViz=function(lid){
- if(this.m_containerInfoJSON[lid]){
- var _111d=this.m_containerInfoJSON[lid].displayTypeId;
- if(_111d){
- return (_111d.toLowerCase()=="viz");
- }
- }
- return false;
- };
- RAPReportInfo.prototype.isInteractiveDataContainer=function(lid){
- var _111f=false;
- if(this.m_containerInfoJSON[lid]){
- var _1120=this.m_containerInfoJSON[lid].displayTypeId;
- if(_1120){
- var id=_1120.toLowerCase();
- _111f=id=="crosstab"||id=="list"||id=="viz"||this.isChart(id);
- }
- }
- return _111f;
- };
- RAPReportInfo.prototype.containsInteractiveDataContainer=function(){
- if(this.m_bContainsInteractiveDataContainer==null){
- this.m_bContainsInteractiveDataContainer=false;
- for(var lid in this.m_containerInfoJSON){
- if(this.isInteractiveDataContainer(lid)){
- this.m_bContainsInteractiveDataContainer=true;
- break;
- }
- }
- }
- return this.m_bContainsInteractiveDataContainer;
- };
- RAPReportInfo.prototype.containsFilters=function(){
- return this.m_bContainsFilters;
- };
- RAPReportInfo.prototype.getFilterObject=function(_1123,_1124){
- for(var lid in this.m_containerInfoJSON){
- var _1126=this.getFilterObjectFromContainer(lid,_1123,_1124);
- if(_1126){
- return _1126;
- }
- }
- return null;
- };
- RAPReportInfo.prototype.getFilterObjectFromContainer=function(lid,_1128,_1129){
- var _112a=this.m_containerInfoJSON[lid];
- if(_112a&&_112a.filter){
- var _112b=_112a.filter.length;
- for(var i=0;i<_112b;++i){
- var _112d=_112a.filter[i];
- if(_1128==_112d.item){
- if(!_1129||(_112d.itemLabel&&_112d.itemLabel.length>0)){
- return _112d;
- }
- }
- }
- }
- return null;
- };
- RAPReportInfo.prototype.hunHasFilterOrSlider=function(_112e){
- if(!_112e){
- return null;
- }
- for(var lid in this.m_containerInfoJSON){
- var _1130=this.m_containerInfoJSON[lid];
- if(_1130&&_1130.filter){
- var _1131=_1130.filter.length;
- for(var i=0;i<_1131;++i){
- var _1133=_1130.filter[i];
- if(_1133.HUN&&_112e.indexOf(_1133.HUN)==0){
- return _1133.item;
- }
- }
- }
- if(_1130&&_1130.sliders){
- var _1131=_1130.sliders.length;
- for(var i=0;i<_1131;++i){
- var _1134=_1130.sliders[i];
- if(_1134.hun&&_112e.indexOf(_1134.hun)==0){
- return _1134.name;
- }
- }
- }
- }
- return null;
- };
- RAPReportInfo.prototype.hasSlider=function(){
- return this.m_bContainsSlider;
- };
- RAPReportInfo.prototype.collectSliderSetFromReportInfo=function(){
- var _1135={};
- for(var lid in this.m_containerInfoJSON){
- var _1137=this.m_containerInfoJSON[lid].sliders;
- if(_1137){
- for(var _1138=0;_1138<_1137.length;++_1138){
- var _1139=_1137[_1138].clientId;
- _1135[_1139]=_1137[_1138];
- }
- }
- }
- return _1135;
- };
- RAPReportInfo.prototype._getEventTimings=function(){
- return (this.m_reportInfoJSON&&this.m_reportInfoJSON.reportLevelProperties&&this.m_reportInfoJSON.reportLevelProperties.eventTimings)?this.m_reportInfoJSON.reportLevelProperties.eventTimings:null;
- };
- RAPReportInfo.prototype.destroy=function(){
- GUtil.destroyProperties(this);
- };
- function DelayedLoadingContext(id){
- this.widgetid=id;
- this.m_promptValues=null;
- };
- DelayedLoadingContext.prototype.setPromptValues=function(_113b){
- if(_113b===null){
- this.m_promptValues=null;
- return;
- }
- if(!this.m_promptValues){
- this.m_promptValues={};
- }
- applyJSONProperties(this.m_promptValues,_113b);
- };
- DelayedLoadingContext.prototype.getPromptValues=function(){
- return this.m_promptValues;
- };
- DelayedLoadingContext.prototype.setForceRunReport=function(_113c){
- this.m_forceRunReport=_113c;
- };
- DelayedLoadingContext.prototype.getForceRunReport=function(){
- return this.m_forceRunReport;
- };
- DelayedLoadingContext.prototype.isEmpty=function(){
- return !(this.m_promptValues||this.m_forceRunReport);
- };
- DelayedLoadingContext.prototype.reset=function(){
- delete (this.m_promptValues);
- this.m_promptValues=null;
- this.m_forceRunReport=false;
- delete (this._cascadingPromptParamsToClear);
- };
- DelayedLoadingContext.prototype.setCascadingPromptParamsToClear=function(_113d){
- this._cascadingPromptParamsToClear=_113d;
- };
- DelayedLoadingContext.prototype.getCascadingPromptParamsToClear=function(){
- return this._cascadingPromptParamsToClear;
- };
- function ViewerLoadManager(_113e){
- this.m_oWidget=_113e;
- this.m_oDelayedLoadingContext=new DelayedLoadingContext();
- this.m_aQueue=[];
- this.m_fOnEmptyCallback=null;
- this.m_bPendingRequest=false;
- this.m_bViewerLoadInitiated=false;
- this.m_bCanRunReports=false;
- };
- ViewerLoadManager.prototype.viewerLoadInitiated=function(){
- this.m_bViewerLoadInitiated=true;
- };
- ViewerLoadManager.prototype.isViewerLoadInitiated=function(){
- return this.m_bViewerLoadInitiated;
- };
- ViewerLoadManager.prototype.canRunReports=function(){
- return this.m_bCanRunReports;
- };
- ViewerLoadManager.prototype.runningReport=function(){
- if(!this.m_bCanRunReports){
- this._queue({fCallback:dojo.hitch(this,function(){
- this.m_bCanRunReports=true;
- return false;
- })});
- }
- };
- ViewerLoadManager.prototype.isViewerReady=function(){
- if(!this.isViewerLoaded()){
- return false;
- }
- if(!this._isEmpty()||this.m_fOnEmptyCallback||this.m_bPendingRequest){
- return false;
- }
- return true;
- };
- ViewerLoadManager.prototype.isViewerLoaded=function(){
- var oCV=this.m_oWidget.getViewerObject();
- if(!oCV){
- return false;
- }
- if(this.m_oWidget.isLiveReport()){
- var _1140=oCV.getStatus();
- return _1140==="complete"||_1140==="prompting"||_1140==="fault";
- }
- return true;
- };
- ViewerLoadManager.prototype.runWhenHasViewer=function(f,_1142){
- if(this.isViewerReady()){
- this._run(f);
- return true;
- }else{
- var _1143={fCallback:f};
- if(_1142){
- _1143.sGroupId=_1142;
- }
- this._queue(_1143);
- if(!this.m_bViewerLoadInitiated){
- this.getDelayedLoadingContext().setForceRunReport(true);
- this.m_oWidget.setRunReportOption(false);
- this.m_oWidget.postReport(null);
- }
- return false;
- }
- };
- ViewerLoadManager.prototype.processQueue=function(){
- this.m_bPendingRequest=false;
- var _1144=false;
- while(!_1144&&!this._isEmpty()){
- var _1145=this.m_aQueue.shift();
- while(_1145.sGroupId&&!this._isEmpty()&&this.m_aQueue[0].sGroupId===_1145.sGroupId){
- _1145=this.m_aQueue.shift();
- }
- _1144=this._run(_1145.fCallback);
- }
- if(this._isEmpty()&&!_1144&&this.m_fOnEmptyCallback){
- var _1146=this.m_fOnEmptyCallback;
- this.m_fOnEmptyCallback=null;
- _1146();
- }
- };
- ViewerLoadManager.prototype._run=function(f){
- var _1148=f.call();
- if(_1148){
- this.m_bPendingRequest=true;
- }
- return _1148;
- };
- ViewerLoadManager.prototype._isEmpty=function(){
- return !this.m_aQueue.length;
- };
- ViewerLoadManager.prototype._queue=function(_1149){
- this.m_aQueue.push(_1149);
- };
- ViewerLoadManager.prototype.setOnEmptyCallback=function(_114a){
- this.m_fOnEmptyCallback=_114a;
- };
- ViewerLoadManager.prototype.getDelayedLoadingContext=function(){
- return this.m_oDelayedLoadingContext;
- };
- function XmlHttpObject(){
- this.m_formFields=new CDictionary();
- this.xmlHttp=XmlHttpObject.createRequestObject();
- this.m_requestIndicator=null;
- this.m_httpCallbacks={};
- this.m_asynch=true;
- this.m_headers=null;
- };
- XmlHttpObject.prototype.setHeaders=function(_114b){
- this.m_headers=_114b;
- };
- XmlHttpObject.prototype.getHeaders=function(){
- return this.m_headers;
- };
- XmlHttpObject.prototype.newRequest=function(){
- var _114c=new XmlHttpObject();
- _114c.init(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
- this.executeHttpCallback("newRequest");
- return _114c;
- };
- XmlHttpObject.prototype.abortHttpRequest=function(){
- if(this.xmlHttp!=null){
- this.xmlHttp.abort();
- this.xmlHttp=null;
- this.executeHttpCallback("cancel");
- this.m_httpCallbacks={};
- }
- };
- XmlHttpObject.prototype.cancel=function(){
- this.abortHttpRequest();
- };
- XmlHttpObject.prototype.executeHttpCallback=function(_114d){
- if(this.m_httpCallbacks&&this.m_httpCallbacks[_114d]){
- var _114e=this.concatResponseArguments(this.m_httpCallbacks.customArguments);
- var _114f=GUtil.generateCallback(this.m_httpCallbacks[_114d].method,_114e,this.m_httpCallbacks[_114d].object);
- _114f();
- return true;
- }
- return false;
- };
- XmlHttpObject.prototype.setCallbacks=function(_1150){
- if(!this.m_httpCallbacks){
- this.m_httpCallbacks={};
- }
- for(callback in _1150){
- this.m_httpCallbacks[callback]=_1150[callback];
- }
- };
- XmlHttpObject.prototype.getCallbacks=function(){
- return this.m_httpCallbacks;
- };
- XmlHttpObject.createRequestObject=function(){
- var _1151=null;
- if(window.XMLHttpRequest){
- _1151=new XMLHttpRequest();
- }else{
- if(window.ActiveXObject){
- _1151=new ActiveXObject("Msxml2.XMLHTTP");
- }else{
- }
- }
- return _1151;
- };
- XmlHttpObject.prototype.waitForXmlHttpResponse=function(){
- var _1152=this.xmlHttp;
- if(_1152&&_1152.readyState===4){
- if(_1152.status===200){
- this.httpSuccess();
- }else{
- this.httpError();
- }
- }else{
- }
- };
- XmlHttpObject.prototype.init=function(_1153,_1154,url,_1156){
- this.m_action=_1153;
- this.m_gateway=_1154;
- this.m_url=url;
- this.m_asynch=_1156;
- };
- XmlHttpObject.prototype.httpSuccess=function(){
- this.executeHttpCallback("postHttpRequest");
- this.executeHttpCallback("entryComplete");
- this.executeHttpCallback("complete");
- this.m_httpCallbacks=null;
- };
- XmlHttpObject.prototype.httpError=function(){
- this.executeHttpCallback("entryFault");
- this.executeHttpCallback("fault");
- this.m_httpCallbacks=null;
- };
- XmlHttpObject.prototype.forceSynchronous=function(){
- this.m_asynch=false;
- };
- XmlHttpObject.prototype.sendRequest=function(){
- this.sendHtmlRequest(this.m_action,this.m_gateway,this.m_url,this.m_asynch);
- };
- XmlHttpObject.prototype.sendHtmlRequest=function(_1157,_1158,url,async){
- var _115b=this.xmlHttp;
- if(_115b){
- _115b.open(_1157,_1158,async);
- if(async){
- _115b.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
- }else{
- _115b.onreadystatechange=GUtil.generateCallback(this.waitForXmlHttpResponse,[],this);
- if(!isIE()){
- _115b.onload=GUtil.generateCallback(this.httpSuccess,[],this);
- _115b.onerror=GUtil.generateCallback(this.httpError,[],this);
- }
- }
- _115b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
- if(this.m_headers){
- for(header in this.m_headers){
- _115b.setRequestHeader(header,this.m_headers[header]);
- }
- }
- this.executeHttpCallback("preHttpRequest");
- var _115c=this.convertFormFieldsToUrl();
- if(url){
- _115c+=url;
- }
- _115b.send(_115c);
- }
- };
- XmlHttpObject.prototype.getResponseXml=function(){
- return (this.xmlHttp)?this.xmlHttp.responseXML:null;
- };
- XmlHttpObject.prototype.getResponseText=function(){
- return (this.xmlHttp)?this.xmlHttp.responseText:"";
- };
- XmlHttpObject.prototype.getResponseHeader=function(item){
- return (this.xmlHttp)?this.xmlHttp.getResponseHeader(item):null;
- };
- XmlHttpObject.prototype.getStatus=function(){
- return this.xmlHttp.status;
- };
- XmlHttpObject.prototype.addFormField=function(name,value){
- this.m_formFields.add(name,value);
- };
- XmlHttpObject.prototype.getFormFields=function(){
- return this.m_formFields;
- };
- XmlHttpObject.prototype.getFormField=function(_1160){
- return this.m_formFields.get(_1160);
- };
- XmlHttpObject.prototype.clearFormFields=function(){
- this.m_formFields=new CDictionary();
- };
- XmlHttpObject.prototype.convertFormFieldsToUrl=function(){
- var url="";
- var _1162=this.m_formFields.keys();
- for(var index=0;index<_1162.length;index++){
- if(index>0){
- url+="&";
- }
- url+=encodeURIComponent(_1162[index])+"="+encodeURIComponent(this.m_formFields.get(_1162[index]));
- }
- return url;
- };
- XmlHttpObject.prototype.concatResponseArguments=function(_1164){
- var _1165=[this];
- if(_1164){
- _1165=_1165.concat(_1164);
- }
- return _1165;
- };
- function AsynchRequest(_1166,_1167){
- AsynchRequest.baseConstructor.call(this);
- this.m_gateway=_1166;
- this.m_webContentRoot=_1167;
- this.m_callbacks={};
- this.m_soapFault=null;
- this.m_faultDialog=null;
- this.m_promptDialog=null;
- this.m_logonDialog=null;
- };
- AsynchRequest.prototype=new XmlHttpObject();
- AsynchRequest.baseConstructor=XmlHttpObject;
- AsynchRequest.prototype.parent=XmlHttpObject.prototype;
- AsynchRequest.prototype.getTracking=function(){
- return "";
- };
- AsynchRequest.prototype.getConversation=function(){
- return "";
- };
- AsynchRequest.prototype.getPrimaryAction=function(){
- return "";
- };
- AsynchRequest.prototype.getActionState=function(){
- return "";
- };
- AsynchRequest.prototype.getAsynchStatus=function(){
- return "";
- };
- AsynchRequest.prototype.getResult=function(){
- return null;
- };
- AsynchRequest.prototype.getSoapFault=function(){
- return this.m_soapFault;
- };
- AsynchRequest.prototype.constructFaultEnvelope=function(){
- return null;
- };
- AsynchRequest.prototype.getPromptHTMLFragment=function(){
- return "";
- };
- AsynchRequest.prototype.isRAPWaitTrue=function(){
- return false;
- };
- AsynchRequest.prototype.getRAPRequestCache=function(){
- return null;
- };
- AsynchRequest.prototype.getMainConversation=function(){
- return null;
- };
- AsynchRequest.prototype.getMainTracking=function(){
- return null;
- };
- AsynchRequest.prototype.construct=function(){
- };
- AsynchRequest.prototype.executeCallback=function(_1168){
- if(this.m_callbacks[_1168]){
- var _1169=this.concatResponseArguments(this.m_callbacks.customArguments);
- var _116a=GUtil.generateCallback(this.m_callbacks[_1168].method,_1169,this.m_callbacks[_1168].object);
- _116a();
- return true;
- }
- return false;
- };
- AsynchRequest.prototype.setCallbacks=function(_116b){
- if(!this.m_callbacks){
- this.m_callbacks={};
- }
- for(callback in _116b){
- this.m_callbacks[callback]=_116b[callback];
- }
- };
- AsynchRequest.prototype.getCallbacks=function(){
- return this.m_callbacks;
- };
- AsynchRequest.prototype.newRequest=function(){
- var _116c=this.construct();
- _116c.setHeaders(this.getHeaders());
- if(this.getFormFields().exists("b_action")){
- _116c.addFormField("b_action",this.getFormField("b_action"));
- }
- if(this.getFormFields().exists("cv.catchLogOnFault")){
- _116c.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
- }
- _116c.setPromptDialog(this.m_promptDialog);
- _116c.setFaultDialog(this.m_faultDialog);
- _116c.setLogonDialog(this.m_logonDialog);
- _116c.m_asynch=this.m_asynch;
- if(this.m_callbacks.newRequest){
- var _116d=GUtil.generateCallback(this.m_callbacks.newRequest.method,[_116c],this.m_callbacks.newRequest.object);
- _116d();
- }
- return _116c;
- };
- AsynchRequest.prototype.success=function(){
- var _116e=this.getAsynchStatus();
- switch(_116e){
- case "stillWorking":
- case "working":
- this.working();
- break;
- case "prompting":
- this.prompting();
- break;
- case "fault":
- case "complete":
- case "conversationComplete":
- this.complete();
- break;
- default:
- this.complete();
- break;
- }
- };
- AsynchRequest.prototype.setFaultDialog=function(_116f){
- if(_116f instanceof IFaultDialog){
- if(typeof console!="undefined"){
- console.log("AsynchRequest.prototype.setFaultDialog is deprecated");
- }
- this.m_faultDialog=_116f;
- }else{
- if(_116f&&typeof console!="undefined"){
- console.log("The parameter faultDialog must be an instance of IFaultDialog");
- }
- }
- };
- AsynchRequest.prototype.setPromptDialog=function(_1170){
- if(_1170 instanceof IPromptDialog){
- if(typeof console!="undefined"){
- console.log("AsynchRequest.prototype.setPromptDialog is deprecated");
- }
- this.m_promptDialog=_1170;
- }else{
- if(_1170&&typeof console!="undefined"){
- console.log("The parameter promptDialog must be an instance of IPromptDialog");
- }
- }
- };
- AsynchRequest.prototype.setLogonDialog=function(_1171){
- if(_1171 instanceof ILogOnDialog){
- if(typeof console!="undefined"){
- console.log("AsynchRequest.prototype.setLogonDialog is deprecated");
- }
- this.m_logonDialog=_1171;
- }else{
- if(_1171&&typeof console!="undefined"){
- console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
- }
- }
- };
- AsynchRequest.prototype.resubmitRequest=function(){
- var _1172=this.newRequest();
- _1172.m_formFields=this.m_formFields;
- _1172.sendRequest();
- return _1172;
- };
- AsynchRequest.prototype.sendRequest=function(){
- var _1173=this;
- var _1174={"complete":{"object":_1173,"method":_1173.successHandler},"fault":{"object":_1173,"method":_1173.errorHandler}};
- this.init("POST",this.m_gateway,"",this.m_asynch);
- this.executeCallback("preHttpRequest");
- this.parent.setCallbacks.call(this,_1174);
- this.parent.sendRequest.call(this);
- };
- AsynchRequest.prototype.errorHandler=function(){
- this.executeCallback("postHttpRequest");
- this.executeCallback("entryFault");
- this.executeCallback("error");
- };
- AsynchRequest.prototype.successHandler=function(){
- this.executeCallback("postHttpRequest");
- if(typeof window["AsynchRequestPromptDialog"]!="undefined"&&window["AsynchRequestPromptDialog"]!=null){
- window["AsynchRequestPromptDialog"].hide();
- window["AsynchRequestPromptDialog"]=null;
- }
- if(this.getResponseHeader("Content-type").indexOf("text/html")!=-1){
- var _1175=this.getResponseText();
- if(_1175.indexOf("<ERROR_CODE>CAM_PASSPORT_ERROR</ERROR_CODE>")!=-1){
- this.passportTimeout();
- }else{
- if((_1175.indexOf("http-equiv=\"refresh\"")!=-1)||(_1175.indexOf("http-equiv='refresh'")!=-1)){
- this.passportTimeout();
- }else{
- this.executeCallback("entryFault");
- if(!this.executeCallback("fault")){
- var _1176=window.open("","","height=400,width=500");
- if(_1176!=null){
- _1176.document.write(_1175);
- }
- }
- }
- }
- }else{
- this.m_soapFault=this.constructFaultEnvelope();
- if(this.m_soapFault!=null){
- var _1177=XMLHelper_FindChildByTagName(this.m_soapFault,"CAM",true);
- if(_1177!=null&&XMLHelper_FindChildByTagName(_1177,"promptInfo",true)){
- this.passportTimeout();
- }else{
- this.fault();
- }
- }else{
- this.success();
- }
- }
- };
- AsynchRequest.prototype.cancel=function(){
- this.parent.cancel.call(this);
- var _1178=this.getFormField("m_tracking");
- if(_1178){
- var _1179=new XmlHttpObject();
- _1179.init("POST",this.m_gateway,"",false);
- if(this.getFormField("cv.outputKey")){
- _1179.addFormField("b_action","cvx.high");
- _1179.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
- _1179.setHeaders(this.getHeaders());
- }else{
- _1179.addFormField("b_action","cognosViewer");
- }
- _1179.addFormField("cv.responseFormat","successfulRequest");
- _1179.addFormField("ui.action","cancel");
- _1179.addFormField("m_tracking",_1178);
- if(this.getFormField("cv.debugDirectory")){
- _1179.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
- }
- _1179.sendRequest();
- this.executeCallback("cancel");
- }
- };
- AsynchRequest.prototype.working=function(){
- this.executeCallback("working");
- var _117a=this.newRequest();
- _117a.addFormField("m_tracking",this.getTracking());
- if(this.getFormField("cv.outputKey")){
- _117a.addFormField("cv.outputKey",this.getFormField("cv.outputKey"));
- _117a.addFormField("b_action","cvx.high");
- }
- if(this.isRAPWaitTrue()){
- _117a.m_formFields=this.m_formFields;
- _117a.addFormField("m_tracking",this.getTracking());
- _117a.addFormField("rapWait","true");
- var _117b=this.getRAPRequestCache();
- if(_117b!==null&&typeof _117b!="undefined"){
- _117a.addFormField("rapRequestCache",_117b);
- }
- var _117c=this.getMainConversation();
- if(_117c){
- _117a.addFormField("mainConversation",_117c);
- }
- var _117d=this.getMainTracking();
- if(_117d){
- _117a.addFormField("mainTracking",_117d);
- }
- }else{
- _117a.addFormField("ui.action","wait");
- _117a.addFormField("ui.primaryAction",this.getPrimaryAction());
- _117a.addFormField("cv.actionState",this.getActionState());
- if(this.getFormField("ui.preserveRapTags")){
- _117a.addFormField("ui.preserveRapTags",this.getFormField("ui.preserveRapTags"));
- }
- if(this.getFormField("ui.backURL")){
- _117a.addFormField("ui.backURL",this.getFormField("ui.backURL"));
- }
- if(this.getFormField("errURL")){
- _117a.addFormField("errURL",this.getFormField("errURL"));
- }
- if(this.getFormField("cv.showFaultPage")){
- _117a.addFormField("cv.showFaultPage",this.getFormField("cv.showFaultPage"));
- }
- if(this.getFormField("cv.catchLogOnFault")){
- _117a.addFormField("cv.catchLogOnFault",this.getFormField("cv.catchLogOnFault"));
- }
- }
- if(this.getFormField("bux")){
- _117a.addFormField("bux",this.getFormField("bux"));
- }
- if(this.getFormField("cv.debugDirectory")){
- _117a.addFormField("cv.debugDirectory",this.getFormField("cv.debugDirectory"));
- }
- _117a.sendRequest();
- };
- AsynchRequest.prototype.prompting=function(){
- this.executeCallback("entryComplete");
- if(!this.executeCallback("prompting")){
- if(this.m_promptDialog!=null){
- this.showPromptPage();
- }else{
- if(typeof console!="undefined"){
- console.log("An unhandled prompt response was returned: %o",this.xmlHttp);
- }
- }
- }
- this.executeCallback("postEntryComplete");
- };
- AsynchRequest.prototype.promptPageOkCallback=function(_117e){
- var _117f=this.newRequest();
- _117f.addFormField("ui.action","forward");
- _117f.addFormField("m_tracking",this.getTracking());
- _117f.addFormField("ui.conversation",this.getConversation());
- _117f.addFormField("ui.primaryAction",this.getPrimaryAction());
- _117f.addFormField("cv.actionState",this.getActionState());
- for(var _1180 in _117e){
- _117f.addFormField(_1180,_117e[_1180]);
- }
- _117f.sendRequest();
- window["AsynchRequestObject"]=null;
- };
- AsynchRequest.prototype.promptPageCancelCallback=function(){
- window["AsynchRequestPromptDialog"].hide();
- this.complete();
- };
- AsynchRequest.prototype.showPromptPage=function(){
- window["AsynchRequestObject"]=this;
- window["AsynchRequestPromptDialog"]=this.m_promptDialog;
- var _1181=this.m_promptDialog.getViewerId()==null?"":"?cv.id="+this.m_promptDialog.getViewerId();
- window["AsynchRequestPromptDialog"].initialize(this.m_webContentRoot+"/rv/showStandalonePrompts.html"+_1181,400,400);
- window["AsynchRequestPromptDialog"].show();
- };
- AsynchRequest.prototype.passportTimeout=function(){
- this.executeCallback("entryFault");
- if(!this.executeCallback("passportTimeout")){
- if(this.m_logonDialog!=null){
- this.m_logonDialog.show(response.getSoapFault());
- }else{
- if(typeof console!="undefined"){
- console.log("An unhandled passport timeout fault was returned: %o",this.getSoapFault());
- }
- }
- }
- };
- AsynchRequest.prototype.fault=function(){
- this.executeCallback("entryFault");
- if(!this.executeCallback("fault")){
- if(this.m_faultDialog!=null){
- this.m_faultDialog.show(this.getSoapFault());
- }else{
- if(typeof console!="undefined"){
- console.log("An unhandled soap fault was returned: %o",this.getSoapFault());
- }
- }
- }
- };
- AsynchRequest.prototype.complete=function(){
- this.executeCallback("entryComplete");
- this.executeCallback("complete");
- this.executeCallback("postEntryComplete");
- };
- AsynchRequest.prototype.getSoapFaultCode=function(){
- var _1182=this.constructFaultEnvelope();
- if(_1182){
- var _1183=XMLHelper_FindChildByTagName(_1182,"faultcode",true);
- if(_1183!=null){
- return XMLHelper_GetText(_1183);
- }
- }
- return null;
- };
- AsynchRequest.prototype.getSoapFaultDetailMessageString=function(){
- var _1184=this.constructFaultEnvelope();
- if(_1184){
- var entry=XMLHelper_FindChildByTagName(_1184,"messageString",true);
- if(entry!=null){
- return XMLHelper_GetText(entry);
- }
- }
- return null;
- };
- function AsynchDATARequest(_1186,_1187){
- AsynchDATARequest.baseConstructor.call(this,_1186,_1187);
- this.m_oResponseState=null;
- this.m_sResponseState=null;
- this.m_endOfStateIdx=-1;
- this.cStatePrefix="<xml><state>";
- this.cStateSuffix="</state></xml>";
- };
- AsynchDATARequest.prototype=new AsynchRequest();
- AsynchDATARequest.baseConstructor=AsynchRequest;
- AsynchDATARequest.prototype.getEndOfStateIdx=function(){
- if(this.m_endOfStateIdx==-1){
- var _1188=this.getResponseText().substring(0,12);
- if(_1188==this.cStatePrefix){
- this.m_endOfStateIdx=this.getResponseText().indexOf(this.cStateSuffix);
- if(this.m_endOfStateIdx!=-1){
- this.m_endOfStateIdx+=this.cStateSuffix.length;
- }
- }
- }
- return this.m_endOfStateIdx;
- };
- AsynchDATARequest.prototype.getResponseStateText=function(){
- if(!this.m_sResponseState){
- this.getResponseState();
- }
- return this.m_sResponseState;
- };
- AsynchDATARequest.prototype.getResponseState=function(){
- if(this.m_oResponseState==null&&this.getEndOfStateIdx()!=-1){
- this.m_sResponseState=this.getResponseText().substring(this.cStatePrefix.length,this.getEndOfStateIdx()-this.cStateSuffix.length);
- if(this.m_sResponseState!=null){
- this.m_sResponseState=xml_decode(this.m_sResponseState);
- this.m_oResponseState=eval("("+this.m_sResponseState+")");
- }
- }
- return this.m_oResponseState;
- };
- AsynchDATARequest.prototype.getAsynchStatus=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().m_sStatus!="undefined"){
- return this.getResponseState().m_sStatus;
- }
- return "unknown";
- };
- AsynchDATARequest.prototype.getTracking=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().m_sTracking!="undefined"){
- return this.getResponseState().m_sTracking;
- }
- return "";
- };
- AsynchDATARequest.prototype.getConversation=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().m_sConversation!="undefined"){
- return this.getResponseState().m_sConversation;
- }
- return "";
- };
- AsynchDATARequest.prototype.getPrimaryAction=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().envParams!="undefined"&&this.getResponseState().envParams["ui.primaryAction"]!="undefined"){
- return this.getResponseState().envParams["ui.primaryAction"];
- }
- return "";
- };
- AsynchDATARequest.prototype.getActionState=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().m_sActionState!="undefined"){
- return this.getResponseState().m_sActionState;
- }
- return "";
- };
- AsynchDATARequest.prototype.getResult=function(){
- if(this.getEndOfStateIdx()!=-1){
- return this.getResponseText().substring(this.getEndOfStateIdx(),this.getResponseText().length);
- }
- return "";
- };
- AsynchDATARequest.prototype.getDebugLogs=function(){
- if(this.getResponseState()!=null&&typeof this.getResponseState().debugLogs!="undefined"){
- return this.getResponseState().debugLogs;
- }
- return "";
- };
- AsynchDATARequest.prototype.getPromptHTMLFragment=function(){
- return this.getResult();
- };
- AsynchDATARequest.prototype.constructFaultEnvelope=function(){
- if(this.m_soapFault==null){
- var state=this.getResponseState();
- if(state!=null){
- if(state.m_sSoapFault){
- var _118a=state.m_sSoapFault;
- this.m_soapFault=XMLBuilderLoadXMLFromString(_118a);
- }
- }
- }
- return this.m_soapFault;
- };
- AsynchDATARequest.prototype.construct=function(){
- var _118b=new AsynchDATARequest(this.m_gateway,this.m_webContentRoot);
- _118b.setCallbacks(this.m_callbacks);
- if(this.getFormFields().exists("cv.responseFormat")){
- _118b.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
- }else{
- _118b.addFormField("cv.responseFormat","data");
- }
- return _118b;
- };
- AsynchDATARequest.prototype.getEnvParam=function(param){
- var _118d=this.getResponseState();
- if(_118d&&typeof _118d.envParams!="undefined"&&typeof _118d.envParams[param]!="undefined"){
- return _118d.envParams[param];
- }
- return null;
- };
- AsynchDATARequest.prototype.isRAPWaitTrue=function(){
- var _118e=this.getEnvParam("rapWait");
- if(_118e!=null){
- return _118e=="true"?true:false;
- }
- return false;
- };
- AsynchDATARequest.prototype.getRAPRequestCache=function(){
- return this.getEnvParam("rapRequestCache");
- };
- AsynchDATARequest.prototype.getMainConversation=function(){
- return this.getEnvParam("mainConversation");
- };
- AsynchDATARequest.prototype.getMainTracking=function(){
- return this.getEnvParam("mainTracking");
- };
- function AsynchJSONRequest(_118f,_1190){
- AsynchJSONRequest.baseConstructor.call(this,_118f,_1190);
- this.m_jsonResponse=null;
- };
- AsynchJSONRequest.prototype=new AsynchRequest();
- AsynchJSONRequest.baseConstructor=AsynchRequest;
- AsynchJSONRequest.prototype.getJSONResponseObject=function(){
- if(this.m_jsonResponse==null){
- if(this.getResponseHeader("Content-type").indexOf("application/json")!=-1){
- var text=this.getResponseText();
- if(text!=null){
- var _1192=this.removeInvalidCharacters(text);
- this.m_jsonResponse=eval("("+_1192+")");
- }
- }
- }
- return this.m_jsonResponse;
- };
- AsynchJSONRequest.prototype.getTracking=function(){
- var _1193=this.getJSONResponseObject();
- if(_1193){
- return _1193.tracking;
- }
- return "";
- };
- AsynchJSONRequest.prototype.getConversation=function(){
- var _1194=this.getJSONResponseObject();
- if(_1194){
- return _1194.conversation;
- }
- return "";
- };
- AsynchJSONRequest.prototype.getAsynchStatus=function(){
- var _1195=this.getJSONResponseObject();
- if(_1195){
- return _1195.status;
- }
- return "unknown";
- };
- AsynchJSONRequest.prototype.getPrimaryAction=function(){
- var _1196=this.getJSONResponseObject();
- if(_1196){
- return _1196.primaryAction;
- }
- return "";
- };
- AsynchJSONRequest.prototype.getActionState=function(){
- var _1197=this.getJSONResponseObject();
- if(_1197){
- return _1197.actionState;
- }
- return "";
- };
- AsynchJSONRequest.prototype.getDebugLogs=function(){
- var _1198=this.getJSONResponseObject();
- if(_1198){
- return _1198.debugLogs;
- }
- return "";
- };
- AsynchJSONRequest.prototype.isRAPWaitTrue=function(){
- var _1199=this.getJSONResponseObject();
- if(_1199){
- return (_1199.rapWait==="true");
- }
- return false;
- };
- AsynchJSONRequest.prototype.getRAPRequestCache=function(){
- var _119a=this.getJSONResponseObject();
- if(_119a){
- var _119b=_119a.rapRequestCache;
- if(_119b!==null&&typeof _119b!="undefined"){
- return _119b;
- }
- }
- return null;
- };
- AsynchJSONRequest.prototype.getMainConversation=function(){
- var _119c=this.getJSONResponseObject();
- if(_119c){
- return _119c.mainConversation;
- }
- return null;
- };
- AsynchJSONRequest.prototype.getMainTracking=function(){
- var _119d=this.getJSONResponseObject();
- if(_119d){
- return _119d.mainTracking;
- }
- return null;
- };
- AsynchJSONRequest.prototype.getResult=function(){
- var _119e=this.getJSONResponseObject();
- if(_119e&&_119e.json){
- var _119f=this.removeInvalidCharacters(_119e.json);
- return eval("("+_119f+")");
- }
- return null;
- };
- AsynchJSONRequest.prototype.removeInvalidCharacters=function(text){
- if(text){
- text=text.replace(/(\n|\r|\t)+/g,"");
- }
- return text;
- };
- AsynchJSONRequest.prototype.getPromptHTMLFragment=function(){
- var _11a1=this.getJSONResponseObject();
- if(_11a1&&_11a1.promptHTMLFragment){
- return _11a1.promptHTMLFragment;
- }
- return "";
- };
- AsynchJSONRequest.prototype.constructFaultEnvelope=function(){
- if(this.m_soapFault==null){
- var _11a2=this.getJSONResponseObject();
- if(_11a2.status=="fault"){
- this.m_soapFault=XMLBuilderLoadXMLFromString(_11a2.fault);
- }
- }
- return this.m_soapFault;
- };
- AsynchJSONRequest.prototype.construct=function(){
- var _11a3=new AsynchJSONRequest(this.m_gateway,this.m_webContentRoot);
- _11a3.setCallbacks(this.m_callbacks);
- if(this.getFormFields().exists("cv.responseFormat")){
- _11a3.addFormField("cv.responseFormat",this.getFormField("cv.responseFormat"));
- }else{
- _11a3.addFormField("cv.responseFormat","asynchJSON");
- }
- return _11a3;
- };
- function IFaultDialog(){
- };
- IFaultDialog.prototype.show=function(){
- if(typeof console!="undefined"){
- console.log("Required method IFaultDialog:show not implemented.");
- }
- };
- IFaultDialog.prototype.handleUnknownHTMLResponse=function(){
- if(typeof console!="undefined"){
- console.log("Required method IFaultDialog:handlerUnknownHTMLResponse not implemented.");
- }
- };
- function ILogOnDialog(){
- };
- ILogOnDialog.prototype.show=function(_11a4){
- if(typeof console!="undefined"){
- console.log("Required method ILogOnDialog:show not implemented.");
- }
- };
- ILogOnDialog.prototype.handleUnknownHTMLResponse=function(_11a5){
- if(typeof console!="undefined"){
- console.log("Required method ILogOnDialog:handleUnknownHTMLResponse not implemented.");
- }
- };
- function IPromptDialog(){
- };
- IPromptDialog.prototype.initialize=function(url,width,_11a8){
- if(typeof console!="undefined"){
- console.log("Required method IModalDialog:initialize not implemented.");
- }
- };
- IPromptDialog.prototype.show=function(){
- if(typeof console!="undefined"){
- console.log("Required method IModalDialog:show not implemented.");
- }
- };
- IPromptDialog.prototype.hide=function(){
- if(typeof console!="undefined"){
- console.log("Required method IModalDialog:hide not implemented.");
- }
- };
- function IRequestHandler(){
- };
- IRequestHandler.prototype.preHttpRequest=function(_11a9){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:preHttpRequest not implemented.");
- }
- };
- IRequestHandler.prototype.postHttpRequest=function(_11aa){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:postHttpRequest not implemented.");
- }
- };
- IRequestHandler.prototype.postComplete=function(_11ab){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:postComplete not implemented.");
- }
- };
- IRequestHandler.prototype.onComplete=function(_11ac){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:onComplete not implemented.");
- }
- };
- IRequestHandler.prototype.onPostEntryComplete=function(_11ad){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:onPostEntryComplete not implemented.");
- }
- };
- IRequestHandler.prototype.onFault=function(_11ae){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:onFault not implemented.");
- }
- };
- IRequestHandler.prototype.onPrompting=function(_11af){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:onPrompting not implemented.");
- }
- };
- IRequestHandler.prototype.onWorking=function(_11b0){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:onWorking not implemented.");
- }
- };
- IRequestHandler.prototype.setWorkingDialog=function(_11b1){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:setWorkingDialog not implemented.");
- }
- };
- IRequestHandler.prototype.setRequestIndicator=function(_11b2){
- if(typeof console!="undefined"){
- console.log("Required method IRequestHandler:setExecutionCursor not implemented.");
- }
- };
- function IRequestIndicator(){
- };
- IRequestIndicator.prototype.show=function(){
- if(typeof console!="undefined"){
- console.log("Required method IRequestIndicator:show not implemented.");
- }
- };
- IRequestIndicator.prototype.hide=function(){
- if(typeof console!="undefined"){
- console.log("Required method IRequestIndicator:hide not implemented.");
- }
- };
- function BaseRequestHandler(oCV){
- if(oCV){
- this.m_oCV=oCV;
- this.m_workingDialog=null;
- this.m_requestIndicator=null;
- this.m_faultDialog=null;
- this.m_logOnDialog=null;
- this.m_promptDialog=null;
- this.m_httpRequestConfig=this.m_oCV.getConfig()&&this.m_oCV.getConfig().getHttpRequestConfig()?this.m_oCV.getConfig().getHttpRequestConfig():null;
- }
- };
- BaseRequestHandler.prototype=new IRequestHandler();
- BaseRequestHandler.prototype.onError=function(_11b4){
- };
- BaseRequestHandler.prototype.onComplete=function(){
- };
- BaseRequestHandler.prototype.onPrompting=function(){
- };
- BaseRequestHandler.prototype.resubmitInSafeMode=function(){
- };
- BaseRequestHandler.prototype.massageHtmlBeforeDisplayed=function(){
- };
- BaseRequestHandler.prototype.onPostEntryComplete=function(){
- this._processDelayedLoadingQueue();
- };
- BaseRequestHandler.prototype.getViewer=function(){
- return this.m_oCV;
- };
- BaseRequestHandler.prototype.setDispatcherEntry=function(_11b5){
- this.m_oDispatcherEntry=_11b5;
- };
- BaseRequestHandler.prototype.getDispatcherEntry=function(){
- return this.m_oDispatcherEntry;
- };
- BaseRequestHandler.prototype.processInitialResponse=function(_11b6){
- this.updateViewerState(_11b6);
- };
- BaseRequestHandler.prototype.setLogOnDialog=function(_11b7){
- if(_11b7==null){
- this.m_logOnDialog=null;
- }else{
- if(_11b7 instanceof ILogOnDialog){
- this.m_logOnDialog=_11b7;
- }else{
- if(_11b7&&typeof console!="undefined"){
- console.log("The parameter logOnDialog must be an instance of ILogOnDialog");
- }
- }
- }
- };
- BaseRequestHandler.prototype.setWorkingDialog=function(_11b8){
- if(_11b8==null){
- this.m_workingDialog=null;
- }else{
- if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getWorkingDialog()){
- this.m_workingDialog=this.m_httpRequestConfig.getWorkingDialog();
- }else{
- if(_11b8 instanceof IRequestIndicator){
- this.m_workingDialog=_11b8;
- }else{
- if(_11b8&&typeof console!="undefined"){
- console.log("The parameter workingDialog must be an instance of IRequestIndicator");
- }
- }
- }
- }
- };
- BaseRequestHandler.prototype.getWorkingDialog=function(){
- return this.m_workingDialog;
- };
- BaseRequestHandler.prototype.setRequestIndicator=function(_11b9){
- if(_11b9==null){
- this.m_requestIndicator=null;
- }else{
- if(this.m_httpRequestConfig&&this.m_httpRequestConfig.getRequestIndicator()){
- this.m_requestIndicator=this.m_httpRequestConfig.getRequestIndicator();
- }else{
- if(_11b9 instanceof IRequestIndicator){
- this.m_requestIndicator=_11b9;
- }else{
- if(_11b9&&typeof console!="undefined"){
- console.log("The parameter requestIndicator must be an instance of IRequestIndicator");
- }
- }
- }
- }
- };
- BaseRequestHandler.prototype.getRequestIndicator=function(){
- return this.m_requestIndicator;
- };
- BaseRequestHandler.prototype.setFaultDialog=function(_11ba){
- if(_11ba==null){
- this.m_faultDialog=null;
- }else{
- if(_11ba instanceof IFaultDialog){
- this.m_faultDialog=_11ba;
- }else{
- if(_11ba&&typeof console!="undefined"){
- console.log("The parameter faultDialog must be an instance of IFaultDialog");
- }
- }
- }
- };
- BaseRequestHandler.prototype.setPromptDialog=function(_11bb){
- if(_11bb==null){
- this.m_promptDialog=null;
- }else{
- if(_11bb instanceof IPromptDialog){
- this.m_promptDialog=_11bb;
- }else{
- if(_11bb&&typeof console!="undefined"){
- console.log("The parameter promptDialog must be an instance of IPromptDialog");
- }
- }
- }
- };
- BaseRequestHandler.prototype.preHttpRequest=function(_11bc){
- if(_11bc&&typeof _11bc.getFormField=="function"){
- if(_11bc.getFormField("ui.action")!="wait"&&_11bc.getFormField("rapWait")!="true"){
- if(this.m_requestIndicator){
- this.m_requestIndicator.show();
- }
- }
- }
- };
- BaseRequestHandler.prototype.postHttpRequest=function(_11bd){
- if(_11bd&&typeof _11bd.getAsynchStatus=="function"){
- var _11be=_11bd.getAsynchStatus();
- if(_11be!="working"&&_11be!="stillWorking"){
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- }
- }else{
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- }
- };
- BaseRequestHandler.prototype.onFault=function(_11bf){
- var oCV=this.getViewer();
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- if(typeof FaultDialog=="undefined"){
- if(typeof console!="undefined"){
- console.log("An unhandled fault was returned: %o",_11bf);
- }
- return;
- }
- if(!this.m_faultDialog){
- this.m_faultDialog=new FaultDialog(this.getViewer());
- }
- if(_11bf&&_11bf.getResponseHeader&&_11bf.getResponseHeader("Content-type").indexOf("text/html")!=-1){
- this.m_faultDialog.handleUnknownHTMLResponse(_11bf.getResponseText());
- }else{
- if(_11bf&&_11bf.getSoapFault){
- this.m_faultDialog.show(_11bf.getSoapFault());
- }else{
- if(oCV.getSoapFault()){
- var _11c1=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
- this.m_faultDialog.show(_11c1);
- oCV.setSoapFault("");
- }else{
- if(typeof console!="undefined"){
- console.log("An unhandled fault was returned: %o",_11bf);
- }
- }
- }
- }
- };
- BaseRequestHandler.prototype.isAuthenticationFault=function(_11c2){
- var oCV=this.getViewer();
- var _11c4=null;
- if(_11c2&&_11c2.getSoapFault){
- _11c4=_11c2.getSoapFault();
- }else{
- if(oCV.getSoapFault()){
- _11c4=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
- }
- }
- if(_11c4!=null){
- var _11c5=XMLHelper_FindChildByTagName(_11c4,"CAM",true);
- return (_11c5!=null&&XMLHelper_FindChildByTagName(_11c5,"promptInfo",true)!=null);
- }
- return false;
- };
- BaseRequestHandler.prototype.onPassportTimeout=function(_11c6){
- var oCV=this.getViewer();
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- if(!this.m_logOnDialog){
- this.m_logOnDialog=new LogOnDialog(this.getViewer());
- }
- if(_11c6&&_11c6.getResponseHeader&&_11c6.getResponseHeader("Content-type").indexOf("text/html")!=-1){
- var _11c8="";
- if(_11c6.getResponseText){
- _11c8=_11c6.getResponseText();
- }
- if((_11c8.indexOf("http-equiv=\"refresh\"")!=-1)||(_11c8.indexOf("http-equiv='refresh'")!=-1)){
- this.m_logOnDialog.show(null);
- }else{
- this.m_logOnDialog.handleUnknownHTMLResponse(_11c8);
- }
- }else{
- if(_11c6&&_11c6.getSoapFault){
- this.m_logOnDialog.show(_11c6.getSoapFault());
- }else{
- if(oCV.getSoapFault()){
- var _11c9=XMLBuilderLoadXMLFromString(oCV.getSoapFault());
- this.m_logOnDialog.show(_11c9);
- oCV.setSoapFault("");
- }else{
- if(typeof console!="undefined"){
- console.log("BaseRequestHandler.prototype.onPassportTimeout: An unhandled authentication fault was returned: %o",_11c6);
- }
- }
- }
- }
- };
- BaseRequestHandler.prototype.onWorking=function(_11ca){
- if(this.m_workingDialog){
- var _11cb=_11ca&&typeof _11ca.getAsynchStatus=="function"&&_11ca.getAsynchStatus()=="stillWorking"?true:false;
- if(!_11cb){
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- this.m_workingDialog.show();
- }
- }
- };
- BaseRequestHandler.prototype.onCancel=function(){
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- var oCV=this.getViewer();
- oCV.gbPromptRequestSubmitted=false;
- this._processDelayedLoadingQueue();
- };
- BaseRequestHandler.prototype._processDelayedLoadingQueue=function(){
- var oCV=this.getViewer();
- if(oCV&&oCV.getViewerWidget()){
- var _11ce=oCV.getViewerWidget();
- if(_11ce.getLoadManager()){
- _11ce.getLoadManager().processQueue();
- }
- }
- };
- BaseRequestHandler.prototype.onPrompting=function(_11cf){
- var oCV=this.getViewer();
- if(this.m_workingDialog){
- this.m_workingDialog.hide();
- }
- if(this.m_requestIndicator){
- this.m_requestIndicator.hide();
- }
- if(!this.m_promptDialog){
- this.m_promptDialog=new PromptDialog(this.getViewer());
- }
- window["AsynchRequestObject"]=_11cf;
- window["AsynchRequestPromptDialog"]=this.m_promptDialog;
- var _11d1="?cv.id="+oCV.getId();
- window["AsynchRequestPromptDialog"].initialize(oCV.getWebContentRoot()+"/rv/showStandalonePrompts.html"+_11d1,400,400);
- window["AsynchRequestPromptDialog"].show();
- };
- BaseRequestHandler.prototype.processDATAReportResponse=function(_11d2){
- var oCV=this.getViewer();
- if(!oCV||oCV.m_destroyed){
- if(console){
- console.warn("Tried to process a data response on an invalid CCognosViewer",oCV);
- }
- return;
- }
- var _11d4=_11d2.getResponseState();
- if(!_11d4){
- this.resubmitInSafeMode();
- }
- if(this.loadReportHTML(_11d2.getResult())===false){
- this.resubmitInSafeMode();
- }
- this.updateViewerState(_11d4);
- };
- BaseRequestHandler.prototype.updateViewerState=function(_11d5){
- var oCV=this.getViewer();
- applyJSONProperties(oCV,_11d5);
- var _11d7=oCV.getStatus();
- if(typeof oCV.envParams["ui.spec"]!="undefined"&&oCV.envParams["ui.spec"].indexOf("<")===0){
- oCV.envParams["ui.spec"]=xml_decode(oCV.envParams["ui.spec"]);
- }
- if(_11d7!="fault"){
- if(oCV.envParams["rapReportInfo"]){
- this._processRapReportInfo(oCV);
- }
- if(typeof _11d5.clientunencodedexecutionparameters!="undefined"){
- var _11d8=document.getElementById("formWarpRequest"+oCV.getId());
- if(_11d8!=null&&typeof _11d8["clientunencodedexecutionparameters"]!="undefined"){
- _11d8["clientunencodedexecutionparameters"].value=_11d5.clientunencodedexecutionparameters;
- }
- if(typeof document.forms["formWarpRequest"]!="undefined"&&typeof document.forms["formWarpRequest"]["clientunencodedexecutionparameters"]!="undefined"){
- document.forms["formWarpRequest"]["clientunencodedexecutionparameters"].value=_11d5.clientunencodedexecutionparameters;
- }
- }
- }else{
- oCV.setTracking("");
- }
- };
- BaseRequestHandler.prototype._processRapReportInfo=function(oCV){
- if(oCV.envParams["rapReportInfo"]){
- var _11da=eval("("+oCV.envParams["rapReportInfo"]+")");
- if(typeof RAPReportInfo!="undefined"){
- var _11db=new RAPReportInfo(_11da,oCV);
- oCV.setRAPReportInfo(_11db);
- }
- }
- };
- BaseRequestHandler.prototype.loadReportHTML=function(_11dc){
- if(!_11dc){
- return true;
- }
- var oCV=this.getViewer();
- if(window.IBM&&window.IBM.perf){
- window.IBM.perf.log("viewer_gotHtml",oCV);
- }
- if(oCV.m_undoStack.length>0){
- oCV.m_undoStack[oCV.m_undoStack.length-1].m_bRefreshPage=true;
- }
- oCV.pageNavigationObserverArray=[];
- oCV.m_flashChartsObjectIds=[];
- var sHTML=_11dc.replace(/<form[^>]*>/gi,"").replace(/<\/form[^>]*>/gi,"");
- oCV.m_sHTML=sHTML;
- oCV.setHasPrompts(false);
- var id=oCV.getId();
- var _11e0=document.getElementById("RVContent"+id);
- var _11e1=document.getElementById("CVReport"+id);
- if(window.gScriptLoader){
- var _11e2=oCV.getViewerWidget()?true:false;
- var _11e3=oCV.getViewerWidget()?document.getElementById("_"+oCV.getViewerWidget().iContext.widgetId+"_cv"):_11e1;
- sHTML=window.gScriptLoader.loadCSS(sHTML,_11e3,_11e2,id);
- }
- if(oCV.sBrowser=="ie"){
- sHTML="<span style='display:none'> </span>"+sHTML;
- }
- _11e1.innerHTML=sHTML;
- this.massageHtmlBeforeDisplayed();
- if(window.gScriptLoader){
- var _11e4=GUtil.generateCallback(oCV.showLoadedContent,[_11e0],oCV);
- oCV.m_resizeReady=false;
- if(!window.gScriptLoader.loadAll(_11e1,_11e4,id,true)){
- if(window.gScriptLoader.containsAjaxWarnings()){
- return false;
- }
- }
- }else{
- _11e0.style.display="block";
- }
- var _11e5=document.querySelectorAll("button");
- var _11e6=_11e5.length;
- for(var k=0;k<_11e6;k++){
- var _11e8=_11e5[k];
- var id=_11e8.id;
- var _11e9=id.match(/reprompt/);
- if(_11e9){
- var _11ea=_11e8.outerHTML;
- var _11eb=_11ea.match(/layoutname="\w+"/);
- if(_11eb!==null){
- var _11ec=_11eb[0];
- var _11ed=/".*"/;
- var _11ee=_11ed.exec(_11ec);
- if(oCV.getCurrentPromptControlFocus()==_11ee){
- _11e8.focus();
- oCV.setCurrentPromptControlFocus(null);
- _11e8=null;
- }
- }else{
- oCV.setCurrentPromptControlFocus(null);
- _11e8=null;
- }
- }
- }
- oCV.updateOutputForA11ySupport();
- this._clearFindState();
- return true;
- };
- BaseRequestHandler.prototype._clearFindState=function(){
- var oCV=this.getViewer();
- var _11f0=oCV.getState()&&oCV.getState().getFindState()?oCV.getState().getFindState():null;
- if(_11f0&&!_11f0.findOnServerInProgress()){
- oCV.getState().clearFindState();
- }
- };
- BaseRequestHandler.prototype.showReport=function(){
- var oCV=this.getViewer();
- var _11f2=document.getElementById("CVReport"+oCV.getId());
- if(_11f2){
- _11f2.style.display="";
- }
- };
- BaseRequestHandler.prototype.postComplete=function(){
- var oCV=this.getViewer();
- if(oCV.shouldWriteNavLinks()){
- oCV.writeNavLinks(oCV.getSecondaryRequests().join(" "));
- }
- if(oCV.getStatus()==="complete"){
- oCV.m_undoStack=[new CognosViewerSession(oCV)];
- }
- };
- BaseRequestHandler.prototype.onAsynchStatusUpdate=function(_11f4){
- if(this.m_httpRequestConfig){
- var _11f5=this.m_httpRequestConfig.getReportStatusCallback(_11f4);
- if(_11f5){
- _11f5();
- }
- }
- };
- BaseRequestHandler.prototype.addCallbackHooks=function(){
- if(!this.m_httpRequestConfig){
- return;
- }
- this._addCallback("complete","onComplete");
- this._addCallback("working","onWorking");
- this._addCallback("prompting","onPrompting");
- };
- BaseRequestHandler.prototype._addCallback=function(_11f6,_11f7){
- var _11f8=_11f6;
- var _11f9=this[_11f7];
- this[_11f7]=function(_11fa){
- _11f9.apply(this,arguments);
- var _11fb=null;
- if(_11fa&&typeof _11fa.getAsynchStatus=="function"){
- _11fb=_11fa.getAsynchStatus();
- }else{
- _11fb=_11f8=="complete"?this.getViewer().getStatus():_11f8;
- }
- if(_11fb=="stillWorking"){
- return;
- }
- var _11fc=this.m_httpRequestConfig.getReportStatusCallback(_11fb);
- if(typeof _11fc=="function"){
- setTimeout(_11fc,10);
- }
- };
- };
- dojo.provide("FaultDialog");
- dojo.declare("FaultDialog",IFaultDialog,{m_soapFault:null,m_errorMessage:null,m_oCV:null,constructor:function(oCV){
- this.m_oCV=oCV;
- },show:function(_11fe){
- this.m_soapFault=_11fe;
- this.m_oCV.m_resizeReady=true;
- this.renderInlineDialog();
- this.m_oCV.getViewerWidget().setErrorDlg(this);
- },handleUnknownHTMLResponse:function(_11ff){
- if(_11ff){
- var _1200=window.open("","","height=400,width=500");
- if(_1200!=null){
- _1200.document.write(_11ff);
- }
- }
- },canRetryRequest:function(){
- var _1201=true;
- var _1202=XMLHelper_FindChildrenByTagName(this.m_soapFault,"allowRetry",true);
- if(_1202.length>0){
- _1201=(XMLHelper_GetText(_1202[0],false)==="true");
- }
- return _1201;
- },isWarningMessage:function(){
- return false;
- },getButtons:function(){
- var _1203=[{label:RV_RES.IDS_JS_OK,action:dojo.hitch(this,this.ok)}];
- if(this.canRetryRequest()){
- _1203.push({label:RV_RES.IDS_JS_RETRY,action:dojo.hitch(this,this.retry)});
- }
- return _1203;
- },renderInlineDialog:function(){
- var _1204={"type":this.isWarningMessage()?"warning":"error","message":this.getErrorMessage(),"buttons":this.getButtons()};
- var _1205=this.getDetails();
- if(_1205&&_1205.length>0){
- _1204.details=_1205;
- }
- this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.notification",null,_1204);
- },setErrorMessage:function(_1206){
- this.m_errorMessage=_1206;
- },getErrorMessage:function(){
- if(this.m_errorMessage==null){
- var _1207=XMLHelper_FindChildrenByTagName(this.m_soapFault,"message",true);
- if(_1207.length>0){
- var _1208=XMLHelper_FindChildByTagName(_1207[0],"messageString",false);
- this.checkAndSetErrorMessage(XMLHelper_GetText(_1208,false));
- }
- }
- return this.m_errorMessage;
- },checkAndSetErrorMessage:function(_1209){
- this.m_detailMessageStartIndex=1;
- if(_1209.indexOf("RSV-BBP-0038")==0){
- _1209=RV_RES.IDS_CONV_CANCELED_ERROR;
- this.m_detailMessageStartIndex=0;
- }
- this.m_errorMessage=_1209;
- },getDetails:function(){
- var _120a="";
- var _120b=XMLHelper_FindChildrenByTagName(this.m_soapFault,"message",true);
- if(_120b.length>0){
- if(typeof this.m_detailMessageStartIndex==="undefined"||this.m_detailMessageStartIndex===null){
- this.m_detailMessageStartIndex=1;
- }
- for(var _120c=this.m_detailMessageStartIndex;_120c<_120b.length;++_120c){
- var _120d=XMLHelper_FindChildByTagName(_120b[_120c],"messageString",false);
- _120a+=XMLHelper_GetText(_120d,false)+"\n";
- }
- }
- return _120a;
- },retry:function(){
- var _120e=this.m_oCV.getRetryDispatcherEntry();
- this.hide();
- if(_120e){
- _120e.retryRequest();
- }else{
- var _120f=this.m_oCV.getViewerWidget().getOriginalFormFields();
- if(_120f&&(_120f.get("b_action")=="cvx"||_120f.get("b_action")=="cvx.high")){
- _120f.add("b_action","cognosViewer");
- }
- this.m_oCV.executeAction("RetryRequest",_120f);
- }
- },ok:function(){
- var _1210=this.m_oCV.getRetryDispatcherEntry();
- this.hide();
- if(_1210){
- _1210.onCloseErrorDlg();
- }
- },hide:function(){
- this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.notification",null,{remove:1});
- this.m_oCV.getViewerWidget().setErrorDlg(null);
- this.m_oCV.setRetryDispatcherEntry(null);
- }});
- function buxErrorPage_toggleErrorDetails(event,cvId,_1213){
- if((event.button==0&&(event.keyCode=="0"||typeof event.keyCode=="undefined"))||event.keyCode=="32"||event.keyCode=="13"){
- var _1214=document.getElementById("buxErrorPageDetailContentOuter"+cvId);
- var _1215=document.getElementById("buxErrorPageDetails"+cvId);
- var _1216=document.getElementById("titlePaneTitle"+cvId);
- var _1217=(_1215.style.display=="none");
- dojo.removeClass(_1214,_1217?"dijitTitlePaneContentOuterClosed":"dijitTitlePaneContentOuterOpen");
- dojo.addClass(_1214,_1217?"dijitTitlePaneContentOuterOpen":"dijitTitlePaneContentOuterClosed");
- dojo.removeClass(_1216,_1217?"dijitClose":"dijitOpen");
- dojo.addClass(_1216,_1217?"dijitOpen":"dijitClose");
- _1215.style.display=_1217?"":"none";
- }
- };
- function ModalFaultDialog(){
- };
- ModalFaultDialog.prototype=new FaultDialog();
- ModalFaultDialog.prototype.show=function(_1218){
- var _1219="";
- var _121a="",_121b="";
- var _121c=XMLHelper_FindChildrenByTagName(_1218,"message",true);
- if(_121c.length>0){
- for(var _121d=1;_121d<_121c.length;++_121d){
- _121b=XMLHelper_FindChildByTagName(_121c[_121d],"messageString",false);
- _1219+=XMLHelper_GetText(_121b,false)+"\n";
- }
- _121b=XMLHelper_FindChildByTagName(_121c[0],"messageString",false);
- _121a=XMLHelper_GetText(_121b,false);
- }
- bux.messageBox(bux.MB_ERROR,_121a,"",_1219);
- };
- dojo.provide("GlobalPromptFaultDialog");
- dojo.require("FaultDialog");
- dojo.declare("GlobalPromptFaultDialog",FaultDialog,{m_sendRequestOnOK:false,setSendRequestOnOK:function(_121e){
- this.m_sendRequestOnOK=_121e;
- },ok:function(){
- this.hide();
- this.m_oCV.getViewerWidget().disableListenToForGlobalPrompt();
- if(this.m_sendRequestOnOK){
- var _121f=this.m_oCV.getRetryDispatcherEntry();
- var _1220=null;
- if(_121f){
- _1220=_121f.getOriginalFormFields();
- }else{
- _1220=this.m_oCV.getViewerWidget().getOriginalFormFields();
- }
- if(_1220&&_1220.exists("widget.globalPromptInfo")){
- _1220.remove("widget.globalPromptInfo");
- }
- this.retry();
- }
- }});
- dojo.provide("FaultMessageDialog");
- dojo.declare("FaultMessageDialog",FaultDialog,{m_oCV:null,m_errorMessage:"",constructor:function(oCV,_1222){
- this.m_errorMessage=_1222;
- },getErrorMessage:function(){
- return this.m_errorMessage;
- },getDetails:function(){
- return "";
- },canRetryRequest:function(){
- return false;
- }});
- dojo.provide("WarningMessageDialog");
- dojo.declare("WarningMessageDialog",FaultMessageDialog,{constructor:function(oCV,_1224){
- },isWarningMessage:function(){
- return true;
- }});
- function LogOnDialog(oCV){
- if(oCV){
- this.m_oCV=oCV;
- }
- };
- LogOnDialog.prototype=new ILogOnDialog();
- LogOnDialog.prototype.getViewer=function(){
- return this.m_oCV;
- };
- LogOnDialog.prototype.handleUnknownHTMLResponse=function(_1226){
- this.show(null);
- };
- LogOnDialog.prototype.show=function(_1227){
- var _1228=this.getPromptInfoNamespacesFromAuthenticationFault(_1227);
- if(window["CVEditContentActionInstance"]){
- window["CVEditContentActionInstance"].transitionFromBUA();
- }
- IWidgetLogonhandler.handleLogon(this.getViewer().getId(),_1228);
- };
- LogOnDialog.prototype.getPromptInfoNamespacesFromAuthenticationFault=function(_1229){
- if(!_1229){
- return null;
- }
- var _122a=XMLHelper_FindChildByTagName(_1229,"CAM",true);
- if(_122a==null){
- return null;
- }
- var _122b=XMLHelper_FindChildByTagName(_122a,"promptInfo",true);
- if(_122b==null){
- return null;
- }
- var _122c=XMLHelper_FindChildByTagName(_122a,"displayObjects",true);
- if(_122c==null){
- return null;
- }
- var items=XMLHelper_FindChildrenByTagName(_122c,"item",true);
- if(items==null||items.length!=1){
- return null;
- }
- var _122e=items[0];
- if(_122e==null){
- return null;
- }
- var _122f=XMLHelper_FindChildByTagName(_122e,"name",true);
- var name=XMLHelper_GetText(_122f,false);
- if(name==="CAMNamespace"){
- var _1231=XMLHelper_FindChildByTagName(_122e,"value",true);
- var value=XMLHelper_GetText(_1231,false);
- if(value!=null){
- return value;
- }
- }
- return null;
- };
- dojo.provide("LogOnHandler");
- dojo.declare("LogOnHandler",null,{constructor:function(){
- this.m_cvIdList=[];
- },handleLogon:function(cvId,_1234){
- this.m_cvIdList.push(cvId);
- if(this.m_cvIdList.length==1){
- dojo["require"]("bux.dialogs.IFrameDialog");
- 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}});
- _1235.startup();
- _1235.show();
- }
- },okHandler:function(){
- for(var index=0;index<this.m_cvIdList.length;++index){
- var cvId=this.m_cvIdList[index];
- var oCV=window["oCV"+cvId];
- if(index===0&&oCV.getViewerWidget){
- oCV.getViewerWidget().fireEvent("com.ibm.bux.widget.action",null,{action:"refreshAfterLogon"});
- }
- if(oCV.getRetryDispatcherEntry()){
- oCV.getRetryDispatcherEntry().retryRequest();
- }else{
- var _1239=oCV.getViewerWidget().getOriginalFormFields();
- if(_1239){
- oCV.executeAction("RetryRequest",_1239);
- }
- }
- }
- this.m_cvIdList=[];
- },cancelHandler:function(){
- for(var index=0;index<this.m_cvIdList.length;++index){
- var cvId=this.m_cvIdList[index];
- var oCV=window["oCV"+cvId];
- if(oCV.getRetryDispatcherEntry()){
- oCV.getRetryDispatcherEntry().onCloseErrorDlg();
- }
- }
- this.m_cvIdList=[];
- }});
- IWidgetLogonhandler=new LogOnHandler();
- function PromptDialog(oCV){
- this.m_oCV=oCV;
- this.m_url="";
- this.m_width=0;
- this.m_height=0;
- this.m_dialogImpl=null;
- };
- PromptDialog.prototype=new IPromptDialog();
- PromptDialog.prototype.initialize=function(url,width,_1240){
- this.m_url=url;
- this.m_width=width;
- this.m_height=_1240;
- };
- PromptDialog.prototype.show=function(){
- this.m_dialogImpl=new bux.dialogs.IFrameDialog();
- this.m_dialogImpl.src=this.m_url;
- this.m_dialogImpl.width=this.m_width;
- this.m_dialogImpl.height=this.m_height;
- this.m_dialogImpl.startup();
- this.m_dialogImpl.show();
- };
- PromptDialog.prototype.hide=function(){
- this.m_dialogImpl.hide();
- this.m_dialogImpl.destroy();
- delete this.m_dialogImpl;
- this.m_dialogImpl=null;
- };
- function RequestHandler(oCV){
- if(oCV){
- RequestHandler.baseConstructor.call(this,oCV);
- this.m_originalFormFields=null;
- this.m_forceRaiseSharePrompt=false;
- }
- };
- RequestHandler.prototype=new BaseRequestHandler();
- RequestHandler.baseConstructor=BaseRequestHandler;
- RequestHandler.prototype.parent=BaseRequestHandler.prototype;
- RequestHandler.prototype.postHttpRequest=function(_1242){
- var oCV=this.getViewer();
- this.parent.postHttpRequest.call(this,_1242);
- };
- RequestHandler.prototype.setForceRaiseSharePrompt=function(bFlag){
- this.m_forceRaiseSharePrompt=bFlag;
- };
- RequestHandler.prototype.preHttpRequest=function(_1245){
- var oCV=this.getViewer();
- var _1247=oCV.getViewerWidget();
- oCV.setCurrentNodeFocus(null);
- if(this.doRaiseSharePromptEvent(_1245)){
- if(oCV.widgetHasPromptParameters()){
- this.setRequestIndicator(new BaseRequestExecutedIndicator(oCV));
- var _1248=this.getListOfCascadingPromptParametersToReset(oCV,_1245);
- oCV.raisePromptEvent(oCV.envParams["reportPrompts"],_1245.getFormFields(),_1248);
- }else{
- if(!(_1247&&_1247.promptParametersRetrieved==true)){
- var _1249=oCV.getAction("GetParameters");
- _1249.isPrimaryPromptWidget=true;
- _1249.execute();
- }
- }
- }
- oCV.resetRaiseSharePromptEventFlag();
- this.parent.preHttpRequest.call(this,_1245);
- };
- RequestHandler.prototype.getListOfChangedPromptParameters=function(oCV,_124b){
- var _124c=oCV.getOldParameters();
- if(!_124c){
- return null;
- }
- var _124d=[];
- for(var _124e in _124c){
- oldParmValueItems=_124c[_124e].m_parmValueItems;
- var _124f=_124b.getFormFields().get("p_"+_124e);
- if(!_124f){
- continue;
- }
- for(var j=0;j<oldParmValueItems.length;++j){
- var _1251=sXmlEncode(oldParmValueItems[j].m_useValue);
- if(_124f.indexOf(_1251)<0){
- _124d.push("p_"+_124e);
- }
- }
- }
- return _124d;
- };
- RequestHandler.prototype.getListOfCascadingPromptParametersToReset=function(oCV,_1253){
- if(!oCV.preProcessControlArray){
- return null;
- }
- var _1254=this.getListOfChangedPromptParameters(oCV,_1253);
- if(!_1254||!_1254.length){
- return null;
- }
- var _1255=[];
- var _1256=oCV.preProcessControlArray.length;
- var _1257=_1254.slice();
- for(var k=0;k<_1256;k++){
- var _1259=(oCV.preProcessControlArray[k]);
- if(!_1259.getCascadeOnParameter){
- return;
- }
- var _125a=_1259.getCascadeOnParameter();
- if(!_125a){
- continue;
- }
- var _125b=_1259.getParameterName();
- var _125c=_125a.getName();
- if(this.contains(_1257,_125c)&&!this.contains(_1257,_125b)){
- _1257.push(_125b);
- _1255.push(_125b);
- }
- }
- return _1255;
- };
- RequestHandler.prototype.contains=function(a,obj){
- var i=a.length;
- while(i--){
- if(a[i]===obj){
- return true;
- }
- }
- return false;
- };
- RequestHandler.prototype.doRaiseSharePromptEvent=function(_1260){
- var oCV=this.getViewer();
- var _1262=false;
- var _1263=_1260.getFormField("ui.action");
- if(((typeof _1263!=="undefined"&&(_1263==="forward"||_1263==="back"))&&oCV.m_raiseSharePromptEvent)||this.m_forceRaiseSharePrompt){
- _1262=true;
- var _1264=null;
- var _1265=false;
- var _1266=0;
- var _1267=_1260.getFormFields();
- var keys=_1267.keys();
- for(_1264 in keys){
- _1264=keys[_1264];
- if(_1264=="_promptControl"&&_1267.get(_1264)=="search"){
- _1262=false;
- break;
- }else{
- if(_1264.indexOf("p_")===0){
- if(_1264.indexOf("p_credential:")===0){
- _1265=true;
- }else{
- _1266+=1;
- }
- }
- }
- }
- if(_1262&&_1265&&_1266===0){
- _1262=false;
- }
- }
- return _1262;
- };
- RequestHandler.prototype.onComplete=function(_1269){
- var oCV=this.getViewer();
- if(oCV&&!oCV.m_destroyed){
- this.parent.onComplete.call(this,_1269);
- this.processDATAReportResponse(_1269);
- this.postComplete();
- }else{
- if(console){
- console.warn("Tried to complete a request on an invalid CCognosViewer",oCV);
- }
- }
- };
- RequestHandler.prototype.onPrompting=function(_126b){
- var oCV=this.getViewer();
- if(oCV&&!oCV.m_destroyed){
- var _126d=oCV.getViewerWidget();
- _126d.hideToolbarAndContextMenu();
- this.onComplete(_126b);
- }else{
- if(console){
- console.warn("Tried to prompt on an invalid CCognosViewer",oCV);
- }
- }
- };
- RequestHandler.prototype.onError=function(_126e){
- var oCV=this.getViewer();
- if(_126e&&oCV){
- var _1270=oCV.getViewerWidget();
- if(typeof console!="undefined"&&console&&console.log){
- console.log("Viewer http error: "+_126e.getResponseText()+" "+_126e.getStatus());
- }
- _1270.fireEvent("com.ibm.bux.widget.action",null,{action:"httpError",responseText:_126e.getResponseText(),status:_126e.getStatus()});
- }
- };
- RequestHandler.prototype.onFault=function(_1271){
- var oCV=this.getViewer();
- var _1273=oCV.getViewerWidget();
- var _1274=oCV.getRetryDispatcherEntry();
- if(_1274&&_1274.getOriginalFormFields()){
- this.m_originalFormFields=_1274.getOriginalFormFields();
- }else{
- this.m_originalFormFields=_1273.getOriginalFormFields();
- }
- if(window["gReportWidgetLoadQueue"]){
- window["gReportWidgetLoadQueue"].widgetDoneLoading(_1273);
- }
- if(this.isGlobalPromptException()){
- this.handleGlobalPromptException();
- }
- if(this.isMissingMemberException(oCV,_1271)){
- this.handleMissingMemberException(oCV);
- }
- if(oCV.envParams&&oCV.envParams["updateToolbar"]==="true"){
- _1273.savedOutputMenuUpdated=false;
- _1273.updateToolbar();
- }
- if(oCV.envParams&&oCV.envParams["ui.action"]==="buxView"){
- _1273.setSavedOutputsCMResponse(null);
- }
- if(typeof _1273.postOnFault=="function"){
- _1273.postOnFault();
- }
- this.parent.onFault.call(this,_1271);
- if(_1274&&_1271&&_1271.getResponseState){
- var _1275=_1271.getResponseState();
- if(_1275){
- this.updateViewerState(_1275);
- }
- this.onPostEntryComplete();
- }
- };
- RequestHandler.prototype.handleGlobalPromptException=function(){
- var oCV=this.getViewer();
- var _1277=new GlobalPromptFaultDialog(oCV);
- oCV.disableRaiseSharePromptEvent();
- if(this.m_originalFormFields&&!this.m_originalFormFields.exists("sharedPromptRequest")){
- _1277.setSendRequestOnOK(true);
- }
- _1277.setErrorMessage(RV_RES.IDS_JS_GLOBAL_PROMPTS_NOT_RESPONDING_WARNING);
- this.setFaultDialog(_1277);
- };
- RequestHandler.prototype.isGlobalPromptException=function(){
- var oCV=this.getViewer();
- if(this.m_originalFormFields){
- if(this.m_originalFormFields.exists("sharedPromptRequest")||(this.m_originalFormFields.get("ui.reportDrop")==="true"&&this.m_originalFormFields.exists("widget.globalPromptInfo"))){
- return true;
- }
- }
- return false;
- };
- RequestHandler.prototype.postComplete=function(){
- var oCV=this.getViewer();
- if(oCV.getStatus()=="complete"&&!oCV.inlineScriptsDoneExecuting){
- var _127a=this;
- setTimeout(function(){
- _127a.postComplete();
- },10);
- return;
- }
- this.parent.postComplete.call(this);
- if(oCV&&oCV.m_destroyed){
- if(console){
- console.warn("Tried to postComplete on an invalid CCognosViewer",oCV);
- }
- return;
- }
- var _127b=oCV.getViewerWidget();
- if(window["gReportWidgetLoadQueue"]){
- window["gReportWidgetLoadQueue"].widgetDoneLoading(_127b);
- }
- this.showReport();
- oCV.getSelectionController().clearSelectionData();
- oCV.addPageAdornments();
- _127b.savedOutputMenuUpdated=false;
- if(oCV.getStatus()!="prompting"){
- _127b.fetchAnnotationData();
- _127b.getUndoRedoQueue().add({"reportUpdated":true});
- }
- _127b.updateToolbar();
- oCV.m_stateSet=true;
- oCV.doneLoading();
- if(typeof _127b.postComplete=="function"){
- _127b.postComplete();
- }
- };
- RequestHandler.prototype.updateViewerState=function(_127c){
- var oCV=this.getViewer();
- if(oCV&&oCV.m_destroyed){
- if(console){
- console.warn("Tried to update state on an invalid CCognosViewer",oCV);
- }
- return;
- }
- this.parent.updateViewerState.call(this,_127c);
- var _127e=oCV.getStatus();
- if(_127e!="fault"){
- if(oCV.envParams["buxToolbarPayload"]){
- oCV.setToolbar(eval(oCV.envParams["buxToolbarPayload"]));
- delete oCV.envParams["buxToolbarPayload"];
- }
- if(oCV.envParams["buxContextMenuPayload"]){
- oCV.setContextMenu(eval(oCV.envParams["buxContextMenuPayload"]));
- delete oCV.envParams["buxContextMenuPayload"];
- }
- if(oCV.envParams.reportPrompts){
- oCV.getViewerWidget().setPromptParametersRetrieved(true);
- }
- if(oCV.envParams.reRunObject){
- var _127f=document.getElementById("formWarpRequest"+oCV.getId());
- if(_127f["reRunObj"]){
- _127f["reRunObj"].value=oCV.envParams.reRunObject;
- }else{
- _127f.appendChild(createHiddenFormField("reRunObj",oCV.envParams.reRunObject));
- }
- }
- }
- };
- RequestHandler.prototype.processInitialResponse=function(_1280){
- var oCV=this.getViewer();
- var _1282=oCV.getViewerWidget();
- if(_1282!=null){
- if(_1282.shouldUseSavedReportInfo()){
- oCV.envParams["rapReportInfo"]=_1282.getAttributeValue("rapReportInfo");
- }
- this.parent.processInitialResponse.call(this,_1280);
- _1282.fireEvent("com.ibm.bux.widget.render.done",null,{noAutoResize:true});
- this.getViewer().renderTabs();
- oCV.getPinFreezeManager().fromJSONString(_1282.getAttributeValue("PinFreezeInfo"));
- var _1283=oCV.getStatus();
- if(_1283!="working"&&_1283!="stillWorking"){
- delete oCV.envParams["cv.outputKey"];
- _1282.setXNodeId(null);
- }
- switch(_1283){
- case "complete":
- _1282.setOriginalFormFields(null);
- this.postComplete();
- break;
- case "working":
- case "stillWorking":
- oCV.getWorkingDialog().show();
- setTimeout(getCognosViewerObjectRefAsString(oCV.getId())+".executeCallback(\"wait\");",10);
- break;
- case "prompting":
- _1282.hideToolbarAndContextMenu();
- break;
- case "fault":
- if(this.isAuthenticationFault()){
- this.onPassportTimeout();
- }else{
- this.onFault();
- }
- }
- this.showReport();
- this.onPostEntryComplete();
- oCV.m_stateSet=true;
- this.onAsynchStatusUpdate(_1283);
- }else{
- var _1284=this;
- setTimeout(function(){
- _1284.processInitialResponse(_1280);
- },100);
- }
- };
- RequestHandler.prototype.onPostEntryComplete=function(){
- var oCV=this.getViewer();
- if(oCV&&oCV.getViewerWidget()){
- var _1286=oCV.getViewerWidget();
- _1286.getLoadManager().processQueue();
- }
- };
- RequestHandler.prototype.isMissingMemberException=function(oCV,_1288){
- if(oCV.bMissingMemberException){
- return true;
- }
- if(_1288&&_1288.getResponseState){
- var _1289=_1288.getResponseState();
- if(_1289&&_1289.envParams&&_1289.envParams.bMissingMemberException){
- this._populateMissingMemberDetails(oCV,_1289);
- return true;
- }
- }
- return false;
- };
- RequestHandler.prototype._populateMissingMemberDetails=function(oCV,_128b){
- if(!oCV||!_128b||!_128b.envParams){
- return;
- }
- oCV.bCanEditContent=_128b.envParams.bCanEditContent;
- oCV.bHasParameters=_128b.envParams.bHasParameters;
- if(_128b.envParams["ui.spec"]){
- if(oCV.envParams){
- if(!oCV.envParams["ui.spec"]){
- oCV.envParams["ui.spec"]=xml_decode(_128b.envParams["ui.spec"]);
- }
- }
- }
- };
- RequestHandler.prototype.handleMissingMemberException=function(oCV){
- var _128d=null;
- _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;
- var _128e=new MissingMemberFaultDialog(oCV,_128d,oCV.bCanEditContent,oCV.bHasParameters);
- this.setFaultDialog(_128e);
- };
- RequestHandler.prototype.massageHtmlBeforeDisplayed=function(){
- var oCV=this.getViewer();
- if(!oCV){
- return;
- }
- var _1290=oCV.getViewerWidget();
- if(!_1290){
- return;
- }
- _1290.updateDrillThroughLinks();
- };
- function BaseRequestExecutedIndicator(oCV){
- this.m_oCV=oCV;
- if(oCV){
- this.m_oCVId=oCV.getId();
- if(oCV.getViewerWidget()){
- this.m_background=oCV.getViewerWidget().getReportBlocker();
- }
- }
- };
- BaseRequestExecutedIndicator.prototype=new IRequestIndicator();
- BaseRequestExecutedIndicator.prototype.getViewer=function(){
- return this.m_oCV;
- };
- BaseRequestExecutedIndicator.prototype.show=function(){
- this.m_background.setClassNameOverride("report-blocker");
- this.m_background.show();
- };
- BaseRequestExecutedIndicator.prototype.hide=function(){
- if(this.m_background){
- this.m_background.hide();
- }
- };
- function RequestExecutedIndicator(oCV){
- RequestExecutedIndicator.baseConstructor.call(this,oCV);
- };
- RequestExecutedIndicator.prototype=new BaseRequestExecutedIndicator();
- RequestExecutedIndicator.baseConstructor=BaseRequestExecutedIndicator;
- RequestExecutedIndicator.prototype.parent=BaseRequestExecutedIndicator.prototype;
- RequestExecutedIndicator.prototype.show=function(){
- var oCV=this.getViewer();
- var cvid=oCV.getId();
- var _1295=document.getElementById("executionCursor"+cvid);
- var _1296=document.getElementById("formWarpRequest"+cvid);
- if(!_1295&&_1296){
- _1295=document.createElement("span");
- _1295.className="executionCursor";
- _1295.setAttribute("id","executionCursor"+cvid);
- var _1297="<img alt=\"\" src=\""+oCV.getWebContentRoot()+"/rv/images/action_busy_32x32.gif"+"\"/>";
- _1295.innerHTML=_1297;
- _1296.appendChild(_1295);
- }
- this.parent.show.call(this);
- };
- RequestExecutedIndicator.prototype.hide=function(){
- var _1298=document.getElementById("executionCursor"+this.getViewer().getId());
- if(_1298!=null){
- _1298.parentNode.removeChild(_1298);
- }
- this.parent.hide.call(this);
- };
- dojo.provide("WorkingDialog");
- dojo.declare("WorkingDialog",IRequestIndicator,{constructor:function(oCV){
- this.m_oCV=oCV;
- this.m_sNamespace=oCV.getId();
- this.m_sGateway=oCV.getGateway();
- try{
- var _129a=[];
- if(oCV.getAdvancedServerProperty("VIEWER_JS_HIDE_CANCEL_BUTTON")!="true"){
- _129a.push({"class":"icdDialogButton",label:RV_RES.CANCEL,onClick:dojo.hitch(this,this.doCancel)});
- }
- this.m_waitPageDialog=new ViewerIWidgetInlineDialog(this.getCognosViewer(),this.getWaitPageHTML(),_129a,"waitButtonContainer_"+this.getCognosViewer().getId());
- }
- catch(e){
- if(console&&console.log){
- console.log(e);
- }
- }
- },setSimpleWorkingDialogFlag:function(flag){
- },getCognosViewer:function(){
- return this.m_oCV;
- },show:function(){
- this.m_waitPageDialog.show();
- },getWaitPageHTML:function(){
- var id=this.getCognosViewer().getId();
- 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>";
- },hide:function(){
- this.m_waitPageDialog.hide();
- this.m_cancelCallback=null;
- },setCancelCallback:function(_129d){
- this.m_cancelCallback=_129d;
- },doCancel:function(){
- var oCV=this.getCognosViewer();
- if(this.m_cancelCallback){
- this.m_cancelCallback();
- this.m_cancelCallback=null;
- }else{
- var _129f=oCV.cancel();
- if(_129f){
- var _12a0=oCV.getViewerWidget().getUndoRedoQueue();
- if(_12a0){
- _12a0.handleCancel();
- }
- }
- }
- if(oCV.isReportRenderingDone()){
- this.hide();
- }else{
- var _12a1={action:"deleteWidget"};
- oCV.getViewerWidget().iContext.iEvents.fireEvent("com.ibm.bux.widget.action",null,_12a1);
- }
- }});
- dojo.provide("ModalFaultMessageDialog");
- dojo.declare("ModalFaultMessageDialog",IFaultDialog,{m_errorMessage:"",m_errorDetails:"",constructor:function(_12a2,_12a3){
- this.m_errorMessage=_12a2;
- this.m_errorDetails=_12a3;
- },getErrorMessage:function(){
- return this.m_errorMessage;
- },getDetails:function(){
- return this.m_errorDetails;
- },show:function(){
- bux.messageBox(bux.MB_ERROR,this.getErrorMessage(),"",this.getDetails());
- }});
- dojo.provide("MissingMemberFaultDialog");
- dojo.declare("MissingMemberFaultDialog",FaultDialog,{m_oCV:null,m_errorMessage:null,m_bHasBUACapability:false,m_bHasParameters:false,constructor:function(oCV,_12a5,_12a6,_12a7){
- this.m_errorMessage=_12a5;
- this.m_bHasBUACapability=_12a6;
- this.m_bHasParameters=_12a7;
- },getErrorMessage:function(){
- return this.m_errorMessage;
- },canRetryRequest:function(){
- return false;
- },getButtons:function(){
- var _12a8=[];
- if(this.m_bHasBUACapability){
- _12a8.push({label:RV_RES.IDS_JS_EDIT,action:dojo.hitch(this,this.invokeEditContentAction)});
- }
- _12a8.push({label:RV_RES.IDS_JS_CLOSE,action:dojo.hitch(this,this.ok)});
- return _12a8;
- },invokeEditContentAction:function(){
- var _12a9={};
- _12a9.oFaultDialog=this;
- _12a9.bHasParameters=this.m_bHasParameters;
- this.m_oCV.executeAction("EditContent",{"MissingMemberRecoveryMode":_12a9});
- }});
- function ViewerDispatcher(){
- this.m_activeRequest=null;
- this.m_requestQueue=[];
- this.m_bUsePageRequest=false;
- };
- ViewerDispatcher.prototype.getActiveRequest=function(){
- return this.m_activeRequest;
- };
- ViewerDispatcher.prototype.setUsePageRequest=function(_12aa){
- this.m_bUsePageRequest=_12aa;
- };
- ViewerDispatcher.prototype.getUsePageRequest=function(){
- return this.m_bUsePageRequest;
- };
- ViewerDispatcher.prototype.dispatchRequest=function(_12ab){
- if(this.m_activeRequest==null){
- this.startRequest(_12ab);
- }else{
- if(_12ab.canBeQueued()==true){
- this.m_requestQueue.push(_12ab);
- }else{
- if(window.cognosViewerDebug&&console&&console.warn){
- console.warn("Warning! Dropped a dispatcher entry!");
- }
- }
- }
- };
- ViewerDispatcher.prototype.startRequest=function(_12ac){
- this.m_activeRequest=_12ac;
- if(_12ac!=null){
- _12ac.setUsePageRequest(this.m_bUsePageRequest);
- _12ac.sendRequest();
- }
- };
- ViewerDispatcher.prototype.cancelRequest=function(key){
- for(var i=0;i<this.m_requestQueue.length;i++){
- var _12af=this.m_requestQueue[i];
- if(_12af.getKey()===key){
- _12af.setCallbacks({"onEntryComplete":null});
- _12af.cancelRequest(false);
- this.m_requestQueue.splice(i,1);
- i--;
- }
- }
- if(this.m_activeRequest&&this.m_activeRequest.getKey()===key){
- this.m_activeRequest.setCallbacks({"onEntryComplete":null});
- this.m_activeRequest.cancelRequest(false);
- this.requestComplete();
- }
- };
- ViewerDispatcher.prototype.possibleUnloadEvent=function(){
- if(this.m_activeRequest){
- this.m_activeRequest.possibleUnloadEvent();
- }
- };
- ViewerDispatcher.prototype.requestComplete=function(_12b0){
- this.startRequest(this.nextRequest());
- };
- ViewerDispatcher.prototype.nextRequest=function(){
- var _12b1=null;
- if(this.m_requestQueue.length>0){
- _12b1=this.m_requestQueue.shift();
- if(_12b1.getKey()!=null){
- while(this.m_requestQueue.length>0&&this.m_requestQueue[0].getKey()==_12b1.getKey()){
- _12b1=this.m_requestQueue.shift();
- }
- }
- }
- return _12b1;
- };
- ViewerDispatcher.prototype.queueIsEmpty=function(){
- return (this.m_requestQueue.length==0);
- };
- function DispatcherEntry(oCV){
- this.m_oCV=oCV;
- this.m_requestKey=null;
- this.m_canBeQueued=false;
- this.m_originalFormFields=null;
- this.m_bUsePageRequest=false;
- if(oCV){
- if(!this.m_request){
- this.m_request=new XmlHttpObject();
- this.m_request.init("POST",this.m_oCV.getGateway(),"",true);
- }
- if(!this.m_requestHandler){
- this.setRequestHandler(new BaseRequestHandler(oCV));
- }
- DispatcherEntry.prototype.setDefaultFormFields.call(this);
- 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}});
- }
- };
- DispatcherEntry.prototype.setHeaders=function(_12b3){
- this.m_request.setHeaders(_12b3);
- };
- DispatcherEntry.prototype.getHeaders=function(){
- return this.m_request.getHeaders();
- };
- DispatcherEntry.prototype.setOriginalFormFields=function(_12b4){
- this.m_originalFormFields=_12b4;
- };
- DispatcherEntry.prototype.getOriginalFormFields=function(){
- return this.m_originalFormFields;
- };
- DispatcherEntry.prototype.setRequestHandler=function(_12b5){
- _12b5.addCallbackHooks();
- this.m_requestHandler=_12b5;
- };
- DispatcherEntry.prototype.getRequestHandler=function(){
- return this.m_requestHandler;
- };
- DispatcherEntry.prototype.setWorkingDialog=function(_12b6){
- if(this.getRequestHandler()){
- this.m_requestHandler.setWorkingDialog(_12b6);
- }
- };
- DispatcherEntry.prototype.setRequestIndicator=function(_12b7){
- if(this.getRequestHandler()){
- this.getRequestHandler().setRequestIndicator(_12b7);
- }
- };
- DispatcherEntry.prototype.forceSynchronous=function(){
- this.getRequest().forceSynchronous();
- };
- DispatcherEntry.prototype.setUsePageRequest=function(_12b8){
- this.m_bUsePageRequest=_12b8;
- };
- DispatcherEntry.prototype.getUsePageRequest=function(){
- return this.m_bUsePageRequest;
- };
- DispatcherEntry.prototype.setDefaultFormFields=function(){
- var _12b9=this.getViewer().envParams;
- this.addFormField("b_action","cognosViewer");
- this.addFormField("cv.catchLogOnFault","true");
- this.addDefinedNonNullFormField("protectParameters",_12b9["protectParameters"]);
- this.addDefinedNonNullFormField("ui.routingServerGroup",_12b9["ui.routingServerGroup"]);
- this.addDefinedNonNullFormField("cv.debugDirectory",_12b9["cv.debugDirectory"]);
- this.addDefinedNonNullFormField("cv.showFaultPage",_12b9["cv.showFaultPage"]);
- this.addDefinedNonNullFormField("cv.useRAPDrill",_12b9["cv.useRAPDrill"]);
- this.addDefinedNonNullFormField("container",_12b9["container"]);
- this.addNonEmptyStringFormField("cv.objectPermissions",_12b9["cv.objectPermissions"]);
- };
- DispatcherEntry.prototype.getViewer=function(){
- return this.m_oCV;
- };
- DispatcherEntry.prototype.prepareRequest=function(){
- };
- DispatcherEntry.addWidgetInfoToFormFields=function(_12ba,_12bb){
- if(_12ba){
- var _12bc=_12ba.getBUXRTStateInfoMap();
- if(_12bc){
- _12bb.addFormField("cv.buxRTStateInfo",_12bc);
- }
- var _12bd=_12ba.getDisplayName();
- if(_12bd&&_12bd.length>0){
- _12bb.addFormField("displayTitle",_12bd);
- }
- }
- };
- DispatcherEntry.prototype.canBeQueued=function(){
- return this.m_canBeQueued;
- };
- DispatcherEntry.prototype.setCanBeQueued=function(_12be){
- this.m_canBeQueued=_12be;
- };
- DispatcherEntry.prototype.getKey=function(){
- return this.m_requestKey;
- };
- DispatcherEntry.prototype.setKey=function(key){
- this.m_requestKey=key;
- };
- DispatcherEntry.prototype.setRequest=function(_12c0){
- this.m_request=_12c0;
- };
- DispatcherEntry.prototype.getRequest=function(){
- return this.m_request;
- };
- DispatcherEntry.prototype.setCallbacks=function(_12c1){
- this.getRequest().setCallbacks(_12c1);
- };
- DispatcherEntry.prototype.getCallbacks=function(){
- return this.getRequest().getCallbacks();
- };
- DispatcherEntry.prototype.sendRequest=function(){
- this.prepareRequest();
- var _12c2=this.getRequest().getFormFields();
- var _12c3=_12c2.keys();
- if(!this.m_originalFormFields){
- this.m_originalFormFields=new CDictionary();
- for(var index=0;index<_12c3.length;index++){
- this.m_originalFormFields.add(_12c3[index],_12c2.get(_12c3[index]));
- }
- }
- this.getRequest().sendRequest();
- };
- DispatcherEntry.prototype.onNewRequest=function(_12c5){
- this.setRequest(_12c5);
- };
- DispatcherEntry.prototype.retryRequest=function(){
- var oCV=this.getViewer();
- oCV.setRetryDispatcherEntry(null);
- var _12c7=this.getRequest().newRequest();
- _12c7.setHeaders(null);
- this.setRequest(_12c7);
- var _12c8=this.m_originalFormFields.keys();
- for(var index=0;index<_12c8.length;index++){
- var _12ca=_12c8[index];
- var _12cb=this.m_originalFormFields.get(_12ca);
- if(_12ca=="cv.responseFormat"&&_12cb=="iWidget"){
- this.addFormField("cv.responseFormat","data");
- }else{
- if(_12ca=="ui.action"&&_12cb=="wait"){
- this.addFormField("ui.action",this.m_originalFormFields.get("ui.primaryAction"));
- }else{
- if(_12ca!="m_tracking"&&_12ca!="cv.outputKey"){
- this.addFormField(_12ca,_12cb);
- }
- }
- }
- }
- this.addFormField("widget.reloadToolbar","true");
- if(this.m_oCV.getViewerWidget()){
- this.addFormField("cv.buxCurrentUserRole",this.m_oCV.getViewerWidget().getUserRole());
- }
- this.addNonEmptyStringFormField("cv.objectPermissions",oCV.envParams["cv.objectPermissions"]);
- this.addNonEmptyStringFormField("limitedInteractiveMode",oCV.envParams["limitedInteractiveMode"]);
- this.m_oCV.getViewerDispatcher().dispatchRequest(this);
- };
- DispatcherEntry.prototype.abortHttpRequest=function(){
- if(!this.m_bCancelCalled){
- if(this.getRequestHandler()){
- this.getRequestHandler().onCancel();
- }
- this.m_bCancelCalled=true;
- this.getRequest().abortHttpRequest();
- this.onEntryComplete();
- }
- };
- DispatcherEntry.prototype.cancelRequest=function(_12cc){
- if(!this.m_bCancelCalled){
- this.m_bCancelCalled=true;
- if(this.getRequestHandler()){
- this.getRequestHandler().onCancel();
- }
- if(_12cc){
- this.getRequest().forceSynchronous();
- }
- this.getRequest().cancel();
- this.onEntryComplete();
- }
- };
- DispatcherEntry.prototype.getFormFields=function(){
- return this.m_request.getFormFields();
- };
- DispatcherEntry.prototype.getFormField=function(name){
- if(this.m_request){
- return this.m_request.getFormField(name);
- }else{
- return "";
- }
- };
- DispatcherEntry.prototype.clearFormFields=function(){
- this.m_request.clearFormFields();
- };
- DispatcherEntry.prototype.formFieldExists=function(name){
- if(this.m_request){
- return this.m_request.getFormFields().exists(name);
- }
- return false;
- };
- DispatcherEntry.prototype.removeFormField=function(name){
- if(this.formFieldExists(name)){
- this.m_request.getFormFields().remove(name);
- }
- };
- DispatcherEntry.prototype.addFormField=function(name,value){
- this.m_request.addFormField(name,value);
- };
- DispatcherEntry.prototype.addDefinedNonNullFormField=function(name,value){
- if(typeof value!="undefined"&&value!=null){
- this.addFormField(name,value);
- }
- };
- DispatcherEntry.prototype.addDefinedFormField=function(name,value){
- if(typeof value!="undefined"){
- this.addFormField(name,value);
- }
- };
- DispatcherEntry.prototype.addNonNullFormField=function(name,value){
- if(value!=null){
- this.addFormField(name,value);
- }
- };
- DispatcherEntry.prototype.addNonEmptyStringFormField=function(name,value){
- if(typeof value!="undefined"&&value!=null&&value!=""){
- this.addFormField(name,value);
- }
- };
- DispatcherEntry.prototype.onWorking=function(_12da,arg1){
- if(this.getRequestHandler()){
- this.getRequestHandler().onWorking(_12da);
- }
- };
- DispatcherEntry.prototype.onFault=function(_12dc){
- if(this.getRequestHandler()){
- this.getRequestHandler().onFault(_12dc);
- }
- };
- DispatcherEntry.prototype.onError=function(_12dd){
- if(this.m_bCancelCalled){
- return;
- }
- if(this.getRequestHandler()){
- this.getRequestHandler().onError(_12dd);
- }
- };
- DispatcherEntry.prototype.possibleUnloadEvent=function(){
- this.setCallbacks({"error":{}});
- };
- DispatcherEntry.prototype.onPreHttpRequest=function(_12de){
- if(this.getRequestHandler()){
- this.getRequestHandler().preHttpRequest(_12de);
- }
- };
- DispatcherEntry.prototype.onPostHttpRequest=function(_12df){
- if(this.getRequestHandler()){
- this.getRequestHandler().postHttpRequest(_12df);
- }
- };
- DispatcherEntry.prototype.onPassportTimeout=function(_12e0){
- if(this.getRequestHandler()){
- this.getRequestHandler().onPassportTimeout(_12e0);
- }
- };
- DispatcherEntry.prototype.onPrompting=function(_12e1){
- if(this.getRequestHandler()){
- this.getRequestHandler().onPrompting(_12e1);
- }
- };
- DispatcherEntry.prototype.onEntryComplete=function(_12e2){
- if(!this.m_oCV._beingDestroyed){
- this.m_oCV.getViewerDispatcher().requestComplete(this);
- }
- };
- DispatcherEntry.prototype.onEntryFault=function(_12e3){
- this.m_oCV.setFaultDispatcherEntry(this);
- this.m_oCV.resetViewerDispatcher();
- if(!this.m_bCancelCalled){
- this.m_oCV.setRetryDispatcherEntry(this);
- }
- };
- DispatcherEntry.prototype.onCloseErrorDlg=function(){
- var _12e4=this.getCallbacks();
- if(_12e4["closeErrorDlg"]){
- var _12e5=GUtil.generateCallback(_12e4["closeErrorDlg"].method,[],_12e4["closeErrorDlg"].object);
- _12e5();
- }
- };
- DispatcherEntry.prototype.onPostEntryComplete=function(){
- if(this.getRequestHandler()){
- this.getRequestHandler().onPostEntryComplete();
- }
- this.executeCallback("postComplete");
- };
- DispatcherEntry.prototype.executeCallback=function(_12e6){
- var _12e7=this.getCallbacks();
- if(_12e7[_12e6]){
- var _12e8=(_12e7.customArguments)?[this,_12e7.customArguments]:[this];
- var _12e9=GUtil.generateCallback(_12e7[_12e6].method,_12e8,_12e7[_12e6].object);
- _12e9();
- return true;
- }
- return false;
- };
- function DataDispatcherEntry(oCV){
- if(oCV){
- this.setRequest(new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot()));
- }
- DataDispatcherEntry.baseConstructor.call(this,oCV);
- };
- DataDispatcherEntry.prototype=new DispatcherEntry();
- DataDispatcherEntry.baseConstructor=DispatcherEntry;
- function JSONDispatcherEntry(oCV){
- if(oCV){
- this.setRequest(new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot()));
- }
- JSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
- JSONDispatcherEntry.baseConstructor.call(this,oCV);
- };
- JSONDispatcherEntry.prototype=new DispatcherEntry();
- JSONDispatcherEntry.baseConstructor=DispatcherEntry;
- JSONDispatcherEntry.prototype.setDefaultFormFields=function(){
- this.addFormField("cv.responseFormat","JSON");
- };
- function AsynchDataDispatcherEntry(oCV){
- if(oCV){
- var _12ed=new AsynchDATARequest(oCV.getGateway(),oCV.getWebContentRoot());
- this.setRequest(_12ed);
- AsynchDataDispatcherEntry.baseConstructor.call(this,oCV);
- AsynchDataDispatcherEntry.prototype.setDefaultFormFields.call(this);
- }
- };
- AsynchDataDispatcherEntry.prototype=new DispatcherEntry();
- AsynchDataDispatcherEntry.baseConstructor=DispatcherEntry;
- AsynchDataDispatcherEntry.prototype.setDefaultFormFields=function(){
- this.addFormField("cv.responseFormat","data");
- };
- function AsynchJSONDispatcherEntry(oCV){
- if(oCV){
- var _12ef=new AsynchJSONRequest(oCV.getGateway(),oCV.getWebContentRoot());
- this.setRequest(_12ef);
- AsynchJSONDispatcherEntry.baseConstructor.call(this,oCV);
- AsynchJSONDispatcherEntry.prototype.setDefaultFormFields.call(this);
- }
- };
- AsynchJSONDispatcherEntry.prototype=new DispatcherEntry();
- AsynchJSONDispatcherEntry.baseConstructor=DispatcherEntry;
- AsynchJSONDispatcherEntry.prototype.setDefaultFormFields=function(){
- this.addFormField("cv.responseFormat","asynchJSON");
- };
- function ReportDispatcherEntry(oCV){
- ReportDispatcherEntry.baseConstructor.call(this,oCV);
- if(oCV){
- ReportDispatcherEntry.prototype.setDefaultFormFields.call(this);
- this.setRequestHandler(new RequestHandler(oCV));
- this.setWorkingDialog(oCV.getWorkingDialog());
- this.setRequestIndicator(oCV.getRequestIndicator());
- this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onComplete}});
- }
- };
- ReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
- ReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
- ReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
- ReportDispatcherEntry.prototype.prepareRequest=function(){
- var _12f1=this.getFormField("ui.action");
- var _12f2=this.getViewer().getActionState();
- if(_12f2!==""&&(_12f1=="wait"||_12f1=="forward"||_12f1=="back")){
- this.addFormField("cv.actionState",_12f2);
- }
- var _12f3=["nextPage","previousPage","firstPage","lastPage","reportAction","cancel","wait"];
- var _12f4=true;
- for(var i=0;i<_12f3.length;i++){
- if(_12f3[i]==_12f1){
- _12f4=false;
- break;
- }
- }
- if(_12f4){
- this.getViewer().clearTabs();
- }
- if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")&&this.getViewer().getStatus()!="prompting"){
- this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
- }
- };
- ReportDispatcherEntry.prototype.setDefaultFormFields=function(){
- var oCV=this.getViewer();
- var _12f7=oCV.envParams;
- this.addFormField("cv.id",oCV.getId());
- if(_12f7["cv.showFaultPage"]){
- this.addFormField("cv.showFaultPage",_12f7["cv.showFaultPage"]);
- }else{
- this.addFormField("cv.showFaultPage","false");
- }
- this.addDefinedNonNullFormField("ui.object",_12f7["ui.object"]);
- this.addDefinedNonNullFormField("ui.primaryAction",_12f7["ui.primaryAction"]);
- this.addDefinedNonNullFormField("ui.objectClass",_12f7["ui.objectClass"]);
- this.addNonEmptyStringFormField("specificationType",_12f7["specificationType"]);
- this.addNonEmptyStringFormField("cv.promptForDownload",_12f7["cv.promptForDownload"]);
- this.addNonEmptyStringFormField("ui.conversation",oCV.getConversation());
- this.addNonEmptyStringFormField("m_tracking",oCV.getTracking());
- var _12f8=oCV.getExecutionParameters();
- this.addNonEmptyStringFormField("executionParameters",_12f8);
- var sCAF=oCV.getCAFContext();
- this.addDefinedNonNullFormField("ui.cafcontextid",sCAF);
- };
- ReportDispatcherEntry.prototype.onWorking=function(_12fa,arg1){
- var _12fc=_12fa.getResponseState();
- var _12fd=this.getRequestHandler();
- if(_12fd){
- var _12fe=_12fd.getWorkingDialog();
- if(_12fe&&_12fe.setSecondaryRequests&&_12fc.m_aSecRequests){
- _12fe.setSecondaryRequests(_12fc.m_aSecRequests);
- }
- }
- DispatcherEntry.prototype.onWorking.call(this,_12fa,arg1);
- if(_12fd){
- this.getRequestHandler().updateViewerState(_12fc);
- }
- };
- ReportDispatcherEntry.prototype.onComplete=function(_12ff,arg1){
- if(this.getRequestHandler()){
- this.getRequestHandler().onComplete(_12ff);
- }
- };
- function ViewerDispatcherEntry(oCV){
- ViewerDispatcherEntry.baseConstructor.call(this,oCV);
- if(oCV){
- ViewerDispatcherEntry.prototype.setDefaultFormFields.call(this);
- this.setCallbacks({"prompting":{"object":this,"method":this.onPrompting}});
- var _1302=oCV.getViewerWidget();
- if(_1302.m_originalFormFields){
- this.setOriginalFormFields(_1302.m_originalFormFields);
- _1302.m_originalFormFields=null;
- }
- }
- };
- ViewerDispatcherEntry.prototype=new ReportDispatcherEntry();
- ViewerDispatcherEntry.baseConstructor=ReportDispatcherEntry;
- ViewerDispatcherEntry.prototype.parent=ReportDispatcherEntry.prototype;
- ViewerDispatcherEntry.prototype.prepareRequest=function(){
- this.parent.prepareRequest.call(this);
- var _1303=this.getViewer().getViewerWidget();
- if(this.getFormField("widget.reloadToolbar")){
- this.addFormField("cv.buxCurrentUserRole",_1303.getUserRole());
- }
- if(_1303){
- DispatcherEntry.addWidgetInfoToFormFields(_1303,this);
- }
- this.getViewer().inlineScriptsDoneExecuting=false;
- };
- ViewerDispatcherEntry.prototype.setDefaultFormFields=function(){
- var oCV=this.getViewer();
- var _1305=oCV.getViewerWidget();
- var _1306=oCV.envParams;
- this.addFormField("bux","true");
- this.addFormField("cv.showFaultPage","false");
- this.addDefinedNonNullFormField("baseReportModificationTime",_1306["baseReportModificationTime"]);
- this.addDefinedNonNullFormField("originalReport",_1306["originalReport"]);
- this.addDefinedNonNullFormField("ui.reportDrop",_1306["ui.reportDrop"]);
- this.addDefinedNonNullFormField("ui.preserveRapTags",_1306["ui.preserveRapTags"]);
- if(_1305.getProperties()){
- var _1307=_1305.getProperties().getFlashCharts();
- if(_1307!=null){
- this.addDefinedNonNullFormField("savedFlashChartOption",_1307);
- if(_1306.hasAVSChart){
- this.addDefinedNonNullFormField("hasAVSChart",_1306.hasAVSChart);
- }else{
- this.addDefinedNonNullFormField("hasAVSChart",oCV.hasAVSChart());
- }
- }
- }
- var _1308=_1305.getAttributeValue("gateway");
- if(_1308){
- this.addDefinedNonNullFormField("cv.gateway",_1308);
- }
- var _1309=_1305.getAttributeValue("webcontent");
- if(_1309){
- this.addDefinedNonNullFormField("cv.webcontent",_1309);
- }
- if(oCV.envParams["cv.outputKey"]){
- this.addFormField("cv.outputKey",oCV.envParams["cv.outputKey"]);
- this.addFormField("b_action","cvx.high");
- delete oCV.envParams["cv.outputKey"];
- }
- if(_1305.getXNodeId()){
- this.setHeaders({"X-Node-ID":_1305.getXNodeId()});
- _1305.setXNodeId(null);
- }
- };
- ViewerDispatcherEntry.prototype.onPrompting=function(_130a){
- if(this.getRequestHandler()){
- this.getRequestHandler().onPrompting(_130a);
- }
- };
- function Blocker(oCVId){
- this.oCV_Id=oCVId;
- this.m_viewerDiv=dojo.byId("RVContent"+this.oCV_Id);
- this.m_containerDiv=this._findContainerDiv();
- this.initialize();
- };
- Blocker.prototype._findContainerDiv=function(){
- var _130c=null;
- if(!this.m_containerDiv){
- _130c=this.m_viewerDiv;
- while(_130c){
- if(_130c.style&&_130c.style.height&&_130c.style.height.indexOf("px")!=-1){
- return _130c;
- }
- _130c=_130c.parentNode;
- }
- }
- if(typeof console!="undefined"&&console&&console.log){
- console.log("ViewerIWidgetInlineDialog: Could not find the container div for showing the dialog.");
- }
- return this.m_viewerDiv;
- };
- Blocker.prototype.setClassNameOverride=function(_130d){
- if(!_130d){
- return;
- }
- this.m_classNameOverride=_130d;
- this.applyClassNameOverride();
- };
- Blocker.prototype.applyClassNameOverride=function(){
- if(!this.m_classNameOverride||!this.m_background){
- return;
- }
- dojo.removeClass(this.m_background);
- dojo.addClass(this.m_background,this.m_classNameOverride);
- };
- Blocker.prototype.getNode=function(){
- return this.m_background;
- };
- Blocker.prototype.initialize=function(){
- if(!this.m_background){
- this.m_background=dojo.byId("BACKGROUND"+this.oCV_Id);
- if(!this.m_background){
- this.m_background=document.createElement("div");
- this.m_background.id="BACKGROUND"+this.oCV_Id;
- this.m_background.className="report-blocker";
- this.m_background.tabIndex="0";
- dojo.place(this.m_background,this.m_containerDiv,"before");
- }
- }
- };
- Blocker.prototype.show=function(){
- if(this.m_background){
- this.m_background.style.display="block";
- }
- };
- Blocker.prototype.hide=function(){
- if(this.m_background){
- this.m_background.style.display="none";
- }
- };
- Blocker.prototype.destroy=function(){
- if(this.m_background!=null){
- this.m_background.parentNode.removeChild(this.m_background);
- this.m_background=null;
- }
- };
- function ReselectAction(oCV,_130f){
- this.m_aSelectionFilterObjects=_130f;
- this.m_oCV=oCV;
- this.m_oSC=oCV.getSelectionController();
- this.m_cd=this.m_oSC.getCCDManager().m_cd;
- this.m_md=this.m_oSC.getCCDManager().m_md;
- this.m_nReportDiv=oCV.getReportDiv();
- this.m_oRAPReportContainers=oCV.getRAPReportInfo().getContainers();
- };
- ReselectAction.prototype.executeAction=function(){
- this.mapCdMd();
- if(this.show()){
- var oVW=this.m_oCV.getViewerWidget();
- if(oVW){
- var _1311=oVW.m_oWidgetContextManager.genSelectionPayload(this.m_oCV,oVW.getWidgetId());
- oVW.setSelectionFilterSent(true);
- oVW.fireEvent("com.ibm.bux.data.filterCache.init",null,_1311);
- if(oVW.isPastedWidget()&&!oVW.pastedSelectedBroadcasted){
- oVW.pastedSelectedBroadcasted=true;
- oVW.onSelectionChange();
- }
- }
- }
- };
- ReselectAction.prototype.mapCdMd=function(){
- var _1312=this.m_aSelectionFilterObjects;
- for(var i in _1312){
- var _1314=_1312[i];
- var oItem=_1314.selectedItem;
- var aCtx=[];
- var _1317=null;
- var _1318=this._findMdIndex("q",_1314.query);
- _1317=this._setNewCtx(oItem,_1318);
- if(_1317){
- aCtx.push(_1317);
- }else{
- continue;
- }
- for(var j in _1314.context){
- var _131a=_1314.context[j];
- _1317=this._setNewCtx(_131a,_1318);
- if(_1317){
- aCtx.push(_1317);
- }
- }
- _1314.ctxArray=aCtx;
- }
- };
- ReselectAction.prototype._setNewCtx=function(oItem,_131c){
- var _131d=null;
- var ctxId=null;
- if(oItem.isMeasure==="true"){
- _131d=this._findMdIndex(oItem.mdProperty,oItem.mdValue,_131c);
- if(_131d){
- oItem.ctxRef={"property":oItem.mdProperty,"mdIndex":_131d};
- return oItem.ctxRef;
- }
- }else{
- if(oItem.mun){
- _131d=this._findMdIndex("m",oItem.mun,_131c);
- ctxId=this._getContextIdForCdProperty(_131c,"m",_131d);
- }else{
- _131d=this._findMdIndex(oItem.mdProperty,oItem.mdValue,_131c);
- ctxId=this._getContextIdForCdPropertyAndMdProperty(_131c,"u",oItem.use,oItem.mdProperty,_131d);
- }
- if(ctxId){
- oItem.ctxId=ctxId;
- return oItem.ctxId;
- }
- }
- return null;
- };
- ReselectAction.prototype._getContextIdForCdProperty=function(_131f,_1320,_1321){
- var ctxid=null;
- for(var j in this.m_cd){
- if(this.m_cd[j].q==_131f&&this.m_cd[j][_1320]==_1321){
- ctxid=j;
- break;
- }
- }
- return ctxid;
- };
- ReselectAction.prototype._getContextIdForCdPropertyAndMdProperty=function(_1324,_1325,_1326,_1327,_1328){
- var ctxid=null;
- for(var j in this.m_cd){
- if(this.m_cd[j].q==_1324&&this.m_cd[j][_1327]==_1328&&this.m_cd[j][_1325]==_1326){
- ctxid=j;
- break;
- }
- }
- return ctxid;
- };
- ReselectAction.prototype._findMdIndex=function(_132b,value,_132d){
- var _132e=null;
- for(var j in this.m_md){
- if(this.m_md[j][_132b]===value){
- if(this.m_md[j]["q"]&&_132d){
- if(this.m_md[j]["q"]==_132d){
- _132e=j;
- break;
- }
- }else{
- _132e=j;
- break;
- }
- }
- }
- return _132e;
- };
- ReselectAction.prototype.show=function(){
- var _1330=false;
- var oCV=this.m_oCV;
- var oVW=oCV.getViewerWidget();
- var _1333=oCV.getReportDiv();
- var _1334=null;
- var _1335=null;
- var _1336=null;
- oVW.preprocessPageClicked(false);
- if(oVW&&_1333){
- for(var _1337 in this.m_aSelectionFilterObjects){
- var _1338=this.m_aSelectionFilterObjects[_1337];
- var _1339=(_1338.selectedItem.isMeasure==="true");
- var _133a=true;
- if(_1339){
- var _133b=_1338.context;
- for(var idx in _133b){
- if(_133b[idx].isMeasure!=="true"){
- _133a=false;
- break;
- }
- }
- if(_133a){
- continue;
- }
- }
- var aCtx=_1338.ctxArray;
- if(aCtx&&aCtx.length>0){
- _1334=this._getLayoutContainers(_1338.lid);
- var _133e=false;
- for(var _133f=0;!_133e&&_133f<_1334.length;_133f++){
- if(/img|IMG/.test(_1334[_133f].tagName)){
- var _1340=_1334[_133f];
- for(_1336=null;!_1336&&_1340.parentNode;){
- _1340=_1340.parentNode;
- var _1341=_1340.getElementsByTagName("map");
- if(_1341&&_1341.length>0){
- _1336=_1341[0];
- }
- }
- }else{
- _1336=_1334[_133f].parentNode;
- }
- if(_1336){
- var _1342=this._buildCtxQueryRegExp(aCtx);
- _1335=getElementsByAttribute(_1336,"*","ctx",null,-1,_1342);
- var _1343=_1338.selectedItem;
- for(var idx in _1335){
- if(_1335[idx].getAttribute){
- if(_1339&&_1343.isDataValueOrChartElement==="false"&&(_1335[idx].getAttribute("type")==="datavalue"||_1335[idx].getAttribute("type")==="chartElement")){
- continue;
- }
- if(this.isMatchingCell(aCtx,_1335[idx])){
- var _1344=_1335[idx];
- if(_1344.tagName==="SPAN"||_1344.tagName==="span"){
- var _1345=_1344.parentNode.tagName;
- if(_1345=="td"||_1345=="TD"||_1345=="TH"||_1345=="th"){
- if(_1344.parentNode.getAttribute("ctx")==_1344.getAttribute("ctx")){
- continue;
- }
- }
- }
- var evt={"target":_1344,"button":1,"ctrlKey":true};
- this.m_oSC.pageClicked(evt);
- _133e=true;
- _1330=true;
- }
- }
- }
- }
- }
- }
- }
- }
- return _1330;
- };
- ReselectAction.prototype.isMatchingCell=function(aCtx,_1348){
- var _1349=_1348.getAttribute("ctx");
- if(!_1349||_1349.length==0){
- return false;
- }
- var _134a=_1349.replace(/::/g,":").split(":");
- var _134b=0;
- var _134c=null;
- var _134d=0;
- var _134e=null;
- var _134f=0;
- var _1350=false;
- for(;_134b<_134a.length;_134b++){
- if(_134a[_134b].length>0){
- _134c=_134a[_134b++];
- break;
- }
- }
- _134e=aCtx[_134d];
- if(typeof _134e=="string"){
- if(_134e==_134c){
- _134f++;
- }
- }else{
- if(this.m_cd[_134c][_134e.property]==_134e.mdIndex){
- _134f++;
- }
- }
- if(_134f!=1){
- return false;
- }
- if(aCtx.length==1){
- _1350=true;
- }
- for(_134d=1;!_1350&&_134d<aCtx.length;_134d++){
- _134e=aCtx[_134d];
- if(typeof _134e=="string"){
- for(_134b=1;_134b<_134a.length;_134b++){
- if(_134a[_134b].length>0&&_134a[_134b]!="0"){
- _134c=_134a[_134b];
- if(_134e==_134c){
- _134f++;
- _134a[_134b]="0";
- break;
- }
- }
- }
- }else{
- for(_134b=1;_134b<_134a.length;_134b++){
- if(_134a[_134b].length>0&&_134a[_134b]!="0"){
- _134c=_134a[_134b];
- if(this.m_cd[_134c][_134e.property]==_134e.mdIndex){
- _134f++;
- _134a[_134b]="0";
- break;
- }
- }
- }
- }
- if(aCtx.length==_134f){
- _1350=true;
- }
- }
- return _1350;
- };
- ReselectAction.prototype._buildCtxQueryRegExp=function(aCtx){
- var _1352="";
- var _1353=false;
- var i=0;
- if(typeof aCtx[i]=="string"){
- _1352+="^"+aCtx[i];
- }else{
- _1352+="^[\\d:]+";
- }
- i++;
- var _1355="";
- for(;!_1353&&i<aCtx.length;i++){
- if(typeof aCtx[i]=="string"){
- if(_1355.length>0){
- _1355+="+";
- }
- _1355+=aCtx[i];
- _1353=true;
- }else{
- if(i<aCtx.length-1){
- if(_1355.length>0){
- _1355+="+";
- }
- _1355+="[\\d:]";
- }
- }
- }
- if(_1355.length>0){
- _1352+=":{1,}"+_1355;
- }
- return new RegExp(_1352);
- };
- ReselectAction.prototype._getLayoutContainers=function(sLid){
- var _1357="";
- if(this.m_oRAPReportContainers&&this.m_oRAPReportContainers[sLid]){
- _1357=sLid+".+";
- }else{
- for(var name in this.m_oRAPReportContainers){
- if(_1357.length>0){
- _1357+="|";
- }
- _1357+=name+".+";
- }
- }
- return getElementsByAttribute(this.m_nReportDiv,"*","lid",null,-1,new RegExp(_1357));
- };
- function ViewerA11YHelper(oCV){
- this.m_oCV=oCV;
- };
- ViewerA11YHelper.prototype.onFocus=function(evt){
- var _135b=getCrossBrowserNode(evt);
- _135b=ViewerA11YHelper.findChildOfTableCell(_135b);
- this.updateCellAccessibility(_135b,false);
- };
- ViewerA11YHelper.prototype.onKeyDown=function(evt){
- evt=(evt)?evt:((event)?event:null);
- var _135d=getCrossBrowserNode(evt);
- if(ViewerA11YHelper.isTableCell(_135d)){
- for(var i=0;i<_135d.childNodes.length;i++){
- if(_135d.childNodes[i].nodeName.toLowerCase()=="span"){
- _135d=_135d.childNodes[i];
- break;
- }
- }
- }
- if(!this.isValidNodeToSelect(_135d)){
- return true;
- }
- _135d=ViewerA11YHelper.findChildOfTableCell(_135d);
- if(_135d){
- if(evt.keyCode=="39"){
- if(this.m_oCV.getState()&&this.m_oCV.getState().getFindState()&&evt.ctrlKey&&evt.shiftKey){
- this.m_oCV.executeAction("FindNext");
- }else{
- this.moveRight(_135d);
- }
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="37"){
- this.moveLeft(_135d);
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="38"){
- this.moveUp(_135d);
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="40"){
- this.moveDown(_135d);
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="13"){
- if(this.m_oCV.isBux){
- if(this.m_oCV.getViewerWidget().isSelectionFilterEnabled()){
- this.m_oCV.getViewerWidget().preprocessPageClicked(false,evt);
- if(this.m_oCV.getSelectionController().pageClicked(evt)!==false){
- this.m_oCV.JAWSTalk(RV_RES.IDS_JS_SELECTION_FILTER_INFO_JAWS);
- this.m_oCV.getViewerWidget().updateToolbar();
- }
- }else{
- this.m_oCV.getSelectionController().pageClicked(evt);
- var _135f=this.m_oCV.getActionFactory().load("Selection");
- _135f.onKeyDown(evt);
- }
- this.m_oCV.getViewerWidget().onSelectionChange();
- }else{
- this.m_oCV.de(evt);
- }
- }else{
- if(evt.keyCode=="32"){
- if(this.m_oCV.isBux){
- this.m_oCV.getViewerWidget().preprocessPageClicked(false);
- if(this.m_oCV.getSelectionController().pageClicked(evt)!==false&&this.m_oCV.getViewerWidget().isSelectionFilterEnabled()){
- this.m_oCV.JAWSTalk(RV_RES.IDS_JS_SELECTION_FILTER_INFO_JAWS);
- }
- this.m_oCV.getViewerWidget().updateToolbar();
- this.m_oCV.getViewerWidget().onSelectionChange();
- }else{
- this.m_oCV.getSelectionController().pageClicked(evt);
- }
- return stopEventBubble(evt);
- }else{
- if(evt.keyCode=="46"&&this.m_oCV.isBux){
- 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()){
- var _1360=this.m_oCV.getActionFactory().load("Delete");
- if(!this.m_oCV.isBlacklisted("Delete")&&_1360.canDelete()){
- _1360.execute();
- return stopEventBubble(evt);
- }
- }
- }else{
- if(this.m_oCV.isBux&&evt.ctrlKey==true&&evt.shiftKey==true&&evt.keyCode=="49"){
- var lid=this.m_oCV.getSelectionController().getSelectionObjectFactory().getLayoutElementId(_135d);
- if(lid!=""){
- lid=lid.split(this.m_oCV.getId())[0];
- var _1362=-1;
- var _1363=this.m_oCV.getRAPReportInfo();
- if(_1363){
- var _1364=_1363.getContainer(lid);
- if(typeof _1364.layoutIndex!="undefined"){
- _1362=_1364.layoutIndex;
- }
- }
- var _1365=document.getElementById("infoBarHeaderButton"+_1362+this.m_oCV.getId());
- if(_1365!==null){
- this.m_oCV.setCurrentNodeFocus(getCrossBrowserNode(evt));
- _1365.focus();
- }
- }
- return stopEventBubble(evt);
- }else{
- if(!this.m_oCV.isBux&&evt.shiftKey==true&&evt.keyCode=="121"){
- var ocv=this.m_oCV;
- var _1367=function(){
- if(typeof evt.clientX=="undefined"||typeof evt.clientY=="undefined"){
- var _1368=clientToScreenCoords(evt.target,document.body);
- evt.clientX=_1368.leftCoord;
- evt.clientY=_1368.topCoord;
- }
- ocv.dcm(evt,true);
- };
- if(isFF()){
- setTimeout(_1367,0);
- }else{
- _1367.call();
- }
- return stopEventBubble(evt);
- }else{
- if(this.m_oCV.isBux&&(evt.keyCode=="93"||(evt.shiftKey==true&&evt.keyCode=="121"))){
- var _1369=this.m_oCV.getViewerWidget();
- var _136a=this.m_oCV.getSelectionController();
- _1369.preprocessPageClicked(true);
- _136a.pageClicked(evt);
- _1369.updateToolbar();
- _1369.onContextMenu(evt);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- };
- ViewerA11YHelper.prototype.isValidNodeToSelect=function(node){
- return this.getValidNodeToSelect(node)?true:false;
- };
- ViewerA11YHelper.prototype.getValidNodeToSelect=function(node){
- if(node&&node.style&&node.style.visibility!="hidden"&&node.style.display!="none"){
- var _136d=node.nodeName.toLowerCase();
- 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))){
- return node;
- }
- if(ViewerA11YHelper.isSemanticNode(node)){
- var child=node.childNodes&&node.childNodes.length?node.childNodes[0]:null;
- if(child){
- return this.getValidNodeToSelect(child);
- }
- }
- }
- return null;
- };
- ViewerA11YHelper.isSemanticNode=function(node){
- if(!ViewerA11YHelper.isSemanticNode._semanticNodeNames){
- ViewerA11YHelper.isSemanticNode._semanticNodeNames=["strong","em","h1","h2","h3","h4","h5","h6"];
- }
- var _1370=node.nodeName.toLowerCase();
- for(var i=0;i<ViewerA11YHelper.isSemanticNode._semanticNodeNames.length;i++){
- if(_1370===ViewerA11YHelper.isSemanticNode._semanticNodeNames[i]){
- return true;
- }
- }
- return false;
- };
- ViewerA11YHelper.isTableCell=function(node){
- var _1373=node.nodeName.toLowerCase();
- return _1373==="td"||_1373==="th";
- };
- ViewerA11YHelper.findChildOfTableCell=function(_1374){
- var _1375=_1374;
- while(_1375&&_1375.parentNode){
- if(ViewerA11YHelper.getTableCell(_1375)){
- break;
- }
- _1375=_1375.parentNode;
- }
- return _1375;
- };
- ViewerA11YHelper.getTableCell=function(node){
- var _1377=node.parentNode;
- if(ViewerA11YHelper.isTableCell(_1377)){
- return _1377;
- }
- if(ViewerA11YHelper.isSemanticNode(_1377)&&ViewerA11YHelper.isTableCell(_1377.parentNode)){
- return _1377.parentNode;
- }
- return null;
- };
- ViewerA11YHelper.prototype.moveRight=function(_1378){
- var _1379=this.getNextNonTextSibling(_1378);
- _1379=this.getValidNodeToSelect(_1379);
- if(_1379){
- this.setFocusToNode(_1379);
- return true;
- }
- var _137a=ViewerA11YHelper.getTableCell(_1378);
- _137a=this.getPfMainOutputCell(_137a);
- while(_137a.nextSibling){
- if(this.moveToTD(_137a.nextSibling)){
- return true;
- }
- _137a=_137a.nextSibling;
- }
- var _137b=_137a.parentNode;
- while(_137b.nextSibling){
- var _137c=_137b.nextSibling;
- if(this.moveToTD(_137c.childNodes[0])){
- return true;
- }
- _137b=_137b.nextSibling;
- }
- return false;
- };
- ViewerA11YHelper.prototype.moveLeft=function(_137d){
- var _137e=this.getPreviousNonTextSibling(_137d);
- _137e=this.getValidNodeToSelect(_137e);
- if(_137e){
- this.setFocusToNode(_137e);
- return true;
- }
- var _137f=ViewerA11YHelper.getTableCell(_137d);
- _137f=this.getPfMainOutputCell(_137f);
- while(_137f.previousSibling){
- if(this.moveToTDFromTheRight(_137f.previousSibling)){
- return true;
- }
- _137f=_137f.previousSibling;
- }
- var _1380=_137f.parentNode;
- while(_1380.previousSibling){
- var _1381=_1380.previousSibling;
- if(this.moveToTDFromTheRight(_1381.lastChild)){
- return true;
- }
- _1380=_1380.previousSibling;
- }
- return false;
- };
- ViewerA11YHelper.prototype.moveDown=function(_1382){
- var _1383=ViewerA11YHelper.getTableCell(_1382);
- _1383=this.getPfMainOutputCell(_1383);
- var _1384=this.getColumnIndex(_1383);
- _1384+=this.getColSpanFromRowSpans(_1383);
- var _1385=_1383.parentNode;
- if(_1383.rowSpan&&_1383.rowSpan>1){
- var _1386=_1383.rowSpan;
- for(var _1387=1;_1387<_1386;_1387++){
- _1385=_1385.nextSibling;
- }
- }
- var _1388=false;
- while(_1385){
- if(_1385.nextSibling){
- _1385=_1385.nextSibling;
- }else{
- if(_1383.nextSibling&&!_1388){
- _1385=_1385.parentNode.firstChild;
- _1388=true;
- _1384++;
- }else{
- return false;
- }
- }
- if(this.doMoveUpDown(_1385,_1384)){
- return true;
- }
- }
- return false;
- };
- ViewerA11YHelper.prototype.moveUp=function(_1389){
- var _138a=ViewerA11YHelper.getTableCell(_1389);
- _138a=this.getPfMainOutputCell(_138a);
- var _138b=_138a.parentNode;
- var _138c=this.getColumnIndex(_138a);
- _138c+=this.getColSpanFromRowSpans(_138a);
- var _138d=false;
- while(_138b){
- if(_138b.previousSibling){
- _138b=_138b.previousSibling;
- }else{
- if(_138a.previousSibling&&!_138d){
- _138b=_138b.parentNode.lastChild;
- _138d=true;
- _138c--;
- }else{
- return false;
- }
- }
- if(this.doMoveUpDown(_138b,_138c)){
- return true;
- }
- }
- return false;
- };
- ViewerA11YHelper.prototype.getNextNonTextSibling=function(node){
- while(node.nextSibling){
- node=node.nextSibling;
- if(node.nodeName.toLowerCase()!="#text"){
- return node;
- }
- }
- if(ViewerA11YHelper.isSemanticNode(node.parentNode)){
- return this.getNextNonTextSibling(node.parentNode);
- }
- return null;
- };
- ViewerA11YHelper.prototype.doMoveUpDown=function(_138f,_1390){
- if(_138f!=null){
- var _1391=_138f.firstChild;
- var pos=this.getColSpanFromRowSpans(_1391);
- while(_1391){
- if(pos==_1390){
- return this.moveToTDFromTheRight(_1391);
- }else{
- if(pos>_1390){
- break;
- }
- }
- var _1393=0;
- if(_1391.colSpan){
- _1393=_1391.colSpan;
- }else{
- _1393++;
- }
- pos+=_1393;
- _1391=_1391.nextSibling;
- }
- }
- };
- ViewerA11YHelper.prototype.moveToTDFromTheRight=function(td){
- td=this.getPfVisibleCell(td);
- var _1395=td.childNodes;
- for(var _1396=_1395.length-1;_1396>=0;_1396--){
- var node=this.getValidNodeToSelect(_1395[_1396]);
- if(node){
- if(node.childNodes&&node.childNodes[0]&&node.childNodes[0].nodeName.toLowerCase()=="span"){
- node=node.childNodes[0];
- }
- if(node.tabIndex!=-1&&node.tabIndex!=0){
- node.tabIndex=-1;
- }
- this.setFocusToNode(node);
- return true;
- }
- }
- return false;
- };
- ViewerA11YHelper.prototype.moveToTD=function(td){
- td=this.getPfVisibleCell(td);
- var _1399=td.childNodes;
- for(var _139a=0;_139a<_1399.length;_139a++){
- var node=this.getValidNodeToSelect(_1399[_139a]);
- if(node){
- if(node.childNodes&&node.childNodes[0]&&node.childNodes[0].nodeName.toLowerCase()=="span"){
- node=node.childNodes[0];
- }
- if(node.tabIndex!=-1&&node.tabIndex!=0){
- node.tabIndex=-1;
- }
- this.setFocusToNode(node);
- return true;
- }
- }
- return false;
- };
- ViewerA11YHelper.prototype.setFocusToNode=function(node){
- this.m_oCV.setCurrentNodeFocus(node);
- this.updateCellAccessibility(node,false);
- node.focus();
- if(this.m_oCV.m_pinFreezeManager){
- var _139d=this.m_oCV.m_pinFreezeManager.nodeToContainer(node);
- if(_139d){
- _139d.updateScroll(node);
- }
- }
- };
- ViewerA11YHelper.prototype.getPfMainOutputCell=function(_139e){
- var main=null;
- var slid=_139e.getAttribute("pfslid");
- if(slid){
- var lid=PinFreezeContainer.getLidFromSlid(slid);
- if(lid&&this.m_oCV.m_pinFreezeManager){
- lid=this.m_oCV.m_pinFreezeManager.removeNamespace(lid);
- var _13a2=this.m_oCV.m_pinFreezeManager.getContainer(lid);
- if(_13a2){
- main=_13a2.getMain(_139e);
- }
- }
- }
- return main?main:_139e;
- };
- ViewerA11YHelper.prototype.getPreviousNonTextSibling=function(node){
- while(node.previousSibling){
- node=node.previousSibling;
- if(node.nodeName.toLowerCase()!="#text"){
- return node;
- }
- }
- if(ViewerA11YHelper.isSemanticNode(node.parentNode)){
- return this.getPreviousNonTextSibling(node.parentNode);
- }
- return null;
- };
- ViewerA11YHelper.prototype.getColumnIndex=function(node){
- var _13a5=0;
- while(node.previousSibling){
- node=node.previousSibling;
- if(node.rowSpan==1){
- if(node.colSpan){
- _13a5+=node.colSpan;
- }else{
- _13a5++;
- }
- }
- }
- return _13a5;
- };
- ViewerA11YHelper.prototype.getPfVisibleCell=function(_13a6){
- var copy=null;
- var slid=_13a6.getAttribute("pfslid");
- if(slid){
- var lid=PinFreezeContainer.getLidFromSlid(slid);
- if(lid&&this.m_oCV.m_pinFreezeManager){
- lid=this.m_oCV.m_pinFreezeManager.removeNamespace(lid);
- var _13aa=this.m_oCV.m_pinFreezeManager.getContainer(lid);
- if(_13aa){
- copy=_13aa.getCopy(_13a6);
- }
- }
- }
- return copy?copy:_13a6;
- };
- ViewerA11YHelper.prototype.updateCellAccessibility=function(_13ab,force){
- if(!_13ab){
- return false;
- }
- var _13ad=false;
- var _13ae=false;
- var _13af=false;
- var _13b0=_13ab.getAttribute("ctx")!=null?_13ab:_13ab.parentNode;
- if(_13ab.getAttribute("flashChartContainer")!="true"){
- if(_13b0.getAttribute("ctx")!=null){
- if(this.m_oCV.isBux){
- var _13b1=this.m_oCV.getAction("DrillUpDown");
- _13b1.updateDrillability(this.m_oCV,_13b0);
- _13ad=_13b1.canDrillDown();
- _13ae=_13b1.canDrillUp();
- }else{
- var _13b2=_13b0.getAttribute("ctx");
- var ctxID=_13b2.indexOf(":")==-1?_13b2:_13b2.substring(0,_13b2.indexOf(":"));
- var _13b4=this.m_oCV.getSelectionController();
- _13ad=_13b4.canDrillDown(ctxID);
- _13ae=_13b4.canDrillUp(ctxID);
- }
- }
- _13af=_13ab.parentNode.getAttribute("dtTargets")?true:false;
- }
- var _13b5=_13ab.nodeName.toLowerCase()=="img";
- var _13b6=_13ab.parentNode.getAttribute("type")=="columnTitle";
- if(!_13b5&&(force||((_13ab.getAttribute("aria-labelledby")!=null||_13b6||this.m_oCV.isAccessibleMode())))){
- var _13b7="";
- if(_13ab.parentNode.getAttribute("cc")=="true"){
- _13b7+=" "+RV_RES.IDS_JS_CROSSTAB_CORNER;
- }
- if(_13ab.innerHTML.length===0){
- _13ab.innerHTML=" ";
- _13b7+=" "+RV_RES.IDS_JS_EMPTY_CELL;
- }
- if(_13ad&&_13ae){
- _13b7+=" "+RV_RES.IDS_JS_DRILL_DOWN_UP_JAWS;
- }else{
- if(_13ad){
- _13b7+=" "+RV_RES.IDS_JS_DRILL_DOWN_JAWS;
- }else{
- if(_13ae){
- _13b7+=" "+RV_RES.IDS_JS_DRILL_UP_JAWS;
- }
- }
- }
- if(_13af){
- _13b7+=" "+RV_RES.IDS_JS_DRILL_THROUGH_JAWS;
- }
- if(_13ab.altText&&_13ab.altText.length>0){
- _13b7=_13ab.altText;
- }else{
- if(_13ab.getAttribute("flashChartContainer")=="true"){
- _13b7=RV_RES.IDS_JS_CHART_IMAGE;
- }
- }
- if(this.m_oCV.isBux){
- var _13b8=_13ab.previousSibling;
- if(_13b8){
- var wid=_13b8.getAttribute("widgetid");
- if(wid&&wid.indexOf("comment")){
- _13b7+=" "+RV_RES.IDS_JS_ANNOTATION_JAWS;
- }
- }
- if(_13ab.getAttribute("rp_name")||_13ab.parentNode.getAttribute("rp_name")){
- _13b7+=" "+RV_RES.IDS_JS_LABEL_HAS_BEEN_RENAMED;
- }
- if(_13ab.nextSibling&&_13ab.nextSibling.getAttribute("class")=="sortIconVisible"){
- _13b7+=" "+_13ab.nextSibling.getAttribute("alt");
- }
- }
- if(_13b7.length>0){
- this.addAriaLabelledByOnCell(_13ab,_13b7);
- }
- }
- if(_13ae||_13ad||_13af){
- this.addDrillAccessibilityAttributes(_13ab,_13af);
- }
- if(_13ab.attachEvent){
- _13ab.attachEvent("onblur",this.onBlur);
- }else{
- _13ab.addEventListener("blur",this.onBlur,false);
- }
- if((isIE()&&_13ab.getAttribute("tabIndex")!=0)||_13b5){
- _13ab.setAttribute("modifiedTabIndex","true");
- _13ab.setAttribute("oldTabIndex",_13ab.getAttribute("tabIndex"));
- _13ab.setAttribute("tabIndex",0);
- }
- };
- ViewerA11YHelper.prototype.addAriaLabelledByOnCell=function(_13ba,_13bb){
- var _13bc=0;
- var _13bd=_13ba;
- while(_13bd.previousSibling){
- _13bc++;
- _13bd=_13bd.previousSibling;
- }
- var _13be=_13ba.getAttribute("ariaHiddenSpanId");
- if(_13be&&document.getElementById(_13be)){
- document.getElementById(_13be).innerHTML=_13bb;
- }else{
- if(!_13ba.parentNode.id&&!_13ba.id){
- _13ba.parentNode.id=Math.random();
- }
- var _13bf=document.createElement("span");
- _13bf.style.visibility="hidden";
- _13bf.style.display="none";
- _13bf.id=(_13ba.id==""?_13ba.parentNode.id:_13ba.id)+"_"+_13bc;
- _13bf.innerHTML=_13bb;
- _13ba.parentNode.appendChild(_13bf);
- var _13c0="";
- if(_13ba.getAttribute("aria-labelledby")!=null){
- _13c0+=_13ba.getAttribute("aria-labelledby");
- }else{
- if(_13ba.id==""){
- _13ba.id=_13ba.parentNode.id+"_main_"+_13bc;
- }
- _13c0+=_13ba.id;
- }
- _13c0+=" "+_13bf.id;
- _13ba.setAttribute("aria-labelledby",_13c0);
- _13ba.setAttribute("ariaHiddenSpanId",_13bf.id);
- }
- };
- ViewerA11YHelper.prototype.addDrillAccessibilityAttributes=function(_13c1,_13c2){
- if(!_13c1.getAttribute("oldClassName")){
- if(!_13c2){
- _13c1.setAttribute("oldClassName",_13c1.className);
- _13c1.className="dl "+_13c1.className;
- }
- if(!_13c1.getAttribute("role")){
- _13c1.setAttribute("role","link");
- }
- }
- };
- ViewerA11YHelper.prototype.onBlur=function(evt){
- var _13c4=null;
- if(isIE()){
- _13c4=getNodeFromEvent(evt,true);
- }else{
- _13c4=this;
- }
- _13c4=ViewerA11YHelper.findChildOfTableCell(_13c4);
- if(_13c4){
- if(_13c4.getAttribute("oldClassName")){
- _13c4.className=_13c4.getAttribute("oldClassName");
- _13c4.removeAttribute("oldClassName");
- }
- if(_13c4.getAttribute("modifiedTabIndex")=="true"){
- _13c4.removeAttribute("modifiedTabIndex");
- _13c4.removeAttribute("tabIndex");
- if(_13c4.getAttribute("oldTabIndex")){
- _13c4.setAttribute("tabIndex",_13c4.getAttribute("oldTabIndex"));
- }
- _13c4.removeAttribute("oldTabIndex");
- }
- var _13c5=_13c4.getAttribute("ariaHiddenSpanId");
- if(_13c5){
- var _13c6=document.getElementById(_13c5);
- if(_13c6){
- _13c6.innerHTML="";
- }
- }
- }
- };
- ViewerA11YHelper.prototype.getColSpanFromRowSpans=function(_13c7){
- var _13c8=0;
- var _13c9=_13c7.parentNode;
- var _13ca=0;
- while(_13c9){
- var _13cb=_13c9.firstChild;
- var _13cc=this.getColumnCount(_13c9)-_13ca;
- while(_13cb&&_13cb.rowSpan>1&&_13cc>0&&_13cb!=_13c7){
- _13c8+=_13cb.colSpan;
- _13cb=_13cb.nextSibling;
- _13cc--;
- }
- if(_13c9.childNodes.length>_13ca){
- _13ca=this.getColumnCount(_13c9);
- }
- _13c9=_13c9.previousSibling;
- }
- return _13c8;
- };
- ViewerA11YHelper.prototype.getColumnCount=function(_13cd){
- var _13ce=0;
- var node=_13cd.firstChild;
- while(node){
- _13ce+=node.colSpan;
- node=node.nextSibling;
- }
- return _13ce;
- };
- ViewerA11YHelper.prototype.addLabelledByForItemsOutsideOfContainers=function(){
- if(!this.m_oCV.isAccessibleMode()){
- return;
- }
- var _13d0=document.getElementById("RVContent"+this.m_oCV.getId());
- if(!_13d0){
- return;
- }
- var _13d1=getElementsByAttribute(_13d0,"span","tabindex","0");
- if(!_13d1){
- return;
- }
- for(var i=0;i<_13d1.length;i++){
- var span=_13d1[i];
- this.updateCellAccessibility(span,false);
- }
- };
- function CtxArrayPlaceHolder(){
- };
- var self=window;
- function CDrillManager(oCV){
- this.m_drawDrillTargets=false;
- this.setCV(oCV);
- };
- CDrillManager.prototype=new CViewerHelper();
- CDrillManager.prototype.getSelectionController=function(){
- var _13d5;
- try{
- _13d5=getCognosViewerSCObjectRef(this.getCV().getId());
- }
- catch(e){
- _13d5=null;
- }
- return _13d5;
- };
- CDrillManager.prototype.getSelectedObject=function(){
- var _13d6=this.getSelectionController();
- if(_13d6==null){
- return null;
- }
- var _13d7=null;
- var _13d8=null;
- if(_13d6.hasSelectedChartNodes()){
- _13d8=_13d6.getSelectedChartNodes();
- }else{
- _13d8=_13d6.getSelections();
- }
- if(_13d8&&_13d8.length==1){
- _13d7=_13d8[0];
- }
- return _13d7;
- };
- CDrillManager.prototype.canDrillUp=function(){
- if(this.getDrillOption("drillUp")==true&&this.hasMuns()){
- return true;
- }
- return false;
- };
- CDrillManager.prototype.canDrillDown=function(){
- if(this.getDrillOption("drillDown")==true){
- return true;
- }
- return false;
- };
- CDrillManager.prototype.hasMuns=function(_13d9){
- if(typeof _13d9=="undefined"){
- _13d9=this.getSelectedObject();
- }
- if(_13d9==null){
- return false;
- }
- var _13da=_13d9.getMuns();
- var muns="";
- for(var _13dc=0;_13dc<_13da.length&&muns=="";++_13dc){
- if(typeof _13da[_13dc][0]!="undefined"){
- muns+=_13da[_13dc][0];
- }
- }
- return (muns!="");
- };
- CDrillManager.prototype.getRefQuery=function(){
- var _13dd="";
- var _13de=this.getSelectedObject();
- if(_13de==null){
- return "";
- }
- var _13df=_13de.getRefQueries();
- for(var i=0;i<_13df.length;i++){
- if(_13df[i]!=null){
- for(var j=0;j<_13df[i].length;j++){
- if(_13df[i][j]!=null&&_13df[i][j]!=""){
- return _13df[i][j];
- }
- }
- }
- }
- return _13dd;
- };
- CDrillManager.prototype.isIsolated=function(){
- var _13e2=this.getSelectionController();
- if(_13e2==null||_13e2.getDrillUpDownEnabled()==false){
- return false;
- }
- var _13e3=this.getSelectedObject();
- if(_13e3==null){
- return false;
- }
- if(_13e3 instanceof CSelectionChartObject&&_13e2!=null){
- var _13e4=_13e3.getArea();
- if(_13e4!=null){
- var _13e5=_13e4.getAttribute("isolated");
- if(typeof _13e5!="undefined"&&_13e5!=null&&_13e5=="true"){
- return true;
- }
- }
- }else{
- var _13e6=_13e3.getCellRef();
- if(typeof _13e6=="object"&&_13e6!=null){
- var _13e7=_13e6.getElementsByTagName("span");
- if(_13e7!=null&&typeof _13e7!="undefined"&&_13e7.length>0){
- var _13e8=_13e7[0].getAttribute("isolated");
- if(_13e8!=null&&_13e8!="undefined"&&_13e8=="true"){
- return true;
- }
- }
- }
- }
- return false;
- };
- CDrillManager.prototype.getDrillOption=function(_13e9){
- var _13ea=this.getSelectionController();
- if(_13ea==null||_13ea.getDrillUpDownEnabled()==false||typeof _13e9=="undefined"){
- return false;
- }
- var _13eb=this.getSelectedObject();
- if(_13eb==null){
- return false;
- }
- if(this.isIsolated()){
- if(_13e9=="drillDown"){
- return false;
- }else{
- if(_13e9=="drillUp"){
- return true;
- }
- }
- }
- if(_13e9=="drillDown"){
- if(_13eb instanceof CSelectionChartObject&&_13ea!=null){
- var _13ec=_13eb.getArea();
- if(_13ec!=null){
- var _13ed=_13ec.getAttribute("isChartTitle");
- if(typeof _13ed!="undefined"&&_13ed!=null&&_13ed=="true"){
- return false;
- }
- }
- }
- }
- var _13ee=_13eb.getDrillOptions();
- var _13ef=(typeof DrillContextMenuHelper!=="undefined"&&DrillContextMenuHelper.needsDrillSubMenu(this.m_oCV));
- for(var idx=0;idx<_13ee.length;++idx){
- var _13f1=(_13ef)?_13ee[idx].length:1;
- for(var level=0;level<_13f1;++level){
- var _13f3=_13ee[idx][level];
- if(_13f3=="3"){
- return true;
- }else{
- if(_13e9=="drillUp"&&_13f3=="1"){
- return true;
- }else{
- if(_13e9=="drillDown"&&_13f3=="2"){
- return true;
- }
- }
- }
- }
- }
- return false;
- };
- CDrillManager.prototype.canDrillThrough=function(){
- var _13f4=this.getSelectionController();
- if(_13f4==null||_13f4.getModelDrillThroughEnabled()==false){
- return false;
- }
- return true;
- };
- CDrillManager.prototype.singleClickDrillEvent=function(evt,app){
- var _13f7=this.getSelectionController();
- if(_13f7!=null){
- if(this.getCV().bCanUseCognosViewerSelection==true){
- _13f7.pageClicked(evt);
- }
- }
- var node=getCrossBrowserNode(evt);
- try{
- if(node.className&&node.className.indexOf("dl")==0){
- if(this.canDrillDown()){
- this.singleClickDrillDown(evt,app);
- return true;
- }else{
- if(this.canDrillUp()){
- this.singleClickDrillUp(evt,app);
- return true;
- }
- }
- }
- }
- catch(e){
- }
- if(app=="RV"){
- return this.getDrillThroughParameters("execute",evt);
- }
- return false;
- };
- CDrillManager.prototype.singleClickDrillDown=function(evt,app){
- if(app=="QS"){
- this.qsDrillDown();
- }else{
- this.rvDrillDown();
- }
- };
- CDrillManager.prototype.singleClickDrillUp=function(evt,app){
- if(app=="QS"){
- this.qsDrillUp();
- }else{
- this.rvDrillUp();
- }
- };
- CDrillManager.prototype.getDrillParameters=function(_13fd,_13fe,_13ff,_1400){
- var _1401=[];
- var _1402=this.getSelectedObject();
- if(_1402==null){
- return _1401;
- }
- if(typeof _13fe=="undefined"){
- _13fe=true;
- }
- var _1403=_1402.getDataItems();
- var _1404=_1402.getMuns();
- var _1405=_1402.getDimensionalItems("lun");
- var _1406=_1402.getDimensionalItems("hun");
- var _1407=_1402.getDrillOptions();
- if(typeof _1403=="undefined"||typeof _1404=="undefined"||typeof _1407=="undefined"||_1404==null||_1403==null||_1407==null){
- return _1401;
- }
- if(_1404.length!=_1403.length){
- return _1401;
- }
- var _1408=_1404.length;
- for(var _1409=0;_1409<_1408;++_1409){
- if(_1403[_1409].length!=0){
- var _140a=(_1400)?this.findUserSelectedDrillItem(_1400,_1403[_1409]):0;
- if(_140a<0){
- continue;
- }
- if((_13ff===true)||this.getDrillOption(_13fd)){
- if(_1404[_1409][_140a]==""||_1401.toString().indexOf(_1404[_1409][_140a],0)==-1){
- _1401[_1401.length]=_1403[_1409][_140a];
- _1401[_1401.length]=_1404[_1409][_140a];
- if(_13fe===true){
- _1401[_1401.length]=_1405[_1409][_140a];
- _1401[_1401.length]=_1406[_1409][_140a];
- }
- }
- }
- }
- }
- return _1401;
- };
- CDrillManager.prototype.findUserSelectedDrillItem=function(_140b,_140c){
- for(var _140d=0;_140d<_140c.length;++_140d){
- if(_140b==_140c[_140d]){
- return _140d;
- }
- }
- return -1;
- };
- CDrillManager.prototype.getModelDrillThroughContext=function(_140e){
- var _140f="";
- if(this.canDrillThrough()===true){
- if(typeof gUseNewSelectionContext=="undefined"){
- var _1410="";
- if(typeof getConfigFrame!="undefined"){
- _1410=decodeURIComponent(getConfigFrame().cfgGet("PackageBase"));
- }else{
- if(this.getCV().getModelPath()!==""){
- _1410=this.getCV().getModelPath();
- }
- }
- _140f=getViewerSelectionContext(this.getSelectionController(),new CSelectionContext(_1410));
- }else{
- var _1411=new CParameterValues();
- var _1412=this.getSelectionController();
- if(_1412){
- var _1413=_1412.getAllSelectedObjects();
- for(var _1414=0;_1414<_1413.length;++_1414){
- var _1415=_1413[_1414];
- var _1416=_1415.getMuns();
- var _1417=_1415.getMetadataItems();
- var _1418=_1415.getUseValues();
- for(var _1419=0;_1419<_1417.length;++_1419){
- for(var idx=0;idx<_1417[_1419].length;++idx){
- if(_1417[_1419][idx]==null||_1417[_1419][idx]==""){
- continue;
- }
- var name=_1417[_1419][idx];
- var _141c;
- if(_1416[_1419][idx]!=null&&_1416[_1419][idx]!=""){
- _141c=_1416[_1419][idx];
- }else{
- _141c=_1418[_1419][idx];
- }
- var _141d=_1418[_1419][idx];
- _1411.addSimpleParmValueItem(name,_141c,_141d,"true");
- }
- }
- }
- }
- var _141e=_140e.XMLBuilderCreateXMLDocument("context");
- _140f=_1411.generateXML(_140e,_141e);
- }
- }
- return _140f;
- };
- CDrillManager.prototype.rvDrillUp=function(_141f){
- this.getCV().executeAction("DrillUp",_141f);
- };
- CDrillManager.prototype.rvDrillDown=function(_1420){
- this.getCV().executeAction("DrillDown",_1420);
- };
- CDrillManager.prototype.rvBuildXMLDrillParameters=function(_1421,_1422){
- var _1423=this.getDrillParameters(_1421,true,false,_1422);
- if(_1423.length==0){
- return drillParams;
- }
- return this.buildDrillParametersSpecification(_1423);
- };
- CDrillManager.prototype.buildDrillParametersSpecification=function(_1424){
- var _1425="<DrillParameters>";
- var idx=0;
- while(idx<_1424.length){
- _1425+="<DrillGroup>";
- _1425+="<DataItem>";
- _1425+=sXmlEncode(_1424[idx++]);
- _1425+="</DataItem>";
- _1425+="<MUN>";
- _1425+=sXmlEncode(_1424[idx++]);
- _1425+="</MUN>";
- _1425+="<LUN>";
- _1425+=sXmlEncode(_1424[idx++]);
- _1425+="</LUN>";
- _1425+="<HUN>";
- _1425+=sXmlEncode(_1424[idx++]);
- _1425+="</HUN>";
- _1425+="</DrillGroup>";
- }
- _1425+="</DrillParameters>";
- return _1425;
- };
- CDrillManager.prototype.getAuthoredDrillsForCurrentSelection=function(){
- var _1427=null;
- var _1428=this.getAuthoredDrillThroughTargets();
- if(_1428.length>0){
- var _1429="<AuthoredDrillTargets>";
- for(var _142a=0;_142a<_1428.length;++_142a){
- _1429+=eval("\""+_1428[_142a]+"\"");
- }
- _1429+="</AuthoredDrillTargets>";
- var cv=this.getCV();
- var _142c=cv.getAction("AuthoredDrill");
- var _142d=cv.getDrillTargets();
- if(_142d.length>0){
- _1427=_142c.getAuthoredDrillThroughContext(_1429,_142d);
- }
- }
- return _1427;
- };
- CDrillManager.prototype.getAuthoredDrillsForGotoPage=function(){
- var _142e="";
- var _142f=this.getAuthoredDrillsForCurrentSelection();
- if(_142f){
- _142e=XMLBuilderSerializeNode(_142f);
- }
- return _142e;
- };
- CDrillManager.prototype.launchGoToPage=function(_1430,_1431){
- var _1432=this.getSelectionController();
- if((_1432!=null&&_1432.getModelDrillThroughEnabled()==true)||(typeof _1430!="undefined"&&_1430!=null&&_1430!="")){
- var _1433=this.getAuthoredDrillsForGotoPage();
- var _1434=this.getModelDrillThroughContext(self);
- var form=document.getElementById("drillForm");
- if(form!=null){
- document.body.removeChild(form);
- }
- form=document.createElement("form");
- var cvid=this.getCVId();
- var _1437=document.forms["formWarpRequest"+cvid];
- form.setAttribute("id","drillForm");
- form.setAttribute("name","drillForm");
- form.setAttribute("target",_1437.getAttribute("target"));
- form.setAttribute("method","post");
- form.setAttribute("action",_1437.getAttribute("action"));
- form.style.display="none";
- document.body.appendChild(form);
- if(this.getCV().getModelPath()!==""){
- form.appendChild(createHiddenFormField("modelPath",this.getCV().getModelPath()));
- }
- if(typeof _1437["ui.object"]!="undefined"&&_1437["ui.object"].value!=""){
- form.appendChild(createFormField("drillSource",_1437["ui.object"].value));
- }else{
- if(typeof this.getCV().envParams["ui.spec"]!="undefined"){
- form.appendChild(createFormField("sourceSpecification",this.getCV().envParams["ui.spec"]));
- }
- }
- if(_1433!=""){
- form.appendChild(createHiddenFormField("m","portal/drillthrough.xts"));
- form.appendChild(createFormField("invokeGotoPage","true"));
- form.appendChild(createFormField("m","portal/drillthrough.xts"));
- form.appendChild(createFormField("modelDrillEnabled",_1432.getModelDrillThroughEnabled()));
- if(typeof gUseNewSelectionContext=="undefined"){
- form.appendChild(createFormField("newSelectionContext","true"));
- }
- }else{
- if(typeof gUseNewSelectionContext=="undefined"){
- form.appendChild(createHiddenFormField("m","portal/goto2.xts"));
- }else{
- form.appendChild(createHiddenFormField("m","portal/goto.xts"));
- }
- }
- form.appendChild(createHiddenFormField("b_action","xts.run"));
- form.appendChild(createHiddenFormField("drillTargets",_1433));
- if(typeof gUseNewSelectionContext=="undefined"){
- form.appendChild(createHiddenFormField("drillContext",_1434));
- }else{
- form.appendChild(createHiddenFormField("modeledDrillthru",_1434));
- }
- form.appendChild(createHiddenFormField("errURL","javascript:window.close();"));
- if(typeof _1431!="undefined"&&_1431==true){
- form.appendChild(this.createFormField("directLaunch","true"));
- }
- var _1438="";
- if(this.getCV().envParams["ui.routingServerGroup"]){
- _1438=this.getCV().envParams["ui.routingServerGroup"];
- }
- form.appendChild(createHiddenFormField("ui.routingServerGroup",_1438));
- if(this.getCV().getExecutionParameters()!=""){
- form.appendChild(createHiddenFormField("encExecutionParameters",this.getCV().getExecutionParameters()));
- }
- if(_1437.lang&&_1437.lang.value!=""){
- form.appendChild(createHiddenFormField("lang",_1437.lang.value));
- }
- if(!this.getCV()||!this.getCV().launchGotoPageForIWidgetMobile(drillForm)){
- if(typeof this.getCV().launchGotoPage==="function"){
- this.getCV().launchGotoPage(form);
- }else{
- var _1439="winNAT_"+(new Date()).getTime();
- var sPath=this.getCV().getWebContentRoot()+"/rv/blankDrillWin.html?cv.id="+cvid;
- window.open(sPath,_1439,"toolbar,location,status,menubar,resizable,scrollbars=1");
- form.target=_1439;
- }
- }
- }
- };
- CDrillManager.prototype.buildSearchPageXML=function(_143b,pkg,model,_143e,_143f,_1440,_1441){
- var _1442=null;
- if(typeof _143b.XMLElement=="function"){
- _1442=_143b.XMLBuilderCreateXMLDocument("cognosSearch");
- _143b.XMLBuilderSetAttributeNodeNS(_1442.documentElement,"xmlns:cs","http://developer.cognos.com/schemas/cs/1/");
- var _1443=_1442.createElement("package");
- if(typeof pkg=="string"&&pkg!==""){
- _1443.appendChild(_1442.createTextNode(pkg));
- }
- _1442.documentElement.appendChild(_1443);
- var _1444=_1442.createElement("model");
- if(typeof model=="string"&&model!==""){
- _1444.appendChild(_1442.createTextNode(model));
- }
- _1442.documentElement.appendChild(_1444);
- var _1445=_1442.createElement("selectedContext");
- _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
- _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
- _143b.XMLBuilderSetAttributeNodeNS(_1445,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
- _143b.XMLBuilderSetAttributeNodeNS(_1445,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
- _143b.XMLBuilderSetAttributeNodeNS(_1445,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _1442.documentElement.appendChild(_1445);
- for(var _1446 in _143e){
- var _1447=_1442.createElement("item");
- _143b.XMLBuilderSetAttributeNodeNS(_1447,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
- var _1448=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",_1442);
- _143b.XMLBuilderSetAttributeNodeNS(_1448,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _1448.appendChild(_1442.createTextNode(_143e[_1446].name));
- var _1449=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",_1442);
- _143b.XMLBuilderSetAttributeNodeNS(_1449,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _143b.XMLBuilderSetAttributeNodeNS(_1449,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
- for(var j=0;j<_143e[_1446].values.length;j++){
- var _144b=_1442.createElement("item");
- _143b.XMLBuilderSetAttributeNodeNS(_144b,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- var _144c=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",_1442);
- _143b.XMLBuilderSetAttributeNodeNS(_144c,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _144c.appendChild(_1442.createTextNode(_143e[_1446].values[j][0]));
- var _144d=_143b.XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",_1442);
- _143b.XMLBuilderSetAttributeNodeNS(_144d,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- var _144e=_143e[_1446].values[j][1]==null?"":_143e[_1446].values[j][1];
- _144d.appendChild(_1442.createTextNode(_144e));
- _144b.appendChild(_144c);
- _144b.appendChild(_144d);
- _1449.appendChild(_144b);
- }
- _1447.appendChild(_1448);
- _1447.appendChild(_1449);
- _1445.appendChild(_1447);
- }
- var _144f=_1442.createElement("defaultMeasure");
- _1442.documentElement.appendChild(_144f);
- _1440.buildXML(_143b,_1442,"data");
- var _1450=_1442.createElement("filter");
- _1442.documentElement.appendChild(_1450);
- }
- return _1442;
- };
- CDrillManager.prototype.openSearchPage=function(_1451,_1452){
- this.getModelDrillThroughContext(self);
- var _1453=document.getElementById("searchPage");
- if(_1453!=null){
- document.body.removeChild(_1453);
- }
- _1453=document.createElement("form");
- _1453.setAttribute("id","searchPage");
- _1453.setAttribute("name","searchPage");
- _1453.setAttribute("method","post");
- _1453.setAttribute("target",_1453.name);
- _1453.setAttribute("action",this.getCV().getGateway()+"/gosearch");
- _1453.style.display="none";
- document.body.appendChild(_1453);
- _1453.appendChild(createHiddenFormField("csn.action","search"));
- _1453.appendChild(createHiddenFormField("csn.drill",_1452));
- 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");
- _1454.focus();
- _1453.submit();
- };
- CDrillManager.prototype.launchSearchPage=function(){
- var _1455=this.getSelectionController();
- var _1456=document.forms["formWarpRequest"+this.getCVId()];
- var _1457=this.determineSelectionsForSearchPage(_1455);
- var _1458=this.getSearchContextDataSpecfication(_1455);
- var spXML=this.buildSearchPageXML(self,_1456.packageBase.value,this.getCV().getModelPath(),_1457,[],_1458,[]);
- this.openSearchPage(_1456.packageBase.value,XMLBuilderSerializeNode(spXML));
- };
- CDrillManager.prototype.qsDrillDown=function(){
- if(!this.canDrillDown()){
- getConfigFrame().dlgGenericSelectionMessage(false);
- return;
- }
- var _145a="DD:";
- this.qsSendDrillCommand(_145a);
- };
- CDrillManager.prototype.qsDrillUp=function(){
- if(!this.canDrillUp()){
- getConfigFrame().dlgGenericSelectionMessage(false);
- return;
- }
- var _145b="DU:";
- this.qsSendDrillCommand(_145b);
- };
- CDrillManager.prototype.qsSendDrillCommand=function(_145c){
- var _145d;
- if(_145c=="DU:"){
- _145d="drillUp";
- }else{
- _145d="drillDown";
- }
- var _145e=this.getDrillParameters(_145d,false,false);
- if(_145e.length==0){
- getConfigFrame().dlgGenericSelectionMessage(false);
- return;
- }
- for(var idx=0;idx<_145e.length;++idx){
- _145c+=getConfigFrame().escapeParam(_145e[idx]);
- if(idx+1<_145e.length){
- _145c+=",";
- }
- }
- getConfigFrame().sendCmd(_145c,"",true);
- };
- CDrillManager.prototype.qsLaunchGoToPage=function(_1460){
- var _1461=this.getSelectionController();
- if(_1461!=null&&_1461.getModelDrillThroughEnabled()==true){
- var _1462=this.getModelDrillThroughContext(cf);
- if(_1462==""){
- getConfigFrame().dlgGenericSelectionMessage(false);
- return;
- }
- var _1463=document.getElementById("gotoPage");
- if(_1463!=null){
- document.body.removeChild(_1463);
- }
- _1463=document.createElement("form");
- _1463.setAttribute("id","gotoPage");
- _1463.setAttribute("name","gotoPage");
- _1463.setAttribute("method","post");
- _1463.style.display="none";
- document.body.appendChild(_1463);
- var _1464=getConfigFrame();
- _1463.appendChild(this.createFormField("objpath",decodeURIComponent(_1464.cfgGet("PackageBase"))));
- if(typeof gUseNewSelectionContext=="undefined"){
- _1463.appendChild(this.createFormField("m","portal/goto2.xts"));
- }else{
- _1463.appendChild(this.createFormField("m","portal/goto.xts"));
- }
- _1463.appendChild(this.createFormField("b_action","xts.run"));
- if(typeof gUseNewSelectionContext=="undefined"){
- _1463.appendChild(this.createFormField("drillContext",_1462));
- }else{
- _1463.appendChild(this.createFormField("modeledDrillthru",_1462));
- }
- if(typeof getConfigFrame().routingServerGroup!="undefined"){
- _1463.appendChild(this.createFormField("ui.routingServerGroup",getConfigFrame().routingServerGroup));
- }
- if(typeof _1460!="undefined"&&_1460==true){
- _1463.appendChild(this.createFormField("directLaunch","true"));
- }
- var _1465=_1464.goApplicationManager.getReportManager().getParameterManager().getExecutionParameters();
- if(_1465){
- _1463.appendChild(this.createFormField("encExecutionParameters",_1465));
- }
- var _1466="winNAT_"+(new Date()).getTime();
- var sPath=this.getCV().getWebContentRoot()+"/rv/blankDrillWin.html?cv.id="+this.getCVId();
- window.open(sPath,_1466,"toolbar,location,status,menubar,resizable,scrollbars=1");
- _1463.target=_1466;
- }
- };
- CDrillManager.prototype.qsLaunchSearchPage=function(){
- var cf=getConfigFrame();
- var _1469=goWindowManager.getSelectionController();
- var _146a=this.determineSelectionsForSearchPage(_1469);
- var _146b=this.getSearchContextDataSpecfication(_1469);
- var _146c=decodeURIComponent(cf.cfgGet("PackageBase"));
- var spXML=this.buildSearchPageXML(cf,_146c,decodeURIComponent(cf.cfgGet("cmLastModel")),_146a,[],_146b,[]);
- this.openSearchPage(_146c,cf.XMLBuilderSerializeNode(spXML));
- };
- CDrillManager.prototype.determineSelectionsForSearchPage=function(_146e){
- var _146f=new CtxArrayPlaceHolder();
- var _1470=_146e.getAllSelectedObjects();
- for(var i=0;i<_1470.length;i++){
- var _1472=_1470[i].getColumnName();
- if(!this.containsByIndiceInArray(_146f,_1472)){
- _146f[_1472]={};
- _146f[_1472].name=_1472;
- _146f[_1472].values=[];
- }
- var idx0="";
- var muns=_1470[i].getMuns();
- if(muns!=null&&muns.length>0){
- idx0=muns[0][0];
- }
- var idx1=_1470[i].getDisplayValues()[0];
- if(!(this.containsInArray(_146f[_1472].values,0,idx0)&&this.containsInArray(_146f[_1472].values,1,idx1))){
- _146f[_1472].values[_146f[_1472].values.length]=[idx0,idx1];
- }
- }
- return _146f;
- };
- CDrillManager.prototype.getSearchContextDataSpecfication=function(_1476){
- var _1477=new CParameterValues();
- var _1478=_1476.getCCDManager();
- var _1479=_1478.m_cd;
- for(var ctxId in _1479){
- var _147b=_1478.GetUsage(ctxId);
- if(_147b!="2"){
- var _147c=_1478.GetRDIValue(ctxId);
- var _147d=_1478.GetDisplayValue(ctxId);
- _1477.addSimpleParmValueItem(_147c,_147c,_147d,"true");
- }
- }
- return _1477;
- };
- CDrillManager.prototype.containsByIndiceInArray=function(a,v){
- for(var i in a){
- if(i==v){
- return true;
- }
- }
- return false;
- };
- CDrillManager.prototype.containsInArray=function(a,idx,v){
- for(var i in a){
- if(a[i][idx]==v){
- return true;
- }
- }
- return false;
- };
- CDrillManager.prototype.createFormField=function(name,value){
- var _1487=document.createElement("input");
- _1487.setAttribute("type","hidden");
- _1487.setAttribute("name",name);
- _1487.setAttribute("value",value);
- return (_1487);
- };
- CDrillManager.prototype.getAuthoredDrillThroughTargets=function(){
- var _1488=[];
- var _1489=this.getSelectionController();
- var _148a=null;
- if(_1489!=null){
- if(_1489.getSelectedColumnIds().length==1){
- var _148b=_1489.getSelections();
- for(var _148c=0;_148c<_148b.length;++_148c){
- var _148d=_148b[_148c];
- _148a=_148d.getCellRef();
- while(_148a){
- if(_148a.getAttribute("dtTargets")!=null){
- _1488.push("<rvDrillTargets>"+_148a.getAttribute("dtTargets")+"</rvDrillTargets>");
- break;
- }else{
- if(_148a.getAttribute("onclick")!=null){
- var _148e=_148a.getAttribute("onclick");
- var _148f=null;
- if(_148e.indexOf("doSingleDrillThrough")!=-1){
- _148f=_148e.replace("doSingleDrillThrough","this.buildRvTargetsForSingleDrillThrough");
- }else{
- if(_148e.indexOf("doMultipleDrillThrough")!=-1){
- _148f=_148e.replace("doMultipleDrillThrough","this.buildRvTargetsForMultipleDrillThrough");
- }
- }
- if(_148f!=null){
- var _1490=eval(_148f);
- if(_1490!=null){
- _1488.push(_1490);
- break;
- }
- }
- }
- }
- _148a=XMLHelper_GetFirstChildElement(_148a);
- }
- }
- }else{
- if(_1489.hasSelectedChartNodes()){
- var _1491=_1489.getSelectedChartNodes();
- var _1492=_1491[0];
- _148a=_1492.getArea();
- if(_148a.getAttribute("dtTargets")!=null){
- _1488.push("<rvDrillTargets>"+_148a.getAttribute("dtTargets")+"</rvDrillTargets>");
- }
- }else{
- if(_1489.getSelectedDrillThroughImage()!=null){
- var _1493=_1489.getSelectedDrillThroughImage();
- if(_1493&&_1493.getAttribute("dtTargets")!=null){
- _1488.push("<rvDrillTargets>"+_1493.getAttribute("dtTargets")+"</rvDrillTargets>");
- }
- }else{
- if(_1489.getSelectDrillThroughSingleton()!=null){
- var _1494=_1489.getSelectDrillThroughSingleton();
- if(_1494&&_1494.getAttribute("dtTargets")!=null){
- _1488.push("<rvDrillTargets>"+_1494.getAttribute("dtTargets")+"</rvDrillTargets>");
- }
- }
- }
- }
- }
- }
- return _1488;
- };
- CDrillManager.prototype.getDrillThroughParameters=function(_1495,evt){
- if(typeof _1495=="undefined"){
- _1495="query";
- }
- var _1497=[];
- if(typeof evt!="undefined"){
- var _1498=getCrossBrowserNode(evt,true);
- try{
- while(_1498){
- if(typeof _1498.getAttribute!="undefined"&&_1498.getAttribute("dtTargets")){
- _1497.push("<rvDrillTargets>"+_1498.getAttribute("dtTargets")+"</rvDrillTargets>");
- break;
- }
- _1498=_1498.parentNode;
- }
- }
- catch(e){
- return false;
- }
- }else{
- var oCV=this.getCV();
- var _149a=oCV.getDrillMgr();
- var _149b=_149a.getSelectionController();
- if(_149b!=null){
- var _149c=null;
- if(_149b.hasSelectedChartNodes()){
- var _149d=_149b.getSelectedChartNodes();
- var _149e=_149d[0];
- _149c=_149e.getArea();
- }
- if(_149c!=null){
- _1497.push("<rvDrillTargets>"+_149c.getAttribute("dtTargets")+"</rvDrillTargets>");
- }else{
- _1497=this.getAuthoredDrillThroughTargets();
- }
- }
- }
- if(_1497.length>0){
- var _149f="<AuthoredDrillTargets>";
- for(var _14a0=0;_14a0<_1497.length;++_14a0){
- _149f+=eval("\""+_1497[_14a0]+"\"");
- }
- _149f+="</AuthoredDrillTargets>";
- var _14a1=this.getCV().getAction("AuthoredDrill");
- if(_1495=="query"){
- _14a1.populateContextMenu(_149f);
- this.showOtherMenuItems();
- }else{
- if(this.getCV().envParams["cv.id"]=="AA"){
- this.getCV().m_viewerFragment.raiseAuthoredDrillClickEvent();
- }else{
- _14a1.execute(_149f);
- }
- }
- return true;
- }else{
- if(_1495=="query"){
- this.showOtherMenuItems();
- return true;
- }else{
- return false;
- }
- }
- };
- CDrillManager.prototype.executeAuthoredDrill=function(_14a2){
- var _14a3=decodeURIComponent(_14a2);
- var _14a4=this.getCV().getAction("AuthoredDrill");
- _14a4.executeDrillTarget(_14a3);
- };
- CDrillManager.prototype.doesMoreExist=function(_14a5){
- for(var i=0;i<_14a5.getNumItems();i++){
- var _14a7=_14a5.get(i);
- if(_14a7!=null){
- if((_14a7 instanceof CMenuItem)&&(_14a7.getLabel()==RV_RES.RV_MORE)&&(_14a7.getAction()==this.getCVObjectRef()+".getDrillMgr().launchGoToPage();")){
- return true;
- }
- }
- }
- return false;
- };
- CDrillManager.prototype.showOtherMenuItems=function(){
- var cv=this.getCV();
- var _14a9=cv.rvMainWnd;
- var _14aa=_14a9.getToolbarControl();
- var _14ab=null;
- var _14ac=null;
- if(typeof _14aa!="undefined"&&_14aa!=null){
- _14ab=_14aa.getItem("goto");
- if(_14ab){
- _14ac=_14ab.getMenu();
- }
- }
- var _14ad=_14a9.getContextMenu();
- var _14ae=_14a9.getUIHide();
- var _14af=null;
- if(typeof _14ad!="undefined"&&_14ad!=null&&_14ad.getGoToMenuItem()){
- _14af=_14ad.getGoToMenuItem().getMenu();
- }
- var _14b0=null;
- var _14b1=this.getSelectionController();
- if(_14ac!=null){
- if(this.doesMoreExist(_14ac)==false){
- if(typeof gMenuSeperator!="undefined"&&_14ac.getNumItems()>0&&(cv.bCanUseCognosViewerIndexSearch||_14ae.indexOf(" RV_TOOLBAR_BUTTONS_GOTO_RELATED_LINKS ")==-1)){
- _14ac.add(gMenuSeperator);
- }
- var _14b2=new CMenuItem(_14ac,RV_RES.RV_MORE,this.getCVObjectRef()+".getDrillMgr().launchGoToPage();","",gMenuItemStyle,cv.getWebContentRoot(),cv.getSkin());
- if(_14ae.indexOf(" RV_TOOLBAR_BUTTONS_GOTO_RELATED_LINKS ")!=-1){
- _14b2.hide();
- }else{
- if(_14b1==null||_14b1.getModelDrillThroughEnabled()==false){
- _14b2.disable();
- }
- }
- }
- }
- if(_14af!=null){
- if(typeof gMenuSeperator!="undefined"&&_14af.getNumItems()>0&&(cv.bCanUseCognosViewerIndexSearch||_14ae.indexOf(" RV_CONTEXT_MENU_GOTO_RELATED_LINKS ")==-1)){
- _14af.add(gMenuSeperator);
- }
- var _14b3=new CMenuItem(_14af,RV_RES.RV_MORE,this.getCVObjectRef()+".getDrillMgr().launchGoToPage();","",gMenuItemStyle,cv.getWebContentRoot(),cv.getSkin());
- if(_14ae.indexOf(" RV_CONTEXT_MENU_GOTO_RELATED_LINKS ")!=-1){
- _14b3.hide();
- }else{
- if(_14b1==null||_14b1.getModelDrillThroughEnabled()==false){
- _14b3.disable();
- }
- }
- }
- if(_14b0!=null&&_14b1!=null){
- var _14b4=_14b1.getAllSelectedObjects();
- if(_14b4==null||_14b4.length===0){
- _14b0.disable();
- }
- }
- if(_14ac!=null){
- _14ac.draw();
- if(_14ac.isVisible()){
- _14ac.show();
- }
- }
- if(_14af!=null){
- _14af.draw();
- if(_14af.isVisible()){
- _14af.show();
- }
- }
- };
- CDrillManager.prototype.ddc=function(evt){
- var node=getNodeFromEvent(evt);
- if(node!=null&&node.getAttribute("ddc")!=="1"){
- node.setAttribute("ddc","1");
- if(node.getAttribute("dtTargets")){
- node.className="dl "+node.className;
- node.setAttribute("href","#");
- return;
- }
- var _14b7=this.getSelectionController();
- if(_14b7!=null){
- var _14b8=_14b7.getSelectionObjectFactory().getSelectionChartObject(node);
- if(_14b8!=null){
- var _14b9=_14b8.getDrillOptions();
- for(var idx=0;idx<_14b9.length;++idx){
- var _14bb=_14b9[idx][0];
- if((node.getAttribute("isChartTitle")==="true"&&_14bb=="1")||_14bb=="3"||_14bb=="2"){
- node.className="dl "+node.className;
- node.setAttribute("href","#");
- break;
- }
- }
- }
- }
- }
- };
- CDrillManager.prototype.buildRvTargetsForSingleDrillThrough=function(_14bc){
- if(typeof _14bc=="undefined"||_14bc==null){
- return null;
- }
- var _14bd=this.getCV().getDrillTargets();
- if(!_14bd||_14bd.length==0){
- return null;
- }
- var _14be=_14bc[0][0];
- if(typeof _14be=="undefined"||_14be==null){
- return null;
- }
- var _14bf=_14bd[_14be];
- if(typeof _14bf=="undefined"||_14bf==null){
- return null;
- }
- var _14c0="<drillTarget drillIdx=\\\""+_14be+"\\\" label=\\\""+_14bf.getLabel()+"\\\"/>";
- return "<rvDrillTargets>"+_14c0+"</rvDrillTargets>";
- };
- CDrillManager.prototype.buildRvTargetsForMultipleDrillThrough=function(_14c1){
- if(typeof _14c1=="undefined"||_14c1==null){
- return null;
- }
- var _14c2=this.getCV().getDrillTargets();
- if(!_14c2||_14c2.length==0){
- return null;
- }
- var _14c3="";
- for(var _14c4=0;_14c4<_14c1.length;++_14c4){
- var _14c5=_14c1[_14c4];
- if(_14c5.length<2){
- continue;
- }
- var _14c6=_14c5[0];
- if(typeof _14c6=="undefined"||_14c6==null){
- continue;
- }
- var _14c7=_14c5[1];
- if(typeof _14c7=="undefined"||_14c7==null){
- continue;
- }
- var _14c8=_14c2[_14c6];
- if(typeof _14c8=="undefined"||_14c8==null){
- continue;
- }
- if(_14c7===null||_14c7===""){
- _14c7=_14c8.getLabel();
- }
- _14c3+="<drillTarget drillIdx=\\\""+_14c6+"\\\" label=\\\""+_14c7+"\\\"/>";
- }
- if(_14c3.length>0){
- return "<rvDrillTargets>"+_14c3+"</rvDrillTargets>";
- }
- return null;
- };
- function CImageMapHighlight(map,_14ca){
- this.m_webContentRoot=_14ca;
- this.createHighlight=CImageMapHighlight.prototype.createHighlightElement;
- this.initialize(map);
- };
- CImageMapHighlight.prototype.initialize=function(map){
- this.m_map=map;
- this.m_areas={};
- this.m_areaNodes={};
- this.m_visibleAreas=[];
- this.initImageBlank();
- this.m_divCanvas=null;
- this.m_creationNode=null;
- this._setMapAreasId();
- this.m_sDefaultFillColour="#F7E1BC";
- this.m_sDefaultStrokeColour="#F0A630";
- this.m_sFillColour=this.m_sDefaultFillColour;
- this.m_sStrokeColour=this.m_sDefaultStrokeColour;
- };
- CImageMapHighlight.prototype.setFillColour=function(_14cc){
- this.m_sFillColour=(!_14cc)?this.m_sDefaultFillColour:_14cc;
- };
- CImageMapHighlight.prototype.getFillColour=function(){
- return this.m_sFillColour;
- };
- CImageMapHighlight.prototype.setStrokeColour=function(_14cd){
- this.m_sStrokeColour=(!_14cd)?this.m_sDefaultStrokeColour:_14cd;
- };
- CImageMapHighlight.prototype.getStrokeColour=function(){
- return this.m_sStrokeColour;
- };
- CImageMapHighlight.prototype.resetColours=function(){
- this.m_sStrokeColour=this.m_sDefaultStrokeColour;
- this.m_sFillColour=this.m_sDefaultFillColour;
- };
- CImageMapHighlight.prototype.initImageBlank=function(){
- var img=this._getChartImageFromMap();
- if(img===null){
- return;
- }
- this.m_img=img;
- this.m_sImageHeight=img.offsetHeight+"px";
- this.m_sImageWidth=img.offsetWidth+"px";
- this.m_sUseMap=img.getAttribute("usemap");
- this.m_imgLid=img.getAttribute("lid");
- this.m_imgBlank=img.ownerDocument.createElement("IMG");
- this.m_imgBlank.src=this.m_webContentRoot+"/rv/images/blank.gif";
- this.m_imgBlank.style.height=this.m_sImageHeight;
- this.m_imgBlank.style.width=this.m_sImageWidth;
- this.m_imgBlank.style.position="absolute";
- this.m_imgBlank.border="0";
- this.m_imgBlank.useMap=this.m_sUseMap;
- this.m_imgBlank.setAttribute("lid",this.m_imgLid);
- this.m_imgBlank.setAttribute("rsvpchart",img.getAttribute("rsvpchart"));
- this.m_imgBlank.alt=img.alt;
- if(this.m_bShowPointer){
- this.m_imgBlank.style.cursor="auto";
- }
- this.m_imgBlank.v_bIsBlankImageMapImg=true;
- img.parentNode.insertBefore(this.m_imgBlank,img);
- this.f_copyStyle(img,this.m_imgBlank);
- this.m_imgBlank.style.borderColor="transparent";
- };
- CImageMapHighlight.prototype._getChartImageFromMap=function(){
- var map=this.m_map;
- var _14d0=null;
- var _14d1=null;
- var _14d2=map.nextSibling;
- while(_14d2){
- if(_14d2.tagName=="DIV"){
- var _14d3=_14d2.firstChild;
- while(_14d3){
- if((_14d3.tagName=="SPAN"||_14d3.tagName=="DIV")&&_14d3.getAttribute("chartcontainer")=="true"){
- _14d1=_14d3;
- break;
- }
- _14d3=_14d3.nextSibling;
- }
- }
- if(_14d1){
- break;
- }
- _14d2=_14d2.nextSibling;
- }
- if(_14d1){
- var _14d4=_14d1.children;
- var _14d5=_14d4.length;
- for(var i=0;i<_14d5;i++){
- var el=_14d4[i];
- if(el.tagName=="IMG"&&el.getAttribute("rsvpchart")=="true"&&el.getAttribute("usemap")=="#"+map.name){
- _14d0=el;
- break;
- }
- }
- }
- return _14d0;
- };
- CImageMapHighlight.prototype._AREA_ID="aid";
- CImageMapHighlight.prototype._setMapAreasId=function(){
- var _14d8=this.m_map.getAttribute("lid")+"_";
- var areas=this.m_map.childNodes;
- var _14da=areas.length;
- for(var i=0;i<_14da;i++){
- var a=areas[i];
- var id=_14d8+i;
- a.setAttribute(this._AREA_ID,id);
- this.m_areaNodes[id]=a;
- }
- };
- CImageMapHighlight.prototype.isAreaInitialized=function(area){
- return (area.getAttribute(this._AREA_ID)===null?false:true);
- };
- CImageMapHighlight.prototype.getAreaId=function(area){
- var _14e0=area.getAttribute(this._AREA_ID);
- if(_14e0===null){
- this.initialize(area.parentNode);
- _14e0=area.getAttribute(this._AREA_ID);
- }
- return _14e0+this.getFillColour();
- };
- CImageMapHighlight.prototype.getAreaFromId=function(_14e1){
- return this.m_areaNodes[_14e1];
- };
- CImageMapHighlight.prototype.highlightArea=function(area,_14e3){
- var _14e4=this.getAreaId(area);
- if(!_14e3){
- var _14e5=this.m_visibleAreas;
- var _14e6=_14e5.length;
- for(var i=0;i<_14e6;i++){
- if(_14e4!=_14e5[i]){
- this.hideAreaById(_14e5[i]);
- }
- }
- this.m_visibleAreas=[];
- }
- this._highlightArea(area);
- };
- CImageMapHighlight.prototype.highlightAreas=function(areas,_14e9){
- if(!_14e9){
- this.hideAllAreas();
- }
- this._highlightAreas(areas);
- };
- CImageMapHighlight.prototype._highlightAreas=function(areas){
- var _14eb=areas.length;
- for(var i=0;i<_14eb;i++){
- this._highlightArea(areas[i]);
- }
- };
- CImageMapHighlight.prototype._highlightArea=function(area){
- var _14ee=this.getAreaId(area);
- if(!this.highlightAreaExists(_14ee)){
- var _14ef=this.createHighlight(area);
- if(_14ef){
- this.m_areas[_14ee]=_14ef;
- _14ef.style.visibility="visible";
- area.setAttribute("highlighted","true");
- }
- }else{
- if(this.m_areas[_14ee].style.visibility=="hidden"){
- this.m_areas[_14ee].style.visibility="visible";
- area.setAttribute("highlighted","true");
- }
- }
- this.m_visibleAreas.push(_14ee);
- };
- CImageMapHighlight.prototype.highlightAreaExists=function(_14f0){
- return this.m_areas[_14f0]?true:false;
- };
- CImageMapHighlight.prototype.hideAreaById=function(_14f1){
- if(this.m_areas[_14f1]&&this.m_areas[_14f1].style.visibility){
- this.m_areas[_14f1].style.visibility="hidden";
- }
- };
- CImageMapHighlight.prototype.hideAreas=function(areas){
- var _14f3=areas.length;
- for(var i=0;i<_14f3;i++){
- this.hideArea(areas[i]);
- }
- };
- CImageMapHighlight.prototype.hideArea=function(area){
- this.hideAreaById(this.getAreaId(area));
- area.setAttribute("highlighted","false");
- };
- CImageMapHighlight.prototype.hideAllAreas=function(){
- var _14f6=this.m_visibleAreas;
- var _14f7=_14f6.length;
- for(var i=0;i<_14f7;i++){
- this.hideAreaById(_14f6[i]);
- var _14f9=this.getAreaFromId(_14f6[i]);
- if(_14f9){
- _14f9.setAttribute("highlighted","false");
- }
- }
- this.m_visibleAreas=[];
- };
- CImageMapHighlight.prototype.isAreaHighlighted=function(area){
- var _14fb=this.getAreaId(area);
- return this.m_areas[_14fb]&&this.m_areas[_14fb].style.visibility=="visible";
- };
- CImageMapHighlight.prototype.removeAreaHighlights=function(areas){
- };
- CImageMapHighlight.prototype.removeAllAreaHighlights=function(){
- };
- CImageMapHighlight.prototype.destroy=function(area){
- this.removeAllAreaHighlights();
- };
- CImageMapHighlight.prototype.createHighlightElement=function(_14fe,_14ff){
- var doc=_14fe.ownerDocument;
- if(!this.m_divCanvas){
- for(var _1501=this.m_img.parentNode;_1501;_1501=_1501.parentNode){
- if((_1501.nodeName=="DIV")&&(_1501.getAttribute("sSpecName")=="block")){
- var _1502=doc.defaultView.getComputedStyle(_1501,null);
- var _1503=_1502.overflow;
- if((_1503=="auto")||(_1503=="scroll")&&(_1502.position!="relative")){
- _1501.style.position="relative";
- }
- }
- }
- this.m_divCanvas=doc.createElementNS("http://www.w3.org/2000/svg","svg");
- this.m_divCanvas.style.height=this.m_sImageHeight;
- this.m_divCanvas.style.width=this.m_sImageWidth;
- this.m_divCanvas.style.position="absolute";
- this.m_img.parentNode.insertBefore(this.m_divCanvas,this.m_imgBlank);
- this.f_copyStyle(this.m_imgBlank,this.m_divCanvas);
- this.m_divCanvas.style.display=this.m_bHiddenCanvas?"none":"block";
- }
- var _1504=doc.createElementNS("http://www.w3.org/2000/svg","polyline");
- var _1505=_14fe.getAttribute("coords");
- _1504.setAttribute("points",_14fe.getAttribute("coords")+" "+_1505.substr(0,_1505.indexOf(",",_1505.indexOf(",")+1)));
- _1504.style.position="absolute";
- _1504.style.top="0px";
- _1504.style.left="0px";
- _1504.style.visibility="hidden";
- _1504.setAttribute("stroke",_14ff?"#F7CB83":this.getStrokeColour());
- _1504.setAttribute("stroke-width",(_14fe.getAttribute("type")=="legendLabel")?"1pt":"1.75pt");
- _1504.setAttribute("fill",_14ff?"#F7E1BC":this.getFillColour());
- _1504.setAttribute("fill-opacity","0.4");
- this.m_divCanvas.appendChild(_1504);
- return _1504;
- };
- CImageMapHighlight.prototype.f_copyStyle=function(_1506,_1507){
- var a=["margin","marginTop","marginRight","marginBottom","marginLeft","border","borderTop","borderRight","borderBottom","borderLeft"];
- var _1509=a.length;
- for(var i=0;i<_1509;i++){
- var _150b=a[i];
- var _150c=_1506.style[_150b];
- if(_150c){
- _1507.style[_150b]=_150c;
- }
- }
- };
- function CSelectionXml(_150d,_150e,_150f){
- this.queries={};
- this.burstContext=_150d||"";
- this.expressionLocale=_150e||"";
- this.contentLocale=_150f||"";
- };
- function SC_SingleSelection(){
- this.rows=[];
- this.cols=[];
- this.sections=[];
- this.measures=[];
- this.layoutElementId="";
- };
- function SC_SingleQuery(){
- this.selections=[];
- this.slicers=[];
- this.filters=[];
- };
- function SC_SingleSlicer(){
- };
- function SC_SingleDetailFilter(){
- };
- function SC_SingleSummaryFilter(){
- };
- CSelectionXml.prototype.BuildSelectionFromController=function(sc){
- if(sc){
- var _1511=sc.getAllSelectedObjects();
- for(var s=0;s<_1511.length;++s){
- var _1513=_1511[s];
- var _1514=_1513.getSelectedContextIds();
- var muns=_1513.getMuns();
- var _1516=muns.length;
- var _1517=new SC_SingleSelection();
- _1517.layoutElementId=_1513.getLayoutElementId();
- var _1518=null;
- for(var i=0;i<_1516;++i){
- var j,ctxId,_151c;
- if(i===0&&_1516===1){
- for(j=0;j<muns[i].length;++j){
- ctxId=_1514[i][j];
- if(ctxId!=0){
- if(j===0){
- _1518=sc.getRefQuery(ctxId);
- _151c=_1513.getDisplayValues()[j];
- this._buildMeasureSelection(sc,ctxId,_1517.measures,_151c,j,_1513.getLayoutType());
- }else{
- if(sc.getUsageInfo(ctxId)!=2){
- this._buildEdgeSelection(sc,ctxId,_1517.cols,j);
- }
- }
- }
- }
- }else{
- for(j=0;j<muns[i].length;++j){
- ctxId=_1514[i][j];
- if(ctxId!=0){
- if(i===0){
- _151c=_1513.getDisplayValues()[j];
- _1518=sc.getRefQuery(ctxId);
- this._buildMeasureSelection(sc,ctxId,_1517.measures,_151c,j,_1513.getLayoutType());
- }else{
- if(i===1){
- this._buildEdgeSelection(sc,ctxId,_1517.rows,j);
- }else{
- if(i===2){
- this._buildEdgeSelection(sc,ctxId,_1517.cols,j);
- }else{
- this._buildSectionSelection(sc,ctxId,_1517.sections,j);
- }
- }
- }
- }
- }
- }
- }
- this.AddSelection(_1518,_1517);
- }
- }
- };
- CSelectionXml.prototype.AddSelection=function(_151d,_151e){
- if(!this.queries[_151d]){
- this.queries[_151d]=new SC_SingleQuery();
- }
- this.queries[_151d].selections.push(_151e);
- };
- CSelectionXml.prototype._buildMeasureSelection=function(sc,ctxId,_1521,_1522,idx,_1524){
- if(_1524==""||_1524==null){
- _1524="datavalue";
- }
- if(ctxId){
- _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"});
- }
- };
- CSelectionXml.prototype._buildEdgeSelection=function(sc,ctxId,edges,idx){
- if(ctxId){
- 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)});
- }
- };
- CSelectionXml.prototype._buildSectionSelection=function(sc,ctxId,_152b,idx){
- if(ctxId){
- _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)});
- }
- };
- CSelectionXml.prototype.getUseValue=function(sc,ctxId){
- var _152f=sc.getMun(ctxId);
- if(_152f==""){
- _152f=sc.getUseValue(ctxId);
- }
- return _152f;
- };
- CSelectionXml.prototype.toXml=function(){
- var _1530=XMLBuilderCreateXMLDocument("selections");
- var _1531=_1530.documentElement;
- XMLBuilderSetAttributeNodeNS(_1531,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
- XMLBuilderSetAttributeNodeNS(_1531,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
- XMLBuilderSetAttributeNodeNS(_1531,"SOAP-ENC:arrayType","bus:parameterValue[]","http://schemas.xmlsoap.org/soap/encoding/");
- XMLBuilderSetAttributeNodeNS(_1531,"xmlns:xsd","http://www.w3.org/2001/XMLSchema");
- XMLBuilderSetAttributeNodeNS(_1531,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _1531.setAttribute("contentLocale",this.contentLocale);
- _1531.setAttribute("expressionLocale",this.expressionLocale);
- for(var q in this.queries){
- this._queryToXml(_1531,q,this.queries[q]);
- }
- this._burstToXml(_1531);
- return XMLBuilderSerializeNode(_1530);
- };
- CSelectionXml.prototype._queryToXml=function(_1533,name,obj){
- var _1536=_1533.ownerDocument.createElement("query");
- _1536.setAttribute("name",name);
- for(var _1537=0;_1537<obj.selections.length;++_1537){
- this._selectionToXml(_1536,obj.selections[_1537]);
- }
- for(var _1538=0;_1538<obj.slicers.length;++_1538){
- this._slicersToXml(_1536,obj.slicers[_1538]);
- }
- for(var _1539=0;_1539<obj.selections.length;++_1539){
- this._filtersToXml(_1536,obj.selections[_1539]);
- }
- _1533.appendChild(_1536);
- };
- CSelectionXml.prototype._selectionToXml=function(_153a,_153b){
- var doc=_153a.ownerDocument;
- var _153d=doc.createElement("selection");
- _153a.appendChild(_153d);
- this._edgeToXml(_153d,"row",_153b.rows);
- this._edgeToXml(_153d,"column",_153b.cols);
- this._edgeToXml(_153d,"measure",_153b.measures);
- this._edgeToXml(_153d,"section",_153b.sections);
- var _153e=doc.createElement("layoutElementId");
- _153e.appendChild(doc.createTextNode(_153b.layoutElementId));
- _153d.appendChild(_153e);
- };
- CSelectionXml.prototype._edgeToXml=function(_153f,sEdge,_1541){
- var doc=_153f.ownerDocument;
- var _1543=doc.createElement(sEdge+"s");
- _153f.appendChild(_1543);
- for(var i=0;i<_1541.length;++i){
- var _1545=doc.createElement(sEdge);
- _1543.appendChild(_1545);
- var edge=_1541[i];
- for(var j in edge){
- if(j!=="name"&&j!=="values"){
- _1545.setAttribute(j,edge[j]!==null?edge[j]:"");
- }
- }
- this._itemToXml(_1545,edge.name,edge.values);
- }
- };
- CSelectionXml.prototype._itemToXml=function(_1548,name,_154a){
- var doc=_1548.ownerDocument;
- var _154c=doc.createElement("item");
- XMLBuilderSetAttributeNodeNS(_154c,"xsi:type","bus:parameterValue","http://www.w3.org/2001/XMLSchema-instance");
- var _154d=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:name",doc);
- XMLBuilderSetAttributeNodeNS(_154d,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- _154d.appendChild(doc.createTextNode(name));
- _154c.appendChild(_154d);
- var _154e=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:value",doc);
- XMLBuilderSetAttributeNodeNS(_154e,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- XMLBuilderSetAttributeNodeNS(_154e,"SOAP-ENC:arrayType","bus:parmValueItem[]","http://schemas.xmlsoap.org/soap/encoding/");
- _154c.appendChild(_154e);
- for(var j=0;j<_154a.length;j++){
- var _1550=doc.createElement("item");
- XMLBuilderSetAttributeNodeNS(_1550,"xsi:type","bus:simpleParmValueItem","http://www.w3.org/2001/XMLSchema-instance");
- var _1551=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:use",doc);
- XMLBuilderSetAttributeNodeNS(_1551,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- if(_154a[j].use){
- _1551.appendChild(doc.createTextNode(_154a[j].use));
- }else{
- if(_154a[j].display){
- _1551.appendChild(doc.createTextNode(_154a[j].display));
- }else{
- _1551.appendChild(doc.createTextNode(""));
- }
- }
- var _1552=XMLBuilderCreateElementNS("http://developer.cognos.com/schemas/bibus/3/","bus:display",doc);
- XMLBuilderSetAttributeNodeNS(_1552,"xsi:type","xs:string","http://www.w3.org/2001/XMLSchema-instance");
- if(_154a[j].display){
- _1552.appendChild(doc.createTextNode(_154a[j].display));
- }else{
- _1552.appendChild(doc.createTextNode(""));
- }
- _1550.appendChild(_1551);
- _1550.appendChild(_1552);
- _154e.appendChild(_1550);
- }
- _1548.appendChild(_154c);
- };
- CSelectionXml.prototype._burstToXml=function(_1553){
- var doc=_1553.ownerDocument;
- var _1555=doc.createElement("burst-context");
- _1555.appendChild(doc.createTextNode(this.burstContext));
- _1553.appendChild(_1555);
- };
- CSelectionXml.prototype._slicersToXml=function(_1556,_1557){
- };
- CSelectionXml.prototype._filtersToXml=function(_1558,_1559){
- };
- CSubscriptionManager.k_SubscriptionWizardName="subscriptionWizard";
- function CSubscriptionManager(cv){
- this.m_cv=cv;
- this.m_bInitialized=false;
- this.m_aWatchRules=null;
- this.m_sEmail="";
- this.m_sAlertNewVersionConfirm="";
- this.m_sQueryNotificationResponse="";
- this.m_bAllowNotification=false;
- this.m_bAllowSubscription=false;
- this.m_bCanCreateNewWatchRule=false;
- this.m_bCanGetNotified=false;
- this.m_bAllowAnnotations=false;
- this.m_bCanCreateAnnotations=false;
- this.m_windowOptions="width=450,height=350,toolbar=0,location=0,status=0,menubar=0,resizable,scrollbars=1";
- };
- CSubscriptionManager.prototype.getViewer=function(){
- return this.m_cv;
- };
- CSubscriptionManager.prototype.Initialize=function(_155b){
- try{
- var _155c=_155b.getJSONResponseObject();
- var _155d=document.forms["formWarpRequest"+this.m_cv.getId()];
- if(_155c["annotationInfo"]){
- var _155e=_155c["annotationInfo"];
- this.m_AnnotationsCount=_155e.annotations.length;
- this.m_annotations=_155e.annotations;
- this.m_bAllowAnnotations=_155e.allowAnnotations;
- this.m_bCanCreateAnnotations=_155e.traverse=="true";
- return true;
- }
- if(_155c["subscriptionInfo"]){
- var _155f=_155c["subscriptionInfo"];
- if(!this.m_bInitialized){
- this.m_sEmail=_155f.sEmail;
- this.m_bAllowNotification=_155f.bAllowNotification;
- this.m_bAllowSubscription=_155f.bAllowSubscription;
- this.m_sAlertNewVersionConfirm=_155f.sAlertNewVersionConfirm;
- if(_155d["ui.action"]&&_155d["ui.action"].value=="view"){
- if(_155d["ui.format"]){
- this.m_bCanCreateNewWatchRule=(_155d["ui.format"].value=="HTML")&&this.m_cv.bCanUseCognosViewerConditionalSubscriptions&&this.m_bAllowSubscription;
- }
- this.m_bCanGetNotified=(!_155d["ui.burstKey"]||(_155d["ui.burstKey"]&&_155d["ui.burstKey"].value==""))&&this.m_bAllowNotification;
- }
- }
- if(_155f.sQueryNotificationResponse){
- this.m_sQueryNotificationResponse=_155f.sQueryNotificationResponse;
- }
- if(_155f.aWatchRules){
- var _1560=_155f.aWatchRules;
- this.m_aWatchRules=[];
- for(var i=0;i<_1560.length;i++){
- this.m_aWatchRules.push(_1560[i]);
- }
- }
- this.m_bInitialized=true;
- return true;
- }
- }
- catch(exception){
- return false;
- }
- return false;
- };
- CSubscriptionManager.prototype.IsValidSelectionForNewRule=function(){
- var _1562=this.m_cv.getSelectionController();
- if(_1562&&!_1562.hasSelectedChartNodes()){
- var _1563=_1562.getAllSelectedObjects();
- if(_1563.length===1){
- if(_1563[0]!=null&&_1563[0].getLayoutType()!="columnTitle"){
- return true;
- }
- }
- }
- return false;
- };
- CSubscriptionManager.prototype.CanCreateNewWatchRule=function(){
- if(typeof this.m_cv.UIBlacklist!="undefined"&&this.m_cv.UIBlacklist.indexOf(" RV_TOOLBAR_BUTTONS_ALERT_USING_NEW_WATCH_RULE ")!=-1){
- return false;
- }
- if(!this.m_bInitialized&&this.getViewer().envParams["ui.action"]=="view"){
- var oCV=this.getViewer();
- var _1565=new JSONDispatcherEntry(oCV);
- _1565.setKey("subscriptionManager");
- _1565.forceSynchronous();
- _1565.addFormField("ui.action","getSubscriptionInfo");
- _1565.addFormField("cv.responseFormat","subscriptionManager");
- _1565.addFormField("contextMenu","true");
- this.addCommonFormFields(_1565);
- _1565.setCallbacks({"complete":{"object":this,"method":this.Initialize}});
- oCV.dispatchRequest(_1565);
- }
- return this.m_bCanCreateNewWatchRule;
- };
- CSubscriptionManager.prototype.CanModifyWatchRule=function(){
- return this.m_cv.bCanUseCognosViewerConditionalSubscriptions&&this.m_bAllowSubscription;
- };
- CSubscriptionManager.prototype.CanGetNotified=function(){
- if(typeof this.m_cv.UIBlacklist!="undefined"&&this.m_cv.UIBlacklist.indexOf(" RV_TOOLBAR_BUTTONS_ALERT_ABOUT_NEW_VERSIONS ")!=-1){
- return false;
- }
- return this.m_bCanGetNotified;
- };
- CSubscriptionManager.prototype.UpdateSubscribeMenu=function(){
- var _1566=this.getStandaloneViewerToolbarControl();
- var _1567=_1566?_1566.getItem("watchNewVersions"):null;
- var _1568=this.m_cv.getWebContentRoot();
- var sSkin=this.m_cv.getSkin();
- if(_1567){
- var _156a=_1567.getMenu();
- this.ClearSubscriptionMenu();
- var _156b=false;
- if(this.CanGetNotified()){
- if(this.m_sQueryNotificationResponse=="on"){
- 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);
- _156b=true;
- }else{
- if(this.m_sQueryNotificationResponse=="off"&&this.m_sEmail!=""){
- 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);
- _156b=true;
- }
- }
- }
- if(this.CanCreateNewWatchRule()){
- if(_156b){
- _156a.add(gMenuSeperator);
- }
- 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);
- if(!this.IsValidSelectionForNewRule()){
- _156c.disable();
- }
- _156b=true;
- }
- var _156d="";
- if(typeof this.m_cv.UIBlacklist!="undefined"){
- _156d=this.m_cv.UIBlacklist;
- }
- var _156e;
- if(_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES ")==-1){
- if(_156b){
- _156a.add(gMenuSeperator);
- }
- if(this.m_aWatchRules&&this.m_aWatchRules.length>0){
- var _156f=this.CanModifyWatchRule();
- for(var sub=0;sub<this.m_aWatchRules.length;++sub){
- var menu=new CMenuItem(_156a,this.m_aWatchRules[sub].name,"",_1568+"/rv/images/icon_subscription.gif",gMenuItemStyle,_1568,sSkin);
- var _1572=menu.createCascadedMenu(gMenuStyle);
- _1572.m_oCV=this.m_cv;
- if(_156f&&_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES_MODIFY ")==-1){
- 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);
- }
- if(_156d.indexOf(" RV_TOOLBAR_BUTTONS_RULES_DELETE ")==-1){
- 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);
- }
- }
- }else{
- _156e=new CMenuItem(_156a,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_1568,sSkin);
- _156e.disable();
- }
- }
- if(_156a.getNumItems()==0){
- _156e=new CMenuItem(_156a,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_1568,sSkin);
- _156e.disable();
- }
- _156a.setForceCallback(false);
- _156a.draw();
- if(_156a.isVisible()){
- _156a.show();
- }
- _156a.setForceCallback(true);
- }
- };
- CSubscriptionManager.prototype.UpdateAnnotationMenu=function(){
- var _1573=this.getStandaloneViewerToolbarControl();
- var _1574=_1573?_1573.getItem("addAnnotations"):null;
- var _1575=this.m_cv.getWebContentRoot();
- var sSkin=this.m_cv.getSkin();
- var _1577=_1574.getMenu();
- this.ClearAnnotationMenu();
- 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);
- var _1579=this.m_annotations.length;
- if(_1579>0){
- _1577.add(gMenuSeperator);
- }
- if(!this.m_bAllowAnnotations||!this.m_bCanCreateAnnotations){
- menu.disable();
- }
- var _157a;
- var bidi=isViewerBidiEnabled()?BidiUtils.getInstance():null;
- for(var i=0;i<_1579;i++){
- var _157d=this.m_annotations[i].defaultName;
- _157a=_157d.length>60?_157d.substring(0,60)+"...":_157d;
- if(isViewerBidiEnabled()){
- _157a=bidi.btdInjectUCCIntoStr(_157a,getViewerBaseTextDirection());
- }
- var _157e=Boolean(this.m_annotations[i].permissions.read);
- var _157f=Boolean(this.m_annotations[i].permissions.write);
- var _1580=Boolean(this.m_annotations[i].permissions.traverse)&&Boolean(this.m_annotations[i].permissions.write);
- var _1581="javascript:"+this.m_cv.getObjectId()+".getSubscriptionManager().ViewAnnotation("+i+");";
- var _1582="javascript:alert('Permission denied')";
- _1581=_157e?_1581:_1582;
- if(i>0&&this.m_annotations[i].layoutElementId!=this.m_annotations[i-1].layoutElementId){
- _1577.add(gMenuSeperator);
- }
- var _1583="/rv/images/action_comment.gif";
- if(this.m_annotations[i].layoutElementId!=""){
- _1583="/rv/images/action_subscribe.gif";
- }
- menu=new CMenuItem(_1577,_157a,_1581,_1575+_1583,gMenuItemStyle,_1575,sSkin);
- var _1584=menu.createCascadedMenu(gMenuStyle);
- var _1585=new CInfoPanel("300px",_1575,_1584.getId()+"_comments");
- _1585.setParent(_1584);
- _157d=this.m_annotations[i].defaultName;
- var _1586=_157d.length>60?_157d.substring(0,60)+"...":_157d;
- if(isViewerBidiEnabled()){
- _1586=bidi.btdInjectUCCIntoStr(_1586,getViewerBaseTextDirection());
- }
- _1585.addProperty(RV_RES.RV_VIEW_COMMENT_NAME,html_encode(_1586));
- _1585.addSpacer(4);
- var cmnt=this.m_annotations[i].description;
- var _1588=cmnt.length>590?cmnt.substring(0,590)+"...":cmnt;
- if(isViewerBidiEnabled()){
- _1588=bidi.btdInjectUCCIntoStr(_1588,getViewerBaseTextDirection());
- }
- _1585.addProperty(RV_RES.RV_VIEW_COMMENT_CONTENTS,replaceNewLine(html_encode(_1588)));
- _1585.addSpacer(4);
- var _1589=this.m_annotations[i].modificationTime;
- if(isViewerBidiEnabled()){
- _1589=bidi.btdInjectUCCIntoStr(_1589,getViewerBaseTextDirection());
- }
- _1585.addProperty(RV_RES.RV_VIEW_COMMENT_MODTIME,_1589);
- var _158a=this.m_annotations[i].owner.defaultName;
- if(isViewerBidiEnabled()){
- _158a=bidi.btdInjectUCCIntoStr(_158a,getViewerBaseTextDirection());
- }
- _1585.addProperty(RV_RES.RV_VIEW_COMMENT_OWNER,_158a);
- _1584.add(_1585);
- if(_157f||_1580){
- _1584.add(gMenuSeperator);
- }
- 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);
- if(_157f){
- 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);
- }
- if(_1580){
- 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);
- }
- }
- _1577.setForceCallback(false);
- _1577.draw();
- if(_1577.isVisible()){
- _1577.show();
- }
- _1577.setForceCallback(true);
- };
- CSubscriptionManager.prototype.AddNotification=function(){
- alert(this.m_sAlertNewVersionConfirm);
- var oCV=this.getViewer();
- var _158c=new DataDispatcherEntry(oCV);
- _158c.setKey("subscriptionManager");
- _158c.addFormField("ui.action","addNotification");
- _158c.addFormField("cv.responseFormat","data");
- this.addCommonFormFields(_158c);
- oCV.dispatchRequest(_158c);
- };
- CSubscriptionManager.prototype.DeleteNotification=function(){
- alert(RV_RES.RV_DO_NOT_ALERT_NEW_VERSION_CONFIRM);
- var oCV=this.getViewer();
- var _158e=new DataDispatcherEntry(oCV);
- _158e.setKey("subscriptionManager");
- _158e.addFormField("ui.action","deleteNotification");
- _158e.addFormField("cv.responseFormat","data");
- this.addCommonFormFields(_158e);
- oCV.dispatchRequest(_158e);
- };
- CSubscriptionManager.prototype.NewAnnotation=function(){
- var oFWR=document.forms["formWarpRequest"+this.m_cv.getId()];
- var _1590=oFWR["ui.object"].value;
- var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
- GUtil.createFormField(form,"ui.object",_1590);
- GUtil.createFormField(form,"b_action","xts.run");
- GUtil.createFormField(form,"m","rv/annotation1.xts");
- GUtil.createFormField(form,"backURL","javascript:window.close();");
- GUtil.createFormField(form,"action_hint","create");
- var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
- window.open(sPath,form.target,this.m_windowOptions);
- };
- CSubscriptionManager.prototype.ViewAnnotation=function(idx){
- var sub=this.m_annotations[idx];
- var _1595=sub.searchPath;
- var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
- GUtil.createFormField(form,"ui.object",_1595);
- GUtil.createFormField(form,"b_action","xts.run");
- GUtil.createFormField(form,"m","rv/annotation1.xts");
- GUtil.createFormField(form,"backURL","javascript:window.close();");
- var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
- window.open(sPath,form.target,this.m_windowOptions);
- };
- CSubscriptionManager.prototype.ModifyAnnotation=function(idx){
- var sub=this.m_annotations[idx];
- var _159a=this.m_annotations[idx].searchPath;
- if(sub&&_159a){
- var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
- GUtil.createFormField(form,"ui.object",_159a);
- GUtil.createFormField(form,"b_action","xts.run");
- GUtil.createFormField(form,"m","rv/annotation1.xts");
- GUtil.createFormField(form,"backURL","javascript:window.close();");
- GUtil.createFormField(form,"action_hint","save");
- var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
- window.open(sPath,form.target,this.m_windowOptions);
- }
- };
- CSubscriptionManager.prototype.DeleteAnnotation=function(idx){
- var sub=this.m_annotations[idx];
- if(sub&&sub.searchPath&&confirm(RV_RES.RV_CONFIRM_DELETE_WATCH_RULE)){
- var oCV=this.getViewer();
- var _15a0=new DataDispatcherEntry(oCV);
- _15a0.setKey("subscriptionManager");
- _15a0.addFormField("ui.action","deleteAnnotation");
- _15a0.addFormField("cv.responseFormat","data");
- this.addCommonFormFields(_15a0,sub.searchPath);
- oCV.dispatchRequest(_15a0);
- }
- };
- CSubscriptionManager.prototype.NewSubscription=function(){
- var sc=this.m_cv.getSelectionController();
- var oFWR=document.forms["formWarpRequest"+this.m_cv.getId()];
- var _15a3=oFWR.reRunObj.value;
- if(_15a3&&sc&&sc.getAllSelectedObjects().length===1){
- var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
- var fWR=document.getElementById("formWarpRequest"+this.m_cv.getId());
- var _15a6=new CSelectionXml(fWR["ui.burstID"].value,fWR["ui.contentLocale"].value,fWR["ui.outputLocale"].value);
- _15a6.BuildSelectionFromController(sc);
- GUtil.createFormField(form,"rv.selectionSpecXML",_15a6.toXml());
- GUtil.createFormField(form,"rv.periodicalProducer",_15a3);
- GUtil.createFormField(form,"b_action","xts.run");
- GUtil.createFormField(form,"m","subscribe/conditional_subscribe1.xts");
- GUtil.createFormField(form,"backURL","javascript:window.close();");
- var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
- window.open(sPath,form.target,"toolbar,location,status,menubar,resizable,scrollbars=1");
- }else{
- }
- };
- CSubscriptionManager.prototype.DeleteSubscription=function(idx){
- var sub=this.m_aWatchRules[idx];
- if(sub&&sub.searchPath&&confirm(RV_RES.RV_CONFIRM_DELETE_WATCH_RULE)){
- var oCV=this.getViewer();
- var _15ab=new DataDispatcherEntry(oCV);
- _15ab.setKey("subscriptionManager");
- _15ab.addFormField("ui.action","deleteSubscription");
- _15ab.addFormField("cv.responseFormat","data");
- this.addCommonFormFields(_15ab,sub.searchPath);
- oCV.dispatchRequest(_15ab);
- }
- };
- CSubscriptionManager.prototype.ModifySubscription=function(idx){
- var sub=this.m_aWatchRules[idx];
- if(sub&&sub.searchPath){
- var form=GUtil.createHiddenForm("subscriptionForm","post",this.m_cv.getId(),CSubscriptionManager.k_SubscriptionWizardName);
- GUtil.createFormField(form,"m_obj",sub.searchPath);
- GUtil.createFormField(form,"m_name",sub.name);
- GUtil.createFormField(form,"b_action","xts.run");
- GUtil.createFormField(form,"m_class","reportDataServiceAgentDefinition");
- GUtil.createFormField(form,"m","portal/properties_subscription.xts");
- GUtil.createFormField(form,"backURL","javascript:window.close();");
- var sPath=this.m_cv.getWebContentRoot()+"/rv/blankSubscriptionWin.html?cv.id="+this.m_cv.getId();
- window.open(sPath,form.target,"toolbar,location,status,menubar,resizable,scrollbars=1");
- }
- };
- CSubscriptionManager.prototype.OpenSubscriptionMenu=function(){
- var oCV=this.getViewer();
- var _15b1=new JSONDispatcherEntry(oCV);
- _15b1.setKey("subscriptionManager");
- _15b1.addFormField("ui.action","getSubscriptionInfo");
- _15b1.addFormField("cv.responseFormat","subscriptionManager");
- this.addCommonFormFields(_15b1);
- _15b1.setCallbacks({"complete":{"object":this,"method":this.OpenSubscriptionMenuResponse}});
- oCV.dispatchRequest(_15b1);
- };
- CSubscriptionManager.prototype.OpenAnnotationMenu=function(){
- var oCV=this.getViewer();
- var _15b3=new JSONDispatcherEntry(oCV);
- _15b3.setKey("subscriptionManager");
- _15b3.addFormField("ui.action","getAnnotationInfo");
- _15b3.addFormField("cv.responseFormat","getAnnotations");
- var _15b4=oCV.envParams["ui.object"];
- this.addCommonFormFields(_15b3,_15b4?_15b4:"");
- _15b3.setCallbacks({"complete":{"object":this,"method":this.OpenAnnotationMenuResponse}});
- oCV.dispatchRequest(_15b3);
- };
- CSubscriptionManager.prototype.OpenAnnotationMenuResponse=function(_15b5){
- if(this.Initialize(_15b5)){
- this.UpdateAnnotationMenu();
- }else{
- this.ClearAnnotationMenu();
- }
- };
- CSubscriptionManager.prototype.OpenSubscriptionMenuResponse=function(_15b6){
- if(this.Initialize(_15b6)){
- this.UpdateSubscribeMenu();
- }else{
- this.AddEmptySubscriptionMenuItem();
- }
- };
- CSubscriptionManager.prototype.addCommonFormFields=function(_15b7,_15b8){
- if(_15b8&&_15b8!=""){
- _15b7.addFormField("ui.object",_15b8);
- }else{
- var _15b9=document["formWarpRequest"+this.getViewer().getId()];
- if(_15b9&&_15b9["reRunObj"]){
- _15b7.addFormField("ui.object",_15b9["reRunObj"].value);
- }
- }
- if(_15b7.getFormField("ui.action")=="getSubscriptionInfo"){
- _15b7.addFormField("initialized",this.m_bInitialized?"true":"false");
- }
- _15b7.addFormField("cv.id",this.getViewer().getId());
- };
- CSubscriptionManager.prototype.AddEmptySubscriptionMenuItem=function(){
- var _15ba=this.getStandaloneViewerToolbarControl();
- if(_15ba){
- var _15bb=_15ba.getItem("watchNewVersions");
- if(_15bb){
- _15bb.getMenu().clear();
- }
- var _15bc=this.m_cv.getWebContentRoot();
- var sSkin=this.m_cv.getSkin();
- var _15be=_15bb.getMenu();
- var _15bf=new CMenuItem(_15be,RV_RES.RV_NO_WATCH_RULES,"","",gMenuItemStyle,_15bc,sSkin);
- _15bf.disable();
- _15be.setForceCallback(false);
- _15be.draw();
- if(_15be.isVisible()){
- _15be.show();
- }
- _15be.setForceCallback(true);
- }
- };
- CSubscriptionManager.prototype.ClearSubscriptionMenu=function(){
- var _15c0=this.getStandaloneViewerToolbarControl();
- if(_15c0){
- var _15c1=_15c0.getItem("watchNewVersions");
- if(_15c1){
- _15c1.getMenu().clear();
- }
- }
- };
- CSubscriptionManager.prototype.ClearAnnotationMenu=function(){
- var _15c2=this.getStandaloneViewerToolbarControl();
- if(_15c2){
- var _15c3=_15c2.getItem("addAnnotations");
- if(_15c3){
- _15c3.getMenu().clear();
- }
- }
- };
- CSubscriptionManager.prototype.ClearContextAnnotationMenu=function(){
- var _15c4=this.getStandaloneViewerContextMenu();
- if(_15c4){
- var _15c5=_15c4.getFindCommentMenuItem();
- if(_15c5){
- _15c5.getMenu().clear();
- }
- }
- };
- CSubscriptionManager.prototype.getStandaloneViewerToolbarControl=function(){
- if(typeof this.m_cv.rvMainWnd!="undefined"&&this.m_cv.rvMainWnd!=null&&typeof this.m_cv.rvMainWnd.getToolbarControl=="function"){
- return this.m_cv.rvMainWnd.getToolbarControl();
- }else{
- return null;
- }
- };
- CSubscriptionManager.prototype.getStandaloneViewerContextMenu=function(){
- if(typeof this.m_cv.rvMainWnd!="undefined"&&this.m_cv.rvMainWnd!=null&&typeof this.m_cv.rvMainWnd.getContextMenu=="function"){
- return this.m_cv.rvMainWnd.getContextMenu();
- }else{
- return null;
- }
- };
- function CSelectionMetadata(){
- this.m_sContextId="";
- this.m_sDataItem="";
- this.m_sMetadataModelItem="";
- this.m_sUseValue="";
- this.m_sUseValueType="";
- this.m_sType=null;
- this.m_sDisplayValue="";
- this.m_sUsage=null;
- this.m_refQuery=null;
- this.m_sHun=null;
- this.m_sDun=null;
- };
- CSelectionMetadata.prototype.setContextId=function(_15c6){
- this.m_sContextId=_15c6;
- };
- CSelectionMetadata.prototype.getContextId=function(){
- return this.m_sContextId;
- };
- CSelectionMetadata.prototype.setRefQuery=function(_15c7){
- this.m_refQuery=_15c7;
- };
- CSelectionMetadata.prototype.getRefQuery=function(){
- return this.m_refQuery;
- };
- CSelectionMetadata.prototype.setDataItem=function(_15c8){
- this.m_sDataItem=_15c8;
- };
- CSelectionMetadata.prototype.getDataItem=function(){
- return this.m_sDataItem;
- };
- CSelectionMetadata.prototype.setMetadataModelItem=function(_15c9){
- this.m_sMetadataModelItem=_15c9;
- };
- CSelectionMetadata.prototype.getMetadataModelItem=function(){
- return this.m_sMetadataModelItem;
- };
- CSelectionMetadata.prototype.setUseValue=function(_15ca){
- this.m_sUseValue=_15ca;
- };
- CSelectionMetadata.prototype.getUseValue=function(){
- return this.m_sUseValue;
- };
- CSelectionMetadata.prototype.setUseValueType=function(_15cb){
- this.m_sUseValueType=_15cb;
- };
- CSelectionMetadata.prototype.setType=function(sType){
- this.m_sType=sType;
- };
- CSelectionMetadata.prototype.getType=function(){
- var sType=null;
- switch(this.m_sUseValueType){
- case 25:
- case 27:
- case 30:
- case 32:
- sType="memberUniqueName";
- break;
- case 26:
- sType="memberCaption";
- break;
- case 1:
- case 55:
- case 56:
- sType="string";
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 22:
- case 21:
- case 23:
- case 24:
- case 54:
- sType=parseInt(this.m_sUseValueType,10);
- break;
- }
- return sType;
- };
- CSelectionMetadata.prototype.getUseValueType=function(){
- if(this.m_sType==null){
- this.m_sType=this.getType();
- }
- return this.m_sType;
- };
- CSelectionMetadata.prototype.setDisplayValue=function(_15ce){
- this.m_sDisplayValue=_15ce;
- };
- CSelectionMetadata.prototype.getDisplayValue=function(){
- return this.m_sDisplayValue;
- };
- CSelectionMetadata.prototype.setUsage=function(_15cf){
- this.m_sUsage=_15cf;
- };
- CSelectionMetadata.prototype.getUsage=function(){
- if(this.m_sUsage=="2"){
- return "measure";
- }else{
- return "nonMeasure";
- }
- };
- CSelectionMetadata.prototype.setHun=function(sHun){
- this.m_sHun=sHun;
- };
- CSelectionMetadata.prototype.getHun=function(){
- return this.m_sHun;
- };
- CSelectionMetadata.prototype.setDun=function(sDun){
- this.m_sDun=sDun;
- };
- CSelectionMetadata.prototype.getDun=function(){
- return this.m_sDun;
- };
- function CSelectionMetadataIterator(_15d2,_15d3){
- this.m_axisIndex=_15d3;
- this.m_index=0;
- this.m_selectionObject=_15d2;
- };
- CSelectionMetadataIterator.prototype.getSelectionAxis=function(){
- var _15d4=null;
- if(typeof this.m_selectionObject=="object"&&this.m_axisIndex<this.m_selectionObject.getSelectedContextIds().length){
- _15d4=this.m_selectionObject.getSelectedContextIds()[this.m_axisIndex];
- }
- return _15d4;
- };
- CSelectionMetadataIterator.prototype.hasNext=function(){
- var _15d5=this.getSelectionAxis();
- if(_15d5!=null){
- return (this.m_index<_15d5.length);
- }else{
- return false;
- }
- };
- CSelectionMetadataIterator.prototype.next=function(){
- var _15d6=null;
- if(this.hasNext()){
- _15d6=new CSelectionMetadata();
- _15d6.setContextId(this.m_selectionObject.m_contextIds[this.m_axisIndex][this.m_index]);
- _15d6.setDataItem(this.m_selectionObject.getDataItems()[this.m_axisIndex][this.m_index]);
- _15d6.setMetadataModelItem(this.m_selectionObject.getMetadataItems()[this.m_axisIndex][this.m_index]);
- if(this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]!=null&&this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]!=""){
- _15d6.setUseValue(this.m_selectionObject.getMuns()[this.m_axisIndex][this.m_index]);
- _15d6.setType("memberUniqueName");
- }else{
- _15d6.setUseValue(this.m_selectionObject.getUseValues()[this.m_axisIndex][this.m_index]);
- }
- if(typeof this.m_selectionObject.m_selectionController=="object"){
- var ctxId=this.m_selectionObject.getSelectedContextIds()[this.m_axisIndex][this.m_index];
- if(this.m_selectionObject.useDisplayValueFromObject){
- _15d6.setDisplayValue(this.m_selectionObject.getDisplayValues()[this.m_axisIndex]);
- }else{
- var _15d8=null;
- var _15d9=null;
- if(this.m_axisIndex===0){
- var _15da=this.m_selectionObject.getCellRef();
- if(_15da&&_15da.nodeName&&_15da.nodeName.toLowerCase()==="td"){
- _15d9=this.m_selectionObject.m_selectionController.getDisplayValueFromDOM(ctxId,_15da.parentNode);
- }
- }
- if(_15d9==null){
- _15d9=this.m_selectionObject.m_selectionController.getDisplayValue(ctxId);
- }
- if(_15d9===""){
- _15d9=this.m_selectionObject.m_selectionController.getUseValue(ctxId);
- }
- _15d6.setDisplayValue(_15d9);
- }
- _15d6.setUseValueType(this.m_selectionObject.m_selectionController.getDataType(ctxId));
- _15d6.setUsage(this.m_selectionObject.m_selectionController.getUsageInfo(ctxId));
- _15d6.setRefQuery(this.m_selectionObject.m_selectionController.getRefQuery(ctxId));
- _15d6.setHun(this.m_selectionObject.m_selectionController.getHun(ctxId));
- _15d6.setDun(this.m_selectionObject.m_selectionController.getDun(ctxId));
- }
- ++this.m_index;
- }
- return _15d6;
- };
- function CAxisSelectionIterator(_15db){
- this.m_index=0;
- this.m_selectionObject=_15db;
- };
- CAxisSelectionIterator.prototype.hasNext=function(){
- return ((typeof this.m_selectionObject=="object")&&(this.m_index<this.m_selectionObject.getSelectedContextIds().length));
- };
- CAxisSelectionIterator.prototype.next=function(){
- var _15dc=null;
- if(this.hasNext()){
- _15dc=new CSelectionMetadataIterator(this.m_selectionObject,this.m_index);
- ++this.m_index;
- }
- return _15dc;
- };
- function getSelectionContextIds(_15dd){
- var _15de=[];
- var _15df=_15dd.getAllSelectedObjects();
- if(_15df!=null&&_15df.length>0){
- for(var index=0;index<_15df.length;++index){
- var _15e1=_15df[index];
- var _15e2=_15e1.getSelectedContextIds();
- var _15e3=[];
- for(var item=0;item<_15e2.length;++item){
- var _15e5=_15e2[item].join(":");
- _15e3.push(_15e5);
- }
- _15de.push(_15e3.join("::"));
- }
- }
- return _15de;
- };
- function getViewerSelectionContext(_15e6,_15e7,_15e8){
- var _15e9=_15e8==true?_15e6.getAllSelectedObjectsWithUniqueCTXIDs():_15e6.getAllSelectedObjects();
- if(_15e9!=null&&_15e9.length>0){
- for(var index=0;index<_15e9.length;++index){
- var _15eb={};
- var _15ec=new CAxisSelectionIterator(_15e9[index]);
- if(_15ec.hasNext()){
- var _15ed=_15ec.next();
- if(_15ed.hasNext()){
- var _15ee=_15ed.next();
- var _15ef=_15ee.getContextId();
- _15eb[_15ef]=true;
- var _15f0=_15e7.addSelectedCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
- if(_15ee.getHun()!=null){
- _15f0.addProperty("HierarchyUniqueName",_15ee.getHun());
- }
- if(_15ee.getDun()!=null){
- _15f0.addProperty("DimensionUniqueName",_15ee.getDun());
- }
- while(_15ed.hasNext()){
- _15ee=_15ed.next();
- _15ef=_15ee.getContextId();
- if(typeof _15eb[_15ef]=="undefined"||_15ef===""){
- _15eb[_15ef]=true;
- var _15f1=_15f0.addDefiningCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
- if(_15ee.getHun()!=null){
- _15f1.addProperty("HierarchyUniqueName",_15ee.getHun());
- }
- if(_15ee.getDun()!=null){
- _15f1.addProperty("DimensionUniqueName",_15ee.getDun());
- }
- }
- }
- while(_15ec.hasNext()){
- _15ed=_15ec.next();
- var _15f2=_15f0;
- while(_15ed.hasNext()){
- _15ee=_15ed.next();
- _15ef=_15ee.getContextId();
- if(typeof _15eb[_15ef]=="undefined"||_15ef===""){
- _15eb[_15ef]=true;
- _15f2=_15f2.addDefiningCell(_15ee.getDataItem(),_15ee.getMetadataModelItem(),_15ee.getUseValue(),_15ee.getUseValueType(),_15ee.getDisplayValue(),_15ee.getUsage(),{"queryName":_15ee.getRefQuery()});
- if(_15ee.getHun()!=null){
- _15f2.addProperty("HierarchyUniqueName",_15ee.getHun());
- }
- if(_15ee.getDun()!=null){
- _15f2.addProperty("DimensionUniqueName",_15ee.getDun());
- }
- }
- }
- }
- }
- }
- }
- }
- var _15f3=_15e7.toString();
- if(window.gViewerLogger){
- window.gViewerLogger.log("Selection context",_15f3,"xml");
- }
- return _15f3;
- };
- dojo.provide("bux.dialogs.CalculationDialog");
- dojo.require("bux.dialogs.BaseCustomContentDialog");
- dojo.require("bux.layout.TableContainer");
- dojo.require("dijit.form.NumberTextBox");
- dojo.require("dijit.form.Button");
- dojo.declare("viewer.dialogs.CalculationDialog",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,sDescription:null,sContentLocale:null,okHandler:null,cancelHandler:null,startup:function(){
- this.updateTitle(this.sTitle);
- this.inherited(arguments);
- var _15f4=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
- var cell=null,row=null;
- if(this.sDescription){
- row=new bux.layout.TableContainerRow({parentContainer:_15f4});
- cell=new bux.layout.TableContainerCell({classname:"bux-dialog-info",parentContainer:row});
- cell.addContent(document.createTextNode(this.sDescription));
- dijit.setWaiState(this._buxBaseDialog.domNode,"describedBy",cell.id);
- }
- row=new bux.layout.TableContainerRow({parentContainer:_15f4});
- cell=new bux.layout.TableContainerCell({classname:"bux-dialog-label",parentContainer:row});
- this._calculationField=new dijit.form.NumberTextBox({required:true,onBlur:function(){
- if(!this._cancelled&&!this.isValid()){
- this.focus();
- }
- },_setOKBtnDisabled:function(_15f7,_15f8){
- if(_15f7&&_15f7[0]&&_15f7[0].label===RV_RES.IDS_JS_OK){
- _15f7[0].set("disabled",_15f8);
- }
- },isValid:function(){
- var _15f9=this.validator(this.get("displayedValue"),this.get("constraints"));
- this._setOKBtnDisabled(this.oDlgBtns,!_15f9);
- return _15f9;
- }});
- if(this.sContentLocale!=null){
- dojo.requireLocalization("dojo.cldr","number",this.sContentLocale);
- this._calculationField.constraints={locale:this.sContentLocale};
- }
- var _15fa=document.createElement("label");
- _15fa.appendChild(document.createTextNode(this.sLabel));
- _15fa.setAttribute("for",this._calculationField.id);
- cell.addContent(_15fa);
- row=new bux.layout.TableContainerRow({parentContainer:_15f4});
- cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
- cell.addContent(this._calculationField.domNode);
- this._calculationField.oDlgBtns=this._buxBaseDialog._aButtonObjects;
- },onOK:function(){
- if(this._calculationField.state!="Error"){
- this.inherited(arguments);
- this.okHandler(this._calculationField.get("value"));
- this.hide();
- }
- },onCancel:function(){
- this._calculationField._cancelled=true;
- this.inherited(arguments);
- }});
- dojo.provide("bux.dialogs.ConfirmationDialog");
- viewer.dialogs.ConfirmationDialog=function(_15fb,_15fc,_15fd,_15fe,_15ff,_1600){
- dojo["require"]("bux.dialogs.InformationDialog");
- var _1601=new bux.dialogs.Confirm(_15fb,_15fc,_15fd,dojo.hitch(_15ff,_1600,_15ff),_15fe);
- return _1601;
- };
- dojo.provide("bux.dialogs.SelectSnapshot");
- dojo.require("bux.dialogs.BaseCustomContentDialog");
- dojo.require("bux.layout.TableContainer");
- dojo.require("dijit.form.NumberTextBox");
- dojo.require("dijit.form.Button");
- dojo.declare("viewer.dialogs.SelectSnapshot",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,okHandler:null,cancelHandler:null,startup:function(){
- this.updateTitle(this.sTitle);
- this.inherited(arguments);
- var _1602=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
- var row=new bux.layout.TableContainerRow({parentContainer:_1602});
- var cell=new bux.layout.TableContainerCell({classname:"bux-dialog-label",parentContainer:row});
- this.createSnapshotsControl();
- var _1605=document.createElement("label");
- _1605.appendChild(document.createTextNode(this.sLabel));
- _1605.setAttribute("for",this._snapshots.id);
- cell.addContent(_1605);
- row=new bux.layout.TableContainerRow({parentContainer:_1602});
- cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
- cell.addContent(this._snapshots);
- },onOK:function(){
- this.inherited(arguments);
- var _1606=this._snapshots.selectedIndex;
- var _1607=this._snapshots.options[_1606];
- this.okHandler(_1607.getAttribute("storeID"),_1607.value);
- this.hide();
- },createSnapshotsControl:function(){
- this._snapshots=document.createElement("select");
- this._snapshots.id=this.dialogId+"snapshots";
- this._snapshots.setAttribute("size","8");
- this._snapshots.setAttribute("name",this.dialogId+"snapshots");
- var _1608=XMLHelper_FindChildByTagName(this.cmResponse,"result",true);
- var _1609=XMLHelper_FindChildrenByTagName(_1608,"item",false);
- for(var _160a=0;_160a<_1609.length;_160a++){
- var _160b=_1609[_160a];
- var _160c=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160b,"creationTime_localized",true));
- var _160d=XMLHelper_FindChildByTagName(_160b,"storeID",true);
- var _160e=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160d,"value",true));
- var _160f=XMLHelper_FindChildByTagName(_160b,"creationTime",true);
- var _1610=XMLHelper_GetText(XMLHelper_FindChildByTagName(_160f,"value",true));
- this._snapshots.options[_160a]=new Option(_160c,_1610);
- this._snapshots.options[_160a].setAttribute("storeID",_160e);
- if(this.currentSnapshotCreationTime==_1610){
- this._snapshots.options[_160a].selected=true;
- }
- }
- }});
- function CognosViewerAction(){
- this.m_oCV=null;
- };
- CognosViewerAction.prototype.setRequestParms=function(parms){
- };
- CognosViewerAction.prototype.onMouseOver=function(evt){
- return false;
- };
- CognosViewerAction.prototype.onMouseOut=function(evt){
- return false;
- };
- CognosViewerAction.prototype.onMouseDown=function(evt){
- return false;
- };
- CognosViewerAction.prototype.onClick=function(evt){
- return false;
- };
- CognosViewerAction.prototype.onDoubleClick=function(evt){
- return false;
- };
- CognosViewerAction.prototype.updateMenu=function(_1617){
- return _1617;
- };
- CognosViewerAction.prototype.addAdditionalOptions=function(_1618){
- };
- CognosViewerAction.prototype.genSelectionContextWithUniqueCTXIDs=function(){
- return false;
- };
- CognosViewerAction.prototype.doUndo=function(){
- if(typeof console!="undefined"){
- console.log("Required method doUndo not implemented.");
- }
- };
- CognosViewerAction.prototype.doRedo=function(){
- if(typeof console!="undefined"){
- console.log("Required method doRedo not implemented.");
- }
- };
- CognosViewerAction.prototype.forceRunSpecRequest=function(){
- return false;
- };
- CognosViewerAction.prototype.preProcess=function(){
- };
- CognosViewerAction.prototype.setCognosViewer=function(oCV){
- this.m_oCV=oCV;
- };
- CognosViewerAction.prototype.getCognosViewer=function(){
- return this.m_oCV;
- };
- CognosViewerAction.prototype.getUndoRedoQueue=function(){
- if(this.getCognosViewer().getViewerWidget()){
- return this.getCognosViewer().getViewerWidget().getUndoRedoQueue();
- }
- return null;
- };
- CognosViewerAction.prototype.getViewerWidget=function(){
- return this.m_oCV.getViewerWidget();
- };
- CognosViewerAction.prototype.getObjectDisplayName=function(){
- var _161a="";
- if(this.m_oCV!=null){
- if(typeof this.m_oCV.envParams["reportpart_id"]!="undefined"){
- _161a=this.m_oCV.envParams["reportpart_id"];
- }else{
- if(typeof this.m_oCV.envParams["ui.name"]!="undefined"){
- _161a=this.m_oCV.envParams["ui.name"];
- }
- }
- }
- return _161a;
- };
- CognosViewerAction.prototype.getContainerId=function(_161b){
- var _161c="";
- if(_161b&&_161b.getAllSelectedObjects){
- var _161d=_161b.getAllSelectedObjects();
- if(_161d){
- var _161e=_161d[0];
- if(_161e&&_161e.getLayoutElementId){
- _161c=this.removeNamespace(_161e.getLayoutElementId());
- }
- }
- }
- return _161c;
- };
- CognosViewerAction.prototype.removeNamespace=function(value){
- var _1620=value;
- try{
- if(value!=""){
- var _1621=value.indexOf(this.m_oCV.getId());
- if(_1621!=-1){
- value=value.replace(this.m_oCV.getId(),"");
- }
- }
- return value;
- }
- catch(e){
- return _1620;
- }
- };
- CognosViewerAction.prototype.doAddActionContext=function(){
- return true;
- };
- CognosViewerAction.prototype.getSelectionContext=function(){
- return getViewerSelectionContext(this.m_oCV.getSelectionController(),new CSelectionContext(this.m_oCV.envParams["ui.object"]),this.genSelectionContextWithUniqueCTXIDs());
- };
- CognosViewerAction.prototype.getNumberOfSelections=function(){
- var _1622=-1;
- if(this.m_oCV!=null&&this.m_oCV.getSelectionController()!=null){
- _1622=this.m_oCV.getSelectionController().getSelections().length;
- }
- return _1622;
- };
- CognosViewerAction.prototype.buildDynamicMenuItem=function(_1623,_1624){
- _1623.action={name:"LoadMenu",payload:{action:_1624}};
- _1623.items=[{"name":"loading","label":RV_RES.GOTO_LOADING,iconClass:"loading"}];
- return _1623;
- };
- CognosViewerAction.prototype.createCognosViewerDispatcherEntry=function(_1625){
- var oReq=new ViewerDispatcherEntry(this.getCognosViewer());
- oReq.addFormField("ui.action",_1625);
- this.preProcess();
- if(this.doAddActionContext()===true){
- var _1627=this.addActionContext();
- oReq.addFormField("cv.actionContext",_1627);
- if(window.gViewerLogger){
- window.gViewerLogger.log("Action context",_1627,"xml");
- }
- }
- oReq.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
- oReq.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- }
- if(this.m_oCV.getModelPath()!==""){
- oReq.addFormField("modelPath",this.m_oCV.getModelPath());
- }
- if(typeof this.m_oCV.envParams["packageBase"]!="undefined"){
- oReq.addFormField("packageBase",this.m_oCV.envParams["packageBase"]);
- }
- if(typeof this.m_oCV.envParams["rap.state"]!="undefined"){
- oReq.addFormField("rap.state",this.m_oCV.envParams["rap.state"]);
- }
- if(typeof this.m_oCV.envParams["rapReportInfo"]!="undefined"){
- oReq.addFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
- }
- this.addAdditionalOptions(oReq);
- return oReq;
- };
- CognosViewerAction.prototype.fireModifiedReportEvent=function(){
- try{
- var _1628=this.getCognosViewer().getViewerWidget();
- if(_1628){
- var _1629={"modified":true};
- _1628.fireEvent("com.ibm.bux.widget.modified",null,_1629);
- }
- }
- catch(e){
- }
- };
- CognosViewerAction.prototype.showCustomCursor=function(evt,id,_162c){
- var _162d=document.getElementById(id);
- if(_162d==null){
- _162d=document.createElement("span");
- _162d.className="customCursor";
- _162d.setAttribute("id",id);
- document.body.appendChild(_162d);
- }
- var _162e="<img src=\""+this.getCognosViewer().getWebContentRoot()+_162c+"\"/>";
- _162d.innerHTML=_162e;
- _162d.style.position="absolute";
- _162d.style.left=(evt.clientX+15)+"px";
- _162d.style.top=(evt.clientY+15)+"px";
- _162d.style.display="inline";
- };
- CognosViewerAction.prototype.hideCustomCursor=function(id){
- var _1630=document.getElementById(id);
- if(_1630!=null){
- _1630.style.display="none";
- }
- };
- CognosViewerAction.prototype.selectionHasContext=function(){
- var _1631=this.getCognosViewer().getSelectionController().getAllSelectedObjects();
- var _1632=false;
- if(_1631!=null&&_1631.length>0){
- for(var i=0;i<_1631.length;i++){
- if(_1631[i].hasContextInformation()){
- _1632=true;
- break;
- }
- }
- }
- return _1632;
- };
- CognosViewerAction.prototype.isInteractiveDataContainer=function(_1634){
- var _1635=false;
- if(typeof _1634!="undefined"&&_1634!=null){
- var id=_1634.toLowerCase();
- _1635=id=="crosstab"||id=="list"||this.getCognosViewer().getRAPReportInfo().isChart(id);
- }
- return _1635;
- };
- CognosViewerAction.prototype.getSelectedContainerId=function(){
- var _1637=this.getCognosViewer();
- var _1638=_1637.getSelectionController();
- var _1639=null;
- if(_1638!=null&&typeof _1638!="undefined"){
- _1639=this.getContainerId(_1638);
- }
- return _1639;
- };
- CognosViewerAction.prototype.getSelectedReportInfo=function(){
- var _163a=this.getCognosViewer();
- var _163b=this.getSelectedContainerId();
- var _163c=this.getReportInfo(_163b);
- if(_163c==null){
- var _163d=_163a.getRAPReportInfo();
- if(_163d.getContainerCount()==1){
- _163c=_163d.getContainerFromPos(0);
- }
- }
- return _163c;
- };
- CognosViewerAction.prototype.getReportInfo=function(_163e){
- var _163f=null;
- if(_163e!=null&&_163e.length>0){
- var _1640=this.getCognosViewer();
- var _1641=_1640.getRAPReportInfo();
- _163f=_1641.getContainer(_163e);
- }
- return _163f;
- };
- CognosViewerAction.prototype.isSelectionOnChart=function(){
- var _1642=this.getCognosViewer();
- if(_1642.getSelectionController().hasSelectedChartNodes()){
- return true;
- }
- var _1643=this.getContainerId(_1642.getSelectionController());
- if(typeof _1643!="undefined"){
- var _1644=this.getReportInfo(_1643);
- if(_1644!=null&&_1644.displayTypeId){
- var _1645=_1644.displayTypeId.toLowerCase();
- return _1642.getRAPReportInfo().isChart(_1645);
- }
- }
- return false;
- };
- CognosViewerAction.prototype.ifContainsInteractiveDataContainer=function(){
- var _1646=this.getCognosViewer().getRAPReportInfo();
- if(_1646){
- return _1646.containsInteractiveDataContainer();
- }
- return false;
- };
- CognosViewerAction.prototype.isPromptWidget=function(){
- var oCV=this.getCognosViewer();
- if(oCV.getRAPReportInfo()&&oCV.getRAPReportInfo().isPromptPart()){
- return true;
- }
- return false;
- };
- CognosViewerAction.prototype.getLayoutComponents=function(){
- var _1648=[];
- var _1649=document.getElementById("rt"+this.m_oCV.getId());
- if(_1649!=null){
- _1648=getElementsByAttribute(_1649,"*","lid");
- }
- return _1648;
- };
- CognosViewerAction.prototype.addClientContextData=function(_164a){
- var _164b=this.m_oCV.getSelectionController();
- if(typeof _164b!="undefined"&&_164b!=null&&typeof _164b.getCCDManager!="undefined"&&_164b.getCCDManager()!=null){
- var _164c=_164b.getCCDManager();
- return ("<md>"+xml_encode(_164c.MetadataToJSON())+"</md>"+"<cd>"+xml_encode(_164c.ContextDataSubsetToJSON(_164a))+"</cd>");
- }
- return "";
- };
- CognosViewerAction.prototype.getDataItemInfoMap=function(){
- var _164d=this.m_oCV.getSelectionController();
- if(typeof _164d!="undefined"&&_164d!=null&&typeof _164d.getCCDManager!="undefined"&&_164d.getCCDManager()!=null){
- var _164e=_164d.getCCDManager();
- return ("<di>"+xml_encode(_164e.DataItemInfoToJSON())+"</di>");
- }
- return "";
- };
- CognosViewerAction.prototype.getRAPLayoutTag=function(_164f){
- var _1650=null;
- if(typeof _164f=="object"&&_164f!=null){
- _1650=_164f.getAttribute("rap_layout_tag");
- }
- return _1650;
- };
- CognosViewerAction.prototype.addMenuItemChecked=function(_1651,_1652,_1653){
- if(_1651){
- if(this.getCognosViewer().isHighContrast()){
- _1652["class"]="menuItemSelected";
- }
- _1652.iconClass="menuItemChecked";
- }else{
- if(_1653&&_1653.length>0){
- _1652.iconClass=_1653;
- }
- }
- };
- CognosViewerAction.prototype.gatherFilterInfoBeforeAction=function(_1654){
- var _1655=this.getCognosViewer().getViewerWidget();
- _1655.filterRequiredAction=_1654;
- _1655.clearRAPCache();
- _1655.fireEvent("com.ibm.bux.widget.action",null,{action:"canvas.filters"});
- };
- CognosViewerAction.prototype.addClientSideUndo=function(_1656,_1657){
- var _1658=GUtil.generateCallback(_1656.doUndo,_1657,_1656);
- var _1659=GUtil.generateCallback(_1656.doRedo,_1657,_1656);
- this.getUndoRedoQueue().addClientSideUndo({"tooltip":_1656.getUndoHint(),"undoCallback":_1658,"redoCallback":_1659});
- this.getCognosViewer().getViewerWidget().updateToolbar();
- };
- CognosViewerAction.prototype.isValidMenuItem=function(){
- var _165a=this.getCognosViewer();
- var _165b=_165a.getViewerWidget();
- if(this.isPromptWidget()){
- return false;
- }
- return true;
- };
- CognosViewerAction.prototype.isPositiveInt=function(value){
- if(typeof value==="undefined"||value===null){
- return false;
- }
- var _165d=parseInt(value,10);
- return value&&_165d===+value&&_165d>0&&value.indexOf(".")==-1;
- };
- CognosViewerAction.prototype.buildActionResponseObject=function(_165e,code,msg){
- return {"status":_165e,"message":msg?msg:null,"code":code?code:null,getStatus:function(){
- return this.status;
- },getMessage:function(){
- return this.message;
- },getCode:function(){
- return this.code;
- }};
- };
- function LineageAction(){
- };
- LineageAction.prototype=new CognosViewerAction();
- LineageAction.prototype.getCommonOptions=function(_1661){
- _1661.addFormField("cv.responseFormat","asynchDetailMIMEAttachment");
- _1661.addFormField("bux",this.m_oCV.getViewerWidget()?"true":"false");
- _1661.addFormField("cv.id",this.m_oCV.envParams["cv.id"]);
- };
- LineageAction.prototype.getSelectionOptions=function(_1662){
- var _1663=this.m_oCV.getSelectionController();
- var _1664=getSelectionContextIds(_1663);
- _1662.addFormField("context.format","initializer");
- _1662.addFormField("context.type","reportService");
- _1662.addFormField("context.selection","metadata,"+_1664.toString());
- };
- LineageAction.prototype.getPrimaryRequestOptions=function(_1665){
- _1665.addFormField("specificationType","metadataServiceLineageSpecification");
- _1665.addFormField("ui.action","runLineageSpecification");
- _1665.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- };
- LineageAction.prototype.getSecondaryRequestOptions=function(_1666){
- _1666.addFormField("ui.conversation",this.m_oCV.getConversation());
- _1666.addFormField("m_tracking",this.m_oCV.getTracking());
- _1666.addFormField("ui.action","lineage");
- };
- LineageAction.prototype.updateMenu=function(_1667){
- if(!this.getCognosViewer().bCanUseLineage){
- return "";
- }
- _1667.disabled=!this.selectionHasContext();
- return _1667;
- };
- LineageAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- var _1669=new AsynchDataDispatcherEntry(oCV);
- this.getCommonOptions(_1669);
- this.getSelectionOptions(_1669);
- if(oCV.getConversation()==""){
- this.getPrimaryRequestOptions(_1669);
- }else{
- this.getSecondaryRequestOptions(_1669);
- }
- _1669.setCallbacks({"complete":{"object":this,"method":this.handleLineageResponse}});
- if(!oCV.m_viewerFragment){
- _1669.setRequestIndicator(oCV.getRequestIndicator());
- var _166a=new WorkingDialog(oCV);
- _166a.setSimpleWorkingDialogFlag(true);
- _1669.setWorkingDialog(_166a);
- }
- oCV.dispatchRequest(_1669);
- };
- LineageAction.prototype.handleLineageResponse=function(_166b){
- var oCV=this.getCognosViewer();
- oCV.loadExtra();
- oCV.setStatus(_166b.getAsynchStatus());
- oCV.setConversation(_166b.getConversation());
- oCV.setTracking(_166b.getTracking());
- var _166d=null;
- if(typeof MDSRV_CognosConfiguration!="undefined"){
- _166d=new MDSRV_CognosConfiguration();
- var _166e="";
- if(this.m_oCV.envParams["metadataInformationURI"]){
- _166e=this.m_oCV.envParams["metadataInformationURI"];
- }
- _166d.addProperty("lineageURI",_166e);
- _166d.addProperty("gatewayURI",this.m_oCV.getGateway());
- }
- var _166f=this.m_oCV.envParams["ui.object"];
- var _1670=getViewerSelectionContext(this.m_oCV.getSelectionController(),new CSelectionContext(_166f));
- var _1671=new MDSRV_LineageFragmentContext(_166d,_1670);
- _1671.setExecutionParameters(this.m_oCV.getExecutionParameters());
- if(typeof _166f=="string"){
- _1671.setReportPath(_166f);
- }
- _1671.setReportLineage(_166b.getResult());
- _1671.open();
- };
- function ModifyReportAction(){
- this.m_reuseConversation=true;
- };
- ModifyReportAction.prototype=new CognosViewerAction();
- ModifyReportAction.prototype.addActionContextAdditionalParms=function(){
- };
- ModifyReportAction.prototype.runReport=function(){
- return true;
- };
- ModifyReportAction.prototype.updateRunReport=function(){
- };
- ModifyReportAction.prototype.reuseQuery=function(){
- return false;
- };
- ModifyReportAction.prototype.reuseGetParameter=function(){
- return true;
- };
- ModifyReportAction.prototype.reuseConversation=function(_1672){
- if(typeof _1672!="undefined"){
- this.m_reuseConversation=_1672;
- }
- return this.m_reuseConversation;
- };
- ModifyReportAction.prototype.updateInfoBar=function(){
- return true;
- };
- ModifyReportAction.prototype.getUndoHint=function(){
- return "";
- };
- ModifyReportAction.prototype.isUndoable=function(){
- return true;
- };
- ModifyReportAction.prototype.saveSpecForUndo=function(){
- return false;
- };
- ModifyReportAction.prototype.keepFocusOnWidget=function(){
- return true;
- };
- ModifyReportAction.prototype.keepRAPCache=function(){
- return true;
- };
- ModifyReportAction.prototype.getActionKey=function(){
- return null;
- };
- ModifyReportAction.prototype.canBeQueued=function(){
- return false;
- };
- ModifyReportAction.prototype.getPromptOption=function(){
- return "false";
- };
- ModifyReportAction.prototype.createActionDispatcherEntry=function(){
- var _1673=new ModifyReportDispatcherEntry(this.m_oCV);
- _1673.initializeAction(this);
- return _1673;
- };
- ModifyReportAction.prototype.isSelectSingleMember=function(_1674){
- var _1675=this.m_oCV.getRAPReportInfo();
- var _1676=_1674.getDataItems();
- if(_1675&&_1676.length>0){
- var _1677=this.getContainerId(this.m_oCV.getSelectionController());
- var _1678=_1675.getItemInfo(_1677,_1676[0][0]);
- if(_1678.single=="true"){
- return true;
- }
- }
- return false;
- };
- ModifyReportAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- oCV.setKeepFocus(this.keepFocusOnWidget());
- this.updateRunReport();
- if(this.runReport()==true){
- var _167a=this.createActionDispatcherEntry();
- this.addAdditionalOptions(_167a);
- oCV.dispatchRequest(_167a);
- }else{
- var _167b=this.createCognosViewerDispatcherEntry("modifyReport");
- _167b.setCallbacks({"complete":{"object":this,"method":this.updateReportSpecCallback}});
- oCV.dispatchRequest(_167b);
- }
- this.fireModifiedReportEvent();
- };
- ModifyReportAction.prototype.updateReportSpecCallback=function(_167c){
- var state=_167c.getResponseState();
- var _167e=new RequestHandler(this.m_oCV);
- _167e.updateViewerState(state);
- if(!this.m_bUndoAdded){
- this.m_bUndoAdded=true;
- var _167f=this.getUndoRedoQueue();
- if(_167f){
- _167f.initUndoObj({"tooltip":this.getUndoHint(),"saveSpec":true});
- _167f.add({"reportUpdated":true});
- }
- var _1680=this.getCognosViewer().getViewerWidget();
- if(_1680){
- _1680.updateToolbar();
- }
- }
- };
- ModifyReportAction.prototype.addActionContext=function(){
- var _1681="<reportActions";
- if(this.runReport()==false){
- _1681+=" run=\"false\"";
- }
- _1681+=">";
- _1681+=this.getReportActionContext();
- _1681+="</reportActions>";
- return _1681;
- };
- ModifyReportAction.prototype.getReportActionContext=function(){
- var _1682=this.getCognosViewer();
- var _1683=_1682.getSelectionController();
- var _1684="<"+this.m_sAction+">";
- var _1685=this.getContainerId(_1683);
- if(_1685!=""){
- _1684+="<id>"+xml_encode(_1685)+"</id>";
- }
- _1684+=this.getRTStateInfo();
- _1684+=this.getSelectionContext();
- var _1686=this.addActionContextAdditionalParms();
- if(_1686!=null&&_1686!="undefined"){
- _1684+=_1686;
- }
- _1684+="</"+this.m_sAction+">";
- if(this.updateInfoBar()){
- _1684+=this.getGetInfoActionContext();
- }
- return _1684;
- };
- ModifyReportAction.prototype.getGetInfoActionContext=function(){
- return "<GetInfo/>";
- };
- ModifyReportAction.prototype.getRTStateInfo=function(){
- var _1687=this.getCognosViewer().getViewerWidget();
- if(_1687&&_1687.getBUXRTStateInfoMap){
- var _1688=_1687.getBUXRTStateInfoMap();
- return _1688?_1688:"";
- }
- return "";
- };
- ModifyReportAction.prototype.createEmptyMenuItem=function(){
- return {name:"None",label:"(empty)",iconClass:"",action:null,items:null};
- };
- ModifyReportAction.prototype.getStateFromResponse=function(_1689){
- var _168a=null;
- if(_1689&&typeof _1689!="undefined"&&_1689.responseText&&typeof _1689.responseText!="undefined"&&_1689.responseText.length>0){
- var _168b=XMLBuilderLoadXMLFromString(_1689.responseText);
- var _168c=_168b.getElementsByTagName("state");
- if(_168c!=null&&_168c.length>0){
- try{
- if(typeof _168c[0].text!="undefined"){
- _168a=eval("("+_168c[0].text+")");
- }else{
- _168a=eval("("+_168c[0].textContent+")");
- }
- }
- catch(e){
- if(typeof console!="undefined"&&console&&console.log){
- console.log(e);
- }
- }
- }
- }
- return _168a;
- };
- ModifyReportAction.prototype.getSelectedCellTags=function(){
- var _168d="";
- var _168e=this.getCognosViewer().getSelectionController().getSelections();
- for(var i=0;i<_168e.length;++i){
- var _1690=_168e[i].getCellRef();
- var _1691=_168e[i].getDataItems()[0];
- if(typeof _1691=="undefined"||_1691==null){
- _1691="";
- }
- var tag=this.getRAPLayoutTag(_1690);
- if(tag!=null){
- _168d+="<tag><tagValue>"+xml_encode(tag)+"</tagValue><dataItem>"+xml_encode(_1691)+"</dataItem></tag>";
- }else{
- _168d+="<tag><tagValue/><dataItem>"+xml_encode(_1691)+"</dataItem></tag>";
- }
- }
- if(_168d!=""){
- _168d="<selectedCellTags>"+_168d+"</selectedCellTags>";
- }
- return _168d;
- };
- ModifyReportAction.prototype.getIsNumericFromReportInfo=function(_1693){
- var _1694=this.getSelectedReportInfo();
- if(_1694!=null&&typeof _1694.itemInfo!="undefined"){
- for(var item=0;item<_1694.itemInfo.length;++item){
- if(_1693==_1694.itemInfo[item].item&&typeof _1694.itemInfo[item].numeric!="undefined"){
- return (_1694.itemInfo[item].numeric=="true");
- }
- }
- }
- return false;
- };
- function CognosViewerCalculation(){
- this.m_oCV=null;
- };
- CognosViewerCalculation.prototype.setCognosViewer=function(oCV){
- this.m_oCV=oCV;
- };
- CognosViewerCalculation.prototype.getCognosViewer=function(){
- return this.m_oCV;
- };
- CognosViewerCalculation.prototype.validSelectionLength=function(_1697){
- try{
- return _1697.getAllSelectedObjects().length>0;
- }
- catch(e){
- return false;
- }
- };
- CognosViewerCalculation.prototype.getDisplayValueFromSelection=function(_1698){
- var _1699="";
- if(!_1698){
- return _1699;
- }
- if(_1698.getLayoutType()=="columnTitle"){
- _1699=_1698.getDisplayValues()[0];
- }else{
- if(_1698.getLayoutType()=="datavalue"){
- var _169a=this.m_oCV.getAction("CognosViewer");
- var _169b=this.m_oCV.getSelectionController();
- var _169c=_169a.getContainerId(_169b);
- _1699=_1698.getDataItemDisplayValue(_169a.getReportInfo(_169c));
- }
- }
- if(_1699.indexOf("+")!=-1||_1699.indexOf("-")!=-1||_1699.indexOf("*")!=-1||_1699.indexOf("/")!=-1){
- _1699="("+_1699+")";
- }
- return _1699;
- };
- CognosViewerCalculation.prototype.getCalcSymbol=function(){
- };
- CognosViewerCalculation.prototype.getMenuItemString=function(_169d){
- var _169e=this.getCognosViewer();
- var _169f=_169e.getSelectionController();
- var _16a0="";
- var _16a1,index;
- if(_169d){
- try{
- var _16a3=_169f.getAllSelectedObjects().length;
- if(_16a3==1){
- _16a1=_169f.getAllSelectedObjects()[0];
- if(this.m_bFlipSelection){
- _16a0=RV_RES.IDS_JS_CALCULATE_NUMBER+" "+this.getCalcSymbol()+" "+this.getDisplayValueFromSelection(_16a1);
- }else{
- _16a0=this.getDisplayValueFromSelection(_16a1)+" "+this.getCalcSymbol()+" "+RV_RES.IDS_JS_CALCULATE_NUMBER;
- }
- }else{
- if(this.m_bFlipSelection){
- _16a3--;
- for(index=_16a3;index>=0;index--){
- _16a1=_169f.getAllSelectedObjects()[index];
- if(index!=_16a3){
- _16a0+=" "+this.getCalcSymbol()+" ";
- }
- _16a0+=this.getDisplayValueFromSelection(_16a1);
- }
- }else{
- for(index=0;index<_16a3;index++){
- _16a1=_169f.getAllSelectedObjects()[index];
- if(index>0){
- _16a0+=" "+this.getCalcSymbol()+" ";
- }
- _16a0+=this.getDisplayValueFromSelection(_16a1);
- }
- }
- }
- }
- catch(e){
- _16a0=this.getCalcSymbol();
- }
- }else{
- _16a0=this.getCalcSymbol();
- }
- return _16a0;
- };
- function PercentDifferenceCalculation(){
- };
- PercentDifferenceCalculation.prototype=new CognosViewerCalculation();
- PercentDifferenceCalculation.prototype.validSelectionLength=function(_16a4){
- try{
- return _16a4.getAllSelectedObjects().length==2;
- }
- catch(e){
- return false;
- }
- };
- PercentDifferenceCalculation.prototype.getMenuItemString=function(_16a5){
- var _16a6=this.getCognosViewer().getSelectionController();
- var _16a7=RV_RES.IDS_JS_CALCULATE_PERCENT_DIFFERENCE;
- if(_16a5){
- try{
- var _16a8=_16a6.getAllSelectedObjects().length;
- _16a7+=" (";
- for(var index=0;index<_16a8;index++){
- var _16aa=_16a6.getAllSelectedObjects()[index];
- if(index>0){
- _16a7+=", ";
- }
- _16a7+=this.getDisplayValueFromSelection(_16aa);
- }
- _16a7+=")";
- }
- catch(e){
- }
- }
- return _16a7;
- };
- function PercentDifferenceCalculationSwapOrder(){
- this.m_bFlipSelection=true;
- };
- PercentDifferenceCalculationSwapOrder.prototype=new PercentDifferenceCalculation();
- PercentDifferenceCalculationSwapOrder.prototype.getMenuItemString=function(_16ab){
- var _16ac=this.getCognosViewer().getSelectionController();
- var _16ad=RV_RES.IDS_JS_CALCULATE_PERCENT_DIFFERENCE;
- if(_16ab){
- try{
- var _16ae=_16ac.getAllSelectedObjects().length;
- _16ad+=" (";
- _16ae--;
- for(var index=_16ae;index>=0;index--){
- var _16b0=_16ac.getAllSelectedObjects()[index];
- if(index<_16ae){
- _16ad+=", ";
- }
- _16ad+=this.getDisplayValueFromSelection(_16b0);
- }
- _16ad+=")";
- }
- catch(e){
- }
- }
- return _16ad;
- };
- function AdditionCalculation(){
- };
- AdditionCalculation.prototype=new CognosViewerCalculation();
- AdditionCalculation.prototype.getCalcSymbol=function(){
- return "+";
- };
- function SubtractionCalculation(){
- };
- SubtractionCalculation.prototype=new CognosViewerCalculation();
- SubtractionCalculation.prototype.getCalcSymbol=function(){
- return "-";
- };
- SubtractionCalculation.prototype.validSelectionLength=function(_16b1){
- try{
- var _16b2=_16b1.getAllSelectedObjects().length;
- return _16b2>0&&_16b2<3;
- }
- catch(e){
- return false;
- }
- };
- function SubtractionCalculationSwapOrder(){
- this.m_bFlipSelection=true;
- };
- SubtractionCalculationSwapOrder.prototype=new SubtractionCalculation();
- function MultiplicationCalculation(){
- };
- MultiplicationCalculation.prototype=new CognosViewerCalculation();
- MultiplicationCalculation.prototype.getCalcSymbol=function(){
- return "*";
- };
- function DivisionCalculation(){
- };
- DivisionCalculation.prototype=new CognosViewerCalculation();
- DivisionCalculation.prototype.getCalcSymbol=function(){
- return "/";
- };
- DivisionCalculation.prototype.validSelectionLength=function(_16b3){
- try{
- var _16b4=_16b3.getAllSelectedObjects().length;
- return (_16b4>0&&_16b4<3);
- }
- catch(e){
- return false;
- }
- };
- function DivisionCalculationSwapOrder(){
- this.m_bFlipSelection=true;
- };
- DivisionCalculationSwapOrder.prototype=new DivisionCalculation();
- function CalculationAction(){
- this.m_payload="";
- this.m_menuBuilderClass=null;
- this.m_defaultName="";
- this.m_constant=null;
- };
- CalculationAction.prototype=new ModifyReportAction();
- CalculationAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_CALCULATION;
- };
- CalculationAction.prototype.keepRAPCache=function(){
- return false;
- };
- CalculationAction.prototype.listRules=function(){
- var _16b5=this.getCognosViewer().getSelectionController();
- var _16b6=_16b5.getSelections();
- if(_16b6.length>1){
- var tmp={};
- for(var i=0;i<_16b6.length;++i){
- var _16b9=_16b6[i].getColumnRef();
- if(typeof tmp[_16b9]=="undefined"){
- tmp[_16b9]=1;
- }else{
- return false;
- }
- }
- }
- return _16b5.selectionsHaveCalculationMetadata();
- };
- CalculationAction.prototype.crosstabRules=function(){
- var _16ba=this.getCognosViewer().getSelectionController();
- if(!_16ba.areSelectionsColumnRowTitles()){
- return false;
- }
- if(_16ba.isRelational()){
- if(!this.relationalCrosstabRules(_16ba)){
- return false;
- }
- }else{
- if(!this.olapCrosstabRules(_16ba)){
- return false;
- }
- }
- return true;
- };
- CalculationAction.prototype.relationalCrosstabRules=function(_16bb){
- return _16bb.selectionsHaveCalculationMetadata();
- };
- CalculationAction.prototype.olapCrosstabRules=function(_16bc){
- if(!_16bc.selectionsHaveCalculationMetadata()){
- return false;
- }
- if(!this.sameDimension(_16bc)){
- return (typeof this.m_oCV.aQoSFunctions!="undefined")&&this.m_oCV.aQoSFunctions.toString().indexOf("MULTIPLE_MEASURE_DIMENSION_CALCULATIONS")!=-1&&_16bc.selectionsAreMeasures();
- }else{
- if(this.sameHierarchy(_16bc)){
- return true;
- }else{
- return (typeof this.m_oCV.aQoSFunctions!="undefined")&&this.m_oCV.aQoSFunctions.toString().indexOf("VALUE_EXPRESSIONS_REF_MULTIPLE_HIERARCHIES_OF_SAME_DIMENSION")!=-1;
- }
- }
- };
- CalculationAction.prototype.sameDimension=function(_16bd){
- try{
- var dim="";
- var _16bf=_16bd.getAllSelectedObjects().length;
- for(var _16c0=0;_16c0<_16bf;_16c0++){
- if(dim.length==0){
- dim=_16bd.getAllSelectedObjects()[_16c0].getDimensionalItems("dun")[0][0];
- }else{
- if(dim!=_16bd.getAllSelectedObjects()[_16c0].getDimensionalItems("dun")[0][0]){
- return false;
- }
- }
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CalculationAction.prototype.sameHierarchy=function(_16c1){
- try{
- var dim="";
- var _16c3=_16c1.getAllSelectedObjects().length;
- for(var _16c4=0;_16c4<_16c3;_16c4++){
- if(dim.length==0){
- dim=_16c1.getAllSelectedObjects()[_16c4].getDimensionalItems("hun")[0][0];
- }else{
- if(dim!=_16c1.getAllSelectedObjects()[_16c4].getDimensionalItems("hun")[0][0]){
- return false;
- }
- }
- }
- return true;
- }
- catch(e){
- return false;
- }
- };
- CalculationAction.prototype.addActionContextAdditionalParms=function(){
- var _16c5="";
- if(this.m_constant!=null){
- _16c5+="<constant>"+xml_encode(this.m_constant)+"</constant>";
- if(this.m_swapSelectionOrder){
- _16c5+="<constantFirst/>";
- }
- }
- if(this.m_defaultName!=""){
- _16c5+="<columnName>"+xml_encode(this.m_defaultName)+"</columnName>";
- }
- return _16c5;
- };
- CalculationAction.prototype.setRequestParms=function(parms){
- if(parms!=null){
- if(typeof parms.constant!=null){
- this.m_constant=parms.constant;
- }
- }
- };
- CalculationAction.prototype.buildDefaultName=function(){
- try{
- var calc=this.getCognosViewer().getCalculation(this.m_menuBuilderClass);
- this.m_defaultName=calc.getMenuItemString(true);
- if(this.m_constant!=null){
- var _16c8=""+this.m_constant;
- var _16c9=this.getCognosViewer().envParams["contentDecimalSeparator"];
- if(typeof _16c9!="undefined"&&_16c9!=null&&_16c9!="."){
- _16c8=_16c8.replace(".",_16c9);
- }
- this.m_defaultName=this.m_defaultName.replace(RV_RES.IDS_JS_CALCULATE_NUMBER,_16c8);
- }
- }
- catch(e){
- this.m_defaultName="";
- }
- };
- CalculationAction.prototype.preProcess=function(){
- var _16ca=this.getNumberOfSelections();
- this.buildDefaultName();
- if(this.m_swapSelectionOrder&&_16ca==2){
- var _16cb=this.getCognosViewer().getSelectionController();
- var sel1=_16cb.getAllSelectedObjects()[0];
- var sel2=_16cb.getAllSelectedObjects()[1];
- _16cb.m_aSelectedObjects=[sel2,sel1];
- }
- };
- CalculationAction.prototype.isFactCellOnCrosstabOrEmpty=function(){
- var _16ce=this.m_oCV.getSelectionController();
- var _16cf=_16ce.getAllSelectedObjects();
- if(_16cf!=null&&typeof _16cf!="undefined"){
- if(_16cf.length==0){
- return true;
- }else{
- var _16d0=_16cf[0];
- if(_16ce.getDataContainerType()=="crosstab"&&_16d0.getLayoutType()=="datavalue"){
- return true;
- }
- }
- }
- return false;
- };
- CalculationAction.prototype.isSummaryOrAggregateCell=function(){
- var _16d1=this.m_oCV.getSelectionController();
- var _16d2=_16d1.getAllSelectedObjects();
- if(_16d2!=null&&typeof _16d2!="undefined"){
- var _16d3;
- var _16d4=/\b(ol|il)\b/;
- for(var i=0;i<_16d2.length;i++){
- _16d3=_16d2[i].getCellRef();
- if(_16d3!=null&&typeof _16d3!="undefined"){
- if(_16d2[i].getLayoutType()=="summary"||(_16d3!=null&&_16d4.test(_16d3.className))){
- return true;
- }
- }
- _16d3=null;
- }
- }
- return false;
- };
- CalculationAction.prototype.isLastSelectionSingleDimensionNested=function(){
- var _16d6=this.m_oCV.getSelectionController();
- var _16d7=_16d6.getAllSelectedObjects();
- if(_16d7!=null&&typeof _16d7!="undefined"&&_16d7.length){
- var _16d8=_16d7[_16d7.length-1];
- var _16d9=_16d8.getDimensionalItems("dun")[0];
- if(_16d9&&_16d9.length&&_16d9[0]){
- for(var _16da=1;_16da<_16d9.length;++_16da){
- if(_16d9[_16da]===_16d9[0]){
- return true;
- }
- }
- }
- }
- return false;
- };
- CalculationAction.prototype.areCalculationsPossible=function(){
- var _16db=this.getCognosViewer().getSelectionController();
- if(this.isFactCellOnCrosstabOrEmpty()){
- return false;
- }
- if(this.isSelectionOnChart()){
- return false;
- }
- if(this.isSummaryOrAggregateCell()){
- return false;
- }
- if(!_16db.selectionsInSameDataContainer()){
- return false;
- }
- if(_16db.getDataContainerType()=="list"){
- return this.listRules(_16db);
- }else{
- if(_16db.getDataContainerType()=="crosstab"&&!this.isLastSelectionSingleDimensionNested()){
- return this.crosstabRules(_16db);
- }
- }
- return false;
- };
- CalculationAction.prototype.updateMenu=function(_16dc,_16dd){
- _16dc.visible=this.ifContainsInteractiveDataContainer();
- if(!_16dc.visible){
- return _16dc;
- }
- if(!this.areCalculationsPossible()){
- return this.toggleMenu(_16dc,false);
- }
- this.toggleMenu(_16dc,true);
- if(this.m_oCV.aQoSFunctions){
- _16dc=this.buildCalculationMenuItemsAgainstSelection(_16dc);
- }else{
- _16dc=this.buildDynamicMenuItem(_16dc,"Calculation");
- }
- return _16dc;
- };
- CalculationAction.prototype.toggleMenu=function(_16de,_16df){
- if(_16df){
- _16de.iconClass="calculate";
- _16de.disabled=false;
- }else{
- _16de.iconClass="calculateDisabled";
- _16de.disabled=true;
- }
- return _16de;
- };
- CalculationAction.prototype.buildMenu=function(_16e0,_16e1){
- _16e0.visible=this.ifContainsInteractiveDataContainer();
- if(!_16e0.visible){
- return _16e0;
- }
- if(!this.areCalculationsPossible()){
- return this.toggleMenu(_16e0,false);
- }
- this.toggleMenu(_16e0,true);
- var _16e2=this.getCognosViewer();
- if(typeof _16e2.aQoSFunctions=="undefined"){
- this.fetchQoS(_16e0,_16e1,(typeof _16e1=="undefined")?false:true);
- }
- if(typeof _16e2.aQoSFunctions!="undefined"){
- return this.buildCalculationMenuItemsAgainstSelection(_16e0);
- }
- };
- CalculationAction.prototype.fetchQoS=function(_16e3,_16e4,_16e5){
- var _16e6={customArguments:[_16e3,_16e4],"complete":{"object":this,"method":this.handleQoSResponse}};
- var _16e7=new AsynchJSONDispatcherEntry(this.m_oCV);
- _16e7.setCallbacks(_16e6);
- _16e7.addFormField("ui.action","getQualityOfService");
- _16e7.addFormField("parameterValues",this.m_oCV.getExecutionParameters());
- _16e7.addFormField("bux","true");
- _16e7.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
- _16e7.addDefinedFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
- if(!_16e5){
- _16e7.forceSynchronous();
- }
- this.m_oCV.dispatchRequest(_16e7);
- };
- CalculationAction.prototype.handleQoSResponse=function(_16e8,_16e9,_16ea){
- this.m_oCV.aQoSFunctions=_16e8.getResult();
- this.buildCalculationMenuItemsAgainstSelection(_16e9,_16ea);
- if(typeof _16ea=="function"){
- _16ea();
- }
- };
- CalculationAction.prototype.buildCalculationMenuItemsAgainstSelection=function(_16eb,_16ec){
- var _16ed=this.m_oCV.aBuxCalculations;
- var _16ee=[];
- for(var _16ef=0;_16ef<_16ed.length;_16ef++){
- var calc=this.m_oCV.getCalculation(_16ed[_16ef]);
- if(this.m_oCV.aQoSFunctions==null||typeof this.m_oCV.aQoSFunctions=="undefined"){
- _16eb.disabled=true;
- _16eb.iconClass="calculate";
- _16eb.items=null;
- return _16eb;
- }
- if(calc&&calc.validSelectionLength(this.getCognosViewer().getSelectionController())&&this.m_oCV.aQoSFunctions.toString().indexOf(_16ed[_16ef])!=-1){
- var _16f1={};
- _16f1.name=_16ed[_16ef];
- _16f1.label=calc.getMenuItemString(true);
- _16f1.action={};
- var _16f2="";
- if(_16ed[_16ef].indexOf("SwapOrder")!=-1){
- _16f2=_16ed[_16ef].substring(0,_16ed[_16ef].indexOf("SwapOrder"));
- }else{
- _16f2=_16ed[_16ef];
- }
- _16f1.iconClass=_16f2;
- if(this.getNumberOfSelections()==1){
- _16f1.action.name="ConstantOperandCalculation";
- _16f1.action.payload=_16ed[_16ef];
- }else{
- _16f1.action.name=_16ed[_16ef];
- _16f1.action.payload="";
- }
- if(_16f1.action.name=="PercentDifferenceCalculation"){
- _16ee.push({separator:true});
- }
- _16f1.items=null;
- _16ee.push(_16f1);
- }
- }
- if(_16ee.length==0){
- this.toggleMenu(_16eb,false);
- _16ee.push({name:"None",label:RV_RES.IDS_JS_CALCULATION_SELECT_DATA,iconClass:"",action:null,items:null});
- }else{
- this.toggleMenu(_16eb,true);
- }
- _16eb.items=_16ee;
- return _16eb;
- };
- function PercentDifferenceCalculationAction(){
- this.m_sAction="PercentDifference";
- this.m_menuBuilderClass="PercentDifferenceCalculation";
- };
- PercentDifferenceCalculationAction.prototype=new CalculationAction();
- function PercentDifferenceCalculationSwapOrderAction(){
- this.m_sAction="PercentDifference";
- this.m_menuBuilderClass="PercentDifferenceCalculationSwapOrder";
- this.m_swapSelectionOrder=true;
- };
- PercentDifferenceCalculationSwapOrderAction.prototype=new CalculationAction();
- function AdditionCalculationAction(){
- this.m_sAction="Addition";
- this.m_menuBuilderClass="AdditionCalculation";
- };
- AdditionCalculationAction.prototype=new CalculationAction();
- function SubtractionCalculationAction(){
- this.m_sAction="Subtraction";
- this.m_menuBuilderClass="SubtractionCalculation";
- };
- SubtractionCalculationAction.prototype=new CalculationAction();
- function SubtractionCalculationSwapOrderAction(){
- this.m_sAction="Subtraction";
- this.m_menuBuilderClass="SubtractionCalculationSwapOrder";
- this.m_swapSelectionOrder=true;
- };
- SubtractionCalculationSwapOrderAction.prototype=new CalculationAction();
- function MultiplicationCalculationAction(){
- this.m_sAction="Multiplication";
- this.m_menuBuilderClass="MultiplicationCalculation";
- };
- MultiplicationCalculationAction.prototype=new CalculationAction();
- function DivisionCalculationAction(){
- this.m_sAction="Division";
- this.m_menuBuilderClass="DivisionCalculation";
- };
- DivisionCalculationAction.prototype=new CalculationAction();
- function DivisionCalculationSwapOrderAction(){
- this.m_sAction="Division";
- this.m_menuBuilderClass="DivisionCalculationSwapOrder";
- this.m_swapSelectionOrder=true;
- };
- DivisionCalculationSwapOrderAction.prototype=new CalculationAction();
- function ConstantOperandCalculationAction(){
- this.m_action=null;
- };
- ConstantOperandCalculationAction.prototype=new CognosViewerAction();
- ConstantOperandCalculationAction.prototype.setRequestParms=function(_16f3){
- this.m_action=_16f3;
- };
- ConstantOperandCalculationAction.prototype.execute=function(){
- var _16f4=getCognosViewerObjectString(this.m_oCV.getId());
- var _16f5=this.m_action;
- var _16f6=this.m_oCV.getCalculation(_16f5);
- var _16f7=_16f6.getMenuItemString(true);
- var _16f8=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER_TITLE;
- var _16f9=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER_DESCRIPTION;
- _16f9=_16f9.substring(0,_16f9.indexOf("{0}"))+_16f7+_16f9.substring(_16f9.indexOf("{0}")+3);
- var _16fa=RV_RES.IDS_JS_CALCULATE_ENTER_NUMBER;
- var _16fb=this.m_oCV.envParams["contentLocale"];
- var _16fc=new viewer.dialogs.CalculationDialog({sTitle:_16f8,sLabel:_16fa,sDescription:_16f9,sContentLocale:_16fb,okHandler:function(value){
- window[_16f4].executeAction(_16f5,{constant:value});
- },cancelHandler:function(){
- }});
- _16fc.startup();
- window.setTimeout(function(){
- _16fc.show();
- },0);
- };
- function FilterAction(){
- this.m_sAction="Filter";
- this.m_sType="";
- this.m_sItem="";
- this.m_sFormattedNumber="";
- this.m_sFormattedEndNumber="";
- this.m_jsonDetails="";
- };
- FilterAction.prototype=new ModifyReportAction();
- FilterAction.prototype.execute=function(){
- ModifyReportAction.prototype.execute.apply(this,arguments);
- if(this.m_sType.indexOf("remove")!=-1){
- this.getCognosViewer().getViewerWidget().clearRAPCache();
- }
- };
- FilterAction.prototype.genSelectionContextWithUniqueCTXIDs=function(){
- return true;
- };
- FilterAction.prototype.getUndoHint=function(){
- if(this.m_sType.indexOf("remove")!=-1){
- return RV_RES.IDS_JS_REMOVE_FILTER;
- }else{
- return RV_RES.IDS_JS_FILTER;
- }
- };
- FilterAction.prototype.setRequestParms=function(parms){
- if(parms.type!=null&&typeof parms.type!="undefined"){
- this.m_sType=parms.type;
- if(parms.id!=null&&typeof parms.id!="undefined"){
- this.m_sId=parms.id;
- }
- if(parms.item!=null&&typeof parms.item!="undefined"){
- this.m_sItem=parms.item;
- }
- if(parms.details){
- this.m_jsonDetails=parms.details;
- }
- if(parms.formattedNumber!=null&&typeof parms.formattedNumber!="undefined"){
- this.m_sFormattedNumber=parms.formattedNumber;
- }
- if(parms.formattedEndNumber!=null&&typeof parms.formattedEndNumber!="undefined"){
- this.m_sFormattedEndNumber=parms.formattedEndNumber;
- }
- }else{
- this.m_sType=parms;
- }
- };
- FilterAction.prototype.addActionContextAdditionalParms=function(){
- var parms="<type>"+this.m_sType+"</type>";
- if(this.m_sId!=null&&typeof this.m_sId!="undefined"){
- parms+=("<id>"+xml_encode(this.m_sId)+"</id>");
- }
- if(this.m_sItem!=null&&typeof this.m_sItem!="undefined"&&this.m_sItem!=""){
- parms+=("<item>"+xml_encode(this.m_sItem)+"</item>");
- }
- if(this.m_jsonDetails&&this.m_jsonDetails!=""){
- parms+="<details>"+xml_encode(this.m_jsonDetails)+"</details>";
- }
- if(this.m_sFormattedNumber!=null&&typeof this.m_sFormattedNumber!="undefined"&&this.m_sFormattedNumber!=""){
- parms+=("<formattedNumber>"+this.m_sFormattedNumber+"</formattedNumber>");
- }
- if(this.m_sFormattedEndNumber!=null&&typeof this.m_sFormattedEndNumber!="undefined"&&this.m_sFormattedEndNumber!=""){
- parms+=("<formattedEndNumber>"+this.m_sFormattedEndNumber+"</formattedEndNumber>");
- }
- return parms;
- };
- FilterAction.prototype.buildSelectedItemsString=function(_1700){
- var _1701="";
- var _1702=_1700.length;
- var _1703=_1702>5?5:_1702;
- for(var index=0;index<_1702;++index){
- var value=this.getItemLabel(_1700[index]);
- if(typeof value=="undefined"||value==""){
- return "";
- }
- if((index)<_1703){
- _1701+=value;
- }
- if((index+1)<_1703){
- _1701+=", ";
- }
- }
- if(_1702>5){
- _1701+=", ++";
- }
- return _1701;
- };
- FilterAction.prototype.getItemLabel=function(_1706){
- var value=_1706.getDisplayValues()[0];
- if(typeof value=="undefined"){
- value=_1706.getUseValues()[0][0];
- }
- return value;
- };
- FilterAction.prototype.toggleMenu=function(_1708,_1709){
- if(_1709){
- _1708.iconClass="filter";
- _1708.disabled=false;
- }else{
- _1708.iconClass="filterDisabled";
- _1708.disabled=true;
- }
- return _1708;
- };
- FilterAction.prototype.updateMenu=function(_170a){
- _170a.visible=(this.ifContainsInteractiveDataContainer()&&!this.detailFilteringIsDisabled());
- var _170b=_170a;
- if(_170a.visible){
- var _170c=(this.m_oCV.getSelectionController().getAllSelectedObjects().length>0||this.isSelectionFilterable()||this.isRemoveAllValid());
- if(!_170c){
- _170b=this.toggleMenu(_170a,false);
- }else{
- this.buildMenu(_170a);
- if(_170a.disabled==true){
- _170b=this.toggleMenu(_170a,false);
- }else{
- _170b=this.buildDynamicMenuItem(_170a,"Filter");
- }
- }
- }
- return _170b;
- };
- FilterAction.prototype.detailFilteringIsDisabled=function(){
- var _170d=this.getCognosViewer().getRAPReportInfo();
- if(_170d){
- return _170d.isDetailFilteringDisabled();
- }
- return false;
- };
- FilterAction.prototype.buildMenu=function(_170e){
- _170e.visible=(this.ifContainsInteractiveDataContainer()&&!this.detailFilteringIsDisabled());
- if(!_170e.visible){
- return _170e;
- }
- var _170f=this.isSelectionFilterable();
- this.toggleMenu(_170e,_170f);
- var _1710=[];
- var _1711=false;
- var _1712=false;
- var _1713=this.m_oCV.getSelectionController();
- var _1714=_1713.getAllSelectedObjects();
- if(_1714.length>0&&_1713.selectionsInSameDataContainer()&&_1713.selectionsFromSameDataItem()){
- var _1715=_1714[0].getDataItems()[0][0];
- if(_170f){
- _1711=this.addFilterValueActionsToMenu(_1713,_1710,_1715);
- }
- if(this.isRemoveItemFilterValid(_1715)){
- if(_1711==true){
- _1710.push({separator:true});
- _1712=true;
- }
- var label=this.getRefDataItemLabel(_1715);
- _1710.push({name:"RemoveFilterFor",label:RV_RES.IDS_JS_REMOVE_FILTER_FOR+" "+enforceTextDir(label),iconClass:"",action:{name:"Filter",payload:"remove"},items:null});
- }
- }
- if(this.isRemoveAllValid()==true){
- if(_1711&&!_1712){
- _1710.push({separator:true});
- }
- _1710.push({name:"RemoveAllFiltersForWidget",label:RV_RES.IDS_JS_REMOVE_ALL_FILTERS_FOR_WIDGET,iconClass:"",action:{name:"Filter",payload:"removeAllForWidget"},items:null});
- }
- if(_1710.length==0){
- return this.toggleMenu(_170e,false);
- }else{
- _170e.items=_1710;
- this.toggleMenu(_170e,true);
- return _170e;
- }
- };
- FilterAction.prototype.getRefDataItemLabel=function(_1717){
- var label=_1717;
- var _1719=this.m_oCV.getRAPReportInfo();
- if(_1719){
- var _171a=_1719.getFilterObject(_1717,true);
- if(_171a){
- label=_171a.itemLabel;
- }
- }
- return label;
- };
- FilterAction.prototype.addFilterValueActionsToMenu=function(_171b,_171c,_171d){
- var _171e=_171b.getAllSelectedObjectsWithUniqueCTXIDs();
- var _171f=_171e.length;
- var sel=0;
- if(_171e[0].m_dataContainerType=="list"){
- for(sel=0;sel<_171e.length;++sel){
- if(_171e[sel].m_sLayoutType=="columnTitle"){
- _171f=0;
- break;
- }
- }
- }
- if(_171f==0){
- return false;
- }
- var _1721=this.buildSelectedItemsString(_171e);
- if(_1721==""){
- if(_171f==1&&_171e[0].getLayoutType()=="datavalue"){
- _1721=RV_RES.IDS_JS_NULL;
- _171c.push({name:"InFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_INCLUDE,_1721),iconClass:"",action:{name:"Filter",payload:"in"},items:null});
- _171c.push({name:"NotInFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_EXCLUDE,_1721),iconClass:"",action:{name:"Filter",payload:"not"},items:null});
- }
- }else{
- if(_171b.selectionsAreDateTime()||(_171b.selectionsHaveCalculationMetadata()&&!_171b.selectionsNonMeasureWithMUN())){
- for(sel=0;sel<_171f;++sel){
- if(_171e[sel].m_sLayoutType=="columnTitle"){
- return false;
- }
- }
- if(_171f==1){
- if(_171e[0].getUseValues()[0][0]){
- _171c.push({name:"LessFilter",label:RV_RES.IDS_JS_FILTER_LESS_THAN+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"lessThan",formattedNumber:_1721}},items:null});
- _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});
- _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});
- _171c.push({name:"GreaterFilter",label:RV_RES.IDS_JS_FILTER_GREATER_THAN+" "+_1721,iconClass:"",action:{name:"Filter",payload:{type:"greaterThan",formattedNumber:_1721}},items:null});
- }
- }else{
- if(_171f==2){
- if(_171e[0].getUseValues()[0][0]&&_171e[1].getUseValues()[0][0]){
- var _1722=this.getItemLabel(_171e[0]);
- var _1723=this.getItemLabel(_171e[1]);
- _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});
- _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});
- }
- }else{
- return false;
- }
- }
- }else{
- var _1724=_171b.getDataContainerType();
- if(_1724=="crosstab"&&_171e[0].getLayoutType()=="columnTitle"){
- if(this.isSelectSingleMember(_171e[0])==true){
- return false;
- }
- }
- _171c.push({name:"InFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_INCLUDE,enforceTextDir(_1721)),iconClass:"",action:{name:"Filter",payload:"in"},items:null});
- _171c.push({name:"NotInFilter",label:CViewerCommon.getMessage(RV_RES.IDS_JS_FILTER_EXCLUDE,enforceTextDir(_1721)),iconClass:"",action:{name:"Filter",payload:"not"},items:null});
- }
- }
- return true;
- };
- FilterAction.prototype.isRemoveAllValid=function(){
- var _1725=this.m_oCV.getRAPReportInfo();
- if(_1725){
- return _1725.containsFilters();
- }
- return false;
- };
- FilterAction.prototype.isRemoveItemFilterValid=function(_1726){
- var _1727=this.getContainerId(this.m_oCV.getSelectionController());
- var _1728=this.m_oCV.getRAPReportInfo();
- if(_1727!=null&&_1728){
- var _1729=_1728.getFilterObjectFromContainer(_1727,_1726,false);
- return _1729?true:false;
- }
- return false;
- };
- FilterAction.prototype.isSelectionFilterable=function(){
- var _172a=this.m_oCV.getSelectionController();
- var _172b=_172a.getAllSelectedObjects();
- if(_172b.length>0){
- var _172c=_172b[0].getCellRef();
- if(_172c&&_172c.getAttribute&&_172c.getAttribute("no_data_item_column")==="true"){
- return false;
- }
- if(_172a.hasSelectedChartNodes()){
- var _172d=false;
- if(_172a.selectionsAreDateTime()||(_172a.selectionsHaveCalculationMetadata()&&!_172a.selectionsNonMeasureWithMUN())){
- _172d=true;
- }
- for(var sel=0;sel<_172b.length;++sel){
- if(_172b[sel].getLayoutType()){
- if(_172b[sel].getLayoutType().match("Title$")=="Title"){
- return false;
- }
- if(_172d&&_172b[sel].getLayoutType().match("Label$")=="Label"){
- return false;
- }
- }
- }
- }
- }
- return true;
- };
- function GetFilterInfoAction(){
- this.m_requestParms=null;
- };
- GetFilterInfoAction.prototype=new ModifyReportAction();
- GetFilterInfoAction.prototype.isUndoable=function(){
- return false;
- };
- GetFilterInfoAction.prototype.canBeQueued=function(){
- return true;
- };
- GetFilterInfoAction.prototype.setRequestParms=function(parms){
- this.m_requestParms=parms;
- };
- GetFilterInfoAction.prototype.runReport=function(){
- return false;
- };
- GetFilterInfoAction.prototype.updateInfoBar=function(){
- return false;
- };
- GetFilterInfoAction.prototype.fireModifiedReportEvent=function(){
- };
- GetFilterInfoAction.prototype.buildActionContextAdditionalParmsXML=function(){
- var _1730=XMLBuilderCreateXMLDocument("item");
- var _1731=_1730.documentElement;
- for(var parm in this.m_requestParms){
- if(this.m_requestParms.hasOwnProperty(parm)){
- var _1733=_1730.createElement(parm);
- _1733.appendChild(_1730.createTextNode(this.m_requestParms[parm]));
- _1731.appendChild(_1733);
- }
- }
- return _1730;
- };
- GetFilterInfoAction.prototype.addActionContextAdditionalParms=function(){
- if(this.m_requestParms===null){
- return "";
- }
- return XMLBuilderSerializeNode(this.buildActionContextAdditionalParmsXML());
- };
- GetFilterInfoAction.prototype.createFilterInfoDispatcherEntry=function(){
- var _1734=new ReportInfoDispatcherEntry(this.m_oCV);
- _1734.initializeAction(this);
- return _1734;
- };
- GetFilterInfoAction.prototype.execute=function(){
- this.getCognosViewer().setKeepFocus(this.keepFocusOnWidget());
- var _1735=this.createFilterInfoDispatcherEntry();
- this.m_oCV.dispatchRequest(_1735);
- this.fireModifiedReportEvent();
- };
- GetFilterInfoAction.prototype.getOnPromptingCallback=function(){
- return this.getOnCompleteCallback();
- };
- function GetFilterValuesAction(){
- this.m_sAction="CollectFilterValues";
- this.m_sRetryClass="GetFilterValues";
- };
- GetFilterValuesAction.prototype=new GetFilterInfoAction();
- GetFilterValuesAction.prototype.addActionContextAdditionalParms=function(){
- if(this.m_requestParms===null){
- return "";
- }
- var _1736=this.buildActionContextAdditionalParmsXML();
- var _1737=_1736.documentElement;
- for(var parm in this.m_requestParms){
- if(parm=="name"){
- var _1739=this.m_oCV.getSelectionController();
- if(typeof _1739!="undefined"&&typeof _1739.getCCDManager()!="undefined"){
- var _173a=_1739.getCCDManager().GetPageMinMaxForRDI(this.m_requestParms[parm]);
- if(typeof _173a!="undefined"){
- var _173b=_1736.createElement("pageMin");
- _173b.appendChild(_1736.createTextNode(_173a.pageMin));
- var _173c=_1736.createElement("pageMax");
- _173c.appendChild(_1736.createTextNode(_173a.pageMax));
- _1737.appendChild(_173b);
- _1737.appendChild(_173c);
- }
- if(this.m_oCV.isSinglePageReport()==true){
- var _173d=_1736.createElement("singlePageReport");
- _1737.appendChild(_173d);
- }
- }
- break;
- }
- }
- var _173e=XMLBuilderSerializeNode(_1736);
- return (_173e+this.addClientContextData(3));
- };
- GetFilterValuesAction.prototype.getOnCompleteCallback=function(){
- var _173f=this.getCognosViewer();
- var _1740=_173f.getViewerWidget();
- var _1741=this.m_requestParms;
- var _1742=function(_1743){
- _1740.handleGetFilterValuesResponse(_1743,_1741);
- };
- return _1742;
- };
- GetFilterValuesAction.prototype.canBeQueued=function(){
- return true;
- };
- GetFilterValuesAction.prototype.getActionKey=function(){
- if(typeof this.m_requestParms!="undefined"&&typeof this.m_requestParms.source!="undefined"){
- return this.m_sAction+this.m_requestParms.source;
- }
- return null;
- };
- function GetFilterableItemsAction(){
- this.m_sAction="CollectFilterableItems";
- };
- GetFilterableItemsAction.prototype=new GetFilterInfoAction();
- GetFilterableItemsAction.prototype.addActionContextAdditionalParms=function(){
- return this.addClientContextData(3);
- };
- GetFilterableItemsAction.prototype.getOnCompleteCallback=function(){
- var _1744=this.getCognosViewer();
- var _1745=_1744.getViewerWidget();
- var _1746=function(_1747){
- _1745.handleGetFilterableItemsResponse(_1747);
- };
- return _1746;
- };
- function UpdateDataFilterAction(){
- this.m_sAction="UpdateDataFilter";
- this.m_bForceRunSpec=false;
- };
- UpdateDataFilterAction.prototype=new ModifyReportAction();
- UpdateDataFilterAction.prototype.runReport=function(){
- return this.getViewerWidget().shouldReportBeRunOnAction();
- };
- UpdateDataFilterAction.prototype.getActionKey=function(){
- if(typeof this.m_requestParams!="undefined"){
- try{
- var parms=eval("("+this.m_requestParams+")");
- if(parms.clientId!==null){
- return this.m_sAction+parms.clientId;
- }
- }
- catch(e){
- }
- }
- return null;
- };
- UpdateDataFilterAction.prototype.canBeQueued=function(){
- return true;
- };
- UpdateDataFilterAction.prototype.keepFocusOnWidget=function(){
- return false;
- };
- UpdateDataFilterAction.prototype.isUndoable=function(){
- return false;
- };
- UpdateDataFilterAction.prototype.setRequestParms=function(parms){
- this.m_requestParams=parms.filterPayload;
- this.m_drillResetHUN=parms.drillResetHUN;
- this.m_isFacet=parms.isFacet;
- if(parms.forceCleanup){
- this.m_sForceCleanup=parms.forceCleanup;
- }
- };
- UpdateDataFilterAction.prototype.forceRunSpecRequest=function(){
- return this.m_bForceRunSpec;
- };
- UpdateDataFilterAction.prototype.preProcessContextValues=function(){
- var _174a=[];
- var _174b=dojo.fromJson(this.m_requestParams);
- if(_174b&&_174b["com.ibm.widget.context"]&&(_174b["com.ibm.widget.context"]["values"]||_174b["com.ibm.widget.context"]["ranges"])){
- var _174c=this.m_oCV.m_RAPReportInfo;
- var _174d=_174c.getContainers();
- if(!_174d){
- _174a;
- }
- var key="";
- var _174f="";
- if(_174b["com.ibm.widget.context"]["values"]){
- key="values";
- _174f=_174b["com.ibm.widget.context"]["values"];
- }else{
- key="ranges";
- _174f=_174b["com.ibm.widget.context"]["ranges"];
- }
- var _1750=_174c.collectSliderSetFromReportInfo();
- for(dataItem in _174f){
- if(_174c&&_174c.isReferenced(dataItem)){
- var _1751=dojo.clone(_174b);
- var _1752={};
- _1752[dataItem]=_174b["com.ibm.widget.context"][key][dataItem];
- _1751["com.ibm.widget.context"][key]=_1752;
- 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"]){
- var _1753={};
- _1751["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"]={};
- var _1754=document.forms["formWarpRequest"+this.m_oCV.getId()].packageBase.value;
- for(modelItem in _174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"]){
- if(modelItem.indexOf(_1754)!=-1){
- _1753[dataItem]=_174b["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"][modelItem][dataItem];
- if(_1753[dataItem]){
- _1751["com.ibm.widget.context.bux.selectValueControl"]["selectValueControl"]["itemSpecification"][modelItem]=_1753;
- break;
- }
- }
- }
- }
- var _1755=_174f[dataItem]&&key!=="ranges"?_174f[dataItem].length:0;
- if(this.checkIfFilterExpressionChanged(dataItem,_174b.clientId,_1755,_1750)){
- this.m_bForceRunSpec=true;
- }
- _174a.push(dojo.toJson(_1751));
- }
- }
- }else{
- _174a.push(dojo.toJson(_174b));
- }
- return _174a;
- };
- UpdateDataFilterAction.prototype.checkIfFilterExpressionChanged=function(_1756,_1757,_1758,_1759){
- if(!_1759||!_1759[_1757]||_1759[_1757].name!=_1756){
- return true;
- }
- var _175a=_1759[_1757].values?_1759[_1757].values.length:0;
- if(_1758==_175a){
- return false;
- }
- return (_1758===1)!==(_175a===1);
- };
- UpdateDataFilterAction.prototype.addActionContext=function(){
- var _175b="<reportActions";
- var _175c="";
- if(!this.runReport()){
- _175b+=" run=\"false\"";
- _175c="<inlineValues/>";
- }
- _175b+=">";
- if(this.m_drillResetHUN&&this.m_drillResetHUN.length>0){
- _175b+=this._getDrillResetActionContext();
- }
- if(this.m_sForceCleanup){
- _175b+="<reportAction name=\""+this.m_sAction+"\">"+dojo.toJson(this.m_sForceCleanup)+"</reportAction>";
- }
- var _175d;
- var _175e=(this.m_requestParams.charAt(0)==="<");
- if(this.m_isFacet||_175e){
- _175d=[this.m_requestParams];
- }else{
- _175d=this.preProcessContextValues();
- }
- for(var idx=0;idx<_175d.length;++idx){
- var _1760=_175d[idx];
- _175b+="<reportAction name=\""+this.m_sAction+"\">"+_175c;
- _175b+=(_175e)?_1760:xml_encode(_1760);
- if(idx>0){
- _175b+="<augment>true</augment>";
- }
- if(!this.m_isFacet){
- _175b+=this.addClientContextData(3);
- }
- _175b+="</reportAction>";
- _175b+="<reportAction name=\"GetInfo\"><include><sliders/></include>";
- _175b+="</reportAction>";
- }
- _175b+="</reportActions>";
- return _175b;
- };
- UpdateDataFilterAction.prototype._getDrillResetActionContext=function(){
- var _1761=new DrillResetAction();
- _1761.setCognosViewer(this.getCognosViewer());
- var _1762={drilledResetHUNs:this.m_drillResetHUN};
- _1761.setRequestParms(_1762);
- _1761.setUpdateInfoBar(false);
- var _1763=_1761.getReportActionContext();
- return _1763;
- };
- function CognosViewerSort(event,oCV){
- this.m_oCV=oCV;
- if(event){
- this.m_oEvent=event;
- this.m_oNode=getCrossBrowserNode(event,true);
- }
- };
- CognosViewerSort.prototype.setNode=function(node){
- this.m_oNode=node;
- };
- CognosViewerSort.prototype.getNode=function(){
- return this.m_oNode;
- };
- CognosViewerSort.prototype.isSort=function(){
- if(this.m_oNode&&this.m_oNode.nodeName=="IMG"&&(this.m_oNode.id).indexOf("sortimg")>=0){
- return true;
- }else{
- return false;
- }
- };
- CognosViewerSort.prototype.execute=function(){
- var _1767=getCognosViewerSCObjectRef(this.m_oCV.getId());
- _1767.selectSingleDomNode(this.m_oNode.parentNode);
- var _1768=this.getSortAction();
- _1768.setCognosViewer(this.m_oCV);
- _1768.execute();
- if(window.gViewerLogger){
- window.gViewerLogger.addContextInfo(_1767);
- }
- };
- CognosViewerSort.prototype.getSortAction=function(){
- var _1769=this.m_oCV.getAction("Sort");
- var _176a=this.m_oNode.getAttribute("sortOrder");
- if(_176a.indexOf("nosort")!=-1){
- _1769.setRequestParms({order:"ascending",type:"value"});
- }else{
- if(_176a.indexOf("ascending")!=-1){
- _1769.setRequestParms({order:"descending",type:"value"});
- }else{
- if(_176a.indexOf("descending")!=-1){
- _1769.setRequestParms({order:"none",type:"value"});
- }
- }
- }
- return _1769;
- };
- function SortAction(){
- this.m_sAction="Sort";
- this.m_sortOrder="none";
- this.m_sortType="";
- this.m_sItem="";
- this.m_sId="";
- };
- SortAction.prototype=new ModifyReportAction();
- SortAction.prototype.doExecute=function(){
- if(this.m_sortOrder==="none"){
- if(this.getContainerId(this.m_oCV.getSelectionController())){
- var _176b=this.getCurrentSortFromSelection();
- if(this.m_sortType==="value"&&_176b.indexOf("sortByValue")===-1){
- return false;
- }else{
- if(this.m_sortType==="label"&&_176b.indexOf("sortByLabel")===-1){
- return false;
- }
- }
- }
- }
- return true;
- };
- SortAction.prototype.execute=function(){
- if(this.doExecute()){
- ModifyReportAction.prototype.execute.call(this);
- }
- };
- SortAction.prototype.getUndoHint=function(){
- if(this.m_sortOrder=="none"){
- return RV_RES.IDS_JS_DONT_SORT;
- }else{
- return RV_RES.IDS_JS_SORT;
- }
- };
- SortAction.prototype.setRequestParms=function(_176c){
- this.m_sortOrder=_176c.order;
- this.m_sortType=_176c.type;
- if(_176c.id!=null&&typeof _176c.id!="undefined"){
- this.m_sId=_176c.id;
- }
- if(_176c.item!=null&&typeof _176c.item!="undefined"){
- this.m_sItem=_176c.item;
- }
- };
- SortAction.prototype.addActionContextAdditionalParms=function(){
- var _176d=this.m_oCV.getSelectionController();
- var parms="<order>"+this.m_sortOrder+"</order>";
- if(this.m_sortType=="label"){
- parms+="<byLabel/>";
- }
- if(this.getContainerId(_176d)==""&&this.m_sId!=null&&typeof this.m_sId!="undefined"&&this.m_sId!=""){
- parms+=("<id>"+xml_encode(this.m_sId)+"</id>");
- }
- if(this.m_sItem!=null&&typeof this.m_sItem!="undefined"&&this.m_sItem!=""){
- parms+=("<item>"+xml_encode(this.m_sItem)+"</item>");
- }
- parms+=this.addClientContextData(3);
- parms+=this.getSelectedCellTags();
- return parms;
- };
- SortAction.prototype.toggleMenu=function(_176f,_1770){
- if(_1770){
- _176f.iconClass="sort";
- _176f.disabled=false;
- }else{
- _176f.iconClass="sortDisabled";
- _176f.disabled=true;
- }
- return _176f;
- };
- SortAction.prototype.updateMenu=function(_1771){
- _1771.visible=this.ifContainsInteractiveDataContainer();
- if(!_1771.visible){
- return _1771;
- }
- this.buildMenu(_1771);
- if(_1771.disabled==true){
- return this.toggleMenu(_1771,false);
- }
- return this.buildDynamicMenuItem(this.toggleMenu(_1771,true),"Sort");
- };
- SortAction.prototype.buildSelectedItemsString=function(_1772,_1773,_1774){
- try{
- var _1775=_1772[_1772.length-1];
- if(_1773){
- var _1776=_1775.getDisplayValues()[0];
- if(typeof _1776=="undefined"){
- _1776=_1775.getUseValues()[0][0];
- }
- return _1776;
- }else{
- return _1775.getDataItemDisplayValue(_1774);
- }
- }
- catch(e){
- if(console&&console.log){
- console.log(e);
- }
- }
- };
- SortAction.prototype.buildMenu=function(_1777){
- _1777.visible=this.ifContainsInteractiveDataContainer();
- if(!_1777.visible){
- return _1777;
- }
- if(!this.isSelectionSortable()){
- return this.toggleMenu(_1777,false);
- }
- _1777=this.toggleMenu(_1777,true);
- var _1778=[];
- var _1779=this.m_oCV.getSelectionController();
- var _177a=_1779.getAllSelectedObjects();
- if(_177a.length==1&&_177a[0].isHomeCell()==false){
- var _177b=_1779.getDataContainerType();
- var _177c=this.getContainerId(_1779);
- var _177d=this.getReportInfo(_177c);
- if(_177b==""&&!this.isSelectionOnChart()&&_177a[0].getLayoutType()=="section"){
- if(_177d!=null){
- _177b=_177d.displayTypeId;
- }
- }
- var _177e,_177f,_1780;
- var _1781=this.getCurrentSortFromSelection();
- var _1782=this.isSelectionOnChart();
- var _1783=_1781.indexOf("sortByValue")!=-1;
- var _1784=_1781.indexOf("sortByValueAscending")!=-1;
- var _1785=_1781.indexOf("sortByValueDescending")!=-1;
- var _1786=this.m_oCV.isIWidgetMobile();
- if(_177b=="list"){
- var _1787={name:"SortAscending",label:RV_RES.IDS_JS_SORT_ASCENDING,action:{name:"Sort",payload:{order:"ascending",type:"value"}},items:null};
- this.addMenuItemChecked(_1784,_1787,"sortAscending");
- _1778.push(_1787);
- var _1788={name:"SortDescending",label:RV_RES.IDS_JS_SORT_DESCENDING,action:{name:"Sort",payload:{order:"descending",type:"value"}},items:null};
- this.addMenuItemChecked(_1785,_1788,"sortDescending");
- _1778.push(_1788);
- var _1789={name:"DontSort",label:RV_RES.IDS_JS_DONT_SORT,action:{name:"Sort",payload:{order:"none",type:"value"}},items:null};
- this.addMenuItemChecked(!_1783,_1789,"sortNone");
- _1778.push(_1789);
- }else{
- if(_177b=="crosstab"||_1782){
- if(_177a[0].getLayoutType()=="columnTitle"||_1782){
- _177e=this.m_oCV.getRAPReportInfo();
- if(this.canSortByValueOnCrosstab(_177a[0],_177e)){
- _177f=RV_RES.IDS_JS_SORT_BY_VALUE;
- if(_1782){
- _1780=this.buildSelectedItemsString(_177a,true,_177d);
- if(typeof _1780!=="undefined"){
- _177f+=":"+_1780;
- }
- }
- 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}]};
- this.addMenuItemChecked(_1783,_178a);
- this.addMenuItemChecked(_1784,_178a.items[0],"sortAscending");
- this.addMenuItemChecked(_1785,_178a.items[1],"sortDescending");
- this.addMenuItemChecked(!_1783,_178a.items[2],"sortNone");
- if(_1786){
- _178a.flatten=true;
- }
- _1778.push(_178a);
- }
- if(this.canSortByLabelOnCrosstab(_177a[0])){
- _177f=RV_RES.IDS_JS_SORT_BY_LABEL;
- if(_1782){
- _1780=this.buildSelectedItemsString(_177a,false,_177d);
- if(typeof _1780!=="undefined"){
- _177f+=":"+_1780;
- }
- }
- 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}]};
- var _178c=_1781.indexOf("sortByLabel")!=-1;
- this.addMenuItemChecked(_178c,_178b);
- this.addMenuItemChecked(_1781.indexOf("sortByLabelAscending")!=-1,_178b.items[0],"sortAscending");
- this.addMenuItemChecked(_1781.indexOf("sortByLabelDescending")!=-1,_178b.items[1],"sortDescending");
- this.addMenuItemChecked(!_178c,_178b.items[2],"sortNone");
- if(_1786){
- _178b.flatten=true;
- }
- _1778.push(_178b);
- }
- }
- }
- }
- }
- if(_1778.length==0){
- this.toggleMenu(_1777,false);
- }else{
- if(_1786){
- if(_177b=="crosstab"||_1782){
- _1777.useChildrenItems=true;
- }else{
- _1777.flatten=true;
- }
- }
- _1777.items=_1778;
- this.toggleMenu(_1777,true);
- }
- return _1777;
- };
- SortAction.prototype.isSelectionSortable=function(){
- var _178d=this.m_oCV.getSelectionController();
- var _178e=_178d.getAllSelectedObjects();
- if(_178e.length==1){
- var _178f=_178e[0];
- if(_178d.getDataContainerType()=="crosstab"&&_178f.getLayoutType()=="datavalue"){
- return false;
- }
- if(_178d.hasSelectedChartNodes()){
- var node=_178f.getArea();
- if(node.nodeName=="AREA"||node.nodeName=="IMG"){
- return _178e[0].getLayoutType()=="ordinalAxisLabel"||_178e[0].getLayoutType()=="legendLabel";
- }
- }else{
- var data=_178f.getDataItems();
- if(_178f.getCellRef().getAttribute("type")=="datavalue"&&!(data&&data.length)){
- return false;
- }
- var oCell=_178f.getCellRef();
- if(oCell.getAttribute("no_data_item_column")==="true"){
- return false;
- }
- if(oCell.getAttribute("canSort")!="false"){
- return true;
- }
- }
- }
- return false;
- };
- SortAction.prototype.getCurrentSortFromSelection=function(){
- var _1793=this.getContainerId(this.m_oCV.getSelectionController());
- var _1794=this.m_oCV.getRAPReportInfo();
- var _1795="";
- if(_1793!=""&&_1794){
- var _1796=_1794.getContainer(_1793);
- if(typeof _1796.sort!="undefined"){
- var _1797=this.m_oCV.getSelectionController();
- var _1798=_1797.getAllSelectedObjects();
- if(_1798.length==1){
- var _1799=_1798[0].getDataItems();
- if(_1799.length<1){
- return _1795;
- }
- var _179a=_1799[0][0];
- for(var index=0;index<_1796.sort.length;++index){
- var _179c=_1796.sort[index];
- if(typeof _179c.labels=="string"&&_179c.labels==_179a){
- _1795+=_179c.order=="descending"?"sortByLabelDescending":"sortByLabelAscending";
- }
- if(typeof _179c.valuesOf=="string"&&(_179c.valuesOf==_179a||this.isSortedValueOnRenamedColumn(_1798[0],_179c))){
- _1795+=_179c.order=="descending"?"sortByValueDescending":"sortByValueAscending";
- }else{
- if(_179c.valuesOf instanceof Array){
- var match=true;
- for(var _179e=0;_179e<_179c.valuesOf.length;++_179e){
- if(_179e<_1798[0].m_contextIds[0].length){
- var ctx=_1798[0].m_contextIds[0][_179e];
- var _17a0=_1797.getDisplayValue(ctx);
- var _17a1=this.findItemLabel(_1796,_179c.valuesOf[_179e].item);
- if(_17a1!=_17a0){
- match=false;
- break;
- }
- }
- }
- if(match){
- _1795+=_179c.valuesOf[0].order=="descending"?"sortByValueDescending":"sortByValueAscending";
- }
- }
- }
- }
- }
- }
- }
- return _1795;
- };
- SortAction.prototype.isSortedValueOnRenamedColumn=function(_17a2,_17a3){
- if(_17a3&&_17a2){
- return (_17a3.valuesOf===_17a2.getColumnRP_Name()&&_17a2.getLayoutType()==="columnTitle");
- }
- };
- SortAction.prototype.findItemLabel=function(_17a4,item){
- var _17a6=_17a4.itemInfo;
- if(_17a6){
- for(var i=0;i<_17a6.length;i++){
- if(_17a6[i].item===item){
- if(_17a6[i].itemLabel){
- return _17a6[i].itemLabel;
- }
- break;
- }
- }
- }
- return item;
- };
- SortAction.prototype.canSortByValueOnCrosstab=function(_17a8,_17a9){
- var _17aa=this.m_oCV.getSelectionController();
- var _17ab=this.getContainerId(this.m_oCV.getSelectionController());
- if(_17aa.isRelational()==true){
- return false;
- }
- if(_17aa.selectionsHaveCalculationMetadata()&&this.selectedObjectIsLeaf(_17ab,_17a8,_17a9)){
- var aMuns=_17a8.getMuns()[0];
- for(var index=0;index<aMuns.length;++index){
- if(aMuns[index]!=null&&aMuns[index].indexOf("uuid:")>=0){
- return false;
- }
- }
- return true;
- }
- return false;
- };
- SortAction.prototype.selectedObjectIsLeaf=function(_17ae,_17af,_17b0){
- if(_17b0){
- var _17b1=_17af.getDataItems();
- if(_17b1!=null&&typeof _17b1!="undefined"&&_17b1.length>0){
- var _17b2=_17b0.getDrillability(_17ae,_17b1[0][0]);
- if(_17b2){
- return _17b2.leaf==true;
- }
- }
- }
- return false;
- };
- SortAction.prototype.canSortByLabelOnCrosstab=function(_17b3){
- var _17b4=this.m_oCV.getSelectionController();
- var _17b5=_17b4.getAllSelectedObjects();
- if(_17b5.length==1){
- var _17b3=_17b5[0];
- if(this.isSelectSingleMember(_17b3)==false){
- if(_17b4.selectionsNonMeasureWithMUN()||!_17b4.selectionsHaveCalculationMetadata()){
- return true;
- }
- }
- }
- return false;
- };
- function RedrawAction(){
- this.m_specUpdated=false;
- };
- RedrawAction.prototype=new ModifyReportAction();
- RedrawAction.prototype.reuseQuery=function(){
- return true;
- };
- RedrawAction.prototype.keepRAPCache=function(){
- return false;
- };
- RedrawAction.prototype.setSpecUpdated=function(flag){
- this.m_specUpdated=flag;
- };
- RedrawAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_ADVANCED_EDITING;
- };
- RedrawAction.prototype.addActionContext=function(){
- if(this.m_specUpdated){
- return "<reportActions><GetInfo><specUpdatedInBUA/></GetInfo></reportActions>";
- }
- return "<reportActions><GetInfo/></reportActions>";
- };
- function EditContentAction(){
- this._oMissingMemberRecoveryMode=null;
- };
- EditContentAction.prototype=new CognosViewerAction();
- EditContentAction.superclass=CognosViewerAction.prototype;
- EditContentAction.prototype.execute=function(){
- if(typeof this.preferencesChanged!="undefined"&&this.preferencesChanged!==null&&this.preferencesChanged===true){
- this.deleteCWAContainer();
- return;
- }
- window.CVEditContentActionInstance=this;
- var _17b7=window.viewerCWAContainer?true:false;
- if(!window.viewerCWAContainer){
- this.createCWAContainer();
- }
- this.addWindowEventListeners();
- this.buildBUAObjects();
- window.viewerCWAContainer.show();
- if(_17b7){
- window.BUAEvent("appReady");
- }
- };
- EditContentAction.prototype.createCWAContainer=function(){
- this.deleteCWAContainer();
- var _17b8=this.createCWAIFrame();
- var _17b9=this.createBlocker();
- window.viewerCWAContainer={"type":"iframe","containerDiv":_17b8,"blocker":_17b9,"iframePadding":"18","show":function(){
- this.resize();
- this.containerDiv.style.display="block";
- this.blocker.style.display="block";
- },"hide":function(){
- this.blocker.style.display="none";
- this.containerDiv.style.display="none";
- },"resize":function(){
- var _17ba=dojo.window.getBox();
- this.containerDiv.style.height=_17ba.h-this.iframePadding+"px";
- this.containerDiv.style.width=_17ba.w-this.iframePadding+"px";
- }};
- };
- EditContentAction.prototype.deleteCWAContainer=function(){
- var _17bb=window.viewerCWAContainer;
- if(_17bb){
- _17bb.hide();
- document.body.removeChild(_17bb.containerDiv);
- document.body.removeChild(_17bb.blocker);
- delete window.viewerCWAContainer;
- window.viewerCWAContainer=null;
- }
- };
- EditContentAction.prototype.hideCWAContainer=function(){
- this.removeWindowEventListeners();
- if(window.viewerCWAContainer){
- window.viewerCWAContainer.hide();
- }
- window.CVEditContentActionInstance=null;
- };
- EditContentAction.prototype.createCWAIFrame=function(){
- var _17bc=document.createElement("div");
- _17bc.className="buaContainer";
- document.body.appendChild(_17bc);
- var _17bd=document.createElement("iframe");
- _17bd.setAttribute("id","buaIframe");
- _17bd.setAttribute("src",this.getWebContent()+"/pat/rsapp.htm");
- _17bd.setAttribute("name","buaIframe");
- _17bd.setAttribute("frameborder","0");
- _17bd.className="buaIframe";
- _17bc.appendChild(_17bd);
- return _17bc;
- };
- EditContentAction.prototype.createBlocker=function(){
- var _17be=document.createElement("div");
- _17be.setAttribute("id","reportBlocker");
- _17be.setAttribute("name","reportBlocker");
- _17be.setAttribute("tabIndex","1");
- _17be.className="reportBlocker";
- document.body.appendChild(_17be);
- return _17be;
- };
- EditContentAction.prototype.buildBUAObjects=function(){
- 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()};
- var _17bf=this.getViewerIWidget();
- if(_17bf!==null){
- var _17c0=_17bf.getAttributeValue("gateway");
- if(_17c0){
- window.RSParameters["cv.gateway"]=_17c0;
- }
- var _17c1=_17bf.getAttributeValue("webcontent");
- if(_17c1){
- window.RSParameters["cv.webcontent"]=_17c1;
- }
- }
- this.addExtraLaunchParameters(window.RSParameters);
- };
- EditContentAction.prototype.getBUAIframe=function(){
- return document.getElementById("buaIframe");
- };
- EditContentAction.prototype.getBUAWindow=function(){
- var _17c2=null;
- var _17c3=this.getBUAIframe();
- if(_17c3!==null){
- _17c2=_17c3.contentWindow;
- }
- return _17c2;
- };
- EditContentAction.prototype.setReportSettings=function(){
- var oCV=this.getCognosViewer();
- var _17c5=oCV.getViewerWidget();
- _17c5.fireEvent("com.ibm.bux.widget.getDisplayTitle",null,{callback:function(_17c6){
- window.CVEditContentActionInstance.openReportWithBUA(_17c6);
- }});
- };
- EditContentAction.prototype.openReportWithBUA=function(_17c7){
- var _17c8=this.m_oCV.envParams["ui.spec"].indexOf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- if(_17c8==-1){
- _17c8=0;
- }else{
- _17c8="<?xml version=\"1.0\" encoding=\"UTF-8\"?>".length;
- }
- var _17c9=this.m_oCV.envParams["ui.spec"].substr(_17c8,this.m_oCV.envParams["ui.spec"].length);
- var _17ca={"displayName":xml_decode(_17c7),"parameterValues":this.m_oCV.getExecutionParameters(),"reportXML":_17c9,"showOpenTransition":false};
- if(this.ifPassTrackingtoBUA()){
- _17ca.tracking=this.m_oCV.getTracking();
- }
- var _17cb=this.getBUAWindow();
- _17cb.Application.SetBUAContext(_17ca);
- };
- EditContentAction.prototype.getViewerIWidget=function(){
- return this.m_oCV.getViewerWidget();
- };
- EditContentAction.prototype.getGateway=function(){
- return this.m_oCV.getGateway();
- };
- EditContentAction.prototype.getCapabilitiesXml=function(){
- return this.m_oCV.capabilitiesXML;
- };
- EditContentAction.prototype.getCafContextId=function(){
- return typeof this.m_oCV.cafContextId!="undefined"?this.m_oCV.cafContextId:"";
- };
- EditContentAction.prototype.getWebContent=function(){
- return this.getCognosViewer().getWebContentRoot();
- };
- EditContentAction.prototype.addExtraLaunchParameters=function(_17cc){
- };
- EditContentAction.prototype.runUpdatedReportFromBUA=function(){
- var _17cd=this.getBUAWindow();
- var _17ce=this.m_oCV.envParams["ui.spec"];
- var _17cf=_17cd.Application.GetBUAContext();
- if(_17cf.isSpecModified){
- this.m_oCV.envParams["ui.spec"]=_17cf.reportXML;
- this.m_oCV.setTracking(_17cf.tracking);
- this.m_oCV.setExecutionParameters(_17cf.parameterValues);
- this._invokeRedrawAction(_17ce);
- }
- };
- EditContentAction.prototype._invokeRedrawAction=function(_17d0){
- this.getUndoRedoQueue().setOriginalSpec(_17d0);
- var _17d1=this.m_oCV.getAction("Redraw");
- _17d1.setSpecUpdated(true);
- this.m_oCV.getViewerWidget().setPromptParametersRetrieved(false);
- _17d1.execute();
- };
- EditContentAction.prototype.ifPassTrackingtoBUA=function(){
- if(this.m_oCV.getRAPReportInfo()){
- return this.m_oCV.getRAPReportInfo().getPassTrackingtoBUA();
- }
- return true;
- };
- EditContentAction.prototype.setRequestParms=function(_17d2){
- EditContentAction.superclass.setRequestParms(_17d2);
- if(_17d2){
- if(_17d2.preferencesChanged){
- this.preferencesChanged=_17d2.preferencesChanged;
- }
- if(_17d2.MissingMemberRecoveryMode){
- this._oMissingMemberRecoveryMode=_17d2.MissingMemberRecoveryMode;
- }
- }
- };
- EditContentAction.prototype.runUpdatedReportFromBUA_MissingMemberRecoveryMode=function(){
- var _17d3=this.getBUAWindow();
- var _17d4=this.m_oCV.envParams["ui.spec"];
- var _17d5=_17d3.Application.GetBUAContext();
- this.m_oCV.setTracking(_17d5.tracking);
- this.m_oCV.envParams["ui.spec"]=_17d5.reportXML;
- this.m_oCV.setExecutionParameters(_17d5.parameterValues);
- if(this._oMissingMemberRecoveryMode&&this._oMissingMemberRecoveryMode.oFaultDialog){
- this._oMissingMemberRecoveryMode.oFaultDialog.hide();
- }
- this._invokeRedrawAction(_17d4);
- };
- EditContentAction.prototype.cancelPressed=function(){
- };
- EditContentAction.prototype.addWindowEventListeners=function(){
- if(window.attachEvent){
- window.attachEvent("onresize",window.CVEditContentActionInstance.onWindowResize);
- }else{
- window.addEventListener("resize",window.CVEditContentActionInstance.onWindowResize,false);
- }
- };
- EditContentAction.prototype.removeWindowEventListeners=function(){
- if(window.detachEvent){
- window.detachEvent("onresize",window.CVEditContentActionInstance.onWindowResize);
- }else{
- window.removeEventListener("resize",window.CVEditContentActionInstance.onWindowResize,false);
- }
- };
- EditContentAction.prototype.onWindowResize=function(){
- var _17d6=window.viewerCWAContainer;
- if(_17d6){
- _17d6.resize();
- }
- };
- function BUAEvent(_17d7){
- var _17d8=window.CVEditContentActionInstance;
- switch(_17d7){
- case "appReady":
- _17d8.setReportSettings();
- break;
- case "donePressed":
- _17d8.hideCWAContainer();
- if(_17d8._oMissingMemberRecoveryMode){
- _17d8.runUpdatedReportFromBUA_MissingMemberRecoveryMode();
- }else{
- _17d8.runUpdatedReportFromBUA();
- }
- break;
- case "cancelPressed":
- _17d8.cancelPressed();
- _17d8.hideCWAContainer();
- break;
- }
- };
- function NewReportAction(){
- this._viewerIWidget=null;
- this._packageSearchPath=null;
- this._webContentRoot=null;
- this._gateway=null;
- this._capabilitiesXml=null;
- this._cafContextId=null;
- };
- NewReportAction.prototype=new EditContentAction();
- NewReportAction.prototype.parent=EditContentAction.prototype;
- NewReportAction.prototype.clearSelections=function(){
- };
- NewReportAction.prototype.getCognosViewer=function(){
- return this.getViewerIWidget().getViewerObject();
- };
- NewReportAction.prototype.setRequestParms=function(_17d9){
- this.parent.setRequestParms.call(this,_17d9);
- this._packageSearchPath=_17d9.packageSearchPath;
- this._viewerIWidget=_17d9.viewerIWidget;
- this._webContentRoot=_17d9.webContentRoot;
- this._gateway=_17d9.gateway;
- this._capabilitiesXml=_17d9.capabilitiesXml;
- this._cafContextId=_17d9.cafContextId;
- };
- NewReportAction.prototype.getViewerIWidget=function(){
- return this._viewerIWidget;
- };
- NewReportAction.prototype.getGateway=function(){
- return this._gateway;
- };
- NewReportAction.prototype.getCapabilitiesXml=function(){
- return this._capabilitiesXml;
- };
- NewReportAction.prototype.getCafContextId=function(){
- return this._cafContextId?this._cafContextId:"";
- };
- NewReportAction.prototype.getWebContent=function(){
- return this._webContentRoot;
- };
- NewReportAction.prototype.setReportSettings=function(){
- var _17da={"showOpenTransition":false,"model":this._packageSearchPath};
- var _17db=this.getBUAWindow();
- _17db.Application.SetBUAContext(_17da);
- };
- NewReportAction.prototype.addExtraLaunchParameters=function(_17dc){
- _17dc.model=this._packageSearchPath;
- };
- NewReportAction.prototype.cancelPressed=function(){
- this.getViewerIWidget().iContext.iEvents.fireEvent("com.ibm.bux.widget.action",null,{action:"deleteWidget"});
- };
- NewReportAction.prototype.runUpdatedReportFromBUA=function(){
- var _17dd=this.getViewerIWidget();
- _17dd.setAttributeValue("reportCreatedInCW","true");
- var _17de=this.getBUAWindow().Application.GetBUAContext();
- _17dd.setNewReportInfo({"ui.spec":_17de.reportXML,"m_tracking":_17de.tracking?_17de.tracking:"","parameterValues":_17de.parameterValues?_17de.parameterValues:""});
- _17dd.onLoad();
- };
- function AuthoredDrillAction(){
- this.m_drillTargetSpecification="";
- };
- AuthoredDrillAction.prototype=new CognosViewerAction();
- AuthoredDrillAction.prototype.setRequestParms=function(_17df){
- this.m_drillTargetSpecification=_17df;
- };
- AuthoredDrillAction.prototype.executeDrillTarget=function(_17e0){
- var _17e1=XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(_17e0));
- var _17e2=encodeURIComponent(_17e1.getAttribute("bookmarkRef"));
- var _17e3=_17e1.getAttribute("path");
- var _17e4=this._shouldShowInNewWindow(_17e1);
- var oCV=this.getCognosViewer();
- if((_17e2!==null&&_17e2!=="")&&(_17e3===null||_17e3==="")){
- var _17e6=_17e1.getAttribute("bookmarkPage");
- if(_17e6&&_17e6!==""){
- oCV.executeAction("GotoPage",{"pageNumber":_17e6,"anchorName":_17e2});
- }else{
- document.location="#"+_17e2;
- }
- }else{
- var _17e7="";
- if(_17e4){
- _17e7="_blank";
- }
- var _17e8=[];
- var _17e9=[];
- _17e9.push("obj");
- _17e9.push(_17e3);
- _17e8[_17e8.length]=_17e9;
- var _17ea=false;
- var _17eb,_17ec,_17ed,sName,sNil;
- var _17f0=XMLHelper_FindChildrenByTagName(_17e1,"drillParameter",false);
- for(var index=0;index<_17f0.length;++index){
- _17eb=[];
- _17ec=_17f0[index];
- _17ed=_17ec.getAttribute("value");
- sName=_17ec.getAttribute("name");
- if(_17ed!==null&&_17ed!==""){
- _17eb.push("p_"+sName);
- _17eb.push(this.buildSelectionChoicesSpecification(_17ec));
- }
- sNil=_17ec.getAttribute("nil");
- if(sNil!==null&&sNil!==""){
- _17eb.push("p_"+sName);
- _17eb.push(this.buildSelectionChoicesNilSpecification());
- }
- if(_17eb.length>0){
- _17e8[_17e8.length]=_17eb;
- }
- if(!_17ea){
- var _17f2=_17ec.getAttribute("propertyToPass");
- _17ea=(_17f2&&_17f2.length>0)?true:false;
- }
- }
- var _17f3=_17e1.getAttribute("method");
- var _17f4=_17e1.getAttribute("outputFormat");
- var _17f5=_17e1.getAttribute("outputLocale");
- var _17f6=_17e1.getAttribute("prompt");
- var _17f7=_17e1.getAttribute("dynamicDrill");
- var _17f8=this.getXMLNodeAsString(_17e1,"parameters");
- var _17f9=this.getXMLNodeAsString(_17e1,"objectPaths");
- var oCVId=oCV.getId();
- var _17fb=document.forms["formWarpRequest"+oCVId];
- var _17fc=oCV.getAdvancedServerProperty("VIEWER_JS_CALL_FORWARD_DRILLTHROUGH_TO_SELF");
- if((!_17fc||_17fc.toLowerCase()!=="false")&&_17f6!="true"&&this.isSameReport(_17fb,_17e3)&&this.isSameReportFormat(_17f4)&&!_17e4&&!_17ea){
- var _17fd=new ViewerDispatcherEntry(oCV);
- _17fd.addFormField("ui.action","forward");
- if(oCV!==null&&typeof oCV.rvMainWnd!="undefined"){
- oCV.rvMainWnd.addCurrentReportToReportHistory();
- var _17fe=oCV.rvMainWnd.saveReportHistoryAsXML();
- _17fd.addFormField("cv.previousReports",_17fe);
- }
- for(index=0;index<_17f0.length;++index){
- _17eb=[];
- _17ec=_17f0[index];
- _17ed=_17ec.getAttribute("value");
- sName=_17ec.getAttribute("name");
- sNil=_17ec.getAttribute("nil");
- if((sNil===null||sNil==="")&&(_17ed===null||_17ed==="")){
- _17eb.push("p_"+sName);
- _17eb.push(this.buildSelectionChoicesNilSpecification());
- }
- if(_17eb.length>0){
- _17e8[_17e8.length]=_17eb;
- }
- }
- for(index=1;index<_17e8.length;index++){
- _17fd.addFormField(_17e8[index][0],_17e8[index][1]);
- }
- _17fd.addFormField("_drillThroughToSelf","true");
- if(oCV.m_tabsPayload&&oCV.m_tabsPayload.tabs){
- _17fd.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",oCV.m_tabsPayload.tabs[0].id);
- }
- oCV.setUsePageRequest(true);
- oCV.dispatchRequest(_17fd);
- if(typeof oCV.m_viewerFragment=="undefined"){
- var _17ff=getCognosViewerObjectRefAsString(oCVId);
- setTimeout(_17ff+".getRequestIndicator().show()",10);
- }
- }else{
- doSingleDrill(_17e7,_17e8,_17f3,_17f4,_17f5,_17e2,_17f8,_17f9,this.getCognosViewer().getId(),_17f6,_17f7);
- }
- }
- };
- AuthoredDrillAction.prototype._shouldShowInNewWindow=function(_1800){
- return _1800.getAttribute("showInNewWindow")=="true";
- };
- AuthoredDrillAction.prototype.isSameReport=function(_1801,_1802){
- if(_1801["ui.object"]&&_1802==_1801["ui.object"].value){
- return true;
- }
- return false;
- };
- AuthoredDrillAction.prototype.isSameReportFormat=function(_1803){
- var _1804=this.getCognosViewer().envParams["run.outputFormat"];
- if(_1804){
- if(_1803==_1804){
- return true;
- }else{
- if(_1804=="HTML"&&_1803=="HTMLFragment"){
- return true;
- }
- }
- }
- return false;
- };
- AuthoredDrillAction.prototype.getXMLNodeAsString=function(_1805,_1806){
- var sXML="";
- if(_1805!=null){
- var node=XMLHelper_FindChildByTagName(_1805,_1806,false);
- if(node!=null){
- sXML=XMLBuilderSerializeNode(node);
- }
- }
- return sXML;
- };
- AuthoredDrillAction.prototype.execute=function(_1809){
- if(this.m_drillTargetSpecification!=""){
- this.executeDrillTarget(this.m_drillTargetSpecification);
- }else{
- if(typeof _1809!="undefined"){
- var _180a=this.getCognosViewer().getDrillTargets();
- var _180b=this.getAuthoredDrillThroughContext(_1809,_180a);
- var _180c=_180b.childNodes;
- if(_180c.length==1){
- this.executeDrillTarget(XMLBuilderSerializeNode(_180c[0]));
- }else{
- doMultipleDrills(XMLBuilderSerializeNode(_180b),this.getCognosViewer().getId());
- }
- }
- }
- };
- AuthoredDrillAction.prototype.showDrillTargets=function(_180d){
- var _180e="<context>";
- for(var index=0;index<_180d.length;++index){
- var _1810=_180d[index];
- _180e+="<member>";
- var sName=_1810.getAttribute("label");
- _180e+="<name>";
- _180e+=sXmlEncode(sName);
- _180e+="</name>";
- var _1812=_1810.getAttribute("path");
- _180e+="<drillThroughSearchPath>";
- _180e+=sXmlEncode(_1812);
- _180e+="</drillThroughSearchPath>";
- var _1813=_1810.getAttribute("method");
- _180e+="<drillThroughAction>";
- _180e+=sXmlEncode(_1813);
- _180e+="</drillThroughAction>";
- var _1814=_1810.getAttribute("outputFormat");
- _180e+="<drillThroughFormat>";
- _180e+=sXmlEncode(_1814);
- _180e+="</drillThroughFormat>";
- var sData="parent."+this.getTargetReportRequestString(_1810);
- _180e+="<data>";
- _180e+=sXmlEncode(sData);
- _180e+="</data>";
- _180e+="</member>";
- }
- _180e+="</context>";
- };
- AuthoredDrillAction.prototype.populateContextMenu=function(_1816){
- var _1817=this.getCognosViewer();
- var _1818=_1817.rvMainWnd.getToolbarControl();
- var _1819=null;
- if(typeof _1818!="undefined"&&_1818!=null){
- var _181a=_1818.getItem("goto");
- if(_181a){
- _1819=_181a.getMenu();
- }
- }
- var _181b=_1817.rvMainWnd.getContextMenu();
- var _181c=null;
- if(typeof _181b!="undefined"&&_181b!=null){
- _181c=_181b.getGoToMenuItem().getMenu();
- }
- if(_1819!=null||_181c!=null){
- var _181d=this.getCognosViewer().getDrillTargets();
- var _181e=this.getAuthoredDrillThroughContext(_1816,_181d);
- var _181f=_181e.childNodes;
- if(_181f.length>0){
- for(var index=0;index<_181f.length;++index){
- var _1821=_181f[index];
- var _1822=getCognosViewerObjectRefAsString(this.getCognosViewer().getId())+".m_oDrillMgr.executeAuthoredDrill(\""+encodeURIComponent(XMLBuilderSerializeNode(_1821))+"\");";
- var _1823=this.getTargetReportIconPath(_1821);
- var _1824=_1821.getAttribute("label");
- if(isViewerBidiEnabled()){
- var bidi=BidiUtils.getInstance();
- _1824=bidi.btdInjectUCCIntoStr(_1824,getViewerBaseTextDirection());
- }
- if(_1819!=null){
- new CMenuItem(_1819,_1824,_1822,_1823,gMenuItemStyle,_1817.getWebContentRoot(),_1817.getSkin());
- }
- if(_181c!=null){
- new CMenuItem(_181c,_1824,_1822,_1823,gMenuItemStyle,_1817.getWebContentRoot(),_1817.getSkin());
- }
- }
- }
- }
- };
- AuthoredDrillAction.prototype.buildSelectionChoicesNilSpecification=function(){
- return "<selectChoices/>";
- };
- AuthoredDrillAction.prototype.buildSelectionChoicesSpecification=function(_1826){
- var _1827="";
- var _1828=_1826.getAttribute("value");
- if(_1828!=null){
- var _1829=_1826.getAttribute("propertyToPass");
- _1827+="<selectChoices";
- if(_1829!=null&&_1829!=""){
- _1827+=" propertyToPass=\"";
- _1827+=sXmlEncode(_1829);
- _1827+="\"";
- }
- _1827+=">";
- if(_1828.indexOf("<selectChoices>")!=-1){
- _1827+=_1828.substring(_1828.indexOf("<selectChoices>")+15);
- }else{
- if(_1828!=""){
- _1827+="<selectOption ";
- var sMun=_1826.getAttribute("mun");
- if(sMun!=null&&sMun!=""){
- var _182b=sXmlEncode(sMun);
- _1827+="useValue=\"";
- _1827+=_182b;
- _1827+="\" ";
- _1827+="mun=\"";
- _1827+=_182b;
- _1827+="\" ";
- _1827+="displayValue=\"";
- _1827+=sXmlEncode(_1828);
- _1827+="\"";
- }else{
- _1827+="useValue=\"";
- _1827+=sXmlEncode(_1828);
- _1827+="\" ";
- var _182c=_1826.getAttribute("displayValue");
- if(_182c==null||_182c==""){
- _182c=_1828;
- }
- _1827+="displayValue=\"";
- _1827+=sXmlEncode(_182c);
- _1827+="\"";
- }
- _1827+="/>";
- _1827+="</selectChoices>";
- }
- }
- }
- return _1827;
- };
- AuthoredDrillAction.prototype.getPropertyToPass=function(_182d,_182e){
- if(_182d!=null&&_182d!=""&&_182e!=null){
- var _182f=_182e.childNodes;
- if(_182f!=null){
- for(var index=0;index<_182f.length;++index){
- var _1831=_182f[index];
- var sName="";
- if(_1831.getAttribute("name")!=null){
- sName=_1831.getAttribute("name");
- }
- if(sName==_182d){
- return _1831.getAttribute("propertyToPass");
- }
- }
- }
- }
- return "";
- };
- AuthoredDrillAction.prototype.getTargetReportRequestString=function(_1833){
- var _1834="";
- var _1835=_1833.getAttribute("bookmarkRef");
- var _1836=_1833.getAttribute("path");
- var _1837=_1833.getAttribute("showInNewWindow");
- if((_1835!=null&&_1835!="")&&(_1836==null||_1836=="")){
- _1834+="document.location=\"#";
- _1834+=_1835;
- _1834+="\";";
- }else{
- _1834+="doSingleDrill(";
- if(_1837=="true"){
- _1834+="\"_blank\",";
- }else{
- _1834+="\"\",";
- }
- _1834+="[[\"obj\",\"";
- _1834+=encodeURIComponent(_1836);
- _1834+="\"]";
- var _1838=XMLHelper_FindChildrenByTagName(_1833,"drillParameter",false);
- for(var index=0;index<_1838.length;++index){
- var _183a=_1838[index];
- var _183b=_183a.getAttribute("value");
- var sName=_183a.getAttribute("name");
- if(_183b!=null&&_183b!=""){
- _1834+=", [\"p_"+sName+"\",\""+encodeURIComponent(this.buildSelectionChoicesSpecification(_183a))+"\"]";
- }
- var sNil=_183a.getAttribute("nil");
- if(sNil!=null&&sNil!=""){
- _1834+="\", [\"p_"+sName+"\",\""+encodeURIComponent(this.buildSelectionChoicesNilSpecification())+"\"]";
- }
- }
- _1834+="],";
- var _183e=_1833.getAttribute("method");
- _1834+="\""+encodeURIComponent(_183e)+"\",";
- var _183f=_1833.getAttribute("outputFormat");
- _1834+="\""+encodeURIComponent(_183f)+"\",";
- var _1840=_1833.getAttribute("outputLocale");
- _1834+="\""+encodeURIComponent(_1840)+"\",";
- _1834+="\""+encodeURIComponent(_1835)+"\",";
- var _1841=XMLBuilderSerializeNode(XMLHelper_FindChildByTagName(_1833,"parameters",false));
- _1834+="\""+encodeURIComponent(_1841)+"\",";
- var _1842=XMLBuilderSerializeNode(XMLHelper_FindChildByTagName(_1833,"objectPaths",false));
- _1834+="\""+encodeURIComponent(_1842)+"\",";
- _1834+="\""+encodeURIComponent(this.getCognosViewer().getId())+"\",";
- var _1843=_1833.getAttribute("prompt");
- _1834+="\""+encodeURIComponent(_1843)+"\",";
- var _1844=_1833.getAttribute("dynamicDrill");
- _1834+=" "+encodeURIComponent(_1844);
- _1834+=");";
- }
- return _1834;
- };
- AuthoredDrillAction.prototype.getTargetReportIconPath=function(_1845){
- var _1846="";
- var _1847=_1845.getAttribute("bookmarkRef");
- var _1848=XMLHelper_FindChildByTagName(_1845,"drillParameter",false);
- if((_1847!=null&&_1847!="")&&_1848==null){
- _1846="/common/images/spacer.gif";
- }else{
- var _1849=_1845.getAttribute("method");
- switch(_1849){
- case "editAnalysis":
- _1846="/ps/portal/images/icon_ps_analysis.gif";
- break;
- case "editQuery":
- _1846="/ps/portal/images/icon_qs_query.gif";
- break;
- case "execute":
- _1846="/ps/portal/images/action_run.gif";
- break;
- case "view":
- var _184a=_1845.getAttribute("outputFormat");
- switch(_184a){
- case "HTML":
- case "XHTML":
- case "HTMLFragment":
- _1846="/ps/portal/images/icon_result_html.gif";
- break;
- case "PDF":
- _1846="/ps/portal/images/icon_result_pdf.gif";
- break;
- case "XML":
- _1846="/ps/portal/images/icon_result_xml.gif";
- break;
- case "CSV":
- _1846="/ps/portal/images/icon_result_csv.gif";
- break;
- case "XLS":
- _1846="/ps/portal/images/icon_result_excel.gif";
- break;
- case "SingleXLS":
- _1846="/ps/portal/images/icon_result_excel_single.gif";
- break;
- case "XLWA":
- _1846="/ps/portal/images/icon_result_excel_web_arch.gif";
- break;
- default:
- _1846="/common/images/spacer.gif";
- }
- break;
- default:
- _1846="/common/images/spacer.gif";
- }
- }
- return this.getCognosViewer().getWebContentRoot()+_1846;
- };
- AuthoredDrillAction.prototype.getAuthoredDrillThroughContext=function(_184b,_184c){
- if(typeof _184b!="string"||typeof _184c!="object"){
- return null;
- }
- var _184d=XMLBuilderLoadXMLFromString(_184b);
- if(_184d==null||_184d.firstChild==null){
- return null;
- }
- var _184e=XMLHelper_GetFirstChildElement(_184d);
- if(XMLHelper_GetLocalName(_184e)!="AuthoredDrillTargets"){
- return null;
- }
- var _184f=XMLHelper_GetFirstChildElement(_184e);
- if(XMLHelper_GetLocalName(_184f)!="rvDrillTargets"){
- return null;
- }
- var _1850=_184f.childNodes;
- if(_1850===null||_1850.length===0){
- return null;
- }
- var _1851=self.XMLBuilderCreateXMLDocument("rvDrillTargets");
- for(var _1852=0;_1852<_1850.length;++_1852){
- if(typeof _1850[_1852].getAttribute=="undefined"){
- continue;
- }
- var _1853=_1851.createElement("drillTarget");
- _1851.documentElement.appendChild(_1853);
- var _1854=_1850[_1852].getAttribute("bookmarkRef");
- if(_1854===null){
- _1853.setAttribute("bookmarkRef","");
- }else{
- _1853.setAttribute("bookmarkRef",_1854);
- }
- var _1855=_1850[_1852].getAttribute("bookmarkPage");
- if(_1855===null){
- _1853.setAttribute("bookmarkPage","");
- }else{
- _1853.setAttribute("bookmarkPage",_1855);
- }
- var _1856=_1850[_1852].getAttribute("drillIdx");
- if(_1856==null){
- continue;
- }
- if(_1856>=_184c.length){
- continue;
- }
- var _1857=_184c[_1856];
- if(typeof _1857!="object"){
- continue;
- }
- _1853.setAttribute("outputFormat",_1857.getOutputFormat());
- _1853.setAttribute("outputLocale",_1857.getOutputLocale());
- _1853.setAttribute("prompt",_1857.getPrompt());
- _1853.setAttribute("dynamicDrill",_1857.isDynamicDrillThrough()?"true":"false");
- var _1858=_1850[_1852].getAttribute("label");
- if(_1858===null||_1858===""){
- _1858=_1857.getLabel();
- }
- _1853.setAttribute("label",_1858);
- _1853.setAttribute("path",_1857.getPath());
- _1853.setAttribute("showInNewWindow",_1857.getShowInNewWindow());
- _1853.setAttribute("method",_1857.getMethod());
- var _1859=_184f;
- var _185a="";
- var _185b=_1857.getParameterProperties();
- if(typeof _185b!="undefined"&&_185b!=null&&_185b!=""){
- _185a=XMLHelper_GetFirstChildElement(XMLBuilderLoadXMLFromString(_1857.getParameterProperties()));
- }
- while(_1859){
- var _185c=_1859.childNodes[_1852].childNodes;
- for(var _185d=0;_185d<_185c.length;++_185d){
- var _185e=_185c[_185d].cloneNode(true);
- if(_185a){
- var _185f=this.getPropertyToPass(_185e.getAttribute("name"),_185a);
- if(_185f!=null&&_185f!=""){
- _185e.setAttribute("propertyToPass",_185f);
- }
- }
- _1853.appendChild(_185e);
- }
- _1859=_1859.nextSibling;
- }
- 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\">";
- var _1861="</root>";
- var _1862=_1860+_1857.getParameters()+_1861;
- var _1863=XMLBuilderLoadXMLFromString(_1862);
- var _1864=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(_1863));
- if(_1864){
- _1853.appendChild(_1864.cloneNode(true));
- }
- var _1865=_1860+_1857.getObjectPaths()+_1861;
- var _1866=XMLBuilderLoadXMLFromString(_1865);
- _1864=XMLHelper_GetFirstChildElement(XMLHelper_GetFirstChildElement(_1866));
- if(_1864){
- _1853.appendChild(_1864.cloneNode(true));
- }
- }
- return XMLHelper_GetFirstChildElement(_1851);
- };
- function ChangeDisplayTypeAction(){
- this.m_requestParams=null;
- this.m_sAction="ChangeDataContainerType";
- this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES=5;
- };
- ChangeDisplayTypeAction.prototype=new ModifyReportAction();
- ChangeDisplayTypeAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_CHANGE_DISPLAY;
- };
- ChangeDisplayTypeAction.prototype.setRequestParms=function(parms){
- this.m_requestParams=parms;
- };
- ChangeDisplayTypeAction.prototype.addActionContextAdditionalParms=function(){
- this._cleaerPinAndFreeze();
- var _1868=false;
- if(this.m_requestParams.bestVisualization){
- _1868=true;
- }else{
- if(((this.m_requestParams.targetType.targetType==undefined)||(this.m_requestParams.targetType.targetType=="undefined"))&&(this.m_requestParams.targetType.templateId==undefined)){
- var _1869=eval("("+this.m_requestParams.targetType+")");
- }else{
- var _1869=this.m_requestParams.targetType;
- }
- }
- var _186a=this.m_oCV.getViewerWidget().findContainerDiv();
- var _186b="";
- if(_186a){
- _186b="<widgetWidth>"+(parseInt(_186a.style.width,10)-ResizeChartAction.PADDING.getWidth())+"px</widgetWidth>"+"<widgetHeight>"+(parseInt(_186a.style.height,10)-ResizeChartAction.PADDING.getHeight())+"px</widgetHeight>";
- }
- var _186c="";
- if(_1868){
- _186c+="<bestVisualization>true</bestVisualization>";
- _186c+=this.getDataItemInfoMap();
- }else{
- _186c+="<target>";
- _186c+=_1869.targetType;
- _186c+="</target>";
- if(_1869.templateId){
- _186c+="<templateId>";
- _186c+=((_1869.templateId)?_1869.templateId:"");
- _186c+="</templateId>";
- _186c+="<variationId>";
- _186c+=((_1869.variationId)?_1869.variationId:"");
- _186c+="</variationId>";
- _186c+=this.getDataItemInfoMap();
- }
- _186c+="<label>";
- _186c+=_1869.label;
- _186c+="</label>";
- }
- _186c+=_186b;
- _186c+=this.addClientContextData(3);
- return (_186c);
- };
- ChangeDisplayTypeAction.prototype._cleaerPinAndFreeze=function(){
- var _186d=this.m_oCV.getPinFreezeManager();
- if(_186d){
- var _186e=this.getContainerId(this.m_oCV.getSelectionController());
- _186d.clearPinInfo(_186e);
- }
- };
- ChangeDisplayTypeAction.prototype.updateMenu=function(_186f){
- var _1870=this.getCognosViewer().getRAPReportInfo();
- _186f.visible=(_1870)?_1870.containsInteractiveDataContainer():_186f.visible;
- if(!_186f.visible){
- return _186f;
- }
- var _1871=this.getSelectedReportInfo();
- _186f.disabled=(_1871==null||_1871.displayTypeId==null||!this.isInteractiveDataContainer(_1871.displayTypeId));
- if(_186f.disabled){
- _186f.iconClass="chartTypesDisabled";
- return _186f;
- }
- _186f.iconClass="chartTypes";
- return this.buildDynamicMenuItem(_186f,"ChangeDisplayType");
- };
- ChangeDisplayTypeAction.prototype.createEmptyMenuItem=function(){
- return {name:"None",label:RV_RES.IDS_JS_CHANGE_DISPLAY_SELECT_DATA,iconClass:"",action:null,items:null};
- };
- ChangeDisplayTypeAction.prototype.getActionContextString=function(_1872){
- var _1873="<getInfoActions>";
- _1873+="<getInfoAction name=\"GetInfo\">";
- _1873+="<include><suggestedDisplayTypes/></include>";
- _1873+=this.getDataItemInfoMap();
- _1873+="<groupId>";
- _1873+=_1872;
- _1873+="</groupId>";
- _1873+=this.addClientContextData(3);
- _1873+="</getInfoAction>";
- _1873+="</getInfoActions>";
- return _1873;
- };
- ChangeDisplayTypeAction.prototype.fetchSuggestedDisplayTypes=function(_1874){
- var oCV=this.getCognosViewer();
- var _1876=new AsynchJSONDispatcherEntry(oCV);
- _1876.addFormField("ui.action","getInfoFromReportSpec");
- _1876.addFormField("bux","true");
- _1876.addFormField("ui.object",oCV.envParams["ui.object"]);
- _1876.addFormField("cv.actionContext",this.getActionContextString(_1874));
- _1876.addDefinedFormField("ui.spec",oCV.envParams["ui.spec"]);
- _1876.addNonEmptyStringFormField("modelPath",oCV.getModelPath());
- if(_1874=="undefined"){
- _1876.setCallbacks({"complete":{"object":this,"method":this.handleSuggestedDisplayTypesResponse}});
- }else{
- _1876.setCallbacks({"complete":{"object":this,"method":this.handleSuggestedDisplayVariationsResponse}});
- }
- oCV.dispatchRequest(_1876);
- };
- ChangeDisplayTypeAction.prototype.handleSuggestedDisplayTypesResponse=function(_1877){
- var _1878=this.getCognosViewer();
- var _1879=_1878.getViewerWidget();
- this.addSuggestedDisplayTypesMenuItems(_1877.getResult());
- };
- ChangeDisplayTypeAction.prototype.addSuggestedDisplayTypesMenuItems=function(_187a){
- var _187b=this.getCognosViewer().findToolbarItem("ChangeDisplayType");
- if(_187b){
- _187b.open=false;
- }
- var _187c=[];
- var _187d=this.getSelectedReportInfo();
- var _187e=undefined;
- for(var x=0;x<_187a.containers.length;x++){
- if(_187d.container==_187a.containers[x].container){
- _187e=_187a.containers[x];
- break;
- }
- }
- if(_187e==undefined){
- return;
- }
- var _1880=_187e.suggestedDisplayTypes.length<=this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES?_187e.suggestedDisplayTypes.length:this.m_iMAX_NUM_SUGGESTED_DISPLAY_TYPES;
- _187c.push({title:RV_RES.IDS_JS_CHANGE_DISPLAY_RECOMMENDED});
- _187c.push({separator:true});
- for(var i=0;i<_1880;i++){
- _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});
- }
- _187c.push({separator:true});
- _187c.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:{}},items:null});
- _187b.open=true;
- _187b.items=_187c;
- var _1882=[];
- _1882.push(_187b);
- this.getCognosViewer().getViewerWidget().fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1882);
- return _187c;
- };
- ChangeDisplayTypeAction.prototype.buildMenu=function(_1883){
- var _1884=this.getCognosViewer().getRAPReportInfo();
- _1883.visible=(_1884)?_1884.containsInteractiveDataContainer():_1883.visible;
- if(!_1883.visible){
- return _1883;
- }
- var _1885=this.getSelectedReportInfo();
- _1883.disabled=(_1885==null||_1885.displayTypeId==null||!this.isInteractiveDataContainer(_1885.displayTypeId));
- if(_1883.disabled){
- _1883.iconClass="chartTypesDisabled";
- }else{
- _1883.iconClass="chartTypes";
- var _1886=this.getCognosViewer().getAdvancedServerProperty("VIEWER_JS_enableVisCoach");
- if(_1886!=="false"&&(typeof _1885.suggestedDisplayTypesEnabled!="undefined")&&(_1885.suggestedDisplayTypesEnabled!=null)&&(_1885.suggestedDisplayTypesEnabled=="true")){
- this.fetchSuggestedDisplayTypes("undefined");
- return this.buildDynamicMenuItem(_1883,"ChangeDisplayType");
- }else{
- _1883.items=[];
- var isV2=(_1885.displayTypeId.match("v2_")!=null||_1885.displayTypeId=="crosstab"||_1885.displayTypeId=="list");
- if(isV2){
- _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});
- _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});
- _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});
- _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});
- _1883.items.push({name:"ChangeDisplayCrosstab",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_CROSSTAB,iconClass:"ChartTypeCrosstab",action:{name:"ChangeDisplayType",payload:{targetType:"Crosstab"}},items:null});
- _1883.items.push({name:"ChangeDisplayList",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LIST,iconClass:"ChartTypeList",action:{name:"ChangeDisplayType",payload:{targetType:"List"}},items:null});
- _1883.items.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:""},items:null});
- }else{
- _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});
- _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});
- _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});
- _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});
- _1883.items.push({name:"ChangeDisplayCrosstab",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_CROSSTAB,iconClass:"ChartTypeCrosstab",action:{name:"ChangeDisplayType",payload:{targetType:"Crosstab"}},items:null});
- _1883.items.push({name:"ChangeDisplayList",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_LIST,iconClass:"ChartTypeList",action:{name:"ChangeDisplayType",payload:{targetType:"List"}},items:null});
- _1883.items.push({name:"ChangeDisplayMore",label:RV_RES.IDS_JS_CHANGE_DISPLAY_TYPE_MORE,iconClass:"ChartTypeOther",action:{name:"InvokeChangeDisplayTypeDialog",payload:""},items:null});
- }
- }
- for(var i in _1883.items){
- _1883.items[i].action.payload={targetType:_1883.items[i].action.payload};
- _1883.items[i].action.payload.targetType.label=_1883.items[i].label;
- }
- }
- return _1883;
- };
- function ChangeDisplayVariationsAction(){
- };
- ChangeDisplayVariationsAction.prototype=new CognosViewerAction();
- function ChangeDisplayVariationsAction(){
- this.m_requestParams=null;
- };
- ChangeDisplayVariationsAction.prototype.setRequestParms=function(parms){
- this.m_requestParams=parms;
- };
- ChangeDisplayVariationsAction.prototype.execute=function(){
- var _188a=this.m_requestParams.groupId;
- var _188b=this.getCognosViewer();
- var _188c=this.getSelectedReportInfo();
- if(_188c){
- var _188d=_188b.getViewerWidget();
- if(typeof _188c.suggestedDisplayVariations=="undefined"){
- var _188e=new AsynchJSONDispatcherEntry(this.m_oCV);
- _188e.setCallbacks({"complete":{"object":this,"method":this.handleResponse}});
- _188e.setRequestIndicator(_188b.getRequestIndicator());
- _188e.addFormField("ui.action","getInfoFromReportSpec");
- _188e.addFormField("bux","true");
- _188e.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
- _188e.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- _188e.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- _188e.addFormField("cv.actionContext",this.addActionContext(_188a));
- _188b.dispatchRequest(_188e);
- }else{
- _188d.updateDisplayTypeDialogVariations(_188c.possibleDisplayTypes,_188c.suggestedDisplayVariations);
- }
- }
- };
- ChangeDisplayVariationsAction.prototype.handleResponse=function(_188f){
- var _1890=this.getCognosViewer();
- var _1891=_1890.getViewerWidget();
- var _1892=_188f.getResult();
- for(var i in _1892.containers){
- var _1894=this.getReportInfo(_1892.containers[i].container);
- _1894.possibleDisplayTypes=_1892.containers[i].possibleDisplayTypes;
- _1894.variationGroups=_1892.containers[i].variationGroups;
- }
- var _1895=this.getSelectedReportInfo();
- _1891.updateDisplayTypeDialogVariations(_1895.possibleDisplayTypes,_1895.variationGroups);
- };
- ChangeDisplayVariationsAction.prototype.addActionContext=function(_1896){
- var _1897="<getInfoActions>";
- _1897+="<getInfoAction name=\"GetInfo\">";
- _1897+="<include><suggestedDisplayVariations/></include>";
- _1897+=this.getDataItemInfoMap();
- _1897+=this.addClientContextData(3);
- _1897+="<groupId>";
- _1897+=_1896;
- _1897+="</groupId>";
- _1897+="</getInfoAction>";
- _1897+="</getInfoActions>";
- return _1897;
- };
- function ChangePaletteAction(){
- this.m_sAction="ChangePalette";
- this.m_palette="";
- this.m_runReport=true;
- this.m_aPaletteNames=["Flow","Classic","Contemporary","Contrast","Corporate","Dynamic","Excel","Excel 2007","Gradients","Grey Scale","Jazz","Legacy","Metro","Mixed","Modern","Patterns"];
- this.m_aPaletteIcons=["changePaletteFlow","changePaletteClassic","changePaletteContemporary","changePaletteContrast","changePaletteCorporate","changePaletteDynamic","changePaletteExcel","changePaletteExcel2007","changePaletteGradients","changePaletteGreyScale","changePaletteJazz","changePaletteLegacy","changePaletteMetro","changePaletteMixed","changePaletteModern","changePalettePatterns"];
- };
- ChangePaletteAction.prototype=new ModifyReportAction();
- ChangePaletteAction.baseclass=ModifyReportAction.prototype;
- ChangePaletteAction.prototype.reuseQuery=function(){
- return true;
- };
- ChangePaletteAction.prototype.preProcess=function(){
- this.updateRunReport();
- if(this.m_runReport==false){
- var _1898=this.getLayoutComponents();
- for(var index=0;index<_1898.length;++index){
- var _189a=_1898[index];
- if(_189a.getAttribute("flashChart")!=null){
- if(this.m_palette==""){
- _189a.setPalette("Flow");
- }else{
- _189a.setPalette(this.m_palette);
- }
- }
- }
- }
- };
- ChangePaletteAction.prototype.updateRunReport=function(){
- this.m_runReport=true;
- var _189b=document.getElementById("rt"+this.m_oCV.getId());
- if(_189b!=null){
- var _189c=getElementsByAttribute(_189b,"*","chartcontainer","true");
- if(_189c.length==0){
- this.m_runReport=false;
- }
- }
- };
- ChangePaletteAction.prototype.runReport=function(){
- return this.m_runReport;
- };
- ChangePaletteAction.prototype.updateInfoBar=function(){
- return false;
- };
- ChangePaletteAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_CHANGE_PALETTE;
- };
- ChangePaletteAction.prototype.setRequestParms=function(_189d){
- if(typeof _189d=="string"){
- this.m_palette=_189d;
- if(this.m_oCV!=null&&typeof this.m_oCV!="undefined"){
- this.m_oCV.m_sPalette=_189d;
- }
- }
- };
- ChangePaletteAction.prototype.addActionContextAdditionalParms=function(){
- if(this.m_palette!=""){
- return "<name>"+this.m_palette+"</name>";
- }
- return "";
- };
- ChangePaletteAction.prototype.updateMenu=function(_189e){
- _189e.visible=this.ifContainsInteractiveDataContainer();
- if(!_189e.visible){
- return _189e;
- }
- var _189f=this.getSelectedReportInfo();
- if(_189f!=null&&_189f.displayTypeId.indexOf("Chart")>=0){
- _189e.disabled=false;
- return _189e;
- }
- _189e.disabled=true;
- return _189e;
- };
- ChangePaletteAction.reset=function(oCV){
- delete (oCV.m_sPalette);
- };
- function DragDropAction(){
- this.m_source=null;
- this.m_target=null;
- this.m_insertBefore=false;
- this.m_sAction="Reorder";
- };
- DragDropAction.prototype=new ModifyReportAction();
- DragDropAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_MOVE;
- };
- DragDropAction.prototype.getOffsetCoords=function(_18a1){
- var _18a2=document.getElementById("rt"+this.getCognosViewer().getId());
- var _18a3=_18a1;
- var _18a4=0;
- var _18a5=0;
- while(_18a3!=_18a2){
- _18a4+=_18a3.offsetTop;
- _18a5+=_18a3.offsetLeft;
- _18a3=_18a3.offsetParent;
- }
- return {left:_18a5,top:_18a4};
- };
- DragDropAction.prototype.showDragDropCaret=function(evt,cell,_18a8){
- var _18a9=document.getElementById("VDDC"+this.getCognosViewer().getId());
- if(_18a9==null){
- _18a9=document.createElement("span");
- _18a9.setAttribute("id","VDDC"+this.getCognosViewer().getId());
- _18a9.className="dropCaret";
- if(_18a9.attachEvent){
- _18a9.attachEvent("onmousemove",stopEventBubble);
- }else{
- _18a9.addEventListener("mousemove",stopEventBubble,false);
- }
- _18a9.style.width="8px";
- _18a9.innerHTML="<img style=\"margin:1px;width:2px;height:100%;\" src=\""+this.getCognosViewer().getWebContentRoot()+"/rv/images/drop_caret.gif\"/>";
- _18a8.appendChild(_18a9);
- }
- var _18aa=this.getOffsetCoords(_18a8);
- _18a9.style.top=(_18aa.top-1)+"px";
- var _18ab;
- if(typeof evt.offsetX=="undefined"){
- _18ab=evt.layerX;
- }else{
- _18aa=this.getOffsetCoords(evt.srcElement);
- _18ab=evt.offsetX+_18aa.left;
- }
- _18aa=this.getOffsetCoords(cell);
- var _18ac=_18aa.left+(cell.clientWidth/2);
- this.m_insertBefore=(_18ab<_18ac);
- _18a9.style.height=_18a8.clientHeight+"px";
- if(this.m_insertBefore==false){
- _18a9.style.left=(_18aa.left+cell.clientWidth+1)+"px";
- }else{
- _18a9.style.left=_18aa.left+"px";
- }
- _18a9.style.display="inline";
- };
- DragDropAction.prototype.showDragDropIndicators=function(evt){
- if(this.m_target!=null){
- var cell=this.m_target.getCellRef();
- var _18af=cell;
- while(_18af.getAttribute("lid")==null){
- _18af=_18af.parentNode;
- }
- this.showDragDropCaret(evt,cell,_18af);
- }
- };
- DragDropAction.prototype.showDragDropToolTip=function(evt){
- var _18b1="";
- if(this.canDrop()==true){
- _18b1="/rv/images/cursor_move.gif";
- }else{
- _18b1="/rv/images/cursor_nodrop.gif";
- }
- this.showCustomCursor(evt,"viewerTooltipSpan",_18b1);
- };
- DragDropAction.prototype.canMove=function(){
- if(this.m_oCV.isBlacklisted("Move")){
- return false;
- }
- var _18b2=this.getCognosViewer().getSelectionController();
- this.m_source=_18b2.getAllSelectedObjects();
- if(this.m_source!=null&&this.m_source.length>0){
- if(typeof this.m_source[0].m_dataContainerType!="undefined"&&this.m_source[0].m_dataContainerType=="list"&&this.m_source[0].getLayoutType()!="summary"){
- return true;
- }
- }
- return false;
- };
- DragDropAction.prototype.onDrag=function(evt){
- clearTextSelection();
- var _18b4=getNodeFromEvent(evt);
- var _18b5=this.getCognosViewer().getSelectionController();
- this.m_target=_18b5.buildSelectionObject(_18b4,evt);
- this.showDragDropToolTip(evt);
- if(this.canDrop()){
- this.showDragDropIndicators(evt);
- }else{
- this.hideDropIndicators();
- }
- };
- DragDropAction.prototype.hideDropIndicators=function(){
- var _18b6=document.getElementById("VDDC"+this.getCognosViewer().getId());
- if(_18b6!=null){
- _18b6.style.display="none";
- }
- };
- DragDropAction.prototype.onMouseDown=function(evt){
- if(this.canMove()){
- window.oCVDragDropObject={action:this,x:evt.clientX,y:evt.clientY,dragging:false};
- }
- };
- DragDropAction.prototype.canDrop=function(){
- return this.m_target!=null&&this.m_source!=null&&this.m_target.getLayoutType()!="summary"&&(this.m_target.getLayoutElementId()==this.m_source[0].getLayoutElementId());
- };
- DragDropAction.prototype.onDrop=function(evt){
- this.hideCustomCursor("viewerTooltipSpan");
- this.hideDropIndicators();
- if(this.canDrop(evt)){
- var _18b9=true;
- var _18ba;
- var first=parseInt(this.m_source[0].getColumnRef(),10);
- var last=first;
- var _18bd=true;
- for(var index=0;index<this.m_source.length;++index){
- _18ba=parseInt(this.m_source[index].getColumnRef(),10);
- if(index>0&&_18ba!==last+1){
- _18bd=false;
- break;
- }
- last=_18ba;
- }
- if(_18bd){
- var _18bf=parseInt(this.m_target.getColumnRef(),10);
- _18bf+=this.m_insertBefore?0:1;
- if(_18bf>=first&&_18bf<=last+1){
- _18b9=false;
- }
- }
- if(_18b9){
- this.execute();
- }
- }
- };
- DragDropAction.prototype.addActionContextAdditionalParms=function(){
- var tag=this.m_insertBefore==true?"before":"after";
- var _18c1=this.m_target.getCellRef();
- var _18c2=this.getRAPLayoutTag(_18c1);
- _18c2=(_18c2!=null)?_18c2:this.m_target.getColumnName();
- return this.getSelectedCellTags()+"<"+tag+">"+xml_encode(_18c2)+"</"+tag+">";
- };
- function DragDropAction_isDragging(evt){
- var _18c4=window.oCVDragDropObject;
- if(_18c4){
- var _18c5=evt.clientX;
- var _18c6=evt.clientY;
- var _18c7=_18c4.x;
- var _18c8=_18c4.y;
- if((_18c5>=(_18c7+2))||(_18c5<=(_18c7-2))||(_18c6>=(_18c8+2))||(_18c6<=(_18c8-2))){
- _18c4.dragging=true;
- }
- return _18c4.dragging;
- }
- return false;
- };
- function DragDropAction_onmouseup(evt){
- if(DragDropAction_isDragging(evt)){
- window.oCVDragDropObject.action.onDrop(evt);
- }
- window.oCVDragDropObject=null;
- };
- function DragDropAction_onmousemove(evt){
- if(DragDropAction_isDragging(evt)){
- window.oCVDragDropObject.action.onDrag(evt);
- }
- };
- function DrillAction(){
- this.m_bUseReportInfoSelection=false;
- this.m_aDrillSelectedObjects=[];
- this.m_useMARequest=false;
- this.m_userSelectedDrillItem=null;
- };
- DrillAction.prototype=new ModifyReportAction();
- DrillAction.prototype.getHoverClassName=function(){
- return "";
- };
- DrillAction.prototype.setRequestParms=function(parms){
- if(parms){
- this.m_userSelectedDrillItem=parms.userSelectedDrillItem;
- }
- };
- DrillAction.prototype.setKeepFocusOnWidget=function(_18cc){
- this.m_bKeepFocusOnWidget=_18cc;
- };
- DrillAction.prototype.keepFocusOnWidget=function(){
- if(typeof this.m_bKeepFocusOnWidget!="undefined"){
- return this.m_bKeepFocusOnWidget;
- }
- return true;
- };
- DrillAction.prototype.getDrillabilityForItemFromReportInfo=function(_18cd){
- if(!this.m_oCV){
- return null;
- }
- var _18ce=this.m_oCV.getRAPReportInfo();
- if(!_18ce){
- return null;
- }
- var _18cf=_18ce.getContainers();
- for(var _18d0 in _18cf){
- var _18d1=_18ce.getDrillability(_18d0);
- if(_18d1[_18cd]){
- return _18d1[_18cd];
- }
- }
- return null;
- };
- DrillAction.prototype.onDoubleClick=function(evt){
- this.execute();
- };
- DrillAction.prototype.preProcess=function(){
- if(typeof this.m_drillSpec==="undefined"||this.m_drillSpec===null){
- var _18d3=this.generateDrillSpecObjects();
- if(!_18d3){
- return null;
- }
- var _18d4=this.getCognosViewer();
- var _18d5=_18d4.getViewerWidget();
- if(_18d5){
- var _18d6=_18d4.getModelPath();
- _18d5.getWidgetContextManager().raiseDrillEvent(_18d3,this.m_sAction,_18d6);
- }
- }
- };
- DrillAction.prototype.generateDrillSpecObjects=function(){
- try{
- var _18d7=[];
- var oCV=this.getCognosViewer();
- var _18d9=oCV.getDrillMgr();
- var _18da=oCV.getSelectionController();
- var _18db=true;
- var _18dc=_18d9.getDrillParameters(this.m_drillOption,true,_18db,this.m_userSelectedDrillItem);
- if(_18dc.length===0){
- return null;
- }
- var _18dd=_18d9.getSelectedObject();
- if(_18dc.length>3*4&&(_18dd.getDataContainerType()=="crosstab"||_18dd.getLayoutType()=="chartElement")){
- _18dc.length=3*4;
- }
- var _18de=_18d9.getSelectedObject().getSelectedContextIds();
- for(var i=0,_18e0=0;_18e0<_18de.length&&i<_18dc.length;++_18e0){
- var _18e1=_18de[_18e0][0];
- var _18e2=_18da.getRefDataItem(_18e1);
- var sMUN=_18da.getMun(_18e1);
- var _18e4=_18da.getDisplayValue(_18e1);
- if(_18da.getDrillFlagForMember(_18e1)===0){
- i=i+4;
- continue;
- }
- var _18e5={"dataItem":_18dc[i++],"mun":_18dc[i++],"lun":_18dc[i++],"hun":_18dc[i++]};
- if(_18e2!=""&&_18e4!=""){
- if(_18e5.dataItem===_18e2){
- _18e5.displayValue=_18e4;
- }
- }
- var _18e6=_18da.getUsageInfo(_18e1);
- _18e5.isMeasure=(_18e6==="2")?"true":"false";
- var _18e7=false;
- if(sMUN!=""&&_18e6!="2"){
- var _18e8=this.getDrillabilityForItemFromReportInfo(_18e2);
- if((_18e8!=null&&_18e8.disableDown==true)||this.m_oCV.getSelectionController().getDrillFlagForMember(_18e1)==1){
- _18e7=true;
- }
- }
- if(_18e7){
- if(_18e5.dataItem===_18e2){
- _18e5.summary="true";
- }
- }
- _18d7.push(_18e5);
- }
- return (_18d7.length>0)?_18d7:null;
- }
- catch(e){
- return null;
- }
- };
- DrillAction.prototype.parseDrillSpec=function(evt){
- try{
- var oCV=this.getCognosViewer();
- if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
- return false;
- }
- this.m_drillSpec=evt.payload.drillSpec;
- var _18eb=XMLBuilderLoadXMLFromString(this.m_drillSpec);
- var _18ec=_18eb.firstChild;
- var _18ed=getCognosViewerSCObjectRef(oCV.getId());
- _18ed.m_aSelectedObjects=[];
- if(_18ed.hasSelectedChartNodes()){
- _18ed.clearSelectionData();
- }
- var _18ee=XMLHelper_FindChildrenByTagName(_18ec,"DrillGroup",false);
- for(var _18ef=0;_18ef<_18ee.length;++_18ef){
- var _18f0=XMLHelper_FindChildByTagName(_18ee[_18ef],"MUN",false);
- var sMun=XMLHelper_GetText(_18f0);
- var sLun="";
- var sHun="";
- var _18f4="";
- var _18f5="";
- var _18f6=XMLHelper_FindChildByTagName(_18ee[_18ef],"DisplayValue",false);
- if(_18f6!=null){
- _18f4=XMLHelper_GetText(_18f6);
- }
- var _18f7=XMLHelper_FindChildByTagName(_18ee[_18ef],"LUN",false);
- if(_18f7!=null){
- sLun=XMLHelper_GetText(_18f7);
- }
- var _18f8=XMLHelper_FindChildByTagName(_18ee[_18ef],"HUN",false);
- if(_18f8!=null){
- sHun=XMLHelper_GetText(_18f8);
- }
- var _18f9=XMLHelper_FindChildByTagName(_18ee[_18ef],"Summary",false);
- if(_18f9!=null){
- _18f5=XMLHelper_GetText(_18f9);
- }
- this.selectObject(sMun,sLun,sHun,_18f4,_18f5,_18ed);
- }
- }
- catch(e){
- return false;
- }
- return (_18ed.m_aSelectedObjects.length>0);
- };
- DrillAction.prototype.parseDrillSpecObjects=function(_18fa){
- if(this.useReportInfoSelection()){
- return this.parseDrillSpecObjectsWithReportInfo(_18fa);
- }
- try{
- var oCV=this.getCognosViewer();
- if(oCV.getStatus()!=="complete"||oCV.getConversation()===""){
- return false;
- }
- this.m_drillSpec="";
- var _18fc=getCognosViewerSCObjectRef(oCV.getId());
- _18fc.m_aSelectedObjects=[];
- if(_18fc.hasSelectedChartNodes()){
- _18fc.clearSelectionData();
- }
- for(var i in _18fa){
- var oSpec=_18fa[i];
- var _18ff=(oSpec.summary)?oSpec.summary:"";
- var _1900=true;
- this.selectObject(oSpec.mun,oSpec.lun,oSpec.hun,oSpec.displayValue,_18ff,_18fc,_1900);
- }
- }
- catch(e){
- return false;
- }
- return (_18fc.m_aSelectedObjects.length>0);
- };
- DrillAction.prototype.getDrillabilityForCtxValue=function(_1901){
- if(console&&console.log){
- console.log("Required method, getDrillabilityForCtxValue, not implemented.");
- }
- };
- DrillAction.prototype.setDrillabilityForSelectObject=function(_1902){
- this.drillability=this.getDrillabilityForCtxValue(_1902);
- };
- DrillAction.prototype.canDrillDown=function(){
- if(console&&console.log){
- console.log("Required method, canDrillDown, not implemented.");
- }
- };
- DrillAction.prototype.canDrilUp=function(){
- if(console&&console.log){
- console.log("Required method, canDrilUp, not implemented.");
- }
- };
- DrillAction.prototype.selectObject=function(sMun,sLun,sHun,_1906,_1907,_1908,_1909){
- var _190a=sHun;
- var _190b=sLun;
- var _190c=sMun;
- var _190d=false;
- var _190e=_1908.getCtxIdFromMun(sMun);
- var _190f=_190e;
- if(_190e===""){
- var _1910=_1908.replaceNamespaceForSharedTM1DimensionOnly(sLun,sHun,sMun);
- _190b=_1910.lun;
- _190a=_1910.hun;
- if(_190a!==sHun){
- _190c=this._replaceNamespace(sMun,_190a);
- }
- _190d=(_1909==true);
- _190e=_1908.getCtxIdFromMetaData(_190b,_190a,_190d);
- if(_190e===""){
- return false;
- }
- }
- this.setDrillabilityForSelectObject(_190e);
- if((_190d==true)||(this.m_sAction=="DrillDown"&&this.canDrillDown())||(this.m_sAction=="DrillUp"&&this.canDrillUp())){
- var _1911=_1908.getSelections().length;
- _1908.selectObject(_190c,_190b,_190a,_190d);
- var _1912=_1908.getSelections();
- if(_190f===""&&_1912.length>_1911){
- var aMuns=_1912[_1912.length-1].m_aMuns;
- aMuns[aMuns.length]=[];
- aMuns[aMuns.length-1].push(_190c);
- var _1914=_1912[_1912.length-1].m_aDisplayValues;
- _1914.push(_1906);
- _1912[_1912.length-1].useDisplayValueFromObject=true;
- }
- if(_1907=="true"){
- _1912=_1908.getSelections();
- _1912[_1912.length-1].onSummary=true;
- }
- }
- };
- DrillAction.prototype._replaceNamespace=function(mun,_1916){
- var _1917=null;
- if(_1916){
- var _1918=_1916.substr(0,_1916.indexOf("].[")+1);
- if(mun&&_1918&&!(mun.match("^"+_1918))){
- var _1919=mun.indexOf("].[");
- _1917=_1918+mun.substr(_1919+1,mun.length);
- }
- }
- return _1917||mun;
- };
- DrillAction.prototype.addActionContextAdditionalParms=function(){
- var _191a="";
- var _191b=(this.useReportInfoSelection())?this.m_aDrillSelectedObjects:this.getCognosViewer().getSelectionController().getSelections();
- var sItem=null;
- for(var i=0;i<_191b.length;++i){
- if(_191b[i].onSummary){
- sItem=(this.useReportInfoSelection())?_191b[i].item:_191b[i].getDataItems()[0][0];
- _191a+="<dataItem>"+xml_encode(sItem)+"</dataItem>";
- }
- }
- if(_191a!=""){
- _191a="<onSummary>"+_191a+"</onSummary>";
- }
- if(this.m_userSelectedDrillItem){
- _191a+=("<userSelectedDrillItem>"+this.m_userSelectedDrillItem+"</userSelectedDrillItem>");
- }
- if(this.m_useMARequest===true){
- _191a=_191a+"<useMAGetChildRequest>false</useMAGetChildRequest>";
- _191a=_191a+"<useMAGetParentRequest>false</useMAGetParentRequest>";
- }
- _191a+=this.addClientContextData(3);
- return _191a;
- };
- DrillAction.prototype.getDrillOptionsAsString=function(){
- var _191e=this.getViewerWidget();
- var _191f="";
- if(_191e){
- _191f="<addSummaryMembers>"+_191e.getDrillOptions().addSummaryMembers+"</addSummaryMembers>";
- _191f=_191f+"<backwardsCompatible>"+_191e.getDrillOptions().backwardsCompatible+"</backwardsCompatible>";
- }
- return _191f;
- };
- DrillAction.prototype.getItemInfo=function(_1920,_1921){
- var _1922=_1920.getRAPReportInfo();
- if(!_1922){
- return null;
- }
- var _1923=_1922.getContainers();
- for(var _1924 in _1923){
- var _1925=_1922.getItemInfo(_1924);
- if(_1925[_1921]){
- return _1925[_1921];
- }
- }
- return null;
- };
- DrillAction.prototype.isSelectionFilterEnabled=function(){
- var _1926=this.getViewerWidget();
- if(!_1926){
- return false;
- }
- return _1926.isSelectionFilterEnabled();
- };
- DrillAction.prototype.getHierarchyHasExpandedSet=function(_1927,_1928){
- var _1929=this.getItemInfo(_1927,_1928);
- return (_1929&&_1929.hierarchyHasExpandedMembers);
- };
- DrillAction.prototype.getIsRSDrillParent=function(_192a,_192b){
- var _192c=this.getItemInfo(_192a,_192b);
- return (_192c&&_192c.isRSDrillParent);
- };
- DrillAction.prototype.setUseReportInfoSelection=function(bFlag){
- this.m_bUseReportInfoSelection=bFlag;
- };
- DrillAction.prototype.useReportInfoSelection=function(){
- return this.m_bUseReportInfoSelection;
- };
- DrillAction.prototype.parseDrillSpecObjectsWithReportInfo=function(_192e){
- try{
- var _192f=this.m_oCV.getRAPReportInfo();
- if(!_192f){
- return null;
- }
- this.m_drillSpec="";
- this.m_aDrillSelectedObjects=[];
- for(var i in _192e){
- this.populateSelectObjectWithReportInfo(_192e[i],_192f);
- }
- }
- catch(e){
- return false;
- }
- return (this.m_aDrillSelectedObjects.length>0);
- };
- DrillAction.prototype.populateSelectObjectWithReportInfo=function(oSpec,_1932){
- var _1933=_1932.getItemDetails(oSpec.dataItem,oSpec.hun);
- if(!_1933){
- _1933=_1932.getItemDetailsByHun(oSpec.hun);
- if(!_1933){
- return null;
- }
- }
- if(oSpec.mun){
- _1933.mun=oSpec.mun;
- }
- if(oSpec.lun){
- _1933.lun=oSpec.lun;
- }
- if(oSpec.displayValue){
- _1933.displayValue=oSpec.displayValue;
- }
- if(oSpec.isMeasure==="true"){
- _1933.isMeasure=true;
- }
- if(oSpec.summary==="true"){
- _1933.onSummary=true;
- }
- this.m_aDrillSelectedObjects.push(_1933);
- };
- DrillAction.prototype.getSelectionContext=function(){
- if(this.useReportInfoSelection()){
- return this.genLeanSelection();
- }else{
- return CognosViewerAction.prototype.getSelectionContext.call(this);
- }
- };
- DrillAction.prototype.genLeanSelection=function(){
- if(this.m_aDrillSelectedObjects.length==0){
- return "";
- }
- var _1934="";
- for(var idx in this.m_aDrillSelectedObjects){
- var obj=this.m_aDrillSelectedObjects[idx];
- _1934+="<selectedCell>";
- _1934+=("<name>"+obj.item+"</name>"+"<display>"+obj.displayValue+"</display>"+"<rapLayoutTag>"+obj.lid+"</rapLayoutTag>"+"<queryName>"+obj.queryName+"</queryName>");
- if(obj.mun){
- _1934+=("<nodeUse>"+obj.mun+"</nodeUse>");
- _1934+=("<nodeType>memberUniqueName</nodeType>");
- }
- if(obj.hun){
- _1934+=("<nodeHierarchyUniqueName>"+obj.hun+"</nodeHierarchyUniqueName>");
- }
- var _1937=(obj.isMeasure)?"measure":"nonMeasure";
- _1934+=("<nodeUsage>"+_1937+"</nodeUsage>");
- _1934+="</selectedCell>";
- }
- return ("<selection>"+_1934+"</selection>");
- };
- DrillAction.prototype.runReport=function(){
- if(this.getViewerWidget()){
- return this.getViewerWidget().shouldReportBeRunOnAction();
- }else{
- return true;
- }
- };
- DrillAction.prototype.canBeQueued=function(){
- if(this.getViewerWidget()){
- return !(this.getViewerWidget().isVisible());
- }else{
- return false;
- }
- };
- function DrillUpDownAction(){
- this.m_sAction="DrillDown";
- this.m_drillOption="drillDown";
- this.undoTooltip="";
- };
- DrillUpDownAction.prototype=new DrillAction();
- DrillUpDownAction.prototype.getHoverClassName=function(){
- return "dl";
- };
- DrillUpDownAction.prototype.getUndoHint=function(){
- return this.undoTooltip;
- };
- DrillUpDownAction.prototype.keepRAPCache=function(){
- return false;
- };
- DrillUpDownAction.prototype.updateDrillability=function(_1938,_1939){
- this.m_oCV=_1938;
- var _193a=_1939.getAttribute("ctx");
- this.drillability=0;
- if(_193a){
- var _193b=_193a.split("::");
- if(_193b&&_193b.length>0){
- if(_193b.length>2){
- this.drillability=this.getDrillabilityForIntersection(_193b[1].split(":")[0],_193b[2].split(":")[0]);
- }else{
- if(_193b.length===2){
- this.drillability=this.getDrillabilityForCtxValue(_193b[1].split(":")[0]);
- }else{
- this.drillability=this.getDrillabilityForCtxValue(_193b[0].split(":")[0]);
- }
- }
- }
- }
- if(this.isDefaultDrillUp(_1939)){
- this.m_sAction="DrillUp";
- this.m_drillOption="drillUp";
- this.undoTooltip=RV_RES.RV_DRILL_UP;
- }else{
- this.m_sAction="DrillDown";
- this.m_drillOption="drillDown";
- this.undoTooltip=RV_RES.RV_DRILL_DOWN;
- }
- return this.drillability;
- };
- DrillUpDownAction.prototype.updateDrillabilityFromSelections=function(){
- var _193c=this.m_oCV.getSelectionController();
- var _193d=_193c.getAllSelectedObjects();
- this.drillability=0;
- if(_193d!=null&&typeof _193d!="undefined"&&_193d.length==1&&_193d[0].m_contextIds!=null){
- if(_193d[0].getLayoutType()=="section"){
- this.drillability=0;
- }else{
- if(_193d[0].m_contextIds.length==0){
- this.drillability=0;
- }else{
- if(typeof DrillContextMenuHelper!=="undefined"&&DrillContextMenuHelper.needsDrillSubMenu(this.m_oCV)){
- this.drillability=this.getDrillabilityForAll(_193d[0].m_contextIds);
- }else{
- if(_193d[0].m_contextIds.length>2){
- this.drillability=this.getDrillabilityForIntersection(_193d[0].m_contextIds[1][0],_193d[0].m_contextIds[2][0]);
- }else{
- this.drillability=this.getDrillabilityForCtxValue(_193d[0].m_contextIds[0][0]);
- }
- }
- }
- }
- }
- return this.drillability;
- };
- DrillUpDownAction.prototype.getDrillabilityForCtxValue=function(_193e){
- var _193f=0;
- var _1940=this.m_oCV.getSelectionController();
- var _1941=_1940.getRefDataItem(_193e);
- if(this.getHierarchyHasExpandedSet(this.m_oCV,_1941)&&this.getIsRSDrillParent(this.m_oCV,_1941)){
- _193f=1;
- return _193f;
- }
- if(_1940.getMun(_193e)!==""&&_1940.getUsageInfo(_193e)!=="2"){
- _193f=(+_1940.getDrillFlagForMember(_193e));
- var _1942=this.getDrillabilityForItemFromReportInfo(_1940.getRefDataItem(_193e));
- if(_1942!=null){
- if(_1942.disableDown==true||_1942.isolated==true){
- if(_193f==1||_193f>=3||_1942.isolated==true){
- _193f=1;
- }else{
- _193f=0;
- }
- }
- if(_1942.disableUp==true){
- if(_193f>=2){
- _193f=2;
- }else{
- _193f=0;
- }
- }
- }
- }
- return _193f;
- };
- DrillUpDownAction.prototype.getDrillabilityForIntersection=function(_1943,_1944){
- var _1945=this.getDrillabilityForCtxValue(_1943);
- return this.mergeDrillability(_1945,_1944);
- };
- DrillUpDownAction.prototype.getDrillabilityForAll=function(_1946){
- var _1947=(_1946.length>=2)?1:0;
- var _1948;
- if(_1946.length==2){
- _1948=1;
- }else{
- if(_1946.length>2){
- _1948=2;
- }else{
- _1948=0;
- }
- }
- var _1949=0;
- for(var iDim=_1947;iDim<=_1948;++iDim){
- for(var _194b=0;_194b<_1946[iDim].length;++_194b){
- _1949=this.mergeDrillability(_1949,_1946[iDim][_194b]);
- }
- }
- return _1949;
- };
- DrillUpDownAction.prototype.mergeDrillability=function(_194c,_194d){
- var _194e=this.getDrillabilityForCtxValue(_194d);
- if(_194c==_194e){
- return _194c;
- }
- if(_194c>_194e){
- var temp=_194c;
- _194c=_194e;
- _194e=temp;
- }
- if(_194c==1&&_194e==2){
- return 3;
- }
- return _194e;
- };
- DrillUpDownAction.prototype.hasPermission=function(){
- if(this.m_oCV){
- if(this.m_oCV.isDrillBlackListed()){
- return false;
- }
- var _1950=this.m_oCV.envParams;
- if(_1950){
- return !(this.m_oCV.isLimitedInteractiveMode()||(_1950["cv.objectPermissions"].indexOf("read")===-1));
- }
- }
- return false;
- };
- DrillUpDownAction.prototype.canDrillUp=function(){
- return ((this.drillability==1||this.drillability==3||this.drillability==4)&&this.hasPermission());
- };
- DrillUpDownAction.prototype.canDrillDown=function(){
- return ((this.drillability==2||this.drillability==3||this.drillability==4)&&this.hasPermission());
- };
- DrillUpDownAction.prototype.isDefaultDrillUp=function(_1951){
- if(this.drillability==1||this.drillability==4||(_1951&&_1951.getAttribute("ischarttitle")==="true")){
- return true;
- }else{
- return false;
- }
- };
- DrillUpDownAction.prototype.doOnMouseOver=function(evt){
- if(this.drillability>0&&!this.getCognosViewer().isLimitedInteractiveMode()){
- var _1953=getCtxNodeFromEvent(evt);
- this.addDrillableClass(_1953);
- if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
- this.addDrillableClass(evt.toElement);
- }
- }
- };
- DrillUpDownAction.prototype.doOnMouseOut=function(evt){
- var _1955=getCtxNodeFromEvent(evt);
- if(_1955){
- this.removeDrillableClass(_1955);
- if(evt.toElement&&evt.toElement.nodeName&&evt.toElement.nodeName.toLowerCase()=="img"){
- this.removeDrillableClass(evt.toElement);
- }
- }
- };
- DrillUpDownAction.prototype.onMouseOver=function(evt){
- this.doOnMouseOver(evt);
- };
- DrillUpDownAction.prototype.onMouseOut=function(evt){
- this.doOnMouseOut(evt);
- };
- DrillUpDownAction.prototype.onDoubleClick=function(evt){
- if(this.drillability>0&&this.hasPermission()&&!this.isSelectionFilterEnabled()){
- this.execute();
- var _1959=getCtxNodeFromEvent(evt);
- if(_1959!=null){
- this.removeDrillableClass(_1959);
- }
- }
- };
- DrillUpDownAction.prototype.addDrillableClass=function(node){
- if(!node.className.match(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)"))){
- node.className+=" "+this.getHoverClassName();
- }
- };
- DrillUpDownAction.prototype.removeDrillableClass=function(node){
- var _195c=node.className;
- _195c=_195c.replace(new RegExp("(\\s|^)"+this.getHoverClassName()+"(\\s|$)")," ");
- node.className=_195c.replace(/^\s*/,"").replace(/\s*$/,"");
- };
- function DrillUpDownOrThroughAction(){
- this.m_hasAuthoredDrillTargets=false;
- this.m_canDrillUpDown=false;
- };
- DrillUpDownOrThroughAction.prototype=new DrillUpDownAction();
- DrillUpDownOrThroughAction.prototype.init=function(_195d,_195e){
- if(this.getCognosViewer()){
- var _195f=this.getCognosViewer().getViewerWidget();
- if(_195f&&_195f.isSelectionFilterEnabled()){
- return;
- }else{
- if(this.m_oCV.isDrillBlackListed()){
- return;
- }
- }
- }
- this.m_hasAuthoredDrillTargets=_195d;
- this.m_canDrillUpDown=_195e;
- };
- DrillUpDownOrThroughAction.prototype.updateDrillabilityInfo=function(_1960,_1961){
- if(this.m_canDrillUpDown){
- return this.updateDrillability(_1960,_1961);
- }
- return null;
- };
- DrillUpDownOrThroughAction.prototype.onMouseOver=function(evt){
- if(this.m_hasAuthoredDrillTargets){
- var _1963=getCtxNodeFromEvent(evt);
- if(_1963){
- this.addDrillableClass(_1963);
- this._set_chartImage_drillThroughCursor_IE("pointer",evt);
- }
- }
- if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
- this.doOnMouseOver(evt);
- }
- };
- DrillUpDownOrThroughAction.prototype.onMouseOut=function(evt){
- if(this.m_hasAuthoredDrillTargets){
- var _1965=getCtxNodeFromEvent(evt);
- if(_1965){
- this.removeDrillableClass(_1965);
- this._set_chartImage_drillThroughCursor_IE("default",evt);
- }
- }
- if(this.m_canDrillUpDown&&!this.isSelectionFilterEnabled()&&!this.m_oCV.isDrillBlackListed()){
- this.doOnMouseOut(evt);
- }
- };
- DrillUpDownOrThroughAction.prototype._getDrillThroughChartImage_from_chartArea=function(evt){
- var _1967=getCrossBrowserNode(evt);
- if(_1967){
- var _1968=this.m_oCV.getSelectionController();
- return _1968.getSelectedChartImageFromChartArea(_1967);
- }
- };
- DrillUpDownOrThroughAction.prototype._set_chartImage_drillThroughCursor_IE=function(_1969,evt){
- if(dojo.isIE||dojo.isTrident){
- var oImg=this._getDrillThroughChartImage_from_chartArea(evt);
- if(oImg){
- oImg.style.cursor=_1969;
- }
- }
- };
- function DrillDownAction(){
- this.m_sAction="DrillDown";
- this.m_drillOption="drillDown";
- };
- DrillDownAction.prototype=new DrillUpDownAction();
- DrillDownAction.prototype.getUndoHint=function(){
- return RV_RES.RV_DRILL_DOWN;
- };
- DrillDownAction.prototype.getHoverClassName=function(){
- return "dl";
- };
- DrillDownAction.prototype.updateMenu=function(_196c){
- _196c.visible=this.ifContainsInteractiveDataContainer();
- if(!_196c.visible){
- return _196c;
- }
- this.updateDrillabilityFromSelections();
- if(!this.canDrillDown()){
- _196c.disabled=true;
- }else{
- _196c.disabled=false;
- DrillContextMenuHelper.updateDrillMenuItems(_196c,this.m_oCV,this.m_sAction);
- }
- return _196c;
- };
- function DrillUpAction(){
- this.m_sAction="DrillUp";
- this.m_drillOption="drillUp";
- };
- DrillUpAction.prototype=new DrillUpDownAction();
- DrillUpAction.prototype.getHoverClassName=function(){
- return "dl";
- };
- DrillUpAction.prototype.getUndoHint=function(){
- return RV_RES.RV_DRILL_UP;
- };
- DrillUpAction.prototype.updateMenu=function(_196d){
- _196d.visible=this.ifContainsInteractiveDataContainer();
- if(!_196d.visible){
- return _196d;
- }
- this.updateDrillabilityFromSelections();
- if(!this.canDrillUp()){
- _196d.disabled=true;
- }else{
- _196d.disabled=false;
- DrillContextMenuHelper.updateDrillMenuItems(_196d,this.m_oCV,this.m_sAction);
- }
- return _196d;
- };
- function DeleteAction(){
- this.m_sAction="Delete";
- };
- DeleteAction.prototype=new ModifyReportAction();
- DeleteAction.baseclass=ModifyReportAction.prototype;
- DeleteAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_DELETE;
- };
- DeleteAction.prototype.canDelete=function(){
- if(!this.m_oCV.isLimitedInteractiveMode()){
- var _196e=this.m_oCV.getSelectionController().getAllSelectedObjects();
- if(_196e.length>0){
- for(var i=0;i<_196e.length;++i){
- var _1970=_196e[i];
- var _1971=_1970.getCellRef();
- if(!_1970.hasContextInformation()||_1970.isHomeCell()||(_1970.getLayoutType()!="columnTitle"&&_1970.getDataContainerType()!="list")||_1971.getAttribute("cc")=="true"){
- return false;
- }
- }
- return true;
- }
- }
- return false;
- };
- DeleteAction.prototype.execute=function(){
- DeleteAction.baseclass.execute.call(this);
- this.m_oCV.getSelectionController().clearSelectionData();
- this.m_oCV.getViewerWidget().onContextMenu(null);
- };
- DeleteAction.prototype.keepRAPCache=function(){
- return false;
- };
- DeleteAction.prototype.updateMenu=function(_1972){
- _1972.visible=this.ifContainsInteractiveDataContainer();
- if(!_1972.visible){
- return _1972;
- }
- _1972.disabled=!this.canDelete();
- return _1972;
- };
- DeleteAction.prototype.addActionContextAdditionalParms=function(){
- return this.getSelectedCellTags();
- };
- function UndoableClientActionBase(){
- };
- UndoableClientActionBase.prototype=new CognosViewerAction();
- UndoableClientActionBase.prototype.setContainerId=function(_1973){
- this.m_sContainerId=_1973;
- };
- UndoableClientActionBase.prototype.doRedo=function(_1974){
- this.setContainerId(_1974);
- this.execute();
- };
- UndoableClientActionBase.prototype.doUndo=function(_1975){
- factory=this.getCognosViewer().getActionFactory();
- var _1976=factory.load(this.getUndoClass());
- _1976.setContainerId(_1975);
- _1976.execute();
- };
- UndoableClientActionBase.prototype.getSelectedContainerId=function(){
- var _1977=this.m_oCV.getSelectionController().getAllSelectedObjects();
- if(_1977&&_1977.length){
- var lid=_1977[0].getLayoutElementId();
- if(lid){
- return this.removeNamespace(lid);
- }
- }
- return null;
- };
- function FreezeRowHeadingsAction(){
- };
- FreezeRowHeadingsAction.prototype=new UndoableClientActionBase();
- FreezeRowHeadingsAction.superclass=UndoableClientActionBase.prototype;
- FreezeRowHeadingsAction.prototype.execute=function(){
- var _1979=this.m_sContainerId?this.m_sContainerId:this.getSelectedCrosstabContainerId();
- if(_1979){
- this.m_oCV.getSelectionController().resetSelections();
- this.m_oCV.getPinFreezeManager().freezeContainerRowHeadings(_1979);
- this.addClientSideUndo(this,[_1979]);
- }
- };
- FreezeRowHeadingsAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_FREEZEROWHEADINGS;
- };
- FreezeRowHeadingsAction.prototype.getUndoClass=function(){
- return "UnfreezeRowHeadings";
- };
- FreezeRowHeadingsAction.prototype.getSelectedCrosstabContainerLid=function(){
- var _197a=this.m_oCV.getSelectionController().getAllSelectedObjects();
- if(_197a&&_197a.length&&_197a[0].getDataContainerType()=="crosstab"){
- var lid=(_197a[0].getLayoutElementId());
- if(lid){
- return lid;
- }
- }
- return null;
- };
- FreezeRowHeadingsAction.prototype.getSelectedCrosstabContainerId=function(){
- var lid=this.getSelectedCrosstabContainerLid();
- if(lid){
- return this.removeNamespace(lid);
- }
- return null;
- };
- FreezeRowHeadingsAction.prototype.canFreezeRowHeadings=function(){
- var _197d=this.m_oCV.getPinFreezeManager();
- if(_197d){
- var _197e=this.getSelectedCrosstabContainerId();
- if(_197e){
- if(!_197d.hasFrozenRowHeadings(_197e)&&_197d.getValidSelectedContainerId(false)){
- return true;
- }
- }
- }
- return false;
- };
- FreezeRowHeadingsAction.prototype.updateMenu=function(_197f){
- _197f.visible=this.canFreezeRowHeadings();
- return _197f;
- };
- function UnfreezeRowHeadingsAction(){
- };
- UnfreezeRowHeadingsAction.prototype=new UndoableClientActionBase();
- UnfreezeRowHeadingsAction.superclass=UndoableClientActionBase.prototype;
- UnfreezeRowHeadingsAction.prototype.execute=function(){
- if(this.m_oCV.getPinFreezeManager()){
- var _1980=document.getElementById("CVReport"+this.m_oCV.getId());
- var _1981=this.m_sContainerId?this.m_sContainerId:this.getSelectedContainerId();
- this.m_oCV.getSelectionController().resetSelections();
- this.m_oCV.getPinFreezeManager().unfreezeContainerRowHeadings(_1981,_1980);
- this.addClientSideUndo(this,[_1981]);
- }
- };
- UnfreezeRowHeadingsAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_UNFREEZEROWHEADINGS;
- };
- UnfreezeRowHeadingsAction.prototype.getUndoClass=function(){
- return "FreezeRowHeadings";
- };
- UnfreezeRowHeadingsAction.prototype.areRowHeadingsFrozen=function(){
- if(this.m_oCV.getPinFreezeManager()&&this.m_oCV.getPinFreezeManager().hasFrozenRowHeadings(this.getSelectedContainerId())){
- return true;
- }
- return false;
- };
- UnfreezeRowHeadingsAction.prototype.updateMenu=function(_1982){
- _1982.visible=this.areRowHeadingsFrozen();
- return _1982;
- };
- function FreezeColumnHeadingsAction(){
- };
- FreezeColumnHeadingsAction.prototype=new UndoableClientActionBase();
- FreezeColumnHeadingsAction.superclass=UndoableClientActionBase.prototype;
- FreezeColumnHeadingsAction.prototype.execute=function(){
- var _1983=this.m_sContainerId?this.m_sContainerId:this.getSelectedCrosstabOrListContainerId();
- if(_1983){
- this.m_oCV.getSelectionController().resetSelections();
- this.m_oCV.getPinFreezeManager().freezeContainerColumnHeadings(_1983);
- this.addClientSideUndo(this,[_1983]);
- }
- };
- FreezeColumnHeadingsAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_FREEZECOLUMNHEADINGS;
- };
- FreezeColumnHeadingsAction.prototype.getUndoClass=function(){
- return "UnfreezeColumnHeadings";
- };
- FreezeColumnHeadingsAction.prototype.getSelectedCrosstabOrListContainerLid=function(){
- var _1984=this.m_oCV.getSelectionController().getAllSelectedObjects();
- if(_1984&&_1984.length&&(_1984[0].getDataContainerType()=="crosstab"||_1984[0].getDataContainerType()=="list")){
- var lid=(_1984[0].getLayoutElementId());
- if(lid){
- return lid;
- }
- }
- return null;
- };
- FreezeColumnHeadingsAction.prototype.getSelectedCrosstabOrListContainerId=function(){
- var lid=this.getSelectedCrosstabOrListContainerLid();
- if(lid){
- return this.removeNamespace(lid);
- }
- return null;
- };
- FreezeColumnHeadingsAction.prototype.canFreezeColumnHeadings=function(){
- var _1987=this.m_oCV.getPinFreezeManager();
- if(_1987){
- var _1988=this.getSelectedCrosstabOrListContainerId();
- if(_1988){
- if(!_1987.hasFrozenColumnHeadings(_1988)&&_1987.getValidSelectedContainerId(true)){
- return true;
- }
- }
- return false;
- }
- };
- FreezeColumnHeadingsAction.prototype.updateMenu=function(_1989){
- _1989.visible=this.canFreezeColumnHeadings();
- return _1989;
- };
- function UnfreezeColumnHeadingsAction(){
- };
- UnfreezeColumnHeadingsAction.prototype=new UndoableClientActionBase();
- UnfreezeColumnHeadingsAction.superclass=UndoableClientActionBase.prototype;
- UnfreezeColumnHeadingsAction.prototype.execute=function(){
- if(this.m_oCV.getPinFreezeManager()){
- var _198a=document.getElementById("CVReport"+this.m_oCV.getId());
- var _198b=this.m_sContainerId?this.m_sContainerId:this.getSelectedContainerId();
- this.m_oCV.getSelectionController().resetSelections();
- this.m_oCV.getPinFreezeManager().unfreezeContainerColumnHeadings(_198b,_198a);
- this.addClientSideUndo(this,[_198b]);
- }
- };
- UnfreezeColumnHeadingsAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_UNFREEZECOLUMNHEADINGS;
- };
- UnfreezeColumnHeadingsAction.prototype.getUndoClass=function(){
- return "FreezeColumnHeadings";
- };
- UnfreezeColumnHeadingsAction.prototype.areColumnHeadingsFrozen=function(){
- if(this.m_oCV.getPinFreezeManager()&&this.m_oCV.getPinFreezeManager().hasFrozenColumnHeadings(this.getSelectedContainerId())){
- return true;
- }
- return false;
- };
- UnfreezeColumnHeadingsAction.prototype.updateMenu=function(_198c){
- _198c.visible=this.areColumnHeadingsFrozen();
- return _198c;
- };
- function GlossaryAction(){
- };
- GlossaryAction.prototype=new CognosViewerAction();
- GlossaryAction.prototype.execute=function(){
- var _198d=this.getCognosViewer();
- _198d.loadExtra();
- var _198e=_198d.getSelectionController();
- var _198f=_198e.getAllSelectedObjects();
- if(_198f.length>0){
- var _1990=null;
- if(typeof MDSRV_CognosConfiguration!="undefined"){
- _1990=new MDSRV_CognosConfiguration();
- var _1991="";
- if(_198d.envParams["glossaryURI"]){
- _1991=_198d.envParams["glossaryURI"];
- }
- _1990.addProperty("glossaryURI",_1991);
- _1990.addProperty("gatewayURI",_198d.getGateway());
- }
- var _1992=_198d.envParams["ui.object"];
- var _1993=getViewerSelectionContext(_198e,new CSelectionContext(_1992));
- var _1994=new MDSRV_BusinessGlossary(_1990,_1993);
- _1994.open();
- }
- };
- GlossaryAction.prototype.updateMenu=function(_1995){
- if(!this.getCognosViewer().bCanUseGlossary){
- return "";
- }
- var _1996=this.selectionHasContext();
- if(!_1996||this.getCognosViewer().envParams["glossaryURI"]==null||this.getCognosViewer().envParams["glossaryURI"]==""){
- _1995.disabled=true;
- }else{
- _1995.disabled=false;
- }
- return _1995;
- };
- function GroupAction(){
- this.m_sAction="GroupColumn";
- };
- GroupAction.prototype=new ModifyReportAction();
- GroupAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_GROUP_UNGROUP;
- };
- GroupAction.prototype.updateMenu=function(_1997){
- _1997.visible=this.ifContainsInteractiveDataContainer();
- if(!_1997.visible){
- return _1997;
- }
- var _1998=this.m_oCV.getSelectionController();
- var _1999=_1998.getAllSelectedObjects();
- if(_1999.length===0||_1998.getDataContainerType()!="list"){
- return this.disableMenuItem(_1997);
- }
- if(_1999[0].getCellRef().getAttribute("no_data_item_column")==="true"){
- return this.disableMenuItem(_1997);
- }
- var _199a=!_1998.isRelational();
- for(var index=0;index<_1999.length;++index){
- if(_1998.getUsageInfo(_1999[index].getSelectedContextIds()[0][0])==_1998.c_usageMeasure&&(_199a||_1999[index].getLayoutType()==="summary")){
- return this.disableMenuItem(_1997);
- }
- }
- _1997.disabled=false;
- _1997.iconClass="group";
- return _1997;
- };
- GroupAction.prototype.disableMenuItem=function(_199c){
- _199c.disabled=true;
- _199c.iconClass="groupDisabled";
- return _199c;
- };
- GroupAction.prototype.addActionContextAdditionalParms=function(){
- return this.addClientContextData(3);
- };
- function LoadMenuAction(){
- this.m_action=null;
- };
- LoadMenuAction.prototype=new CognosViewerAction();
- LoadMenuAction.prototype.FROM_TOOLBAR="toolbar";
- LoadMenuAction.prototype.FROM_TOOLBAR_BLUEDOTMENU="toolbarBlueDotMenu";
- LoadMenuAction.prototype.FROM_CONTEXTMENU="contextMenu";
- LoadMenuAction.prototype.FROM_CONTEXTMENU_MOREACTIONS="contextMenuMoreActions";
- LoadMenuAction.prototype.TOOLBAR_UPDATE_EVENT="com.ibm.bux.widgetchrome.toolbar.update";
- LoadMenuAction.prototype.CONTEXTMENU_UPDATE_EVENT="com.ibm.bux.widget.contextMenu.update";
- LoadMenuAction.prototype.setRequestParms=function(_199d){
- this.m_action=_199d.action;
- this.m_sFrom=(_199d.from)?_199d.from:this.FROM_TOOLBAR;
- };
- LoadMenuAction.prototype.execute=function(){
- var _199e=this.m_oCV.getActionFactory();
- var _199f=_199e.load(this.m_action);
- var _19a0=this.getMenuSpec();
- var _19a1=GUtil.generateCallback(this.buildMenuCallback,[_19a0],this);
- _19a0=_199f.buildMenu(_19a0,_19a1);
- if(_19a0!=null){
- this.buildMenuCallback(_19a0);
- }
- };
- LoadMenuAction.prototype.buildMenuCallback=function(_19a2){
- _19a2.open=true;
- _19a2.action=null;
- this.fireEvent(_19a2);
- };
- LoadMenuAction.prototype.getMenuSpec=function(){
- var oCV=this.m_oCV;
- var sFrom=this.m_sFrom;
- if(!sFrom||!oCV){
- return null;
- }
- var _19a5=null;
- var _19a6=null;
- switch(sFrom){
- case this.FROM_TOOLBAR:
- _19a5=oCV.getToolbar();
- break;
- case this.FROM_TOOLBAR_BLUEDOTMENU:
- _19a5=oCV.findBlueDotMenu();
- break;
- case this.FROM_CONTEXTMENU_MOREACTIONS:
- _19a5=oCV.findToolbarItem("MoreActions",oCV.getContextMenu());
- break;
- }
- if(_19a5){
- _19a6=oCV.findToolbarItem(this.m_action,_19a5);
- }
- if(_19a6){
- _19a6.from=sFrom;
- }
- return _19a6;
- };
- LoadMenuAction.prototype.fireEvent=function(_19a7){
- var _19a8=[];
- if(_19a7){
- _19a8.push(_19a7);
- }
- var _19a9=this.m_oCV.getViewerWidget();
- var sFrom=_19a7.from;
- switch(sFrom){
- case this.FROM_TOOLBAR:
- case this.FROM_TOOLBAR_BLUEDOTMENU:
- _19a9.fireEvent(this.TOOLBAR_UPDATE_EVENT,null,_19a8);
- break;
- case this.FROM_CONTEXTMENU_MOREACTIONS:
- _19a9.fireEvent(this.CONTEXTMENU_UPDATE_EVENT,null,_19a8);
- break;
- }
- };
- function MoveAction(){
- this.m_sAction="Reorder";
- };
- MoveAction.prototype=new DragDropAction();
- MoveAction.prototype.setRequestParms=function(_19ab){
- this.m_order=_19ab.order;
- };
- MoveAction.prototype.canMoveLeftRight=function(_19ac){
- var _19ad=this.m_oCV.getSelectionController();
- if(_19ad&&_19ad.getAllSelectedObjects().length==1){
- var _19ae=_19ad.getAllSelectedObjects()[0].getCellRef();
- if(_19ac=="right"&&_19ae.nextSibling){
- return true;
- }else{
- if(_19ac=="left"&&_19ae.previousSibling){
- return true;
- }
- }
- }
- return false;
- };
- MoveAction.prototype.updateMenu=function(_19af){
- if(!this.canMove()){
- _19af="";
- }else{
- var _19b0=this.m_oCV.getSelectionController();
- if(_19b0&&_19b0.getAllSelectedObjects().length>1){
- _19af.disabled=true;
- _19af.items=null;
- }else{
- _19af.disabled=false;
- _19af.items=[];
- _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});
- _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});
- }
- }
- return _19af;
- };
- MoveAction.prototype.addActionContextAdditionalParms=function(){
- var _19b1=this.getCognosViewer().getSelectionController();
- var _19b2=null;
- if(this.m_order=="right"){
- _19b2=_19b1.getAllSelectedObjects()[0].getCellRef().nextSibling;
- }else{
- _19b2=_19b1.getAllSelectedObjects()[0].getCellRef().previousSibling;
- }
- var _19b3=_19b1.buildSelectionObject(_19b2,null);
- var tag=this.m_order=="right"?"after":"before";
- var _19b5=this.getRAPLayoutTag(_19b2);
- _19b5=(_19b5!=null)?_19b5:_19b3.getColumnName();
- return this.getSelectedCellTags()+"<"+tag+">"+xml_encode(_19b5)+"</"+tag+">";
- };
- function RefreshViewAction(){
- this.m_bCanvasRefreshEvent=false;
- };
- RefreshViewAction.prototype=new CognosViewerAction();
- RefreshViewAction.prototype.addCommonOptions=function(_19b6){
- var _19b7=this.getCognosViewer().getViewerWidget();
- if(this.m_bCanvasRefreshEvent&&_19b7.getSavedOutputSearchPath()!=null){
- _19b6.addFormField("ui.savedOutputSearchPath",encodeURIComponent(_19b7.getSavedOutputSearchPath()));
- }else{
- _19b7.setSavedOutputsCMResponse(null);
- _19b7.setSavedOutputSearchPath(null);
- }
- _19b6.addFormField("run.outputFormat","HTML");
- _19b6.addFormField("widget.reloadToolbar","true");
- _19b7.clearPropertiesDialog();
- var _19b8=document.getElementById("formWarpRequest"+this.getCognosViewer().getId());
- _19b6.addFormField("ui.object",_19b8["reRunObj"].value);
- };
- RefreshViewAction.prototype.execute=function(){
- var _19b9=this.createCognosViewerDispatcherEntry("buxDropReportOnCanvas");
- this.addCommonOptions(_19b9);
- var oCV=this.getCognosViewer();
- var _19bb=oCV.getViewerWidget();
- if(oCV.getCurrentlySelectedTab()&&_19bb.getSavedOutput()){
- oCV.setKeepTabSelected(oCV.getCurrentlySelectedTab());
- }
- this.getCognosViewer().dispatchRequest(_19b9);
- };
- RefreshViewAction.prototype.doAddActionContext=function(){
- return false;
- };
- RefreshViewAction.prototype.updateMenu=function(_19bc){
- _19bc.disabled=false;
- var oCV=this.getCognosViewer();
- if(oCV){
- var _19be=oCV.getViewerWidget();
- if(_19be&&_19be.getSavedOutputSearchPath()!=null){
- _19bc.disabled=true;
- }
- }
- return _19bc;
- };
- function RefreshViewEventAction(){
- this.m_bCanvasRefreshEvent=true;
- };
- RefreshViewEventAction.prototype=new RefreshViewAction();
- function RenameDataItemAction(){
- this.m_sAction="Rename";
- this.m_newLabel="";
- this.m_prevLabel="";
- this.m_containerId="";
- this.m_bUndoAdded=false;
- };
- RenameDataItemAction.prototype=new ModifyReportAction();
- RenameDataItemAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_RENAME;
- };
- RenameDataItemAction.prototype.saveSpecForUndo=function(){
- return true;
- };
- RenameDataItemAction.prototype.getContainerId=function(){
- return this.m_containerId;
- };
- RenameDataItemAction.prototype.addActionContextAdditionalParms=function(){
- var _19bf=this.getSelectedCellTags();
- return (_19bf+"<prevName>"+xml_encode(this.m_prevLabel)+"</prevName>"+"<toName>"+xml_encode(this.m_newLabel)+"</toName>");
- };
- RenameDataItemAction.prototype.onMouseOver=function(evt){
- var _19c1=getCtxNodeFromEvent(evt);
- _19c1.style.cursor=this.canRename()?"text":"default";
- };
- RenameDataItemAction.prototype.onMouseOut=function(evt){
- var _19c3=getCtxNodeFromEvent(evt);
- _19c3.style.cursor="default";
- };
- RenameDataItemAction.prototype.onDoubleClick=function(evt){
- if(this.canRename()){
- var _19c5=getCtxNodeFromEvent(evt);
- this.insertTextArea(_19c5);
- }
- };
- RenameDataItemAction.prototype.canRename=function(){
- if(this.m_oCV.isBlacklisted("RenameFromContextMenu")){
- return false;
- }
- var _19c6=this.m_oCV.getSelectionController();
- var _19c7=_19c6.getAllSelectedObjects().length;
- if(_19c7==1&&!this.m_oCV.isLimitedInteractiveMode()){
- var _19c8=_19c6.getAllSelectedObjects()[0];
- if(_19c8.hasContextInformation()){
- var _19c9=_19c8.getSelectedContextIds()[0][0];
- var _19ca=_19c8.getCellRef();
- return this.checkRenamableConditions(_19c8,_19ca,_19c9,_19c6);
- }
- }
- return false;
- };
- RenameDataItemAction.prototype.checkRenamableConditions=function(_19cb,_19cc,_19cd,_19ce){
- if(_19cb.isHomeCell()){
- return false;
- }
- if(_19cb.getLayoutType()=="columnTitle"&&_19ce.selectionsHaveCalculationMetadata()){
- if(_19cb.getDataContainerType()=="crosstab"&&!_19ce.areSelectionsMeasureOrCalculation()){
- return false;
- }
- return true;
- }
- if(_19cb.getLayoutType()=="columnTitle"&&_19cb.getDataContainerType()=="crosstab"){
- return false;
- }
- if(_19cb.getLayoutType()!="columnTitle"){
- return false;
- }
- if(_19cc.getAttribute("cc")=="true"){
- return false;
- }
- if(_19cc.getAttribute("CTNM")!=null&&_19ce.getMun(_19cd)!=""){
- return false;
- }
- return true;
- };
- RenameDataItemAction.prototype.insertTextArea=function(_19cf){
- var label=document.createElement("label");
- label.style.height="1px";
- label.style.width="1px";
- label.style.overflow="hidden";
- label.style.position="absolute";
- label.style.left="0px";
- label.style.top="-500px";
- label.setAttribute("for","rename"+this.m_oCV.getId());
- label.id="renameLabel"+this.m_oCV.getId();
- label.innerHTML=RV_RES.IDS_JS_RENAME_LABEL;
- var input=document.createElement("input");
- input.id="rename"+this.m_oCV.getId();
- input.name="rename"+this.m_oCV.getId();
- input.type="text";
- input.value=_19cf.childNodes[0].nodeValue;
- input.style.backgroundColor="transparent";
- input.style.borderWidth="0px";
- input.style.padding="0px";
- input.style.margin="0px";
- input.setAttribute("role","textbox");
- input.setAttribute("aria-labelledby","renameLabel"+this.m_oCV.getId());
- var width=_19cf.parentNode.scrollWidth-10;
- var _19d3=_19cf.parentNode.firstChild;
- while(_19d3){
- if(_19d3!=_19cf){
- width-=_19d3.scrollWidth;
- }
- _19d3=_19d3.nextSibling;
- }
- input.style.width=width+"px";
- input.ctxNode=_19cf;
- input.action=this;
- input.originalLabel=_19cf.childNodes[0].nodeValue;
- if(isIE()){
- input.style.fontFamily=_19cf.currentStyle.fontFamily;
- input.style.fontSize=_19cf.currentStyle.fontSize;
- input.style.fontStyle=_19cf.currentStyle.fontStyle;
- input.style.fontVariant=_19cf.currentStyle.fontVariant;
- input.style.fontWeight=_19cf.currentStyle.fontWeight;
- input.attachEvent("onblur",this.onBlur);
- input.attachEvent("onkeydown",this.onKeyDown);
- input.style.overflow="hidden";
- }else{
- input.style.font="inherit";
- input.addEventListener("blur",this.onBlur,false);
- input.addEventListener("keydown",this.onKeyDown,false);
- input.style.overflow="visible";
- }
- _19cf.innerHTML="";
- _19cf.appendChild(label);
- _19cf.appendChild(input);
- input.focus();
- input.select();
- };
- RenameDataItemAction.prototype.onMouseDown=function(evt){
- if(evt){
- try{
- var node=evt.originalTarget?evt.originalTarget:evt.srcElement;
- if(node&&node.getAttribute("id")==="rename"+this.m_oCV.getId()){
- return true;
- }
- }
- catch(ex){
- }
- }
- return false;
- };
- RenameDataItemAction.prototype.onBlur=function(evt){
- var node;
- if(isIE()){
- node=getNodeFromEvent(evt);
- }else{
- node=this;
- }
- var _19d8=node.ctxNode;
- var _19d9=node.action;
- var _19da=node.value!=""?node.value:node.innerHTML;
- _19d9.updateLabel(_19d8,_19da,node.originalLabel);
- };
- RenameDataItemAction.prototype.onKeyDown=function(evt){
- var _19dc="";
- var node=getNodeFromEvent(evt);
- if(evt.keyCode=="13"){
- _19dc=node.value!=""?node.value:node.originalLabel;
- }else{
- if(evt.keyCode=="27"){
- _19dc=node.originalLabel;
- }
- }
- if(_19dc!=""){
- var _19de=node.ctxNode;
- var _19df=node.action;
- _19df.updateLabel(_19de,_19dc,node.originalLabel);
- return stopEventBubble(evt);
- }else{
- return true;
- }
- };
- RenameDataItemAction.prototype.updateLabel=function(_19e0,_19e1,_19e2){
- this.m_newLabel=_19e1;
- this.m_prevLabel=_19e2;
- _19e0.innerHTML="";
- _19e0.appendChild(document.createTextNode(_19e1));
- var _19e3=this.m_oCV.getSelectionController();
- if(_19e3!=null&&_19e1!=_19e2){
- var _19e4=new CSelectionObjectFactory(_19e3);
- this.m_containerId=this.removeNamespace(_19e4.getLayoutElementId(_19e0));
- var _19e5=_19e4.getSelectionObject(_19e0.parentNode);
- _19e3.m_aSelectedObjects[0]=_19e5;
- var _19e6=_19e5.getCellRef().getElementsByTagName("span");
- var span=null;
- if(_19e6){
- for(var i=0;i<_19e6.length;i++){
- span=_19e6[i];
- if(span.getAttribute("ctx")!=null&&span.style.visibility!="hidden"){
- span.focus();
- break;
- }
- }
- }
- this.execute();
- }
- };
- RenameDataItemAction.prototype.buildUrl=function(){
- var _19e9="b_action=cognosViewer&ui.action=modifyReport&cv.responseFormat=xml";
- var _19ea=this.addActionContext();
- _19e9+="&cv.actionContext="+encodeURIComponent(_19ea);
- if(window.gViewerLogger){
- window.gViewerLogger.log("Action context",_19ea,"xml");
- }
- _19e9+="&ui.object="+encodeURIComponent(this.m_oCV.envParams["ui.object"]);
- if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
- _19e9+="&ui.spec="+encodeURIComponent(this.m_oCV.envParams["ui.spec"]);
- }
- if(typeof this.m_oCV.getModelPath()!=""){
- _19e9+="&modelPath="+encodeURIComponent(this.m_oCV.getModelPath());
- }
- return _19e9;
- };
- RenameDataItemAction.prototype.keepRAPCache=function(){
- return false;
- };
- RenameDataItemAction.prototype.reuseQuery=function(){
- return true;
- };
- function RenameFromContextMenuAction(){
- };
- RenameFromContextMenuAction.prototype=new RenameDataItemAction();
- RenameFromContextMenuAction.prototype.canRename=function(_19eb){
- if(!_19eb||_19eb.hasContextInformation()==false){
- return false;
- }
- var _19ec=this.m_oCV.getSelectionController();
- var _19ed=_19eb.getSelectedContextIds()[0][0];
- var _19ee=_19eb.getCellRef();
- return this.checkRenamableConditions(_19eb,_19ee,_19ed,_19ec);
- };
- RenameFromContextMenuAction.prototype.updateMenu=function(_19ef){
- _19ef.visible=this.ifContainsInteractiveDataContainer();
- if(!_19ef.visible){
- return _19ef;
- }
- var _19f0=this.m_oCV.getSelectionController();
- var _19f1=_19f0.getAllSelectedObjects().length;
- if(_19f1!=1){
- for(var _19f2=0;_19f2<_19f1;_19f2++){
- if(!this.canRename(_19f0.getAllSelectedObjects()[_19f2])){
- return "";
- }
- }
- _19ef.disabled=true;
- }else{
- if(!this.canRename(_19f0.getAllSelectedObjects()[0])){
- _19ef="";
- }else{
- _19ef.disabled=false;
- }
- }
- return _19ef;
- };
- RenameFromContextMenuAction.prototype.getSpanFromCellRef=function(_19f3){
- var _19f4=_19f3.getElementsByTagName("span");
- var span=null;
- if(_19f4){
- for(var i=0;i<_19f4.length;i++){
- span=_19f4[i];
- if(span.getAttribute("ctx")!=null&&span.style.visibility!="hidden"){
- break;
- }
- }
- }
- return span;
- };
- RenameFromContextMenuAction.prototype.execute=function(){
- var _19f7=this.m_oCV.getSelectionController().getAllSelectedObjects()[0].getCellRef();
- if(_19f7){
- var span=this.getSpanFromCellRef(_19f7);
- var _19f9=this.m_oCV.getAction("RenameDataItem");
- _19f9.insertTextArea(span);
- }
- };
- function ResetToOriginalAction(){
- };
- ResetToOriginalAction.prototype=new CognosViewerAction();
- ResetToOriginalAction.prototype.updateMenu=function(_19fa){
- var _19fb=this.getCognosViewer().envParams.baseReportAvailable;
- _19fa.disabled=(_19fb==="false")?true:_19fa.disabled;
- return _19fa;
- };
- ResetToOriginalAction.prototype.execute=function(){
- 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);
- _19fc.startup();
- _19fc.show();
- };
- ResetToOriginalAction.prototype.executeAction=function(_19fd){
- this.gatherFilterInfoBeforeAction("ResetToOriginal");
- ChangePaletteAction.reset(this.getCognosViewer());
- };
- ResetToOriginalAction.prototype.dispatchRequest=function(_19fe){
- var _19ff=this.getCognosViewer();
- var _1a00=_19ff.getViewerWidget();
- _1a00.reset();
- var _1a01=_1a00.getAttributeValue("originalReport");
- if(!_1a01){
- var _1a02=_1a00.getSavedItem();
- if(_1a00.isSavedReport(_1a01,_1a02)){
- _1a01=_1a02;
- }
- }
- var _1a03=_1a00.getAttributeValue("originalReportPart");
- var _1a04=_19ff.envParams["cv.objectPermissions"];
- var _1a05=_19ff.envParams["bpmRestURI"];
- var _1a06=_19ff.envParams["glossaryURI"];
- var _1a07=_19ff.envParams["metadataInformationURI"];
- var _1a08=_19ff.envParams["ui.routingServerGroup"];
- delete _19ff.envParams;
- _19ff.envParams={};
- _19ff.envParams["ui.object"]=_1a01;
- _19ff.envParams["originalReport"]=_1a01;
- _19ff.envParams["bux"]="true";
- _19ff.envParams["cv.objectPermissions"]=_1a04;
- _19ff.envParams["ui.routingServerGroup"]=_1a08;
- if(_1a05){
- _19ff.envParams["bpmRestURI"]=_1a05;
- }
- if(_1a06){
- _19ff.envParams["glossaryURI"]=_1a06;
- }
- if(_1a07){
- _19ff.envParams["metadataInformationURI"]=_1a07;
- }
- var _1a09=this.createCognosViewerDispatcherEntry("resetToOriginal");
- _1a09.addFormField("run.outputFormat","HTML");
- _1a09.addFormField("widget.reloadToolbar","true");
- _1a09.addFormField("ui.reportDrop","true");
- _19ff.resetbHasPromptFlag();
- _1a09.addFormField("widget.forceGetParameters","true");
- if(_19fe!=""){
- _1a09.addFormField("cv.updateDataFilters",_19fe);
- }
- _1a09.addFormField("run.prompt","false");
- var _1a0a=(_1a03&&_1a03.length>0);
- if(_1a0a){
- _1a09.addFormField("reportpart_id",_1a03);
- }
- _19ff.hideReportInfo();
- _19ff.dispatchRequest(_1a09);
- this.fireModifiedReportEvent();
- };
- ResetToOriginalAction.prototype.doAddActionContext=function(){
- return false;
- };
- ResetToOriginalAction.prototype.canShowMenuInGlobalArea=function(){
- return true;
- };
- ResetToOriginalAction.prototype.isValidMenuItem=function(){
- var _1a0b=this.getCognosViewer();
- var _1a0c=_1a0b.getViewerWidget();
- if(_1a0c.m_isInGlobalArea){
- return (this.isPromptWidget()?true:false);
- }else{
- return (this.isPromptWidget()?false:true);
- }
- };
- function ResizeChartAction(){
- this.m_width=0;
- this.m_height=0;
- this.m_sAction="ChangeDataContainerSize";
- this.m_bRunReport=true;
- this.m_oChart=null;
- };
- ResizeChartAction.prototype=new ModifyReportAction();
- ResizeChartAction.prototype.isUndoable=function(){
- return false;
- };
- ResizeChartAction.superclass=ModifyReportAction.prototype;
- ResizeChartAction.prototype.runReport=function(){
- return this.m_bRunReport;
- };
- ResizeChartAction.prototype.canBeQueued=function(){
- return true;
- };
- ResizeChartAction.prototype.reuseQuery=function(){
- return true;
- };
- ResizeChartAction.PADDING={getWidth:function(){
- return 2;
- },getHeight:function(){
- return 2;
- }};
- ResizeChartAction.prototype.getActionKey=function(){
- return "ResizeChartAction";
- };
- ResizeChartAction.prototype.setRequestParms=function(_1a0d){
- if(_1a0d&&_1a0d.resize){
- this.m_width=parseInt(_1a0d.resize.w,10)-ResizeChartAction.PADDING.getWidth();
- this.m_height=parseInt(_1a0d.resize.h,10)-ResizeChartAction.PADDING.getHeight();
- }
- };
- ResizeChartAction.prototype.execute=function(){
- if(this.m_oCV.m_readyToRespondToResizeEvent!==true){
- return;
- }
- if(this.m_oCV.getPinFreezeManager()){
- this.m_oCV.getPinFreezeManager().resize(this.m_width,this.m_height);
- }
- if(this.isActionApplicable()){
- var _1a0e=this.getLayoutComponents();
- if(_1a0e&&_1a0e.length>0){
- for(var i=0;i<_1a0e.length;++i){
- if(_1a0e[i].nodeName==="IMG"||_1a0e[0].getAttribute("flashChart")!==null){
- this.m_oChart=_1a0e[i];
- break;
- }
- }
- if(this.m_oChart&&this.isNewSizeDifferent()){
- if(_1a0e[0].getAttribute("flashChart")!==null){
- this.m_bRunReport=false;
- this.resizeFlashChart();
- }else{
- this.m_bRunReport=true;
- this.resizeChart();
- }
- }
- }
- }
- };
- ResizeChartAction.prototype.isActionApplicable=function(){
- var _1a10=this.m_oCV.getRAPReportInfo();
- if(_1a10&&_1a10.isSingleContainer()){
- return true;
- }
- return false;
- };
- ResizeChartAction.prototype.resizeFlashChart=function(){
- var size=this.getNewChartSize();
- this.m_oChart.setAttribute("width",size.w+"px");
- this.m_oChart.setAttribute("height",size.h+"px");
- this.resizeChart();
- };
- ResizeChartAction.prototype.resizeChart=function(){
- ResizeChartAction.superclass.execute.call(this);
- };
- ResizeChartAction.prototype.addActionContextAdditionalParms=function(){
- var _1a12="";
- var size=this.getNewChartSize();
- _1a12+="<height>"+size.h+"px</height>";
- _1a12+="<width>"+size.w+"px</width>";
- return _1a12;
- };
- ResizeChartAction.prototype.isNewSizeDifferent=function(){
- var _1a14=(this.m_oChart.getAttribute("flashChart")!==null);
- var _1a15=_1a14?this.m_oChart.getAttribute("width"):this.m_oChart.style.width;
- var _1a16=_1a14?this.m_oChart.getAttribute("height"):this.m_oChart.style.height;
- if(!_1a15||_1a15==""){
- _1a15=this.m_oChart.width;
- _1a16=this.m_oChart.height;
- }
- return parseInt(_1a15,10)!=this.m_width||parseInt(_1a16,10)!=this.m_height;
- };
- ResizeChartAction.prototype.getNewChartSize=function(){
- var _1a17=this.m_oChart;
- var _1a18=0;
- var _1a19=0;
- var _1a1a=0;
- var _1a1b=0;
- var _1a1c=0;
- var _1a1d=0;
- var _1a1e=0;
- var _1a1f=0;
- var _1a20=0;
- var _1a21=0;
- var _1a22=0;
- var _1a23=0;
- require(["dojo/dom-style"],function(_1a24){
- _1a18=_1a24.get(_1a17,"marginLeft");
- _1a19=_1a24.get(_1a17,"marginRight");
- _1a1a=_1a24.get(_1a17,"marginTop");
- _1a1b=_1a24.get(_1a17,"marginBottom");
- _1a1c=_1a24.get(_1a17,"borderLeftWidth");
- _1a1d=_1a24.get(_1a17,"borderRightWidth");
- _1a1e=_1a24.get(_1a17,"borderTopWidth");
- _1a1f=_1a24.get(_1a17,"borderBottomWidth");
- _1a20=_1a24.get(_1a17,"paddingLeft");
- _1a21=_1a24.get(_1a17,"paddingRight");
- _1a22=_1a24.get(_1a17,"paddingTop");
- _1a23=_1a24.get(_1a17,"paddingBottom");
- });
- this.m_width-=_1a1c+_1a1d+_1a18+_1a19+_1a20+_1a21;
- this.m_height-=_1a1e+_1a1f+_1a1a+_1a1b+_1a22+_1a23;
- if(this.m_keepRatio){
- var ratio=parseInt(this.m_oChart.style.width,10)/parseInt(this.m_oChart.style.height,10);
- var _1a26=ratio*this.m_height;
- if(_1a26>this.m_width){
- this.m_height=this.m_width/ratio;
- }
- var _1a27=this.m_width/ratio;
- if(_1a27>this.m_height){
- this.m_width=this.m_height*ratio;
- }
- }
- return {w:this.m_width,h:this.m_height};
- };
- function RetryRequestAction(){
- this.m_lastActionParams=null;
- };
- RetryRequestAction.prototype=new CognosViewerAction();
- RetryRequestAction.prototype.setRequestParms=function(parms){
- this.m_lastActionParams=parms;
- };
- RetryRequestAction.prototype.execute=function(){
- if(this.m_lastActionParams){
- var _1a29=new ViewerDispatcherEntry(this.m_oCV);
- var _1a2a=this.m_lastActionParams.keys();
- for(var index=0;index<_1a2a.length;index++){
- _1a29.addFormField(_1a2a[index],this.m_lastActionParams.get(_1a2a[index]));
- }
- _1a29.addFormField("cv.responseFormat","data");
- _1a29.addFormField("widget.reloadToolbar","true");
- _1a29.addNonEmptyStringFormField("limitedInteractiveMode",this.m_oCV.envParams["limitedInteractiveMode"]);
- this.m_oCV.dispatchRequest(_1a29);
- this.m_oCV.getViewerWidget().setOriginalFormFields(null);
- }
- };
- function RunReportAction(){
- this.m_reuseQuery=false;
- this.m_promptValues=null;
- this.m_sendParameterValues=false;
- this.m_clearCascadeParamsList=null;
- };
- RunReportAction.prototype=new CognosViewerAction();
- RunReportAction.prototype.setRequestParams=function(_1a2c){
- if(!_1a2c){
- return;
- }
- this.m_promptValues=_1a2c.promptValues;
- this.m_clearCascadeParamsList=_1a2c.clearCascadeParamsList;
- };
- RunReportAction.prototype.setSendParameterValues=function(_1a2d){
- this.m_sendParameterValues=_1a2d;
- };
- RunReportAction.prototype.reuseQuery=function(){
- return this.m_reuseQuery;
- };
- RunReportAction.prototype.setReuseQuery=function(value){
- this.m_reuseQuery=value;
- };
- RunReportAction.prototype.getPromptOption=function(){
- return "false";
- };
- RunReportAction.prototype.canBeQueued=function(){
- return false;
- };
- RunReportAction.prototype.getAction=function(_1a2f){
- return _1a2f?"run":"runSpecification";
- };
- RunReportAction.prototype.addAdditionalOptions=function(_1a30){
- this._addCommonOptions(_1a30);
- this._addRunOptionsFromProperties(_1a30);
- this._addClearCascadeParams(_1a30);
- this._addPromptValuesToRequest(_1a30);
- };
- RunReportAction.prototype._addClearCascadeParams=function(oReq){
- if(!this.m_clearCascadeParamsList||this.m_clearCascadeParamsList.length==0){
- return;
- }
- var _1a32=this.m_clearCascadeParamsList.length;
- for(var i=0;i<_1a32;i++){
- oReq.addFormField("c"+this.m_clearCascadeParamsList[i],"1");
- }
- };
- RunReportAction.prototype._addPromptValuesToRequest=function(_1a34){
- if(!this.m_promptValues){
- return;
- }
- _1a34.addFormField("sharedPromptRequest","true");
- for(var _1a35 in this.m_promptValues){
- _1a34.addFormField(_1a35,this.m_promptValues[_1a35]);
- }
- };
- RunReportAction.prototype._addCommonOptions=function(oReq){
- var _1a37=this.getCognosViewer().isLimitedInteractiveMode();
- if(typeof this.m_action==="undefined"){
- this.m_action=this.getAction(_1a37);
- }
- oReq.addFormField("run.prompt",this.getPromptOption());
- oReq.addFormField("ui.action",this.m_action);
- if(_1a37){
- oReq.addFormField("run.xslURL","bux.xsl");
- }
- oReq.addFormField("run.outputFormat","HTML");
- if(this.reuseQuery()===true){
- oReq.addFormField("reuseResults","true");
- }
- };
- RunReportAction.prototype._addRunOptionsFromProperties=function(oReq){
- var _1a39=this.getCognosViewer().getViewerWidget().getProperties();
- if(_1a39.getRowsPerPage()!=null){
- oReq.addFormField("run.verticalElements",_1a39.getRowsPerPage());
- }
- };
- RunReportAction.prototype.execute=function(){
- var oReq=this.createCognosViewerDispatcherEntry(this.m_action);
- oReq.setCanBeQueued(this.canBeQueued());
- if((this.m_action==="forward"||this.m_action==="back")&&(typeof this.m_bAbortAction==="undefined"||this.m_bAbortAction===true)){
- return false;
- }
- var oCV=this.getCognosViewer();
- if(this.m_sendParameterValues&&oCV.envParams["delayedLoadingExecutionParams"]){
- oReq.addFormField("delayedLoadingExecutionParams",oCV.envParams["delayedLoadingExecutionParams"]);
- delete oCV.envParams["delayedLoadingExecutionParams"];
- }
- this.getCognosViewer().dispatchRequest(oReq);
- return true;
- };
- RunReportAction.prototype.doAddActionContext=function(){
- return false;
- };
- RunReportAction.prototype.updateMenu=function(json){
- json.visible=!this.isPromptWidget();
- return json;
- };
- function BuxRunReportAction(){
- BuxRunReportAction.baseConstructor.call();
- };
- BuxRunReportAction.prototype=new RunReportAction();
- BuxRunReportAction.baseConstructor=RunReportAction;
- BuxRunReportAction.prototype.canBeQueued=function(){
- return true;
- };
- BuxRunReportAction.prototype.getAction=function(_1a3d){
- return _1a3d?"runBux":"buxRunSpec";
- };
- function RefreshAction(){
- this.m_sAction="Refresh";
- };
- RefreshAction.prototype=new RunReportAction();
- RefreshAction.superclass=RunReportAction.prototype;
- RefreshAction.prototype.execute=function(){
- RefreshAction.superclass.execute.call(this);
- };
- function GetParametersAction(){
- this.m_payload="";
- this.isPrimaryPromptWidget=false;
- this.m_requestParamsCopy=null;
- };
- GetParametersAction.prototype=new RunReportAction();
- GetParametersAction.prototype.setRequestParms=function(_1a3e){
- this.m_payload=_1a3e;
- };
- GetParametersAction.prototype.addRequestOptions=function(_1a3f){
- _1a3f.addFormField("asynch.alwaysIncludePrimaryRequest","false");
- _1a3f.addFormField("ui.action","getParameters");
- _1a3f.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- _1a3f.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- _1a3f.addFormField("isPrimaryPromptWidget",this.isPrimaryPromptWidget?"true":"false");
- _1a3f.addFormField("parameterValues",this.m_oCV.getExecutionParameters());
- if(this.m_oCV.envParams["bux"]=="true"){
- _1a3f.addFormField("bux","true");
- }
- };
- GetParametersAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- var _1a41=new AsynchJSONDispatcherEntry(oCV);
- _1a41.setCallbacks({"complete":{"object":this,"method":this.handleGetParametersResponse}});
- this.addRequestOptions(_1a41);
- if(oCV.getActiveRequest()){
- this.m_requestFormFieldsCopy=oCV.getActiveRequest().getFormFields();
- }
- _1a41.sendRequest();
- };
- GetParametersAction.prototype.handleGetParametersResponse=function(_1a42){
- try{
- var _1a43=_1a42.getResult();
- var _1a44=_1a43.xml;
- var _1a45=this.getCognosViewer();
- var _1a46=_1a45.getViewerWidget();
- if(typeof _1a44!="undefined"&&_1a44!=null){
- var _1a47=xml_decode(_1a44);
- this.m_oCV.envParams["reportPrompts"]=_1a47;
- if(this.isPrimaryPromptWidget){
- this.m_oCV.raisePromptEvent(_1a47,this.m_requestFormFieldsCopy);
- }else{
- _1a46.sharePrompts(this.m_payload);
- }
- }
- if(typeof _1a46!="undefined"){
- _1a46.promptParametersRetrieved=true;
- var _1a48=_1a46.getButtonFromSavedToolbarButtons("Reprompt");
- if(typeof _1a48!="undefined"&&_1a48!=null){
- var _1a49=_1a45.findBlueDotMenu();
- if(_1a45.addedButtonToToolbar(_1a49,_1a48.button,"Refresh",_1a48.position)){
- _1a45.resetbHasPromptFlag();
- _1a46.updateToolbar();
- }
- _1a46.removeFromSavedToolbarButtons("Reprompt");
- }
- }
- }
- catch(e){
- }
- };
- function RepromptAction(){
- this.m_repromptAction=null;
- };
- RepromptAction.prototype=new CognosViewerAction();
- RepromptAction.superclass=CognosViewerAction.prototype;
- RepromptAction.prototype.updateMenu=function(_1a4a){
- var oCV=this.getCognosViewer();
- _1a4a.visible=(!this.isPromptWidget()&&oCV.hasPrompt());
- if(!_1a4a.visible){
- _1a4a.save=true;
- }else{
- delete _1a4a.save;
- }
- return _1a4a;
- };
- RepromptAction.prototype.setRequestParms=function(_1a4c){
- RepromptAction.superclass.setRequestParms(_1a4c);
- if(_1a4c&&_1a4c["preferencesChanged"]){
- this["preferencesChanged"]=_1a4c["preferencesChanged"];
- }
- };
- RepromptAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- if(oCV.isLimitedInteractiveMode()){
- this.m_repromptAction=new RepromptRunAction();
- }else{
- this.m_repromptAction=new RepromptRAPAction();
- }
- this.m_repromptAction.setCognosViewer(oCV);
- if(this["preferencesChanged"]){
- this.m_repromptAction.reuseConversation(false);
- }
- this.m_repromptAction.execute();
- };
- function RepromptRAPAction(){
- this.m_sAction="Reprompt";
- };
- RepromptRAPAction.prototype=new ModifyReportAction();
- RepromptRAPAction.prototype.getPromptOption=function(){
- return "true";
- };
- RepromptRAPAction.prototype.isUndoable=function(){
- return false;
- };
- RepromptRAPAction.prototype.reuseQuery=function(){
- return false;
- };
- RepromptRAPAction.prototype.reuseGetParameter=function(){
- return false;
- };
- RepromptRAPAction.prototype.keepFocusOnWidget=function(){
- return false;
- };
- RepromptRAPAction.prototype.preProcess=function(){
- var cv=this.getCognosViewer();
- cv.m_raiseSharePromptEvent=true;
- };
- RepromptRAPAction.prototype.addAdditionalOptions=function(_1a4f){
- _1a4f.addFormField("run.outputFormat","HTML");
- _1a4f.addFormField("bux","true");
- };
- function RepromptRunAction(){
- };
- RepromptRunAction.prototype=new RunReportAction();
- RepromptRunAction.prototype.reuseQuery=function(){
- return false;
- };
- RepromptRunAction.prototype.reuseGetParameter=function(){
- return false;
- };
- RepromptRunAction.prototype.preProcess=function(){
- var cv=this.getCognosViewer();
- cv.m_raiseSharePromptEvent=true;
- };
- RepromptRunAction.prototype.getPromptOption=function(){
- return "true";
- };
- function SelectionAction(){
- };
- SelectionAction.prototype=new CognosViewerAction();
- SelectionAction.prototype.onMouseOver=function(evt){
- if(DragDropAction_isDragging(evt)==false){
- var _1a52=this.getCognosViewer().getSelectionController();
- _1a52.pageHover(evt);
- }
- };
- SelectionAction.prototype.onMouseOut=function(evt){
- if(DragDropAction_isDragging(evt)==false){
- var _1a54=this.getCognosViewer().getSelectionController();
- _1a54.pageHover(evt);
- }
- };
- SelectionAction.prototype.hasPermission=function(){
- var oCV=this.getCognosViewer();
- return !(oCV.isLimitedInteractiveMode()||oCV.envParams["cv.objectPermissions"].indexOf("read")===-1);
- };
- SelectionAction.prototype.executeDrillUpDown=function(evt){
- var oCV=this.getCognosViewer();
- var _1a58=oCV.getViewerWidget();
- if(oCV.isDrillBlackListed()||(_1a58&&_1a58.isSelectionFilterEnabled())){
- return false;
- }
- if(evt.button==0||evt.button==1||evt.keyCode=="13"){
- var _1a59=getCtxNodeFromEvent(evt);
- if(_1a59!=null){
- var _1a5a=this.m_oCV.getSelectionController();
- var _1a5b=_1a59.getAttribute("type")!=null?_1a59:_1a59.parentNode;
- var type=_1a5b.getAttribute("type");
- var _1a5d=_1a59.getAttribute("ctx");
- _1a5d=_1a5d.split("::")[0].split(":")[0];
- if((_1a5b.getAttribute("CTNM")!=null||type=="datavalue")&&_1a5a.getMun(_1a5d)!=""){
- var _1a5e=_1a5a.getAllSelectedObjects();
- for(var index=0;index<_1a5e.length;++index){
- var _1a60=_1a5e[index];
- if(_1a60.getCellRef()==_1a59.parentNode){
- if(_1a5e.length>1){
- _1a5a.clearSelectedObjects();
- _1a5a.addSelectionObject(_1a60);
- }
- var _1a61=this.m_oCV.getActionFactory();
- var _1a62=_1a61.load("DrillUpDown");
- _1a62.updateDrillability(this.m_oCV,_1a59);
- if(_1a62.drillability>0&&this.hasPermission()){
- _1a62.execute();
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- };
- SelectionAction.prototype.executeDrillThrough=function(evt){
- var _1a64=this.getCognosViewer().getViewerWidget();
- if(_1a64&&_1a64.isSelectionFilterEnabled()){
- return;
- }
- var _1a65=this.getCognosViewer().getDrillMgr();
- return _1a65.getDrillThroughParameters("execute",evt);
- };
- SelectionAction.prototype.pageClicked=function(evt){
- var _1a67=false;
- var _1a68=evt.which?evt.which==1:evt.button==1;
- var _1a69=new CognosViewerSort(evt,this.m_oCV);
- var _1a6a,_1a6b=getCrossBrowserNode(evt);
- try{
- _1a6a=(_1a6b&&_1a6b.className)||"";
- }
- catch(ex){
- _1a6a="";
- }
- var oCV=this.getCognosViewer();
- var _1a6d=null;
- if(_1a68&&_1a69.isSort(evt)&&!oCV.isLimitedInteractiveMode()&&!oCV.isBlacklisted("Sort")){
- _1a69.execute();
- }else{
- if(_1a68&&_1a6a.indexOf("expandButton")>-1){
- var nNode=_1a6b;
- if(_1a6a.indexOf("expandButtonCaption")>-1){
- nNode=nNode.parentNode;
- _1a6a=nNode.className;
- }
- _1a6d=getCognosViewerSCObjectRef(this.m_oCV.getId());
- _1a6d.selectSingleDomNode(nNode.parentNode);
- var _1a6f;
- if(_1a6a.indexOf("collapse")===-1){
- _1a6f=new ExpandMemberAction();
- }else{
- _1a6f=new CollapseMemberAction();
- }
- _1a6f.setCognosViewer(oCV);
- _1a6f.execute();
- }else{
- _1a6d=this.m_oCV.getSelectionController();
- if(this.executeDrillUpDown(evt)===false){
- var _1a70=this.m_oCV.getViewerWidget();
- if(_1a70.isSelectionFilterEnabled()){
- if(_1a68||evt.keyCode===13){
- _1a70.preprocessPageClicked(false,evt);
- }else{
- _1a70.preprocessPageClicked(true);
- }
- }
- if(_1a6d.pageClicked(evt)!=false){
- this.m_oCV.getViewerWidget().updateToolbar();
- _1a6d.resetAllowHorizontalDataValueSelection();
- }
- setNodeFocus(evt);
- }
- if(_1a68||evt.keyCode===13){
- _1a67=this.executeDrillThrough(evt);
- }
- if(_1a68&&this.m_oCV.getViewerWidget()&&this.m_oCV.getViewerWidget().onSelectionChange){
- this.m_oCV.getViewerWidget().onSelectionChange();
- }
- }
- }
- return _1a67;
- };
- SelectionAction.prototype.mouseActionInvolvesSelection=function(evt){
- var _1a72=evt.which?evt.which==1:evt.button==1;
- var _1a73=new CognosViewerSort(evt,this.m_oCV);
- if(_1a72&&_1a73.isSort(evt)){
- return false;
- }
- if(this.executeDrillUpDown(evt)!==false){
- return false;
- }
- return true;
- };
- SelectionAction.prototype.onMouseDown=function(evt){
- this.delegateClickToMouseUp=false;
- if(this.mouseActionInvolvesSelection(evt)&&!this.m_oCV.getSelectionController().shouldExecutePageClickedOnMouseDown(evt)){
- this.delegateClickToMouseUp=true;
- return false;
- }
- return this.pageClicked(evt);
- };
- SelectionAction.prototype.onMouseUp=function(evt,_1a76){
- var ret=false;
- if(!_1a76&&this.mouseActionInvolvesSelection(evt)&&this.delegateClickToMouseUp){
- ret=this.pageClicked(evt);
- }
- this.delegateClickToMouseUp=false;
- return ret;
- };
- SelectionAction.prototype.onKeyDown=function(evt){
- this.pageClicked(evt);
- };
- SelectionAction.prototype.onDoubleClick=function(evt){
- var _1a7a=this.m_oCV;
- var _1a7b=_1a7a.getViewerWidget();
- if(_1a7a.isDrillBlackListed()||(_1a7b&&_1a7b.isSelectionFilterEnabled())){
- return;
- }
- if(_1a7a.getStatus()=="complete"){
- var _1a7c=_1a7a.getDrillMgr();
- var _1a7d="DrillDown";
- var _1a7e="DrillDown";
- var _1a7f=false;
- var _1a80=false;
- if(_1a7c!=null){
- if(!this.hasPermission()){
- return true;
- }
- var _1a81=_1a7c.getSelectedObject();
- if(_1a81==null||(_1a81.m_dataContainerType=="list"&&_1a81.m_sLayoutType=="columnTitle")){
- return true;
- }
- var _1a82=_1a81.getDrillOptions();
- if(typeof _1a82=="undefined"||_1a82==null||!_1a82.length){
- return true;
- }
- _1a7f=_1a7c.canDrillDown();
- if(!_1a7f){
- _1a80=_1a7c.canDrillUp();
- if(_1a80){
- _1a7d="DrillUp";
- _1a7e="DrillUp";
- }
- }
- if(_1a7f||_1a80){
- _1a7a.executeAction(_1a7d,_1a7e);
- }
- }else{
- return true;
- }
- }
- };
- function SelectionFilterSwitchAction(){
- this.m_sAction="SelectionFilterSwitch";
- };
- SelectionFilterSwitchAction.prototype=new CognosViewerAction();
- SelectionFilterSwitchAction.prototype.updateMenu=function(_1a83){
- if(this.getCognosViewer().getViewerWidget().isSelectionFilterEnabled()){
- _1a83.disabled=false;
- _1a83.checked=true;
- _1a83.iconClass="selectionFilterEnabled";
- _1a83.label=RV_RES.IDS_JS_SELECTION_FILTER_SWITCH_DISABLE;
- }else{
- _1a83.disabled=false;
- _1a83.checked=false;
- _1a83.iconClass="selectionFilter";
- _1a83.label=RV_RES.IDS_JS_SELECTION_FILTER_SWITCH;
- }
- return _1a83;
- };
- SelectionFilterSwitchAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- var _1a85=oCV.getViewerWidget();
- var _1a86=_1a85.isSelectionFilterEnabled();
- if(_1a86){
- if(_1a85.selectionFilterSent()){
- _1a85.clearSelectionFilter();
- }
- }
- _1a85.toggleSelectionFilterSwitch();
- _1a85.updateToolbar();
- _1a85.onContextMenu({});
- if(!_1a86){
- if(_1a85.somethingSelected()){
- _1a85.broadcastSelectionFilter();
- }
- }
- _1a85.updateDrillThroughLinks();
- _1a85.fireEvent("com.ibm.bux.widget.modified",null,{"modified":true});
- };
- function SharePromptAction(){
- this.m_bAbortAction=true;
- };
- SharePromptAction.prototype=new RunReportAction();
- SharePromptAction.prototype.preProcess=function(){
- var cv=this.getCognosViewer();
- cv.disableRaiseSharePromptEvent();
- };
- SharePromptAction.prototype.setRequestParms=function(_1a88){
- this.m_sharePromptParameters=_1a88.parameters;
- this.m_action="forward";
- };
- SharePromptAction.prototype.parsePromptParameters=function(){
- var _1a89=false;
- var _1a8a=this.getReportParameterNodes();
- if(_1a8a){
- var _1a8b=this.m_sharePromptParameters;
- var _1a8c={};
- var _1a8d=[];
- for(var i in _1a8b){
- var _1a8f=_1a8b[i].parmName;
- var _1a90=_1a8b[i].modelItem;
- var sName=null;
- var _1a92=null;
- var _1a93=false;
- var _1a94={};
- for(var j in _1a8a){
- var _1a96=_1a8a[j].getAttribute("parameterName");
- var _1a97=_1a8a[j].getAttribute("modelItem");
- if((typeof _1a96!=="undefined"&&_1a96===_1a8f)||(typeof _1a97!=="undefined"&&_1a90!=="undefined"&&_1a90!==""&&_1a97===_1a90&&!this.arrayContains(_1a8d,_1a97))){
- _1a89=true;
- sName="p_"+_1a96;
- _1a92=this.getSharedPromptValue(_1a8b[i],_1a8a[j]);
- if(_1a96===_1a8f){
- _1a8c[sName]=_1a92;
- _1a8d.push(_1a97);
- _1a93=false;
- break;
- }else{
- _1a94[sName]=_1a92;
- _1a93=true;
- }
- }
- }
- if(_1a93){
- for(var x in _1a94){
- _1a8c[x]=_1a94[x];
- }
- }
- }
- if(_1a89){
- this.m_bAbortAction=false;
- this.m_promptValues=_1a8c;
- }
- }
- return _1a89;
- };
- SharePromptAction.prototype.getSharedPromptValue=function(_1a99,_1a9a){
- var _1a9b=null;
- var _1a9c=_1a99.parmValue;
- var _1a9d=this._isPromptParamMultiValued(_1a99.multivalued,_1a9c);
- var _1a9e=new RegExp(/^<selectChoices><selectOption/);
- if(_1a9d&&_1a9a.getAttribute("multivalued")==null&&_1a9c.match(_1a9e)){
- var _1a9f=new RegExp(/^(<selectChoices><selectOption.*?><)/);
- var _1aa0=_1a9f.exec(_1a9c);
- _1a9b=_1aa0[1]+"/selectChoices>";
- }else{
- _1a9b=_1a9c;
- }
- return _1a9b;
- };
- SharePromptAction.prototype.arrayContains=function(array,value){
- var found=false;
- for(var i=0;i<array.length;i++){
- if(array[i]===value){
- found=true;
- break;
- }
- }
- return found;
- };
- SharePromptAction.prototype.getPromptValues=function(){
- if(!this.m_promptValues){
- this.parsePromptParameters();
- }
- return this.m_promptValues;
- };
- SharePromptAction.prototype._isPromptParamMultiValued=function(_1aa5,_1aa6){
- var _1aa7=false;
- if(_1aa5!="undefined"&&_1aa5){
- _1aa7=true;
- }else{
- var _1aa8=new RegExp(/^<selectChoices><selectOption.*?>\s*<selectOption/);
- if(_1aa6.match(_1aa8)){
- _1aa7=true;
- }
- }
- return _1aa7;
- };
- SharePromptAction.prototype.getReportParameterNodes=function(){
- var cv=this.getCognosViewer();
- var _1aaa=null;
- try{
- if(cv.envParams&&cv.envParams.reportPrompts){
- var _1aab=cv.envParams.reportPrompts;
- var _1aac=XMLBuilderLoadXMLFromString(_1aab);
- if(!(_1aac&&_1aac.childNodes&&_1aac.childNodes.length>0&&_1aac.childNodes[0].nodeName==="parsererror")){
- var _1aad=_1aac.firstChild;
- var _1aae=XMLHelper_FindChildByTagName(_1aad,"reportParameters",true);
- _1aaa=XMLHelper_FindChildrenByTagName(_1aae,"reportParameter",false);
- }
- }
- }
- catch(e){
- }
- return _1aaa;
- };
- SharePromptAction.prototype.executePrompt=function(){
- if(this.getPromptValues()!==null){
- this.execute();
- return true;
- }
- return false;
- };
- function SnapshotsAction(){
- };
- SnapshotsAction.prototype=new CognosViewerAction();
- SnapshotsAction.prototype.updateMenu=function(_1aaf){
- var _1ab0=this.m_oCV.getViewerWidget();
- _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;
- _1aaf.visible=!this.isPromptWidget();
- return _1aaf;
- };
- SnapshotsAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- var _1ab2=oCV.getViewerWidget();
- if(_1ab2.getSavedOutputsCMResponse()==null){
- this.queryCMForSavedOutputs({"complete":{"object":this,"method":this.handleQueryResponse}});
- }else{
- if(typeof _1ab2.savedOutputMenuUpdated!="undefined"&&_1ab2.savedOutputMenuUpdated==false){
- this.populateMenu(true);
- _1ab2.savedOutputMenuUpdated=true;
- }
- }
- };
- SnapshotsAction.prototype.queryCMForSavedOutputs=function(_1ab3){
- var oCV=this.getCognosViewer();
- var _1ab5=oCV.getViewerWidget();
- var _1ab6="";
- var _1ab7=document.getElementById("formWarpRequest"+oCV.getId());
- if(oCV.envParams["originalReport"]){
- _1ab6=oCV.envParams["originalReport"];
- }else{
- if(_1ab7&&_1ab7["reRunObj"]!=null&&_1ab7["reRunObj"].value.length>0){
- _1ab6=_1ab7["reRunObj"].value;
- }else{
- _1ab6=oCV.envParams["ui.object"];
- }
- }
- _1ab6+="/reportVersion/*[@format='HTML' or @format='XHTML']/..";
- 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>";
- var _1ab9=new DataDispatcherEntry(oCV);
- _1ab9.addFormField("ui.action","CMRequest");
- _1ab9.addFormField("cv.responseFormat","CMRequest");
- _1ab9.addFormField("ui.object",_1ab6);
- _1ab9.addFormField("CMRequest",_1ab8);
- _1ab9.setCallbacks(_1ab3);
- oCV.dispatchRequest(_1ab9);
- };
- SnapshotsAction.prototype.setSavedOutputsCMResponse=function(_1aba){
- var oCV=this.getCognosViewer();
- var _1abc=oCV.getViewerWidget();
- var _1abd=XMLBuilderLoadXMLFromString(_1aba.getResult());
- _1abc.setSavedOutputsCMResponse(_1abd);
- };
- SnapshotsAction.prototype.handleQueryResponse=function(_1abe){
- this.setSavedOutputsCMResponse(_1abe);
- this.populateMenu(true);
- };
- SnapshotsAction.prototype.canShowLiveMenuItem=function(){
- var oCV=this.getCognosViewer();
- return (oCV.envParams["cv.responseFormat"]!=="activeReport"&&(oCV.isLimitedInteractiveMode()||(oCV.envParams["cv.objectPermissions"]&&oCV.envParams["cv.objectPermissions"].indexOf("execute")!=-1)));
- };
- SnapshotsAction.prototype.getMenuItemActionClassHandler=function(){
- var oCV=this.getCognosViewer();
- return oCV.envParams["cv.responseFormat"]==="activeReport"?"ViewActiveReport":"ViewSavedOutput";
- };
- SnapshotsAction.prototype.populateMenu=function(bOpen){
- var oCV=this.getCognosViewer();
- var _1ac3=oCV.getViewerWidget();
- var _1ac4=oCV.envParams["ui.action"];
- var _1ac5=_1ac3.savedOutputsCMResponse;
- var root=oCV.findBlueDotMenu();
- root.open=bOpen;
- var _1ac7=oCV.findToolbarItem("Snapshots",root);
- var _1ac8=XMLHelper_FindChildByTagName(_1ac5,"result",true);
- var _1ac9=XMLHelper_FindChildrenByTagName(_1ac8,"item",false);
- var _1aca=[];
- var _1acb=null;
- var _1acc=null;
- var _1acd=null;
- var _1ace;
- if(this.canShowLiveMenuItem()){
- _1ace=(_1ac4!="view"&&_1ac4!="buxView"&&oCV.getStatus()!=="fault");
- _1acd={name:"live",label:RV_RES.IDS_JS_SNAPSHOTS_LIVE,action:_1ace?{}:{name:"RunSavedOutputReport",payload:{}},items:null};
- this.addMenuItemChecked(_1ace,_1acd);
- _1aca.push(_1acd);
- if(_1ac9.length>0){
- _1aca.push({separator:true});
- }
- }
- if(_1ac9.length>0){
- var _1acf=this.getMenuItemActionClassHandler();
- var _1ad0=[];
- for(var _1ad1=0;_1ad1<_1ac9.length;_1ad1++){
- if(_1ad1<5){
- var _1ad2=_1ac9[_1ad1];
- var _1ad3=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad2,"creationTime_localized",true));
- _1ad3=enforceTextDir(_1ad3);
- var _1ad4=XMLHelper_FindChildByTagName(_1ad2,"storeID",true);
- var _1ad5=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad4,"value",true));
- var _1ad6=XMLHelper_FindChildByTagName(_1ad2,"creationTime",true);
- var _1ad7=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1ad6,"value",true));
- if(_1acb==null){
- _1acb=_1ad7;
- _1acc=_1ad5;
- }
- _1ace=(_1ac4=="view"||_1ac4=="buxView")&&oCV.envParams["creationTime"]==_1ad7&&_1ac3.getSavedOutputSearchPath()!=null;
- _1acd={name:"savedOutput",label:_1ad3,action:_1ace?{}:{name:_1acf,payload:{obj:_1ad5,creationTime:_1ad7,mostRecent:false}},items:null};
- this.addMenuItemChecked(_1ace,_1acd);
- _1ad0.push(_1acd);
- }else{
- _1ad0.push({name:"viewAllSnapshots",label:RV_RES.IDS_JS_VIEW_ALL_SNAPSHOTS,action:{name:"ViewAllSnapshots",payload:{}},items:null});
- break;
- }
- }
- _1ace=false;
- if(_1ac3.getSavedOutputSearchPath()==null&&(_1ac4=="view"||_1ac4=="buxView")){
- _1ace=true;
- }
- _1acd={name:"savedOutput",label:RV_RES.IDS_JS_MOST_RECENT_SNAPSHOT,action:_1ace?{}:{name:_1acf,payload:{obj:_1acc,creationTime:_1acb,mostRecent:true}},items:null};
- this.addMenuItemChecked(_1ace,_1acd);
- _1aca.push(_1acd);
- _1aca.push({separator:true});
- _1aca=_1aca.concat(_1ad0);
- }
- _1ac7.open=bOpen;
- _1ac7.items=_1aca;
- var _1ad8=[];
- _1ad8.push(_1ac7);
- _1ac3.fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1ad8);
- };
- SnapshotsAction.prototype.resetMenu=function(bOpen){
- var oCV=this.getCognosViewer();
- var _1adb=oCV.getViewerWidget();
- var root=oCV.findBlueDotMenu();
- var _1add=oCV.findToolbarItem("Snapshots",root);
- if(_1add){
- _1add.open=false;
- var _1ade=[{name:"loadng",label:RV_RES.GOTO_LOADING,iconClass:"loading"}];
- _1add.items=_1ade;
- var _1adf=[_1add];
- _1adb.fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1adf);
- }
- };
- function SwapRowsAndColumnsAction(){
- this.m_sAction="SwapRowsAndColumns";
- };
- SwapRowsAndColumnsAction.prototype=new ModifyReportAction();
- SwapRowsAndColumnsAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_SWAP_ROWS_AND_COLUMNS;
- };
- SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported={winLossChart:true,progressiveChart:true,list:true};
- SwapRowsAndColumnsAction.prototype.canSwap=function(){
- if(this.reportHasOneObjectOnly()){
- return this.isCurrentObject_singlePart_SupportedChartOrCrosstab();
- }else{
- return this.isSelectedObject_SupportedChartOrCrosstab();
- }
- };
- SwapRowsAndColumnsAction.prototype.reportHasOneObjectOnly=function(){
- var _1ae0=this.m_oCV.getRAPReportInfo();
- if(_1ae0){
- return (_1ae0.getContainerCount()==1);
- }
- return false;
- };
- SwapRowsAndColumnsAction.prototype.isSelectedObject_SupportedChartOrCrosstab=function(){
- var _1ae1=this.getSelectedReportInfo();
- return (_1ae1&&!SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported[_1ae1.displayTypeId]);
- };
- SwapRowsAndColumnsAction.prototype.isCurrentObject_singlePart_SupportedChartOrCrosstab=function(){
- var _1ae2=this.m_oCV.getRAPReportInfo();
- if(_1ae2){
- if(_1ae2.getContainerCount()===1){
- var _1ae3=_1ae2.getContainerFromPos(0).displayTypeId;
- if(_1ae3&&!SwapRowsAndColumnsAction.M_oDisplayTypeIsUnsupported[_1ae3]){
- return true;
- }
- }
- }
- return false;
- };
- SwapRowsAndColumnsAction.prototype.keepRAPCache=function(){
- return false;
- };
- SwapRowsAndColumnsAction.prototype.updateMenu=function(_1ae4){
- _1ae4.visible=this.ifContainsInteractiveDataContainer();
- if(!_1ae4.visible){
- return _1ae4;
- }
- _1ae4.disabled=!this.canSwap();
- _1ae4.iconClass=_1ae4.disabled?"disabledSwap":"swap";
- return _1ae4;
- };
- function UndoRedoAction(){
- };
- UndoRedoAction.prototype=new CognosViewerAction();
- UndoRedoAction.prototype.dispatchRequest=function(_1ae5,_1ae6){
- var _1ae7=null;
- var _1ae8=null;
- var _1ae9=this.getUndoRedoQueue();
- if(_1ae6=="Undo"){
- _1ae8=_1ae9.moveBack();
- }else{
- _1ae8=_1ae9.moveForward();
- }
- if(_1ae6=="Undo"&&_1ae8&&_1ae8.undoCallback){
- _1ae8.undoCallback();
- this.getCognosViewer().getViewerWidget().updateToolbar();
- }else{
- if(_1ae6=="Redo"&&_1ae8&&_1ae8.redoCallback){
- _1ae8.redoCallback();
- this.getCognosViewer().getViewerWidget().updateToolbar();
- }else{
- var _1aea=this.getCognosViewer().getViewerWidget().getProperties();
- if(_1aea&&_1ae8.widgetProperties){
- _1aea.doUndo(_1ae8.widgetProperties);
- }
- var _1ae7=new ViewerDispatcherEntry(this.getCognosViewer());
- if(typeof _1ae8.spec!="undefined"){
- _1ae7.addFormField("ui.action","undoRedo");
- _1ae7.addFormField("ui.spec",_1ae8.spec);
- _1ae7.addFormField("executionParameters",_1ae8.parameters);
- }else{
- _1ae7.addFormField("ui.action","undoRedo");
- _1ae7.addFormField("ui.conversation",_1ae8.conversation);
- }
- if(typeof _1ae8.hasAVSChart!="undefined"){
- _1ae7.addFormField("hasAVSChart",_1ae8.hasAVSChart);
- }
- if(_1aea&&_1aea.getRowsPerPage()!=null){
- _1ae7.addFormField("run.verticalElements",_1aea.getRowsPerPage());
- }
- if(_1ae5!=""){
- _1ae7.addFormField("cv.updateDataFilters",_1ae5);
- }
- if(typeof _1ae8.infoBar=="string"){
- _1ae7.addFormField("rap.reportInfo",_1ae8.infoBar);
- }else{
- _1ae7.addFormField("rap.reportInfo","{}");
- }
- _1ae7.addFormField("run.prompt","false");
- _1ae7.setCallbacks({"closeErrorDlg":{"object":_1ae9,"method":_1ae9.handleCancel}});
- this.getCognosViewer().dispatchRequest(_1ae7);
- }
- }
- this.fireModifiedReportEvent();
- };
- UndoRedoAction.prototype.execute=function(){
- this.gatherFilterInfoBeforeAction(this.m_sAction);
- };
- function UndoAction(){
- this.m_sAction="Undo";
- };
- UndoAction.prototype=new UndoRedoAction();
- UndoAction.prototype.updateMenu=function(_1aeb){
- _1aeb.visible=this.getCognosViewer().isLimitedInteractiveMode()?true:this.ifContainsInteractiveDataContainer();
- if(!_1aeb.visible){
- return _1aeb;
- }
- if(this.getUndoRedoQueue().getPosition()>0){
- _1aeb.iconClass="undo";
- _1aeb.disabled=false;
- }else{
- _1aeb.iconClass="undoDisabled";
- _1aeb.disabled=true;
- }
- _1aeb.label=this.getUndoRedoQueue().getUndoTooltip();
- return _1aeb;
- };
- function RedoAction(){
- this.m_sAction="Redo";
- };
- RedoAction.prototype=new UndoRedoAction();
- RedoAction.prototype.updateMenu=function(_1aec){
- _1aec.visible=this.getCognosViewer().isLimitedInteractiveMode()?true:this.ifContainsInteractiveDataContainer();
- if(!_1aec.visible){
- return _1aec;
- }
- if(this.getUndoRedoQueue().getPosition()<(this.getUndoRedoQueue().getLength()-1)){
- _1aec.iconClass="redo";
- _1aec.disabled=false;
- }else{
- _1aec.iconClass="redoDisabled";
- _1aec.disabled=true;
- }
- _1aec.label=this.getUndoRedoQueue().getRedoTooltip();
- return _1aec;
- };
- function ViewAllSnapshotsAction(){
- };
- ViewAllSnapshotsAction.prototype=new SnapshotsAction();
- ViewAllSnapshotsAction.prototype.updateMenu=function(_1aed){
- var oCV=this.getCognosViewer();
- var _1aef=oCV.getViewerWidget();
- if(_1aef.m_bNoSavedOutputs==true){
- _1aed.disabled=true;
- }
- return _1aed;
- };
- ViewAllSnapshotsAction.prototype.execute=function(){
- if(!this.getCognosViewer().getViewerWidget().getSavedOutputsCMResponse()){
- this.queryCMForSavedOutputs({"complete":{"object":this,"method":this.handleQueryResponse}});
- }else{
- this.showDialog();
- }
- };
- ViewAllSnapshotsAction.prototype.handleQueryResponse=function(_1af0){
- this.setSavedOutputsCMResponse(_1af0);
- this.showDialog();
- };
- ViewAllSnapshotsAction.prototype.showDialog=function(){
- var oCV=this.getCognosViewer();
- var _1af2=oCV.getViewerWidget();
- var _1af3=_1af2.getSavedOutputsCMResponse();
- var _1af4=null;
- var _1af5=null;
- if(_1af3){
- _1af4=XMLHelper_FindChildByTagName(_1af3,"result",true);
- if(_1af4){
- _1af5=XMLHelper_FindChildrenByTagName(_1af4,"item",false);
- }
- }
- if(!_1af3||!_1af5||_1af5.length==0){
- _1af2.m_bNoSavedOutputs=true;
- var _1af6=new WarningMessageDialog(oCV,RV_RES.IDS_JS_NO_SAVED_OUTPUTS);
- _1af6.renderInlineDialog();
- }else{
- var _1af7=getCognosViewerObjectString(this.m_oCV.getId());
- var _1af8=RV_RES.IDS_JS_SELECT_SNAPSHOT_DIALOG_TITLE;
- var _1af9=RV_RES.IDS_JS_SELECT_SNAPSHOT_DIALOG_DESC;
- var _1afa=this.getCognosViewer().envParams["creationTime"];
- this.selectSnapshotDialog=new viewer.dialogs.SelectSnapshot({sTitle:_1af8,sLabel:_1af9,cmResponse:_1af3,currentSnapshotCreationTime:_1afa,okHandler:function(_1afb,_1afc){
- window[_1af7].executeAction("ViewSavedOutput",{obj:_1afb,creationTime:_1afc});
- },cancelHandler:function(){
- }});
- this.selectSnapshotDialog.startup();
- this.selectSnapshotDialog.show();
- }
- };
- function ViewOriginalLabelAction(){
- };
- ViewOriginalLabelAction.prototype=new CognosViewerAction();
- ViewOriginalLabelAction.prototype.getCellRef=function(){
- return this.m_oCV.getSelectionController().getSelections()[0].getCellRef();
- };
- ViewOriginalLabelAction.prototype.updateMenu=function(_1afd){
- if(this.getNumberOfSelections()==1){
- var _1afe=this.getCellRef();
- if(_1afe.getAttribute("rp_name")){
- var _1aff=[];
- _1aff.push({name:"originalLabel",label:_1afe.getAttribute("rp_name"),iconClass:"",action:null,items:null});
- _1afd.items=_1aff;
- return _1afd;
- }
- }
- return "";
- };
- function ViewSavedOutputAction(){
- this.m_obj="";
- this.creationTime="";
- this.m_mostRecent=false;
- };
- ViewSavedOutputAction.prototype=new CognosViewerAction();
- ViewSavedOutputAction.prototype.addAdditionalRequestParms=function(_1b00){
- };
- ViewSavedOutputAction.prototype.setRequestParms=function(_1b01){
- this.m_obj=_1b01.obj;
- this.creationTime=_1b01.creationTime;
- this.m_mostRecent=_1b01.mostRecent;
- };
- ViewSavedOutputAction.prototype.updateMenu=function(){
- var _1b02=this.getCognosViewer().getAction("Snapshots");
- _1b02.populateMenu(false);
- };
- ViewSavedOutputAction.prototype.execute=function(){
- var _1b03=this.getCognosViewer();
- var _1b04=_1b03.getViewerWidget();
- if(_1b03.getStatus()==="fault"){
- _1b04.clearErrorDlg();
- }
- _1b03.getViewerWidget().setPromptParametersRetrieved(false);
- _1b03.envParams["reportPrompts"]="";
- var _1b05=_1b03.envParams["ui.action"];
- var _1b06=document.getElementById("formWarpRequest"+_1b03.getId());
- if(_1b05=="view"&&_1b06&&_1b06.reRunObj&&_1b06.reRunObj.value){
- _1b03.envParams["ui.reRunObj"]=_1b06["reRunObj"].value;
- }else{
- if(_1b05!="view"){
- _1b03.envParams["ui.reRunObj"]=_1b03.envParams["ui.object"];
- }
- }
- var _1b07="storeID('"+this.m_obj+"')";
- _1b03.envParams["ui.action"]="buxView";
- _1b03.envParams["ui.object"]=_1b03.envParams["ui.reRunObj"];
- _1b03.envParams["creationTime"]=this.creationTime;
- if(this.m_mostRecent===true){
- _1b04.setSavedOutputSearchPath(null);
- }else{
- _1b04.setSavedOutputSearchPath(_1b07);
- }
- this.updateMenu();
- this.getUndoRedoQueue().clearQueue();
- _1b03.getViewerWidget().clearPropertiesDialog();
- if(_1b03.getCurrentlySelectedTab()&&_1b04.getSavedOutput()){
- _1b03.setKeepTabSelected(_1b03.getCurrentlySelectedTab());
- }
- this.dispatchRequest(_1b07);
- this.fireModifiedReportEvent();
- };
- ViewSavedOutputAction.prototype.dispatchRequest=function(_1b08){
- this.m_request=new ViewerDispatcherEntry(this.m_oCV);
- this.m_request.addFormField("ui.action","buxView");
- this.m_request.addFormField("ui.name",this.m_oCV.envParams["ui.name"]);
- this.m_request.addFormField("widget.reloadToolbar","true");
- this.m_request.addFormField("cv.objectPermissions",this.m_oCV.envParams["cv.objectPermissions"]);
- this.m_request.addFormField("ui.savedOutputSearchPath",_1b08);
- this.m_request.setCallbacks({"complete":{"object":this,"method":this.onComplete}});
- this.addAdditionalRequestParms(this.m_request);
- this.m_oCV.dispatchRequest(this.m_request);
- };
- ViewSavedOutputAction.prototype.onComplete=function(_1b09,arg1){
- this.m_oCV.setTracking("");
- this.m_oCV.setConversation("");
- this.m_request.onComplete(_1b09,arg1);
- };
- function WatchNewVersionsAction(){
- this.m_requestParms={subAction:""};
- };
- WatchNewVersionsAction.prototype=new CognosViewerAction();
- WatchNewVersionsAction.prototype.setRequestParms=function(_1b0b){
- this.m_requestParms=_1b0b;
- };
- WatchNewVersionsAction.prototype.execute=function(){
- var _1b0c=this.m_oCV.getSubscriptionManager();
- switch(this.m_requestParms.subAction){
- case "loadMenu":
- this.loadMenu(this.m_requestParms.contextMenu);
- break;
- case "close":
- this.closeMenu();
- break;
- case "DeleteNotification":
- _1b0c.DeleteNotification();
- break;
- case "AddNotification":
- _1b0c.AddNotification();
- break;
- case "NewSubscription":
- _1b0c.NewSubscription();
- break;
- case "ModifySubscription":
- _1b0c.ModifySubscription(this.m_requestParms.subscriptionId);
- break;
- case "DeleteSubscription":
- _1b0c.DeleteSubscription(this.m_requestParms.subscriptionId);
- break;
- }
- };
- WatchNewVersionsAction.prototype.closeMenu=function(){
- var _1b0d=this.m_oCV.findToolbarItem("WatchNewVersions");
- this.resetMenu(_1b0d);
- var _1b0e=getCognosViewerObjectRefAsString(this.m_oCV.getId());
- setTimeout(_1b0e+".getViewerWidget().fireEvent(\"com.ibm.bux.widgetchrome.toolbar.update\", null, ["+_1b0e+".findToolbarItem(\"WatchNewVersions\")]);",1);
- };
- WatchNewVersionsAction.prototype.resetMenu=function(_1b0f){
- _1b0f.open=false;
- _1b0f.action={name:"WatchNewVersions",payload:{subAction:"loadMenu",contextMenu:false}};
- _1b0f.closeAction=null;
- var _1b10=[];
- _1b10.push({name:"loadng",label:RV_RES.GOTO_LOADING,iconClass:"loading"});
- _1b0f.items=_1b10;
- };
- WatchNewVersionsAction.prototype.updateMenu=function(_1b11){
- var items=_1b11.items;
- var _1b13=this.m_oCV.getSubscriptionManager();
- if(!items||items.length===0){
- _1b11.visible=_1b13.CanCreateNewWatchRule();
- _1b11.disabled=!(_1b13.IsValidSelectionForNewRule());
- }else{
- this.resetMenu(_1b11);
- }
- return _1b11;
- };
- WatchNewVersionsAction.prototype.loadMenu=function(_1b14){
- var _1b15=this.m_oCV.getSubscriptionManager();
- var cvId=this.m_oCV.getId();
- var oCV=this.m_oCV;
- var _1b18=new JSONDispatcherEntry(oCV);
- _1b18.addFormField("ui.action","getSubscriptionInfo");
- _1b18.addFormField("cv.responseFormat","subscriptionManager");
- _1b18.addFormField("contextMenu",_1b14==true?"true":"false");
- _1b15.addCommonFormFields(_1b18,"");
- _1b18.setCallbacks({"complete":{"object":this,"method":this.openSubscriptionMenuResponse}});
- oCV.dispatchRequest(_1b18);
- };
- WatchNewVersionsAction.prototype.openSubscriptionMenuResponse=function(_1b19){
- var _1b1a=this.m_oCV.getSubscriptionManager();
- _1b1a.Initialize(_1b19);
- var _1b1b=[];
- _1b1a.ClearSubscriptionMenu();
- var _1b1c=false;
- if(_1b1a.CanGetNotified()){
- if(_1b1a.m_sQueryNotificationResponse=="on"){
- _1b1b.push({name:"DeleteNotification",label:RV_RES.RV_DO_NOT_ALERT_NEW_VERSION,iconClass:"deleteNotification",action:{name:"WatchNewVersions",payload:{subAction:"DeleteNotification"}},items:null});
- _1b1c=true;
- }else{
- if(_1b1a.m_sQueryNotificationResponse=="off"&&_1b1a.m_sEmail!=""){
- _1b1b.push({name:"AddNotification",label:RV_RES.RV_ALERT_NEW_VERSION,iconClass:"addNotification",action:{name:"WatchNewVersions",payload:{subAction:"AddNotification"}},items:null});
- _1b1c=true;
- }
- }
- }
- if(_1b1a.CanCreateNewWatchRule()){
- if(_1b1c){
- _1b1b.push({separator:true});
- }
- var _1b1d={name:"NewSubscription",label:RV_RES.RV_NEW_WATCH_RULE,iconClass:"newSubscription",action:{name:"WatchNewVersions",payload:{subAction:"NewSubscription"}},items:null};
- if(!_1b1a.IsValidSelectionForNewRule()){
- _1b1d.disabled=true;
- }
- _1b1b.push(_1b1d);
- _1b1c=true;
- }
- var _1b1e="";
- if(typeof this.m_oCV.UIBlacklist!="undefined"){
- _1b1e=this.m_oCV.UIBlacklist;
- }
- if(_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES ")==-1){
- if(_1b1a.m_aWatchRules&&_1b1a.m_aWatchRules.length>0){
- if(_1b1c){
- _1b1b.push({separator:true});
- }
- var _1b1f=_1b1a.CanModifyWatchRule();
- for(var sub=0;sub<_1b1a.m_aWatchRules.length;++sub){
- var menu={name:"WatchRule"+sub,label:_1b1a.m_aWatchRules[sub].name,iconClass:"watchRule",action:null,items:[]};
- if(_1b1f&&_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES_MODIFY ")==-1){
- 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});
- }
- if(_1b1e.indexOf(" RV_TOOLBAR_BUTTONS_RULES_DELETE ")==-1){
- 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});
- }
- _1b1b.push(menu);
- }
- }
- }
- if(_1b1b.length===0){
- _1b1b.push({name:"NoWatchRules",label:RV_RES.RV_NO_WATCH_RULES,iconClass:"",action:null,items:null,disabled:true});
- }
- var _1b22=this.m_oCV.findToolbarItem("WatchNewVersions");
- if(_1b22){
- _1b22.items=_1b1b;
- _1b22.action=null;
- _1b22.open=true;
- _1b22.closeAction={name:"WatchNewVersions",payload:{subAction:"close"}};
- var _1b23=[];
- _1b23.push(_1b22);
- this.m_oCV.getViewerWidget().fireEvent("com.ibm.bux.widgetchrome.toolbar.update",null,_1b23);
- }
- };
- function RunSavedOutputReportAction(){
- };
- RunSavedOutputReportAction.prototype=new CognosViewerAction();
- RunSavedOutputReportAction.prototype.updateMenu=function(_1b24){
- var _1b25=this.m_oCV.envParams["ui.action"];
- var _1b26=(_1b25!="view"&&_1b25!="buxView"&&this.m_oCV.getStatus()!=="fault");
- this.addMenuItemChecked(_1b26,_1b24);
- return _1b24;
- };
- RunSavedOutputReportAction.prototype.dispatchRequest=function(_1b27){
- var _1b28=this.getCognosViewer();
- if(_1b28.envParams["savedReportName"]){
- delete _1b28.envParams["savedReportName"];
- }
- if(_1b28.getStatus()==="fault"){
- var _1b29=this.getCognosViewer().getViewerWidget();
- _1b29.clearErrorDlg();
- }
- var _1b2a=_1b28.envParams["ui.action"];
- var _1b2b=document.getElementById("formWarpRequest"+_1b28.getId());
- if(_1b28.envParams["ui.reRunObj"]){
- _1b28.envParams["ui.object"]=_1b28.envParams["ui.reRunObj"];
- }else{
- if(_1b2a=="view"&&_1b2b&&typeof _1b2b["reRunObj"]!="undefined"&&_1b2b["reRunObj"]!=null&&_1b2b["reRunObj"].value.length>0){
- _1b28.envParams["ui.object"]=_1b2b["reRunObj"].value;
- }
- }
- var oReq=new ViewerDispatcherEntry(_1b28);
- oReq.addFormField("ui.action","bux");
- oReq.addFormField("widget.runFromSavedOutput","true");
- oReq.addFormField("ui.object",_1b28.envParams["ui.object"]);
- oReq.addFormField("run.outputFormat","HTML");
- oReq.addFormField("ui.primaryAction","");
- oReq.addFormField("widget.reloadToolbar","true");
- oReq.addDefinedNonNullFormField("cv.objectPermissions",_1b28.envParams["cv.objectPermissions"]);
- oReq.addDefinedNonNullFormField("run.prompt",_1b28.envParams["promptOnRerun"]);
- oReq.addDefinedNonNullFormField("limitedInteractiveMode",_1b28.envParams["limitedInteractiveMode"]);
- oReq.addDefinedNonNullFormField("widget.globalPromptInfo",_1b28.getViewerWidget().getGlobalPromptsInfo());
- oReq.addDefinedNonNullFormField("baseReportSearchPath",_1b28.envParams["baseReportSearchPath"]);
- oReq.addNonEmptyStringFormField("cv.updateDataFilters",_1b27);
- _1b28.getViewerWidget().clearPropertiesDialog();
- _1b28.preparePromptValues(oReq);
- _1b28.dispatchRequest(oReq);
- this.fireModifiedReportEvent();
- _1b28.envParams["ui.action"]="run";
- };
- RunSavedOutputReportAction.prototype.execute=function(){
- this.gatherFilterInfoBeforeAction("RunSavedOutputReport");
- };
- function InvokeChangeDisplayTypeDialogAction(){
- };
- InvokeChangeDisplayTypeDialogAction.prototype=new CognosViewerAction();
- InvokeChangeDisplayTypeDialogAction.prototype.execute=function(){
- var _1b2d=this.getCognosViewer();
- var _1b2e=this.getSelectedReportInfo();
- if(_1b2e){
- var _1b2f=_1b2d.getViewerWidget();
- var _1b30=false;
- if(_1b2e.suggestedDisplayTypesEnabled==true){
- _1b30=(typeof _1b2e.possibleDisplayTypes=="undefined")||(typeof _1b2e.suggestedDisplayTypes=="undefined")?true:false;
- }else{
- _1b30=(typeof _1b2e.possibleDisplayTypes=="undefined");
- }
- if(_1b30){
- var _1b31=new AsynchJSONDispatcherEntry(this.m_oCV);
- _1b31.setCallbacks({"complete":{"object":this,"method":this.handleResponse}});
- _1b31.setRequestIndicator(_1b2d.getRequestIndicator());
- _1b31.addFormField("ui.action","getInfoFromReportSpec");
- _1b31.addFormField("bux","true");
- _1b31.addNonEmptyStringFormField("modelPath",this.m_oCV.getModelPath());
- _1b31.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- _1b31.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- _1b31.addFormField("cv.actionContext",this.addActionContext());
- _1b31.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
- _1b2d.dispatchRequest(_1b31);
- }else{
- _1b2f.invokeDisplayTypeDialog(_1b2e.possibleDisplayTypes,_1b2e.suggestedDisplayTypes);
- }
- }
- };
- InvokeChangeDisplayTypeDialogAction.prototype.handleResponse=function(_1b32){
- var _1b33=this.getCognosViewer();
- var _1b34=_1b33.getViewerWidget();
- var _1b35=_1b32.getResult();
- for(var i in _1b35.containers){
- var _1b37=this.getReportInfo(_1b35.containers[i].container);
- _1b37.possibleDisplayTypes=_1b35.containers[i].possibleDisplayTypes;
- _1b37.suggestedDisplayTypes=_1b35.containers[i].suggestedDisplayTypes;
- }
- var _1b38=this.getSelectedReportInfo();
- _1b34.invokeDisplayTypeDialog(_1b38.possibleDisplayTypes,_1b38.suggestedDisplayTypes);
- };
- InvokeChangeDisplayTypeDialogAction.prototype.addActionContext=function(){
- var _1b39="<getInfoActions>";
- _1b39+="<getInfoAction name=\"GetInfo\">";
- _1b39+="<include><possibleDisplayTypes/></include>";
- _1b39+="<include><suggestedDisplayTypes/></include>";
- _1b39+=this.getDataItemInfoMap();
- _1b39+=this.addClientContextData(3);
- _1b39+="</getInfoAction>";
- _1b39+="</getInfoActions>";
- return _1b39;
- };
- InvokeChangeDisplayTypeDialogAction.prototype.updateMenu=function(_1b3a){
- var _1b3b=this.getCognosViewer().getRAPReportInfo();
- _1b3a.visible=_1b3b.containsInteractiveDataContainer();
- if(!_1b3a.visible){
- return _1b3a;
- }
- var _1b3c=this.getSelectedReportInfo();
- _1b3a.disabled=(_1b3c==null||_1b3c.displayTypeId==null||!this.isInteractiveDataContainer(_1b3c.displayTypeId));
- if(_1b3a.disabled){
- _1b3a.iconClass="chartTypesDisabled";
- return _1b3a;
- }
- _1b3a.iconClass="chartTypes";
- return _1b3a;
- };
- function GotoAction(){
- };
- GotoAction.prototype=new CognosViewerAction();
- GotoAction.prototype.execute=function(){
- var _1b3d=this.m_oCV.getDrillMgr();
- _1b3d.launchGoToPage();
- };
- GotoAction.prototype.updateMenu=function(_1b3e){
- var items=[];
- var _1b40=this.m_oCV.getDrillTargets();
- var _1b41=this.m_oCV.getDrillMgr();
- var _1b42=_1b41.getAuthoredDrillThroughTargets();
- if(_1b42.length>0){
- var _1b43="<AuthoredDrillTargets>";
- for(var _1b44=0;_1b44<_1b42.length;++_1b44){
- _1b43+=eval("\""+_1b42[_1b44]+"\"");
- }
- _1b43+="</AuthoredDrillTargets>";
- var _1b45=this.m_oCV.getAction("AuthoredDrill");
- var _1b46=_1b45.getAuthoredDrillThroughContext(_1b43,_1b40);
- var _1b47=_1b46.childNodes;
- if(_1b47.length>0){
- for(var index=0;index<_1b47.length;++index){
- var _1b49=_1b47[index];
- var _1b4a=this.getTargetReportIconClass(_1b49);
- var _1b4b=_1b49.getAttribute("label");
- items.push({name:"AuthoredDrill",label:_1b4b,iconClass:_1b4a,action:{name:"AuthoredDrill",payload:XMLBuilderSerializeNode(_1b49)},items:null});
- }
- }
- }
- if(items.length>0){
- items.push({separator:true});
- }
- var _1b4c=false;
- if(this.m_oCV.getSelectionController()==null||this.m_oCV.getSelectionController().getModelDrillThroughEnabled()==false){
- _1b4c=true;
- }
- items.push({name:"Goto",disabled:_1b4c,label:RV_RES.RV_MORE,iconClass:"",action:{name:"Goto",payload:""},items:null});
- if(this.m_oCV.isIWidgetMobile()){
- _1b3e.flatten="true";
- }
- _1b3e.items=items;
- return _1b3e;
- };
- GotoAction.prototype.getTargetReportIconClass=function(_1b4d){
- var _1b4e="";
- var _1b4f=_1b4d.getAttribute("method");
- switch(_1b4f){
- case "edit":
- _1b4e="editContent";
- break;
- case "execute":
- _1b4e="runReport";
- break;
- case "view":
- var _1b50=_1b4d.getAttribute("outputFormat");
- switch(_1b50){
- case "HTML":
- case "XHTML":
- case "HTMLFragment":
- _1b4e="html";
- break;
- case "PDF":
- _1b4e="pdf";
- break;
- case "XML":
- _1b4e="xml";
- break;
- case "CSV":
- _1b4e="csv";
- break;
- case "XLS":
- _1b4e="excel2000";
- break;
- case "SingleXLS":
- _1b4e="excelSingleSheet";
- break;
- case "XLWA":
- _1b4e="excel2002";
- break;
- case "spreadsheetML":
- _1b4e="excel2007";
- break;
- case "xlsxData":
- _1b4e="excel2007";
- break;
- }
- break;
- }
- return _1b4e;
- };
- function AnnotationAction(){
- };
- AnnotationAction.prototype=new CognosViewerAction();
- AnnotationAction.prototype.updateMenu=function(_1b51){
- var _1b52=this.m_oCV.getViewerWidget();
- var _1b53=this.m_oCV.aBuxAnnotations;
- var _1b54=[];
- for(var _1b55=0;_1b55<_1b53.length;_1b55++){
- var ann=eval("new "+_1b53[_1b55]+"()");
- ann.setCognosViewer(this.m_oCV);
- if(ann&&ann.isEnabled(_1b51.placeType)){
- var _1b57={};
- _1b57.name=_1b53[_1b55];
- _1b57.label=ann.getMenuItemString(_1b52.getAttributeValue("itemName"));
- _1b57.action={};
- _1b57.action.name=_1b53[_1b55];
- _1b57.action.payload="";
- _1b57.items=null;
- _1b57.iconClass=ann.getMenuItemIconClass();
- _1b54.push(_1b57);
- }
- }
- _1b51.items=_1b54;
- _1b51.disabled=!(_1b51.items&&_1b51.items.length);
- if(_1b51.disabled){
- _1b51.iconClass="disabledAnnotation";
- }else{
- _1b51.iconClass="annotation";
- }
- return _1b51;
- };
- AnnotationAction.prototype.execute=function(){
- var _1b58=this.getCognosViewer();
- var _1b59=_1b58.getSelectionController();
- var _1b5a=_1b59.getSelections();
- if(_1b5a&&_1b5a.length==1){
- var _1b5b=_1b58.getViewerWidget();
- if(_1b5b){
- this.executeAction(_1b58,_1b5b,_1b5a[0]);
- }
- }
- };
- AnnotationAction.prototype.executeAction=function(_1b5c,_1b5d,_1b5e){
- };
- function DeleteWidgetAnnotationAction(){
- };
- DeleteWidgetAnnotationAction.prototype=new AnnotationAction();
- DeleteWidgetAnnotationAction.prototype.execute=function(){
- var _1b5f=this.getCognosViewer();
- var _1b60=_1b5f.getViewerWidget();
- if(_1b60){
- _1b60.getAnnotationHelper().deleteWidgetComment();
- }
- };
- function EditWidgetAnnotationAction(){
- };
- EditWidgetAnnotationAction.prototype=new AnnotationAction();
- EditWidgetAnnotationAction.prototype.execute=function(){
- var _1b61=this.getCognosViewer();
- var _1b62=_1b61.getViewerWidget();
- if(_1b62){
- window.setTimeout(function(){
- _1b62.getAnnotationHelper().editWidgetComment();
- },0);
- }
- };
- function NewWidgetAnnotationAction(){
- };
- NewWidgetAnnotationAction.prototype=new AnnotationAction();
- NewWidgetAnnotationAction.prototype.execute=function(){
- var _1b63=this.getCognosViewer();
- var _1b64=_1b63.getViewerWidget();
- if(_1b64){
- _1b64.getAnnotationHelper().addWidgetComment();
- }
- };
- function DeleteAnnotationAction(){
- };
- DeleteAnnotationAction.prototype=new AnnotationAction();
- DeleteAnnotationAction.prototype.executeAction=function(_1b65,_1b66,_1b67){
- if(_1b65&&_1b66&&_1b67){
- var _1b68=_1b67.getCellRef();
- var ctxId=_1b65.findCtx(_1b68);
- _1b66.getAnnotationHelper().deleteComment(ctxId);
- }
- };
- function EditAnnotationAction(){
- };
- EditAnnotationAction.prototype=new AnnotationAction();
- EditAnnotationAction.prototype.executeAction=function(_1b6a,_1b6b,_1b6c){
- if(_1b6a&&_1b6b&&_1b6c){
- var _1b6d=_1b6c.getCellRef();
- var ctxId=_1b6a.findCtx(_1b6d);
- window.setTimeout(function(){
- _1b6b.getAnnotationHelper().editComment(ctxId);
- },0);
- }
- };
- function NewAnnotationAction(){
- };
- NewAnnotationAction.prototype=new AnnotationAction();
- NewAnnotationAction.prototype.executeAction=function(_1b6f,_1b70,_1b71){
- if(_1b6f&&_1b70&&_1b71){
- var _1b72=_1b71.getCellRef();
- var ctxId=_1b6f.findCtx(_1b72);
- var value=_1b71.getDisplayValues()[0];
- window.setTimeout(function(){
- _1b70.getAnnotationHelper().addComment(ctxId,value);
- },0);
- }
- };
- function ExploreWithAAFAction(){
- };
- ExploreWithAAFAction.prototype=new CognosViewerAction();
- ExploreWithAAFAction.prototype.execute=function(){
- window.open(this.m_oCV.getGateway()+this.m_oCV.envParams.aafBaseURL,"_blank");
- };
- function ViewActiveReportAction(){
- };
- ViewActiveReportAction.prototype=new ViewSavedOutputAction();
- ViewActiveReportAction.prototype.addAdditionalRequestParms=function(_1b75){
- _1b75.addFormField("cv.responseFormat","CMRequest");
- _1b75.setCallbacks({"complete":{"object":this,"method":this.handleQueryResponse}});
- };
- ViewActiveReportAction.prototype.handleQueryResponse=function(_1b76){
- var _1b77=this.m_oCV.getViewerWidget();
- _1b77.showLoading();
- var _1b78=XMLBuilderLoadXMLFromString(_1b76.getResult());
- var _1b79=XMLHelper_FindChildByTagName(_1b78,"storeID",true);
- var _1b7a=XMLHelper_GetText(XMLHelper_FindChildByTagName(_1b79,"value",true));
- var _1b7b=dojo.byId(this.m_oCV.getViewerWidget().getIFrameId());
- _1b7b.src=this.m_oCV.getGateway()+"/output/cm/"+_1b7a+"/";
- };
- function RefreshActiveReportAction(){
- this.m_sAction="RefreshActiveReport";
- };
- RefreshActiveReportAction.prototype=new CognosViewerAction();
- RefreshActiveReportAction.prototype.execute=function(){
- var _1b7c=this.m_oCV.getViewerWidget();
- var _1b7d=dojo.byId(_1b7c.getIFrameId());
- var _1b7e=_1b7d.src;
- _1b7d.src=_1b7e;
- _1b7c.showLoading();
- };
- function ExportAction(){
- this.m_format="";
- this.m_responseFormat="";
- };
- ExportAction.prototype=new CognosViewerAction();
- ExportAction.prototype.getWindowTitle=function(){
- return "";
- };
- ExportAction.prototype.execute=function(){
- if(!this.m_format){
- return false;
- }
- this.initializeForm();
- this.insertGenericFormElements();
- this.insertSpecializedFormElements();
- return this.sendRequest();
- };
- ExportAction.prototype.addFormField=function(sName,_1b80){
- if(console){
- console.log("Required method ExportAction.addFormField not implemented");
- }
- };
- ExportAction.prototype.initializeForm=function(){
- if(console){
- console.log("Required method ExportAction.initializeForm not implemented");
- }
- };
- ExportAction.prototype.sendRequest=function(){
- if(console){
- console.log("Required method ExportAction.sendRequest not implemented");
- }
- };
- ExportAction.prototype.insertGenericFormElements=function(){
- var _1b81="false";
- var _1b82="cognosViewer";
- this.addFormField("b_action",_1b82);
- this.addFormField("cv.toolbar","false");
- this.addFormField("cv.header","false");
- this.addFormField("ui.windowtitleformat","chromeless_window_action_format");
- this.addFormField("ui.name",this.getObjectDisplayName());
- this.addFormField("cv.responseFormat",this.m_responseFormat);
- this.addFormField("ui.reuseWindow","true");
- var _1b83=this.m_oCV.envParams["ui.spec"];
- var _1b84=this.m_oCV.getConversation();
- this.addFormField("ui.action","export");
- this.addFormField("ui.conversation",_1b84);
- this.addFormField("run.prompt",_1b81);
- this.addFormField("asynch.attachmentEncoding","base64");
- this.addFormField("run.outputEncapsulation","URLQueryString");
- this.addFormField("ui.spec",_1b83);
- this.addFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
- if(this.m_oCV.envParams["ui.routingServerGroup"]){
- this.addFormField("ui.routingServerGroup",this.m_oCV.envParams["ui.routingServerGroup"]);
- }
- var _1b85=this.m_oCV.getViewerWidget();
- if(_1b85!=null){
- dojo.when(_1b85.getWidgetStoreID(),dojo.hitch(this,function(_1b86){
- if(typeof _1b86!="undefined"&&_1b86!=null){
- this.addFormField("widgetStoreID",_1b86);
- }
- }));
- var _1b87=_1b85.getAttributeValue("gateway");
- if(_1b87){
- this.addFormField("cv.gateway",_1b87);
- }
- var _1b88=_1b85.getAttributeValue("webcontent");
- if(_1b88){
- this.addFormField("cv.webcontent",_1b88);
- }
- }
- this.addFormField("rap.parametersInfo",CViewerCommon.buildParameterValuesSpec(this.m_oCV));
- };
- ExportAction.prototype.insertSpecializedFormElements=function(_1b89){
- this.addFormField("run.outputFormat",this.m_format);
- this.addFormField("ui.windowtitleaction",this.getWindowTitle());
- };
- ExportAction.prototype.updateMenu=function(json){
- json.visible=!this.isPromptWidget();
- if(this.m_oCV.isIWidgetMobile()){
- json.flatten=true;
- }
- return json;
- };
- function ExportFromIframeAction(){
- this.m_format="";
- this.m_responseFormat="downloadObject";
- };
- ExportFromIframeAction.prototype=new ExportAction();
- ExportFromIframeAction.prototype.initializeForm=function(){
- this.oRequest=new HiddenIframeDispatcherEntry(this.getCognosViewer());
- this.addFormField("cv.detachRelease","true");
- };
- ExportFromIframeAction.prototype.addFormField=function(sName,_1b8c){
- this.oRequest.addFormField(sName,_1b8c);
- };
- ExportFromIframeAction.prototype.sendRequest=function(){
- this.getCognosViewer().dispatchRequest(this.oRequest);
- return true;
- };
- function ExportToCSVAction(){
- this.m_format="CSV";
- };
- ExportToCSVAction.prototype=new ExportFromIframeAction();
- ExportToCSVAction.prototype.getWindowTitle=function(){
- return RV_RES.RV_CSV;
- };
- function ExportToExcel2000Action(){
- this.m_format="XLS";
- };
- ExportToExcel2000Action.prototype=new ExportFromIframeAction();
- ExportToExcel2000Action.prototype.getWindowTitle=function(){
- return RV_RES.RV_EXCEL_2000;
- };
- function ExportToExcel2002Action(){
- this.m_format="XLWA";
- };
- ExportToExcel2002Action.prototype=new ExportFromIframeAction();
- ExportToExcel2002Action.prototype.getWindowTitle=function(){
- return RV_RES.RV_EXCEL_2002;
- };
- function ExportToExcel2007Action(){
- this.m_format="spreadsheetML";
- };
- ExportToExcel2007Action.prototype=new ExportFromIframeAction();
- ExportToExcel2007Action.prototype.getWindowTitle=function(){
- return RV_RES.RV_EXCEL_2007;
- };
- function ExportToExcel2007DataAction(){
- this.m_format="xlsxData";
- };
- ExportToExcel2007DataAction.prototype=new ExportFromIframeAction();
- ExportToExcel2007DataAction.prototype.getWindowTitle=function(){
- return RV_RES.RV_EXCEL_2007_DATA;
- };
- function ExportToExcelSingleSheetAction(){
- this.m_format="singleXLS";
- };
- ExportToExcelSingleSheetAction.prototype=new ExportFromIframeAction();
- ExportToExcelSingleSheetAction.prototype.getWindowTitle=function(){
- return RV_RES.RV_EXCEL_2000SF;
- };
- function ExportToPDFAction(){
- this.m_format="PDF";
- };
- ExportToPDFAction.prototype=new ExportFromIframeAction();
- ExportToPDFAction.prototype.getWindowTitle=function(){
- return RV_RES.RV_PDF;
- };
- function ExportToXMLAction(){
- this.m_format="XML";
- };
- ExportToXMLAction.prototype=new ExportFromIframeAction();
- ExportToXMLAction.prototype.getWindowTitle=function(){
- return RV_RES.RV_XML;
- };
- function PrintAsPDFAction(){
- this.m_format="PDF";
- this.m_responseFormat="page";
- };
- PrintAsPDFAction.prototype=new ExportAction();
- PrintAsPDFAction.prototype.getWindowTitle=function(){
- return RV_RES.IDS_PRINT_AS_PDF;
- };
- PrintAsPDFAction.prototype.initializeForm=function(){
- this.nForm=document.createElement("form");
- this.nForm.setAttribute("method","post");
- var _1b8d=location.protocol+"//"+location.host+this.m_oCV.m_sGateway;
- this.nForm.setAttribute("action",_1b8d);
- };
- PrintAsPDFAction.prototype.sendRequest=function(){
- var _1b8e=this.m_oCV.getId();
- var sName="get"+this.m_format+_1b8e;
- this.nForm.setAttribute("id",sName);
- this.nForm.setAttribute("name",sName);
- this.nForm.setAttribute("target",this.m_format+"Window"+_1b8e);
- document.body.appendChild(this.nForm);
- var _1b90=this.nForm.getAttribute("target");
- window.open("",_1b90,"resizable=yes,menubar=no,directories=no,location=no,status=no,toolbar=no,titlebar=no");
- this.nForm.submit();
- document.body.removeChild(this.nForm);
- this.nForm=null;
- return true;
- };
- PrintAsPDFAction.prototype.addFormField=function(sName,_1b92){
- this.nForm.appendChild(createHiddenFormField(sName,_1b92));
- };
- function ExpandCollapseMemberAction(){
- this.m_sAction="ExpandCollapseMember";
- this.m_sExpandCollapseType=null;
- this.m_RAPReportInfo=null;
- this.m_itemInfo=null;
- this.m_sPreviousDataItem=null;
- };
- ExpandCollapseMemberAction.prototype=new ModifyReportAction();
- ExpandCollapseMemberAction.baseclass=ModifyReportAction.prototype;
- ExpandCollapseMemberAction.prototype._getCanExpand=function(_1b93){
- var _1b94=this._getItemInfo(_1b93);
- return (_1b94&&_1b94.canExpand);
- };
- ExpandCollapseMemberAction.prototype._isExpanded=function(_1b95){
- var sMUN=this._getSelectedMUN(_1b95);
- if(!sMUN){
- return false;
- }
- var _1b97=this._getItemInfo(_1b95);
- return (_1b97&&_1b97.expandedMembers&&_1b97.expandedMembers[sMUN]===true);
- };
- ExpandCollapseMemberAction.prototype._getSelectedMUN=function(_1b98){
- var sMun=null;
- var aMuns=_1b98.getMuns();
- if(aMuns&&aMuns.length>0&&aMuns[0].length>0){
- sMun=aMuns[0][0];
- }
- return sMun;
- };
- ExpandCollapseMemberAction.prototype._getDataItem=function(_1b9b){
- if(!_1b9b){
- return null;
- }
- var _1b9c=null;
- var _1b9d=_1b9b.getDataItems();
- if(_1b9d&&_1b9d.length>0&&_1b9d[0].length>0){
- _1b9c=_1b9d[0][0];
- }
- return _1b9c;
- };
- ExpandCollapseMemberAction.prototype._getItemInfo=function(_1b9e){
- var _1b9f=this._getDataItem(_1b9e);
- if(!_1b9f){
- return null;
- }
- var _1ba0=this.removeNamespace(_1b9e.getLayoutElementId());
- this.m_RAPReportInfo=this.m_oCV.getRAPReportInfo();
- this.m_itemInfo=this.m_RAPReportInfo.getItemInfo(_1ba0,_1b9f);
- this.m_sPreviousDataItem=_1b9f;
- return this.m_itemInfo;
- };
- ExpandCollapseMemberAction.prototype._alwaysCanExpandCollapse=function(_1ba1){
- var _1ba2=this._getItemInfo(_1ba1);
- return (_1ba2&&_1ba2.alwaysCanExpandCollapse);
- };
- ExpandCollapseMemberAction.prototype._canShowMenu=function(_1ba3){
- var _1ba4=this._getFirstSelectedObject(_1ba3);
- return (_1ba4&&this._hasMUN(_1ba4)&&this._isCrosstab(_1ba4)&&this._isOnEdge(_1ba4)&&!_1ba3.areSelectionsMeasureOrCalculation());
- };
- ExpandCollapseMemberAction.prototype._getCtxId=function(_1ba5){
- var _1ba6=_1ba5.getCellRef();
- if(_1ba6&&_1ba6.getAttribute){
- var _1ba7=_1ba6.getAttribute("ctx");
- if(_1ba7){
- _1ba7=_1ba7.split("::")[0].split(":")[0];
- return _1ba7;
- }
- }
- return "";
- };
- ExpandCollapseMemberAction.prototype._hasMUN=function(_1ba8){
- var aMuns=_1ba8.getMuns();
- return aMuns.length>0?true:false;
- };
- ExpandCollapseMemberAction.prototype._isCrosstab=function(_1baa){
- return _1baa.getDataContainerType()==="crosstab"?true:false;
- };
- ExpandCollapseMemberAction.prototype._isOnEdge=function(_1bab){
- return _1bab.getLayoutType()==="columnTitle"?true:false;
- };
- ExpandCollapseMemberAction.prototype.keepRAPCache=function(){
- return false;
- };
- ExpandCollapseMemberAction.prototype.updateMenu=function(_1bac){
- var _1bad=this.m_oCV.getSelectionController();
- _1bac.visible=this._canShowMenu(_1bad);
- if(!_1bac.visible){
- return _1bac;
- }
- _1bac.disabled=!this._canEnableMenu(_1bad);
- return _1bac;
- };
- ExpandCollapseMemberAction.prototype._canEnableMenu=function(_1bae){
- return true;
- };
- ExpandCollapseMemberAction.prototype._getFirstSelectedObject=function(_1baf){
- var _1bb0=_1baf.getAllSelectedObjects();
- if(_1bb0.length>0){
- return _1bb0[0];
- }
- return null;
- };
- ExpandCollapseMemberAction.prototype._isSingleSelection=function(_1bb1){
- var _1bb2=_1bb1.getAllSelectedObjects();
- return (_1bb2.length===1);
- };
- ExpandCollapseMemberAction.prototype.addActionContextAdditionalParms=function(){
- var _1bb3=this.getCognosViewer().getSelectionController();
- var _1bb4=this._getFirstSelectedObject(_1bb3);
- var sPUN=_1bb3.getPun(this._getCtxId(_1bb4));
- if(sPUN){
- sPUN="<PUN>"+sXmlEncode(sPUN)+"</PUN>";
- }
- var sType="";
- if(this.m_sExpandCollapseType){
- sType="<ExpandCollapseType>"+this.m_sExpandCollapseType+"</ExpandCollapseType>";
- }
- return this.getSelectedCellTags()+sPUN+sType;
- };
- function ExpandMemberAction(){
- this.m_sAction="ExpandCollapseMember";
- this.m_sExpandCollapseType="ExpandMember";
- };
- ExpandMemberAction.prototype=new ExpandCollapseMemberAction();
- ExpandMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
- ExpandMemberAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_EXPAND_MEMBER;
- };
- ExpandMemberAction.prototype._canEnableMenu=function(_1bb7){
- if(!this._isSingleSelection(_1bb7)){
- return false;
- }
- var _1bb8=this._getFirstSelectedObject(_1bb7);
- if(this._alwaysCanExpandCollapse(_1bb8)){
- return true;
- }
- var ctxId=this._getCtxId(_1bb8);
- var _1bba=true;
- if(_1bb7.getDrillUpDownEnabled()===true){
- _1bba=_1bb7.canDrillDown(ctxId);
- }
- return (_1bba&&this._getCanExpand(_1bb8)&&!this._isExpanded(_1bb8));
- };
- function CollapseMemberAction(){
- this.m_sAction="ExpandCollapseMember";
- this.m_sExpandCollapseType="CollapseMember";
- };
- CollapseMemberAction.prototype=new ExpandCollapseMemberAction();
- CollapseMemberAction.baseclass=ExpandCollapseMemberAction.prototype;
- CollapseMemberAction.prototype.getUndoHint=function(){
- return RV_RES.IDS_JS_COLLAPSE_MEMBER;
- };
- CollapseMemberAction.prototype._canDisableMenu=function(_1bbb){
- if(this._isSingleSelection(_1bbb)&&!this._isExpanded()){
- return true;
- }
- return false;
- };
- CollapseMemberAction.prototype._canEnableMenu=function(_1bbc){
- var _1bbd=this._getFirstSelectedObject(_1bbc);
- if(this._alwaysCanExpandCollapse(_1bbd)){
- return true;
- }
- return (this._isSingleSelection(_1bbc)&&this._isExpanded(_1bbd));
- };
- function OpenReportFromClipboardAction(){
- this.m_action="bux";
- this.m_cv=this.getCognosViewer();
- };
- OpenReportFromClipboardAction.prototype=new CognosViewerAction();
- OpenReportFromClipboardAction.prototype.reuseQuery=function(){
- return false;
- };
- OpenReportFromClipboardAction.prototype.reuseGetParameter=function(){
- return false;
- };
- OpenReportFromClipboardAction.prototype.keepRAPCache=function(){
- return false;
- };
- OpenReportFromClipboardAction.prototype.reuseConversation=function(){
- return false;
- };
- OpenReportFromClipboardAction.prototype.runReport=function(){
- return true;
- };
- OpenReportFromClipboardAction.prototype.isUndoable=function(){
- return true;
- };
- OpenReportFromClipboardAction.prototype.execute=function(){
- if(window.clipboardData){
- this.openReportForIE();
- }else{
- this.openReportForNonIE();
- }
- };
- OpenReportFromClipboardAction.prototype.openReportForNonIE=function(){
- var _1bbe=this;
- var _1bbf=new viewer.dialogs.ClipboardDialog({sTitle:RV_RES.IDS_JS_CLIPBOARD,okHandler:function(_1bc0){
- _1bbe.executeAction(_1bc0);
- },cancelHandler:function(){
- }});
- _1bbf.startup();
- window.setTimeout(function(){
- _1bbf.show();
- },0);
- };
- OpenReportFromClipboardAction.prototype.openReportForIE=function(){
- var _1bc1=window.clipboardData.getData("Text");
- this.executeAction(_1bc1);
- };
- OpenReportFromClipboardAction.prototype.getDeleteEnvParamsList=function(){
- var _1bc2=["modelPath","packageBase","rapReportInfo","rap.state"];
- return _1bc2;
- };
- OpenReportFromClipboardAction.prototype.deleteEnvParams=function(){
- var _1bc3=this.m_cv.envParams;
- var _1bc4=this.getDeleteEnvParamsList();
- for(var index in _1bc4){
- if(_1bc3[_1bc4[index]]){
- delete _1bc3[_1bc4[index]];
- }
- }
- };
- OpenReportFromClipboardAction.prototype.cleanUpCognosViewer=function(){
- this.m_cv.setExecutionParameters("");
- this.m_cv.setConversation("");
- this.deleteEnvParams();
- };
- OpenReportFromClipboardAction.prototype.getRequestParams=function(){
- var _1bc6={"run.outputFormat":"HTML","cv.id":this.m_cv.getId(),"widget.reloadToolbar":"true","openReportFromClipboard":"true","ui.reportDrop":"true"};
- var _1bc7=this.m_cv.getViewerWidget().getGlobalPromptsInfo();
- if(_1bc7!=null){
- _1bc6["widget.globalPromptInfo"]=_1bc7;
- }
- if(this.m_filters!=""){
- _1bc6["cv.updateDataFilters"]=this.m_filters;
- }
- var _1bc8=["cv.objectPermissions","limitedInteractiveMode"];
- for(var index in _1bc8){
- var _1bca=_1bc8[index];
- var _1bcb=this.m_cv.envParams[_1bca];
- if(_1bcb){
- _1bc6[_1bca]=_1bcb;
- }
- }
- return _1bc6;
- };
- OpenReportFromClipboardAction.prototype.addAdditionalOptions=function(_1bcc){
- var _1bcd=this.getRequestParams();
- for(var index in _1bcd){
- _1bcc.addFormField(index,_1bcd[index]);
- }
- };
- OpenReportFromClipboardAction.prototype.executeAction=function(_1bcf){
- this.m_cv=this.getCognosViewer();
- this.m_cv.envParams["ui.spec"]=_1bcf;
- this.gatherFilterInfoBeforeAction("OpenReportFromClipboard");
- ChangePaletteAction.reset(this.getCognosViewer());
- };
- OpenReportFromClipboardAction.prototype.dispatchRequest=function(_1bd0){
- this.m_cv=this.getCognosViewer();
- var _1bd1=this.m_cv.getViewerWidget();
- _1bd1.reset();
- this.m_filters=_1bd0;
- this.cleanUpCognosViewer();
- var _1bd2=this.createCognosViewerDispatcherEntry(this.m_action);
- this.m_cv.hideReportInfo();
- this.m_cv.dispatchRequest(_1bd2);
- this.fireModifiedReportEvent();
- };
- OpenReportFromClipboardAction.prototype.doAddActionContext=function(){
- return false;
- };
- OpenReportFromClipboardAction.prototype.updateMenu=function(json){
- json.visible=(window.cognosViewerDebug===true);
- return json;
- };
- function SaveAsReportAction(){
- _progressDisplay=null;
- };
- SaveAsReportAction.prototype=new CognosViewerAction();
- SaveAsReportAction.prototype.onSaveCallback=function(){
- if(!this._progressDisplay){
- dojo["require"]("bux.dialogs.InformationDialog");
- this._progressDisplay=new bux.dialogs.Working(BUXMSG.CPN.IDS_CPN_SAVING);
- this._progressDisplay.startup();
- this._progressDisplay.show();
- }
- };
- SaveAsReportAction.prototype.afterSaveCallback=function(){
- if(this._progressDisplay){
- this._progressDisplay.destroy();
- this._progressDisplay=null;
- }
- };
- SaveAsReportAction.prototype.execute=function(){
- this.getCognosViewer().executeAction("RemoveAllDataFilter",{callback:{method:this.doSaveAs,object:this}});
- };
- SaveAsReportAction.prototype.updateMenu=function(_1bd4){
- _1bd4.visible=this.hasEnvUISpec();
- return _1bd4;
- };
- SaveAsReportAction.prototype.hasEnvUISpec=function(){
- if(this.m_oCV){
- var sSpec=this.m_oCV.envParams["ui.spec"];
- return (sSpec&&sSpec.length>0);
- }
- return false;
- };
- SaveAsReportAction.prototype.doSaveAs=function(_1bd6){
- dojo["require"]("bux.dialogs.FileDialog");
- dojo["require"]("bux.iwidget.canvas.ReportIOHandler");
- this.m_cv=this.getCognosViewer();
- var _1bd7=_1bd6;
- var _1bd8=this.m_cv.envParams["ui.objectClass"];
- var _1bd9=this.onSaveCallback;
- var _1bda=this.afterSaveCallback;
- var _1bdb={filter:"content-report",title:RV_RES.IDS_JS_SAVE_AS_FDG_TITLE,sMainActionButtonLabel:RV_RES.IDS_JS_OK,"class":"bux-fileDialog"};
- var _1bdc=new bux.iwidget.canvas.ReportIOHandler(_1bd7,_1bd8,_1bd9,_1bda,_1bdb);
- _1bdc._doSaveAs();
- };
- function BusinessProcessAction(){
- };
- BusinessProcessAction.prototype=new CognosViewerAction();
- BusinessProcessAction.prototype.updateMenu=function(_1bdd){
- var _1bde=this.getCognosViewer().envParams["bpmRestURI"];
- _1bdd.visible=(_1bde?true:false);
- if(_1bdd.visible){
- _1bdd.disabled=!this._hasAnyContextInSelectedObjects();
- }
- return _1bdd;
- };
- BusinessProcessAction.prototype._initBPMGateway=function(){
- var _1bdf=this.getCognosViewer();
- this.m_BPMGateway=_1bdf.envParams["bpmRestURI"];
- var _1be0=this.m_BPMGateway.length;
- if(this.m_BPMGateway[_1be0-1]!=="/"){
- this.m_BPMGateway+="/";
- }
- };
- BusinessProcessAction.prototype.execute=function(){
- this._initBPMGateway();
- var _1be1=this._getBPMProcesses();
- };
- BusinessProcessAction.prototype._getBPMProcesses=function(){
- var _1be2={complete:{object:this,method:this.handleGetBPMProcessSuccess},fault:{object:this,method:this.handleGetBPMProcessFail}};
- var url=this.m_BPMGateway+"exposed/process";
- var _1be4=this._createBPMServerRequest("GET",_1be2,url);
- _1be4.sendRequest();
- };
- BusinessProcessAction.prototype._createBPMServerRequest=function(_1be5,_1be6,url,_1be8){
- var _1be9=new XmlHttpObject();
- _1be9.init(_1be5,this._rewriteURL(url));
- _1be9.setCallbacks(_1be6);
- _1be9.setHeaders({Accept:"application/json"});
- if(_1be8){
- for(var i in _1be8){
- _1be9.addFormField(_1be8[i].name,_1be8[i].value);
- }
- }
- return _1be9;
- };
- BusinessProcessAction.prototype._rewriteURL=function(url){
- if(bux&&bux.iwidget&&bux.iwidget.canvas&&bux.iwidget.canvas.Helper&&bux.iwidget.canvas.Helper.rewriteUrl){
- return bux.iwidget.canvas.Helper.rewriteUrl(url);
- }
- return url;
- };
- BusinessProcessAction.prototype.handleGetBPMProcessFail=function(_1bec){
- var _1bed=RV_RES.IDS_JS_BUSINESS_PROCESS_GET_PROCESSES_FAIL_MSG;
- var _1bee=_1bec.getResponseText();
- this._showErrorMessage(_1bed,_1bee);
- };
- BusinessProcessAction.prototype.handleGetBPMProcessSuccess=function(_1bef){
- var _1bf0=_1bef.getResponseText();
- if(!_1bf0){
- return;
- }
- var _1bf1=dojo.fromJson(_1bf0);
- var _1bf2=this._getBusinessProcessesInfo(_1bf1.data.exposedItemsList);
- this._showDialog(_1bf2);
- };
- BusinessProcessAction.prototype._getBusinessProcessesInfo=function(_1bf3){
- if(!_1bf3){
- return;
- }
- var _1bf4=_1bf3.length;
- var _1bf5=new Array();
- var _1bf6={};
- for(var i=0;i<_1bf4;i++){
- var _1bf8=_1bf3[i].display;
- var _1bf9=_1bf3[i].itemID;
- var _1bfa=_1bf3[i].processAppID;
- if(_1bf8&&!_1bf6[_1bf8]&&_1bf9&&_1bfa){
- _1bf6[_1bf8]=true;
- _1bf5.push({sCaption:_1bf8,sBPD_ID:_1bf9,sProcessAppID:_1bfa});
- }
- }
- return _1bf5;
- };
- BusinessProcessAction.prototype._showDialog=function(_1bfb){
- var _1bfc=this;
- 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(){
- },cancelHandler:function(){
- },BPMProcessesInfo:_1bfb,bpAction:_1bfc});
- _1bfd.startup();
- _1bfd.show();
- };
- BusinessProcessAction.prototype.getInputParameter=function(_1bfe){
- var obj=null;
- var _1c00=this.getCognosViewer();
- var _1c01=_1c00.getSelectionController();
- var _1c02=_1c01.getSelectedObjectsJsonContext();
- if(_1c02){
- var value=_1c02;
- if(_1bfe){
- value=dojo.toJson(value);
- }
- obj={"cognosParameter":value};
- }
- return obj;
- };
- BusinessProcessAction.prototype.startProcess=function(_1c04,_1c05,_1c06){
- var _1c07={customArguments:[_1c06],complete:{object:this,method:this.handleGetStartProcessSuccessResponse},fault:{object:this,method:this.handleGetStartProcessFailResponse}};
- var url=this.m_BPMGateway+"process";
- var _1c09=new Array();
- _1c09.push({name:"action",value:"start"});
- _1c09.push({name:"parts",value:"data"});
- if(_1c04){
- _1c09.push({name:"bpdId",value:_1c04});
- }
- if(_1c05){
- _1c09.push({name:"processAppId",value:_1c05});
- }
- var _1c0a=this.getInputParameter(true);
- if(_1c0a){
- _1c09.push({name:"params",value:dojo.toJson(_1c0a)});
- }
- var _1c0b=this._createBPMServerRequest("POST",_1c07,url,_1c09);
- _1c0b.sendRequest();
- };
- BusinessProcessAction.prototype.handleGetStartProcessSuccessResponse=function(_1c0c,_1c0d){
- var _1c0e=_1c0c.getResponseText();
- if(_1c0e){
- var _1c0f=dojo.fromJson(_1c0e);
- if(_1c0f.status==="200"){
- var sMsg=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_SUCCEED_MSG,_1c0d);
- 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});
- _1c11.show();
- }
- }
- };
- BusinessProcessAction.prototype.handleGetStartProcessFailResponse=function(_1c12,_1c13){
- var _1c14=_1c12.getResponseXml();
- if(_1c14&&_1c14.documentElement){
- this._handleXMLErrorResponse(_1c14,_1c13);
- return;
- }
- var _1c15=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_FAILED_MSG,_1c13);
- var _1c16=_1c12.getResponseText();
- try{
- var _1c17=dojo.fromJson(_1c16);
- _1c16=_1c17.Data.errorMessage;
- }
- catch(err){
- }
- this._showErrorMessage(_1c15,_1c16);
- };
- BusinessProcessAction.prototype._handleXMLErrorResponse=function(_1c18,_1c19){
- var _1c1a=XMLHelper_FindChildrenByTagName(_1c18,"error");
- var _1c1b="";
- var _1c1c="";
- if(_1c1a){
- _1c1b=XMLHelper_FindChildrenByTagName(_1c1a,"message").childNodes[0].nodeValue;
- _1c1c=XMLHelper_FindChildrenByTagName(_1c1a,"detail").childNodes[0].nodeValue;
- }else{
- _1c1b=CViewerCommon.getMessage(RV_RES.IDS_JS_BUSINESS_PROCESS_START_PROCESS_FAILED_MSG,_1c19);
- }
- this._showErrorMessage(_1c1b,_1c1c);
- };
- BusinessProcessAction.prototype._showErrorMessage=function(_1c1d,_1c1e){
- var _1c1f=new ModalFaultMessageDialog(_1c1d,_1c1e);
- _1c1f.show();
- };
- BusinessProcessAction.prototype._hasAnyContextInSelectedObjects=function(){
- var _1c20=false;
- var _1c21=this.m_oCV.getSelectionController();
- var _1c22=_1c21.getAllSelectedObjects();
- for(var i=0;i<_1c22.length;i++){
- var _1c24=_1c22[i].getSelectedContextIds();
- if(_1c24&&_1c24.length>0){
- _1c20=true;
- break;
- }
- }
- return _1c20;
- };
- function DrillResetAction(){
- this.m_sAction="DrillDown";
- this.m_sharePromptValues=null;
- this.m_aDrilledResetHUNs=null;
- this.m_updateInfoBar=true;
- };
- DrillResetAction.prototype=new ModifyReportAction();
- DrillResetAction.prototype.setRequestParms=function(_1c25){
- this.m_aDrilledResetHUNs=_1c25.drilledResetHUNs;
- this.m_sharePromptValues=_1c25.promptValues;
- };
- DrillResetAction.prototype.addAdditionalOptions=function(oReq){
- if(!this.m_oCV){
- return;
- }
- if(!this.m_sharePromptValues){
- this.m_oCV.preparePromptValues(oReq);
- oReq.getRequestHandler().setForceRaiseSharePrompt(true);
- }else{
- if(!this.m_sharePromptValues){
- return;
- }
- for(var _1c27 in this.m_sharePromptValues){
- oReq.addFormField(_1c27,this.m_sharePromptValues[_1c27]);
- }
- }
- };
- DrillResetAction.prototype.addActionContextAdditionalParms=function(){
- var _1c28="<HUNS>";
- for(var i=0;i<this.m_aDrilledResetHUNs.length;i++){
- _1c28+="<HUN>"+xml_encode(this.m_aDrilledResetHUNs[i])+"</HUN>";
- }
- _1c28+="</HUNS>";
- _1c28+="<action>resetDimension</action>";
- return _1c28;
- };
- DrillResetAction.prototype.setUpdateInfoBar=function(_1c2a){
- this.m_updateInfoBar=_1c2a;
- };
- DrillResetAction.prototype.updateInfoBar=function(){
- this.m_updateInfoBar;
- };
- function RemoveAllDataFilterAction(){
- this.m_sAction="UpdateDataFilter";
- };
- RemoveAllDataFilterAction.prototype.setCognosViewer=function(oCV){
- this.m_oCV=oCV;
- };
- RemoveAllDataFilterAction.prototype.getCognosViewer=function(oCV){
- return this.m_oCV;
- };
- RemoveAllDataFilterAction.prototype.setRequestParms=function(_1c2d){
- if(!_1c2d||!_1c2d.callback){
- return;
- }
- this.m_callbackMethod=_1c2d.callback.method;
- this.m_callbackObject=_1c2d.callback.object;
- };
- RemoveAllDataFilterAction.prototype.createJSONDispatcherEntry=function(_1c2e){
- var oReq=new JSONDispatcherEntry(this.getCognosViewer());
- oReq.addFormField("ui.action",_1c2e);
- var _1c30=this.addActionContext();
- oReq.addFormField("cv.actionContext",_1c30);
- if(window.gViewerLogger){
- window.gViewerLogger.log("Action context",_1c30,"xml");
- }
- if(typeof this.m_oCV.envParams["ui.spec"]!="undefined"){
- oReq.addFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- }
- oReq.addFormField("bux","true");
- return oReq;
- };
- RemoveAllDataFilterAction.prototype.addActionContext=function(){
- var _1c31="<reportActions";
- var _1c32="";
- _1c31+=" run=\"false\"";
- _1c31+=">";
- _1c31+="<reportAction name=\""+this.m_sAction+"\">";
- var _1c33="{ \"removeAll\" :\"true\"}";
- _1c31+=xml_encode(_1c33);
- _1c31+="</reportAction>";
- _1c31+="</reportActions>";
- return _1c31;
- };
- RemoveAllDataFilterAction.prototype.executeCallback=function(_1c34){
- var _1c35=GUtil.generateCallback(this.m_callbackMethod,[_1c34],this.m_callbackObject);
- _1c35();
- };
- RemoveAllDataFilterAction.prototype.handleServerResponse=function(_1c36){
- if(_1c36&&_1c36.getJSONResponseObject()){
- this.executeCallback(_1c36.getJSONResponseObject().reportSpec);
- }
- };
- RemoveAllDataFilterAction.prototype.execute=function(){
- var oCV=this.getCognosViewer();
- if(!oCV.getRAPReportInfo().hasSlider()){
- this.executeCallback(oCV.envParams["ui.spec"]);
- }else{
- var _1c38=this.createJSONDispatcherEntry("modifyReport");
- _1c38.setCallbacks({"complete":{"object":this,"method":this.handleServerResponse}});
- oCV.dispatchRequest(_1c38);
- }
- };
- CCognosViewer.prototype.loadExtra=function(){
- };
- function DrillContextMenuHelper(){
- };
- DrillContextMenuHelper.updateDrillMenuItems=function(_1c39,oCV,_1c3b){
- var _1c3c=[];
- if(DrillContextMenuHelper.needsDrillSubMenu(oCV)){
- var _1c3d=oCV.getSelectionController();
- var _1c3e=_1c3d.getAllSelectedObjects();
- var _1c3f=_1c3e[0];
- if(_1c3f.getUseValues().length>1&&typeof RV_RES!="undefined"){
- var _1c40={name:_1c3b,label:RV_RES.RV_DRILL_DEFAULT,action:{name:_1c3b,payload:{}}};
- _1c3c.push(_1c40);
- }
- var _1c41=(_1c3f.getUseValues().length>1)?1:0;
- var _1c42=_1c3f.getUseValues().length-1;
- _1c42=(_1c42>2)?2:_1c42;
- for(var iDim=_1c41;iDim<=_1c42;++iDim){
- DrillContextMenuHelper.addSubMenuItem(_1c3b,_1c3c,_1c3f,iDim,0);
- }
- var _1c44=false;
- for(var iDim=_1c41;iDim<=_1c42;++iDim){
- for(var _1c45=1;_1c45<_1c3f.getUseValues()[iDim].length;++_1c45){
- if(_1c44==false){
- _1c3c.push({separator:true});
- _1c44=true;
- }
- DrillContextMenuHelper.addSubMenuItem(_1c3b,_1c3c,_1c3f,iDim,_1c45);
- }
- }
- }
- DrillContextMenuHelper.completeDrillMenu(_1c3b,_1c3c,_1c39);
- };
- DrillContextMenuHelper.needsDrillSubMenu=function(oCV){
- var _1c47=(oCV&&oCV.getSelectionController());
- if(_1c47){
- var _1c48=_1c47.getAllSelectedObjects();
- if(_1c48.length==1&&_1c48[0].isHomeCell&&_1c48[0].isHomeCell()==false){
- var _1c49=_1c48[0].isSelectionOnVizChart();
- if(!_1c49){
- var _1c4a=oCV.getAdvancedServerProperty("VIEWER_JS_ENABLE_DRILL_SUBMENU");
- _1c49=(_1c4a=="charts"&&_1c47.hasSelectedChartNodes());
- }
- if(_1c49){
- var _1c4b=_1c48[0];
- return (_1c49&&_1c4b.getUseValues()&&(_1c4b.getUseValues().length>1||_1c4b.getUseValues()[0].length>1));
- }
- }
- }
- return false;
- };
- DrillContextMenuHelper.addSubMenuItem=function(_1c4c,_1c4d,_1c4e,iDim,_1c50){
- var _1c51=_1c4e.getDrillOptions()[iDim][_1c50];
- if(DrillContextMenuHelper.isOptionDrillable(_1c4c,_1c51)){
- var _1c52=DrillContextMenuHelper.getItemValue(_1c4e,iDim,_1c50);
- if(_1c52){
- var _1c53=_1c4e.getDataItems()[iDim][_1c50];
- var _1c54={name:_1c4c,label:_1c52,action:{name:_1c4c,payload:{userSelectedDrillItem:_1c53}}};
- _1c4d.push(_1c54);
- }
- }
- };
- DrillContextMenuHelper.completeDrillMenu=function(_1c55,_1c56,_1c57){
- if(_1c56.length>0){
- _1c57.items=_1c56;
- }else{
- _1c57.items=null;
- if(_1c57.action==null){
- _1c57.action={name:_1c55,action:{name:_1c55}};
- }
- }
- };
- DrillContextMenuHelper.isOptionDrillable=function(_1c58,_1c59){
- return (_1c59>=3||(_1c58=="DrillDown"&&_1c59==2)||(_1c58=="DrillUp"&&_1c59==1));
- };
- DrillContextMenuHelper.getItemValue=function(_1c5a,iDim,_1c5c){
- var _1c5d=(_1c5c==0)?_1c5a.getDisplayValues()[iDim]:null;
- return ((_1c5d)?_1c5d:_1c5a.getUseValues()[iDim][_1c5c]);
- };
- dojo.provide("viewer.dialogs.ClipboardDialog");
- dojo.require("bux.dialogs.BaseCustomContentDialog");
- dojo.require("bux.layout.TableContainer");
- dojo.require("dijit.form.Textarea");
- dojo.require("dijit.form.Button");
- dojo.declare("viewer.dialogs.ClipboardDialog",bux.dialogs.BaseCustomContentDialog,{sTitle:null,okHandler:null,cancelHandler:null,startup:function(){
- this.updateTitle(this.sTitle);
- this.inherited(arguments);
- var _1c5e=new bux.layout.TableContainer({classname:"bux-InformationDialog"},this.contentContainer);
- var cell=null,row=null;
- this._textField=new dijit.form.SimpleTextarea({required:true,rows:10,cols:50,style:"width:auto"});
- row=new bux.layout.TableContainerRow({parentContainer:_1c5e});
- cell=new bux.layout.TableContainerCell({classname:"bux-dialog-field",parentContainer:row});
- cell.addContent(this._textField.domNode);
- },onOK:function(){
- if(this._textField.state!="Error"){
- this.inherited(arguments);
- this.okHandler(this._textField.get("value"));
- this.hide();
- }
- }});
- dojo.provide("bux.reportViewer.chart");
- dojo.declare("bux.reportViewer.chart",null,{m_displayTypeDialogDefinition:null,constructor:function(){
- this.initialize();
- },initialize:function(){
- if(this.m_displayTypeDialogDefinition!==null){
- return;
- }
- 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"}]}];
- },getDisplayTypeDialogDefinition:function(_1c61){
- var _1c62=[];
- for(var j in this.m_displayTypeDialogDefinition){
- var _1c64=this.m_displayTypeDialogDefinition[j];
- var _1c65={};
- _1c65.image=this.m_displayTypeDialogDefinition[j].image;
- _1c65.label=this.m_displayTypeDialogDefinition[j].label;
- _1c65.options=[];
- var _1c66=_1c64.options;
- for(var k in _1c66){
- var chart=_1c66[k];
- for(var i in _1c61){
- var _1c6a=_1c61[i];
- if(chart.value===_1c6a){
- var _1c6b={label:chart.label,Description:chart.Description,image:chart.image,value:"{targetType:'"+chart.value+"', label:'"+chart.label+"'}"};
- _1c65.options.push(_1c6b);
- }
- }
- }
- if(_1c65.options.length>0){
- _1c62.push(_1c65);
- }
- }
- return _1c62;
- }});
- function ActionFormFields(_1c6c){
- this.m_dispatcherEntry=_1c6c;
- this.m_oCV=_1c6c.getViewer();
- };
- ActionFormFields.prototype.addFormFields=function(){
- var _1c6d=this.m_dispatcherEntry;
- var _1c6e=_1c6d.getAction();
- _1c6e.preProcess();
- _1c6d.addFormField("ui.action","modifyReport");
- if(this.m_oCV.getModelPath()!==""){
- _1c6d.addFormField("modelPath",this.m_oCV.getModelPath());
- if(typeof this.m_oCV.envParams["metaDataModelModificationTime"]!="undefined"){
- _1c6d.addFormField("metaDataModelModificationTime",this.m_oCV.envParams["metaDataModelModificationTime"]);
- }
- }
- if(_1c6e.doAddActionContext()===true){
- var _1c6f=_1c6e.addActionContext();
- _1c6d.addFormField("cv.actionContext",_1c6f);
- if(window.gViewerLogger){
- window.gViewerLogger.log("Action context",_1c6f,"xml");
- }
- }
- var isBux=this.m_oCV.envParams["bux"]=="true";
- if(isBux){
- _1c6d.addFormField("cv.showFaultPage","false");
- }else{
- _1c6d.addFormField("cv.showFaultPage","true");
- }
- _1c6d.addFormField("ui.object",this.m_oCV.envParams["ui.object"]);
- _1c6d.addDefinedFormField("ui.spec",this.m_oCV.envParams["ui.spec"]);
- _1c6d.addDefinedFormField("modelPath",this.m_oCV.envParams["modelPath"]);
- _1c6d.addDefinedFormField("packageBase",this.m_oCV.envParams["packageBase"]);
- _1c6d.addDefinedFormField("rap.state",this.m_oCV.envParams["rap.state"]);
- _1c6d.addDefinedFormField("rap.reportInfo",this.m_oCV.envParams["rapReportInfo"]);
- _1c6d.addDefinedFormField("ui.primaryAction",this.m_oCV.envParams["ui.primaryAction"]);
- _1c6d.addNonNullFormField("cv.debugDirectory",this.m_oCV.envParams["cv.debugDirectory"]);
- _1c6d.addNonNullFormField("ui.objectClass",this.m_oCV.envParams["ui.objectClass"]);
- _1c6d.addNonNullFormField("bux",this.m_oCV.envParams["bux"]);
- _1c6d.addNonNullFormField("baseReportModificationTime",this.m_oCV.envParams["baseReportModificationTime"]);
- _1c6d.addNonNullFormField("originalReport",this.m_oCV.envParams["originalReport"]);
- var _1c71=this.m_oCV.getFlashChartOption();
- if(_1c71!=null){
- _1c6d.addFormField("savedFlashChartOption",_1c71);
- if(_1c71&&_1c6e!=null&&typeof (_1c6e.m_requestParams)!="undefined"&&typeof (_1c6e.m_requestParams.targetType)!="undefined"){
- var _1c72=false;
- var _1c73=null;
- if(typeof (_1c6e.m_requestParams.targetType.targetType)!="undefined"){
- _1c73=_1c6e.m_requestParams.targetType.targetType;
- }else{
- _1c73=_1c6e.m_requestParams.targetType;
- }
- if(_1c73.match("v2_")!=null||_1c73.match("_v2")!=null){
- _1c72=true;
- }else{
- var _1c74=this.m_oCV.getRAPReportInfo();
- var _1c75=_1c6e.getSelectedReportInfo();
- if(_1c74&&_1c75){
- var _1c76=_1c74.getDisplayTypes(_1c75.container);
- if(_1c76.match("v2_")!=null||_1c76.match("_v2")!=null){
- _1c72=true;
- }
- }
- }
- _1c6d.addFormField("hasAVSChart",_1c72);
- }else{
- _1c6d.addFormField("hasAVSChart",this.m_oCV.hasAVSChart());
- }
- }
- var sEP=this.m_oCV.getExecutionParameters();
- if(sEP){
- _1c6d.addFormField("executionParameters",encodeURIComponent(sEP));
- }
- _1c6d.addFormField("ui.conversation",encodeURIComponent(this.m_oCV.getConversation()));
- _1c6d.addFormField("m_tracking",encodeURIComponent(this.m_oCV.getTracking()));
- var sCAF=this.m_oCV.getCAFContext();
- if(sCAF){
- _1c6d.addFormField("ui.cafcontextid",sCAF);
- }
- if(_1c6e.forceRunSpecRequest()){
- _1c6d.addFormField("widget.forceRunSpec","true");
- }
- };
- HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX="viewerHiddenRequest";
- HiddenIframeDispatcherEntry.FORM_NAME="viewerHiddenFormRequest";
- function HiddenIframeDispatcherEntry(oCV){
- HiddenIframeDispatcherEntry.baseConstructor.call(this,oCV);
- if(oCV){
- HiddenIframeDispatcherEntry.prototype.setDefaultFormFields.call(this);
- this.setRequestHandler(new RequestHandler(oCV));
- this.setWorkingDialog(oCV.getWorkingDialog());
- this.setRequestIndicator(oCV.getRequestIndicator());
- this.m_httpRequestConfig=oCV.getConfig()&&oCV.getConfig().getHttpRequestConfig()?oCV.getConfig().getHttpRequestConfig():null;
- this.setIframeId(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+oCV.getId());
- this.originalGetViewerConfiguration=null;
- }
- };
- HiddenIframeDispatcherEntry.prototype=new DispatcherEntry();
- HiddenIframeDispatcherEntry.baseConstructor=DispatcherEntry;
- HiddenIframeDispatcherEntry.prototype.setDefaultFormFields=function(){
- var oCV=this.getViewer();
- var sCAF=oCV.getCAFContext();
- this.addDefinedNonNullFormField("ui.cafcontextid",sCAF);
- };
- HiddenIframeDispatcherEntry.prototype.sendRequest=function(){
- this._createHiddenIframe();
- var form=this._createForm();
- this._setupCallbacks();
- this.onPreHttpRequest(this.getRequest());
- form.submit();
- };
- HiddenIframeDispatcherEntry.prototype._iframeRequestComplete=function(){
- window.getViewerConfiguration=this.originalGetViewerConfiguration;
- this.onPostHttpRequest();
- this.onEntryComplete();
- };
- HiddenIframeDispatcherEntry.prototype._setupCallbacks=function(){
- this.originalGetViewerConfiguration=window.getViewerConfiguration;
- if(this.getFormField("cv.useAjax")!="false"){
- var _1c7d=this;
- var _1c7e=this.getRequestHandler().getRequestIndicator();
- var _1c7f=this.getRequestHandler().getWorkingDialog();
- window.getViewerConfiguration=function(){
- var _1c80={"httpRequestCallbacks":{"reportStatus":{"complete":function(){
- _1c7d.onComplete();
- },"working":function(){
- _1c7d.onWorking();
- },"prompting":function(){
- _1c7d.onPrompting();
- }}}};
- return _1c80;
- };
- }
- };
- HiddenIframeDispatcherEntry.prototype.setIframeId=function(id){
- this._iframeId=id;
- };
- HiddenIframeDispatcherEntry.prototype.getIframeId=function(){
- return this._iframeId;
- };
- HiddenIframeDispatcherEntry.prototype._createForm=function(_1c82){
- var oCV=this.getViewer();
- var _1c84=HiddenIframeDispatcherEntry.FORM_NAME+oCV.getId();
- var _1c85=document.getElementById(_1c84);
- if(_1c85){
- _1c85.parentNode.removeChild(_1c85);
- _1c85=null;
- }
- var _1c86=location.protocol+"//"+location.host+oCV.m_sGateway;
- _1c85=document.createElement("form");
- _1c85.setAttribute("method","post");
- _1c85.setAttribute("action",_1c86);
- _1c85.setAttribute("target",this.getIframeId());
- _1c85.setAttribute("id",_1c84);
- _1c85.style.display="none";
- var _1c87=this.getRequest().getFormFields();
- var _1c88=_1c87.keys();
- for(var index=0;index<_1c88.length;index++){
- _1c85.appendChild(createHiddenFormField(_1c88[index],_1c87.get(_1c88[index])));
- }
- document.body.appendChild(_1c85);
- return _1c85;
- };
- HiddenIframeDispatcherEntry.prototype._createHiddenIframe=function(){
- var oCV=this.getViewer();
- var _1c8b=this.getIframeId();
- var _1c8c=document.getElementById(_1c8b);
- if(_1c8c){
- _1c8c.parentNode.parentNode.removeChild(_1c8c.parentNode);
- }
- var div=document.createElement("div");
- div.style.position="absolute";
- div.style.left="0px";
- div.style.top="0px";
- div.style.display="none";
- document.body.appendChild(div);
- div.innerHTML="<iframe frameborder=\"0\" id=\""+_1c8b+"\" name=\""+_1c8b+"\"></iframe>";
- _1c8c=document.getElementById(_1c8b);
- var _1c8e=this;
- var func=function(){
- HiddenIframeDispatcherEntry.handleIframeLoad(_1c8e);
- };
- if(_1c8c.attachEvent){
- _1c8c.attachEvent("onload",func);
- }else{
- _1c8c.addEventListener("load",func,true);
- }
- };
- HiddenIframeDispatcherEntry.hideIframe=function(cvId){
- var _1c91=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
- if(_1c91){
- _1c91.parentNode.style.display="none";
- }
- };
- HiddenIframeDispatcherEntry.showIframeContentsInWindow=function(cvId){
- var _1c93=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
- if(!_1c93){
- return;
- }
- var html=_1c93.contentWindow.document.getElementsByTagName("html")[0].innerHTML;
- var _1c95=window.open("","","height=400,width=500");
- if(_1c95){
- _1c95.document.write("<html>"+html+"</html>");
- }
- };
- HiddenIframeDispatcherEntry.handleIframeLoad=function(_1c96){
- if(!_1c96){
- return;
- }
- var _1c97=document.getElementById(_1c96.getIframeId());
- if(!_1c97){
- return;
- }
- var oCV=_1c97.contentWindow.window.gaRV_INSTANCES?_1c97.contentWindow.window.gaRV_INSTANCES[0]:null;
- var _1c99=oCV?oCV.getStatus():null;
- if(_1c99=="complete"){
- _1c96.onComplete();
- }
- if(_1c99=="working"){
- _1c96.onWorking();
- }
- if(_1c99=="prompting"){
- _1c96.onPrompting();
- }
- if(!oCV||_1c99=="fault"||_1c99==""){
- _1c96.onFault();
- }
- };
- HiddenIframeDispatcherEntry.prototype.onFault=function(){
- this._iframeRequestComplete();
- HiddenIframeDispatcherEntry.showIframeContentsInWindow(this.getViewer().getId());
- };
- HiddenIframeDispatcherEntry.prototype.onPrompting=function(){
- this._iframeRequestComplete();
- if(this.m_httpRequestConfig){
- var _1c9a=this.m_httpRequestConfig.getReportStatusCallback("prompting");
- if(typeof _1c9a=="function"){
- _1c9a();
- }
- }
- HiddenIframeDispatcherEntry.showIframeContentsInWindow(this.getViewer().getId());
- };
- HiddenIframeDispatcherEntry.prototype.onComplete=function(){
- this._iframeRequestComplete();
- if(this.m_httpRequestConfig){
- var _1c9b=this.m_httpRequestConfig.getReportStatusCallback("complete");
- if(typeof _1c9b=="function"){
- _1c9b();
- }
- }
- var _1c9c=document.getElementById(this.getIframeId());
- if(typeof _1c9c.contentWindow.detachLeavingRV=="function"){
- _1c9c.contentWindow.detachLeavingRV();
- }
- var _1c9d=_1c9c.parentNode;
- _1c9d.style.display="none";
- if(this.getCallbacks()&&this.getCallbacks()["complete"]){
- HiddenIframeDispatcherEntry.executeCallback(this.getCallbacks()["complete"]);
- }
- };
- HiddenIframeDispatcherEntry.prototype.cancelRequest=function(_1c9e){
- this._iframeRequestComplete();
- if(!this.m_bCancelCalled){
- this.m_bCancelCalled=true;
- var _1c9f=document.getElementById(this.getIframeId());
- if(!_1c9f){
- return;
- }
- var oCV=_1c9f.contentWindow[getCognosViewerObjectString(this.getViewer().getId())];
- if(oCV){
- oCV.cancel();
- }
- }
- };
- HiddenIframeDispatcherEntry.executeCallback=function(_1ca1){
- if(_1ca1){
- var _1ca2=GUtil.generateCallback(_1ca1.method,_1ca1.params,_1ca1.object);
- _1ca2();
- }
- };
- HiddenIframeDispatcherEntry.getIframe=function(cvId){
- var _1ca4=document.getElementById(HiddenIframeDispatcherEntry.IFRAME_ID_PREFIX+cvId);
- return _1ca4;
- };
- function ReportInfoDispatcherEntry(oCV){
- ReportInfoDispatcherEntry.baseConstructor.call(this,oCV);
- if(oCV){
- this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting}});
- this.getRequestHandler().setFaultDialog(new ModalFaultDialog(oCV));
- }
- };
- ReportInfoDispatcherEntry.prototype=new AsynchJSONDispatcherEntry();
- ReportInfoDispatcherEntry.baseConstructor=AsynchJSONDispatcherEntry;
- ReportInfoDispatcherEntry.prototype.initializeAction=function(_1ca6){
- this.setKey(_1ca6.getActionKey());
- this.setCanBeQueued(_1ca6.canBeQueued());
- this.m_action=_1ca6;
- };
- ReportInfoDispatcherEntry.prototype.getAction=function(){
- return this.m_action;
- };
- ReportInfoDispatcherEntry.prototype.prepareRequest=function(){
- var _1ca7=new ActionFormFields(this);
- _1ca7.addFormFields();
- };
- ReportInfoDispatcherEntry.prototype.onComplete=function(_1ca8,arg1){
- if(this.m_oCV.getViewerDispatcher().queueIsEmpty()==true){
- var _1caa=this.m_action.getOnCompleteCallback();
- _1caa(_1ca8);
- }
- };
- ReportInfoDispatcherEntry.prototype.onPrompting=function(_1cab,arg1){
- var _1cad=this.m_action.getOnPromptingCallback();
- _1cad(_1cab);
- };
- ReportInfoDispatcherEntry.prototype.onPostEntryComplete=function(){
- var oCV=this.getViewer();
- if(oCV&&oCV.getViewerWidget()){
- var _1caf=oCV.getViewerWidget();
- _1caf.getLoadManager().processQueue();
- }
- };
- function ModifyReportDispatcherEntry(oCV){
- ModifyReportDispatcherEntry.baseConstructor.call(this,oCV);
- this.m_action=null;
- if(oCV){
- this.m_viewerWidget=oCV.getViewerWidget();
- this.setRequestHandler(new RequestHandler(oCV));
- this.setWorkingDialog(oCV.getWorkingDialog());
- this.setRequestIndicator(oCV.getRequestIndicator());
- this.setCallbacks({"complete":{"object":this,"method":this.onComplete},"prompting":{"object":this,"method":this.onPrompting}});
- }
- };
- ModifyReportDispatcherEntry.prototype=new AsynchDataDispatcherEntry();
- ModifyReportDispatcherEntry.baseConstructor=AsynchDataDispatcherEntry;
- ModifyReportDispatcherEntry.prototype.parent=AsynchDataDispatcherEntry.prototype;
- ModifyReportDispatcherEntry.prototype.initializeAction=function(_1cb1){
- this.setKey(_1cb1.getActionKey());
- this.setCanBeQueued(_1cb1.canBeQueued());
- this.m_action=_1cb1;
- };
- ModifyReportDispatcherEntry.prototype.getAction=function(){
- return this.m_action;
- };
- ModifyReportDispatcherEntry.prototype.prepareRequest=function(){
- if(this.m_viewerWidget){
- DispatcherEntry.addWidgetInfoToFormFields(this.m_viewerWidget,this);
- }
- var _1cb2=new ActionFormFields(this);
- _1cb2.addFormFields();
- if(this.m_viewerWidget){
- this.addFormField("cv.id",this.m_viewerWidget.getViewerId());
- }
- this.addFormField("keepIterators","true");
- this.addFormField("run.prompt",this.m_action.getPromptOption());
- if(this.m_action.reuseQuery()===true){
- this.addFormField("reuseResults","true");
- }else{
- if(this.m_action.reuseGetParameter()===true){
- this.addFormField("reuseResults","paramInfo");
- }
- }
- if(this.m_action.keepRAPCache()===false&&this.m_viewerWidget){
- this.m_viewerWidget.clearRAPCache();
- }
- if(this.m_action.reuseConversation()===true){
- this.addFormField("cv.reuseConversation","true");
- }
- if(this.m_action.isUndoable()&&this.m_action.getUndoRedoQueue()){
- this.m_action.getUndoRedoQueue().initUndoObj({"tooltip":this.m_action.getUndoHint(),"saveSpec":this.m_action.saveSpecForUndo()});
- }
- if(this.getViewer().getCurrentlySelectedTab()&&!this.formFieldExists("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup")){
- this.addFormField("generic.anyURI.http://developer.cognos.com/ceba/constants/runOptionEnum#pageGroup",this.getViewer().getCurrentlySelectedTab());
- }
- this.getViewer().clearTabs();
- };
- ModifyReportDispatcherEntry.prototype.onComplete=function(_1cb3,arg1){
- if(this.getRequestHandler()){
- this.getRequestHandler().onComplete(_1cb3);
- }
- };
- ModifyReportDispatcherEntry.prototype.onPrompting=function(_1cb5){
- if(this.getRequestHandler()){
- this.getRequestHandler().onPrompting(_1cb5);
- }
- };
- ModifyReportDispatcherEntry.prototype.onWorking=function(_1cb6,arg1){
- this.parent.onWorking.call(this,_1cb6,arg1);
- var _1cb8=_1cb6.getResponseState();
- if(this.getRequestHandler()){
- this.getRequestHandler().updateViewerState(_1cb8);
- }
- };
- dojo.provide("ModalInfoMessageDialog");
- dojo.declare("ModalInfoMessageDialog",null,{sMessage:"",sDescription:"",sTitle:"",constructor:function(args){
- dojo.safeMixin(this,args);
- },getMessage:function(){
- return this.sMessage;
- },getDescription:function(){
- return this.sDescription;
- },getTitle:function(){
- return this.sTitle;
- },show:function(){
- dojo["require"]("bux.dialogs.InformationDialog");
- var _1cba=new bux.dialogs.InformationDialog({title:this.getTitle(),sMainMessage:this.getMessage(),sDescription:this.getDescription(),sInfoIconClass:"bux-informationDialog-info-icon"});
- _1cba.show();
- }});
- function CCognosViewerSaveReport(_1cbb,_1cbc){
- this.m_cognosViewer=_1cbb;
- this.m_params=null;
- this.dashboardToSaveIn=_1cbc.cm$storeID;
- this.m_doSaveAsOnFault=false;
- };
- CCognosViewerSaveReport.prototype.canSave=function(_1cbd){
- return (this.doSaveAs()||_1cbd&&_1cbd.indexOf("write")!==-1);
- };
- CCognosViewerSaveReport.prototype.isSavedOutput=function(){
- var _1cbe=this.m_cognosViewer.envParams["ui.action"];
- return (typeof _1cbe!=="undefined"&&_1cbe==="view");
- };
- CCognosViewerSaveReport.prototype.doSaveAs=function(){
- var _1cbf=(this.m_doSaveAsOnFault||!this.m_cognosViewer.envParams["savedReportName"]||!this.isSameDashboard());
- return _1cbf;
- };
- CCognosViewerSaveReport.prototype.isSameDashboard=function(){
- var _1cc0=(this.m_cognosViewer.envParams["ui.object"].indexOf(this.dashboardToSaveIn)!==-1);
- return _1cc0;
- };
- CCognosViewerSaveReport.prototype.getUIAction=function(){
- return (this.doSaveAs()?"saveInDashboard":"updateSavedReport");
- };
- CCognosViewerSaveReport.prototype.populateRequestParams=function(_1cc1){
- _1cc1.addFormField("ui.action",this.getUIAction());
- _1cc1.addFormField("cv.ignoreState","true");
- _1cc1.addFormField("dashboard-id",this.dashboardToSaveIn);
- _1cc1.addNonEmptyStringFormField("executionParameters",this.m_cognosViewer.m_sParameters);
- for(var param in this.m_cognosViewer.envParams){
- if(param.indexOf("frag-")==0||param=="cv.actionState"||param=="ui.primaryAction"||param=="dashboard"||param=="ui.action"||param=="cv.responseFormat"||param=="b_action"){
- continue;
- }
- _1cc1.addFormField(param,this.m_cognosViewer.envParams[param]);
- }
- };
- CCognosViewerSaveReport.prototype.getCognosViewer=function(){
- return this.m_cognosViewer;
- };
- CCognosViewerSaveReport.prototype.getViewerWidget=function(){
- return this.getCognosViewer().getViewerWidget();
- };
- CCognosViewerSaveReport.prototype.dispatchRequest=function(){
- var _1cc3=this.m_cognosViewer;
- var _1cc4=this.getViewerWidget();
- var _1cc5={"complete":{"object":_1cc4,"method":_1cc4.handleWidgetSaveDone},"fault":{"object":this,"method":this.onFault}};
- var _1cc6=new AsynchJSONDispatcherEntry(_1cc3);
- _1cc6.setCallbacks(_1cc5);
- this.populateRequestParams(_1cc6);
- _1cc3.dispatchRequest(_1cc6);
- };
- CCognosViewerSaveReport.prototype.onFault=function(_1cc7,arg1){
- var _1cc9=this.m_cognosViewer;
- var _1cca=this.getViewerWidget();
- var _1ccb=_1cc7.getSoapFault();
- var _1ccc=XMLHelper_FindChildByTagName(_1ccb,"Fault",true);
- if(this.ifIsEmptySelectionFault(_1ccc)){
- this.handleEmptySelectionFault();
- return;
- }
- var _1ccd=_1ccb.createElement("allowRetry");
- _1ccd.appendChild(_1ccb.createTextNode("false"));
- _1ccc.appendChild(_1ccd);
- var _1cce=XMLBuilderSerializeNode(_1ccc);
- _1cc9.setSoapFault(_1cce);
- _1cca.handleFault();
- var _1ccf={"status":false};
- _1cca.iContext.iEvents.fireEvent("com.ibm.bux.widget.save.done",null,_1ccf);
- };
- CCognosViewerSaveReport.prototype.ifIsEmptySelectionFault=function(_1cd0){
- if(_1cd0){
- var _1cd1=XMLHelper_FindChildByTagName(_1cd0,"errorCode",true);
- if(_1cd1){
- var _1cd2=XMLHelper_GetText(_1cd1,false);
- return (_1cd2==="cmEmptySelection");
- }
- }
- return false;
- };
- CCognosViewerSaveReport.prototype.handleEmptySelectionFault=function(){
- delete (this.m_cognosViewer.envParams["savedReportName"]);
- this.m_doSaveAsOnFault=true;
- this.dispatchRequest();
- };
- SAVE_REPORT_TYPE={reportView:"application/x-ibmcognos_v5reportview+xml",report:"application/x-ibmcognos_v5report+xml"};
- function ViewerIWidgetSave(_1cd3,_1cd4){
- this.m_ViewerWidget=_1cd3;
- this.m_payload=_1cd4;
- this._setIsSavedDashboard();
- };
- ViewerIWidgetSave.prototype.setDoCWCopy=function(value){
- this._doCWCopy=value;
- };
- ViewerIWidgetSave.prototype._getSavedReport=function(){
- var _1cd6=this._getWidgetAttributeValue("savedReportPath");
- if(!_1cd6){
- _1cd6=this._getWidgetAttributeValue("savedReportName");
- }
- return _1cd6;
- };
- ViewerIWidgetSave.prototype._setIsSavedDashboard=function(){
- var _1cd7=this._getSavedReport();
- this._bIsSavedDashboard=(_1cd7!==null&&_1cd7!==undefined&&_1cd7.length!==0);
- };
- ViewerIWidgetSave.prototype._isSavedDashboard=function(){
- return this._bIsSavedDashboard;
- };
- ViewerIWidgetSave.prototype.canSave=function(_1cd8){
- return (this._doSaveNewOrSaveAs()||_1cd8&&_1cd8.indexOf("write")!==-1||this.m_ViewerWidget.isDropped());
- };
- ViewerIWidgetSave.prototype.isSavedOutput=function(){
- var _1cd9=this.m_cognosViewer.envParams["ui.action"];
- return (typeof _1cd9!=="undefined"&&_1cd9==="view");
- };
- ViewerIWidgetSave.prototype._doSaveNewOrSaveAs=function(){
- var _1cda=(this.m_payload.operation==="save"&&!this._isSavedDashboard())||(this.m_payload.operation==="saveAs");
- return _1cda;
- };
- ViewerIWidgetSave.prototype._getWidgetAttributeValue=function(_1cdb){
- return this._getViewerWidget().getAttributeValue(_1cdb);
- };
- ViewerIWidgetSave.prototype._getEnvParam=function(_1cdc){
- return this._getViewerWidget().getEnvParam(_1cdc);
- };
- ViewerIWidgetSave.prototype._getViewerWidget=function(){
- return this.m_ViewerWidget;
- };
- ViewerIWidgetSave.prototype._isLimitedInteractiveMode=function(){
- return this._getViewerWidget().isLimitedInteractiveMode();
- };
- ViewerIWidgetSave.prototype._getDefaultReportName=function(){
- return this._getEnvParam("ui.name");
- };
- ViewerIWidgetSave.prototype._getReportSpec=function(){
- return this._getEnvParam("ui.spec");
- };
- ViewerIWidgetSave.prototype._getCurrentReportIsReportView=function(){
- return (this._getEnvParam("ui.objectClass")==="reportView");
- };
- ViewerIWidgetSave.prototype.doGetSavePropertiesFromServer=function(){
- this.delayedLoadingContext=this._getViewerWidget().getLoadManager().getDelayedLoadingContext();
- if(this._getEnvParam("delayedLoadingExecutionParams")){
- return true;
- }
- return (this.delayedLoadingContext&&this.delayedLoadingContext.getPromptValues()!==null);
- };
- ViewerIWidgetSave.prototype.getSavePropertiesFromServer=function(){
- var oCV=this._getViewerWidget().getViewerObject();
- var _1cde=new JSONDispatcherEntry(oCV);
- var _1cdf=this._getViewerWidget();
- _1cde.setCallbacks({customArguments:[this.m_payload],complete:{"object":_1cdf,"method":_1cdf.handleGetSavePropertiesFromServerResponse}});
- this._addRequestOptions(_1cde);
- _1cde.sendRequest();
- };
- ViewerIWidgetSave.prototype._addRequestOptions=function(_1ce0){
- _1ce0.addFormField("ui.action","noOp");
- _1ce0.addFormField("bux","true");
- _1ce0.addFormField("cv.responseFormat","IWidgetSavePropertiesJSON");
- if(this._getEnvParam("delayedLoadingExecutionParams")){
- _1ce0.addFormField("delayedLoadingExecutionParams",this._getEnvParam("delayedLoadingExecutionParams"));
- }else{
- _1ce0.addFormField("ui.conversation",this._getViewerWidget().getViewerObject().getConversation());
- }
- var _1ce1=this.delayedLoadingContext.getPromptValues();
- for(var _1ce2 in _1ce1){
- _1ce0.addFormField(_1ce2,_1ce1[_1ce2]);
- }
- };
- ViewerIWidgetSave.prototype._getExecutionParameters=function(){
- return this._getViewerWidget().getViewerObject().getExecutionParameters();
- };
- ViewerIWidgetSave.prototype._setExecutionParameters=function(body){
- var _1ce4=this._getExecutionParameters();
- var doc=XMLBuilderLoadXMLFromString(_1ce4);
- if(!doc.documentElement){
- return;
- }
- var root=XMLBuilderCreateXMLDocument("root");
- var _1ce7=root.createElement("parameters");
- XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:SOAP-ENC","http://schemas.xmlsoap.org/soap/encoding/");
- XMLBuilderSetAttributeNodeNS(_1ce7,"xsi:type","bus:parameterValueArrayProp","http://www.w3.org/2001/XMLSchema-instance");
- XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:bus","http://developer.cognos.com/schemas/bibus/3/");
- XMLBuilderSetAttributeNodeNS(_1ce7,"xmlns:xs","http://www.w3.org/2001/XMLSchema");
- root.documentElement.appendChild(_1ce7);
- var _1ce8=XMLHelper_FindChildrenByTagName(doc.documentElement,"item",false);
- var _1ce9=root.createElement("value");
- XMLBuilderSetAttributeNodeNS(_1ce9,"xsi:type","SOAP-ENC:Array","http://www.w3.org/2001/XMLSchema-instance");
- _1ce7.appendChild(_1ce9);
- var _1cea=_1ce8.length;
- for(var i=0;i<_1ce8.length;i++){
- var eName=XMLHelper_FindChildByTagName(_1ce8[i],"name",false);
- if(eName&&eName.childNodes[0].nodeValue.indexOf("credential:")!==-1){
- _1cea--;
- continue;
- }
- _1ce9.appendChild(_1ce8[i]);
- }
- XMLBuilderSetAttributeNodeNS(_1ce9,"SOAP-ENC:arrayType","bus:parameterValue["+_1cea+"]","http://schemas.xmlsoap.org/soap/encoding/");
- body.parameters=XMLBuilderSerializeNode(_1ce7);
- };
- ViewerIWidgetSave.prototype._setSourceObject=function(_1ced,_1cee){
- var _1cef=(_1cee===true)?this._getEnvParam("ui.object"):this._getEnvParam("originalReport");
- if(_1cef){
- _1ced.sourceObject=_1cef;
- }
- };
- ViewerIWidgetSave.prototype._setReportTypeToReportView=function(_1cf0){
- _1cf0.type=SAVE_REPORT_TYPE.reportView;
- };
- ViewerIWidgetSave.prototype._setReportTypeToReport=function(_1cf1){
- _1cf1.type=SAVE_REPORT_TYPE.report;
- };
- ViewerIWidgetSave.prototype._setReportSpec=function(body){
- body.specification=this._getReportSpec();
- };
- ViewerIWidgetSave.prototype._setResourceForSave=function(_1cf3){
- if(!this._getCurrentReportIsReportView()&&!this._isLimitedInteractiveMode()){
- this._setReportSpec(_1cf3.body);
- this._setReportTypeToReport(_1cf3);
- }
- return _1cf3;
- };
- ViewerIWidgetSave.prototype._setResourceForCopy=function(_1cf4){
- this._setReportSpec(_1cf4.body);
- this._setReportTypeToReport(_1cf4);
- return _1cf4;
- };
- ViewerIWidgetSave.prototype._setResourceForSaveNew=function(_1cf5){
- var _1cf6=false;
- if(this._getEnvParam("originalReport")==null){
- _1cf6=true;
- }
- this._setSourceObject(_1cf5,_1cf6);
- if(this._isLimitedInteractiveMode()){
- this._setReportTypeToReportView(_1cf5);
- }else{
- this._setReportTypeToReport(_1cf5);
- this._setReportSpec(_1cf5.body);
- }
- return _1cf5;
- };
- ViewerIWidgetSave.prototype._setResourceForSaveAs=function(_1cf7){
- if(this._getCurrentReportIsReportView()){
- this._setReportTypeToReportView(_1cf7);
- this._setSourceObject(_1cf7);
- }else{
- if(this._isLimitedInteractiveMode()){
- this._setReportTypeToReportView(_1cf7);
- this._setSourceObject(_1cf7,true);
- }else{
- this._setReportTypeToReport(_1cf7);
- this._setSourceObject(_1cf7,true);
- this._setReportSpec(_1cf7.body);
- }
- }
- return _1cf7;
- };
- ViewerIWidgetSave.prototype._getResource=function(){
- var _1cf8={};
- if(this._doCWCopy===true){
- _1cf8.copyOnCreate=true;
- }
- _1cf8.body={};
- var _1cf9=(this.m_payload.operation==="save");
- var _1cfa=(this.m_payload.operation==="copy");
- if(_1cfa){
- this._setResourceForCopy(_1cf8);
- }else{
- if(_1cf9){
- this._setResourceForSave(_1cf8);
- }else{
- if(this._isSavedDashboard()){
- this._setResourceForSaveAs(_1cf8);
- }else{
- this._setResourceForSaveNew(_1cf8);
- }
- }
- }
- this._setExecutionParameters(_1cf8.body);
- if(!_1cfa){
- _1cf8.itemSetUpdate={name:"savedReportPath",type:"searchPath"};
- }
- return _1cf8;
- };
- ViewerIWidgetSave.prototype._getWidgetId=function(){
- return this._getViewerWidget().getWidgetId();
- };
- ViewerIWidgetSave.prototype.getPayload=function(){
- var _1cfb={};
- _1cfb.resource=new Array();
- _1cfb.widgetId=this._getWidgetId();
- _1cfb.resource.push(this._getResource());
- return _1cfb;
- };
- dojo.provide("viewer.dialogs.SelectBusinessProcess");
- dojo.require("bux.dialogs.BaseCustomContentDialog");
- dojo.require("bux.layout.TableContainer");
- dojo.require("dijit.form.NumberTextBox");
- dojo.require("dijit.form.Button");
- dojo.declare("viewer.dialogs.SelectBusinessProcess",bux.dialogs.BaseCustomContentDialog,{sTitle:null,sLabel:null,okHandler:null,cancelHanlder:null,buildRendering:function(){
- 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"}];
- this.inherited(arguments);
- if(!this.BPMProcessesInfo||this.BPMProcessesInfo.length===0){
- this._buxBaseDialog._aButtonObjects[0].set("disabled",true);
- }
- },startup:function(){
- this.updateTitle(this.sTitle);
- this.inherited(arguments);
- this.set("role","group");
- var _1cfc=new bux.layout.TableContainer({classname:"bux-InformationDialog buxFilterConfigDiscreteValuesTable"},this.contentContainer);
- var row=new bux.layout.TableContainerRow({classname:"bux-dialog-label",parentContainer:_1cfc});
- var cell=new bux.layout.TableContainerCell({parentContainer:row});
- this.generateSelectProcessSection(cell);
- cell.addContent(document.createElement("br"));
- this.generateViewInputValuesSection(cell);
- cell.addContent(document.createElement("br"));
- },addDivContainer:function(_1cff,sID,sRole){
- var div=document.createElement("div");
- dojo.attr(div,{"class":"buxFilterConfigFilterValue","aria-labelledby":sID,role:sRole});
- _1cff.addContent(div);
- return div;
- },generateSelectProcessSection:function(_1d03){
- var _1d04=this.id+"_selectProcess_a11ylabel";
- this.addTableDescription(_1d03,this.sLabel,_1d04);
- var div=this.addDivContainer(_1d03,_1d04,"radiogroup");
- var _1d06=new bux.layout.TableContainer({classname:"buxFilterConfigFilterValueTable"});
- dojo.style(_1d06.domNode,"width","325px");
- this.addSelectProcessTableHeader(_1d06);
- if(!this.BPMProcessesInfo||this.BPMProcessesInfo.length===0){
- this.addEmptySelectProcessTableContent(_1d06);
- }else{
- this.addSelectProcessTableContent(_1d06);
- }
- div.appendChild(_1d06.domNode);
- },addSelectProcessTableHeader:function(_1d07){
- var _1d08=new bux.layout.TableContainerRow({classname:"buxFilterConfigFilterValueTableHeaderRow",parentContainer:_1d07});
- var _1d09=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeaderLeft",width:"25px",parentContainer:_1d08});
- var _1d0a=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeader",width:"300px",parentContainer:_1d08});
- _1d0a.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_TABLE_HEADER));
- },addEmptySelectProcessTableContent:function(_1d0b){
- var _1d0c=this.id+"_processItemsRow_label_none";
- var _1d0d=new bux.layout.TableContainerRow({parentContainer:_1d0b});
- dojo.attr(_1d0d.domNode,{id:this.id+"_processItemsRow_none","aria-labelledby":_1d0c,tabindex:0});
- var _1d0e=this.createA11yLabel(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_NO_PROCESS_A11Y,_1d0c,true);
- _1d0d.domNode.appendChild(_1d0e);
- var cell=new bux.layout.TableContainerCell({parentContainer:_1d0d});
- cell.set("colspan",2);
- cell.addContent(this.createLabelElement(RV_RES.IDS_JS_BUSINESS_PROCESS_SELECT_DIALOG_NO_PROCESS));
- },addSelectProcessTableContent:function(_1d10){
- for(var i=0;i<this.BPMProcessesInfo.length;i++){
- var _1d12=new dijit.form.RadioButton({checked:((i===0)?true:false),name:this.id+"_processItem",disabled:false});
- var _1d13=html_encode(this.BPMProcessesInfo[i].sCaption);
- var _1d14=this.BPMProcessesInfo[i].sBPD_ID;
- var _1d15=this.BPMProcessesInfo[i].sProcessAppID;
- _1d12.onChange=dojo.hitch(this,"getProcessItemRadioChangeFunction",_1d14,_1d15,_1d13,_1d12);
- var _1d16=new bux.layout.TableContainerRow({parentContainer:_1d10,classname:((i===0)?"buxFilterConfigFilterValueRowSelected":"")});
- _1d16.set("id",this.id+"_processItemsRow"+_1d12.id);
- var _1d17=new bux.layout.TableContainerCell({align:"center",parentContainer:_1d16});
- _1d17.addContent(_1d12.domNode);
- _1d17.set("id",this.id+"_processItemsCell"+i);
- var _1d18=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"300px",valign:"top",parentContainer:_1d16});
- var _1d19=document.createElement("label");
- _1d19.appendChild(document.createTextNode(_1d13));
- _1d19.setAttribute("for",_1d12.id);
- _1d18.addContent(_1d19);
- }
- this.setDefaultProcessSelectedInfo();
- },setDefaultProcessSelectedInfo:function(){
- this._selectedBPD_ID=this.BPMProcessesInfo[0].sBPD_ID;
- this._selectedProcessAppId=this.BPMProcessesInfo[0].sProcessAppID;
- this._selectedProcessName=html_encode(this.BPMProcessesInfo[0].sCaption);
- },getProcessItemRadioChangeFunction:function(_1d1a,_1d1b,_1d1c,radio){
- if(radio.get("value")==="on"){
- dojo.byId(this.id+"_processItemsRow"+radio.id).className="buxFilterConfigFilterValueRowSelected";
- this._selectedBPD_ID=_1d1a;
- this._selectedProcessAppId=_1d1b;
- this._selectedProcessName=_1d1c;
- }else{
- dojo.byId(this.id+"_processItemsRow"+radio.id).className="";
- }
- },generateViewInputValuesSection:function(_1d1e){
- var _1d1f=this.id+"_viewInputValues_a11ylabel";
- this.addTableDescription(_1d1e,RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_DESCRIPTION,_1d1f);
- this.addViewInputValuesTable(_1d1e,_1d1f);
- },addViewInputValuesTable:function(_1d20,_1d21){
- _1d20.addContent(this.generateViewInputValuesTable(_1d21));
- },addTableDescription:function(_1d22,_1d23,sID){
- var div=document.createElement("div");
- dojo.attr(div,{"class":"bux-label",id:sID});
- div.appendChild(document.createTextNode(html_encode(_1d23)));
- _1d22.addContent(div);
- },generateViewInputValuesTable:function(_1d26){
- var _1d27=this.bpAction.getInputParameter();
- var div=document.createElement("div");
- dojo.attr(div,{"class":"buxFilterConfigFilterValue",style:"height:80px",role:"group","aria-labelledby":_1d26});
- var _1d29=new bux.layout.TableContainer({classname:"buxFilterConfigFilterValueTable"});
- dojo.style(_1d29.domNode,"width","335px");
- _1d29.set("role","list");
- div.appendChild(_1d29.domNode);
- var _1d2a=new bux.layout.TableContainerRow({classname:"buxFilterConfigFilterValueTableHeaderRow",parentContainer:_1d29});
- var _1d2b=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeaderLeft",width:"40%",parentContainer:_1d2a});
- _1d2b.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_COLUMN_HEADER_DATA_ITEM));
- var _1d2c=new bux.layout.TableContainerCell({classname:"buxListHeader buxFilterConfigFilterValueTableHeader",width:"60%",parentContainer:_1d2a});
- _1d2c.addContent(document.createTextNode(RV_RES.IDS_JS_BUSINESS_PROCESS_VIEW_INPUT_VALUES_TABLE_COLUMN_HEADER_DISPLAY_VALUE_HEADER));
- var _1d2d=_1d27.cognosParameter;
- var _1d2e=false;
- for(var i=0;i<_1d2d.length;i++){
- var _1d30=0;
- var _1d31=this.getWidgetContextValues(_1d2d[i]);
- for(var _1d32 in _1d31){
- var row=new bux.layout.TableContainerRow({parentContainer:_1d29});
- var _1d34={id:this.id+"_inputValueRow_"+_1d30,role:"listitem"};
- if(!_1d2e){
- _1d34.tabindex=0;
- _1d2e=true;
- }
- dojo.attr(row.domNode,_1d34);
- this.addRowAccessibility(row,_1d30,_1d32,_1d31[_1d32]);
- var _1d35=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"40%",valign:"top",parentContainer:row});
- _1d35.set("id",this.id+"_dataItem_"+i);
- _1d35.addContent(this.createLabelElement(_1d32));
- var _1d36=new bux.layout.TableContainerCell({classname:"buxFilterConfigFilterItemName text_overflow_ellipsis_ie",width:"60%",valign:"top",parentContainer:row});
- _1d36.set("id",this.id+"_displayValue_"+i);
- _1d36.addContent(this.createLabelElement(_1d31[_1d32][0]));
- _1d30++;
- }
- }
- return div;
- },getWidgetContextValues:function(_1d37){
- return values=_1d37["com.ibm.widget.context"].values;
- },addRowAccessibility:function(row,_1d39,_1d3a,_1d3b){
- var _1d3c=this.id+"_inputValueRow_label_"+_1d39;
- dojo.attr(row.domNode,{"aria-labelledby":_1d3c});
- 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;
- row.domNode.appendChild(this.createA11yLabel(_1d3d,_1d3c,true));
- dojo.connect(row.domNode,"onkeypress",dojo.hitch(this,this._rowOnKeyPress));
- },_rowOnKeyPress:function(evt){
- switch(evt.keyCode){
- case dojo.keys.DOWN_ARROW:
- this.changeNodeFocus(evt,evt.target,evt.target.nextSibling);
- break;
- case dojo.keys.UP_ARROW:
- this.changeNodeFocus(evt,evt.target,evt.target.previousSibling);
- break;
- }
- },changeNodeFocus:function(evt,_1d40,_1d41){
- if(!_1d41||(_1d41&&_1d41.id&&_1d41.id.indexOf("_inputValueRow_")===-1)){
- return;
- }
- dojo.attr(_1d40,{tabindex:-1});
- dojo.attr(_1d41,{tabindex:0});
- dijit.focus(_1d41);
- if(dojo.isIE||dojo.isTrident){
- evt.keyCode=0;
- }
- dojo.stopEvent(evt);
- },createA11yLabel:function(_1d42,_1d43,_1d44){
- var _1d45=this.createLabelElement(_1d42);
- var _1d46={id:_1d43};
- if(_1d44){
- _1d46.style="visibility:hidden;display:none";
- }
- dojo.attr(_1d45,_1d46);
- return _1d45;
- },createLabelElement:function(_1d47){
- var _1d48=document.createElement("span");
- _1d48.appendChild(document.createTextNode(html_encode(_1d47)));
- return _1d48;
- },onOK:function(){
- this.hide();
- this.bpAction.startProcess(this._selectedBPD_ID,this._selectedProcessAppId,this._selectedProcessName);
- }});
|