浏览代码

HPCC-15454 Filter out duplicated schemas for WU Results XML

Duplicated schemas cause WsECL QueryOutputView to show duplicated
results. In this fix, duplicated schemas are filtered out before
using them.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 9 年之前
父节点
当前提交
a09ae463b7
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 15 1
      common/wuwebview/wuwebview.cpp

+ 15 - 1
common/wuwebview/wuwebview.cpp

@@ -28,6 +28,8 @@
 #include "wuwebview.hpp"
 #include "wuweberror.hpp"
 
+typedef MapStringTo<bool> BoolHash;
+
 class WuExpandedResultBuffer : public CInterface, implements IPTreeNotifyEvent
 {
 public:
@@ -142,9 +144,21 @@ public:
         assertex(!finalized);
         if (!dll)
             return;
+        BoolHash uniqueResultNames;
         Owned<IPropertyTreeIterator> iter = manifest.getElements("Resource[@type='RESULT_XSD']");
         ForEach(*iter)
-            appendSchemaResource(iter->query(), dll);
+        {
+            IPropertyTree& res = iter->query();
+            const char* name = res.queryProp("@name");
+            if (name && *name)
+            {
+                bool* found = uniqueResultNames.getValue(name);
+                if (found && *found)
+                    continue;
+                uniqueResultNames.setValue(name, true);
+            }
+            appendSchemaResource(res, dll);
+        }
     }
 
     void appendManifestResultSchema(IPropertyTree &manifest, const char *resultname, ILoadedDllEntry *dll)