view_events.xts 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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, 2011
  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" requiredCapability="canUseScheduling">
  13. <!-- form logic stuff ============================================================== -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--
  16. ===============================================================================================
  17. Load object actions map
  18. ===============================================================================================
  19. -->
  20. <xts:block id="getActions" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  21. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_actions.xslt"/>
  22. </xts:block>
  23. <!--
  24. ===============================================================================================
  25. doActions - Perform the cancel, release and suspend actions
  26. ===============================================================================================
  27. -->
  28. <xts:block id="doActions" processor="XSLT" type="exec" dependency="formlogic_init" mandatory="false" condition=".[/root/env/param[@name='action']!='']">
  29. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  30. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  31. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  32. xmlns:es="http://developer.cognos.com/schemas/eventManagementService/1"
  33. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  34. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  35. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  36. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  37. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  38. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  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. <xts:append>
  44. <actionResponse>
  45. <send:request provider="eventManagementService">
  46. <xsl:choose>
  47. <xsl:when test="key('env-param','action')='cancel'">
  48. <es:cancelEvents>
  49. <xsl:call-template name="requestBody"/>
  50. </es:cancelEvents>
  51. </xsl:when>
  52. <xsl:when test="key('env-param','action')='schedule'">
  53. <es:scheduleEvents>
  54. <xsl:call-template name="requestBody"/>
  55. </es:scheduleEvents>
  56. </xsl:when>
  57. </xsl:choose>
  58. </send:request>
  59. </actionResponse>
  60. </xts:append>
  61. <xts:delete select="/root/env/param[@name='action' or starts-with(@name,'checkbox_')]"/>
  62. </xts:sequence>
  63. </xsl:template>
  64. <xsl:template name="requestBody">
  65. <eventIDs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[{count(/root/env/param[starts-with(@name,'checkbox_')])}]">
  66. <xsl:for-each select="/root/env/param[starts-with(@name,'checkbox_')]">
  67. <item xsi:type="xsd:string"><xsl:value-of select="."/></item>
  68. </xsl:for-each>
  69. </eventIDs>
  70. </xsl:template>
  71. </xsl:stylesheet>
  72. </xts:block>
  73. <!--
  74. ===============================================================================================
  75. ckFilterChange:
  76. When the filter changes, the 'm_page' vpa variables must be deleted before recalculating maxObjects and skipObjects.
  77. ===============================================================================================
  78. -->
  79. <xts:block id="ckFilterChange" processor="XSLT" type="exec" dependency="doActions" mandatory="false" condition=".[/root/env/param[@name = 'm_vpaFilterChange'] and .[/root/env/param[@name = 'm_vpaFilterChange'] ='true']]">
  80. <xsl:stylesheet xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  81. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  82. <xsl:template match="/">
  83. <xts:sequence>
  84. <xts:delete select="/root/env/param[@name='m_pagerfromvpa_pager' or @name='m_pagertovpa_pager' or @name='m_pagerfrom_dvpa_pager' or @name='m_pagerto_dvpa_pager' or @name='m_vpa_pagersection' or @name='m_pg_evpa_pager' or @name='m_vpaFilterChange']"/>
  85. </xts:sequence>
  86. </xsl:template>
  87. </xsl:stylesheet>
  88. </xts:block>
  89. <!--
  90. ===============================================================================================
  91. getContent
  92. ===============================================================================================
  93. -->
  94. <xts:block id="getContent" type="exec" mode="interpret" processor="XSLT" dependency="doActions ckFilterChange"
  95. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  96. xmlns:pf="http://developer.cognos.com/schemas/xts/pf">
  97. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  98. <xts:logicsheet path="logicsheets/portal.xsl"/>
  99. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  100. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  101. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  102. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  103. <pf:variables/>
  104. <xsl:variable name="selectDate">
  105. <xsl:choose>
  106. <xsl:when test="key('env-param','p_selectDay')">
  107. <xsl:value-of select="key('env-param', 'p_selectDay')"/>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <xsl:value-of select="substring-before(xtsext:getCurrentDateTime(string($timeZone)), 'T')"/>
  111. </xsl:otherwise>
  112. </xsl:choose>
  113. </xsl:variable>
  114. <!-- Beginning of the selected day.-->
  115. <xsl:variable name="from">
  116. <xsl:value-of select="xtsext:formatDateToUTC(string(concat($selectDate, 'T', '00:00:00')), string($timeZone))"/>
  117. </xsl:variable>
  118. <!-- End of the selected day.-->
  119. <xsl:variable name="to">
  120. <xsl:value-of select="xtsext:formatDateToUTC(string(concat($selectDate, 'T', '23:59:59')), string($timeZone))"/>
  121. </xsl:variable>
  122. <!-- TODO: Implement support for sorting -->
  123. <xsl:variable name="sort_order">
  124. <xsl:choose>
  125. <xsl:when test="key('env-param', 's_vpa') = 'rd'">descending</xsl:when>
  126. <xsl:otherwise>ascending</xsl:otherwise>
  127. </xsl:choose>
  128. </xsl:variable>
  129. <xsl:variable name="userPrefs" select="/root/session/param"/>
  130. <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
  131. <xsl:variable name="maxObjects">
  132. <xsl:choose>
  133. <xsl:when test="string(/root/env/param[@name = 'm_pagertovpa_pager']) !='' and string(/root/env/param[@name = 'm_pagerfromvpa_pager']) !=''"><xsl:value-of select="(/root/env/param[@name = 'm_pagertovpa_pager'] - /root/env/param[@name = 'm_pagerfromvpa_pager']) + 1"/></xsl:when>
  134. <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
  135. <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
  136. </xsl:when>
  137. <xsl:otherwise>
  138. <xsl:value-of select="$userPrefsDefault/pref[@name='lines']"/>
  139. </xsl:otherwise>
  140. </xsl:choose>
  141. </xsl:variable>
  142. <xsl:variable name="skipObjects">
  143. <xsl:choose>
  144. <xsl:when test="/root/env/param[@name = 'm_pagerfromvpa_pager'] and /root/env/param[@name = 'm_pagerfromvpa_pager']!=''">
  145. <xsl:value-of select="(/root/env/param[@name = 'm_pagerfromvpa_pager'])-1"/>
  146. </xsl:when>
  147. <xsl:when test="/root/env/param[@name='m_vpa_pagersection']!=''">
  148. <xsl:value-of select="((/root/env/param[@name='m_vpa_pagersection']) - 1)"/>
  149. </xsl:when>
  150. <xsl:otherwise>0</xsl:otherwise>
  151. </xsl:choose>
  152. </xsl:variable>
  153. <xsl:template match="/">
  154. <xts:sequence>
  155. <xts:append>
  156. <send:request provider="eventManagementService">
  157. <bus:queryEvents xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  158. <options xsi:type="bus:queryEventsOptions">
  159. <startTime xsi:type="xsd:dateTime"><xsl:value-of select="$from"/></startTime>
  160. <endTime xsi:type="xsd:dateTime"><xsl:value-of select="$to"/></endTime>
  161. <order xsi:type="bus:orderEnum"><xsl:value-of select="$sort_order"/></order>
  162. <xsl:choose>
  163. <xsl:when test="not(key('env-param', 'queryEventsStatus')) or key('env-param', 'queryEventsStatus')='allStatuses'">
  164. <status xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]">
  165. <item xsi:type="xsd:string">cancelled</item>
  166. <item xsi:type="xsd:string">scheduled</item>
  167. </status>
  168. </xsl:when>
  169. <xsl:otherwise>
  170. <status xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
  171. <item xsi:type="xsd:string"><xsl:value-of select="key('env-param', 'queryEventsStatus')"/></item>
  172. </status>
  173. </xsl:otherwise>
  174. </xsl:choose>
  175. <refProps xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:eventRefProp[1]">
  176. <item xsi:type="bus:eventRefProp">
  177. <refPropName xsi:type="bus:eventRefPropEnum">runnable</refPropName>
  178. <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[5]">
  179. <item xsi:type="bus:propEnum">searchPath</item>
  180. <item xsi:type="bus:propEnum">ancestors</item>
  181. <item xsi:type="bus:propEnum">defaultName</item>
  182. <item xsi:type="bus:propEnum">defaultOutputFormat</item>
  183. <item xsi:type="bus:propEnum">objectClass</item>
  184. <item xsi:type="bus:propEnum">defaultScreenTip</item>
  185. <item xsi:type="bus:propEnum">base</item>
  186. </properties>
  187. </item>
  188. </refProps>
  189. <skipObjects xsi:type="xsd:int"><xsl:value-of select="$skipObjects"/></skipObjects>
  190. <maxObjects xsi:type="xsd:int"><xsl:value-of select="$maxObjects+1"/></maxObjects>
  191. </options>
  192. </bus:queryEvents>
  193. </send:request>
  194. </xts:append>
  195. <xts:delete select="/root/env/param[@name='pagerfromvpa_pager']"/>
  196. <xts:delete select="/root/env/param[@name='pagertovpa_pager']"/>
  197. <xts:delete select="/root/env/param[@name='pagerfrom_dvpa_pager']"/>
  198. <xts:delete select="/root/env/param[@name='pagerto_dvpa_pager']"/>
  199. </xts:sequence>
  200. </xsl:template>
  201. </xsl:stylesheet>
  202. </xts:block>
  203. <!--
  204. ===============================================================================================
  205. transformAncestor - This is needed since do-the-path-link expects the structure produced by our post-process. We only need
  206. to process the ancestor element, so simply copy the output of the transform into the DOM
  207. ===============================================================================================
  208. -->
  209. <xts:block id="transformAncestor" dependency="getContent" mode="interpret" processor="XSLT" type="exec">
  210. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  211. <xts:logicsheet path="logicsheets/portal.xsl"/>
  212. <xsl:stylesheet version="1.0"
  213. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  214. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  215. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  216. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  217. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  218. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  219. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  220. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  221. <pf:variables/>
  222. <xsl:template match="/">
  223. <xts:sequence>
  224. <xts:append>
  225. <ancestors>
  226. <xsl:for-each select="/root/bus:queryEventsResponse/*/item">
  227. <ancestor>
  228. <xsl:if test="runnable/item/ancestors">
  229. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  230. <xsl:copy-of select="runnable/item/ancestors"/>
  231. </xts:transform>
  232. </xsl:if>
  233. </ancestor>
  234. </xsl:for-each>
  235. </ancestors>
  236. </xts:append>
  237. </xts:sequence>
  238. </xsl:template>
  239. </xsl:stylesheet>
  240. </xts:block>
  241. <!--
  242. ===============================================================================================
  243. format - Render the page. It's a dialog page with Close button.
  244. ===============================================================================================
  245. -->
  246. <xts:block id="format" mode="output" processor="XSLT" type="exec" dependency=" transformAncestor getActions " mimeType="text/html"
  247. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  248. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  249. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  250. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  251. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  252. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  253. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  254. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  255. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  256. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/">
  257. <!-- logicsheets -->
  258. <!-- portal specific information -->
  259. <xts:logicsheet path="logicsheets/portal.xsl"/>
  260. <!-- Dialog specific logicsheets -->
  261. <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
  262. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  263. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  264. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  265. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  266. <!-- Generic logicsheets -->
  267. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  268. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  269. <!-- apply the form logic -->
  270. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  271. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  272. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  273. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  274. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  275. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  276. exclude-result-prefixes="bus xts xsl pf xtsext lyt dp df cf cp utml">
  277. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  278. <!-- Global template variables -->
  279. <pf:variables/>
  280. <mf:variables stateParams="p_selectDay backURL"/>
  281. <xsl:variable name="mname" select="'view_events.xts'"/>
  282. <xsl:variable name="cmd-form" select="'cform'"/> <!-- Required -->
  283. <xsl:variable name="edit-form" select="'pform'"/>
  284. <xsl:variable name="promptLocale" select="$productLocale"/>
  285. <xsl:variable name="promptFormName" select="$edit-form"/>
  286. <xsl:variable name="promptBrowserMode">
  287. <xsl:choose>
  288. <xsl:when test="$browser = 'ie' ">IE5</xsl:when>
  289. <xsl:when test="$browser = 'moz' ">NS6</xsl:when>
  290. <xsl:when test="$browser = 'safari' ">safari</xsl:when>
  291. <xsl:otherwise>NS4</xsl:otherwise>
  292. </xsl:choose>
  293. </xsl:variable>
  294. <xsl:variable name="skin" select="key('user-param', 'skin')"/>
  295. <!-- Prompt Control XSL include -->
  296. <xsl:include href="p_include.xsl"/>
  297. <xsl:variable name="today">
  298. <xsl:value-of select="substring-before(xtsext:getCurrentDateTime(string($timeZone)), 'T')"/>
  299. </xsl:variable>
  300. <xsl:variable name="selectDate">
  301. <xsl:choose>
  302. <xsl:when test="key('env-param','p_selectDay')">
  303. <xsl:value-of select="key('env-param', 'p_selectDay')"/>
  304. </xsl:when>
  305. <xsl:otherwise>
  306. <xsl:value-of select="$today"/>
  307. </xsl:otherwise>
  308. </xsl:choose>
  309. </xsl:variable>
  310. <xsl:template match="/root">
  311. <xsl:variable name="browserTitle">
  312. <xts:string id="IDS_VPA_TITLE"/>
  313. </xsl:variable>
  314. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  315. <mf:head/>
  316. <dp:meta>
  317. <pf:meta/>
  318. <!-- Standard meta tags -->
  319. </dp:meta>
  320. <dp:script>
  321. <pf:help context=""/>
  322. <!-- Help system -->
  323. <script language="javascript">
  324. function doApplyFilter()
  325. {
  326. var form = document.pform;
  327. <!-- reset the pager to the first page -->
  328. if(form.m_vpa_pagersection)
  329. {
  330. form.m_vpa_pagersection.value = '';
  331. }
  332. if(form.m_vpaFilterChange)
  333. form.m_vpaFilterChange.value = 'true';
  334. form.m.value = "<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>";
  335. form.submit();
  336. }
  337. function doAction( action )
  338. {
  339. var frm = document.pform;
  340. var items = frm.elements.length;
  341. var selected = 'false';
  342. for (var i=0; i&lt;items; i++)
  343. {
  344. if (frm.elements[i].name)
  345. {
  346. if (frm.elements[i].name.substring(0,9) == "checkbox_" &amp;&amp; frm.elements[i].checked)
  347. {
  348. selected = 'true';
  349. }
  350. }
  351. }
  352. if (selected == 'false')
  353. {
  354. alert("<xts:string id="IDS_ERR_NO_SELECTION" encode="javascript"/>");
  355. return;
  356. }
  357. <!-- Perform the action -->
  358. frm.action.value = action;
  359. frm.m.value = "<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>";
  360. frm.backURL.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'backURL')))"/>";
  361. frm.submit();
  362. }
  363. </script>
  364. <script language="javascript">
  365. <xsl:attribute name="src">
  366. <xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>/js/list.js<xsl:text/>
  367. </xsl:attribute>
  368. </script>
  369. </dp:script>
  370. <!-- Get date control includes -->
  371. <xsl:call-template name="getPromptCommonIncludes">
  372. <xsl:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  373. </xsl:call-template>
  374. <xsl:call-template name="getselectDateTimeIncludes">
  375. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  376. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  377. <xsl:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  378. </xsl:call-template>
  379. <utml:form name="pform" method="post" action="{$gateway}">
  380. <utml:excludes>p_selectDay queryEventsStatus</utml:excludes>
  381. <utml:excludes>txtDatedateFrom</utml:excludes>
  382. <!-- To track filter change so we can delete 'm_pager' values -->
  383. <utml:input type="hidden" name="m_vpaFilterChange" utml:update="false">
  384. <utml:value>
  385. <xsl:value-of select="'false'"/>
  386. </utml:value>
  387. </utml:input>
  388. <utml:input type="hidden" name="action" value="" utml:update="false"/>
  389. <!-- dialog header -->
  390. <dp:header>
  391. <!-- header titles-->
  392. <dp:title showName="false">
  393. <xsl:value-of select="$browserTitle"/>
  394. </dp:title>
  395. <dp:description>
  396. <xts:string id="IDS_VPA_DESCRIPTION"/>
  397. </dp:description>
  398. </dp:header>
  399. <lyt:layout style="2" border="no">
  400. <lyt:section>
  401. <!-- Filter section -->
  402. <dp:input>
  403. <dp:section1>
  404. <dp:text>
  405. <xts:string id="IDS_VPA_FILTER_DAY"/>
  406. </dp:text>
  407. </dp:section1>
  408. <dp:section2>
  409. <dp:field width="200">
  410. <!-- Render a select date prompt-->
  411. <xsl:call-template name="getSelectDate">
  412. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  413. <xsl:with-param name="promptTimeZone" select="$timeZone"/>
  414. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  415. <xsl:with-param name="promptRequired" select="'false'"/>
  416. <xsl:with-param name="promptStartOfWeek" select="'Sunday'"/>
  417. <xsl:with-param name="promptCalendar" select="'Gregorian'"/>
  418. <xsl:with-param name="promptParameter" select="'selectDay'"/>
  419. <xsl:with-param name="promptSelectDateUI" select="'editBox'"/>
  420. <xsl:with-param name="promptInputOrder" select="'YMD'"/>
  421. <xsl:with-param name="promptFirstDate" select="$today"/>
  422. <xsl:with-param name="promptDefaultDate" select="$selectDate"/>
  423. <xsl:with-param name="promptDateTime" select="'false'"/>
  424. <xsl:with-param name="promptMultiSelect" select="'false'"/>
  425. <xsl:with-param name="promptId" select="'dateFrom'"/>
  426. <xsl:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  427. <xsl:with-param name="suppressDisabled" select="'true'"/>
  428. <xsl:with-param name="promptSelectUI" select="'editBox'"/> <xsl:with-param name="promptHideAdornments" select="'true'"/>
  429. </xsl:call-template>
  430. </dp:field>
  431. </dp:section2>
  432. </dp:input>
  433. </lyt:section>
  434. <lyt:section>
  435. <xsl:variable name="filterStatus" select="key('env-param', 'queryEventsStatus')"/>
  436. <dp:input>
  437. <!-- status filder -->
  438. <dp:section1>
  439. <dp:text>
  440. <xts:string id="IDS_FILTER_STATUS"/>
  441. </dp:text>
  442. </dp:section1>
  443. <dp:section2>
  444. <dp:field>
  445. <utml:select name="queryEventsStatus" size="1">
  446. <utml:option value="allStatuses">
  447. <xsl:if test="not($filterStatus) or ($filterStatus = 'allStatuses')">
  448. <xsl:attribute name="selected">selected</xsl:attribute>
  449. </xsl:if>
  450. <xts:string id="IDS_JOB_STATUS_ALL"/>
  451. </utml:option>
  452. <utml:option value="cancelled">
  453. <xsl:if test="$filterStatus = 'cancelled'">
  454. <xsl:attribute name="selected">selected</xsl:attribute>
  455. </xsl:if>
  456. <xts:string id="IDS_JOB_STATUS_CANCELLED"/>
  457. </utml:option>
  458. <utml:option value="scheduled">
  459. <xsl:if test="$filterStatus = 'scheduled'">
  460. <xsl:attribute name="selected">selected</xsl:attribute>
  461. </xsl:if>
  462. <xts:string id="IDS_JOB_STATUS_SCHEDULED"/>
  463. </utml:option>
  464. </utml:select>
  465. </dp:field>
  466. </dp:section2>
  467. </dp:input>
  468. </lyt:section>
  469. </lyt:layout>
  470. <lyt:layout style="1" border="no">
  471. <lyt:section align="center" width="100%">
  472. <dp:buttonGroup>
  473. <dp:button>
  474. <a href="javascript:doApplyFilter();">
  475. <dp:buttonText>
  476. <xsl:text/><xts:string id="IDS_APPLY"/> <xsl:text/>
  477. <img height="16" width="16" border="0" align="absMiddle">
  478. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_down.gif</xsl:attribute>
  479. <xsl:attribute name="alt"><xts:string id="IDS_APPLY"/></xsl:attribute>
  480. </img>
  481. </dp:buttonText>
  482. </a>
  483. </dp:button>
  484. </dp:buttonGroup>
  485. </lyt:section>
  486. <!-- Results section -->
  487. <lyt:section>
  488. <utml:input type="hidden" name="s_vpa"/>
  489. <!-- noPosition attribute is required for proper pager functionality when it is a virtual page and request does not contain position property -->
  490. <cf:main-pager-section name="vpa_pager" form="pform" virtualPage="true" width="100%" noPosition="true" noEntriesMsgID="IDS_VPA_NO_RESULTS">
  491. <cf:param name="item-path">/root/bus:queryEventsResponse/*/item</cf:param>
  492. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  493. <cf:param name="lines-per-page">
  494. <xsl:value-of select="key('session-param', 'linesPerPage')"/>
  495. </cf:param>
  496. <cf:param name="actions">
  497. <cp:action>
  498. <a href="#" onclick="javascript:doAction('cancel')"><xts:string id="IDS_CANCEL"/></a>
  499. </cp:action>
  500. <cp:action>
  501. <a href="#" onclick="javascript:doAction('schedule')"><xts:string id="IDS_ACT_SCHEDULE"/></a>
  502. </cp:action>
  503. </cf:param>
  504. <cf:param name="rows">
  505. <cp:tableHeader session-name="s_vpa" sort_track_type="page">
  506. <!-- Checkbox column -->
  507. <cp:columnHeader width="16" toggleName="checkbox_"/>
  508. <!-- Icon Column -->
  509. <cp:columnHeader width="20"/>
  510. <!-- Path-Name Column -->
  511. <cp:columnHeader width="200">
  512. <!-- All of this is to align the header (...> Name) with the contents of the table-->
  513. <img height="5" width="1" border="0" src="{$webcontent}/images/space.gif"/>
  514. <xsl:text/><xts:string id="IDS_PATH_INDICATOR"/><xsl:text>&#160;</xsl:text>
  515. <img height="5" width="1" border="0" src="{$webcontent}/images/space.gif"/>
  516. <xsl:text/><xts:string id="IDS_NAME"/><xsl:text/>
  517. </cp:columnHeader>
  518. <!-- Task Requested Column -->
  519. <cp:columnHeader width="200" sort="r">
  520. <cp:sortHref>
  521. <xsl:text>javascript:document.pform.s_vpa.value=</xsl:text>
  522. <xsl:choose>
  523. <xsl:when test="key('env-param', 's_vpa') = 'rd' ">"ra"</xsl:when>
  524. <xsl:otherwise>"rd"</xsl:otherwise>
  525. </xsl:choose>
  526. <xsl:text>;document.pform.submit();</xsl:text>
  527. </cp:sortHref>
  528. <xts:string id="IDS_HEADING_REQEXECTIME"/>
  529. </cp:columnHeader>
  530. <!-- Status Column -->
  531. <cp:columnHeader width="100%">
  532. <xts:string id="IDS_HEADING_STATUS"/>
  533. </cp:columnHeader>
  534. </cp:tableHeader>
  535. <cp:tableContent>
  536. <!-- a couple of useful variables to point to the runnable -->
  537. <xsl:variable name="runnable" select="runnable/item"/>
  538. <xsl:variable name="position" select="position()"/>
  539. <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
  540. <xsl:variable name="path" select="$runnable/searchPath/value"/>
  541. <!-- For personal folder destinations, render the path starting at the directory/namespace/account/folder ancestor. -->
  542. <xsl:variable name="rootPath">
  543. <xsl:if test="starts-with($path, '~') or (/root/session/param[@name='e_hp'] and starts-with($path, /root/session/param[@name='e_hp']) )">
  544. <xsl:value-of select="concat(/root/session/param[@name='e_hp'], '/folder')"/>
  545. </xsl:if>
  546. </xsl:variable>
  547. <!-- Create tooltip using defaultName and defaultScreenTip. -->
  548. <xsl:variable name="toolTip">
  549. <xsl:choose>
  550. <xsl:when test="$runnable/defaultScreenTip/value=''">
  551. <xsl:value-of select="$runnable/defaultName/value"/>
  552. </xsl:when>
  553. <xsl:otherwise>
  554. <xsl:value-of select="concat($runnable/defaultName/value,' - ',$runnable/defaultScreenTip/value )"/>
  555. </xsl:otherwise>
  556. </xsl:choose>
  557. </xsl:variable>
  558. <!-- checkbox column -->
  559. <cp:columnContent position="start">
  560. <input type="checkbox" value="{xtsext:urlencode(string(*[local-name()='eventID']))}" name="checkbox_{position()}"/>
  561. </cp:columnContent>
  562. <!-- Icon Column -->
  563. <cp:columnContent>
  564. <xsl:variable name="baseClass">
  565. <xsl:choose>
  566. <xsl:when test="contains(string($runnable/base/value/item/@xsi:type),':')">
  567. <xsl:value-of select="substring-after($runnable/base/value/item/@xsi:type, ':')"/>
  568. </xsl:when>
  569. <xsl:otherwise>
  570. <xsl:value-of select="string($runnable/base/value/item/@xsi:type)"/>
  571. </xsl:otherwise>
  572. </xsl:choose>
  573. </xsl:variable>
  574. <xsl:call-template name="gen-icon">
  575. <xsl:with-param name="showAction" select="false()"/>
  576. <xsl:with-param name="class" select="$runnable/objectClass/value"/>
  577. <xsl:with-param name="isDangling" select="not($runnable/base/*) and ($runnable/base)"/>
  578. <xsl:with-param name="tooltipOverride" select="$toolTip"/>
  579. <xsl:with-param name="baseClass" select="$baseClass"/>
  580. </xsl:call-template>
  581. </cp:columnContent>
  582. <!-- Path-Name Column -->
  583. <cp:columnContent>
  584. <img height="16" width="20" align="absmiddle" src="{$skin_images}path.gif">
  585. <xsl:attribute name="alt">
  586. <cf:do-the-path-link>
  587. <cf:param name="familytree">/root/ancestors/ancestor[position()=$position]/cm:ancestors</cf:param>
  588. <cf:param name="familymember">$runnable/defaultName/value</cf:param>
  589. <cf:param name="home"><xsl:value-of select="$rootPath"/></cf:param>
  590. <cf:param name="onlyAncestors">true</cf:param>
  591. </cf:do-the-path-link> </xsl:attribute>
  592. </img>
  593. <xsl:text> </xsl:text>
  594. <xsl:value-of select="$runnable/defaultName"/>
  595. </cp:columnContent>
  596. <!-- Task Requested Column -->
  597. <cp:columnContent>
  598. <xsl:choose>
  599. <xsl:when test="string-length(requestedStartTime)=0">
  600. <xsl:text/>
  601. </xsl:when>
  602. <xsl:otherwise>
  603. <xsl:value-of select="xtsext:formatDateFromUTC( string( normalize-space(requestedStartTime)), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  604. </xsl:otherwise>
  605. </xsl:choose>
  606. </cp:columnContent>
  607. <!-- Status Column -->
  608. <cp:columnContent>
  609. <xsl:choose>
  610. <xsl:when test="*[local-name()='status']='cancelled'">
  611. <xts:string id="IDS_JOB_STATUS_CANCELLED"/>
  612. </xsl:when>
  613. <xsl:otherwise>
  614. <xts:string id="IDS_JOB_STATUS_SCHEDULED"/>
  615. </xsl:otherwise>
  616. </xsl:choose>
  617. </cp:columnContent>
  618. </cp:tableContent>
  619. </cf:param>
  620. </cf:main-pager-section>
  621. </lyt:section>
  622. </lyt:layout>
  623. <dp:footer>
  624. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  625. </dp:footer>
  626. </utml:form>
  627. <form name="cform" method="post" action="{$gateway}">
  628. <mf:cmd-vars/>
  629. </form>
  630. </dp:page>
  631. </xsl:template>
  632. <!-- Insert common templates -->
  633. <mt:actions mode="tools"/>
  634. <pf:gen-icon/>
  635. </xsl:stylesheet>
  636. </xts:block>
  637. <!--======================================================================
  638. Name: debug
  639. Comments: display the debug info.
  640. ======================================================================-->
  641. <xts:block id="debug" dependency="format" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  642. <!-- get the debug logic sheet -->
  643. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  644. <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">
  645. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  646. <xsl:template match="/">
  647. <dbg:dumpxml select="/root"/>
  648. </xsl:template>
  649. </xsl:stylesheet>
  650. </xts:block>
  651. </xts:morphlet>