Selaa lähdekoodia

EPE-22 Redirect Eclipse plugin to use new ECL Watch

Enable direct page loads from eclipse plugin.

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 12 vuotta sitten
vanhempi
commit
aa682bf3fb

+ 4 - 5
esp/files/scripts/DFUWUQueryWidget.js

@@ -37,7 +37,7 @@ define([
     "hpcc/LFDetailsWidget",
     "hpcc/SFDetailsWidget",
 
-    "dojo/text!../templates/DFUWUQueryWidget.html",
+    "dojo/text!../templates/DFUQueryWidget.html",
 
     "dijit/layout/BorderContainer",
     "dijit/layout/TabContainer",
@@ -60,9 +60,9 @@ define([
                 EnhancedGrid, Pagination, IndirectSelection,
                 _TabContainerWidget, WsDfu, ESPLogicalFile, LFDetailsWidget, SFDetailsWidget,
                 template) {
-    return declare("DFUWUQueryWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
+    return declare("DFUQueryWidget", [_TabContainerWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
-        baseClass: "DFUWUQueryWidget",
+        baseClass: "DFUQueryWidget",
         workunitsTab: null,
         workunitsGrid: null,
 
@@ -256,8 +256,7 @@ define([
                 { name: "Modified (UTC/GMT)", field: "Modified", width: "12" }
             ]);
             var objStore = ESPLogicalFile.CreateLFQueryObjectStore();
-            this.workunitsGrid.setStore(objStore);
-            this.workunitsGrid.setQuery(this.getFilter());
+            this.workunitsGrid.setStore(objStore, this.getFilter());
 
             var context = this;
             this.workunitsGrid.on("RowDblClick", function (evt) {

+ 0 - 10
esp/files/scripts/DFUWUDetailsWidget.js

@@ -64,8 +64,6 @@ define([
         playgroundWidgetLoaded: false,
         xmlWidget: null,
         xmlWidgetLoaded: false,
-        legacyPane: null,
-        legacyPaneLoaded: false,
 
         wu: null,
         loaded: false,
@@ -78,10 +76,8 @@ define([
             this.inherited(arguments);
             this.borderContainer = registry.byId(this.id + "BorderContainer");
             this.tabContainer = registry.byId(this.id + "TabContainer");
-            this.legacyPane = registry.byId(this.id + "Legacy");
             this.xmlWidget = registry.byId(this.id + "XML");
 
-
             var context = this;
             this.tabContainer.watch("selectedChildWidget", function (name, oval, nval) {
                 if (nval.id == context.id + "Content" && !context.resultWidgetLoaded) {
@@ -123,12 +119,6 @@ define([
                     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: "/FileSpray/GetDFUWorkunit?wuid=" + context.wu.Wuid,
-                        style: "border: 0; width: 100%; height: 100%"
-                    }));
                 }
             });
         },

+ 10 - 0
esp/files/scripts/ESPWorkunit.js

@@ -558,6 +558,16 @@ define([
                 onGetResults: onFetchResults
             });
         },
+        fetchSourceFiles: function (onFetchSourceFiles) {
+            if (this.sourceFiles && this.sourceFiles.length) {
+                onFetchSourceFiles(this.sourceFiles);
+                return;
+            }
+
+            this.getInfo({
+                onGetSourceFiles: onFetchSourceFiles
+            });
+        },
         fetchTimers: function (onFetchTimers) {
             if (this.timers && this.timers.length) {
                 onFetchTimers(this.timers);

+ 8 - 16
esp/files/scripts/GetDFUWorkunitsWidget.js

@@ -55,8 +55,6 @@ define([
         borderContainer: null,
         tabContainer: null,
         workunitsGrid: null,
-        legacyPane: null,
-        legacyPaneLoaded: false,
 
         tabMap: [],
 
@@ -69,19 +67,10 @@ define([
             this.borderContainer = registry.byId(this.id + "BorderContainer");
             this.tabContainer = registry.byId(this.id + "TabContainer");
             this.workunitsGrid = registry.byId(this.id + "WorkunitsGrid");
-            this.legacyPane = registry.byId(this.id + "Legacy");
 
             var context = this;
             this.tabContainer.watch("selectedChildWidget", function (name, oval, nval) {
                 if (nval.id == context.id + "Workunits") {
-                } else if (nval.id == context.id + "Legacy") {
-                    if (!context.legacyPaneLoaded) {
-                        context.legacyPaneLoaded = true;
-                        context.legacyPane.set("content", dojo.create("iframe", {
-                            src: "/FileSpray/GetDFUWorkunits",
-                            style: "border: 0; width: 100%; height: 100%"
-                        }));
-                    }
                 } else {
                     if (!nval.initalized) {
                         nval.init(nval.params);
@@ -93,8 +82,6 @@ define([
 
         startup: function (args) {
             this.inherited(arguments);
-            this.refreshActionState();
-            this.initWorkunitsGrid();
         },
 
         resize: function (args) {
@@ -217,6 +204,12 @@ define([
             if (this.initalized)
                 return;
             this.initalized = true;
+
+            if (params.ClusterName) {
+                registry.byId(this.id + "Cluster").set("value", params.ClusterName);
+            }
+            this.initWorkunitsGrid();
+            this.refreshActionState();
         },
 
         initWorkunitsGrid: function() {
@@ -266,8 +259,7 @@ define([
             ]);
             var store = new FileSpray.GetDFUWorkunits();
             var objStore = new ObjectStore({ objectStore: store });
-            this.workunitsGrid.setStore(objStore);
-            this.workunitsGrid.setQuery(this.getFilter());
+            this.workunitsGrid.setStore(objStore, this.getFilter());
 
             var context = this;
             this.workunitsGrid.on("RowDblClick", function (evt) {
@@ -332,7 +324,7 @@ define([
                 retVal = new DFUWUDetailsWidget({
                     Wuid: id,
                     title: id,
-                    closable: true,
+                    closable: false,
                     onClose: function () {
                         delete context.tabMap[id];
                         return true;

+ 3 - 1
esp/files/scripts/GraphPageWidget.js

@@ -47,7 +47,9 @@ define([
     "dijit/PopupMenuItem",
     "dijit/Menu",
     "dijit/MenuItem",
-    "dijit/form/TextBox"
+    "dijit/MenuSeparator",
+    "dijit/form/TextBox",
+    "dijit/form/DropDownButton"
 ], function (declare, lang, sniff, arrayUtil, dom, domConstruct, on, has, Memory, ObjectStore,
             _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, registry, Dialog,
             DataGrid, entities,

+ 2 - 0
esp/files/scripts/GraphsWidget.js

@@ -37,6 +37,7 @@ define([
         templateString: template,
         baseClass: "GraphsWidget",
 
+        TabPosition: "bottom",
         tabMap: [],
 
         onErrorClick: function (line, col) {
@@ -63,6 +64,7 @@ define([
                 this.tabMap[id] = retVal;
                 this.addChild(retVal);
             }
+            return retVal;
         },
 
         init: function (params) {

+ 28 - 4
esp/files/scripts/ResultWidget.js

@@ -27,6 +27,8 @@ define([
     "dojox/grid/enhanced/plugins/Pagination",
 
     "hpcc/ESPBase",
+    "hpcc/ESPWorkunit",
+    "hpcc/ESPLogicalFile",
 
     "dojo/text!../templates/ResultWidget.html",
 
@@ -38,7 +40,7 @@ define([
 ], function (declare, lang, dom, iframe,
                 _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, registry,
                 Pagination,
-                ESPBase,
+                ESPBase, ESPWorkunit, ESPLogicalFile,
                 template) {
     return declare("ResultWidget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         templateString: template,
@@ -124,12 +126,34 @@ define([
             this.result = params.result;
             //TODO:  Encapsulate this IF into ESPResult.js
             if (params.result && params.result.canShowResults()) {
+                this.initResult(params.result);
+            } else if (params.Wuid && params.Sequence) {
+                var wu = ESPWorkunit.Get(params.Wuid);
                 var context = this;
-                params.result.fetchStructure(function (structure) {
+                wu.fetchResults(function (results) {
+                    context.initResult(results[params.Sequence]);
+                });
+            } else if (params.LogicalName) {
+                var logicalFile = ESPLogicalFile.Get(params.LogicalName);
+                var context = this;
+                logicalFile.getInfo({
+                    onGetAll: function(response) {
+                        context.initResult(logicalFile.result);
+                    }
+                });
+            } else {
+                this.initResult(null);
+            }
+        },
+
+        initResult: function (result) {
+            if (result) {
+                var context = this;
+                result.fetchStructure(function (structure) {
                     context.grid.setStructure(structure);
-                    context.grid.setStore(params.result.getObjectStore());
+                    context.grid.setStore(result.getObjectStore());
                     context.refresh();
-                })
+                });
             } else {
                 this.grid.setStructure([
                             {

+ 12 - 5
esp/files/scripts/WUQueryWidget.js

@@ -77,10 +77,8 @@ define([
 
         startup: function (args) {
             this.inherited(arguments);
-            this.initWorkunitsGrid();
             this.initFilter();
             this.initContextMenu();
-            this.refreshActionState();
         },
 
         resize: function (args) {
@@ -304,6 +302,12 @@ define([
                 return;
             this.initalized = true;
 
+            //TODO:  Should be easier generic way
+            if (params.Cluster) {
+                registry.byId(this.id + "Cluster").set("value", params.Cluster);
+            }
+            this.initWorkunitsGrid();
+            this.refreshActionState();
             this.selectChild(this.workunitsTab, true);
         },
 
@@ -434,8 +438,7 @@ define([
             ]);
 
             this.objectStore = ESPWorkunit.CreateWUQueryObjectStore();
-            this.workunitsGrid.setStore(this.objectStore);
-            this.workunitsGrid.setQuery(this.getFilter());
+            this.workunitsGrid.setStore(this.objectStore, this.getFilter());
             this.workunitsGrid.noDataMessage = "<span class='dojoxGridNoData'>Zero Workunits (check filter).</span>";
 
             this.workunitsGrid.on("RowDblClick", function (evt) {
@@ -493,7 +496,6 @@ define([
             var hasNotProtected = false;
             var hasFailed = false;
             var hasNotFailed = false;
-            var hasFilter = this.hasFilter();
             var hasCompleted = false;
             var hasNotCompleted = false;
             for (var i = 0; i < selection.length; ++i) {
@@ -531,6 +533,11 @@ define([
             this.menuProtect.set("disabled", !hasNotProtected);
             this.menuUnprotect.set("disabled", !hasProtected);
 
+            this.refreshFilterState();
+        },
+
+        refreshFilterState: function () {
+            var hasFilter = this.hasFilter();
             dom.byId(this.id + "IconFilter").src = hasFilter ? "img/filter.png" : "img/noFilter.png";
         },
 

+ 5 - 0
esp/files/stub.js

@@ -44,6 +44,11 @@ define([
                         TabPosition: params.TabPosition
                     });
                 }
+                if (params.ReadOnly) {
+                    lang.mixin(webParams, {
+                        readOnly: params.ReadOnly
+                    });
+                }
                 var widget = WidgetClass.fixCircularDependency ? new WidgetClass.fixCircularDependency(webParams) : new WidgetClass(webParams);
 
                 var standbyBackground = new Standby({

esp/files/templates/DFUWUQueryWidget.html → esp/files/templates/DFUQueryWidget.html


+ 0 - 2
esp/files/templates/DFUWUDetailsWidget.html

@@ -220,8 +220,6 @@
             </div>
             <div id="${id}XML" title="XML" data-dojo-props="WUXml: true" data-dojo-type="ECLSourceWidget">
             </div>
-            <div id="${id}Legacy" title="Legacy Web Page" data-dojo-type="dijit.layout.ContentPane">
-            </div>
         </div>
     </div>
 </div>

+ 0 - 2
esp/files/templates/GetDFUWorkunitsWidget.html

@@ -76,8 +76,6 @@
                 }" data-dojo-type="dojox.grid.EnhancedGrid">
                 </div>
             </div>
-            <div id="${id}Legacy" title="Legacy Web Page" data-dojo-type="dijit.layout.ContentPane">
-            </div>
         </div>
     </div>
 </div>

+ 1 - 1
esp/files/templates/GraphsWidget.html

@@ -1,4 +1,4 @@
 <div class="${baseClass}">
-    <div id="${id}TabContainer" style="width: 100%; height: 100%" data-dojo-props="tabPosition: 'bottom'" data-dojo-type="dijit.layout.TabContainer">
+    <div id="${id}TabContainer" style="width: 100%; height: 100%" data-dojo-props="tabPosition: '${TabPosition}'"  data-dojo-type="dijit.layout.TabContainer">
     </div>
 </div>

+ 1 - 1
esp/services/ws_fs/ws_fsBinding.hpp

@@ -69,7 +69,7 @@ public:
 
         IPropertyTree *folderTP = CEspBinding::ensureNavFolder(data, "Tech Preview", "Technical Preview");
         CEspBinding::ensureNavLink(*folderTP, "DFU Workunits", "/esp/files/stub.htm?Widget=GetDFUWorkunitsWidget", "DFU Workunits", NULL, NULL, 2);
-        CEspBinding::ensureNavLink(*folderTP, "Logical Files", "/esp/files/stub.htm?Widget=DFUWUQueryWidget", "Logical Files", NULL, NULL, 3);
+        CEspBinding::ensureNavLink(*folderTP, "Logical Files", "/esp/files/stub.htm?Widget=DFUQueryWidget", "Logical Files", NULL, NULL, 3);
     }
 
     int onGetInstantQuery(IEspContext &context, CHttpRequest* request, CHttpResponse* response, const char *service, const char *method);