addMigration.xts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio">
  9. <!--
  10. ===============================================================================================
  11. get the information for the agent - we only need the defaultName thought for the time being
  12. ===============================================================================================
  13. -->
  14. <xts:block id="getSelectedPath" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] " mandatory="false" >
  15. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  16. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  18. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  19. <xsl:template match="/">
  20. <xts:sequence>
  21. <xts:append>
  22. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  23. <send:request provider="cm" requester="AGS:addMigration">
  24. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  25. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  26. <search>
  27. <!-- Get the report - we know only it's search path now -->
  28. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  29. </search>
  30. <properties>
  31. <property name="defaultName"/>
  32. <property name="searchPath"/>
  33. </properties>
  34. </query>
  35. </xts:transform>
  36. </send:request>
  37. </xts:transform>
  38. </xts:append>
  39. </xts:sequence>
  40. </xsl:template>
  41. </xsl:stylesheet>
  42. </xts:block>
  43. <!--
  44. ===============================================================================================
  45. returnResult - We're done with the email options morphlet, so return the appropriate response
  46. ===============================================================================================
  47. -->
  48. <xts:block id="returnResult" path="/ags/tabResultTemplate.xslt" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" mandatory="false" dependency="getSelectedPath">
  49. <xts:logicsheet path="logicsheets/portal.xsl"/>
  50. </xts:block>
  51. <!--
  52. ===============================================================================================
  53. genMarkup -
  54. ===============================================================================================
  55. -->
  56. <xts:block id="genMarkup" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] " dependency="returnResult">
  57. <!-- logicsheets -->
  58. <!-- portal specific information -->
  59. <xts:logicsheet path="logicsheets/portal.xsl"/>
  60. <!-- agent studio logicsheets -->
  61. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  62. <!-- Dialog specific logicsheets -->
  63. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  64. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  65. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  66. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  67. <!-- Generic logicsheets -->
  68. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  69. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  70. <!-- apply the form logic -->
  71. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  72. <!-- Prevent the href from appearing in the status bar. -->
  73. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  74. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" exclude-result-prefixes="xts cm pf xtsext lyt dp df cf cp xos utml agsdlg">
  75. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  76. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  77. <pf:variables/>
  78. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  79. <xsl:variable name="spacer">
  80. <img height="10" width="10">
  81. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  82. </img>
  83. </xsl:variable>
  84. <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
  85. <xsl:variable name="hasTask">
  86. <xsl:choose>
  87. <xsl:when test="key('env-param','selected_path') != ''"><xsl:text>true</xsl:text></xsl:when>
  88. <xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
  89. </xsl:choose>
  90. </xsl:variable>
  91. <xsl:template match="/">
  92. <xts:sequence>
  93. <xts:append select="/root/output">
  94. <xos:part>
  95. <xos:entityHeader>
  96. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  97. </xos:entityHeader>
  98. <xos:entityBody>
  99. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  100. <markup>
  101. <xts:transform name="XMLEncode">
  102. <utml:form name="pform">
  103. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  104. <!-- ================================================================ -->
  105. <!-- H E A D E R -->
  106. <!-- ================================================================ -->
  107. <utml:exclusion-list><xsl:value-of select="' pageitem '"/></utml:exclusion-list>
  108. <agsdlg:header>
  109. <dp:image>
  110. <img alt="" border="0">
  111. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_import_24.gif</xsl:attribute>
  112. </img>
  113. </dp:image>
  114. <dp:title>
  115. <xts:string id="DIALOG_MIGRATION_TITLE"/>
  116. </dp:title>
  117. <dp:description>
  118. <xts:string id="DIALOG_MIGRATION_DESCRIPTION"/>
  119. </dp:description>
  120. </agsdlg:header>
  121. <utml:input type="hidden" name="report_visited" id="report_visited" value="true"/>
  122. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false">
  123. <utml:value>
  124. <xsl:choose>
  125. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:migrationTask/cm:defaultName != '' ">
  126. <xsl:value-of select="/root/cm:queryResponse/cm:migrationTask/cm:defaultName"/>
  127. </xsl:when>
  128. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  129. <xsl:value-of select="key('env-param', 'taskName')"/>
  130. </xsl:when>
  131. </xsl:choose>
  132. </utml:value>
  133. </utml:input>
  134. <!-- ================================================================ -->
  135. <!-- B O D Y -->
  136. <!-- ================================================================ -->
  137. <!-- Define a new layout-->
  138. <lyt:layout style="2">
  139. <!-- create a new row, each row includes a spacer -->
  140. <lyt:section>
  141. <dp:textarea section3_align="left">
  142. <!-- the import name label-->
  143. <dp:section1>
  144. <xts:string id="DIALOG_MIGRATIONS_LABEL"/>
  145. </dp:section1>
  146. <dp:section2>
  147. <!-- get the name of the migration -->
  148. <xsl:choose>
  149. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:migrationTask/cm:defaultName != '' ">
  150. <!--xsl:copy-of select="$spacer"/-->
  151. <xsl:value-of select="/root/cm:queryResponse/cm:migrationTask/cm:defaultName"/>
  152. </xsl:when>
  153. <xsl:otherwise>
  154. <xts:string id="DIALOG_MESSAGE_NONE"/>
  155. </xsl:otherwise>
  156. </xsl:choose>
  157. </dp:section2>
  158. <dp:section3>
  159. <a href="#" onclick="doSelectObject('migrationTask.es', '{xtsext:javascriptencode(/root/env/param[@name = 'selected_path'])}')">
  160. <xts:string id="SELECT_MIGRATION"/>
  161. </a>
  162. </dp:section3>
  163. </dp:textarea>
  164. </lyt:section>
  165. <lyt:section>
  166. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  167. </lyt:section>
  168. </lyt:layout>
  169. <dp:emptyFooter/>
  170. <script type="text/javascript">
  171. function init() {
  172. <xsl:if test="not(/root/env/param[@name='report_visited'])">
  173. <xsl:if test="not(/root/env/param[@name='selected_path'])">
  174. doSelectObject('migrationTask.es')
  175. </xsl:if>
  176. </xsl:if>
  177. }
  178. /*
  179. * validate the report page and popup an appropriate alert message
  180. */
  181. function validate() {
  182. var hasTask = <xsl:value-of select="string($hasTask)"/>;
  183. var isValid = true;
  184. if (hasTask==false) {
  185. isValid = false;
  186. alert(&quot;<xts:string id="DIALOG_MIGRATION_NO_MIGRATION_TASK" encode="javascript"/>&quot;);
  187. }
  188. return isValid;
  189. }
  190. </script>
  191. </utml:form>
  192. </xts:transform>
  193. </markup>
  194. </xsl:element>
  195. </xos:entityBody>
  196. </xos:part>
  197. </xts:append>
  198. </xts:sequence>
  199. </xsl:template>
  200. </xsl:stylesheet>
  201. </xts:block>
  202. <!--
  203. ===============================================================================================
  204. debug - special debug block for nested requests
  205. ===============================================================================================
  206. -->
  207. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  208. <!-- Get the debug logic sheet -->
  209. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  210. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  211. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  212. <xsl:template match="/">
  213. <dbg:dumpxml select="/root"/>
  214. </xsl:template>
  215. </xsl:stylesheet>
  216. </xts:block>
  217. </xts:morphlet>