diff OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 4694:da1edb7d6332

"/tools/bulk-delete" to delete a group of multiple, unrelated resources at once
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Jun 2021 17:37:47 +0200
parents 66109d24d26e
children 569d9ef165b1
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Wed Jun 16 16:44:04 2021 +0200
+++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp	Wed Jun 16 17:37:47 2021 +0200
@@ -1973,7 +1973,7 @@
   }
 
 
-  bool StatelessDatabaseOperations::DeleteResource(Json::Value& target,
+  bool StatelessDatabaseOperations::DeleteResource(Json::Value& remainingAncestor,
                                                    const std::string& uuid,
                                                    ResourceType expectedType)
   {
@@ -1981,16 +1981,16 @@
     {
     private:
       bool                found_;
-      Json::Value&        target_;
+      Json::Value&        remainingAncestor_;
       const std::string&  uuid_;
       ResourceType        expectedType_;
       
     public:
-      Operations(Json::Value& target,
+      Operations(Json::Value& remainingAncestor,
                  const std::string& uuid,
                  ResourceType expectedType) :
         found_(false),
-        target_(target),
+        remainingAncestor_(remainingAncestor),
         uuid_(uuid),
         expectedType_(expectedType)
       {
@@ -2019,20 +2019,20 @@
           ResourceType remainingLevel;
           if (transaction.GetTransactionContext().LookupRemainingLevel(remainingPublicId, remainingLevel))
           {
-            target_["RemainingAncestor"] = Json::Value(Json::objectValue);
-            target_["RemainingAncestor"]["Path"] = GetBasePath(remainingLevel, remainingPublicId);
-            target_["RemainingAncestor"]["Type"] = EnumerationToString(remainingLevel);
-            target_["RemainingAncestor"]["ID"] = remainingPublicId;
+            remainingAncestor_["RemainingAncestor"] = Json::Value(Json::objectValue);
+            remainingAncestor_["RemainingAncestor"]["Path"] = GetBasePath(remainingLevel, remainingPublicId);
+            remainingAncestor_["RemainingAncestor"]["Type"] = EnumerationToString(remainingLevel);
+            remainingAncestor_["RemainingAncestor"]["ID"] = remainingPublicId;
           }
           else
           {
-            target_["RemainingAncestor"] = Json::nullValue;
+            remainingAncestor_["RemainingAncestor"] = Json::nullValue;
           }
         }
       }
     };
 
-    Operations operations(target, uuid, expectedType);
+    Operations operations(remainingAncestor, uuid, expectedType);
     Apply(operations);
     return operations.IsFound();
   }