scheduleController.xts 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  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, 2015
  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. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
  15. <!--
  16. ===============================================================================================
  17. execute-method -
  18. ===============================================================================================
  19. -->
  20. <xts:block id="execute-method" dependency="formlogic_init" processor="XSLT" type="exec" condition=".[/root/env/param[@name='method'] and /root/env/param[@name='method']!='']" mandatory="false">
  21. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  22. <xsl:stylesheet version="1.0"
  23. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  24. xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/"
  25. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  26. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  28. <xsl:template match="/">
  29. <xts:sequence>
  30. <xts:append>
  31. <promptRequest>
  32. <send:request provider="xts" option="xml-multipart">
  33. <xsl:choose>
  34. <xsl:when test="key('env-param', 'method') = 'edit' ">
  35. <prompt:collect>
  36. <returnMorphlet>ags/scheduleController.xts</returnMorphlet>
  37. <ps_nav_op>maintain</ps_nav_op>
  38. <runAsync>true</runAsync>
  39. <reportSpec><xsl:value-of select="key('env-param', 'agentReportSpec')"/></reportSpec>
  40. </prompt:collect>
  41. </xsl:when>
  42. <xsl:otherwise>
  43. <xsl:element name="{key('env-param', 'method')}" namespace="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
  44. <returnMorphlet>ags/scheduleController.xts</returnMorphlet>
  45. <ps_nav_op>maintain</ps_nav_op>
  46. </xsl:element>
  47. </xsl:otherwise>
  48. </xsl:choose>
  49. </send:request>
  50. </promptRequest>
  51. </xts:append>
  52. </xts:sequence>
  53. </xsl:template>
  54. </xsl:stylesheet>
  55. </xts:block>
  56. <!--
  57. ===============================================================================================
  58. check-state -
  59. ===============================================================================================
  60. -->
  61. <xts:block id="check-state" path="/portal/iPrompting/logicsheets/check-state.xslt" processor="XSLT" type="exec" dependency="execute-method" mandatory="false">
  62. <xts:logicsheet path="logicsheets/portal.xsl"/>
  63. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  64. </xts:block>
  65. <!--
  66. ===============================================================================================
  67. appendAgentDefinitionBlob - Append the AgentDefinition blob here so we can create the tasks.
  68. ===============================================================================================
  69. -->
  70. <xts:block id="appendAgentDefinitionBlob" dependency="check-state" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] !='' and /root/view='properties']" mandatory="false">
  71. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  72. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  73. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  74. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  75. <xsl:template match="/">
  76. <xts:sequence>
  77. <xts:append select="/root">
  78. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_dialogadapter001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  79. </xts:append>
  80. </xts:sequence>
  81. </xsl:template>
  82. </xsl:stylesheet>
  83. </xts:block>
  84. <!--
  85. ===============================================================================================
  86. Main content request
  87. ===============================================================================================
  88. -->
  89. <xts:block id="getContent" processor="XSLT" type="exec" dependency="appendAgentDefinitionBlob" condition=".[(count(/root/agent_definition/items/item) > 0 and /root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != '' and /root/view='properties')]" mandatory="false">
  90. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl" />
  91. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  92. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  93. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  94. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  95. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  96. <xsl:template match="/">
  97. <xts:sequence>
  98. <xts:append>
  99. <contentResponse>
  100. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  101. <send:request provider="cm">
  102. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  103. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  104. <cm:requests>
  105. <!--xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']//*[local-name()='taskObject']//*[local-name()='searchPath' and text()]"-->
  106. <xsl:for-each select="/root/agent_definition/items/item">
  107. <xsl:choose>
  108. <xsl:when test="./targetStoreID[text()]">
  109. <cm:query>
  110. <cm:search>
  111. <!-- The path of the actual object-->
  112. <xsl:value-of select="./targetStoreID"/>
  113. </cm:search>
  114. <cm:properties>
  115. <cm:property name="defaultName"/>
  116. <cm:property name="defaultOutputFormat"/>
  117. <cm:property name="searchPath"/>
  118. <cm:property name="storeID"/>
  119. <cm:property name="uri"/>
  120. <cm:property name="base"/>
  121. <cm:property name="modificationTime"/>
  122. <cm:property name="format"/>
  123. <cm:property name="contentLocale"/>
  124. <cm:property name="defaultScreenTip"/>
  125. <cm:property name="permissions"/>
  126. <cm:property name="usage"/>
  127. <cm:property name="target"/>
  128. <cm:property name="disabled"/>
  129. <cm:property name="ancestors"/>
  130. </cm:properties>
  131. </cm:query>
  132. </xsl:when>
  133. <xsl:otherwise>
  134. <cm:query>
  135. <cm:search>
  136. <!-- Create a dummy query so that we make sure the response count matchs for each item-->
  137. <xsl:text>~</xsl:text>
  138. </cm:search>
  139. <cm:properties/>
  140. </cm:query>
  141. </xsl:otherwise>
  142. </xsl:choose>
  143. </xsl:for-each>
  144. </cm:requests>
  145. </cm:query>
  146. </xts:transform>
  147. </send:request>
  148. </xts:transform>
  149. </contentResponse>
  150. </xts:append>
  151. </xts:sequence>
  152. </xsl:template>
  153. </xsl:stylesheet>
  154. </xts:block>
  155. <!--
  156. ===============================================================================================
  157. createTasksResponse - This block will merge the response form the getContent block with the agent_definitions items.
  158. For the tasks that do not have a selected object we generate a dummy name and type.
  159. ===============================================================================================
  160. -->
  161. <xts:block id="createTasksResponse" dependency="getContent" processor="XSLT" type="exec" condition=".[(/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != '' and /root/view='properties')]" mandatory="false">
  162. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  163. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  164. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  165. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  166. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  167. <xsl:template match="/">
  168. <xts:sequence>
  169. <xts:append select="/root">
  170. <xsl:call-template name="process"/>
  171. </xts:append>
  172. </xts:sequence>
  173. <xts:sequence>
  174. <xts:delete select="/root/env/param[@name='pagerfromtasks']"/>
  175. <xts:delete select="/root/env/param[@name='pagertotasks']"/>
  176. <xts:delete select="/root/env/param[@name='pagerfrom_dtasks']"/>
  177. <xts:delete select="/root/env/param[@name='pagerto_dtasks']"/>
  178. </xts:sequence>
  179. </xsl:template>
  180. <xsl:template name="process">
  181. <xsl:variable name="userPrefs" select="/root/session/param"/>
  182. <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
  183. <xsl:variable name="maxObjects">
  184. <xsl:choose>
  185. <xsl:when test="string(key('env-param','m_pagertotasks')) !='' and string(key('env-param','m_pagerfromtasks')) !=''">
  186. <xsl:value-of select="(key('env-param','m_pagertotasks') - key('env-param','m_pagerfromtasks')) + 1"/>
  187. </xsl:when>
  188. <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
  189. <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
  190. </xsl:when>
  191. <xsl:otherwise>
  192. <xsl:value-of select="userPrefsDefault/pref[@name='lines']"/>
  193. </xsl:otherwise>
  194. </xsl:choose>
  195. </xsl:variable>
  196. <xsl:variable name="skipObjects">
  197. <xsl:choose>
  198. <xsl:when test="key('env-param','m_pagerfromtasks') and key('env-param','m_pagerfromtasks')!=''">
  199. <xsl:value-of select="key('env-param','m_pagerfromtasks')-1"/>
  200. </xsl:when>
  201. <xsl:when test="key('env-param','m_taskssection')!=''">
  202. <xsl:choose>
  203. <xsl:when test="key('env-param','m_taskssection')!='-1'">
  204. <xsl:value-of select="(key('env-param','m_taskssection') -1)"/>
  205. </xsl:when>
  206. <xsl:otherwise>
  207. <xsl:value-of select="($maxObjects) * -1"/>
  208. </xsl:otherwise>
  209. </xsl:choose>
  210. </xsl:when>
  211. <xsl:otherwise>0</xsl:otherwise>
  212. </xsl:choose>
  213. </xsl:variable>
  214. <xsl:variable name="start_pos">
  215. <xsl:value-of select="number($skipObjects)+1"/>
  216. </xsl:variable>
  217. <xsl:variable name="end_pos">
  218. <xsl:value-of select="number($start_pos)+number($maxObjects)"/>
  219. </xsl:variable>
  220. <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  221. <xsl:if test="boolean(/root/agent_definition/items/item)">
  222. <queryReply>
  223. <xsl:if test="boolean(/root/agent_definition/agentParameters/*)">
  224. <!-- take a copy of the agent parameters. Those are the ones stored under the report-->
  225. <xsl:copy-of select="/root/agent_definition/agentParameters/*"/>
  226. </xsl:if>
  227. <xsl:for-each select="/root/agent_definition/items/item">
  228. <xsl:variable name="index" select="position()"/>
  229. <xsl:if test="position() &gt;= number($start_pos) and position() &lt;= number($end_pos)">
  230. <agentTaskDefinition>
  231. <objectClass>agentTaskDefinition</objectClass>
  232. <searchPath type="cm:stringProp"><xsl:value-of select="./id"/></searchPath>
  233. <displaySequence type="cm:nonNegativeIntegerProp"><xsl:value-of select="$index"/></displaySequence>
  234. <taskObject type="cm:baseClassArrayProp">
  235. <!-- Copy contents of call to CM -->
  236. <xsl:choose>
  237. <!-- it's possible that we don't have access to the object in which case the query doesn't return anything - so just add default info -->
  238. <xsl:when test="./targetStoreID != '' and /root/*[local-name()='contentResponse']//*[local-name()='queryReply'][position()=$index]/*">
  239. <xsl:copy-of select="/root/*[local-name()='contentResponse']//*[local-name()='queryReply'][position()=$index]/*"/>
  240. </xsl:when>
  241. <xsl:otherwise>
  242. <xsl:variable name="objectType">
  243. <xsl:call-template name="getType">
  244. <xsl:with-param name="type"><xsl:value-of select="./type"/></xsl:with-param>
  245. </xsl:call-template>
  246. </xsl:variable>
  247. <xsl:element name="{$objectType}">
  248. <!-- Copy contents of call to CM -->
  249. <objectClass><xsl:value-of select="$objectType"/></objectClass>
  250. <defaultName type="cm:tokenProp"><xsl:value-of select="./name"/></defaultName>
  251. </xsl:element>
  252. </xsl:otherwise>
  253. </xsl:choose>
  254. </taskObject>
  255. <position><xsl:value-of select="number(position()) -1"/></position>
  256. </agentTaskDefinition>
  257. </xsl:if>
  258. </xsl:for-each>
  259. </queryReply>
  260. </xsl:if>
  261. </queryResponse>
  262. </xsl:template>
  263. <!-- only build the appropriate type for items which might not be saved - ie are created as part of the agent -->
  264. <xsl:template name="getType">
  265. <xsl:param name="type"/>
  266. <xsl:choose>
  267. <xsl:when test="$type = 'message'">
  268. <xsl:text>memo</xsl:text>
  269. </xsl:when>
  270. <xsl:when test="$type='sql'">
  271. <xsl:text>storedProcedureTask</xsl:text>
  272. </xsl:when>
  273. <xsl:when test="$type='web'">
  274. <xsl:text>webServiceTask</xsl:text>
  275. </xsl:when>
  276. <xsl:when test="$type = 'url'">
  277. <!-- Need to do be a bit smarter here in order to get the shortcutRSSTask or the urlRSSTask - although it doesn't really matter
  278. seeing as the only thing the type is used for is to display the icon - and the icon's are the same for both -->
  279. <xsl:text>shortcutRSSTask</xsl:text>
  280. </xsl:when>
  281. <!-- all the following mappings are needed if we don't have access to the item - we can build a type from the agentDefinition -->
  282. <xsl:when test="$type = 'report'">
  283. <xsl:text>report</xsl:text>
  284. </xsl:when>
  285. <xsl:when test="$type = 'agent'">
  286. <xsl:text>agentDefinition</xsl:text>
  287. </xsl:when>
  288. <xsl:when test="$type = 'job'">
  289. <xsl:text>jobDefinition</xsl:text>
  290. </xsl:when>
  291. <xsl:when test="$type = 'import'">
  292. <xsl:text>importDeployment</xsl:text>
  293. </xsl:when>
  294. <xsl:when test="$type = 'export'">
  295. <xsl:text>exportDeployment</xsl:text>
  296. </xsl:when>
  297. <xsl:when test="$type = 'content'">
  298. <xsl:text>contentTask</xsl:text>
  299. </xsl:when>
  300. <xsl:when test="$type = 'metric'">
  301. <xsl:text>metricsMaintenanceTask</xsl:text>
  302. </xsl:when>
  303. <xsl:when test="$type = 'planningMacro'">
  304. <xsl:text>planningMacroTask</xsl:text>
  305. </xsl:when>
  306. <xsl:when test="$type = 'index'">
  307. <xsl:text>indexUpdateTask</xsl:text>
  308. </xsl:when>
  309. <xsl:when test="$type = 'migration'">
  310. <xsl:text>migrationTask</xsl:text>
  311. </xsl:when>
  312. <xsl:when test="$type = 'approval' or $type='notification' ">
  313. <xsl:text>humanTask</xsl:text>
  314. </xsl:when>
  315. </xsl:choose>
  316. </xsl:template>
  317. </xsl:stylesheet>
  318. </xts:block>
  319. <!--
  320. ===============================================================================================
  321. appendAgentDefinitionBlob - Append the AgentDefinition blob here so we can create the tasks.
  322. ===============================================================================================
  323. -->
  324. <xts:block id="appendQueryResponse" dependency="createTasksResponse" processor="XSLT" type="exec" condition=".[(/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != '' and /root/view='properties' )]" mandatory="false">
  325. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  326. <xts:logicsheet path="logicsheets/portal.xsl"/>
  327. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  328. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  329. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  330. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  331. exclude-result-prefixes="xsl xtsext cm pf">
  332. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  333. <pf:serialize-xml/>
  334. <pf:variables/>
  335. <xsl:template match="/">
  336. <xts:sequence>
  337. <xsl:variable name="builtResponse">
  338. <xsl:call-template name="serialize-xml">
  339. <xsl:with-param name="node-set" select="/root/cm:queryResponse"/>
  340. </xsl:call-template>
  341. </xsl:variable>
  342. <!-- Delete any existing query responses -->
  343. <xts:delete select="/root/env/param[@name='queryResponse']"/>
  344. <xts:append select="/root/env">
  345. <param name="queryResponse">
  346. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_dialogadapter003'), xtsext:web64encode( string( $builtResponse ), true()))"/>
  347. </param>
  348. </xts:append>
  349. </xts:sequence>
  350. </xsl:template>
  351. </xsl:stylesheet>
  352. </xts:block>
  353. <!--
  354. ===============================================================================================
  355. initController - The first time this morphlet gets executed, set the controller_state to
  356. schedule|markup to display the schedule
  357. ===============================================================================================
  358. -->
  359. <xts:block id="initController" dependency="appendQueryResponse" processor="XSLT" type="exec" condition=".[(not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='' and /root/view='properties') ]" mandatory="false">
  360. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  361. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  362. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  363. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  364. <xsl:template match="/">
  365. <xts:sequence>
  366. <!-- make sure we start up nicely -->
  367. <xts:delete select="/root/env/param[not( @name='queryResponse' or starts-with(@name,'AgentTask') or @name='agent_definition_blob' or @name='agentReportSpec' or @name='scheduleParameters' or @name='m' or @name='b_action' or @name='m_path' or @name='cafcontextid' or @name='ui.routingServerGroup' or starts-with(@name,'ps_nav') or starts-with(@name, 'stack'))]"/>
  368. <!-- make this generic - we either have no controller_state - that would prefered or we have an empty one -->
  369. <xts:append select="/root/env">
  370. <param name="controller_state">schedule|markup</param>
  371. </xts:append>
  372. <xts:delete select="/root/agent_definition"/>
  373. </xts:sequence>
  374. </xsl:template>
  375. </xsl:stylesheet>
  376. </xts:block>
  377. <!--
  378. ===============================================================================================
  379. callMorphlet - Calls the right wizard page depending on the controller_state information
  380. ===============================================================================================
  381. -->
  382. <xts:block id="callMorphlet" processor="XSLT" dependency="initController" type="exec" condition=".[ (/root/env/param[@name='controller_state'] = 'schedule|markup' or /root/env/param[@name='controller_state'] = 'schedule|finished') and /root/view='properties']" mandatory="false">
  383. <xts:logicsheet path="logicsheets/portal.xsl"/>
  384. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  385. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl dlgctrl xtsext req-params pf">
  386. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  387. <!-- add any theme variables -->
  388. <pf:variables/>
  389. <xsl:template match="/">
  390. <xts:sequence>
  391. <!-- set schedule -->
  392. <dlgctrl:XTS2Request>
  393. <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
  394. <dlgctrl:target>/ags/setSchedule.xts</dlgctrl:target>
  395. <req-params:param name="titlePrefix">
  396. <xts:string id="NEW_AGENT_SCHEDULE_TITLE"/>
  397. </req-params:param>
  398. <req-params:param name="titlePostfix">
  399. <xts:string id="NEW_AGENT_WIZARD_TITLE"/>
  400. </req-params:param>
  401. <req-params:param name="scheduleParameters">
  402. <xsl:value-of select="/root/env/param[@name='scheduleParameters']"/>
  403. </req-params:param>
  404. <req-params:param name="ui.routingServerGroup">
  405. <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
  406. </req-params:param>
  407. <req-params:param name="cancelURL">
  408. <xsl:value-of select="concat($gateway,'?m=ags/ags.xts')"/>
  409. </req-params:param>
  410. <req-params:param name="inWizard">false</req-params:param>
  411. </dlgctrl:XTS2Request>
  412. </xts:sequence>
  413. </xsl:template>
  414. </xsl:stylesheet>
  415. </xts:block>
  416. <!--
  417. ===============================================================================================
  418. processFirstResponse - process the resut returned by the callMorphlet block
  419. ===============================================================================================
  420. -->
  421. <xts:block id="processFirstResponse" processor="XSLT" dependency="callMorphlet" type="exec" condition=".[(/root/env/param[@name='controller_state'] = 'schedule|markup' or /root/env/param[@name='controller_state'] = 'schedule|finished') and /root/view='properties']" mandatory="false">
  422. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  423. <xts:logicsheet path="logicsheets/portal.xsl"/>
  424. <xsl:stylesheet version="1.0"
  425. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  426. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  427. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  428. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  429. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  430. exclude-result-prefixes="xsl dlgctrl xtsext xts pf">
  431. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  432. <pf:variables/>
  433. <xsl:variable name="current_state" select="/root/env/param[@name='controller_state']"/>
  434. <xsl:template match="/">
  435. <xts:sequence>
  436. <dlgctrl:processXTS2Response>
  437. <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
  438. <!-- display the markup -->
  439. <dlgctrl:mode match="markup">
  440. <xts:append select="/root/output">
  441. <xts:transform src="ags/transforms/display_markup_page.xslt" processor="XSLT" option="part" mimeType="text/html">
  442. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  443. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  444. <root>
  445. <xts:transform name="XMLDecode">
  446. <dlgctrl:morphletResponse/>
  447. </xts:transform>
  448. <xsl:copy-of select="/root/http"/>
  449. <xsl:copy-of select="/root/env"/>
  450. <xsl:copy-of select="/root/system"/>
  451. <xsl:copy-of select="/root/user"/>
  452. </root>
  453. </xts:transform>
  454. </xts:append>
  455. </dlgctrl:mode>
  456. <dlgctrl:mode match="scheduleParameters">
  457. <xts:delete select="/root/env/param[@name='scheduleParameters']"/>
  458. <xts:append select="/root/env">
  459. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  460. <param name="scheduleParameters">
  461. <passport>
  462. <xsl:value-of select="$passport"/>
  463. </passport>
  464. <markup>
  465. <xts:transform name="XMLEncode">
  466. <dlgctrl:morphletResponse/>
  467. </xts:transform>
  468. </markup>
  469. </param>
  470. </xts:transform>
  471. <xsl:copy-of select="/root/env/param[@name='controller_state']"/>
  472. </xts:append>
  473. </dlgctrl:mode>
  474. </dlgctrl:processXTS2Response>
  475. <xts:delete select="/root/*[local-name()='morphletResponse']"/>
  476. </xts:sequence>
  477. </xsl:template>
  478. </xsl:stylesheet>
  479. </xts:block>
  480. <!--
  481. ===============================================================================================
  482. displayMarkup - display the markup returned from getMarkup
  483. ===============================================================================================
  484. -->
  485. <xts:block id="displayMarkup" processor="XSLT" dependency="processFirstResponse" type="exec" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] != 'schedule|finished' and /root/view='properties']" mandatory="false">
  486. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  487. <xts:logicsheet path="logicsheets/portal.xsl"/>
  488. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl dlgctrl xtsext xts">
  489. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  490. <xsl:variable name="current_state" select="/root/env/param[@name='controller_state']"/>
  491. <xsl:template match="/">
  492. <xts:sequence>
  493. <dlgctrl:processXTS2Response>
  494. <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
  495. <!-- display the markup -->
  496. <dlgctrl:mode match="markup">
  497. <xts:append select="/root/output">
  498. <xts:transform src="ags/transforms/display_markup_page.xslt" processor="XSLT" option="part" mimeType="text/html">
  499. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  500. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  501. <root>
  502. <xts:transform name="XMLDecode">
  503. <dlgctrl:morphletResponse/>
  504. </xts:transform>
  505. <xsl:copy-of select="/root/http"/>
  506. <xsl:copy-of select="/root/env"/>
  507. <xsl:copy-of select="/root/system"/>
  508. <xsl:copy-of select="/root/user"/>
  509. </root>
  510. </xts:transform>
  511. </xts:append>
  512. </dlgctrl:mode>
  513. </dlgctrl:processXTS2Response>
  514. </xts:sequence>
  515. </xsl:template>
  516. </xsl:stylesheet>
  517. </xts:block>
  518. <!--
  519. ===============================================================================================
  520. displayMarkup - display the markup returned from getMarkup
  521. ===============================================================================================
  522. -->
  523. <!--xts:block id="copyResult" mode="output" processor="XSLT" dependency="displayMarkup" type="exec" condition=".[ /root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished']" mandatory="false">
  524. <xts:logicsheet path="logicsheets/portal.xsl"/>
  525. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  526. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  527. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  528. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  529. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  530. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  531. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  532. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  533. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  534. exclude-result-prefixes="xsl dp xts pf df xtsext"-->
  535. <!-- add any theme variables -->
  536. <!--pf:variables/>
  537. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  538. <xsl:variable name="scheduleParameters"><xsl:value-of select="/root/env/param[@name='scheduleParameters']"/></xsl:variable>
  539. <xsl:template match="/">
  540. <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
  541. <dp:page>
  542. <dp:meta>
  543. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  544. </dp:meta>
  545. <script type="text/javascript" src="../ags/layout.js">//</script>
  546. <script type="text/javascript" src="../ags/cmd.js">//</script>
  547. <script type="text/javascript">
  548. function init() {
  549. var frm = document.messageIFrame.pform;
  550. if (frm != null) {
  551. if (frm.AgentTask-schedule = null) {
  552. frm.appendChild(createHiddenInput(frm , "AgentTask-schedule", ""));
  553. }
  554. frm.AgentTask-schedule.value = '<xsl:value-of select="$scheduleParameters"/>';
  555. }
  556. getConfigFrame().hideDialogFrame();
  557. }
  558. </script>
  559. </dp:page>
  560. </xsl:template>
  561. </xsl:stylesheet>
  562. </xts:block-->
  563. <!--
  564. ===============================================================================================
  565. decodeScheduleParameters - decode and append the Schedule parameters.
  566. ===============================================================================================
  567. -->
  568. <xts:block id="decodeScheduleParameters" type="exec" mode="interpret" processor="XSLT" dependency="displayMarkup" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished' and /root/view='properties']" mandatory="false">
  569. <!-- portal specific information-->
  570. <xts:logicsheet path="logicsheets/portal.xsl"/>
  571. <!-- Dialog specific logicsheets -->
  572. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  573. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="form xtsext">
  574. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  575. <xsl:template match="/">
  576. <xts:sequence>
  577. <xts:append>
  578. <xts:transform name="XMLDecode">
  579. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_scheduleController_settemplateid_save001',string(/root/env/param[@name='scheduleParameters'])), true())"/>
  580. </xts:transform>
  581. </xts:append>
  582. </xts:sequence>
  583. </xsl:template>
  584. </xsl:stylesheet>
  585. </xts:block>
  586. <!--
  587. ===============================================================================================
  588. render-page: Proxy display and redirect to dialogAdapter
  589. ===============================================================================================
  590. -->
  591. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="decodeScheduleParameters" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished' and /root/view='properties']">
  592. <!-- portal specific information -->
  593. <xts:logicsheet path="logicsheets/portal.xsl"/>
  594. <!-- Get the new theme logicsheets. -->
  595. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  596. <!-- apply the form logic -->
  597. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  598. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="utml dp pf xtsext">
  599. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  600. <!-- add any theme variables -->
  601. <pf:variables/>
  602. <xsl:variable name="scheduleParameters">
  603. <xsl:value-of select="/root/env/param[@name='scheduleParameters']"/>
  604. </xsl:variable>
  605. <xsl:template match="/">
  606. <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
  607. <dp:page>
  608. <dp:meta>
  609. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  610. </dp:meta>
  611. <dp:script>
  612. <script type="text/javascript" src="../ags/layout.js">//</script>
  613. <script type="text/javascript" src="../ags/cmd.js">//</script>
  614. <script type="text/javascript">
  615. function init() {
  616. var msgFrame = getMessageIFrame();
  617. if (msgFrame != null) {
  618. var elmnt = msgFrame.document.getElementById("AgentTask-schedule");
  619. if (elmnt == null) {
  620. elmnt = createHiddenInput(msgFrame.document, "AgentTask-schedule", "");
  621. msgFrame.document.pform.appendChild(elmnt);
  622. }
  623. elmnt.value = '<xsl:value-of select="$scheduleParameters"/>';
  624. // This is called each time when there are any changes in schedule to change the schedule icon for
  625. // schedule the agent task in the UI .
  626. parent.toggleScheduleState(<xsl:value-of select="/root/scheduleParameters/item/active/value"/>, false);
  627. }
  628. getConfigFrame().hideDialogFrame();
  629. }
  630. </script>
  631. </dp:script>
  632. </dp:page>
  633. </xsl:template>
  634. </xsl:stylesheet>
  635. </xts:block>
  636. <!--
  637. ===============================================================================================
  638. debug - display debug information
  639. ===============================================================================================
  640. -->
  641. <xts:block id="debug" dependency="displayMarkup" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  642. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  643. <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">
  644. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  645. <xsl:template match="/">
  646. <dbg:dumpxml select="/root"/>
  647. </xsl:template>
  648. </xsl:stylesheet>
  649. </xts:block>
  650. </xts:morphlet>