ui_configmgr.xslt 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ##############################################################################
  4. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ##############################################################################
  18. -->
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  20. <xsl:output method="html" encoding="utf-8"/>
  21. <xsl:variable name="Component" select="/*[1]/Component/text()"/>
  22. <xsl:variable name="CompDefn" select="/*[1]/CompDefn/text()"/>
  23. <xsl:variable name="debugMode" select="0"/>
  24. <xsl:variable name="filePath">
  25. <xsl:choose>
  26. <xsl:when test="$debugMode">c:/development/bin/debug/files</xsl:when>
  27. <xsl:otherwise>/esp/files_</xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:variable>
  30. <xsl:template name="string-replace-all">
  31. <xsl:param name="text" />
  32. <xsl:param name="replace" />
  33. <xsl:param name="by" />
  34. <xsl:choose>
  35. <xsl:when test="contains($text, $replace)">
  36. <xsl:value-of select="substring-before($text,$replace)" />
  37. <xsl:value-of select="$by" />
  38. <xsl:call-template name="string-replace-all">
  39. <xsl:with-param name="text" select="substring-after($text,$replace)" />
  40. <xsl:with-param name="replace" select="$replace" />
  41. <xsl:with-param name="by" select="$by" />
  42. </xsl:call-template>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:value-of select="$text" />
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xsl:template>
  49. <xsl:template match="/*[1]/XmlArgs/*">
  50. <html>
  51. <head>
  52. <!--<script type="text/javascript" src="{$filePath}/scripts/configmgr/generated/{$Component}.js"></script>-->
  53. <script type="text/javascript">
  54. <xsl:value-of select="$CompDefn"/>
  55. </script>
  56. <script type="text/javascript" src="{$filePath}/yui/build/yahoo/yahoo-min.js"></script>
  57. <script type="text/javascript" src="{$filePath}/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
  58. <script type="text/javascript" src="{$filePath}/yui/build/event/event-min.js"></script>
  59. <script type="text/javascript" src="{$filePath}/yui/build/dragdrop/dragdrop-min.js"></script>
  60. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/fonts/fonts.css" />
  61. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/layout/assets/skins/sam/layout.css" />
  62. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/datatable/assets/skins/sam/datatable.css" />
  63. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/tabview/assets/skins/sam/tabview.css" />
  64. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/menu/assets/skins/sam/menu.css" />
  65. <link rel="stylesheet" type="text/css" href="{$filePath}/yui/build/container/assets/skins/sam/container.css" />
  66. <script type="text/javascript" src="/esp/files/scripts/espdefault.js">&#160;</script>
  67. <script type="text/javascript" src="{$filePath}/yui/build/yuiloader/yuiloader-min.js" ></script>
  68. <script type="text/javascript" src="{$filePath}/yui/build/element/element-min.js"></script>
  69. <script type="text/javascript" src="{$filePath}/yui/build/datasource/datasource-min.js"></script>
  70. <script type="text/javascript" src="{$filePath}/yui/build/datatable/datatable.js"></script>
  71. <script type="text/javascript" src="{$filePath}/yui/build/tabview/tabview-min.js"></script>
  72. <script type="text/javascript" src="{$filePath}/yui/build/connection/connection-min.js"></script>
  73. <script type="text/javascript" src="{$filePath}/yui/build/container/container-min.js"></script>
  74. <script type="text/javascript" src="{$filePath}/yui/build/layout/layout-min.js"></script>
  75. <script type="text/javascript" src="{$filePath}/yui/build/menu/menu-min.js"></script>
  76. <script type="text/javascript" src="{$filePath}/yui/build/json/json-min.js"></script>
  77. <script type="text/javascript" src="{$filePath}/yui/build/animation/animation-min.js"></script>
  78. <script type="text/javascript" src="{$filePath}/yui/build/dom/dom-min.js"></script>
  79. <script type="text/javascript" src="{$filePath}/yui/build/resize/resize-min.js"></script>
  80. <script type="text/javascript" src="{$filePath}/yui/build/progressbar/progressbar-min.js"></script>
  81. <script type="text/javascript" src="{$filePath}/yui/build/event-simulate/event-simulate-min.js"></script>
  82. <script type="text/javascript" src="/esp/files/scripts/configmgr/common.js"></script>
  83. <script type="text/javascript" src="{$filePath}/scripts/configmgr/configmgr.js"/>
  84. <!--begin custom header content for this example-->
  85. <style type="text/css">
  86. /* custom styles for this example */
  87. .yui-skin-sam .yui-dt-liner { white-space:nowrap; }
  88. .not_in_env { color: #FF0000;}
  89. </style>
  90. <style type="text/css">
  91. .yui-dt-liner #depth-1 {
  92. padding-left:0em !important;
  93. }
  94. .yui-dt-liner #depth0 {
  95. padding-left:2em !important;
  96. }
  97. .yui-dt-liner #depth1 {
  98. padding-left:4em !important;
  99. background-position:1em 0 !important;
  100. }
  101. .yui-dt-liner #depth2 {
  102. padding-left:6em !important;
  103. background-position:2em 0 !important;
  104. }
  105. .yui-dt-liner #depth3 {
  106. padding-left:8em !important;
  107. background-position:3em 0 !important;
  108. }
  109. .yui-dt-liner #depth4 {
  110. padding-left:10em !important;
  111. background-position:4em 0 !important;
  112. }
  113. .yui-dt-liner #depth5 {
  114. padding-left:12em !important;
  115. background-position:5em 0 !important;
  116. }
  117. .yui-dt-liner #depth6 {
  118. padding-left:14em !important;
  119. background-position:6em 0 !important;
  120. }
  121. .yui-dt-liner #depth7 {
  122. padding-left:16em !important;
  123. background-position:7em 0 !important;
  124. }
  125. .yui-dt-liner #depth8 {
  126. padding-left:18em !important;
  127. background-position:8em 0 !important;
  128. }
  129. .yui-dt-liner #depth9 {
  130. padding-left:20em !important;
  131. background-position:9em 0 !important;
  132. }
  133. .hidden {
  134. display:none;
  135. }
  136. .expanded .yui-dt-col-icon .yui-dt-liner{
  137. background: url(<xsl:value-of select="$filePath"/>/img/collapse.gif) no-repeat;
  138. }
  139. .collapsed .yui-dt-col-icon .yui-dt-liner{
  140. background: url(<xsl:value-of select="$filePath"/>/img/expand.gif) no-repeat;
  141. }
  142. .buttoncollapsed#pushbutton {
  143. background: url(<xsl:value-of select="$filePath"/>/img/expand.gif) center center no-repeat;
  144. border: none;
  145. text-indent: -4em;
  146. text-align:justify;
  147. overflow: hidden;
  148. padding: 0 .75em;
  149. width: 1.75em;
  150. height: 1em;
  151. margin-left: 4em; /* IE only */
  152. padding: 0 1.75em; /* IE only */
  153. }
  154. div>.buttoncollapsed#pushbutton {
  155. margin-left: 0em; /* non-IE only */
  156. padding: 0 0em; /* non-IE only */
  157. }
  158. .buttonexpanded#pushbutton {
  159. background: url(<xsl:value-of select="$filePath"/>/img/collapse.gif) center center no-repeat;
  160. border: none;
  161. text-indent: -4em;
  162. text-align:justify;
  163. overflow: hidden;
  164. padding: 0 .75em;
  165. width: 1.75em;
  166. height: 1em;
  167. margin-left: 4em; /* IE only */
  168. padding: 0 1.75em; /* IE only */
  169. }
  170. div>.buttonexpanded#pushbutton {
  171. margin-left: 0em; /* non-IE only */
  172. padding: 0 0em; /* non-IE only */
  173. }
  174. /* Class for displaying out of focus tables */
  175. .yui-skin-sam .yui-dt tr.outoffocus td {
  176. background-color: #D0D0D0;
  177. }
  178. .yui-skin-sam .yui-tt .bd
  179. {
  180. BORDER-RIGHT: #808080 1px solid;
  181. BORDER-TOP: #808080 1px solid;
  182. BORDER-LEFT: #808080 1px solid;
  183. BORDER-BOTTOM: #808080 1px solid;
  184. BACKGROUND-COLOR: #FAFAD2;
  185. }
  186. </style>
  187. </head>
  188. <body class=" yui-skin-sam" onmousedown="handlemousedown(event)" onkeydown="handlekeydown(event)" onunload="handleunload(true)">
  189. <xsl:choose>
  190. <xsl:when test="($Component='Refresh')">
  191. <script type="text/javascript">
  192. doPageRefresh("Configmgr has been restarted. Press ok to refresh the page");
  193. </script>
  194. </xsl:when>
  195. <xsl:when test="($Component='Deploy')">
  196. <div id="DeployTab">
  197. </div>
  198. </xsl:when>
  199. <xsl:when test="not($Component='BuildSet') and not($Component='Deploy')">
  200. <div>
  201. <i>
  202. <h3>
  203. <script type="text/javascript">
  204. if (top.document.navDT.getRecordIndex(top.document.navDT.getSelectedRows()[0]) == 0)
  205. document.write("XML View");
  206. else
  207. document.write('<xsl:value-of select="$Component"/>');
  208. </script>
  209. </h3>
  210. </i>
  211. </div>
  212. <div id="tabviewcontainer" class="yui-navset">
  213. <ul id="tabviewcontainerul" class="yui-nav">
  214. <script type="text/javascript">
  215. createTabDivsForComp('<xsl:value-of select="$Component"/>');
  216. </script>
  217. </ul>
  218. <div id ="tabviewcontainercontent" class="yui-content">
  219. <script type="text/javascript">
  220. </script>
  221. </div>
  222. </div>
  223. <br>
  224. <div id="tabviewcontainer1" class="hidden yui-navset">
  225. <ul id="tabviewcontainerul1" class="yui-nav">
  226. <script type="text/javascript">
  227. createTabDivsForComp('BuildSet');
  228. </script>
  229. </ul>
  230. <div id ="tabviewcontainercontent1" class="yui-content">
  231. <div id="BuildSetTab"></div>
  232. </div>
  233. </div>
  234. </br>
  235. </xsl:when>
  236. </xsl:choose>
  237. <script type="text/javascript">
  238. var rows = new Array();
  239. var rowsPorts = new Array();
  240. var rowsServers = new Array();
  241. var rowsTopology = new Array();
  242. var menuEnabled = new Array();
  243. var viewChildNodes = new Array();
  244. var multiRowNodes = new Array();
  245. initRowsForComplexComps(rowsPorts, "RoxiePorts");
  246. initRowsForComplexComps(rowsServers, "RoxieSlaves");
  247. initRowsForComplexComps(rowsTopology, "Topology");
  248. <xsl:call-template name="fillenableMenu"/>
  249. createDivInTabsForComp('<xsl:value-of select="$Component"/>');
  250. <xsl:choose>
  251. <xsl:when test="($Component='Refresh')"></xsl:when>
  252. <xsl:when test="($Component='Programs')">
  253. var id = 0;
  254. <xsl:for-each select="child::*">
  255. var i = {};
  256. i.compType = '<xsl:value-of select="$Component"/>';
  257. var subRecordIndex = 0;
  258. i.depth = 0;
  259. var parent = 0;
  260. var eN = '<xsl:value-of select="name()"/>'
  261. var subTypeKey = '<xsl:value-of select="@name"/>';
  262. var cN = '<xsl:value-of select="@name"/>';
  263. <xsl:for-each select="@*">
  264. var aS = cS['<xsl:value-of select="name()"/>'+'<xsl:value-of select="$Component"/>'];
  265. if ( aS.hidden != 1) {
  266. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  267. i.<xsl:value-of select="name()"/>_extra = aS.extra;
  268. i.<xsl:value-of select="name()"/>_ctrlType = aS.ctrlType;
  269. }
  270. </xsl:for-each>
  271. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  272. i.params +="::subTypeKey=" + subTypeKey;
  273. i.parent = -1;
  274. parent = id;
  275. i.id = id++;
  276. rows[rows.length] = i;
  277. <xsl:for-each select="*">
  278. var i = {};
  279. var eN = '<xsl:value-of select="name()"/>';
  280. i.compType = '<xsl:value-of select="$Component"/>';
  281. <xsl:for-each select="@*">
  282. var aS = cS['<xsl:value-of select="name()"/>'+'<xsl:value-of select="$Component"/>'];
  283. if(aS.hidden != 1) {
  284. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  285. i.<xsl:value-of select="name()"/>_extra = aS.extra;
  286. i.<xsl:value-of select="name()"/>_ctrlType = aS.ctrlType;
  287. }
  288. </xsl:for-each>
  289. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  290. i.params +="::subTypeKey=";
  291. subRecordIndex = id;
  292. i.id = id++;
  293. i.depth = 1;
  294. i.parent = parent;
  295. rows[rows.length] = i;
  296. </xsl:for-each>
  297. </xsl:for-each>
  298. createMultiColTreeCtrlForComp(rows, "Programs", subRecordIndex);
  299. </xsl:when>
  300. <xsl:when test="($Component='Topology')">
  301. var id = 0;
  302. var i = {};
  303. i.compType = '<xsl:value-of select="$Component"/>';
  304. i.depth = 0;
  305. i.name = "<xsl:value-of select="name()"/>";
  306. i.value = "";
  307. i.name_ctrlType = 0;
  308. i.value_extra = "";
  309. i.value_ctrlType = 0;
  310. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=::subType=";
  311. i.params +="::subTypeKey=";
  312. i.parent = -1;
  313. parent = id;
  314. i.id = id++;
  315. rows[rows.length] = i;
  316. var subRecordIndex = 0;
  317. var parent = 0;
  318. var eN = '<xsl:value-of select="name()"/>'
  319. var subTypeKey = '<xsl:value-of select="@name"/>';
  320. var cN = '<xsl:value-of select="@name"/>';
  321. <xsl:for-each select="@*">
  322. var aS = cS['<xsl:value-of select="name()"/>'];
  323. if(typeof(aS) != 'undefined') {
  324. if ( aS.hidden != 1) {
  325. var i = {};
  326. i.compType = '<xsl:value-of select="$Component"/>';
  327. i.depth = 1;
  328. i.name = "<xsl:value-of select="name()"/>";
  329. if ( i.name != 'build') {
  330. i.value = "<xsl:value-of select="."/>";
  331. i.name_extra = "";
  332. i.name_ctrlType = 0;
  333. i.value_extra = aS.extra;
  334. i.value_ctrlType = aS.ctrlType;
  335. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  336. i.params +="::subTypeKey=" + subTypeKey;
  337. i.parent = parent;
  338. i.id = id++;
  339. }
  340. rows[rows.length] = i;
  341. }
  342. }
  343. </xsl:for-each>
  344. var parentIds = new Array();
  345. parentIds[parentIds.length] = parent;
  346. <xsl:for-each select="descendant::*">
  347. var cN = '<xsl:value-of select="name()"/>';
  348. var i = {};
  349. i.compType = '<xsl:value-of select="$Component"/>';
  350. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  351. i.name = '<xsl:value-of select="name()"/>';
  352. if ('<xsl:value-of select="@name"/>' != '')
  353. i.name += ' - ' + '<xsl:value-of select="@name"/>';
  354. else
  355. i.name += ' - ' + '<xsl:value-of select="@process"/>';
  356. i.value = "";
  357. i.name_extra = "";
  358. i.name_ctrlType = 0;
  359. i.value_extra = "";
  360. i.value_ctrlType = 0;
  361. i.parent = parentIds[parentIds.length-1];
  362. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + rows[i.parent].name + "::subType=";
  363. i.params +="::subTypeKey=" + rows[i.parent].value;
  364. parent = id;
  365. i.id = id++;
  366. rows[rows.length] = i;
  367. var eN = '<xsl:value-of select="name()"/>'
  368. setParentIds(i, rows, parentIds);
  369. <xsl:for-each select="@*">
  370. var aS = cS['<xsl:value-of select="name()"/>'+cN];
  371. if(aS.hidden != 1) {
  372. var i = {};
  373. i.compType = '<xsl:value-of select="$Component"/>';
  374. i.depth = <xsl:value-of select="count(ancestor::*) - 1"/>;
  375. i.name = "<xsl:value-of select="name()"/>";
  376. i.value = "<xsl:value-of select="."/>";
  377. i.name_ctrlType = 0;
  378. i.value_extra = aS.extra;
  379. i.value_ctrlType = aS.ctrlType;
  380. i.parent = parentIds[parentIds.length-1];
  381. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  382. i.params +="::subTypeKey=" + rows[i.parent].name;
  383. i.id = id++;
  384. rows[rows.length] = i;
  385. }
  386. </xsl:for-each>
  387. </xsl:for-each>
  388. createMultiColTreeCtrlForComp(rows, "<xsl:value-of select="$Component"/>", 0);
  389. </xsl:when>
  390. <xsl:when test="($Component='Environment')">
  391. var id = 0;
  392. var i = {};
  393. initEnvXmlType(i);
  394. i.compType = '<xsl:value-of select="$Component"/>';
  395. i.depth = 0;
  396. i.name = "<xsl:value-of select="name()"/>";
  397. i.value = "";
  398. i.params = "pcType=<xsl:value-of select="$Component"/>";
  399. i.parent = -1;
  400. parent = id;
  401. i.id = id++;
  402. rows[rows.length] = i;
  403. var parent = 0;
  404. var cN = '<xsl:value-of select="@name"/>';
  405. <xsl:for-each select="@*">
  406. var i = {};
  407. initEnvXmlType(i);
  408. i.compType = '<xsl:value-of select="$Component"/>';
  409. i.depth = 1;
  410. i.name = "<xsl:value-of select="name()"/>";
  411. i.value = "<xsl:value-of select="."/>";
  412. i.params = "isAttr=no:parentParams" + i.depth + "=" + rows[i.parent].params;
  413. i.parent = parent;
  414. i.hasChildren = false;
  415. i.id = id++;
  416. rows[rows.length] = i;
  417. rows[i.parent].hasChildren = true;
  418. </xsl:for-each>
  419. var parentIds = new Array();
  420. parentIds[parentIds.length] = parent;
  421. <xsl:for-each select="descendant::*">
  422. var i = {};
  423. initEnvXmlType(i);
  424. i.compType = '<xsl:value-of select="@name"/>';
  425. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  426. i.name = '<xsl:value-of select="name()"/>';
  427. <xsl:variable name="value_quote">
  428. <xsl:call-template name="string-replace-all">
  429. <xsl:with-param name="text" select="normalize-space(text())"/>
  430. <xsl:with-param name="replace" select="'&quot;'" />
  431. <xsl:with-param name="by" select="'\&quot;'" />
  432. </xsl:call-template>
  433. </xsl:variable>
  434. i.value = "<xsl:value-of select="$value_quote"/>";
  435. i.parent = parentIds[parentIds.length-1];
  436. parent = id;
  437. i.id = id++;
  438. rows[rows.length] = i;
  439. setParentIds(i, rows, parentIds);
  440. rows[i.parent].hasChildren = true;
  441. i.params = "isAttr=no:pcType=" + '<xsl:value-of select="name()"/>' + ":pcName=" + '<xsl:value-of select="@name"/>' + "::parentParams" + i.depth + "=" + rows[i.parent].params;
  442. <xsl:for-each select="@*">
  443. var i = {};
  444. initEnvXmlType(i);
  445. i.compType = '<xsl:value-of select="$Component"/>';
  446. i.depth = <xsl:value-of select="count(ancestor::*) - 1"/>;
  447. i.name = "<xsl:value-of select="name()"/>";
  448. <xsl:variable name="value">
  449. <xsl:call-template name="string-replace-all">
  450. <xsl:with-param name="text" select="."/>
  451. <xsl:with-param name="replace" select="'\'" />
  452. <xsl:with-param name="by" select="'\\'" />
  453. </xsl:call-template>
  454. </xsl:variable>
  455. i.value = "<xsl:value-of select="$value" />";
  456. i.parent = parentIds[parentIds.length-1];
  457. i.params = "parentParams" + i.depth + "=" + rows[i.parent].params;
  458. i.id = id++;
  459. rows[i.parent].hasChildren = true;
  460. i.hasChildren = false;
  461. rows[rows.length] = i;
  462. </xsl:for-each>
  463. </xsl:for-each>
  464. createEnvXmlView(rows, "<xsl:value-of select="$Component"/>", 0);
  465. </xsl:when>
  466. <xsl:when test="($Component='Deploy')">
  467. var id = 0;
  468. var i = {};
  469. i.compType = '<xsl:value-of select="$Component"/>';
  470. i.depth = 0;
  471. i.name = "<xsl:value-of select="name()"/>";
  472. i.value = "";
  473. i.name_ctrlType = 0;
  474. i.value_extra = "";
  475. i.value_ctrlType = 1;
  476. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=::subType=";
  477. i.params +="::subTypeKey=";
  478. i.parent = -1;
  479. i.instanceName = '';
  480. i.build = '';
  481. i.buildSet = '';
  482. parent = id;
  483. i.id = id++;
  484. rows[rows.length] = i;
  485. var subRecordIndex = 0;
  486. var parent = 0;
  487. var eN = '<xsl:value-of select="name()"/>'
  488. var subTypeKey = '<xsl:value-of select="@name"/>';
  489. var cN = '<xsl:value-of select="@name"/>';
  490. var parentIds = new Array();
  491. parentIds[parentIds.length] = parent;
  492. <xsl:for-each select="descendant::*">
  493. var cN = '<xsl:value-of select="name()"/>';
  494. var i = {};
  495. i.compType = '<xsl:value-of select="$Component"/>';
  496. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  497. if ('<xsl:value-of select="@name"/>' != '')
  498. i.name = '<xsl:value-of select="@name"/>';
  499. else
  500. i.name = '<xsl:value-of select="@nodeName"/>';
  501. i.parent = parentIds[parentIds.length-1];
  502. parent = id;
  503. i.id = id++;
  504. var eN = '<xsl:value-of select="name()"/>'
  505. setParentIds(i, rows, parentIds);
  506. <xsl:for-each select="@*">
  507. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  508. </xsl:for-each>
  509. rows[rows.length] = i;
  510. </xsl:for-each>
  511. createMultiColTreeCtrlForComp(rows, "Deploy", 0);
  512. </xsl:when>
  513. <xsl:otherwise>
  514. createRowArraysForComp('<xsl:value-of select="$Component"/>', rows);
  515. var cN = '<xsl:value-of select="@name"/>';
  516. var notInEnv = '<xsl:value-of select="@_notInEnv"/>';
  517. var aS;
  518. var tN;
  519. <xsl:for-each select="@*">
  520. aS = cS['<xsl:value-of select="name()"/>'];
  521. if(typeof(aS) != 'undefined') {
  522. if (typeof(aS.tab) != 'undefined') {
  523. tN = 'Attributes';
  524. if (aS.tab.length > 0)
  525. tN = aS.tab;
  526. if ( aS.hidden != 1) {
  527. if ((top.document.forms['treeForm'].displayMode.value !== '1') || (aS.displayMode === 1)) {
  528. var i = {};
  529. i.compType = '<xsl:value-of select="$Component"/>';
  530. i.name = "<xsl:value-of select="name()"/>";
  531. i._key = "<xsl:value-of select="name()"/>";
  532. if (aS.caption)
  533. i.name = aS.caption;
  534. i.value = "<xsl:value-of select="."/>";
  535. i.name_ctrlType = 0;
  536. i.value_extra = aS.extra;
  537. i.value_ctrlType = aS.ctrlType;
  538. i.value_required = aS.required;
  539. i.value_onChange = aS.onChange;
  540. i.value_onChangeMsg = aS.onChangeMsg;
  541. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN;
  542. if (isNotInEnv(notInEnv, "<xsl:value-of select="name()"/>"))
  543. i._not_in_env = 1;
  544. rows[tN][rows[tN].length] = i;
  545. }
  546. }
  547. }
  548. }
  549. </xsl:for-each>
  550. var id = 0;
  551. var parent = 0;
  552. var parentIds = new Array();
  553. <xsl:for-each select="*">
  554. <xsl:choose>
  555. <xsl:when test="(name() = 'Topology')">
  556. id = rowsTopology.length;
  557. parent = 0;
  558. parentIds.splice(0, parentIds.length);
  559. parentIds[parentIds.length] = parent;
  560. <xsl:for-each select="descendant::*">
  561. var i = {};
  562. i.compType = '<xsl:value-of select="$Component"/>';
  563. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  564. i.parent = parentIds[parentIds.length-1];
  565. parent = id;
  566. i.id = id++;
  567. setParentIds(i, rowsTopology, parentIds);
  568. <xsl:for-each select="@*">
  569. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  570. </xsl:for-each>
  571. rowsTopology[rowsTopology.length] = i;
  572. </xsl:for-each>
  573. </xsl:when>
  574. <xsl:when test="(name() = 'RoxieFarmProcess')">
  575. id = rowsPorts.length;
  576. parent = 0;
  577. parentIds.splice(0, parentIds.length);
  578. parentIds[parentIds.length] = parent;
  579. <xsl:for-each select="descendant-or-self::*">
  580. var subCompType = '<xsl:value-of select="name()"/>';
  581. var i = {};
  582. i.compType = subCompType;
  583. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  584. i.parent = parentIds[parentIds.length-1];
  585. parent = id;
  586. i.id = id++;
  587. setParentIds(i, rowsPorts, parentIds);
  588. var subTypeKey = '<xsl:value-of select="@name"/>';
  589. <xsl:for-each select="@*">
  590. try {
  591. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  592. i.<xsl:value-of select="name()"/>_extra = cS['<xsl:value-of select="name()"/>'+subCompType].extra;
  593. i.<xsl:value-of select="name()"/>_ctrlType = cS['<xsl:value-of select="name()"/>'+subCompType].ctrlType;
  594. } catch (err) {}
  595. </xsl:for-each>
  596. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN;
  597. i.params += "::subType=" + subCompType + "::subTypeKey=" + subTypeKey;
  598. rowsPorts[rowsPorts.length] = i;
  599. </xsl:for-each>
  600. </xsl:when>
  601. <xsl:when test="(name() = 'RoxieServerProcess')">
  602. id = rowsServers.length;
  603. parent = 0;
  604. parentIds.splice(0, parentIds.length);
  605. parentIds[parentIds.length] = parent;
  606. <xsl:for-each select="descendant-or-self::*">
  607. var i = {};
  608. i.compType = 'RoxieSlave';
  609. i.depth = <xsl:value-of select="count(ancestor::*) - 2"/>;
  610. i.name_ctrlType = 0;
  611. i.parent = parentIds[parentIds.length-1];
  612. parent = id;
  613. i.id = id++;
  614. setParentIds(i, rowsServers, parentIds);
  615. <xsl:for-each select="@*">
  616. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  617. </xsl:for-each>
  618. rowsServers[rowsServers.length] = i;
  619. </xsl:for-each>
  620. </xsl:when>
  621. <xsl:when test="name() = /*[1]/ViewChildNodes/viewChildNodes/*">
  622. var i = {};
  623. i.compType = '<xsl:value-of select="$Component"/>';
  624. var eN = '<xsl:value-of select="name()"/>'
  625. var subTypeKey="";
  626. <xsl:for-each select="@*">
  627. aS = cS['<xsl:value-of select="name()"/>'+eN];
  628. if(typeof(aS) != 'undefined') {
  629. if (typeof(aS.tab) != 'undefined') {
  630. if(aS.hidden != 1) {
  631. if ((top.document.forms['treeForm'].displayMode.value !== 1) || (aS.displayMode === 1)) {
  632. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  633. i.<xsl:value-of select="name()"/>_extra = aS.extra;
  634. i.<xsl:value-of select="name()"/>_ctrlType = aS.ctrlType;
  635. i.<xsl:value-of select="name()"/>_required = aS.required;
  636. i.<xsl:value-of select="name()"/>_onChange = aS.onChange;
  637. i.<xsl:value-of select="name()"/>_onChangeMsg = aS.onChangeMsg;
  638. if ("<xsl:value-of select="."/>"!== "")
  639. subTypeKey += "[@" + "<xsl:value-of select="name()"/>" + "='" + "<xsl:value-of select="."/>" + "']";
  640. if (aS.caption)
  641. i.<xsl:value-of select="name()"/>_caption = aS.caption;
  642. }
  643. }
  644. }
  645. }
  646. </xsl:for-each>
  647. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  648. i.params +="::subTypeKey=" + subTypeKey;
  649. if (typeof(aS) != 'undefined')
  650. rows[aS.tab][rows[aS.tab].length] = i;
  651. <xsl:for-each select="*">
  652. var subi = {};
  653. subi.compType = '<xsl:value-of select="$Component"/>';
  654. var subeN = '<xsl:value-of select="name()"/>'
  655. var subsubTypeKey="";
  656. if (typeof(i._<xsl:value-of select="name()"/>) === 'undefined')
  657. i._<xsl:value-of select="name()"/> = new Array();
  658. <xsl:for-each select="@*">
  659. aS = cS['<xsl:value-of select="name()"/>'+ subeN];
  660. if(typeof(aS) != 'undefined') {
  661. if (typeof(aS.tab) != 'undefined') {
  662. if(aS.hidden != 1) {
  663. if ((top.document.forms['treeForm'].displayMode.value !== 1) || (aS.displayMode === 1)) {
  664. subi.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  665. subi.<xsl:value-of select="name()"/>_extra = aS.extra;
  666. subi.<xsl:value-of select="name()"/>_ctrlType = aS.ctrlType;
  667. subi.<xsl:value-of select="name()"/>_required = aS.required;
  668. subi.<xsl:value-of select="name()"/>_onChange = aS.onChange;
  669. subi.<xsl:value-of select="name()"/>_onChangeMsg = aS.onChangeMsg;
  670. subsubTypeKey += "[@" + "<xsl:value-of select="name()"/>" + "='" + "<xsl:value-of select="."/>" + "']";
  671. if (aS.caption)
  672. subi.<xsl:value-of select="name()"/>_caption = aS.caption;
  673. }
  674. }
  675. }
  676. }
  677. </xsl:for-each>
  678. if (<xsl:value-of select="count(@*)"/> === 0) {
  679. subi.<xsl:value-of select="name()"/> = '<xsl:value-of select="."/>';
  680. subi.<xsl:value-of select="name()"/>_ctrlType = cS['<xsl:value-of select="name()"/>'+ subeN].ctrlType;
  681. }
  682. subi.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  683. subi.params += subTypeKey + "/" + subeN;
  684. subi.params +="::subTypeKey=" + subsubTypeKey;
  685. i._<xsl:value-of select="name()"/>[i._<xsl:value-of select="name()"/>.length] = subi;
  686. </xsl:for-each>
  687. </xsl:when>
  688. <xsl:when test="name() = /*[1]/MultiRowNodes/multiRowNodes/*">
  689. var i = {};
  690. i.compType = '<xsl:value-of select="$Component"/>';
  691. var eN = '<xsl:value-of select="name()"/>'
  692. var subTypeKey="";
  693. var tN;
  694. <xsl:for-each select="@*">
  695. aS = cS['<xsl:value-of select="name()"/>'+eN];
  696. if(typeof(aS) != 'undefined') {
  697. if (typeof(aS.tab) != 'undefined') {
  698. tN = aS.tab
  699. if(aS.hidden != 1) {
  700. if ((top.document.forms['treeForm'].displayMode.value !== 1) || (aS.displayMode === 1)) {
  701. i.<xsl:value-of select="name()"/> = "<xsl:value-of select="."/>";
  702. i.<xsl:value-of select="name()"/>_extra = aS.extra;
  703. i.<xsl:value-of select="name()"/>_ctrlType = aS.ctrlType;
  704. i.<xsl:value-of select="name()"/>_required = aS.required;
  705. i.<xsl:value-of select="name()"/>_onChange = aS.onChange;
  706. i.<xsl:value-of select="name()"/>_onChangeMsg = aS.onChangeMsg;
  707. subTypeKey += "[@" + "<xsl:value-of select="name()"/>" + "='" + "<xsl:value-of select="."/>" + "']";
  708. if (aS.caption)
  709. i.<xsl:value-of select="name()"/>_caption = aS.caption;
  710. }
  711. }
  712. }
  713. }
  714. </xsl:for-each>
  715. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  716. i.params +="::subTypeKey=" + subTypeKey;
  717. if (typeof(tN) != 'undefined')
  718. rows[tN][rows[tN].length] = i;
  719. </xsl:when>
  720. <xsl:otherwise>
  721. var eN = '<xsl:value-of select="name()"/>'
  722. var subTypeKey;
  723. if (eN == 'Instance')
  724. subTypeKey = '<xsl:value-of select="@name"/>';
  725. else if (eN == 'Notes')
  726. subTypeKey = '<xsl:value-of select="@date"/>';
  727. else
  728. subTypeKey = '';
  729. <xsl:for-each select="@*">
  730. aS = cS['<xsl:value-of select="name()"/>'+eN];
  731. if(typeof(aS) != 'undefined') {
  732. if (typeof(aS.tab) != 'undefined') {
  733. if(aS.hidden != 1) {
  734. if ((top.document.forms['treeForm'].displayMode.value !== 1) || (aS.displayMode === 1)) {
  735. var i = {};
  736. i.compType = '<xsl:value-of select="$Component"/>';
  737. i.name = "<xsl:value-of select="name()"/>";
  738. i._key = "<xsl:value-of select="name()"/>";
  739. if (aS.caption)
  740. i.name = aS.caption;
  741. i.value = "<xsl:value-of select="."/>";
  742. i.name_ctrlType = 0;
  743. i.value_extra = aS.extra;
  744. i.value_ctrlType = aS.ctrlType;
  745. i.value_required = aS.required;
  746. i.value_onChange = aS.onChange;
  747. i.value_onChangeMsg = aS.onChangeMsg;
  748. i.params = "pcType=<xsl:value-of select="$Component"/>::pcName=" + cN + "::subType=" + eN;
  749. i.params +="::subTypeKey=" + subTypeKey;
  750. if (typeof(rows[aS.tab]) != 'undefined')
  751. rows[aS.tab][rows[aS.tab].length] = i;
  752. }
  753. }
  754. }
  755. }
  756. </xsl:for-each>
  757. </xsl:otherwise>
  758. </xsl:choose>
  759. </xsl:for-each>
  760. createTablesForComp('<xsl:value-of select="$Component"/>', rows);
  761. if ('<xsl:value-of select="$Component"/>'==='RoxieCluster') {
  762. createMultiColTreeCtrlForComp(rowsServers, "Servers", 0);
  763. createMultiColTreeCtrlForComp(rowsPorts, "Ports", 0);
  764. }
  765. else if ('<xsl:value-of select="$Component"/>'==='ThorCluster')
  766. createMultiColTreeCtrlForComp(rowsTopology, "Topology", 0);
  767. </xsl:otherwise>
  768. </xsl:choose>
  769. selectLastActiveTab();
  770. top.window.document.body.style.cursor='auto';
  771. </script>
  772. </body>
  773. </html>
  774. </xsl:template>
  775. <xsl:template match="/*[1]/Component" />
  776. <xsl:template match="/*[1]/CompDefn" />
  777. <xsl:template match="/*[1]/ViewChildNodes" />
  778. <xsl:template match="/*[1]/MultiRowNodes" />
  779. <xsl:template name="fillenableMenu">
  780. <xsl:for-each select="/*[1]/ViewChildNodes/viewChildNodes/*">
  781. addUniqueToArray(menuEnabled, '<xsl:value-of select="."/>');
  782. addUniqueToArray(viewChildNodes, '<xsl:value-of select="."/>');
  783. </xsl:for-each>
  784. <xsl:for-each select="/*[1]/MultiRowNodes/multiRowNodes/*">
  785. addUniqueToArray(menuEnabled, '<xsl:value-of select="."/>');
  786. addUniqueToArray(multiRowNodes, '<xsl:value-of select="."/>');
  787. </xsl:for-each>
  788. </xsl:template>
  789. </xsl:stylesheet>