cm_access_finish.xts 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  13. <!--
  14. ================================================================================
  15. decode_results
  16. Decodes the value of the addentries_list field and appends it to the input
  17. document.
  18. ================================================================================
  19. -->
  20. <xts:block id="decode_results" type="exec" mode="interpret" processor="XSLT" mandatory="false" condition=".[/root/env/param[@name='addentries_list']]">
  21. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  22. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  23. <xsl:template match="/">
  24. <xts:sequence>
  25. <xts:append>
  26. <entries>
  27. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addentries_list'])), true())" disable-output-escaping="yes"/>
  28. </entries>
  29. </xts:append>
  30. <!--xts:delete select="/root/env/param[@name='addentries_list']"/-->
  31. </xts:sequence>
  32. </xsl:template>
  33. </xsl:stylesheet>
  34. </xts:block>
  35. <!--
  36. ================================================================================
  37. get_entries_names
  38. Retrieves the names property for each of the result entries.
  39. ================================================================================
  40. -->
  41. <xts:block id="get_entries_names" type="exec" mode="interpret" processor="XSLT" dependency="decode_results" mandatory="false" condition=".[/root/entries/*]">
  42. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  43. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  44. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  45. <xsl:template match="/">
  46. <xts:sequence>
  47. <xts:append>
  48. <list>
  49. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  50. <send:request provider="cm">
  51. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  52. <cm:query>
  53. <cm:requests>
  54. <xsl:for-each select="/root/entries/*">
  55. <cm:query>
  56. <cm:search>
  57. <xsl:value-of select="cm:searchPath"/>
  58. </cm:search>
  59. <cm:properties>
  60. <cm:property name="searchPath"/>
  61. <cm:property name="defaultName"/>
  62. <cm:property name="userName"/>
  63. <cm:property name="ancestors"/>
  64. </cm:properties>
  65. </cm:query>
  66. </xsl:for-each>
  67. </cm:requests>
  68. </cm:query>
  69. </xts:transform>
  70. </send:request>
  71. </xts:transform>
  72. </list>
  73. </xts:append>
  74. <!--xts:delete select="/root/entries"/-->
  75. </xts:sequence>
  76. </xsl:template>
  77. </xsl:stylesheet>
  78. </xts:block>
  79. <!--
  80. ================================================================================
  81. ================================================================================
  82. -->
  83. <xts:block id="render_page" dependency="get_entries_names" mode="output" processor="XSLT" type="exec" mimeType="text/html"
  84. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  85. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  86. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  87. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  88. <xts:logicsheet path="logicsheets/portal.xsl"/>
  89. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  90. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  91. <xsl:stylesheet version="1.0"
  92. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  93. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  94. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  95. exclude-result-prefixes="xsl cm xtsext">
  96. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  97. <pf:variables/>
  98. <xsl:template match="/root">
  99. <html lang="{$productLocale}">
  100. <head>
  101. <title>Loading Access Information</title>
  102. <script language="JavaScript">
  103. // the entries array is generated by the
  104. // server script, and populated with the
  105. // entries selected by he user in the CM wizard
  106. //
  107. <xsl:variable name="item-count" select="count(/root/list/*)"/>
  108. function Entry()
  109. {
  110. var path;
  111. var type;
  112. var names;
  113. var userName;
  114. var displayPath;
  115. }
  116. function MultilingualName()
  117. {
  118. var lang;
  119. var name;
  120. }
  121. var g_vEntries = new Array();
  122. <xsl:for-each select="/root/list/cm:queryResponse/cm:queryReply/*">
  123. <xsl:variable name="fullPath">
  124. <cf:do-the-path-link>
  125. <cf:param name="familytree">cm:ancestors</cf:param>
  126. <cf:param name="familymember">cm:defaultName</cf:param>
  127. <cf:param name="onlyAncestors">true</cf:param>
  128. </cf:do-the-path-link>
  129. </xsl:variable>
  130. <xsl:variable name="i" select="position()-1"/>
  131. g_vEntries[<xsl:value-of select="$i"/>] = new Entry();
  132. g_vEntries[<xsl:value-of select="$i"/>].path = '<xsl:value-of select="xtsext:javascriptencode(string(cm:searchPath))"/>';
  133. g_vEntries[<xsl:value-of select="$i"/>].type = '<xsl:value-of select="xtsext:javascriptencode(string(cm:objectClass))"/>';
  134. g_vEntries[<xsl:value-of select="$i"/>].userName = '<xsl:value-of select="xtsext:javascriptencode(string(cm:userName))"/>';
  135. g_vEntries[<xsl:value-of select="$i"/>].displayPath = '<xsl:value-of select="xtsext:javascriptencode(string($fullPath))"/>';
  136. g_vEntries[<xsl:value-of select="$i"/>].names = new Array(<xsl:value-of select="count(cm:name/cm:multilingualToken)"/>);
  137. g_vEntries[<xsl:value-of select="$i"/>].names[0] = new MultilingualName();
  138. g_vEntries[<xsl:value-of select="$i"/>].names[0].lang = '<xsl:value-of select="xtsext:javascriptencode(string($contentLocale))"/>';
  139. g_vEntries[<xsl:value-of select="$i"/>].names[0].name = '<xsl:value-of select="xtsext:javascriptencode(string(cm:defaultName))"/>';
  140. </xsl:for-each>
  141. <![CDATA[
  142. // function that passes the information from the g_vEntries array
  143. // to the container application
  144. function OnPageLoaded()
  145. {
  146. var ext = window.external;
  147. if (!ext || ext.Signature != "BMT-CMAccessDlg")
  148. return;
  149. for (var i = 0; i < g_vEntries.length; i++)
  150. {
  151. var e = g_vEntries[i];
  152. var nExtIndex = ext.AddEntry(e.path, e.type);
  153. if (-1 != nExtIndex)
  154. {
  155. for (var j = 0; j < e.names.length; j++)
  156. {
  157. ext.AddEntryName(nExtIndex, e.names[j].lang, e.names[j].name, e.userName, e.displayPath);
  158. }
  159. }
  160. }
  161. ext.OnClose(0);
  162. }
  163. ]]>
  164. </script>
  165. </head>
  166. <body onload="OnPageLoaded();" style="background-color:buttonface;border:0 solid #FFFFFF;overflow:auto;">
  167. <table width="100%" height="100%">
  168. <tr height="100%">
  169. <td align="center">
  170. <table>
  171. <tr>
  172. <td>
  173. <span style="font-family:Verdana,Tahoma,Arial;font-size:8pt;font-weight:normal;">
  174. Loading Access Information...
  175. </span>
  176. </td>
  177. </tr>
  178. </table>
  179. </td>
  180. </tr>
  181. </table>
  182. </body>
  183. </html>
  184. </xsl:template>
  185. </xsl:stylesheet>
  186. </xts:block>
  187. <!--
  188. <xts:block id="debug" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="render_page">
  189. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  190. <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">
  191. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  192. <xsl:template match="/">
  193. <dbg:dumpxml select="/root"/>
  194. </xsl:template>
  195. </xsl:stylesheet>
  196. </xts:block>
  197. -->
  198. </xts:morphlet>