123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: CCS
- (c) Copyright IBM Corp. 2005, 2011
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true">
- <!--
- ===============================================================================================
- getExistingPrompt - if an existing promptID was passed in, go get the prompt information from CM
- ===============================================================================================
- -->
- <xts:block id="getExistingPrompt" processor="XSLT" type="exec" dependency="getExistingPromptTDS" condition=".[/root/env/param[@name = 'promptID'] and /root/env/param[@name = 'promptID']!='' and not(/root/env/param[@name='method'])]" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <!-- get any existing promptID from the URL -->
- <xsl:variable name="promptID">
- <xsl:value-of select="key('env-param','promptID')"/>
- </xsl:variable>
-
- <xts:sequence>
- <xsl:if test="count(/root/promptData/*) = 0">
- <!-- promptData element with no children (probably because the prompt answers entry was "evicted" from the TDS/PDC caches),
- get the prompt information from CM using the provide promptID -->
- <xts:append select="/root/promptData">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:text>storeID("</xsl:text>
- <xsl:value-of select="$promptID"/>
- <xsl:text>")</xsl:text>
- </search>
- <properties>
- <property name="state"/>
- </properties>
- </query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="getExistingPromptTDS" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'promptID'] and /root/env/param[@name = 'promptID']!='' and not(/root/env/param[@name='method'])]" 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:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:sessionpassport/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <!-- get any existing promptID from the URL -->
- <xsl:variable name="promptID">
- <xsl:value-of select="key('env-param','promptID')"/>
- </xsl:variable>
- <!-- Get the prompt information from TDS using the provide promptID -->
- <xts:sequence>
- <xts:append>
- <promptData>
- <xts:function name="TDSRequest">
- <xts:param name="action">get</xts:param>
- <xts:param name="session-id">
- <xsl:value-of select="$passport"/>
- </xts:param>
- <xts:param name="map-id">
- <xsl:value-of select="'cmsPromptAnswers'"/>
- </xts:param>
- <xts:param name="name">
- <xsl:value-of select="$promptID"/>
- </xts:param>
- </xts:function>
- </promptData>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- execute-method - begin the process to collect the prompt information from the user
- ===============================================================================================
- -->
- <xts:block id="execute-method" processor="XSLT" type="exec" dependency="getExistingPrompt" condition=".[not(/root/env/param[@name='method']='cancel')]" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <!-- get the report object from the URL -->
- <xsl:variable name="reportObject">
- <xsl:value-of select="key('env-param','ui.object')"/>
- </xsl:variable>
- <xsl:variable name="promptID">
- <xsl:value-of select="key('env-param','promptID')"/>
- </xsl:variable>
- <!-- collect the prompt information from the report server -->
- <xts:sequence>
- <xts:append>
- <promptRequest>
- <send:request provider="xts" option="xml-multipart">
- <xsl:choose>
- <xsl:when test=" not(/root/env/param[@name='method'])">
- <prompt:collect>
- <returnMorphlet>portal/get_prompt.xts</returnMorphlet>
- <ps_nav_op>maintain</ps_nav_op>
- <runAsync>true</runAsync>
- <forcePrompting>true</forcePrompting>
- <showNoPromptsWarning>false</showNoPromptsWarning>
- <promptObject>
- <xsl:value-of select="$reportObject"/>
- </promptObject>
- <!-- check if prompt values are available from the cache -->
- <xsl:variable name="promptData" select="/root/promptData/*[local-name()='parameterValues'] | /root/promptData/*[local-name()='queryResponse']/*[local-name()='runTimeState']/*[local-name()='state']/*[local-name()='parameterValues']"/>
- <xsl:if test="count($promptData) > 0">
- <parameterValues>
- <xsl:copy-of select="$promptData"/>
- </parameterValues>
- </xsl:if>
- </prompt:collect>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{key('env-param', 'method')}" namespace="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
- <returnMorphlet>ccs/ccs_prompt.xts</returnMorphlet>
- <ps_nav_op>maintain</ps_nav_op>
- <callFinish>true</callFinish>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </send:request>
- </promptRequest>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- check-state -
- ===============================================================================================
- -->
- <xts:block id="check-state" path="/portal/iPrompting/logicsheets/check-state.xslt" processor="XSLT" type="exec" dependency="execute-method" condition=".[not(/root/env/param[@name='method']='cancel')]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- </xts:block>
- <!--
- ===============================================================================================
- updateID - updates the passed-in prompt ID with the saved parameter values
- ===============================================================================================
- -->
- <xts:block id="updateID" processor="XSLT" type="exec" dependency="check-state execute-method" mandatory="false" condition=".[/root/view='properties' or /root/promptRequest/*[local-name()='collectResponse']/*[local-name()='status']='conversationComplete']">
- <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:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="cms xts send cm pf form xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xsl:variable name="storeID">
- <xsl:value-of select="key('env-param','promptID')"/>
- </xsl:variable>
- <xts:sequence>
- <!-- Update CM RuntimeState, its output will be returned -->
- <!-- get the prompt information from CM using the provide promptID -->
- <xts:append>
- <updateIDResponse>
- <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:update>
- <cm:objects>
- <cm:runTimeState>
- <cm:searchPath>
- <xsl:value-of select="concat('storeID("', $storeID, '")')"/>
- </cm:searchPath>
- <cm:state>
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="XMLEncode">
- <xts:transform src="transforms/portal/parameters/pre-WARP-process.xslt" processor="XSLT">
- <xsl:element name="parameters" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="/root/*[local-name()='promptRequest']/*/*[local-name()='parameters']/*"/>
- </xsl:element>
- </xts:transform>
- </xts:transform>
- </cm:state>
- </cm:runTimeState>
- </cm:objects>
- </cm:update>
- </xts:transform>
- </send:request>
- </xts:transform>
- </updateIDResponse>
- </xts:append>
- </xts:sequence>
- <!-- Update TDS, its output (if any) will be ignored -->
- <xts:sequence>
- <xts:append>
- <TDSRequest_updatedID>
- <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="'cmsPromptAnswers'"/>
- </xts:param>
- <xts:param name="name">
- <xsl:value-of select="$storeID"/>
- </xts:param>
- <xts:param name="source">
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="XMLEncode">
- <xts:transform src="transforms/portal/parameters/pre-WARP-process.xslt" processor="XSLT">
- <xsl:element name="parameters" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:copy-of select="/root/*[local-name()='promptRequest']/*/*[local-name()='parameters']/*"/>
- </xsl:element>
- </xts:transform>
- </xts:transform>
- </xts:param>
- </xts:function>
- </TDSRequest_updatedID>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- renderPage - render the page
- ===============================================================================================
- -->
- <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="check-state updateID" condition=".[/root/view='properties' or /root/promptRequest/*[local-name()='collectResponse']/*[local-name()='status']='conversationComplete' or (/root/env/param[@name='method'] and /root/env/param[@name='method']='cancel')]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" 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:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:thm="http://developer.cognos.com/schemas/xts/logicsheets/xslt/theme/" exclude-result-prefixes="xsl cf cp df dp dc lyt cm cml thm utml xtsext ut">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'get_prompt.xts'"/>
- <xsl:variable name="has_write_permission" select="contains(concat(' ', /root/cm:queryResponse/*[position()=1]/cm:permissions, ' '), ' write ')"/>
- <xsl:variable name="has_execute_permission" select="contains(concat(' ', /root/cm:queryResponse/*[position()=1]/cm:permissions, ' '), ' execute ')"/>
- <xsl:variable name="has_policy_permission" select="contains(concat(' ', /root/cm:queryResponse/*[position()=1]//cm:permissions, ' '), ' setPolicy ')"/>
- <pf:variables/>
- <xsl:variable name="the-object" select="/root/cm:queryResponse/*[position()=1]"/>
- <xsl:variable name="showOKCancel" select="$has_write_permission or $has_policy_permission"/>
- <!-- start the output -->
- <xsl:template match="/root">
- <dp:page>
- <dp:meta>
- <pf:meta/>
- <!-- Standard meta tags -->
- </dp:meta>
- <!-- storeID will be blank if the report did not contain prompts or the provided promptID was invalid -->
- <xsl:variable name="storeID">
- <xsl:value-of select="/root/promptIDResponse/*[local-name()='addResponse']/*[local-name()='runTimeState']/*[local-name()='storeID']"/>
- </xsl:variable>
- <!-- return the promptID to the calling page -->
- <script language="javascript">
- var success = 1;
- <xsl:if test="/root/env/param[@name='method']='cancel'">
- success = 0;
- </xsl:if>
- try
- {
- window.external.FinishCollectPrompts(success);
- }
- catch(e1)
- {
- try
- {
- parent.FinishCollectPrompts(success);
- }
- catch(e2)
- {
- try
- {
- window.opener.FinishCollectPrompts(success)
- }
- catch (e3)
- {
- window.close();
- }
- }
- }
- </script>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <!-- get the debug logic sheet -->
- <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"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|