properties_pagelet_style.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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" includeConfig="true">
  13. <!-- Navigation Logic -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!-- Load object-specific property tabs map -->
  16. <xts:block id="getTabs" path="/portal/uiobjects_tabs.xml" type="exec" mode="interpret" processor="XML" />
  17. <!-- Read the page information from CM -->
  18. <xts:block
  19. id="get_content"
  20. path="/portal/mypages/common/request/read_pagelet_properties.xslt"
  21. processor="XSLT"
  22. type="exec"
  23. mode="interpret"
  24. dependency="formlogic_init">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. </xts:block>
  27. <!-- ========= One-time house keeping work =========== -->
  28. <!-- Append the page layout to the DOM -->
  29. <xts:block
  30. id="appendPageletLayout"
  31. dependency="get_content"
  32. path="/portal/mypages/common/process/append_page_layout.xslt"
  33. type="exec"
  34. mode="interpret"
  35. mandatory="false"
  36. processor="XSLT"/>
  37. <!-- Gracefully downgrade newer layout versions as required .. -->
  38. <xts:block
  39. id="convert1.1To1.0"
  40. condition=".[/root/layout/@version = '1.1']"
  41. dependency="appendPageletLayout"
  42. type="exec"
  43. mode="interpret"
  44. mandatory="false"
  45. processor="XSLT">
  46. <xsl:stylesheet version="1.0"
  47. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  48. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  49. <xsl:output method="xml" encoding="UTF-8" version="1.0" indent="no"/>
  50. <xsl:template match="/root/layout">
  51. <xts:sequence>
  52. <xts:replace select="/root/layout">
  53. <!-- Set a new layout spec with the right version -->
  54. <layout version="1.0">
  55. <xsl:copy-of select="/root/layout/title"/>
  56. <xsl:copy-of select="/root/layout/instructions"/>
  57. <xsl:copy-of select="/root/layout/portletOptions"/>
  58. <!-- Create one 100%-wide column and pile all portlets in it -->
  59. <column width="100">
  60. <xsl:copy-of select="/root/layout//portlet"/>
  61. </column>
  62. </layout>
  63. </xts:replace>
  64. <!-- Tell the presentation pale that this happened to alert the user -->
  65. <xts:append>
  66. <revert/>
  67. </xts:append>
  68. </xts:sequence>
  69. </xsl:template>
  70. </xsl:stylesheet>
  71. </xts:block>
  72. <!-- Persist (unpack) the layout XML into form fields -->
  73. <xts:block
  74. id="unpack_pagelet_layout"
  75. dependency="convert1.1To1.0"
  76. path="/portal/mypages/common/process/unpack_pagelet_layout.xslt"
  77. processor="XSLT"
  78. type="exec"
  79. condition=".[not(/root/env/param[starts-with(@name, 'm_mp_title')])]"
  80. mandatory="false"
  81. mode="interpret">
  82. </xts:block>
  83. <!-- Enumerate list of existing portlet instances in 'm_mp_portlet' form fields. Make dependent on -->
  84. <xts:block
  85. id="buildPortletList"
  86. dependency="unpack_pagelet_layout"
  87. condition=".[not(/root/env/param[@name = 'm_mp_portlet'])]"
  88. path="/portal/mypages/common/process/build_portlet_list.xslt"
  89. type="exec"
  90. mode="interpret"
  91. mandatory="false"
  92. processor="XSLT"/>
  93. <!-- ========= Lang and font info =========== -->
  94. <!-- Processes changes to the title and instructions fields w.r.t languages -->
  95. <xts:block
  96. id="buildLanguageList"
  97. dependency="unpack_pagelet_layout"
  98. path="/portal/mypages/common/process/build_language_list.xslt"
  99. type="exec"
  100. mode="interpret"
  101. processor="XSLT"/>
  102. <!--
  103. Build and append the list of selected languages so we can easily set them
  104. appart from available languages when rendering the language selection control.
  105. -->
  106. <xts:block
  107. id="listSelectedLangs"
  108. dependency="buildLanguageList"
  109. path="/portal/mypages/common/process/selected_languages.xslt"
  110. processor="XSLT"
  111. type="exec"
  112. mode="interpret"
  113. mandatory="false"/>
  114. <!-- Read the list of supported fonts form the CFGAPI -->
  115. <xts:block id="getFonts" processor="XML" type="exec" mode="interpret">
  116. <xts:sequence>
  117. <xts:append>
  118. <fonts>
  119. <xts:function name="getConfiguration">
  120. <xts:param name="fonts"/>
  121. </xts:function>
  122. </fonts>
  123. </xts:append>
  124. </xts:sequence>
  125. </xts:block>
  126. <!-- Build page response -->
  127. <xts:block
  128. id="missingObject"
  129. condition=".[not(/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*[local-name()='pagelet'])]"
  130. mode="output"
  131. processor="XSLT"
  132. type="exec"
  133. mimeType="text/html"
  134. dependency="listSelectedLangs getTabs getFonts"
  135. path="/portal/missing_object.xml">
  136. <xts:logicsheet path="logicsheets/portal.xsl"/>
  137. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  138. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  139. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  140. </xts:block>
  141. <xts:block
  142. id="render_page"
  143. condition=".[/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][1]/*[local-name()='pagelet']]"
  144. dependency="listSelectedLangs getTabs getFonts"
  145. mode="output"
  146. processor="XSLT"
  147. type="exec"
  148. mimeType="text/html">
  149. <xts:logicsheet path="portal/mypages/common/response/style.xslt"/>
  150. <xts:logicsheet path="logicsheets/portal.xsl"/>
  151. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  152. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  153. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  154. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  155. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  156. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  157. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  158. <xts:logicsheet path="logicsheets/validation.xslt"/>
  159. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  160. <xsl:stylesheet version="1.0"
  161. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  162. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  163. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  164. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  165. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  166. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  167. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  168. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  169. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  170. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  171. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
  172. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl cm pf df dp dc lyt utml cp cf xtsext rdb">
  173. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  174. <pf:variables/>
  175. <!-- Bidi common templates -->
  176. <pf:common-bidi-templates/>
  177. <!-- current file name -->
  178. <xsl:variable name="mname" select="'/portal/properties_pagelet_style.xts'"/>
  179. <xsl:variable name="object" select="/root/cm:queryResponse/cm:queryReply[1]/*"/>
  180. <!-- start the output -->
  181. <xsl:template match="/root">
  182. <xsl:variable name="canWrite" select="contains(concat(' ',$object/cm:permissions,' '),' write ')"/>
  183. <xsl:variable name="canSetPolicy" select="contains(concat(' ', $object/cm:permissions, ' '), ' setPolicy ')"/>
  184. <xsl:variable name="showOKCancel" select="$canWrite or $canSetPolicy"/>
  185. <xsl:variable name="browserTitle">
  186. <xts:string id="IDS_PROPERTIES_TITLE">
  187. <xts:param name="objectName">
  188. <xsl:choose>
  189. <xsl:when test="$object/cm:defaultName">
  190. <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD($object/cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
  191. </xsl:when>
  192. <xsl:otherwise>
  193. <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD(/root/env/param[@name='m_name'], $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
  194. </xsl:otherwise>
  195. </xsl:choose>
  196. </xts:param>
  197. </xts:string>
  198. </xsl:variable>
  199. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  200. <dp:meta>
  201. <pf:meta/>
  202. </dp:meta>
  203. <dp:script>
  204. <pf:help context="HID_PROPERTIES"/>
  205. <script language="JavaScript">
  206. // page initialization functions
  207. function init()
  208. {
  209. <!-- Alert when downgrading page layout. -->
  210. var sDownGradeMessage = "<xts:string id="IDS_MP_DOWNGRADE_LAYOUT" encode="javascript"/>";
  211. <xsl:if test="/root/revert">
  212. alert(sDownGradeMessage);
  213. </xsl:if>
  214. if (window.initTextControls)
  215. {
  216. initTextControls();
  217. }
  218. }
  219. </script>
  220. </dp:script>
  221. <cp:colourSelectionDialog/>
  222. <utml:form name="pform" method="post" action="{$gateway}">
  223. <utml:exclude-prefix>m_mp_mlt_</utml:exclude-prefix>
  224. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  225. <utml:input type="hidden" name="read_only_page">
  226. <utml:value>
  227. <xsl:value-of select="not($canWrite)"/>
  228. </utml:value>
  229. </utml:input>
  230. <dp:header useBackURL="not($showOKCancel)">
  231. <dp:title>
  232. <xsl:copy-of select="$browserTitle"/>
  233. </dp:title>
  234. </dp:header>
  235. <df:propertiesTabs select="style">
  236. <df:hasSetPolicy>
  237. <xsl:value-of select="$canSetPolicy"/>
  238. </df:hasSetPolicy>
  239. </df:propertiesTabs>
  240. <!-- Render the body of the page -->
  241. <xsl:choose>
  242. <xsl:when test="/root/layout/@version = '1' or /root/layout/@version = '1.0'">
  243. <rdb:mypages mode="properties"/>
  244. </xsl:when>
  245. <xsl:otherwise>
  246. <div class="messageText" style="width:100%; text-align: center;padding-top:100px; padding-bottom:100px;">
  247. <xts:string id="IDS_MP_UNSUPPORTED_LAYOUT"/>
  248. </div>
  249. </xsl:otherwise>
  250. </xsl:choose>
  251. <dp:footer>
  252. <xsl:choose>
  253. <xsl:when test="$showOKCancel">
  254. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  255. <xsl:choose>
  256. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  257. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  258. </xsl:when>
  259. <xsl:otherwise>
  260. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  261. </xsl:otherwise>
  262. </xsl:choose>
  263. </xsl:when>
  264. <xsl:otherwise>
  265. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  266. </xsl:otherwise>
  267. </xsl:choose>
  268. </dp:footer>
  269. </utml:form>
  270. </dp:page>
  271. </xsl:template>
  272. <!-- Toolbar control -->
  273. <cp:toolbarControl/>
  274. </xsl:stylesheet>
  275. </xts:block>
  276. <xts:block id="debug" dependency="render_page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  277. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  278. <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">
  279. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  280. <xsl:template match="/">
  281. <dbg:dumpxml select="/root"/>
  282. </xsl:template>
  283. </xsl:stylesheet>
  284. </xts:block>
  285. </xts:morphlet>