123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
- <xts:block id="createSystemElement" type="exec" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="bus xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xts:request protocol="FILEREAD" cache="true" faultBlock="requestFault" target="./portal/system.xml"/>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Handle errors which occur when reading the system XML file. Provide default values. -->
- <xts:block id="requestFault" type="fault" processor="XML" nodelist="">
- <system>
- <param name="delimiters" d1="|" d2=":"/>
- <param name="COGNOSHome">b_action=xts.run&m=portal/main.xts</param>
- </system>
- </xts:block>
-
- <!-- Build the missing session element from the cc_session and CRN cookies, and the missing http element from the bus header. This is done so that common variables will work. -->
- <xts:block id="createMissingElements" dependency="createSystemElement" type="exec" processor="XSLT">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="bus xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xsl:variable name="CRNValue">
- <xsl:choose>
- <xsl:when test="string(/root/cookies/cookie[@name='CRN']) != ''">
- <xsl:value-of select="string(/root/cookies/cookie[@name='CRN'])"/>
- </xsl:when>
- <xsl:otherwise> <!-- No CRN cookie found. Use the setCookieVars value if it exists. -->
- <xsl:value-of select="string(/root/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='setCookieVars']/item[name = 'CRN']/value)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <session>
- <xsl:if test="(string(/root/cookies/cookie[@name='cc_session']) != '') or ($CRNValue != '')">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:decodeCCSession(string(/root/cookies/cookie[@name='cc_session']),/root/system/param[@name='delimiters']/@d1,/root/system/param[@name='delimiters']/@d2)"/>
- <xsl:value-of select="xtsext:decodeCRNCookie($CRNValue)"/>
- </xts:transform>
- </xsl:if>
- <!-- construct the session user capability cache -->
- <xsl:if test="/root/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']">
- <param name="capabilities" type="CRN">
- <xsl:for-each select="/root/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']/*[local-name()='item']">
- <xsl:variable name="capability" select="."/>
- <xsl:if test="string($capability) != ''">
- <xsl:element name="{$capability}"/>
- </xsl:if>
- </xsl:for-each>
- </param>
- </xsl:if>
- </session>
- <http>
- <xsl:for-each select="/root/*[local-name()='biBusHeader']/*[local-name()='hdrSession']/*[local-name()='environmentVars']/item">
- <param>
- <xsl:attribute name="name">
- <xsl:value-of select="name/."/>
- </xsl:attribute>
- <xsl:value-of select="value/."/>
- </param>
- </xsl:for-each>
- </http>
- <header>
- <xsl:copy-of select="/root/*[local-name()='biBusHeader']"/>
- </header>
- </xts:append>
- <xts:delete select="/root/*[local-name()='biBusHeader']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block xmlns:xts="http://developer.cognos.com/schemas/xts/" id="getContent" processor="XSLT" type="exec" dependency="createMissingElements" condition=".[count(/root/input[@name='dep']/queryResponse/*[local-name()='manualTask']/*[local-name()='linksList']/*[local-name()='link']) > 0]" mandatory="false">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0"
- exclude-result-prefixes="xsl pf xtsext cml send cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <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 xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:for-each select="/root/input[@name='dep']/queryResponse/*[local-name()='manualTask']/*[local-name()='linksList']/*[local-name()='link']">
- <xsl:variable name="storeId">
- <xsl:text>storeID('</xsl:text>
- <xsl:value-of select="./*[local-name()='id']"/>
- <xsl:text>')</xsl:text>
- </xsl:variable>
- <cm:query>
- <cm:search><xsl:value-of select="$storeId"/></cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="uri"/>
- <cm:property name="iconURI"/>
- <cm:property name="objectClass"/>
- <cm:property name="base"/>
- <cm:property name="searchPath"/>
- <cm:property name="defaultOutputFormat"/>
- <cm:property name="mostRecentEventList"/>
- <cm:property name="storeID"/>
- </cm:properties>
- <cm:options schemaInfo="true">
- <cm:refProps>
- <!-- Get base info for reportView/agentDefinitionView objects -->
- <cm:refProp refPropName="base">
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="permissions"/>
- <cm:property name="defaultPortalAction"/>
- <cm:property name="defaultOutputFormat"/>
- <cm:property name="mostRecentEventList"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!-- replace the most recent event list search path with its store id. The universal viewer only accepts store ids-->
- <xts:block xmlns:xts="http://developer.cognos.com/schemas/xts/" id="agentDefinitionViewQuery" processor="XSLT" type="exec" dependency="getContent" condition=".[count(/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinitionView']/*[local-name()='mostRecentEventList'][not(./@nil)]) > 0]" mandatory="false">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- version="1.0"
- exclude-result-prefixes="xsl pf xtsext cml send cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <agentDefinitionViewQuery>
- <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>
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinitionView']/*[local-name()='mostRecentEventList'][not(./@nil)]">
- <cm:query>
- <cm:search><xsl:value-of select="."/></cm:search>
- <cm:properties>
- <cm:property name="storeID"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <!-- store the keys so that we can map back to the correct agentDefinitionView element -->
- <keys>
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinitionView']/*[local-name()='mostRecentEventList'][not(./@nil)]/../*[local-name()='storeID']">
- <storeID><xsl:value-of select="."/></storeID>
- </xsl:for-each>
- </keys>
- </agentDefinitionViewQuery>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- replace the most recent event list search path with its store id. The universal viewer only accepts store ids-->
- <xts:block xmlns:xts="http://developer.cognos.com/schemas/xts/" id="eventListQuery" processor="XSLT" type="exec" dependency="agentDefinitionViewQuery" condition=".[count(/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='mostRecentEventList'][not(./@nil)]) > 0]" mandatory="false">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0"
- exclude-result-prefixes="xsl pf xtsext cml send cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <eventListQuery>
- <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>
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='mostRecentEventList'][not(./@nil)]">
- <cm:query>
- <cm:search><xsl:value-of select="."/></cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- <cm:property name="storeID"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <!-- store the keys so that we can map back to the correct agentDefinition -->
- <keys>
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='mostRecentEventList'][not(./@nil)]/../*[local-name()='storeID']">
- <storeID><xsl:value-of select="."/></storeID>
- </xsl:for-each>
- </keys>
- </eventListQuery>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- replace the most recent event list search path with its store id. The universal viewer only accepts store ids-->
- <xts:block xmlns:xts="http://developer.cognos.com/schemas/xts/" id="updateEventLists" processor="XSLT" type="exec" dependency="eventListQuery" condition=".[count(/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='mostRecentEventList'][not(./@nil)]) > 0]" mandatory="false">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" version="1.0"
- exclude-result-prefixes="xsl pf xtsext cml send cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- update agents by replacing the event list searchpath with the storeid-->
- <xsl:for-each select="/root/*[local-name()='eventListQuery']/*[local-name()='keys']/*[local-name()='storeID']">
- <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="agentStoreId">
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:variable name="eventListStoreId">
- <xsl:value-of select="/root/*[local-name()='eventListQuery']/*[local-name()='queryResponse']/*[local-name()='queryReply'][$pos=position()]/*[local-name()='output']/*[local-name()='storeID']"/>
- </xsl:variable>
- <xts:replace select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='mostRecentEventList'][../*[local-name()='storeID']='{$agentStoreId}']">
- <mostRecentEventList><xsl:value-of select="$eventListStoreId"/></mostRecentEventList>
- </xts:replace>
- </xsl:for-each>
-
- <!-- update agent views by replacing the event list searchpath with the storeid-->
- <xsl:for-each select="/root/*[local-name()='agentDefinitionViewQuery']/*[local-name()='keys']/*[local-name()='storeID']">
- <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="agentStoreId">
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:variable name="eventListStoreId">
- <xsl:value-of select="/root/*[local-name()='agentDefinitionViewQuery']/*[local-name()='queryResponse']/*[local-name()='queryReply'][$pos=position()]/*[local-name()='output']/*[local-name()='storeID']"/>
- </xsl:variable>
- <xts:replace select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinitionView']/*[local-name()='mostRecentEventList'][../*[local-name()='storeID']='{$agentStoreId}']">
- <mostRecentEventList><xsl:value-of select="$eventListStoreId"/></mostRecentEventList>
- </xts:replace>
- </xsl:for-each>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- Generate the header in XML form -->
- <xts:block id="response" type="exec" mode="interpret" dependency="updateEventLists" processor="XSLT" condition=".[count(/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*) > 0]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:encodingUtils="com.cognos.portal.utils.EncodingUtils"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- exclude-result-prefixes="xsl xos pf xtsext encodingUtils cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <pf:gen-icon/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:delete select="/root/*[local-name()='eventListQuery']"/>
- <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; charset=UTF-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <response>
- <logic>
- <xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*">
- <xsl:variable name="storeId"><xsl:value-of select="./*[local-name()='storeID']"/></xsl:variable>
- <xsl:variable name="linkObjectClass">
- <xsl:value-of select="./*[local-name()='objectClass']"/>
- </xsl:variable>
- <outputInfo>
- <xsl:attribute name="id">
- <xsl:choose>
- <xsl:when test="./*[local-name()='mostRecentEventList']!=''"><xsl:value-of select="./*[local-name()='mostRecentEventList']"/></xsl:when>
- <xsl:when test="./*[local-name()='mostRecentEventList']=''"></xsl:when>
- <xsl:otherwise><xsl:value-of select="$storeId"/></xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <name><xsl:value-of select="//*[local-name()='linksList']/*[local-name()='link']/*[local-name()='id'][.=$storeId]/../*[local-name()='display']"/></name>
- <format/>
- <locale/>
- <objectClass><xsl:value-of select="$linkObjectClass"/></objectClass>
- <xsl:variable name="tooltip" select="xtsext:javascriptencode(string(./*[local-name()='defaultName']))"/>
- <xsl:call-template name="gen-icon">
- <!-- for a watch rule notification, the object class is 'documentContent'. Tell gen-icon to create a report icon -->
- <xsl:with-param name="class">
- <xsl:choose>
- <xsl:when test="$linkObjectClass='documentContent'">report</xsl:when>
- <xsl:otherwise><xsl:value-of select="$linkObjectClass"/></xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="showAction" select="false()"/>
- <xsl:with-param name="tooltipOverride" select="$tooltip"/>
- </xsl:call-template>
- </outputInfo>
- </xsl:for-each>
- </logic>
- </response>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|