mypages.xts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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, 2013
  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. <!-- Navigation control -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <xts:block id="checkSharedPagesChanged" processor="XSLT" type="exec" dependency="formlogic_init" condition=".[/root/env/param[@name='sharedPagesChanged'] = 'addPagelet']" mandatory="false" >
  16. <xts:logicsheet path="logicsheets/portal.xsl"/>
  17. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  18. <xsl:stylesheet version="1.0"
  19. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  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'>addSharedPageEntries|navigate</param>
  25. </xts:append>
  26. <xts:append select="/root/env">
  27. <param xmlns="" name='m_sharedPagesPagersection'>1</param>
  28. </xts:append>
  29. <xts:append select="/root/env">
  30. <param xmlns="" name='addPageletsMode'></param>
  31. </xts:append>
  32. </xts:sequence>
  33. </xsl:template>
  34. </xsl:stylesheet>
  35. </xts:block>
  36. <xts:block
  37. id="callAddDialog"
  38. nodelist="requestParams,env, http, session, credential, cookies, header, user"
  39. processor="XSLT"
  40. type="exec"
  41. dependency="checkSharedPagesChanged"
  42. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  43. mandatory="false" >
  44. <xts:logicsheet path="logicsheets/portal.xsl"/>
  45. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  46. <xsl:stylesheet version="1.0"
  47. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  48. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  49. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  50. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  51. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  52. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  53. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  54. <xsl:template match="/">
  55. <xts:sequence>
  56. <dlgctrl:XTS2Request>
  57. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  58. <dlgctrl:stackName>addSharedPageEntriesStack</dlgctrl:stackName>
  59. <req-params:param name="defaultTarget">/portal/preferences/mypages.xts</req-params:param>
  60. <req-params:param name="titlePostfix"><xsl:value-of select="/root/session/param[@name = 'e_user']"/></req-params:param>
  61. <req-params:param name="defaultSearchPath">/</req-params:param>
  62. <req-params:param name="showUsers">false</req-params:param>
  63. <req-params:param name="addEntriesUI">mypages</req-params:param>
  64. <req-params:param name="allowDuplicates">false</req-params:param>
  65. <req-params:param name="returnProperties">
  66. <req-params:property name="name"/>
  67. <req-params:property name="permissions"/>
  68. <req-params:property name="searchPath"/>
  69. <req-params:property name="storeID"/>
  70. </req-params:param>
  71. <req-params:param name="typeDialog">false</req-params:param>
  72. <req-params:param name="selectableRootObjects">true</req-params:param>
  73. <req-params:param name="allowRootBrowsing">true</req-params:param>
  74. </dlgctrl:XTS2Request>
  75. </xts:sequence>
  76. </xsl:template>
  77. </xsl:stylesheet>
  78. </xts:block>
  79. <!--
  80. ===============================================================================================
  81. processReponse - Process the response from the callMorphlet block and either displays
  82. the markup or processes the results
  83. ===============================================================================================
  84. -->
  85. <xts:block
  86. id="processAddDialogResponse"
  87. nodelist="output,http,env,system,user,morphletResponse,credential,cookies"
  88. path="/portal/addEntries/logicsheets/process_added_entries.xslt"
  89. processor="XSLT"
  90. dependency="callAddDialog"
  91. type="exec"
  92. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  93. mandatory="false">
  94. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  95. <xts:logicsheet path="logicsheets/portal.xsl"/>
  96. </xts:block>
  97. <!-- Content request to get basic preferences -->
  98. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init processAddDialogResponse" condition=".[not(/root/mode='addEntries')]" mandatory="false">
  99. <xts:logicsheet path="portal/preferences/common/request/request.xslt"/>
  100. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  101. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  102. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  103. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  104. <cml:object-predicates/>
  105. <xsl:template match="/root">
  106. <rdr:Requests>
  107. <rdr:Request type="preferences" mode="preferences">
  108. <rdr:searchPath>~</rdr:searchPath>
  109. </rdr:Request>
  110. </rdr:Requests>
  111. </xsl:template>
  112. </xsl:stylesheet>
  113. </xts:block>
  114. <!-- need to get the pagelet list to display in the mypges tab. It must include the welcome page, -->
  115. <!-- public folder page, private folder page, and all custom pages -->
  116. <!-- Content request to get basic preferences -->
  117. <xts:block id="createPageletList" processor="XSLT" type="exec" dependency="formlogic_init getContent" condition=".[not(/root/mode='addEntries')]" mandatory="true">
  118. <xsl:stylesheet version="1.0"
  119. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  120. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  121. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  122. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  123. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  124. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  125. <xsl:template match="/">
  126. <xts:sequence>
  127. <xts:append>
  128. <!-- create the list based on the m_pp_shared_pages variable if it was passed in. If not then use the cm's pages -->
  129. <xsl:choose>
  130. <xsl:when test="/root/env/param[@name='m_pp_shared_pages']">
  131. <!-- the list was passed in so lets unpack it -->
  132. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='m_pp_shared_pages'])),true())" disable-output-escaping="yes"/>
  133. </xsl:when>
  134. <xsl:otherwise>
  135. <!-- the list was not passed in so we must look at cm for the portalPages list -->
  136. <sharedPagesListForDisplay>
  137. <xsl:for-each select="/root/cm:queryResponse/cm:queryReply[1]/cm:account/cm:portalPages/*">
  138. <pagelet>
  139. <xsl:copy-of select="@*|*"/>
  140. </pagelet>
  141. </xsl:for-each>
  142. </sharedPagesListForDisplay>
  143. </xsl:otherwise>
  144. </xsl:choose>
  145. </xts:append>
  146. </xts:sequence>
  147. </xsl:template>
  148. </xsl:stylesheet>
  149. </xts:block>
  150. <!-- if we have a resequence response or and kind of response then we need to -->
  151. <!-- modify the shared pages. So create a new sharepageslist chunk based on the updated -->
  152. <!-- data and delete the old shared pages -->
  153. <!-- this block gets executed only if the env incudes sharedPagesChanged -->
  154. <xts:block id="updatePageletList" processor="XSLT" type="exec" path="/portal/preferences/common/processing/updateSharedPagesList.xslt" dependency="createPageletList" mandatory="false" condition=".[(/root/newEntries or (/root/env/param[@name='sharedPagesChanged'] and /root/env/param[@name='sharedPagesChanged']!= ''))] "/>
  155. <!-- response (from flyout) -->
  156. <xts:block id="formatRedirect" mode="output" processor="XSLT" type="exec" mimeType="text/html" condition=".[not(/root/mode='addEntries') and ((/root/AddPageletResponse) or (/root/AddPageletCancel))]" dependency="formlogic_init getContent createPageletList updatePageletList" mandatory="false">
  157. <xts:logicsheet path="portal/preferences/common/response/mypagesredirect.xslt"/>
  158. <xts:logicsheet path="logicsheets/portal.xsl"/>
  159. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  160. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  161. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  162. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  163. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  164. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  165. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  166. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  167. <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: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:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/" 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:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb" exclude-result-prefixes="rdb xsl cm df dp pf dc utml xts xtsext lyt cf cp">
  168. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  169. <!-- current file name -->
  170. <xsl:variable name="mname" select="'preferences/mypages.xts'"/>
  171. <!-- define the current object we are using -->
  172. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  173. <xsl:template match="/root">
  174. <xsl:variable name="browserTitle">
  175. <xts:string id="IDS_PREFERENCES"/>
  176. </xsl:variable>
  177. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  178. <dp:meta>
  179. <pf:meta/>
  180. <xsl:if test="/root/AddPageletCancel">
  181. <!-- if the cancel button was pressed on the addentries dialog and -->
  182. <!-- this dialog was called from the flyout menu, then we have to -->
  183. <!-- redirect to the back-url -->
  184. <META HTTP-EQUIV="Refresh">
  185. <xsl:attribute name="CONTENT">0; URL=<xsl:value-of select="/root/env/param[@name='backURL']"/></xsl:attribute>
  186. </META>
  187. </xsl:if>
  188. </dp:meta>
  189. <form name="testform" method="get">
  190. <xsl:attribute name="action"><xsl:value-of select="/root/env/param[@name = 'backURL']"/></xsl:attribute>
  191. </form>
  192. <utml:form name="pform" method="post" action="{$gateway}">
  193. <utml:input type="hidden" name="errURL" utml:update="false">
  194. <utml:value>
  195. <xsl:value-of select="/root/env/param[@name = 'backURL']"/>
  196. </utml:value>
  197. </utml:input>
  198. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  199. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  200. <utml:input type="hidden" name="sharedPagesChanged" value="" utml:update="false"/>
  201. <rdb:preferences mode="preferences"/>
  202. </utml:form>
  203. </dp:page>
  204. </xsl:template>
  205. <pf:serialize-xml/>
  206. <pf:variables/>
  207. <pf:gen-icon/>
  208. </xsl:stylesheet>
  209. </xts:block>
  210. <!-- Response (from preferences page)-->
  211. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" condition=".[not(/root/mode='addEntries') and (not((/root/AddPageletResponse) or (/root/AddPageletCancel)))]" dependency="formlogic_init getContent createPageletList updatePageletList" mandatory="false">
  212. <xts:logicsheet path="portal/preferences/common/response/mypages.xslt"/>
  213. <xts:logicsheet path="logicsheets/portal.xsl"/>
  214. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  215. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  216. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  217. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  218. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  219. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  220. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  221. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  222. <xts:logicsheet path="logicsheets/validation.xslt"/>
  223. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  224. <xsl:stylesheet version="1.0"
  225. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  226. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  227. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  228. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  229. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  230. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  231. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  232. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  233. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  234. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  235. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  236. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  237. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  238. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
  239. exclude-result-prefixes="rdb xsl cm df dp pf dc utml xts xtsext lyt cf cp">
  240. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  241. <!-- current file name -->
  242. <xsl:variable name="mname" select="'preferences/mypages.xts'"/>
  243. <!-- define the current object we are using -->
  244. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  245. <xsl:variable name="isNamedAccountReadOnly" select="(not(contains($the-object/cm:permissions,'write')) and ($is-named='1'))"/>
  246. <pf:modalVariables/>
  247. <xsl:template match="/root">
  248. <xsl:variable name="browserTitle">
  249. <xts:string id="IDS_PREFERENCES"/>
  250. </xsl:variable>
  251. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  252. <dp:meta>
  253. <pf:meta/>
  254. </dp:meta>
  255. <dp:script>
  256. <pf:help context="HID_PERSONALIZE"/>
  257. </dp:script>
  258. <utml:form name="pform" method="post" action="{$gateway}">
  259. <utml:read-only><xsl:value-of select="$isNamedAccountReadOnly"/></utml:read-only>
  260. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  261. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  262. <utml:input type="hidden" name="sharedPagesChanged" value="" utml:update="false"/>
  263. <dp:header>
  264. <dp:title>
  265. <xsl:value-of select="$browserTitle"/>
  266. </dp:title>
  267. </dp:header>
  268. <!-- Tab bar -->
  269. <df:personalizeTabs select="mypages"/>
  270. <!-- Intro text -->
  271. <dp:description>
  272. <xts:string id="IDS_PERS_TAB_MYPAGES_INTRO"/>
  273. </dp:description>
  274. <!-- Body -->
  275. <rdb:preferences mode="preferences" />
  276. <!-- Footer -->
  277. <dp:footer>
  278. <xsl:if test="$isNamedAccountReadOnly != 'true'">
  279. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  280. </xsl:if>
  281. <xsl:choose>
  282. <xsl:when test="$isModal">
  283. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:processModalCommand('cancel')" onclick="{$dc-confirm-cancel}"/>
  284. </xsl:when>
  285. <xsl:otherwise>
  286. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  287. </xsl:otherwise>
  288. </xsl:choose>
  289. </dp:footer>
  290. </utml:form>
  291. </dp:page>
  292. </xsl:template>
  293. <pf:serialize-xml/>
  294. <pf:variables/>
  295. <pf:gen-icon/>
  296. </xsl:stylesheet>
  297. </xts:block>
  298. <!-- Debug Block -->
  299. <xts:block id="debug" dependency="format formatRedirect createPageletList" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  300. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  301. <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">
  302. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  303. <xsl:template match="/">
  304. <dbg:dumpxml select="/root"/>
  305. </xsl:template>
  306. </xsl:stylesheet>
  307. </xts:block>
  308. </xts:morphlet>