deployment.xts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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, 2015
  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/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true" resolverBase="prompting">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ===============================================================================================
  21. checkParam - change m_name, m_class, m_obj when dealing with shortcut.
  22. ===============================================================================================
  23. -->
  24. <xts:block id="checkParam" path="/portal/ref2target.xml" dependency="formlogic_init" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[starts-with(@name,'sc_target')]!='']" mandatory="false"/>
  25. <!--
  26. ===============================================================================================
  27. getContent - get our data from Content Manager
  28. ===============================================================================================
  29. -->
  30. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init checkParam">
  31. <xts:logicsheet path="portal/runWithOptions/logicsheets/request.xslt"/>
  32. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  33. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  34. <xsl:stylesheet version="1.0"
  35. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  36. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  37. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  38. exclude-result-prefixes="xsl xtsext rdr">
  39. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  40. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  41. <xsl:template match="/">
  42. <xts:sequence>
  43. <rdr:Requests mode="deployment">
  44. <rdr:Request type="runnable" mode="deployment">
  45. <rdr:searchPath>
  46. <xsl:value-of select="key('env-param', 'm_obj')"/>
  47. </rdr:searchPath>
  48. </rdr:Request>
  49. <rdr:Request type="namespaces"/>
  50. <rdr:Request type="credential"/>
  51. <rdr:Request type="accountOptions"/>
  52. <xsl:if test="key('env-param','from_schedule_tool') = 'true'">
  53. <rdr:Request type="schedule">
  54. <rdr:searchPath>
  55. <xsl:value-of select="key('env-param', 'm_obj')"/>
  56. <xsl:text>/schedule[permission("read")]</xsl:text>
  57. </rdr:searchPath>
  58. </rdr:Request>
  59. </xsl:if>
  60. </rdr:Requests>
  61. <xsl:if test="/root/env/param[@name='m_class']='importDeployment'">
  62. <xts:append select="/root/env">
  63. <xts:transform src="transforms/portal/deploymentOptions/generateDeploymentOptionsEnvParams.xslt" processor="XSLT">
  64. <root>
  65. <xts:queryNode select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*/*[local-name()='deploymentOptions']"/>
  66. </root>
  67. </xts:transform>
  68. </xts:append>
  69. </xsl:if>
  70. </xts:sequence>
  71. </xsl:template>
  72. </xsl:stylesheet>
  73. </xts:block>
  74. <!--
  75. ===============================================================================================
  76. getExportPackages - get the names and paths of the packages being exported.
  77. ===============================================================================================
  78. -->
  79. <xts:block id="getExportPackages" processor="XSLT" type="exec" dependency="getContent" condition="/root/env/param[@name='m_class']='exportDeployment'" nodelist="header,env,http,cookies,queryResponse">
  80. <xts:logicsheet path="portal/runWithOptions/logicsheets/request.xslt"/>
  81. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  82. <xsl:stylesheet version="1.0"
  83. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  84. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  85. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  86. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  87. exclude-result-prefixes="xsl cm xtsext rdr">
  88. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  89. <xsl:template match="/">
  90. <xsl:variable name="exportOption" select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:deploymentOptions/*[@name='export']"/>
  91. <xsl:if test="$exportOption/cm:searchPathSingleObject">
  92. <xts:sequence>
  93. <rdr:Requests rootElement="exportPackages">
  94. <xsl:for-each select="$exportOption/cm:searchPathSingleObject">
  95. <cm:query>
  96. <cm:search><xsl:value-of select="."/></cm:search>
  97. <cm:properties>
  98. <cm:property name="defaultName"/>
  99. <cm:property name="ancestors"/>
  100. <cm:property name="storeID"/>
  101. <cm:property name="objectClass"/>
  102. </cm:properties>
  103. </cm:query>
  104. </xsl:for-each>
  105. </rdr:Requests>
  106. </xts:sequence>
  107. </xsl:if>
  108. </xsl:template>
  109. </xsl:stylesheet>
  110. </xts:block>
  111. <!--
  112. ===============================================================================================
  113. getArchiveOptions - call getDeploymentOptions method.
  114. ===============================================================================================
  115. -->
  116. <xts:block id="getArchiveOptions" processor="XSLT" type="exec" dependency="getContent" mandatory="false" condition=".[/root/env/param[@name='m_class'] = 'importDeployment' and /root/env/param[@name='m_archive'] != '' and not(/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][5]/*[local-name()='schedule'])]">
  117. <xts:logicsheet path="logicsheets/deploymentlogic.xsl"/>
  118. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  119. <xts:logicsheet path="logicsheets/portal.xsl"/>
  120. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  121. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  122. <dpl:getArchiveOptions handleFault="true"/>
  123. </xsl:stylesheet>
  124. </xts:block>
  125. <!--
  126. ===============================================================================================
  127. Handle getDeploymentOptions fault.
  128. ===============================================================================================
  129. -->
  130. <xts:block id="faultHandler" type="fault" processor="XSLT">
  131. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  132. <xsl:output method="xml"/>
  133. <xsl:template match="/root/fault">
  134. <copyFault>
  135. <xsl:copy-of select="."/>
  136. </copyFault>
  137. </xsl:template>
  138. <xsl:template match="text()"/>
  139. </xsl:stylesheet>
  140. </xts:block>
  141. <!--
  142. ===============================================================================================
  143. generateDefaults - generate any required default values
  144. ===============================================================================================
  145. -->
  146. <xts:block id="generateDefaults" processor="XSLT" type="exec" dependency="getContent getArchiveOptions">
  147. <xts:logicsheet path="logicsheets/deploymentlogic.xsl"/>
  148. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  149. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  150. xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/">
  151. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  152. <xsl:variable name="the-account" select="/root/cm:queryResponse/cm:queryReply[4]/cm:account"/>
  153. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[5]/cm:schedule"/>
  154. <xsl:template match="/">
  155. <xts:sequence>
  156. <xts:append select="/root/env">
  157. <xts:transform src="/portal/runWithOptions/transforms/generateDefaultParams.xslt" processor="XSLT">
  158. <root>
  159. <xsl:copy-of select="/root/env"/>
  160. <xsl:copy-of select="/root/user"/>
  161. <xsl:copy-of select="/root/system"/>
  162. <xsl:copy-of select="$the-account"/>
  163. </root>
  164. </xts:transform>
  165. <!-- set the archive upgrade default value -->
  166. <xsl:if test="/root/env/param[@name='m_class']='importDeployment'">
  167. <dpl:defaultArchiveOptionsValuesForSchedule/>
  168. </xsl:if>
  169. </xts:append>
  170. </xts:sequence>
  171. </xsl:template>
  172. </xsl:stylesheet>
  173. </xts:block>
  174. <!--
  175. ===============================================================================================
  176. processSummaryOptions
  177. Filter the deployment options and append a summary of the options to the root.
  178. ===============================================================================================
  179. -->
  180. <xts:block id="processSummaryOptions" processor="XSLT" type="exec" dependency="generateDefaults getExportPackages" path="/portal/deployment/getShortOptionsSummary.xslt">
  181. <xts:logicsheet path="logicsheets/deploymentlogic.xsl"/>
  182. <xts:logicsheet path="logicsheets/portal.xsl"/>
  183. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  184. </xts:block>
  185. <!--
  186. ===============================================================================================
  187. Render the HTML page
  188. ===============================================================================================
  189. -->
  190. <xts:block id="renderPage" dependency="formlogic_init generateDefaults getArchiveOptions processSummaryOptions" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  191. <xts:logicsheet path="portal/runWithOptions/logicsheets/response.xslt"/>
  192. <xts:logicsheet path="logicsheets/deploymentlogic.xsl"/>
  193. <!-- portal specific information -->
  194. <xts:logicsheet path="logicsheets/portal.xsl"/>
  195. <!-- Dialog specific logicsheets -->
  196. <xts:logicsheet path="logicsheets/presentation/dialog/recurrenceUI.xslt"/>
  197. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  198. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  199. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  200. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  201. <xts:logicsheet path="portal/schedule/logicsheets/scheduleVars.xsl"/>
  202. <!-- Generic logicsheets -->
  203. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  204. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  205. <!-- apply the form logic -->
  206. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  207. <xts:logicsheet path="logicsheets/validation.xslt"/>
  208. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  209. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  210. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb/"
  211. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  212. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  213. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/"
  214. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  215. xmlns:dpl="http://developer.cognos.com/schemas/xts/logicsheets/deployment/"
  216. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  217. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  218. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  219. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  220. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  221. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  222. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  223. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  224. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  225. xmlns:x="x"
  226. exclude-result-prefixes="xsl lyt dp df cp cf cm bus utml xtsext xts">
  227. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  228. <!-- current file name -->
  229. <xsl:variable name="mname" select="'runWithOptions/deployment.xts'"/>
  230. <xsl:variable name="m_class" select="/root/env/param[@name = 'm_class']"/>
  231. <xsl:variable name="back-url" select="key('env-param','backURL')"/>
  232. <!-- add any theme variables -->
  233. <pf:variables/>
  234. <rui:variables/>
  235. <!-- deployment variables -->
  236. <dpl:variables/>
  237. <!-- Need ability to display icons-->
  238. <pf:gen-icon/>
  239. <!-- include date control stylesheet and declare any vairables needed -->
  240. <rui:promptControls form="pform"/>
  241. <!-- references to the various objects queried from CM -->
  242. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  243. <xsl:variable name="the-namespaces" select="/root/cm:queryResponse/cm:queryReply[2]/*"/>
  244. <xsl:variable name="the-credential" select="/root/cm:queryResponse/cm:queryReply[3]/cm:credential"/>
  245. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[5]/cm:schedule"/>
  246. <!-- start the output -->
  247. <xsl:template match="root">
  248. <!-- Page and title -->
  249. <xsl:variable name="browserTitle">
  250. <rdb:pageTitle/>
  251. </xsl:variable>
  252. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  253. <dp:meta>
  254. <pf:meta/>
  255. <!-- Standard meta tags -->
  256. </dp:meta>
  257. <!-- include data control scripts -->
  258. <rui:promptControlsScript/>
  259. <dp:script>
  260. <pf:help context="HID_SCHEDULE_MULTIPLE"/> <!-- Help system -->
  261. <script language="javascript">
  262. function runReport()
  263. {
  264. document.pform.ps_nav_op.value = 'push';
  265. document.pform.m.value = 'portal/runWithOptions/confirm.xts';
  266. document.pform.submit();
  267. }
  268. </script>
  269. </dp:script>
  270. <utml:form name="pform" action="{$gateway}" method="post">
  271. <!-- Since the date control input variables are not utml input, they would be put into Hidden inputs whenever the page is refreshed and cause
  272. duplicate. So we exclude them from query values. -->
  273. <utml:exclusion-list>
  274. <xsl:value-of select="' p_runDate p_runTime hourstimeFrom minutestimeFrom AMPMtimeFrom txtDatedateFrom '"/>
  275. </utml:exclusion-list>
  276. <!-- this defines the form command operation to be performed when all the collected properties are submitted. -->
  277. <utml:input type="hidden" name="ifrmcmd" value='execute' utml:update="false"/>
  278. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  279. <!-- if the user doesn't have a credentail then add the h_CAM_action to create one -->
  280. <rdb:checkCredential/>
  281. <!-- Dialog header -->
  282. <dp:header>
  283. <dp:title>
  284. <xsl:copy-of select="$browserTitle"/>
  285. </dp:title>
  286. <dp:description>
  287. <xsl:choose>
  288. <xsl:when test="$m_class='importDeployment'"><xts:string id="IDS_RUN_WITH_OPTIONS_IMPORT_INTRO"/></xsl:when>
  289. <xsl:when test="$m_class='exportDeployment'"><xts:string id="IDS_RUN_WITH_OPTIONS_EXPORT_INTRO"/></xsl:when>
  290. </xsl:choose>
  291. </dp:description>
  292. </dp:header>
  293. <lyt:layout style="1">
  294. <lyt:section>
  295. <div>
  296. <rdb:nowOrLater/>
  297. </div>
  298. </lyt:section>
  299. </lyt:layout>
  300. <!-- Display a summary of the deployment options -->
  301. <dpl:shortOptionsSummary>
  302. <dpl:param name="item-path">/root/deploymentOptionsSummary/*</dpl:param>
  303. </dpl:shortOptionsSummary>
  304. <lyt:layout style="1" border="no">
  305. <lyt:section>
  306. <dpl:archiveDeploymentOptionsRadioButtons/>
  307. </lyt:section>
  308. </lyt:layout>
  309. <!-- footer -->
  310. <dp:footer>
  311. <df:button df:id="IDS_OTHERRUN_RUN" df:style="href" df:href="javascript:runReport();"/>
  312. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  313. </dp:footer>
  314. </utml:form>
  315. </dp:page>
  316. </xsl:template>
  317. <cp:tabControl/>
  318. </xsl:stylesheet>
  319. </xts:block>
  320. <!--
  321. ===============================================================================================
  322. debug - display debug information
  323. ===============================================================================================
  324. -->
  325. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  326. <!-- Get the debug logic sheet -->
  327. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  328. <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">
  329. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  330. <xsl:template match="/">
  331. <dbg:dumpxml select="/root"/>
  332. </xsl:template>
  333. </xsl:stylesheet>
  334. </xts:block>
  335. </xts:morphlet>