add_entries_bux.xts 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. ===============================================================================================
  14. USED BY BUX INTERFACE ONLY
  15. ===============================================================================================
  16. -->
  17. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  18. <!--
  19. ===============================================================================================
  20. initController - The first time this morphlet gets executed, set the controller_state to
  21. wizard_page1|markup to display the first page of the wizard.
  22. ===============================================================================================
  23. -->
  24. <xts:block id="initController" processor="XSLT" type="exec" condition=".[ not(/root/env/param[@name='controller_state']) ]" mandatory="false">
  25. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  26. <xsl:stylesheet version="1.0"
  27. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  28. exclude-result-prefixes="xsl">
  29. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  30. <xsl:template match="/">
  31. <xts:sequence>
  32. <xts:append select="/root/env">
  33. <param name="controller_state">addEntries|navigate</param>
  34. </xts:append>
  35. </xts:sequence>
  36. </xsl:template>
  37. </xsl:stylesheet>
  38. </xts:block>
  39. <!-- ======================================================== -->
  40. <!-- Session Management -->
  41. <!-- ======================================================== -->
  42. <!-- Reads session-sensitive info from CM -->
  43. <xts:block processor="XSLT" type="exec" mandatory="false"
  44. id="refreshSession"
  45. path="portal/cc/read_session.xml"
  46. condition=".[
  47. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  48. or /root/env/param[@name='m_reload']
  49. or /root/env/param[@name='m_root'] ]">
  50. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  51. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  52. </xts:block>
  53. <!-- Update the <session> element for this request. -->
  54. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
  55. condition=".[
  56. /root/newSession
  57. or /root/env/param[@name='ui']
  58. or /root/env/param[@name='d']
  59. or /root/env/param[starts-with(@name,'m_s_')]
  60. or /root/env/param[@name = 'resetSort'] ]"
  61. mandatory="false"/>
  62. <!-- Save changes to the state info in a cookie -->
  63. <xts:block mode="interpret" processor="XSLT" type="exec"
  64. id="setSession"
  65. path="portal/set_session.xml"
  66. dependency="buildSession"
  67. condition=".[/root/updateSession]"
  68. mandatory="false"/>
  69. <!--
  70. ===============================================================================================
  71. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  72. markup to be displayed or the expected results
  73. ===============================================================================================
  74. -->
  75. <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="initController setSession" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
  76. <xts:logicsheet path="logicsheets/portal.xsl"/>
  77. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  78. <xsl:stylesheet version="1.0"
  79. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  80. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  81. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  82. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  83. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  84. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  85. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  86. <xsl:template match="/">
  87. <xts:sequence>
  88. <dlgctrl:XTS2Request>
  89. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  90. <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
  91. <req-params:param name="defaultTarget">/portal/add_entries_bux.xts</req-params:param>
  92. <req-params:param name="titlePostfix"><xsl:value-of select="/root/env/param[@name='m_name']"/></req-params:param>
  93. <req-params:param name="defaultSearchPath">/directory</req-params:param>
  94. <req-params:param name="showUsers">true</req-params:param>
  95. <req-params:param name="addEntriesUI">recipients</req-params:param>
  96. <req-params:param name="withCC">false</req-params:param>
  97. <req-params:param name="allowDuplicates">false</req-params:param>
  98. <req-params:param name="typeDialog">true</req-params:param>
  99. <req-params:param name="returnProperties">
  100. <req-params:property name="name"/>
  101. <req-params:property name="userName"/>
  102. <req-params:property name="storeID"/>
  103. <req-params:property name="searchPath"/>
  104. </req-params:param>
  105. </dlgctrl:XTS2Request>
  106. </xts:sequence>
  107. </xsl:template>
  108. </xsl:stylesheet>
  109. </xts:block>
  110. <!--
  111. ===============================================================================================
  112. processReponse - Process the response from the callMorphlet block and either displays
  113. the markup or processes the results
  114. ===============================================================================================
  115. -->
  116. <xts:block id="processResponse" path="/portal/addEntries/logicsheets/process_added_entries.xslt" processor="XSLT" dependency="callMorphlet" type="exec" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
  117. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  118. <xts:logicsheet path="logicsheets/portal.xsl"/>
  119. </xts:block>
  120. <!--
  121. ================================================================================
  122. render_page - send the results back
  123. ================================================================================
  124. -->
  125. <xts:block id="render_page" dependency="processResponse" mode="output" processor="XSLT" type="exec" mimeType="text/html" condition=".[not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='']" mandatory="false"
  126. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  127. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  128. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  129. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  130. <xts:logicsheet path="logicsheets/portal.xsl"/>
  131. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  132. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  133. <xsl:stylesheet version="1.0"
  134. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  135. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  136. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  137. exclude-result-prefixes="xsl cm xtsext">
  138. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  139. <pf:variables/>
  140. <xsl:template match="/root">
  141. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  142. <html>
  143. <head>
  144. <title>Loading Access Information</title>
  145. <script language="JavaScript">
  146. // the entries array is generated by the
  147. // server script, and populated with the
  148. // entries selected by he user in the CM wizard
  149. //
  150. function Entry()
  151. {
  152. var defaultName;
  153. var id;
  154. var searchPath;
  155. }
  156. var g_vEntries = new Array();
  157. <xsl:for-each select="/root/newEntries/*">
  158. <xsl:variable name="i" select="position()-1"/>
  159. g_vEntries[<xsl:value-of select="$i"/>] = new Entry();
  160. g_vEntries[<xsl:value-of select="$i"/>].id = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='storeID']))"/>';
  161. g_vEntries[<xsl:value-of select="$i"/>].defaultName = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='defaultName']))"/>';
  162. g_vEntries[<xsl:value-of select="$i"/>].searchPath = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='searchPath']))"/>';
  163. </xsl:for-each>
  164. <![CDATA[
  165. // function that passes the information from the g_vEntries array
  166. // to the container application
  167. if (parent.ccModalCallBack){
  168. if (g_vEntries && g_vEntries.length > 0){
  169. parent.ccModalCallBack("ok", g_vEntries);
  170. }
  171. else {
  172. parent.ccModalCallBack("cancel", null);
  173. }
  174. }
  175. ]]>
  176. </script>
  177. </head>
  178. <body>
  179. </body>
  180. </html>
  181. </xsl:template>
  182. </xsl:stylesheet>
  183. </xts:block>
  184. </xts:morphlet>