1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2021
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <!-- This morphlet provides functionality to launch the difference IBM Cognos studios. It is normally invoked by the
- cognosLaunch() and cognosLaunchInWindow() javascript functions.
- The general execution path of this morphlet is as follows:
- 1. Session Management - Create/Update the CC session. This is needed as launch.xts is a possible
- entry point, and the session may not exist.
- 2. Launch Setup - Read the launch parameter XML file and parse through it to generate the
- provided launch parameters. Check if the user has all needed
- privileges and determine if any prompts need to be run.
- 3. Package Select - Select the package to be used (in 4. *Prompts*) as the ui.object when launching a studio
- with a ui.action of new. This prompt can possibly output a package selection
- dialog.
- The following additional parameters are also retrieved:
- ui.routingServerGroup
- ui.defaultAnalysis (AnalysisStudio only)
- ui.memberDisplayCountDefault (AnalysisStudio only)
- ui.memberDisplayCountLimit (AnalysisStudio only)
- ui.appname (Contributor only)
- 4. *Prompts* - Retrieve various additional parameters needed by the studios. Two internal
- prompts are provided. These prompts are independant and may be executed
- in parallel.
- 4-a. routingServerGroup Prompt - Retrieve the routingServerGroup for the package assigned to the provided
- ui.object. This value is passed in the ui.routingServerGroup parameter.
- 4-b. defaultAnalysis Prompt - Retrieve the defaultAnalysis for the package assigned to the provided
- ui.object. This value is passed in the ui.defaultAnalysis parameter.
- 5. MRU - Update the most recently used package list.
- 6. Launch Output - The main output blocks for launch. These encompass three possible tasks.
- 1. Displaying an error message.
- 2. Redirecting to an external prompt.
- 3. Performing the final launch to the studio.
- 7. Debug - Display debugging information.
- An example of an actual block execution order, with block sections added, is below:
- Block Section
- 1. refreshSession Session Management
- 2. retrieveComponentInfo Launch Setup
- 3. onPackageSelected package Prompt
- 4. buildSession Session Management
- 5. validatePassport Launch Setup
- 6. setupParams Launch Setup
- 7. checkSpecifiableMissingParams Launch Setup
- 8. getSelectedPackage package Prompt
- 9. checkPackage package Prompt
- 10. prepareSOSEnvironment package Prompt
- 11. handleCallerEnv package Prompt
- 12. preprocess package Prompt
- 13. messages package Prompt
- 14. buildSpec package Prompt
- 15. getContent package Prompt
- 16. setSearchExpression package Prompt
- 17. getContent2 package Prompt
- 18. formlogic_init package Prompt
- 19. filterMRUentries MRU
- 20. retrievePackagePropertyInfo package Prompt
- 21. contentLogic package Prompt
- 22. packCallerEnv package Prompt
- 23. updatePackagePropertyInfo package Prompt
- 24. checkOtherMissingMandatoryParams Launch Setup
- 25. packageSelectionDialogHeader package Prompt
- 26. packageSelectionDialog package Prompt
- 27. packageSelectionDialogFooter package Prompt
- 29. getPackageBase parameter package Prompt
- 30. getPackageBaseCache parameter package Prompt (CM Cache equivalent gets all the pkg info using CM Cache and processes it (for Agent also))
- 31. getAgentPackageBase parameter package Prompt
- 32. getRoutingServerContent routingServerGroup Prompt
- 33. addRoutingServer routingServerGroup Prompt
- 34. getDefaultAnalysisContent defaultAnalysis Prompt
- 35. addDefaultAnalysis defaultAnalysis Prompt
- 36. redirect Launch Output
- 37. setUpError Launch Output
- 38. checkMRUfolderPermissions MRU
- 39. updateMRUlist MRU
- 40. performLaunch Launch Output
- 41. launchHTTPRedirect Launch Output
- 42. setSession Session Management
- 43. reportError Launch Output
- 44. debug Debug
- -->
- <!-- ============================================================================================================================ -->
- <!-- =============== Session Management Blocks - Start ========================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- Reads session-sensitive info from CM. This information is used to construct the CC session. -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="refreshSession"
- path="portal/cc/read_session.xml"
- condition=".[
- string(/root/cookies/cookie[@name = 'cc_session']) = ''
- or /root/env/param[@name='m_reload']
- or /root/env/param[@name='m_root'] ]"
- nodelist="header, env, system">
-
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
-
- <!-- Update the <session> element for this request. -->
- <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
- condition=".[
- /root/newSession
- or /root/env/param[@name='ui']
- or /root/env/param[@name='d']
- or /root/env/param[starts-with(@name,'m_s_')]
- or /root/env/param[@name = 'resetSort'] ]"
- nodelist="env, system, newSession, mroot, croot, cookies, session, credential, rsProfiles"
- mandatory="false"/>
-
- <!-- Save changes to the state info in a cookie. This block must be executed after all CM request have taken place. -->
- <xts:block mode="interpret" processor="XSLT" type="exec"
- id="setSession"
- path="portal/set_session.xml"
- dependency="getRoutingServerContent getContent updateMRUlist"
- condition=".[/root/updateSession]"
- nodelist="output, env, system, session, configProps"
- mandatory="false"/>
-
- <!-- ============================================================================================================================ -->
- <!-- =============== Session Management Blocks - End ============================================================================ -->
- <!-- ============================================================================================================================ -->
-
- <!-- ============================================================================================================================ -->
- <!-- =============== Launch Setup Blocks - Start ================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- Dummy CM request to force passport validation every time this page is called. This is needed so that the
- capability checks do not fail. -->
- <xts:block id="validatePassport" processor="XSLT" type="exec" dependency="buildSession" nodelist="header" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <ValidatePassport>
- <send:request provider="cm"/>
- </ValidatePassport>
- <!-- Check to see if the CM Cache is being used -->
- <xsl:if test="xtsext:isCacheEnabled()">
- <configInfo>
- <useCMCache/>
- </configInfo>
- </xsl:if>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Read the launch XML file for the given ui.tool. The filename is in the format of "<ui.tool>Launch.xml".
- If this file can not be read an error is reported and the launch process stops. The XML file is appended
- to the root node as the launchComponent element. -->
- <xts:block id="retrieveComponentInfo" processor="XSLT" type="exec" nodelist="env" condition=".[not(/root/launchError)]" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xts:sequence>
- <xts:append>
- <xsl:choose>
- <xsl:when test="not(/root/env/param[@name='ui.tool'])">
- <launchError>
- <errorMessage><xts:string id="IDS_LAUNCH_NO_TOOL"/></errorMessage>
- </launchError>
- </xsl:when>
- <xsl:otherwise>
- <xts:request protocol="FILEREAD" cache="true" faultBlock="requestFault" target="{concat('/portal/launch/',/root/env/param[@name='ui.tool'],'Launch.xml')}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Handle errors which occur when reading the launch XML file. This is a fault block referenced from retrieveComponentInfo. -->
- <xts:block id="requestFault" type="fault" processor="XML" nodelist="">
- <launchError>
- <errorMessage><xts:string id="IDS_LAUNCH_NO_PARAMETER_FILE"/></errorMessage>
- </launchError>
- </xts:block>
- <!-- Parse through the launchComponent element, reading provided values from the environment. This appends the
- launchParams element to the root of the input document which contains the processed output versions of
- the known input parameters.
- This block also checks to see if the current user has the capabilities to launch the given ui.tool. If
- they do not, an error message is presented and the launch process ends. -->
- <xts:block id="setupParams" processor="XSLT" type="exec"
- dependency="validatePassport onPackageSelected retrieveComponentInfo" mandatory="false"
- condition=".[not(/root/launchError)]"
- nodelist="launchComponent, env, system, session, user, tabs, http, configProps, credential, cookies, configInfo">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="xsl xts xtsext pf ">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
-
- <xsl:template match="root">
- <xts:sequence>
- <!-- Check capabilities to see if the studio can be launched. This is done here as this is the only time that we let pf:variables have enough of the input document to generate the capability varaibles. -->
- <xsl:variable name="uiTool" select="string(/root/env/param[@name='ui.tool'])"/>
- <xsl:variable name="uiGateway" select="string(/root/env/param[@name='ui.gateway'])"/>
- <xsl:variable name="requiredCapability" select="launchComponent/capability/@name"/>
- <!-- +++++++++++++++++++++++++++++++++++++++++++++
- Format of profile node in component XML
- <capability ...>
- <userProfiles>
- <profile name="allowable value of ui.profile parameter for component">
- <mapsToKeyValues key="name of session parameter containing profile code">
- <value>profile code</value>
- ...
- </mapsToKeyValues>
- ...
- </profile>
- ...
- </userProfiles>
- </capability>
- (see ReportStudioLaunch.xml for detail example)
- +++++++++++++++++++++++++++++++++++++++++++++
- -->
- <!-- Following variables added for API backward compatibility - introduced for Business Insights Advanced support, based on Report Studio component -->
- <xsl:variable name="userProfiles" select="launchComponent/capability/userProfiles"/> <!-- new component structure - userProfiles contains individual profile names required by the studio -->
- <xsl:variable name="hasProfile">
- <xsl:choose>
- <xsl:when test="$userProfiles">
- <xsl:variable name="uiProfileValue" select="string(/root/env/param[@name='ui.profile'])"/> <!-- profile value passed in to launch -->
- <xsl:choose>
- <xsl:when test="$uiProfileValue!=''">
- <xsl:variable name="upv" select="$userProfiles/profile[@name=$uiProfileValue]"/>
- <xsl:if test="$upv">
- <xsl:variable name="keyValue" select="/root/session/param[@name=$upv/mapsToKeyValues/@key]"/>
- <xsl:if test="$keyValue!='' and $upv/mapsToKeyValues/value=$keyValue">true</xsl:if> <!-- The profile value passed in to launch matches -->
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$userProfiles/profile"> <!-- No profile passed in so determine if the user has a profile -->
- <xsl:variable name="keyValue" select="/root/session/param[@name=current()/mapsToKeyValues/@key]"/>
- <xsl:if test="$keyValue != '' and current()/mapsToKeyValues/value = $keyValue">true</xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- End of API backward compatibility variables -->
- <xsl:variable name="capabilityPermission" select="string(launchComponent/capability/permission)"/>
- <xsl:variable name="checkPermission">
- <xsl:if test="string($requiredCapability)!='' and string(launchComponent/capability/@allowAccessByPermission)='true' and $capabilityPermission!=''">
- <xsl:variable name="permission_name" select="launchComponent/capability/permission/@name"/>
- <xsl:variable name="conparm" select="launchComponent/capability/permission/@conditionParam"/>
- <xsl:variable name="convalue" select="launchComponent/capability/permission/@conditionValue"/>
- <xsl:if test="/root/env/param[@name=$permission_name]">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name=$conparm]=$convalue">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap', string(/root/env/param[@name = $permission_name])), true() )" disable-output-escaping="yes"/>
- </xsl:when>
- <xsl:otherwise>nil</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="hasCapability" select="(string($requiredCapability) = '' or boolean(key('session-param', 'capabilities')/*[local-name()=$requiredCapability])) and (not($userProfiles) or $hasProfile!='')"/>
- <xsl:variable name="hasPermission" select="(not($hasCapability) and $capabilityPermission!='' and $capabilityPermission=$checkPermission) or $hasCapability"/>
- <xsl:variable name="supportsBrowser" select="(not(launchComponent/capability/allowBrowsers) or launchComponent/capability/allowBrowsers/browser[. = $browser]) and
- (not(launchComponent/capability/denyBrowsers) or not(launchComponent/capability/denyBrowsers/browser[. = $browser]))"/>
- <!-- A capability was set in the XML file. Check to see if we are allowed to launch the studio -->
- <xsl:if test="not($hasPermission and $supportsBrowser)">
- <xts:append>
- <launchError>
- <errorMessage><xts:string id="IDS_LAUNCH_INSUFFICIENT_CAPABILITIES"><xts:param name="studioName"><xsl:value-of select="/root/env/param[@name='ui.tool']"/></xts:param></xts:string></errorMessage>
- </launchError>
- </xts:append>
- </xsl:if>
- <xts:append>
- <launchWebURI>
- <xsl:value-of select="xtsext:replace(/root/launchComponent/@URL, '$WEB$', $webRoot)"/>
- </launchWebURI>
- <launchParams><!-- Set up the list of launch parameters and final values. -->
- <xsl:for-each select="launchComponent/param">
- <xsl:variable name="paramName" select="@name"/>
- <xsl:element name="param">
- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
- <xsl:variable name="preRuleValue">
- <xsl:choose> <!-- Set the value -->
- <xsl:when test="./defaultValue/cafValue"> <!-- 1. A CAF value is needed -->
- <xsl:choose>
- <xsl:when test="./defaultValue/cafValue/@type = 'signedreporturls'">
- <xsl:value-of select="xtsext:cafaction('get_configsignedreporturls','')"/>
- </xsl:when>
- <xsl:when test="./defaultValue/cafValue/@type = 'contextid' and $passportForCafContext != ''">
- <xsl:variable name="contextIdComponent" select="./defaultValue/cafValue/@component"/>
- <xsl:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_launchxts_setcomponent_',$contextIdComponent,'_setpassportid_', $passportForCafContext), '')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="/root/env/param[@name=$paramName] and not(string(./defaultValue/@forceDefault) = 'true') and not(string(./defaultValue/@forceWhenParamBlank) = 'true' and string(/root/env/param[@name=$paramName])='')"><!-- 2. If a value was provided for the parameter, and we don't want to force default (forceDefault) 3. and we don't want to force a default when no value supplied (forceWhenNull)-->
- <xsl:value-of select="/root/env/param[@name=$paramName]"/>
- </xsl:when>
- <xsl:otherwise><!-- 3. If the paramater has a default -->
- <xsl:choose>
- <xsl:when test="./defaultValue/conditionalValue">
- <!-- We have conditional defaults. As we haven't assembled all our values yet, we'll have to do it manually here.
- To simplify matters we will make the following assumptions:
- 1. The value specified in @conditionParam may not have a forced default.
- 2. The value specified in @conditionParam may not have a conditionalValue
-
- valueRules will still be applied.
-
- Note: These assumptions do not apply to a @conditionParam which is specified for an alias.
- -->
- <xsl:for-each select="./defaultValue/conditionalValue"> <!-- Loop over the conditional defaults to see if one applies -->
- <xsl:variable name="condParamName" select="@conditionParam"/>
- <xsl:variable name="condParamValue" select="@conditionValue"/>
- <xsl:variable name="condParamNode" select="@conditionNode"/> <!-- added attribute which contains a node to reference for associated parameter information -->
- <xsl:variable name="condValue" select="."/>
- <xsl:variable name="preRuleParamValue"> <!-- Retrieve the value from the env, or use a default.-->
- <xsl:choose>
- <xsl:when test="string($condParamNode)!='' and /root//*[local-name()=$condParamNode]//*[local-name()='param' and @name=$condParamName]"> <!-- a condition parameter node is specified -->
- <xsl:value-of select="/root//*[local-name()=$condParamNode]//*[local-name()='param' and @name=$condParamName]"/>
- </xsl:when>
- <xsl:when test="/root/env/param[@name=$condParamName]">
- <xsl:value-of select="/root/env/param[@name=$condParamName]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/launchComponent/param[@name=$condParamName]/defaultValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="replaceGATEWAYHead">
- <xsl:choose>
- <xsl:when test="$uiGateway!=''">
- <xsl:value-of select="string(xtsext:replace(/root/launchComponent/param[@name=$condParamName]/valueRule/@headConstant, '$GATEWAY$', $uiGateway))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(xtsext:replace(/root/launchComponent/param[@name=$condParamName]/valueRule/@headConstant, '$GATEWAY$', $gateway))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="replaceWEBHead" select="string(xtsext:replace($replaceGATEWAYHead, '$WEB$', $gateway))"/>
- <xsl:variable name="preRuleAliasParamValue" select="concat(string($replaceWEBHead),string($preRuleParamValue),string(/root/launchComponent/param[@name=$condParamName]/valueRule/@tailConstant))"/>
- <xsl:variable name="calcParamValue">
- <xsl:choose>
- <xsl:when test="/root/launchComponent/param[@name=$condParamName]/valueRule/valueAlias[@value=$preRuleAliasParamValue]">
- <xsl:value-of select="/root/launchComponent/param[@name=$condParamName]/valueRule/valueAlias[@value=$preRuleAliasParamValue]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$preRuleAliasParamValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$calcParamValue = $condParamValue">
- <xsl:value-of select="$condValue"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="./defaultValue/valueParamName">
- <xsl:variable name="valueParamName" select="./defaultValue/valueParamName"/>
- <xsl:value-of select="/root/http/param[@name=$valueParamName]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="defaultValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Only perform rule processing if we have a value at this point -->
- <xsl:if test="not(string($preRuleValue) = '')">
- <!-- Apply head and tail constants. -->
- <xsl:variable name="replaceGATEWAYHead" select="xtsext:replace(./valueRule/@headConstant, '$GATEWAY$', $gateway)"/>
- <xsl:variable name="replaceWEBHead" select="xtsext:replace($replaceGATEWAYHead, '$WEB$', $webRoot)"/>
- <xsl:variable name="postConstantRuleValue" select="concat($replaceWEBHead,$preRuleValue,./valueRule/@tailConstant)"/>
-
- <!-- Now apply valueAliases if specified -->
- <xsl:choose>
- <xsl:when test="not(string(./valueRule/valueAlias[@value = $postConstantRuleValue]) = '')">
- <xsl:value-of select="./valueRule/valueAlias[@value = $postConstantRuleValue]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$postConstantRuleValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </launchParams>
- <launchURLStructure>
- <xsl:copy-of select="launchComponent/URLStructure"/>
- </launchURLStructure>
- <xsl:if test="/root/launchComponent/param[@name='launch.service']/defaultValue='Lotus Connections'">
- <launchService name="{/root/launchComponent/param[@name='launch.service']/defaultValue}">
- <collaborationApps>
- <xts:function name="getConfiguration">
- <xts:param name="lc_homepage_uri"/>
- <xts:param name="lc_activities_uri"/>
- </xts:function>
- </collaborationApps>
- </launchService>
- </xsl:if>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Parse through the launchComponent element, looking for parameters which have prompts. If one is found, look
- in the launchParams to see if a value is specified. If not, and if the specified prompt has not been run
- in a previous execution of launch.xts, output a launchRedirect parameter noting that the prompt should be run. -->
- <xts:block id="checkSpecifiableMissingParams" processor="XSLT" type="exec" dependency="setupParams" mandatory="false" condition=".[not(/root/launchError)]" nodelist="launchComponent, launchParams, env">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xts:sequence>
- <xts:append>
- <launchRedirect>
- <xsl:for-each select="/root/launchComponent/param">
- <xsl:variable name="currentName" select="@name"/>
- <xsl:variable name="hasNoValue" select="string(/root/launchParams/param[@name=$currentName])=''"/>
- <xsl:if test="prompt"> <!-- First check if the there are any prompts specified. -->
- <xsl:for-each select="./prompt"> <!-- Loop over any prompt child elements to see if any apply -->
- <xsl:variable name="promptRunParam" select="concat('temp.prompt_', ., '.', ../@name)"/>
- <xsl:if test="($hasNoValue or (string(@forcePrompt) = 'true')) and not(string(/root/env/param[@name=$promptRunParam]) = 'true')">
- <xsl:choose>
- <xsl:when test="@conditionParam">
- <xsl:variable name="condParam" select="@conditionParam"/>
- <xsl:if test="(/root/launchParams/param[@name=$condParam] = ./@conditionValue)"> <!-- The condition matches so we can prompt -->
- <xsl:element name="param">
- <xsl:attribute name="name"><xsl:value-of select="../@name"/></xsl:attribute>
- <xsl:if test="@type">
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@subType">
- <xsl:attribute name="subType"><xsl:value-of select="@subType"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise> <!-- No conditionParam was specified. This is a general prompt. -->
- <xsl:element name="param">
- <xsl:attribute name="name"><xsl:value-of select="../@name"/></xsl:attribute>
- <xsl:if test="@type">
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@subType">
- <xsl:attribute name="subType"><xsl:value-of select="@subType"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- </xsl:for-each>
- </launchRedirect>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Once the launchParams element in the input document has been finalized, parse through launchComponent and
- find all mandatory parameters which do not have values in launchParams, including those associated with the launchService. If any are found missing, an error message
- is presented and the launch process ends.
-
- This block only runs if there are no prompts to be executed. -->
- <xts:block id="checkOtherMissingMandatoryParams" processor="XSLT" type="exec" dependency="updatePackagePropertyInfo" mandatory="false" condition=".[not(/root/launchError) and not(/root/launchRedirect/param)]" nodelist="launchParams, launchComponent, launchService">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xts:sequence>
- <xsl:variable name="anyMissingParams">
- <xsl:for-each select="/root/launchComponent/param[@mandatory='true']">
- <xsl:variable name="currentName" select="@name"/>
- <xsl:if test="string(/root/launchParams/param[@name=$currentName])=''">
- <launchError>
- <errorMessage><xts:string id="IDS_LAUNCH_MISSING_PARAMETER"><xts:param name="paramName"><xsl:value-of select="@name"/></xts:param></xts:string></errorMessage>
- </launchError>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$anyMissingParams/launchError">
- <xts:append>
- <xsl:copy-of select="$anyMissingParams"/>
- </xts:append>
- </xsl:when>
- <xsl:when test="/root/launchService">
- <xsl:variable name="launchService" select="/root/launchService"/>
- <xsl:variable name="launchLotusConnections" select="$launchService/@name = 'Lotus Connections'"/>
- <xsl:variable name="serviceName">
- <xsl:choose>
- <xsl:when test="$launchLotusConnections"><xts:string id="IDS_LOTUSCONNECTIONS_SERVICE"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xts:append>
- <xsl:choose>
- <xsl:when test="$launchLotusConnections">
-
- <xsl:choose>
- <xsl:when test="string($launchService/collaborationApps/configuration/property[@name=concat('lc_',/root/launchParams/param[@name='ui.appname'],'_uri')])=''">
- <launchError>
- <errorMessage>
- <xts:string id="IDS_NO_SERVICE_TO_LAUNCH">
- <xts:param name="servicename"><xsl:value-of select="$serviceName"/></xts:param>
- </xts:string>
- </errorMessage>
- </launchError>
- </xsl:when>
- </xsl:choose>
-
- </xsl:when>
- </xsl:choose>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== Launch Setup Blocks - End ================================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- =============== Package Base Block - Start =================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- Retrieve the packageBase property from the given ui.object so that properties of the package may be retrieved. (Not using CM Cache) -->
- <xts:block id="getPackageBase"
- dependency="checkOtherMissingMandatoryParams" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[(string(.) = 'routingServerGroup' or string(.) = 'defaultAnalysis') and @type='internal']]" nodelist="env, header">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:search><xsl:value-of select="/root/env/param[@name='ui.object']"/></cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="metadataModelPackage"/>
- <cm:property name="routingServerGroup"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="getAgentPackageBase"
- dependency="getPackageBase" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[(string(.) = 'routingServerGroup' or string(.) = 'defaultAnalysis') and @type='internal'] and string(/root/*[local-name()='queryResponse']/*[1]/*[local-name()='objectClass']) = 'agentDefinition']" nodelist="env, header">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:search><xsl:value-of select="/root/env/param[@name='ui.object']"/>/report</cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="metadataModelPackage"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Retrieve all the pacakge information from the given ui.object using the CM Cache and process the information (for Agent also) one stop shopping -->
- <xts:block id="getPackageBaseCache"
- dependency="checkOtherMissingMandatoryParams" processor="XSLT" type="exec" mandatory="false"
- condition=".[/root/configInfo/useCMCache and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[(string(.) = 'routingServerGroup' or string(.) = 'defaultAnalysis') and @type='internal']]" nodelist="env, header, launchRedirect, launchParams">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <xsl:choose>
- <xsl:when test="/root/launchRedirect/param[@subType='childReport']">
- <cmCacheResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- outputHeader only when doing validation -->
- <send:request provider="cmCache">
- <ps:queryCache xmlns:ps="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <bus:objectPath xsi:type="bus:searchPathSingleObject"><xsl:value-of select="/root/env/param[@name='ui.object']"/>/report</bus:objectPath>
- <bus:searchType xsi:type="bus:classEnum">report</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[1]">
- <item xsi:type="bus:classEnum">package</item>
- <item xsi:type="bus:classEnum">packageConfiguration</item>
- </bus:entries>
- </ps:queryCache>
- </send:request>
- </cmCacheResponse>
- </xsl:when>
- <xsl:otherwise>
- <cmCacheResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <send:request provider="cmCache">
- <ps:queryCache xmlns:ps="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <bus:objectPath xsi:type="bus:searchPathSingleObject"><xsl:value-of select="/root/env/param[@name='ui.object']"/></bus:objectPath>
- <bus:searchType xsi:type="bus:classEnum">report</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[1]">
- <item xsi:type="bus:classEnum">package</item>
- <item xsi:type="bus:classEnum">packageConfiguration</item>
- </bus:entries>
- </ps:queryCache>
- </send:request>
- </cmCacheResponse>
- </xsl:otherwise>
- </xsl:choose>
- </xts:transform>
- </xts:append>
-
- <!-- Add cache context -->
- <xts:replace select="/root/launchParams/param[@name='ui.cacheContext']">
- <param name="ui.cacheContext"><xts:transform name="XMLEncode"><xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='genericOptionXMLEncodedXML']/*[local-name()='value']"/></xts:transform></param>
- </xts:replace>
-
- <!-- Add Routing Server if it was asked for -->
- <xsl:if test="/root/launchRedirect/param[(string(.) = 'routingServerGroup') and @type='internal']">
- <!-- Place the value in env and launchParams and note that we've prompted. -->
- <xts:replace select="/root/launchParams/param[@name='ui.routingServerGroup']">
- <param name="ui.routingServerGroup"><xts:transform name="XMLEncode"><xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='package']/*[local-name()='routingServerGroup']"/></xts:transform></param>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='ui.routingServerGroup']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'routingServerGroup' and @type='internal']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_routingServerGroup.ui.routingServerGroup">true</param>
- <param name="ui.routingServerGroup"><xts:transform name="XMLEncode"><xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='package']/*[local-name()='routingServerGroup']"/></xts:transform></param>
- </xts:append>
- </xsl:if>
- <!-- Add Default Analysis Content if it was asked for -->
- <xsl:if test="/root/launchRedirect/param[(string(.) = 'defaultAnalysis') and @type='internal']">
- <!-- Place the value in env and launchParams and note that we've prompted. -->
- <xts:replace select="/root/launchParams/param[@name='ui.defaultAnalysis']">
- <param name="ui.defaultAnalysis"><xts:transform name="XMLEncode"><xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='packageConfiguration']/*[local-name()='defaultAnalysis']/*/*[local-name()='searchPath']"/></xts:transform></param>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='ui.defaultAnalysis']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'defaultAnalysis' and @type='internal']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_defaultAnalysis.ui.defaultAnalysis">true</param>
- <param name="ui.defaultAnalysis"><xts:transform name="XMLEncode"><xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='packageConfiguration']/*[local-name()='defaultAnalysis']/*/*[local-name()='searchPath']"/></xts:transform></param>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!-- ============================================================================================================================ -->
- <!-- =============== Package Base Block - End ===================================================================== -->
- <!-- ============================================================================================================================ -->
-
-
- <!-- ============================================================================================================================ -->
- <!-- =============== routingServerGroup Prompt Blocks - Start =================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- If getPackageBase retrieved a packageBase, then retrieve the routingServerGroup property of that package. -->
- <xts:block id="getRoutingServerContent"
- dependency="getAgentPackageBase" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[string(.) = 'routingServerGroup' and @type='internal'] and (string(/root/*[local-name()='queryResponse']/*[1]/*[local-name()='metadataModelPackage']/*/*[local-name()='storeID']) != '' or string(/root/*[local-name()='queryResponse']/*[1]/*[local-name()='objectClass']) = 'agentDefinition')]" nodelist="env, header, queryResponse">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xsl:variable name="packageStoreId">
- <xsl:choose>
- <xsl:when test="string(/root/*[local-name()='queryResponse'][1]/*[1]/*[local-name()='objectClass']) = 'agentDefinition'">
- <xsl:value-of select="/root/*[local-name()='queryResponse'][2]/*[1]/*[local-name()='metadataModelPackage']/*/*[local-name()='storeID']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/*[local-name()='queryResponse'][1]/*[1]/*[local-name()='metadataModelPackage']/*/*[local-name()='storeID']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <xsl:choose>
- <xsl:when test="$packageStoreId = ''">
- <launchError>
- <errorMessage><xts:string id="IDS_LAUNCH_MISSING_PACKAGE"/></errorMessage>
- </launchError>
- </xsl:when>
- <xsl:otherwise>
- <routingServerContent>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>storeID("<xsl:value-of select="$packageStoreId"/>")</cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="routingServerGroup"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </routingServerContent>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Alter the env and launchParams elements to use the routingServerGroup parameter retrieved by getRoutingServerContent
- as the value for the ui.routingServerGroup launch parameter. -->
- <xts:block id="addRoutingServer"
- dependency="getRoutingServerContent" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[string(.) = 'routingServerGroup' and @type='internal']]" nodelist="launchParams, routingServerContent, launchRedirect, env, queryResponse">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl cm xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
-
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:variable name="routingServerGroupValue">
- <xsl:choose>
- <xsl:when test="/root/routingServerContent/cm:queryResponse/cm:package/cm:routingServerGroup">
- <xsl:value-of select="string(/root/routingServerContent/cm:queryResponse/cm:package/cm:routingServerGroup)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(/root/*[local-name()='queryResponse']/*[local-name()='package']/*[local-name()='routingServerGroup'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Place the value in env and launchParams and note that we've prompted. -->
- <xts:replace select="/root/launchParams/param[@name='ui.routingServerGroup']">
- <param name="ui.routingServerGroup"><xsl:value-of select="$routingServerGroupValue"/></param>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='ui.routingServerGroup']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'routingServerGroup' and @type='internal']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_routingServerGroup.ui.routingServerGroup">true</param>
- <param name="ui.routingServerGroup"><xsl:value-of select="$routingServerGroupValue"/></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== routingServerGroup Prompt Blocks - End ===================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- =============== defaultAnalysis Prompt Blocks - Start =================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- If getPackageBase retrieved a packageBase, then retrieve the defaultAnalysis property of that package. -->
- <xts:block id="getDefaultAnalysisContent"
- dependency="getAgentPackageBase" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[string(.) = 'defaultAnalysis' and @type='internal'] and string(/root/*[local-name()='queryResponse'][1]/*[1]/*[local-name()='metadataModelPackage']/*/*[local-name()='storeID']) != '']" nodelist="env, header, queryResponse">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl send xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <defaultAnalysis>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>storeID("<xsl:value-of select="/root/*[local-name()='queryResponse'][1]/*[1]/*[local-name()='metadataModelPackage']/*/*[local-name()='storeID']"/>")/packageConfiguration</cm:search>
- <cm:properties>
- <cm:property name="defaultAnalysis"/>
- </cm:properties>
- <cm:options schemaInfo="false">
- <cm:refProps>
- <cm:refProp refPropName="defaultAnalysis">
- <cm:properties>
- <cm:property name="searchPath"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </defaultAnalysis>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Alter the env and launchParams elements to use the routingServerGroup parameter retrieved by getRoutingServerContent
- as the value for the ui.routingServerGroup launch parameter. -->
- <xts:block id="addDefaultAnalysis"
- dependency="getDefaultAnalysisContent" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/configInfo/useCMCache) and not(/root/launchError) and string(/root/env/param[@name='ui.object'])!='' and /root/launchRedirect/param[string(.) = 'defaultAnalysis' and @type='internal']]" nodelist="launchParams, defaultAnalysis, launchRedirect, env">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl cm xts">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
-
- <xsl:template match="/root">
- <xts:sequence>
- <xsl:variable name="defaultAnalysis" select="string(/root/defaultAnalysis/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:searchPath)"/>
- <!-- Place the value in env and launchParams and note that we've prompted. -->
- <xts:replace select="/root/launchParams/param[@name='ui.defaultAnalysis']">
- <param name="ui.defaultAnalysis"><xsl:value-of select="$defaultAnalysis"/></param>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='ui.defaultAnalysis']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'defaultAnalysis' and @type='internal']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_defaultAnalysis.ui.defaultAnalysis">true</param>
- <param name="ui.defaultAnalysis"><xsl:value-of select="$defaultAnalysis"/></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== defaultAnalysis Prompt Blocks - End ===================================================================== -->
- <!-- ============================================================================================================================ -->
-
- <!-- ============================================================================================================================ -->
- <!-- =============== package Prompt Blocks - Start ============================================================================== -->
- <!-- ============================================================================================================================ -->
-
-
- <xts:block
- id="getSelectedPackage"
- processor="XSLT"
- type="exec"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and string(/root/env/param[@name='ui.object'])!='']"
- dependency="checkSpecifiableMissingParams"
- nodelist="header, env, selectionSpec, configInfo"
- mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <defaultSelectedPackage>
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <cmCacheResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- outputHeader only when doing validation -->
- <send:request provider="cmCache">
- <ps:queryCache xmlns:ps="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <bus:objectPath xsi:type="bus:searchPathSingleObject"><xsl:value-of select="/root/env/param[@name='ui.object']"/></bus:objectPath>
- <bus:searchType xsi:type="bus:classEnum">package</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[1]">
- <item xsi:type="bus:classEnum">package</item>
- </bus:entries>
- </ps:queryCache>
- </send:request>
- </cmCacheResponse>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search><xsl:value-of select="string(/root/env/param[@name='ui.object'])"/>/*[1]/..[permission("traverse")][@objectClass="package"]</cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="userInterfaces"/>
- <cm:property name="effectiveUserCapabilities"/>
- <cm:property name="storeID"/>
- <cm:property name="position"/>
- </cm:properties>
- <cm:options schemaInfo="false"/>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </defaultSelectedPackage>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="checkPackage"
- processor="XSLT"
- type="exec"
- dependency="getSelectedPackage"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal']]"
- nodelist="env, queryResponse, launchRedirect, launchParams, launchComponent, defaultSelectedPackage, configInfo"
- mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="cacheContext" select="/root/defaultSelectedPackage/*[local-name()='queryResponse']/*[local-name()='genericOptionXMLEncodedXML']/*[local-name()='value']"/>
- <xsl:variable name="userInterface"><xsl:value-of select="/root/launchComponent/userInterface"/></xsl:variable>
- <xsl:variable name="mustExist" select="/root/launchComponent/userInterface/@mustExist = 'true'"/>
- <xsl:variable name="pkgRoot" select="/root/defaultSelectedPackage/*[local-name()='queryResponse']/*[local-name()='package']"/>
- <xsl:variable name="pkgHasUserInterface" select="boolean($pkgRoot/*[local-name()='userInterfaces']/*)"/>
- <xsl:variable name="pkgMatchesUserInterface" select="$pkgRoot/*[local-name()='searchPath' and string(.) != '']/../*[local-name()='userInterfaces']/*[local-name()='uiComponentEnum' and string(.)=$userInterface]"/>
-
- <!-- check to see if user has suffucient package capabilities -->
- <xsl:variable name="requiredCapability" select="/root/launchComponent/capability/@name"/>
- <xsl:variable name="hasCapability" select="string($requiredCapability) = '' or boolean($pkgRoot/*[local-name()='effectiveUserCapabilities']/*[local-name() = $requiredCapability])"/>
-
- <!-- if cm cache then must check permissions and that object is a folder or a package because cm cache cannot handle predicates in the search query -->
- <xsl:variable name="isValidPkg">
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xsl:value-of select="contains(string($pkgRoot/*[local-name()='permissions']), 'traverse') and ($pkgRoot/*[local-name()='objectClass' = 'package'] )"/>
- </xsl:when>
- <xsl:otherwise><xsl:value-of select="true()"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="canLaunchPackage">
- <!--
- * set to true when:
- * ui.object is a valid package;
- * user has sufficient package capability or package has no required capability;
- * package matches the launch component userInterface or it has no userInterface
- -->
- <xsl:choose>
- <xsl:when test="not($hasCapability)">
- <xsl:value-of select="false()"/>
- </xsl:when>
- <xsl:when test="not($isValidPkg)">
- <xsl:value-of select="false()"/>
- </xsl:when>
- <xsl:when test="not($mustExist) and /root/defaultSelectedPackage and ($pkgMatchesUserInterface or not($pkgHasUserInterface))">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:when test="$mustExist and ($pkgMatchesUserInterface or ($pkgRoot/*[local-name()='searchPath'] and ($userInterface='' or not($pkgHasUserInterface))))">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="false()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
-
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="$canLaunchPackage = 'true'">
- <xts:append select="/root">
- <packageSelected>
- <xsl:copy-of select="$pkgRoot/*"/>
- <param name="so.id"><xsl:value-of select="$pkgRoot/*[local-name()='id']"/></param>
- <param name="so.storeID"><xsl:value-of select="$pkgRoot/*[local-name()='storeID']"/></param>
- <param name="so.searchPath"><xsl:value-of select="$pkgRoot/*[local-name()='searchPath']"/></param>
- </packageSelected>
- </xts:append>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.object']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_package.ui.object">true</param>
- </xts:append>
- <xts:delete select="/root/env/param[@name='ui.object']"/>
- <xts:append select="/root/env">
- <param name="ui.object">
- <xsl:value-of select="$pkgRoot/*[local-name()='searchPath']"/>
- </param>
- </xts:append>
- <xts:replace select="/root/launchParams/param[@name='ui.object']">
- <param name="ui.object"><xsl:value-of select="$pkgRoot/*[local-name()='searchPath']"/></param>
- </xts:replace>
-
- <xts:replace select="/root/launchParams/param[@name='ui.cacheContext']">
- <param name="ui.cacheContext"><xsl:value-of select="$cacheContext"/></param>
- </xts:replace>
- </xsl:when>
- <xsl:otherwise>
- <xts:append select="/root">
- <!-- hint to prompt package -->
- <displayPackageDialog/>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="onPackageSelected" processor="XSLT" type="exec"
- nodelist="env"
- condition=".[not(/root/launchError) and /root/env/param[@name='so.searchPath']]" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xsl:variable name="target" select="string(/root/env/param[@name='temp.prompt_package_target'])"/>
- <xts:sequence>
- <xts:append select="/root/env">
- <param>
- <xsl:attribute name="name">
- <xsl:value-of select="concat('temp.prompt_package.',$target)"/>
- </xsl:attribute>
- <xsl:text>true</xsl:text>
- </param>
- </xts:append>
- <xts:append select="/root">
- <packageSelected onPackageSelected="true">
- <xsl:copy-of select="/root/env/param[@name='so.id']"/>
- <xsl:copy-of select="/root/env/param[@name='so.storeID']"/>
- <xsl:copy-of select="/root/env/param[@name='so.searchPath']"/>
- </packageSelected>
- </xts:append>
- <xts:delete select="/root/env/param[@name='temp.prompt_package_target']"/>
- <xsl:variable name="xpathinject">"'/@=*[]()</xsl:variable>
- <xsl:if test="translate($target, $xpathinject, '') = $target"> <!--ensure no xpath injection-->
- <xts:delete select="/root/env/param[@name='{$target}']"/>
- </xsl:if>
- <xts:append select="/root/env">
- <param>
- <xsl:attribute name="name">
- <xsl:value-of select="$target"/>
- </xsl:attribute>
- <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="prepareSOSEnvironment"
- dependency="checkPackage" processor="XSLT" type="exec" mandatory="false"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal']]"
- nodelist="env, launchRedirect">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:delete select="/root/env/param[@name='so.select']"/>
- <xts:delete select="/root/env/param[@name='so.return.m']"/>
- <xts:delete select="/root/env/param[@name='so.backURL']"/>
- <xts:delete select="/root/env/param[@name='temp.prompt_package_target']"/>
- <xts:append select="/root/env">
- <param name="so.select">launch.<xsl:value-of select="/root/env/param[@name='ui.tool']"/></param>
- <param name="so.return.m">portal/launch.xts</param>
- <param name="so.backURL">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='launch.launchInWindow']) = 'true'">
- <xsl:value-of select="'javascript:closePage();'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/env/param[@name='ui.backURL']"/>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <param name="temp.prompt_package_target">
- <xsl:value-of select="/root/launchRedirect/param[string(.) = 'package' and @type='internal'][1]/@name"/>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- formlogic_init is only needed if the Specify Package prompt needs to display -->
- <xts:block id="formlogic_init" type="exec" mode="interpret"
- dependency="prepareSOSEnvironment" mandatory="false" processor="XSLT"
- path="/logicsheets/formlogic_init.xslt"
- condition=".[not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/displayPackageDialog]"
- nodelist="env,credential,system,http"/>
-
- <!-- ui.backURL is deleted in formlogic_init as it adds backURL and does a 'same domain as CRN check' .
- PowerPlay requires ui.backURL so easiest to just add it back.
- Besides, we should honour our API and pass back ui.backURL for consistency-->
- <xts:block id="addUIbackURL" type="exec"
- dependency="formlogic_init"
- mandatory="false"
- processor="XSLT"
- condition=".[not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/displayPackageDialog]"
- nodelist="env">
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xts xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/env">
- <xsl:if test="not(/root/env/param[@name='ui.backURL']) and /root/env/param[@name='backURL'] and /root/env/param[@name='backURL'] != ''">
- <param name="ui.backURL">
- <xsl:value-of select="/root/env/param[@name='backURL']"/>
- </param>
- </xsl:if>
- </xts:append>
- <xts:delete select="/root/env/param[@name='backURL']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
-
- </xts:block>
- <!-- Encode the callers environment to use when ok or cancel is pressed. Only so.parameters and m are not encoded. ================ -->
- <xts:block
- id="handleCallerEnv"
- processor="XSLT"
- type="exec"
- dependency="prepareSOSEnvironment"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal']]"
- nodelist="env, credential"
- mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xtsext xts xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='so.handledCallerEnv'] and /root/env/param[@name='so.savedCallerEnv']">
- <xts:append select="/root">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='so.savedCallerEnv'])), true())" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:when>
- <xsl:otherwise>
- <xts:append select="/root">
- <callerEnv>
- <xsl:for-each select="/root/env/param[not(starts-with(@name,'so.') or starts-with(@name,'md.')) and not(@name='m_s_sort')]">
- <param name="{@name}"><xsl:value-of select="."/></param>
- </xsl:for-each>
- </callerEnv>
- </xts:append>
- <xts:delete select="/root/env/param[
- not (starts-with(@name,'run.') or
- starts-with(@name,'launch.') or
- starts-with(@name,'so.') or
- starts-with(@name,'ce_') or
- starts-with(@name,'md.') or
- starts-with(@name,'ui.') or
- starts-with(@name,'m_pager') or
- starts-with(@name,'m_pg')) and
- @name != 'm_section' and @name!='m' and @name!='m_s_sort']"/>
- <xts:append select="/root/env"><param name="so.handledCallerEnv">true</param></xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Convert paths to id's. -->
- <xts:block
- id="preprocess"
- processor="XSLT"
- type="exec"
- condition=".[/root/launchRedirect/param[string(.) = 'package' and @type='internal'] and
- not(/root/packageSelected) and not(/root/env/param[@name='so.defaultRootId'])]"
- path="portal/select/src/preprocess.xslt"
- dependency="handleCallerEnv"
- mandatory="false"
- nodelist="header, env, session">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <xts:block
- id="messages"
- type="exec"
- mode="interpret"
- processor="XSLT"
- dependency="preprocess"
- condition=".[not(/root/packageSelected) and not(/root/selectionSpec/item[@name='selectionTitle']) or not(/root/selectionSpec/item[@name='selectionIntro'])]"
- path="portal/select/src/messages.xslt"
- nodelist="session"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!-- Build a selectionSpec node from scratch or update it on a return trip either from a navigation operation or a page refresh. ================ -->
- <xts:block
- id="buildSpec"
- processor="XSLT"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal']]"
- type="exec"
- dependency="messages"
- mandatory="false"
- nodelist="http, session, env, system, selectionSpecMessages, searchSpecMessages, selectionSpec, CMRootMap">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="not(/root/selectionSpec)">
- <xts:append select="/root">
- <xts:transform processor="XSLT" src="portal/select/transforms/buildSpec.xslt" mimeType="text/xml">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <xts:queryNode select="/root/http | /root/session | /root/env | /root/system | /root/selectionSpecMessages | /root/searchSpecMessages"/>
- <xts:request protocol="FILEREAD" cache="true" target="/portal/select/res/specGuide.xml"/>
- </root>
- </xts:transform>
- </xts:append>
- <xts:delete select="/root/selectionSpecMessages"/>
- <xts:delete select="/root/searchSpecMessages"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:replace select="/root/selectionSpec">
- <xts:transform processor="XSLT" src="portal/select/transforms/buildSpec.xslt" mimeType="text/xml">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <xts:queryNode select="/root/http | /root/session | /root/env | /root/system | /root/selectionSpec"/>
- </root>
- </xts:transform>
- </xts:replace>
- </xsl:otherwise>
- </xsl:choose>
- <xts:delete select="/root/CMRootMap"/>
- <xts:delete select="/root/env/param[starts-with(@name,'so.condition_')]"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="getContent"
- processor="XSLT"
- type="exec"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/selectionSpec/item[@name='navigationId']]"
- dependency="setSearchExpression buildSpec"
- path="portal/select/src/getContent.xslt"
- nodelist="header, env, session, system, selectionSpec, search, queryResponse"
- mandatory="false">
- <xts:logicsheet path="portal/mru/logicsheets/mru.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
-
- <!-- generate search expression (cm or nav) for search mode-->
- <xts:block
- id="setSearchExpression"
- processor="XSLT"
- condition=".[ /root/env/param[@name = 'sosmode'] = 'search' ]"
- type="exec"
- nodelist="header, env, session, system, selectionSpec, search, queryResponse"
- dependency="buildSpec"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/searchlogic.xslt"/>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/" exclude-result-prefixes="xtsext pf cm search">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
-
- <pf:variables/>
- <cml:object-predicates/>
- <xsl:key name="spec-item" match="/root/selectionSpec/item" use="@name"/>
- <xsl:template match="/root">
- <xsl:variable name="path">
- <xsl:text/>storeID("<xsl:value-of select="key('spec-item','navigationId')"/>")<xsl:text/>
- </xsl:variable>
- <xsl:variable name="ns-path" select="/root/env/param[@name='so.namespace']"/>
- <xsl:variable name="admin-path">
- <xsl:text/>storeID("<xsl:value-of select="/root/env/param[@name='so.adminId']"/>")<xsl:text/>
- </xsl:variable>
- <xsl:variable name="selectionPermissions">
- <xsl:choose>
- <!-- When in the directory tree apply security filter based on where we are in the tree (unless we're selecting a container) -->
- <xsl:when test="contains(key('spec-item','containerObjects'), 'namespace') and not(contains(key('env-param','so.select'),'.container'))">
- <xsl:choose>
- <!-- when displaying a list of namespaces use the namespace_filter -->
- <xsl:when test="key('spec-item','navigationId')=key('env-param', 'so.directoryId')">
- <xsl:value-of select="/root/system/param[@name='namespace_filter']"/>
- </xsl:when>
- <!-- when inside the Cognos namespace, use the visible filter -->
- <xsl:when test="key('env-param','so.namespace')='CAMID(":")' or ( string( key('env-param','so.cognosNamespaceId') )!='' and (key('env-param','so.namespaceId')=key('env-param','so.cognosNamespaceId') ) or key('spec-item','navigationId')=key('env-param','so.cognosNamespaceId'))">
- <xsl:value-of select="/root/system/param[@name='visible']"/>
- </xsl:when>
- <!-- otherwise (if we're in a 3rd party namespace) do not apply any security filter -->
- </xsl:choose>
- </xsl:when>
- <!-- Otherwise, use the permissions defined in the specGuide -->
- <xsl:otherwise>
- <xsl:value-of select="key('spec-item','selectionPermissions')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name = 'sfield']) = 'k'">
- <search:gen-search-exp navInterface="true" mode="sos"/>
- </xsl:when>
- <xsl:otherwise>
- <search:gen-search-exp mode="sos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="retrievePackagePropertyInfo"
- dependency="checkPackage"
- mode="interpret" mandatory="false"
- condition=".[/root/packageSelected]"
- nodelist="header, env, packageSelected, launchParams, configInfo"
- processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/root">
- <xsl:variable name="pkgPath">
- <xsl:value-of select="/root/packageSelected/param[@name='so.searchPath']"/>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <packageInfo>
- <xsl:choose>
- <!-- No CM Cache request for Contributor -->
- <xsl:when test="string(/root/env/param[@name='ui.tool'])='Contributor' or string(/root/callerEnv/param[@name='ui.tool'])='Contributor'">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:request>
- <cm:search><xsl:value-of select="$pkgPath"/>/planningApplication</cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="applicationID"/>
- <cm:property name="applicationURL"/>
- </cm:properties>
- </cm:request>
- <cm:request>
- <cm:search><xsl:value-of select="$pkgPath"/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="routingServerGroup"/>
- </cm:properties>
- </cm:request>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:when>
- <xsl:when test="/root/configInfo/useCMCache">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <cmCacheResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <send:request provider="cmCache">
- <ps:queryCache xmlns:ps="http://developer.cognos.com/schemas/contentManagerCacheService/1">
- <bus:objectPath xsi:type="bus:searchPathSingleObject"><xsl:value-of select="$pkgPath"/></bus:objectPath>
- <bus:searchType xsi:type="bus:classEnum">package</bus:searchType>
- <bus:entries xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:classEnum[1]">
- <item xsi:type="bus:classEnum">package</item>
- <item xsi:type="bus:classEnum">packageConfiguration</item>
- </bus:entries>
- <!-- It is possible when doing a package prompt that the context does not exist yet so need to check -->
- <xsl:if test="string(/root/launchParams/param[@name='ui.cacheContext']) != ''">
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[1]">
- <item xsi:type="bus:genericOptionXMLEncodedXML">
- <bus:name xsi:type="xs:string">http://developer.cognos.com/ceba/constants/contentManagerCacheOptionEnum#context</bus:name>
- <bus:value xsi:type="bus:xmlEncodedXML"><xsl:value-of select="/root/launchParams/param[@name='ui.cacheContext']"/></bus:value>
- </item>
- </bus:options>
- </xsl:if>
- </ps:queryCache>
- </send:request>
- </cmCacheResponse>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.tool']='AnalysisStudio' or /root/env/param[@name='ce_ui.tool']='AnalysisStudio'">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:request>
- <cm:search><xsl:value-of select="$pkgPath"/>/packageConfiguration</cm:search>
- <cm:properties>
- <cm:property name="defaultAnalysis"/>
- <cm:property name="memberDisplayCountDefault"/>
- <cm:property name="memberDisplayCountLimit"/>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="ancestors"/>
- </cm:properties>
- <cm:options schemaInfo="false">
- <cm:refProps>
- <cm:refProp refPropName="defaultAnalysis">
- <cm:properties>
- <cm:property name="searchPath"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- </cm:request>
- <cm:request>
- <cm:search><xsl:value-of select="$pkgPath"/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="routingServerGroup"/>
- </cm:properties>
- </cm:request>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:request>
- <cm:search><xsl:value-of select="$pkgPath"/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="routingServerGroup"/>
- </cm:properties>
- </cm:request>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </packageInfo>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="updatePackagePropertyInfo"
- dependency="retrievePackagePropertyInfo"
- mode="interpret" mandatory="false"
- condition=".[/root/packageSelected]"
- nodelist="env, packageInfo, launchParams, configInfo"
- processor="XSLT" type="exec">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/root">
- <xts:sequence>
- <!-- Unfortunately the CM Cache does not handle mulitple requests so the output cannot be post-processed to match regular multi CM requests
- so the Cache output differs from the non-Cache output -->
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.tool']='AnalysisStudio' or /root/env/param[@name='ce_ui.tool']='AnalysisStudio'">
- <xsl:variable name="defaultAnalysis">
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xsl:value-of select="/root/packageInfo/*/*[local-name()='packageConfiguration']/*[local-name()='defaultAnalysis']/*/*[local-name()='searchPath']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/packageInfo/cm:queryResponse/cm:queryReply[1]/cm:packageConfiguration/cm:defaultAnalysis/*/cm:searchPath"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="memberDisplayCountDefault">
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xsl:value-of select="/root/packageInfo/*/*[local-name()='packageConfiguration']/*[local-name()='memberDisplayCountDefault']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/packageInfo/cm:queryResponse/cm:queryReply[1]/cm:packageConfiguration/cm:memberDisplayCountDefault"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="memberDisplayCountLimit">
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xsl:value-of select="/root/packageInfo/*/*[local-name()='packageConfiguration']/*[local-name()='memberDisplayCountLimit']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/packageInfo/cm:queryResponse/cm:queryReply[1]/cm:packageConfiguration/cm:memberDisplayCountLimit"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:replace select="/root/launchParams/param[@name='ui.defaultAnalysis']">
- <param name="ui.defaultAnalysis"><xsl:value-of select="$defaultAnalysis"/></param>
- </xts:replace>
- <xts:replace select="/root/launchParams/param[@name='ui.memberDisplayCountDefault']">
- <param name="ui.memberDisplayCountDefault"><xsl:value-of select="$memberDisplayCountDefault"/></param>
- </xts:replace>
- <xts:replace select="/root/launchParams/param[@name='ui.memberDisplayCountLimit']">
- <param name="ui.memberDisplayCountLimit"><xsl:value-of select="$memberDisplayCountLimit"/></param>
- </xts:replace>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.defaultAnalysis']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.memberDisplayCountDefault']"/>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.memberDisplayCountLimit']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_package.ui.defaultAnalysis">true</param>
- <param name="temp.prompt_package.ui.memberDisplayCountDefault">true</param>
- <param name="temp.prompt_package.ui.memberDisplayCountLimit">true</param>
- </xts:append>
- </xsl:when>
- <!-- CM Cache does not support the Contributor object -->
- <xsl:when test="string(/root/env/param[@name='ui.tool'])='Contributor' or string(/root/callerEnv/param[@name='ui.tool'])='Contributor'">
- <xsl:variable name="appname" select="/root/packageInfo/cm:queryResponse/cm:queryReply[1]/*/cm:applicationID"/>
- <xts:replace select="/root/launchParams/param[@name='ui.appname']">
- <param name="ui.appname"><xsl:value-of select="$appname"/></param>
- </xts:replace>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.appname']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_package.ui.appname">true</param>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- <!-- update the routingServerGroup -->
- <xsl:variable name="routingServerGroup">
- <xsl:choose>
- <xsl:when test="/root/configInfo/useCMCache">
- <xsl:value-of select="/root/packageInfo/*/*[local-name()='package']/*[local-name()='routingServerGroup']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/packageInfo/cm:queryResponse/*/*/cm:routingServerGroup"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:replace select="/root/launchParams/param[@name='ui.routingServerGroup']">
- <param name="ui.routingServerGroup"><xsl:value-of select="$routingServerGroup"/></param>
- </xts:replace>
- <xts:delete select="/root/launchRedirect/param[string(.) = 'package' and @type='internal' and @name='ui.routingServerGroup']"/>
- <xts:append select="/root/env">
- <param name="temp.prompt_package.ui.routingServerGroup">true</param>
- </xts:append>
-
- <!-- Update cache context if not already there-->
- <xsl:if test="/root/configInfo/useCMCache and string(/root/launchParams/param[@name='ui.cacheContext']) = '' ">
- <xsl:variable name="cacheContext" select="/root/packageInfo/*[local-name()='queryResponse']/*[local-name()='genericOptionXMLEncodedXML']/*[local-name()='value']"/>
- <xts:replace select="/root/launchParams/param[@name='ui.cacheContext']">
- <param name="ui.cacheContext"><xsl:value-of select="$cacheContext"/></param>
- </xts:replace>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="getContent2"
- processor="XSLT"
- type="exec"
- dependency="getContent buildSpec"
- condition=".[not(/root/packageSelected) and /root/selectionSpec/item[@name='navigationId'] and /root/selectionSpec/item[@name='consumer-root'] != '/content' and starts-with(/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='searchPath'],'/content')]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl send bus xts xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:template match="root">
- <xts:sequence>
- <xts:replace select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='ancestors']">
- <ancestors xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='ancestors']/*[local-name()='ancestorInfo']">
- <xsl:if test="position()='1' or contains(string(./*[local-name()='searchPath']),string(/root/selectionSpec/item[@name='consumer-root']))">
- <xsl:copy-of select="."/>
- </xsl:if>
- </xsl:for-each>
- </ancestors>
- </xts:replace>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="contentLogic"
- processor="XSLT"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/selectionSpec/item[@name='navigationId']]"
- type="exec"
- dependency="filterMRUentries"
- nodelist="http, session, env, system, selectionSpec, queryResponse"
- mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="root">
- <xts:sequence>
- <xts:replace select="/root/*[local-name()='queryResponse']">
- <xts:transform processor="XSLT" src="portal/select/transforms/contentLogic.xslt" mimeType="text/xml">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
- <root>
- <xts:queryNode select="/root/http | /root/session | /root/env | /root/system | /root/selectionSpec | root/*[local-name()='queryResponse'] "/>
- </root>
- </xts:transform>
- </xts:replace>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="packCallerEnv"
- processor="XSLT"
- type="exec"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal']]"
- dependency="contentLogic"
- nodelist="env, credential, callerEnv"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xtsext xts xsl pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:delete select="/root/env/param[@name='so.savedCallerEnv']"/>
- <xts:append select="/root/env">
- <xsl:variable name="callerEnv">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/callerEnv"/>
- </xsl:call-template>
- </xsl:variable>
- <param name="so.savedCallerEnv">
- <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($callerEnv), true()))"/>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="packageSelectionDialogHeader"
- dependency="addUIbackURL updatePackagePropertyInfo contentLogic"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/displayPackageDialog]"
- mode="output"
- processor="XSLT"
- type="exec"
- mimeType="text/html"
- nodelist=""
- mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <!-- A workaround to resolve RPT violation (for accessibility support) concerning missing DOCTYPE line in Package
- Selection UI is to directly hard-code the missing line just before the opening <html> tag. -->
- <xsl:text>
- <!DOCTYPE HTML>
- <html lang="</xsl:text>
- <xsl:choose>
- <xsl:when test="/root/session">
- <xsl:value-of select="/root/session/param[@name='productLocale']"/>
- </xsl:when>
- <xsl:when test="/root/http">
- <xsl:value-of select="/root/http/param[@name='HTTP_ACCEPT_LANGUAGE']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'en'"/>
- </xsl:otherwise>
- </xsl:choose>
- <!--
- ++++++++
- COGCQ00056587 Trakker 617104.0 Firefox - select a package dialog does not have scrollbar until it has been maximized.
- COGCQ00234016 - Package Selection: when try to do next page, user is returned to next page of Public Folders instead of current folder.
- ++++++++
- - Add this function so that when there is more content than window, it triggers the display of scroll bar(s)
- - Must do any init javascript function at onload.
- -->
- <xsl:text>">
- <body onload="adjustVu('init')" onResize="adjustVu('resize')">
- <script language="javascript">
- function adjustVu(parm)
- {
- document.getElementById('selectionDiv').style.height='100%';
- if(parm == 'init' && window.init) window.init();
- }
- </script>
- <div id="selectionDiv" style="overflow:auto; width=100%; height=100%">
- </xsl:text>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="packageSelectionDialog"
- dependency="packageSelectionDialogHeader"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/displayPackageDialog]"
- mode="output"
- processor="XSLT"
- type="exec"
- mimeType="text/html"
- path="portal/select/src/render.xslt"
- nodelist="http, env, queryResponse, selectionSpec, callerEnv, system, session, configProps, search, user"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/permissions.xsl"/>
- <xts:logicsheet path="portal/select/logicsheets/search.xsl"/>
- <xts:logicsheet path="portal/select/logicsheets/pagers.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- </xts:block>
- <xts:block
- id="packageSelectionDialogFooter"
- dependency="packageSelectionDialog"
- condition=".[not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/displayPackageDialog]"
- mode="output"
- processor="XSLT"
- type="exec"
- mimeType="text/html"
- nodelist=""
- mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:text>
- </div>
- </body>
- </html>
- </xsl:text>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== package Prompt Blocks - End ================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- =============== MRU Blocks - Start ========================================================================================= -->
- <!-- ============================================================================================================================ -->
- <xts:block id="filterMRUentries" processor="XSLT" type="exec"
- condition=".[/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]/*[local-name()='shortcut'] and
- not(/root/packageSelected) and not(/root/launchError) and /root/launchRedirect/param[string(.) = 'package' and @type='internal'] and /root/selectionSpec/item[@name='navigationId']]"
- dependency="getContent2"
- nodelist="header, selectionSpec, queryResponse, launchComponent"
- mandatory="false">
- <xts:logicsheet path="portal/mru/logicsheets/mru.xslt"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:mru="http://developer.cognos.com/schemas/xts/mru/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xsl:variable name="mruShortcutNodes" select="/root/cm:queryResponse/cm:queryReply[3]/cm:shortcut"/>
- <mru:filter/>
- </xts:append>
- <xts:replace select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][3]">
- <queryReply xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <xts:queryNode select="/root/mruPackages/*[local-name()='queryResponse']/*[local-name()='queryReply']/*"/>
- </queryReply>
- </xts:replace>
- <xts:delete select="/root/mruPackages"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="checkMRUfolderPermissions"
- processor="XSLT"
- type="exec"
- condition=".[/root/packageSelected]"
- dependency="addRoutingServer addDefaultAnalysis getPackageBaseCache packageSelectionDialogFooter"
- nodelist="header"
- mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <MRUFolderPermission>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:search>~/mruFolder</cm:search>
- <cm:properties>
- <cm:property name="permissions"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </MRUFolderPermission>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block
- id="updateMRUlist"
- processor="XSLT"
- type="exec"
- condition=".[/root/packageSelected]"
- dependency="checkMRUfolderPermissions"
- nodelist="header, session, MRUFolderPermission, packageSelected"
- mandatory="false">
- <xts:logicsheet path="portal/mru/logicsheets/mru.xslt"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:mru="http://developer.cognos.com/schemas/xts/mru/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xsl:if test="string(/root/session/param[@name='write']) = 'true' and
- contains(string(/root/MRUFolderPermission/cm:queryResponse//cm:permissions),'write') and
- contains(string(/root/MRUFolderPermission/cm:queryResponse//cm:permissions),'traverse')">
- <xsl:variable name="mruTargetObjectId">
- <xsl:value-of select="/root/packageSelected/param[@name='so.storeID']"/>
- </xsl:variable>
- <xsl:variable name="mruTargetObjectSearchPath">
- <xsl:value-of select="/root/packageSelected/param[@name='so.searchPath']"/>
- </xsl:variable>
- <mru:update/>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== MRU Blocks - End =========================================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- ============================================================================================================================ -->
- <!-- =============== Launch Output Blocks - Start =============================================================================== -->
- <!-- ============================================================================================================================ -->
- <!-- Perform a browser redirection to a morphlet prompt. This block should execute for non-"internal" prompts.
- The page contains a POST redirection form which contains all the parameters from the env element, and which
- posts to the mophlet specified by the prompt element in the launch parameter XML file. -->
- <xts:block id="redirect" processor="XSLT" type="exec" mode="output" mimeType="text/html" dependency="checkSpecifiableMissingParams addRoutingServer addDefaultAnalysis getPackageBaseCache packageSelectionDialogFooter" mandatory="false" condition=".[not(/root/launchError) and (/root/launchRedirect/param) and not(/root/launchRedirect/param[@type='internal'])]" nodelist="launchRedirect, env, http, system, user">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl pf dp xts">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
-
- <pf:variables/>
- <xsl:template match="/">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
- <dp:meta>
- <pf:meta/> <!-- Add standard meta tags -->
- </dp:meta>
- <xsl:variable name="gateway">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='ui.gateway']">
- <xsl:value-of select="/root/env/param[@name='ui.gateway']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(/root/http/param[@name='SCRIPT_NAME'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <form name="pform" method="post" action="{$gateway}">
- <input name="m" type="hidden" value="{/root/launchRedirect/param[1]}"/>
- <input name="specifiedParamName" type="hidden" value="{/root/launchRedirect/param[1]/@name}"/>
- <input name="{concat('temp.prompt_',/root/launchRedirect/param[1], '.', /root/launchRedirect/param[1]/@name)}" type="hidden" value="true"/>
- <xsl:for-each select="/root/env/param[@name != 'm' and @name != 'specifiedParamName']">
- <input name="{@name}" type="hidden" value="{.}"/>
- </xsl:for-each>
- <!-- Add in an errURL element if no errURL element is provided. If launch.launchInWindow is provided we use javascript:window.close(), if there is a backURL we use that. If neither is present the CC home url will be used. This allows error pages to properly redirect and prevents redirection loops where it is impossible to exit the error page. This needs to be done after the first redirection from launch.xts because after this we no longer know how many times we've visited this page. -->
- <xsl:if test="not(/root/env/param[@name='errURL'] and not(/root/env/param[@name='errURL'] = ''))">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='launch.launchInWindow'] and /root/env/param[@name='launch.launchInWindow'] = 'true'">
- <input name="errURL" type="hidden" value="javascript:window.close()"/>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='ui.backURL'] and not(/root/env/param[@name='ui.backURL'] = '')">
- <input name="errURL" type="hidden" value="{/root/env/param[@name='ui.backURL']}"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="errURL" type="hidden" value="{concat($gateway, '?', /root/system/param[@name='COGNOSHome'])}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </form>
- <script language="javascript">document.pform.submit();</script>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Set up the parameters needed to call display_message.xslt. The displayed message will be the first launch error message
- attached to the input document. -->
- <xts:block id="setUpError" dependency="addRoutingServer addDefaultAnalysis getPackageBaseCache packageSelectionDialogFooter" condition=".[/root/launchError]" nodelist="launchError, env" type="exec" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <xsl:variable name="backURL">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='launch.launchInWindow'] = 'true'">
- <xsl:text>javascript:window.close();</xsl:text>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='ui.backURL']">
- <xsl:value-of select="/root/env/param[@name='ui.backURL']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <displayMessage>
- <backURL><xsl:value-of select="$backURL"/></backURL>
- <message><xsl:value-of select="/root/launchError[1]/errorMessage"/></message>
- </displayMessage>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Use display_message.xslt to display any error messages which have occurred during the launch process. -->
- <xts:block id="reportError" dependency="setUpError" condition=".[/root/launchError]" nodelist="displayMessage, http, user, system" mandatory="false" mode="output" processor="XSLT" type="exec" mimeType="text/html" path="portal/display_message.xslt">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- </xts:block>
- <!-- Launch the studio. This output block performs an HTTP 302 redirection to the studio being launched. This block is only executed
- for the 'redirect' launch type. The url provided must be a fully qualified URL, and no parameters are supported.
- -->
- <xts:block type="exec" mode="interpret" processor="XML"
- id="launchHTTPRedirect"
- dependency="updateMRUlist"
- condition=".[not(/root/launchError) and not(/root/launchRedirect/param) and (/root/launchComponent/@launchType='redirect')]"
- mandatory="false"
- nodelist="launchComponent, output, launchWebURI">
- <xts:sequence xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
- <xts:append select="/root/output">
- <xos:statusCode xmlns:xos="http://developer.cognos.com/schemas/xts/output/">302</xos:statusCode>
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Length">0</xos:param>
- <xos:param name="Location"><xts:queryValue select="/root/launchWebURI"/></xos:param>
- </xos:entityHeader>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xts:block>
- <!-- Launch the studio. This output block performs a redirection to the studio being launched, passing it all of the parameters
- specified in the launchParams element, and all other parameters contained in the env elements. Params in the launchParams
- element take precidence.
-
- There are three launch types which can be performed by this block. The launch type is specified in the launch parameter XML file.
- 1. url - The browser does a redirect to a given URL. In this case only, no parameters are passed.
- 2. javascript - A javascript object containing all of parameters in from the launchParams, and env
- elements of the input document is constructed. Params in the launchParams element take
- precidence. Javascript on the generated page then opens a new window to a URL specified in the
- launch parameter XML file. Once that page has been loaded, and the javascript parameter object has
- been read. The current page closes leaving the studio window open.
- 3. form - A POST form is constructed which POSTs to the ui.gateway and which contains all of the parameters
- from the launchParams, and env elements of the input document. Params in the launchParams element take
- precidence. -->
- <xts:block id="performLaunch"
- dependency="updateMRUlist" processor="XSLT" type="exec" mode="output" mimeType="text/html" mandatory="false"
- condition=".[not(/root/launchError) and not(/root/launchRedirect/param) and not(/root/launchComponent/@launchType='redirect')]"
- nodelist="launchParams, launchComponent, launchURLStructure, env, http, system, launchWebURI, launchService, session">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- exclude-result-prefixes="xsl pf dp xtsext xts">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
-
- <pf:variables/>
- <xsl:template match="/root">
- <xsl:choose>
- <!-- Three launch methods are available: url, javascript and form. -->
- <xsl:when test="/root/launchComponent/@launchType = 'url'"> <!-- URL based launch. Redirect to the given URL. -->
- <xsl:variable name="urlValue">
- <xsl:choose>
- <xsl:when test="not(/root/launchService)">
- <xsl:value-of select="/root/launchWebURI"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/launchService/collaborationApps/configuration/property[@name=concat('lc_',/root/launchParams/param[@name='ui.appname'],'_uri')]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <html lang="{$productLocale}">
- <head>
- <meta http-equiv="refresh" content="0; URL={$urlValue}"/>
- <title><xsl:value-of select="$product_name"/></title>
- </head>
- <body>
- </body>
- </html>
- </xsl:when>
- <xsl:when test="/root/launchComponent/@launchType = 'javascript'">
- <html lang="{$productLocale}">
- <head>
- <title><xsl:value-of select="$product_name"/></title>
- <script language="javascript">
- <xsl:variable name="jsObjName">
- <xsl:value-of select="/root/launchComponent/@jsObject"/>
- </xsl:variable>
- var <xsl:value-of select="$jsObjName"/> = new Object();
- <xsl:for-each select="/root/launchParams/param">
- <xsl:if test="not(string(.)='')">
- <xsl:variable name="paramName" select="@name"/>
- <xsl:variable name="paramValue">
- <xsl:text>'</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:text>'</xsl:text>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/launchComponent/param[@name=$paramName]/alias"> <!-- Aliases have been provided. They might be conditional, or we might need the value in multiple places -->
- <xsl:for-each select="/root/launchComponent/param[@name=$paramName]/alias">
- <xsl:variable name="condParamName" select="@conditionParam"/>
- <xsl:choose>
- <xsl:when test="not(@conditionParam)"> <!-- The alias is conditionless -->
- <xsl:value-of select="$jsObjName"/><xsl:text>["</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:text>"] = </xsl:text><xsl:value-of select="$paramValue"/><xsl:text>;</xsl:text>
- </xsl:when>
- <xsl:when test="/root/launchParams/param[@name=$condParamName] = ./@conditionValue"> <!-- The condition is met -->
- <xsl:value-of select="$jsObjName"/><xsl:text>["</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:text>"] = </xsl:text><xsl:value-of select="$paramValue"/><xsl:text>;</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise> <!-- Use name as is. -->
- <xsl:if test="not(starts-with(@name,'temp.')) and not(starts-with(@name,'launch.'))">
- <xsl:value-of select="$jsObjName"/><xsl:text>["</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(@name))"/><xsl:text>"] = </xsl:text><xsl:value-of select="$paramValue"/><xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="/root/env/param">
- <!-- Add all of the other parameters passed in as written. -->
- <xsl:variable name="paramName" select="./@name"/>
- <xsl:variable name="paramValue">
- <xsl:text>'</xsl:text><xsl:value-of select="xtsext:javascriptencode(string(.))"/><xsl:text>'</xsl:text>
- </xsl:variable>
- <xsl:if test="not(/root/launchParams/param[@name=$paramName]) and not(/root/launchComponent/*/alias[. = $paramName]) and not(string($paramValue) = '') and not(starts-with($paramName, 'launch.')) and not(starts-with($paramName, 'temp.'))"> <!-- Only add the element if it isn't in launchParams and if it won't be overridden by an alias, and it isn't a launch parameter. -->
- <xsl:value-of select="$jsObjName"/><xsl:text>["</xsl:text><xsl:value-of select="xtsext:javascriptencode(string($paramName))"/><xsl:text>"] = </xsl:text><xsl:value-of select="$paramValue"/><xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </script>
- </head>
- <xsl:choose>
- <xsl:when test="/root/launchParams/param[@name='launch.openJSStudioInFrame'] and /root/launchParams/param[@name='launch.openJSStudioInFrame']='true'">
- <script language="javascript">
- function updateTitle()
- {
- if (document.title != studioFrame.document.title)
- {
- document.title = studioFrame.document.title;
- }
-
- setTimeout("updateTitle()", 500);
- }
- setTimeout("updateTitle()",500);
- </script>
- <!-- Open the studio in a frame. (Used in main.xslt) -->
- <frameset>
- <xsl:element name="frame">
- <xsl:attribute name="name">studioFrame</xsl:attribute>
- <xsl:attribute name="src"><xsl:value-of select="/root/launchWebURI"/></xsl:attribute>
- </xsl:element>
- </frameset>
- </xsl:when>
- <xsl:otherwise>
- <body>
- <!-- Open the studio in a new window and close this one -->
- <script language="javascript">
- function launchStudio() {
- window.open( "<xsl:value-of select="/root/launchWebURI"/>" , "_blank", "menubar=no,toolbar=no,status=no,location=no,resizable=yes,width=700,height=500" );
- }
- function postLoad() {
- setTimeout("window.open('','_self','');window.close();",50);
- }
- if (window.attachEvent) {
- window.attachEvent('onload', launchStudio);
- } else {
- window.addEventListener('load', launchStudio, false);
- }
- </script>
- </body>
- </xsl:otherwise>
- </xsl:choose>
- </html>
- </xsl:when>
- <xsl:otherwise> <!-- Form based launch. Create a form to load the studio -->
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
- <dp:meta>
- <pf:meta/> <!-- Add standard meta tags -->
- </dp:meta>
- <xsl:variable name="gateway">
- <xsl:choose>
- <xsl:when test="/root/launchComponent/@URL">
- <xsl:value-of select="/root/launchWebURI"/>
- </xsl:when>
- <xsl:when test="/root/launchComponent/@URLStructure">
- <xsl:variable name="genURL" select="/root/launchURLStructure/URLStructure"/>
- <xsl:for-each select="$genURL/uriParam">
- <xsl:choose>
- <xsl:when test="@refparam">
- <xsl:value-of select="/root/launchParams/param[@name=current()/@refparam]"/>
- </xsl:when>
- <xsl:when test="@refnode">
- <xsl:choose>
- <xsl:when test="@refattr">
- <xsl:value-of select="//*[local-name()=current()/@refnode]/@*[local-name()=current()/@refattr]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="//*[local-name()=current()/@refnode]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='ui.gateway']">
- <xsl:value-of select="/root/env/param[@name='ui.gateway']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(/root/http/param[@name='SCRIPT_NAME'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="formMethod">
- <xsl:choose>
- <xsl:when test="/root/launchComponent/@formMethod">
- <xsl:value-of select="/root/launchComponent/@formMethod"/>
- </xsl:when>
- <xsl:when test="/root/launchComponent/@URL or /root/launchComponent/@URLStructure">
- <xsl:text>GET</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>POST</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <form name="pform" method="{$formMethod}" action="{$gateway}">
- <xsl:for-each select="/root/launchParams/param">
- <!-- TODO: Re-evaluate the existing logic that excludes params that have blank values-->
- <xsl:if test="not(string(.)='')">
- <xsl:variable name="paramName" select="@name"/>
- <xsl:variable name="paramValue">
- <xsl:choose>
- <xsl:when test="$formMethod = 'GET'"> <!-- In a GET request, the values must be protected -->
- <xsl:value-of select="xtsext:protect(string(.), '','','getdata')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/root/launchComponent/param[@name=$paramName]/alias"> <!-- Aliases have been provided. They might be conditional, or we might need the value in multiple places -->
- <xsl:for-each select="/root/launchComponent/param[@name=$paramName]/alias">
- <xsl:if test="not(starts-with(string(.),'temp.') or starts-with($paramName, 'launch.'))">
- <xsl:variable name="condParamName" select="@conditionParam"/>
- <xsl:choose>
- <xsl:when test="not(@conditionParam)"> <!-- The alias is conditionless -->
- <input name="{.}" type="hidden" value="{$paramValue}"/>
- </xsl:when>
- <xsl:when test="/root/launchParams/param[@name=$condParamName] = ./@conditionValue"> <!-- The condition is met -->
- <input name="{.}" type="hidden" value="{$paramValue}"/>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise> <!-- Use name as is. -->
- <xsl:if test="not(starts-with(string(.),'temp.') or starts-with($paramName, 'launch.'))">
- <input name="{@name}" type="hidden" value="{$paramValue}"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <!-- NOTE: URLStructures are the equivalent of a URL but handled within a form -->
- <!-- Therefore the existing environment MUST NOT BE ADDED to the form -->
- <xsl:for-each select="/root/env/param">
- <!-- Add all of the other parameters passed in as written. (This is needed for such things as the postBack functionality of CognosViewer -->
- <xsl:variable name="paramName" select="./@name"/>
- <xsl:variable name="paramValue">
- <xsl:choose>
- <xsl:when test="$formMethod = 'GET'"> <!-- In a GET request, the values must be protected -->
- <xsl:value-of select="xtsext:protect(string(.), '','','getdata')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not(/root/launchParams/param[@name=$paramName]) and not(/root/launchComponent/*/alias[. = $paramName]) and not(string($paramValue) = '') and not(starts-with($paramName, 'launch.')) and not(starts-with($paramName, 'temp.'))"> <!-- Only add the element if it isn't in launchParams and if it won't be overridden by an alias, and it isn't a launch parameter. -->
- <input name="{$paramName}" type="hidden" value="{$paramValue}"/>
- </xsl:if>
- </xsl:for-each>
- <!-- Add in an errURL element if no errURL element is provided. If launch.launchInWindow is provided we use javascript:window.close(), if there is a backURL we use that. If neither is present the CC home url will be used. This allows error pages to properly redirect and prevents redirection loops where it is impossible to exit the error page. This needs to be done after the first redirection from launch.xts because after this we no longer know how many times we've visited this page. -->
- <xsl:if test="not(/root/env/param[@name='errURL'] and not(/root/env/param[@name='errURL'] = ''))">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='launch.launchInWindow'] and /root/env/param[@name='launch.launchInWindow'] = 'true'">
- <input name="errURL" type="hidden" value="javascript:window.close()"/>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='ui.backURL'] and not(/root/env/param[@name='ui.backURL'] = '')">
- <input name="errURL" type="hidden" value="{/root/env/param[@name='ui.backURL']}"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="errURL" type="hidden" value="{concat($gateway, '?', /root/system/param[@name='COGNOSHome'])}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </form>
- <script language="javascript">
- document.pform.submit();
- </script>
- </dp:page>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!-- ============================================================================================================================ -->
- <!-- =============== Debug Blocks - Start ======================================================================================= -->
- <!-- ============================================================================================================================ -->
- <!-- Output debugging information if the debug session parameter is set. -->
- <xts:block id="debug" type="exec" dependency="launchHTTPRedirect performLaunch redirect reportError" mode="output" condition=".[/root/env/param[@name='d'] = '1' or /root/session/param[@name='debug'] = '1' ]" processor="XSLT" mandatory="false" mimeType="text/html" >
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <dbg:templates/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ============================================================================================================================ -->
- <!-- =============== Debug Blocks - End ========================================================================================= -->
- <!-- ============================================================================================================================ -->
- </xts:morphlet>
|