determineRouting.xslt 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--this template depends on the presence of an element called routingServerGroup with objectPath elements inside
  9. these will be used to call determine routing-->
  10. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  11. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  12. <xsl:template match="/">
  13. <xts:sequence>
  14. <xts:replace select="/root/routingServerGroup">
  15. <routingServerGroup>
  16. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  17. <xts:request href="bus://cm" protocol="BUS" responseEnvelope="true" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201505/" outputHeader="true" >
  18. <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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:cm="http://developer.cognos.com/schemas/contentManagerService/1" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  19. <SOAP-ENV:Header>
  20. <xts:transform src="ags/transforms/transportRequester.xslt" processor="XSLT">
  21. <root>
  22. <requester>determineRouting</requester>
  23. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  24. </root>
  25. </xts:transform>
  26. </SOAP-ENV:Header>
  27. <SOAP-ENV:Body>
  28. <!-- get info from CM -->
  29. <cm:determineRouting>
  30. <objectPaths xsi:type="xsd:searchPathSingleObjectArray" SOAP-ENC:arrayType="cm:searchPathSingleObject[]">
  31. <xsl:if test="/root/routingServerGroup//*[local-name()='parent']//*[local-name()='searchPath']">
  32. <item xsi:type="cm:searchPathSingleObject">
  33. <xsl:value-of select="/root/routingServerGroup//*[local-name()='parent']//*[local-name()='searchPath']"/>
  34. </item>
  35. </xsl:if>
  36. <xsl:if test="/root/routingServerGroup//*[local-name()='objectPath']">
  37. <item xsi:type="cm:searchPathSingleObject">
  38. <xsl:value-of select="/root/routingServerGroup/*[local-name()='objectPath']"/>
  39. </item>
  40. </xsl:if>
  41. <xsl:if test="/root/env/param[@name='obj'] and /root/env/param[@name='obj'] != ''">
  42. <item xsi:type="cm:searchPathSingleObject">
  43. <xsl:value-of select="/root/env/param[@name='obj']"/>
  44. </item>
  45. </xsl:if>
  46. </objectPaths>
  47. </cm:determineRouting>
  48. </SOAP-ENV:Body>
  49. </SOAP-ENV:Envelope>
  50. </xts:request>
  51. </xts:transform>
  52. </routingServerGroup>
  53. </xts:replace>
  54. </xts:sequence>
  55. </xsl:template>
  56. </xsl:stylesheet>