123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2016
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml" requiredCapability="canUseEventStudio">
- <!--
- ===============================================================================================
- wait - issue the wait async request
- ===============================================================================================
- -->
- <xts:block id="wait" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name='promptResponse']) and /root/env/param[@name='conversation'] and /root/env/param[@name='doWait']='1']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/">
- <xsl:variable name="soapAction">
- <xsl:choose>
- <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
- <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201505/</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="requestNamespace">
- <xsl:choose>
- <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
- <xsl:value-of select="key('env-param', 'requestNamespace')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append select="/root">
- <response>
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart">
- <xsl:attribute name="soapAction">
- <xsl:value-of select="$soapAction"/>
- <xsl:text>.absolute</xsl:text>
- </xsl:attribute>
- <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
- <!-- copy the tracking information from previous request -->
- <bus:tracking>
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
- </bus:tracking>
- <xsl:copy-of select="/root/header/*[local-name()='biBusHeader']/*[local-name() != 'tracking']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="wait" namespace="{$requestNamespace}">
- <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
- </bus:conversation>
- <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- getOutput - Special case to handle complete.
- With complete, we just need to call getOutput to get the actual output, so do it here instead of bouncing through the browser .
- ===============================================================================================
- -->
- <xts:block id="getOutput" dependency="wait" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/env/param[@name='promptResponse']) and /root/env/param[@name='doWait']='1' and /root/response/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='status'] = 'responseReady']" mandatory="false" nodelist="header, env, response">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl xts xos cm bus SOAP-ENV xsi">
- <xsl:output method="xml"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/root">
- <xsl:variable name="requestNamespace">
- <xsl:choose>
- <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
- <xsl:value-of select="key('env-param', 'requestNamespace')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- default is report server request - but we can fire to other places too -->
- <xsl:variable name="soapAction">
- <xsl:choose>
- <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
- <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201404/</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
-
- <xts:sequence>
- <xts:replace select="/root/response">
- <response>
- <!-- replace the existing response -->
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" outputHeader="true" option="xml-multipart">
- <xsl:attribute name="soapAction">
- <xsl:value-of select="$soapAction"/>
- <xsl:text>.absolute</xsl:text>
- </xsl:attribute>
- <SOAP-ENV:Envelope>
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:copy-of select="/root/response/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='tracking']"/>
- <xsl:apply-templates select="header/bus:biBusHeader/*[local-name()!='tracking']"/>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:element name="getOutput" namespace="{$requestNamespace}">
- <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param', 'conversation'))), true())" disable-output-escaping="yes"/>
- </bus:conversation>
- <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
- <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
- </xsl:element>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:replace>
- </xts:sequence>
- </xsl:template>
- <!-- used to copy the bus header stuff - see "apply-templates" above. -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- get the package root for the object
- ===============================================================================================
- -->
- <xts:block id="getPackage" mode="interpret" type="exec" processor="XSLT" mandatory="false" condition=".[not(/root/env/param[@name='promptResponse']) and not(/root/env/param[@name = 'doWait']) and /root/env/param[@name='model'] and /root/env/param[@name='model']!='' ]" nodelist="header, env">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <routingServerGroup>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:submit">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:query>
- <cm:search>
- <xsl:value-of select="/root/env/param[@name='model']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="parent"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </routingServerGroup>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- determine the routing server group
- ===============================================================================================
- -->
- <xts:block id="routingServerGroup" mode="interpret" path="/ags/determineRouting.xslt" type="exec" processor="XSLT" dependency="getPackage" condition=".[/root/routingServerGroup//*[local-name()='parent']//*[local-name()='searchPath']]" mandatory="false" nodelist="header, env, routingServerGroup"/>
- <!--
- ===============================================================================================
- ge- issue the initial metadata runSpec request
- ===============================================================================================
- -->
- <xts:block id="getContent" mode="interpret" processor="XSLT" type="exec" dependency="routingServerGroup" condition=".[not (/root/routingServerGroup/authenticationFault) and not(/root/env/param[@name='promptResponse']) and not(/root/env/param[@name = 'doWait']) and not(/root/env/param[@name = 'doSkip'])]" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <!-- make some variables -->
- <xsl:variable name="method">
- <xsl:value-of select="key('env-param','method')"/>
- </xsl:variable>
- <xsl:variable name="inlineSpecType">
- <xsl:choose>
- <xsl:when test="key('env-param', 'inlineSpecType') and key('env-param', 'inlineSpecType') != '' ">
- <xsl:value-of select="key('env-param', 'inlineSpecType')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>reportServiceReportSpecification</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="inlineSpec">
- <xsl:choose>
- <xsl:when test="$inlineSpecType = 'queryFrameworkSpecification'">
- <xsl:value-of select="key('env-param','qfSpec')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','inlineSpec')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="obj">
- <xsl:value-of select="key('env-param','obj')"/>
- </xsl:variable>
- <xsl:variable name="affinity">
- <xsl:choose>
- <xsl:when test="$method='back'">high</xsl:when>
- <xsl:when test="$method='firstPage'">high</xsl:when>
- <xsl:when test="$method='forward'">high</xsl:when>
- <xsl:when test="$method='lastPage'">high</xsl:when>
- <xsl:when test="$method='nextPage'">high</xsl:when>
- <xsl:when test="$method='previousPage'">high</xsl:when>
- <xsl:when test="$method='render'">high</xsl:when>
- <xsl:when test="$method='cancel'">control</xsl:when>
- <xsl:when test="$method='getOutput'">absolute</xsl:when>
- <xsl:when test="$method='release'">absolute</xsl:when>
- <xsl:when test="$method='wait'">absolute</xsl:when>
- <xsl:when test="$method='runSpecification'">session</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- default is report server request - but we can fire to other places too -->
- <xsl:variable name="soapAction">
- <xsl:choose>
- <xsl:when test="key('env-param', 'soapAction') and key('env-param', 'soapAction') = 'AGENT_SERVICE_SOAPACTION' ">
- <xsl:text>http://www.ibm.com/xmlns/prod/cognos/agentService/201505/</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="requestNamespace">
- <xsl:choose>
- <xsl:when test="key('env-param', 'requestNamespace') and key('env-param', 'requestNamespace') != '' ">
- <xsl:value-of select="key('env-param', 'requestNamespace')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>http://developer.cognos.com/schemas/reportService/1</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="routingServerGroup">
- <xsl:choose>
- <xsl:when test="/root/routingServerGroup/*[local-name()='result'] != ''">
- <xsl:value-of select="/root/routingServerGroup/*[local-name()='result'][last()]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('env-param','routingServerGroup')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <affinity>
- <xsl:value-of select="$affinity"/>
- </affinity>
- </xts:append>
- </xts:sequence>
- <xts:sequence>
- <xts:append>
- <response>
- <xts:request href="bus://dispatcher" protocol="BUS" responseEnvelope="true" option="xml-multipart" outputHeader="true" >
- <xsl:attribute name="soapAction">
- <xsl:value-of select="$soapAction"/>
- <xsl:if test="$affinity!=''">
- <xsl:text>.</xsl:text>
- <xsl:value-of select="$affinity"/>
- </xsl:if>
- </xsl:attribute>
- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
- <!-- copy the tracking information from previous request -->
- <bus:tracking>
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
- </bus:tracking>
- <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:tracking']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:routing']"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$routingServerGroup != ''">
- <bus:routing>
- <routingServerGroup>
- <xsl:value-of select="$routingServerGroup"/>
- </routingServerGroup>
- </bus:routing>
- </xsl:if>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:choose>
- <!-- the run/runSpecification method -->
- <xsl:when test="$method = 'runSpecification' or $method = 'run' or $method = 'validateSpecification' or $method = 'validate' or $method = 'getParametersSpecification' or $method = 'getParameters' or $method='collectParameterValuesSpecification' or $method='collectParameterValues' ">
- <xsl:element name="{$method}" namespace="{$requestNamespace}">
- <xsl:choose>
- <xsl:when test="$method = 'runSpecification' or $method='validateSpecification' or $method='getParametersSpecification' or $method='collectParameterValuesSpecification' ">
- <!-- we need two vars to be passed in here - the inline spec contents and the type of the spec -->
- <bus:specification xsi:type="bus:{$inlineSpecType}">
- <xsl:choose>
- <xsl:when test="$inlineSpec != ''">
- <bus:value xsi:type="bus:specification" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xsl:value-of select="$inlineSpec"/>
- </bus:value>
- </xsl:when>
- <xsl:otherwise>
- <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
- <!-- env -->
- <!-- solution for package name has ampersand characters -->
- <xsl:if test="key('env-param', 'buildRequestXTS')= '/ags/async/spParamRequest.xts' or key('env-param', 'buildRequestXTS')= '/ags/async/spRequest.xts'">
- <xsl:variable name="sql">
- <xsl:value-of select="/root/env/param[@name='sql_package']"/>
- </xsl:variable>
- <xts:delete select="/root/env/param[@name='sql_package']"/>
- <xts:append select="/root/env">
- <param name="sql_package">
- <xts:transform name="XMLEncode">
- <xsl:value-of select="$sql"/>
- </xts:transform>
- </param>
- </xts:append>
- </xsl:if>
- <xsl:copy-of select="/root/env"/>
- <xsl:copy-of select="/root/header"/>
- <xsl:copy-of select="/root/credential"/>
- </xts:request>
- </xsl:otherwise>
- </xsl:choose>
- </bus:specification>
- </xsl:when>
- <xsl:otherwise>
- <objectPath xsi:type="bus:searchPathSingleObject">
- <xsl:value-of select="/root/env/param[@name='obj']"/>
- </objectPath>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='parameterValues'] != ''">
- <xsl:value-of select="string(/root/env/param[@name='parameterValues'])" disable-output-escaping="yes"/>
- </xsl:when>
- <xsl:when test="/root/env/param[@name='m_rp_parameters'] != ''">
- <xts:transform src="transforms/portal/parameters/pre-WARP-process.xslt" processor="XSLT">
- <xsl:value-of select="xtsext:web64decode( string(/root/env/param[@name='m_rp_parameters']), true())" disable-output-escaping="yes"/>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]"/>
- </xsl:otherwise>
- </xsl:choose>
- <!-- do the options -->
- <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
- <xsl:call-template name="Options"/>
- </bus:options>
- </xsl:element>
- </xsl:when>
- <!-- nextPage, previousPage, other "Page" operations, release, and cancel only send conversation param -->
- <xsl:when test="$method = 'release' or $method = 'cancel'">
- <xsl:element name="{$method}" namespace="{$requestNamespace}">
- <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
- </bus:conversation>
- </xsl:element>
- </xsl:when>
- <!-- plug in the two agentService method -->
- <xsl:when test="$method = 'validateAgent'">
- <xsl:element name="{$method}" namespace="{$requestNamespace}">
- <!-- get the sub morphlet to build the information for validate and preview -->
- <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
- <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
- <!-- env -->
- <xsl:copy-of select="/root/env"/>
- <xsl:copy-of select="/root/header"/>
- <xsl:copy-of select="/root/credential"/>
- </xts:request>
- </xts:transform>
- <!-- validate also has parameters and options -->
- <bus:parameterValues SOAP-ENC:arrayType="bus:parameterValue[]" xsi:type="SOAP-ENC:Array"/>
- <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
- <xsl:call-template name="Options"/>
- </bus:options>
- </xsl:element>
- </xsl:when>
- <xsl:when test="$method = 'previewAgent'">
- <xsl:element name="{$method}" namespace="{$requestNamespace}">
- <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
- <!-- get the sub morphlet to build the information for validate and preview -->
- <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildRequestXTS']}" option="xml">
- <!-- env -->
- <xsl:copy-of select="/root/env"/>
- <xsl:copy-of select="/root/header"/>
- <xsl:copy-of select="/root/credential"/>
- </xts:request>
- </xts:transform>
- </xsl:element>
- </xsl:when>
- <!-- all other methods (wait, getOutput, all the page operations) -->
- <xsl:otherwise>
- <xsl:element name="{$method}" namespace="{$requestNamespace}">
- <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='conversation'])), true())" disable-output-escaping="yes"/>
- </bus:conversation>
- <!-- we're not using parameters for this query -->
- <bus:parameterValues SOAP-ENC:arrayType="bus:parameterValue[]" xsi:type="SOAP-ENC:Array"/>
- <bus:options SOAP-ENC:arrayType="bus:option[]" xsi:type="SOAP-ENC:Array">
- <xsl:call-template name="Options"/>
- </bus:options>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </response>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <!--
- We are using this template to create a copy of a XML node because
- for some reason, using xsl:copy caused an exception (java.lang.ArrayIndexOutOfBoundsException)
- -->
- <xsl:template match="*" mode="copy">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="copy"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template name="Options" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <!-- save output -->
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">saveOutput</bus:name>
- <bus:value xsi:type="xsd:boolean">false</bus:value>
- </item>
- <!-- prompt -->
- <xsl:if test="key('env-param', 'prompt')!=''">
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">prompt</bus:name>
- <bus:value xsi:type="xsd:boolean">
- <xsl:value-of select="key('env-param','prompt')"/>
- </bus:value>
- </item>
- </xsl:if>
- <!-- outputLocale -->
- <xsl:if test="key('env-param', 'outputLocale')!=''">
- <item xsi:type="bus:runOptionLanguageArray">
- <bus:name xsi:type="bus:runOptionEnum">outputLocale</bus:name>
- <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
- <item>
- <xsl:value-of select="key('env-param','outputLocale')"/>
- </item>
- </bus:value>
- </item>
- </xsl:if>
- <!-- Default is: outputEncapsulation=none, attachmentEncoding=MIME, and outputFormat=HTMLFragment -->
- <item xsi:type="bus:runOptionOutputEncapsulation">
- <bus:name xsi:type="bus:runOptionEnum">outputEncapsulation</bus:name>
- <bus:value xsi:type="bus:outputEncapsulationEnum">none</bus:value>
- </item>
-
- <!--layoutParameters for prompt reports-->
- <xsl:if test="/root/evts/configuration/property[@name='reportLayoutParameters']='true'">
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">layoutParameters</bus:name>
- <bus:value xsi:type="xsd:boolean">true</bus:value>
- </item>
- </xsl:if>
-
- <!-- outputFormat -->
- <item xsi:type="bus:runOptionStringArray">
- <bus:name xsi:type="bus:runOptionEnum">outputFormat</bus:name>
- <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
- <item>XHTML</item>
- </bus:value>
- </item>
- <!-- version -->
- <xsl:if test="key('env-param', 'version')!=''">
- <item xsi:type="bus:runOptionDateTime">
- <bus:name xsi:type="bus:runOptionEnum">version</bus:name>
- <bus:value xsi:type="xsd:dateTime">
- <xsl:value-of select="key('env-param', 'version')"/>
- </bus:value>
- </item>
- </xsl:if>
- <!-- xslURL -->
- <xsl:if test="key('env-param', 'xslURL')!=''">
- <item xsi:type="bus:runOptionAnyURI">
- <bus:name xsi:type="bus:runOptionEnum">xslURL</bus:name>
- <bus:value xsi:type="xsd:string">
- <!--<xsl:text>null.xsl</xsl:text> -->
- <xsl:value-of select="key('env-param', 'xslURL')"/>
- </bus:value>
- </item>
- </xsl:if>
- <!-- credential parameters -->
- <xsl:if test="key('env-param', 'credentialParameters')!=''">
- <item xsi:type="bus:runOptionBoolean">
- <bus:name xsi:type="bus:runOptionEnum">credentialParameters</bus:name>
- <bus:value xsi:type="xsd:boolean">
- <xsl:value-of select="key('env-param', 'credentialParameters')"/>
- </bus:value>
- </item>
- </xsl:if>
- <!-- validate severity option -->
- <xsl:if test="key('env-param', 'severity')!=''">
- <item xsi:type="bus:validateOptionValidateSeverity">
- <bus:name xsi:type="bus:validateOptionEnum">severity</bus:name>
- <bus:value xsi:type="bus:validateSeverityEnum">
- <xsl:value-of select="key('env-param', 'severity')"/>
- </bus:value>
- </item>
- </xsl:if>
- <!-- validate member unique names -->
- <xsl:if test="key('env-param', 'checkMemberUniqueNames')!=''">
- <item xsi:type="bus:validateOptionBoolean">
- <bus:name xsi:type="bus:validateOptionEnum">checkMemberUniqueNames</bus:name>
- <bus:value xsi:type="xsd:boolean">
- <xsl:value-of select="key('env-param','checkMemberUniqueNames')"/>
- </bus:value>
- </item>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- appendPromptResponse - add the response from prompting into the tree as the response
- ===============================================================================================
- -->
- <xts:block id="appendPromptResponse" processor="XSLT" type="exec" dependency="getContent getOutput" mandatory="false" condition="/root/env/param[@name='promptResponse']" nodelist="env">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/root">
- <xsl:variable name="CRLF">
- <xsl:text>
</xsl:text>
- </xsl:variable>
- <xts:sequence>
- <xts:append>
- <response>
- <SOAP-ENV:Envelope>
- <SOAP-ENV:Header>
- <bus:biBusHeader xsi:type="bus:biBusHeader">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='disp_trackingInfo'] and /root/env/param[@name='disp_trackingInfo']!='' ">
- <!-- copy the tracking information from previous request -->
- <bus:tracking>
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='disp_trackingInfo'])), true())" disable-output-escaping="yes"/>
- </bus:tracking>
- <xsl:copy-of select="/root/header/bus:biBusHeader/*[name() != 'bus:tracking']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="/root/header/bus:biBusHeader/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </bus:biBusHeader>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <xsl:value-of select="xtsext:replace(/root/env/param[@name='promptResponse'], string($CRLF), string('&#xA;'), false)" disable-output-escaping="yes"/>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </response>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- appendDocument - add the results of the requests into the right place
- ===============================================================================================
- -->
- <xts:block id="appendResponse" processor="XSLT" type="exec" dependency="appendPromptResponse" mandatory="false" nodelist="header,env,response,cookies" condition=".[(/root/env/param[@name = 'doSkip'] or /root/response/*/*/*/*/*[local-name() = 'status'] = 'complete' or /root/response/*/*/*/*/*[local-name() = 'status'] = 'conversationComplete') and not(/root/response/*/*/*/*/*[local-name() = 'details']/*/*[local-name()='status'] = 'prompting')]">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/root">
- <!-- need to concat the method name into the response - for secondary requests -->
- <xsl:variable name="method" select="/root/env/param[@name='method']"/>
- <!-- check we have a response -->
- <xsl:if test="/root/env/param[@name = 'doSkip'] or ./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'getOutputResponse' or local-name()='waitResponse' or local-name() = string(concat($method,'Response'))] or /root/env/param[@name='promptResponse'] ">
- <xts:sequence>
- <xts:append>
- <asyncResponse>
- <xsl:if test="/root/env/param[@name='buildResponseXTS'] and /root/env/param[@name='buildResponseXTS'] != '' ">
- <xts:request name="BUS" target="bus://xts2{/root/env/param[@name='buildResponseXTS']}" option="xml">
- <!-- env -->
- <xsl:copy-of select="/root/env"/>
- <xsl:copy-of select="/root/header"/>
- <xsl:copy-of select="/root/cookies"/>
- <xsl:copy-of select="/root/credential"/>
- <!-- also have to copy out the SOAP-ENV from the reply -->
- <xsl:copy-of select="/root/response/SOAP-ENV:Envelope"/>
- </xts:request>
- </xsl:if>
- </asyncResponse>
- </xts:append>
- </xts:sequence>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- appendDocument - add the results of the requests into the right place
- ===============================================================================================
- -->
- <xts:block id="appendDocument" mode="output" mimeType="application/xml; charset=utf-8" processor="XSLT" type="exec" dependency="appendResponse" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xtsext SOAP-ENV pf bus send cml xsi xos">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <pf:serialize-xml/>
- <pf:variables/>
- <xsl:template match="/root">
- <!-- need to concat the method name into the response - for secondary requests -->
- <xsl:variable name="method" select="/root/env/param[@name='method']"/>
- <xsl:variable name="trackingInfo">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="./response/SOAP-ENV:Envelope/SOAP-ENV:Header/*[local-name()='biBusHeader']/*[local-name()='tracking']/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="conversation">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/bus:result/bus:primaryRequest/*"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="routingServerGroup">
- <xsl:choose>
- <!-- get the routing server group from the model or object -->
- <xsl:when test="/root/routingServerGroup//*[local-name()='result']!=''">
- <xsl:value-of select="/root/routingServerGroup//*[local-name()='result'][last()]"/>
- </xsl:when>
- <!-- get the routing server group for a second pass through were we stored the result from the first invokation of asyncConv -->
- <xsl:when test="/root/env/param[@name='routingServerGroup'] and /root/env/param[@name='routingServerGroup'] != '' ">
- <xsl:value-of select="/root/env/param[@name='routingServerGroup']"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = string(concat($method,'Response'))]/*[local-name()='result']/*[local-name()='status'], 'working') or
- contains(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'waitResponse']/*[local-name()='result']/*[local-name()='status'], 'stillWorking')">
- <working>
- <context>
- <xsl:value-of select="/root/env/param[@name='context']"/>
- </context>
- <tracking>
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
- </tracking>
- <routingServerGroup>
- <xsl:value-of select="$routingServerGroup"/>
- </routingServerGroup>
- <conversation>
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
- </conversation>
- <originalSoapAction>
- <xsl:value-of select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:dispatcherTransportVars/item/bus:value"/>
- </originalSoapAction>
- </working>
- </xsl:when>
- <xsl:when test="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportStatus']/*[local-name()='status'] = 'prompting'">
- <prompting>
- <context>
- <xsl:value-of select="/root/env/param[@name='context']"/>
- </context>
- <tracking>
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
- </tracking>
- <conversation>
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
- </conversation>
- <routingServerGroup>
- <xsl:value-of select="$routingServerGroup"/>
- </routingServerGroup>
- <htmlFragment>
- <xsl:value-of select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='details']/item[@xsi:type='bus:asynchDetailReportOutput']/*[local-name()='outputPages']/item"/>
- </htmlFragment>
- </prompting>
- </xsl:when>
- <xsl:when test="not(/root/asyncResponse/soapFault) and ( /root/env/param[@name = 'doSkip'] or ./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'getOutputResponse' or local-name()='waitResponse' or local-name()= string(concat($method,'Response'))] or /root/env/param[@name='promptResponse'])">
- <!-- build the response -->
- <asyncResponse>
- <context>
- <xsl:value-of select="/root/env/param[@name='context']"/>
- </context>
- <tracking>
- <!-- send the tracking back if we haven't completed the converstaion - if we have the conversation is dead -->
- <xsl:if test="not(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='status'] = 'conversationComplete')">
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($trackingInfo), true()))"/>
- </xsl:if>
- </tracking>
- <conversation>
- <!-- send the conversation back if we haven't completed it - if we have the conversation is dead -->
- <xsl:if test="not(./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='status'] = 'conversationComplete')">
- <xsl:value-of select="xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($conversation), true()))"/>
- </xsl:if>
- </conversation>
- <routingServerGroup>
- <xsl:value-of select="$routingServerGroup"/>
- </routingServerGroup>
- <!-- copy the output from the response -->
- <xsl:value-of select="/root/asyncResponse/asyncReply" disable-output-escaping="yes"/>
- <!-- a copy of all the allowed secondary requests-->
- <secondaryRequests>
- <xsl:for-each select="./response/SOAP-ENV:Envelope/SOAP-ENV:Body/*/*[local-name()='result']/*[local-name()='secondaryRequests']/*[local-name()='item']">
- <secondaryRequest>
- <xsl:value-of select="./*[local-name()='name']"/>
- </secondaryRequest>
- </xsl:for-each>
- </secondaryRequests>
- </asyncResponse>
- </xsl:when>
- <xsl:when test="./response/*/*/*[local-name() = 'cancelResponse']">
- <cancelResponse>
- <xsl:copy-of select="/root/response/SOAP-ENV:Envelope/SOAP-ENV:Body/*[local-name() = 'cancelResponse']/*"/>
- </cancelResponse>
- </xsl:when>
- <xsl:when test="./routingServerGroup/authenticationFault/passport or ./response/authenticationFault/passport">
- <passport>
- <errorCode><xsl:value-of select="/root/response//SOAP-ENV:Envelope/SOAP-ENV:Body//*[local-name()='errorCode']"/></errorCode>
- <soapFault>
- <xsl:call-template name="entityEncode">
- <xsl:with-param name="strVal">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="./*/authenticationFault/passport/soapFault"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </soapFault>
- </passport>
- </xsl:when>
- <xsl:when test="/root/asyncResponse/soapFault or ./response/soapFault or ./routingServerGroup/soapFault">
- <soapFault>
- <xsl:call-template name="entityEncode">
- <xsl:with-param name="strVal">
- <xsl:text/>FAULT<xsl:text/>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test=".//fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']">
- <xsl:for-each select=".//fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']">
- <messageString>
- <xsl:attribute name="severity">
- <xsl:value-of select="ancestor::*[local-name()='exception']/*[local-name()='severity']"/>
- </xsl:attribute>
- <xsl:value-of select="./*[local-name()='messageString']"/>
- </messageString>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="entityEncode">
- <xsl:with-param name="strVal">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="."/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </soapFault>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <!-- XML encoder - just put this into a node -->
- <xsl:template name="entityEncode">
- <xsl:param name="strVal"/>
- <a>
- <xsl:value-of select="$strVal"/>
- </a>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|