ui_overrides.xslt 7.8 KB

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