set_commands.xts 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" messageBase="messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ===============================================================================================
  21. renderPage - render the page
  22. ===============================================================================================
  23. -->
  24. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init">
  25. <!-- get the presentation theme -->
  26. <xts:logicsheet path="logicsheets/portal.xsl"/>
  27. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  28. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  29. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  30. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  31. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  32. <!-- apply the form logic -->
  33. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  34. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  35. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  36. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  37. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  38. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  39. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  40. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  41. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  42. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  43. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  44. exclude-result-prefixes="xsl cf cp pf df dp lyt utml">
  45. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  46. <!-- current file name -->
  47. <xsl:variable name="mname" select="'set_commands.xts'"/>
  48. <!-- add any theme variables -->
  49. <pf:variables/>
  50. <!-- start the output -->
  51. <xsl:template match="/root">
  52. <xsl:variable name="backURL" select="key('env-param','backURL')"/>
  53. <!--
  54. IMPORTANT: This logic to set the commandToEdit variable fixes a sev 2 XSS scripting issue #COGCQ00587230
  55. Do not change it or implement correctly the way the command to edit should be treated
  56. in this page:
  57. - names of the input fields should not be generated from submitted values
  58. - the current command to edit is stored in a hidden input and sends backs to the
  59. calling page with the new value and/or a flag indicating if the value was changed
  60. -->
  61. <xsl:variable name="commandToEdit">
  62. <xsl:variable name="submittedCommand" select="key('env-param','commandToEdit')"/>
  63. <xsl:choose>
  64. <xsl:when test="contains(' openConnectionCommands openSessionCommands closeSessionCommands closeConnectionCommands ',concat(' ',$submittedCommand,' '))">
  65. <xsl:value-of select="$submittedCommand"/>
  66. </xsl:when>
  67. <xsl:otherwise></xsl:otherwise>
  68. </xsl:choose>
  69. </xsl:variable>
  70. <!-- select="key('env-param','commandToEdit')"/>-->
  71. <xsl:variable name="browserTitle">
  72. <xsl:choose>
  73. <xsl:when test="$commandToEdit != ''">
  74. <xts:string id="IDS_SET_COMMANDS_TITLE">
  75. <xts:param name="commandDisplayString"><xsl:value-of select="/root/env/param[@name=concat('m_display_cbp_',$commandToEdit)]"/></xts:param>
  76. </xts:string>
  77. </xsl:when>
  78. <xsl:otherwise>
  79. <xts:string id="IDS_SET_COMMANDS_GENERIC_TITLE"/>
  80. </xsl:otherwise>
  81. </xsl:choose>
  82. </xsl:variable>
  83. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  84. <dp:meta>
  85. <!-- Standard meta tags -->
  86. <pf:meta/>
  87. </dp:meta>
  88. <dp:script>
  89. <!-- Help system -->
  90. <pf:help context="HID_DATABASE_COMMANDS"/>
  91. <script language="javascript">
  92. <xsl:if test="key('env-param','from_bmt')!=''">
  93. <!-- Called only when canceling back to BMT environment. -->
  94. function doCancel()
  95. {
  96. window.external.OnClose(1);
  97. }
  98. </xsl:if>
  99. </script>
  100. </dp:script>
  101. <utml:form name="pform" method="post" action="{$gateway}">
  102. <dp:header>
  103. <!-- header titles-->
  104. <dp:title><xsl:value-of select="normalize-space($browserTitle)"/></dp:title>
  105. <dp:description>
  106. <xts:string id="IDS_SET_COMMANDS_DESCRIPTION"/>
  107. </dp:description>
  108. <dp:close>
  109. <xsl:choose>
  110. <xsl:when test="key('env-param','from_bmt')">
  111. <a href="javascript:doCancel()">
  112. <dp:closeMarker/>
  113. </a>
  114. </xsl:when>
  115. <xsl:otherwise>
  116. <a href="{$backURL}">
  117. <dp:closeMarker/>
  118. </a>
  119. </xsl:otherwise>
  120. </xsl:choose>
  121. </dp:close>
  122. </dp:header>
  123. <lyt:layout style="1">
  124. <lyt:section>
  125. <dp:input>
  126. <dp:section1 for="ctrl_m_cbp_edit_{$commandToEdit}">
  127. <xts:string id="IDS_PROP_XML_DATABASE_COMMANDS"/>
  128. </dp:section1>
  129. <dp:section2>
  130. <utml:textarea cols="50" rows="13" style="width: 600px; height: 200px;" utml:track="true" id="ctrl_m_cbp_edit_{$commandToEdit}">
  131. <utml:name><xsl:value-of select="concat('m_cbp_edit_',$commandToEdit)"/></utml:name>
  132. <utml:value><xsl:value-of select="/root/env/param[@name=concat('m_cbp_',$commandToEdit)]"/></utml:value>
  133. </utml:textarea >
  134. </dp:section2>
  135. </dp:input>
  136. </lyt:section>
  137. </lyt:layout>
  138. <dp:footer>
  139. <!-- Cancel button -->
  140. <df:button df:id="IDS_OK" df:style="stack-down-save"/>
  141. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  142. </dp:footer>
  143. </utml:form>
  144. </dp:page>
  145. </xsl:template>
  146. </xsl:stylesheet>
  147. </xts:block>
  148. <!--
  149. ===============================================================================================
  150. debug - display debug information
  151. ===============================================================================================
  152. -->
  153. <xts:block id="debug" dependency="render_page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  154. <!-- get the debug logic sheet -->
  155. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  156. <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">
  157. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  158. <xsl:template match="/">
  159. <dbg:dumpxml select="/root"/>
  160. </xsl:template>
  161. </xsl:stylesheet>
  162. </xts:block>
  163. </xts:morphlet>