properties_mypages.xts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  16. <xts:block id="checkSharedPagesChanged" processor="XSLT" type="exec" dependency="formlogic_init" condition=".[/root/env/param[@name='sharedPagesChanged'] = 'addPagelet']" mandatory="false" >
  17. <xts:logicsheet path="logicsheets/portal.xsl"/>
  18. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  19. <xsl:stylesheet version="1.0"
  20. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/">
  23. <xts:sequence>
  24. <xts:append select="/root/env">
  25. <param name='controller_state'>addSharedPageEntries|navigate</param>
  26. </xts:append>
  27. <xts:append select="/root/env">
  28. <param xmlns="" name='m_sharedPagesPagersection'>1</param>
  29. </xts:append>
  30. <xts:append select="/root/env">
  31. <param xmlns="" name='addPageletsMode'></param>
  32. </xts:append>
  33. </xts:sequence>
  34. </xsl:template>
  35. </xsl:stylesheet>
  36. </xts:block>
  37. <xts:block
  38. id="callAddDialog"
  39. nodelist="requestParams,env, http, session, credential, cookies, header, user"
  40. processor="XSLT"
  41. type="exec"
  42. dependency="checkSharedPagesChanged"
  43. condition=".[ /root/env/param[@name='controller_state'] != '' ]"
  44. mandatory="false" >
  45. <xts:logicsheet path="logicsheets/portal.xsl"/>
  46. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  47. <xsl:stylesheet version="1.0"
  48. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  49. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  50. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  51. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  52. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  53. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  54. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  55. <xsl:template match="/">
  56. <xts:sequence>
  57. <dlgctrl:XTS2Request>
  58. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  59. <dlgctrl:stackName>addSharedPageEntriesStack</dlgctrl:stackName>
  60. <req-params:param name="defaultTarget">/portal/properties_mypages.xts</req-params:param>
  61. <req-params:param name="titlePostfix"><xts:string id="IDS_ADDENTRIES_MY_PAGES_TITLE"/></req-params:param>
  62. <req-params:param name="defaultSearchPath">/content</req-params:param>
  63. <req-params:param name="showUsers">false</req-params:param>
  64. <req-params:param name="addEntriesUI">mypages</req-params:param>
  65. <req-params:param name="allowDuplicates">false</req-params:param>
  66. <req-params:param name="returnProperties">
  67. <req-params:property name="name"/>
  68. <req-params:property name="permissions"/>
  69. <req-params:property name="searchPath"/>
  70. <req-params:property name="storeID"/>
  71. </req-params:param>
  72. <req-params:param name="typeDialog">false</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. <xsl:template match="/root">
  105. <rdr:Requests>
  106. <rdr:Request type="preferences">
  107. <rdr:searchPath><xsl:value-of select="/root/env/param[@name='m_obj']"/></rdr:searchPath>
  108. </rdr:Request>
  109. <rdr:Request type="pubicFolder" mode="properties"/>
  110. <rdr:Request type="personalFolder" mode="properties">
  111. <rdr:searchPath>
  112. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  113. </rdr:searchPath>
  114. </rdr:Request>
  115. </rdr:Requests>
  116. </xsl:template>
  117. </xsl:stylesheet>
  118. </xts:block>
  119. <!-- need to get the pagelet list to display in the mypges tab. It must include the welcome page, -->
  120. <!-- public folder page, private folder page, and all custom pages -->
  121. <!-- Content request to get basic preferences -->
  122. <xts:block id="createPageletList" processor="XSLT" type="exec" dependency="formlogic_init getContent" condition=".[not(/root/mode='addEntries')]" mandatory="true">
  123. <xsl:stylesheet version="1.0"
  124. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  125. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  126. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  127. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  128. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  129. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  130. <xsl:template match="/">
  131. <xts:sequence>
  132. <xts:append>
  133. <!-- create the list based on the m_pp_shared_pages variable if it was passed in. If not then use the cm's pages -->
  134. <xsl:choose>
  135. <xsl:when test="/root/env/param[@name='m_pp_shared_pages']">
  136. <!-- the list was passed in so lets unpack it -->
  137. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='m_pp_shared_pages'])),true())" disable-output-escaping="yes"/>
  138. </xsl:when>
  139. <xsl:otherwise>
  140. <!-- the list was not passed in so we must look at cm for the portalPages list -->
  141. <xsl:variable name="personalFolderId"><xsl:value-of select="/root/cm:queryResponse/cm:queryReply[3]/cm:folder/cm:storeID"/></xsl:variable>
  142. <sharedPagesListForDisplay>
  143. <xsl:for-each select="/root/cm:queryResponse/cm:queryReply[1]/cm:account/cm:portalPages/*">
  144. <pagelet>
  145. <xsl:choose>
  146. <xsl:when test="./cm:storeID = $personalFolderId">
  147. <xsl:copy-of select="@*|(*[not(local-name() = 'defaultName')])"/>
  148. <cm:defaultName xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"><xts:string id="IDS_MYPAGES_PERSONAL_FOLDER"/></cm:defaultName>
  149. </xsl:when>
  150. <xsl:otherwise>
  151. <xsl:copy-of select="@*|*"/>
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. </pagelet>
  155. </xsl:for-each>
  156. </sharedPagesListForDisplay>
  157. </xsl:otherwise>
  158. </xsl:choose>
  159. </xts:append>
  160. </xts:sequence>
  161. </xsl:template>
  162. </xsl:stylesheet>
  163. </xts:block>
  164. <!-- if we have a resequence response or and kind of response then we need to -->
  165. <!-- modify the shared pages. So create a new sharepageslist chunk based on the updated -->
  166. <!-- data and delete the old shared pages -->
  167. <!-- this block gets executed only if the env incudes sharedPagesChanged -->
  168. <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']!= ''))] "/>
  169. <!-- Response-->
  170. <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="getTabs formlogic_init getContent createPageletList updatePageletList" mandatory="false">
  171. <xts:logicsheet path="portal/preferences/common/response/mypages.xslt"/>
  172. <xts:logicsheet path="logicsheets/portal.xsl"/>
  173. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  174. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  175. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  176. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  177. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  178. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  179. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  180. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  181. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  182. <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/"
  183. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  184. 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">
  185. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  186. <!-- current file name -->
  187. <xsl:variable name="mname" select="'properties_mypages.xts'"/>
  188. <!-- define the current object we are using -->
  189. <xsl:variable name="the-object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  190. <xsl:variable name="publicFolder" select="/root/cm:queryResponse/cm:queryReply[2]/*"/>
  191. <xsl:variable name="privateFolder" select="/root/cm:queryResponse/cm:queryReply[3]/*"/>
  192. <xsl:variable name="isNamedAccountReadOnly" select="(not(contains($the-object/cm:permissions,'write')) and ($is-named='1'))"/>
  193. <pf:modalVariables/>
  194. <xsl:template match="/root">
  195. <xsl:variable name="has_write_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' write ')"/>
  196. <xsl:variable name="has_policy_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' setPolicy ')"/>
  197. <xsl:variable name="showOKCancel" select="$has_write_permission or $has_policy_permission"/>
  198. <xsl:variable name="browserTitle">
  199. <xsl:variable name="objectName">
  200. <xsl:choose>
  201. <xsl:when test="key('env-param','m_name') and key('env-param','m_name') != ''"><span lang="{$contentLocale}"><xsl:value-of select="key('env-param','m_name')"/></span></xsl:when>
  202. <xsl:otherwise><span lang="{$contentLocale}"><xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:defaultName"/></span></xsl:otherwise>
  203. </xsl:choose>
  204. </xsl:variable>
  205. <xts:string id="IDS_PROPERTIES_TITLE">
  206. <xts:param name="objectName">
  207. <xsl:value-of select="$objectName"/>
  208. </xts:param>
  209. </xts:string>
  210. </xsl:variable>
  211. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  212. <dp:meta>
  213. <pf:meta/>
  214. </dp:meta>
  215. <dp:script>
  216. <pf:help context="HID_PERSONALIZE"/>
  217. <script language="javascript">
  218. function init()
  219. {
  220. if (document.pform.controller_state)
  221. {
  222. document.pform.controller_state.value = '';
  223. }
  224. }
  225. </script>
  226. </dp:script>
  227. <utml:form name="pform" method="post" action="{$gateway}">
  228. <utml:read-only><xsl:value-of select="$isNamedAccountReadOnly"/></utml:read-only>
  229. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  230. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  231. <utml:input type="hidden" name="sharedPagesChanged" value="" utml:update="false"/>
  232. <dp:header useBackURL="not($showOKCancel)">
  233. <dp:title>
  234. <xsl:copy-of select="$browserTitle"/>
  235. </dp:title>
  236. </dp:header>
  237. <!-- Tab bar -->
  238. <df:propertiesTabs select="mypages">
  239. <df:hasSetPolicy>
  240. <xsl:value-of select="$has_policy_permission"/>
  241. </df:hasSetPolicy>
  242. </df:propertiesTabs>
  243. <!-- Intro text -->
  244. <dp:description>
  245. <xts:string id="IDS__ADMIN_PERS_TAB_MYPAGES_INTRO"/>
  246. </dp:description>
  247. <!-- Body -->
  248. <rdb:preferences mode="properties"/>
  249. <!-- Footer -->
  250. <dp:footer>
  251. <xsl:choose>
  252. <xsl:when test="$showOKCancel">
  253. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  254. <xsl:choose>
  255. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  256. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  257. </xsl:when>
  258. <xsl:otherwise>
  259. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  260. </xsl:otherwise>
  261. </xsl:choose>
  262. </xsl:when>
  263. <xsl:otherwise>
  264. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  265. </xsl:otherwise>
  266. </xsl:choose>
  267. </dp:footer>
  268. </utml:form>
  269. </dp:page>
  270. </xsl:template>
  271. <pf:serialize-xml/>
  272. <pf:variables/>
  273. <pf:gen-icon/>
  274. </xsl:stylesheet>
  275. </xts:block>
  276. <!-- Debug Block -->
  277. <xts:block id="debug" dependency="format createPageletList" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  278. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  279. <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">
  280. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  281. <xsl:template match="/">
  282. <dbg:dumpxml select="/root"/>
  283. </xsl:template>
  284. </xsl:stylesheet>
  285. </xts:block>
  286. </xts:morphlet>