addAgent.xts 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  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="false" requiredCapability="canUseEventStudio">
  9. <!--
  10. ===============================================================================================
  11. whip out the parameters that were saved off previously
  12. ===============================================================================================
  13. -->
  14. <xts:block id="decodeExistingParameters" path="/ags/parameters/decodeExistingParameters.xslt" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' ]" mandatory="false">
  15. <xts:logicsheet path="logicsheets/portal.xsl"/>
  16. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  17. </xts:block>
  18. <!--
  19. ================================================================================
  20. decode the the model item parameters from the form fields and update the parameters block
  21. ===============================================================================================
  22. -->
  23. <xts:block id="mergeModelParameters" path="/ags/parameters/mergeModelParameters.xslt" processor="XSLT" type="exec" mode="interpret" dependency="decodeExistingParameters" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished'] " mandatory="false"/>
  24. <!--
  25. ================================================================================
  26. if We have just come back from a jaunt round the report server, update the agent task blob
  27. ===============================================================================================
  28. -->
  29. <xts:block id="createParametersBlob" path="/ags/parameters/createParametersBlob.xslt" dependency="mergeModelParameters" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished'] " mandatory="false">
  30. <xts:logicsheet path="logicsheets/portal.xsl"/>
  31. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  32. </xts:block>
  33. <!--
  34. ===============================================================================================
  35. returnResult - We're done with the email options morphlet, so return the appropriate response
  36. ===============================================================================================
  37. -->
  38. <xts:block id="returnResult" path="/ags/tabResultTemplate.xslt" type="exec" dependency="createParametersBlob" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" mandatory="false">
  39. <xts:logicsheet path="logicsheets/portal.xsl"/>
  40. </xts:block>
  41. <!--
  42. ===============================================================================================
  43. Get the information about agent
  44. ===============================================================================================
  45. -->
  46. <xts:block id="getContent" dependency="returnResult" 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">
  47. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  48. <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/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/">
  49. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  50. <xsl:template match="/">
  51. <xts:sequence>
  52. <xts:append>
  53. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  54. <send:request provider="cm" requester="AGS:load_agent">
  55. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  56. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  57. <cm:requests>
  58. <cm:query>
  59. <cm:search>
  60. <!-- Get the agent - we know only it's search path now -->
  61. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  62. </cm:search>
  63. <cm:properties>
  64. <cm:property name="defaultName"/>
  65. <cm:property name="searchPath"/>
  66. <cm:property name="permissions"/>
  67. </cm:properties>
  68. </cm:query>
  69. </cm:requests>
  70. </cm:query>
  71. </xts:transform>
  72. </send:request>
  73. </xts:transform>
  74. </xts:append>
  75. </xts:sequence>
  76. </xsl:template>
  77. </xsl:stylesheet>
  78. </xts:block>
  79. <!--
  80. ===============================================================================================
  81. Now that we have the base object details. Find out if it is an agent or agentView and modify the searchPath accordingly.
  82. Then make the call to get the needed report spec information.
  83. ===============================================================================================
  84. -->
  85. <xts:block id="checkObjectType" dependency="getContent" 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">
  86. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  87. <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/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/">
  88. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  89. <xsl:template match="/">
  90. <xts:sequence>
  91. <xsl:variable name="obj_path">
  92. <xsl:value-of select="/root/env/param[@name='selected_path']"/>
  93. <xsl:choose>
  94. <xsl:when test="/root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' ]/cm:defaultName">
  95. <xsl:text>/report</xsl:text>
  96. </xsl:when>
  97. <xsl:otherwise>
  98. <xsl:text>/reportView</xsl:text>
  99. </xsl:otherwise>
  100. </xsl:choose>
  101. </xsl:variable>
  102. <!-- now that we can tell if its a view or normal agent. Get the report details and append to where they ought to be-->
  103. <xts:append select="/root/*[local-name()='queryResponse']">
  104. <xts:transform src="ags/transforms/getChildren.xslt" processor="XSLT">
  105. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  106. <send:request provider="cm" requester="AGS:load_agent">
  107. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  108. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  109. <cm:requests>
  110. <cm:query>
  111. <cm:search>
  112. <!-- Get the report - we want its package for the routing -->
  113. <xsl:value-of select="$obj_path"/>
  114. </cm:search>
  115. <cm:properties>
  116. <cm:property name="searchPath"/>
  117. <cm:property name="metadataModelPackage"/>
  118. <cm:property name="metadataModel"/>
  119. <cm:property name="permissions"/>
  120. </cm:properties>
  121. <cm:options>
  122. <cm:refProps>
  123. <!-- get metadataModelPackage of the base properties using refProps incase we have a report view -->
  124. <cm:refProp refPropName="base">
  125. <cm:properties>
  126. <cm:property name="metadataModelPackage"/>
  127. </cm:properties>
  128. </cm:refProp>
  129. </cm:refProps>
  130. </cm:options>
  131. </cm:query>
  132. </cm:requests>
  133. </cm:query>
  134. </xts:transform>
  135. </send:request>
  136. </xts:transform>
  137. </xts:transform>
  138. </xts:append>
  139. <xts:append>
  140. <!--set up the next block -->
  141. <routingServerGroup>
  142. <objectPath><xts:queryNode select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']//*[local-name()='metadataModelPackage']//*[local-name()='searchPath']/text()"/></objectPath>
  143. <objectPath><xsl:value-of select="/root/env/param[@name = 'selected_path']"/></objectPath>
  144. </routingServerGroup>
  145. <model><xts:queryNode select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']//*[local-name()='metadataModel']//*[local-name()='searchPath']/text()"/></model>
  146. </xts:append>
  147. </xts:sequence>
  148. </xsl:template>
  149. </xsl:stylesheet>
  150. </xts:block>
  151. <xts:block id="getRouting" dependency="checkObjectType" path="/ags/determineRouting.xslt" 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"/>
  152. <!--
  153. ================================================================================
  154. encode the agent items again
  155. ================================================================================
  156. -->
  157. <xts:block id="buildContext" dependency="getRouting" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  158. <xts:logicsheet path="logicsheets/portal.xsl"/>
  159. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf cm xts xtsext">
  160. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  161. <pf:serialize-xml/>
  162. <pf:variables/>
  163. <xsl:template match="/">
  164. <xts:sequence>
  165. <xsl:variable name="markup">
  166. <xsl:call-template name="serialize-xml">
  167. <xsl:with-param name="node-set">
  168. <xsl:call-template name="buildContext"/>
  169. </xsl:with-param>
  170. </xsl:call-template>
  171. </xsl:variable>
  172. <xts:append select="/root/env">
  173. <param name="context">
  174. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_dialogadapter003'), xtsext:web64encode( string( $markup ), true()))"/>
  175. </param>
  176. </xts:append>
  177. </xts:sequence>
  178. </xsl:template>
  179. <!-- build the context -->
  180. <xsl:template name="buildContext">
  181. <context>
  182. <env>
  183. <xsl:variable name="selected_path_var">
  184. <xsl:value-of select="/root/env/param[@name='selected_path']"/>
  185. <xsl:choose>
  186. <xsl:when test=" /root/cm:queryResponse/cm:queryReply[1]//cm:objectClass = 'agentDefinition' ">
  187. <xsl:text>/report</xsl:text>
  188. </xsl:when>
  189. <xsl:otherwise>
  190. <xsl:text>/reportView</xsl:text>
  191. </xsl:otherwise>
  192. </xsl:choose>
  193. </xsl:variable>
  194. <!-- copy all the values which we need -->
  195. <param name="selected_path">
  196. <xsl:value-of select="$selected_path_var"/>
  197. </param>
  198. <!-- taskParameters is what stores the current values of the parameters/assignments -->
  199. <!-- only pass taskParameters into the context if the report is the same as it was last time -
  200. we don't want parameters which are defined on reportA being used on reportB -->
  201. <xsl:if test="not(/root/env/param[@name='m_obj']) or (/root/env/param[@name='m_obj'] = $selected_path_var)">
  202. <xsl:copy-of select="/root/env/param[@name='taskParameters']"/>
  203. </xsl:if>
  204. <!-- the m_rp_parameters which is the end result of the prompt pages -->
  205. <xsl:copy-of select="/root/env/param[@name='m_rp_parameters']"/>
  206. <!-- the pv_ items - which is all the settings for parameters in the UI/drop down/input box -->
  207. <xsl:copy-of select="/root/env/param[starts-with(@name, 'pv_')]"/>
  208. </env>
  209. </context>
  210. </xsl:template>
  211. </xsl:stylesheet>
  212. </xts:block>
  213. <!--
  214. ===============================================================================================
  215. genMarkup -
  216. ===============================================================================================
  217. -->
  218. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="buildContext" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']]" mandatory="false">
  219. <!-- logicsheets -->
  220. <xts:logicsheet path="ags/logicsheets/promptValues.xslt"/>
  221. <!-- the define condition ui -->
  222. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  223. <!-- portal specific information -->
  224. <xts:logicsheet path="logicsheets/portal.xsl"/>
  225. <!-- Dialog specific logicsheets -->
  226. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  227. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  228. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  229. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  230. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  231. <!-- Generic templates -->
  232. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  233. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  234. <!-- apply the form logic -->
  235. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  236. <!-- Prevent the href from appearing in the status bar. -->
  237. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  238. <xsl:stylesheet version="1.0"
  239. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  240. xmlns:out="http://www.w3.org/1999/XSL/Transform"
  241. xmlns:agspmt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/promptValues/"
  242. xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/"
  243. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  244. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  245. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  246. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  247. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  248. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  249. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  250. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  251. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  252. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  253. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  254. exclude-result-prefixes="xsl out agspmt xsi agsdlg pf xtsext lyt dp df utml xts xos cm">
  255. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  256. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  257. <pf:variables/>
  258. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  259. <xsl:variable name="spacer">
  260. <img height="10" width="10">
  261. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  262. </img>
  263. </xsl:variable>
  264. <!-- declared a variable to determine if a report has been selected, used for validation purposes-->
  265. <xsl:variable name="hasReport">
  266. <xsl:choose>
  267. <xsl:when test="key('env-param','selected_path') != '' and /root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' or local-name()='agentDefinitionView']/cm:defaultName">
  268. <xsl:text>true</xsl:text>
  269. </xsl:when>
  270. <xsl:otherwise>
  271. <xsl:text>false</xsl:text>
  272. </xsl:otherwise>
  273. </xsl:choose>
  274. </xsl:variable>
  275. <xsl:template match="/">
  276. <xts:sequence>
  277. <xts:append select="/root/output">
  278. <xos:part>
  279. <xos:entityHeader>
  280. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  281. </xos:entityHeader>
  282. <xos:entityBody>
  283. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  284. <markup>
  285. <xts:transform name="XMLEncode">
  286. <utml:form name="pform">
  287. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  288. <!-- ================================================================ -->
  289. <!-- H E A D E R -->
  290. <!-- ================================================================ -->
  291. <utml:exclude-prefix>
  292. <xsl:value-of select="'pv_'"/>
  293. </utml:exclude-prefix>
  294. <!-- exclusion list should remove certain items but definately those which are passed in context to the async call -->
  295. <utml:exclusion-list><xsl:value-of select="' m_obj method cleared_prompts pageitem context m_rp_parameters has_prompts updatedTaskParameters '"/></utml:exclusion-list>
  296. <agsdlg:header>
  297. <dp:image>
  298. <img alt="" border="0">
  299. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_agent_24.gif</xsl:attribute>
  300. </img>
  301. </dp:image>
  302. <dp:title>
  303. <xts:string id="DIALOG_AGENT_TITLE"/>
  304. </dp:title>
  305. <dp:description>
  306. <xts:string id="DIALOG_AGENT_DESCRIPTION"/>
  307. </dp:description>
  308. </agsdlg:header>
  309. <!-- need this to be included by default -->
  310. <script type="text/javascript" src="../ags/dragDropHandler.js"/>
  311. <utml:input type="hidden" name="taskParameters" id="taskParameters"/>
  312. <!-- default value will bring in both agents and views -->
  313. <!--utml:input type="hidden" name="ags_select" value="default" utml:update="false"/>
  314. <utml:input type="hidden" name="m_class" value="agentDefinition" utml:update="false"/-->
  315. <utml:input type="hidden" name="report_visited" id="report_visited" value="true"/>
  316. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false">
  317. <utml:value>
  318. <xsl:choose>
  319. <xsl:when test="$hasReport='true' and /root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' or local-name()='agentDefinitionView']/cm:defaultName != '' ">
  320. <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' or local-name()='agentDefinitionView']/cm:defaultName"/>
  321. </xsl:when>
  322. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  323. <xsl:value-of select="key('env-param', 'taskName')"/>
  324. </xsl:when>
  325. </xsl:choose>
  326. </utml:value>
  327. </utml:input>
  328. <utml:input type="hidden" name="ui.routingServerGroup" id="ui.routingServerGroup" utml:update="false">
  329. <utml:value>
  330. <xsl:value-of select="/root/routingServerGroup/*[local-name() = 'result'][last()]"/>
  331. </utml:value>
  332. </utml:input>
  333. <utml:input type="hidden" name="model" id="model" utml:update="false">
  334. <utml:value>
  335. <xsl:value-of select="/root/model"/>
  336. </utml:value>
  337. </utml:input>
  338. <!-- ================================================================ -->
  339. <!-- B O D Y -->
  340. <!-- ================================================================ -->
  341. <!-- Define a new layout-->
  342. <lyt:layout style="2">
  343. <!-- create a new row, each row includes a spacer -->
  344. <lyt:section>
  345. <dp:textarea section3_align="left">
  346. <!-- the agent name label-->
  347. <dp:section1>
  348. <xts:string id="DIALOG_AGENT_LABEL"/>
  349. </dp:section1>
  350. <!-- the agent name input-->
  351. <dp:section2>
  352. <!-- get the name of the Agent -->
  353. <xsl:choose>
  354. <xsl:when test="$hasReport = 'true' and /root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' or local-name()='agentDefinitionView']/cm:defaultName != '' ">
  355. <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' or local-name()='agentDefinitionView']/cm:defaultName"/>
  356. </xsl:when>
  357. <xsl:otherwise>
  358. <xsl:text>
  359. <xts:string id="DIALOG_MESSAGE_NONE"/>
  360. </xsl:text>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. </dp:section2>
  364. <dp:section3>
  365. <a href="#" onclick="doSelectObject('agentTask.es', '{xtsext:javascriptencode(/root/env/param[@name = 'selected_path'])}')">
  366. <xts:string id="SELECT_AN_AGENT"/>
  367. </a>
  368. </dp:section3>
  369. </dp:textarea>
  370. </lyt:section>
  371. <lyt:section>
  372. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  373. </lyt:section>
  374. </lyt:layout>
  375. <xsl:if test="$hasReport = 'true'">
  376. <lyt:layout style="1">
  377. <lyt:section width="100%">
  378. <dp:list title="DIALOG_PROMPT_OPTIONS" width="100%">
  379. <dp:section>
  380. <dp:hint wrap="wrap">
  381. <xts:string id="DIALOG_PROMPT_DESCRIPTION"/>
  382. </dp:hint>
  383. </dp:section>
  384. <dp:section>
  385. <div id="promptValuesDiv"/>
  386. </dp:section>
  387. </dp:list>
  388. </lyt:section>
  389. </lyt:layout>
  390. </xsl:if>
  391. <dp:emptyFooter/>
  392. <script type="text/javascript">
  393. function init() {
  394. <xsl:if test="/root/env/param[@name='selected_path']">
  395. parent.getConfigFrame().cfgSet("so.defaultLocation", "<xsl:value-of select="xtsext:javascriptencode(/root/env/param[@name='selected_path'])"/>/..");
  396. </xsl:if>
  397. <xsl:if test="not(/root/env/param[@name='report_visited'])">
  398. <xsl:if test="not(/root/env/param[@name='selected_path'])">
  399. doSelectObject('agentTask.es')
  400. </xsl:if>
  401. </xsl:if>
  402. <xsl:if test="$hasReport = 'true'">
  403. loadParameters();
  404. </xsl:if>
  405. //let the listener know that this is a promptable report task
  406. var taskId = "<xsl:value-of select="xtsext:javascriptencode(/root/req-params:requestParams/req-params:param[@name='tabSelectedID'])"/>";
  407. var reportName = "<xsl:value-of select="/root/cm:queryResponse/cm:agentDefinition/cm:defaultName"/>";
  408. var reportPath = "storeID(\'<xsl:value-of select="/root/cm:queryResponse/cm:agentDefinition/cm:storeID"/>\')";
  409. parent.getConfigFrame().getAgentItemsListener().setReportTask(taskId, reportName, reportPath);
  410. }
  411. function loadParameters() {
  412. var promptDiv = document.getElementById('promptValuesDiv');
  413. if (promptDiv) {
  414. var imgHTML = '&lt;img src="' + '<xsl:value-of select="xtsext:javascriptencode(string($skin_root))"/>' + '/prompting/images/loading_timed.gif"/&gt;';
  415. // SEC_INFO: loading_string values retrieved from AGS_language.xml messages file from the server
  416. promptDiv.innerHTML = imgHTML + parent.htmlEncode( parent.getConfigFrame().loading_string );
  417. }
  418. <!-- the actual path to the report - which is needed in the call to getParameters -
  419. have to build this by hand cause we want to run against the report under the agent -->
  420. <xsl:variable name="obj_path">
  421. <xsl:value-of select="/root/env/param[@name='selected_path']"/>
  422. <xsl:choose>
  423. <xsl:when test="/root/cm:queryResponse/cm:queryReply[1]//*[local-name()='agentDefinition' ]/cm:defaultName">
  424. <xsl:text>/report</xsl:text>
  425. </xsl:when>
  426. <xsl:otherwise>
  427. <xsl:text>/reportView</xsl:text>
  428. </xsl:otherwise>
  429. </xsl:choose>
  430. </xsl:variable>
  431. var taskId = "<xsl:value-of select="xtsext:javascriptencode(/root/req-params:requestParams/req-params:param[@name='tabSelectedID'])"/>";
  432. var obj = "<xsl:value-of select="xtsext:javascriptencode(string($obj_path))"/>";
  433. var context = "<xsl:value-of select="xtsext:javascriptencode(/root/env/param[@name='context'])"/>";
  434. <!-- SEC_INFO the request is not parsed as a string so should not be subject to an injection attack. See getParameters.js for details-->
  435. var request = parent.getConfigFrame().getGetParameterRequestString(obj, context, obj+taskId);
  436. <xsl:if test="not(/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]//*[local-name() ='permissions'][contains(., 'execute') and contains(., 'read')] )">
  437. request += "&amp;doSkip=true";
  438. </xsl:if>
  439. // do the request
  440. parent.getConfigFrame().startGetParametersRequest(request, parent.getConfigFrame().getGetParameterRequestString);
  441. }
  442. /*
  443. * validate the report page and popup an appropriate alert message
  444. */
  445. function validate() {
  446. var isValid = true;
  447. <xsl:if test="not($hasReport = 'true')">
  448. isValid = false;
  449. alert(&quot;<xts:string id="DIALOG_REPORT_NO_REPORT_NAME" encode="javascript"/>&quot;);
  450. </xsl:if>
  451. return isValid &amp;&amp; validatePromptPage();
  452. }
  453. </script>
  454. <!-- build the scripts needed for prompting -->
  455. <xsl:call-template name="promptValuesScript"/>
  456. </utml:form>
  457. </xts:transform>
  458. </markup>
  459. </xsl:element>
  460. </xos:entityBody>
  461. </xos:part>
  462. </xts:append>
  463. </xts:sequence>
  464. </xsl:template>
  465. <agspmt:promptValuesScript/>
  466. </xsl:stylesheet>
  467. </xts:block>
  468. <!--
  469. ===============================================================================================
  470. debug - special debug block for nested requests
  471. ===============================================================================================
  472. -->
  473. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  474. <!-- Get the debug logic sheet -->
  475. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  476. <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">
  477. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  478. <xsl:template match="/">
  479. <dbg:dumpxml select="/root"/>
  480. </xsl:template>
  481. </xsl:stylesheet>
  482. </xts:block>
  483. </xts:morphlet>