rdsad.xsl 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ASV
  5. (C) Copyright IBM Corp. 2005, 2015
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!-- This stylesheet defines global portal variables and templates. -->
  9. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="dummy-uri" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:rdsad="http://developer.cognos.com/schemas/xts/rdsad/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" exclude-result-prefixes="xsl xtsext xts rdsad dp utml cf cp cm">
  10. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  11. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  12. <!--
  13. This stylesheet (rss.xslt) consists of the following templates:
  14. rss:conditionDisplay
  15. rss:emailDisplay
  16. -->
  17. <!--
  18. Template - rss:conditionDisplay:
  19. -->
  20. <xsl:template match="rdsad:conditionDisplay">
  21. <out:variable name="metricWatchRule" select="boolean(/root/env/param[@name='m_sub_type'] = 'metric')"/>
  22. <out:variable name="measureName" select="/root/env/param[@name='m_subData_measure_name']"/>
  23. <table cellpadding="0" cellspacing="0" border="0" role="presentation">
  24. <tr>
  25. <td class="formLabel" nowrap="nowrap">
  26. <out:text>
  27. <xts:string id="IDS_CUSTSUB_CONDITION_CONTEXT"/>
  28. </out:text>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td>
  33. <table cellpadding="0" cellspacing="0" border="0" role="radiogroup">
  34. <tr>
  35. <td>
  36. <input type="radio" name="m_sub_type" id="m_sub_type_nonMetric" value="nonMetric" onclick="nonMetricClicked()" role="radio">
  37. <out:if test="/root/env/param[@name='m_sub_type']='nonMetric' or not(/root/env/param[@name='m_sub_type'])">
  38. <out:attribute name="checked">
  39. <out:text>checked</out:text>
  40. </out:attribute>
  41. <out:attribute name="aria-checked"><out:text>true</out:text></out:attribute>
  42. </out:if>
  43. </input>
  44. </td>
  45. <td class="formText" nowrap="nowrap">
  46. <label for="m_sub_type_nonMetric">
  47. <xts:string id="IDS_CUSTSUB_CONDITION_REPORT">
  48. <xts:param name="reportName">
  49. <out:value-of select="/root/env/param[@name='m_subData_periodical_producer_defaultName']"/>
  50. </xts:param>
  51. </xts:string>
  52. </label>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td>
  57. </td>
  58. <td>
  59. <out:variable name="operatorDomain">
  60. <out:value-of select="/root/env/param[@name='m_subData_dtype_domain']"/>
  61. </out:variable>
  62. <out:variable name="conditionEnum">
  63. <out:choose>
  64. <out:when test="/root/env/param[@name='m_sub_operation']">
  65. <out:value-of select="/root/env/param[@name='m_sub_operation']"/>
  66. </out:when>
  67. <out:otherwise>
  68. <out:choose>
  69. <out:when test="$operatorDomain = 'numeric'">
  70. <out:text>greater_than</out:text>
  71. </out:when>
  72. <out:when test="$operatorDomain = 'string'">
  73. <out:text>contains</out:text>
  74. </out:when>
  75. </out:choose>
  76. </out:otherwise>
  77. </out:choose>
  78. </out:variable>
  79. <!--- have to figure out the initial value of the display and the initlal value of the hidden input -->
  80. <out:variable name="conditionText">
  81. <out:call-template name="conditionEnumLongValue">
  82. <out:with-param name="conditionEnum">
  83. <out:value-of select="$conditionEnum"/>
  84. </out:with-param>
  85. </out:call-template>
  86. </out:variable>
  87. <out:variable name="operatorPopup">
  88. <out:choose>
  89. <out:when test="$operatorDomain='string'">
  90. <flyout id="operatorPopup" height="10">
  91. <items>
  92. <itemGroup id="operatorGroup">
  93. <item id="contains">
  94. <text>
  95. <xts:string id="IDS_CUSTSUB_STRING_CONTAINS"/>
  96. </text>
  97. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_CONTAINS" encode="javascript"/>', 'contains');</action>
  98. </item>
  99. <item id="begins">
  100. <text>
  101. <xts:string id="IDS_CUSTSUB_STRING_BEGINS"/>
  102. </text>
  103. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_BEGINS" encode="javascript"/>', 'begins');</action>
  104. </item>
  105. <item id="ends">
  106. <text>
  107. <xts:string id="IDS_CUSTSUB_STRING_ENDS"/>
  108. </text>
  109. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_ENDS" encode="javascript"/>', 'ends');</action>
  110. </item>
  111. <item id="matches">
  112. <text>
  113. <xts:string id="IDS_CUSTSUB_STRING_MATCH"/>
  114. </text>
  115. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_MATCH" encode="javascript"/>', 'match');</action>
  116. </item>
  117. <item id="notContains">
  118. <text>
  119. <xts:string id="IDS_CUSTSUB_STRING_NOT_CONTAINS"/>
  120. </text>
  121. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_NOT_CONTAINS" encode="javascript"/>', 'not_contains');</action>
  122. </item>
  123. <item id="notBegins">
  124. <text>
  125. <xts:string id="IDS_CUSTSUB_STRING_NOT_BEGIN"/>
  126. </text>
  127. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_NOT_BEGIN" encode="javascript"/>', 'not_begin');</action>
  128. </item>
  129. <item id="notEnds">
  130. <text>
  131. <xts:string id="IDS_CUSTSUB_STRING_NOT_END"/>
  132. </text>
  133. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_NOT_END" encode="javascript"/>', 'not_end');</action>
  134. </item>
  135. <item id="notMatches">
  136. <text>
  137. <xts:string id="IDS_CUSTSUB_STRING_NOT_MATCH"/>
  138. </text>
  139. <action>setOperator('<xts:string id="IDS_CUSTSUB_STRING_NOT_MATCH" encode="javascript"/>', 'not_match');</action>
  140. </item>
  141. </itemGroup>
  142. </items>
  143. </flyout>
  144. </out:when>
  145. <out:when test="$operatorDomain='numeric'">
  146. <flyout id="operatorPopup" height="10">
  147. <items>
  148. <itemGroup id="operatorGroup">
  149. <item id="greaterThan">
  150. <text>
  151. <xts:string id="IDS_CUSTSUB_NUMERIC_GT"/>
  152. </text>
  153. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_GT" encode="javascript"/>', 'greater_than');</action>
  154. </item>
  155. <item id="lessThan">
  156. <text>
  157. <xts:string id="IDS_CUSTSUB_NUMERIC_LT"/>
  158. </text>
  159. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_LT" encode="javascript"/>', 'less_than');</action>
  160. </item>
  161. <item id="greaterThanEqualTo">
  162. <text>
  163. <xts:string id="IDS_CUSTSUB_NUMERIC_GTE"/>
  164. </text>
  165. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_GTE" encode="javascript"/>', 'greater_than_equal');</action>
  166. </item>
  167. <item id="lessThanEqualTo">
  168. <text>
  169. <xts:string id="IDS_CUSTSUB_NUMERIC_LTE"/>
  170. </text>
  171. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_LTE" encode="javascript"/>', 'less_than_equal');</action>
  172. </item>
  173. <item id="equal">
  174. <text>
  175. <xts:string id="IDS_CUSTSUB_NUMERIC_EQ"/>
  176. </text>
  177. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_EQ" encode="javascript"/>', 'equal');</action>
  178. </item>
  179. <item id="notEqual">
  180. <text>
  181. <xts:string id="IDS_CUSTSUB_NUMERIC_NEQ"/>
  182. </text>
  183. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_NEQ" encode="javascript"/>', 'not_equal');</action>
  184. </item>
  185. <item id="between">
  186. <text>
  187. <xts:string id="IDS_CUSTSUB_NUMERIC_BT"/>
  188. </text>
  189. <action>setOperator('<xts:string id="IDS_CUSTSUB_NUMERIC_BT" encode="javascript"/>', 'between');</action>
  190. </item>
  191. </itemGroup>
  192. </items>
  193. </flyout>
  194. </out:when>
  195. </out:choose>
  196. </out:variable>
  197. <out:call-template name="renderPopup">
  198. <out:with-param name="flyoutXML">
  199. <out:copy-of select="$operatorPopup"/>
  200. </out:with-param>
  201. <out:with-param name="controlID">operator_span</out:with-param>
  202. </out:call-template>
  203. <script type="text/javascript">
  204. var a11y_messages = new Object;
  205. function init() {
  206. setAriaLabelMessages('perfPattern_high');
  207. setAriaLabelMessages('perfPattern_medium');
  208. setAriaLabelMessages('perfPattern_low');
  209. }
  210. function setAriaLabelMessages(sPerfPattern) {
  211. if (sPerfPattern == 'perfPattern_high') {
  212. var aria_label_high_0_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_AVERAGE" encode="javascript"/>';
  213. var aria_label_high_1_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_GOOD" encode="javascript"/>';
  214. var aria_label_high_0_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_POOR" encode="javascript"/>';
  215. var aria_label_high_1_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_AVERAGE" encode="javascript"/>';
  216. addA11yMessages('m_sub_perfPattern_high_0',aria_label_high_0_lower,aria_label_high_0_upper);
  217. addA11yMessages('m_sub_perfPattern_high_1',aria_label_high_1_lower,aria_label_high_1_upper);
  218. document.pform.m_sub_perfPattern_high_0.setAttribute('aria-label',aria_label_high_0_upper);
  219. document.pform.m_sub_perfPattern_high_1.setAttribute('aria-label',aria_label_high_1_upper);
  220. } else if (sPerfPattern == 'perfPattern_medium') {
  221. var aria_label_medium_0_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_AVERAGE" encode="javascript"/>';
  222. var aria_label_medium_1_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_GOOD" encode="javascript"/>';
  223. var aria_label_medium_2_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_AVERAGE" encode="javascript"/>';
  224. var aria_label_medium_3_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_POOR" encode="javascript"/>';
  225. var aria_label_medium_0_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_POOR" encode="javascript"/>';
  226. var aria_label_medium_1_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_AVERAGE" encode="javascript"/>';
  227. var aria_label_medium_2_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_GOOD" encode="javascript"/>';
  228. var aria_label_medium_3_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_AVERAGE" encode="javascript"/>';
  229. addA11yMessages('m_sub_perfPattern_medium_0',aria_label_medium_0_lower,aria_label_medium_0_upper);
  230. addA11yMessages('m_sub_perfPattern_medium_1',aria_label_medium_1_lower,aria_label_medium_1_upper);
  231. addA11yMessages('m_sub_perfPattern_medium_2',aria_label_medium_2_lower,aria_label_medium_2_upper);
  232. addA11yMessages('m_sub_perfPattern_medium_3',aria_label_medium_3_lower,aria_label_medium_3_upper);
  233. document.pform.m_sub_perfPattern_medium_0.setAttribute('aria-label',aria_label_medium_0_upper);
  234. document.pform.m_sub_perfPattern_medium_1.setAttribute('aria-label',aria_label_medium_1_upper);
  235. document.pform.m_sub_perfPattern_medium_2.setAttribute('aria-label',aria_label_medium_2_upper);
  236. document.pform.m_sub_perfPattern_medium_3.setAttribute('aria-label',aria_label_medium_3_upper);
  237. } else if (sPerfPattern == 'perfPattern_low') {
  238. var aria_label_low_0_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_GOOD" encode="javascript"/>';
  239. var aria_label_low_1_lower = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_BELOW_INDICATE_AVERAGE" encode="javascript"/>';
  240. var aria_label_low_0_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_LOWER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_AVERAGE" encode="javascript"/>';
  241. var aria_label_low_1_upper = '<xts:string id="IDS_CUSTSUB_CONDITION_A11Y_ENTER_UPPER_BOUNDARY" encode="javascript"><xts:param name="measureName"><out:value-of select="$measureName"/></xts:param></xts:string>. <xts:string id="IDS_CUSTSUB_CONDITION_A11Y_VALUES_ABOVE_INDICATE_POOR" encode="javascript"/>';
  242. addA11yMessages('m_sub_perfPattern_low_0',aria_label_low_0_lower,aria_label_low_0_upper);
  243. addA11yMessages('m_sub_perfPattern_low_1',aria_label_low_1_lower,aria_label_low_1_upper);
  244. document.pform.m_sub_perfPattern_low_0.setAttribute('aria-label',aria_label_low_0_upper);
  245. document.pform.m_sub_perfPattern_low_1.setAttribute('aria-label',aria_label_low_1_upper);
  246. }
  247. }
  248. function addA11yMessages(inputId,lowerMessage,upperMessage) {
  249. var holder = new Object;
  250. holder.lower=lowerMessage;
  251. holder.upper=upperMessage;
  252. a11y_messages[inputId]=holder;
  253. }
  254. function setAriaLabelText(inputTextBoxId,upper) {
  255. var holder=a11y_messages[inputTextBoxId];
  256. var label="";
  257. if (upper) {
  258. label = holder.upper;
  259. }
  260. else {
  261. label = holder.lower;
  262. }
  263. var inputEle = document.getElementById(inputTextBoxId);
  264. inputEle.setAttribute('aria-label',label);
  265. }
  266. function _getEventType(e) {
  267. var evtobj = window.event? event : e;
  268. return evtobj;
  269. }
  270. function _getEventKey(e) {
  271. if (typeof(e.keyCode) == 'number' &amp;&amp; e.keyCode != 0) return e.keyCode;
  272. if (typeof(e.charCode) == 'number' &amp;&amp; e.charCode != 0) return e.charCode;
  273. return 0;
  274. }
  275. function getConditionType()
  276. {
  277. var metric_type_radio_buttons = document.getElementsByName('m_sub_type');
  278. var metric_type = 'nonMetric';
  279. for (var i = 0; i &lt; metric_type_radio_buttons.length; i++) {
  280. if (metric_type_radio_buttons[i].checked) {
  281. metric_type = metric_type_radio_buttons[i].value;
  282. }
  283. }
  284. return metric_type;
  285. }
  286. function conditionValidate()
  287. {
  288. var metric_type = getConditionType();
  289. var return_value = false;
  290. if (metric_type == 'nonMetric') {
  291. return_value = nonMetricConditionValidate();
  292. } else {
  293. return_value = metricConditionValidate();
  294. }
  295. // this selects the already selected PerfPattern - thereby disabling
  296. // the other inputs for other patterns before submitting
  297. if (return_value) {
  298. selectPerfPattern();
  299. }
  300. return return_value;
  301. }
  302. function nonMetricConditionValidate()
  303. {
  304. // have to check the conditions
  305. var v_sMeasureValue = document.getElementsByName('m_sub_measure_value')[0].value;
  306. var v_sMeasureValue1 = document.getElementsByName('m_sub_measure_value1')[0].value;
  307. var v_bBetween = (document.getElementsByName('m_sub_operation')[0].value == 'between');
  308. var v_sDomain = document.getElementsByName('m_subData_dtype_domain')[0].value;
  309. if (v_sMeasureValue.length == 0 || v_sMeasureValue1.length==0 &amp;&amp; v_bBetween) {
  310. // send the alert
  311. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NO_VALUE" encode="javascript"/>');
  312. return false;
  313. }
  314. // only do further checks if we're in the numeric domain
  315. <out:if test="/root/env/param[@name='m_subData_dtype_domain'] = 'numeric' ">
  316. // convert each measure value into a number - alert if it fails
  317. if (!isValidNumber(v_sMeasureValue) || !isValidNumber(v_sMeasureValue1) &amp;&amp; v_bBetween) {
  318. // send the alert
  319. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NON_NUMERIC_VALUE" encode="javascript"/>');
  320. return false;
  321. }
  322. // now need to get the actual values
  323. v_fMeasureValue = v_sMeasureValue * 1;
  324. v_fMeasureValue1= v_sMeasureValue1 * 1;
  325. if (isNaN(v_fMeasureValue) || isNaN(v_fMeasureValue1) &amp;&amp; v_bBetween) {
  326. // send the alert
  327. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NON_NUMERIC_VALUE" encode="javascript"/>');
  328. return false;
  329. }
  330. if (v_bBetween &amp;&amp; v_fMeasureValue &gt; v_fMeasureValue1) {
  331. // send the alert
  332. alert('<xts:string id="IDS_CUSTSUB_CONDITION_INVALID_ORDER" encode="javascript"/>');
  333. return false;
  334. }
  335. </out:if>
  336. return true;
  337. }
  338. function metricConditionValidate()
  339. {
  340. // get the value of the selected perfPattern
  341. var v_sPerfPattern = document.getElementsByName('m_sub_perfPattern')[0].value;
  342. // this gives the prefix to the variables
  343. var size = 0;
  344. if (v_sPerfPattern == 'perfPattern_high') {
  345. size = 2;
  346. } else if (v_sPerfPattern == 'perfPattern_medium') {
  347. size = 4;
  348. } else if (v_sPerfPattern == 'perfPattern_low') {
  349. size = 2;
  350. }
  351. for (var i = 0; i &lt; size-1; i++) {
  352. var v_sMeasureValue = document.getElementsByName('m_sub_'+v_sPerfPattern+'_'+i)[0].value;
  353. var v_sMeasureValue1 = document.getElementsByName('m_sub_'+v_sPerfPattern+'_'+(i+1))[0].value;
  354. // have to check that the field is a number and in sequence
  355. if (v_sMeasureValue.length == 0 || v_sMeasureValue1.length==0) {
  356. // send the alert
  357. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NO_VALUE" encode="javascript"/>');
  358. return false;
  359. }
  360. // convert each measure value into a number - alert if it fails
  361. if (!isValidNumber(v_sMeasureValue) || !isValidNumber(v_sMeasureValue1)) {
  362. // send the alert
  363. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NON_NUMERIC_VALUE" encode="javascript"/>');
  364. return false;
  365. }
  366. // now need to get the actual values
  367. v_fMeasureValue = v_sMeasureValue * 1;
  368. v_fMeasureValue1= v_sMeasureValue1 * 1;
  369. if (isNaN(v_fMeasureValue) || isNaN(v_fMeasureValue1)) {
  370. // send the alert
  371. alert('<xts:string id="IDS_CUSTSUB_CONDITION_NON_NUMERIC_VALUE" encode="javascript"/>');
  372. return false;
  373. }
  374. if (v_fMeasureValue &gt; v_fMeasureValue1) {
  375. // send the alert
  376. alert('<xts:string id="IDS_CUSTSUB_CONDITION_THRESHOLD_ORDER" encode="javascript"/>');
  377. return false;
  378. }
  379. }
  380. return true;
  381. }
  382. function isValidNumber(v_sString) {
  383. return /^[-+]?\d+(\.\d+)?$/.test(v_sString);
  384. }
  385. function updateSubMeasureLabelAriaLabels() {
  386. var v_sMeasureValue = document.getElementById('m_sub_measure_value').value;
  387. var v_sMeasureValue1 = document.getElementById('m_sub_measure_value1').value;
  388. var sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_GT" encode="javascript"/>';
  389. var sValue = document.getElementsByName('m_sub_operation')[0].value;
  390. var ariaLabelValue="";
  391. switch(sValue) {
  392. case 'greater_than':
  393. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_GT" encode="javascript"/>';
  394. break;
  395. case 'less_than':
  396. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_LT" encode="javascript"/>';
  397. break;
  398. case 'greater_than_equal':
  399. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_GTE" encode="javascript"/>';
  400. break;
  401. case 'less_than_equal':
  402. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_LTE" encode="javascript"/>';
  403. break;
  404. case 'equal':
  405. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_EQ" encode="javascript"/>';
  406. break;
  407. case 'not_equal':
  408. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_NEQ" encode="javascript"/>';
  409. break;
  410. case 'between':
  411. sDisplay = '<xts:string id="IDS_CUSTSUB_A11Y_BT" encode="javascript"/>';
  412. break;
  413. }
  414. //set the aria label(read by JAWS)
  415. if (sValue == 'between') {
  416. ariaLabelValue = '<out:value-of select="$measureName"/> '+sDisplay+'. '+v_sMeasureValue+' <xts:string id="IDS_CUSTSUB_A11Y_THRESHOLDONE_AND_THRESHOLDTWO" encode="javascript"/> '+v_sMeasureValue1+'. <xts:string id="IDS_CUSTSUB_A11Y_PRESS_ENTER_TO_SELECT_OPERATOR" encode="javascript"/>';
  417. }
  418. else {
  419. ariaLabelValue = '<out:value-of select="$measureName"/> '+sDisplay+'. '+v_sMeasureValue+'. <xts:string id="IDS_CUSTSUB_A11Y_PRESS_ENTER_TO_SELECT_OPERATOR" encode="javascript"/>';
  420. }
  421. //set the aria-label attribute
  422. document.getElementById('operator_table').setAttribute('aria-label',ariaLabelValue);
  423. }
  424. function setOperator(sDisplay, sValue)
  425. {
  426. // set the value into the hidden input - this value we want to persist
  427. document.getElementsByName('m_sub_operation')[0].value = sValue;
  428. // alter the display to the selected element
  429. document.getElementsByName('operator_text')[0].innerHTML = sDisplay;
  430. document.getElementById('operator_text_disabled').innerHTML = sDisplay;
  431. // alter the tooltip as well to be the name of the current operator
  432. document.getElementsByName('operator_dropdown')[0].alt = sDisplay;
  433. document.getElementsByName('operator_dropdown')[0].title = sDisplay;
  434. // have to show/hide elements if the operator is 'between'
  435. if (sValue == 'between') {
  436. document.getElementsByName('betweenHidingSpan')[0].style.display = 'block';
  437. if (document.all) {
  438. // IE just uses block
  439. document.getElementsByName('betweenHidingRow')[0].style.display = 'block';
  440. document.getElementsByName('betweenHidingRow')[0].setAttribute('aria-hidden','false');
  441. }
  442. else {
  443. document.getElementsByName('betweenHidingRow')[0].style.display = 'table-row';
  444. document.getElementsByName('betweenHidingRow')[0].setAttribute('aria-hidden','false');
  445. }
  446. } else {
  447. document.getElementsByName('betweenHidingSpan')[0].style.display = 'none';
  448. document.getElementsByName('betweenHidingRow')[0].style.display = 'none';
  449. //set aria states for screen readers
  450. document.getElementsByName('betweenHidingSpan')[0].setAttribute('aria-hidden','true');
  451. document.getElementsByName('betweenHidingRow')[0].setAttribute('aria-hidden','true');
  452. }
  453. updateSubMeasureLabelAriaLabels();
  454. }
  455. function selectPerfPattern()
  456. {
  457. var selectedPerfPattern = "";
  458. for (var i = 0; i &lt; document.pform.m_sub_perfPattern.options.length; i++) {
  459. var option = document.pform.m_sub_perfPattern.options[i];
  460. if (option.selected) {
  461. selectedPerfPattern = option.value;
  462. if (document.all) {
  463. // IE just uses block
  464. document.getElementsByName(option.value)[0].style.display = 'block';
  465. document.getElementsByName(option.value)[0].setAttribute('aria-hidden','false');
  466. }
  467. else {
  468. document.getElementsByName(option.value)[0].style.display = 'table-row';
  469. document.getElementsByName(option.value)[0].setAttribute('aria-hidden','false');
  470. }
  471. }
  472. else {
  473. document.getElementsByName(option.value)[0].style.display = 'none';
  474. document.getElementsByName(option.value)[0].setAttribute('aria-hidden','true');
  475. }
  476. }
  477. // have to disable variables depending on what is selected
  478. setDisablePerfPatternHigh(selectedPerfPattern != 'perfPattern_high');
  479. setDisablePerfPatternMedium(selectedPerfPattern != 'perfPattern_medium');
  480. setDisablePerfPatternLow(selectedPerfPattern != 'perfPattern_low');
  481. }
  482. function selectDelivery(sDeliveryON, sDeliveryOFF)
  483. {
  484. var deliveryOn = document.getElementsByName(sDeliveryON);
  485. var deliveryOff = document.getElementsByName(sDeliveryOFF);
  486. if (deliveryOn != null &amp;&amp; deliveryOn.length > 0) {
  487. // turn the one on
  488. if (document.all) {
  489. // IE just uses block
  490. deliveryOn[0].style.display = 'block';
  491. deliveryOn[0].setAttribute('aria-hidden','false');
  492. }
  493. else {
  494. deliveryOn[0].style.display = 'table-row';
  495. deliveryOn[0].setAttribute('aria-hidden','false');
  496. }
  497. }
  498. if (deliveryOff != null &amp;&amp; deliveryOff.length > 0) {
  499. // turn the one off
  500. deliveryOff[0].style.display = 'none';
  501. deliveryOn[0].setAttribute('aria-hidden','true');
  502. }
  503. }
  504. function setDisablePerfPatternHigh(v_bDisable)
  505. {
  506. // high performance pattern
  507. document.pform.m_sub_perfPattern_high_0.disabled = v_bDisable;
  508. document.pform.m_sub_perfPattern_high_1.disabled = v_bDisable;
  509. document.pform.m_sub_perfPattern_high_0_include.disabled = v_bDisable;
  510. document.pform.m_sub_perfPattern_high_1_include.disabled = v_bDisable;
  511. //set aria states for screen readers
  512. document.pform.m_sub_perfPattern_high_0.setAttribute('aria-disabled',v_bDisable);
  513. document.pform.m_sub_perfPattern_high_1.setAttribute('aria-disabled',v_bDisable);
  514. // also toggle the tab index property for the up/down
  515. var tabIndexValue = 0;
  516. if (v_bDisable) {
  517. tabIndexValue = -1;
  518. }
  519. document.getElementsByName('m_sub_perfPattern_high_0_include_img')[0].tabIndex = tabIndexValue;
  520. document.getElementsByName('m_sub_perfPattern_high_1_include_img')[0].tabIndex = tabIndexValue;
  521. /*document.getElementsByName('m_sub_perfPattern_high_0_img')[0].tabIndex = tabIndexValue;
  522. document.getElementsByName('m_sub_perfPattern_high_1_img')[0].tabIndex = tabIndexValue;
  523. document.getElementsByName('m_sub_perfPattern_high_2_img')[0].tabIndex = tabIndexValue;*/
  524. }
  525. function setDisablePerfPatternMedium(v_bDisable)
  526. {
  527. // medium performance pattern
  528. document.pform.m_sub_perfPattern_medium_0.disabled = v_bDisable;
  529. document.pform.m_sub_perfPattern_medium_1.disabled = v_bDisable;
  530. document.pform.m_sub_perfPattern_medium_2.disabled = v_bDisable;
  531. document.pform.m_sub_perfPattern_medium_3.disabled = v_bDisable;
  532. document.pform.m_sub_perfPattern_medium_0_include.disabled = v_bDisable;
  533. document.pform.m_sub_perfPattern_medium_1_include.disabled = v_bDisable;
  534. document.pform.m_sub_perfPattern_medium_2_include.disabled = v_bDisable;
  535. document.pform.m_sub_perfPattern_medium_3_include.disabled = v_bDisable;
  536. //set aria states for screen readers
  537. document.pform.m_sub_perfPattern_medium_0.setAttribute('aria-disabled',v_bDisable);
  538. document.pform.m_sub_perfPattern_medium_1.setAttribute('aria-disabled',v_bDisable);
  539. document.pform.m_sub_perfPattern_medium_2.setAttribute('aria-disabled',v_bDisable);
  540. document.pform.m_sub_perfPattern_medium_3.setAttribute('aria-disabled',v_bDisable);
  541. // also toggle the tab index property for the up/down
  542. var tabIndexValue = 0;
  543. if (v_bDisable) {
  544. tabIndexValue = -1;
  545. }
  546. document.getElementsByName('m_sub_perfPattern_medium_0_include_img')[0].tabIndex = tabIndexValue;
  547. document.getElementsByName('m_sub_perfPattern_medium_1_include_img')[0].tabIndex = tabIndexValue;
  548. document.getElementsByName('m_sub_perfPattern_medium_2_include_img')[0].tabIndex = tabIndexValue;
  549. document.getElementsByName('m_sub_perfPattern_medium_3_include_img')[0].tabIndex = tabIndexValue;
  550. /*document.getElementsByName('m_sub_perfPattern_medium_0_img')[0].tabIndex = tabIndexValue;
  551. document.getElementsByName('m_sub_perfPattern_medium_1_img')[0].tabIndex = tabIndexValue;
  552. document.getElementsByName('m_sub_perfPattern_medium_2_img')[0].tabIndex = tabIndexValue;
  553. document.getElementsByName('m_sub_perfPattern_medium_3_img')[0].tabIndex = tabIndexValue;
  554. document.getElementsByName('m_sub_perfPattern_medium_4_img')[0].tabIndex = tabIndexValue;*/
  555. }
  556. function setDisablePerfPatternLow(v_bDisable)
  557. {
  558. document.pform.m_sub_perfPattern_low_0.disabled = v_bDisable;
  559. document.pform.m_sub_perfPattern_low_1.disabled = v_bDisable;
  560. document.pform.m_sub_perfPattern_low_0_include.disabled = v_bDisable;
  561. document.pform.m_sub_perfPattern_low_1_include.disabled = v_bDisable;
  562. //set aria states for screen readers
  563. document.pform.m_sub_perfPattern_low_0.setAttribute('aria-disabled',v_bDisable);
  564. document.pform.m_sub_perfPattern_low_1.setAttribute('aria-disabled',v_bDisable);
  565. // also toggle the tab index property for the up/down
  566. var tabIndexValue = 0;
  567. if (v_bDisable) {
  568. tabIndexValue = -1;
  569. }
  570. document.getElementsByName('m_sub_perfPattern_low_0_include_img')[0].tabIndex = tabIndexValue;
  571. document.getElementsByName('m_sub_perfPattern_low_1_include_img')[0].tabIndex = tabIndexValue;
  572. /*document.getElementsByName('m_sub_perfPattern_low_0_img')[0].tabIndex = tabIndexValue;
  573. document.getElementsByName('m_sub_perfPattern_low_1_img')[0].tabIndex = tabIndexValue;
  574. document.getElementsByName('m_sub_perfPattern_low_2_img')[0].tabIndex = tabIndexValue;*/
  575. }
  576. function setDisableNonMetric(v_bDisable)
  577. {
  578. document.pform.m_sub_measure_value.disabled = v_bDisable;
  579. document.pform.m_sub_measure_value1.disabled = v_bDisable;
  580. document.pform.m_sub_measure_value_inclusive.disabled = v_bDisable;
  581. document.pform.m_sub_measure_value_inclusive1.disabled = v_bDisable;
  582. //set aria states for screen readers
  583. document.pform.m_sub_measure_value.setAttribute('aria-disabled',v_bDisable);
  584. document.pform.m_sub_measure_value1.setAttribute('aria-disabled',v_bDisable);
  585. document.pform.m_sub_measure_value_inclusive.setAttribute('aria-disabled',v_bDisable);
  586. document.pform.m_sub_measure_value_inclusive1.setAttribute('aria-disabled',v_bDisable);
  587. // also toggle the tab index property for the up/down
  588. var tabIndexValue = 0;
  589. if (v_bDisable) {
  590. tabIndexValue = -1;
  591. }
  592. document.getElementsByName('operator_table')[0].tabIndex = tabIndexValue;
  593. setVisible('operator_text',!v_bDisable);
  594. setVisible('operator_text_disabled',v_bDisable);
  595. }
  596. function setVisible(id,isVisible) {
  597. var value = "";
  598. if (isVisible) {
  599. if (document.all) {
  600. // IE just uses block
  601. value = 'block';
  602. }
  603. else {
  604. value = 'table-row';
  605. }
  606. } else {
  607. value = 'none';
  608. }
  609. document.getElementById(id).style.display=value;
  610. }
  611. function toggleMetric(vb_metric)
  612. {
  613. setDisableNonMetric(vb_metric);
  614. // what's the value of the perf pattern variable
  615. var v_sPerfPattern = document.getElementsByName('m_sub_perfPattern')[0].value;
  616. if (v_sPerfPattern == 'perfPattern_high') {
  617. setDisablePerfPatternHigh(!vb_metric);
  618. }
  619. if (v_sPerfPattern == 'perfPattern_medium') {
  620. setDisablePerfPatternMedium(!vb_metric);
  621. }
  622. // low performance pattern
  623. if (v_sPerfPattern == 'perfPattern_low') {
  624. setDisablePerfPatternLow(!vb_metric);
  625. }
  626. // then have to toggle the
  627. document.pform.m_sub_perfPattern.disabled = !vb_metric;
  628. document.pform.m_sub_perfPattern.setAttribute('aria-disabled',!vb_metric);
  629. // also have to switch the display for delivery
  630. if (vb_metric) {
  631. selectDelivery('metric_delivery', 'nonMetric_delivery');
  632. } else {
  633. selectDelivery('nonMetric_delivery', 'metric_delivery');
  634. }
  635. // also disable the context
  636. doContextCheckboxes(vb_metric);
  637. //set the aria-checked attribute
  638. var nmChecked = document.getElementById('m_sub_type_nonMetric');
  639. var mChecked = document.getElementById('m_sub_type_metric');
  640. nmChecked.setAttribute('aria-checked',nmChecked.checked);
  641. mChecked.setAttribute('aria-checked',mChecked.checked);
  642. }
  643. function handleContextCheckbox(evt)
  644. {
  645. return true;
  646. /* Fix defect 11383: Not able to change selected Context on Watch Rule when setup to send alert based on thresholds.
  647. // As this method always will return TRUE then we may not need it, so just commented out fully.
  648. var returnValue = true;
  649. var conditionType = getConditionType();
  650. if (conditionType == 'metric') {
  651. returnValue = false;
  652. }
  653. return returnValue;
  654. */
  655. }
  656. function doContextCheckboxes(vb_metric)
  657. {
  658. var readOnly = vb_metric;
  659. <!-- build all the select values for all the rows -->
  660. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_row')]">
  661. <out:variable name="selectName">
  662. <out:value-of select="concat('m_sub_',substring-after(@name, 'm_subData_defaultValue_'))"/>
  663. </out:variable>
  664. if (vb_metric) {
  665. document.pform.<out:value-of select="$selectName"/>.checked = vb_metric;
  666. document.pform.<out:value-of select="$selectName"/>.setAttribute('aria-checked',vb_metric);
  667. }
  668. </out:for-each>
  669. <!-- build all the select values for all the columns -->
  670. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_column')]">
  671. <out:variable name="selectName">
  672. <out:value-of select="concat('m_sub_',substring-after(@name, 'm_subData_defaultValue_'))"/>
  673. </out:variable>
  674. if (vb_metric) {
  675. document.pform.<out:value-of select="$selectName"/>.checked = vb_metric;
  676. document.pform.<out:value-of select="$selectName"/>.setAttribute('aria-checked',vb_metric);
  677. }
  678. </out:for-each>
  679. <!-- build all the select values for all the sections -->
  680. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_section')]">
  681. <out:variable name="selectName">
  682. <out:value-of select="concat('m_sub_',substring-after(@name, 'm_subData_defaultValue_'))"/>
  683. </out:variable>
  684. if (vb_metric) {
  685. document.pform.<out:value-of select="$selectName"/>.checked = vb_metric;
  686. document.pform.<out:value-of select="$selectName"/>.setAttribute('aria-checked',vb_metric);
  687. }
  688. </out:for-each>
  689. }
  690. function nonMetricClicked()
  691. {
  692. toggleMetric(false);
  693. }
  694. function metricClicked()
  695. {
  696. toggleMetric(true);
  697. }
  698. var TOGGLENORMAL = 0;
  699. var TOGGLE = 1;
  700. var PRESSED = 2;
  701. var OVER = 3;
  702. var NOTOVER = 4;
  703. function handleRange(imageObject, type)
  704. {
  705. var id = imageObject.id;
  706. //the hidden var
  707. var inputId = id.slice(0,-4);
  708. //the text box
  709. var inputTextBoxId = id.slice(0,-12);
  710. // get the element
  711. var inputControl = document.getElementsByName(inputId)[0];
  712. if (inputControl.value == "true") {
  713. switch (type) {
  714. case TOGGLENORMAL:
  715. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_down_normal.gif'))"/>";
  716. inputControl.value = "false";
  717. setAriaLabelText(inputTextBoxId,false);
  718. break;
  719. case TOGGLE:
  720. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_down_rollover.gif'))"/>";
  721. inputControl.value = "false";
  722. setAriaLabelText(inputTextBoxId,false);
  723. break;
  724. case PRESSED:
  725. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_up_pressed.gif'))"/>";
  726. break;
  727. case OVER:
  728. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_up_rollover.gif'))"/>";
  729. break;
  730. case NOTOVER:
  731. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_up_normal.gif'))"/>";
  732. break;
  733. }
  734. } else if (inputControl.value == "false") {
  735. switch (type) {
  736. case TOGGLENORMAL:
  737. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_up_normal.gif'))"/>";
  738. inputControl.value = "true";
  739. setAriaLabelText(inputTextBoxId,true);
  740. break;
  741. case TOGGLE:
  742. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_up_rollover.gif'))"/>";
  743. inputControl.value = "true";
  744. setAriaLabelText(inputTextBoxId,true);
  745. break;
  746. case PRESSED:
  747. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_down_pressed.gif'))"/>";
  748. break;
  749. case OVER:
  750. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_down_rollover.gif'))"/>";
  751. break;
  752. case NOTOVER:
  753. imageObject.src = "<out:value-of select="xtsext:javascriptencode(concat($webcontent, '/portal/images/watchwiz/rangestyle_down_normal.gif'))"/>";
  754. break;
  755. }
  756. }
  757. // have to update the alt/title attributes
  758. if (inputControl.value == 'false') {
  759. imageObject.alt = '<xts:string id="IDS_CUSTSUB_CONDITION_PERF_LOWER" encode="javascript"/>';
  760. imageObject.title = '<xts:string id="IDS_CUSTSUB_CONDITION_PERF_LOWER" encode="javascript"/>';
  761. } else {
  762. imageObject.alt = '<xts:string id="IDS_CUSTSUB_CONDITION_PERF_HIGHER" encode="javascript"/>';
  763. imageObject.title = '<xts:string id="IDS_CUSTSUB_CONDITION_PERF_HIGHER" encode="javascript"/>';
  764. }
  765. return true;
  766. }
  767. function operator_span_handler(evt) {
  768. var returnValue = false;
  769. var conditionType = getConditionType();
  770. if (conditionType == 'nonMetric') {
  771. returnValue = CCPopupMenu.dropDown(evt,0,0,'operatorPopup');
  772. }
  773. return returnValue;
  774. }
  775. function range_handler(imageObject, type)
  776. {
  777. var returnValue = false;
  778. var conditionType = getConditionType();
  779. if (conditionType == 'metric') {
  780. returnValue = handleRange(imageObject, type);
  781. }
  782. return returnValue;
  783. }
  784. </script>
  785. <table border="0" cellspacing="0" cellpadding="3" width="100%">
  786. <tr>
  787. <td width="100%">
  788. <table border="0" cellspacing="0" cellpadding="1">
  789. <tr><td></td></tr>
  790. <tr>
  791. <td>
  792. <table border="0">
  793. <tr>
  794. <td class="formText">
  795. <out:value-of select="/root/env/param[@name='m_subData_measure_name']"/>
  796. </td>
  797. <td>
  798. <div id="operator_span" name="operator_span" style="position: relative; height:20px;z-index: 2">
  799. <out:variable name="ariaMessage">
  800. <xts:string id="IDS_CUSTSUB_A11Y_PRESS_ENTER_TO_SELECT_OPERATOR"/>
  801. </out:variable>
  802. <out:variable name="greaterThan">
  803. <xts:string id="IDS_CUSTSUB_A11Y_GT"/>
  804. </out:variable>
  805. <table id="operator_table" name="operator_table" summary="" cellspacing="0" cellpadding="0"
  806. style="position: relative; cursor:pointer;"
  807. accessKey="1"
  808. onkeypress="return operator_span_handler(event);"
  809. onclick="return operator_span_handler(event);">
  810. <out:attribute name="aria-label">
  811. <out:value-of select="concat(/root/env/param[@name='m_subData_measure_name'],' ',$greaterThan,' ',/root/env/param[@name='m_sub_measure_value'],'. ',$ariaMessage)"/>
  812. </out:attribute>
  813. <out:attribute name="tabIndex">
  814. <out:choose>
  815. <out:when test="/root/env/param[@name='m_sub_type']='nonMetric' or not(/root/env/param[@name='m_sub_type'])">
  816. <out:text>0</out:text>
  817. </out:when>
  818. <out:otherwise>-1</out:otherwise>
  819. </out:choose>
  820. </out:attribute>
  821. <tr>
  822. <td class="formText" nowrap="true">
  823. <!--a id="operator_text" name="operator_text" style="text-decoration:underline" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;" href="#">
  824. <out:value-of select="$conditionText"/>
  825. </a-->
  826. <span id="operator_text_disabled" class="inactiveHRef">
  827. <out:if test="/root/env/param[@name='m_sub_type']!='metric'">
  828. <out:attribute name="style">
  829. <out:text>display:none;</out:text>
  830. </out:attribute>
  831. </out:if>
  832. <out:value-of select="$conditionText"/>
  833. </span>
  834. <span id="operator_text" name="operator_text" class="pathLink" >
  835. <out:choose>
  836. <out:when test="/root/env/param[@name='m_sub_type']='metric'">
  837. <out:attribute name="style">
  838. <out:text>text-decoration:underline;display:none</out:text>
  839. </out:attribute>
  840. </out:when>
  841. <out:otherwise>
  842. <out:attribute name="style">
  843. <out:text>text-decoration:underline</out:text>
  844. </out:attribute>
  845. </out:otherwise>
  846. </out:choose>
  847. <out:value-of select="$conditionText"/>
  848. </span>
  849. </td>
  850. <td nowrap="true" valign="top">
  851. <img id="operator_dropdown" style="margin-top:3px;margin-left:5px;" class="flyOutLabelImage" align="absmiddle" name="operator_dropdown" src="{'{$skin_shared_images}'}dropdown_arrow.gif" title="{'{$conditionText}'}" alt="{'{$conditionText}'}"/>
  852. <input type="hidden" name="m_sub_operation" id="m_sub_operation">
  853. <out:attribute name="value">
  854. <out:value-of select="$conditionEnum"/>
  855. </out:attribute>
  856. </input>
  857. </td>
  858. </tr>
  859. </table>
  860. </div>
  861. </td>
  862. <td>
  863. <!--
  864. Fixed in defect360901: The range value boxes are not visible in high contrast mode in the "Threshold boundaries" area.
  865. Removed attribute class="portlet-menu" from <input> item.
  866. -->
  867. <input role="textbox" aria-multiline="false" type="text" name="m_sub_measure_value" id="m_sub_measure_value" style="padding-left:4px; padding-right:4px" size="12" onblur="updateSubMeasureLabelAriaLabels();">
  868. <out:attribute name="value">
  869. <out:value-of select="/root/env/param[@name='m_sub_measure_value']"/>
  870. </out:attribute>
  871. <out:if test="$metricWatchRule">
  872. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  873. </out:if>
  874. </input>
  875. </td>
  876. <td class="formText">
  877. <span name="betweenHidingSpan" id="betweenHidingSpan">
  878. <out:if test="not($conditionEnum = 'between')">
  879. <out:attribute name="style">
  880. <out:text>display:none;</out:text>
  881. </out:attribute>
  882. <out:attribute name="aria-hidden"><out:text>true</out:text></out:attribute>
  883. </out:if>
  884. <input type="checkbox" role="checkbox" id="m_sub_measure_value_inclusive" name="m_sub_measure_value_inclusive" value="true">
  885. <out:if test="/root/env/param[@name='m_sub_measure_value_inclusive'] and /root/env/param[@name='m_sub_measure_value_inclusive']='true' ">
  886. <out:attribute name="checked">
  887. <out:text>checked</out:text>
  888. </out:attribute>
  889. <out:attribute name="aria-checked"><out:text>true</out:text></out:attribute>
  890. </out:if>
  891. <out:if test="$metricWatchRule">
  892. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  893. </out:if>
  894. </input>
  895. <label for="m_sub_measure_value_inclusive">
  896. <xts:string id="IDS_CUSTSUB_INCLUDE_VALUE"/>
  897. </label>
  898. </span>
  899. </td>
  900. </tr>
  901. <tr name="betweenHidingRow" id="betweenHidingRow">
  902. <out:if test="not($conditionEnum = 'between')">
  903. <out:attribute name="style">
  904. <out:text>display:none;</out:text>
  905. </out:attribute>
  906. <out:attribute name="aria-hidden"><out:text>true</out:text></out:attribute>
  907. </out:if>
  908. <td/>
  909. <td class="formText" align="left">
  910. <out:text>
  911. <xts:string id="IDS_CUSTSUB_BETWEEN_AND"/>
  912. </out:text>
  913. </td>
  914. <td>
  915. <!--
  916. Fixed in defect360901: The range value boxes are not visible in high contrast mode in the "Threshold boundaries" area.
  917. Removed attribute class="portlet-menu" from <input> item.
  918. -->
  919. <input role="textbox" aria-multiline="false" type="text" name="m_sub_measure_value1" id="m_sub_measure_value1" style="padding-left:4px; padding-right:4px" size="12" onblur="updateSubMeasureLabelAriaLabels();">
  920. <out:attribute name="value">
  921. <out:value-of select="/root/env/param[@name='m_sub_measure_value1']"/>
  922. </out:attribute>
  923. <out:if test="$metricWatchRule">
  924. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  925. </out:if>
  926. </input>
  927. </td>
  928. <td class="formText">
  929. <input role="checkbox" type="checkbox" id="m_sub_measure_value_inclusive1" name="m_sub_measure_value_inclusive1" value="true">
  930. <out:if test="/root/env/param[@name='m_sub_measure_value_inclusive1'] and /root/env/param[@name='m_sub_measure_value_inclusive1']='true' ">
  931. <out:attribute name="checked">
  932. <out:text>checked</out:text>
  933. </out:attribute>
  934. <out:attribute name="aria-checked"><out:text>true</out:text></out:attribute>
  935. </out:if>
  936. <out:if test="$metricWatchRule">
  937. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  938. </out:if>
  939. </input>
  940. <label for="m_sub_measure_value_inclusive1">
  941. <xts:string id="IDS_CUSTSUB_INCLUDE_VALUE"/>
  942. </label>
  943. </td>
  944. </tr>
  945. </table>
  946. </td>
  947. </tr>
  948. <out:if test="$operatorDomain='string'">
  949. <tr>
  950. <td>
  951. <table border="0" cellspacing="0" cellpadding="0" role="presentation">
  952. <tr>
  953. <td class="formText">
  954. <input role="checkbox" type="checkbox" id="m_sub_case_insensitive" name="m_sub_case_insensitive" value="true">
  955. <out:if test="/root/env/param[@name='m_sub_case_insensitive'] and /root/env/param[@name='m_sub_case_insensitive']='true' ">
  956. <out:attribute name="checked">
  957. <out:text>checked</out:text>
  958. </out:attribute>
  959. <out:attribute name="aria-checked"><out:text>true</out:text></out:attribute>
  960. </out:if>
  961. <out:if test="$metricWatchRule">
  962. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  963. </out:if>
  964. </input>
  965. <label for="m_sub_case_insensitive">
  966. <xts:string id="IDS_CUSTSUB_CASE_INSENSITIVE"/>
  967. </label>
  968. </td>
  969. </tr>
  970. </table>
  971. </td>
  972. </tr>
  973. </out:if>
  974. <tr>
  975. <td nowrap="nowrap">
  976. <img height="5" width="1" src="{'{$webcontent}'}/images/space.gif" role="presentation" style="display:block;"/>
  977. </td>
  978. </tr>
  979. <tr>
  980. </tr>
  981. </table>
  982. </td>
  983. </tr>
  984. </table>
  985. </td>
  986. </tr>
  987. <tr>
  988. <td>
  989. <input type="radio" name="m_sub_type" id="m_sub_type_metric" value="metric" onclick="metricClicked()" role="radio">
  990. <out:if test="/root/env/param[@name='m_sub_type']='metric'">
  991. <out:attribute name="checked">
  992. <out:text>checked</out:text>
  993. </out:attribute>
  994. <out:attribute name="aria-checked">
  995. <out:text>true</out:text>
  996. </out:attribute>
  997. </out:if>
  998. </input>
  999. </td>
  1000. <td class="formText" nowrap="nowrap">
  1001. <label for="m_sub_type_metric">
  1002. <out:text><xts:string id="IDS_CUSTSUB_CONDITION_THRESHOLDS"/></out:text>
  1003. </label>
  1004. </td>
  1005. </tr>
  1006. <tr>
  1007. <td>
  1008. </td>
  1009. <td>
  1010. <table border="0" cellspacing="0" cellpadding="3" width="100%" role="presentation">
  1011. <tr>
  1012. <td width="100%">
  1013. <table border="0" cellspacing="0" cellpadding="1" role="presentation">
  1014. <tr>
  1015. </tr>
  1016. <tr>
  1017. <td>
  1018. <table border="0" role="presentation">
  1019. <tr>
  1020. <td id="conditionPerfPatternId" class="formLabel">
  1021. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_PATTERN"/>
  1022. </td>
  1023. </tr>
  1024. <tr>
  1025. <td>
  1026. <select name="m_sub_perfPattern" class="formText" onchange="selectPerfPattern()" role="listbox" aria-labelledby="conditionPerfPatternId">
  1027. <out:if test="not($metricWatchRule)">
  1028. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  1029. </out:if>
  1030. <option value="perfPattern_high" role="option">
  1031. <out:if test="/root/env/param[@name='m_sub_perfPattern']='perfPattern_high' or not(/root/env/param[@name='m_sub_perfPattern'])">
  1032. <out:attribute name="selected"><out:text>selected</out:text></out:attribute>
  1033. <out:attribute name="aria-selected"><out:text>true</out:text></out:attribute>
  1034. </out:if>
  1035. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_PATTERN1"/>
  1036. </option>
  1037. <option value="perfPattern_medium" role="option">
  1038. <out:if test="/root/env/param[@name='m_sub_perfPattern']='perfPattern_medium' ">
  1039. <out:attribute name="selected"><out:text>selected</out:text></out:attribute>
  1040. <out:attribute name="aria-selected"><out:text>true</out:text></out:attribute>
  1041. </out:if>
  1042. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_PATTERN2"/>
  1043. </option>
  1044. <option value="perfPattern_low" role="option">
  1045. <out:if test="/root/env/param[@name='m_sub_perfPattern']='perfPattern_low' ">
  1046. <out:attribute name="selected"><out:text>selected</out:text></out:attribute>
  1047. <out:attribute name="aria-selected"><out:text>true</out:text></out:attribute>
  1048. </out:if>
  1049. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_PATTERN3"/>
  1050. </option>
  1051. </select>
  1052. </td>
  1053. </tr>
  1054. </table>
  1055. </td>
  1056. </tr>
  1057. </table>
  1058. </td>
  1059. </tr>
  1060. </table>
  1061. </td>
  1062. </tr>
  1063. <tr>
  1064. <td>
  1065. </td>
  1066. <td>
  1067. <table border="0" cellspacing="0" cellpadding="3" width="100%" role="presentation">
  1068. <tr>
  1069. <td width="100%">
  1070. <table border="0" cellspacing="0" cellpadding="1" role="presentation">
  1071. <tr>
  1072. </tr>
  1073. <tr>
  1074. <td>
  1075. <table border="0" role="presentation">
  1076. <tr>
  1077. <td class="formLabel">
  1078. <xts:string id="IDS_CUSTSUB_CONDITION_BOUNDARIES"/>
  1079. </td>
  1080. </tr>
  1081. <tr>
  1082. <td>
  1083. <xsl:call-template name="buildThresholdTable">
  1084. <xsl:with-param name="div_id"><xsl:text>perfPattern_high</xsl:text></xsl:with-param>
  1085. <xsl:with-param name="template">
  1086. <row id="high" image="traffic_7_med.gif">
  1087. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1088. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1089. <out:attribute name="aria-label">
  1090. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_GOOD"/>
  1091. </out:attribute>
  1092. </row>
  1093. <row id="med" image="traffic_5_med.gif">
  1094. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1095. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1096. <out:attribute name="aria-label">
  1097. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_AVERAGE"/>
  1098. </out:attribute>
  1099. </row>
  1100. <row id="low" image="traffic_3_med.gif">
  1101. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1102. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1103. <out:attribute name="aria-label">
  1104. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_POOR"/>
  1105. </out:attribute>
  1106. </row>
  1107. </xsl:with-param>
  1108. </xsl:call-template>
  1109. <xsl:call-template name="buildThresholdTable">
  1110. <xsl:with-param name="div_id"><xsl:text>perfPattern_medium</xsl:text></xsl:with-param>
  1111. <xsl:with-param name="template">
  1112. <row id="low" image="traffic_3_med.gif">
  1113. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1114. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1115. <out:attribute name="aria-label">
  1116. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_POOR"/>
  1117. </out:attribute>
  1118. </row>
  1119. <row id="med" image="traffic_5_med.gif">
  1120. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1121. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1122. <out:attribute name="aria-label">
  1123. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_AVERAGE"/>
  1124. </out:attribute>
  1125. </row>
  1126. <row id="high" image="traffic_7_med.gif">
  1127. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1128. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1129. <out:attribute name="aria-label">
  1130. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_GOOD"/>
  1131. </out:attribute>
  1132. </row>
  1133. <row id="med" image="traffic_5_med.gif">
  1134. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1135. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1136. <out:attribute name="aria-label">
  1137. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_AVERAGE"/>
  1138. </out:attribute>
  1139. </row>
  1140. <row id="low" image="traffic_3_med.gif">
  1141. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1142. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1143. <out:attribute name="aria-label">
  1144. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_POOR"/>
  1145. </out:attribute>
  1146. </row>
  1147. </xsl:with-param>
  1148. </xsl:call-template>
  1149. <xsl:call-template name="buildThresholdTable">
  1150. <xsl:with-param name="div_id"><xsl:text>perfPattern_low</xsl:text></xsl:with-param>
  1151. <xsl:with-param name="template">
  1152. <row id="low" image="traffic_3_med.gif">
  1153. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1154. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/></out:attribute>
  1155. <out:attribute name="aria-label">
  1156. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_POOR"/>
  1157. </out:attribute>
  1158. </row>
  1159. <row id="med" image="traffic_5_med.gif">
  1160. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1161. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/></out:attribute>
  1162. <out:attribute name="aria-label">
  1163. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_AVERAGE"/>
  1164. </out:attribute>
  1165. </row>
  1166. <row id="high" image="traffic_7_med.gif">
  1167. <out:attribute name="alt"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1168. <out:attribute name="title"><xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/></out:attribute>
  1169. <out:attribute name="aria-label">
  1170. <xts:string id="IDS_CUSTSUB_A11Y_STATUS_GOOD"/>
  1171. </out:attribute>
  1172. </row>
  1173. </xsl:with-param>
  1174. </xsl:call-template>
  1175. </td>
  1176. </tr>
  1177. </table>
  1178. </td>
  1179. </tr>
  1180. </table>
  1181. </td>
  1182. </tr>
  1183. </table>
  1184. </td>
  1185. </tr>
  1186. </table>
  1187. </td>
  1188. </tr>
  1189. <tr>
  1190. <td>
  1191. <table cellpadding="0" cellspacing="0" border="0" role="presentation">
  1192. <tr>
  1193. <td class="formLabel" nowrap="nowrap">
  1194. <out:text>
  1195. <xts:string id="IDS_CUSTSUB_CONDITION_CONTEXT"/>
  1196. </out:text>
  1197. </td>
  1198. </tr>
  1199. <tr>
  1200. <td>
  1201. <table border="0" cellpadding="0" cellspacing="0" role="presentation">
  1202. <!-- build all the select values for all the rows -->
  1203. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_row')]">
  1204. <out:sort select="substring-after(@name, 'm_subData_defaultValue_row')" order="ascending" data-type="number"/>
  1205. <out:call-template name="buildSelect"/>
  1206. </out:for-each>
  1207. <!-- build all the select values for all the columns -->
  1208. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_column')]">
  1209. <out:sort select="substring-after(@name, 'm_subData_defaultValue_column')" order="ascending" data-type="number"/>
  1210. <out:call-template name="buildSelect"/>
  1211. </out:for-each>
  1212. <!-- build all the select values for all the sections -->
  1213. <out:for-each select="/root/env/param[starts-with(@name, 'm_subData_defaultValue_section')]">
  1214. <out:sort select="substring-after(@name, 'm_subData_defaultValue_section')" order="ascending" data-type="number"/>
  1215. <out:call-template name="buildSelect"/>
  1216. </out:for-each>
  1217. </table>
  1218. </td>
  1219. </tr>
  1220. </table>
  1221. </td>
  1222. </tr>
  1223. </table>
  1224. </xsl:template>
  1225. <xsl:template name="buildThresholdTable">
  1226. <xsl:param name="template"/>
  1227. <xsl:param name="div_id"/>
  1228. <div id="{$div_id}" name="{$div_id}">
  1229. <out:attribute name="style">
  1230. <out:choose>
  1231. <out:when test="not(/root/env/param[@name='m_sub_perfPattern'])">
  1232. <out:if test="'{$div_id}' != 'perfPattern_high' ">
  1233. <out:text>display:none</out:text>
  1234. </out:if>
  1235. </out:when>
  1236. <out:otherwise>
  1237. <out:if test="/root/env/param[@name='m_sub_perfPattern'] != '{$div_id}'">
  1238. <out:text>display:none</out:text>
  1239. </out:if>
  1240. </out:otherwise>
  1241. </out:choose>
  1242. </out:attribute>
  1243. <out:attribute name="aria-hidden">
  1244. <out:choose>
  1245. <out:when test="not(/root/env/param[@name='m_sub_perfPattern'])">
  1246. <out:if test="'{$div_id}' != 'perfPattern_high' ">
  1247. <out:text>true</out:text>
  1248. </out:if>
  1249. </out:when>
  1250. <out:otherwise>
  1251. <out:if test="/root/env/param[@name='m_sub_perfPattern'] != '{$div_id}'">
  1252. <out:text>true</out:text>
  1253. </out:if>
  1254. </out:otherwise>
  1255. </out:choose>
  1256. </out:attribute>
  1257. <table width="420px" cellspacing="0" cellpadding="0" border="0" class="cctable" role="presentation">
  1258. <thead id="Header">
  1259. <tr class="tableHeader" style="padding:3px">
  1260. <td nowrap="" height="10" width="30%" valign="center" style="padding:3px" class="tableTitle">
  1261. <xts:string id="IDS_CUSTSUB_CONDITION_MEASURE"/>
  1262. </td>
  1263. <td height="15" width="1" role="presentation">
  1264. <table cellspacing="0" cellpadding="0" border="0">
  1265. <tbody>
  1266. <tr>
  1267. <td class="tableHeaderDivider">
  1268. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif" role="presentation"/>
  1269. </td>
  1270. </tr>
  1271. </tbody>
  1272. </table>
  1273. </td>
  1274. <td nowrap="" height="10" width="35%" valign="center" style="padding:3px" class="tableTitle">
  1275. <xts:string id="IDS_CUSTSUB_CONDITION_RANGE"/>
  1276. </td>
  1277. <td height="15" width="1" align="center" role="presentation">
  1278. <table cellspacing="0" cellpadding="0" border="0">
  1279. <tbody>
  1280. <tr>
  1281. <td class="tableHeaderDivider">
  1282. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif"/>
  1283. </td>
  1284. </tr>
  1285. </tbody>
  1286. </table>
  1287. </td>
  1288. <td nowrap="" height="10" width="35%" valign="center" style="padding:3px" class="tableTitle">
  1289. <xts:string id="IDS_CUSTSUB_CONDITION_STATUS"/>
  1290. </td>
  1291. </tr>
  1292. </thead>
  1293. <tbody>
  1294. <tr>
  1295. <td class="formText" align="left" style="padding-left:3px"><out:value-of select="/root/env/param[@name='m_subData_measure_name']"/></td>
  1296. <td></td>
  1297. <td class="formText" align="right" valign="bottom"><xts:string id="IDS_CUSTSUB_CONDITION_MAX_VALUE"/></td>
  1298. <td valign="bottom"><img alt="" style="display:block;" width="23" src="{'{$webcontent}'}/portal/images/watchwiz/range_tic.gif" role="presentation"/></td>
  1299. </tr>
  1300. <xsl:variable name="count_rows" select="count($template/row)"/>
  1301. <xsl:for-each select="$template/row">
  1302. <xsl:variable name="pos" select="position()"/>
  1303. <xsl:variable name="id" select="number($count_rows - $pos)"/>
  1304. <xsl:if test="not(position()=1)">
  1305. <tr role="presentation">
  1306. <td></td>
  1307. <td></td>
  1308. <td></td>
  1309. <td><img alt="" style="display:block;" width="23" height="6" src="{'{$webcontent}'}/portal/images/watchwiz/range_tic_mid.gif"/></td>
  1310. </tr>
  1311. </xsl:if>
  1312. <tr>
  1313. <td role="presentation"></td>
  1314. <td role="presentation"></td>
  1315. <td align="right" valign="top">
  1316. <xsl:if test="not(position()=1)">
  1317. <table cellpadding="0" cellspacing="0" role="presentation">
  1318. <tr>
  1319. <td>
  1320. <!--
  1321. Fixed in defect360901: The range value boxes are not visible in high contrast mode in the "Threshold boundaries" area.
  1322. Removed attribute class="portlet-menu" from <input> item.
  1323. -->
  1324. <input role="textbox" aria-multiline="false" type="text" name="m_sub_{$div_id}_{$id}" id="m_sub_{$div_id}_{$id}" style="padding-left:4px; padding-right:4px" size="12">
  1325. <out:attribute name="value">
  1326. <out:value-of select="/root/env/param[@name='m_sub_{$div_id}_{$id}']"/>
  1327. </out:attribute>
  1328. <out:if test="not($metricWatchRule)">
  1329. <out:attribute name="disabled"><out:text>disabled</out:text></out:attribute>
  1330. </out:if>
  1331. </input>
  1332. </td>
  1333. <td>
  1334. <img role="button" id="m_sub_{$div_id}_{$id}_include_img" name="m_sub_{$div_id}_{$id}_include_img" alt="" style="display:block;" onclick="return range_handler(this,TOGGLE);" onmouseover="return range_handler(this,OVER);" onmouseout="return range_handler(this,NOTOVER)" onkeypress="if (_getEventKey(_getEventType(event)) == 32) range_handler(this,TOGGLENORMAL);" onmousedown="return range_handler(this,PRESSED);">
  1335. <out:attribute name="src">
  1336. <out:choose>
  1337. <out:when test="not(/root/env/param[@name='m_sub_{$div_id}_{$id}_include']) or /root/env/param[@name='m_sub_{$div_id}_{$id}_include']='true' ">
  1338. <out:value-of select="concat($webcontent, '/portal/images/watchwiz/rangestyle_up_normal.gif')"/>
  1339. </out:when>
  1340. <out:when test="/root/env/param[@name='m_sub_{$div_id}_{$id}_include']='down' ">
  1341. <out:value-of select="concat($webcontent, '/portal/images/watchwiz/rangestyle_down_normal.gif')"/>
  1342. </out:when>
  1343. </out:choose>
  1344. </out:attribute>
  1345. <out:attribute name="alt">
  1346. <out:choose>
  1347. <out:when test="not(/root/env/param[@name='m_sub_{$div_id}_{$id}_include']) or /root/env/param[@name='m_sub_{$div_id}_{$id}_include']='true' "><xts:string id="IDS_CUSTSUB_CONDITION_PERF_HIGHER"/></out:when>
  1348. <out:when test="/root/env/param[@name='m_sub_{$div_id}_{$id}_include']='down' "><xts:string id="IDS_CUSTSUB_CONDITION_PERF_LOWER"/></out:when>
  1349. </out:choose>
  1350. </out:attribute>
  1351. <out:attribute name="title">
  1352. <out:choose>
  1353. <out:when test="not(/root/env/param[@name='m_sub_{$div_id}_{$id}_include']) or /root/env/param[@name='m_sub_{$div_id}_{$id}_include']='true' "><xts:string id="IDS_CUSTSUB_CONDITION_PERF_HIGHER"/></out:when>
  1354. <out:when test="/root/env/param[@name='m_sub_{$div_id}_{$id}_include']='down' "><xts:string id="IDS_CUSTSUB_CONDITION_PERF_LOWER"/></out:when>
  1355. </out:choose>
  1356. </out:attribute>
  1357. <!--out:attribute name="tabIndex">
  1358. <out:choose>
  1359. <out:when test="$metricWatchRule">
  1360. <out:text>0</out:text>
  1361. </out:when>
  1362. <out:otherwise>
  1363. <out:text>-1</out:text>
  1364. </out:otherwise>
  1365. </out:choose>
  1366. </out:attribute-->
  1367. </img>
  1368. <input id="m_sub_{$div_id}_{$id}_include" name="m_sub_{$div_id}_{$id}_include" type="hidden">
  1369. <out:attribute name="value">
  1370. <out:choose>
  1371. <out:when test="/root/env/param[@name='m_sub_{$div_id}_{$id}_include']">
  1372. <out:value-of select="/root/env/param[@name='m_sub_{$div_id}_{$id}_include']"/>
  1373. </out:when>
  1374. <out:otherwise>
  1375. <out:text>true</out:text>
  1376. </out:otherwise>
  1377. </out:choose>
  1378. </out:attribute>
  1379. </input>
  1380. </td>
  1381. </tr>
  1382. </table>
  1383. </xsl:if>
  1384. </td>
  1385. <td align="right" role="presentation">
  1386. <table cellpadding="0" cellspacing="0">
  1387. <tr><td><img alt="" style="display:block;" src="{'{$webcontent}'}/portal/images/watchwiz/range_top.gif"/></td></tr>
  1388. <tr><td><img alt="" style="display:block;" width="23px" height="15px" src="{'{$webcontent}'}/portal/images/watchwiz/range_resize.gif"/></td></tr>
  1389. <tr><td><img alt="" style="display:block;" src="{'{$webcontent}'}/portal/images/watchwiz/range_middle.gif"/></td></tr>
  1390. <tr><td><img alt="" style="display:block;" width="23px" height="15px" src="{'{$webcontent}'}/portal/images/watchwiz/range_resize.gif"/></td></tr>
  1391. <tr><td><img alt="" style="display:block;" src="{'{$webcontent}'}/portal/images/watchwiz/range_bottom.gif"/></td></tr>
  1392. </table>
  1393. </td>
  1394. <td>
  1395. <img role="img" id="m_sub_{$div_id}_{$id}_img" name="m_sub_{$div_id}_{$id}_img" alt="{@alt}" title="{@title}" src="{'{$webcontent}'}/portal/images/watchwiz/{@image}">
  1396. <!--out:attribute name="tabIndex">
  1397. <out:choose>
  1398. <out:when test="$metricWatchRule">
  1399. <out:text>0</out:text>
  1400. </out:when>
  1401. <out:otherwise>
  1402. <out:text>-1</out:text>
  1403. </out:otherwise>
  1404. </out:choose>
  1405. </out:attribute-->
  1406. <xsl:copy-of select="./*"/>
  1407. </img>
  1408. </td>
  1409. </tr>
  1410. </xsl:for-each>
  1411. <tr role="presentation">
  1412. <td></td>
  1413. <td></td>
  1414. <td class="formText" align="right" valign="top"><xts:string id="IDS_CUSTSUB_CONDITION_MIN_VALUE"/></td>
  1415. <td valign="top"><img alt="" style="display:block;" width="23" src="{'{$webcontent}'}/portal/images/watchwiz/range_tic.gif"/></td>
  1416. </tr>
  1417. </tbody>
  1418. </table>
  1419. </div>
  1420. </xsl:template>
  1421. <!--
  1422. Template - rss:conditionDisplayTemplates - addition templates needed by conditionDisplayCode
  1423. -->
  1424. <xsl:template match="rdsad:conditionDisplayTemplates">
  1425. <out:template name="buildSelect">
  1426. <out:variable name="selectName">
  1427. <out:value-of select="concat('m_sub_',substring-after(@name, 'm_subData_defaultValue_'))"/>
  1428. </out:variable>
  1429. <out:variable name="dataName">
  1430. <out:value-of select="@name"/>
  1431. </out:variable>
  1432. <tr>
  1433. <td nowrap="nowrap" class="formText">
  1434. <input role="checkbox" type="checkbox" value="true" onclick="return handleContextCheckbox(event)" tabindex="0">
  1435. <out:attribute name="name">
  1436. <out:value-of select="$selectName"/>
  1437. </out:attribute>
  1438. <out:attribute name="id">
  1439. <out:value-of select="$selectName"/>
  1440. </out:attribute>
  1441. <out:if test="/root/env/param[@name=$selectName] and /root/env/param[@name=$selectName]='true' ">
  1442. <out:attribute name="checked">
  1443. <out:text>checked</out:text>
  1444. </out:attribute>
  1445. <out:attribute name="aria-checked">
  1446. <out:text>true</out:text>
  1447. </out:attribute>
  1448. </out:if>
  1449. </input>
  1450. </td>
  1451. <td nowrap="nowrap" class="formText">
  1452. <label>
  1453. <out:attribute name="for">
  1454. <out:value-of select="$selectName"/>
  1455. </out:attribute>
  1456. <out:value-of select="/root/env/param[@name=$dataName]" disable-output-escaping="yes"/>
  1457. </label>
  1458. </td>
  1459. </tr>
  1460. <tr>
  1461. <td nowrap="nowrap">
  1462. <img height="5" width="1" src="{'{$webcontent}'}/images/space.gif" role="presentation" style="display:block;"/>
  1463. </td>
  1464. </tr>
  1465. </out:template>
  1466. </xsl:template>
  1467. <!--
  1468. Template - rss:delivery
  1469. -->
  1470. <xsl:template match="rdsad:deliveryDisplay">
  1471. <out:variable name="emailAsAttachment" select="key('env-param', 'm_ro_emailAsAttachment') = 'true'"/>
  1472. <out:variable name="emailAsURL" select="key('env-param', 'm_ro_emailAsURL') = 'true'"/>
  1473. <out:variable name="email_checked" select="/root/env/param[@name='m_subData_emailCB']='true' "/>
  1474. <out:variable name="newsitem_checked" select="/root/env/param[@name='m_subData_newsitemCB']='true' "/>
  1475. <out:variable name="task_checked" select="/root/env/param[@name='m_subData_taskCB']='true' "/>
  1476. <out:variable name="the-object" select="/root/newsitemPath/*[local-name()='queryResponse']/*"/>
  1477. <out:variable name="start-at-path">
  1478. <out:choose>
  1479. <out:when test="starts-with($the-object/*[local-name()='searchPath'], key('session-param', 'e_hp')) or (starts-with($the-object/*[local-name()='searchPath'], '~'))">
  1480. <out:value-of select="concat(key('session-param', 'e_hp'),'/folder')"/>
  1481. </out:when>
  1482. <out:when test="starts-with($the-object/*[local-name()='searchPath'],'/content')">
  1483. <out:value-of select="$defaultContentRoot"/>
  1484. </out:when>
  1485. </out:choose>
  1486. </out:variable>
  1487. <out:variable name="newsitem_path_link">
  1488. <cf:do-the-path-link>
  1489. <cf:param name="familytree">/root/newsitemPath/*[local-name()='queryResponse']/*/*[local-name()='ancestors']</cf:param>
  1490. <cf:param name="familymember">/root/newsitemPath/*[local-name()='queryResponse']/*/*[local-name()='defaultName']</cf:param>
  1491. <cf:param name="home">
  1492. <out:value-of select="$start-at-path"/>
  1493. </cf:param>
  1494. <cf:param name="onlyAncestors">false</cf:param>
  1495. </cf:do-the-path-link>
  1496. </out:variable>
  1497. <out:variable name="displayEmail">
  1498. <xsl:choose>
  1499. <xsl:when test="./display/option[@name='email']/visible">
  1500. <xsl:copy-of select="./display/option[@name='email']/visible/*"/>
  1501. </xsl:when>
  1502. <xsl:otherwise>
  1503. <xsl:value-of select="'false'"/>
  1504. </xsl:otherwise>
  1505. </xsl:choose>
  1506. </out:variable>
  1507. <out:variable name="metricDisplay" select="boolean(/root/env/param[@name='m_sub_type'] = 'metric')"/>
  1508. <script type="text/javascript">
  1509. function removeDeliveryCBS()
  1510. {
  1511. var watch_rule_type = document.getElementsByName('m_sub_type');
  1512. var type = 'nonMetric';
  1513. if (watch_rule_type[0].type == 'hidden') {
  1514. type = watch_rule_type[0].value;
  1515. } else {
  1516. for (var i = 0; i &lt; watch_rule_type.length; i++) {
  1517. if (watch_rule_type[i].checked) {
  1518. type = watch_rule_type[i].value;
  1519. }
  1520. }
  1521. }
  1522. if (type == 'metric') {
  1523. <out:if test="$displayEmail = 'true' ">
  1524. document.pform.m_subData_emailCB.disabled = true;
  1525. document.pform.m_subData_emailCB.setAttribute('aria-disabled',true);
  1526. </out:if>
  1527. document.pform.m_subData_newsitemCB.disabled = true;
  1528. document.pform.m_subData_taskCB.disabled = true;
  1529. document.pform.m_subData_newsitemCB.setAttribute('aria-disabled',true);
  1530. document.pform.m_subData_taskCB.setAttribute('aria-disabled',true);
  1531. } else {
  1532. <out:if test="$displayEmail = 'true' ">
  1533. document.pform.m_subData_emailCB_poor.disabled = true;
  1534. document.pform.m_subData_emailCB_poor.setAttribute('aria-disabled',true);
  1535. </out:if>
  1536. document.pform.m_subData_newsitemCB_poor.disabled = true;
  1537. document.pform.m_subData_taskCB_poor.disabled = true;
  1538. document.pform.m_subData_newsitemCB_poor.setAttribute('aria-disabled',true);
  1539. document.pform.m_subData_taskCB_poor.setAttribute('aria-disabled',true);
  1540. <out:if test="$displayEmail = 'true' ">
  1541. document.pform.m_subData_emailCB_average.disabled = true;
  1542. document.pform.m_subData_emailCB_average.setAttribute('aria-disabled',true);
  1543. </out:if>
  1544. document.pform.m_subData_newsitemCB_average.disabled = true;
  1545. document.pform.m_subData_taskCB_average.disabled = true;
  1546. document.pform.m_subData_newsitemCB_average.setAttribute('aria-disabled',true);
  1547. document.pform.m_subData_taskCB_average.setAttribute('aria-disabled',true);
  1548. <out:if test="$displayEmail = 'true' ">
  1549. document.pform.m_subData_emailCB_good.disabled = true;
  1550. document.pform.m_subData_emailCB_good.setAttribute('aria-disabled',true);
  1551. </out:if>
  1552. document.pform.m_subData_newsitemCB_good.disabled = true;
  1553. document.pform.m_subData_taskCB_good.disabled = true;
  1554. document.pform.m_subData_newsitemCB_good.setAttribute('aria-disabled',true);
  1555. document.pform.m_subData_taskCB_good.setAttribute('aria-disabled',true);
  1556. }
  1557. }
  1558. function deliveryValidate()
  1559. {
  1560. var watch_rule_type = document.getElementsByName('m_sub_type');
  1561. var type = 'nonMetric';
  1562. if (watch_rule_type[0].type == 'hidden') {
  1563. type = watch_rule_type[0].value;
  1564. } else {
  1565. for (var i = 0; i &lt; watch_rule_type.length; i++) {
  1566. if (watch_rule_type[i].checked) {
  1567. type = watch_rule_type[i].value;
  1568. }
  1569. }
  1570. }
  1571. // find out if we're displaying a metric or not
  1572. <out:choose>
  1573. <out:when test="$displayEmail = 'true' ">
  1574. if (type == 'metric') {
  1575. // have to check that both of the delivery options are not checked
  1576. var email_delivery = (document.pform.m_subData_emailCB_poor.checked==true ||
  1577. document.pform.m_subData_emailCB_average.checked==true ||
  1578. document.pform.m_subData_emailCB_good.checked==true);
  1579. var newsitem_delivery = (document.pform.m_subData_newsitemCB_poor.checked==true ||
  1580. document.pform.m_subData_newsitemCB_average.checked==true ||
  1581. document.pform.m_subData_newsitemCB_good.checked==true);
  1582. var task_delivery = (document.pform.m_subData_taskCB_poor.checked==true ||
  1583. document.pform.m_subData_taskCB_average.checked==true ||
  1584. document.pform.m_subData_taskCB_good.checked==true);
  1585. if (!(email_delivery || newsitem_delivery || task_delivery)) {
  1586. alert(&quot;<xts:string id="IDS_CUSTSUB_DELIVERY_NO_DELIVERY_METHOD" encode="javascript"/>&quot;);
  1587. }
  1588. return email_delivery || newsitem_delivery || task_delivery;
  1589. } else {
  1590. // have to check that both of the delivery options are not checked
  1591. var email_delivery = (document.pform.m_subData_emailCB.checked==true);
  1592. var newsitem_delivery = (document.pform.m_subData_newsitemCB.checked==true);
  1593. var task_delivery = (document.pform.m_subData_taskCB.checked==true);
  1594. if (!(email_delivery || newsitem_delivery || task_delivery)) {
  1595. alert(&quot;<xts:string id="IDS_CUSTSUB_DELIVERY_NO_DELIVERY_METHOD" encode="javascript"/>&quot;);
  1596. }
  1597. return email_delivery || newsitem_delivery || task_delivery;
  1598. }
  1599. </out:when>
  1600. <out:otherwise>
  1601. if (type == 'metric') {
  1602. // only have to test that the newsitem delivery option is checked
  1603. var newsitem_delivery = (document.pform.m_subData_newsitemCB_poor.checked==true ||
  1604. document.pform.m_subData_newsitemCB_average.checked==true ||
  1605. document.pform.m_subData_newsitemCB_good.checked==true);
  1606. var task_delivery = (document.pform.m_subData_taskCB_poor.checked==true ||
  1607. document.pform.m_subData_taskCB_average.checked==true ||
  1608. document.pform.m_subData_taskCB_good.checked==true);
  1609. if (!(newsitem_delivery || task_delivery )) {
  1610. alert(&quot;<xts:string id="IDS_CUSTSUB_DELIVERY_NO_DELIVERY_METHOD" encode="javascript"/>&quot;);
  1611. }
  1612. return newsitem_delivery || task_delivery;
  1613. } else {
  1614. // only have to test that the newsitem delivery option is checked
  1615. var newsitem_delivery = (document.pform.m_subData_newsitemCB.checked==true);
  1616. var task_delivery = (document.pform.m_subData_taskCB.checked==true);
  1617. if (!(newsitem_delivery || task_delivery)) {
  1618. alert(&quot;<xts:string id="IDS_CUSTSUB_DELIVERY_NO_DELIVERY_METHOD" encode="javascript"/>&quot;);
  1619. }
  1620. return newsitem_delivery || task_delivery;
  1621. }
  1622. </out:otherwise>
  1623. </out:choose>
  1624. }
  1625. </script>
  1626. <xsl:call-template name="buildDeliveryTable">
  1627. <xsl:with-param name="metricDisplay" select="true()"/>
  1628. <xsl:with-param name="div_id" select="'metric'"/>
  1629. </xsl:call-template>
  1630. <xsl:call-template name="buildDeliveryTable">
  1631. <xsl:with-param name="metricDisplay" select="false()"/>
  1632. <xsl:with-param name="div_id" select="'nonMetric'"/>
  1633. </xsl:call-template>
  1634. </xsl:template>
  1635. <xsl:template name="buildDeliveryTable">
  1636. <xsl:param name="metricDisplay"/>
  1637. <xsl:param name="div_id"/>
  1638. <span>
  1639. <table width="100%" cellspacing="0" cellpadding="2" border="0" class="cctable" name="{$div_id}_delivery" id="{$div_id}_delivery" role="grid">
  1640. <out:attribute name="style">
  1641. <out:if test="not(/root/env/param[@name='m_sub_type'] = '{$div_id}') ">
  1642. <out:text>display:none</out:text>
  1643. </out:if>
  1644. </out:attribute>
  1645. <out:attribute name="aria-hidden">
  1646. <out:if test="not(/root/env/param[@name='m_sub_type'] = '{$div_id}') ">
  1647. <out:text>true</out:text>
  1648. </out:if>
  1649. </out:attribute>
  1650. <thead id="Header" role="rowgroup">
  1651. <tr class="tableHeader" role="row">
  1652. <th nowrap="" height="10" width="20%" valign="center" style="padding-left: 2px; padding-top: 2px; color: #444444; font-weight: bold;" colspan="2" role="columnheader"><xts:string id="IDS_TITLE_ALERT_ALERTS"/></th>
  1653. <th height="15" width="1" role="presentation">
  1654. <table cellspacing="0" cellpadding="0" border="0">
  1655. <tbody>
  1656. <tr>
  1657. <td class="tableHeaderDivider">
  1658. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif"/>
  1659. </td>
  1660. </tr>
  1661. </tbody>
  1662. </table>
  1663. </th>
  1664. <th nowrap="" height="10" width="70%" valign="center" style="padding-left: 2px; padding-top: 2px; color: #444444; font-weight: bold;" role="columnheader"><xts:string id="IDS_TITLE_ALERT_DETAILS"/></th>
  1665. <th height="15" width="1" role="presentation">
  1666. <table cellspacing="0" cellpadding="0" border="0" role="presentation">
  1667. <tbody>
  1668. <tr>
  1669. <td class="tableHeaderDivider">
  1670. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif"/>
  1671. </td>
  1672. </tr>
  1673. </tbody>
  1674. </table>
  1675. </th>
  1676. <th nowrap="" height="10" width="100" align="right" style="padding-left: 2px; padding-top: 4px; color: #444444; font-weight: bold; display:block;" role="columnheader">
  1677. <xts:string id="IDS_TITLE_ALERT_ALERT"/>
  1678. </th>
  1679. <th width="16" role="columnheader">
  1680. <xsl:choose>
  1681. <xsl:when test="$metricDisplay">
  1682. <img height="16" width="16" role="img">
  1683. <out:attribute name="src"><out:value-of select="$webcontent"/>/portal/images/watchwiz/traffic_3_sm.gif</out:attribute>
  1684. <out:attribute name="alt">
  1685. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_POOR"/>
  1686. </out:attribute>
  1687. </img>
  1688. </xsl:when>
  1689. <xsl:otherwise>
  1690. <script language="JavaScript">
  1691. function selectAllOptions()
  1692. {
  1693. var checked = document.pform.m_subData_allOptions.checked;
  1694. if (document.pform.m_subData_emailCB) {
  1695. document.pform.m_subData_emailCB.checked = checked;
  1696. document.pform.m_subData_emailCB.setAttribute('aria-checked',checked);
  1697. }
  1698. document.pform.m_subData_newsitemCB.checked = checked;
  1699. document.pform.m_subData_taskCB.checked = checked;
  1700. document.pform.m_subData_newsitemCB.setAttribute('aria-checked',checked);
  1701. document.pform.m_subData_taskCB.setAttribute('aria-checked',checked);
  1702. }
  1703. </script>
  1704. <utml:input role="checkbox" type="checkbox" name="m_subData_allOptions" value="true" utml:track="false" utml:update="false" onclick="selectAllOptions();">
  1705. <out:attribute name="aria-label">
  1706. <xts:string id="IDS_TITLE_ALERT_A11Y_ALERTS"/>
  1707. </out:attribute>
  1708. </utml:input>
  1709. </xsl:otherwise>
  1710. </xsl:choose>
  1711. </th>
  1712. <th width="16" role="columnheader">
  1713. <xsl:if test="$metricDisplay">
  1714. <img role="img" height="16" width="16">
  1715. <out:attribute name="src"><out:value-of select="$webcontent"/>/portal/images/watchwiz/traffic_5_sm.gif</out:attribute>
  1716. <out:attribute name="alt">
  1717. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_AVERAGE"/>
  1718. </out:attribute>
  1719. </img>
  1720. </xsl:if>
  1721. </th>
  1722. <th width="16" role="columnheader">
  1723. <xsl:if test="$metricDisplay">
  1724. <img role="img" height="16" width="16">
  1725. <out:attribute name="src"><out:value-of select="$webcontent"/>/portal/images/watchwiz/traffic_7_sm.gif</out:attribute>
  1726. <out:attribute name="alt">
  1727. <xts:string id="IDS_CUSTSUB_CONDITION_PERF_GOOD"/>
  1728. </out:attribute>
  1729. </img>
  1730. </xsl:if>
  1731. </th>
  1732. <th nowrap="" height="10" width="100" role="presentation" style="display:block;"></th>
  1733. </tr>
  1734. </thead>
  1735. <tbody role="rowgroup">
  1736. <xsl:for-each select="./display/option">
  1737. <xsl:call-template name="buildRow">
  1738. <xsl:with-param name="metricDisplay" select="$metricDisplay"/>
  1739. </xsl:call-template>
  1740. </xsl:for-each>
  1741. </tbody>
  1742. </table>
  1743. </span>
  1744. </xsl:template>
  1745. <xsl:template name="buildRow">
  1746. <xsl:param name="metricDisplay"/>
  1747. <xsl:variable name="option_name" select="./@name"/>
  1748. <out:variable name="displayRow_{@name}">
  1749. <xsl:copy-of select="./visible/child::node()"/>
  1750. </out:variable>
  1751. <out:if test="$displayRow_{@name} = 'true'">
  1752. <xsl:variable name="id" select="generate-id(.)"/>
  1753. <tr style="height: 1px;" role="row">
  1754. <out:variable name="title">
  1755. <xsl:copy-of select="./title/child::node()"/>
  1756. </out:variable>
  1757. <td valign="middle" align="left" width="1" role="gridcell">
  1758. <xsl:copy-of select="./icon/child::node()"/>
  1759. </td>
  1760. <td nowrap="" height="10" valign="center" class="tableText" width="20%" role="gridcell">
  1761. <span><out:value-of select="$title"/></span>
  1762. </td>
  1763. <td height="15" width="1" role="presentation">
  1764. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif"/>
  1765. </td>
  1766. <td nowrap="" height="10" valign="center" class="tableText" role="gridcell">
  1767. <span>
  1768. <xsl:if test="./description/path">
  1769. <xsl:copy-of select="./description/path/child::node()"/>
  1770. </xsl:if>
  1771. <xsl:copy-of select="./description/text/child::node()"/>
  1772. <img height="5" width="10" alt="" src="{'{$webcontent}'}/images/space.gif" role="presentation"/>
  1773. <script language="JavaScript">
  1774. function utmlA_<xsl:value-of select="$id"/>()
  1775. {
  1776. <xsl:value-of select="./link/href"/>
  1777. document.pform.m.value = '<xsl:copy-of select="./link/target/child::node()"/>';
  1778. <xsl:if test="not($metricDisplay)">
  1779. <xsl:value-of select="concat('document.pform.m_subData_', $option_name, 'CB.checked=true;')"/>
  1780. <xsl:value-of select="concat('document.pform.m_subData_', $option_name, 'CB.setAttribute(&quot;aria-checked&quot;,true)')"/>
  1781. </xsl:if>
  1782. document.pform.submit();
  1783. }
  1784. </script>
  1785. <a role="link" formname="pform" href="javascript:utmlA_{$id}()" onmouseout="window.status='';return true;" onmouseover="window.status='';return true;">
  1786. <out:attribute name="aria-label">
  1787. <xsl:copy-of select="./link/ariaLabel/child::node()"/>
  1788. </out:attribute>
  1789. <xsl:copy-of select="./link/text/child::node()"/>
  1790. </a>
  1791. </span>
  1792. </td>
  1793. <td height="15" width="1" role="presentation">
  1794. <img height="15" width="1" alt="" src="{'{$webcontent}'}/images/space.gif"/>
  1795. </td>
  1796. <td nowrap="" height="10" width="100" align="right" style="padding-left: 2px; padding-top: 2px;" class="tableTitle" role="presentation"></td>
  1797. <td width="16" role="gridcell">
  1798. <xsl:choose>
  1799. <xsl:when test="$metricDisplay">
  1800. <utml:input role="checkbox" type="checkbox" name="m_subData_{$option_name}CB_poor" value="true" utml:track="false">
  1801. <out:attribute name="aria-label"><xts:string id="IDS_CHECKBOX_ALERT_POOR"/></out:attribute>
  1802. </utml:input>
  1803. </xsl:when>
  1804. <xsl:otherwise>
  1805. <utml:input role="checkbox" type="checkbox" name="m_subData_{$option_name}CB" value="true" utml:track="false">
  1806. <out:attribute name="aria-label">
  1807. <out:value-of select="$title"/>&#160;<xts:string id="IDS_TITLE_ALERT_A11Y_ALERT"/>
  1808. </out:attribute>
  1809. </utml:input>
  1810. </xsl:otherwise>
  1811. </xsl:choose>
  1812. </td>
  1813. <td width="16" role="gridcell">
  1814. <xsl:if test="$metricDisplay">
  1815. <utml:input role="checkbox" type="checkbox" name="m_subData_{$option_name}CB_average" value="true" utml:track="false">
  1816. <out:attribute name="aria-label"><xts:string id="IDS_CHECKBOX_ALERT_AVERAGE"/></out:attribute>
  1817. </utml:input>
  1818. </xsl:if>
  1819. </td>
  1820. <td width="16" role="gridcell">
  1821. <xsl:if test="$metricDisplay">
  1822. <utml:input role="checkbox" type="checkbox" name="m_subData_{$option_name}CB_good" value="true" utml:track="false">
  1823. <out:attribute name="aria-label"><xts:string id="IDS_CHECKBOX_ALERT_GOOD"/></out:attribute>
  1824. </utml:input>
  1825. </xsl:if>
  1826. </td>
  1827. <td nowrap="" height="10" width="100" role="presentation"></td>
  1828. </tr>
  1829. </out:if>
  1830. </xsl:template>
  1831. <xsl:template match="rdsad:enumTemplates">
  1832. <!-- template to convert the operator into the long string form -->
  1833. <out:template name="conditionEnumLongValue">
  1834. <out:param name="conditionEnum"/>
  1835. <out:choose>
  1836. <out:when test="$conditionEnum = 'greater_than'">
  1837. <out:text>
  1838. <xts:string id="IDS_CUSTSUB_NUMERIC_GT"/>
  1839. </out:text>
  1840. </out:when>
  1841. <out:when test="$conditionEnum = 'less_than'">
  1842. <out:text>
  1843. <xts:string id="IDS_CUSTSUB_NUMERIC_LT"/>
  1844. </out:text>
  1845. </out:when>
  1846. <out:when test="$conditionEnum = 'greater_than_equal'">
  1847. <out:text>
  1848. <xts:string id="IDS_CUSTSUB_NUMERIC_GTE"/>
  1849. </out:text>
  1850. </out:when>
  1851. <out:when test="$conditionEnum = 'less_than_equal'">
  1852. <out:text>
  1853. <xts:string id="IDS_CUSTSUB_NUMERIC_LTE"/>
  1854. </out:text>
  1855. </out:when>
  1856. <out:when test="$conditionEnum = 'equal'">
  1857. <out:text>
  1858. <xts:string id="IDS_CUSTSUB_NUMERIC_EQ"/>
  1859. </out:text>
  1860. </out:when>
  1861. <out:when test="$conditionEnum = 'not_equal'">
  1862. <out:text>
  1863. <xts:string id="IDS_CUSTSUB_NUMERIC_NEQ"/>
  1864. </out:text>
  1865. </out:when>
  1866. <out:when test="$conditionEnum = 'between'">
  1867. <out:text>
  1868. <xts:string id="IDS_CUSTSUB_NUMERIC_BT"/>
  1869. </out:text>
  1870. </out:when>
  1871. <out:when test="$conditionEnum = 'contains'">
  1872. <out:text>
  1873. <xts:string id="IDS_CUSTSUB_STRING_CONTAINS"/>
  1874. </out:text>
  1875. </out:when>
  1876. <out:when test="$conditionEnum = 'begins'">
  1877. <out:text>
  1878. <xts:string id="IDS_CUSTSUB_STRING_BEGINS"/>
  1879. </out:text>
  1880. </out:when>
  1881. <out:when test="$conditionEnum = 'ends'">
  1882. <out:text>
  1883. <xts:string id="IDS_CUSTSUB_STRING_ENDS"/>
  1884. </out:text>
  1885. </out:when>
  1886. <out:when test="$conditionEnum = 'match'">
  1887. <out:text>
  1888. <xts:string id="IDS_CUSTSUB_STRING_MATCH"/>
  1889. </out:text>
  1890. </out:when>
  1891. <out:when test="$conditionEnum = 'not_contains'">
  1892. <out:text>
  1893. <xts:string id="IDS_CUSTSUB_STRING_NOT_CONTAINS"/>
  1894. </out:text>
  1895. </out:when>
  1896. <out:when test="$conditionEnum = 'not_begin'">
  1897. <out:text>
  1898. <xts:string id="IDS_CUSTSUB_STRING_NOT_BEGIN"/>
  1899. </out:text>
  1900. </out:when>
  1901. <out:when test="$conditionEnum = 'not_end'">
  1902. <out:text>
  1903. <xts:string id="IDS_CUSTSUB_STRING_NOT_END"/>
  1904. </out:text>
  1905. </out:when>
  1906. <out:when test="$conditionEnum = 'not_match'">
  1907. <out:text>
  1908. <xts:string id="IDS_CUSTSUB_STRING_NOT_MATCH"/>
  1909. </out:text>
  1910. </out:when>
  1911. </out:choose>
  1912. </out:template>
  1913. <!-- template to convert the operator into the long string form -->
  1914. <out:template name="conditionEnumShortValue">
  1915. <out:param name="conditionEnum"/>
  1916. <out:choose>
  1917. <out:when test="$conditionEnum = 'greater_than'">
  1918. <out:text>
  1919. <xts:string id="IDS_CUSTSUB_NUMERIC_GT_SHORT"/>
  1920. </out:text>
  1921. </out:when>
  1922. <out:when test="$conditionEnum = 'less_than'">
  1923. <out:text>
  1924. <xts:string id="IDS_CUSTSUB_NUMERIC_LT_SHORT"/>
  1925. </out:text>
  1926. </out:when>
  1927. <out:when test="$conditionEnum = 'greater_than_equal'">
  1928. <out:text>
  1929. <xts:string id="IDS_CUSTSUB_NUMERIC_GTE_SHORT"/>
  1930. </out:text>
  1931. </out:when>
  1932. <out:when test="$conditionEnum = 'less_than_equal'">
  1933. <out:text>
  1934. <xts:string id="IDS_CUSTSUB_NUMERIC_LTE_SHORT"/>
  1935. </out:text>
  1936. </out:when>
  1937. <out:when test="$conditionEnum = 'equal'">
  1938. <out:text>
  1939. <xts:string id="IDS_CUSTSUB_NUMERIC_EQ_SHORT"/>
  1940. </out:text>
  1941. </out:when>
  1942. <out:when test="$conditionEnum = 'not_equal'">
  1943. <out:text>
  1944. <xts:string id="IDS_CUSTSUB_NUMERIC_NEQ_SHORT"/>
  1945. </out:text>
  1946. </out:when>
  1947. <out:when test="$conditionEnum = 'between'">
  1948. <out:text>
  1949. <xts:string id="IDS_CUSTSUB_NUMERIC_BT_SHORT"/>
  1950. </out:text>
  1951. </out:when>
  1952. <out:when test="$conditionEnum = 'contains'">
  1953. <out:text>
  1954. <xts:string id="IDS_CUSTSUB_STRING_CONTAINS"/>
  1955. </out:text>
  1956. </out:when>
  1957. <out:when test="$conditionEnum = 'begins'">
  1958. <out:text>
  1959. <xts:string id="IDS_CUSTSUB_STRING_BEGINS"/>
  1960. </out:text>
  1961. </out:when>
  1962. <out:when test="$conditionEnum = 'ends'">
  1963. <out:text>
  1964. <xts:string id="IDS_CUSTSUB_STRING_ENDS"/>
  1965. </out:text>
  1966. </out:when>
  1967. <out:when test="$conditionEnum = 'match'">
  1968. <out:text>
  1969. <xts:string id="IDS_CUSTSUB_STRING_MATCH"/>
  1970. </out:text>
  1971. </out:when>
  1972. <out:when test="$conditionEnum = 'not_contains'">
  1973. <out:text>
  1974. <xts:string id="IDS_CUSTSUB_STRING_NOT_CONTAINS"/>
  1975. </out:text>
  1976. </out:when>
  1977. <out:when test="$conditionEnum = 'not_begin'">
  1978. <out:text>
  1979. <xts:string id="IDS_CUSTSUB_STRING_NOT_BEGIN"/>
  1980. </out:text>
  1981. </out:when>
  1982. <out:when test="$conditionEnum = 'not_end'">
  1983. <out:text>
  1984. <xts:string id="IDS_CUSTSUB_STRING_NOT_END"/>
  1985. </out:text>
  1986. </out:when>
  1987. <out:when test="$conditionEnum = 'not_match'">
  1988. <out:text>
  1989. <xts:string id="IDS_CUSTSUB_STRING_NOT_MATCH"/>
  1990. </out:text>
  1991. </out:when>
  1992. </out:choose>
  1993. </out:template>
  1994. </xsl:template>
  1995. <xsl:template match="*">
  1996. <xsl:copy>
  1997. <xsl:copy-of select="@*"/>
  1998. <xsl:apply-templates/>
  1999. </xsl:copy>
  2000. </xsl:template>
  2001. </xsl:stylesheet>