add_multilingual.xts 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  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" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. This morphlet (add_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. doParam - build the /root/env/param structure with language specific names beginning with m_add_, m_delete_locale, and m_transLocale.
  17. doEntriesContent - build the /root/entries/entry structure and remove the /root/env/param with names beginning with m_add_ and m_transloc.
  18. doEncode - build the /root/env/addlocales structure.
  19. getContent - retrieve CM Information for this page.
  20. renderPage - render the multilingual properties page for adding language specific objects.
  21. -->
  22. <!--
  23. ===============================================================================================
  24. formlogic_init - standard form logic initialization
  25. ===============================================================================================
  26. -->
  27. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  28. <!-- xts:block id="getLocales" type="exec" mode="interpret" processor="XSLT" path="/portal/locales.xml"/ -->
  29. <xts:block id="doParam" type="exec" mode="interpret" processor="XSLT" condition=".[/root/env/param[@name='m_add_name' or @name='m_add_screenTip' or @name='m_add_description']]" mandatory="false" dependency="formlogic_init">
  30. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  31. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  32. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  33. <xsl:variable name="nam"><xsl:value-of select="key('env-param','m_add_name')"/></xsl:variable>
  34. <xsl:variable name="dsc"><xsl:value-of select="key('env-param','m_add_description')"/></xsl:variable>
  35. <xsl:variable name="sct"><xsl:value-of select="key('env-param','m_add_screenTip')"/></xsl:variable>
  36. <xsl:variable name="lcle"><xsl:value-of select="key('env-param','m_transLocale')"/></xsl:variable>
  37. <xsl:variable name="fndname"><xsl:value-of select="concat('m_add_name_',$lcle)"/></xsl:variable>
  38. <xsl:variable name="fnddesc"><xsl:value-of select="concat('m_add_description_',$lcle)"/></xsl:variable>
  39. <xsl:variable name="fndscrt"><xsl:value-of select="concat('m_add_screenTip_',$lcle)"/></xsl:variable>
  40. <xsl:variable name="fnddelt"><xsl:value-of select="concat('m_delete_locale_',$lcle)"/></xsl:variable>
  41. <xsl:variable name="sections"><xsl:value-of select="key('env-param','m_sectioning')"/></xsl:variable>
  42. <xsl:template match="/">
  43. <xts:sequence>
  44. <xts:append select="/root/env">
  45. <xsl:if test="not($sections = '1')">
  46. <xsl:element name="param">
  47. <xsl:attribute name="name"><xsl:value-of select="$fndname"/></xsl:attribute>
  48. <xsl:value-of select="$nam"/>
  49. </xsl:element>
  50. <xsl:element name="param">
  51. <xsl:attribute name="name"><xsl:value-of select="$fnddesc"/></xsl:attribute>
  52. <xsl:value-of select="$dsc"/>
  53. </xsl:element>
  54. <xsl:element name="param">
  55. <xsl:attribute name="name"><xsl:value-of select="$fndscrt"/></xsl:attribute>
  56. <xsl:value-of select="$sct"/>
  57. </xsl:element>
  58. <xsl:element name="param">
  59. <xsl:attribute name="name"><xsl:value-of select="$fnddelt"/></xsl:attribute>
  60. </xsl:element>
  61. </xsl:if>
  62. </xts:append>
  63. </xts:sequence>
  64. </xsl:template>
  65. </xsl:stylesheet>
  66. </xts:block>
  67. <!--
  68. ===============================================================================================
  69. get_list_content
  70. Unpacks the bottom list (web64encoded) in /root/entries.
  71. ===============================================================================================
  72. -->
  73. <xts:block id="doEntriesContent" type="exec" mode="interpret" processor="XSLT" dependency="doParam">
  74. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  75. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  76. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  77. <xsl:variable name="sections"><xsl:value-of select="key('env-param','m_sectioning')"/></xsl:variable>
  78. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  79. <xsl:template match="/">
  80. <xts:sequence>
  81. <xts:append select="/root">
  82. <entries>
  83. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','addlocales'))), true())" disable-output-escaping="yes"/>
  84. </entries>
  85. </xts:append>
  86. <xts:append select="/root/entries">
  87. <xsl:if test="key('env-param','m_add_name') and key('env-param','m_add_name') != '' and not($sections='1')">
  88. <entry>
  89. <xsl:element name="mlName"><xsl:value-of select="key('env-param','m_add_name')"/></xsl:element>
  90. <!-- This can be uncommented if they decide to see the entry added -->
  91. <!--xsl:element name="mlScreenTip">
  92. <xsl:choose>
  93. <xsl:when test="string-length(key('env-param','m_add_screenTip'))>15">
  94. <xsl:value-of select="concat(substring(key('env-param','m_add_screenTip'),1,15),$elip)"/>
  95. </xsl:when>
  96. <xsl:otherwise><xsl:value-of select="key('env-param','m_add_screenTip')"/></xsl:otherwise>
  97. </xsl:choose>
  98. </xsl:element>
  99. <xsl:element name="mlDescription">
  100. <xsl:choose>
  101. <xsl:when test="string-length(key('env-param','m_add_description'))>25">
  102. <xsl:value-of select="concat(substring(key('env-param','m_add_description'),1,25),$elip)"/>
  103. </xsl:when>
  104. <xsl:otherwise><xsl:value-of select="key('env-param','m_add_description')"/></xsl:otherwise>
  105. </xsl:choose>
  106. </xsl:element-->
  107. <xsl:element name="mlLanguage"><xsl:value-of select="key('env-param','m_add_language_display')"/></xsl:element>
  108. </entry>
  109. </xsl:if>
  110. </xts:append>
  111. <xsl:if test="key('env-param','m_add_name')">
  112. <xts:delete select="/root/env/param[@name='m_add_name']"/>
  113. <xts:delete select="/root/env/param[@name='m_add_description']"/>
  114. <xts:delete select="/root/env/param[@name='m_add_screenTip']"/>
  115. <xts:delete select="/root/env/param[@name='m_transLocale']"/>
  116. <xts:delete select="/root/env/param[@name='m_add_language_display']"/>
  117. </xsl:if>
  118. <xsl:if test="$sections='1'"><xts:delete select="/root/env/param[@name='m_sectioning']"/></xsl:if>
  119. <xts:delete select="/root/env/param[@name='pagerfromlistpager']"/>
  120. <xts:delete select="/root/env/param[@name='pagertolistpager']"/>
  121. <xts:delete select="/root/env/param[@name='pagerfrom_dlistpager']"/>
  122. <xts:delete select="/root/env/param[@name='pagerto_dlistpager']"/>
  123. </xts:sequence>
  124. </xsl:template>
  125. </xsl:stylesheet>
  126. </xts:block>
  127. <!--
  128. ===============================================================================================
  129. encode_lists
  130. Encodes the entries in /root/entries into the addlocales parameter in /root/env/param.
  131. ===============================================================================================
  132. -->
  133. <xts:block id="doEncode" mode="interpret" processor="XSLT" type="exec" dependency="doEntriesContent">
  134. <xts:logicsheet path="logicsheets/portal.xsl"/>
  135. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  136. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  137. <xsl:template match="/">
  138. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  139. <xts:sequence>
  140. <xts:delete select="/root/env/param[@name='addlocales']"/>
  141. <xts:append select="/root/env">
  142. <xsl:variable name="entries-markup">
  143. <xsl:apply-templates select="/root/entries/*" mode="markup"/>
  144. </xsl:variable>
  145. <param name="addlocales">
  146. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($entries-markup), true()))"/>
  147. </param>
  148. </xts:append>
  149. </xts:sequence>
  150. </xsl:template>
  151. <pf:serialize-xml/>
  152. </xsl:stylesheet>
  153. </xts:block>
  154. <!--
  155. ===============================================================================================
  156. getContent - get our data from Content Manager
  157. ===============================================================================================
  158. -->
  159. <xts:block id="getContent" processor="XSLT" type="exec" condition=".[(/root/env/param[@name='m_class'] != 'exportDeployment') and (/root/env/param[@name='m_class'] != 'importDeployment')] " mandatory="false" dependency="doEncode">
  160. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  161. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  162. <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/">
  163. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  164. <xsl:template match="/">
  165. <xts:sequence>
  166. <xts:append>
  167. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  168. <send:request provider="cm">
  169. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  170. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  171. <cm:search>
  172. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  173. </cm:search>
  174. <cm:properties>
  175. <cml:prop-general/>
  176. <cm:property name="name"/>
  177. <cm:property name="description"/>
  178. <cm:property name="screenTip"/>
  179. <cm:property name="position"/>
  180. </cm:properties>
  181. <cm:options schemaInfo="true"/>
  182. </cm:query>
  183. </xts:transform>
  184. </send:request>
  185. </xts:transform>
  186. </xts:append>
  187. </xts:sequence>
  188. </xsl:template>
  189. </xsl:stylesheet>
  190. </xts:block>
  191. <!--
  192. ===============================================================================================
  193. renderPage - render the page
  194. ===============================================================================================
  195. -->
  196. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init doEntriesContent doEncode getContent">
  197. <xts:logicsheet path="logicsheets/portal.xsl"/>
  198. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  199. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  200. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  201. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  202. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  203. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  204. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  205. <xsl:stylesheet version="1.0"
  206. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  207. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  208. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  209. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  210. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  211. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  212. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  213. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  214. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  215. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  216. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  217. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  218. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  219. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  220. exclude-result-prefixes="xsl cf cp df dp dc lyt cm cml utml xtsext pf send xts">
  221. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  222. <!-- current file name -->
  223. <xsl:variable name="mname" select="'add_multilingual.xts'"/>
  224. <pf:variables/>
  225. <!-- start the output -->
  226. <xsl:template match="/root">
  227. <xsl:variable name="section_path"><xsl:value-of select="key('env-param','m_obj')"/></xsl:variable>
  228. <cml:single-object/>
  229. <!-- basically create a list of what values have not been used and put their position in the variable notUsed.-->
  230. <xsl:variable name="notUsed">
  231. <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale']">
  232. <xsl:variable name="cL"><xsl:value-of select="./id"/></xsl:variable>
  233. <xsl:variable name="haveMatch">
  234. <xsl:for-each select="/root/env/param[starts-with( @name, 'm_delete_locale_' )]">
  235. <xsl:if test="translate(substring-after(./@name,'m_delete_locale_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = $cL">
  236. <xsl:value-of select="$cL"/>
  237. </xsl:if>
  238. </xsl:for-each>
  239. </xsl:variable>
  240. <xsl:if test="$haveMatch=''">
  241. <xsl:value-of select="concat(position(),' ,')"/>
  242. </xsl:if>
  243. </xsl:for-each>
  244. </xsl:variable>
  245. <xsl:variable name="firstpos" select="substring-before(string($notUsed), ' ,')"/>
  246. <xsl:variable name="posnum" select="number($firstpos)"/>
  247. <xsl:variable name="firsttouse">
  248. <xsl:value-of select="/root/config/param[@name='locale']/locale[@type='contentLocale' and position()=$posnum]/id"/>
  249. </xsl:variable>
  250. <!-- default product variable used with the product local select -->
  251. <xsl:variable name="default-product-locale">
  252. <xsl:choose>
  253. <xsl:when test="key('env-param','m_transLocale') and key('env-param','m_transLocale') != ''">
  254. <!-- we know this guy is in lower case...it comes from us! -->
  255. <xsl:value-of select="key('env-param','m_transLocale')"/>
  256. </xsl:when>
  257. <xsl:otherwise>
  258. <xsl:choose>
  259. <xsl:when test="$firsttouse != ''">
  260. <xsl:value-of select="$firsttouse"/>
  261. </xsl:when>
  262. <xsl:otherwise>
  263. <xsl:value-of select="translate( string($contentLocale), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/>
  264. </xsl:otherwise>
  265. </xsl:choose>
  266. </xsl:otherwise>
  267. </xsl:choose>
  268. </xsl:variable>
  269. <!-- this will represent the root with the given label -->
  270. <xsl:variable name="report-title">
  271. <xsl:choose>
  272. <xsl:when test="starts-with(string($section_path),string( /root/path//cm:content/cm:searchPath))">
  273. <xts:string id="IDS_ALL_FILES"/>
  274. </xsl:when>
  275. </xsl:choose>
  276. </xsl:variable>
  277. <xsl:variable name="isDeployment">
  278. <xsl:choose>
  279. <xsl:when test="(/root/env/param[@name='m_class'] = 'exportDeployment') or (/root/env/param[@name='m_class'] = 'importDeployment')">
  280. <xsl:value-of select="'true'"/>
  281. </xsl:when>
  282. <xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise>
  283. </xsl:choose>
  284. </xsl:variable>
  285. <xsl:variable name="has_write_permission" select="contains(concat(' ', string($the-object/cm:permissions), ' '), ' write ')"/>
  286. <xsl:variable name="browserTitle">
  287. <xts:string id="IDS_DEPLOYMENT_ADD_TARGET_NAME_TITLE">
  288. <xts:param name="specName">
  289. <span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name = 'm_p_defaultName']"/></span>
  290. </xts:param>
  291. </xts:string>
  292. </xsl:variable>
  293. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  294. <dp:meta>
  295. <pf:meta/> <!-- Standard meta tags -->
  296. </dp:meta>
  297. <!-- get passed in parameters -->
  298. <dp:script>
  299. <pf:help context="HID_DEPLOY"/> <!-- Help system -->
  300. <xsl:if test="$has_write_permission = true() or $isDeployment='true'">
  301. <script language="javascript">
  302. var MSG_ERR_NO_NAME = "<xts:string id="IDS_PROP_ERR_NO_NAME" encode="javascript"/>";
  303. function cancelit()
  304. {
  305. <xsl:for-each select="/root/env/param[starts-with(@name,'m_add_name_')]">
  306. <xsl:variable name="deloc" select="xtsext:javascriptencode(substring-after(./@name,'m_add_name_'))"/>
  307. document.pform['m_delete_locale_<xsl:value-of select="$deloc"/>'].value='<xsl:value-of select="$deloc"/>';
  308. </xsl:for-each>
  309. <!-- even on Cancel - reset the section information -->
  310. resetSection();
  311. }
  312. function resetSection()
  313. {
  314. <!--
  315. This function resets the listpagersection (for main-pager-section) to 1 and the sectioning to 0,
  316. so that the next time to this page from properties_multilingual will handle processing correctly.
  317. -->
  318. document.pform.m_listpagersection.value = '1';
  319. document.pform.m_sectioning.value='0';
  320. }
  321. function validate()
  322. {
  323. <!--
  324. This function is here only for main-pager-section. It allows moving through the sections without
  325. affecting the main functioning of add-multilingual.
  326. -->
  327. <xsl:if test="key('env-param','m_return') and key('env-param','m_return')!=''">
  328. document.pform.m_return.value = '<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','m_return')))"/>';
  329. </xsl:if>
  330. document.pform.m.value = '<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>';
  331. document.pform.ps_nav_op.value='maintain';
  332. document.pform.m_sectioning.value='1';
  333. return true;
  334. }
  335. function addLocale()
  336. {
  337. document.pform.m_add_language_display.value = document.pform.m_transLocale.options[document.pform.m_transLocale.selectedIndex].text;
  338. if (document.pform['m_add_name'] &amp;&amp; document.pform['m_add_name'].type != "hidden")
  339. {
  340. if (trim(document.pform['m_add_name'].value) == '')
  341. {
  342. document.pform['m_add_name'].focus();
  343. alert( MSG_ERR_NO_NAME );
  344. return;
  345. }
  346. }
  347. <xsl:if test="key('env-param','m_return') and key('env-param','m_return')!=''">
  348. document.pform.m_return.value = '<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','m_return')))"/>';
  349. </xsl:if>
  350. document.pform.m.value = '<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>';
  351. document.pform.ps_nav_op.value='maintain';
  352. if (document.layers)
  353. {
  354. if( document.layers['m_add_name'] != null &amp;&amp; document.layers['m_add_name'].type != "hidden")
  355. document.layers['m_add_name'].color = 'silver';
  356. }
  357. else if (document.all)
  358. {
  359. if( document.all['m_add_name'] != null &amp;&amp; document.all['m_add_name'].type != "hidden")
  360. document.all['m_add_name'].style.color = 'silver';
  361. }
  362. document.pform.m_newtrans.value = '1';
  363. document.pform.submit();
  364. }
  365. function langChange(idx)
  366. {
  367. document.pform.m_add_language_display.value = document.pform.m_transLocale.options[idx].text;
  368. }
  369. </script>
  370. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"></script>
  371. </xsl:if>
  372. </dp:script>
  373. <utml:form name="pform" method="post" action="{$gateway}">
  374. <utml:read-only>
  375. <xsl:choose>
  376. <xsl:when test="$has_write_permission = true() or $isDeployment='true'">
  377. <xsl:text>false</xsl:text>
  378. </xsl:when>
  379. <xsl:otherwise>
  380. <xsl:text>true</xsl:text>
  381. </xsl:otherwise>
  382. </xsl:choose>
  383. </utml:read-only>
  384. <!--
  385. add a hidden input for the 'ps_nav_op', doing this will define the default behavior when submitting
  386. this form, we don't want the operation set when tabing, so set it to empty here. ideally this would
  387. be done by the tabbing itself, but since it's done in the theme stuff (and can't use utml) we'll just do
  388. it here.
  389. -->
  390. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  391. <!--
  392. this defines the form command operation to be performed when all the collected properties are submitted.
  393. -->
  394. <utml:input type="hidden" name="m" value="" utml:update="false"/>
  395. <utml:input type="hidden" name="m_newtrans" value="0"/>
  396. <utml:input type="hidden" name="m_sectioning" value="0"/>
  397. <utml:input type="hidden" name="m_add_language_display" value="" utml:update="false"/>
  398. <xsl:choose>
  399. <xsl:when test="$isDeployment='true'">
  400. <dp:header>
  401. <dp:title>
  402. <xsl:copy-of select="$browserTitle"/>
  403. </dp:title>
  404. <dp:description>
  405. <xts:string id="IDS_DEPLOYMENT_ADD_TARGET_NAME_DESCRIPTION"/>
  406. </dp:description>
  407. </dp:header>
  408. </xsl:when>
  409. <xsl:otherwise>
  410. <dp:header>
  411. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  412. <dp:description>
  413. <xts:string id="IDS_PROP_ADD_MULTILINGUAL_INTRO"/>
  414. </dp:description>
  415. </dp:header>
  416. </xsl:otherwise>
  417. </xsl:choose>
  418. <lyt:layout style="1">
  419. <lyt:section>
  420. <dp:list>
  421. <dp:section>
  422. <dp:input>
  423. <dp:section1 id="lbl_m_transLocale">
  424. <xts:string id="IDS_PROP_LANGUAGE"/>
  425. </dp:section1>
  426. <dp:section2>
  427. <utml:select name="m_transLocale" aria-labelledby="lbl_m_transLocale">
  428. <!-- Hard-coded language values for 0.1 release -->
  429. <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale']">
  430. <xsl:variable name="cL"><xsl:value-of select="id"/></xsl:variable>
  431. <xsl:variable name="haveMatch">
  432. <xsl:for-each select="/root/env/param[starts-with( @name, 'm_delete_locale_' )]">
  433. <xsl:if test="translate(substring-after(./@name,'m_delete_locale_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = $cL">
  434. <xsl:value-of select="$cL"/>
  435. </xsl:if>
  436. </xsl:for-each>
  437. </xsl:variable>
  438. <xsl:variable name="haveMatch2">
  439. <xsl:for-each select="/root/env/param[starts-with( @name, 'm_d_default_name_' )]">
  440. <xsl:if test="translate(substring-after(./@name,'m_d_default_name_'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = $cL">
  441. <xsl:value-of select="$cL"/>
  442. </xsl:if>
  443. </xsl:for-each>
  444. </xsl:variable>
  445. <xsl:if test="$haveMatch='' and $haveMatch2=''">
  446. <utml:option>
  447. <xsl:if test="$cL = $default-product-locale"><xsl:attribute name="selected"/></xsl:if>
  448. <utml:value><xsl:value-of select="id"/></utml:value>
  449. <xsl:attribute name="id"><xsl:value-of select="displayName"/></xsl:attribute>
  450. <xsl:value-of select="displayName"/>
  451. </utml:option>
  452. </xsl:if>
  453. </xsl:for-each>
  454. </utml:select>
  455. </dp:section2>
  456. </dp:input>
  457. </dp:section>
  458. </dp:list>
  459. </lyt:section>
  460. </lyt:layout>
  461. <xsl:variable name="inputTitle">
  462. <xsl:choose>
  463. <xsl:when test="$isDeployment='true'">
  464. <xts:string id="IDS_DEPLOYMENT_TARGET_NAME_TARGET"/>
  465. </xsl:when>
  466. <xsl:otherwise>
  467. <xts:string id="IDS_PROP_NAME"/>
  468. </xsl:otherwise>
  469. </xsl:choose>
  470. </xsl:variable>
  471. <lyt:layout style="2">
  472. <lyt:section>
  473. <dp:input>
  474. <dp:section1 id="lbl_m_add_name">
  475. <xsl:value-of select="$inputTitle"/>
  476. </dp:section1>
  477. <dp:section2>
  478. <utml:input type="text" class="pInput" size="30" maxlength="256" aria-labelledby="lbl_m_add_name">
  479. <utml:name>m_add_name</utml:name>
  480. <utml:read-only>
  481. <xsl:choose>
  482. <xsl:when test="$the-object/cm:defaultName[@modifiable = 'false']"><xsl:text>true</xsl:text></xsl:when>
  483. <xsl:otherwise>
  484. <xsl:text>false</xsl:text>
  485. </xsl:otherwise>
  486. </xsl:choose>
  487. </utml:read-only>
  488. <utml:value>
  489. <xsl:if test="$the-object/cm:defaultName[@modifiable = 'false']">
  490. <xsl:value-of select="$the-object/cm:defaultName"/>
  491. </xsl:if>
  492. </utml:value>
  493. </utml:input>
  494. <xsl:if test="$the-object/cm:defaultName[@modifiable = 'false']">
  495. <utml:input type="hidden" name="m_add_name">
  496. <utml:value><xsl:value-of select="$the-object/cm:defaultName"/></utml:value>
  497. </utml:input>
  498. </xsl:if>
  499. </dp:section2>
  500. </dp:input>
  501. <xsl:if test="$the-object/cm:defaultScreenTip and not(key('session-param','e_proot')='' and key('session-param','e_mroot')='')">
  502. <dp:input>
  503. <dp:section1 id="lbl_m_add_screenTip">
  504. <xts:string id="IDS_PROP_SCREENTIP"/>
  505. </dp:section1>
  506. <dp:section2>
  507. <utml:input type="text" class="pInput" maxlength="100" size="30" aria-labelledby="lbl_m_add_screenTip">
  508. <utml:name>m_add_screenTip</utml:name>
  509. <utml:read-only><xsl:value-of select="$the-object/cm:defaultScreenTip[@modifiable = 'false']"/></utml:read-only>
  510. <utml:value>
  511. <xsl:if test="$the-object/cm:screenTip[@modifiable = 'false']">
  512. <xsl:value-of select="$the-object/cm:screenTip"/>
  513. </xsl:if>
  514. </utml:value>
  515. </utml:input>
  516. <xsl:if test="$the-object/cm:screenTip[@modifiable = 'false']">
  517. <utml:input type="hidden" name="m_add_screenTip">
  518. <utml:value><xsl:value-of select="$the-object/cm:screenTip"/></utml:value>
  519. </utml:input>
  520. </xsl:if>
  521. </dp:section2>
  522. </dp:input>
  523. </xsl:if>
  524. </lyt:section>
  525. <lyt:section>
  526. <xsl:if test="$the-object/cm:defaultDescription and not($the-object/cm:shortcut != '')">
  527. <dp:input>
  528. <dp:section1 id="lbl_m_add_description">
  529. <xts:string id="IDS_PROP_DESCRIPTION"/>
  530. </dp:section1>
  531. <dp:section2>
  532. <utml:textarea rows="4" class="pTextarea" cols="32" aria-labelledby="lbl_m_add_description">
  533. <utml:name>m_add_description</utml:name>
  534. <utml:read-only><xsl:value-of select="$the-object/cm:defaultDescription[@modifiable='false']"/></utml:read-only>
  535. <utml:value>
  536. <xsl:if test="$the-object/cm:description[@modifiable = 'false']">
  537. <xsl:value-of select="$the-object/cm:description"/>
  538. </xsl:if>
  539. </utml:value>
  540. </utml:textarea>
  541. <xsl:if test="$the-object/cm:description[@modifiable = 'false']">
  542. <utml:input type="hidden" name="m_add_description">
  543. <utml:value><xsl:value-of select="$the-object/cm:description"/></utml:value>
  544. </utml:input>
  545. </xsl:if>
  546. </dp:section2>
  547. </dp:input>
  548. </xsl:if>
  549. </lyt:section>
  550. </lyt:layout>
  551. <lyt:layout style="1" border="no">
  552. <lyt:section align="center" width="100%">
  553. <dp:buttonGroup>
  554. <dp:button id="btn_addLocale">
  555. <a role="button">
  556. <xsl:attribute name="href">javascript:addLocale()</xsl:attribute>
  557. <dp:buttonText>
  558. <xsl:text/><xts:string id="IDS_ADD"/> <xsl:text/>
  559. <img border="0" align="absMiddle" alt="">
  560. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_down.gif</xsl:attribute>
  561. </img>
  562. </dp:buttonText>
  563. </a>
  564. </dp:button>
  565. </dp:buttonGroup>
  566. </lyt:section>
  567. </lyt:layout>
  568. <lyt:layout style="1" title="IDS_ADDENTRIES_ADDENTRIES" border="yes">
  569. <lyt:section>
  570. <cf:main-pager-section name="listpager" form="pform" width="100%" validate="true">
  571. <cf:param name="item-path">/root/entries/*</cf:param>
  572. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  573. <cf:param name="lines-per-page">
  574. <xsl:choose>
  575. <xsl:when test="key('session-param','linesPerPage')!=''">
  576. <xsl:value-of select="key('session-param','linesPerPage')"/>
  577. </xsl:when>
  578. <xsl:otherwise>
  579. <xsl:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
  580. </xsl:otherwise>
  581. </xsl:choose>
  582. </cf:param>
  583. <cf:param name="rows">
  584. <cp:tableHeader>
  585. <cp:columnHeader width="25%">
  586. <xts:string id="IDS_PROP_MULTILINGUAL_LANGUAGE_COLUMN"/>
  587. </cp:columnHeader>
  588. <cp:columnHeader width="75%">
  589. <xsl:choose>
  590. <xsl:when test="$isDeployment='true'">
  591. <xts:string id="IDS_DEPLOYMENT_PACKAGES_TARGET_NAME"/>
  592. </xsl:when>
  593. <xsl:otherwise>
  594. <xts:string id="IDS_NAME"/>
  595. </xsl:otherwise>
  596. </xsl:choose>
  597. </cp:columnHeader>
  598. </cp:tableHeader>
  599. <cp:tableContent>
  600. <cp:columnContent><xsl:value-of select="mlLanguage"/></cp:columnContent>
  601. <cp:columnContent lang="{$contentLocale}"><xsl:value-of select="mlName"/></cp:columnContent>
  602. </cp:tableContent>
  603. <cf:row/>
  604. </cf:param>
  605. </cf:main-pager-section>
  606. </lyt:section>
  607. </lyt:layout>
  608. <xsl:choose>
  609. <xsl:when test="$isDeployment='true'">
  610. <dp:footer>
  611. <df:button df:id="IDS_OK" df:style="stack-down-save">
  612. <df:target><xsl:value-of select="$app"/>/deployment_target_name.xts</df:target>
  613. </df:button>
  614. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="javascript:cancelit()">
  615. <df:target><xsl:value-of select="$app"/>/deployment_target_name.xts</df:target>
  616. </df:button>
  617. </dp:footer>
  618. </xsl:when>
  619. <xsl:otherwise>
  620. <dp:footer>
  621. <df:button df:id="IDS_OK" df:style="maintain" onclick="javascript:resetSection()">
  622. <df:target><xsl:value-of select="$app"/>/properties_multilingual.xts</df:target>
  623. </df:button>
  624. <df:button df:id="IDS_CANCEL" df:style="maintain" onclick="javascript:cancelit()">
  625. <df:target><xsl:value-of select="$app"/>/properties_multilingual.xts</df:target>
  626. </df:button>
  627. </dp:footer>
  628. </xsl:otherwise>
  629. </xsl:choose>
  630. </utml:form>
  631. </dp:page>
  632. </xsl:template>
  633. </xsl:stylesheet>
  634. </xts:block>
  635. <!--
  636. ===============================================================================================
  637. debug - display debug information
  638. ===============================================================================================
  639. -->
  640. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  641. <!-- get the debug logic sheet -->
  642. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  643. <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">
  644. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  645. <xsl:template match="/">
  646. <dbg:dumpxml select="/root"/>
  647. </xsl:template>
  648. </xsl:stylesheet>
  649. </xts:block>
  650. </xts:morphlet>