metricsMaintenanceTask.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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, 2016
  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" resolverBase="prompting" includeConfig="true" requiredCapability="canUseScheduling">
  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/schedule/logicsheets/request.xslt"/>
  32. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  33. <xts:logicsheet path="portal/schedule/logicsheets/common.xslt"/>
  34. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  35. <xsl:stylesheet version="1.0"
  36. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  37. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  38. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  39. xmlns:cls="http://developer.cognos.com/schemas/xts/cls/"
  40. exclude-result-prefixes="xsl xtsext rdr cls">
  41. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  42. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  43. <xsl:template match="/">
  44. <xts:sequence>
  45. <rdr:Requests>
  46. <rdr:Request type="runnable" mode="cmm">
  47. <rdr:searchPath>
  48. <xsl:value-of select="key('env-param', 'm_obj')"/>
  49. </rdr:searchPath>
  50. </rdr:Request>
  51. <rdr:Request type="credential"/>
  52. <xsl:if test="not(key('env-param', 'visited_schedule_properties'))">
  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. <!-- if we have a schedule credential blob, then unpack it -->
  62. <cls:unpackCredentials/>
  63. </xts:sequence>
  64. </xsl:template>
  65. </xsl:stylesheet>
  66. </xts:block>
  67. <!--
  68. ===============================================================================================
  69. generateDefaults
  70. Produce default form fields under /root/env
  71. ===============================================================================================
  72. -->
  73. <xts:block id="generateDefaults" processor="XSLT" type="exec" dependency="getContent">
  74. <xsl:stylesheet version="1.0"
  75. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  76. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  77. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  78. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  79. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[3]/cm:schedule"/>
  80. <xsl:template match="/">
  81. <xts:sequence>
  82. <xts:append select="/root/env">
  83. <xsl:if test="not(/root/env/param[@name='visited_schedule_properties'])">
  84. <xts:transform src="/portal/schedule/transforms/generateDefaultParams.xslt" processor="XSLT">
  85. <root>
  86. <xsl:copy-of select="/root/user"/>
  87. <xsl:copy-of select="/root/env"/>
  88. <xsl:copy-of select="$the-schedule"/>
  89. </root>
  90. </xts:transform>
  91. </xsl:if>
  92. </xts:append>
  93. <xts:append select="/root/env">
  94. <xts:transform src="/portal/schedule/transforms/generateMissingParams.xslt" processor="XSLT">
  95. <xts:param name="logicsheet">/logicsheets/portal.xsl</xts:param>
  96. <root>
  97. <xsl:copy-of select="/root/user"/>
  98. <xsl:copy-of select="/root/session"/>
  99. <xts:queryNode select="/root/env"/>
  100. </root>
  101. </xts:transform>
  102. </xts:append>
  103. </xts:sequence>
  104. </xsl:template>
  105. </xsl:stylesheet>
  106. </xts:block>
  107. <!--
  108. ===============================================================================================
  109. queryCredentialInfo:
  110. Query CM for the necessary user information (default names required for UI)
  111. ===============================================================================================
  112. -->
  113. <xts:block id="queryCredentialInfo"
  114. nodelist="env,header,session,http,queryResponse,scheduleCredentials,credential,cookies"
  115. path="/portal/schedule/logicsheets/query-credential-info.xslt"
  116. processor="XSLT"
  117. type="exec"
  118. dependency="getContent">
  119. mandatory="false">
  120. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  121. <xts:logicsheet path="logicsheets/portal.xsl"/>
  122. </xts:block>
  123. <!--
  124. ===============================================================================================
  125. Render the HTML page
  126. ===============================================================================================
  127. -->
  128. <xts:block id="renderPage" type="exec" mode="output" dependency="getContent generateDefaults queryCredentialInfo" processor="XSLT" mimeType="text/html"
  129. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  130. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  131. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  132. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  133. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  134. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  135. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  136. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  137. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  138. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  139. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  140. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  141. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/">
  142. <!-- logicsheets -->
  143. <xts:logicsheet path="logicsheets/presentation/dialog/recurrenceUI.xslt"/>
  144. <!-- portal specific information -->
  145. <xts:logicsheet path="logicsheets/portal.xsl"/>
  146. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  147. <!-- Dialog specific logicsheets -->
  148. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  149. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  150. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  151. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  152. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  153. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  154. <xts:logicsheet path="portal/schedule/logicsheets/scheduleVars.xsl"/>
  155. <!-- Generic logicsheets -->
  156. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  157. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  158. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  159. <!-- apply the form logic -->
  160. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  161. <xts:logicsheet path="logicsheets/validation.xslt"/>
  162. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  163. <xsl:stylesheet version="1.0"
  164. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  165. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  166. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  167. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  168. xmlns:xIE5="http://developer.cognos.com/prompting/xIE5"
  169. exclude-result-prefixes="pf cml ut df lyt dp cf cp dc utml xts bus xtsext cm xIE5">
  170. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  171. <!-- current file name -->
  172. <xsl:variable name="mname" select="'schedule/metricsMaintenanceTask.xts'"/>
  173. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  174. <xsl:variable name="the-credential" select="/root/cm:queryResponse/cm:queryReply[2]/cm:credential"/>
  175. <xsl:variable name="the-schedule" select="/root/cm:queryResponse/cm:queryReply[3]/cm:schedule"/>
  176. <xsl:variable name="savedTriggerType" select="'schedule'"/>
  177. <!-- add any theme variables -->
  178. <pf:variables/>
  179. <rui:variables/>
  180. <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']"/>
  181. <!-- include prompt control stylesheet and variables -->
  182. <rui:promptControls form="pform"/>
  183. <xsl:template match="/">
  184. <xsl:variable name="browserTitle">
  185. <xts:string id="IDS_PROP_SCHEDULE_TITLE">
  186. <xts:param name="objectName">
  187. <span lang="{$contentLocale}"><xsl:value-of select="$the-object/cm:defaultName"/></span>
  188. </xts:param>
  189. </xts:string>
  190. </xsl:variable>
  191. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  192. <dp:meta>
  193. <pf:meta/>
  194. </dp:meta>
  195. <!-- get the JavaScript needed for the prompt controls -->
  196. <rui:promptControlsScript/>
  197. <dp:script>
  198. <pf:help context="HID_SCHEDULE"/>
  199. <!-- Help system -->
  200. <dc:confirm-cancel/>
  201. <script language="javascript">
  202. <!-- some behavior for when the page loads -->
  203. function init()
  204. {
  205. <!-- m can get clobbered when going to secondary dialogs, so make sure it has the right value -->
  206. document.pform.m.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'm')))"/>";
  207. }
  208. function onClickOK()
  209. {
  210. var frm = document.pform;
  211. if (validateSchedule())
  212. {
  213. frm.ps_nav_op.value = 'submit';
  214. frm.m.value = 'portal/submit.xts';
  215. frm.submit();
  216. }
  217. }
  218. </script>
  219. </dp:script>
  220. <utml:form name="pform" method="post" action="{$gateway}">
  221. <!-- Since the date control input variables are not utml input, they would be put into Hidden inputs whenever the page is refreshed and cause
  222. duplicate. So we exclude them from query values. -->
  223. <utml:exclusion-list>
  224. <xsl:value-of select="' txtDatedateTo txtDatedateFrom tempPath p_sched_date1 p_sched_date2 p_sched_time1 p_sched_time2 p_intradayRecurrenceStart p_intradayRecurrenceEnd hourstimeTo hourstimeFrom minutestimeTo minutestimeFrom secondstimeFrom secondstimeTo AMPMtimeTo AMPMtimeFrom visited_schedule_properties dateTotxtDate dateFromtxtDate'"/>
  225. </utml:exclusion-list>
  226. <utml:read-only>
  227. <xsl:choose>
  228. <xsl:when test="contains($the-object/cm:permissions, 'write') and contains($the-object/cm:permissions, 'execute')">
  229. <xsl:text>false</xsl:text>
  230. </xsl:when>
  231. <xsl:otherwise>
  232. <xsl:text>true</xsl:text>
  233. </xsl:otherwise>
  234. </xsl:choose>
  235. </utml:read-only>
  236. <!-- header -->
  237. <dp:header>
  238. <dp:title showName="false">
  239. <xsl:copy-of select="$browserTitle"/>
  240. </dp:title>
  241. <dp:description headerBorder="true">
  242. <xts:string id="IDS_PROP_SCHED_INTRO2"/>
  243. </dp:description>
  244. </dp:header>
  245. <utml:input type="hidden" name="m_timeZoneID">
  246. <xsl:attribute name="value">
  247. <xsl:value-of select="/root/cm:queryResponse/cm:queryReply/cm:schedule/cm:timeZoneID"/>
  248. </xsl:attribute>
  249. </utml:input>
  250. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  251. <utml:input type="hidden" name="m_scheduleCredentials">
  252. <xsl:attribute name="value"><xsl:value-of select="key('env-param','m_scheduleCredentials')"/></xsl:attribute>
  253. </utml:input>
  254. <xsl:choose>
  255. <xsl:when test="$form-read-only='true' and not($the-schedule)">
  256. <mt:objectNoneFound id="IDS_PROP_SCHED_READ_ONLY_NO_SCHED"/>
  257. </xsl:when>
  258. <xsl:otherwise>
  259. <!-- add this hidden input, its existence allows us to infer that this morphlet has been previously visited -->
  260. <input name="visited_schedule_properties" type="hidden" value="true"/>
  261. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  262. <!-- save the schedule with the user's credentials if the user has chosen to reset them or with a new schedule -->
  263. <xsl:if test="key('env-param','m_schedule_owner_reset')='true'">
  264. <xsl:choose>
  265. <xsl:when test="$userCredentialsExist='true'">
  266. <utml:input type="hidden" name="m_sp_credential" utml:update="false">
  267. <utml:value><xsl:value-of select="$userCredentialSearchPathProperty"/></utml:value>
  268. </utml:input>
  269. </xsl:when>
  270. <xsl:otherwise>
  271. <input type="hidden" name="h_CAM_action" value=""/>
  272. </xsl:otherwise>
  273. </xsl:choose>
  274. </xsl:if>
  275. <!-- Recurrence -->
  276. <rui:recurrenceUI formName="pform"/>
  277. </xsl:otherwise>
  278. </xsl:choose>
  279. <ut:metricsOtherOptionsSummaryUI/>
  280. <rui:footer/>
  281. </utml:form>
  282. </dp:page>
  283. </xsl:template>
  284. <cp:tabControl/>
  285. </xsl:stylesheet>
  286. </xts:block>
  287. <!-- Debug -->
  288. <!-- ============================================================================= -->
  289. <xts:block id="debug" dependency="renderPage" condition=".[ /root/session/param[@name='debug'] = '1' ]" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  290. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  291. <!-- debug logic sheet -->
  292. <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">
  293. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  294. <xsl:template match="/">
  295. <dbg:dumpxml select="/root"/>
  296. </xsl:template>
  297. </xsl:stylesheet>
  298. </xts:block>
  299. </xts:morphlet>