diff Framework/Plugins/GlobalProperties.cpp @ 221:73cc85f3d9c1

implementation of the "serverIdentifier" information for global properties
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Mar 2021 10:40:34 +0200
parents 3236894320d6
children
line wrap: on
line diff
--- a/Framework/Plugins/GlobalProperties.cpp	Mon Mar 29 16:39:20 2021 +0200
+++ b/Framework/Plugins/GlobalProperties.cpp	Tue Mar 30 10:40:34 2021 +0200
@@ -34,6 +34,7 @@
   bool LookupGlobalProperty(std::string& target,
                             IDatabase& db,
                             ITransaction& transaction,
+                            const std::string& serverIdentifier,
                             Orthanc::GlobalProperty property)
   {
     Query query("SELECT value FROM GlobalProperties WHERE property=${property}", true);
@@ -73,6 +74,7 @@
 
   bool LookupGlobalProperty(std::string& target /* out */,
                             DatabaseManager& manager,
+                            const std::string& serverIdentifier,
                             Orthanc::GlobalProperty property)
   {
     DatabaseManager::CachedStatement statement(
@@ -113,6 +115,7 @@
 
   void SetGlobalProperty(IDatabase& db,
                          ITransaction& transaction,
+                         const std::string& serverIdentifier,
                          Orthanc::GlobalProperty property,
                          const std::string& utf8)
   {
@@ -168,6 +171,7 @@
 
 
   void SetGlobalProperty(DatabaseManager& manager,
+                         const std::string& serverIdentifier,
                          Orthanc::GlobalProperty property,
                          const std::string& utf8)
   {
@@ -227,11 +231,12 @@
   bool LookupGlobalIntegerProperty(int& target,
                                    IDatabase& db,
                                    ITransaction& transaction,
+                                   const std::string& serverIdentifier,
                                    Orthanc::GlobalProperty property)
   {
     std::string value;
 
-    if (LookupGlobalProperty(value, db, transaction, property))
+    if (LookupGlobalProperty(value, db, transaction, serverIdentifier, property))
     {
       try
       {
@@ -253,9 +258,10 @@
 
   void SetGlobalIntegerProperty(IDatabase& db,
                                 ITransaction& transaction,
+                                const std::string& serverIdentifier,
                                 Orthanc::GlobalProperty property,
                                 int value)
   {
-    SetGlobalProperty(db, transaction, property, boost::lexical_cast<std::string>(value));
+    SetGlobalProperty(db, transaction, serverIdentifier, property, boost::lexical_cast<std::string>(value));
   }
 }