cps-ui.xslt 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2017
  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. <!-- $Header: //cpscrn/main/templates/cps4/producer/logicsheets/cps-ui.xslt#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:out="dummy-uri"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
  21. xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
  22. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  23. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  24. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  25. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  26. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  28. <xsl:template match="xsl:stylesheet" priority="1">
  29. <out:stylesheet
  30. xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
  31. xmlns:crn="http://developer.cognos.com/schemas/crconfig/1/"
  32. xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
  33. xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
  34. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  35. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/">
  36. <!-- dummy way of copying namespaces -->
  37. <xsl:for-each select="namespace::*[. != 'http://www.w3.org/1999/XSL/Transform']">
  38. <xsl:attribute name="{name()}:dummy" namespace="{.}"/>
  39. </xsl:for-each>
  40. <!-- copy all attributes, except 'exclude-result-prefixes' -->
  41. <xsl:apply-templates select="@*[name()!='exclude-result-prefixes']"/>
  42. <!-- construct an 'exclude-result-prefixes' attribute with the list from the source xslt plus our own list -->
  43. <xsl:attribute name="exclude-result-prefixes">
  44. <xsl:if test="@exclude-result-prefixes">
  45. <xsl:value-of select="@exclude-result-prefixes"/>
  46. <xsl:text> </xsl:text>
  47. </xsl:if>
  48. <xsl:text>xts xtsext ui crn utml wsrp SOAP-ENV cps</xsl:text>
  49. </xsl:attribute>
  50. <!-- add some useful variables... -->
  51. <!-- TODO: utml may define the same variables, should grab these instead -->
  52. <out:variable name="ui-op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
  53. <out:variable name="ui-markups" select="$ui-op/wsrp:markupParams"/>
  54. <out:variable name="ui-session-params" select="/root/session/param"/>
  55. <out:variable name="ui-state-params" select="$ui-op/wsrp:portletContext/wsrp:portletState/param"/>
  56. <out:variable name="ui-registration-params" select="$ui-op/wsrp:registrationContext/wsrp:registrationState/param"/>
  57. <out:variable name="ui-navigational-params" select="$ui-markups/wsrp:navigationalState/param"/>
  58. <out:variable name="ui-form-params" select="$ui-op/wsrp:interactionParams/wsrp:formParameters"/>
  59. <out:variable name="ui-configuration" select="/root/configProps/param[@name='cps']/property"/>
  60. <out:variable name="ui-system-params" select="/root/system/param"/>
  61. <out:variable name="ui-mode" select="$ui-markups/wsrp:mode"/>
  62. <out:variable name="ui-window-state" select="$ui-markups/wsrp:windowState"/>
  63. <out:variable name="ui-is-cognos-connection" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:portalAgent = 'cognos'"/>
  64. <out:variable name="ui-is-myportal" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:portalAgent = 'cognosFragmentServer'"/>
  65. <out:variable name="ui-is-iwidget" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name='isIWidget'] = 'true'"/>
  66. <out:variable name="ui-gateway">
  67. <out:choose>
  68. <out:when test="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'gatewayURL'] != ''">
  69. <out:value-of select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'gatewayURL']"/>
  70. </out:when>
  71. <out:otherwise>
  72. <out:value-of select="/root/configProps/param[@name='cps']/property[@name = 'gateway']"/>
  73. </out:otherwise>
  74. </out:choose>
  75. </out:variable>
  76. <out:variable name="ui-webcontent">
  77. <out:choose>
  78. <out:when test="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'webContentURL'] != ''">
  79. <out:value-of select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'webContentURL']"/>
  80. </out:when>
  81. <out:when test="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = 'webcontent']/crn:value != ''">
  82. <out:value-of select="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = 'webcontent']/crn:value"/>
  83. </out:when>
  84. <out:when test="contains($ui-gateway,'/cgi-bin')">
  85. <out:value-of select="substring-before($ui-gateway,'/cgi-bin')"/>
  86. </out:when>
  87. <out:otherwise>
  88. <out:value-of select="$ui-system-params[@name = 'webcontent']"/>
  89. </out:otherwise>
  90. </out:choose>
  91. <out:text>/</out:text>
  92. </out:variable>
  93. <out:variable name="ui-producer-images">
  94. <out:value-of select="$ui-webcontent"/>
  95. <out:text>.</out:text>
  96. <out:value-of select="/root/interfaces/interfaceInfo/param[@name = 'extraInfo']"/>
  97. <out:text>/images/</out:text>
  98. </out:variable>
  99. <out:variable name="ui-hide-selector" select="$ui-configuration[@name='cps4.portlet.ui.hide.empty.selector']"/>
  100. <out:variable name="ui-portlet-product-locale" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>
  101. <out:variable name="ui-portlet-user-preferences" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars"/>
  102. <out:variable name="ui-portlet-isBidiEnabled">
  103. <out:choose>
  104. <out:when test="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled']/value != ''">
  105. <out:value-of select="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled']/value"/>
  106. </out:when>
  107. <out:otherwise>false</out:otherwise>
  108. </out:choose>
  109. </out:variable>
  110. <out:variable name="ui-portlet-baseTextDirection">
  111. <out:variable name="ui-ns_name">
  112. <out:value-of select="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#baseTextDirection']/value"/>
  113. </out:variable>
  114. <out:choose>
  115. <out:when test="$ui-ns_name != ''">
  116. <out:value-of select="translate(substring-after($ui-ns_name,'#'),'LTRA','ltra')"/>
  117. </out:when>
  118. <out:otherwise>auto</out:otherwise>
  119. </out:choose>
  120. </out:variable>
  121. <xsl:apply-templates select="*|text()|processing-instruction()"/>
  122. <out:template name="ui-get-property">
  123. <out:param name="property-name"/>
  124. <out:param name="property-exclude-form-input" select="'true'"/>
  125. <out:param name="property-exclude-nav-state" select="'false'"/>
  126. <out:param name="property-exclude-session-state" select="'false'"/>
  127. <out:param name="property-default" select="''"/>
  128. <out:choose>
  129. <!-- level 1: form params (when performBlockingInteraction) -->
  130. <out:when test="not($property-exclude-form-input = 'true') and ($ui-form-params[@name = string( $property-name )])">
  131. <out:value-of select="$ui-form-params[@name = string( $property-name )]/wsrp:value"/>
  132. </out:when>
  133. <!-- level 2: navigational params -->
  134. <out:when test="not($property-exclude-nav-state = 'true') and ($ui-navigational-params[@name = string( $property-name )])">
  135. <out:value-of select="$ui-navigational-params[@name = string( $property-name )]"/>
  136. </out:when>
  137. <!-- UTML ONLY: when reloading the page, unchecked checkbox's value are not there -->
  138. <xsl:if test="/*[namespace-uri()='http://developer.cognos.com/schemas/cps/logic/form/1/']">
  139. <out:when test="(key('utml-key-params', 'edit_visited') = 'true') and ($property-default != '') and not( key('utml-key-params', string( $property-name )) )">
  140. <out:value-of select="$property-default"/>
  141. </out:when>
  142. </xsl:if>
  143. <!-- level 3: session states -->
  144. <out:when test="not($property-exclude-session-state = 'true') and ($ui-session-params[@name = string( $property-name )] != '')">
  145. <out:value-of select="$ui-session-params[@name = string( $property-name )]"/>
  146. </out:when>
  147. <!-- level 4: portlet states -->
  148. <out:when test="$ui-state-params[@name = string( $property-name )]">
  149. <out:value-of select="$ui-state-params[@name = string( $property-name )]"/>
  150. </out:when>
  151. <!-- level 5: registration params -->
  152. <out:when test="$ui-registration-params[@name = string( $property-name )] != ''">
  153. <out:value-of select="$ui-registration-params[@name = string( $property-name )]"/>
  154. </out:when>
  155. <!-- level 6: configuration API (either property[@name] or property['CPS']/parameter[@name]) -->
  156. <out:when test="$ui-configuration[@name = string( $property-name )] != ''">
  157. <out:value-of select="$ui-configuration[@name = string( $property-name )]"/>
  158. </out:when>
  159. <out:when test="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = string( $property-name )]/crn:value != ''">
  160. <out:value-of select="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = string( $property-name )]/crn:value"/>
  161. </out:when>
  162. <!-- level 7: system params -->
  163. <out:when test="$ui-system-params[@name = string( $property-name )] != ''">
  164. <out:value-of select="$ui-system-params[@name = string( $property-name )]"/>
  165. </out:when>
  166. <!-- level 8: default in the code -->
  167. <out:otherwise>
  168. <out:value-of select="$property-default"/>
  169. </out:otherwise>
  170. </out:choose>
  171. </out:template>
  172. </out:stylesheet>
  173. </xsl:template>
  174. <xsl:template match="ui:capabilities" priority="1">
  175. <out:variable name="userCapabilities" select="/root/envelope/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']"/>
  176. <out:variable name="ui-canUseQueryStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseQueryStudio'])"/>
  177. <out:variable name="ui-canUseReportStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseReportStudio'])"/>
  178. <out:variable name="ui-canUseCognosViewerRunWithOptions" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseCognosViewerRunWithOptions'])"/>
  179. <out:variable name="ui-canUseMetricStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseMetricStudio'])"/>
  180. <out:variable name="ui-canUseAnalysisStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseAnalysisStudio'])"/>
  181. <out:variable name="ui-canUseEventStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseEventStudio'])"/>
  182. <out:variable name="ui-canUseScheduling" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseScheduling'])"/>
  183. <out:variable name="ui-canUsePlanningContributor" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUsePlanningContributor'])"/>
  184. <out:variable name="ui-canUseIndexSearch" select="false()"/>
  185. <out:variable name="ui-canUseCMSearch" select="string(/root/configuration/property[@name='portal.disablecmsearch']) != 'true'"/>
  186. </xsl:template>
  187. <xsl:template match="ui:property" priority="1">
  188. <xsl:choose>
  189. <xsl:when test="@name">
  190. <out:variable name="{ @name }">
  191. <out:call-template name="ui-get-property">
  192. <out:with-param name="property-name">
  193. <xsl:choose>
  194. <xsl:when test="@select">
  195. <out:value-of select="{ @select }"/>
  196. </xsl:when>
  197. <xsl:otherwise>
  198. <xsl:apply-templates/>
  199. </xsl:otherwise>
  200. </xsl:choose>
  201. </out:with-param>
  202. <xsl:if test="@default">
  203. <out:with-param name="property-default">
  204. <out:value-of select="{ @default }"/>
  205. </out:with-param>
  206. </xsl:if>
  207. <xsl:if test="@exclude-form-input">
  208. <out:with-param name="property-exclude-form-input">
  209. <out:value-of select="{ @exclude-form-input }"/>
  210. </out:with-param>
  211. </xsl:if>
  212. <xsl:if test="@exclude-nav-state">
  213. <out:with-param name="property-exclude-nav-state">
  214. <out:value-of select="{ @exclude-nav-state }"/>
  215. </out:with-param>
  216. </xsl:if>
  217. <xsl:if test="@exclude-session-state">
  218. <out:with-param name="property-exclude-session-state">
  219. <out:value-of select="{ @exclude-session-state }"/>
  220. </out:with-param>
  221. </xsl:if>
  222. </out:call-template>
  223. </out:variable>
  224. </xsl:when>
  225. <xsl:otherwise>
  226. <xsl:call-template name="ui-compile-error">
  227. <xsl:with-param name="errno">0001</xsl:with-param>
  228. <xsl:with-param name="errmsg">Missing mandatory attribute: name (xsd:string)</xsl:with-param>
  229. </xsl:call-template>
  230. </xsl:otherwise>
  231. </xsl:choose>
  232. </xsl:template>
  233. <xsl:template match="ui:create-nav-state" priority="1">
  234. <out:variable name="{generate-id()}">
  235. <xsl:apply-templates/>
  236. </out:variable>
  237. <out:variable name="{@name}" select="xtsext:validator('prepare','create-nav-state',xtsext:base64encode(string(${generate-id()}), true()))"/>
  238. </xsl:template>
  239. <xsl:template match="ui:param" priority="1">
  240. <out:text/>&lt;param name="<xsl:value-of select="@name"/>"&gt;<out:text/>
  241. <xsl:apply-templates/>
  242. <out:text/>&lt;/param&gt;<out:text/>
  243. </xsl:template>
  244. <xsl:template match="ui:preview" priority="1"/>
  245. <!-- helper function: creates a doHelp() javascript function to invoke the help page -->
  246. <xsl:template match="ui:help" name="ui-help" priority="1">
  247. <out:variable name="tmp-context">
  248. <out:text>IDH_</out:text>
  249. <out:if test="$ui-is-cognos-connection or $ui-is-myportal">
  250. <out:text>COGNOS_</out:text>
  251. </out:if>
  252. <out:value-of select="/root/portlet/@id"/>
  253. <out:text>_</out:text>
  254. <xsl:choose>
  255. <xsl:when test="@ui:helpid != ''"><xsl:value-of select="@ui:helpid"/></xsl:when>
  256. <xsl:otherwise>
  257. <out:choose>
  258. <out:when test="substring-before( string($ui-mode), ':' ) != ''">
  259. <out:value-of select="substring-after( string($ui-mode), ':' )"/>
  260. </out:when>
  261. <out:otherwise>
  262. <out:value-of select="$ui-mode"/>
  263. </out:otherwise>
  264. </out:choose>
  265. </xsl:otherwise>
  266. </xsl:choose>
  267. </out:variable>
  268. <out:variable name="context">
  269. <out:value-of select="translate( $tmp-context, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' )"/>
  270. </out:variable>
  271. <script language="javascript">
  272. function wsrp_rewrite_doHelp(redirect)
  273. {
  274. <out:variable name="ui-platform" select="$ui-configuration[@name='cps2.platform']/platform"/>
  275. <out:variable name="ui-help-path" select="$ui-platform/help/path"/>
  276. <out:variable name="ui-help">
  277. <out:if test="$ui-help-path != ''">
  278. <out:value-of select="$ui-webcontent"/>
  279. <out:value-of select="$ui-help-path"/>
  280. <out:if test="substring($ui-help-path, string-length($ui-help-path), 1) != '/'">
  281. <out:text>/</out:text>
  282. </out:if>
  283. </out:if>
  284. </out:variable>
  285. <out:choose>
  286. <out:when test="$ui-help != ''">
  287. var sLocale = "<out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>";
  288. <!-- Use the first two letters of the locale string to construct the path to the localized help folder. -->
  289. <!-- Make sure they are converted to lowercase. -->
  290. var sLang = sLocale.substring(0,2).toLowerCase();
  291. var sSupportedLangs = " <out:value-of select="$ui-platform/help/supportedLangs"/> ";
  292. if ( sSupportedLangs.indexOf(" " + sLang + " ") &lt; 0) {
  293. sLang = "en";
  294. }
  295. <out:variable name="bookFile">
  296. <out:choose>
  297. <out:when test="$ui-is-iwidget"><out:value-of select="$ui-platform/help/bookFileIWidget"/></out:when>
  298. <out:otherwise><out:value-of select="$ui-platform/help/bookFile"/></out:otherwise>
  299. </out:choose>
  300. </out:variable>
  301. var sHelpTopic = "<out:value-of select="$bookFile"/>?helpid=<out:value-of select="$context"/>";
  302. var sURL = "<out:value-of select="$ui-help"/>" + sLang + "/" + sHelpTopic;
  303. if (redirect != null) {
  304. document.location.href = sURL;
  305. } else {
  306. windowHelp = window.open(sURL, "cps_help", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
  307. windowHelp.focus();
  308. }
  309. </out:when>
  310. <out:otherwise>
  311. window.alert("<xts:string id="IDS_PRO_HTM_NO_HELP_URL" encode="javascript"/>");
  312. </out:otherwise>
  313. </out:choose>
  314. }
  315. </script>
  316. </xsl:template>
  317. <xsl:template match="ui:about" priority="1">
  318. <out:variable name="jsEncoded-ui-webcontent" select="xtsext:javascriptencode($ui-webcontent)"/>
  319. <script language="javascript" ><out:attribute name="src"><out:value-of select="$jsEncoded-ui-webcontent"/>ps/portal/js/aboutdialog.js</out:attribute></script>
  320. <script language="javascript">
  321. function wsrp_rewrite_doAbout()
  322. {
  323. <out:variable name="jsDefaultMessageFileLocation">
  324. <out:text>wsrp_rewrite?wsrp-urlType=resource&amp;wsrp-requiresRewrite=true&amp;wsrp-url=</out:text>
  325. <out:text>ps/portal/js/about/ps/nls/psuiaboutmsg_en.js</out:text>
  326. <out:text>/wsrp_rewrite</out:text>
  327. </out:variable>
  328. <out:variable name="jsMessageFileLocation">
  329. <out:text>wsrp_rewrite?wsrp-urlType=resource&amp;wsrp-requiresRewrite=true&amp;wsrp-url=</out:text>
  330. <out:text>ps/portal/js/about/ps/nls/psuiaboutmsg_</out:text>
  331. <out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>
  332. <out:text>.js/wsrp_rewrite</out:text>
  333. </out:variable>
  334. var httpArgSep = "?";
  335. <!-- need this argument to be passed to along so that in the scenario when the page is a custom tab in cc, a full url can be built -->
  336. var sLocale = "<out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>";
  337. var aboutMessageFileLocation = new Object().href = "<out:value-of select="$jsMessageFileLocation"/>";
  338. var aboutDefaultMessageFileLocation = new Object().href = "<out:value-of select="$jsDefaultMessageFileLocation"/>";
  339. if (aboutDefaultMessageFileLocation.indexOf('?') != -1){
  340. httpArgSep = "&amp;";
  341. }
  342. var helpAB = new about_dialog("<out:value-of select="$jsEncoded-ui-webcontent"/>ps/portal/images/about/cc_about_" + sLocale +".jpg","<out:value-of select="$jsEncoded-ui-webcontent"/>/ps/portal/images/about/cc_about_en.jpg",aboutMessageFileLocation, aboutDefaultMessageFileLocation);
  343. helpAB.show();
  344. }
  345. </script>
  346. </xsl:template>
  347. <xsl:template match="ui:copyright" priority="1">
  348. <script language="javascript">
  349. function wsrp_rewrite_doCopyright()
  350. {
  351. <out:variable name="ui-platform" select="$ui-configuration[@name='cps2.platform']/platform"/>
  352. <out:variable name="ui-help-path" select="$ui-platform/help/path"/>
  353. <out:variable name="ui-help">
  354. <out:if test="$ui-help-path != ''">
  355. <out:value-of select="$ui-webcontent"/>
  356. <out:value-of select="$ui-help-path"/>
  357. <out:if test="substring($ui-help-path, string-length($ui-help-path), 1) != '/'">
  358. <out:text>/</out:text>
  359. </out:if>
  360. </out:if>
  361. </out:variable>
  362. <out:variable name="ui-copyright-url">
  363. <out:if test="$ui-platform/help/copyrightFile != ''">
  364. <out:value-of select="$ui-help"/>
  365. <out:value-of select="$ui-platform/help/copyrightFile"/>
  366. </out:if>
  367. </out:variable>
  368. <out:choose>
  369. <out:when test="$ui-copyright-url != ''">
  370. var sLocale = "<out:value-of select="$ui-markups/wsrp:locales[1]"/>";
  371. <!-- Use the first two letters of the locale string to construct the path to the localized help folder. -->
  372. <!-- Make sure they are converted to lowercase. -->
  373. var sLang = sLocale.substring(0,2).toLowerCase();
  374. var sSupportedLangs = " <out:value-of select="$ui-platform/help/supportedLangs"/> ";
  375. if ( sSupportedLangs.indexOf(" " + sLang + " ") &lt; 0) {
  376. sLang = "en";
  377. }
  378. var sURL = "<out:value-of select="$ui-copyright-url"/>";
  379. var idxLocale = sURL.indexOf("@@");
  380. if (idxLocale != -1) {
  381. sURL = sURL.substring(0, idxLocale) + sLang + sURL.substring(idxLocale + 2);
  382. }
  383. windowHelp = window.open(sURL, "cps_copyright", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
  384. windowHelp.focus();
  385. </out:when>
  386. <out:otherwise>
  387. window.alert("<xts:string id="IDS_PRO_HTM_NO_COPYRIGHT" encode="javascript"/>");
  388. </out:otherwise>
  389. </out:choose>
  390. }
  391. </script>
  392. </xsl:template>
  393. <xsl:template match="ui:browser" priority="1">
  394. <out:variable name="ui-user-agent" select="translate(string( $ui-markups/wsrp:clientData/wsrp:userAgent ), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
  395. <out:variable name="ui-browser">
  396. <out:choose>
  397. <out:when test="contains($ui-user-agent , 'msie')">ie</out:when> <!-- IE 4.xx and above -->
  398. <out:when test="contains($ui-user-agent , 'safari/5') and not(contains($ui-user-agent , 'chrome'))">safari</out:when> <!-- Safari user-agent does not contain Chrome -->
  399. <out:when test="contains($ui-user-agent , 'chrome')">chrome</out:when> <!-- Chrome user-agent contains Safari also -->
  400. <out:when test="contains($ui-user-agent , 'mozilla/5.0')">
  401. <out:choose>
  402. <out:when test="contains($ui-user-agent , 'netscape/7.1')">ns71</out:when>
  403. <out:when test="contains($ui-user-agent , 'netscape/7.0')">ns70</out:when>
  404. <out:when test="contains($ui-user-agent , 'aol/7.0')">ns70</out:when>
  405. <out:when test="contains($ui-user-agent , 'cs 2000 7.0/7.0')">ns70</out:when>
  406. <out:when test="contains($ui-user-agent , 'netscape6')">ns6</out:when>
  407. <out:otherwise>moz</out:otherwise>
  408. </out:choose>
  409. </out:when>
  410. <out:when test="contains($ui-user-agent , 'mozilla/4.')">ns4</out:when> <!-- NS 4.xx -->
  411. <out:otherwise>other</out:otherwise>
  412. </out:choose>
  413. </out:variable>
  414. </xsl:template>
  415. <xsl:template match="ui:consumer" priority="1">
  416. <out:variable name="ui-consumer-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
  417. <out:variable name="ui-consumer-info" select="/root/portlet/consumer"/>
  418. </xsl:template>
  419. <xsl:template match="ui:page" priority="1">
  420. <out:variable name="ui-portal-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
  421. <out:variable name="ui-portal-info" select="/root/portlet/consumer"/>
  422. <out:variable name="ui-buttons-location" select="$ui-portal-info/layout/buttons/@location"/>
  423. <out:variable name="ui-buttons-align">
  424. <out:choose>
  425. <out:when test="contains( $ui-buttons-location, 'right' )">right</out:when>
  426. <out:otherwise>left</out:otherwise>
  427. </out:choose>
  428. </out:variable>
  429. <script type="text/javascript">
  430. <out:attribute name="src">
  431. <out:choose>
  432. <out:when test="contains($ui-gateway, '/bi/v1/disp')">
  433. <out:value-of select="$ui-webcontent"/>ccl/i18n/bidi/BidiUtils.js<out:text/>
  434. </out:when>
  435. <out:otherwise>
  436. <out:value-of select="$ui-webcontent"/>../ccl/i18n/bidi/BidiUtils.js<out:text/>
  437. </out:otherwise>
  438. </out:choose>
  439. </out:attribute>
  440. </script>
  441. <script language="javascript">
  442. var isBidiEnabled = <out:value-of select="boolean($ui-portlet-isBidiEnabled='true')"/>;
  443. if (isBidiEnabled){
  444. var bidi = BidiUtils.getInstance();
  445. bidi.setProperties('<out:value-of select="$ui-portlet-baseTextDirection"/>',
  446. '<out:value-of select="xtsext:getBTD('', $ui-portlet-baseTextDirection, $ui-portlet-product-locale)"/>',
  447. '<out:value-of select="$ui-portlet-product-locale"/>');
  448. }
  449. </script>
  450. <table border="0" cellspacing="0" cellpadding="2" width="100%" role="presentation">
  451. <tr>
  452. <td>
  453. <table border="0" cellspacing="0" cellpadding="0" width="100%" role="presentation">
  454. <tr>
  455. <!-- Page description -->
  456. <td class="portlet-msg-info" valign="middle" align="left" style="padding-left: 3px;">
  457. <xsl:copy-of select="ui:page-description/child::node()"/>
  458. </td>
  459. <!-- Links -->
  460. <td align="right"><img alt="" src="{ '{ $ui-producer-images }space.gif'}" width="5" height="1"/></td>
  461. <td class="portlet-form-field" align="right" valign="top">
  462. <a class="cognos-anchor" href="javascript:wsrp_rewrite_doAbout();"><xts:string id="IDS_PRO_HTM_ABOUT_LINK"/></a>
  463. <out:value-of select="$ui-portal-info/layout/linkSeparator"/>
  464. <a class="cognos-anchor" href="javascript:wsrp_rewrite_doHelp();"><xts:string id="IDS_PRO_HTM_HELP_LINK"/></a>
  465. <br/>
  466. </td>
  467. </tr>
  468. </table>
  469. </td>
  470. </tr>
  471. <out:if test="contains( $ui-buttons-location, 'top' )">
  472. <tr>
  473. <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap">
  474. <br/>
  475. <xsl:choose>
  476. <xsl:when test="ui:buttons">
  477. <xsl:for-each select="ui:buttons/*">
  478. <div class="cognos-form-footer-button-area" style="display:inline">
  479. <xsl:apply-templates select="."/>
  480. </div>
  481. </xsl:for-each>
  482. </xsl:when>
  483. <xsl:otherwise>
  484. <xsl:call-template name="ui-gen-save-scripts"/>
  485. <div class="cognos-form-footer-button-area" style="display:inline">
  486. <xsl:call-template name="ui-gen-button">
  487. <xsl:with-param name="name" select="'Save'"/>
  488. <xsl:with-param name="more" select="true()"/>
  489. </xsl:call-template>
  490. </div>
  491. <div class="cognos-form-footer-button-area" style="display:inline">
  492. <xsl:call-template name="ui-gen-button">
  493. <xsl:with-param name="name" select="'Cancel'"/>
  494. <xsl:with-param name="more" select="true()"/>
  495. </xsl:call-template>
  496. </div>
  497. <out:if test="/root/portlet/consumer/@id != 'cognos'">
  498. <div class="cognos-form-footer-button-area" style="display:inline">
  499. <xsl:call-template name="ui-gen-button">
  500. <xsl:with-param name="name" select="'Reset'"/>
  501. <xsl:with-param name="more" select="false()"/>
  502. </xsl:call-template>
  503. </div>
  504. </out:if>
  505. </xsl:otherwise>
  506. </xsl:choose>
  507. </td>
  508. </tr>
  509. </out:if>
  510. </table>
  511. <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-section|text()|processing-instruction()"/>
  512. <out:if test="contains( $ui-buttons-location, 'bottom' )">
  513. <table border="0" cellspacing="0" cellpadding="2" width="100%" class="cognos-form-footer" style="vertical-align:bottom" role="presentation">
  514. <tr>
  515. <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap">
  516. <div class="cognos-form-footer-area">
  517. <xsl:choose>
  518. <xsl:when test="ui:buttons">
  519. <xsl:for-each select="ui:buttons/*">
  520. <div class="cognos-form-footer-button-area" style="display:inline">
  521. <xsl:apply-templates select="."/>
  522. </div>
  523. </xsl:for-each>
  524. </xsl:when>
  525. <xsl:otherwise>
  526. <xsl:call-template name="ui-gen-save-scripts"/>
  527. <div class="cognos-form-footer-button-area" style="display:inline">
  528. <xsl:call-template name="ui-gen-button">
  529. <xsl:with-param name="name" select="'Save'"/>
  530. <xsl:with-param name="more" select="true()"/>
  531. </xsl:call-template>
  532. </div>
  533. <div class="cognos-form-footer-button-area" style="display:inline">
  534. <xsl:call-template name="ui-gen-button">
  535. <xsl:with-param name="name" select="'Cancel'"/>
  536. <xsl:with-param name="more" select="true()"/>
  537. </xsl:call-template>
  538. </div>
  539. <out:if test="/root/portlet/consumer/@id != 'cognos'">
  540. <div class="cognos-form-footer-button-area" style="display:inline">
  541. <xsl:call-template name="ui-gen-button">
  542. <xsl:with-param name="name" select="'Reset'"/>
  543. <xsl:with-param name="more" select="false()"/>
  544. </xsl:call-template>
  545. </div>
  546. </out:if>
  547. </xsl:otherwise>
  548. </xsl:choose>
  549. </div>
  550. </td>
  551. </tr>
  552. </table>
  553. </out:if>
  554. </xsl:template>
  555. <!-- ui:page-description , only allowed in ui:page -->
  556. <xsl:template match="ui:page-description" priority="1">
  557. <xsl:choose>
  558. <xsl:when test="parent::ui:page">
  559. <!-- Let parent handle it -->
  560. </xsl:when>
  561. <xsl:otherwise>
  562. <xsl:call-template name="ui-compile-error">
  563. <xsl:with-param name="errno">0002</xsl:with-param>
  564. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  565. </xsl:call-template>
  566. </xsl:otherwise>
  567. </xsl:choose>
  568. </xsl:template>
  569. <!--
  570. ui:page-section
  571. Ancestors must have a ui:page.
  572. Output : <table> ... </table>
  573. -->
  574. <xsl:template match="ui:page-section" priority="1">
  575. <xsl:choose>
  576. <xsl:when test="ancestor::ui:page">
  577. <table width="100%" cellspacing="0" cellpadding="0" border="0" role="presentation">
  578. <!-- Add space before section -->
  579. <tr>
  580. <td width="100%" height="10">
  581. <img width="1" height="5" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
  582. </td>
  583. </tr>
  584. <!-- Add the section divider if it exists -->
  585. <xsl:if test="ui:page-section-divider">
  586. <tr>
  587. <td>
  588. <table width="100%" cellspacing="0" cellpadding="0" border="0" role="presentation">
  589. <tr>
  590. <td style="padding-left: 8px;" class="portlet-form-field-label" nowrap="nowrap"><xsl:copy-of select="ui:page-section-divider/child::node()"/>&#160;</td>
  591. <td width="100%"><hr size="1"/></td>
  592. </tr>
  593. <!-- Add the section description if it exists -->
  594. <xsl:choose>
  595. <xsl:when test="ui:page-section-desc">
  596. <tr>
  597. <td colspan="2" class="portlet-msg-info" style="padding-left: 8px;padding-top: 2px;padding-bottom:2px;"><xsl:copy-of select="ui:page-section-desc/child::node()"/></td>
  598. </tr>
  599. </xsl:when>
  600. <xsl:otherwise>
  601. <tr>
  602. <td width="1" height="5" colspan="2">
  603. <img width="1" height="2" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
  604. </td>
  605. </tr>
  606. </xsl:otherwise>
  607. </xsl:choose>
  608. </table>
  609. </td>
  610. </tr>
  611. </xsl:if>
  612. <!-- If the section does not have a divider, put the groups in here -->
  613. <xsl:if test="not (ui:page-section-divider)">
  614. <tr>
  615. <td style="padding-left: 8px;" class="portlet-form-field" nowrap="nowrap">
  616. <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-sub-section-group|text()|processing-instruction()"/>
  617. </td>
  618. </tr>
  619. </xsl:if>
  620. </table>
  621. <!-- If we have a divider, we render the content differently -->
  622. <xsl:if test="ui:page-section-divider">
  623. <table width="100%" cellspacing="0" cellpadding="3" border="0" role="presentation">
  624. <tr>
  625. <td width="1" height="1">
  626. <img width="1" height="1" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
  627. </td>
  628. <td width="100%">
  629. <table cellspacing="0" cellpadding="1" border="0" width="100%" role="presentation">
  630. <tr>
  631. <td>
  632. <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-sub-section-group|text()|processing-instruction()"/>
  633. </td>
  634. </tr>
  635. </table>
  636. </td>
  637. </tr>
  638. </table>
  639. </xsl:if>
  640. </xsl:when>
  641. <xsl:otherwise>
  642. <xsl:call-template name="ui-compile-error">
  643. <xsl:with-param name="errno">0003</xsl:with-param>
  644. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  645. </xsl:call-template>
  646. </xsl:otherwise>
  647. </xsl:choose>
  648. </xsl:template>
  649. <xsl:template match="ui:page-section-divider" priority="1">
  650. <xsl:choose>
  651. <xsl:when test="ui:page-section">
  652. <!-- Let the parent handle it -->
  653. </xsl:when>
  654. <xsl:otherwise>
  655. <xsl:call-template name="ui-compile-error">
  656. <xsl:with-param name="errno">0004</xsl:with-param>
  657. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  658. </xsl:call-template>
  659. </xsl:otherwise>
  660. </xsl:choose>
  661. </xsl:template>
  662. <xsl:template match="ui:page-section-desc" priority="1">
  663. <xsl:choose>
  664. <xsl:when test="ui:page-section">
  665. <!-- Let the parent handle it -->
  666. </xsl:when>
  667. <xsl:otherwise>
  668. <xsl:call-template name="ui-compile-error">
  669. <xsl:with-param name="errno">0005</xsl:with-param>
  670. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  671. </xsl:call-template>
  672. </xsl:otherwise>
  673. </xsl:choose>
  674. </xsl:template>
  675. <xsl:template match="ui:page-sub-section-group" priority="1">
  676. <table cellspacing="0" cellpadding="1" border="0" width="100%" role="presentation">
  677. <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-sub-section|ui:admin-settings|text()|processing-instruction()"/>
  678. </table>
  679. </xsl:template>
  680. <xsl:template match="ui:page-sub-section" priority="1">
  681. <xsl:choose>
  682. <xsl:when test="(ancestor::ui:page-section)">
  683. <!-- Handle the title of the group -->
  684. <xsl:if test="ui:page-sub-section-title">
  685. <tr>
  686. <td nowrap="" class="portlet-form-field-label">
  687. <xsl:copy-of select="ui:page-sub-section-title/child::node()"/>
  688. </td>
  689. </tr>
  690. </xsl:if>
  691. <xsl:if test="ui:page-sub-section-desc">
  692. <tr>
  693. <td nowrap="" class="portlet-msg-info">
  694. <xsl:copy-of select="ui:page-sub-section-desc/child::node()"/>
  695. </td>
  696. </tr>
  697. </xsl:if>
  698. <tr>
  699. <td>
  700. <xsl:apply-templates select="ui:page-sub-section-content/*|ui:page-sub-section-content/text()|ui:page-sub-section-content/processing-instruction()"/>
  701. </td>
  702. </tr>
  703. <xsl:if test="not (@tailing-space ='false')">
  704. <tr>
  705. <td nowrap="">
  706. <img width="1" height="2" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
  707. </td>
  708. </tr>
  709. </xsl:if>
  710. </xsl:when>
  711. <xsl:otherwise>
  712. <!-- error -->
  713. <xsl:call-template name="ui-compile-error">
  714. <xsl:with-param name="errno">0006</xsl:with-param>
  715. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  716. </xsl:call-template>
  717. </xsl:otherwise>
  718. </xsl:choose>
  719. </xsl:template>
  720. <xsl:template match="ui:page-sub-section-title" priority="1">
  721. <xsl:choose>
  722. <xsl:when test="parent::ui:page-sub-section">
  723. <!-- Let the parent handle it -->
  724. </xsl:when>
  725. <xsl:otherwise>
  726. <!-- error -->
  727. <xsl:call-template name="ui-compile-error">
  728. <xsl:with-param name="errno">0007</xsl:with-param>
  729. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  730. </xsl:call-template>
  731. </xsl:otherwise>
  732. </xsl:choose>
  733. </xsl:template>
  734. <xsl:template match="ui:page-sub-section-desc" priority="1">
  735. <xsl:choose>
  736. <xsl:when test="parent::ui:page-sub-section">
  737. <!-- Let the parent handle it -->
  738. </xsl:when>
  739. <xsl:otherwise>
  740. <!-- error -->
  741. <xsl:call-template name="ui-compile-error">
  742. <xsl:with-param name="errno">0008</xsl:with-param>
  743. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  744. </xsl:call-template>
  745. </xsl:otherwise>
  746. </xsl:choose>
  747. </xsl:template>
  748. <xsl:template match="ui:page-sub-section-content" priority="1">
  749. <xsl:choose>
  750. <xsl:when test="parent::ui:page-sub-section">
  751. <!-- Let the parent handle it -->
  752. </xsl:when>
  753. <xsl:otherwise>
  754. <!-- error -->
  755. <xsl:call-template name="ui-compile-error">
  756. <xsl:with-param name="errno">0009</xsl:with-param>
  757. <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
  758. </xsl:call-template>
  759. </xsl:otherwise>
  760. </xsl:choose>
  761. </xsl:template>
  762. <!--
  763. =-=-=-=-=-=-=-=-=-=-=-=-=-=
  764. ui:wizard
  765. -->
  766. <xsl:template match="ui:wizard" priority="1">
  767. <out:variable name="ui-portal-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
  768. <out:variable name="ui-portal-info" select="/root/portlet/consumer"/>
  769. <out:variable name="ui-buttons-location" select="$ui-portal-info[1]/layout/buttons/@location"/>
  770. <out:variable name="ui-buttons-align">
  771. <out:choose>
  772. <out:when test="contains( $ui-buttons-location, 'right' )">right</out:when>
  773. <out:otherwise>left</out:otherwise>
  774. </out:choose>
  775. </out:variable>
  776. <table border="0" cellspacing="0" cellpadding="2" width="100%" role="presentation">
  777. <tr class="portlet-section-header">
  778. <td class="portlet-font" style="font-size:larger" colspan="2">
  779. <out:value-of select="{@ui:portlet}"/>
  780. </td>
  781. </tr>
  782. <tr class="portlet-section-subheader">
  783. <td class="portlet-font" colspan="2">
  784. <b><xts:string id="IDS_PRO_CUI_WIZARD"/></b>
  785. </td>
  786. </tr>
  787. <tr>
  788. <td class="portlet-form-label">
  789. <xsl:choose>
  790. <xsl:when test="ui:header">
  791. <xsl:apply-templates select="ui:header/child::node()"/>
  792. </xsl:when>
  793. <xsl:otherwise>
  794. <out:choose>
  795. <out:when test="$ui-mode = 'cps:config'">
  796. <out:text/><xts:string id="IDS_PRO_HTM_ADMIN_DESC"><xts:param name="name"><out:value-of select="{@ui:portlet}"/></xts:param></xts:string>
  797. </out:when>
  798. <out:otherwise>
  799. <out:text/><xts:string id="IDS_PRO_HTM_USER_DESC"><xts:param name="name"><out:value-of select="{@ui:portlet}"/></xts:param></xts:string><out:text/>
  800. </out:otherwise>
  801. </out:choose>
  802. </xsl:otherwise>
  803. </xsl:choose>
  804. </td>
  805. <td class="portlet-font" align="right">
  806. <a class="cognos-anchor" href="javascript:wsrp_rewrite_doAbout();"><xts:string id="IDS_PRO_HTM_ABOUT_LINK"/></a>
  807. <out:value-of select="$ui-consumer-info/layout/linkSeparator"/>
  808. <a class="cognos-anchor" href="javascript:wsrp_rewrite_doHelp();"><xts:string id="IDS_PRO_HTM_HELP_LINK"/></a>
  809. <br/><br/>
  810. </td>
  811. </tr>
  812. <out:if test="contains( $ui-buttons-location, 'top' )">
  813. <tr>
  814. <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap" colspan="2">
  815. <xsl:choose>
  816. <xsl:when test="ui:buttons">
  817. <xsl:for-each select="ui:buttons/*">
  818. <div class="cognos-form-footer-button-area" style="display:inline">
  819. <xsl:apply-templates select="."/>
  820. </div>
  821. </xsl:for-each>
  822. </xsl:when>
  823. <xsl:otherwise>
  824. <xsl:call-template name="ui-gen-save-scripts"/>
  825. <div class="cognos-form-footer-button-area" style="display:inline">
  826. <xsl:call-template name="ui-gen-button">
  827. <xsl:with-param name="name" select="'Cancel'"/>
  828. <xsl:with-param name="more" select="true()"/>
  829. </xsl:call-template>
  830. </div>
  831. <div class="cognos-form-footer-button-area" style="display:inline">
  832. <xsl:call-template name="ui-gen-button">
  833. <xsl:with-param name="name" select="'Back'"/>
  834. <xsl:with-param name="more" select="true()"/>
  835. </xsl:call-template>
  836. </div>
  837. <div class="cognos-form-footer-button-area" style="display:inline">
  838. <xsl:call-template name="ui-gen-button">
  839. <xsl:with-param name="name" select="'Next'"/>
  840. <xsl:with-param name="more" select="true()"/>
  841. </xsl:call-template>
  842. </div>
  843. <div class="cognos-form-footer-button-area" style="display:inline">
  844. <xsl:call-template name="ui-gen-button">
  845. <xsl:with-param name="name" select="'Finish'"/>
  846. <xsl:with-param name="more" select="false()"/>
  847. </xsl:call-template>
  848. </div>
  849. </xsl:otherwise>
  850. </xsl:choose>
  851. </td>
  852. </tr>
  853. </out:if>
  854. </table>
  855. <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/ui/1/']|text()|processing-instruction()"/>
  856. <out:if test="contains( $ui-buttons-location, 'bottom' )">
  857. <table border="0" cellspacing="0" cellpadding="2" width="100%" style="border-top:solid 1px #cccccc" class="cognos-form-footer" role="presentation" >
  858. <tr>
  859. <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap" colspan="2">
  860. <div class="cognos-form-footer-area">
  861. <xsl:choose>
  862. <xsl:when test="ui:buttons">
  863. <xsl:apply-templates select="ui:buttons/ui:button"/>
  864. </xsl:when>
  865. <xsl:otherwise>
  866. <div class="cognos-form-footer-button-area" style="display:inline">
  867. <xsl:call-template name="ui-gen-button">
  868. <xsl:with-param name="name" select="'Cancel'"/>
  869. <xsl:with-param name="more" select="true()"/>
  870. </xsl:call-template>
  871. </div>
  872. <div class="cognos-form-footer-button-area" style="display:inline">
  873. <xsl:call-template name="ui-gen-button">
  874. <xsl:with-param name="name" select="'Back'"/>
  875. <xsl:with-param name="more" select="true()"/>
  876. </xsl:call-template>
  877. </div>
  878. <div class="cognos-form-footer-button-area" style="display:inline">
  879. <xsl:call-template name="ui-gen-button">
  880. <xsl:with-param name="name" select="'Next'"/>
  881. <xsl:with-param name="more" select="true()"/>
  882. </xsl:call-template>
  883. </div>
  884. <div class="cognos-form-footer-button-area" style="display:inline">
  885. <xsl:call-template name="ui-gen-button">
  886. <xsl:with-param name="name" select="'Finish'"/>
  887. <xsl:with-param name="more" select="false()"/>
  888. </xsl:call-template>
  889. </div>
  890. </xsl:otherwise>
  891. </xsl:choose>
  892. </div>
  893. </td>
  894. </tr>
  895. </table>
  896. </out:if>
  897. </xsl:template>
  898. <xsl:template match="ui:error" priority="1">
  899. <xsl:choose>
  900. <xsl:when test="not(@message)">
  901. <xsl:call-template name="ui-compile-error">
  902. <xsl:with-param name="errno">0010</xsl:with-param>
  903. <xsl:with-param name="errmsg">Missing mandatory attribute: message (xsd:string)</xsl:with-param>
  904. </xsl:call-template>
  905. </xsl:when>
  906. <xsl:otherwise>
  907. <out:variable name="error-code" select="substring-before({@message}, ' ')"/>
  908. <out:variable name="error-msg" select="substring-after({@message}, ' ')"/>
  909. <table role="presentation">
  910. <tr>
  911. <td colspan="2" class="portlet-msg-info">
  912. <out:value-of select="$error-code"/>
  913. </td>
  914. </tr>
  915. <tr>
  916. <td>
  917. <img src="{ '{ $ui-producer-images }dialog_error.gif'}" width="32" height="32" border="0"/>
  918. </td>
  919. <td class="portlet-msg-error">
  920. <out:value-of select="$error-msg"/>
  921. </td>
  922. </tr>
  923. </table>
  924. </xsl:otherwise>
  925. </xsl:choose>
  926. </xsl:template>
  927. <xsl:template match="ui:header" priority="1"/>
  928. <!--
  929. -=-=-=-=-=-=-=-=-=-=-=-=-
  930. -->
  931. <xsl:template match="ui:button" name="ui-gen-button" priority="1">
  932. <xsl:param name="name" select="@name"/>
  933. <xsl:param name="more" select="position() != last()"/>
  934. <out:variable name="text-{$name}"><xts:string id="IDS_PRO_CUI_BTN_{ translate( $name, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) }"/></out:variable>
  935. <out:variable name="padding-text-{$name}">
  936. <out:if test="string-length($text-{$name}) &lt; 8 and contains($ui-markups/wsrp:clientData/wsrp:userAgent, 'Mozilla/5.0')">
  937. <out:value-of select="substring(' ', 1, floor((8 - string-length($text-{$name})) div 2) )"/>
  938. </out:if>
  939. </out:variable>
  940. <out:variable name="patched-text-{$name}">
  941. <out:value-of select="$padding-text-{$name}"/><out:value-of select="$text-{$name}"/><out:value-of select="$padding-text-{$name}"/>
  942. </out:variable>
  943. <input class="portlet-form-button" onclick="javascript:wsrp_rewrite_do{ $name }{ ../@suffix }();" type="button" name="{ $name }" value="{'{'}$patched-text-{$name}{'}'}"/>
  944. <xsl:if test="$more = true()">
  945. <out:text>&#160;</out:text>
  946. </xsl:if>
  947. </xsl:template>
  948. <xsl:template match="ui:admin-settings" priority="1">
  949. <out:variable name="userCategory" select="/root/cookies/cookie[@name = 'userCategory']"/>
  950. <out:if test="($userCategory = 'administrator' and $ui-mode != 'cps:config')">
  951. <tr>
  952. <td class="portlet-form-field-label"><xts:string id="IDS_PRO_HTM_LABEL_ADMIN_SETTINGS"/></td>
  953. </tr>
  954. <tr>
  955. <td class="portlet-font">
  956. <script language="javascript">
  957. function wsrp_rewrite_doConfig() {
  958. <utml:rewrite-render utml:mode="cps:config"/>
  959. }
  960. </script>
  961. <a class="cognos-anchor" href="javascript:wsrp_rewrite_doConfig();"><xts:string id="IDS_PRO_HTM_LABEL_ADMIN_SAVE_GLOBAL"/></a>
  962. </td>
  963. </tr>
  964. </out:if>
  965. </xsl:template>
  966. <xsl:template match="ui:maximize-scripts" priority="1">
  967. <xsl:choose>
  968. <xsl:when test="not (@ui:objectId or ui:objectId)">
  969. <xsl:call-template name="ui-compile-error">
  970. <xsl:with-param name="errno">011</xsl:with-param>
  971. <xsl:with-param name="errmsg">The @objectId attribute is required</xsl:with-param>
  972. </xsl:call-template>
  973. </xsl:when>
  974. <xsl:when test="not (ancestor::*/ui:browser)">
  975. <xsl:call-template name="ui-compile-error">
  976. <xsl:with-param name="errno">012</xsl:with-param>
  977. <xsl:with-param name="errmsg">ui:browser must be called first to initialize the browser variables</xsl:with-param>
  978. </xsl:call-template>
  979. </xsl:when>
  980. <xsl:otherwise>
  981. <out:if test="$ui-window-state = 'wsrp:maximized'">
  982. <script>
  983. function wsrp_rewrite_toInt(value, defaultValue){
  984. var nValue = parseInt(value);
  985. if (isNaN(nValue)){
  986. if (defaultValue){
  987. return defaultValue;
  988. }
  989. return 0;
  990. }
  991. return nValue;
  992. }
  993. function wsrp_rewrite_getStyle(obj){
  994. try {
  995. if (document.defaultView &amp;&amp; document.defaultView.getComputedStyle){
  996. return document.defaultView.getComputedStyle(obj, null);
  997. }
  998. else if (obj.currentStyle){
  999. return obj.currentStyle;
  1000. }
  1001. } catch (e){}
  1002. return obj.style;
  1003. }
  1004. function wsrp_rewrite_getTop(obj) {
  1005. var curtop = 0;
  1006. try {
  1007. if (obj.offsetParent) {
  1008. while (obj.offsetParent) {
  1009. curtop += obj.offsetTop
  1010. obj = obj.offsetParent;
  1011. }
  1012. }
  1013. else if (obj.y) {
  1014. curtop += obj.y;
  1015. }
  1016. }catch (e) {}
  1017. return curtop;
  1018. }
  1019. function wsrp_rewrite_getWindowHeight(){
  1020. if( typeof( window.innerHeight ) == 'number' ) {
  1021. return window.innerHeight;
  1022. } else if( document.documentElement &amp;&amp; document.documentElement.clientHeight ) {
  1023. return document.documentElement.clientHeight;
  1024. } else if( document.body &amp;&amp; document.body.clientHeight ) {
  1025. return document.body.clientHeight;
  1026. }
  1027. }
  1028. <!--
  1029. This method will find the last sibling thatthe atucal position in the layout is below the object in question.
  1030. -->
  1031. function wsrp_rewrite_getLastSiblingPositionedBelow(obj) {
  1032. var lastValidSibling = null;
  1033. var sibling = obj.nextSibling;
  1034. while (sibling != null ) {
  1035. if (sibling.tagName != null){
  1036. var siblingStyle = wsrp_rewrite_getStyle(sibling);
  1037. var isVisible = siblingStyle.display.toLowerCase() != "none" ;
  1038. var isRelative = siblingStyle.position.toLowerCase() != "absolute" ;
  1039. if (sibling.offsetHeight != null &amp;&amp; isVisible &amp;&amp; isRelative){
  1040. var isSiblingPlacedBelow = wsrp_rewrite_getTop(obj) + obj.offsetHeight &lt;= wsrp_rewrite_getTop(sibling);
  1041. if (isSiblingPlacedBelow){
  1042. <!-- This sibling is visible and does not have absolute positioning and is located below the object -->
  1043. obj = sibling;
  1044. lastValidSibling = sibling;
  1045. }
  1046. }
  1047. }
  1048. sibling = sibling.nextSibling;
  1049. }
  1050. return lastValidSibling;
  1051. }
  1052. function wsrp_rewrite_getExtraBottomContent(obj) {
  1053. var extraContentHeight;
  1054. var lastSibling = wsrp_rewrite_getLastSiblingPositionedBelow(obj);
  1055. if (lastSibling != null){
  1056. var distance = wsrp_rewrite_getTop(lastSibling) - wsrp_rewrite_getTop(obj) - obj.offsetHeight;
  1057. extraContentHeight = distance +
  1058. wsrp_rewrite_toInt(wsrp_rewrite_getStyle(lastSibling).marginTop) +
  1059. lastSibling.offsetHeight +
  1060. wsrp_rewrite_toInt(wsrp_rewrite_getStyle(lastSibling).marginBottom)
  1061. }
  1062. else{
  1063. extraContentHeight = wsrp_rewrite_toInt(wsrp_rewrite_getStyle(obj).marginBottom)
  1064. }
  1065. var parent = obj.parentNode;
  1066. if (parent &amp;&amp; obj != document.body) {
  1067. var parentStyle = wsrp_rewrite_getStyle(parent);
  1068. <!-- If this is a cell in a table, we will need to calculate the space take by the "cellspacing"-->
  1069. if (obj.parentNode != null &amp;&amp; obj.offsetParent != null &amp;&amp; obj.parentNode.rowIndex != null &amp;&amp; obj.offsetParent.cellSpacing != null &amp;&amp; obj.offsetParent.rows != null){
  1070. var cellspacing = wsrp_rewrite_toInt(obj.offsetParent.cellSpacing, 2) * (obj.offsetParent.rows.length - obj.parentNode.rowIndex );
  1071. extraContentHeight += cellspacing;
  1072. }
  1073. extraContentHeight += wsrp_rewrite_toInt(parentStyle.paddingBottom) + wsrp_rewrite_toInt(parentStyle.borderBottomWidth);
  1074. extraContentHeight += wsrp_rewrite_getExtraBottomContent(parent);
  1075. }
  1076. return extraContentHeight;
  1077. }
  1078. var wsrp_rewrite_minHeight = 100;
  1079. function wsrp_rewrite_getNewHeight(id) {
  1080. try {
  1081. var eDiv= document.getElementById(id);
  1082. if (eDiv != null) {
  1083. var newHeight = wsrp_rewrite_getWindowHeight() - wsrp_rewrite_getTop( eDiv) - wsrp_rewrite_getExtraBottomContent(eDiv) ;
  1084. if (newHeight &lt; wsrp_rewrite_minHeight){
  1085. newHeight = wsrp_rewrite_minHeight;
  1086. }
  1087. <out:if test="$ui-browser != 'ie'">
  1088. <!-- Mozilla does not inlcude the border in the height , so let's take into account the border thickness-->
  1089. var runtimeStyle = wsrp_rewrite_getStyle(eDiv);
  1090. if (runtimeStyle){
  1091. if (runtimeStyle.borderTopWidth){
  1092. newHeight -= wsrp_rewrite_toInt(runtimeStyle.borderTopWidth);
  1093. }
  1094. if (runtimeStyle.borderBottomWidth){
  1095. newHeight -= wsrp_rewrite_toInt(runtimeStyle.borderBottomWidth);
  1096. }
  1097. }
  1098. </out:if>
  1099. return newHeight;
  1100. }
  1101. }catch(e){}
  1102. }
  1103. function wsrp_rewrite_setHeight(id, newHeight, refresh){
  1104. var eDiv= document.getElementById(id);
  1105. if (eDiv != null) {
  1106. <!--
  1107. when used in myportlal with firefox , it is off by 2 pixels.
  1108. I'm not sure what we are missing.. but it is easier for now to substract 2 pixel than track it down.
  1109. -->
  1110. newHeight -= 2;
  1111. eDiv.style.height = newHeight + "px";
  1112. <out:if test="$ui-browser != 'ie'">
  1113. if (refresh){
  1114. <!-- mozilla has some redrawing problems. This will force it to redraw, not sure why but it seems to work -->
  1115. var oldBorderColor = eDiv.style.borderColor;
  1116. var oldBorderWidth = eDiv.style.borderWidth;
  1117. eDiv.style.borderWidth="1";
  1118. eDiv.style.borderColor="transparent";
  1119. setTimeout("document.getElementById(\""+id+"\").style.borderWidth = \""+oldBorderWidth+"\"" ,1);
  1120. setTimeout("document.getElementById(\""+id+"\").style.borderColor = \""+oldBorderColor+"\"" ,1);
  1121. }
  1122. </out:if>
  1123. }
  1124. }
  1125. function wsrp_rewrite_resize_main() {
  1126. var newHeight;
  1127. <xsl:for-each select="@ui:objectId | ui:objectId">
  1128. newHeight = wsrp_rewrite_getNewHeight("<xsl:value-of select="."/>");
  1129. <xsl:if test="./@ui:callback">
  1130. <xsl:value-of select="./@ui:callback"/>(newHeight);
  1131. </xsl:if>
  1132. wsrp_rewrite_setHeight("<xsl:value-of select="."/>", newHeight, true);
  1133. </xsl:for-each>
  1134. }
  1135. function wsrp_rewrite_attachEvent(e, obj, f){
  1136. if (obj){
  1137. if (obj.attachEvent){
  1138. obj.attachEvent("on" + e,f);
  1139. }
  1140. else if (obj.addEventListener){
  1141. obj.addEventListener(e, f, null);
  1142. }
  1143. }
  1144. }
  1145. <out:if test="$ui-is-myportal">
  1146. <!--
  1147. if we are in a dashboard, we need to attach the resize event to the object onload event if there is one.
  1148. If we don't do this, the object will not resize when the portlet is displayed in the dashboard because
  1149. the dashboard does not do a full window reload so the window onload event will not kick in.
  1150. -->
  1151. <xsl:for-each select="@ui:objectId | ui:objectId">
  1152. wsrp_rewrite_load_resized = false;
  1153. wsrp_rewrite_attachEvent("load", document.getElementById("<xsl:value-of select="."/>") ,
  1154. function(){
  1155. if (!wsrp_rewrite_load_resized &amp;&amp; document.readyState == "complete"){
  1156. wsrp_rewrite_load_resized = true;
  1157. wsrp_rewrite_resize_main();
  1158. }
  1159. }
  1160. );
  1161. <!-- This is to handle loading ActiveX objects like ppt files in IE .. -->
  1162. wsrp_rewrite_attachEvent("readystatechange", document.getElementById("<xsl:value-of select="."/>") ,
  1163. function(){
  1164. if (document.readyState=="complete" &amp;&amp; !wsrp_rewrite_load_resized){
  1165. wsrp_rewrite_load_resized = true;
  1166. wsrp_rewrite_resize_main();
  1167. }
  1168. });
  1169. </xsl:for-each>
  1170. </out:if>
  1171. wsrp_rewrite_attachEvent("load", window, wsrp_rewrite_resize_main);
  1172. wsrp_rewrite_attachEvent("resize", window, wsrp_rewrite_resize_main);
  1173. </script>
  1174. </out:if>
  1175. </xsl:otherwise>
  1176. </xsl:choose>
  1177. </xsl:template>
  1178. <xsl:template match="ui:save-scripts" name="ui-gen-save-scripts" priority="1">
  1179. <xsl:variable name="ui-overwrite-mode">
  1180. <xsl:choose>
  1181. <xsl:when test="@ui:mode">
  1182. <xsl:value-of select="@ui:mode"/>
  1183. </xsl:when>
  1184. <xsl:otherwise>wsrp:view</xsl:otherwise>
  1185. </xsl:choose>
  1186. </xsl:variable>
  1187. <xsl:variable name="ui-urlType">
  1188. <xsl:choose>
  1189. <xsl:when test="@ui:urlType">
  1190. <xsl:value-of select="@ui:urlType"/>
  1191. </xsl:when>
  1192. <xsl:otherwise>blockingAction</xsl:otherwise>
  1193. </xsl:choose>
  1194. </xsl:variable>
  1195. <script language="javascript">
  1196. function wsrp_rewrite_doReset() {
  1197. wsrp_rewrite_saveHelper(true);
  1198. }
  1199. function wsrp_rewrite_doSave() {
  1200. wsrp_rewrite_saveHelper(false);
  1201. }
  1202. function wsrp_rewrite_doCancel() {
  1203. <utml:rewrite-render/>
  1204. }
  1205. function wsrp_rewrite_saveHelper(reset) {
  1206. if (reset) {
  1207. if (!window.confirm("<xts:string id="IDS_PRO_HTM_PROMPT_REVERT" encode="javascript"/>")) {
  1208. return;
  1209. }
  1210. <utml:form-submit
  1211. utml:mode="{$ui-overwrite-mode}"
  1212. utml:operation="reset"
  1213. utml:validate="false"/>
  1214. } else {
  1215. <utml:form-submit
  1216. utml:mode="wsrp:view"
  1217. utml:operation="save"
  1218. utml:urlType="{$ui-urlType}"
  1219. utml:validate="true"/>
  1220. }
  1221. }
  1222. </script>
  1223. </xsl:template>
  1224. <xsl:template match="ui:add-hidden-opacity-style" priority="1">
  1225. <out:attribute name="style">filter:alpha(opacity=40);opacity:0.4;-moz-opacity:0.4;</out:attribute>
  1226. </xsl:template>
  1227. <xsl:template match="ui:*" priority="0">
  1228. <xsl:call-template name="ui-compile-error">
  1229. <xsl:with-param name="errno">0100</xsl:with-param>
  1230. <xsl:with-param name="errmsg">Unsupported logicsheet tag: <xsl:value-of select="local-name(.)"/></xsl:with-param>
  1231. </xsl:call-template>
  1232. </xsl:template>
  1233. <xsl:template name="ui-compile-error">
  1234. <xsl:param name="errno"/>
  1235. <xsl:param name="errmsg"/>
  1236. <xsl:message>
  1237. <xsl:text>CPS-ERR-</xsl:text>
  1238. <xsl:value-of select="$errno"/>
  1239. <xsl:text>: </xsl:text>
  1240. <xsl:value-of select="$errmsg"/>
  1241. <xsl:text>.</xsl:text>
  1242. </xsl:message>
  1243. <xsl:message terminate="yes">
  1244. <xsl:text> ...at: </xsl:text>
  1245. <xsl:for-each select="ancestor-or-self::node()[name()!='']">
  1246. <xsl:text>/</xsl:text>
  1247. <xsl:value-of select="name()"/>
  1248. </xsl:for-each>
  1249. </xsl:message>
  1250. </xsl:template>
  1251. <xsl:template match="*|@*|text()|processing-instruction()" priority="-1">
  1252. <xsl:copy>
  1253. <xsl:apply-templates select="*|@*|text()|processing-instruction()"/>
  1254. </xsl:copy>
  1255. </xsl:template>
  1256. </xsl:stylesheet>