properties_multilingual.xts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. <!--
  14. This morphlet (properties_multilingual.xts) consists of the following blocks:
  15. formlogic_init - update various /root/env level parameters based on new or changed /root/env parameters.
  16. getTabs - build the /root/tabs/objects structure.
  17. getContent - retrieve CM Information for this page.
  18. buildMultiLang - build the /root/multiLang structure with /lang and /name leaf nodes.
  19. renderPage - render the multilingual information properties page (READ-ONLY view) for the object specified by m_obj or m_id.
  20. -->
  21. <!--
  22. ===============================================================================================
  23. formlogic_init - standard form logic initialization
  24. ===============================================================================================
  25. -->
  26. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  27. <!-- Load object-specific property tabs map ============================================================== -->
  28. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  29. <!--
  30. ===============================================================================================
  31. getContent - get our data from Content Manager
  32. ===============================================================================================
  33. -->
  34. <xts:block id="getContent" processor="XSLT" type="exec">
  35. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  36. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  37. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 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/">
  38. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  39. <xsl:template match="/">
  40. <xsl:variable name="path">
  41. <xsl:choose>
  42. <xsl:when test="/root/env/param[@name='m_id']!=''"><xsl:value-of select="/root/env/param[@name='m_id']"/></xsl:when>
  43. <xsl:otherwise><xsl:value-of select="/root/env/param[@name='m_obj']"/></xsl:otherwise>
  44. </xsl:choose>
  45. </xsl:variable>
  46. <xts:sequence>
  47. <xts:append>
  48. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  49. <send:request provider="cm">
  50. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  51. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  52. <cm:search>
  53. <xsl:value-of select="$path"/>
  54. </cm:search>
  55. <cm:properties>
  56. <cml:prop-general/>
  57. <cm:property name="name"/>
  58. <cm:property name="description"/>
  59. <cm:property name="screenTip"/>
  60. </cm:properties>
  61. <cm:options schemaInfo="true"/>
  62. </cm:query>
  63. </xts:transform>
  64. </send:request>
  65. </xts:transform>
  66. </xts:append>
  67. </xts:sequence>
  68. </xsl:template>
  69. </xsl:stylesheet>
  70. </xts:block>
  71. <xts:block id="buildMultiLang" dependency="getContent" type="exec" mode="interpret" processor="XSLT" path="/portal/multilingual.xml"/>
  72. <!--
  73. ===============================================================================================
  74. renderPage - render the page
  75. ===============================================================================================
  76. -->
  77. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getContent buildMultiLang formlogic_init getTabs">
  78. <xts:logicsheet path="logicsheets/portal.xsl"/>
  79. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  80. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  81. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  82. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  83. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  84. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  85. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  86. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  87. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  88. <xsl:stylesheet version="1.0"
  89. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  90. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  91. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  92. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  93. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  94. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  95. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  96. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  97. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  98. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  99. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  100. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  101. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  102. xmlns:thm="http://developer.cognos.com/schemas/xts/logicsheets/xslt/theme/"
  103. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  104. exclude-result-prefixes="xsl cf cp df dp dc lyt cm cml thm utml xtsext xts send pf">
  105. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  106. <!-- current file name -->
  107. <xsl:variable name="mname" select="'properties_multilingual.xts'"/>
  108. <pf:variables/>
  109. <!-- start the output -->
  110. <xsl:template match="/root">
  111. <cml:single-object/>
  112. <xsl:variable name="section_path"><xsl:value-of select="key('env-param','m_obj')"/></xsl:variable>
  113. <!-- default product variable used with the product local select -->
  114. <xsl:variable name="default-product-locale">
  115. <!-- TODO: IS IT CORRECT TO GET THIS FROM THE HTTP HEADER... -->
  116. <xsl:value-of select="$contentLocale"/>
  117. <!-- xsl:value-of select="translate(string($contentLocale), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/ -->
  118. </xsl:variable>
  119. <xsl:variable name="has_write_permission" select="contains(concat(' ', $the-object/cm:permissions, ' '), ' write ')"/>
  120. <xsl:variable name="has_screenTip" select="$the-object/cm:screenTip"/>
  121. <!-- this will represent the root with the given label -->
  122. <xsl:variable name="report-title">
  123. <xts:string id="IDS_ALL_FILES"/>
  124. </xsl:variable>
  125. <xsl:variable name="browserTitle"><xts:string id="IDS_PROP_VIEW_MULTILINGUAL_TITLE"><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span></xts:param></xts:string></xsl:variable>
  126. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  127. <dp:meta>
  128. <pf:meta/> <!-- Standard meta tags -->
  129. </dp:meta>
  130. <!-- get passed in parameters -->
  131. <dp:script>
  132. <pf:help context=""/> <!-- Help system -->
  133. </dp:script>
  134. <utml:form name="pform" method="post" action="{$gateway}">
  135. <!--
  136. add a hidden input for the 'ps_nav_op', doing this will define the default behavior when submitting
  137. this form, we don't want the operation set when tabing, so set it to empty here. ideally this would
  138. be done by the tabbing itself, but since it's done in the theme stuff (and can't use utml) we'll just do
  139. it here.
  140. -->
  141. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  142. <!--
  143. this defines the form command operation to be performed when all the collected properties are submitted.
  144. -->
  145. <utml:input type="hidden" name="ifrmcmd" value="" utml:update="false"/>
  146. <utml:input type="hidden" name="m" value="" utml:update="false"/>
  147. <xsl:if test="key('env-param','m_transLocale')">
  148. <utml:input type="hidden" name="m_transLocale" value="" utml:update="false"/>
  149. </xsl:if>
  150. <utml:input type="hidden" name="m_newtrans" utml:update="false">
  151. <xsl:attribute name="value">
  152. <xsl:choose>
  153. <xsl:when test="key('env-param','m_newtrans')">
  154. <xsl:value-of select="key('env-param','m_newtrans')"/>
  155. </xsl:when>
  156. <xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise>
  157. </xsl:choose>
  158. </xsl:attribute>
  159. </utml:input>
  160. <!-- dialog header -->
  161. <dp:header>
  162. <!-- header titles-->
  163. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  164. <dp:description>
  165. <xts:string id="IDS_PROP_MULTILINGUAL_VIEW_INTRO"/>
  166. </dp:description>
  167. </dp:header>
  168. <xsl:call-template name="initial-render">
  169. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  170. <xsl:with-param name="default-product-locale" select="$default-product-locale"/>
  171. <xsl:with-param name="has_write_permission" select="$has_write_permission"/>
  172. <xsl:with-param name="has_screenTip" select="$has_screenTip"/>
  173. </xsl:call-template>
  174. <dp:footer>
  175. <xsl:choose>
  176. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  177. <df:button df:id="IDS_CLOSE" df:style="stack-down"/>
  178. </xsl:when>
  179. <xsl:otherwise>
  180. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  181. </xsl:otherwise>
  182. </xsl:choose>
  183. </dp:footer>
  184. </utml:form>
  185. </dp:page>
  186. </xsl:template>
  187. <xsl:template name="initial-render">
  188. <xsl:param name="form-read-only"/>
  189. <xsl:param name="default-product-locale"/>
  190. <xsl:param name="has_write_permission"/>
  191. <xsl:param name="has_screenTip"/>
  192. <xsl:variable name="transCnt" select="count(/root/multiLangs/name)"/>
  193. <xsl:for-each select="/root/multiLangs/name">
  194. <xsl:if test="not(preceding-sibling::name = .)">
  195. <xsl:variable name="cL"><xsl:value-of select="."/></xsl:variable>
  196. <xsl:variable name="cLT">
  197. <xsl:value-of select="translate( $cL, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/>
  198. </xsl:variable>
  199. <xsl:variable name="cFL">
  200. <xsl:value-of select="/root/config/param[@name='locale']/locale[@type='contentLocale' and id=string($cLT)]/displayName"/>
  201. </xsl:variable>
  202. <xsl:variable name="cDN">
  203. <xsl:value-of select="/root/cm:queryResponse/child::node()/cm:name/*[@xml:lang=$cL]"/>
  204. </xsl:variable>
  205. <xsl:variable name="cDST">
  206. <xsl:value-of select="/root/cm:queryResponse/child::node()/cm:screenTip/*[@xml:lang=$cL]"/>
  207. </xsl:variable>
  208. <xsl:variable name="cDD">
  209. <xsl:value-of select="/root/cm:queryResponse/child::node()/cm:description/*[@xml:lang=$cL]"/>
  210. </xsl:variable>
  211. <xsl:if test="position() &gt; 1">
  212. <lyt:layout style="1" border="yes"/>
  213. </xsl:if>
  214. <xsl:call-template name="render-out">
  215. <xsl:with-param name="cL" select="$cL"/>
  216. <xsl:with-param name="cFL" select="$cFL"/>
  217. <xsl:with-param name="cLT" select="$cLT"/>
  218. <xsl:with-param name="cDST" select="$cDST"/>
  219. <xsl:with-param name="cDD" select="$cDD"/>
  220. <xsl:with-param name="cDN" select="$cDN"/>
  221. <xsl:with-param name="transCnt" select="$transCnt"/>
  222. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  223. <xsl:with-param name="default-product-locale" select="$default-product-locale"/>
  224. <xsl:with-param name="has_write_permission" select="$has_write_permission"/>
  225. <xsl:with-param name="has_screenTip" select="$has_screenTip"/>
  226. <xsl:with-param name="initialRender" select="true()"/>
  227. </xsl:call-template>
  228. </xsl:if>
  229. </xsl:for-each>
  230. <!--/xsl:if>
  231. </xsl:for-each-->
  232. </xsl:template>
  233. <xsl:template name="render-out">
  234. <xsl:param name="cL"/>
  235. <xsl:param name="cFL"/>
  236. <xsl:param name="cLT"/>
  237. <xsl:param name="cDST"/>
  238. <xsl:param name="cDD"/>
  239. <xsl:param name="cDN"/>
  240. <xsl:param name="transCnt"/>
  241. <xsl:param name="form-read-only"/>
  242. <xsl:param name="default-product-locale"/>
  243. <xsl:param name="has_write_permission"/>
  244. <xsl:param name="has_screenTip"/>
  245. <xsl:param name="utml-form-name"/>
  246. <xsl:param name="initialRender" select="false()"/>
  247. <lyt:layout style="2">
  248. <lyt:section>
  249. <dp:list width="100%">
  250. <dp:section>
  251. <dp:text tdClass="formLabel" width="60%"><xts:string id="IDS_PROP_LANGUAGE"/></dp:text><dp:text width="40%"></dp:text>
  252. </dp:section>
  253. <dp:section>
  254. <dp:text width="60%"><xsl:value-of select="$cFL"/></dp:text>
  255. </dp:section>
  256. </dp:list>
  257. </lyt:section>
  258. <lyt:section></lyt:section>
  259. </lyt:layout>
  260. <lyt:layout style="2">
  261. <lyt:section>
  262. <dp:group>
  263. <dp:groupItem>
  264. <dp:group>
  265. <dp:groupItem width="100%">
  266. <dp:input>
  267. <dp:section1><xts:string id="IDS_PROP_NAME"/></dp:section1>
  268. <dp:section2>
  269. <utml:input type="text" size="45" utml:update="false" maxlength="256">
  270. <utml:name><xsl:value-of select="concat('l_defaultName',position())"/></utml:name>
  271. <utml:value><xsl:value-of select="$cDN"/></utml:value>
  272. <utml:read-only>true</utml:read-only>
  273. </utml:input>
  274. </dp:section2>
  275. </dp:input>
  276. </dp:groupItem>
  277. </dp:group>
  278. <dp:group>
  279. <dp:groupItem width="100%">
  280. <xsl:if test="$has_screenTip and not(key('session-param','e_proot')='' and key('session-param','e_mroot')='')">
  281. <dp:input>
  282. <dp:section1><xts:string id="IDS_PROP_SCREENTIP"/></dp:section1>
  283. <dp:section2>
  284. <utml:input type="text" class="pInput" size="30" maxlength="100">
  285. <utml:name><xsl:value-of select="concat('l_defaultScreenTip',position())"/></utml:name>
  286. <utml:value><xsl:value-of select="$cDST"/></utml:value>
  287. <utml:read-only>true</utml:read-only>
  288. </utml:input>
  289. </dp:section2>
  290. </dp:input>
  291. </xsl:if>
  292. </dp:groupItem>
  293. </dp:group>
  294. </dp:groupItem>
  295. </dp:group>
  296. </lyt:section>
  297. <lyt:section>
  298. <dp:group>
  299. <dp:groupItem>
  300. <dp:group>
  301. <dp:groupItem width="100%">
  302. <dp:textarea wrap="true">
  303. <dp:section1><xts:string id="IDS_PROP_DESCRIPTION"/></dp:section1>
  304. <dp:section2>
  305. <utml:textarea rows="4" cols="32" class="pTextarea">
  306. <utml:name><xsl:value-of select="concat('l_defaultDescription',position())"/></utml:name>
  307. <utml:value><xsl:value-of select="$cDD"/></utml:value>
  308. <utml:read-only>true</utml:read-only>
  309. </utml:textarea>
  310. </dp:section2>
  311. </dp:textarea>
  312. </dp:groupItem>
  313. </dp:group>
  314. <dp:group>
  315. <dp:groupItem width="100%"><dp:text/></dp:groupItem>
  316. </dp:group>
  317. </dp:groupItem>
  318. </dp:group>
  319. </lyt:section>
  320. </lyt:layout>
  321. </xsl:template>
  322. </xsl:stylesheet>
  323. </xts:block>
  324. <!--
  325. ===============================================================================================
  326. debug - display debug information
  327. ===============================================================================================
  328. -->
  329. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  330. <!-- get the debug logic sheet -->
  331. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  332. <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">
  333. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  334. <xsl:template match="/">
  335. <dbg:dumpxml select="/root"/>
  336. </xsl:template>
  337. </xsl:stylesheet>
  338. </xts:block>
  339. </xts:morphlet>