createUserProfile.xts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  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. <!--
  13. ===============================================================================================
  14. Adds the current user as to the notification list of an agent or agent view
  15. ===============================================================================================
  16. -->
  17. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" requiredCapability="canUseAdministrationPortal">
  18. <xts:block id="doFormCommand" processor="XSLT" type="exec">
  19. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  20. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  21. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  22. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  23. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  24. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  25. xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
  26. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  27. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  28. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  29. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  30. exclude-result-prefixes="xtsext">
  31. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  32. <xsl:template match="/root/command/form:createUserProfile/form:env">
  33. <xts:sequence>
  34. <xts:append>
  35. <send:request provider="cm">
  36. <cm2:copyAccount xmlns:cm2="http://developer.cognos.com/schemas/contentManagerService/1">
  37. <sourceAccountPath xsi:type="bus:searchPathSingleObject">/configuration/account[@tenantID='']</sourceAccountPath>
  38. <targetAccountPath xsi:type="bus:searchPathSingleObject"><xsl:value-of select="form:param[@name = 'm_obj']"/></targetAccountPath>
  39. <options xsi:type="bus:optionArray" SOAP-ENC:arrayType="bus:option[3]">
  40. <item xsi:type="bus:copyAccountOptionBoolean">
  41. <name xsi:type="bus:copyAccountOptionEnum">folders</name>
  42. <value xsi:type="xsd:boolean">true</value>
  43. </item>
  44. <item xsi:type="bus:copyAccountOptionBoolean">
  45. <name xsi:type="bus:copyAccountOptionEnum">pages</name>
  46. <value xsi:type="xsd:boolean">true</value>
  47. </item>
  48. <item xsi:type="bus:copyAccountOptionBoolean">
  49. <name xsi:type="bus:copyAccountOptionEnum">preferences</name>
  50. <value xsi:type="xsd:boolean">true</value>
  51. </item>
  52. </options>
  53. </cm2:copyAccount>
  54. </send:request>
  55. </xts:append>
  56. </xts:sequence>
  57. </xsl:template>
  58. </xsl:stylesheet>
  59. </xts:block>
  60. <xts:block id="saveFault" type="fault" processor="XSLT">
  61. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  62. <xsl:output method="xml"/>
  63. <xsl:template match="/root/fault">
  64. <xsl:choose>
  65. <xsl:when test="./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/*[local-name()='errorCode'] = 'cmDuplicateName'">
  66. <copyFault>
  67. <xsl:copy-of select="."/>
  68. </copyFault>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <xsl:copy-of select="."/>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. </xsl:template>
  75. <xsl:template match="text()"/>
  76. </xsl:stylesheet>
  77. </xts:block>
  78. <!--
  79. ===============================================================================================
  80. commandResults - operation results
  81. ===============================================================================================
  82. -->
  83. <xts:block id="commandResults" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doFormCommand">
  84. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  85. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" version="1.0">
  86. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  87. <xsl:template match="/root">
  88. <response xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  89. <!--xsl:copy-of select="."/-->
  90. <xsl:choose>
  91. <xsl:when test="./copyFault">
  92. <error>
  93. <errorCode>
  94. <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='errorCode']"/>
  95. </errorCode>
  96. <errorMessage>
  97. <xsl:value-of select="./copyFault/fault/*[local-name()='exception']/*[local-name()='exceptionDetail']/*[local-name()='exception']/*[local-name()='message']/*[local-name()='messageString']"/>
  98. </errorMessage>
  99. </error>
  100. </xsl:when>
  101. <xsl:when test="bus:copyAccountResponse">
  102. <xsl:copy-of select="bus:copyAccountResponse"/>
  103. </xsl:when>
  104. <xsl:otherwise>
  105. <error/>
  106. </xsl:otherwise>
  107. </xsl:choose>
  108. </response>
  109. </xsl:template>
  110. <xsl:template match="text()"/>
  111. </xsl:stylesheet>
  112. </xts:block>
  113. </xts:morphlet>