123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2009
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <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:req-params="http://developer.cognos.com/schemas/request/params" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xtsext pf req-params xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <pf:serialize-xml/>
- <xsl:template match="/">
- <!-- the setSchedule page expects the scheduleParameters to live in /root/env/param which are then taken
- and copied into req:params:param prior to the morphlet call, see ags/navigator.xslt -->
- <!-- we can have multiple items returned in the response - have to handle them all -->
- <xts:sequence>
- <!-- remove the last version of the returned vars -->
- <xsl:for-each select="/root/*[local-name()='morphletResponse']/*">
- <xts:delete select="/root/env/param[@name='{local-name()}']"/>
- </xsl:for-each>
- <!-- copy the schedule summary out into the params -->
- <xsl:if test="/root/morphletResponse/scheduleParameters/param[@name='Summary_schedule']">
- <!-- update the summary schedule -->
- <xts:replace select="/root/agent_definition/schedule">
- <schedule>
- <xsl:value-of select="/root/morphletResponse/scheduleParameters/param[@name='Summary_schedule']"/>
- </schedule>
- </xts:replace>
- </xsl:if>
- <xsl:if test="/root/morphletResponse/param[@name='conditionSummary']">
- <!-- update the summary schedule -->
- <xts:replace select="/root/agent_definition/condition">
- <condition selectedTab="{/root/morphletResponse/param[@name='conditionSummary']/@selectedTab}">
- <xsl:value-of select="/root/morphletResponse/param[@name='conditionSummary']"/>
- </condition>
- </xts:replace>
- </xsl:if>
- <!-- create the encoded result -->
- <xts:append select="/root/env">
- <!-- this is a bit strange - taskName doesn't get wrapped up - but we're going to assume that everything else does -->
- <xsl:for-each select="/root/*[local-name()='morphletResponse']/*[local-name()!='taskName' and local-name()!='conditionSummary' and local-name() !='tabResult']">
- <!-- create the encoded response parameter -->
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="{local-name()}">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xsl:copy-of select="."/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xsl:for-each>
- <!-- if there's a task name - we just return it -->
- <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='tabResult']">
- <param name="tabResult">
- <xsl:value-of select="/root/*[local-name()='morphletResponse']/*[local-name()='tabResult']"/>
- </param>
- </xsl:if>
- <!-- if there's a task name - we just return it -->
- <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='taskName']">
- <param name="taskName">
- <xsl:value-of select="/root/*[local-name()='morphletResponse']/*[local-name()='taskName']"/>
- </param>
- </xsl:if>
- </xts:append>
- <!-- we're getting rid of the waste products here - we know the result object of the morphlet - so get rid of
- all but the result object -->
- <!-- clean everything else up - we have to create the select statement though
- This is mostly fixed - but we add the parameters from the response into the list of items to ignore -->
- <xsl:variable name="selectPath">
- <xsl:text>/root/env/param[not(starts-with(@name, 'agsSave')</xsl:text>
- <xsl:text> or starts-with(@name,'AgentTask')</xsl:text>
- <xsl:text> or starts-with(@name,'ps_nav')</xsl:text>
- <xsl:text> or @name='agent_definition_blob'</xsl:text>
- <xsl:text> or @name='cafcontextid'</xsl:text>
- <xsl:text> or @name='tabSelectedID'</xsl:text>
- <xsl:text> or @name='prevTabID'</xsl:text>
- <xsl:text> or @name='newTaskType'</xsl:text>
- <xsl:text> or @name='itemSelected'</xsl:text>
- <xsl:text> or @name='itemNewLocation'</xsl:text>
- <xsl:text> or @name='agentItemOp'</xsl:text>
- <xsl:text> or @name='m'</xsl:text>
- <xsl:text> or @name='packRoot'</xsl:text>
- <xsl:text> or @name='b_action'</xsl:text>
- <xsl:text> or @name='m_path'</xsl:text>
- <xsl:text> or @name='controller_state'</xsl:text>
- <xsl:text> or @name='has_prompts'</xsl:text>
- <xsl:for-each select="/root/*[local-name()='morphletResponse']/*">
- <xsl:text> or @name='</xsl:text>
- <xsl:value-of select="local-name()"/>
- <xsl:text>'</xsl:text>
- </xsl:for-each>
- <xsl:text>)]</xsl:text>
- </xsl:variable>
- <xts:delete select="{$selectPath}"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
|