123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2013
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!-- $Header: //cpscrn/main/templates/cps4/portlets/sdk/portlet-impl/remote/remote.xts#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:block id="checkPassport" processor="XSLT" type="exec">
- <xts:logicsheet path="/cps4/common/logicsheets/soaplogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://developer.cognos.com/schemas/cps/logic/soap">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:discard>
- <soap:request provider="cm">
- <bus:query 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:xsd="http://www.w3.org/2001/XMLSchema">
- <search>~</search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[1]">
- <item xsi:type="bus:propEnum">storeID</item>
- </properties>
- <options xsi:type="bus:queryOptions">
- <schemaInfo xsi:type="xsd:boolean">false</schemaInfo>
- </options>
- </bus:query>
- </soap:request>
- </xts:discard>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="preload" dependency="checkPassport" mode="interpret" processor="XSLT" type="exec">
- <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <portlet:if-mode name="wsrp:edit|cps:config">
- <xts:sequence>
- <xts:append select="/root">
- <xts:request protocol="GET" target="{/root/configProps/param[@name='cps']/property[@name = 'gateway']}/portlet/applications" cache="false">
- <xts:param name="header">
- <xsl:text>Cookie=</xsl:text>
- <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
- <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
- <xsl:if test="position() != last()">
- <xsl:text>; </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xts:param>
- </xts:request>
- </xts:append>
- </xts:sequence>
- </portlet:if-mode>
- <portlet:if-mode name="wsrp:view|wsrp:preview">
- <xts:sequence>
- <portlet:property name="apppath" select="'app.path'"/>
- <xts:append select="/root">
- <xts:request protocol="GET" target="{/root/configProps/param[@name='cps']/property[@name = 'gateway']}/portlet/applications/{$apppath}" cache="false">
- <xts:param name="header">
- <xsl:text>Cookie=</xsl:text>
- <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
- <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
- <xsl:if test="position() != last()">
- <xsl:text>; </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xts:param>
- </xts:request>
- </xts:append>
- </xts:sequence>
- </portlet:if-mode>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block dependency="preload" id="request" mode="interpret" processor="XSLT" type="exec">
- <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
- <xts:logicsheet path="/cps4/producer/logicsheets/cps-ui.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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 select="/root">
- <temp-response/>
- </xts:append>
-
-
-
-
-
- <xts:append select="/root/temp-response">
- <portlet:portlet handle="sdk">
- <portlet:if-mode name="wsrp:view|wsrp:preview">
- <portlet:response>
- <portlet:content>
- <portlet:markup-context useCachedMarkup="'false'" mimeType="'text/html'" requiresUrlRewriting="'true'">
- <portlet:if-window-state name="wsrp:minimized">
- <portlet:markup-string/>
- </portlet:if-window-state>
- <portlet:if-window-state name="wsrp:normal|wsrp:maximized|wsrp:solo">
- <portlet:property name="appurl" select="'app.url'"/>
- <portlet:property name="features" select="'app.features'"/>
- <portlet:property name="appmessagefile" select="'app.messagefile'"/>
-
- <xsl:variable name="is-legacy" select="contains($features, 'legacy')"/>
- <xsl:variable name="url">
- <xsl:choose>
- <xsl:when test="contains($appurl, '$WEB$')">
- <xsl:variable name="beforeToken" select="substring-before($appurl, '$WEB$')"/>
- <xsl:variable name="afterToken" select="substring-after($appurl, '$WEB$')"/>
- <xsl:value-of select="concat(concat($beforeToken, $ui-webcontent), $afterToken)"/>
- </xsl:when>
- <xsl:when test="contains($appurl, '$CGI$')">
- <xsl:variable name="beforeToken" select="substring-before($appurl, '$CGI$')"/>
- <xsl:variable name="afterToken" select="substring-after($appurl, '$CGI$')"/>
- <xsl:value-of select="concat(concat($beforeToken, $ui-gateway), $afterToken)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$appurl"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
-
- <xsl:variable name="url-markers">
- <xsl:choose>
- <xsl:when test="contains($url, '[$') and contains($url, '$]')">
- <xsl:variable name="token" select="substring-before(substring-after($url, '[$'), '$]')"/>
- <xsl:variable name="beforeToken" select="substring-before($url, '[$')"/>
- <xsl:variable name="afterToken" select="substring-after($url, '$]')"/>
- <xsl:variable name="atest" select="concat('sdk_', $token)"/>
- <portlet:property name="token-value" select="$atest"/>
- <xsl:value-of select="concat(concat($beforeToken, $token-value), $afterToken)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$url"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <portlet:property name="cognos-product" select="'sdk'"/>
- <xsl:variable name="remote-url">
- <xsl:if test="$url-markers != '' and not(starts-with($url-markers, 'http://') or starts-with($url-markers, 'https://'))">
- <xsl:call-template name="get-host">
- <xsl:with-param name="url" select="$cognos-product"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:value-of select="$url-markers"/>
- </xsl:variable>
- <xsl:variable name="consumer-escape" select="$portlet-registration-params[@name = 'consumerEscape']"/>
-
-
- <xsl:if test="$remote-url and not($remote-url = '')">
-
- <xsl:choose>
- <xsl:when test="$is-legacy">
-
- <xsl:variable name="cps_jsessionid" select="$portlet-navigational-params[@name = 'cps_jsessionid']"/>
- <xsl:variable name="jsessionid">
- <xsl:if test="$cps_jsessionid">
- <xsl:text>;jsessionid=</xsl:text>
- <xsl:value-of select="$cps_jsessionid"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="full-url">
- <xsl:choose>
- <xsl:when test="contains($remote-url, '?')">
- <xsl:value-of select="substring-before($remote-url, '?')"/>
- <xsl:value-of select="$jsessionid"/>
- <xsl:text>?</xsl:text>
- <xsl:value-of select="substring-after($remote-url, '?')"/>
- <xsl:text>&</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$remote-url"/>
- <xsl:value-of select="$jsessionid"/>
- <xsl:text>?</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:for-each select="$portlet-navigational-params[not(starts-with(@name, 'edit_') or starts-with(@name, 'p_') or starts-with(@name, 'tmp_') or starts-with(@name, 'stack_'))]">
- <xsl:value-of select="@name"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:urlencode(string(.))"/>
- <xsl:text>&</xsl:text>
- </xsl:for-each>
- <xsl:for-each select="$portlet-state-params[starts-with( @name, 'sdk_' )]">
- <xsl:variable name="param-name" select="substring-after( @name, 'sdk_' )"/>
- <!--
- navigationalState overrides portletState sdk variables
- -->
- <xsl:if test="not($portlet-navigational-params[string(@name) = string($param-name)])">
- <xsl:value-of select="$param-name"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:urlencode(string(.))"/>
- <xsl:text>&</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>cognos_product=</xsl:text>
- <xsl:value-of select="$cognos-product"/>
- <xsl:text>&namespacePrefix=</xsl:text>
- <xsl:value-of select="$portlet-op/wsrp:runtimeContext/wsrp:namespacePrefix"/>
- <xsl:if test="$consumer-escape != ''">
- <xsl:text>&consumerEscape=</xsl:text>
- <xsl:value-of select="$consumer-escape"/>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="$full-url != ''">
- <portlet:markup-string>
- <xts:request protocol="POST" target="{ $full-url }" faultBlock="requestFault" protocolHeader="true" protocolHeaderSelect="/root/temp-response">
- <xts:param name="internalRequest">true</xts:param>
- <xsl:if test="$portlet-markups/wsrp:locales">
- <xts:param name="header">
- <xsl:text>Accept-Language=</xsl:text>
- <xsl:value-of select="$portlet-markups/wsrp:locales[1]"/>
- </xts:param>
- </xsl:if>
- <xts:param name="header">
- <xsl:text>Cookie=</xsl:text>
- <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
- <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
- <xsl:if test="position() != last()">
- <xsl:text>; </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xts:param>
- </xts:request>
- <xsl:if test="$portlet-mode = 'wsrp:preview'">
- <portlet:markup-preview/>
- </xsl:if>
- </portlet:markup-string>
- </xsl:if>
-
-
- </xsl:when>
- <xsl:otherwise>
- <portlet:markup-string>
- <xsl:call-template name="retrieve-portable-markup">
- <xsl:with-param name="remote-url" select="$remote-url"/>
- <xsl:with-param name="features" select="$features"/>
- <xsl:with-param name="messagefile" select="$appmessagefile"/>
- </xsl:call-template>
- </portlet:markup-string>
- </xsl:otherwise>
- </xsl:choose>
-
-
-
- </xsl:if>
- <xsl:if test="string($remote-url) = ''">
- <portlet:markup-transform name="XSLT" src="'/cps4/producer/wsrp-impl/transforms/display-nocontent.xslt'">
- <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
- <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
- <portlet:source/>
- </portlet:markup-transform>
- </xsl:if>
- </portlet:if-window-state>
- </portlet:markup-context>
- </portlet:content>
- </portlet:response>
- </portlet:if-mode>
- <portlet:if-mode name="wsrp:edit|cps:config">
- <portlet:response>
- <portlet:content>
- <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'true'">
- <xsl:variable name="is-about" select="contains( $portlet-navigational-params[@name = 'edit_mode'], 'about' )"/>
- <xsl:choose>
- <xsl:when test="$is-about">
- <portlet:markup-transform name="XSLT" src="/cps4/producer/wsrp-impl/transforms/display-about.xslt">
- <portlet:logicsheet>/cps4/producer/logicsheets/cps-ui.xslt</portlet:logicsheet>
- <portlet:logicsheet>/cps4/producer/logicsheets/cps-formlogic.xslt</portlet:logicsheet>
- <portlet:messageBase>/cps4/producer/messages/cpsproducermsgs.xml</portlet:messageBase>
- <portlet:messageBase>/cps4/portlets/sdk/messages/cpssdkmsgs.xml</portlet:messageBase>
- <portlet:source>
- <portlet:get-version/>
- <xsl:variable name="nav-titles" select="$portlet-navigational-params[starts-with( @name, 'p_title_' ) and .!='']"/>
- <xsl:variable name="state-titles" select="$portlet-state-params[starts-with( @name, 'title_' ) and .!='']"/>
- <portlet:title-locale selectState1="$nav-titles" selectState2="$state-titles"/>
- </portlet:source>
- </portlet:markup-transform>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="messagefile-list">
- <xsl:for-each select="/root/applications/application">
-
- <xsl:if test="messagefile !=''">
- <xsl:if test="position() != 1">
- <xsl:text>,</xsl:text>
- </xsl:if>
- <xsl:value-of select="messagefile"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <portlet:markup-string>
- <xsl:call-template name="retrieve-portable-markup">
- <xsl:with-param name="remote-url" select="concat($ui-webcontent, '/cps4/portlets/appeditor/appeditor.html')"/>
- <xsl:with-param name="messagefile" select="$messagefile-list"/>
- </xsl:call-template>
- </portlet:markup-string>
- </xsl:otherwise>
- </xsl:choose>
-
-
- </portlet:markup-context>
- </portlet:content>
- </portlet:response>
- </portlet:if-mode>
- <portlet:if-mode name="wsrp:help">
- <portlet:response>
- <portlet:content>
- <portlet:markup-context mimeType="'text/html'" requiresUrlRewriting="'false'">
- <portlet:markup-help/>
- </portlet:markup-context>
- </portlet:content>
- </portlet:response>
- </portlet:if-mode>
- </portlet:portlet>
- </xts:append>
- </xts:sequence>
- </xsl:template>
-
- <xsl:template name="retrieve-portable-markup">
- <xsl:param name="remote-url"/>
- <xsl:param name="scope" select="'CognosConnect'"/>
- <xsl:param name="features" select="''"/>
- <xsl:param name="messagefile"/>
-
- <xsl:param name="rewrite-functions" select="'false'"/>
-
- <xsl:variable name="userprefquery">
-
- <xsl:for-each select="$portlet-user-preferences/item">
- <xsl:value-of select="xtsext:urlencode(string(name))"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:urlencode(string(value))"/>
- <xsl:if test="position() != last()">
- <xsl:text>&</xsl:text>
- </xsl:if>
- </xsl:for-each>
-
- </xsl:variable>
-
- <xsl:variable name="portletsettingsquery">
-
- <xsl:for-each select="$portlet-state-params">
- <xsl:value-of select="xtsext:urlencode(string(@name))"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:urlencode(string(.))"/>
- <xsl:if test="position() != last()">
- <xsl:text>&</xsl:text>
- </xsl:if>
- </xsl:for-each>
-
- </xsl:variable>
-
- <xsl:variable name="portalagent">
- <xsl:value-of select="$portlet-op/wsrp:markupParams/wsrp:extensions/*[local-name()='portalContext']/*[local-name()='portalAgent']"/>
- </xsl:variable>
-
- <xsl:variable name="cssmappingquery">
- <xsl:for-each select="/root/applications/application/cssmapping/portalagent[@name = $portalagent]/css">
- <xsl:value-of select="@name"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="@mapsto"/>
- <xsl:if test="position() != last()">
- <xsl:text>&</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="eventspublished">
- <xsl:for-each select="/root/applications/application/communication/publishes/event">
- <xsl:text>"</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(string(@name))"/>
- <xsl:text>"</xsl:text>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="eventslistenedfor">
- <xsl:for-each select="/root/applications/application/communication/listensfor/event">
- <xsl:text>"</xsl:text>
- <xsl:value-of select="xtsext:javascriptencode(string(@name))"/>
- <xsl:text>"</xsl:text>
- <xsl:if test="position() != last()">
- <xsl:text>,</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="campassportcookie">
- <xsl:for-each select="/root/cookies/cookie[@name='cam_passport']">
- <xsl:value-of select="xtsext:javascriptencode(string(.))"/>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="navstatequery">
- <xsl:for-each select="$portlet-op/wsrp:markupParams/wsrp:navigationalState/param">
-
- <xsl:value-of select="xtsext:urlencode(string(@name))"/>
- <xsl:text>=</xsl:text>
- <xsl:value-of select="xtsext:urlencode(string(.))"/>
-
- <xsl:if test="position() != last()">
- <xsl:text>&</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xts:transform name="CPSWEB"
- scope="{$scope}"
- namespacePrefix="{$portlet-op/wsrp:runtimeContext/wsrp:namespacePrefix}"
- webcontent="{$ui-webcontent}"
- gateway="{$ui-gateway}"
- remoteUrl = "{$remote-url}"
- userPreferencesQuery = "{$userprefquery}"
- applicationSettingsQuery = "{$portletsettingsquery}"
- navigationStateQuery = "{$navstatequery}"
- cssMappingQuery = "{$cssmappingquery}"
- events = "{'{'}listen:[{$eventslistenedfor}],publish:[{$eventspublished}]{'}'}"
- camPassport = "{$campassportcookie}"
- features = "{$features}"
- messagefile = "{$messagefile}"
- portalAgent = "{$portalagent}"
- rewriteFunctions="{$rewrite-functions}">
- <xsl:choose>
- <xsl:when test="contains($features, 'server')">
- <!-- Build the URL here-->
- <xsl:variable name="remote-url-query">
- <xsl:choose>
- <xsl:when test="contains($remote-url, '?')">
- <xsl:value-of select="concat($remote-url,'&', $userprefquery,'&', $portletsettingsquery,'&', $navstatequery)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($remote-url,'?',$userprefquery,'&', $portletsettingsquery,'&', $navstatequery)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:request protocol="POST" target="{ $remote-url-query }" faultBlock="requestFault">
- <xsl:call-template name="insert-headers"/>
- <xts:param name="header">
- <xsl:text>CPS-Gateway=</xsl:text>
- <xsl:value-of select="$ui-gateway"/>
- </xts:param>
- <xts:param name="header">
- <xsl:text>CPS-Webcontent=</xsl:text>
- <xsl:value-of select="$ui-webcontent"/>
- </xts:param>
- </xts:request>
- </xsl:when>
- <xsl:otherwise>
- <xts:request protocol="GET" target="{ $remote-url }" faultBlock="requestFault">
- <xsl:call-template name="insert-headers"/>
- </xts:request>
- </xsl:otherwise>
- </xsl:choose>
- </xts:transform>
- </xsl:template>
-
- <xsl:template name="insert-headers">
- <xts:param name="internalRequest">true</xts:param>
- <xsl:if test="$portlet-markups/wsrp:locales">
- <xts:param name="header">
- <xsl:text>Accept-Language=</xsl:text>
- <xsl:value-of select="$portlet-markups/wsrp:locales[1]"/>
- </xts:param>
- </xsl:if>
- <xts:param name="header">
- <xsl:text>Cookie=</xsl:text>
- <xsl:for-each select="/root/cookies/cookie[not(@name='JSESSIONID')]">
- <xsl:value-of select="@name"/>=<xsl:value-of select="."/>
- <xsl:if test="position() != last()">
- <xsl:text>; </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xts:param>
- </xsl:template>
-
-
-
- <xsl:template name="get-content">
- <xsl:param name="apps"/>
- <xts:transform name="XSLT" src="/cps4/portlets/sdk/portlet-impl/transforms/app2cps.xslt">
- <root>
- <summaryOnly>true</summaryOnly>
- <xsl:call-template name="get-request">
- <xsl:with-param name="apps" select="$apps"/>
- </xsl:call-template>
- </root>
- </xts:transform>
- </xsl:template>
- <xsl:template name="get-request">
- <xsl:param name="apps"/>
- <xsl:choose>
- <xsl:when test="starts-with($apps,'http://') or starts-with($apps,'https://')">
- <xts:request protocol="GET" target="{ $apps }" faultBlock="applicationsFileFault">
- <xts:param name="internalRequest">true</xts:param>
- </xts:request>
- </xsl:when>
- <xsl:otherwise>
- <xts:request protocol="FILEREAD" target="{$apps}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-app">
- <xsl:param name="apps"/>
- <xsl:param name="alias"/>
- <xts:transform name="XSLT" src="/cps4/portlets/sdk/portlet-impl/transforms/app2cps.xslt">
- <root>
- <applicationName>
- <xsl:value-of select="string( $alias)"/>
- </applicationName>
- <xsl:call-template name="get-request">
- <xsl:with-param name="apps" select="$apps"/>
- </xsl:call-template>
- </root>
- </xts:transform>
- </xsl:template>
- <xsl:template name="get-host">
- <xsl:param name="url"/>
- <xsl:choose>
- <xsl:when test="$url != ''">
- <xsl:variable name="protocol" select="substring-before($url, '://')"/>
- <xsl:variable name="host" select="substring-before(substring-after($url, '://'), '/')"/>
- <xsl:value-of select="concat($protocol, '://')"/>
- <xsl:value-of select="$host"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'http://'"/>
- <xsl:value-of select="/root/serverInfo/param[@name = 'HTTP_HOST']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block dependency="request" id="response" mode="interpret" processor="XSLT" type="exec">
- <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" 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="/">
- <xsl:variable name="originalPassportID">
- <xsl:choose>
- <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:when>
- <xsl:when test="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/id">
- <xsl:value-of select="/root/header/*[local-name() = 'biBusHeader']/*[local-name()= 'CAM']/CAMPassport/id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="xtsext:camcookie_action('getPassportID', string(/root/cookies/cookie[@name='cam_passport']))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="newPassportID">
- <xsl:call-template name="getCamPassportCookie"/>
- </xsl:variable>
-
- <portlet:soap-response>
- <xsl:choose>
- <xsl:when test="$newPassportID != '' and $newPassportID != $originalPassportID">
- <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">
- <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types" wsrp:dummy="">wsrp:InvalidCookie</faultcode>
- <faultstring>The producer environment has timed out. The consumer needs to initialize the cookies again.</faultstring>
- <detail>
- <wsrp:InvalidCookie/>
- </detail>
- </SOAP-ENV:Fault>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/temp-response/*[local-name()='getMarkupResponse']"/>
- </xsl:otherwise>
- </xsl:choose>
- </portlet:soap-response>
- </xsl:template>
- <xsl:template name="getCamPassportCookie">
- <xsl:for-each select="/root/temp-response/xos:protocolHeader/xos:param[@name = 'Set-Cookie']">
- <xsl:variable name="cookieName" select="substring-before(., '=')"/>
- <xsl:if test="$cookieName = 'cam_passport'">
- <xsl:variable name="value" select="substring-after(., '=')"/>
- <xsl:choose>
- <xsl:when test="contains($value, ';')">
- <xsl:value-of select="substring-before($value, ';')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="requestFault" processor="XSLT" type="fault">
- <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/2/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
- <xsl:variable name="http-response" select="$xts-fault/xts:exceptionDetail/httpResponse"/>
- <fault>
- <xsl:choose>
- <xsl:when test="$http-response">
- <xsl:copy-of select="$xts-fault/xts:exceptionCode"/>
- <xsl:copy-of select="$xts-fault/xts:exceptionMsg"/>
- <xts:exceptionDetail>
- <httpResponse>
- <xsl:copy-of select="$http-response/code"/>
- <xsl:copy-of select="$http-response/message"/>
- </httpResponse>
- </xts:exceptionDetail>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/fault/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </fault>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- This fault block is used to handle the error when we can't read the application.xml
- file The error is appended to the input and handled later in the listapps.xslt stylesheet.
- -->
- <xts:block id="applicationsFileFault" processor="XSLT" type="fault">
- <xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/2/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="xts-fault" select="/root/fault/xts:exception[last()]"/>
- <xsl:variable name="http-response" select="$xts-fault/xts:exceptionDetail/httpResponse"/>
- <application-file-error>
- <xsl:choose>
- <xsl:when test="$http-response">
- <xsl:copy-of select="$xts-fault/xts:exceptionCode"/>
- <xsl:copy-of select="$xts-fault/xts:exceptionMsg"/>
- <xts:exceptionDetail>
- <httpResponse>
- <xsl:copy-of select="$http-response/code"/>
- <xsl:copy-of select="$http-response/message"/>
- </httpResponse>
- </xts:exceptionDetail>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/fault/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </application-file-error>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
- <!-- This file was formated by XML Formatter (Cognos Inc.) on Aug 17, 2005 2:36:24 PM -->
|