modify_rules_sequence.xts 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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, 2013
  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/" 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. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init">
  20. <xts:logicsheet path="logicsheets/portal.xsl"/>
  21. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  22. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  23. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  24. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  25. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  26. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  27. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  28. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  29. <xsl:stylesheet version="1.0"
  30. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  31. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  32. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  33. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  34. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  35. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  36. xmlns:st="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/specializetabs/"
  37. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  38. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  39. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  40. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  41. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  42. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  43. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  44. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  45. exclude-result-prefixes="xsl cm pf lyt dp df st cf cp bus cml dbg utml xtsext xts">
  46. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  47. <!-- current file name -->
  48. <xsl:variable name="mname" select="'modify_rules_sequence.xts'"/>
  49. <!-- add any theme variables -->
  50. <pf:variables/>
  51. <xsl:variable name="browserTitle">
  52. <xts:string id="IDS_MRS_TITLE"/>
  53. </xsl:variable>
  54. <!-- start the output -->
  55. <xsl:template match="/root">
  56. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  57. <dp:meta>
  58. <pf:meta/>
  59. <!-- Standard meta tags -->
  60. </dp:meta>
  61. <dp:script>
  62. <pf:help context="HID_SCHEDULE_MULTIPLE"/>
  63. <!-- Help system -->
  64. <script language="javascript">
  65. var rulesList = new Array();
  66. <xsl:variable name="ruleCount" select="count(/root/env/param[starts-with(@name,'rule_package_')])"/>
  67. <xsl:for-each select="/root/env/param[starts-with(@name,'rule_package_')]">
  68. <xsl:sort select="substring-after(@name,'rule_package_')" data-type="number"/>
  69. <xsl:variable name="displayName">
  70. <xsl:call-template name="buildDisplayName">
  71. <xsl:with-param name="rulePosition" select="position()"/>
  72. </xsl:call-template>
  73. </xsl:variable>
  74. rulesList[<xsl:value-of select="(position() - 1)"/>] = new Array("<xsl:value-of select="$ruleCount - (position() - 1)"/>", "<xsl:value-of select="xtsext:javascriptencode(string($displayName))"/>", "<xsl:value-of select="position()"/>", "", "", "");
  75. </xsl:for-each>
  76. function setValues()
  77. {
  78. var selectList = document.pform.entriesSortOrder;
  79. var sortArray = rulesList;
  80. if (selectList)
  81. {
  82. for (var i=0; i &lt; selectList.options.length; i++)
  83. {
  84. positionInArray = selectList[i].value;
  85. dispSeq = i+1;
  86. selectList[i].value = dispSeq + ',' + sortArray[positionInArray][2];
  87. selectList[i].selected = true;
  88. }
  89. }
  90. }
  91. </script>
  92. </dp:script>
  93. <utml:form name="pform" method="post" action="{$gateway}">
  94. <!-- dialog header -->
  95. <dp:header>
  96. <!-- header titles-->
  97. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  98. </dp:header>
  99. <utml:input type="hidden" name="visited_modify_sequence" value="true" utml:update="false"/>
  100. <lyt:layout style="1" border="no">
  101. <lyt:section>
  102. <dp:list title="IDS_SRR_ROUTING_RULES" for="ctrl_entriesSortOrder">
  103. <dp:section>
  104. <dp:text>
  105. <cf:sortList name="entriesSortOrder" form="pform" array="rulesList" size="15" id="ctrl_entriesSortOrder">
  106. <cf:initContent>
  107. <xsl:attribute name="style"><xsl:value-of select="'width:550'"/></xsl:attribute>
  108. <xsl:for-each select="/root/env/param[starts-with(@name,'rule_package_')]">
  109. <xsl:sort select="substring-after(@name,'rule_package_')" data-type="number"/>
  110. <utml:option>
  111. <xsl:attribute name="value"><xsl:value-of select="(position() - 1)"/></xsl:attribute>
  112. <xsl:call-template name="buildDisplayName">
  113. <xsl:with-param name="rulePosition" select="position()"/>
  114. </xsl:call-template>
  115. </utml:option>
  116. </xsl:for-each>
  117. </cf:initContent>
  118. </cf:sortList>
  119. </dp:text>
  120. </dp:section>
  121. </dp:list>
  122. </lyt:section>
  123. </lyt:layout>
  124. <dp:footer>
  125. <df:button df:id="IDS_OK" utml:validate="false" df:style="stack-down-save" onclick="javascript:setValues()"/>
  126. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  127. </dp:footer>
  128. </utml:form>
  129. </dp:page>
  130. </xsl:template>
  131. <xsl:template name="buildDisplayName">
  132. <xsl:param name="rulePosition"/>
  133. <xsl:choose>
  134. <xsl:when test="normalize-space(key('env-param',concat('rule_package_',$rulePosition))) != ''">
  135. <xsl:text/><xts:string id="IDS_MRS_PACKAGE_RULE"><xts:param name="package"><xsl:value-of select="key('env-param',concat('rule_package_',$rulePosition))"/></xts:param></xts:string><xsl:text/>
  136. </xsl:when>
  137. <xsl:otherwise>
  138. <xsl:text/><xts:string id="IDS_MRS_ANY_PACKAGE"/><xsl:text/>
  139. </xsl:otherwise>
  140. </xsl:choose>
  141. <xsl:value-of select="' - '"/>
  142. <xsl:choose>
  143. <xsl:when test="normalize-space(key('env-param',concat('rule_group_',$rulePosition))) != ''">
  144. <xsl:text/><xts:string id="IDS_MRS_GROUP_RULE"><xts:param name="group"><xsl:value-of select="key('env-param',concat('rule_group_',$rulePosition))"/></xts:param></xts:string><xsl:text/>
  145. </xsl:when>
  146. <xsl:otherwise>
  147. <xsl:text/><xts:string id="IDS_MRS_ANY_GROUP"/><xsl:text/>
  148. </xsl:otherwise>
  149. </xsl:choose>
  150. <xsl:value-of select="' - '"/>
  151. <xsl:choose>
  152. <xsl:when test="normalize-space(key('env-param',concat('rule_role_',$rulePosition))) != ''">
  153. <xsl:text/><xts:string id="IDS_MRS_ROLE_RULE"><xts:param name="role"><xsl:value-of select="key('env-param',concat('rule_role_',$rulePosition))"/></xts:param></xts:string><xsl:text/>
  154. </xsl:when>
  155. <xsl:otherwise>
  156. <xsl:text/><xts:string id="IDS_MRS_ANY_ROLE"/><xsl:text/>
  157. </xsl:otherwise>
  158. </xsl:choose>
  159. <xsl:value-of select="' => '"/>
  160. <xsl:choose>
  161. <xsl:when test="normalize-space(key('env-param',concat('rule_server_group_',$rulePosition))) != ''">
  162. <xsl:text/><xts:string id="IDS_MRS_SERVER_GROUP_RULE"><xts:param name="servergroup"><xsl:value-of select="key('env-param',concat('rule_server_group_',$rulePosition))"/></xts:param></xts:string><xsl:text/>
  163. </xsl:when>
  164. <xsl:otherwise>
  165. <xsl:text/><xts:string id="IDS_MRS_NO_SERVER_GROUP"/><xsl:text/>
  166. </xsl:otherwise>
  167. </xsl:choose>
  168. </xsl:template>
  169. </xsl:stylesheet>
  170. </xts:block>
  171. <!--
  172. ===============================================================================================
  173. debug - display debug information
  174. ===============================================================================================
  175. -->
  176. <xts:block id="debug" dependency="format" condition=".[/root/session/param[@name='debug'] = '1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  177. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  178. <!-- debug logic sheet -->
  179. <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">
  180. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  181. <dbg:templates/>
  182. <!-- add any debug templates -->
  183. <xsl:template match="/">
  184. <dbg:dumpxml select="/root"/>
  185. </xsl:template>
  186. </xsl:stylesheet>
  187. </xts:block>
  188. </xts:morphlet>