styles.xts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  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/" resolverBase="cogadmin" messageBase="messages/cogadminuimsgs.xml" requiredCapability="canUsePortalAdministrationTool">
  13. <xts:block id="frag_init" nodelist="env, credential" type="exec" mode="interpret" processor="XSLT" path="cogadmin/logicsheets/fragment_init.xslt" condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
  14. <!--
  15. Get the styles
  16. -->
  17. <xts:block id="getContent" dependency="frag_init" nodelist="env, header, session, system, http, configProps" type="exec" mode="interpret" processor="XSLT">
  18. <xts:logicsheet path="logicsheets/tenantlogic.xsl"/>
  19. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  20. <xts:logicsheet path="cogadmin/logicsheets/presentation/filters.xslt"/>
  21. <xts:logicsheet path="/cogadmin/logicsheets/buslogic.xslt"/>
  22. <xsl:stylesheet version="1.0"
  23. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  24. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  25. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  26. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  27. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  28. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  29. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  30. exclude-result-prefixes="xsl xts SOAP-ENV bus admui xtsext flt send">
  31. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  32. <!-- common pager variables -->
  33. <admui:pagerVariables pagerName="styles"/>
  34. <!-- common variables -->
  35. <admui:variables/>
  36. <xsl:variable name="m_sort" select="/root/session/param[@name='s_ct']"/>
  37. <xsl:variable name="id">path:/portal/portalSkinFolder</xsl:variable>
  38. <xsl:template match="/">
  39. <xts:sequence>
  40. <xts:append select="/root">
  41. <response>
  42. <xts:request href="bus://dispatcher" protocol="NAV" responseEnvelope="false" outputHeader="false">
  43. <SOAP-ENV:Envelope xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  44. <SOAP-ENV:Header>
  45. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  46. </SOAP-ENV:Header>
  47. <SOAP-ENV:Body>
  48. <nav:getContainer>
  49. <nav:id>
  50. <xsl:value-of select="$id"/>
  51. </nav:id>
  52. <nav:childObjectFilter>
  53. <nav:itemType>portalSkin</nav:itemType>
  54. </nav:childObjectFilter>
  55. <nav:property name="objectClass"/>
  56. <nav:property name="defaultName"/>
  57. <nav:property name="ancestors"/>
  58. <nav:property name="searchPath"/>
  59. <nav:property name="storeID"/>
  60. <nav:property name="permissions"/>
  61. <nav:property name="lastModifiedDate"/>
  62. <nav:property name="displaySequence"/>
  63. <nav:property name="position"/>
  64. <nav:property name="screenTip"/>
  65. <nav:property name="disabled"/>
  66. <nav:property name="iconURI"/>
  67. <nav:property name="name"/>
  68. <nav:property name="internalId"/>
  69. <nav:property name="type"/>
  70. <nav:property name="icons"/>
  71. <nav:property name="hidden"/>
  72. <nav:property name="tenantID"/>
  73. <nav:maxObjects><xsl:value-of select="$maxObjects"/></nav:maxObjects>
  74. <nav:skipObjects><xsl:value-of select="$skipObjects"/></nav:skipObjects>
  75. <nav:sort>
  76. <xsl:attribute name="order">
  77. <xsl:choose>
  78. <xsl:when test="key('env-param', 'sort_order')='ascending'">ascending</xsl:when>
  79. <xsl:otherwise>descending</xsl:otherwise>
  80. </xsl:choose>
  81. </xsl:attribute>
  82. <xsl:choose>
  83. <xsl:when test="key('env-param', 'sort_column') != ''">
  84. <xsl:value-of select="key('env-param', 'sort_column')"/>
  85. </xsl:when>
  86. <xsl:otherwise>defaultName</xsl:otherwise>
  87. </xsl:choose>
  88. </nav:sort>
  89. <!-- common nav params -->
  90. <admui:commonNavParams/>
  91. </nav:getContainer>
  92. </SOAP-ENV:Body>
  93. </SOAP-ENV:Envelope>
  94. </xts:request>
  95. </response>
  96. </xts:append>
  97. <!-- The tool does not browse from the root of the /portal content area. As a result we need to tweak the ancestor property to
  98. make the pathlinks control work -->
  99. <xts:delete select="/root/content/*[local-name()='queryResponse']/*[local-name()='queryReply']/*/*[local-name()='ancestors']/*[./*[local-name()='objectClass' and text()='portal'] or ./*[local-name()='objectClass' and text()='portalSkin']]"/>
  100. <!-- Reset m_newsearch to false, so next time the skipobject will be set to 0.-->
  101. <xsl:if test="/root/env/param[@name = 'm_newsearch'] = 'true' ">
  102. <xts:replace select="/root/env/param[@name = 'm_newsearch']">
  103. <param name="m_newsearch">false</param>
  104. </xts:replace>
  105. </xsl:if>
  106. </xts:sequence>
  107. <xts:sequence>
  108. <!-- This is required for proper functioning of the pager control -->
  109. <xts:delete select="/root/env/param[@name='pagerfrom' or @name='pagerto' or @name='pagerfrom_d' or @name='pagerto_d']"/>
  110. </xts:sequence>
  111. <xts:sequence>
  112. <xsl:if test="not(/root/env/param[@name = 'm_path']) or /root/env/param[@name = 'm_path'] = '' ">
  113. <xts:append select="/root/env"><param name="m_path">/portal/portalSkinFolder</param></xts:append>
  114. </xsl:if>
  115. </xts:sequence>
  116. </xsl:template>
  117. </xsl:stylesheet>
  118. </xts:block>
  119. <!-- Merge the tenantNames into the response -->
  120. <xts:block processor="XSLT" type="exec" mandatory="false"
  121. path="/portal/tenancy/mergeTenantNames.xslt"
  122. id="mergeTenantNames"
  123. dependency="getContent"
  124. condition=".[/root/session/param[@name='e_showTenantInfo']='true']">
  125. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  126. </xts:block>
  127. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT">
  128. <xsl:stylesheet version="1.0"
  129. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  130. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  131. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  132. exclude-result-prefixes="xsl xts xos xtsext">
  133. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  134. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  135. <xsl:template match="/">
  136. <xts:sequence>
  137. <xts:append select="/root/output">
  138. <xos:part>
  139. <xos:entityHeader>
  140. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  141. </xos:entityHeader>
  142. <xos:entityBody>
  143. <fragment>
  144. <info>
  145. <title>
  146. <xts:string id="IDS_ADM_STYLES"/>
  147. </title>
  148. </info>
  149. <preferredTitle>
  150. <xts:string id="IDS_ADM_STYLES"/>
  151. </preferredTitle>
  152. <meta>
  153. <requiredCapabilities>canUsePortalAdministrationTool</requiredCapabilities>
  154. </meta>
  155. <state>
  156. <xsl:variable name="state">
  157. <xsl:text>&lt;param name="searchMode"&gt;</xsl:text>
  158. <xsl:value-of select="xtsext:xmlencode(string(key('env-param', 'searchMode')))"/>
  159. <xsl:text>&lt;/param&gt;</xsl:text>
  160. </xsl:variable>
  161. <xsl:value-of select="xtsext:base64encode($state,true())"/>
  162. </state>
  163. </fragment>
  164. </xos:entityBody>
  165. </xos:part>
  166. </xts:append>
  167. </xts:sequence>
  168. </xsl:template>
  169. </xsl:stylesheet>
  170. </xts:block>
  171. <xts:block id="renderMarkup" dependency="frag_init mergeTenantNames getMeta" nodelist="env, state, user, system" type="exec" mode="interpret" processor="XSLT">
  172. <xts:logicsheet path="cogadmin/logicsheets/admin.xslt"/>
  173. <xsl:stylesheet version="1.0"
  174. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  175. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  176. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  177. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  178. xmlns:nemo="http://developer.cognos.com/nemo"
  179. xmlns:admui="http://developer.cognos.com/schemas/xts/admui"
  180. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  181. exclude-result-prefixes="xsl nemo admui xts SOAP-ENV xos bus">
  182. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  183. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  184. <xsl:template match="/">
  185. <xts:sequence>
  186. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  187. <markup>
  188. <mimeType>text/html</mimeType>
  189. <markupXml>
  190. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  191. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  192. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  193. <root>
  194. <xts:transform src="/cogadmin/transforms/gen-ui-markup/styles.xslt" processor="XSLT">
  195. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  196. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  197. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/pager.xslt</xts:param>
  198. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  199. <root>
  200. <xts:queryNode select="/root/*[local-name()='queryResponse'] | /root/response/* | /root/scheduledBy | /root/user | /root/metadata | /root/system | /root/session | /root/env | /root/http"/>
  201. </root>
  202. </xts:transform>
  203. <xts:queryNode select="/root/system | /root/session | /root/user"/>
  204. </root>
  205. </xts:transform>
  206. </markupXml>
  207. </markup>
  208. <xsl:if test="key('env-param','searchMode') != ''">
  209. <subfragment id="STYLES_SEARCH_FRAGMENT" href="bus://xts.run?m=/cogadmin/search.xts&amp;type=styles"/>
  210. </xsl:if>
  211. </xts:append>
  212. </xts:sequence>
  213. </xsl:template>
  214. </xsl:stylesheet>
  215. </xts:block>
  216. </xts:morphlet>