ui_overrides.xslt 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ##############################################################################
  4. # Copyright (C) 2011 HPCC Systems.
  5. #
  6. # All rights reserved. This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as
  8. # published by the Free Software Foundation, either version 3 of the
  9. # License, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. ##############################################################################
  19. -->
  20. <!DOCTYPE xsl:stylesheet [
  21. <!--define the HTML non-breaking space:-->
  22. <!ENTITY nbsp "<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>">
  23. ]>
  24. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  25. <xsl:output method="html" encoding="UTF-8"/>
  26. <!--define line feed character-->
  27. <xsl:variable name="LF"><xsl:text>
  28. </xsl:text>
  29. </xsl:variable>
  30. <!--the following template matches a schema node -->
  31. <xsl:template match="*" mode="override">
  32. <xsl:param name="objNode"/>
  33. <xsl:param name="columnHeader"/>
  34. <xsl:param name="rowId"/>
  35. <xsl:variable name="name" select="name()"/>
  36. <xsl:if test="not($columnHeader)">
  37. <xsl:choose>
  38. <xsl:when test="$Command='DeployMultiple'">
  39. <xsl:choose>
  40. <xsl:when test="$name='ImportAllModules' or $name='ImportImplicitModules'">
  41. <xsl:variable name="pos" select="number(substring-after($rowId, 'Requests.Deploy.'))+1"/>
  42. <xsl:variable name="depNode"
  43. select="$objNode/../.. | $objRootNode/Requests/Deploy[not($objNode)][$pos]"/>
  44. <xsl:if test="starts-with($depNode/Info/SourceRepositoryType, 'R')">
  45. <xsl:attribute name="disabled">true</xsl:attribute>
  46. </xsl:if>
  47. </xsl:when>
  48. <xsl:when test="$name='input' and @name='submitBtnCheck'">
  49. <xsl:variable name="req" select="$objRootNode/Requests"/>
  50. <xsl:if test="string($objRootNode/Checkable)='0' or not($req/Deploy[1])">
  51. <xsl:attribute name="disabled">true</xsl:attribute>
  52. </xsl:if>
  53. <xsl:attribute name="value">
  54. <xsl:text>Check</xsl:text>
  55. <xsl:if test="$req/Deploy[2]"> All</xsl:if>
  56. </xsl:attribute>
  57. </xsl:when>
  58. <xsl:when test="$name='input' and @name='submitBtnDeploy'">
  59. <xsl:variable name="req" select="$objRootNode/Requests"/>
  60. <xsl:if test="(string($objRootNode/AllDeployable)='0' and string($objRootNode/Checkable)='1') or not($req/Deploy[1])">
  61. <xsl:attribute name="disabled">true</xsl:attribute>
  62. </xsl:if>
  63. <xsl:attribute name="value">
  64. <xsl:text>Deploy</xsl:text>
  65. <xsl:if test="$req/Deploy[2]"> All</xsl:if>
  66. </xsl:attribute>
  67. </xsl:when>
  68. </xsl:choose>
  69. </xsl:when>
  70. <xsl:when test="$Command='ListSuperFilesUsedByQuery' and $name='Name'">
  71. <xsl:variable name="desc" select="$objNode/../Description"/>
  72. <xsl:if test="string($desc)!=''">
  73. <br/>
  74. <xsl:value-of select="$desc"/>
  75. </xsl:if>
  76. </xsl:when>
  77. </xsl:choose>
  78. </xsl:if>
  79. </xsl:template>
  80. <!--the following template matches a schema node -->
  81. <xsl:template match="*" mode="overrideCell">
  82. <xsl:param name="objNode"/>
  83. <xsl:param name="columnHeader"/>
  84. <xsl:param name="rowId"/>
  85. <xsl:variable name="name" select="name()"/>
  86. <xsl:if test="not($columnHeader)">
  87. <xsl:choose>
  88. <xsl:when test="$name='highPriority' and $Command='DeployMultiple'">
  89. <xsl:variable name="pos" select="number(substring-after($rowId, 'Requests.Deploy'))+1"/>
  90. <xsl:variable name="depNode"
  91. select="$objNode/../.. | $objRootNode/Requests/Deploy[not($objNode)][$pos]"/>
  92. <xsl:variable name="highPriority">
  93. <xsl:choose>
  94. <xsl:when test="$objNode">
  95. <xsl:value-of select="$objNode"/>
  96. </xsl:when>
  97. <xsl:otherwise>1</xsl:otherwise>
  98. </xsl:choose>
  99. </xsl:variable>
  100. <xsl:variable name="wuHighPriority">
  101. <xsl:choose>
  102. <xsl:when test="$depNode/WorkunitHighPriority">
  103. <xsl:value-of select="$depNode/WorkunitHighPriority"/>
  104. </xsl:when>
  105. <xsl:otherwise>1</xsl:otherwise>
  106. </xsl:choose>
  107. </xsl:variable>
  108. <xsl:if test="$wuHighPriority!=$highPriority">
  109. <xsl:variable name="priority">
  110. <xsl:choose>
  111. <xsl:when test="$wuHighPriority='1'">High</xsl:when>
  112. <xsl:otherwise>Low</xsl:otherwise>
  113. </xsl:choose>
  114. </xsl:variable>
  115. <xsl:attribute name="style">background-color:orange</xsl:attribute>
  116. <xsl:attribute name="onmouseover">EnterContent('ToolTip', null, '<xsl:value-of select="$priority"/> priority was specified by ECL!', true); Activate();</xsl:attribute>
  117. <xsl:attribute name="onmouseout">deActivate()</xsl:attribute>
  118. </xsl:if>
  119. </xsl:when>
  120. <xsl:when test="$Command='SetupSuperFilesRemap'">
  121. <xsl:choose>
  122. <xsl:when test="$name='RemapInfo'">
  123. <xsl:variable name="outerRowId" select="substring-before($rowId, '.RemapInfo')"/>
  124. <div style="text-align:left">
  125. <b>&nbsp;
  126. <a id="{$outerRowId}.Link" href="" onclick="return onShowHideSourceFileTable(this, '{$outerRowId}')">
  127. <img src="{$filePath}/img/folder.gif" style="vertical-align:text-bottom" border="0"/>
  128. <xsl:text>Source Files:</xsl:text>
  129. </a>
  130. </b>
  131. </div>
  132. <table id="{$outerRowId}.SourceFiles" class="left-aligned-table" style="display:none" width="800">
  133. <thead>
  134. <tr class="blue-bottom">
  135. <th width="25">
  136. &nbsp;
  137. <script type="text/javascript">
  138. var ms = ms_create('<xsl:value-of select="$outerRowId"/>.SourceFiles', onRowCheck ); ms.b_singleSelect = true;
  139. </script>
  140. </th>
  141. <th width="675">Description</th>
  142. <th width="100">Version</th>
  143. </tr>
  144. </thead>
  145. <tbody>
  146. </tbody>
  147. </table>
  148. </xsl:when>
  149. </xsl:choose>
  150. </xsl:when>
  151. </xsl:choose>
  152. </xsl:if>
  153. </xsl:template>
  154. </xsl:stylesheet>