HPCCPlatformFilesWidget.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. "hpcc/GetDFUWorkunitsWidget",
  24. "hpcc/DFUQueryWidget",
  25. "hpcc/LZBrowseWidget",
  26. "dojo/text!../templates/HPCCPlatformFilesWidget.html",
  27. "dijit/layout/BorderContainer",
  28. "dijit/layout/TabContainer",
  29. "dijit/layout/ContentPane"
  30. ], function (declare,
  31. _TemplatedMixin, _WidgetsInTemplateMixin, registry,
  32. _TabContainerWidget, ESPRequest, GetDFUWorkunitsWidget, DFUQueryWidget, LZBrowseWidget,
  33. template) {
  34. return declare("HPCCPlatformFilesWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
  35. templateString: template,
  36. baseClass: "HPCCPlatformFilesWidget",
  37. postCreate: function (args) {
  38. this.inherited(arguments);
  39. },
  40. startup: function (args) {
  41. this.inherited(arguments);
  42. },
  43. getTitle: function () {
  44. return "HPCC Platform - Files";
  45. },
  46. // Hitched actions ---
  47. // Implementation ---
  48. init: function (params) {
  49. if (this.initalized)
  50. return;
  51. this.initalized = true;
  52. this.initTab();
  53. },
  54. initTab: function () {
  55. var currSel = this.getSelectedChild();
  56. if (currSel && !currSel.initalized) {
  57. if (currSel.id === this.id + "_XRef") {
  58. currSel.set("content", dojo.create("iframe", {
  59. src: ESPRequest.getBaseURL("WsDFUXRef") + "/DFUXRefList",
  60. style: "border: 0; width: 100%; height: 100%"
  61. }));
  62. } else if (currSel.init) {
  63. currSel.init(currSel.params);
  64. }
  65. currSel.initalized = true;
  66. }
  67. }
  68. });
  69. });