PortletManagementServiceImpl.xts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!-- $Header: //cpscrn/main/templates/cps4/producer/wsrp-impl/PortletManagementServiceImpl.xts#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  16. <xts:block id="execution" type="exec" mode="interpret" processor="XSLT" nodelist="envelope,session,system,configProps,implementation">
  17. <xts:logicsheet path="/cps4/producer/logicsheets/cps-portlet.xslt"/>
  18. <xsl:stylesheet version="1.0"
  19. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  21. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  22. xmlns:portlet="http://developer.cognos.com/schemas/cps/logic/portlet/1/">
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  24. <xsl:template match="/">
  25. <portlet:soap-response>
  26. <xsl:choose>
  27. <xsl:when test="$portlet-op-name = 'getPortletDescription'">
  28. <xsl:choose>
  29. <xsl:when test="/root/implementation/portlet[@handle = $portlet-op/wsrp:portletContext/wsrp:portletHandle]">
  30. <xsl:variable name="desired-locales" select="$portlet-op/wsrp:desiredLocales"/>
  31. <xts:transform processor="XSLT" src="/cps4/producer/wsrp-impl/transforms/getServiceDescription.xslt">
  32. <root>
  33. <xts:queryNode select="/root/implementation/message[1] | /root/implementation/portlet[@handle = '{ $portlet-op/wsrp:portletContext/wsrp:portletHandle }']"/>
  34. <xsl:for-each select="$desired-locales">
  35. <locale>
  36. <xsl:value-of select="."/>
  37. </locale>
  38. </xsl:for-each>
  39. <xts:function name="getConfiguration">
  40. <xts:param name="productLocales">en</xts:param>
  41. <xts:param name="contentLocales">en</xts:param>
  42. </xts:function>
  43. </root>
  44. </xts:transform>
  45. </xsl:when>
  46. <xsl:otherwise>
  47. <xts:transform name="XML" cache="false">
  48. <xts:param name="messageBase"><xts:queryValue select="/root/interfaces/interfaceInfo/param[@name='location']"/>/messages/cpsproducermsgs.xml</xts:param>
  49. <xts:param name="systemId">no-cache-id</xts:param>
  50. <xts:param name="src">
  51. <SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  52. <faultcode xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types">wsrp:InconsistentParameters</faultcode>
  53. <faultstring><xts:string id="IDS_PRO_WSF_NOTIMPLEMENTEDFAULT"/></faultstring>
  54. <detail>
  55. <wsrp:OperationFailed xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"/>
  56. </detail>
  57. </SOAP-ENV:Fault>
  58. </xts:param>
  59. </xts:transform>
  60. </xsl:otherwise>
  61. </xsl:choose>
  62. </xsl:when>
  63. <xsl:when test="$portlet-op-name = 'clonePortlet'">
  64. <portlet:response>
  65. <wsrp:portletHandle>
  66. <xsl:choose>
  67. <xsl:when test="contains( $portlet-op/wsrp:portletContext/wsrp:portletHandle, ':' )">
  68. <xsl:value-of select="substring-before( $portlet-op/wsrp:portletContext/wsrp:portletHandle, ':' )"/>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <xsl:value-of select="$portlet-op/wsrp:portletContext/wsrp:portletHandle"/>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. <xsl:value-of select="concat(':', xtsext:generateGUID())"/>
  75. </wsrp:portletHandle>
  76. <wsrp:portletState>
  77. <xsl:variable name="portlet-state">
  78. <xsl:for-each select="$portlet-state-params">
  79. <xsl:value-of select="concat('&lt;param name=&quot;', @name, '&quot;&gt;', xtsext:xmlencode(.), '&lt;/param&gt;')"/>
  80. </xsl:for-each>
  81. </xsl:variable>
  82. <xsl:value-of select="xtsext:base64encode(string($portlet-state), true())"/>
  83. </wsrp:portletState>
  84. </portlet:response>
  85. </xsl:when>
  86. <xsl:when test="$portlet-op-name = 'destroyPortlets'">
  87. <portlet:response/>
  88. </xsl:when>
  89. <xsl:when test="$portlet-op-name = 'setPortletProperties'">
  90. <portlet:response>
  91. <wsrp:portletHandle>
  92. <xsl:value-of select="$portlet-op/wsrp:portletContext/wsrp:portletHandle"/>
  93. <!-- TODO: complete the implementation -->
  94. <!-- wsrp:portletState -->
  95. </wsrp:portletHandle>
  96. </portlet:response>
  97. </xsl:when>
  98. <xsl:when test="$portlet-op-name = 'getPortletProperties'">
  99. <!-- TODO: complete the implementation -->
  100. <portlet:response/>
  101. </xsl:when>
  102. <xsl:when test="$portlet-op-name = 'getPortletPropertyDescription'">
  103. <!-- TODO: complete the implementation -->
  104. <portlet:response/>
  105. </xsl:when>
  106. </xsl:choose>
  107. </portlet:soap-response>
  108. </xsl:template>
  109. </xsl:stylesheet>
  110. </xts:block>
  111. </xts:morphlet>