addIndex.xts 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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,canUseIndexSearch">
  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. createROParamsForAgentDefaults
  38. create the m_ro_* parameters for the agent defaults. Only create these when the agent defaults have been overridden and the report
  39. options have not
  40. ===========================================================================================================
  41. -->
  42. <xts:block id="createROParamsForAgentDefaults" dependency="decodeAgentDefinition" processor="XSLT" type="exec" condition=".[/root/agent_definition/agentOptions/form-vars/param[@name='override_default_index_update_task_options']='true']" mandatory="false">
  43. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  44. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  45. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  46. <xts:logicsheet path="logicsheets/portal.xsl"/>
  47. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="x" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" 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:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts xtsext xsl x cm dt pf cf cp">
  48. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  49. <pf:variables/>
  50. <xsl:template match="/">
  51. <xts:sequence>
  52. <!-- remove stray m_ro_* parameters from the environment where they exist, particularly a problem
  53. if the user deselects the override check box and then ok's the report options dialog-->
  54. <xts:replace select="/root/env">
  55. <xts:transform src="ags/transforms/delete_run_options.xslt" processor="XSLT">
  56. <root>
  57. <xsl:copy-of select="/root/env"/>
  58. </root>
  59. </xts:transform>
  60. </xts:replace>
  61. <!-- when the agent defaults have been overridden and the report options have not then
  62. the m_ro_* options must be created. This ensures the UI summary string is rendered properly-->
  63. <xts:append select="/root/env">
  64. <xts:transform src="transforms/portal/options/generateParams.xslt" processor="XSLT">
  65. <xsl:element name="root">
  66. <!-- copy the run options that we have -->
  67. <xsl:copy-of select="/root/agent_definition/agentOptions/options"/>
  68. </xsl:element>
  69. </xts:transform>
  70. </xts:append>
  71. <!-- generate the summary strings for the email options-->
  72. <xsl:choose>
  73. <xsl:when test="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']">
  74. <param name="emailSummary"><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']/*[local-name()='emailSummary']"/></param>
  75. <param name="emailRecipientsCount"><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']/*[local-name()='emailRecipientsCount']"/></param>
  76. <param name="emailDescription"><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']/*[local-name()='emailRecipients']"/></param>
  77. <param name="printerSummary"><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']/*[local-name()='printerSummary']"/></param>
  78. <param name="hasRecipients"><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='UIHelpers']/*[local-name()='hasRecipients']"/></param>
  79. </xsl:when>
  80. <xsl:otherwise>
  81. <xsl:call-template name="dt:generateUIHelpersFromOptions">
  82. <xsl:with-param name="queryReplyPath" select="/root/agent_definition/*[local-name()='agentOptions']"/>
  83. <xsl:with-param name="appendPath" select="'/root/env'"/>
  84. <xsl:with-param name="currentReply" select="'1'"/>
  85. <xsl:with-param name="genParams" select="true()"/>
  86. </xsl:call-template>
  87. </xsl:otherwise>
  88. </xsl:choose>
  89. <!-- delete any reportOptions-->
  90. <xts:delete select="/root/env/param[@name='reportOptions']" mandatory="false"/>
  91. </xts:sequence>
  92. </xsl:template>
  93. <dt:generateUIHelpersFromOptions/>
  94. </xsl:stylesheet>
  95. </xts:block>
  96. <!--
  97. ===============================================================================================
  98. get the information for the agent - we only need the defaultName thought for the time being
  99. ===============================================================================================
  100. -->
  101. <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="createROParamsForAgentDefaults">
  102. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  103. <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/">
  104. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  105. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  106. <xsl:template match="/">
  107. <xts:sequence>
  108. <xts:append>
  109. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  110. <send:request provider="cm" requester="AGS:addIndex">
  111. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  112. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  113. <search>
  114. <!-- Get the report - we know only it's search path now -->
  115. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  116. </search>
  117. <properties>
  118. <property name="defaultName"/>
  119. <property name="searchPath"/>
  120. </properties>
  121. </query>
  122. </xts:transform>
  123. </send:request>
  124. </xts:transform>
  125. </xts:append>
  126. </xts:sequence>
  127. </xsl:template>
  128. </xsl:stylesheet>
  129. </xts:block>
  130. <!--
  131. ===============================================================================================
  132. onAgentLoaded - the agent has been loaded and this task visited, unpack the cmOptions if they exist and set the overrideMode
  133. value to true, the basic rule is that if options exist then the user has overridden the content maintenance options at the task level
  134. ===============================================================================================
  135. -->
  136. <xts:block id="onAgentLoaded" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='']" mandatory="false" dependency="getSelectedPath">
  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. <!-- set the overridden state-->
  148. <xsl:variable name="overriddenTaskOptions">
  149. <xsl:choose>
  150. <xsl:when test="/root/env/param[@name='cmOptions']"><xsl:text>true</xsl:text></xsl:when>
  151. <xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
  152. </xsl:choose>
  153. </xsl:variable>
  154. <xts:sequence>
  155. <!-- unpack the options-->
  156. <xsl:if test="$overriddenTaskOptions='true'">
  157. <xsl:variable name="options">
  158. <xsl:value-of select="/root/env/param[@name='cmOptions']"/>
  159. </xsl:variable>
  160. <xts:append select="/root">
  161. <xts:transform name="XMLDecode">
  162. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_onagentloaded__settemplateid_addcontmgt001',string($options)), true() )" disable-output-escaping="yes"/>
  163. </xts:transform>
  164. </xts:append>
  165. </xsl:if>
  166. <!-- add index_option_mode and overrideMode to the environment-->
  167. <xts:append select="/root/env">
  168. <param name="index_option_mode">
  169. <xsl:choose>
  170. <xsl:when test="$overriddenTaskOptions='true'">
  171. <xts:queryNode select="/root/cmOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item'][name='force']/*[local-name()='value']"/>
  172. </xsl:when>
  173. <xsl:otherwise><xsl:text>true</xsl:text></xsl:otherwise>
  174. </xsl:choose>
  175. </param>
  176. <!--param name="index_option_mode"><xsl:value-of select="$force"/></param-->
  177. <param name="overrideMode"><xsl:value-of select="$overriddenTaskOptions"/></param>
  178. </xts:append>
  179. <!-- tidy -->
  180. <xts:delete select="/root/env/param[@name='cmOptions']" mandatory="false"/>
  181. <xts:delete select="/root/cmOptions" mandatory="false"/>
  182. </xts:sequence>
  183. </xsl:template>
  184. </xsl:stylesheet>
  185. </xts:block>
  186. <!--
  187. ===============================================================================================
  188. updateCMMode - update the mode based on whether the agent defaults have been set, the value of index_option_mode dictates
  189. how the UI is rendered
  190. ===============================================================================================
  191. -->
  192. <xts:block id="updateOptions" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name = 'selected_path']!='']" mandatory="false" dependency="onAgentLoaded">
  193. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  194. <xts:logicsheet path="logicsheets/portal.xsl"/>
  195. <xsl:stylesheet version="1.0"
  196. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  197. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  198. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  199. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl xtsext xts pf">
  200. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  201. <pf:variables/>
  202. <xsl:template match="/">
  203. <xsl:variable name="cmOptions" select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
  204. <!-- index_option_mode=false for 'find and fix' and true for 'find only'-->
  205. <!--******find ******-->
  206. <xsl:variable name="force">
  207. <xsl:choose>
  208. <!-- the user has overridden the mode at the task level-->
  209. <xsl:when test="/root/env/param[@name='overrideMode']='true'">
  210. <xsl:value-of select="/root/env/param[@name='m_io_force']"/>
  211. </xsl:when>
  212. <!-- the user has overridden the mode at the agent level-->
  213. <xsl:when test="/root/agent_definition/agentOptions/form-vars/param[@name='override_default_index_update_task_options']='true'">
  214. <xsl:value-of select="$cmOptions[name='indexOptionBoolean']/*[local-name()='value']"/>
  215. </xsl:when>
  216. <!-- the default setting-->
  217. <xsl:otherwise><xsl:text>true</xsl:text></xsl:otherwise>
  218. </xsl:choose>
  219. </xsl:variable>
  220. <!--xsl:message>agent overridden?:<xsl:value-of select="/root/agent_definition/agentOptions/form-vars/param[@name='override_default_content_task_options']"/></xsl:message>
  221. <xsl:message>task overridden?:<xsl:value-of select="/root/env/param[@name='overrideMode']"/></xsl:message>
  222. <xsl:message>index_option_mode:<xsl:value-of select="/root/env/param[@name='index_option_mode']"/></xsl:message>
  223. <xsl:message>find:<xsl:value-of select="$force"/></xsl:message-->
  224. <!-- update/create the mode -->
  225. <xts:sequence>
  226. <!-- tidy -->
  227. <xts:delete select="/root/env/param[@name='cmOptions']"/>
  228. <xsl:choose>
  229. <!-- update -->
  230. <xsl:when test="/root/env/param[@name='m_io_force']">
  231. <xts:update select="/root/env/param[@name='index_option_mode']">
  232. <param name="index_option_mode">
  233. <xsl:value-of select="$force"/>
  234. </param>
  235. </xts:update>
  236. </xsl:when>
  237. <!-- create -->
  238. <xsl:otherwise>
  239. <xts:append select="/root/env">
  240. <param name="m_io_force">
  241. <xsl:value-of select="$force"/>
  242. </param>
  243. </xts:append>
  244. </xsl:otherwise>
  245. </xsl:choose>
  246. </xts:sequence>
  247. <!-- create the content maintenance options in CM format-->
  248. <xts:sequence>
  249. <xts:append select="/root">
  250. <cmOptions>
  251. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  252. <root>
  253. <xts:transform src="transforms/portal/options/buildOptionItems.xslt" processor="XSLT">
  254. <root>
  255. <env>
  256. <param name="m_io_force">
  257. <xsl:choose>
  258. <xsl:when test="$force='true'">
  259. <xsl:text>true</xsl:text>
  260. </xsl:when>
  261. <xsl:otherwise>
  262. <xsl:text>false</xsl:text>
  263. </xsl:otherwise>
  264. </xsl:choose>
  265. </param>
  266. </env>
  267. <xts:transform name="XML" src="portal/options.xml"/>
  268. <contentLocale>
  269. <xsl:value-of select="$contentLocale"/>
  270. </contentLocale>
  271. <optionType>indexOptions</optionType>
  272. <genDefaults>false</genDefaults>
  273. </root>
  274. </xts:transform>
  275. </root>
  276. </xts:transform>
  277. </cmOptions>
  278. </xts:append>
  279. </xts:sequence>
  280. </xsl:template>
  281. </xsl:stylesheet>
  282. </xts:block>
  283. <!--
  284. ===============================================================================================
  285. encodeCMOptions
  286. Serialize the content maintenance options only when we have /root/cmOptions and the user has overridden one of them
  287. ===============================================================================================
  288. -->
  289. <xts:block id="encodeOptions" dependency="updateOptions" type="exec" mode="interpret" processor="XSLT" condition=".[/root/cmOptions!='']" mandatory="false">
  290. <!--and /root/env/param[@name='overrideMode']='true'-->
  291. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  292. <xts:logicsheet path="logicsheets/portal.xsl"/>
  293. <xsl:stylesheet version="1.0"
  294. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  295. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  296. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  297. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  298. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  299. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  300. exclude-result-prefixes="xsl xts pf cm dt xtsext">
  301. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  302. <pf:variables/>
  303. <pf:serialize-xml/>
  304. <xsl:template match="/">
  305. <xts:sequence>
  306. <xsl:variable name="markup">
  307. <xsl:call-template name="serialize-xml">
  308. <xsl:with-param name="node-set" select="/root/cmOptions"/>
  309. </xsl:call-template>
  310. </xsl:variable>
  311. <xts:append select="/root/env">
  312. <param name="cmOptions">
  313. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup ),true()))"/>
  314. </param>
  315. </xts:append>
  316. <xts:delete select="/root/cmOptions"/>
  317. </xts:sequence>
  318. </xsl:template>
  319. </xsl:stylesheet>
  320. </xts:block>
  321. <!--
  322. ===============================================================================================
  323. returnResult - We're done with the email options morphlet, so return the appropriate response
  324. ===============================================================================================
  325. -->
  326. <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="encodeOptions">
  327. <xts:logicsheet path="logicsheets/portal.xsl"/>
  328. </xts:block>
  329. <!--
  330. ===============================================================================================
  331. genMarkup -
  332. ===============================================================================================
  333. -->
  334. <xts:block id="genMarkup" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] " dependency="returnResult">
  335. <!-- logicsheets -->
  336. <!-- portal specific information -->
  337. <xts:logicsheet path="logicsheets/portal.xsl"/>
  338. <!-- agent studio logicsheets -->
  339. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  340. <xts:logicsheet path="logicsheets/contentadmin.xsl"/>
  341. <!-- Dialog specific logicsheets -->
  342. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  343. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  344. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  345. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  346. <!-- Generic logicsheets -->
  347. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  348. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  349. <!-- apply the form logic -->
  350. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  351. <!-- Prevent the href from appearing in the status bar. -->
  352. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  353. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  354. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  355. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  356. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  357. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  358. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  359. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  360. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  361. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  362. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  363. xmlns:adm="http://developer.cognos.com/schemas/xts/logicsheets/contentadmin/"
  364. 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 adm">
  365. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  366. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  367. <pf:variables/>
  368. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  369. <xsl:variable name="spacer">
  370. <img height="10" width="10">
  371. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  372. </img>
  373. </xsl:variable>
  374. <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
  375. <xsl:variable name="hasTask">
  376. <xsl:choose>
  377. <xsl:when test="key('env-param','selected_path') != ''">
  378. <xsl:text>true</xsl:text>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <xsl:text>false</xsl:text>
  382. </xsl:otherwise>
  383. </xsl:choose>
  384. </xsl:variable>
  385. <xsl:template match="/">
  386. <xts:sequence>
  387. <xts:append select="/root/output">
  388. <xos:part>
  389. <xos:entityHeader>
  390. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  391. </xos:entityHeader>
  392. <xos:entityBody>
  393. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  394. <markup>
  395. <xts:transform name="XMLEncode">
  396. <utml:form name="pform">
  397. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  398. <!-- ================================================================ -->
  399. <!-- H E A D E R -->
  400. <!-- ================================================================ -->
  401. <utml:exclusion-list>
  402. <xsl:value-of select="' pageitem '"/>
  403. </utml:exclusion-list>
  404. <agsdlg:header>
  405. <dp:image>
  406. <img alt="" border="0">
  407. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_index_update_24.gif</xsl:attribute>
  408. </img>
  409. </dp:image>
  410. <dp:title>
  411. <xts:string id="DIALOG_INDEX_TITLE"/>
  412. </dp:title>
  413. <dp:description>
  414. <xts:string id="DIALOG_INDEX_DESCRIPTION"/>
  415. </dp:description>
  416. </agsdlg:header>
  417. <utml:input type="hidden" name="report_visited" id="report_visited" value="true"/>
  418. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false">
  419. <utml:value>
  420. <xsl:choose>
  421. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:indexUpdateTask/cm:defaultName != '' ">
  422. <xsl:value-of select="/root/cm:queryResponse/cm:indexUpdateTask/cm:defaultName"/>
  423. </xsl:when>
  424. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  425. <xsl:value-of select="key('env-param', 'taskName')"/>
  426. </xsl:when>
  427. </xsl:choose>
  428. </utml:value>
  429. </utml:input>
  430. <!-- ================================================================ -->
  431. <!-- B O D Y -->
  432. <!-- ================================================================ -->
  433. <!-- Define a new layout-->
  434. <lyt:layout style="2">
  435. <!-- create a new row, each row includes a spacer -->
  436. <lyt:section>
  437. <dp:textarea section3_align="left">
  438. <!-- the indexUpdateTask name label-->
  439. <dp:section1>
  440. <xts:string id="DIALOG_INDEX_LABEL"/>
  441. </dp:section1>
  442. <dp:section2>
  443. <!-- get the name of the indexUpdateTask -->
  444. <xsl:choose>
  445. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:indexUpdateTask/cm:defaultName != '' ">
  446. <!--xsl:copy-of select="$spacer"/-->
  447. <xsl:value-of select="/root/cm:queryResponse/cm:indexUpdateTask/cm:defaultName"/>
  448. </xsl:when>
  449. <xsl:otherwise>
  450. <xts:string id="DIALOG_MESSAGE_NONE"/>
  451. </xsl:otherwise>
  452. </xsl:choose>
  453. </dp:section2>
  454. <dp:section3>
  455. <a href="#" onclick="doSelectObject('indexUpdateTask.es', '{xtsext:javascriptencode(/root/env/param[@name = 'selected_path'])}')">
  456. <xts:string id="SELECT_INDEX"/>
  457. </a>
  458. </dp:section3>
  459. </dp:textarea>
  460. </lyt:section>
  461. <lyt:section>
  462. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  463. </lyt:section>
  464. </lyt:layout>
  465. <!-- add the option block -->
  466. <adm:forceOptionRadioButtons/>
  467. <dp:emptyFooter/>
  468. <script type="text/javascript">
  469. function init() {
  470. <xsl:if test="not(/root/env/param[@name='report_visited'])">
  471. <xsl:if test="not(/root/env/param[@name='selected_path'])">
  472. doSelectObject('indexUpdateTask.es')
  473. </xsl:if>
  474. </xsl:if>
  475. }
  476. /*
  477. * validate the report page and popup an appropriate alert message
  478. */
  479. function validate() {
  480. var hasTask = <xsl:value-of select="string($hasTask)"/>;
  481. var isValid = true;
  482. if (hasTask==false) {
  483. isValid = false;
  484. alert(&quot;<xts:string id="DIALOG_INDEX_NO_INDEX_TASK" encode="javascript"/>&quot;);
  485. }
  486. return isValid;
  487. }
  488. /*
  489. * set scope of this index
  490. */
  491. function setScope( option ){
  492. var index_scope = document.getElementById('index_scope_all');
  493. index_scope.value = option;
  494. }
  495. </script>
  496. </utml:form>
  497. </xts:transform>
  498. </markup>
  499. </xsl:element>
  500. </xos:entityBody>
  501. </xos:part>
  502. </xts:append>
  503. </xts:sequence>
  504. </xsl:template>
  505. </xsl:stylesheet>
  506. </xts:block>
  507. <!--
  508. ===============================================================================================
  509. debug - special debug block for nested requests
  510. ===============================================================================================
  511. -->
  512. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  513. <!-- Get the debug logic sheet -->
  514. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  515. <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">
  516. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  517. <xsl:template match="/">
  518. <dbg:dumpxml select="/root"/>
  519. </xsl:template>
  520. </xsl:stylesheet>
  521. </xts:block>
  522. </xts:morphlet>