jobDefinition.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. <xsl:variable name="userPrefs" select="/root/session/param"/>
  43. <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
  44. <xsl:variable name="maxObjects">
  45. <xsl:choose>
  46. <xsl:when test="string(key('env-param','m_pagertotasks')) !='' and string(key('env-param','m_pagerfromtasks')) !=''">
  47. <xsl:value-of select="(key('env-param','m_pagertotasks') - key('env-param','m_pagerfromtasks')) + 1"/>
  48. </xsl:when>
  49. <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
  50. <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
  51. </xsl:when>
  52. <xsl:otherwise>
  53. <xsl:value-of select="userPrefsDefault/pref[@name='lines']"/>
  54. </xsl:otherwise>
  55. </xsl:choose>
  56. </xsl:variable>
  57. <xsl:variable name="skipObjects">
  58. <xsl:choose>
  59. <xsl:when test="key('env-param','m_pagerfromtasks') and key('env-param','m_pagerfromtasks')!=''">
  60. <xsl:value-of select="key('env-param','m_pagerfromtasks')-1"/>
  61. </xsl:when>
  62. <xsl:when test="key('env-param','m_taskssection')!=''">
  63. <xsl:choose>
  64. <xsl:when test="key('env-param','m_taskssection')!='-1'">
  65. <xsl:value-of select="(key('env-param','m_taskssection') -1)"/>
  66. </xsl:when>
  67. <xsl:otherwise>
  68. <xsl:value-of select="($maxObjects) * -1"/>
  69. </xsl:otherwise>
  70. </xsl:choose>
  71. </xsl:when>
  72. <xsl:otherwise>0</xsl:otherwise>
  73. </xsl:choose>
  74. </xsl:variable>
  75. <xts:sequence>
  76. <rdr:Requests>
  77. <rdr:Request type="runnable">
  78. <rdr:searchPath>
  79. <xsl:value-of select="key('env-param', 'm_obj')"/>
  80. </rdr:searchPath>
  81. </rdr:Request>
  82. <rdr:Request type="steps" mode="job">
  83. <rdr:searchPath>
  84. <xsl:value-of select="key('env-param', 'm_obj')"/>
  85. </rdr:searchPath>
  86. <rdr:maxObjects><xsl:value-of select="$maxObjects+1"/></rdr:maxObjects>
  87. <rdr:skipObjects><xsl:value-of select="$skipObjects"/></rdr:skipObjects>
  88. </rdr:Request>
  89. <rdr:Request type="credential"/>
  90. <rdr:Request type="accountOptions"/>
  91. <xsl:if test="key('env-param','from_schedule_tool') = 'true'">
  92. <rdr:Request type="schedule">
  93. <rdr:searchPath>
  94. <xsl:value-of select="key('env-param', 'm_obj')"/>
  95. <xsl:text>/schedule[permission("read")]</xsl:text>
  96. </rdr:searchPath>
  97. </rdr:Request>
  98. </xsl:if>
  99. </rdr:Requests>
  100. </xts:sequence>
  101. <!-- Every time the page is reloaded, delete the following pager parameters from the /root/env. This is required for the pager to work properly. -->
  102. <xts:sequence>
  103. <xts:delete select="/root/env/param[@name='pagerfromtasks']"/>
  104. <xts:delete select="/root/env/param[@name='pagertotasks']"/>
  105. <xts:delete select="/root/env/param[@name='pagerfrom_dtasks']"/>
  106. <xts:delete select="/root/env/param[@name='pagerto_dtasks']"/>
  107. </xts:sequence>
  108. </xsl:template>
  109. </xsl:stylesheet>
  110. </xts:block>
  111. <!--
  112. ===============================================================================================
  113. generateDefaults - generate any required default values
  114. ===============================================================================================
  115. -->
  116. <xts:block id="generateDefaults" processor="XSLT" type="exec" dependency="getContent">
  117. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  118. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  119. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  120. <xsl:variable name="the-account" select="/root/cm:queryResponse/cm:queryReply[4]/cm:account"/>
  121. <xsl:template match="/">
  122. <xts:sequence>
  123. <xts:append select="/root/env">
  124. <xts:transform src="/portal/runWithOptions/transforms/generateDefaultParams.xslt" processor="XSLT">
  125. <root>
  126. <xsl:copy-of select="/root/env"/>
  127. <xsl:copy-of select="/root/user"/>
  128. <xsl:copy-of select="/root/system"/>
  129. <xsl:copy-of select="$the-account"/>
  130. </root>
  131. </xts:transform>
  132. </xts:append>
  133. </xts:sequence>
  134. </xsl:template>
  135. </xsl:stylesheet>
  136. </xts:block>
  137. <!--
  138. ===============================================================================================
  139. getObjects - get object class names
  140. ===============================================================================================
  141. -->
  142. <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  143. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  144. </xts:block>
  145. <!--
  146. ===============================================================================================
  147. Render the HTML page
  148. ===============================================================================================
  149. -->
  150. <xts:block id="renderPage" dependency="formlogic_init generateDefaults classNames" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  151. <xts:logicsheet path="portal/runWithOptions/logicsheets/response.xslt"/>
  152. <!-- portal specific information -->
  153. <xts:logicsheet path="logicsheets/portal.xsl"/>
  154. <!-- Dialog specific logicsheets -->
  155. <xts:logicsheet path="logicsheets/presentation/dialog/recurrenceUI.xslt"/>
  156. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  157. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  158. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  159. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  160. <xts:logicsheet path="portal/schedule/logicsheets/scheduleVars.xsl"/>
  161. <!-- Generic logicsheets -->
  162. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  163. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  164. <!-- apply the form logic -->
  165. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  166. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  167. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  168. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb/"
  169. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  170. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  171. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/"
  172. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  173. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  174. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  175. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  176. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  177. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  178. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  179. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  180. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  181. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  182. xmlns:x="x"
  183. exclude-result-prefixes="xsl lyt dp df cp cf cm bus utml xtsext xts">
  184. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  185. <!-- current file name -->
  186. <xsl:variable name="mname" select="'runWithOptions/jobDefinition.xts'"/>
  187. <xsl:variable name="m_class" select="/root/env/param[@name = 'm_class']"/>
  188. <xsl:variable name="back-url" select="key('env-param','backURL')"/>
  189. <!-- add any theme variables -->
  190. <pf:variables/>
  191. <pf:gen-icon/>
  192. <rui:variables/>
  193. <!-- include date control stylesheet and declare any vairables needed -->
  194. <rui:promptControls form="pform"/>
  195. <!-- references to the various objects queried from CM -->
  196. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  197. <xsl:variable name="the-steps" select="/root/cm:queryResponse/cm:queryReply[2]/*"/>
  198. <xsl:variable name="the-credential" select="/root/cm:queryResponse/cm:queryReply[3]/cm:credential"/>
  199. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[5]/cm:schedule"/>
  200. <!-- start the output -->
  201. <xsl:template match="root">
  202. <!-- Page and title -->
  203. <xsl:variable name="browserTitle">
  204. <rdb:pageTitle/>
  205. </xsl:variable>
  206. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  207. <dp:meta>
  208. <pf:meta/>
  209. <!-- Standard meta tags -->
  210. </dp:meta>
  211. <!-- include data control scripts -->
  212. <rui:promptControlsScript/>
  213. <dp:script>
  214. <pf:help context="HID_SCHEDULE_MULTIPLE"/> <!-- Help system -->
  215. <script language="javascript">
  216. function runReport()
  217. {
  218. document.pform.ps_nav_op.value = 'push';
  219. document.pform.m.value = 'portal/runWithOptions/confirm.xts';
  220. document.pform.submit();
  221. }
  222. </script>
  223. </dp:script>
  224. <utml:form name="pform" action="{$gateway}" method="post">
  225. <!-- Since the date control input variables are not utml input, they would be put into Hidden inputs whenever the page is refreshed and cause
  226. duplicate. So we exclude them from query values. -->
  227. <utml:exclusion-list>
  228. <xsl:value-of select="' p_runDate p_runTime hourstimeFrom minutestimeFrom AMPMtimeFrom txtDatedateFrom '"/>
  229. </utml:exclusion-list>
  230. <!-- this defines the form command operation to be performed when all the collected properties are submitted. -->
  231. <utml:input type="hidden" name="ifrmcmd" value='execute' utml:update="false"/>
  232. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  233. <!-- if the user doesn't have a credentail then add the h_CAM_action to create one -->
  234. <rdb:checkCredential/>
  235. <!-- Dialog header -->
  236. <dp:header>
  237. <dp:title>
  238. <xsl:copy-of select="$browserTitle"/>
  239. </dp:title>
  240. <dp:description>
  241. <rdb:description>
  242. <className><xts:string id="IDS_OBJ_JOBDEFINITION_LC"/></className>
  243. <shortVersion>true</shortVersion>
  244. </rdb:description>
  245. </dp:description>
  246. </dp:header>
  247. <lyt:layout style="1">
  248. <lyt:section>
  249. <div>
  250. <rdb:nowOrLater/>
  251. </div>
  252. </lyt:section>
  253. </lyt:layout>
  254. <lyt:layout style="1">
  255. <lyt:section>
  256. <!-- itemObject is added because there is difference between agent and job result -->
  257. <ut:taskSummaryUI objectClass="$the-object/cm:objectClass" iterate="$the-steps" itemObject="cm:stepObject"/>
  258. </lyt:section>
  259. </lyt:layout>
  260. <!-- footer -->
  261. <dp:footer>
  262. <df:button df:id="IDS_OTHERRUN_RUN" df:style="href" df:href="javascript:runReport();"/>
  263. <xsl:choose>
  264. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  265. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  266. </xsl:when>
  267. <xsl:otherwise>
  268. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  269. </xsl:otherwise>
  270. </xsl:choose>
  271. </dp:footer>
  272. </utml:form>
  273. </dp:page>
  274. </xsl:template>
  275. <cp:tabControl/>
  276. </xsl:stylesheet>
  277. </xts:block>
  278. <!--
  279. ===============================================================================================
  280. debug - display debug information
  281. ===============================================================================================
  282. -->
  283. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  284. <!-- Get the debug logic sheet -->
  285. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  286. <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">
  287. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  288. <xsl:template match="/">
  289. <dbg:dumpxml select="/root"/>
  290. </xsl:template>
  291. </xsl:stylesheet>
  292. </xts:block>
  293. </xts:morphlet>