123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- <?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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
-
- <!-- CM content request ==================================================================== -->
- <xts:block id="getContent" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init">
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm" testBlock="test">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query>
- <cm:search><xsl:value-of select="/root/env/param[@name='m_obj']"/></cm:search>
- <cm:properties>
- <cm:property name="advancedSettings"/>
- <cm:property name="defaultName"/>
- <cm:property name="permissions"/>
- <cm:property name="parent"/>
- </cm:properties>
- <cm:options schemaInfo="true">
- <cm:refProps>
- <cm:refProp refPropName="parent">
- <cm:properties>
- <cm:property name="advancedSettings"/>
- </cm:properties>
- </cm:refProp>
- </cm:refProps>
- </cm:options>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="replace" type="exec" mode="interpret" processor="XSLT" dependency="getContent formlogic_init" condition="/root/env/param[@name='replace']" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:replace select="/root/*[local-name()='queryResponse']/*/*[local-name()='advancedSettings']">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='reset_advancedSettings']='1'">
- <xsl:apply-templates select="cm:queryResponse/*/cm:parent/*/cm:advancedSettings"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="cm:queryResponse/*/cm:advancedSettings"/>
- </xsl:otherwise>
- </xsl:choose>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='reset_advancedSettings']"/>
- </xts:sequence>
- </xsl:template>
-
- <xsl:template match="cm:advancedSettings">
- <xsl:copy>
- <xsl:copy-of select="@*[local-name() != 'acquired']"/>
- <xsl:attribute name="acquired">false</xsl:attribute>
- <xsl:copy-of select="*"/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="addCounter" type="exec" mode="interpret" processor="XSLT" dependency="getContent">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:variable name="elementCounter">
- <xsl:choose>
- <xsl:when test="count(/root/cm:queryResponse/*/cm:advancedSettings/cm:settings/*)+5 > 20">
- <xsl:value-of select="count(/root/cm:queryResponse/*/cm:advancedSettings/cm:settings/*)+5"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="20"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:append>
- <counter>
- <xsl:call-template name="generateElement">
- <xsl:with-param name="count" select="$elementCounter"/>
- </xsl:call-template>
- </counter>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="generateElement">
- <xsl:param name="count"/>
- <xsl:if test="$count != 0">
- <element/>
- <xsl:call-template name="generateElement">
- <xsl:with-param name="count" select="$count - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="format" mode="output" processor="XSLT" type="exec" dependency="getContent replace addCounter formlogic_init" mimeType="text/html">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- 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:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- exclude-result-prefixes="xsl cm pf lyt dp df cf cp utml xts xtsext">
-
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <!-- Global variables ======================== -->
- <pf:variables/>
- <xsl:variable name="mname" select="'actions.xts'"/>
- <!-- These vars are required by global templates that generate an icon and a url for a CM entry -->
- <xsl:variable name="back-url" select="string(key('env-param', 'backURL'))"/>
- <xsl:variable name="cmd-form" select="'pform'"/>
- <xsl:variable name="edit-form" select="'pform'"/>
-
- <!-- Object reference -->
- <xsl:variable name="obj-ref" select="/root/cm:queryResponse/*"/>
- <xsl:variable name="browserTitle">
- <xts:string id="IDS_ADV_TITLE"><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span></xts:param></xts:string>
- </xsl:variable>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:variable name="has_write_permission" select="contains(concat(' ', /root/cm:queryResponse/*/cm:permissions, ' '), ' write ')"/>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <pf:meta/><!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <pf:help context="HID_ADVANCED_CMSETTINGS"/> <!-- Help system -->
- <!-- Define selectall and deselectall functions.-->
- <dt:selectDeselectAll/>
-
- <script language="javascript">
- function clearChecked()
- {
- var form = document.pform;
- for (var i = 0; i < form.elements.length; i++)
- {
- if (form.elements[i].checked == true && form.elements[i].name.indexOf('checkbox_') == 0)
- {
- form.elements['m_pa_n' + form.elements[i].name.substr(9)].value='';
- form.elements['m_pa_v' + form.elements[i].name.substr(9)].value='';
- form.elements[i].checked = false;
- }
- }
- }
-
- function validate()
- {
- <!-- make sure we clear the reset flag if the user hit the OK button -->
- if (document.pform.resetroot_advancedSettings)
- {
- document.pform.resetroot_advancedSettings.value = '0';
- }
-
- if (document.pform.reset_advancedSettings)
- {
- document.pform.reset_advancedSettings.value = '0';
- }
-
- return true;
- }
- </script>
- </dp:script>
-
- <utml:form name="pform" method="post" action="{$gateway}">
- <utml:read-only>
- <xsl:choose>
- <xsl:when test="not($has_write_permission)">true</xsl:when>
- <xsl:when test="key('env-param', 'replace') and (key('env-param', 'replace') != 'replace')">true</xsl:when>
- <xsl:when test="key('env-param', 'replace') and (key('env-param', 'replace') = 'replace')">false</xsl:when>
- <xsl:when test="key('env-param', 'reset_advancedSettings')='1'">true</xsl:when>
- <xsl:when test="/root/cm:queryResponse/*/cm:advancedSettings/@acquired = 'true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </utml:read-only>
- <utml:exclusion-list>
- <xsl:for-each select="/root/counter/*">
- <xsl:value-of select="concat(' m_pa_n', position(), ' ')"/>
- <xsl:value-of select="concat(' m_pa_v', position(), ' ')"/>
- </xsl:for-each>
- </utml:exclusion-list>
- <!-- dialog header -->
- <dp:header>
- <!-- header titles-->
- <dp:title showName="false"><xsl:copy-of select="$browserTitle"/></dp:title>
- <dp:description>
- <xts:string id="IDS_ADV_INTRO"/>
- </dp:description>
- </dp:header>
- <lyt:layout style="1">
- <lyt:section>
- <xsl:if test="$has_write_permission and $form-read-only = 'true'">
- <dp:choice>
- <dp:section1>
- <input type="checkbox" name="replace" value="replace" onclick="javascript:document.pform.submit();">
- <xsl:if test="not(key('env-param','reset_advancedSettings')) and (key('env-param', 'replace') = 'replace' or $obj-ref/cm:advancedSettings/@acquired = 'false')">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <xts:string id="IDS_ADV_OPTION"/>
- </dp:section2>
- </dp:choice>
- </xsl:if>
- </lyt:section>
- <lyt:section>
- <xsl:choose>
- <xsl:when test="key('env-param','reset_advancedSettings')='1'">
- <xsl:apply-templates select="/root/cm:queryResponse/*/cm:parent/*/cm:advancedSettings">
- <xsl:with-param name="form-read-only" select="$form-read-only"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="/root/cm:queryResponse/*/cm:advancedSettings">
- <xsl:with-param name="form-read-only" select="$form-read-only"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </lyt:section>
- </lyt:layout>
- <dp:footer>
- <xsl:choose>
- <xsl:when test="$form-read-only = 'true'">
- <df:button df:id="IDS_CLOSE" df:style="stack-down"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save"/>
- <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:template>
- <xsl:template match="cm:advancedSettings">
- <xsl:param name="form-read-only"/>
- <xsl:variable name="settings" select="."/>
- <xsl:choose>
- <xsl:when test="$form-read-only = 'true'">
- <cp:table name="entries" iterate="/root/counter/*" width="100%">
- <cp:tableHeader>
- <cp:columnHeader width="50%" id="lbl_entries_name"><xts:string id="IDS_ADV_NAME"/></cp:columnHeader>
- <cp:columnHeader width="50%" id="lbl_entries_value"><xts:string id="IDS_ADV_VALUE"/></cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <xsl:variable name="position" select="position()"/>
- <cp:columnContent>
- <utml:input type="text" style="width:95%" aria-labelledby="lbl_entries_name">
- <utml:name><xsl:value-of select="concat('m_pa_n', position())"/></utml:name>
- <utml:value><xsl:value-of select="$settings/cm:settings/cm:setting[position()=$position]/@name"/></utml:value>
- </utml:input>
- </cp:columnContent>
- <cp:columnContent>
- <utml:input type="text" style="width:95%" aria-labelledby="lbl_entries_value">
- <utml:name><xsl:value-of select="concat('m_pa_v', position())"/></utml:name>
- <utml:value><xsl:value-of select="$settings/cm:settings/cm:setting[position()=$position]"/></utml:value>
- </utml:input>
- </cp:columnContent>
- </cp:tableContent>
- </cp:table>
- </xsl:when>
- <xsl:otherwise>
- <cp:table name="entries" iterate="/root/counter/*" width="100%">
- <cp:tableHeader>
- <cp:columnHeader width="16" toggleName="checkbox_" utml="utml" noLabel="true"/>
- <cp:columnHeader width="50%" id="lbl_entries_name"><xts:string id="IDS_ADV_NAME"/></cp:columnHeader>
- <cp:columnHeader width="50%" id="lbl_entries_value"><xts:string id="IDS_ADV_VALUE"/></cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <xsl:variable name="position" select="position()"/>
- <cp:columnContent>
- <utml:input type="checkbox">
- <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><xsl:value-of select="$position"/></xts:param></xts:string></xsl:attribute>
- <utml:value>
- <xsl:value-of select="local-name()"/>
- </utml:value>
- <utml:name>
- <xsl:value-of select="concat('checkbox_', $position)"/>
- </utml:name>
- </utml:input>
- </cp:columnContent>
- <cp:columnContent>
- <utml:input type="text" style="width:95%" aria-labelledby="lbl_entries_name">
- <utml:name><xsl:value-of select="concat('m_pa_n', $position)"/></utml:name>
- <utml:value>
- <xsl:if test="key('env-param','m_obj')!='/configuration' or key('env-param','resetroot_advancedSettings') != '1'">
- <xsl:value-of select="$settings/cm:settings/cm:setting[position()=$position]/@name"/>
- </xsl:if>
- </utml:value>
- </utml:input>
- </cp:columnContent>
- <cp:columnContent>
- <utml:input type="text" style="width:95%" aria-labelledby="lbl_entries_value">
- <utml:name><xsl:value-of select="concat('m_pa_v', $position)"/></utml:name>
- <utml:value>
- <xsl:if test="key('env-param','m_obj')!='/configuration' or key('env-param','resetroot_advancedSettings') != '1'">
- <xsl:value-of select="$settings/cm:settings/cm:setting[position()=$position]"/>
- </xsl:if>
- </utml:value>
- </utml:input>
- </cp:columnContent>
- </cp:tableContent>
- <cp:action>
- <a href="javascript:clearChecked()">
- <xsl:text/><xts:string id="IDS_ADV_CLEAR_CHECKED"/><xsl:text/>
- </a>
- </cp:action>
- </cp:table>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
-
-
-
- <!-- Debug -->
- <xts:block id="debug" type="exec" dependency="format" mode="output" condition=".[ /root/session/param[@name='debug'] = '1' ]" processor="XSLT" mandatory="false" mimeType="text/html" >
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <dbg:templates/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|