Quellcode durchsuchen

HPCC-9927 Logical File Details Issues

Sprayed file displays confusing messages for ECL/DEF and XML.
Sprayed file does not show content.
Desprayed file does not show content.

Fixes HPCC-9927

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith vor 11 Jahren
Ursprung
Commit
04ca90cf74

+ 4 - 3
esp/files/scripts/ECLSourceWidget.js

@@ -15,6 +15,7 @@
 ############################################################################## */
 define([
     "dojo/_base/declare",
+    "dojo/_base/lang",
     "dojo/dom",
 
     "dijit/layout/BorderContainer",
@@ -28,7 +29,7 @@ define([
 
     "dijit/Toolbar", "dijit/ToolbarSeparator", "dijit/form/Button"
 ],
-    function (declare, dom,
+    function (declare, lang, dom,
             BorderContainer, ContentPane, registry,
             _Widget, ESPWorkunit,
             template) {
@@ -102,8 +103,8 @@ define([
                             context.editor.setValue(text);
                         });
                     }
-                } else if (params.ECL) {
-                    context.editor.setValue(params.ECL);
+                } else if (lang.exists("ECL"), params) {
+                    context.editor.setValue(params.ECL ? params.ECL : "");
                 }
             },
 

+ 2 - 3
esp/files/scripts/ESPLogicalFile.js

@@ -170,10 +170,9 @@ define([
                 request: {
                     Name: this.Name,
                     Format: format
-                },
-                load: function (response) {
-                    onFetchStructure(response);
                 }
+            }).then(function(response) {
+                onFetchStructure(response);
             });
         },
         fetchDEF: function (onFetchXML) {

+ 14 - 1
esp/files/scripts/ESPResult.js

@@ -44,7 +44,10 @@ define([
         startProperty: "Start",
         countProperty: "Count",
         preRequest: function (request) {
-            if (this.name) {
+            if (this.name && this.cluster) {
+                request['LogicalName'] = this.name;
+                request['Cluster'] = this.cluster;
+            } else if (this.name) {
                 request['LogicalName'] = this.name;
             } else {
                 request['Wuid'] = this.wuid;
@@ -86,6 +89,13 @@ define([
                     sequence: this.Sequence,
                     isComplete: this.isComplete()
                 });
+            } else if (lang.exists("Name", this) && lang.exists("ClusterName", this)) {
+                this.store = new Store({
+                    wuid: this.Wuid,
+                    cluster: this.ClusterName,
+                    name: this.Name,
+                    isComplete: true
+                });
             } else {
                 this.store = new Store({
                     wuid: this.Wuid,
@@ -346,6 +356,9 @@ define([
                 if (this.Wuid && lang.exists("Sequence", this)) {
                     request['Wuid'] = this.Wuid;
                     request['Sequence'] = this.Sequence;
+                } else if (this.Name && this.ClusterName) {
+                    request['LogicalName'] = this.Name;
+                    request['Cluster'] = this.ClusterName;
                 } else if (this.Name) {
                     request['LogicalName'] = this.Name;
                 }

+ 8 - 0
esp/files/scripts/ResultWidget.js

@@ -142,6 +142,14 @@ define([
                         context.initResult(logicalFile.result);
                     }
                 });
+            } else if (params.result && params.result.Name) {
+                var logicalFile = ESPLogicalFile.Get(params.result.Name);
+                var context = this;
+                logicalFile.getInfo({
+                    onAfterSend: function (response) {
+                        context.initResult(logicalFile.result);
+                    }
+                });
             } else {
                 this.initResult(null);
             }

+ 17 - 2
esp/files/scripts/WsDfu.js

@@ -21,9 +21,13 @@ define([
     "dojo/_base/array",
     "dojo/store/util/QueryResults",
 
+    "dojox/xml/parser",
+
+    "hpcc/ESPBase",
     "hpcc/ESPRequest"
 ], function (declare, lang, Deferred, arrayUtil, QueryResults,
-    ESPRequest) {
+    parser,
+    ESPBase, ESPRequest) {
 
     return {
         DFUArrayAction: function (logicalFiles, actionType, callback) {
@@ -134,7 +138,18 @@ define([
             lang.mixin(params, {
                 handleAs: "text"
             });
-            return ESPRequest.send("WsDfu", "DFUDefFile", params);
+            return ESPRequest.send("WsDfu", "DFUDefFile", params).then(function (response) {
+                var domXml = parser.parse(response);
+                var espBase = new ESPBase();
+                var exceptions = espBase.getValues(domXml, "Exception", ["Exception"]);
+                if (exceptions.length) {
+                    response = "";
+                    arrayUtil.forEach(exceptions, function (item, idx) {
+                        response += item.Message + "\n";
+                    });
+                }
+                return response;
+            });
         }
     };
 });

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

@@ -109,7 +109,7 @@
                                         <option value="9">UTF-32BE</option><!--value="utf32be"-->
                                     </select>
                                     <input id="${id}SprayXmlMaxRecordLength" title="Max&nbsp;Record&nbsp;Length:" style="width: 95%;" name="sourceMaxRecordSize" colspan="2" data-dojo-props="trim: true, placeHolder:'8192'" data-dojo-type="dijit.form.TextBox" />
-                                    <input id="${id}SprayXmlRowTag" title="Row&nbsp;Tag:" style="width: 95%;" name="sourceRowTag" colspan="2" data-dojo-props="trim: true, placeHolder:'\,'" data-dojo-type="dijit.form.TextBox" />
+                                    <input id="${id}SprayXmlRowTag" title="Row&nbsp;Tag:" style="width: 95%;" name="sourceRowTag" colspan="2" data-dojo-props="trim: true, placeHolder:'tag'" data-dojo-type="dijit.form.TextBox" />
                                 </div>
                                 <h2>Destination</h2>
                                 <div data-dojo-props="cols:2" data-dojo-type="dojox.layout.TableContainer">