addContMgt.xts 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  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, 2014
  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,canUseContentStoreTool">
  9. <!--
  10. ================================================================================
  11. decode the agent items (which contain the agentOptions)
  12. ===============================================================================================
  13. -->
  14. <xts:block id="decodeAgentDefinition" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  15. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  16. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  17. <xsl:stylesheet version="1.0"
  18. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  20. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext xts">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/">
  23. <xts:sequence>
  24. <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
  25. <xts:append select="/root">
  26. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_addcontmgt001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  27. </xts:append>
  28. </xsl:if>
  29. <!-- delete the override flag-->
  30. <!--xts:delete select="/root/env/param[@name='override_default_content_task_options']"/-->
  31. </xts:sequence>
  32. </xsl:template>
  33. </xsl:stylesheet>
  34. </xts:block>
  35. <!--
  36. ===============================================================================================
  37. get the information for the content task
  38. ===============================================================================================
  39. -->
  40. <xts:block id="getSelectedPath" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false" dependency="decodeAgentDefinition">
  41. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  42. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  43. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  44. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  45. <xsl:template match="/">
  46. <xts:sequence>
  47. <xts:append>
  48. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  49. <send:request provider="cm" requester="AGS:addContMgt">
  50. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  51. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  52. <search>
  53. <!-- Get the report - we know only it's search path now -->
  54. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  55. </search>
  56. <properties>
  57. <property name="defaultName"/>
  58. <property name="searchPath"/>
  59. <property name="options"/>
  60. </properties>
  61. </query>
  62. </xts:transform>
  63. </send:request>
  64. </xts:transform>
  65. </xts:append>
  66. </xts:sequence>
  67. <!-- delete the consistency check -->
  68. <xts:sequence>
  69. <xts:delete select="/root/env/param[@name='cto_consistency_check']"/>
  70. </xts:sequence>
  71. </xsl:template>
  72. </xsl:stylesheet>
  73. </xts:block>
  74. <!--
  75. ===============================================================================================
  76. onAgentLoaded - the agent has been loaded and this task visited, unpack the cmOptions if they exist and set the overrideMode
  77. value to true, the basic rule is that if options exist then the user has overridden the content maintenance options at the task level
  78. ===============================================================================================
  79. -->
  80. <xts:block id="onAgentLoaded" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='' and not(/root/env/param[@name='cm_mode'])]" mandatory="false" dependency="getSelectedPath">
  81. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  82. <xts:logicsheet path="logicsheets/portal.xsl"/>
  83. <xsl:stylesheet version="1.0"
  84. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  85. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  86. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  87. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl xtsext xts pf">
  88. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  89. <pf:variables/>
  90. <xsl:template match="/">
  91. <!-- set the overridden state-->
  92. <xsl:variable name="overriddenTaskOptions">
  93. <xsl:choose>
  94. <xsl:when test="/root/env/param[@name='cmOptions']"><xsl:text>true</xsl:text></xsl:when>
  95. <xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
  96. </xsl:choose>
  97. </xsl:variable>
  98. <xts:sequence>
  99. <!-- unpack the options-->
  100. <xsl:if test="$overriddenTaskOptions='true'">
  101. <xsl:variable name="options">
  102. <xsl:value-of select="/root/env/param[@name='cmOptions']"/>
  103. </xsl:variable>
  104. <xts:append select="/root">
  105. <xts:transform name="XMLDecode">
  106. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_onagentloaded__settemplateid_addcontmgt001',string($options)), true() )" disable-output-escaping="yes"/>
  107. </xts:transform>
  108. </xts:append>
  109. </xsl:if>
  110. <!-- add cm_mode and overrideMode to the environment-->
  111. <xts:append select="/root/env">
  112. <param name="cm_mode">
  113. <xsl:choose>
  114. <xsl:when test="$overriddenTaskOptions='true'">
  115. <xts:queryNode select="/root/cmOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item'][name='checkSecurityReferences']/*[local-name()='value']"/>
  116. </xsl:when>
  117. <xsl:otherwise><xsl:text>true</xsl:text></xsl:otherwise>
  118. </xsl:choose>
  119. </param>
  120. <!--param name="cm_mode"><xsl:value-of select="$find"/></param-->
  121. <param name="overrideMode"><xsl:value-of select="$overriddenTaskOptions"/></param>
  122. </xts:append>
  123. <!-- tidy -->
  124. <xts:delete select="/root/env/param[@name='cmOptions']" mandatory="false"/>
  125. <xts:delete select="/root/cmOptions" mandatory="false"/>
  126. </xts:sequence>
  127. </xsl:template>
  128. </xsl:stylesheet>
  129. </xts:block>
  130. <!--
  131. ===============================================================================================
  132. updateCMMode - update the mode based on whether the agent defaults have been set, the value of cm_mode dictates
  133. how the UI is rendered
  134. ===============================================================================================
  135. -->
  136. <xts:block id="updateCMMode" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='']" mandatory="false" dependency="onAgentLoaded">
  137. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  138. <xts:logicsheet path="logicsheets/portal.xsl"/>
  139. <xsl:stylesheet version="1.0"
  140. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  141. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  142. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  143. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl xtsext xts pf">
  144. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  145. <pf:variables/>
  146. <xsl:template match="/">
  147. <xsl:variable name="cmOptions" select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
  148. <!-- cm_mode=false for 'find and fix' and true for 'find only'-->
  149. <!--******find ******-->
  150. <xsl:variable name="find">
  151. <xsl:choose>
  152. <!-- the user has overridden the mode at the task level-->
  153. <xsl:when test="/root/env/param[@name='overrideMode']='true'">
  154. <xsl:value-of select="/root/env/param[@name='cm_mode']"/>
  155. </xsl:when>
  156. <!-- the user has overridden the mode at the agent level-->
  157. <xsl:when test="/root/agent_definition/agentOptions/form-vars/param[@name='override_default_content_task_options']='true'">
  158. <xsl:value-of select="$cmOptions[name='checkSecurityReferences']/*[local-name()='value']"/>
  159. </xsl:when>
  160. <!-- the default setting-->
  161. <xsl:otherwise><xsl:text>true</xsl:text></xsl:otherwise>
  162. </xsl:choose>
  163. </xsl:variable>
  164. <!-- content task options-->
  165. <xsl:variable name="taskOptionItems" select="/root/*[local-name()='queryResponse']/*[local-name()='contentTask']/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
  166. <!-- the parameter used to generate the content maintenance options determines internal/external find/repair -->
  167. <xsl:variable name="consistencyCheck" >
  168. <xsl:choose>
  169. <!-- we have switched to an existing content maintenance task, so check for the 'cto_consistency_check' env param and retrieve its value -->
  170. <xsl:when test="/root/env/param[@name='cto_consistency_check']!=''">
  171. <xsl:value-of select="/root/env/param[@name='cto_consistency_check']"/>
  172. </xsl:when>
  173. <!-- new content maintenance task has been created, get the value from the CM content task options -->
  174. <xsl:when test="count($taskOptionItems) &gt; 0">
  175. <xsl:choose>
  176. <xsl:when test="$taskOptionItems[name='checkSecurityReferences']/value='true'"><xsl:text>externalRef</xsl:text></xsl:when>
  177. <xsl:when test="$taskOptionItems[name='checkInternalInconsistencies']/value='true'"><xsl:text>internalRef</xsl:text></xsl:when>
  178. <xsl:when test="$taskOptionItems[name='repairSecurityReferences']/value='true'"><xsl:text>externalRef</xsl:text></xsl:when>
  179. <xsl:when test="$taskOptionItems[name='repairInternalInconsistencies']/value='true'"><xsl:text>internalRef</xsl:text></xsl:when>
  180. </xsl:choose>
  181. </xsl:when>
  182. </xsl:choose>
  183. </xsl:variable>
  184. <xts:sequence>
  185. <!-- delete and recreate consistency check -->
  186. <xts:delete select="/root/env/param[@name='cto_consistency_check']"/>
  187. <xts:append select="/root/env">
  188. <param name="cto_consistency_check"><xsl:value-of select="$consistencyCheck"/></param>
  189. </xts:append>
  190. <!-- tidy -->
  191. <xts:delete select="/root/env/param[@name='cmOptions']"/>
  192. <xsl:choose>
  193. <!-- update -->
  194. <xsl:when test="/root/env/param[@name='cm_mode']">
  195. <xts:update select="/root/env/param[@name='cm_mode']">
  196. <param name="cm_mode">
  197. <xsl:value-of select="$find"/>
  198. </param>
  199. </xts:update>
  200. </xsl:when>
  201. <!-- create -->
  202. <xsl:otherwise>
  203. <xts:append select="/root/env">
  204. <param name="cm_mode">
  205. <xsl:value-of select="$find"/>
  206. </param>
  207. </xts:append>
  208. </xsl:otherwise>
  209. </xsl:choose>
  210. </xts:sequence>
  211. <!-- create the content maintenance options in CM format-->
  212. <xts:sequence>
  213. <xts:append select="/root">
  214. <cmOptions>
  215. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  216. <root>
  217. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  218. <root>
  219. <env>
  220. <param name="ctro_runoption">
  221. <xsl:choose>
  222. <xsl:when test="$find='true'">
  223. <xsl:text>find</xsl:text>
  224. </xsl:when>
  225. <xsl:otherwise>
  226. <xsl:text>fix</xsl:text>
  227. </xsl:otherwise>
  228. </xsl:choose>
  229. </param>
  230. <!--
  231. From buildOptionItems.xslt
  232. <xsl:when test="@name = 'repairInternalInconsistencies' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'true'"/></xsl:when>
  233. <xsl:when test="@name = 'repairSecurityReferences' and key('env-param','cto_consistency_check')='internalRef'"><xsl:value-of select="'false'"/></xsl:when>
  234. <xsl:when test="@name = 'repairInternalInconsistencies' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'false'"/></xsl:when>
  235. <xsl:when test="@name = 'repairSecurityReferences' and key('env-param','cto_consistency_check')='externalRef'"><xsl:value-of select="'true'"/></xsl:when>
  236. This is what we get passed from the content task
  237. <options xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="bus:optionArrayProp">
  238. <value xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[4]">
  239. <item xsi:type="bus:contentTaskOptionBoolean">
  240. <name xsi:type="bus:contentTaskOptionEnum">checkSecurityReferences</name>
  241. <value xsi:type="xsd:boolean">false</value>
  242. </item>
  243. <item xsi:type="bus:contentTaskOptionBoolean">
  244. <name xsi:type="bus:contentTaskOptionEnum">repairSecurityReferences</name>
  245. <value xsi:type="xsd:boolean">false</value>
  246. </item>
  247. <item xsi:type="bus:contentTaskOptionBoolean">
  248. <name xsi:type="bus:contentTaskOptionEnum">checkInternalInconsistencies</name>
  249. <value xsi:type="xsd:boolean">true</value>
  250. </item>
  251. <item xsi:type="bus:contentTaskOptionBoolean">
  252. <name xsi:type="bus:contentTaskOptionEnum">repairInternalInconsistencies</name>
  253. <value xsi:type="xsd:boolean">false</value>
  254. </item>
  255. </value>
  256. </options>
  257. In the UI we can choose between 'fix' and 'find and fix'. An additional option has been added which we are not catering for. This is the 'internal' or 'external' option
  258. external find = checkSecurityReferences
  259. external find and fix = repairSecurityReferences
  260. internal find = checkInternalInconsistencies
  261. internal find and fix = repairInternalInconsistencies
  262. Since in the UI we cannot choose between internal and external then we must interrogate the content task options and set the options accordingly.
  263. To do this the env param 'cto_consistency_check' must be present so that buildOptionItems.xslt can create the options with the correct value.
  264. If this is missing then the option is created without any value and the agent will fail when it is run and also will not load.
  265. See bug COQCQ00275642
  266. -->
  267. <param name="cto_consistency_check"><xsl:value-of select="$consistencyCheck"/></param>
  268. </env>
  269. <xts:transform name="XML" src="portal/options.xml"/>
  270. <contentLocale>
  271. <xsl:value-of select="$contentLocale"/>
  272. </contentLocale>
  273. <optionType>contentTaskOptions</optionType>
  274. <genDefaults>false</genDefaults>
  275. </root>
  276. </xts:transform>
  277. </root>
  278. </xts:transform>
  279. </cmOptions>
  280. </xts:append>
  281. </xts:sequence>
  282. </xsl:template>
  283. </xsl:stylesheet>
  284. </xts:block>
  285. <!--
  286. ===============================================================================================
  287. encodeCMOptions
  288. Serialize the content maintenance options only when we have /root/cmOptions and the user has overridden one of them
  289. ===============================================================================================
  290. -->
  291. <xts:block id="encodeCMOptions" dependency="updateCMMode" type="exec" mode="interpret" processor="XSLT" condition=".[/root/cmOptions and /root/env/param[@name='overrideMode']='true']" mandatory="false">
  292. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  293. <xts:logicsheet path="logicsheets/portal.xsl"/>
  294. <xsl:stylesheet version="1.0"
  295. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  296. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  297. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  298. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  299. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  300. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  301. exclude-result-prefixes="xsl xts pf cm dt xtsext">
  302. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  303. <pf:variables/>
  304. <pf:serialize-xml/>
  305. <xsl:template match="/">
  306. <!--xsl:message>****************addContMgt->encodeCMOptions*******************</xsl:message>
  307. <xsl:message>addContMgt->encodeCMOptions</xsl:message>
  308. <xsl:for-each select="/root/cmOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']">
  309. <xsl:message><xsl:value-of select="./name"/>=<xsl:value-of select="./value"/></xsl:message>
  310. </xsl:for-each-->
  311. <xts:sequence>
  312. <xsl:variable name="markup">
  313. <xsl:call-template name="serialize-xml">
  314. <xsl:with-param name="node-set" select="/root/cmOptions"/>
  315. </xsl:call-template>
  316. </xsl:variable>
  317. <xts:append select="/root/env">
  318. <param name="cmOptions">
  319. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup ),true()))"/>
  320. </param>
  321. </xts:append>
  322. <xts:delete select="/root/cmOptions"/>
  323. </xts:sequence>
  324. </xsl:template>
  325. </xsl:stylesheet>
  326. </xts:block>
  327. <!--
  328. ===============================================================================================
  329. returnResult - We're done with the add content maintenance
  330. ===============================================================================================
  331. -->
  332. <xts:block id="returnResult" path="/ags/tabResultTemplate.xslt" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" mandatory="false" dependency="encodeCMOptions">
  333. <xts:logicsheet path="logicsheets/portal.xsl"/>
  334. </xts:block>
  335. <!--
  336. ===============================================================================================
  337. genMarkup -
  338. ===============================================================================================
  339. -->
  340. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="returnResult" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']">
  341. <!-- logicsheets -->
  342. <!-- portal specific information -->
  343. <xts:logicsheet path="logicsheets/portal.xsl"/>
  344. <!-- the define condition ui -->
  345. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  346. <!-- Dialog specific logicsheets -->
  347. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  348. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  349. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  350. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  351. <!-- Generic logicsheets -->
  352. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  353. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  354. <!-- apply the form logic -->
  355. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  356. <!-- Prevent the href from appearing in the status bar. -->
  357. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  358. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" exclude-result-prefixes="xts cm pf xtsext lyt dp df cf cp xos utml agsdlg">
  359. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  360. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  361. <pf:variables/>
  362. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  363. <xsl:variable name="spacer">
  364. <img height="10" width="10">
  365. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  366. </img>
  367. </xsl:variable>
  368. <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
  369. <xsl:variable name="hasTask">
  370. <xsl:choose>
  371. <xsl:when test="key('env-param','selected_path') != ''"><xsl:text>true</xsl:text></xsl:when>
  372. <xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
  373. </xsl:choose>
  374. </xsl:variable>
  375. <xsl:template match="/">
  376. <xts:sequence>
  377. <xts:append select="/root/output">
  378. <xos:part>
  379. <xos:entityHeader>
  380. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  381. </xos:entityHeader>
  382. <xos:entityBody>
  383. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  384. <markup>
  385. <xts:transform name="XMLEncode">
  386. <utml:form name="pform">
  387. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  388. <!-- ================================================================ -->
  389. <!-- H E A D E R -->
  390. <!-- ================================================================ -->
  391. <utml:exclusion-list><xsl:value-of select="' pageitem '"/></utml:exclusion-list>
  392. <agsdlg:header>
  393. <dp:image>
  394. <img alt="" border="0">
  395. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_content_maintenance_24.gif</xsl:attribute>
  396. </img>
  397. </dp:image>
  398. <dp:title>
  399. <xts:string id="DIALOG_CM_TITLE"/>
  400. </dp:title>
  401. <dp:description>
  402. <xts:string id="DIALOG_CM_DESCRIPTION"/>
  403. </dp:description>
  404. </agsdlg:header>
  405. <utml:input type="hidden" name="report_visited" id="report_visited" value="true"/>
  406. <utml:input type="hidden" name="overrideMode" id="overrideMode" value="false" utml:update="true"/>
  407. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false">
  408. <utml:value>
  409. <xsl:choose>
  410. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:contentTask/cm:defaultName != '' ">
  411. <xsl:value-of select="/root/cm:queryResponse/cm:contentTask/cm:defaultName"/>
  412. </xsl:when>
  413. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  414. <xsl:value-of select="key('env-param', 'taskName')"/>
  415. </xsl:when>
  416. </xsl:choose>
  417. </utml:value>
  418. </utml:input>
  419. <!-- ================================================================ -->
  420. <!-- B O D Y -->
  421. <!-- ================================================================ -->
  422. <!-- Define a new layout-->
  423. <lyt:layout style="2">
  424. <lyt:section>
  425. <dp:textarea section3_align="left">
  426. <!-- the CM name label-->
  427. <dp:section1>
  428. <xts:string id="DIALOG_CM_LABEL"/>
  429. </dp:section1>
  430. <dp:section2>
  431. <!-- get the name of the cont mgt -->
  432. <xsl:choose>
  433. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:contentTask/cm:defaultName != '' ">
  434. <!--xsl:copy-of select="$spacer"/-->
  435. <xsl:value-of select="/root/cm:queryResponse/cm:contentTask/cm:defaultName"/>
  436. </xsl:when>
  437. <xsl:otherwise>
  438. <xts:string id="DIALOG_MESSAGE_NONE"/>
  439. </xsl:otherwise>
  440. </xsl:choose>
  441. </dp:section2>
  442. <dp:section3>
  443. <a href="#" onclick="doSelectObject('contentTask.es', '{xtsext:javascriptencode(/root/env/param[@name = 'selected_path'])}')">
  444. <xts:string id="SELECT_CM"/>
  445. </a>
  446. </dp:section3>
  447. </dp:textarea>
  448. </lyt:section>
  449. <lyt:section>
  450. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  451. </lyt:section>
  452. </lyt:layout>
  453. <lyt:layout style="2">
  454. <lyt:section>
  455. <dp:textarea section3_align="left">
  456. <dp:section1>
  457. <xts:string id="DIALOG_CM_OPTION"/>
  458. </dp:section1>
  459. <dp:section2>
  460. <utml:radio-group name="cm_mode">
  461. <utml:default-value>true</utml:default-value>
  462. <dp:choice>
  463. <dp:section1>
  464. <utml:input type="radio" onclick="javascript:overridden(this);">
  465. <utml:value>true</utml:value>
  466. </utml:input>
  467. </dp:section1>
  468. <dp:section2>
  469. <xts:string id="DIALOG_CM_OPTION_FIND"/>
  470. </dp:section2>
  471. <dp:section1>
  472. <utml:input type="radio" onclick="javascript:overridden(this);">
  473. <utml:value>false</utml:value>
  474. </utml:input>
  475. </dp:section1>
  476. <dp:section2>
  477. <xts:string id="DIALOG_CM_OPTION_FINDFIX"/>
  478. </dp:section2>
  479. </dp:choice>
  480. </utml:radio-group>
  481. </dp:section2>
  482. </dp:textarea>
  483. </lyt:section>
  484. </lyt:layout>
  485. <dp:emptyFooter/>
  486. <script type="text/javascript">
  487. function init() {
  488. <xsl:if test="not(/root/env/param[@name='report_visited']) and not(/root/env/param[@name='selected_path'])">
  489. doSelectObject('contentTask.es')
  490. </xsl:if>
  491. }
  492. /*
  493. * the mode has been overridden by the user, insert a hidden variable into the form. This ensures
  494. that the agent default options(when set) do not interfere with the users chosen mode
  495. */
  496. function overridden(radio) {
  497. //check if the mode has already been overridden
  498. document.pform.overrideMode.value='true';
  499. }
  500. /*
  501. * validate the report page and popup an appropriate alert message
  502. */
  503. function validate() {
  504. var hasTask = <xsl:value-of select="string($hasTask)"/>;
  505. var isValid = true;
  506. if (hasTask==false) {
  507. isValid = false;
  508. alert(&quot;<xts:string id="DIALOG_CM_NO_CM_TASK" encode="javascript"/>&quot;);
  509. }
  510. return isValid;
  511. }
  512. </script>
  513. </utml:form>
  514. </xts:transform>
  515. </markup>
  516. </xsl:element>
  517. </xos:entityBody>
  518. </xos:part>
  519. </xts:append>
  520. </xts:sequence>
  521. </xsl:template>
  522. </xsl:stylesheet>
  523. </xts:block>
  524. <!--
  525. ===============================================================================================
  526. debug - special debug block for nested requests
  527. ===============================================================================================
  528. -->
  529. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  530. <!-- Get the debug logic sheet -->
  531. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  532. <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">
  533. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  534. <xsl:template match="/">
  535. <dbg:dumpxml select="/root"/>
  536. </xsl:template>
  537. </xsl:stylesheet>
  538. </xts:block>
  539. </xts:morphlet>