123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2017
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!-- $Header: //cpscrn/main/templates/cps4/producer/logicsheets/cps-ui.xslt#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:out="dummy-uri"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
- xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
-
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
-
- <xsl:template match="xsl:stylesheet" priority="1">
- <out:stylesheet
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:crn="http://developer.cognos.com/schemas/crconfig/1/"
- xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
- xmlns:wsrp="urn:oasis:names:tc:wsrp:v1:types"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/">
- <!-- dummy way of copying namespaces -->
- <xsl:for-each select="namespace::*[. != 'http://www.w3.org/1999/XSL/Transform']">
- <xsl:attribute name="{name()}:dummy" namespace="{.}"/>
- </xsl:for-each>
- <!-- copy all attributes, except 'exclude-result-prefixes' -->
- <xsl:apply-templates select="@*[name()!='exclude-result-prefixes']"/>
- <!-- construct an 'exclude-result-prefixes' attribute with the list from the source xslt plus our own list -->
- <xsl:attribute name="exclude-result-prefixes">
- <xsl:if test="@exclude-result-prefixes">
- <xsl:value-of select="@exclude-result-prefixes"/>
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>xts xtsext ui crn utml wsrp SOAP-ENV cps</xsl:text>
- </xsl:attribute>
- <!-- add some useful variables... -->
- <!-- TODO: utml may define the same variables, should grab these instead -->
- <out:variable name="ui-op" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]"/>
- <out:variable name="ui-markups" select="$ui-op/wsrp:markupParams"/>
- <out:variable name="ui-session-params" select="/root/session/param"/>
- <out:variable name="ui-state-params" select="$ui-op/wsrp:portletContext/wsrp:portletState/param"/>
- <out:variable name="ui-registration-params" select="$ui-op/wsrp:registrationContext/wsrp:registrationState/param"/>
- <out:variable name="ui-navigational-params" select="$ui-markups/wsrp:navigationalState/param"/>
- <out:variable name="ui-form-params" select="$ui-op/wsrp:interactionParams/wsrp:formParameters"/>
- <out:variable name="ui-configuration" select="/root/configProps/param[@name='cps']/property"/>
- <out:variable name="ui-system-params" select="/root/system/param"/>
- <out:variable name="ui-mode" select="$ui-markups/wsrp:mode"/>
- <out:variable name="ui-window-state" select="$ui-markups/wsrp:windowState"/>
- <out:variable name="ui-is-cognos-connection" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:portalAgent = 'cognos'"/>
- <out:variable name="ui-is-myportal" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:portalAgent = 'cognosFragmentServer'"/>
- <out:variable name="ui-is-iwidget" select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name='isIWidget'] = 'true'"/>
- <out:variable name="ui-gateway">
- <out:choose>
- <out:when test="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'gatewayURL'] != ''">
- <out:value-of select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'gatewayURL']"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="/root/configProps/param[@name='cps']/property[@name = 'gateway']"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="ui-webcontent">
- <out:choose>
- <out:when test="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'webContentURL'] != ''">
- <out:value-of select="$ui-markups/wsrp:extensions/cps:portalContext/cps:param[@name = 'webContentURL']"/>
- </out:when>
- <out:when test="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = 'webcontent']/crn:value != ''">
- <out:value-of select="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = 'webcontent']/crn:value"/>
- </out:when>
- <out:when test="contains($ui-gateway,'/cgi-bin')">
- <out:value-of select="substring-before($ui-gateway,'/cgi-bin')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$ui-system-params[@name = 'webcontent']"/>
- </out:otherwise>
- </out:choose>
- <out:text>/</out:text>
- </out:variable>
- <out:variable name="ui-producer-images">
- <out:value-of select="$ui-webcontent"/>
- <out:text>.</out:text>
- <out:value-of select="/root/interfaces/interfaceInfo/param[@name = 'extraInfo']"/>
- <out:text>/images/</out:text>
- </out:variable>
- <out:variable name="ui-hide-selector" select="$ui-configuration[@name='cps4.portlet.ui.hide.empty.selector']"/>
- <out:variable name="ui-portlet-product-locale" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>
- <out:variable name="ui-portlet-user-preferences" select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars"/>
- <out:variable name="ui-portlet-isBidiEnabled">
- <out:choose>
- <out:when test="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled']/value != ''">
- <out:value-of select="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled']/value"/>
- </out:when>
- <out:otherwise>false</out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="ui-portlet-baseTextDirection">
- <out:variable name="ui-ns_name">
- <out:value-of select="$ui-portlet-user-preferences/item[name='http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#baseTextDirection']/value"/>
- </out:variable>
- <out:choose>
- <out:when test="$ui-ns_name != ''">
- <out:value-of select="translate(substring-after($ui-ns_name,'#'),'LTRA','ltra')"/>
- </out:when>
- <out:otherwise>auto</out:otherwise>
- </out:choose>
- </out:variable>
- <xsl:apply-templates select="*|text()|processing-instruction()"/>
- <out:template name="ui-get-property">
- <out:param name="property-name"/>
- <out:param name="property-exclude-form-input" select="'true'"/>
- <out:param name="property-exclude-nav-state" select="'false'"/>
- <out:param name="property-exclude-session-state" select="'false'"/>
- <out:param name="property-default" select="''"/>
- <out:choose>
- <!-- level 1: form params (when performBlockingInteraction) -->
- <out:when test="not($property-exclude-form-input = 'true') and ($ui-form-params[@name = string( $property-name )])">
- <out:value-of select="$ui-form-params[@name = string( $property-name )]/wsrp:value"/>
- </out:when>
- <!-- level 2: navigational params -->
- <out:when test="not($property-exclude-nav-state = 'true') and ($ui-navigational-params[@name = string( $property-name )])">
- <out:value-of select="$ui-navigational-params[@name = string( $property-name )]"/>
- </out:when>
- <!-- UTML ONLY: when reloading the page, unchecked checkbox's value are not there -->
- <xsl:if test="/*[namespace-uri()='http://developer.cognos.com/schemas/cps/logic/form/1/']">
- <out:when test="(key('utml-key-params', 'edit_visited') = 'true') and ($property-default != '') and not( key('utml-key-params', string( $property-name )) )">
- <out:value-of select="$property-default"/>
- </out:when>
- </xsl:if>
- <!-- level 3: session states -->
- <out:when test="not($property-exclude-session-state = 'true') and ($ui-session-params[@name = string( $property-name )] != '')">
- <out:value-of select="$ui-session-params[@name = string( $property-name )]"/>
- </out:when>
- <!-- level 4: portlet states -->
- <out:when test="$ui-state-params[@name = string( $property-name )]">
- <out:value-of select="$ui-state-params[@name = string( $property-name )]"/>
- </out:when>
- <!-- level 5: registration params -->
- <out:when test="$ui-registration-params[@name = string( $property-name )] != ''">
- <out:value-of select="$ui-registration-params[@name = string( $property-name )]"/>
- </out:when>
- <!-- level 6: configuration API (either property[@name] or property['CPS']/parameter[@name]) -->
- <out:when test="$ui-configuration[@name = string( $property-name )] != ''">
- <out:value-of select="$ui-configuration[@name = string( $property-name )]"/>
- </out:when>
- <out:when test="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = string( $property-name )]/crn:value != ''">
- <out:value-of select="$ui-configuration[@name = 'CPS']/crn:value/crn:parameter[@name = string( $property-name )]/crn:value"/>
- </out:when>
- <!-- level 7: system params -->
- <out:when test="$ui-system-params[@name = string( $property-name )] != ''">
- <out:value-of select="$ui-system-params[@name = string( $property-name )]"/>
- </out:when>
- <!-- level 8: default in the code -->
- <out:otherwise>
- <out:value-of select="$property-default"/>
- </out:otherwise>
- </out:choose>
- </out:template>
- </out:stylesheet>
- </xsl:template>
-
- <xsl:template match="ui:capabilities" priority="1">
- <out:variable name="userCapabilities" select="/root/envelope/*[local-name()='Envelope']/*[local-name()='Header']/*[local-name()='biBusHeader']/*[local-name()='userCapabilityCache']/*[local-name()='userCapabilities']"/>
-
- <out:variable name="ui-canUseQueryStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseQueryStudio'])"/>
- <out:variable name="ui-canUseReportStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseReportStudio'])"/>
- <out:variable name="ui-canUseCognosViewerRunWithOptions" select="boolean($userCapabilities/*[local-name()='item' and string(.)= 'canUseCognosViewerRunWithOptions'])"/>
- <out:variable name="ui-canUseMetricStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseMetricStudio'])"/>
- <out:variable name="ui-canUseAnalysisStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseAnalysisStudio'])"/>
- <out:variable name="ui-canUseEventStudio" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseEventStudio'])"/>
- <out:variable name="ui-canUseScheduling" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUseScheduling'])"/>
- <out:variable name="ui-canUsePlanningContributor" select="boolean($userCapabilities/*[local-name()='item' and string(.)='canUsePlanningContributor'])"/>
- <out:variable name="ui-canUseIndexSearch" select="false()"/>
- <out:variable name="ui-canUseCMSearch" select="string(/root/configuration/property[@name='portal.disablecmsearch']) != 'true'"/>
-
- </xsl:template>
- <xsl:template match="ui:property" priority="1">
- <xsl:choose>
- <xsl:when test="@name">
- <out:variable name="{ @name }">
- <out:call-template name="ui-get-property">
- <out:with-param name="property-name">
- <xsl:choose>
- <xsl:when test="@select">
- <out:value-of select="{ @select }"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </out:with-param>
- <xsl:if test="@default">
- <out:with-param name="property-default">
- <out:value-of select="{ @default }"/>
- </out:with-param>
- </xsl:if>
- <xsl:if test="@exclude-form-input">
- <out:with-param name="property-exclude-form-input">
- <out:value-of select="{ @exclude-form-input }"/>
- </out:with-param>
- </xsl:if>
- <xsl:if test="@exclude-nav-state">
- <out:with-param name="property-exclude-nav-state">
- <out:value-of select="{ @exclude-nav-state }"/>
- </out:with-param>
- </xsl:if>
- <xsl:if test="@exclude-session-state">
- <out:with-param name="property-exclude-session-state">
- <out:value-of select="{ @exclude-session-state }"/>
- </out:with-param>
- </xsl:if>
- </out:call-template>
- </out:variable>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0001</xsl:with-param>
- <xsl:with-param name="errmsg">Missing mandatory attribute: name (xsd:string)</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ui:create-nav-state" priority="1">
- <out:variable name="{generate-id()}">
- <xsl:apply-templates/>
- </out:variable>
- <out:variable name="{@name}" select="xtsext:validator('prepare','create-nav-state',xtsext:base64encode(string(${generate-id()}), true()))"/>
- </xsl:template>
- <xsl:template match="ui:param" priority="1">
- <out:text/><param name="<xsl:value-of select="@name"/>"><out:text/>
- <xsl:apply-templates/>
- <out:text/></param><out:text/>
- </xsl:template>
- <xsl:template match="ui:preview" priority="1"/>
- <!-- helper function: creates a doHelp() javascript function to invoke the help page -->
- <xsl:template match="ui:help" name="ui-help" priority="1">
- <out:variable name="tmp-context">
- <out:text>IDH_</out:text>
- <out:if test="$ui-is-cognos-connection or $ui-is-myportal">
- <out:text>COGNOS_</out:text>
- </out:if>
- <out:value-of select="/root/portlet/@id"/>
- <out:text>_</out:text>
- <xsl:choose>
- <xsl:when test="@ui:helpid != ''"><xsl:value-of select="@ui:helpid"/></xsl:when>
- <xsl:otherwise>
- <out:choose>
- <out:when test="substring-before( string($ui-mode), ':' ) != ''">
- <out:value-of select="substring-after( string($ui-mode), ':' )"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$ui-mode"/>
- </out:otherwise>
- </out:choose>
- </xsl:otherwise>
- </xsl:choose>
- </out:variable>
- <out:variable name="context">
- <out:value-of select="translate( $tmp-context, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' )"/>
- </out:variable>
- <script language="javascript">
- function wsrp_rewrite_doHelp(redirect)
- {
- <out:variable name="ui-platform" select="$ui-configuration[@name='cps2.platform']/platform"/>
- <out:variable name="ui-help-path" select="$ui-platform/help/path"/>
- <out:variable name="ui-help">
- <out:if test="$ui-help-path != ''">
- <out:value-of select="$ui-webcontent"/>
- <out:value-of select="$ui-help-path"/>
- <out:if test="substring($ui-help-path, string-length($ui-help-path), 1) != '/'">
- <out:text>/</out:text>
- </out:if>
- </out:if>
- </out:variable>
- <out:choose>
- <out:when test="$ui-help != ''">
- var sLocale = "<out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>";
- <!-- Use the first two letters of the locale string to construct the path to the localized help folder. -->
- <!-- Make sure they are converted to lowercase. -->
- var sLang = sLocale.substring(0,2).toLowerCase();
- var sSupportedLangs = " <out:value-of select="$ui-platform/help/supportedLangs"/> ";
- if ( sSupportedLangs.indexOf(" " + sLang + " ") < 0) {
- sLang = "en";
- }
- <out:variable name="bookFile">
- <out:choose>
- <out:when test="$ui-is-iwidget"><out:value-of select="$ui-platform/help/bookFileIWidget"/></out:when>
- <out:otherwise><out:value-of select="$ui-platform/help/bookFile"/></out:otherwise>
- </out:choose>
- </out:variable>
- var sHelpTopic = "<out:value-of select="$bookFile"/>?helpid=<out:value-of select="$context"/>";
- var sURL = "<out:value-of select="$ui-help"/>" + sLang + "/" + sHelpTopic;
- if (redirect != null) {
- document.location.href = sURL;
- } else {
- windowHelp = window.open(sURL, "cps_help", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
- windowHelp.focus();
- }
- </out:when>
- <out:otherwise>
- window.alert("<xts:string id="IDS_PRO_HTM_NO_HELP_URL" encode="javascript"/>");
- </out:otherwise>
- </out:choose>
- }
- </script>
- </xsl:template>
- <xsl:template match="ui:about" priority="1">
- <out:variable name="jsEncoded-ui-webcontent" select="xtsext:javascriptencode($ui-webcontent)"/>
- <script language="javascript" ><out:attribute name="src"><out:value-of select="$jsEncoded-ui-webcontent"/>ps/portal/js/aboutdialog.js</out:attribute></script>
- <script language="javascript">
- function wsrp_rewrite_doAbout()
- {
- <out:variable name="jsDefaultMessageFileLocation">
- <out:text>wsrp_rewrite?wsrp-urlType=resource&wsrp-requiresRewrite=true&wsrp-url=</out:text>
- <out:text>ps/portal/js/about/ps/nls/psuiaboutmsg_en.js</out:text>
- <out:text>/wsrp_rewrite</out:text>
- </out:variable>
- <out:variable name="jsMessageFileLocation">
- <out:text>wsrp_rewrite?wsrp-urlType=resource&wsrp-requiresRewrite=true&wsrp-url=</out:text>
- <out:text>ps/portal/js/about/ps/nls/psuiaboutmsg_</out:text>
- <out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>
- <out:text>.js/wsrp_rewrite</out:text>
- </out:variable>
- var httpArgSep = "?";
- <!-- 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 -->
- var sLocale = "<out:value-of select="/root/envelope/SOAP-ENV:Envelope/SOAP-ENV:Header/bus:biBusHeader/bus:userPreferenceVars/item[name='productLocale']/value"/>";
- var aboutMessageFileLocation = new Object().href = "<out:value-of select="$jsMessageFileLocation"/>";
- var aboutDefaultMessageFileLocation = new Object().href = "<out:value-of select="$jsDefaultMessageFileLocation"/>";
- if (aboutDefaultMessageFileLocation.indexOf('?') != -1){
- httpArgSep = "&";
- }
- 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);
- helpAB.show();
- }
- </script>
- </xsl:template>
- <xsl:template match="ui:copyright" priority="1">
- <script language="javascript">
- function wsrp_rewrite_doCopyright()
- {
- <out:variable name="ui-platform" select="$ui-configuration[@name='cps2.platform']/platform"/>
- <out:variable name="ui-help-path" select="$ui-platform/help/path"/>
- <out:variable name="ui-help">
- <out:if test="$ui-help-path != ''">
- <out:value-of select="$ui-webcontent"/>
- <out:value-of select="$ui-help-path"/>
- <out:if test="substring($ui-help-path, string-length($ui-help-path), 1) != '/'">
- <out:text>/</out:text>
- </out:if>
- </out:if>
- </out:variable>
- <out:variable name="ui-copyright-url">
- <out:if test="$ui-platform/help/copyrightFile != ''">
- <out:value-of select="$ui-help"/>
- <out:value-of select="$ui-platform/help/copyrightFile"/>
- </out:if>
- </out:variable>
- <out:choose>
- <out:when test="$ui-copyright-url != ''">
- var sLocale = "<out:value-of select="$ui-markups/wsrp:locales[1]"/>";
- <!-- Use the first two letters of the locale string to construct the path to the localized help folder. -->
- <!-- Make sure they are converted to lowercase. -->
- var sLang = sLocale.substring(0,2).toLowerCase();
- var sSupportedLangs = " <out:value-of select="$ui-platform/help/supportedLangs"/> ";
- if ( sSupportedLangs.indexOf(" " + sLang + " ") < 0) {
- sLang = "en";
- }
- var sURL = "<out:value-of select="$ui-copyright-url"/>";
- var idxLocale = sURL.indexOf("@@");
- if (idxLocale != -1) {
- sURL = sURL.substring(0, idxLocale) + sLang + sURL.substring(idxLocale + 2);
- }
- windowHelp = window.open(sURL, "cps_copyright", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
- windowHelp.focus();
- </out:when>
- <out:otherwise>
- window.alert("<xts:string id="IDS_PRO_HTM_NO_COPYRIGHT" encode="javascript"/>");
- </out:otherwise>
- </out:choose>
- }
- </script>
- </xsl:template>
- <xsl:template match="ui:browser" priority="1">
- <out:variable name="ui-user-agent" select="translate(string( $ui-markups/wsrp:clientData/wsrp:userAgent ), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
- <out:variable name="ui-browser">
- <out:choose>
- <out:when test="contains($ui-user-agent , 'msie')">ie</out:when> <!-- IE 4.xx and above -->
- <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 -->
- <out:when test="contains($ui-user-agent , 'chrome')">chrome</out:when> <!-- Chrome user-agent contains Safari also -->
- <out:when test="contains($ui-user-agent , 'mozilla/5.0')">
- <out:choose>
- <out:when test="contains($ui-user-agent , 'netscape/7.1')">ns71</out:when>
- <out:when test="contains($ui-user-agent , 'netscape/7.0')">ns70</out:when>
- <out:when test="contains($ui-user-agent , 'aol/7.0')">ns70</out:when>
- <out:when test="contains($ui-user-agent , 'cs 2000 7.0/7.0')">ns70</out:when>
- <out:when test="contains($ui-user-agent , 'netscape6')">ns6</out:when>
- <out:otherwise>moz</out:otherwise>
- </out:choose>
- </out:when>
- <out:when test="contains($ui-user-agent , 'mozilla/4.')">ns4</out:when> <!-- NS 4.xx -->
- <out:otherwise>other</out:otherwise>
- </out:choose>
- </out:variable>
- </xsl:template>
- <xsl:template match="ui:consumer" priority="1">
- <out:variable name="ui-consumer-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
- <out:variable name="ui-consumer-info" select="/root/portlet/consumer"/>
- </xsl:template>
- <xsl:template match="ui:page" priority="1">
- <out:variable name="ui-portal-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
- <out:variable name="ui-portal-info" select="/root/portlet/consumer"/>
- <out:variable name="ui-buttons-location" select="$ui-portal-info/layout/buttons/@location"/>
- <out:variable name="ui-buttons-align">
- <out:choose>
- <out:when test="contains( $ui-buttons-location, 'right' )">right</out:when>
- <out:otherwise>left</out:otherwise>
- </out:choose>
- </out:variable>
- <script type="text/javascript">
- <out:attribute name="src">
- <out:choose>
- <out:when test="contains($ui-gateway, '/bi/v1/disp')">
- <out:value-of select="$ui-webcontent"/>ccl/i18n/bidi/BidiUtils.js<out:text/>
- </out:when>
- <out:otherwise>
- <out:value-of select="$ui-webcontent"/>../ccl/i18n/bidi/BidiUtils.js<out:text/>
- </out:otherwise>
- </out:choose>
- </out:attribute>
- </script>
- <script language="javascript">
- var isBidiEnabled = <out:value-of select="boolean($ui-portlet-isBidiEnabled='true')"/>;
- if (isBidiEnabled){
- var bidi = BidiUtils.getInstance();
- bidi.setProperties('<out:value-of select="$ui-portlet-baseTextDirection"/>',
- '<out:value-of select="xtsext:getBTD('', $ui-portlet-baseTextDirection, $ui-portlet-product-locale)"/>',
- '<out:value-of select="$ui-portlet-product-locale"/>');
- }
- </script>
- <table border="0" cellspacing="0" cellpadding="2" width="100%" role="presentation">
- <tr>
- <td>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" role="presentation">
- <tr>
- <!-- Page description -->
- <td class="portlet-msg-info" valign="middle" align="left" style="padding-left: 3px;">
- <xsl:copy-of select="ui:page-description/child::node()"/>
- </td>
- <!-- Links -->
- <td align="right"><img alt="" src="{ '{ $ui-producer-images }space.gif'}" width="5" height="1"/></td>
- <td class="portlet-form-field" align="right" valign="top">
- <a class="cognos-anchor" href="javascript:wsrp_rewrite_doAbout();"><xts:string id="IDS_PRO_HTM_ABOUT_LINK"/></a>
- <out:value-of select="$ui-portal-info/layout/linkSeparator"/>
- <a class="cognos-anchor" href="javascript:wsrp_rewrite_doHelp();"><xts:string id="IDS_PRO_HTM_HELP_LINK"/></a>
- <br/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <out:if test="contains( $ui-buttons-location, 'top' )">
- <tr>
- <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap">
- <br/>
- <xsl:choose>
- <xsl:when test="ui:buttons">
- <xsl:for-each select="ui:buttons/*">
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:apply-templates select="."/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-gen-save-scripts"/>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Save'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Cancel'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <out:if test="/root/portlet/consumer/@id != 'cognos'">
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Reset'"/>
- <xsl:with-param name="more" select="false()"/>
- </xsl:call-template>
- </div>
- </out:if>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </out:if>
- </table>
- <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-section|text()|processing-instruction()"/>
- <out:if test="contains( $ui-buttons-location, 'bottom' )">
- <table border="0" cellspacing="0" cellpadding="2" width="100%" class="cognos-form-footer" style="vertical-align:bottom" role="presentation">
- <tr>
- <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap">
- <div class="cognos-form-footer-area">
- <xsl:choose>
- <xsl:when test="ui:buttons">
- <xsl:for-each select="ui:buttons/*">
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:apply-templates select="."/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-gen-save-scripts"/>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Save'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Cancel'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <out:if test="/root/portlet/consumer/@id != 'cognos'">
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Reset'"/>
- <xsl:with-param name="more" select="false()"/>
- </xsl:call-template>
- </div>
- </out:if>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </td>
- </tr>
- </table>
- </out:if>
- </xsl:template>
- <!-- ui:page-description , only allowed in ui:page -->
- <xsl:template match="ui:page-description" priority="1">
- <xsl:choose>
- <xsl:when test="parent::ui:page">
- <!-- Let parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0002</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- ui:page-section
- Ancestors must have a ui:page.
- Output : <table> ... </table>
- -->
- <xsl:template match="ui:page-section" priority="1">
- <xsl:choose>
- <xsl:when test="ancestor::ui:page">
- <table width="100%" cellspacing="0" cellpadding="0" border="0" role="presentation">
- <!-- Add space before section -->
- <tr>
- <td width="100%" height="10">
- <img width="1" height="5" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
- </td>
- </tr>
- <!-- Add the section divider if it exists -->
- <xsl:if test="ui:page-section-divider">
- <tr>
- <td>
- <table width="100%" cellspacing="0" cellpadding="0" border="0" role="presentation">
- <tr>
- <td style="padding-left: 8px;" class="portlet-form-field-label" nowrap="nowrap"><xsl:copy-of select="ui:page-section-divider/child::node()"/> </td>
- <td width="100%"><hr size="1"/></td>
- </tr>
- <!-- Add the section description if it exists -->
- <xsl:choose>
- <xsl:when test="ui:page-section-desc">
- <tr>
- <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>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr>
- <td width="1" height="5" colspan="2">
- <img width="1" height="2" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
- </td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- </table>
- </td>
- </tr>
- </xsl:if>
-
- <!-- If the section does not have a divider, put the groups in here -->
- <xsl:if test="not (ui:page-section-divider)">
- <tr>
- <td style="padding-left: 8px;" class="portlet-form-field" nowrap="nowrap">
- <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-sub-section-group|text()|processing-instruction()"/>
- </td>
- </tr>
- </xsl:if>
- </table>
-
- <!-- If we have a divider, we render the content differently -->
- <xsl:if test="ui:page-section-divider">
- <table width="100%" cellspacing="0" cellpadding="3" border="0" role="presentation">
- <tr>
- <td width="1" height="1">
- <img width="1" height="1" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
- </td>
- <td width="100%">
- <table cellspacing="0" cellpadding="1" border="0" width="100%" role="presentation">
- <tr>
- <td>
- <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/logic/ui/1/']|ui:page-sub-section-group|text()|processing-instruction()"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0003</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="ui:page-section-divider" priority="1">
- <xsl:choose>
- <xsl:when test="ui:page-section">
- <!-- Let the parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0004</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="ui:page-section-desc" priority="1">
- <xsl:choose>
- <xsl:when test="ui:page-section">
- <!-- Let the parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0005</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="ui:page-sub-section-group" priority="1">
- <table cellspacing="0" cellpadding="1" border="0" width="100%" role="presentation">
- <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()"/>
- </table>
- </xsl:template>
-
-
- <xsl:template match="ui:page-sub-section" priority="1">
- <xsl:choose>
- <xsl:when test="(ancestor::ui:page-section)">
- <!-- Handle the title of the group -->
- <xsl:if test="ui:page-sub-section-title">
- <tr>
- <td nowrap="" class="portlet-form-field-label">
- <xsl:copy-of select="ui:page-sub-section-title/child::node()"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="ui:page-sub-section-desc">
- <tr>
- <td nowrap="" class="portlet-msg-info">
- <xsl:copy-of select="ui:page-sub-section-desc/child::node()"/>
- </td>
- </tr>
- </xsl:if>
- <tr>
- <td>
- <xsl:apply-templates select="ui:page-sub-section-content/*|ui:page-sub-section-content/text()|ui:page-sub-section-content/processing-instruction()"/>
- </td>
- </tr>
- <xsl:if test="not (@tailing-space ='false')">
- <tr>
- <td nowrap="">
- <img width="1" height="2" alt="" src="{ '{ $ui-producer-images }space.gif'}"/>
- </td>
- </tr>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <!-- error -->
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0006</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ui:page-sub-section-title" priority="1">
- <xsl:choose>
- <xsl:when test="parent::ui:page-sub-section">
- <!-- Let the parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <!-- error -->
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0007</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ui:page-sub-section-desc" priority="1">
- <xsl:choose>
- <xsl:when test="parent::ui:page-sub-section">
- <!-- Let the parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <!-- error -->
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0008</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="ui:page-sub-section-content" priority="1">
- <xsl:choose>
- <xsl:when test="parent::ui:page-sub-section">
- <!-- Let the parent handle it -->
- </xsl:when>
- <xsl:otherwise>
- <!-- error -->
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0009</xsl:with-param>
- <xsl:with-param name="errmsg">Element not allowed at this position</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- =-=-=-=-=-=-=-=-=-=-=-=-=-=
- ui:wizard
- -->
- <xsl:template match="ui:wizard" priority="1">
- <out:variable name="ui-portal-agent" select="$ui-registration-params[@name = 'consumerAgent']"/>
- <out:variable name="ui-portal-info" select="/root/portlet/consumer"/>
- <out:variable name="ui-buttons-location" select="$ui-portal-info[1]/layout/buttons/@location"/>
- <out:variable name="ui-buttons-align">
- <out:choose>
- <out:when test="contains( $ui-buttons-location, 'right' )">right</out:when>
- <out:otherwise>left</out:otherwise>
- </out:choose>
- </out:variable>
- <table border="0" cellspacing="0" cellpadding="2" width="100%" role="presentation">
- <tr class="portlet-section-header">
- <td class="portlet-font" style="font-size:larger" colspan="2">
- <out:value-of select="{@ui:portlet}"/>
- </td>
- </tr>
- <tr class="portlet-section-subheader">
- <td class="portlet-font" colspan="2">
- <b><xts:string id="IDS_PRO_CUI_WIZARD"/></b>
- </td>
- </tr>
- <tr>
- <td class="portlet-form-label">
- <xsl:choose>
- <xsl:when test="ui:header">
- <xsl:apply-templates select="ui:header/child::node()"/>
- </xsl:when>
- <xsl:otherwise>
- <out:choose>
- <out:when test="$ui-mode = 'cps:config'">
- <out:text/><xts:string id="IDS_PRO_HTM_ADMIN_DESC"><xts:param name="name"><out:value-of select="{@ui:portlet}"/></xts:param></xts:string>
- </out:when>
- <out:otherwise>
- <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/>
- </out:otherwise>
- </out:choose>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td class="portlet-font" align="right">
- <a class="cognos-anchor" href="javascript:wsrp_rewrite_doAbout();"><xts:string id="IDS_PRO_HTM_ABOUT_LINK"/></a>
- <out:value-of select="$ui-consumer-info/layout/linkSeparator"/>
- <a class="cognos-anchor" href="javascript:wsrp_rewrite_doHelp();"><xts:string id="IDS_PRO_HTM_HELP_LINK"/></a>
- <br/><br/>
- </td>
- </tr>
- <out:if test="contains( $ui-buttons-location, 'top' )">
- <tr>
- <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap" colspan="2">
- <xsl:choose>
- <xsl:when test="ui:buttons">
- <xsl:for-each select="ui:buttons/*">
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:apply-templates select="."/>
- </div>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ui-gen-save-scripts"/>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Cancel'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Back'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Next'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Finish'"/>
- <xsl:with-param name="more" select="false()"/>
- </xsl:call-template>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </out:if>
- </table>
- <xsl:apply-templates select="*[namespace-uri() != 'http://developer.cognos.com/schemas/cps/ui/1/']|text()|processing-instruction()"/>
- <out:if test="contains( $ui-buttons-location, 'bottom' )">
- <table border="0" cellspacing="0" cellpadding="2" width="100%" style="border-top:solid 1px #cccccc" class="cognos-form-footer" role="presentation" >
- <tr>
- <td align="{ '{ $ui-buttons-align }' }" nowrap="nowrap" colspan="2">
- <div class="cognos-form-footer-area">
- <xsl:choose>
- <xsl:when test="ui:buttons">
- <xsl:apply-templates select="ui:buttons/ui:button"/>
- </xsl:when>
- <xsl:otherwise>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Cancel'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Back'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Next'"/>
- <xsl:with-param name="more" select="true()"/>
- </xsl:call-template>
- </div>
- <div class="cognos-form-footer-button-area" style="display:inline">
- <xsl:call-template name="ui-gen-button">
- <xsl:with-param name="name" select="'Finish'"/>
- <xsl:with-param name="more" select="false()"/>
- </xsl:call-template>
- </div>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </td>
- </tr>
- </table>
- </out:if>
- </xsl:template>
- <xsl:template match="ui:error" priority="1">
- <xsl:choose>
- <xsl:when test="not(@message)">
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0010</xsl:with-param>
- <xsl:with-param name="errmsg">Missing mandatory attribute: message (xsd:string)</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <out:variable name="error-code" select="substring-before({@message}, ' ')"/>
- <out:variable name="error-msg" select="substring-after({@message}, ' ')"/>
- <table role="presentation">
- <tr>
- <td colspan="2" class="portlet-msg-info">
- <out:value-of select="$error-code"/>
- </td>
- </tr>
- <tr>
- <td>
- <img src="{ '{ $ui-producer-images }dialog_error.gif'}" width="32" height="32" border="0"/>
- </td>
- <td class="portlet-msg-error">
- <out:value-of select="$error-msg"/>
- </td>
- </tr>
- </table>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ui:header" priority="1"/>
- <!--
- -=-=-=-=-=-=-=-=-=-=-=-=-
- -->
- <xsl:template match="ui:button" name="ui-gen-button" priority="1">
- <xsl:param name="name" select="@name"/>
- <xsl:param name="more" select="position() != last()"/>
- <out:variable name="text-{$name}"><xts:string id="IDS_PRO_CUI_BTN_{ translate( $name, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) }"/></out:variable>
- <out:variable name="padding-text-{$name}">
- <out:if test="string-length($text-{$name}) < 8 and contains($ui-markups/wsrp:clientData/wsrp:userAgent, 'Mozilla/5.0')">
- <out:value-of select="substring(' ', 1, floor((8 - string-length($text-{$name})) div 2) )"/>
- </out:if>
- </out:variable>
- <out:variable name="patched-text-{$name}">
- <out:value-of select="$padding-text-{$name}"/><out:value-of select="$text-{$name}"/><out:value-of select="$padding-text-{$name}"/>
- </out:variable>
- <input class="portlet-form-button" onclick="javascript:wsrp_rewrite_do{ $name }{ ../@suffix }();" type="button" name="{ $name }" value="{'{'}$patched-text-{$name}{'}'}"/>
-
- <xsl:if test="$more = true()">
- <out:text> </out:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="ui:admin-settings" priority="1">
- <out:variable name="userCategory" select="/root/cookies/cookie[@name = 'userCategory']"/>
- <out:if test="($userCategory = 'administrator' and $ui-mode != 'cps:config')">
- <tr>
- <td class="portlet-form-field-label"><xts:string id="IDS_PRO_HTM_LABEL_ADMIN_SETTINGS"/></td>
- </tr>
- <tr>
- <td class="portlet-font">
- <script language="javascript">
- function wsrp_rewrite_doConfig() {
- <utml:rewrite-render utml:mode="cps:config"/>
- }
- </script>
- <a class="cognos-anchor" href="javascript:wsrp_rewrite_doConfig();"><xts:string id="IDS_PRO_HTM_LABEL_ADMIN_SAVE_GLOBAL"/></a>
- </td>
- </tr>
- </out:if>
- </xsl:template>
-
-
- <xsl:template match="ui:maximize-scripts" priority="1">
- <xsl:choose>
- <xsl:when test="not (@ui:objectId or ui:objectId)">
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">011</xsl:with-param>
- <xsl:with-param name="errmsg">The @objectId attribute is required</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="not (ancestor::*/ui:browser)">
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">012</xsl:with-param>
- <xsl:with-param name="errmsg">ui:browser must be called first to initialize the browser variables</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <out:if test="$ui-window-state = 'wsrp:maximized'">
- <script>
-
- function wsrp_rewrite_toInt(value, defaultValue){
- var nValue = parseInt(value);
- if (isNaN(nValue)){
- if (defaultValue){
- return defaultValue;
- }
- return 0;
- }
- return nValue;
- }
-
- function wsrp_rewrite_getStyle(obj){
- try {
- if (document.defaultView && document.defaultView.getComputedStyle){
- return document.defaultView.getComputedStyle(obj, null);
- }
- else if (obj.currentStyle){
- return obj.currentStyle;
- }
- } catch (e){}
- return obj.style;
- }
-
- function wsrp_rewrite_getTop(obj) {
- var curtop = 0;
- try {
- if (obj.offsetParent) {
- while (obj.offsetParent) {
- curtop += obj.offsetTop
- obj = obj.offsetParent;
- }
- }
- else if (obj.y) {
- curtop += obj.y;
- }
- }catch (e) {}
- return curtop;
- }
-
- function wsrp_rewrite_getWindowHeight(){
- if( typeof( window.innerHeight ) == 'number' ) {
- return window.innerHeight;
- } else if( document.documentElement && document.documentElement.clientHeight ) {
- return document.documentElement.clientHeight;
- } else if( document.body && document.body.clientHeight ) {
- return document.body.clientHeight;
- }
- }
-
- <!--
- This method will find the last sibling thatthe atucal position in the layout is below the object in question.
- -->
- function wsrp_rewrite_getLastSiblingPositionedBelow(obj) {
- var lastValidSibling = null;
- var sibling = obj.nextSibling;
- while (sibling != null ) {
- if (sibling.tagName != null){
- var siblingStyle = wsrp_rewrite_getStyle(sibling);
- var isVisible = siblingStyle.display.toLowerCase() != "none" ;
- var isRelative = siblingStyle.position.toLowerCase() != "absolute" ;
- if (sibling.offsetHeight != null && isVisible && isRelative){
- var isSiblingPlacedBelow = wsrp_rewrite_getTop(obj) + obj.offsetHeight <= wsrp_rewrite_getTop(sibling);
- if (isSiblingPlacedBelow){
- <!-- This sibling is visible and does not have absolute positioning and is located below the object -->
- obj = sibling;
- lastValidSibling = sibling;
- }
- }
- }
- sibling = sibling.nextSibling;
- }
- return lastValidSibling;
- }
-
- function wsrp_rewrite_getExtraBottomContent(obj) {
- var extraContentHeight;
- var lastSibling = wsrp_rewrite_getLastSiblingPositionedBelow(obj);
- if (lastSibling != null){
- var distance = wsrp_rewrite_getTop(lastSibling) - wsrp_rewrite_getTop(obj) - obj.offsetHeight;
- extraContentHeight = distance +
- wsrp_rewrite_toInt(wsrp_rewrite_getStyle(lastSibling).marginTop) +
- lastSibling.offsetHeight +
- wsrp_rewrite_toInt(wsrp_rewrite_getStyle(lastSibling).marginBottom)
- }
- else{
- extraContentHeight = wsrp_rewrite_toInt(wsrp_rewrite_getStyle(obj).marginBottom)
- }
-
- var parent = obj.parentNode;
- if (parent && obj != document.body) {
- var parentStyle = wsrp_rewrite_getStyle(parent);
-
- <!-- If this is a cell in a table, we will need to calculate the space take by the "cellspacing"-->
- if (obj.parentNode != null && obj.offsetParent != null && obj.parentNode.rowIndex != null && obj.offsetParent.cellSpacing != null && obj.offsetParent.rows != null){
- var cellspacing = wsrp_rewrite_toInt(obj.offsetParent.cellSpacing, 2) * (obj.offsetParent.rows.length - obj.parentNode.rowIndex );
- extraContentHeight += cellspacing;
- }
- extraContentHeight += wsrp_rewrite_toInt(parentStyle.paddingBottom) + wsrp_rewrite_toInt(parentStyle.borderBottomWidth);
- extraContentHeight += wsrp_rewrite_getExtraBottomContent(parent);
- }
- return extraContentHeight;
- }
-
- var wsrp_rewrite_minHeight = 100;
- function wsrp_rewrite_getNewHeight(id) {
- try {
- var eDiv= document.getElementById(id);
- if (eDiv != null) {
- var newHeight = wsrp_rewrite_getWindowHeight() - wsrp_rewrite_getTop( eDiv) - wsrp_rewrite_getExtraBottomContent(eDiv) ;
-
- if (newHeight < wsrp_rewrite_minHeight){
- newHeight = wsrp_rewrite_minHeight;
- }
-
- <out:if test="$ui-browser != 'ie'">
- <!-- Mozilla does not inlcude the border in the height , so let's take into account the border thickness-->
- var runtimeStyle = wsrp_rewrite_getStyle(eDiv);
- if (runtimeStyle){
- if (runtimeStyle.borderTopWidth){
- newHeight -= wsrp_rewrite_toInt(runtimeStyle.borderTopWidth);
- }
- if (runtimeStyle.borderBottomWidth){
- newHeight -= wsrp_rewrite_toInt(runtimeStyle.borderBottomWidth);
- }
- }
- </out:if>
- return newHeight;
- }
- }catch(e){}
- }
-
- function wsrp_rewrite_setHeight(id, newHeight, refresh){
- var eDiv= document.getElementById(id);
- if (eDiv != null) {
-
- <!--
- when used in myportlal with firefox , it is off by 2 pixels.
- I'm not sure what we are missing.. but it is easier for now to substract 2 pixel than track it down.
- -->
- newHeight -= 2;
- eDiv.style.height = newHeight + "px";
-
- <out:if test="$ui-browser != 'ie'">
- if (refresh){
- <!-- mozilla has some redrawing problems. This will force it to redraw, not sure why but it seems to work -->
- var oldBorderColor = eDiv.style.borderColor;
- var oldBorderWidth = eDiv.style.borderWidth;
- eDiv.style.borderWidth="1";
- eDiv.style.borderColor="transparent";
- setTimeout("document.getElementById(\""+id+"\").style.borderWidth = \""+oldBorderWidth+"\"" ,1);
- setTimeout("document.getElementById(\""+id+"\").style.borderColor = \""+oldBorderColor+"\"" ,1);
- }
- </out:if>
- }
- }
-
- function wsrp_rewrite_resize_main() {
- var newHeight;
- <xsl:for-each select="@ui:objectId | ui:objectId">
- newHeight = wsrp_rewrite_getNewHeight("<xsl:value-of select="."/>");
- <xsl:if test="./@ui:callback">
- <xsl:value-of select="./@ui:callback"/>(newHeight);
- </xsl:if>
- wsrp_rewrite_setHeight("<xsl:value-of select="."/>", newHeight, true);
- </xsl:for-each>
- }
-
- function wsrp_rewrite_attachEvent(e, obj, f){
- if (obj){
- if (obj.attachEvent){
- obj.attachEvent("on" + e,f);
- }
- else if (obj.addEventListener){
- obj.addEventListener(e, f, null);
- }
- }
- }
- <out:if test="$ui-is-myportal">
- <!--
- if we are in a dashboard, we need to attach the resize event to the object onload event if there is one.
- If we don't do this, the object will not resize when the portlet is displayed in the dashboard because
- the dashboard does not do a full window reload so the window onload event will not kick in.
- -->
- <xsl:for-each select="@ui:objectId | ui:objectId">
- wsrp_rewrite_load_resized = false;
- wsrp_rewrite_attachEvent("load", document.getElementById("<xsl:value-of select="."/>") ,
- function(){
- if (!wsrp_rewrite_load_resized && document.readyState == "complete"){
- wsrp_rewrite_load_resized = true;
- wsrp_rewrite_resize_main();
- }
- }
- );
- <!-- This is to handle loading ActiveX objects like ppt files in IE .. -->
- wsrp_rewrite_attachEvent("readystatechange", document.getElementById("<xsl:value-of select="."/>") ,
- function(){
- if (document.readyState=="complete" && !wsrp_rewrite_load_resized){
- wsrp_rewrite_load_resized = true;
- wsrp_rewrite_resize_main();
- }
- });
- </xsl:for-each>
-
- </out:if>
- wsrp_rewrite_attachEvent("load", window, wsrp_rewrite_resize_main);
- wsrp_rewrite_attachEvent("resize", window, wsrp_rewrite_resize_main);
-
-
- </script>
- </out:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ui:save-scripts" name="ui-gen-save-scripts" priority="1">
- <xsl:variable name="ui-overwrite-mode">
- <xsl:choose>
- <xsl:when test="@ui:mode">
- <xsl:value-of select="@ui:mode"/>
- </xsl:when>
- <xsl:otherwise>wsrp:view</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ui-urlType">
- <xsl:choose>
- <xsl:when test="@ui:urlType">
- <xsl:value-of select="@ui:urlType"/>
- </xsl:when>
- <xsl:otherwise>blockingAction</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script language="javascript">
- function wsrp_rewrite_doReset() {
- wsrp_rewrite_saveHelper(true);
- }
- function wsrp_rewrite_doSave() {
- wsrp_rewrite_saveHelper(false);
- }
- function wsrp_rewrite_doCancel() {
- <utml:rewrite-render/>
- }
- function wsrp_rewrite_saveHelper(reset) {
- if (reset) {
- if (!window.confirm("<xts:string id="IDS_PRO_HTM_PROMPT_REVERT" encode="javascript"/>")) {
- return;
- }
- <utml:form-submit
- utml:mode="{$ui-overwrite-mode}"
- utml:operation="reset"
- utml:validate="false"/>
-
- } else {
- <utml:form-submit
- utml:mode="wsrp:view"
- utml:operation="save"
- utml:urlType="{$ui-urlType}"
- utml:validate="true"/>
- }
- }
- </script>
- </xsl:template>
- <xsl:template match="ui:add-hidden-opacity-style" priority="1">
- <out:attribute name="style">filter:alpha(opacity=40);opacity:0.4;-moz-opacity:0.4;</out:attribute>
- </xsl:template>
- <xsl:template match="ui:*" priority="0">
- <xsl:call-template name="ui-compile-error">
- <xsl:with-param name="errno">0100</xsl:with-param>
- <xsl:with-param name="errmsg">Unsupported logicsheet tag: <xsl:value-of select="local-name(.)"/></xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="ui-compile-error">
- <xsl:param name="errno"/>
- <xsl:param name="errmsg"/>
- <xsl:message>
- <xsl:text>CPS-ERR-</xsl:text>
- <xsl:value-of select="$errno"/>
- <xsl:text>: </xsl:text>
- <xsl:value-of select="$errmsg"/>
- <xsl:text>.</xsl:text>
- </xsl:message>
- <xsl:message terminate="yes">
- <xsl:text> ...at: </xsl:text>
- <xsl:for-each select="ancestor-or-self::node()[name()!='']">
- <xsl:text>/</xsl:text>
- <xsl:value-of select="name()"/>
- </xsl:for-each>
- </xsl:message>
- </xsl:template>
- <xsl:template match="*|@*|text()|processing-instruction()" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="*|@*|text()|processing-instruction()"/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|