Browse Source

Merge branch 'candidate-7.4.0' into candidate-7.4.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 năm trước cách đây
mục cha
commit
8c11d98f80

+ 13 - 0
initfiles/examples/ResultCompare/organization.esdl

@@ -32,6 +32,18 @@ ESPStruct NameInfo
     ESParray<string, Alias> Aliases;
 };
 
+ESPStruct Date
+{
+    short Year;
+    short Month;
+    short Day;
+};
+
+ESPStruct DateInfo : Date
+{
+    string Descr;
+};
+
 ESPStruct AddressInfo
 {
     ESPenum AddressType type("Home");
@@ -60,6 +72,7 @@ ESPResponse OrganizationInfoResponse
     ESPstruct AddressInfo Address;
     ESParray<ESPstruct PersonInfo, Member> Members;
     ESParray<ESPstruct PersonInfo, Guest> Guests;
+    ESParray<ESPstruct DateInfo, KeyDate> KeyDates;
 };
 
 ESPservice [version("0.01")] Organizations

+ 14 - 0
initfiles/examples/ResultCompare/result1.xml

@@ -99,4 +99,18 @@
       </Addresses>
     </Guest>
   </Guests>
+  <KeyDates>
+    <KeyDate>
+      <Year>2010</Year>
+      <Month>1</Month>
+      <Day>1</Day>
+      <Descr>Founded</Descr>
+    </KeyDate>
+    <KeyDate>
+      <Year>2015</Year>
+      <Month>1</Month>
+      <Day>1</Day>
+      <Descr>Reboot</Descr>
+    </KeyDate>
+  </KeyDates>
 </OrganizationInfoResponse>

+ 14 - 0
initfiles/examples/ResultCompare/result2.xml

@@ -99,5 +99,19 @@
       </Addresses>
     </Guest>
   </Guests>
+  <KeyDates>
+    <KeyDate>
+      <Year>2010</Year>
+      <Month>1</Month>
+      <Day>1</Day>
+      <Descr>Founded</Descr>
+    </KeyDate>
+    <KeyDate>
+      <Year>2015</Year>
+      <Month>1</Month>
+      <Day>1</Day>
+      <Descr>Restructuring</Descr>
+    </KeyDate>
+  </KeyDates>
 </OrganizationInfoResponse>
 

+ 8 - 0
initfiles/examples/ResultCompare/template1.xml

@@ -55,5 +55,13 @@
         </Addresses>
       </Guest>
     </Guests>
+    <KeyDates diff_match="Year+Month+Day+Descr" diff_monitor="KeyDates">
+      <KeyDate>
+        <Year/>
+        <Month/>
+        <Day/>
+        <Descr/>
+      </KeyDate>
+    </KeyDates>
   </OrganizationInfoResponse>
 </ResultMonitoringTemplate>

+ 2 - 0
system/security/shared/SecurityResource.hpp

@@ -132,8 +132,10 @@ public:
         if(!from)
             return;
 
+        setResourceType(from->getResourceType());
         setDescription(from->getDescription());
         setValue(from->getValue());
+        setRequiredAccessFlags(from->getRequiredAccessFlags());
         setAccessFlags(from->getAccessFlags());
 
         // The destination properties are reset to an empty default state so the

+ 18 - 3
tools/esdlcmd/esdlcmd_monitor.cpp

@@ -500,6 +500,22 @@ public:
             }
         }
     }
+    IPropertyTree *findPartElement(IPropertyTree &depTree, IPropertyTree *parent, const char *name)
+    {
+        VStringBuffer xpath("EsdlElement[@name='%s']", name);
+        IPropertyTree *partElement = parent->queryPropTree(xpath);
+        if (partElement)
+            return partElement;
+        const char *base_type = parent->queryProp("@base_type");
+        if (base_type && *base_type)
+        {
+            VStringBuffer baseXPath("EsdlStruct[@name='%s']", base_type);
+            IPropertyTree *structType = depTree.queryPropTree(baseXPath);
+            if (structType)
+                return findPartElement(depTree, structType, name);
+        }
+        return nullptr;
+    }
     void addDiffIdPartToMap(IPropertyTree &depTree, IPropertyTree *parent, IPropertyTree *map, const char *id)
     {
         StringBuffer part;
@@ -519,8 +535,7 @@ public:
         }
         else
         {
-            VStringBuffer xpath("EsdlElement[@name='%s']", part.str());
-            IPropertyTree *partElement = parent->queryPropTree(xpath);
+            IPropertyTree *partElement = findPartElement(depTree, parent, part.str());
             if (!partElement)
             {
                 StringBuffer idpath(id);
@@ -564,7 +579,7 @@ public:
                 }
                 else
                 {
-                    xpath.setf("EsdlStruct[@name='%s']", partElement->queryProp("@complex_type"));
+                    VStringBuffer xpath("EsdlStruct[@name='%s']", partElement->queryProp("@complex_type"));
                     IPropertyTree *structType = depTree.queryPropTree(xpath);
                     if (!structType)
                     {