addPlanningMacro.xts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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">
  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. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <!--
  34. ===============================================================================================
  35. get the information for the agent - we only need the defaultName thought for the time being
  36. ===============================================================================================
  37. -->
  38. <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">
  39. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  40. <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/">
  41. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  42. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  43. <xsl:template match="/">
  44. <xts:sequence>
  45. <xts:append>
  46. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  47. <send:request provider="cm" requester="AGS:addPlanningMacro">
  48. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  49. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  50. <search>
  51. <!-- Get the report - we know only it's search path now -->
  52. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  53. </search>
  54. <properties>
  55. <property name="defaultName"/>
  56. <property name="searchPath"/>
  57. </properties>
  58. </query>
  59. </xts:transform>
  60. </send:request>
  61. </xts:transform>
  62. </xts:append>
  63. </xts:sequence>
  64. </xsl:template>
  65. </xsl:stylesheet>
  66. </xts:block>
  67. <!--
  68. ===============================================================================================
  69. returnResult - We're done with the email options morphlet, so return the appropriate response
  70. ===============================================================================================
  71. -->
  72. <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="getSelectedPath">
  73. <xts:logicsheet path="logicsheets/portal.xsl"/>
  74. </xts:block>
  75. <!--
  76. ===============================================================================================
  77. genMarkup -
  78. ===============================================================================================
  79. -->
  80. <xts:block id="genMarkup" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] " dependency="returnResult">
  81. <!-- logicsheets -->
  82. <!-- portal specific information -->
  83. <xts:logicsheet path="logicsheets/portal.xsl"/>
  84. <!-- agent studio logicsheets -->
  85. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  86. <!-- Dialog specific logicsheets -->
  87. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  88. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  89. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  90. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  91. <!-- Generic logicsheets -->
  92. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  93. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  94. <!-- apply the form logic -->
  95. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  96. <!-- Prevent the href from appearing in the status bar. -->
  97. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  98. <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">
  99. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  100. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  101. <pf:variables/>
  102. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  103. <xsl:variable name="spacer">
  104. <img height="10" width="10">
  105. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  106. </img>
  107. </xsl:variable>
  108. <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
  109. <xsl:variable name="hasTask">
  110. <xsl:choose>
  111. <xsl:when test="key('env-param','selected_path') != ''"><xsl:text>true</xsl:text></xsl:when>
  112. <xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
  113. </xsl:choose>
  114. </xsl:variable>
  115. <xsl:template match="/">
  116. <xts:sequence>
  117. <xts:append select="/root/output">
  118. <xos:part>
  119. <xos:entityHeader>
  120. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  121. </xos:entityHeader>
  122. <xos:entityBody>
  123. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  124. <markup>
  125. <xts:transform name="XMLEncode">
  126. <utml:form name="pform">
  127. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  128. <!-- ================================================================ -->
  129. <!-- H E A D E R -->
  130. <!-- ================================================================ -->
  131. <utml:exclusion-list><xsl:value-of select="' pageitem '"/></utml:exclusion-list>
  132. <agsdlg:header>
  133. <dp:image>
  134. <img alt="" border="0">
  135. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_import_24.gif</xsl:attribute>
  136. </img>
  137. </dp:image>
  138. <dp:title>
  139. <xts:string id="DIALOG_PLANNING_MACRO_TITLE"/>
  140. </dp:title>
  141. <dp:description>
  142. <xts:string id="DIALOG_PLANNING_MACRO_DESCRIPTION"/>
  143. </dp:description>
  144. </agsdlg:header>
  145. <utml:input type="hidden" name="report_visited" id="report_visited" value="true"/>
  146. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false">
  147. <utml:value>
  148. <xsl:choose>
  149. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:planningMacroTask/cm:defaultName != '' ">
  150. <xsl:value-of select="/root/cm:queryResponse/cm:planningMacroTask/cm:defaultName"/>
  151. </xsl:when>
  152. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  153. <xsl:value-of select="key('env-param', 'taskName')"/>
  154. </xsl:when>
  155. </xsl:choose>
  156. </utml:value>
  157. </utml:input>
  158. <!-- ================================================================ -->
  159. <!-- B O D Y -->
  160. <!-- ================================================================ -->
  161. <!-- Define a new layout-->
  162. <lyt:layout style="2">
  163. <!-- create a new row, each row includes a spacer -->
  164. <lyt:section>
  165. <dp:textarea section3_align="left">
  166. <!-- the import name label-->
  167. <dp:section1>
  168. <xts:string id="DIALOG_PLANNING_MACRO_LABEL"/>
  169. </dp:section1>
  170. <dp:section2>
  171. <!-- get the name of the import -->
  172. <xsl:choose>
  173. <xsl:when test="$hasTask='true' and /root/cm:queryResponse/cm:planningMacroTask/cm:defaultName != '' ">
  174. <!--xsl:copy-of select="$spacer"/-->
  175. <xsl:value-of select="/root/cm:queryResponse/cm:planningMacroTask/cm:defaultName"/>
  176. </xsl:when>
  177. <xsl:otherwise>
  178. <xts:string id="DIALOG_MESSAGE_NONE"/>
  179. </xsl:otherwise>
  180. </xsl:choose>
  181. </dp:section2>
  182. <dp:section3>
  183. <a href="#" onclick="doSelectObject('planningMacroTask.es', '{xtsext:javascriptencode(/root/env/param[@name = 'selected_path'])}')">
  184. <xts:string id="SELECT_PLANNING_MACRO"/>
  185. </a>
  186. </dp:section3>
  187. </dp:textarea>
  188. </lyt:section>
  189. <lyt:section>
  190. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  191. </lyt:section>
  192. </lyt:layout>
  193. <dp:emptyFooter/>
  194. <script type="text/javascript">
  195. function init() {
  196. <xsl:if test="not(/root/env/param[@name='report_visited'])">
  197. <xsl:if test="not(/root/env/param[@name='selected_path'])">
  198. doSelectObject('planningMacroTask.es')
  199. </xsl:if>
  200. </xsl:if>
  201. }
  202. /*
  203. * validate the report page and popup an appropriate alert message
  204. */
  205. function validate() {
  206. var hasTask = <xsl:value-of select="string($hasTask)"/>;
  207. var isValid = true;
  208. if (hasTask==false) {
  209. isValid = false;
  210. alert(&quot;<xts:string id="DIALOG_PLANNING_NO_PLANNING_MACRO_TASK" encode="javascript"/>&quot;);
  211. }
  212. return isValid;
  213. }
  214. </script>
  215. </utml:form>
  216. </xts:transform>
  217. </markup>
  218. </xsl:element>
  219. </xos:entityBody>
  220. </xos:part>
  221. </xts:append>
  222. </xts:sequence>
  223. </xsl:template>
  224. </xsl:stylesheet>
  225. </xts:block>
  226. <!--
  227. ===============================================================================================
  228. debug - special debug block for nested requests
  229. ===============================================================================================
  230. -->
  231. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  232. <!-- Get the debug logic sheet -->
  233. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  234. <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">
  235. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  236. <xsl:template match="/">
  237. <dbg:dumpxml select="/root"/>
  238. </xsl:template>
  239. </xsl:stylesheet>
  240. </xts:block>
  241. </xts:morphlet>