1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2017
- 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">
- <!-- ======================================================== -->
- <!-- State Management -->
- <!-- ======================================================== -->
- <!-- Unpack the CC state if we have one in the request -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="ccstate"
- condition=".[/root/env/param[@name='ccstate']]"
- nodelist="env">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/env">
- <xsl:value-of select="xtsext:web64decode(string(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='ccstate']))), true())" disable-output-escaping="yes"/>
- </xts:append>
- <xts:delete select="/root/env/param[@name='ccstate']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" condition=".[not(string(/root/output/*[local-name() = 'statusCode']) = '304')]">
- <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
- </xts:block>
- <!-- ======================================================== -->
- <!-- Session Management -->
- <!-- ======================================================== -->
- <!-- Reads session-sensitive info from CM -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="refreshSession"
- path="portal/cc/read_session.xml"
- dependency="ccstate"
- condition=".[
- string(/root/cookies/cookie[@name = 'cc_session']) = ''
- or /root/env/param[@name='m_reload']
- or /root/env/param[@name='m_root'] ]">
- <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 impersonateTenant" 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'] ]"
- mandatory="false"/>
- <!-- Save changes to the state info in a cookie -->
- <xts:block mode="interpret" processor="XSLT" type="exec"
- id="setSession"
- path="portal/set_session.xml"
- dependency="ccResponse groupEdit"
- condition=".[/root/updateSession]"
- mandatory="false"/>
- <!-- ======================================================== -->
- <!-- Process -->
- <!-- ======================================================== -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="pre-process"
- condition=".[string(/root/env/param[@name='m_tabPath']) != '' or
- starts-with(/root/env/param[@name='m_tab' or @name='m_page'],'path:') or
- /root/env/param[@name='cpstarget'] or
- (not(/root/env/param[@name='cs_filter']) and string(/root/env/param[@name='t_cs_filter_saved']) = 'true')]"
- dependency="buildSession" nodelist="env, header">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- 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>
- <!-- convert tab path to its id equivalent -->
- <xsl:if test="string(/root/env/param[@name='m_tabPath']) != '' or starts-with(/root/env/param[@name='m_tab' or @name='m_page'],'path:')">
- <xts:append>
- <tabPath_id>
- <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:choose>
- <xsl:when test="string(/root/env/param[@name='m_tabPath']) != ''">
- <xsl:value-of select="string(/root/env/param[@name='m_tabPath'])"/>
- </xsl:when>
- <xsl:when test="starts-with(/root/env/param[@name='m_tab'],'path:')">
- <xsl:value-of select="substring-after(/root/env/param[@name='m_tab'],'path:')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after(/root/env/param[@name='m_page'],'path:')"/>
- </xsl:otherwise>
- </xsl:choose>
- </cm:search>
- <cm:properties>
- <cm:property name="storeID"/>
- </cm:properties>
- <cm:options schemaInfo="false"/>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </tabPath_id>
- </xts:append>
- </xsl:if>
- <!-- unpack cpstarget -->
- <xsl:if test="string(/root/env/param[@name='cpstarget']) != ''">
- <xsl:variable name="cpstarget">
- <xsl:value-of select="xtsext:web64decode(xtsext:validator('verify', 'cpstarget', string(/root/env/param[@name='cpstarget'])), true())" disable-output-escaping="yes"/>
- </xsl:variable>
- <xts:append select="/root/env">
- <xsl:copy-of select="$cpstarget"/>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- For search requests, build the search expression -->
- <xts:block mandatory="false" processor="XSLT" type="exec"
- id="setSearch"
- dependency="buildSession pre-process"
- condition=".[ /root/env/param[@name = 'search'] ]"
- nodelist="cookies, env, session, system, user, configProps">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <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:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:search="http://developer.cognos.com/schemas/xts/logicsheets/xslt/searchlogic/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
- <pf:variables/>
- <cml:object-predicates/>
- <xsl:template match="/root">
- <!-- If we have a search command then append a <search> element -->
- <xsl:variable name="path">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='m_folder']) != ''">
- <xsl:value-of select="concat('storeID("', /root/env/param[@name='m_folder'], '")')"/>
- </xsl:when>
- <xsl:when test="string(/root/env/param[@name='m_path']) != ''">
- <xsl:value-of select="string(/root/env/param[@name='m_path'])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(/root/system/param[@name='consumer-root'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <search:gen-search-exp>
- <search:defaultTypes>
- <search:defaultType>document</search:defaultType>
- <search:defaultType>cd</search:defaultType>
- <search:defaultType>advisorView</search:defaultType>
- <search:defaultType>advisorCanvas</search:defaultType>
- <search:defaultType>shortcut</search:defaultType>
- <search:defaultType>analysis</search:defaultType>
- <search:defaultType>agentDefinition</search:defaultType>
- <search:defaultType>agentDefinitionView</search:defaultType>
- <search:defaultType>dataMovementTask</search:defaultType>
- <search:defaultType>dataMovementTaskAlias</search:defaultType>
- <search:defaultType>report</search:defaultType>
- <search:defaultType>interactiveReport</search:defaultType>
- <search:defaultType>query</search:defaultType>
- <search:defaultType>reportView</search:defaultType>
- <search:defaultType>folder</search:defaultType>
- <search:defaultType>URL</search:defaultType>
- <search:defaultType>pagelet</search:defaultType>
- <search:defaultType>package</search:defaultType>
- <search:defaultType>jobDefinition</search:defaultType>
- <search:defaultType>planningTask</search:defaultType>
- <search:defaultType>powerPlayCube</search:defaultType>
- <search:defaultType>powerPlayReport</search:defaultType>
- <search:defaultType>powerPlay8Report</search:defaultType>
- <search:defaultType>powerPlay8ReportView</search:defaultType>
- <search:defaultType>reportTemplate</search:defaultType>
- <search:defaultType>metricsFileImportTask</search:defaultType>
- <search:defaultType>metricsDataSourceETLTask</search:defaultType>
- <search:defaultType>metricsMaintenanceTask</search:defaultType>
- <search:defaultType>metricsExportTask</search:defaultType>
- <search:defaultType>contentReference</search:defaultType>
- </search:defaultTypes>
- </search:gen-search-exp>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ======================================================== -->
- <!-- Content request -->
- <!-- ======================================================== -->
- <!-- Content request for PF/MF navigation/search and portal pages -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="getContent"
- path="portal/cc/get_content.xslt"
- dependency="setSearch ccstate buildSession"
- nodelist="header, http, env, session, search, cookies, setCookies, user, credential, configProps, page, tabPath_id, mvcSettings">
- <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- </xts:block>
- <!-- Merge the tenantNames into the response -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- path="/portal/tenancy/mergeTenantNames.xslt"
- id="mergeTenantNames"
- dependency="getContent"
- condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!-- Call nav to get content for the search -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="getNavContent"
- condition=".[/root/search/navSearchSpec]"
- path="portal/cc/get_content_nav.xslt"
- dependency="setSearch ccstate buildSession"
- nodelist="header, http, env, system, session, search, cookies, setCookies, user, credential, configProps, page, tabPath_id">
- <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
- <xts:logicsheet path="portal/cc/search_pagers.xslt"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!--
- Read the portal tabs if they did not exist in the session.
- -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="getPortalPages"
- dependency="mergeTenantNames getNavContent"
- nodelist="header, cookies, setCookies, env, system, session, configProps, page, credential"
- path="portal/cc/get_portal_pages.xslt"
- condition=".[
- (
- not(/root/cmContent/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*[local-name()='runTimeState']/*[local-name()='portalTabs'])
- and
- ((/root/cmContent/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*) or (/root/page/type = 'custom'))
- )
- or
- /root/env/param[@name='m_reload']
- or
- /root/env/param[@name='refresh']
- or
- not(/root/session/param[@name='cachestamp'])
- ]">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!-- ================================================ -->
- <!-- getPagelet -->
- <!-- ================================================ -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="getPagelet"
- dependency="getPortalPages"
- condition=".[/root/page/type = 'custom']"
- nodelist="http, env, user, session, credential, header, page, state, cmContent, configProps">
- <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
- xmlns:soap="http://developer.cognos.com/schemas/cps/logic/soap"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="xts cm cps asm soap xtsext pf">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:variable name="pageID" select="/root/page/id"/>
- <xsl:variable name="portlet-param" select="key('env-param', 'm_portlet')"/>
- <xsl:variable name="cps-package">
- <xsl:choose>
- <xsl:when test="$pageID = 'portlet'">
- <xsl:value-of select="concat('/', substring-before(substring-after($portlet-param, '/'), '/'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/connection</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cps-pagelet">
- <xsl:choose>
- <xsl:when test="$pageID = 'portlet'">
- <xsl:value-of select="concat('/', substring-after(substring-after($portlet-param, '/'), '/'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('/', $pageID)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cps-path" select="concat($cps-package, $cps-pagelet)"/>
- <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- <xsl:variable name="session-objects" select="/root/cmContent/cm:queryResponse/cm:queryReply/cm:runTimeState"/>
- <xsl:variable name="package-context" select="$session-objects/cps:packageContext"/>
- <xsl:variable name="pagelet-context" select="/root/state/cps:pageletContext | $session-objects/cps:pageletContext"/>
- <xsl:variable name="wsrp-urlType" select="string(key('env-param', 'wsrp-urlType'))"/>
- <xsl:variable name="cps-portlet" select="string(key('env-param', 'cps-portlet'))"/>
- <!-- parameters not to be passed into assembler call -->
- <xsl:variable name="params-excluded" select="' m b_action m_obj m_folder m_folder2 m_tab encoding backURL tb nh rui style m_page m_portlet m_pagemode m_state '"/>
- <!-- base url -->
- <xsl:variable name="request-url" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
- <xsl:variable name="resource-url" select="concat($request-url, '?b_action=xts.run&m=portal/mypages/page_resource.xts')"/>
- <!--
- being viewed as tab
- m_tab
- m_folder
- m_folder2
- rui
- being viewed as page
- backURL
- rui
- -->
- <xsl:variable name="m_page" select="key('env-param', 'm_page')"/>
- <xsl:variable name="m_portlet" select="key('env-param', 'm_portlet')"/>
- <xsl:variable name="m_tab" select="key('env-param', 'm_tab')"/>
- <xsl:variable name="m_folder" select="key('env-param', 'm_folder')"/>
- <xsl:variable name="m_folder2" select="key('env-param', 'm_folder2')"/>
- <xsl:variable name="rui" select="key('env-param', 'rui')"/>
- <xsl:variable name="style" select="key('env-param', 'style')"/>
- <xsl:variable name="m_ts" select="key('env-param', 'm_ts')"/>
- <!-- page mode overrride, 'edit'=show edit captions, 'view'=hide edit captions -->
- <xsl:variable name="m_pagemode" select="key('env-param', 'm_pagemode')"/>
- <!-- target portion determines routing -->
- <xsl:variable name="target">
- <xsl:text>b_action=xts.run&m=portal/cc.xts</xsl:text>
- </xsl:variable>
- <xsl:variable name="extras">
- <xsl:if test="$m_tab">
- <param name="m_tab"><xsl:value-of select="$m_tab"/></param>
- </xsl:if>
- <xsl:if test="$m_page">
- <param name="m_page"><xsl:value-of select="$m_page"/></param>
- </xsl:if>
- <xsl:if test="$m_portlet">
- <param name="m_portlet"><xsl:value-of select="$m_portlet"/></param>
- </xsl:if>
- <xsl:if test="$m_pagemode">
- <param name="m_pagemode"><xsl:value-of select="$m_pagemode"/></param>
- </xsl:if>
- <xsl:if test="$rui">
- <param name="rui"><xsl:value-of select="$rui"/></param>
- </xsl:if>
- <xsl:if test="$style">
- <param name="style"><xsl:value-of select="$style"/></param>
- </xsl:if>
- <xsl:if test="$m_folder">
- <param name="m_folder"><xsl:value-of select="$m_folder"/></param>
- </xsl:if>
- <xsl:if test="$m_folder2">
- <param name="m_folder2"><xsl:value-of select="$m_folder2"/></param>
- </xsl:if>
- <xsl:if test="$m_ts">
- <param name="m_ts"><xsl:value-of select="$m_ts"/></param>
- </xsl:if>
- </xsl:variable>
- <!-- cpstarget is a bypass parameter in CAF - we handle the signing separately in XTS. -->
- <xsl:variable name="cpstarget">
- <xsl:variable name="params">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="$extras"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text/>&cpstarget=<xsl:value-of select="xtsext:urlencode(xtsext:validator('prepare', 'cpstarget', xtsext:web64encode(string($params), true())))"/>
- </xsl:variable>
- <xsl:variable name="base-url">
- <xsl:value-of select="$request-url"/>?<xsl:text/>
- <xsl:value-of select="$target"/>
- <xsl:value-of select="$cpstarget"/>
- </xsl:variable>
- <!-- backURL -->
- <xsl:variable name="gateway" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
- <xsl:variable name="backURL" select="key('env-param', 'backURL')"/>
- <xsl:variable name="backTemplate">
- <xsl:value-of select="$gateway"/>
- <xsl:text>?b_action=xts.run&m=/portal/back.xts&id={backID}</xsl:text>
- </xsl:variable>
- <!-- rewrite into page or save in session -->
- <xsl:variable name="guid" select="xtsext:generateGUID()"/>
- <xsl:variable name="state-id" select="/root/state/id"/>
- <xsl:variable name="param-state" select="key('env-param', 'm_state')"/>
- <xsl:variable name="rewrite-state" select="/root/page/displayMode = 'viewer' or $param-state"/>
- <!-- user and session -->
- <xsl:variable name="user-id" select="xtsext:web64encode( string( /root/session/param[@name = 'e_hp'] ), false() )"/>
- <xsl:variable name="user-name" select="/root/session/param[@name = 'e_user']"/>
- <xsl:variable name="user-agent" select="/root/http/param[@name = 'HTTP_USER_AGENT']"/>
- <xsl:variable name="content-locale" select="/root/user/param[@name = 'contentLocale']"/>
- <xsl:variable name="product-locale" select="/root/user/param[@name = 'productLocale']"/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- save copy of new state-id for save to session -->
- <xsl:if test="$rewrite-state and not($state-id)">
- <xts:append select="/root/state">
- <guid>
- <xsl:value-of select="concat('ID:', $guid)"/>
- </guid>
- </xts:append>
- </xsl:if>
- <xts:append>
- <assembler>
- <soap:request provider="assembler" responseEnvelope="false" option="xml-part">
- <xts:param name="baseURL">
- <xsl:value-of select="$base-url"/>
- </xts:param>
- <xts:param name="backURL">
- <xsl:value-of select="$backURL"/>
- </xts:param>
- <xts:param name="backTemplate">
- <xsl:value-of select="$backTemplate"/>
- </xts:param>
- <xts:param name="resourceURL">
- <xsl:value-of select="$resource-url"/>
- </xts:param>
- <xts:param name="portletInstanceKey">
- <xsl:value-of select="$cps-portlet"/>
- </xts:param>
- <xts:param name="resourceInstance">
- <xsl:value-of select="$guid"/>
- </xts:param>
- <xts:param name="rewriteState">
- <xsl:value-of select="$rewrite-state"/>
- </xts:param>
- <xts:param name="stateID">
- <xsl:choose>
- <xsl:when test="$state-id">
- <xsl:value-of select="$state-id"/>
- </xsl:when>
- <xsl:when test="$rewrite-state = 'true'">
- <xsl:value-of select="concat('ID:', $guid)"/>
- </xsl:when>
- </xsl:choose>
- </xts:param>
- <asm:getPagelet xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/">
- <cps:path>
- <xsl:value-of select="$cps-path"/>
- </cps:path>
- <!-- packageContext -->
- <xsl:copy-of select="$package-context"/>
- <!-- pageletContext -->
- <xsl:copy-of select="$pagelet-context"/>
- <!-- portalContext -->
- <cps:portalContext>
- <cps:portalAgent>cognos</cps:portalAgent>
- <cps:param name="webContentURL">
- <xts:queryValue select="string(/root/http/param[@name='WEB_CONTENT_ROOT'])"/>
- </cps:param>
- <!--parse request type from incoming request-->
- <cps:param name="gatewayURL">
- <xsl:value-of select="$request-url"/>
- </cps:param>
- </cps:portalContext>
- <!-- userContext -->
- <cps:userContext>
- <cps:userContextKey>
- <xsl:value-of select="$user-id"/>
- </cps:userContextKey>
- <cps:userName>
- <xsl:value-of select="$user-name"/>
- </cps:userName>
- <cps:preferences>
- <xsl:for-each select="/root/user/param">
- <cps:param name="{ @name }">
- <xsl:value-of select="."/>
- </cps:param>
- </xsl:for-each>
- </cps:preferences>
- </cps:userContext>
- <!-- cps:interaction -->
- <xsl:if test="($wsrp-urlType = 'blockingAction' or $wsrp-urlType = 'render') and not($cps-portlet = '') or /root/env/param[@name='refresh']">
- <cps:interaction>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='refresh']">
- <cps:param name="cps-event">name=fragment.refresh</cps:param>
- </xsl:when>
- <xsl:otherwise>
- <cps:param name="wsrp-portletInstanceKey">
- <xsl:value-of select="$cps-portlet"/>
- </cps:param>
- <xsl:for-each select="/root/env/param[not(contains($params-excluded, concat(' ', @name, ' ')))]">
- <cps:param name="{ @name }">
- <xsl:choose>
- <xsl:when test="@format = 'encrypted'">
- <xts:decrypt>
- <xts:param name="encode">xml</xts:param>
- <xts:param name="provider">cognos.cam</xts:param>
- <xts:param name="source">
- <xsl:value-of select="."/>
- </xts:param>
- </xts:decrypt>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </cps:param>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </cps:interaction>
- </xsl:if>
- <!-- pageletParams -->
- <cps:pageletParams>
- <xsl:variable name="content-validator" select="string(/root/page/cache/contentValidator)"/>
- <xsl:variable name="validator">
- <xsl:if test="$content-validator != '' and string(/root/page/cache/ccETagUsable) = 'true'">
- <xsl:value-of select="$content-validator"/>
- </xsl:if>
- </xsl:variable>
- <!-- Add the options element with a cache validator -->
- <cps:validateTag>
- <xsl:value-of select="$validator"/>
- </cps:validateTag>
- <cps:userAgent>
- <xsl:value-of select="$user-agent"/>
- </cps:userAgent>
- <xsl:choose>
- <xsl:when test="$m_pagemode = 'view'">
- <cps:pageletMode>cps:view</cps:pageletMode>
- </xsl:when>
- <xsl:when test="$m_pagemode = 'preview'">
- <cps:pageletMode>cps:preview</cps:pageletMode>
- </xsl:when>
- <xsl:when test="$m_pagemode = 'edit'">
- <cps:pageletMode>cps:edit</cps:pageletMode>
- </xsl:when>
- </xsl:choose>
- <cps:locales>
- <xsl:value-of select="$content-locale"/>
- </cps:locales>
- <xsl:if test="$content-locale != $product-locale">
- <cps:locales>
- <xsl:value-of select="$product-locale"/>
- </cps:locales>
- </xsl:if>
- <cps:mimeTypes>text/html</cps:mimeTypes>
- </cps:pageletParams>
- </asm:getPagelet>
- </soap:request>
- <xsl:if test="contains(string(/root/http/param[@name='HTTP_USER_AGENT']) , 'MSIE')">
- <msie/>
- </xsl:if>
- </assembler>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <pf:serialize-xml/>
- </xsl:stylesheet>
- </xts:block>
- <!-- validator - handle the validator tag -->
- <!-- ============================================================================= -->
- <xts:block type="exec" mode="interpret" processor="XML"
- id="304"
- dependency="getPortalPages getPagelet"
- condition=".[/root/page/cache/ccETagUsable = 'true' and ((string(/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator']) != '' and string(/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator']) = /root/page/cache/contentValidator) or string(/root/assembler/*[local-name() = 'getPageletResponse']/*[local-name() = 'pageletMarkup']/*[local-name() = 'useCachedMarkup']) = 'true')]"
- mandatory="false">
- <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/">304</xos:statusCode>
- <xos:part>
- <xos:entityHeader>
- <xos:param name="ETag"><xts:queryValue select="concat(/root/page/cache/ccETag,':',/root/page/cache/contentValidator)"/></xos:param>
- <xos:param name="Content-Length">0</xos:param>
- <xos:param name="Cache-Control">must-revalidate</xos:param>
- </xos:entityHeader>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xts:block>
- <!--
- ===============================================================================================
- get_advanced_settings - get advanced settings
- ===============================================================================================
- -->
- <xts:block id="get_advanced_settings" type="exec" processor="XSLT" mandatory="false" mode="interpret">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <advancedSettings>
- <xts:function name="getConfiguration">
- <xts:param name="portal.disablecc"/>
- </xts:function>
- </advancedSettings>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ================================================ -->
- <!-- ccResponse -->
- <!-- ================================================ -->
- <!--
- generate response
- if search request
- render search page
- else
- render main page
- -->
- <!-- ================================================ -->
- <xts:block type="exec" mode="interpret" processor="XSLT"
- id="ccResponse"
- dependency="304 classNames get_advanced_settings"
- condition=".[not(string(/root/output/*[local-name() = 'statusCode']) = '304')]"
- nodelist="env, page, search, assembler, session, objectClass, advancedSettings, http">
- <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:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
- exclude-result-prefixes="cm cps xos SOAP-ENV SOAP-ENC xsi bus send xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="asm-redirect" select="/root/assembler/asm:getPageletResponse/cps:redirectURL"/>
- <xsl:variable name="asm-remote" select="/root/env/param[@name = 'asm-remote']"/>
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="$asm-remote">
- <xsl:call-template name="remote"/>
- </xsl:when>
- <xsl:when test="$asm-redirect">
- <xsl:call-template name="redirect"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-page"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="render-page">
- <xsl:variable name="gateway" select="/root/http/param[@name = 'SCRIPT_NAME']"/>
- <xts:sequence>
- <xts:append select="/root/output">
- <xsl:variable name="disableCC" select="/root/*[local-name()='advancedSettings']/*[local-name()='configuration']/*[local-name()='property' and @name='portal.disablecc']"/>
- <xsl:choose>
- <xsl:when test="not($disableCC='false')">
- <xos:part>
- <xos:entityBody>
- <html>
- <head>
- <meta http-equiv="refresh">
- <xsl:attribute name="content">0; URL=<xsl:value-of select="concat(xtsext:substringBeforeLast(xtsext:substringBeforeLast($gateway,'/'),'/'), '/')"/></xsl:attribute>
- </meta>
- </head>
- </html>
- </xos:entityBody>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/html; charset=UTF-8</xos:param>
- </xos:entityHeader>
- </xos:part>
- </xsl:when>
- <xsl:when test="root/env/param[@name='feed'] = 'rss'">
- <xts:transform processor="XSLT" src="portal/cc/gen_rss.xslt" option="part" mimeType="text/xml">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
- <xts:param name="messageBase">messages/portal.xml</xts:param>
- <xts:param name="messageBase">messages/portalRL.xml</xts:param>
- <root>
- <xsl:choose>
- <xsl:when test="root/search/expression or /root/search/navSearchSpec">
- <title><xts:string id="IDS_SEARCH"/></title>
- </xsl:when>
- <xsl:otherwise>
- <title><xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][2]/*/*[local-name() = 'defaultName']"/></title>
- <description><xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][2]/*/*[local-name() = 'defaultDescription']"/></description>
- </xsl:otherwise>
- </xsl:choose>
- <objs>
- <xsl:choose>
- <xsl:when test="/root/search/navSearchSpec">
- <xts:queryNode select="/root/navContent/*[local-name() = 'searchResponse']/*[local-name() = 'content']/*"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:queryNode select="/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'queryReply'][3]/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </objs>
- <xts:queryNode select="/root/http | /root/env | /root/user | /root/system | /root/cmContent | /root/configProps | /root/session | /root/header | /root/credential | /root/cookies | /root/setCookies "/>
- </root>
- </xts:transform>
- </xsl:when>
- <xsl:when test="/root/search">
- <xts:transform processor="XSLT" src="portal/cc/gen_search_page.xslt" option="part" mimeType="text/html">
- <xts:param name="logicsheet">portal/mvc/multi-instance.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">portal/cc/search_pagers.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/search.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/indextree.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/layout.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/dialog/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
- <xts:param name="messageBase">messages/portal.xml</xts:param>
- <xts:param name="messageBase">messages/portalRL.xml</xts:param>
- <xts:queryNode select="/root"/>
- </xts:transform>
- </xsl:when>
- <xsl:when test="/root/page/type = 'custom'">
- <xos:part>
- <xos:entityBody>
- <xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html>]]> </xsl:text>
- <html lang="{/root/session/param[@name='productLocale']}">
- <!-- check for new backURL -->
- <xsl:if test="/root/assembler/backContext/newBack">
- <xts:update xmlns:xts="http://developer.cognos.com/schemas/xts/" select="/root/env/param[@name='backURL']" mandatory="true">
- <param name="backURL"><xsl:value-of select="/root/assembler/backContext/newBack"/></param>
- </xts:update>
- </xsl:if>
- <xts:transform processor="XSLT" nodelist="http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, assembler, tab, portalTabs, configProps" src="portal/cc/gen_head.xslt" option="content" mimeType="text/html">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
- <xts:param name="messageBase">messages/portal.xml</xts:param>
- <xts:param name="messageBase">messages/portalRL.xml</xts:param>
- </xts:transform>
- <body onload="if (window.init) init();" topmargin="3" bottommargin="0" marginheight="3" rightmargin="5" leftmargin="5" marginwidth="3">
- <xsl:if test="/root/assembler/msie">
- <xsl:attribute name="style">overflow:auto</xsl:attribute>
- </xsl:if>
- <xts:transform processor="XSLT" nodelist="http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, assembler, tab, portalTabs, configProps" src="portal/cc/gen_custom_page.xslt" option="content" mimeType="text/html">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
- <xts:param name="messageBase">messages/portal.xml</xts:param>
- <xts:param name="messageBase">messages/portalRL.xml</xts:param>
- </xts:transform>
- <xos:content refId="{/root/assembler/xos:part/xos:entityBody/@refId}"/>
- </body>
- </html>
- </xos:entityBody>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/html; charset=UTF-8</xos:param>
- </xos:entityHeader>
- </xos:part>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform processor="XSLT" nodelist="objectClass, cookies, http, credential, env, user, system, session, cmContent, upfContent, page, gatewayURI, generalConfigSettings, assembler, tab, portalTabs, configProps, mvcSettings" src="portal/cc/gen_page.xslt" option="part" mimeType="text/html">
- <xts:param name="logicsheet">portal/mvc/multi-instance.xsl</xts:param>
- <xts:param name="logicsheet">portal/mvc/config/configuration.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/permissions.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/main/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/framework.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/controls/presentation.xsl</xts:param>
- <xts:param name="logicsheet">logicsheets/rss.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/validation.xslt</xts:param>
- <xts:param name="logicsheet">logicsheets/presentation/touch_up.xslt</xts:param>
- <xts:param name="messageBase">messages/portal.xml</xts:param>
- <xts:param name="messageBase">messages/portalRL.xml</xts:param>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- <xsl:if test="string(/root/page/cache/ccCanCache) = 'true' and string(/root/page/cache/ccETag) != '0'">
- <!-- Set the validator to be sent to the browser as an Etag header -->
- <xts:append select="/root/output/*[local-name() = 'part']/*[local-name() = 'entityHeader']">
- <xos:param name="ETag"><xts:queryValue select="concat(/root/page/cache/ccETag,':',/root/cmContent/*[local-name() = 'queryResponse']/*[local-name() = 'validator'] | /root/assembler/*[local-name() = 'getPageletResponse']/*[local-name() = 'pageletMarkup']/*[local-name() = 'cacheControl']/*[local-name() = 'validateTag'])"/></xos:param>
- <xos:param name="Cache-Control">must-revalidate</xos:param>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="redirect">
- <xsl:variable name="redirect-page">
- <xsl:choose>
- <xsl:when test="$asm-redirect = 'page:///back'">
- <xsl:value-of select="/root/env/param[@name = 'backURL']"/>
- </xsl:when>
- <xsl:when test="starts-with($asm-redirect, 'http://')">
- <xsl:value-of select="$asm-redirect"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
- <xos:entityHeader>
- <xos:param name="Content-Type">text/html</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <html lang="{/root/session/param[@name='productLocale']}">
- <head>
- <meta http-equiv="refresh">
- <xsl:attribute name="content">0; URL=<xsl:value-of select="$redirect-page"/></xsl:attribute>
- </meta>
- <title>CPS Redirect</title>
- </head>
- <body bgcolor="#ffffff"/>
- </html>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="remote">
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <xts:queryNode select="/root/assembler/*[1]/*[local-name() = 'pageletMarkup']"/>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- if cps:pageletContext
- if state-id else guid else path
- save in session
- if state/id
- delete state/id from session
- -->
- <xts:block type="exec" mode="interpret" processor="XSLT"
- id="updatesession"
- dependency="getPagelet"
- condition=".[/root/page/type='custom']"
- nodelist="header, env, credential, cookies, setCookies, page, state, assembler"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:asm="http://developer.cognos.com/schemas/cps/asm/assembler/1/"
- exclude-result-prefixes="cm cps xos SOAP-ENV SOAP-ENC xsi bus send xtsext pf asm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="asm-update" select="/root/assembler/asm:getPageletResponse/cps:updateResponse"/>
- <pf:sessionpassport/>
- <xsl:template match="/">
- <xsl:variable name="pageID" select="/root/page/id"/>
- <xsl:variable name="state-id" select="/root/state/id"/>
- <xsl:variable name="state-guid" select="/root/state/guid"/>
- <xsl:variable name="portlet-param" select="/root/env/param[@name = 'm_portlet']"/>
- <xsl:variable name="cps-package">
- <xsl:choose>
- <xsl:when test="$pageID = 'portlet'">
- <xsl:value-of select="concat('/', substring-before(substring-after($portlet-param, '/'), '/'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>/connection</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cps-pagelet">
- <xsl:choose>
- <xsl:when test="$pageID = 'portlet'">
- <xsl:value-of select="concat('/', substring-after(substring-after($portlet-param, '/'), '/'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('/', $pageID)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cps-path" select="concat($cps-package, $cps-pagelet)"/>
- <!-- check for updated session state -->
- <xsl:variable name="new-package-context" select="$asm-update/cps:packageContext"/>
- <xsl:variable name="new-pagelet-context" select="$asm-update/cps:pageletContext"/>
- <xsl:variable name="new-back-context" select="/root/assembler/backContext"/>
- <xsl:if test="$new-package-context | $new-pagelet-context | $new-back-context">
- <xts:sequence>
- <xts:discard>
- <xsl:if test="$new-package-context">
- <xts:function name="TDSRequest">
- <xts:param name="action">set</xts:param>
- <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
- <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
- <xts:param name="name"><xsl:value-of select="xtsext:web64encode($cps-package, false())"/></xts:param>
- <xts:param name="source">
- <xsl:text><packageContext xmlns="http://developer.cognos.com/schemas/cps/asm/objects/1/" xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"><path></xsl:text>
- <xsl:value-of select="xtsext:xmlencode($cps-package)"/>
- <xsl:text></path><state></xsl:text>
- <xsl:value-of select="$new-package-context/cps:state"/>
- <xsl:text></state></packageContext></xsl:text>
- </xts:param>
- </xts:function>
- </xsl:if>
- <xsl:if test="$new-pagelet-context">
- <xts:function name="TDSRequest">
- <xts:param name="action">set</xts:param>
- <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
- <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
- <xts:param name="name">
- <xsl:choose>
- <xsl:when test="$state-id">
- <xsl:value-of select="$state-id"/>
- </xsl:when>
- <xsl:when test="$state-guid">
- <xsl:value-of select="$state-guid"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:web64encode($cps-path, false())"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- <xts:param name="source">
- <xsl:text><pageletContext xmlns="http://developer.cognos.com/schemas/cps/asm/objects/1/" xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"><path></xsl:text>
- <xsl:value-of select="xtsext:xmlencode($cps-path)"/>
- <xsl:text></path><state></xsl:text>
- <xsl:value-of select="$new-pagelet-context/cps:state"/>
- <xsl:text></state></pageletContext></xsl:text>
- </xts:param>
- </xts:function>
- </xsl:if>
- <xsl:if test="$new-back-context">
- <xts:function name="TDSRequest">
- <xts:param name="action">set</xts:param>
- <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
- <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
- <xts:param name="name"><xsl:value-of select="$new-back-context/id"/></xts:param>
- <xts:param name="source">
- <xsl:text><backURL xmlns=""></xsl:text>
- <xsl:value-of select="xtsext:xmlencode($new-back-context/saveBack)"/>
- <xsl:text></backURL></xsl:text>
- </xts:param>
- </xts:function>
- </xsl:if>
- </xts:discard>
- </xts:sequence>
- </xsl:if>
- <!-- state has transitioned to in-page, delete version in session -->
- <xsl:if test="$state-id and not($new-pagelet-context)">
- <xts:sequence>
- <xts:discard>
- <xts:function name="TDSRequest">
- <xts:param name="action">delete</xts:param>
- <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
- <xts:param name="map-id"><xsl:value-of select="'portlets'"/></xts:param>
- <xts:param name="name"><xsl:value-of select="$state-id"/></xts:param>
- </xts:function>
- </xts:discard>
- </xts:sequence>
- </xsl:if>
- <!-- Dump report portlet state -->
- <xsl:if test="/root/env/param[@name='refresh']">
- <xts:sequence>
- <xts:discard>
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:delete xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>~~/runTimeState[starts-with(@name, '_CPSID_')]</cm:search>
- <cm:options recursive="true" force="true"/>
- </cm:delete>
- </xts:transform>
- </send:request>
- </xts:discard>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ================================================ -->
- <!-- Fault Handling -->
- <!-- ================================================ -->
- <!-- generic fault handler for my pages-->
- <xts:block id="generic-fb" type="fault" processor="XSLT" path="portal/faults/generic-fault.xslt"/>
- <xts:block id="cps_fault" processor="XSLT" type="fault">
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <cps:pageletMarkup xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/">
- <cps:markupString><br><br><center>CPS ERROR</center></cps:markupString>
- </cps:pageletMarkup>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="impersonateTenant" path="/portal/tenants/impersonateTenant.xsl" processor="XSLT" type="exec" mode="interpret" condition=".[/root/env/param[@name='impersonateTenantCmd']!='']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!-- Fault handler for cogx
- <xts:block id="cogx-fault" type="fault" path="portal/faults/cogx-fault.xslt" processor="XSLT"/>
- -->
- <!-- ================================================ -->
- <!-- Group Edit -->
- <!-- ================================================ -->
- <!--
- "editentries" in the request indicates a copy or a cut operation.
- Therefore, we must save cut or copied entries into a CM clipboard
- -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="groupEdit"
- path="portal/set_clipboard.xml"
- condition=".[/root/env/param[@name='editentries']]">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
- <!-- Debug
- -->
- <xts:block type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html"
- id="debug"
- condition=".[ /root/env/param[@name='d'] = '1' or /root/session/param[@name='debug'] = '1']"
- dependency="ccResponse">
- <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>
- </xts:morphlet>
|