add_entries_links.xts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  5. (C) Copyright IBM Corp. 2005, 2010
  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/portal.xml, messages/portalRL.xml">
  9. <!--
  10. ===============================================================================================
  11. initController - The first time this morphlet gets executed, set the controller_state to
  12. wizard_page1|markup to display the first page of the wizard.
  13. ===============================================================================================
  14. -->
  15. <xts:block id="initController" processor="XSLT" type="exec" condition=".[ not(/root/env/param[@name='controller_state']) ]" mandatory="false">
  16. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  17. <xsl:stylesheet version="1.0"
  18. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19. exclude-result-prefixes="xsl">
  20. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  21. <xsl:template match="/">
  22. <xts:sequence>
  23. <xts:append select="/root/env">
  24. <param name="controller_state">addEntries|navigate</param>
  25. </xts:append>
  26. <xts:append select="/root">
  27. <freshControllerState/>
  28. </xts:append>
  29. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <!-- ======================================================== -->
  34. <!-- Session Management -->
  35. <!-- ======================================================== -->
  36. <!-- Reads session-sensitive info from CM -->
  37. <xts:block processor="XSLT" type="exec" mandatory="false"
  38. id="refreshSession"
  39. path="portal/cc/read_session.xml"
  40. condition=".[
  41. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  42. or /root/env/param[@name='m_reload']
  43. or /root/env/param[@name='m_root'] ]">
  44. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  45. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  46. </xts:block>
  47. <!-- Update the <session> element for this request. -->
  48. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
  49. condition=".[
  50. /root/newSession
  51. or /root/env/param[@name='ui']
  52. or /root/env/param[@name='d']
  53. or /root/env/param[starts-with(@name,'m_s_')]
  54. or /root/env/param[@name = 'resetSort'] ]"
  55. mandatory="false"/>
  56. <!-- Save changes to the state info in a cookie -->
  57. <xts:block mode="interpret" processor="XSLT" type="exec"
  58. id="setSession"
  59. path="portal/set_session.xml"
  60. dependency="buildSession"
  61. condition=".[/root/updateSession]"
  62. mandatory="false"/>
  63. <!--
  64. ===============================================================================================
  65. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  66. markup to be displayed or the expected results
  67. ===============================================================================================
  68. -->
  69. <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="initController setSession" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
  70. <xts:logicsheet path="logicsheets/portal.xsl"/>
  71. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  72. <xsl:stylesheet version="1.0"
  73. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  74. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  75. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  76. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  77. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  78. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  79. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  80. <xsl:template match="/">
  81. <xts:sequence>
  82. <dlgctrl:XTS2Request>
  83. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  84. <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
  85. <req-params:param name="defaultTarget">/myinbox/add_entries_links.xts</req-params:param>
  86. <req-params:param name="helpWithWebRoot">true</req-params:param>
  87. <req-params:param name="titlePostfix"><xsl:value-of select="/root/env/param[@name='m_name']"/></req-params:param>
  88. <req-params:param name="defaultSearchPath">/content</req-params:param>
  89. <req-params:param name="showUsers">false</req-params:param>
  90. <req-params:param name="addEntriesUI"><xsl:value-of select="'links'"/></req-params:param>
  91. <req-params:param name="allowDuplicates"><xsl:value-of select="'false'"/></req-params:param>
  92. <req-params:param name="typeDialog">false</req-params:param>
  93. <req-params:param name="allowRootBrowsing">true</req-params:param>
  94. <req-params:param name="returnProperties">
  95. <req-params:property name="name"/>
  96. <req-params:property name="userName"/>
  97. <req-params:property name="storeID"/>
  98. <req-params:property name="searchPath"/>
  99. <req-params:property name="iconURI"/>
  100. <req-params:property name="type"/>
  101. </req-params:param>
  102. </dlgctrl:XTS2Request>
  103. </xts:sequence>
  104. </xsl:template>
  105. </xsl:stylesheet>
  106. </xts:block>
  107. <!--
  108. ===============================================================================================
  109. processReponse - Process the response from the callMorphlet block and either displays
  110. the markup or processes the results
  111. ===============================================================================================
  112. -->
  113. <xts:block
  114. id="processResponse"
  115. path="/portal/addEntries/logicsheets/process_added_entries.xslt"
  116. processor="XSLT"
  117. dependency="callMorphlet"
  118. type="exec"
  119. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  120. mandatory="false">
  121. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  122. <xts:logicsheet path="logicsheets/portal.xsl"/>
  123. </xts:block>
  124. <xts:block id="createSystemElement" type="exec" processor="XSLT" dependency="processResponse" condition=".[/root/newEntries]" mandatory="false">
  125. <xsl:stylesheet version="1.0"
  126. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  127. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  128. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  129. exclude-result-prefixes="bus xtsext">
  130. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  131. <xsl:template match="/">
  132. <xts:sequence>
  133. <xts:append select="/root">
  134. <xts:request protocol="FILEREAD" cache="true" faultBlock="requestFault" target="./portal/system.xml"/>
  135. </xts:append>
  136. </xts:sequence>
  137. </xsl:template>
  138. </xsl:stylesheet>
  139. </xts:block>
  140. <!--
  141. ===============================================================================================
  142. processReponse - Process the response from the callMorphlet block and either displays
  143. the markup or processes the results
  144. ===============================================================================================
  145. -->
  146. <xts:block
  147. id="addIcon"
  148. processor="XSLT"
  149. dependency="createSystemElement"
  150. type="exec"
  151. mode="interpret"
  152. condition=".[/root/newEntries]"
  153. mandatory="false">
  154. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  155. <xts:logicsheet path="logicsheets/portal.xsl"/>
  156. <xsl:stylesheet version="1.0" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" 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:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:eut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/emailOptions/logicsheets/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut utml">
  157. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  158. <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
  159. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  160. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  161. <pf:variables/>
  162. <pf:gen-icon/>
  163. <xsl:template match="/">
  164. <xsl:for-each select="/root/newEntries/child::*/*[local-name()='objectClass']">
  165. <xsl:variable name="link"><xsl:value-of select="./.."/></xsl:variable>
  166. <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
  167. <xsl:variable name="objectClass"><xsl:value-of select="."/></xsl:variable>
  168. <xts:sequence>
  169. <xts:append select="/root/newEntries/*[{$pos}]">
  170. <img>
  171. <xts:transform name="XMLEncode">
  172. <!-- generate the img tag with the correct icon -->
  173. <xsl:call-template name="gen-icon">
  174. <xsl:with-param name="showAction" select="false()"/>
  175. <xsl:with-param name="class" select="$objectClass"/>
  176. </xsl:call-template>
  177. </xts:transform>
  178. </img>
  179. </xts:append>
  180. </xts:sequence>
  181. </xsl:for-each>
  182. </xsl:template>
  183. </xsl:stylesheet>
  184. </xts:block>
  185. <!--
  186. ================================================================================
  187. render_page - send the results back
  188. ================================================================================
  189. -->
  190. <xts:block
  191. id="render_page"
  192. path="/myinbox/logicsheets/renderPage.xslt"
  193. dependency="addIcon"
  194. mode="output"
  195. processor="XSLT"
  196. type="exec"
  197. mimeType="text/html"
  198. condition=".[not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='']"
  199. mandatory="false">
  200. <xts:logicsheet path="logicsheets/portal.xsl"/>
  201. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  202. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  203. </xts:block>
  204. <!-- Handle errors which occur when reading the system XML file. Provide default values. -->
  205. <xts:block id="requestFault" type="fault" processor="XML" nodelist="">
  206. <system>
  207. <param name="delimiters" d1="|" d2=":"/>
  208. <param name="COGNOSHome">b_action=xts.run&amp;m=portal/main.xts</param>
  209. </system>
  210. </xts:block>
  211. </xts:morphlet>