浏览代码

HPCC-8072 Common up widget "stub" files

Fixes HPCC-8072

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 12 年之前
父节点
当前提交
4b00960880

+ 2 - 10
esp/files/CMakeLists.txt

@@ -211,16 +211,8 @@ set ( MAIN_FILES
     esp_app.html
     useradd.html
     groupadd.html
-    ECLPlayground.htm
-    ECLPlayground.js
-    ECLPlaygroundResults.htm
-    ECLPlaygroundResults.js
-    WUGraph.htm
-    WUGraph.js
-    WUTimings.htm
-    WUTimings.js
-    WUSource.htm
-    WUSource.js
+    stub.htm
+    stub.js
     )
 source_group("Source Files" FILES ${MAIN_FILES})
 

+ 0 - 78
esp/files/ECLPlayground.js

@@ -1,78 +0,0 @@
-/*##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-############################################################################## */
-define([
-	"dojo/_base/fx",
-	"dojo/_base/window",
-	"dojo/dom",
-	"dojo/dom-style",
-	"dojo/dom-geometry",
-	"dojo/io-query",
-	"dojo/ready",
-
-	"dijit/registry"
-], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready, registry) {
-    var initUi = function () {
-        var wuid = "";
-        var target = "hthor";
-
-        var urlWuid = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Wuid"];
-        if (urlWuid) {
-            wuid = urlWuid;
-        }
-        var urlTarget = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Target"];
-        if (urlTarget) {
-            target = urlTarget;
-        }
-
-        var eclPlayground = registry.byId("appLayout");
-        if (wuid) {
-            eclPlayground.hideTitle();
-        }
-        eclPlayground.init(wuid, target);
-    },
-
-	startLoading = function (targetNode) {
-	    var overlayNode = dom.byId("loadingOverlay");
-	    if ("none" == domStyle.get(overlayNode, "display")) {
-	        var coords = domGeometry.getMarginBox(targetNode || baseWindow.body());
-	        domGeometry.setMarginBox(overlayNode, coords);
-	        domStyle.set(dom.byId("loadingOverlay"), {
-	            display: "block",
-	            opacity: 1
-	        });
-	    }
-	},
-
-	endLoading = function () {
-	    fx.fadeOut({
-	        node: dom.byId("loadingOverlay"),
-	        duration: 175,
-	        onEnd: function (node) {
-	            domStyle.set(node, "display", "none");
-	        }
-	    }).play();
-	}
-
-    return {
-        init: function () {
-            startLoading();
-            ready(function () {
-                initUi();
-                endLoading();
-            });
-        }
-    };
-});

+ 0 - 69
esp/files/ECLPlaygroundResults.htm

@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<!--
-##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-##############################################################################
--->
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>HPCC: ECL Playground (Results)</title>
-    <link href="css/hpcc.css" media="screen" rel="stylesheet">
-    <link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
-    <link href="dojox/grid/resources/Grid.css" rel="stylesheet">
-    <link href="dojox/grid/enhanced/resources/claro/EnhancedGrid.css" rel="stylesheet">
-    <link href="dojox/grid/resources/claroGrid.css" rel="stylesheet">
-    <!-- load dojo and provide config via dojoConfig global -->
-    <script>
-        var dojoConfig = (function () {
-            var base = location.href.split("/");
-            base.pop();
-            base = base.join("/");
-
-            return {
-                async: true,
-                parseOnLoad: true,
-                urlBase: base,
-                packages: [{
-                    name: "main",
-                    location: base + "/"
-                }, {
-                    name: "hpcc",
-                    location: base + "/scripts/"
-                }]
-            };
-        })();
-    </script>
-    <script src="dojo/dojo.js"></script>
-    <script>
-        require([
-        "main/ECLPlaygroundResults", "hpcc/ResultsWidget",
-        "dojo/domReady!"], function (app) {
-            app.init();
-        });
-    </script>
-</head>
-<body class="claro">
-    <!-- overlay -->
-    <div id="loadingOverlay" class="pageOverlay">
-        <div class="loadingMessage">
-            Loading...
-        </div>
-    </div>
-    <!-- application -->
-    <div id="appLayout" class="hpccApp" data-dojo-props="design: 'headline'" data-dojo-type="ResultsWidget">
-    </div>
-</body>
-</html>

+ 0 - 81
esp/files/ECLPlaygroundResults.js

@@ -1,81 +0,0 @@
-/*##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-############################################################################## */
-define([
-	"dojo/_base/fx",
-	"dojo/_base/window",
-	"dojo/dom",
-	"dojo/dom-style",
-	"dojo/dom-geometry",
-	"dojo/io-query",
-	"dojo/ready",
-
-	"dijit/registry"
-], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready, registry) {
-    var initUi = function () {
-        var wuid = "";
-        var sequence = "";
-        var showSourceFiles = false;
-
-        var urlWuid = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Wuid"];
-        if (urlWuid) {
-            wuid = urlWuid;
-        }
-        var urlSequence = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Sequence"];
-        if (urlSequence) {
-                sequence = urlSequence;
-        }
-
-        var urlShowSourceFiles = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["SourceFiles"];
-        if (urlShowSourceFiles) {
-                showSourceFiles = urlShowSourceFiles;
-        }
-
-        var results = registry.byId("appLayout");
-        results.init(wuid, sequence, showSourceFiles);
-    },
-
-	startLoading = function (targetNode) {
-	    var overlayNode = dom.byId("loadingOverlay");
-	    if ("none" == domStyle.get(overlayNode, "display")) {
-	        var coords = domGeometry.getMarginBox(targetNode || baseWindow.body());
-	        domGeometry.setMarginBox(overlayNode, coords);
-	        domStyle.set(dom.byId("loadingOverlay"), {
-	            display: "block",
-	            opacity: 1
-	        });
-	    }
-	},
-
-	endLoading = function () {
-	    fx.fadeOut({
-	        node: dom.byId("loadingOverlay"),
-	        duration: 175,
-	        onEnd: function (node) {
-	            domStyle.set(node, "display", "none");
-	        }
-	    }).play();
-	}
-
-    return {
-        init: function () {
-            startLoading();
-            ready(function () {
-                initUi();
-                endLoading();
-            });
-        }
-    };
-});

+ 0 - 69
esp/files/WUGraph.htm

@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<!--
-##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-##############################################################################
--->
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>HPCC: WU Graph</title>
-    <link href="css/hpcc.css" media="screen" rel="stylesheet">
-    <link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
-    <link href="dojox/grid/resources/Grid.css" rel="stylesheet">
-    <link href="dojox/grid/enhanced/resources/claro/EnhancedGrid.css" rel="stylesheet">
-    <link href="dojox/grid/resources/claroGrid.css" rel="stylesheet">
-    <!-- load dojo and provide config via dojoConfig global -->
-    <script>
-        var dojoConfig = (function () {
-            var base = location.href.split("/");
-            base.pop();
-            base = base.join("/");
-
-            return {
-                async: true,
-                parseOnLoad: true,
-                urlBase: base,
-                packages: [{
-                    name: "main",
-                    location: base + "/"
-                }, {
-                    name: "hpcc",
-                    location: base + "/scripts/"
-                }]
-            };
-        })();
-    </script>
-    <script src="dojo/dojo.js"></script>
-    <script>
-        require([
-		"main/WUGraph", "hpcc/GraphPageWidget",
-        "dojo/domReady!"], function (app) {
-            app.init();
-        });
-    </script>
-</head>
-<body class="claro">
-    <!-- overlay -->
-    <div id="loadingOverlay" class="pageOverlay">
-        <div class="loadingMessage">
-            Loading...
-        </div>
-    </div>
-    <!-- application -->
-    <div id="appLayout" class="hpccApp" data-dojo-props="design: 'headline'" data-dojo-type="GraphPageWidget">
-    </div>
-</body>
-</html>

+ 0 - 75
esp/files/WUGraph.js

@@ -1,75 +0,0 @@
-/*##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-############################################################################## */
-define([
-	"dojo/_base/fx",
-	"dojo/_base/window",
-	"dojo/dom",
-	"dojo/dom-style",
-	"dojo/dom-geometry",
-	"dojo/io-query",
-	"dojo/ready",
-
-	"dijit/registry"
-], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready, registry) {
-    var initUi = function () {
-        var wuid = "W20120722-100052";//"W20120601-121930";//"W20120530-153214";//
-        var graphName = "";
-
-        var urlWuid = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Wuid"];
-        if (urlWuid) {
-            wuid = urlWuid;
-        }
-        var urlGraphName = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["GraphName"];
-        if (urlGraphName) {
-            graphName = urlGraphName;
-        }
-
-        var graphControl = registry.byId("appLayout");
-        graphControl.setWuid(wuid, graphName);
-    },
-
-	startLoading = function (targetNode) {
-	    var overlayNode = dom.byId("loadingOverlay");
-	    if ("none" == domStyle.get(overlayNode, "display")) {
-	        var coords = domGeometry.getMarginBox(targetNode || baseWindow.body());
-	        domGeometry.setMarginBox(overlayNode, coords);
-	        domStyle.set(dom.byId("loadingOverlay"), {
-	            display: "block",
-	            opacity: 1
-	        });
-	    }
-	},
-
-	endLoading = function () {
-	    fx.fadeOut({
-	        node: dom.byId("loadingOverlay"),
-	        duration: 175,
-	        onEnd: function (node) {
-	            domStyle.set(node, "display", "none");
-	        }
-	    }).play();
-	}
-
-    return {
-        init: function () {
-            startLoading();
-            ready(function () {
-                initUi();
-                endLoading();
-            });
-        }
-    };
-});

+ 0 - 73
esp/files/WUSource.htm

@@ -1,73 +0,0 @@
-<!DOCTYPE html>
-<!--
-/*##############################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-############################################################################## */
--->
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>HPCC: WU Query</title>
-    <link href="CodeMirror2/lib/codemirror.css" rel="stylesheet">
-    <script src="CodeMirror2/lib/codemirror.js"></script>
-    <script src="CodeMirror2/mode/ecl/ecl.js"></script>
-    <link href="css/ecl.css" rel="stylesheet">
-    <link href="css/hpcc.css" rel="stylesheet">
-    <link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
-    <link href="dojox/grid/resources/Grid.css" rel="stylesheet">
-    <link href="dojox/grid/enhanced/resources/claro/EnhancedGrid.css" rel="stylesheet">
-    <link href="dojox/grid/resources/claroGrid.css" rel="stylesheet">
-    <!-- load dojo and provide config via dojoConfig global -->
-    <script>
-        var dojoConfig = (function () {
-            var base = location.href.split("/");
-            base.pop();
-            base = base.join("/");
-
-            return {
-                async: true,
-                parseOnLoad: true,
-                urlBase: base,
-                packages: [{
-                    name: "main",
-                    location: base + "/"
-                }, {
-                    name: "hpcc",
-                    location: base + "/scripts/"
-                }]
-            };
-        })();
-    </script>
-    <script src="dojo/dojo.js"></script>
-    <script>
-        require([
-		"main/WUSource", "hpcc/ECLSourceWidget",
-        "dojo/domReady!"], function (app) {
-            app.init();
-        });
-    </script>
-</head>
-<body class="claro">
-    <!-- overlay -->
-    <div id="loadingOverlay" class="pageOverlay">
-        <div class="loadingMessage">
-            Loading...
-        </div>
-    </div>
-    <!-- application -->
-    <div id="appLayout" class="hpccApp" data-dojo-props="design: 'headline', readOnly: true" data-dojo-type="ECLSourceWidget">
-    </div>
-</body>
-</html>

+ 0 - 69
esp/files/WUTimings.htm

@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<!--
-##############################################################################
-#    Copyright (C) 2011 HPCC Systems.
-#
-#    All rights reserved. This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-##############################################################################
--->
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>HPCC: WU Timings</title>
-    <link href="css/hpcc.css" media="screen" rel="stylesheet">
-	<link href="dojo/resources/dojo.css" rel="stylesheet">
-    <link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
-    <!-- load dojo and provide config via dojoConfig global -->
-    <script>
-        var dojoConfig = (function () {
-            var base = location.href.split("/");
-            base.pop();
-            base = base.join("/");
-
-            return {
-                async: true,
-                parseOnLoad: true,
-                urlBase: base,
-                isDebug: true,
-                packages: [{
-                    name: "main",
-                    location: base + "/"
-                }, {
-                    name: "hpcc",
-                    location: base + "/scripts/"
-                }]
-            };
-        })();
-    </script>
-    <script src="dojo/dojo.js"></script>
-    <script>
-        require([
-		"main/WUTimings", "hpcc/TimingTreeMapWidget",
-        "dojo/domReady!"], function (app) {
-            app.init();
-        });
-    </script>
-</head>
-<body class="claro">
-    <!-- overlay -->
-    <div id="loadingOverlay" class="pageOverlay">
-        <div class="loadingMessage">
-            Loading...
-        </div>
-    </div>
-    <!-- application -->
-    <div id="appLayout" class="hpccApp" data-dojo-props="design: 'headline'" data-dojo-type="TimingTreeMapWidget">
-    </div>
-</body>
-</html>

+ 0 - 69
esp/files/WUTimings.js

@@ -1,69 +0,0 @@
-/*##############################################################################
-#    Copyright (C) 2011 HPCC Systems.
-#
-#    All rights reserved. This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-############################################################################## */
-define([
-	"dojo/_base/fx",
-	"dojo/_base/window",
-	"dojo/dom",
-	"dojo/dom-style",
-	"dojo/dom-geometry",
-	"dojo/io-query",
-	"dojo/ready",
-
-	"dijit/registry"
-], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready, registry) {
-    var initUi = function () {
-        var wuid = "";
-        var urlWuid = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Wuid"];
-        if (urlWuid) {
-            wuid = urlWuid;
-        }
-        var timingControl = registry.byId("appLayout");
-        timingControl.setWuid(wuid);
-    },
-
-	startLoading = function (targetNode) {
-	    var overlayNode = dom.byId("loadingOverlay");
-	    if ("none" == domStyle.get(overlayNode, "display")) {
-	        var coords = domGeometry.getMarginBox(targetNode || baseWindow.body());
-	        domGeometry.setMarginBox(overlayNode, coords);
-	        domStyle.set(dom.byId("loadingOverlay"), {
-	            display: "block",
-	            opacity: 1
-	        });
-	    }
-	},
-
-	endLoading = function () {
-	    fx.fadeOut({
-	        node: dom.byId("loadingOverlay"),
-	        duration: 175,
-	        onEnd: function (node) {
-	            domStyle.set(node, "display", "none");
-	        }
-	    }).play();
-	}
-
-    return {
-        init: function () {
-            startLoading();
-            ready(function () {
-                initUi();
-                endLoading();
-            });
-        }
-    };
-});

+ 12 - 10
esp/files/scripts/ECLPlaygroundWidget.js

@@ -13,7 +13,7 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ############################################################################## */
-require([
+define([
 	"dojo/_base/declare",
 	"dojo/_base/xhr",
 	"dojo/dom",
@@ -33,7 +33,7 @@ require([
 	"hpcc/ResultsWidget",
 	"hpcc/ESPWorkunit",
 
-	"dojo/text!./templates/ECLPlaygroundWidget.html"
+    "dojo/text!../templates/ECLPlaygroundWidget.html"
 ], function (declare, xhr, dom,
 				_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, TabContainer, ContentPane, registry,
 				EclSourceWidget, TargetSelectWidget, SampleSelectWidget, GraphWidget, ResultsWidget, Workunit,
@@ -87,19 +87,21 @@ require([
             this.borderContainer.resize();
         },
 
-        init: function (wuid, target) {
-            this.wuid = wuid;
-            this.targetSelectWidget.setValue(target);
+        init: function (params) {
+            if (params.Wuid) {
+                this.hideTitle();
+            }
+
+            this.wuid = params.Wuid;
+            this.targetSelectWidget.setValue(params.Target);
 
             this.initEditor();
-            //this.initresultsWidget();
 
-            //  ActiveX will flicker if created before initial layout
             var context = this;
             this.initGraph();
-            if (wuid) {
+            if (params.Wuid) {
                 this.wu = new Workunit({
-                    wuid: wuid
+                    wuid: params.Wuid
                 });
                 this.wu.fetchText(function (text) {
                     context.editorControl.setText(text);
@@ -126,7 +128,7 @@ require([
         },
 
         initEditor: function () {
-                this.editorControl = registry.byId(this.id + "Source");
+            this.editorControl = registry.byId(this.id + "Source");
         },
 
         initGraph: function () {

+ 5 - 6
esp/files/scripts/ECLSourceWidget.js

@@ -13,7 +13,7 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ############################################################################## */
-require([
+define([
     "dojo/_base/declare",
     "dojo/aspect",
     "dojo/has",
@@ -30,7 +30,7 @@ require([
 
     "hpcc/ESPWorkunit",
 
-    "dojo/text!./templates/ECLSourceWidget.html",
+    "dojo/text!../templates/ECLSourceWidget.html",
 
     "dijit/Toolbar", "dijit/ToolbarSeparator", "dijit/form/Button"
 ],
@@ -83,12 +83,11 @@ require([
                 });
             },
 
-            setWuid: function (wuid) {
-                this.wuid = wuid;
+            init: function (params) {
                 var context = this;
-                if (wuid) {
+                if (params.Wuid) {
                     this.wu = new ESPWorkunit({
-                        wuid: wuid
+                        wuid: params.Wuid
                     });
                     this.wu.fetchText(function (text) {
                         context.editor.setValue(text);

+ 5 - 5
esp/files/scripts/GraphPageWidget.js

@@ -13,7 +13,7 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ############################################################################## */
-require([
+define([
     "dojo/_base/declare",
     "dojo/_base/sniff",
     "dojo/_base/array",
@@ -38,7 +38,7 @@ require([
     "hpcc/ESPWorkunit",
     "hpcc/TimingTreeMapWidget",
 
-    "dojo/text!./templates/GraphPageWidget.html",
+    "dojo/text!../templates/GraphPageWidget.html",
 
     "dijit/form/Select",
     "dijit/form/TextBox"
@@ -271,10 +271,10 @@ require([
             this._doFind(true);
         },
 
-        setWuid: function (wuid, graphName) {
-            this.graphName = graphName;
+        init: function (params) {
+            this.graphName = params.GraphName;
             this.wu = new ESPWorkunit({
-                wuid: wuid
+                wuid: params.Wuid
             });
 
             var firstLoad = true;

+ 6 - 6
esp/files/scripts/ResultsWidget.js

@@ -13,7 +13,7 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 ############################################################################## */
-require([
+define([
 	"dojo/_base/declare",
 	"dojo/_base/xhr",
 	"dojo/dom",
@@ -27,7 +27,7 @@ require([
 	"hpcc/ESPBase",
 	"hpcc/ESPWorkunit",
 	"hpcc/ResultsControl",
-	"dojo/text!./templates/ResultsWidget.html"
+	"dojo/text!../templates/ResultsWidget.html"
 ], function (declare, xhr, dom,
 				_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, TabContainer, registry,
 				ESPBase, ESPWorkunit, ResultsControl,
@@ -80,16 +80,16 @@ require([
             });
         },
 
-        init: function (wuid, sequence, showSourceFiles) {
-            if (wuid) {
+        init: function (params) {
+            if (params.Wuid) {
                 this.wu = new ESPWorkunit({
-                    wuid: wuid
+                    wuid: params.Wuid
                 });
                 var monitorCount = 4;
                 var context = this;
                 this.wu.monitor(function () {
                     if (context.wu.isComplete() || ++monitorCount % 5 == 0) {
-                        if (showSourceFiles) {
+                        if (params.SourceFiles) {
                             context.wu.getInfo({
                                 onGetSourceFiles: function (sourceFiles) {
                                     context.refreshSourceFiles(context.wu);

+ 5 - 6
esp/files/scripts/TimingTreeMapWidget.js

@@ -14,7 +14,7 @@
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
-require([
+define([
     "dojo/_base/declare",
     "dojo/aspect",
     "dojo/has",
@@ -36,7 +36,7 @@ require([
 
     "hpcc/ESPWorkunit",
 
-    "dojo/text!./templates/TimingTreeMapWidget.html"
+    "dojo/text!../templates/TimingTreeMapWidget.html"
 ],
     function (declare, aspect, has, dom, domConstruct, domClass, Memory, Color,
             registry, _LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, ContentPane,
@@ -97,12 +97,11 @@ require([
             initTreeMap: function () {
             },
 
-            setWuid: function (wuid) {
-                this.wuid = wuid;
+            init: function (params) {
                 var context = this;
-                if (wuid) {
+                if (params.Wuid) {
                     this.wu = new ESPWorkunit({
-                        wuid: wuid
+                        wuid: params.Wuid
                     });
                     this.wu.fetchTimers(function (timers) {
                         context.loadTimers(timers, "*");

+ 4 - 6
esp/files/ECLPlayground.htm

@@ -19,7 +19,7 @@
 <html>
 <head>
     <meta charset="utf-8">
-    <title>HPCC: ECL Playground</title>
+    <title>HPCC: Stub</title>
     <link href="CodeMirror2/lib/codemirror.css" rel="stylesheet">
     <script src="CodeMirror2/lib/codemirror.js"></script>
     <script src="CodeMirror2/mode/ecl/ecl.js"></script>
@@ -42,10 +42,10 @@
                 urlBase: base,
                 packages: [{
                     name: "main",
-                    location: base + "/"
+                    location: base
                 }, {
                     name: "hpcc",
-                    location: base + "/scripts/"
+                    location: base + "/scripts"
                 }]
             };
         })();
@@ -53,7 +53,7 @@
     <script src="dojo/dojo.js"></script>
     <script>
         require([
-        "main/ECLPlayground", "hpcc/ECLPlaygroundWidget",
+        "main/stub",
         "dojo/domReady!"], function (app) {
             app.init();
         });
@@ -67,7 +67,5 @@
         </div>
     </div>
     <!-- application -->
-    <div id="appLayout" class="hpccApp" data-dojo-props="design: 'headline'" data-dojo-type="ECLPlaygroundWidget">
-    </div>
 </body>
 </html>

+ 19 - 9
esp/files/WUSource.js

@@ -22,18 +22,28 @@ define([
     "dojo/io-query",
     "dojo/ready",
 
-    "dijit/registry"
-], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready, registry) {
+    "hpcc/ECLPlaygroundWidget",
+    "hpcc/GraphPageWidget",
+    "hpcc/ResultsWidget",
+    "hpcc/TimingTreeMapWidget",
+    "hpcc/ECLSourceWidget"
+], function (fx, baseWindow, dom, domStyle, domGeometry, ioQuery, ready,
+        ECLPlaygroundWidget, GraphPageWidget, ResultsWidget, TimingTreeMapWidget, ECLSourceWidget) {
+
     var initUi = function () {
-        var wuid = "";
+        var params = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)));
 
-        var urlWuid = ioQuery.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) == "?" ? 1 : 0)))["Wuid"];
-        if (urlWuid) {
-            wuid = urlWuid;
-        }
+        //TODO:  Can we get rid of the required dependency above?
+        var widget = new (eval(params.Widget))({
+            id: "appLayout",
+            class: "hpccApp"
+        });
 
-        var sourceControl = registry.byId("appLayout");
-        sourceControl.setWuid(wuid);
+        if (widget) {
+            widget.placeAt(dojo.body(), "last");
+            widget.startup();
+            widget.init(params);
+        }
     },
 
     startLoading = function (targetNode) {