HPCCPlatformFilesWidget.js 2.5 KB

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