setSchedule.xts 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2009
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio,canUseScheduling">
  9. <!--
  10. ===============================================================================================
  11. processRequestParams - Default any params that weren't passed in. Also this is where we would
  12. do validation (when time permits).
  13. ===============================================================================================
  14. -->
  15. <xts:block id="processRequestParams" processor="XSLT" type="exec" nodeList="/root/*[local-name()='requestParams']">
  16. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  18. <xsl:template match="/">
  19. <xts:sequence>
  20. <xts:append select="/root/*[local-name()='requestParams']">
  21. <xts:transform src="portal/controls/gen_default_parameters.xslt" processor="XSLT">
  22. <root>
  23. <xts:transform name="XML">
  24. <xts:param name="systemId">ags/setSchedule_API.xml</xts:param>
  25. </xts:transform>
  26. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  27. </root>
  28. </xts:transform>
  29. </xts:append>
  30. </xts:sequence>
  31. </xsl:template>
  32. </xsl:stylesheet>
  33. </xts:block>
  34. <!--
  35. ===============================================================================================
  36. decodeMRPParameters - Decode the m_rp_parameters and append it to the dom.
  37. ===============================================================================================
  38. -->
  39. <xts:block id="decodeMRPParameters" type="exec" dependency="processRequestParams" processor="XSLT" condition=".[/root/env/param[@name='m_rp_parameters'] and /root/env/param[@name='m_rp_parameters']!='' and (/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'next' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'back' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled')]" mandatory="false">
  40. <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
  41. <!-- portal specific information -->
  42. <xts:logicsheet path="logicsheets/portal.xsl"/>
  43. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  44. <!-- and now the stylesheet -->
  45. <xsl:stylesheet version="1.0"
  46. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  47. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  48. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  49. xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/"
  50. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  51. xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/"
  52. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  53. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  54. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  55. exclude-result-prefixes="xsl SOAP-ENC xsi cms cm form bus xtsext pf">
  56. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  57. <xsl:key name="env-param" match="/root/env/*[local-name()='param']" use="@name"/>
  58. <pf:variables/>
  59. <xsl:template match="/">
  60. <xts:sequence>
  61. <!-- Remove any existing ones -->
  62. <xts:delete select="/root/parameters"/>
  63. <xsl:if test="key('env-param','m_rp_parameters')">
  64. <xts:append select="/root">
  65. <xts:transform name="XMLDecode">
  66. <xsl:value-of select="xtsext:web64decode(string(key('env-param','m_rp_parameters')), true())"/>
  67. </xts:transform>
  68. </xts:append>
  69. </xsl:if>
  70. </xts:sequence>
  71. </xsl:template>
  72. </xsl:stylesheet>
  73. </xts:block>
  74. <!--
  75. ===============================================================================================
  76. returnResult - We're done with the email options morphlet, so return the appropriate response
  77. ===============================================================================================
  78. -->
  79. <xts:block id="returnResult" type="exec" dependency="decodeMRPParameters" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'next' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'back' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled']" mandatory="false">
  80. <xts:logicsheet path="portal/iFrmCmd/logicsheets/cm-save.xsl"/>
  81. <!-- portal specific information -->
  82. <xts:logicsheet path="logicsheets/portal.xsl"/>
  83. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  84. <!-- and now the stylesheet -->
  85. <xsl:stylesheet version="1.0"
  86. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  87. xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  88. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  89. xmlns:cms="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cms/1/"
  90. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  91. xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/"
  92. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  93. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  94. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  95. exclude-result-prefixes="xsl SOAP-ENC xsi cms form bus xtsext pf">
  96. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  97. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  98. <pf:variables/>
  99. <xsl:template match="/">
  100. <xts:sequence>
  101. <xts:append select="/root/output">
  102. <xts:transform name="Null" option="part" mimeType="text/xml">
  103. <xsl:element name="{key('request-param','resultNode')}" >
  104. <xsl:choose>
  105. <xsl:when test="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled'">
  106. <canceled/>
  107. </xsl:when>
  108. <xsl:otherwise>
  109. <!-- place a response here -->
  110. <scheduleParameters>
  111. <item xsi:type="bus:schedule">
  112. <xsl:call-template name="build_jsm_schedule">
  113. <xsl:with-param name="env">
  114. <xsl:for-each select="/root/env/param">
  115. <form:param name="{./@name}">
  116. <xsl:value-of select="."/>
  117. </form:param>
  118. </xsl:for-each>
  119. </xsl:with-param>
  120. </xsl:call-template>
  121. <xsl:choose>
  122. <xsl:when test="/root/parameters/*">
  123. <xts:transform src="transforms/portal/parameters/pre-JSM-process.xslt" processor="XSLT">
  124. <xsl:element name="parameters" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  125. <xsl:copy-of select="/root/parameters/*"/>
  126. </xsl:element>
  127. </xts:transform>
  128. </xsl:when>
  129. <xsl:otherwise>
  130. <xsl:element name="parameters" namespace="http://developer.cognos.com/schemas/xts-cm/1/">
  131. <xsl:attribute name="xsi:type">bus:parameterValueArrayProp</xsl:attribute>
  132. </xsl:element>
  133. </xsl:otherwise>
  134. </xsl:choose>
  135. </item>
  136. </scheduleParameters>
  137. </xsl:otherwise>
  138. </xsl:choose>
  139. </xsl:element>
  140. </xts:transform>
  141. </xts:append>
  142. </xts:sequence>
  143. </xsl:template>
  144. <cms:prop-save/>
  145. </xsl:stylesheet>
  146. </xts:block>
  147. <!--
  148. ===============================================================================================
  149. processResponse - Append a fake prebuilt response. This is to create the tasks.
  150. ===============================================================================================
  151. -->
  152. <xts:block id="processResponse" type="exec" mode="interpret" processor="XSLT" dependency="returnResult" condition=".[ /root/env/param[@name = 'queryResponse'] and /root/env/param[@name = 'queryResponse'] != '' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  153. <!-- portal specific information -->
  154. <xts:logicsheet path="logicsheets/portal.xsl"/>
  155. <!-- Dialog specific logicsheets -->
  156. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  157. <xsl:stylesheet version="1.0"
  158. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  159. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  160. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  161. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  162. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  163. exclude-result-prefixes="xsl xts dt pf xtsext cm">
  164. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  165. <xsl:template match="/">
  166. <xts:sequence>
  167. <xts:append select="/root">
  168. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_dialogadapter001', string( /root/env/param[@name = 'queryResponse'])), true() )" disable-output-escaping="yes"/>
  169. </xts:append>
  170. </xts:sequence>
  171. </xsl:template>
  172. </xsl:stylesheet>
  173. </xts:block>
  174. <!--
  175. ===============================================================================================
  176. decodeScheduleParameters
  177. ===============================================================================================
  178. -->
  179. <xts:block id="decodeScheduleParameters" type="exec" mode="interpret" processor="XSLT" dependency="processResponse" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='scheduleParameters'] and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='scheduleParameters'] != '' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  180. <!-- portal specific information -->
  181. <xts:logicsheet path="logicsheets/portal.xsl"/>
  182. <!-- Dialog specific logicsheets -->
  183. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  184. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xIE5="http://developer.cognos.com/prompting/xIE5" exclude-result-prefixes="xsl xts dt pf xtsext xIE5">
  185. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  186. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  187. <xsl:template match="/">
  188. <xts:sequence>
  189. <xts:append select="/root/*[local-name()='queryResponse']">
  190. <xsl:element name="queryReply">
  191. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  192. <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
  193. <xts:transform name="XMLDecode">
  194. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','scheduleParameters'))), true())"/>
  195. </xts:transform>
  196. </xts:transform>
  197. </xts:transform>
  198. </xsl:element>
  199. </xts:append>
  200. <!-- delete the schedule parameters -->
  201. <xts:delete select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='scheduleParameters']"/>
  202. <xts:delete select="/root/env/param[@name='scheduleParameters']"/>
  203. </xts:sequence>
  204. </xsl:template>
  205. </xsl:stylesheet>
  206. </xts:block>
  207. <!--
  208. ===============================================================================================
  209. splitParameters - Append a fake prebuilt response. This is to create the tasks.
  210. ===============================================================================================
  211. -->
  212. <xts:block id="splitParameters" type="exec" mode="interpret" processor="XSLT" dependency="decodeScheduleParameters" condition=".[ /root/env/param[@name = 'queryResponse'] and /root/env/param[@name = 'queryResponse'] != '' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  213. <!-- portal specific information -->
  214. <xts:logicsheet path="logicsheets/portal.xsl"/>
  215. <!-- Dialog specific logicsheets -->
  216. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  217. <xsl:stylesheet version="1.0"
  218. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  219. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  220. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  221. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  222. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  223. exclude-result-prefixes="xsl xts dt pf xtsext cm">
  224. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  225. <xsl:key name="env-param" match="/root/env/*[local-name()='param']" use="@name"/>
  226. <xsl:template match="/">
  227. <xts:sequence>
  228. <!-- if we don't have a parameterDescription, then separate the connection/signon prompts
  229. from other prompts. -->
  230. <xsl:if test="not(/root/env/param[@name='parameterDescription'])">
  231. <dt:splitParameters queryNode="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='schedule']/*[local-name()='parameters']"/>
  232. </xsl:if>
  233. <!-- process the parameters saved on the agent -->
  234. <xsl:if test="not(key('env-param','visited_schedule_properties'))">
  235. <dt:splitRunnableParameters queryNode="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='parameters']"/>
  236. </xsl:if>
  237. </xts:sequence>
  238. </xsl:template>
  239. </xsl:stylesheet>
  240. </xts:block>
  241. <!--
  242. ===============================================================================================
  243. queryDataSourcePrompts - Get the parameter data source connection/signon information from CM
  244. ===============================================================================================
  245. -->
  246. <xts:block id="queryDataSourcePrompts"
  247. nodeList="credentialParameters"
  248. path="/portal/iPrompting/logicsheets/query-datasource.xslt"
  249. processor="XSLT"
  250. type="exec"
  251. dependency="splitParameters"
  252. condition=".[/root/credentialParameters or /root/runnableParameters/credentialParameters]"
  253. mandatory="false">
  254. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  255. </xts:block>
  256. <!--
  257. ===============================================================================================
  258. generateParameterDescription
  259. ===============================================================================================
  260. -->
  261. <xts:block id="generateParameterDescription"
  262. nodelist="env,credentialParameters,parameters,dataSources"
  263. path="/portal/iPrompting/logicsheets/gen-prompt-description.xslt"
  264. processor="XSLT"
  265. type="exec"
  266. dependency="queryDataSourcePrompts"
  267. condition=".[not(/root/env/param[@name='parameterDescription'])]"
  268. mandatory="false">
  269. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  270. </xts:block>
  271. <!--
  272. ===============================================================================================
  273. queryCredentialInfo:
  274. Query CM for the necessary user information (default names required for UI)
  275. ===============================================================================================
  276. -->
  277. <xts:block id="queryCredentialInfo"
  278. nodelist="env,header,session,http,queryResponse,scheduleCredentials,credential,cookies"
  279. path="/portal/schedule/logicsheets/query-credential-info.xslt"
  280. processor="XSLT"
  281. condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']"
  282. type="exec"
  283. dependency="generateParameterDescription"
  284. mandatory="false">
  285. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  286. <xts:logicsheet path="logicsheets/portal.xsl"/>
  287. </xts:block>
  288. <!--
  289. ===============================================================================================
  290. processScheduleDetails - This should work out which set of parameters to use, and generate the agent or the schedule parameters.
  291. ===============================================================================================
  292. -->
  293. <xts:block id="processScheduleDetails" type="exec" mode="interpret" processor="XSLT" dependency="queryCredentialInfo" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  294. <!-- portal specific information -->
  295. <xts:logicsheet path="logicsheets/portal.xsl"/>
  296. <!-- Dialog specific logicsheets -->
  297. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  298. <xsl:stylesheet version="1.0"
  299. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  300. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  301. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  302. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  303. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  304. exclude-result-prefixes="xsl xtsext dt pf cm">
  305. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  306. <pf:variables/>
  307. <xsl:template match="/">
  308. <xts:sequence>
  309. <xts:append select="/root/env">
  310. <xsl:if test="not(/root/env/param[@name='visited_schedule_properties'])">
  311. <xts:transform src="/portal/schedule/transforms/generateDefaultParams.xslt" processor="XSLT">
  312. <root>
  313. <xsl:copy-of select="/root/user"/>
  314. <xsl:copy-of select="/root/env"/>
  315. <xsl:copy-of select="/root/*[local-name()='queryResponse']//*[local-name()='schedule']"/>
  316. </root>
  317. </xts:transform>
  318. </xsl:if>
  319. </xts:append>
  320. <xts:append select="/root/env">
  321. <xts:transform src="/portal/schedule/transforms/generateMissingParams.xslt" processor="XSLT">
  322. <xts:param name="logicsheet">/logicsheets/portal.xsl</xts:param>
  323. <root>
  324. <xsl:copy-of select="/root/user"/>
  325. <xsl:copy-of select="/root/session"/>
  326. <xts:queryNode select="/root/env"/>
  327. </root>
  328. </xts:transform>
  329. </xts:append>
  330. <xsl:if test="not(/root/env/param[@name='visited_schedule_properties'])">
  331. <xts:sequence>
  332. <xts:append select="/root/env">
  333. <!-- add the necessary params for the default parameters stored on the runnable -->
  334. <xsl:if test="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='parameters']/* != ''">
  335. <xsl:variable name="default-parameters-markup">
  336. <xsl:call-template name="serialize-xml">
  337. <xsl:with-param name="node-set" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='parameters']"/>
  338. </xsl:call-template>
  339. </xsl:variable>
  340. <xsl:variable name="defaultParameters">
  341. <xsl:value-of select="xtsext:web64encode(string($default-parameters-markup), true())"/>
  342. </xsl:variable>
  343. <param name="defaultParameters"><xsl:value-of select="$defaultParameters"/></param>
  344. <dt:promptDescription params="default" checkRunnableParameters="true"/>
  345. </xsl:if>
  346. </xts:append>
  347. <!-- if we already have saved paramters on the schedule -->
  348. <xsl:if test="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='schedule']/*[local-name()='parameters']!=''">
  349. <xsl:variable name="parameters-markup">
  350. <xsl:call-template name="serialize-xml">
  351. <xsl:with-param name="node-set" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='schedule']/*[local-name()='parameters']"/>
  352. </xsl:call-template>
  353. </xsl:variable>
  354. <xts:append select="/root/env">
  355. <param name="m_rp_parameters">
  356. <xsl:value-of select="xtsext:web64encode(string($parameters-markup), true())"/>
  357. </param>
  358. <param name="override_default_parameters">true</param>
  359. </xts:append>
  360. </xsl:if>
  361. </xts:sequence>
  362. </xsl:if>
  363. </xts:sequence>
  364. </xsl:template>
  365. <dt:hierarchicalParmValueItem/>
  366. <pf:serialize-xml/>
  367. </xsl:stylesheet>
  368. </xts:block>
  369. <!--
  370. ===============================================================================================
  371. businessRules - Take care of any business logic to simplify the UI generation
  372. ===============================================================================================
  373. -->
  374. <xts:block id="businessRules" dependency="processScheduleDetails" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  375. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl" />
  376. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" exclude-result-prefixes="xsl">
  377. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  378. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  379. <xsl:template match="/">
  380. <xts:sequence>
  381. <xts:append select="/root">
  382. <businessRules>
  383. <!-- browser title -->
  384. <browserTitle>
  385. <xsl:text/>
  386. <xsl:choose>
  387. <xsl:when test="key('request-param','titlePostfix') != '' and key('request-param','inWizard')='true' ">
  388. <xts:string id="IDS_COMBINE_TITLE">
  389. <xts:param name="prefix">
  390. <xsl:value-of select="key('request-param','titlePrefix')"/>
  391. </xts:param>
  392. <xts:param name="postfix">
  393. <xsl:value-of select="key('request-param','titlePostfix')"/>
  394. </xts:param>
  395. </xts:string>
  396. </xsl:when>
  397. <xsl:otherwise>
  398. <xts:string id="TASK_DEFINE_SCHEDULE_WIZARD"/>
  399. </xsl:otherwise>
  400. </xsl:choose>
  401. <xsl:text/>
  402. </browserTitle>
  403. <!-- description -->
  404. <description>
  405. <xsl:choose>
  406. <xsl:when test="key('request-param','inWizard') = 'false'">
  407. <xsl:text/>
  408. <xts:string id="IDS_PROP_SCHED_INTRO"/>
  409. <xsl:text/>
  410. </xsl:when>
  411. <xsl:otherwise>
  412. <xsl:text/>
  413. <xts:string id="NEW_AGENT_SCHEDULE_INTRO"/>
  414. <xsl:text/>
  415. </xsl:otherwise>
  416. </xsl:choose>
  417. </description>
  418. </businessRules>
  419. </xts:append>
  420. </xts:sequence>
  421. </xsl:template>
  422. </xsl:stylesheet>
  423. </xts:block>
  424. <!--
  425. ===============================================================================================
  426. genMarkup -
  427. ===============================================================================================
  428. -->
  429. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="businessRules" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']]" mandatory="false">
  430. <!-- logicsheets -->
  431. <xts:logicsheet path="logicsheets/presentation/dialog/recurrenceUI.xslt"/>
  432. <!-- portal specific information -->
  433. <xts:logicsheet path="logicsheets/portal.xsl"/>
  434. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  435. <!-- Dialog specific logicsheets -->
  436. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  437. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  438. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  439. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  440. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  441. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  442. <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
  443. <xts:logicsheet path="portal/schedule/logicsheets/scheduleVars.xsl"/>
  444. <!-- Generic logicsheets -->
  445. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  446. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  447. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  448. <!-- apply the form logic -->
  449. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  450. <xts:logicsheet path="logicsheets/validation.xslt"/>
  451. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  452. <xsl:stylesheet version="1.0"
  453. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  454. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  455. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  456. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  457. xmlns:xIE5="http://developer.cognos.com/prompting/xIE5"
  458. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  459. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  460. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  461. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  462. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  463. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  464. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  465. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  466. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  467. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  468. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  469. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  470. xmlns:rui="http://developer.cognos.com/schemas/xts/logicsheet/xslt/presentation/dialog/recurrenceUI/"
  471. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  472. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/">
  473. exclude-result-prefixes="pf cml ut df lyt dp cf cp dc utml xts bus xtsext cm xIE5 dlgctrl">
  474. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  475. <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
  476. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  477. <pf:variables/>
  478. <rui:variables/>
  479. <cml:single-object/>
  480. <rui:promptControls form="pform"/>
  481. <xsl:variable name="mname" select="concat('..' , /root/env/param[@name='m'])"/>
  482. <xsl:variable name="the-steps" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentTaskDefinition']"/>
  483. <xsl:variable name="agentStudio" select="key('request-param','agentStudio') = 'true'"/>
  484. <xsl:variable name="utml-form-name">pform</xsl:variable>
  485. <!--xsl:variable name="form-read-only">false</xsl:variable-->
  486. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  487. <xsl:variable name="script_name">
  488. <xsl:value-of select="/root/http/param[@name='SCRIPT_NAME']"/>
  489. </xsl:variable>
  490. <!--xsl:variable name="the-credential" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='credential']"/-->
  491. <xsl:variable name="the-schedule" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='schedule']"/>
  492. <xsl:variable name="has_execute_permission" select="contains(concat(' ', /root/cm:queryResponse/cm:queryReply/*/cm:permissions, ' '), ' execute ') or not (/root/cm:queryResponse/cm:queryReply/*/cm:permissions)"/>
  493. <xsl:variable name="savedTriggerType" select="'schedule'"/>
  494. <xsl:template match="/">
  495. <xts:sequence>
  496. <xts:append select="/root/output">
  497. <xos:part>
  498. <xos:entityHeader>
  499. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  500. </xos:entityHeader>
  501. <xos:entityBody>
  502. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  503. <markup>
  504. <xts:transform name="XMLEncode">
  505. <utml:form name="pform">
  506. <!-- Since the date control input variables are not utml input, they would be put into Hidden inputs whenever the page is refreshed and cause
  507. duplicate. So we exclude them from query values. -->
  508. <!-- We also don't want vars from the controller templates usage - which is in the wizard. Add those vars to the exclusion list -->
  509. <utml:exclusion-list>
  510. <xsl:value-of select="' cleared_prompts txtDatedateTo txtDatedateFrom tempPath p_sched_date1 p_sched_date2 p_sched_time1 p_sched_time2 hourstimeTo hourstimeFrom minutestimeTo minutestimeFrom secondstimeFrom secondstimeTo AMPMtimeTo AMPMtimeFrom dateTotxtDate dateFromtxtDate controller_state request_stack_wizardStack request_stack_scheduleStack visited_schedule_properties '"/>
  511. </utml:exclusion-list>
  512. <utml:read-only>
  513. <xsl:choose>
  514. <!-- We might be creating the schedule so if permission are not there then it is ok-->
  515. <xsl:when test="(contains($the-schedule/cm:permissions, 'write') and contains($the-schedule/cm:permissions, 'execute')) or not ($the-schedule/cm:permissions)">
  516. <xsl:text>false</xsl:text>
  517. </xsl:when>
  518. <xsl:otherwise>
  519. <xsl:text>true</xsl:text>
  520. </xsl:otherwise>
  521. </xsl:choose>
  522. </utml:read-only>
  523. <utml:input type="hidden" name="hid" id="hid" utml:update="false" value="ug_cr_as_ag_wspcf_schdl"/>
  524. <!-- get the JavaScript needed for the prompt controls -->
  525. <rui:promptControlsScript/>
  526. <link href="{$skin_root}/ags/ags.css" type="text/css" rel="stylesheet"/>
  527. <link rel="stylesheet" type="text/css" href="{$skin_root}/ags/crn.css"/>
  528. <pf:help context="ug_cr_as_ag_wspcf_schdl" eventStudio="true"/>
  529. <script type="text/javascript" src="../ags/help.js"/>
  530. <script type="text/javascript" src="../ags/layout.js">//</script>
  531. <script language="javascript">
  532. // this function is called when the Next button is pressed. Note that it is only called if utml:validate is set to 'true'
  533. function validate()
  534. {
  535. var isValid = validateSchedule();
  536. return isValid;
  537. }
  538. function doExpandTasksNotused() {
  539. var frm = document.pform;
  540. //we must resubmit to ourselves
  541. frm.m.value = '/ags/dialogAdapter.xts';
  542. frm.ps_nav_op.value = "maintain";
  543. window.setTimeout('document.pform.submit();', 1 );
  544. }
  545. function init()
  546. {
  547. var inWizard = <xsl:value-of select="key('request-param','inWizard')"/>;
  548. //document.getElementById('inWizard').value;
  549. var cf=getConfigFrame?getConfigFrame():null;
  550. if (cf &amp;&amp; cf.showDialogFrame &amp;&amp; !inWizard)
  551. { //This function is used to fix scroll bar issue of dialogIFrame in Standards mode.
  552. resetMargin();
  553. //for now this is commented. because the tasks
  554. //and parameters are not workin properly yet.
  555. cf.showDialogFrame(550);
  556. if (document.pform.override_default_parameters) {
  557. if (document.pform.override_default_parameters.checked)
  558. {
  559. showDynamicDiv('overrideParametersDiv');
  560. hideDynamicDiv('defaultParmetersDiv');
  561. }
  562. else
  563. {
  564. hideDynamicDiv('overrideParametersDiv');
  565. showDynamicDiv('defaultParmetersDiv');
  566. }
  567. }
  568. }
  569. }
  570. function resetMargin(){
  571. var elementArray = document.getElementsByTagName("body");
  572. var iframeBody = elementArray[0];
  573. iframeBody.style.margin = "0px";
  574. }
  575. function onClickOK()
  576. {
  577. var frm = document.pform;
  578. if (validateSchedule() ){
  579. var cf=getConfigFrame?getConfigFrame():null;
  580. cf.agentHasChanged(true);
  581. frm.m.value='/ags/scheduleController.xts';
  582. frm.ps_nav_op.value = 'maintain';
  583. frm.controller_state.value = 'schedule|finished';
  584. frm.submit();
  585. }
  586. }
  587. </script>
  588. <!-- adds standard hidden inputs and javascript -->
  589. <dlgctrl:markupHelper/>
  590. <!-- render the interactive dialog header if this is not the wizard -->
  591. <dp:header>
  592. <dp:title>
  593. <xsl:value-of select="key('business-rules','browserTitle')"/>
  594. </dp:title>
  595. <dp:description headerBorder="true">
  596. <xsl:value-of select="key('business-rules','description')"/>
  597. </dp:description>
  598. <dp:close>
  599. <a href="#" onclick="getConfigFrame().hideDialogFrame();">
  600. <dp:closeMarker/>
  601. </a>
  602. </dp:close>
  603. </dp:header>
  604. <utml:input type="hidden" name="m_rp_parameters" id="m_rp_parameters">
  605. <xsl:attribute name="value"><xsl:value-of select="/root/env/param[@name='m_rp_parameters']"/></xsl:attribute>
  606. </utml:input>
  607. <utml:input type="hidden" name="ui.routingServerGroup" id="ui.routingServerGroup">
  608. <xsl:attribute name="value"><xsl:value-of select="key('request-param', 'ui.routingServerGroup')"/></xsl:attribute>
  609. </utml:input>
  610. <xsl:choose>
  611. <xsl:when test="$form-read-only='true' and not($the-schedule) ">
  612. <mt:objectNoneFound id="IDS_PROP_SCHED_READ_ONLY_NO_SCHED"/>
  613. </xsl:when>
  614. <xsl:otherwise>
  615. <!-- add this hidden input, its existence allows us to infer that this morphlet has been previously visited-->
  616. <input name="visited_schedule_properties" id="visited_schedule_properties" type="hidden" value="true"/>
  617. <!-- Recurrence -->
  618. <rui:recurrenceUI/>
  619. <xsl:if test="key('request-param','inWizard') = 'false'">
  620. <lyt:layout style="1">
  621. <lyt:section>
  622. <cf:dynamicExpandingSection name="expandedContentTaskOptions" width="100%" indent="false" initialize="false" visible="false" title="IDS_PROP_AGENT_TASKS">
  623. <!-- This needs to be modified to have a flag so that the task title is not displayed objectClass="agentTaskDefinition"-->
  624. <ut:taskSummaryUI objectClass="agentTaskDefinition" label="" iterate="$the-steps" itemObject="cm:taskObject"/>
  625. </cf:dynamicExpandingSection>
  626. </lyt:section>
  627. </lyt:layout>
  628. <lyt:layout style="1" title="IDS_PROP_JOB_HEADING_PROMPT_VALUES" border="yes">
  629. <lyt:section>
  630. <dp:choice width="100%">
  631. <dp:section1>
  632. <utml:input type="checkbox" name="override_default_parameters" id="override_default_parameters" value="true" utml:track="true" onclick="togglePromptDivs();"/>
  633. </dp:section1>
  634. <dp:section2>
  635. <xts:string id="IDS_STEP_RUN_OVERRIDE_DEFAULT_OPTIONS"/>
  636. </dp:section2>
  637. <dp:section3 width="100%">
  638. <ut:parametersDiv showTitle="false"/>
  639. </dp:section3>
  640. </dp:choice>
  641. </lyt:section>
  642. </lyt:layout>
  643. </xsl:if>
  644. </xsl:otherwise>
  645. </xsl:choose>
  646. <!-- footer -->
  647. <!-- ******************************************** -->
  648. <!-- TODO: Change framework.xsl to evaluate df:style as an child of df:button so we don't need all these choose statements -->
  649. <!-- ******************************************** -->
  650. <xsl:if test="key('request-param','displayButtons') != 'false'">
  651. <dp:footer>
  652. <df:button df:id="IDS_OK" df:style="href" df:href="#" onclick="javascript:onClickOK();"/>
  653. <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onclick="getConfigFrame().hideDialogFrame();"/>
  654. </dp:footer>
  655. </xsl:if>
  656. </utml:form>
  657. </xts:transform>
  658. </markup>
  659. <browserTitle>
  660. <xsl:value-of select="key('business-rules','browserTitle')"/>
  661. </browserTitle>
  662. </xsl:element>
  663. </xos:entityBody>
  664. </xos:part>
  665. </xts:append>
  666. </xts:sequence>
  667. </xsl:template>
  668. <!-- include all the schedule related templates. -->
  669. <pf:gen-icon/>
  670. <cp:tabControl/>
  671. </xsl:stylesheet>
  672. </xts:block>
  673. <!--
  674. ===============================================================================================
  675. debug - special debug block for nested requests
  676. ===============================================================================================
  677. -->
  678. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup returnResult" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  679. <!-- Get the debug logic sheet -->
  680. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  681. <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">
  682. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  683. <xsl:template match="/">
  684. <dbg:dumpxml select="/root"/>
  685. </xsl:template>
  686. </xsl:stylesheet>
  687. </xts:block>
  688. </xts:morphlet>