HPCCPlatformFilesWidget.js 2.7 KB

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