framework.xsl 91 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559
  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, 2019
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  10. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  11. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  12. xmlns:out="dummy-uri"
  13. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  14. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="cp df dp xts xtsext utml cm">
  17. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  18. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  19. <!--
  20. df:button
  21. df:propertiesTabs
  22. df:personalizeTabs
  23. -->
  24. <xsl:variable name="df-namespace-uri" select="'http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/'"/>
  25. <!--
  26. df:button - a set of commonly used buttons
  27. -No style defined - custom button
  28. -->
  29. <xsl:template match="df:button[not(@df:style)]">
  30. <dp:button>
  31. <xsl:copy-of select="@state"/>
  32. <xsl:apply-templates/>
  33. </dp:button>
  34. </xsl:template>
  35. <!--
  36. df:button - stack-up - df:target child element determines target
  37. -->
  38. <xsl:template match="df:button[@df:style='stack-up' or @df:style='push']">
  39. <out:if test="true()">
  40. <out:variable name="df-target">
  41. <xsl:copy-of select="df:target/child::node()"/>
  42. </out:variable>
  43. <out:choose>
  44. <out:when test="$df-target = ''">
  45. <dp:button state="inactive">
  46. <dp:buttonText><xts:string id="{@df:id}"/></dp:buttonText>
  47. </dp:button>
  48. </out:when>
  49. <out:otherwise>
  50. <dp:button>
  51. <utml:a utml:op="stack-up" role="button">
  52. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  53. <utml:target>
  54. <out:value-of select="$df-target"/>
  55. </utml:target>
  56. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  57. </utml:a>
  58. </dp:button>
  59. </out:otherwise>
  60. </out:choose>
  61. </out:if>
  62. </xsl:template>
  63. <!--
  64. df:button - <dp:button dp:id="xxx" dp:style="stack-down-save"/>
  65. -->
  66. <xsl:template match="df:button[@df:style='stack-down-save' or @df:style='drop']">
  67. <out:if test="true()">
  68. <xsl:variable name="df-defaultKey">
  69. <xsl:value-of select="@df:defaultKey"/>
  70. </xsl:variable>
  71. <out:variable name="df-defaultAct">
  72. <xsl:copy-of select="df:defaultAct/child::node()"/>
  73. </out:variable>
  74. <dp:button>
  75. <xsl:if test="$df-defaultKey='active'">
  76. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  77. </xsl:if>
  78. <utml:a utml:op="stack-down-save" role="button">
  79. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  80. <xsl:if test="$df-defaultKey='active'">
  81. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  82. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  83. </xsl:if>
  84. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  85. </utml:a>
  86. </dp:button>
  87. </out:if>
  88. </xsl:template>
  89. <!--
  90. df:button - <dp:button dp:id="xxx" dp:style="stack-down"/> Without A11y
  91. -->
  92. <xsl:template match="df:button[(@df:style='stack-down' or @df:style='pop') and not(@df:kbA11y)]">
  93. <out:if test="true()">
  94. <xsl:variable name="df-defaultKey">
  95. <xsl:value-of select="@df:defaultKey"/>
  96. </xsl:variable>
  97. <out:variable name="df-defaultAct">
  98. <xsl:copy-of select="df:defaultAct/child::node()"/>
  99. </out:variable>
  100. <dp:button>
  101. <xsl:if test="$df-defaultKey='active'">
  102. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  103. </xsl:if>
  104. <utml:a utml:op="stack-down" id="{@df:idPrefix}{@df:id}" role="button">
  105. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  106. <xsl:if test="$df-defaultKey='active'">
  107. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  108. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  109. </xsl:if>
  110. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  111. </utml:a>
  112. </dp:button>
  113. </out:if>
  114. </xsl:template>
  115. <!--
  116. df:button - <dp:button dp:id="xxx" dp:style="stack-down"/> with A11y
  117. -->
  118. <xsl:template match="df:button[(@df:style='stack-down' or @df:style='pop') and @df:kbA11y='true']">
  119. <out:if test="true()">
  120. <xsl:variable name="df-defaultKey">
  121. <xsl:value-of select="@df:defaultKey"/>
  122. </xsl:variable>
  123. <out:variable name="df-defaultAct">
  124. <xsl:copy-of select="df:defaultAct/child::node()"/>
  125. </out:variable>
  126. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  127. <dp:button>
  128. <dp:df_no_id><xsl:value-of select="$df-kbA11y"/></dp:df_no_id>
  129. <xsl:if test="$df-defaultKey='active'">
  130. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  131. </xsl:if>
  132. <utml:a utml:op="stack-down" id="{@df:idPrefix}{@df:id}" role="button" utml:kbA11y="{$df-kbA11y}">
  133. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  134. <out:attribute name="class">
  135. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  136. <out:choose>
  137. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  138. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  139. <out:otherwise>genericAnchorButton</out:otherwise>
  140. </out:choose>
  141. </out:attribute>
  142. <xsl:if test="$df-defaultKey='active'">
  143. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  144. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  145. </xsl:if>
  146. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  147. </utml:a>
  148. </dp:button>
  149. </out:if>
  150. </xsl:template>
  151. <!--
  152. df:button - <dp:button dp:id="xxx" dp:style="maintain"/> - dp:target child element determines target
  153. -->
  154. <xsl:template match="df:button[@df:style='maintain']">
  155. <out:if test="true()">
  156. <xsl:variable name="df-defaultKey">
  157. <xsl:value-of select="@df:defaultKey"/>
  158. </xsl:variable>
  159. <out:variable name="df-defaultAct">
  160. <xsl:copy-of select="df:defaultAct/child::node()"/>
  161. </out:variable>
  162. <out:variable name="df-target">
  163. <xsl:copy-of select="df:target/child::node()"/>
  164. </out:variable>
  165. <xsl:variable name="df-kbA11y"><xsl:value-of select="true"/></xsl:variable>
  166. <out:choose>
  167. <out:when test="$df-target = ''">
  168. <dp:button state="inactive">
  169. <dp:buttonText><xts:string id="{@df:id}"/></dp:buttonText>
  170. </dp:button>
  171. </out:when>
  172. <out:otherwise>
  173. <dp:button>
  174. <dp:df_no_id>true</dp:df_no_id>
  175. <xsl:if test="$df-defaultKey='active'">
  176. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  177. </xsl:if>
  178. <utml:a>
  179. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  180. <out:attribute name="role">button</out:attribute>
  181. <utml:target>
  182. <out:value-of select="$df-target"/>
  183. </utml:target>
  184. <out:attribute name="class">
  185. <out:variable name="AOKButton">
  186. <xsl:if test="@df:id='IDS_OK'">OK</xsl:if>
  187. </out:variable>
  188. <out:choose>
  189. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  190. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  191. <out:otherwise>genericAnchorButton</out:otherwise>
  192. </out:choose>
  193. </out:attribute>
  194. <out:attribute name="aria-label">
  195. <xsl:choose>
  196. <xsl:when test="@df:label"><xts:string id="{@df:label}"/></xsl:when>
  197. <xsl:otherwise><xts:string id="{@df:id}"/></xsl:otherwise>
  198. </xsl:choose>
  199. </out:attribute>
  200. <xsl:if test="$df-defaultKey='active'">
  201. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  202. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  203. </xsl:if>
  204. <dp:buttonText>
  205. <xsl:choose>
  206. <!-- if there's a left pointing arrow, then place the image followed by the text -->
  207. <xsl:when test="@df:imagePosition='left'">
  208. <xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}" dp:imagePosition="left"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if><xts:string id="{@df:id}"/>
  209. </xsl:when>
  210. <xsl:otherwise>
  211. <xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if>
  212. </xsl:otherwise>
  213. </xsl:choose>
  214. </dp:buttonText>
  215. </utml:a>
  216. </dp:button>
  217. </out:otherwise>
  218. </out:choose>
  219. </out:if>
  220. </xsl:template>
  221. <!--
  222. df:button - <dp:button dp:id="xxx" dp:style="back-url"/> - uses the backURL env param as the target
  223. -->
  224. <xsl:template match="df:button[@df:style='back-url' and not(@df:kbA11y)]">
  225. <out:if test="true()">
  226. <xsl:variable name="df-defaultKey">
  227. <xsl:value-of select="@df:defaultKey"/>
  228. </xsl:variable>
  229. <out:variable name="df-defaultBack">
  230. <out:value-of select="/root/env/param[@name='backURL']"/>
  231. </out:variable>
  232. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  233. <dp:button>
  234. <dp:df_no_id>true</dp:df_no_id>
  235. <xsl:if test="$df-defaultKey='active'">
  236. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  237. <dp:defaultBack><out:value-of select="$df-defaultBack"/></dp:defaultBack>
  238. </xsl:if>
  239. <a role="button" >
  240. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  241. <out:attribute name="class">
  242. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  243. <out:choose>
  244. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  245. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  246. <out:otherwise>genericAnchorButton</out:otherwise>
  247. </out:choose>
  248. </out:attribute>
  249. <out:attribute name="aria-label">
  250. <xsl:choose>
  251. <xsl:when test="@df:label"><xts:string id="{@df:label}"/></xsl:when>
  252. <xsl:otherwise><xts:string id="{@df:id}"/></xsl:otherwise>
  253. </xsl:choose>
  254. </out:attribute>
  255. <out:attribute name="href">
  256. <out:value-of select="xtsext:htmlencode(/root/env/param[@name = 'backURL'])"/>
  257. </out:attribute>
  258. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  259. </a>
  260. </dp:button>
  261. </out:if>
  262. </xsl:template>
  263. <!--
  264. df:button - <dp:button dp:id="xxx" dp:style="back-url"/> - uses the backURL env param as the target
  265. -->
  266. <xsl:template match="df:button[@df:style='back-url' and @df:kbA11y='true']">
  267. <out:if test="true()">
  268. <xsl:variable name="df-defaultKey">
  269. <xsl:value-of select="@df:defaultKey"/>
  270. </xsl:variable>
  271. <out:variable name="df-defaultBack">
  272. <out:value-of select="/root/env/param[@name='backURL']"/>
  273. </out:variable>
  274. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  275. <dp:button>
  276. <dp:df_no_id><xsl:value-of select="$df-kbA11y"/></dp:df_no_id>
  277. <xsl:if test="$df-defaultKey='active'">
  278. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  279. <dp:defaultBack><out:value-of select="$df-defaultBack"/></dp:defaultBack>
  280. </xsl:if>
  281. <a role="button" tabindex="0">
  282. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  283. <out:attribute name="class">
  284. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  285. <out:choose>
  286. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  287. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  288. <out:otherwise>genericAnchorButton</out:otherwise>
  289. </out:choose>
  290. </out:attribute>
  291. <out:attribute name="href">#</out:attribute>
  292. <out:attribute name="onclick">javascript:location.href="<out:value-of select="xtsext:javascriptencode(/root/env/param[@name = 'backURL'])"/>"</out:attribute>
  293. <xsl:choose>
  294. <xsl:when test="@focusidOnTab">
  295. <out:attribute name="onkeydown">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("<xsl:value-of select="@focusidOnTab"/>")) <xsl:text>{</xsl:text>document.getElementById("<xsl:value-of select="@focusidOnTab"/>").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</out:attribute>
  296. </xsl:when>
  297. <xsl:when test="@focusidOnShiftTab">
  298. <out:attribute name="onkeydown">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==false) return true; else <xsl:text>{</xsl:text> if(document.getElementById("<xsl:value-of select="@focusidOnShiftTab"/>")) <xsl:text>{</xsl:text>document.getElementById("<xsl:value-of select="@focusidOnShiftTab"/>").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</out:attribute>
  299. </xsl:when>
  300. </xsl:choose>
  301. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  302. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  303. </a>
  304. </dp:button>
  305. </out:if>
  306. </xsl:template>
  307. <!--
  308. df:button - <dp:button dp:id="xxx" dp:style="href"/> - a dp:href attribute or child determines target
  309. -->
  310. <xsl:template match="df:button[@df:style='href' and not(@df:kbA11y)]">
  311. <out:if test="true()">
  312. <xsl:variable name="df-defaultKey">
  313. <xsl:value-of select="@df:defaultKey"/>
  314. </xsl:variable>
  315. <out:variable name="df-defaultAct">
  316. <xsl:copy-of select="df:defaultAct/child::node()"/>
  317. </out:variable>
  318. <xsl:variable name="df-kbA11y"><xsl:value-of select="true"/></xsl:variable>
  319. <dp:button>
  320. <dp:df_no_id>true</dp:df_no_id>
  321. <xsl:if test="$df-defaultKey='active'">
  322. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  323. <dp:defaultAct><out:value-of select="$df-defaultAct"/></dp:defaultAct>
  324. </xsl:if>
  325. <a id="{@df:id}" role="button">
  326. <xsl:choose>
  327. <xsl:when test="@df:href">
  328. <xsl:attribute name="href">
  329. <xsl:value-of select="@df:href"/>
  330. </xsl:attribute>
  331. </xsl:when>
  332. <xsl:otherwise>
  333. <out:variable name="df-href">
  334. <xsl:copy-of select="df:href"/>
  335. </out:variable>
  336. <out:attribute name="href">
  337. <out:value-of select="$df-href"/>
  338. </out:attribute>
  339. </xsl:otherwise>
  340. </xsl:choose>
  341. <xsl:copy-of select="@*[(local-name()!='class' and local-name()!='role' and local-name()!='aria-label') and namespace-uri() != $df-namespace-uri]"/>
  342. <out:attribute name="class">
  343. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  344. <out:choose>
  345. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  346. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  347. <out:otherwise>genericAnchorButton</out:otherwise>
  348. </out:choose>
  349. </out:attribute>
  350. <out:attribute name="aria-label">
  351. <xsl:choose>
  352. <xsl:when test="@df:label"><xts:string id="{@df:label}"/></xsl:when>
  353. <xsl:otherwise><xts:string id="{@df:id}"/></xsl:otherwise>
  354. </xsl:choose>
  355. </out:attribute>
  356. <dp:buttonText>
  357. <xsl:if test="not(@df:noText) or @df:noText = 'false'"><xts:string id="{@df:id}"/></xsl:if>
  358. <xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if>
  359. </dp:buttonText>
  360. </a>
  361. </dp:button>
  362. </out:if>
  363. </xsl:template>
  364. <!--
  365. df:button - <dp:button dp:id="xxx" dp:style="href"/> - a dp:href attribute or child determines target
  366. -->
  367. <xsl:template match="df:button[@df:style='href' and @df:kbA11y='true']">
  368. <out:if test="true()">
  369. <xsl:variable name="df-defaultKey">
  370. <xsl:value-of select="@df:defaultKey"/>
  371. </xsl:variable>
  372. <out:variable name="df-defaultAct">
  373. <xsl:copy-of select="df:defaultAct/child::node()"/>
  374. </out:variable>
  375. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  376. <dp:button>
  377. <dp:df_no_id><xsl:value-of select="$df-kbA11y"/></dp:df_no_id>
  378. <xsl:if test="$df-defaultKey='active'">
  379. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  380. <dp:defaultAct><out:value-of select="$df-defaultAct"/></dp:defaultAct>
  381. </xsl:if>
  382. <a id="{@df:idPrefix}{@df:id}" role="button">
  383. <xsl:attribute name="href">#</xsl:attribute>
  384. <xsl:choose>
  385. <xsl:when test="@df:href">
  386. <!-- When the href is #, an onclick must have be specified for the button -->
  387. <xsl:if test="string(@df:href)!='#'">
  388. <xsl:attribute name="onclick">
  389. <xsl:value-of select="@df:href"/>
  390. </xsl:attribute>
  391. </xsl:if>
  392. </xsl:when>
  393. <xsl:otherwise>
  394. <xsl:if test="string(df:href)!='#'">
  395. <out:variable name="df-href">
  396. <xsl:copy-of select="df:href"/>
  397. </out:variable>
  398. <out:attribute name="onclick">
  399. <out:value-of select="$df-href"/>
  400. </out:attribute>
  401. </xsl:if>
  402. </xsl:otherwise>
  403. </xsl:choose>
  404. <out:attribute name="class">
  405. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  406. <out:choose>
  407. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  408. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  409. <out:otherwise>genericAnchorButton</out:otherwise>
  410. </out:choose>
  411. </out:attribute>
  412. <xsl:choose>
  413. <xsl:when test="@focusidOnTab">
  414. <out:attribute name="onkeydown">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("<xsl:value-of select="@focusidOnTab"/>")) <xsl:text>{</xsl:text>document.getElementById("<xsl:value-of select="@focusidOnTab"/>").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</out:attribute>
  415. </xsl:when>
  416. <xsl:when test="@focusidOnShiftTab">
  417. <out:attribute name="onkeydown">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==false) return true; else <xsl:text>{</xsl:text> if(document.getElementById("<xsl:value-of select="@focusidOnShiftTab"/>")) <xsl:text>{</xsl:text>document.getElementById("<xsl:value-of select="@focusidOnShiftTab"/>").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</out:attribute>
  418. </xsl:when>
  419. </xsl:choose>
  420. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  421. <xsl:copy-of select="@*[(local-name()!='class' and local-name()!='focusidOnTab' and local-name()!='focusidOnShiftTab' and local-name()!='id' and local-name()!='role') and namespace-uri() != $df-namespace-uri]"/>
  422. <dp:buttonText>
  423. <xsl:if test="not(@df:noText) or @df:noText = 'false'"><xts:string id="{@df:id}"/></xsl:if>
  424. <xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if>
  425. </dp:buttonText>
  426. </a>
  427. </dp:button>
  428. </out:if>
  429. </xsl:template>
  430. <!--
  431. df:button - <df:button df:id="xxx" df:style="submit"/> - submit.xts is target
  432. -->
  433. <xsl:template match="df:button[@df:style='submit' and not(df:target) and not(df:nav_op)]">
  434. <out:if test="true()">
  435. <xsl:variable name="df-defaultKey">
  436. <xsl:value-of select="@df:defaultKey"/>
  437. </xsl:variable>
  438. <out:variable name="df-defaultAct">
  439. <xsl:copy-of select="df:defaultAct/child::node()"/>
  440. </out:variable>
  441. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  442. <dp:button>
  443. <dp:df_no_id>true</dp:df_no_id>
  444. <xsl:if test="$df-defaultKey='active'">
  445. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  446. </xsl:if>
  447. <utml:a utml:op="submit" role="button" utml:kbA11y="{$df-kbA11y}">
  448. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  449. <utml:target>
  450. <out:value-of select="concat($app, '/submit.xts')"/>
  451. </utml:target>
  452. <xsl:if test="$df-defaultKey='active'">
  453. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  454. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  455. </xsl:if>
  456. <out:attribute name="class">
  457. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  458. <out:choose>
  459. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  460. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  461. <out:otherwise>genericAnchorButton</out:otherwise>
  462. </out:choose>
  463. </out:attribute>
  464. <out:attribute name="aria-label">
  465. <xsl:choose>
  466. <xsl:when test="@df:label"><xts:string id="{@df:label}"/></xsl:when>
  467. <xsl:otherwise><xts:string id="{@df:id}"/></xsl:otherwise>
  468. </xsl:choose>
  469. </out:attribute>
  470. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  471. </utml:a>
  472. </dp:button>
  473. </out:if>
  474. </xsl:template>
  475. <!--
  476. df:button - <df:button df:id="xxx" df:style="submit"/> - submit.xts is target
  477. -->
  478. <xsl:template match="df:button[@df:style='submit' and (@df:nav_op) and not(df:target) and not(@df:kbA11y)]">
  479. <out:if test="true()">
  480. <xsl:variable name="df-defaultKey">
  481. <xsl:value-of select="@df:defaultKey"/>
  482. </xsl:variable>
  483. <out:variable name="df-defaultAct">
  484. <xsl:copy-of select="df:defaultAct/child::node()"/>
  485. </out:variable>
  486. <dp:button>
  487. <xsl:if test="$df-defaultKey='active'">
  488. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  489. </xsl:if>
  490. <utml:a utml:op="{@df:nav_op}" role="button">
  491. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  492. <utml:target>
  493. <out:value-of select="concat($app, '/submit.xts')"/>
  494. </utml:target>
  495. <xsl:if test="$df-defaultKey='active'">
  496. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  497. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  498. </xsl:if>
  499. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  500. </utml:a>
  501. </dp:button>
  502. </out:if>
  503. </xsl:template>
  504. <!--
  505. df:button - <df:button df:id="xxx" df:style="submit"/> - submit.xts is target
  506. -->
  507. <xsl:template match="df:button[@df:style='submit' and (@df:nav_op) and not(df:target) and @df:kbA11y='true']">
  508. <out:if test="true()">
  509. <xsl:variable name="df-defaultKey">
  510. <xsl:value-of select="@df:defaultKey"/>
  511. </xsl:variable>
  512. <out:variable name="df-defaultAct">
  513. <xsl:copy-of select="df:defaultAct/child::node()"/>
  514. </out:variable>
  515. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  516. <dp:button>
  517. <span id="buttonLabel{@df:id}" style="position: absolute;margin-left: -9999px;margin-top: -9999px;"><xts:string id="{@df:id}"/></span>
  518. <dp:df_no_id>true</dp:df_no_id>
  519. <xsl:if test="$df-defaultKey='active'">
  520. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  521. </xsl:if>
  522. <utml:a utml:op="{@df:nav_op}" role="button" utml:kbA11y="{$df-kbA11y}">
  523. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  524. <utml:target>
  525. <out:value-of select="concat($app, '/submit.xts')"/>
  526. </utml:target>
  527. <xsl:if test="$df-defaultKey='active'">
  528. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  529. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  530. </xsl:if>
  531. <out:attribute name="class">
  532. <out:variable name="AOKButton"><xsl:if test="@df:id='IDS_OK'">OK</xsl:if></out:variable>
  533. <out:choose>
  534. <out:when test="$browser = 'ie'">ieAnchorButton</out:when>
  535. <out:when test="$AOKButton = 'OK'">genericAnchorWideButton</out:when>
  536. <out:otherwise>genericAnchorButton</out:otherwise>
  537. </out:choose>
  538. </out:attribute>
  539. <out:attribute name="aria-labelledby">buttonLabel<xsl:value-of select="@df:id"/></out:attribute>
  540. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  541. </utml:a>
  542. </dp:button>
  543. </out:if>
  544. </xsl:template>
  545. <!--
  546. df:button - <df:button df:id="xxx" df:style="submit"/> - custom target
  547. -->
  548. <xsl:template match="df:button[@df:style='submit' and df:target]">
  549. <out:if test="true()">
  550. <xsl:variable name="df-defaultKey">
  551. <xsl:value-of select="@df:defaultKey"/>
  552. </xsl:variable>
  553. <out:variable name="df-defaultAct">
  554. <xsl:copy-of select="df:defaultAct/child::node()"/>
  555. </out:variable>
  556. <out:variable name="df-target">
  557. <xsl:copy-of select="df:target/child::node()"/>
  558. </out:variable>
  559. <out:choose>
  560. <out:when test="$df-target = ''">
  561. <dp:button state="inactive">
  562. <dp:buttonText><xts:string id="{@df:id}"/></dp:buttonText>
  563. </dp:button>
  564. </out:when>
  565. <out:otherwise>
  566. <dp:button>
  567. <xsl:if test="$df-defaultKey='active'">
  568. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  569. </xsl:if>
  570. <utml:a utml:op="submit" role="button">
  571. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  572. <utml:target>
  573. <out:value-of select="$df-target"/>
  574. </utml:target>
  575. <xsl:if test="$df-defaultKey='active'">
  576. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  577. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  578. </xsl:if>
  579. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  580. </utml:a>
  581. </dp:button>
  582. </out:otherwise>
  583. </out:choose>
  584. </out:if>
  585. </xsl:template>
  586. <!--
  587. Active button. Can be enabled and disabled on the fly (browser side)
  588. -->
  589. <xsl:template match="df:button[@df:style='active']">
  590. <out:if test="true()">
  591. <xsl:variable name="df-defaultKey">
  592. <xsl:value-of select="@df:defaultKey"/>
  593. </xsl:variable>
  594. <out:variable name="df-defaultAct">
  595. <xsl:copy-of select="df:defaultAct/child::node()"/>
  596. </out:variable>
  597. <dp:button id="{@id}"> <!-- pass the id to the presentation code to insert in the final button tag -->
  598. <xsl:if test="$df-defaultKey='active'">
  599. <dp:defaultKey><xsl:value-of select="$df-defaultKey"/></dp:defaultKey>
  600. </xsl:if>
  601. <a class="commandButtonActive" role="button">
  602. <xsl:copy-of select="@*[namespace-uri() != $df-namespace-uri]"/>
  603. <xsl:if test="$df-defaultKey='active'">
  604. <utml:defaultKey><xsl:value-of select="$df-defaultKey"/></utml:defaultKey>
  605. <utml:defaultAct><out:value-of select="$df-defaultAct"/></utml:defaultAct>
  606. </xsl:if>
  607. <dp:buttonText><xts:string id="{@df:id}"/><xsl:if test="df:image"><dp:buttonImage dp:tooltip="{df:image/@df:tooltip}"><xsl:value-of select="df:image"/></dp:buttonImage></xsl:if></dp:buttonText>
  608. </a>
  609. </dp:button>
  610. </out:if>
  611. </xsl:template>
  612. <!--
  613. df:button - <df:button df:id="xxx"/> - inactive button
  614. -->
  615. <xsl:template match="df:button[@df:id and (count(@*) = 1)]">
  616. <xsl:variable name="df-kbA11y">
  617. <xsl:value-of select="true"/>
  618. </xsl:variable>
  619. <dp:button state="inactive">
  620. <dp:df_no_id>true</dp:df_no_id>
  621. <dp:buttonText>
  622. <xts:string id="{@df:id}"/>
  623. </dp:buttonText>
  624. </dp:button>
  625. </xsl:template>
  626. <!--
  627. df:propertiesTabs - this will display the properties it is a set list that is dependant on the current object
  628. -->
  629. <xsl:template match="df:propertiesTabs">
  630. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  631. <xsl:variable name="onClickScript" select="@onclick | @onClick"/>
  632. <xsl:variable name="hasJSStart" select="starts-with(string($onClickScript),'java')"/>
  633. <script language="javascript">
  634. function submitForm(sTarget, bSkipValidate)
  635. {
  636. if (bSkipValidate == null) {
  637. bSkipValidate = false;
  638. }
  639. var bValidate = true;
  640. <!--If we are not to skip validation and there is something to validate on the container page then do the validation ..-->
  641. <![CDATA[
  642. if (window.validate && !bSkipValidate) {
  643. bValidate = validate();
  644. }
  645. ]]>
  646. if (bValidate)
  647. {
  648. document.pform.m.value = "<out:value-of select="$app"/>" + "/" + sTarget;
  649. document.pform.m_class.value = "<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_class']))"/>";
  650. document.pform.ps_nav_op.value = "maintain";
  651. document.pform.submit();
  652. }
  653. }
  654. </script>
  655. <!-- the tabset requires the df_tab_selected variable to be defined >
  656. <out:variable name="df_tab_selected"><xsl:value-of select="@select"/></out:variable-->
  657. <out:variable name="df_hasSetPolicy">
  658. <xsl:if test="df:hasSetPolicy">
  659. <xsl:copy-of select="df:hasSetPolicy/node()"/>
  660. </xsl:if>
  661. </out:variable>
  662. <out:variable name="df_hasRead">
  663. <xsl:if test="df:hasRead">
  664. <xsl:copy-of select="df:hasRead/node()"/>
  665. </xsl:if>
  666. </out:variable>
  667. <out:variable name="df_hasTraverse">
  668. <xsl:if test="df:hasTraverse">
  669. <xsl:copy-of select="df:hasTraverse/node()"/>
  670. </xsl:if>
  671. </out:variable>
  672. <out:variable name="df_outtabend">
  673. <xsl:choose>
  674. <xsl:when test="@select='general'">false</xsl:when>
  675. <xsl:otherwise>true</xsl:otherwise>
  676. </xsl:choose>
  677. </out:variable>
  678. <out:variable name="df_hasUserProfile">
  679. <xsl:if test="df:hasUserProfile">
  680. <xsl:copy-of select="df:hasUserProfile/node()"/>
  681. </xsl:if>
  682. </out:variable>
  683. <out:variable name="userInterfaces" select="/root//cm:queryResponse//cm:package/cm:userInterfaces/cm:uiComponentEnum"/>
  684. <out:variable name="objLaunchableType" select="/root//cm:queryResponse//cm:launchable/cm:launchableType"/>
  685. <out:variable name="effectiveUserCapabilities">
  686. <out:call-template name="calEffectiveObjectCapabilities">
  687. <out:with-param name="capabilities" select="/root//cm:queryResponse/*/cm:effectiveUserCapabilities | /root//cm:queryResponse/*/*/*/cm:effectiveUserCapabilities"/>
  688. </out:call-template>
  689. </out:variable>
  690. <out:variable name="tabObj" select="key('ui-object-properties', /root/env/param[@name='m_class'])"/>
  691. <out:variable name="ui-obj-tab" select="key('ui-object-properties', /root/env/param[@name='m_class'])[not(@userInterface) or @userInterface=$userInterfaces][not(@launchableType) or @launchableType=$objLaunchableType]"/>
  692. <!-- these are the properties tabs -->
  693. <cp:tabset id="maintabs">
  694. <cp:select><out:text><xsl:value-of select="@select"/></out:text></cp:select>
  695. <cp:tab name="general" position="start">
  696. <a>
  697. <xsl:attribute name="href">
  698. <xsl:choose>
  699. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  700. <xsl:otherwise>javascript:submitForm('properties_general.xts')</xsl:otherwise>
  701. </xsl:choose>
  702. </xsl:attribute>
  703. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  704. <xsl:attribute name="onclick">
  705. <xsl:choose>
  706. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_general.xts');</xsl:when>
  707. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  708. </xsl:choose>
  709. </xsl:attribute>
  710. <xsl:if test="$df-kbA11y='true'">
  711. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  712. </xsl:if>
  713. </xsl:if>
  714. <!--
  715. I could just copy all of the attributes specified on the df:propertiesTabs tag but
  716. not sure if that would produce undesirable side effects.
  717. -->
  718. <cp:label><xts:string id="IDS_PROP_TAB_GENERAL"/></cp:label>
  719. </a>
  720. </cp:tab>
  721. <out:variable name="df_tabcnt">
  722. <out:choose>
  723. <out:when test="$df_hasRead = 'true' or $df_hasRead=''">
  724. <out:choose>
  725. <out:when test="$df_hasTraverse = 'true' or $df_hasTraverse=''"><out:value-of select="count($ui-obj-tab/tab)"/></out:when>
  726. <out:otherwise><out:value-of select="count($ui-obj-tab/tab[not(@needTraverse='T')])"/></out:otherwise>
  727. </out:choose>
  728. </out:when>
  729. <out:otherwise>0</out:otherwise>
  730. </out:choose>
  731. </out:variable>
  732. <!-- only show these property pages if the user has read permission or if the tab needs traverse and the user has traverse -->
  733. <out:if test="$df_hasRead = 'true' or $df_hasRead=''">
  734. <out:variable name="anonymousObj" select="/root/env/param[@name='m_obj'] = 'CAMID(&quot;::Anonymous&quot;)'"/>
  735. <out:for-each select="$ui-obj-tab/tab[not(@needTraverse='T') or (@needTraverse='T' and ($df_hasTraverse = 'true' or $df_hasTraverse=''))]">
  736. <out:variable name="requiredCondition" select="condition"/>
  737. <out:variable name="conditionMet">
  738. <out:for-each select="$requiredCondition">
  739. <out:if test="@type='session'">
  740. <out:variable name="name" select="@name"/>
  741. <out:value-of select="/root/session/param[@name=$name]=@value"/>
  742. </out:if>
  743. </out:for-each>
  744. </out:variable>
  745. <out:variable name="requiredCapability" select="@requiredCapability"/>
  746. <out:variable name="hasCapability" select="string($requiredCapability) = '' or boolean(/root/session/param[@name='capabilities']/*[local-name()=$requiredCapability])"/>
  747. <out:if test="$hasCapability and (not(contains($conditionMet,'false'))) and ((not($anonymousObj or starts-with(/root/env/param[@name='m_obj'],'/configuration/account'))) or @name != 'personal')">
  748. <out:variable name="tabName">
  749. <out:choose>
  750. <out:when test="@isClassTab='T'">
  751. <out:value-of select="/root/objectClass/class[@name= string(/root/env/param[@name='m_class'])]"/>
  752. </out:when>
  753. <out:otherwise>
  754. <out:value-of select="."/>
  755. </out:otherwise>
  756. </out:choose>
  757. </out:variable>
  758. <out:choose>
  759. <out:when test="(((position() = last() or ($anonymousObj and @name='preferences')) and $df_hasUserProfile != 'false') or (@name='personal' and $df_hasUserProfile = 'false')) and $df_hasSetPolicy = 'false'">
  760. <cp:tab name="@name" var-name="true" position="end">
  761. <a>
  762. <xsl:attribute name="href">
  763. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  764. </xsl:attribute>
  765. <xsl:if test="@onclick">
  766. <xsl:attribute name="onclick">
  767. <xsl:value-of select="@onclick"/>
  768. </xsl:attribute>
  769. </xsl:if>
  770. <cp:label><out:value-of select="$tabName"/></cp:label>
  771. </a>
  772. </cp:tab>
  773. </out:when>
  774. <out:when test="@name='preferences' or @name='mypages'">
  775. <out:if test="$df_hasUserProfile != 'false'">
  776. <cp:tab name="@name" var-name="true">
  777. <a>
  778. <xsl:attribute name="href">
  779. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  780. </xsl:attribute>
  781. <xsl:if test="@onclick">
  782. <xsl:attribute name="onclick">
  783. <xsl:value-of select="@onclick"/>
  784. </xsl:attribute>
  785. </xsl:if>
  786. <cp:label><out:value-of select="$tabName"/></cp:label>
  787. </a>
  788. </cp:tab>
  789. </out:if>
  790. </out:when>
  791. <out:otherwise>
  792. <cp:tab name="@name" var-name="true">
  793. <a>
  794. <xsl:attribute name="href">
  795. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  796. </xsl:attribute>
  797. <xsl:if test="@onclick">
  798. <xsl:attribute name="onclick">
  799. <xsl:value-of select="@onclick"/>
  800. </xsl:attribute>
  801. </xsl:if>
  802. <cp:label><out:value-of select="$tabName"/></cp:label>
  803. </a>
  804. </cp:tab>
  805. </out:otherwise>
  806. </out:choose>
  807. </out:if>
  808. </out:for-each>
  809. </out:if>
  810. <out:variable name="df_hasCapabilityPolicy" select="contains(' package content folder ', concat(' ', /root/env/param[@name='m_class'], ' ')) and $userCanUseOC"/>
  811. <out:choose>
  812. <out:when test="($df_hasSetPolicy = 'true' or $df_hasSetPolicy='')">
  813. <out:choose>
  814. <out:when test="$df_hasCapabilityPolicy">
  815. <cp:tab name="privileges">
  816. <a>
  817. <xsl:attribute name="href">
  818. <xsl:choose>
  819. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  820. <xsl:otherwise>javascript:submitForm('properties_privileges.xts')</xsl:otherwise>
  821. </xsl:choose>
  822. </xsl:attribute>
  823. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  824. <xsl:attribute name="onclick">
  825. <xsl:choose>
  826. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_privileges.xts');</xsl:when>
  827. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  828. </xsl:choose>
  829. </xsl:attribute>
  830. <xsl:if test="$df-kbA11y='true'">
  831. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  832. </xsl:if>
  833. </xsl:if>
  834. <cp:label><xts:string id="IDS_PROP_TAB_PRIVILEGES"/></cp:label>
  835. </a>
  836. </cp:tab>
  837. <cp:tab name="capabilities" position="end">
  838. <a>
  839. <xsl:attribute name="href">
  840. <xsl:choose>
  841. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  842. <xsl:otherwise>javascript:submitForm('properties_capabilities.xts')</xsl:otherwise>
  843. </xsl:choose>
  844. </xsl:attribute>
  845. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  846. <xsl:attribute name="onclick">
  847. <xsl:choose>
  848. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_capabilities.xts');</xsl:when>
  849. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  850. </xsl:choose>
  851. </xsl:attribute>
  852. <xsl:if test="$df-kbA11y='true'">
  853. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  854. </xsl:if>
  855. </xsl:if>
  856. <cp:label><xts:string id="IDS_PROP_TAB_CAPABILITIES"/></cp:label>
  857. </a>
  858. </cp:tab>
  859. </out:when>
  860. <out:otherwise>
  861. <cp:tab name="privileges" position="end">
  862. <a>
  863. <xsl:attribute name="href">
  864. <xsl:choose>
  865. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  866. <xsl:otherwise>javascript:submitForm('properties_privileges.xts')</xsl:otherwise>
  867. </xsl:choose>
  868. </xsl:attribute>
  869. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  870. <xsl:attribute name="onclick">
  871. <xsl:choose>
  872. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_privileges.xts');</xsl:when>
  873. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  874. </xsl:choose>
  875. </xsl:attribute>
  876. <xsl:if test="$df-kbA11y='true'">
  877. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  878. </xsl:if>
  879. </xsl:if>
  880. <cp:label><xts:string id="IDS_PROP_TAB_PRIVILEGES"/></cp:label>
  881. </a>
  882. </cp:tab>
  883. </out:otherwise>
  884. </out:choose>
  885. </out:when>
  886. <out:otherwise>
  887. <!-- diddle with the right-hand bar that completes the property tab -->
  888. <out:if test="$df_outtabend='false' and $df_tabcnt=0"><cp:tabend/></out:if>
  889. </out:otherwise>
  890. </out:choose>
  891. <xsl:apply-templates select="cp:description"/>
  892. </cp:tabset>
  893. </xsl:template>
  894. <xsl:template match="df:propertiesTabsTitanPagelet">
  895. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  896. <xsl:variable name="onClickScript" select="@onclick | @onClick"/>
  897. <xsl:variable name="hasJSStart" select="starts-with(string($onClickScript),'java')"/>
  898. <script language="javascript">
  899. function submitForm(sTarget, bSkipValidate)
  900. {
  901. if (bSkipValidate == null) {
  902. bSkipValidate = false;
  903. }
  904. var bValidate = true;
  905. <!--If we are not to skip validation and there is something to validate on the container page then do the validation ..-->
  906. <![CDATA[
  907. if (window.validate && !bSkipValidate) {
  908. bValidate = validate();
  909. }
  910. ]]>
  911. if (bValidate)
  912. {
  913. document.pform.m.value = "<out:value-of select="$app"/>" + "/" + sTarget;
  914. document.pform.m_class.value = "<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_class']))"/>";
  915. document.pform.ps_nav_op.value = "maintain";
  916. document.pform.submit();
  917. }
  918. }
  919. </script>
  920. <!-- the tabset requires the df_tab_selected variable to be defined >
  921. <out:variable name="df_tab_selected"><xsl:value-of select="@select"/></out:variable-->
  922. <out:variable name="df_hasSetPolicy">
  923. <xsl:if test="df:hasSetPolicy">
  924. <xsl:copy-of select="df:hasSetPolicy/node()"/>
  925. </xsl:if>
  926. </out:variable>
  927. <out:variable name="df_hasRead">
  928. <xsl:if test="df:hasRead">
  929. <xsl:copy-of select="df:hasRead/node()"/>
  930. </xsl:if>
  931. </out:variable>
  932. <out:variable name="df_hasTraverse">
  933. <xsl:if test="df:hasTraverse">
  934. <xsl:copy-of select="df:hasTraverse/node()"/>
  935. </xsl:if>
  936. </out:variable>
  937. <out:variable name="df_outtabend">
  938. <xsl:choose>
  939. <xsl:when test="@select='general'">false</xsl:when>
  940. <xsl:otherwise>true</xsl:otherwise>
  941. </xsl:choose>
  942. </out:variable>
  943. <out:variable name="df_hasUserProfile">
  944. <xsl:if test="df:hasUserProfile">
  945. <xsl:copy-of select="df:hasUserProfile/node()"/>
  946. </xsl:if>
  947. </out:variable>
  948. <out:variable name="userInterfaces" select="/root//cm:queryResponse//cm:package/cm:userInterfaces/cm:uiComponentEnum"/>
  949. <out:variable name="objLaunchableType" select="/root//cm:queryResponse//cm:launchable/cm:launchableType"/>
  950. <out:variable name="effectiveUserCapabilities">
  951. <out:call-template name="calEffectiveObjectCapabilities">
  952. <out:with-param name="capabilities" select="/root//cm:queryResponse/*/cm:effectiveUserCapabilities | /root//cm:queryResponse/*/*/*/cm:effectiveUserCapabilities"/>
  953. </out:call-template>
  954. </out:variable>
  955. <out:variable name="tabObj" select="key('ui-object-properties', /root/env/param[@name='m_class'])"/>
  956. <out:variable name="ui-obj-tab" select="key('ui-object-properties', /root/env/param[@name='m_class'])[not(@userInterface) or @userInterface=$userInterfaces][not(@launchableType) or @launchableType=$objLaunchableType]"/>
  957. <!-- these are the properties tabs -->
  958. <cp:tabset id="maintabs">
  959. <cp:select><out:text><xsl:value-of select="@select"/></out:text></cp:select>
  960. <out:variable name="df_tabcnt">
  961. <out:choose>
  962. <out:when test="$df_hasRead = 'true' or $df_hasRead=''">
  963. <out:choose>
  964. <out:when test="$df_hasTraverse = 'true' or $df_hasTraverse=''"><out:value-of select="count($ui-obj-tab/tab)"/></out:when>
  965. <out:otherwise><out:value-of select="count($ui-obj-tab/tab[not(@needTraverse='T')])"/></out:otherwise>
  966. </out:choose>
  967. </out:when>
  968. <out:otherwise>0</out:otherwise>
  969. </out:choose>
  970. </out:variable>
  971. <!-- only show these property pages if the user has read permission or if the tab needs traverse and the user has traverse -->
  972. <out:if test="$df_hasRead = 'true' or $df_hasRead=''">
  973. <out:variable name="anonymousObj" select="/root/env/param[@name='m_obj'] = 'CAMID(&quot;::Anonymous&quot;)'"/>
  974. <out:for-each select="$ui-obj-tab/tab[not(@needTraverse='T') or (@needTraverse='T' and ($df_hasTraverse = 'true' or $df_hasTraverse=''))]">
  975. <out:variable name="requiredCondition" select="condition"/>
  976. <out:variable name="conditionMet">
  977. <out:for-each select="$requiredCondition">
  978. <out:if test="@type='session'">
  979. <out:variable name="name" select="@name"/>
  980. <out:value-of select="/root/session/param[@name=$name]=@value"/>
  981. </out:if>
  982. </out:for-each>
  983. </out:variable>
  984. <out:variable name="requiredCapability" select="@requiredCapability"/>
  985. <out:variable name="hasCapability" select="string($requiredCapability) = '' or boolean(/root/session/param[@name='capabilities']/*[local-name()=$requiredCapability])"/>
  986. <out:if test="$hasCapability and (not(contains($conditionMet,'false'))) and ((not($anonymousObj or starts-with(/root/env/param[@name='m_obj'],'/configuration/account'))) or @name != 'personal')">
  987. <out:variable name="tabName">
  988. <out:choose>
  989. <out:when test="@isClassTab='T'">
  990. <out:value-of select="/root/objectClass/class[@name= string(/root/env/param[@name='m_class'])]"/>
  991. </out:when>
  992. <out:otherwise>
  993. <out:value-of select="."/>
  994. </out:otherwise>
  995. </out:choose>
  996. </out:variable>
  997. <out:choose>
  998. <out:when test="(((position() = last() or ($anonymousObj and @name='preferences')) and $df_hasUserProfile != 'false') or (@name='personal' and $df_hasUserProfile = 'false')) and $df_hasSetPolicy = 'false'">
  999. <cp:tab name="@name" var-name="true" position="end">
  1000. <a>
  1001. <xsl:attribute name="href">
  1002. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1003. </xsl:attribute>
  1004. <xsl:if test="@onclick">
  1005. <xsl:attribute name="onclick">
  1006. <xsl:value-of select="@onclick"/>
  1007. </xsl:attribute>
  1008. </xsl:if>
  1009. <cp:label><out:value-of select="$tabName"/></cp:label>
  1010. </a>
  1011. </cp:tab>
  1012. </out:when>
  1013. <out:when test="@name='preferences' or @name='mypages'">
  1014. <out:if test="$df_hasUserProfile != 'false'">
  1015. <cp:tab name="@name" var-name="true">
  1016. <a>
  1017. <xsl:attribute name="href">
  1018. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1019. </xsl:attribute>
  1020. <xsl:if test="@onclick">
  1021. <xsl:attribute name="onclick">
  1022. <xsl:value-of select="@onclick"/>
  1023. </xsl:attribute>
  1024. </xsl:if>
  1025. <cp:label><out:value-of select="$tabName"/></cp:label>
  1026. </a>
  1027. </cp:tab>
  1028. </out:if>
  1029. </out:when>
  1030. <out:otherwise>
  1031. <cp:tab name="@name" var-name="true">
  1032. <a>
  1033. <xsl:attribute name="href">
  1034. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1035. </xsl:attribute>
  1036. <xsl:if test="@onclick">
  1037. <xsl:attribute name="onclick">
  1038. <xsl:value-of select="@onclick"/>
  1039. </xsl:attribute>
  1040. </xsl:if>
  1041. <cp:label><out:value-of select="$tabName"/></cp:label>
  1042. </a>
  1043. </cp:tab>
  1044. </out:otherwise>
  1045. </out:choose>
  1046. </out:if>
  1047. </out:for-each>
  1048. </out:if>
  1049. <out:variable name="df_hasCapabilityPolicy" select="contains(' package content folder ', concat(' ', /root/env/param[@name='m_class'], ' ')) and $userCanUseOC"/>
  1050. <!-- diddle with the right-hand bar that completes the property tab -->
  1051. <out:if test="$df_outtabend='false' and $df_tabcnt=0"><cp:tabend/></out:if>
  1052. <xsl:apply-templates select="cp:description"/>
  1053. </cp:tabset>
  1054. </xsl:template>
  1055. <xsl:template match="df:propertiesTabsJobsTitan">
  1056. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  1057. <xsl:variable name="onClickScript" select="@onclick | @onClick"/>
  1058. <xsl:variable name="hasJSStart" select="starts-with(string($onClickScript),'java')"/>
  1059. <script language="javascript">
  1060. function submitForm(sTarget, bSkipValidate)
  1061. {
  1062. if (bSkipValidate == null) {
  1063. bSkipValidate = false;
  1064. }
  1065. var bValidate = true;
  1066. <!--If we are not to skip validation and there is something to validate on the container page then do the validation ..-->
  1067. <![CDATA[
  1068. if (window.validate && !bSkipValidate) {
  1069. bValidate = validate();
  1070. }
  1071. ]]>
  1072. if (bValidate)
  1073. {
  1074. document.pform.m.value = "<out:value-of select="$app"/>" + "/" + sTarget;
  1075. document.pform.m_class.value = "<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_class']))"/>";
  1076. document.pform.ps_nav_op.value = "maintain";
  1077. document.pform.submit();
  1078. }
  1079. }
  1080. </script>
  1081. <!-- the tabset requires the df_tab_selected variable to be defined >
  1082. <out:variable name="df_tab_selected"><xsl:value-of select="@select"/></out:variable-->
  1083. <out:variable name="df_hasSetPolicy">
  1084. <xsl:if test="df:hasSetPolicy">
  1085. <xsl:copy-of select="df:hasSetPolicy/node()"/>
  1086. </xsl:if>
  1087. </out:variable>
  1088. <out:variable name="df_hasRead">
  1089. <xsl:if test="df:hasRead">
  1090. <xsl:copy-of select="df:hasRead/node()"/>
  1091. </xsl:if>
  1092. </out:variable>
  1093. <out:variable name="df_hasTraverse">
  1094. <xsl:if test="df:hasTraverse">
  1095. <xsl:copy-of select="df:hasTraverse/node()"/>
  1096. </xsl:if>
  1097. </out:variable>
  1098. <out:variable name="df_outtabend">
  1099. <xsl:choose>
  1100. <xsl:when test="@select='general'">false</xsl:when>
  1101. <xsl:otherwise>true</xsl:otherwise>
  1102. </xsl:choose>
  1103. </out:variable>
  1104. <out:variable name="df_hasUserProfile">
  1105. <xsl:if test="df:hasUserProfile">
  1106. <xsl:copy-of select="df:hasUserProfile/node()"/>
  1107. </xsl:if>
  1108. </out:variable>
  1109. <out:variable name="userInterfaces" select="/root//cm:queryResponse//cm:package/cm:userInterfaces/cm:uiComponentEnum"/>
  1110. <out:variable name="objLaunchableType" select="/root//cm:queryResponse//cm:launchable/cm:launchableType"/>
  1111. <out:variable name="effectiveUserCapabilities">
  1112. <out:call-template name="calEffectiveObjectCapabilities">
  1113. <out:with-param name="capabilities" select="/root//cm:queryResponse/*/cm:effectiveUserCapabilities | /root//cm:queryResponse/*/*/*/cm:effectiveUserCapabilities"/>
  1114. </out:call-template>
  1115. </out:variable>
  1116. <out:variable name="tabObj" select="key('ui-object-properties', /root/env/param[@name='m_class'])"/>
  1117. <out:variable name="ui-obj-tab" select="key('ui-object-properties', /root/env/param[@name='m_class'])[not(@userInterface) or @userInterface=$userInterfaces][not(@launchableType) or @launchableType=$objLaunchableType]"/>
  1118. <!-- these are the properties tabs -->
  1119. <cp:tabset id="maintabs">
  1120. <cp:select><out:text><xsl:value-of select="@select"/></out:text></cp:select>
  1121. <out:variable name="df_tabcnt">
  1122. <out:choose>
  1123. <out:when test="$df_hasRead = 'true' or $df_hasRead=''">
  1124. <out:choose>
  1125. <out:when test="$df_hasTraverse = 'true' or $df_hasTraverse=''"><out:value-of select="count($ui-obj-tab/tab)"/></out:when>
  1126. <out:otherwise><out:value-of select="count($ui-obj-tab/tab[not(@needTraverse='T')])"/></out:otherwise>
  1127. </out:choose>
  1128. </out:when>
  1129. <out:otherwise>0</out:otherwise>
  1130. </out:choose>
  1131. </out:variable>
  1132. <!-- only show these property pages if the user has read permission or if the tab needs traverse and the user has traverse -->
  1133. <out:if test="$df_hasRead = 'true' or $df_hasRead=''">
  1134. <out:variable name="anonymousObj" select="/root/env/param[@name='m_obj'] = 'CAMID(&quot;::Anonymous&quot;)'"/>
  1135. <out:for-each select="$ui-obj-tab/tab[not(@needTraverse='T') or (@needTraverse='T' and ($df_hasTraverse = 'true' or $df_hasTraverse=''))]">
  1136. <out:variable name="requiredCondition" select="condition"/>
  1137. <out:variable name="conditionMet">
  1138. <out:for-each select="$requiredCondition">
  1139. <out:if test="@type='session'">
  1140. <out:variable name="name" select="@name"/>
  1141. <out:value-of select="/root/session/param[@name=$name]=@value"/>
  1142. </out:if>
  1143. </out:for-each>
  1144. </out:variable>
  1145. <out:variable name="requiredCapability" select="@requiredCapability"/>
  1146. <out:variable name="hasCapability" select="string($requiredCapability) = '' or boolean(/root/session/param[@name='capabilities']/*[local-name()=$requiredCapability])"/>
  1147. <out:if test="$hasCapability and (not(contains($conditionMet,'false'))) and ((not($anonymousObj or starts-with(/root/env/param[@name='m_obj'],'/configuration/account'))) or @name != 'personal')">
  1148. <out:variable name="tabName">
  1149. <out:choose>
  1150. <out:when test="@isClassTab='T'">
  1151. <out:value-of select="/root/objectClass/class[@name= string(/root/env/param[@name='m_class'])]"/>
  1152. </out:when>
  1153. <out:otherwise>
  1154. <out:value-of select="."/>
  1155. </out:otherwise>
  1156. </out:choose>
  1157. </out:variable>
  1158. <out:choose>
  1159. <out:when test="(((position() = last() or ($anonymousObj and @name='preferences')) and $df_hasUserProfile != 'false') or (@name='personal' and $df_hasUserProfile = 'false')) and $df_hasSetPolicy = 'false'">
  1160. <cp:tab name="@name" var-name="true" position="end">
  1161. <a>
  1162. <xsl:attribute name="href">
  1163. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1164. </xsl:attribute>
  1165. <xsl:if test="@onclick">
  1166. <xsl:attribute name="onclick">
  1167. <xsl:value-of select="@onclick"/>
  1168. </xsl:attribute>
  1169. </xsl:if>
  1170. <cp:label><out:value-of select="$tabName"/></cp:label>
  1171. </a>
  1172. </cp:tab>
  1173. </out:when>
  1174. <out:when test="@name='preferences' or @name='mypages'">
  1175. <out:if test="$df_hasUserProfile != 'false'">
  1176. <cp:tab name="@name" var-name="true">
  1177. <a>
  1178. <xsl:attribute name="href">
  1179. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1180. </xsl:attribute>
  1181. <xsl:if test="@onclick">
  1182. <xsl:attribute name="onclick">
  1183. <xsl:value-of select="@onclick"/>
  1184. </xsl:attribute>
  1185. </xsl:if>
  1186. <cp:label><out:value-of select="$tabName"/></cp:label>
  1187. </a>
  1188. </cp:tab>
  1189. </out:if>
  1190. </out:when>
  1191. <out:otherwise>
  1192. <cp:tab name="@name" var-name="true">
  1193. <a>
  1194. <xsl:attribute name="href">
  1195. <xsl:text/>javascript:submitForm('{@page}')<xsl:text/>
  1196. </xsl:attribute>
  1197. <xsl:if test="@onclick">
  1198. <xsl:attribute name="onclick">
  1199. <xsl:value-of select="@onclick"/>
  1200. </xsl:attribute>
  1201. </xsl:if>
  1202. <cp:label><out:value-of select="$tabName"/></cp:label>
  1203. </a>
  1204. </cp:tab>
  1205. </out:otherwise>
  1206. </out:choose>
  1207. </out:if>
  1208. </out:for-each>
  1209. </out:if>
  1210. <out:variable name="df_hasCapabilityPolicy" select="contains(' package content folder ', concat(' ', /root/env/param[@name='m_class'], ' ')) and $userCanUseOC"/>
  1211. <xsl:apply-templates select="cp:description"/>
  1212. </cp:tabset>
  1213. </xsl:template>
  1214. <xsl:template match="df:propertiesTabsCapabilitiesTitan">
  1215. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  1216. <xsl:variable name="onClickScript" select="@onclick | @onClick"/>
  1217. <xsl:variable name="hasJSStart" select="starts-with(string($onClickScript),'java')"/>
  1218. <script language="javascript">
  1219. function submitForm(sTarget, bSkipValidate)
  1220. {
  1221. if (bSkipValidate == null) {
  1222. bSkipValidate = false;
  1223. }
  1224. var bValidate = true;
  1225. <!--If we are not to skip validation and there is something to validate on the container page then do the validation ..-->
  1226. <![CDATA[
  1227. if (window.validate && !bSkipValidate) {
  1228. bValidate = validate();
  1229. }
  1230. ]]>
  1231. if (bValidate)
  1232. {
  1233. document.pform.m.value = "<out:value-of select="$app"/>" + "/" + sTarget;
  1234. document.pform.m_class.value = "<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_class']))"/>";
  1235. document.pform.ps_nav_op.value = "maintain";
  1236. document.pform.submit();
  1237. }
  1238. }
  1239. </script>
  1240. <!-- the tabset requires the df_tab_selected variable to be defined >
  1241. <out:variable name="df_tab_selected"><xsl:value-of select="@select"/></out:variable-->
  1242. <out:variable name="df_hasSetPolicy">
  1243. <xsl:if test="df:hasSetPolicy">
  1244. <xsl:copy-of select="df:hasSetPolicy/node()"/>
  1245. </xsl:if>
  1246. </out:variable>
  1247. <out:variable name="df_hasRead">
  1248. <xsl:if test="df:hasRead">
  1249. <xsl:copy-of select="df:hasRead/node()"/>
  1250. </xsl:if>
  1251. </out:variable>
  1252. <out:variable name="df_hasTraverse">
  1253. <xsl:if test="df:hasTraverse">
  1254. <xsl:copy-of select="df:hasTraverse/node()"/>
  1255. </xsl:if>
  1256. </out:variable>
  1257. <out:variable name="df_outtabend">
  1258. <xsl:choose>
  1259. <xsl:when test="@select='general'">false</xsl:when>
  1260. <xsl:otherwise>true</xsl:otherwise>
  1261. </xsl:choose>
  1262. </out:variable>
  1263. <out:variable name="df_hasUserProfile">
  1264. <xsl:if test="df:hasUserProfile">
  1265. <xsl:copy-of select="df:hasUserProfile/node()"/>
  1266. </xsl:if>
  1267. </out:variable>
  1268. <out:variable name="userInterfaces" select="/root//cm:queryResponse//cm:package/cm:userInterfaces/cm:uiComponentEnum"/>
  1269. <out:variable name="objLaunchableType" select="/root//cm:queryResponse//cm:launchable/cm:launchableType"/>
  1270. <out:variable name="effectiveUserCapabilities">
  1271. <out:call-template name="calEffectiveObjectCapabilities">
  1272. <out:with-param name="capabilities" select="/root//cm:queryResponse/*/cm:effectiveUserCapabilities | /root//cm:queryResponse/*/*/*/cm:effectiveUserCapabilities"/>
  1273. </out:call-template>
  1274. </out:variable>
  1275. <out:variable name="tabObj" select="key('ui-object-properties', /root/env/param[@name='m_class'])"/>
  1276. <out:variable name="ui-obj-tab" select="key('ui-object-properties', /root/env/param[@name='m_class'])[not(@userInterface) or @userInterface=$userInterfaces][not(@launchableType) or @launchableType=$objLaunchableType]"/>
  1277. <!-- these are the properties tabs -->
  1278. <cp:tabset id="maintabs">
  1279. <cp:select><out:text><xsl:value-of select="@select"/></out:text></cp:select>
  1280. <out:variable name="df_tabcnt">
  1281. <out:choose>
  1282. <out:when test="$df_hasRead = 'true' or $df_hasRead=''">
  1283. <out:choose>
  1284. <out:when test="$df_hasTraverse = 'true' or $df_hasTraverse=''"><out:value-of select="count($ui-obj-tab/tab)"/></out:when>
  1285. <out:otherwise><out:value-of select="count($ui-obj-tab/tab[not(@needTraverse='T')])"/></out:otherwise>
  1286. </out:choose>
  1287. </out:when>
  1288. <out:otherwise>0</out:otherwise>
  1289. </out:choose>
  1290. </out:variable>
  1291. <out:variable name="df_hasCapabilityPolicy" select="contains(' package content folder ', concat(' ', /root/env/param[@name='m_class'], ' ')) and $userCanUseOC"/>
  1292. <out:choose>
  1293. <out:when test="($df_hasSetPolicy = 'true' or $df_hasSetPolicy='')">
  1294. <out:choose>
  1295. <out:when test="$df_hasCapabilityPolicy">
  1296. <cp:tab name="capabilities" position="end">
  1297. <a>
  1298. <xsl:attribute name="href">
  1299. <xsl:choose>
  1300. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  1301. <xsl:otherwise>javascript:submitForm('properties_capabilities.xts')</xsl:otherwise>
  1302. </xsl:choose>
  1303. </xsl:attribute>
  1304. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  1305. <xsl:attribute name="onclick">
  1306. <xsl:choose>
  1307. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_capabilities.xts');</xsl:when>
  1308. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  1309. </xsl:choose>
  1310. </xsl:attribute>
  1311. <xsl:if test="$df-kbA11y='true'">
  1312. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  1313. </xsl:if>
  1314. </xsl:if>
  1315. <cp:label><xts:string id="IDS_PROP_TAB_CAPABILITIES"/></cp:label>
  1316. </a>
  1317. </cp:tab>
  1318. </out:when>
  1319. <out:otherwise>
  1320. </out:otherwise>
  1321. </out:choose>
  1322. </out:when>
  1323. <out:otherwise>
  1324. <!-- diddle with the right-hand bar that completes the property tab -->
  1325. <out:if test="$df_outtabend='false' and $df_tabcnt=0"><cp:tabend/></out:if>
  1326. </out:otherwise>
  1327. </out:choose>
  1328. <xsl:apply-templates select="cp:description"/>
  1329. </cp:tabset>
  1330. </xsl:template>
  1331. <xsl:template match="df:propertiesTabsTitan">
  1332. <xsl:variable name="df-kbA11y"><xsl:value-of select="string(@df:kbA11y)"/></xsl:variable>
  1333. <xsl:variable name="onClickScript" select="@onclick | @onClick"/>
  1334. <xsl:variable name="hasJSStart" select="starts-with(string($onClickScript),'java')"/>
  1335. <script language="javascript">
  1336. function submitForm(sTarget, bSkipValidate)
  1337. {
  1338. if (bSkipValidate == null) {
  1339. bSkipValidate = false;
  1340. }
  1341. var bValidate = true;
  1342. <!--If we are not to skip validation and there is something to validate on the container page then do the validation ..-->
  1343. <![CDATA[
  1344. if (window.validate && !bSkipValidate) {
  1345. bValidate = validate();
  1346. }
  1347. ]]>
  1348. if (bValidate)
  1349. {
  1350. document.pform.m.value = "<out:value-of select="$app"/>" + "/" + sTarget;
  1351. document.pform.m_class.value = "<out:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_class']))"/>";
  1352. document.pform.ps_nav_op.value = "maintain";
  1353. document.pform.submit();
  1354. }
  1355. }
  1356. </script>
  1357. <!-- the tabset requires the df_tab_selected variable to be defined >
  1358. <out:variable name="df_tab_selected"><xsl:value-of select="@select"/></out:variable-->
  1359. <out:variable name="df_hasSetPolicy">
  1360. <xsl:if test="df:hasSetPolicy">
  1361. <xsl:copy-of select="df:hasSetPolicy/node()"/>
  1362. </xsl:if>
  1363. </out:variable>
  1364. <out:variable name="df_hasRead">
  1365. <xsl:if test="df:hasRead">
  1366. <xsl:copy-of select="df:hasRead/node()"/>
  1367. </xsl:if>
  1368. </out:variable>
  1369. <out:variable name="df_hasTraverse">
  1370. <xsl:if test="df:hasTraverse">
  1371. <xsl:copy-of select="df:hasTraverse/node()"/>
  1372. </xsl:if>
  1373. </out:variable>
  1374. <out:variable name="df_outtabend">
  1375. <xsl:choose>
  1376. <xsl:when test="@select='general'">false</xsl:when>
  1377. <xsl:otherwise>true</xsl:otherwise>
  1378. </xsl:choose>
  1379. </out:variable>
  1380. <out:variable name="df_hasUserProfile">
  1381. <xsl:if test="df:hasUserProfile">
  1382. <xsl:copy-of select="df:hasUserProfile/node()"/>
  1383. </xsl:if>
  1384. </out:variable>
  1385. <out:variable name="userInterfaces" select="/root//cm:queryResponse//cm:package/cm:userInterfaces/cm:uiComponentEnum"/>
  1386. <out:variable name="objLaunchableType" select="/root//cm:queryResponse//cm:launchable/cm:launchableType"/>
  1387. <out:variable name="effectiveUserCapabilities">
  1388. <out:call-template name="calEffectiveObjectCapabilities">
  1389. <out:with-param name="capabilities" select="/root//cm:queryResponse/*/cm:effectiveUserCapabilities | /root//cm:queryResponse/*/*/*/cm:effectiveUserCapabilities"/>
  1390. </out:call-template>
  1391. </out:variable>
  1392. <out:variable name="tabObj" select="key('ui-object-properties', /root/env/param[@name='m_class'])"/>
  1393. <out:variable name="ui-obj-tab" select="key('ui-object-properties', /root/env/param[@name='m_class'])[not(@userInterface) or @userInterface=$userInterfaces][not(@launchableType) or @launchableType=$objLaunchableType]"/>
  1394. <!-- these are the properties tabs -->
  1395. <cp:tabset id="maintabs">
  1396. <cp:select><out:text><xsl:value-of select="@select"/></out:text></cp:select>
  1397. <cp:tab name="general" position="start">
  1398. <a>
  1399. <xsl:attribute name="href">
  1400. <xsl:choose>
  1401. <xsl:when test="$df-kbA11y='true'">#</xsl:when>
  1402. <xsl:otherwise>javascript:submitForm('properties_general.xts')</xsl:otherwise>
  1403. </xsl:choose>
  1404. </xsl:attribute>
  1405. <xsl:if test="$onClickScript or $df-kbA11y='true'">
  1406. <xsl:attribute name="onclick">
  1407. <xsl:choose>
  1408. <xsl:when test="$df-kbA11y='true'"><xsl:if test="not($hasJSStart)">javascript:</xsl:if><xsl:if test="$onClickScript != ''"><xsl:value-of select="$onClickScript"/>;</xsl:if>submitForm('properties_general.xts');</xsl:when>
  1409. <xsl:otherwise><xsl:value-of select="$onClickScript"/></xsl:otherwise>
  1410. </xsl:choose>
  1411. </xsl:attribute>
  1412. <xsl:if test="$df-kbA11y='true'">
  1413. <out:attribute name="onkeypress">javascript:if( event.keyCode==13 || event.keyCode==32 || event.charCode==32 )<xsl:text>{</xsl:text>this.onclick(); return false;<xsl:text>}</xsl:text> return true;</out:attribute>
  1414. </xsl:if>
  1415. </xsl:if>
  1416. <!--
  1417. I could just copy all of the attributes specified on the df:propertiesTabs tag but
  1418. not sure if that would produce undesirable side effects.
  1419. -->
  1420. <cp:label><xts:string id="IDS_PROP_TAB_GENERAL"/></cp:label>
  1421. </a>
  1422. </cp:tab>
  1423. <out:variable name="df_tabcnt">
  1424. <out:choose>
  1425. <out:when test="$df_hasRead = 'true' or $df_hasRead=''">
  1426. <out:choose>
  1427. <out:when test="$df_hasTraverse = 'true' or $df_hasTraverse=''"><out:value-of select="count($ui-obj-tab/tab)"/></out:when>
  1428. <out:otherwise><out:value-of select="count($ui-obj-tab/tab[not(@needTraverse='T')])"/></out:otherwise>
  1429. </out:choose>
  1430. </out:when>
  1431. <out:otherwise>0</out:otherwise>
  1432. </out:choose>
  1433. </out:variable>
  1434. <out:variable name="df_hasCapabilityPolicy" select="contains(' package content folder ', concat(' ', /root/env/param[@name='m_class'], ' ')) and $userCanUseOC"/>
  1435. <xsl:apply-templates select="cp:description"/>
  1436. </cp:tabset>
  1437. </xsl:template>
  1438. <!--
  1439. df:personalizeTabs - this will display the tabs for the personalize section
  1440. -->
  1441. <xsl:template match="df:personalizeTabs">
  1442. <cp:tabset>
  1443. <cp:select><xsl:value-of select="@select"/></cp:select>
  1444. <cp:tab name="general" position="start">
  1445. <utml:a utml:validate="true">
  1446. <utml:target>
  1447. <out:value-of select="$app"/>/preferences/general.xts<out:text/>
  1448. </utml:target>
  1449. <cp:label><xts:string id="IDS_PROP_TAB_GENERAL"/></cp:label>
  1450. </utml:a>
  1451. </cp:tab>
  1452. <!-- These tabs are not supported for users that do not have write access to the account object -->
  1453. <out:choose>
  1454. <out:when test="(contains(/root/cm:queryResponse/cm:queryReply/cm:account/cm:permissions,'write') or ($isNamedAccountReadOnly))">
  1455. <cp:tab name="personal">
  1456. <utml:a utml:validate="true">
  1457. <utml:target>
  1458. <out:value-of select="$app"/>/preferences/personal.xts<out:text/>
  1459. </utml:target>
  1460. <cp:label><xts:string id="IDS_PERS_TAB_PERSONAL"/></cp:label>
  1461. </utml:a>
  1462. </cp:tab>
  1463. <cp:tab name="mypages" position="end">
  1464. <utml:a utml:validate="true">
  1465. <utml:target>
  1466. <out:value-of select="$app"/>/preferences/mypages.xts<out:text/>
  1467. </utml:target>
  1468. <cp:label><xts:string id="IDS_PERS_TAB_MYPAGES"/></cp:label>
  1469. </utml:a>
  1470. </cp:tab>
  1471. </out:when>
  1472. <!-- generate a dummy tab to force the the tab-rendering control to close the general tab -->
  1473. <out:otherwise>
  1474. <cp:tab name="dummy" position="end"/>
  1475. </out:otherwise>
  1476. </out:choose>
  1477. </cp:tabset>
  1478. </xsl:template>
  1479. <!-- the main engine -->
  1480. <xsl:template match="*">
  1481. <xsl:copy>
  1482. <xsl:copy-of select="@*"/>
  1483. <xsl:apply-templates/>
  1484. </xsl:copy>
  1485. </xsl:template>
  1486. </xsl:stylesheet>