HPCCPlatformRoxieWidget.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*##############################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################## */
  16. define([
  17. "dojo/_base/declare",
  18. "dijit/_TemplatedMixin",
  19. "dijit/_WidgetsInTemplateMixin",
  20. "dijit/registry",
  21. "hpcc/_TabContainerWidget",
  22. "hpcc/ESPRequest",
  23. "dojo/text!../templates/HPCCPlatformRoxieWidget.html",
  24. "dijit/layout/BorderContainer",
  25. "dijit/layout/TabContainer",
  26. "dijit/layout/ContentPane"
  27. ], function (declare,
  28. _TemplatedMixin, _WidgetsInTemplateMixin, registry,
  29. _TabContainerWidget, ESPRequest,
  30. template) {
  31. return declare("HPCCPlatformRoxieWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
  32. templateString: template,
  33. baseClass: "HPCCPlatformRoxieWidget",
  34. postCreate: function (args) {
  35. this.inherited(arguments);
  36. },
  37. startup: function (args) {
  38. this.inherited(arguments);
  39. },
  40. // Hitched actions ---
  41. // Implementation ---
  42. init: function (params) {
  43. if (this.initalized)
  44. return;
  45. this.initalized = true;
  46. this.initTab();
  47. },
  48. initTab: function () {
  49. var currSel = this.getSelectedChild();
  50. if (currSel && !currSel.initalized) {
  51. if (currSel.id === this.id + "_Queries") {
  52. currSel.set("content", dojo.create("iframe", {
  53. src: ESPRequest.getBaseURL() + "/WUQuerySets",
  54. style: "border: 0; width: 100%; height: 100%"
  55. }));
  56. currSel.initalized = true;
  57. } else if (currSel.init) {
  58. currSel.init(currSel.params);
  59. }
  60. }
  61. }
  62. });
  63. });