|
@@ -19,7 +19,6 @@ define([
|
|
|
"dojo/dom",
|
|
|
"dojo/dom-class",
|
|
|
|
|
|
- "dijit/layout/_LayoutWidget",
|
|
|
"dijit/_TemplatedMixin",
|
|
|
"dijit/_WidgetsInTemplateMixin",
|
|
|
"dijit/layout/BorderContainer",
|
|
@@ -32,6 +31,7 @@ define([
|
|
|
"dijit/TitlePane",
|
|
|
"dijit/registry",
|
|
|
|
|
|
+ "hpcc/_TabContainerWidget",
|
|
|
"hpcc/ResultWidget",
|
|
|
"hpcc/ECLSourceWidget",
|
|
|
"hpcc/FilePartsWidget",
|
|
@@ -42,17 +42,17 @@ define([
|
|
|
|
|
|
"dojo/text!../templates/LFDetailsWidget.html"
|
|
|
], function (declare, lang, dom, domClass,
|
|
|
- _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, Toolbar, TooltipDialog, SimpleTextarea, Button, TitlePane, registry,
|
|
|
- ResultWidget, EclSourceWidget, FilePartsWidget, WUDetailsWidget, DFUWUDetailsWidget,
|
|
|
+ _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, Toolbar, TooltipDialog, SimpleTextarea, Button, TitlePane, registry,
|
|
|
+ _TabContainerWidget, ResultWidget, EclSourceWidget, FilePartsWidget, WUDetailsWidget, DFUWUDetailsWidget,
|
|
|
ESPLogicalFile,
|
|
|
template) {
|
|
|
- return declare("LFDetailsWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
|
|
|
+ return declare("LFDetailsWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
|
|
|
templateString: template,
|
|
|
baseClass: "LFDetailsWidget",
|
|
|
borderContainer: null,
|
|
|
tabContainer: null,
|
|
|
- resultWidget: null,
|
|
|
- resultWidgetLoaded: false,
|
|
|
+ contentWidget: null,
|
|
|
+ contentWidgetLoaded: false,
|
|
|
sourceWidget: null,
|
|
|
sourceWidgetLoaded: false,
|
|
|
defWidget: null,
|
|
@@ -70,87 +70,19 @@ define([
|
|
|
|
|
|
logicalFile: null,
|
|
|
prevState: "",
|
|
|
- initiated: false,
|
|
|
-
|
|
|
- buildRendering: function (args) {
|
|
|
- this.inherited(arguments);
|
|
|
- },
|
|
|
+ initalized: false,
|
|
|
|
|
|
postCreate: function (args) {
|
|
|
this.inherited(arguments);
|
|
|
- this.borderContainer = registry.byId(this.id + "BorderContainer");
|
|
|
- this.tabContainer = registry.byId(this.id + "TabContainer");
|
|
|
- this.resultWidget = registry.byId(this.id + "Content");
|
|
|
- this.sourceWidget = registry.byId(this.id + "Source");
|
|
|
- this.defWidget = registry.byId(this.id + "DEF");
|
|
|
- this.xmlWidget = registry.byId(this.id + "XML");
|
|
|
- this.filePartsWidget = registry.byId(this.id + "FileParts");
|
|
|
- this.workunitWidget = registry.byId(this.id + "Workunit");
|
|
|
- this.dfuWorkunitWidget = registry.byId(this.id + "DFUWorkunit");
|
|
|
- this.legacyPane = registry.byId(this.id + "Legacy");
|
|
|
-
|
|
|
- var context = this;
|
|
|
- this.tabContainer.watch("selectedChildWidget", function (name, oval, nval) {
|
|
|
- if (nval.id == context.id + "Content" && !context.resultWidgetLoaded) {
|
|
|
- context.resultWidgetLoaded = true;
|
|
|
- context.resultWidget.init({
|
|
|
- result: context.logicalFile.result
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "Source" && !context.sourceWidgetLoaded) {
|
|
|
- context.sourceWidgetLoaded = true;
|
|
|
- context.sourceWidget.init({
|
|
|
- ECL: context.logicalFile.DFUInfoResponse.Ecl
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "DEF" && !context.defWidgetLoaded) {
|
|
|
- context.logicalFile.fetchDEF(function (response) {
|
|
|
- context.defWidgetLoaded = true;
|
|
|
- context.defWidget.init({
|
|
|
- ECL: response
|
|
|
- });
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "XML" && !context.xmlWidgetLoaded) {
|
|
|
- context.logicalFile.fetchXML(function (response) {
|
|
|
- context.xmlWidgetLoaded = true;
|
|
|
- context.xmlWidget.init({
|
|
|
- ECL: response
|
|
|
- });
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "FileParts" && !context.filePartsWidgetLoaded) {
|
|
|
- context.filePartsWidgetLoaded = true;
|
|
|
- context.filePartsWidget.init({
|
|
|
- fileParts: lang.exists("logicalFile.DFUInfoResponse.DFUFileParts.DFUPart", context) ? context.logicalFile.DFUInfoResponse.DFUFileParts.DFUPart : []
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "Workunit" && !context.workunitWidgetLoaded) {
|
|
|
- context.workunitWidgetLoaded = true;
|
|
|
- context.workunitWidget.init({
|
|
|
- Wuid: context.logicalFile.DFUInfoResponse.Wuid
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "DFUWorkunit" && !context.workunitWidgetLoaded) {
|
|
|
- context.dfuWorkunitWidgetLoaded = true;
|
|
|
- context.dfuWorkunitWidget.init({
|
|
|
- Wuid: context.logicalFile.DFUInfoResponse.Wuid
|
|
|
- });
|
|
|
- } else if (nval.id == context.id + "Legacy" && !context.legacyPaneLoaded) {
|
|
|
- context.legacyPaneLoaded = true;
|
|
|
- context.legacyPane.set("content", dojo.create("iframe", {
|
|
|
- src: "/WsDfu/DFUInfo?Name=" + context.logicalFile.logicalName,//+ "&Cluster=" + context.logicalFile.cluster,
|
|
|
- style: "border: 0; width: 100%; height: 100%"
|
|
|
- }));
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- startup: function (args) {
|
|
|
- this.inherited(arguments);
|
|
|
- },
|
|
|
-
|
|
|
- resize: function (args) {
|
|
|
- this.inherited(arguments);
|
|
|
- this.borderContainer.resize();
|
|
|
- },
|
|
|
-
|
|
|
- layout: function (args) {
|
|
|
- this.inherited(arguments);
|
|
|
+ this.summaryWidget = registry.byId(this.id + "_Summary");
|
|
|
+ this.contentWidget = registry.byId(this.id + "_Content");
|
|
|
+ this.sourceWidget = registry.byId(this.id + "_Source");
|
|
|
+ this.defWidget = registry.byId(this.id + "_DEF");
|
|
|
+ this.xmlWidget = registry.byId(this.id + "_XML");
|
|
|
+ this.filePartsWidget = registry.byId(this.id + "_FileParts");
|
|
|
+ this.workunitWidget = registry.byId(this.id + "_Workunit");
|
|
|
+ this.dfuWorkunitWidget = registry.byId(this.id + "_DFUWorkunit");
|
|
|
+ this.legacyPane = registry.byId(this.id + "_Legacy");
|
|
|
},
|
|
|
|
|
|
// Hitched actions ---
|
|
@@ -194,17 +126,71 @@ define([
|
|
|
|
|
|
// Implementation ---
|
|
|
init: function (params) {
|
|
|
- if (!this.initiated) {
|
|
|
- this.initiated = true;
|
|
|
- if (params.Name) {
|
|
|
- dom.byId(this.id + "LogicalFileName").innerHTML = params.Name;
|
|
|
- //dom.byId(this.id + "LogicalFileName2").value = params.Name;
|
|
|
- this.logicalFile = new ESPLogicalFile({
|
|
|
- cluster: params.Cluster,
|
|
|
- logicalName: params.Name
|
|
|
+ if (this.initalized)
|
|
|
+ return;
|
|
|
+ this.initalized = true;
|
|
|
+
|
|
|
+ if (params.Name) {
|
|
|
+ dom.byId(this.id + "LogicalFileName").innerHTML = params.Name;
|
|
|
+ //dom.byId(this.id + "LogicalFileName2").value = params.Name;
|
|
|
+ this.logicalFile = new ESPLogicalFile({
|
|
|
+ cluster: params.Cluster,
|
|
|
+ logicalName: params.Name
|
|
|
+ });
|
|
|
+ this.refreshPage();
|
|
|
+ }
|
|
|
+ this.selectChild(this.summaryWidget, true);
|
|
|
+ },
|
|
|
+
|
|
|
+ initTab: function() {
|
|
|
+ var currSel = this.getSelectedChild();
|
|
|
+ if (currSel.id == this.contentWidget.id && !this.contentWidgetLoaded) {
|
|
|
+ this.contentWidgetLoaded = true;
|
|
|
+ this.contentWidget.init({
|
|
|
+ result: this.logicalFile.result
|
|
|
+ });
|
|
|
+ } else if (currSel.id == this.sourceWidget.id && !this.sourceWidgetLoaded) {
|
|
|
+ this.sourceWidgetLoaded = true;
|
|
|
+ this.sourceWidget.init({
|
|
|
+ ECL: this.logicalFile.DFUInfoResponse.Ecl
|
|
|
+ });
|
|
|
+ } else if (currSel.id == this.defWidget.id && !this.defWidgetLoaded) {
|
|
|
+ var context = this;
|
|
|
+ this.logicalFile.fetchDEF(function (response) {
|
|
|
+ context.defWidgetLoaded = true;
|
|
|
+ context.defWidget.init({
|
|
|
+ ECL: response
|
|
|
});
|
|
|
- this.refreshPage();
|
|
|
- }
|
|
|
+ });
|
|
|
+ } else if (currSel.id == this.xmlWidget.id && !this.xmlWidgetLoaded) {
|
|
|
+ var context = this;
|
|
|
+ this.logicalFile.fetchXML(function (response) {
|
|
|
+ context.xmlWidgetLoaded = true;
|
|
|
+ context.xmlWidget.init({
|
|
|
+ ECL: response
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else if (currSel.id == this.filePartsWidget.id && !this.filePartsWidgetLoaded) {
|
|
|
+ this.filePartsWidgetLoaded = true;
|
|
|
+ this.filePartsWidget.init({
|
|
|
+ fileParts: lang.exists("logicalFile.DFUInfoResponse.DFUFileParts.DFUPart", this) ? this.logicalFile.DFUInfoResponse.DFUFileParts.DFUPart : []
|
|
|
+ });
|
|
|
+ } else if (this.workunitWidget && currSel.id == this.workunitWidget.id && !this.workunitWidgetLoaded) {
|
|
|
+ this.workunitWidgetLoaded = true;
|
|
|
+ this.workunitWidget.init({
|
|
|
+ Wuid: this.logicalFile.DFUInfoResponse.Wuid
|
|
|
+ });
|
|
|
+ } else if (this.dfuWorkunitWidget && currSel.id == this.dfuWorkunitWidget.id && !this.workunitWidgetLoaded) {
|
|
|
+ this.dfuWorkunitWidgetLoaded = true;
|
|
|
+ this.dfuWorkunitWidget.init({
|
|
|
+ Wuid: this.logicalFile.DFUInfoResponse.Wuid
|
|
|
+ });
|
|
|
+ } else if (currSel.id == this.legacyPane.id && !this.legacyPaneLoaded) {
|
|
|
+ this.legacyPaneLoaded = true;
|
|
|
+ this.legacyPane.set("content", dojo.create("iframe", {
|
|
|
+ src: "/WsDfu/DFUInfo?Name=" + this.logicalFile.logicalName,//+ "&Cluster=" + this.logicalFile.cluster,
|
|
|
+ style: "border: 0; width: 100%; height: 100%"
|
|
|
+ }));
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -225,15 +211,13 @@ define([
|
|
|
},
|
|
|
refreshFileDetails: function (fileDetails) {
|
|
|
if (fileDetails.Wuid && fileDetails.Wuid[0] == "D" && this.workunitWidget) {
|
|
|
- this.tabContainer.removeChild(this.workunitWidget);
|
|
|
- this.workunitWidget.destroyRecursive();
|
|
|
+ this.removeChild(this.workunitWidget);
|
|
|
this.workunitWidget = null;
|
|
|
} else if (this.dfuWorkunitWidget) {
|
|
|
- this.tabContainer.removeChild(this.dfuWorkunitWidget);
|
|
|
- this.dfuWorkunitWidget.destroyRecursive();
|
|
|
+ this.removeChild(this.dfuWorkunitWidget);
|
|
|
this.dfuWorkunitWidget = null;
|
|
|
}
|
|
|
- registry.byId(this.id + "Summary").set("title", fileDetails.Filename);
|
|
|
+ registry.byId(this.id + "_Summary").set("title", fileDetails.Filename);
|
|
|
//registry.byId(this.id + "Summary").set("iconClass", "iconRefresh");
|
|
|
//domClass.remove(this.id + "Test");
|
|
|
//domClass.add(this.id + "Test", "iconRefresh");
|
|
@@ -245,7 +229,7 @@ define([
|
|
|
dom.byId(this.id + "Directory").innerHTML = fileDetails.Dir;
|
|
|
dom.byId(this.id + "RecordSize").innerHTML = fileDetails.RecordSize;
|
|
|
dom.byId(this.id + "Count").innerHTML = fileDetails.RecordCount;
|
|
|
- this.resultWidget.set("title", "Content " + "(" + fileDetails.RecordCount + ")");
|
|
|
+ this.contentWidget.set("title", "Content " + "(" + fileDetails.RecordCount + ")");
|
|
|
dom.byId(this.id + "Filesize").innerHTML = fileDetails.Filesize;
|
|
|
dom.byId(this.id + "Pathmask").innerHTML = fileDetails.PathMask;
|
|
|
}
|