metricsDataSourceETLTask.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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>
  44. <rdr:Request type="runnable" mode="cmm">
  45. <rdr:searchPath>
  46. <xsl:value-of select="key('env-param', 'm_obj')"/>
  47. </rdr:searchPath>
  48. </rdr:Request>
  49. <rdr:Request type="credential"/>
  50. <rdr:Request type="accountOptions"/>
  51. <xsl:if test="key('env-param','from_schedule_tool') = 'true'">
  52. <rdr:Request type="schedule">
  53. <rdr:searchPath>
  54. <xsl:value-of select="key('env-param', 'm_obj')"/>
  55. <xsl:text>/schedule[permission("read")]</xsl:text>
  56. </rdr:searchPath>
  57. </rdr:Request>
  58. </xsl:if>
  59. </rdr:Requests>
  60. </xts:sequence>
  61. </xsl:template>
  62. </xsl:stylesheet>
  63. </xts:block>
  64. <!--
  65. ===============================================================================================
  66. generateDefaults - generate any required default values
  67. ===============================================================================================
  68. -->
  69. <xts:block id="generateDefaults" processor="XSLT" type="exec" dependency="getContent">
  70. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  71. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  72. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  73. <xsl:variable name="the-account" select="/root/cm:queryResponse/cm:queryReply[3]/cm:account"/>
  74. <xsl:template match="/">
  75. <xts:sequence>
  76. <xts:append select="/root/env">
  77. <xts:transform src="/portal/runWithOptions/transforms/generateDefaultParams.xslt" processor="XSLT">
  78. <root>
  79. <xsl:copy-of select="/root/env"/>
  80. <xsl:copy-of select="/root/user"/>
  81. <xsl:copy-of select="/root/system"/>
  82. <xsl:copy-of select="$the-account"/>
  83. </root>
  84. </xts:transform>
  85. </xts:append>
  86. </xts:sequence>
  87. </xsl:template>
  88. </xsl:stylesheet>
  89. </xts:block>
  90. <!--
  91. ===============================================================================================
  92. Render the HTML page
  93. ===============================================================================================
  94. -->
  95. <xts:block id="renderPage" dependency="formlogic_init generateDefaults" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  96. <xts:logicsheet path="portal/runWithOptions/logicsheets/response.xslt"/>
  97. <!-- portal specific information -->
  98. <xts:logicsheet path="logicsheets/portal.xsl"/>
  99. <!-- Dialog specific logicsheets -->
  100. <xts:logicsheet path="logicsheets/presentation/dialog/recurrenceUI.xslt"/>
  101. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  102. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  103. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  104. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  105. <!-- Generic logicsheets -->
  106. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  107. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  108. <xts:logicsheet path="portal/schedule/logicsheets/scheduleVars.xsl"/>
  109. <!-- apply the form logic -->
  110. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  111. <xts:logicsheet path="logicsheets/validation.xslt"/>
  112. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  113. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  114. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb/"
  115. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  116. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  117. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/"
  118. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  119. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  120. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  121. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  122. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  123. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  124. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  125. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  126. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  127. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  128. xmlns:x="x"
  129. exclude-result-prefixes="xsl lyt dp df cp cf cm bus utml xtsext xts rui">
  130. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  131. <!-- current file name -->
  132. <xsl:variable name="mname" select="'runWithOptions/metricsDataSourceETLTask.xts'"/>
  133. <xsl:variable name="m_class" select="/root/env/param[@name = 'm_class']"/>
  134. <xsl:variable name="back-url" select="key('env-param','backURL')"/>
  135. <!-- add any theme variables -->
  136. <pf:variables/>
  137. <rui:variables/>
  138. <xsl:key name="options-item" match="/root/cm:queryResponse/cm:queryReply[1]/*/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']" use="./*[local-name()='name']"/>
  139. <!-- include date control stylesheet and declare any vairables needed -->
  140. <rui:promptControls form="pform"/>
  141. <!-- references to the various objects queried from CM -->
  142. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  143. <xsl:variable name="the-credential" select="/root/cm:queryResponse/cm:queryReply[2]/cm:credential"/>
  144. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[4]/cm:schedule"/>
  145. <!-- start the output -->
  146. <xsl:template match="root">
  147. <!-- Page and title -->
  148. <xsl:variable name="browserTitle">
  149. <rdb:pageTitle/>
  150. </xsl:variable>
  151. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  152. <dp:meta>
  153. <pf:meta/>
  154. <!-- Standard meta tags -->
  155. </dp:meta>
  156. <!-- include data control scripts -->
  157. <rui:promptControlsScript/>
  158. <dp:script>
  159. <pf:help context="HID_SCHEDULE_MULTIPLE"/> <!-- Help system -->
  160. <script language="javascript">
  161. function runReport()
  162. {
  163. document.pform.ps_nav_op.value = 'push';
  164. document.pform.m.value = 'portal/runWithOptions/confirm.xts';
  165. document.pform.submit();
  166. }
  167. </script>
  168. </dp:script>
  169. <utml:form name="pform" action="{$gateway}" method="post">
  170. <!-- Since the date control input variables are not utml input, they would be put into Hidden inputs whenever the page is refreshed and cause
  171. duplicate. So we exclude them from query values. -->
  172. <utml:exclusion-list>
  173. <xsl:value-of select="' p_runDate p_runTime hourstimeFrom minutestimeFrom AMPMtimeFrom txtDatedateFrom '"/>
  174. </utml:exclusion-list>
  175. <!-- this defines the form command operation to be performed when all the collected properties are submitted. -->
  176. <utml:input type="hidden" name="ifrmcmd" value='execute' utml:update="false"/>
  177. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  178. <!-- if the user doesn't have a credentail then add the h_CAM_action to create one -->
  179. <rdb:checkCredential/>
  180. <!-- Dialog header -->
  181. <dp:header>
  182. <dp:title>
  183. <xsl:copy-of select="$browserTitle"/>
  184. </dp:title>
  185. <dp:description>
  186. <rdb:description>
  187. <className><xts:string id="IDS_OBJ_METRICSDATASOURCEETLTASK_LC"/></className>
  188. <shortVersion>true</shortVersion>
  189. </rdb:description>
  190. </dp:description>
  191. </dp:header>
  192. <lyt:layout style="1">
  193. <lyt:section>
  194. <div>
  195. <rdb:nowOrLater/>
  196. </div>
  197. </lyt:section>
  198. </lyt:layout>
  199. <ut:metricsImportOptionsSummaryUI/>
  200. <!-- footer -->
  201. <dp:footer>
  202. <df:button df:id="IDS_OTHERRUN_RUN" df:style="href" df:href="javascript:runReport();"/>
  203. <xsl:choose>
  204. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  205. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  206. </xsl:when>
  207. <xsl:otherwise>
  208. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  209. </xsl:otherwise>
  210. </xsl:choose>
  211. </dp:footer>
  212. </utml:form>
  213. </dp:page>
  214. </xsl:template>
  215. <cp:tabControl/>
  216. </xsl:stylesheet>
  217. </xts:block>
  218. <!--
  219. ===============================================================================================
  220. debug - display debug information
  221. ===============================================================================================
  222. -->
  223. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  224. <!-- Get the debug logic sheet -->
  225. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  226. <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">
  227. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  228. <xsl:template match="/">
  229. <dbg:dumpxml select="/root"/>
  230. </xsl:template>
  231. </xsl:stylesheet>
  232. </xts:block>
  233. </xts:morphlet>