123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2013
- 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="serviceDefaultOptions"/>
- <cm:property name="overrideOptions"/>
- <cm:property name="permissions"/>
- </cm:properties>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="render" mode="output" processor="XSLT" type="exec" dependency="getContent 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/"
- xmlns:form="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/"
- 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'"/>
-
- <!-- start the output -->
- <xsl:template match="/root">
-
- <xsl:variable name="booleanType">
- <xsl:value-of select="key('env-param', 'm_bool_type')"/>
- </xsl:variable>
-
- <xsl:variable name="booleanLabel">
- <xsl:variable name="label" select="key('env-param', 'm_bool_label')"/>
- <xsl:choose>
- <xsl:when test="$label!=''">
- <xsl:value-of select="$label"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$booleanType"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="has_write_permission" select="contains(concat(' ', /root/cm:queryResponse/*/cm:permissions, ' '), ' write ')"/>
-
- <xsl:variable name="browserTitle">
- <xts:string id="IDS_BOO_TITLE"><xts:param name="type"><xsl:value-of select="$booleanLabel"/></xts:param><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span></xts:param></xts:string>
- </xsl:variable>
- <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=""/> <!-- Help system -->
- <script language="javascript">
- function validate() {
-
- //Delete the CM derived inputs related to the current editor context.We'll recreate them during the js validate() based on the new values.
- deleteInputs('serviceDefaultOptions_');
- deleteInputs('overrideOptions_');
- deleteInputs('resetroot_optionArrayProp_');
- var overrideDisabled = document.getElementById("custom").checked;
- var boolValue = document.getElementById("always").checked || ((!document.getElementById("optBoolOverrideSelected").disabled) && document.getElementById("optBoolOverrideSelected").value=='true')
- populateInput('serviceDefaultOptions',boolValue);
- if (!overrideDisabled) {
- populateInput('overrideOptions',boolValue);
- }
- return true;
- }
-
- function toggleOverride(isDisabled) {
- document.getElementById("optBoolOverrideSelected").disabled = isDisabled;
- }
-
- function createInput(name,value) {
- var input = document.createElement("INPUT");
- input.setAttribute("type","hidden");
- input.setAttribute("name",name);
- input.setAttribute("value",value);
- pform.appendChild(input);
- return input;
- }
-
- function deleteInputs(inputName) {
- var inputs = document.getElementsByName(inputName+'<xsl:value-of select="xtsext:javascriptencode($booleanType)"/>');
- while (inputs.length>0) {
- var input = inputs[inputs.length-1];
- input.parentNode.removeChild(input);
- }
- }
-
- function populateInput(optionType, value) {
- var inputName = optionType + '_<xsl:value-of select="xtsext:javascriptencode($booleanType)"/>';
- createInput(inputName,value);
- }
- </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:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </utml:read-only>
- <utml:exclusion-list>
- <xsl:value-of select="concat($booleanType,'m_opt_bool_choice_override_selected')"/>
- </utml:exclusion-list>
- <!-- dialog header -->
- <dp:header>
- <!-- header titles-->
- <dp:title showName="false"><xsl:copy-of select="$browserTitle"/></dp:title>
- <dp:description>
- <label id="ctrl_{concat('m_opt_bool_',$booleanType)}_radioGroup"><xts:string id="IDS_BOO_INTRO"><xts:param name="type"><xsl:value-of select="$booleanLabel"/></xts:param><xts:param name="objectName"><xsl:value-of select="key('env-param', 'm_name')"/></xts:param></xts:string></label>
- </dp:description>
- </dp:header>
-
- <xsl:variable name="bool_overrideOptions" select="/root/env/param[@name=concat('overrideOptions_',$booleanType)]"/>
- <xsl:variable name="bool_serviceDefault" select="/root/env/param[@name=concat('serviceDefaultOptions_',$booleanType)]"/>
- <utml:radio-group name="choice">
- <utml:prefix><xsl:value-of select="concat('m_opt_bool_',$booleanType)"/></utml:prefix>
- <utml:default-value>
- <xsl:choose>
- <xsl:when test="$bool_overrideOptions = 'true'">
- <xsl:value-of select="'true'"/>
- </xsl:when>
- <xsl:when test="$bool_overrideOptions = 'false'">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'custom'"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:default-value>
- <dp:choice id="ctrl_{concat('m_opt_bool_',$booleanType)}_radioGroup">
- <dp:section1>
- <utml:input type="radio" value="false" id="never" onclick="toggleOverride(true)"/>
- <xsl:if test="$form-read-only = 'true'">
- <xsl:attribute name="disabled">true</xsl:attribute>
- </xsl:if>
- </dp:section1>
- <dp:section2>
- <label for="never"><xts:string id="IDS_BOO_SUPPORT_NEVER"/></label>
- </dp:section2>
- <dp:section1>
- <utml:input type="radio" value="true" id="always" onclick="toggleOverride(true)">
- <xsl:if test="$form-read-only = 'true'">
- <xsl:attribute name="disabled">true</xsl:attribute>
- </xsl:if>
- </utml:input>
- </dp:section1>
- <dp:section2>
- <label for="always"><xts:string id="IDS_BOO_SUPPORT_ALWAYS"/></label>
- </dp:section2>
- <dp:section1>
- <utml:input type="radio" value="custom" id="custom" onclick="toggleOverride(false)">
- <xsl:if test="$form-read-only = 'true'">
- <xsl:attribute name="disabled">true</xsl:attribute>
- </xsl:if>
- </utml:input>
- </dp:section1>
- <dp:section2>
- <label for="custom"><xts:string id="IDS_BOO_SUPPORT_DECIDE"/></label>
- </dp:section2>
- <dp:section1/>
- <dp:section2>
- <xsl:variable name="boolOverrideSelected"><xsl:value-of select="concat($booleanType,'m_opt_bool_choice_override_selected')"/></xsl:variable>
- <xsl:variable name="boolSelection" select="/root/env/param[@name=concat($booleanType,'m_opt_bool_choice')]"/>
- <label for="optBoolOverrideSelected"><xsl:text><xts:string id="IDS_BOO_DEFAULT"/></xsl:text></label>
- <utml:select id="optBoolOverrideSelected" style="margin-left:3px">
- <utml:name><xsl:value-of select="$boolOverrideSelected"/></utml:name>
- <xsl:if test="$form-read-only = 'true' or ($boolSelection and not($boolSelection='custom')) or (not($boolSelection) and count($bool_overrideOptions) = 1)">
- <xsl:attribute name="disabled">true</xsl:attribute>
- </xsl:if>
- <utml:option value="false">
- <xsl:if test="$bool_serviceDefault='false'">
- <xsl:attribute name="selected">selected</xsl:attribute>
- </xsl:if>
- <xts:string id="IDS_BOO_SUPPORT_ENABLE_NOT_SELECTED"/>
- </utml:option>
- <utml:option value="true">
- <xsl:if test="$bool_serviceDefault='true'">
- <xsl:attribute name="selected">selected</xsl:attribute>
- </xsl:if>
- <xts:string id="IDS_BOO_SUPPORT_ENABLE_SELECTED"/>
- </utml:option>
- </utml:select>
- </dp:section2>
- </dp:choice>
- </utml:radio-group>
- <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:stylesheet>
- </xts:block>
-
- <!-- Debug -->
- <xts:block id="debug" type="exec" dependency="render" 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>
|