addImport.xts 19 KB

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