123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2014
- 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).
- -->
- <xsl:stylesheet version="1.0"
- xmlns:pkgcfg="http://developer.cognos.com/schemas/xts/pkgcfg"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:out="dummy-uri"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl xts xtsext dp cp cf utml">
-
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:template match="pkgcfg:scripts">
- <out:variable name="maxXTabItem">60</out:variable>
- function storeSettings()
- {
- <out:for-each select="/root/pkgcfgSettings/*">
- document.pform.m_ppc_<out:value-of select="./name"/>.value = document.pform.<out:value-of select="./name"/>.value;
- </out:for-each>
- }
-
- function checkCrossTab()
- {
- var field;
- var isOk = 0;
- <out:for-each select="/root/pkgcfgSettings/*">
- <out:if test="contains(string(./name),'crosstabItem')">
- if ( isOk == 0 )
- {
- field = document.pform["<out:value-of select="./name"/>"];
- isOk = checkFieldValues(field,"true");
- }
- </out:if>
- </out:for-each>
- if (isOk == 0) return true;
- return false;
- }
- function checkOther()
- {
- var field;
- var isOk = 0;
- <out:for-each select="/root/pkgcfgSettings/*">
- <out:if test="not(contains(string(./name),'crosstabItem'))">
- if ( isOk == 0 )
- {
- field = document.pform["<out:value-of select="./name"/>"];
- isOk = checkFieldValues(field);
- }
- </out:if>
- </out:for-each>
- if( isOk == 0 ) return true;
- return false;
- }
-
- function checkFieldValues( field, hasLimit )
- {
- var isOk = 0;
- if (field.value < 0 || isNaN(field.value) || parseInt(field.value, 10) != field.value)
- {
- field.value = '0';
- isOk = 1;
- alert("<xts:string id="IDS_VAL_ERR_UNSIGNED_INTEGER" encode="javascript"/>");
- field.focus();
- }
- //outside any applied limit cm will not like it if any of the values here are greater than 2147483647...so make sure we check for that
- if (field.value > 2147483647)
- {
- isOk = 2;
- alert("<xts:string id="IDS_PACKAGECONFIGURATION_XTABITEM_EXCEED_LIMIT" encode="javascript"><xts:param name="maxXTabItem">2147483647</xts:param></xts:string>");
- field.focus();
- }
- if (hasLimit)
- {
- var limit = <out:value-of select="$maxXTabItem"/>;
- if (field.value > limit)
- {
- isOk = 2;
- alert("<xts:string id="IDS_PACKAGECONFIGURATION_XTABITEM_EXCEED_LIMIT" encode="javascript"><xts:param name="maxXTabItem"><out:value-of select="$maxXTabItem"/></xts:param></xts:string>");
- field.focus();
- }
- }
- return isOk;
- }
- function validatePkgCfg()
- {
- if ( checkCrossTab() ) {
- if (checkOther()) {
- storeSettings();
- document.pform.m_return.value = "";
- document.pform.m_path.value = document.pform.m_obj.value;
- document.pform.m_new_class.value = "packageConfiguration";
- return true;
- }
- }
- return false;
- }
- function selection()
- {
- if ( checkCrossTab() ) {
- if (checkOther()) {
- storeSettings();
- document.pform.ps_nav_op.value = "maintain";
- document.pform.m.value = "<out:value-of select="xtsext:javascriptencode($app)"/>/select/select.xts";
- document.pform.submit();
- }
- }
- }
-
- function resetToDefaults()
- {
- <out:for-each select="/root/pkgcfgSettings/*">
- <out:variable name="pos" select="position()"/>
- if(document.pform["checkbox_<out:value-of select="$pos"/>"].checked) {
- document.pform["checkbox_<out:value-of select="$pos"/>"].checked=false;
- document.pform["<out:value-of select="./name"/>"].value = <out:value-of select="./defaultValue"/>;
- }
- </out:for-each>
- var ccb = document.getElementById("controlCheckbox");
- if(ccb.checked) ccb.checked=false;
- }
- </xsl:template>
- <xsl:template match="pkgcfg:defaultAnalysis">
- <dp:list>
- <dp:section>
- <dp:label><xts:string id="IDS_PACKAGECONFIGURATION_DEFAULT_LABEL"/></dp:label>
- </dp:section>
- <dp:section>
- <dp:hint wrap="wrap" width="100%"><xts:string id="IDS_PACKAGECONFIGURATION_DEFAULT_HINT"/></dp:hint>
- </dp:section>
- <out:choose>
- <out:when test="/root/selectedAnalysis">
- <out:variable name="object-start-at-path">
- <out:choose>
- <out:when test="starts-with(/root/selectedAnalysis/cm:queryResponse/*/cm:searchPath, '~') or starts-with(/root/selectedAnalysis/cm:queryResponse/*/cm:searchPath,key('session-param', 'e_hp'))">
- <out:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
- </out:when>
- <out:when test="starts-with(/root/selectedAnalysis/cm:queryResponse/*/cm:searchPath,'/content')">
- <out:value-of select="$defaultContentRoot"/>
- </out:when>
- </out:choose>
- </out:variable>
- <dp:section>
- <span lang="{'{$contentLocale}'}">
- <cf:do-the-path-link>
- <cf:param name="familytree">/root/selectedAnalysis/cm:queryResponse/*/cm:ancestors</cf:param>
- <cf:param name="familymember">/root/selectedAnalysis/cm:queryResponse/*/cm:defaultName</cf:param>
- <cf:param name="home">
- <out:value-of select="$object-start-at-path"/>
- </cf:param>
- </cf:do-the-path-link>
- </span>
- </dp:section>
- </out:when>
- <out:when test="(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis and not(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/@nil)) and (not(key('env-param','remove_m_ppc_defaultAnalysis')='true'))">
- <out:variable name="object-start-at-path">
- <out:choose>
- <out:when test="starts-with(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:searchPath, '~') or starts-with(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:searchPath,key('session-param', 'e_hp'))">
- <out:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
- </out:when>
- <out:when test="starts-with(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:searchPath,'/content')">
- <out:value-of select="$defaultContentRoot"/>
- </out:when>
- </out:choose>
- </out:variable>
- <dp:section>
- <span lang="{'{$contentLocale}'}">
- <cf:do-the-path-link>
- <cf:param name="familytree">/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:ancestors</cf:param>
- <cf:param name="familymember">/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/*/cm:defaultName</cf:param>
- <cf:param name="home">
- <out:value-of select="$object-start-at-path"/>
- </cf:param>
- </cf:do-the-path-link>
- </span>
- </dp:section>
- </out:when>
- <out:otherwise>
- <dp:section>
- <dp:text nospace="nospace"><xts:string id="IDS_PACKAGECONFIGURATION_DEFAULT_VALUE"/></dp:text>
- </dp:section>
- </out:otherwise>
- </out:choose>
- <dp:section>
- <dp:link>
- <a href="javascript:selection()">
- <xts:string id="IDS_PACKAGECONFIGURATION_DEFAULT_LINK"/>
- </a>
- <out:if test="(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis and not(/root/cm:queryResponse/cm:packageConfiguration/cm:defaultAnalysis/@nil)) and (not(key('env-param','remove_m_ppc_defaultAnalysis')='true'))">
- <img height="3" width="10">
- <out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute>
- </img>
- <a href="javascript:removeAnalysis()">
- <xts:string id="IDS_CONTENT_TASK_REPORT_UPGRADE_REMOVE"/>
- </a>
- </out:if>
- </dp:link>
- </dp:section>
- </dp:list>
- </xsl:template>
-
- <xsl:template match="pkgcfg:settingsList">
- <dp:list>
- <dp:section>
- <dp:label><xts:string id="IDS_PACKAGECONFIGURATION_LIMITS_LABEL"/></dp:label>
- </dp:section>
- <dp:section>
- <dp:hint><xts:string id="IDS_PACKAGECONFIGURATION_LIMITS_HINT"/></dp:hint>
- </dp:section>
- <dp:section>
- <dp:text width="100%"/>
- <dp:text nospace="nospace" align="left"><xts:string id="IDS_ENTRIES"/> 1 - 2</dp:text>
- <img height="3" width="1">
- <out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute>
- </img>
- </dp:section>
- </dp:list>
- <cp:table name="pkgcfgsetting" iterate="/root/pkgcfgSettings/*" align="left" width="100%">
- <cp:tableHeader>
- <cp:columnHeader width="20" toggleName="checkbox_" id="controlCheckbox" noLabel="true"/>
- <cp:columnHeader width="16"/>
- <!-- Path-Name Column -->
- <cp:columnHeader width="100%">
- <!-- All of this is to align the header (...> Name) with the contents of the table-->
- <img height="5" width="1" border="0"><out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute></img>
- <out:text/><xts:string id="IDS_PACKAGECONFIGURATION_HEADING_NAME"/><out:text/>
- </cp:columnHeader>
- <cp:columnHeader>
- <span id="lbl_configValue"><xts:string id="IDS_PACKAGECONFIGURATION_HEADING_VALUE"/></span>
- </cp:columnHeader>
- </cp:tableHeader>
- <!-- Column contents -->
- <cp:tableContent>
- <cp:columnContent>
- <input type="checkbox">
- <out:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><out:value-of select="./displayName"/></xts:param></xts:string></out:attribute>
- <out:attribute name="name">checkbox_<out:value-of select="position()"/></out:attribute>
- </input>
- </cp:columnContent>
- <cp:columnContent><img alt=""><out:attribute name="src"><out:value-of select="$image_root"/>icon_parameter.gif</out:attribute></img></cp:columnContent>
- <!-- Path-Name Column -->
- <cp:columnContent><out:value-of select="./displayName"/></cp:columnContent>
- <cp:columnContent>
- <input type="text">
- <out:attribute name="name">
- <out:value-of select="./name"/>
- </out:attribute>
- <out:attribute name="value">
- <out:choose>
- <out:when test="./name = 'memberDisplayCountDefault'">
- <out:choose>
- <out:when test="not(/root/env/param[@name='m_ppc_memberDisplayCountDefault'])"><out:value-of select="./value"/></out:when>
- <out:otherwise><out:value-of select="/root/env/param[@name='m_ppc_memberDisplayCountDefault']"/></out:otherwise>
- </out:choose>
- </out:when>
- <out:when test="./name = 'memberDisplayCountLimit'">
- <out:choose>
- <out:when test="not(/root/env/param[@name='m_ppc_memberDisplayCountLimit'])"><out:value-of select="./value"/></out:when>
- <out:otherwise><out:value-of select="/root/env/param[@name='m_ppc_memberDisplayCountLimit']"/></out:otherwise>
- </out:choose>
- </out:when>
- </out:choose>
- </out:attribute>
- <out:attribute name="aria-label">
- <xts:string id="IDS_PACKAGECONFIGURATION_HEADING_VALUE_ARIA"><xts:param name="settingName"><out:value-of select="./displayName"/></xts:param></xts:string>
- </out:attribute>
- </input>
- </cp:columnContent>
- </cp:tableContent>
- </cp:table>
- <dp:list>
- <dp:section>
- <dp:text width="100%"/>
- <dp:link>
- <a href="javascript:resetToDefaults()">
- <xts:string id="IDS_PACKAGECONFIGURATION_SETTINGS_RESET"/>
- </a>
- </dp:link>
- <img height="3" width="1">
- <out:attribute name="src"><out:value-of select="$webcontent"/>/images/space.gif</out:attribute>
- </img>
- </dp:section>
- </dp:list>
- </xsl:template>
-
- <xsl:template match="pkgcfg:settingsInput">
- <utml:input name="m_ppc_memberDisplayCountDefault" type="hidden" value="" utml:update="false"/>
- <utml:input name="m_ppc_memberDisplayCountLimit" type="hidden" value="" utml:update="false"/>
- </xsl:template>
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|