copyAccount.xts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:create="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/" requiredCapability="canUseAdministrationPortal">
  13. <xts:block id="doCopy" processor="XSLT" type="exec">
  14. <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
  15. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  16. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  17. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  18. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  19. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  20. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  22. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  23. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  24. xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
  25. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  26. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  27. exclude-result-prefixes="xtsext">
  28. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  29. <xsl:template match="/">
  30. <xsl:apply-templates select="root/command/form:copyAccount"/>
  31. </xsl:template>
  32. <xsl:template match="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">
  38. <xsl:value-of select="form:param[@name = 'm_obj']"/>
  39. </sourceAccountPath>
  40. <targetAccountPath xsi:type="bus:searchPathSingleObject">
  41. <xsl:value-of select="form:param[@name = 'target_account']"/>
  42. </targetAccountPath>
  43. <options xsi:type="bus:optionArray" SOAP-ENC:arrayType="bus:option[3]">
  44. <item xsi:type="bus:copyAccountOptionBoolean">
  45. <name xsi:type="bus:copyAccountOptionEnum">folders</name>
  46. <value xsi:type="xsd:boolean">
  47. <xsl:choose>
  48. <xsl:when test="form:param[@name = 'migrate_myfolder'] = 'true'">true</xsl:when>
  49. <xsl:otherwise>false</xsl:otherwise>
  50. </xsl:choose>
  51. </value>
  52. </item>
  53. <item xsi:type="bus:copyAccountOptionBoolean">
  54. <name xsi:type="bus:copyAccountOptionEnum">pages</name>
  55. <value xsi:type="xsd:boolean">
  56. <xsl:choose>
  57. <xsl:when test="form:param[@name = 'migrate_mypages'] = 'true'">true</xsl:when>
  58. <xsl:otherwise>false</xsl:otherwise>
  59. </xsl:choose>
  60. </value>
  61. </item>
  62. <item xsi:type="bus:copyAccountOptionBoolean">
  63. <name xsi:type="bus:copyAccountOptionEnum">preferences</name>
  64. <value xsi:type="xsd:boolean">
  65. <xsl:choose>
  66. <xsl:when test="form:param[@name = 'migrate_preferences'] = 'true'">true</xsl:when>
  67. <xsl:otherwise>false</xsl:otherwise>
  68. </xsl:choose>
  69. </value>
  70. </item>
  71. </options>
  72. </cm2:copyAccount>
  73. </send:request>
  74. <!-- do we delete the source account -->
  75. <xsl:if test="form:param[@name = 'delete_source_account'] = 'true'">
  76. <send:request provider="cm">
  77. <cm2:deleteAccount xmlns:cm2="http://developer.cognos.com/schemas/contentManagerService/1">
  78. <objectPath xsi:type="bus:searchPathSingleObject">
  79. <xsl:value-of select="form:param[@name = 'm_obj']"/>
  80. </objectPath>
  81. </cm2:deleteAccount>
  82. </send:request>
  83. </xsl:if>
  84. </xts:append>
  85. </xts:sequence>
  86. </xsl:template>
  87. </xsl:stylesheet>
  88. </xts:block>
  89. <xts:block id="result" processor="XSLT" type="exec" mode="output" mimeType="text/xml" dependency="doCopy">
  90. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  91. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" version="1.0">
  92. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  93. <xsl:template match="/root">
  94. <xsl:choose>
  95. <xsl:when test="bus:response"><xsl:copy-of select="bus:response/child::*"/></xsl:when>
  96. <xsl:otherwise><error/></xsl:otherwise>
  97. </xsl:choose>
  98. </xsl:template>
  99. <xsl:template match="text()"/>
  100. </xsl:stylesheet>
  101. </xts:block>
  102. </xts:morphlet>