changeset 408:1b09b2943410

more intuitive QidoCaseSensitive, cf. issue #56
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Mar 2020 08:20:15 +0100
parents d513e29bcd09
children 07127c525e6b 7a1ed7f1ff74
files NEWS Plugin/Configuration.cpp Plugin/Configuration.h Plugin/QidoRs.cpp
diffstat 4 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Mar 19 14:00:37 2020 +0100
+++ b/NEWS	Thu Mar 26 08:20:15 2020 +0100
@@ -2,6 +2,12 @@
 ===============================
 
 
+Maintenance
+-----------
+
+* "QidoCaseSensitive" defaults to "CaseSensitivePN" of Orthanc configuration (instead of "true")
+
+
 Version 1.1 (2020-03-04)
 ========================
 
--- a/Plugin/Configuration.cpp	Thu Mar 19 14:00:37 2020 +0100
+++ b/Plugin/Configuration.cpp	Thu Mar 26 08:20:15 2020 +0100
@@ -334,6 +334,14 @@
     }
 
 
+    bool LookupBooleanValue(bool& target,
+                            const std::string& key)
+    {
+      assert(configuration_.get() != NULL);
+      return configuration_->LookupBooleanValue(target, key);
+    }
+
+
     unsigned int GetUnsignedIntegerValue(const std::string& key,
                                          unsigned int defaultValue)
     {
--- a/Plugin/Configuration.h	Thu Mar 19 14:00:37 2020 +0100
+++ b/Plugin/Configuration.h	Thu Mar 26 08:20:15 2020 +0100
@@ -92,12 +92,14 @@
   {
     void Initialize();
 
-    std::string GetStringValue(const std::string& key,
-                               const std::string& defaultValue);
-
+    bool HasKey(const std::string& key);
+    
     bool GetBooleanValue(const std::string& key,
                          bool defaultValue);
 
+    bool LookupBooleanValue(bool& target,
+                            const std::string& key);
+
     unsigned int GetUnsignedIntegerValue(const std::string& key,
                                          unsigned int defaultValue);
 
--- a/Plugin/QidoRs.cpp	Thu Mar 19 14:00:37 2020 +0100
+++ b/Plugin/QidoRs.cpp	Thu Mar 26 08:20:15 2020 +0100
@@ -265,8 +265,13 @@
           throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }
 
+      bool caseSensitive;
+      if (OrthancPlugins::Configuration::LookupBooleanValue(caseSensitive, "QidoCaseSensitive"))
+      {
+        result["CaseSensitive"] = caseSensitive;
+      }
+
       result["Expand"] = false;
-      result["CaseSensitive"] = OrthancPlugins::Configuration::GetBooleanValue("QidoCaseSensitive", true);
       result["Query"] = Json::objectValue;
       result["Limit"] = limit_;
       result["Since"] = offset_;
@@ -483,6 +488,8 @@
   Json::Value find;
   matcher.ConvertToOrthanc(find, level);
 
+  LOG(INFO) << "Body of the call from QIDO-RS to /tools/find: " << find.toStyledString();
+  
   std::string body;
 
   {