threshold.xts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2012
  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/" resolverBase="cogadmin">
  13. <xts:block id="frag_init" nodelist="env, credential" type="exec" mode="interpret" processor="XSLT" path="cogadmin/logicsheets/fragment_init.xslt" condition=".[not(/root/env/param[@name='frag-directive']='meta-only')]" mandatory="true"/>
  14. <xts:block id="getMeta" type="exec" mode="interpret" nodelist="env" processor="XSLT">
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  18. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  19. xmlns:meta="http://developer.cognos.com/schemas/xts/cogadmin/logicsheet/meta"
  20. exclude-result-prefixes="xsl xts xos xtsext meta">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  23. <xsl:template match="/">
  24. <xts:sequence>
  25. <xts:append select="/root/output">
  26. <xos:part>
  27. <xos:entityHeader>
  28. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  29. </xos:entityHeader>
  30. <xos:entityBody>
  31. <fragment>
  32. <meta:threshold/>
  33. </fragment>
  34. </xos:entityBody>
  35. </xos:part>
  36. </xts:append>
  37. </xts:sequence>
  38. </xsl:template>
  39. </xsl:stylesheet>
  40. </xts:block>
  41. <xts:block id="renderMarkup" dependency="frag_init getMeta" type="exec" processor="XSLT" mandatory="false" condition=".[ not(/root/env/param[@name = 'processRequest']) or (/root/env/param[@name = 'processRequest'] != 'true') ]">
  42. <xsl:stylesheet version="1.0"
  43. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  44. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  45. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  46. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  47. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  48. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  49. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  50. exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV bus wsrf-rp">
  51. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  52. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  53. <xsl:template match="/">
  54. <xts:sequence>
  55. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  56. <library type="text/javascript" href="$WEB$/ccl/helpDocs.js"/>
  57. <xts:append>
  58. <xsl:variable name="thresholdPropertyName" select="/root/env/param[@name = 'thresholdPropertyName']"/>
  59. <xsl:variable name="thresholdResourceID" select="/root/env/param[@name = 'thresholdResourceID']"/>
  60. <xsl:variable name="processRequest" select="/root/env/param[@name = '_THIS__processRequest']"/>
  61. <thresholds>
  62. <xts:request protocol="ReadThresholds">
  63. <SOAP-ENV:Envelope
  64. xmlns:nemo="http://developer.cognos.com/nemo"
  65. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  66. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  67. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  68. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  69. <SOAP-ENV:Header>
  70. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  71. <cogadminHeader>
  72. <ResourceIdentifier><xsl:value-of select="$thresholdResourceID"/></ResourceIdentifier>
  73. </cogadminHeader>
  74. </SOAP-ENV:Header>
  75. <SOAP-ENV:Body>
  76. <resource-prop:ReadThresholds xmlns:resource-prop="http://developer.cognos.com/admin/properties">
  77. <resource-prop:ResourceProperty><xsl:value-of select="$thresholdPropertyName"/></resource-prop:ResourceProperty>
  78. </resource-prop:ReadThresholds>
  79. </SOAP-ENV:Body>
  80. </SOAP-ENV:Envelope>
  81. </xts:request>
  82. </thresholds>
  83. </xts:append>
  84. <markup>
  85. <mimeType>text/html</mimeType>
  86. <markupXml>
  87. <!-- render the HTML -->
  88. <xts:transform src="/cogadmin/transforms/presentation/renderFragment.xslt" processor="XSLT">
  89. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  90. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  91. <root>
  92. <!-- Generate UI markup -->
  93. <xts:transform src="/cogadmin/controls/transforms/gen-ui-markup/threshold.xslt" processor="XSLT">
  94. <xts:param name="messageBase">/messages/cogadminuimsgs.xml</xts:param>
  95. <xts:param name="logicsheet">/cogadmin/logicsheets/presentation/common.xslt</xts:param>
  96. <xts:param name="logicsheet">/cogadmin/logicsheets/admin.xslt</xts:param>
  97. <root>
  98. <xts:queryNode select="/root/thresholds | /root/env | /root/metadata | /root/system | /root/user"/>
  99. <contentLocale>
  100. <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
  101. </contentLocale>
  102. </root>
  103. </xts:transform>
  104. <xts:queryNode select="/root/thresholds | /root/system | /root/session | root/user"/>
  105. </root>
  106. </xts:transform>
  107. </markupXml>
  108. </markup>
  109. </xts:append>
  110. </xts:sequence>
  111. </xsl:template>
  112. </xsl:stylesheet>
  113. </xts:block>
  114. <xts:block id="processRequest" dependency="frag_init" type="exec" processor="XSLT" mandatory="false" condition=".[ /root/env/param[@name = 'processRequest'] = 'true' ]">
  115. <xsl:stylesheet version="1.0"
  116. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  117. xmlns:ui="http://developer.cognos.com/schemas/ui/presentation/markup/"
  118. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  119. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  120. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  121. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  122. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  123. exclude-result-prefixes="xsl ui xos xtsext SOAP-ENV bus wsrf-rp">
  124. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  125. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  126. <xsl:template match="/">
  127. <xts:sequence>
  128. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/fragment">
  129. <markup>
  130. <mimeType>text/html</mimeType>
  131. <markupXml>
  132. <root>
  133. <xsl:variable name="deleteThreshold" select="key('env-param', 'deleteThreshold')"/>
  134. <xsl:variable name="thresholdPropertyName" select="/root/env/param[@name = 'thresholdPropertyName']"/>
  135. <xsl:variable name="thresholdResourceID" select="/root/env/param[@name = 'thresholdResourceID']"/>
  136. <xsl:variable name="upperSidePoor" select="key('env-param', 'UpperSidePoor')"/>
  137. <xsl:variable name="upperSideAverage" select="key('env-param', 'UpperSideAverage')"/>
  138. <xsl:variable name="lowerSidePoor" select="key('env-param', 'LowerSidePoor')"/>
  139. <xsl:variable name="lowerSideAverage" select="key('env-param', 'LowerSideAverage')"/>
  140. <xsl:variable name="upperPoorExclusive" select="key('env-param', 'UpperPoorEx') = 'true'"/>
  141. <xsl:variable name="upperAverageExclusive" select="key('env-param', 'UpperAverageEx') = 'true'"/>
  142. <xsl:variable name="lowerPoorExclusive" select="key('env-param', 'LowerPoorEx') = 'true'"/>
  143. <xsl:variable name="lowerAverageExclusive" select="key('env-param', 'LowerAverageEx') = 'true'"/>
  144. <xsl:choose>
  145. <xsl:when test="$deleteThreshold = 'true'">
  146. <xsl:call-template name="clearThresholds">
  147. <xsl:with-param name="resourceID" select="$thresholdResourceID"/>
  148. <xsl:with-param name="propertyName" select="$thresholdPropertyName"/>
  149. </xsl:call-template>
  150. </xsl:when>
  151. <xsl:when test="$deleteThreshold = '' or $deleteThreshold != 'true'">
  152. <xsl:call-template name="writeThresholds">
  153. <xsl:with-param name="resourceID" select="$thresholdResourceID"/>
  154. <xsl:with-param name="propertyName" select="$thresholdPropertyName"/>
  155. <xsl:with-param name="upperSidePoor" select="$upperSidePoor"/>
  156. <xsl:with-param name="upperSideAverage" select="$upperSideAverage"/>
  157. <xsl:with-param name="lowerSidePoor" select="$lowerSidePoor"/>
  158. <xsl:with-param name="lowerSideAverage" select="$lowerSideAverage"/>
  159. <xsl:with-param name="upperSidePoorExclusive" select="$upperPoorExclusive"/>
  160. <xsl:with-param name="upperSideAverageExclusive" select="$upperAverageExclusive"/>
  161. <xsl:with-param name="lowerSidePoorExclusive" select="$lowerPoorExclusive"/>
  162. <xsl:with-param name="lowerSideAverageExclusive" select="$lowerAverageExclusive"/>
  163. </xsl:call-template>
  164. </xsl:when>
  165. </xsl:choose>
  166. <xts:queryNode select="/root/env | /root/metadata | /root/system "/>
  167. <contentLocale>
  168. <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
  169. </contentLocale>
  170. </root>
  171. </markupXml>
  172. </markup>
  173. </xts:append>
  174. </xts:sequence>
  175. </xsl:template>
  176. <xsl:template name="writeThresholds">
  177. <xsl:param name="resourceID" select="''"/>
  178. <xsl:param name="propertyName" select="''"/>
  179. <xsl:param name="upperSidePoor" select="''"/>
  180. <xsl:param name="upperSideAverage" select="''"/>
  181. <xsl:param name="lowerSidePoor" select="''"/>
  182. <xsl:param name="lowerSideAverage" select="''"/>
  183. <xsl:param name="upperSidePoorExclusive" select="'false'"/>
  184. <xsl:param name="upperSideAverageExclusive" select="'false'"/>
  185. <xsl:param name="lowerSidePoorExclusive" select="'false'"/>
  186. <xsl:param name="lowerSideAverageExclusive" select="'false'"/>
  187. <xts:request protocol="WriteThresholds">
  188. <SOAP-ENV:Envelope
  189. xmlns:nemo="http://developer.cognos.com/nemo"
  190. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  191. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  192. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  193. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  194. <SOAP-ENV:Header>
  195. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  196. <cogadminHeader xmlns="http://developer.cognos.com/nemo">
  197. <ResourceIdentifier><xsl:value-of select="$resourceID"/></ResourceIdentifier>
  198. </cogadminHeader>
  199. </SOAP-ENV:Header>
  200. <SOAP-ENV:Body>
  201. <resource-prop:WriteThresholds xmlns:resource-prop="http://developer.cognos.com/admin/properties">
  202. <resource-prop:ResourceProperty><xsl:value-of select="$propertyName"/></resource-prop:ResourceProperty>
  203. <resource-prop:UpperSidePoor exclusive="{$upperSidePoorExclusive}"><xsl:value-of select="$upperSidePoor"/></resource-prop:UpperSidePoor>
  204. <resource-prop:UpperSideAverage exclusive="{$upperSideAverageExclusive}"><xsl:value-of select="$upperSideAverage"/></resource-prop:UpperSideAverage>
  205. <resource-prop:LowerSideAverage exclusive="{$lowerSideAverageExclusive}"><xsl:value-of select="$lowerSideAverage"/></resource-prop:LowerSideAverage>
  206. <resource-prop:LowerSidePoor exclusive="{$lowerSidePoorExclusive}"><xsl:value-of select="$lowerSidePoor"/></resource-prop:LowerSidePoor>
  207. </resource-prop:WriteThresholds>
  208. </SOAP-ENV:Body>
  209. </SOAP-ENV:Envelope>
  210. </xts:request>
  211. </xsl:template>
  212. <xsl:template name="clearThresholds">
  213. <xsl:param name="resourceID" select="''"/>
  214. <xsl:param name="propertyName" select="''"/>
  215. <xts:request protocol="ClearThresholds">
  216. <SOAP-ENV:Envelope
  217. xmlns:nemo="http://developer.cognos.com/nemo"
  218. xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
  219. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  220. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  221. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  222. <SOAP-ENV:Header>
  223. <xsl:copy-of select="/root/header/bus:biBusHeader"/>
  224. <cogadminHeader xmlns="http://developer.cognos.com/nemo">
  225. <ResourceIdentifier><xsl:value-of select="$resourceID"/></ResourceIdentifier>
  226. </cogadminHeader>
  227. </SOAP-ENV:Header>
  228. <SOAP-ENV:Body>
  229. <resource-prop:ClearThresholds xmlns:resource-prop="http://developer.cognos.com/admin/properties">
  230. <resource-prop:ResourceProperty><xsl:value-of select="$propertyName"/></resource-prop:ResourceProperty>
  231. </resource-prop:ClearThresholds>
  232. </SOAP-ENV:Body>
  233. </SOAP-ENV:Envelope>
  234. </xts:request>
  235. </xsl:template>
  236. </xsl:stylesheet>
  237. </xts:block>
  238. </xts:morphlet>