Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package orthanc-dicomweb for 
openSUSE:Factory checked in at 2021-01-28 21:28:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/orthanc-dicomweb (Old)
 and      /work/SRC/openSUSE:Factory/.orthanc-dicomweb.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "orthanc-dicomweb"

Thu Jan 28 21:28:58 2021 rev:6 rq:867449 version:1.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/orthanc-dicomweb/orthanc-dicomweb.changes        
2020-12-21 10:23:12.271969249 +0100
+++ 
/work/SRC/openSUSE:Factory/.orthanc-dicomweb.new.28504/orthanc-dicomweb.changes 
    2021-01-28 21:28:59.540245858 +0100
@@ -1,0 +2,9 @@
+Wed Jan 27 20:08:04 UTC 2021 - Axel Braun <[email protected]>
+
+- Version 1.5 
+* Possibility to store the definition of DICOMweb servers into the Orthanc 
database
+* New configuration option "DicomWeb.ServersInDatabase"
+* Fix compliance with DICOM >= 2016c: If no "transfer-syntax" is provided in 
WADO-RS
+  Retrieve Instance/Series/Study, DICOM shall be transcoded to Little Endian 
Explicit
+
+-------------------------------------------------------------------

Old:
----
  OrthancDicomWeb-1.4.tar.gz

New:
----
  OrthancDicomWeb-1.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ orthanc-dicomweb.spec ++++++
--- /var/tmp/diff_new_pack.UbCCKJ/_old  2021-01-28 21:29:00.344247066 +0100
+++ /var/tmp/diff_new_pack.UbCCKJ/_new  2021-01-28 21:29:00.348247073 +0100
@@ -1,8 +1,8 @@
 #
 # spec file for package orthanc-dicomweb
 #
-# Copyright (c) 2020 SUSE LLC
-# Copyright (c) 2019-2020 Dr. Axel Braun
+# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2019-2021 Dr. Axel Braun
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
 Summary:        WebViewer plugin for Orthanc
 License:        AGPL-3.0-or-later
 Group:          Productivity/Graphics/Viewers
-Version:        1.4
+Version:        1.5
 Release:        0
 URL:            https://orthanc-server.com
 Source0:        
https://www.orthanc-server.com/downloads/get.php?path=/plugin-dicom-web/OrthancDicomWeb-%{version}.tar.gz

++++++ OrthancDicomWeb-1.4.tar.gz -> OrthancDicomWeb-1.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/.hg_archival.txt 
new/OrthancDicomWeb-1.5/.hg_archival.txt
--- old/OrthancDicomWeb-1.4/.hg_archival.txt    2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/.hg_archival.txt    2021-01-26 19:18:58.000000000 
+0100
@@ -1,6 +1,6 @@
 repo: d5f45924411123cfd02d035fd50b8e37536eadef
-node: b751b1383e075319ab286e1388aebc032f34d0b2
-branch: OrthancDicomWeb-1.4
+node: 37795a3d49021da79ce0651451e19b3ee529e28e
+branch: OrthancDicomWeb-1.5
 latesttag: null
-latesttagdistance: 443
-changessincelatesttag: 472
+latesttagdistance: 453
+changessincelatesttag: 482
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/CMakeLists.txt 
new/OrthancDicomWeb-1.5/CMakeLists.txt
--- old/OrthancDicomWeb-1.4/CMakeLists.txt      2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/CMakeLists.txt      2021-01-26 19:18:58.000000000 
+0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Affero General Public License
@@ -21,13 +21,13 @@
 
 project(OrthancDicomWeb)
 
-set(ORTHANC_DICOM_WEB_VERSION "1.4")
+set(ORTHANC_DICOM_WEB_VERSION "1.5")
 
 if (ORTHANC_DICOM_WEB_VERSION STREQUAL "mainline")
   set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline")
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
 else()
-  set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.8.1")
+  set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.8.2")
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
 endif()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/NEWS new/OrthancDicomWeb-1.5/NEWS
--- old/OrthancDicomWeb-1.4/NEWS        2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/NEWS        2021-01-26 19:18:58.000000000 +0100
@@ -2,6 +2,15 @@
 ===============================
 
 
+Version 1.5 (2021-01-26)
+========================
+
+* Possibility to store the definition of DICOMweb servers into the Orthanc 
database
+* New configuration option "DicomWeb.ServersInDatabase"
+* Fix compliance with DICOM >= 2016c: If no "transfer-syntax" is provided in 
WADO-RS
+  Retrieve Instance/Series/Study, DICOM shall be transcoded to Little Endian 
Explicit
+
+
 Version 1.4 (2020-12-18)
 ========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/Configuration.cpp 
new/OrthancDicomWeb-1.5/Plugin/Configuration.cpp
--- old/OrthancDicomWeb-1.4/Plugin/Configuration.cpp    2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/Configuration.cpp    2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -25,15 +25,22 @@
 #include "DicomWebServers.h"
 
 #include <Compatibility.h>
+#include <Logging.h>
 #include <Toolbox.h>
 
 #include <fstream>
-#include <json/reader.h>
 #include <boost/regex.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 
 
+// Assume Latin-1 encoding by default (as in the Orthanc core)
+static Orthanc::Encoding defaultEncoding_ = Orthanc::Encoding_Latin1;
+static std::unique_ptr<OrthancPlugins::OrthancConfiguration> configuration_;
+static bool serversInDatabase_ = false;
+static const int32_t GLOBAL_PROPERTY_SERVERS = 5468;
+
+
 namespace OrthancPlugins
 {
   bool LookupHttpHeader(std::string& value,
@@ -141,7 +148,7 @@
   {
     OrthancPluginDictionaryEntry entry;
     
-    if (OrthancPluginLookupDictionary(OrthancPlugins::GetGlobalContext(), 
&entry, name.c_str()) == OrthancPluginErrorCode_Success)
+    if (OrthancPluginLookupDictionary(GetGlobalContext(), &entry, 
name.c_str()) == OrthancPluginErrorCode_Success)
     {
       target = Orthanc::DicomTag(entry.group, entry.element);
       return true;
@@ -156,9 +163,7 @@
   void ParseJsonBody(Json::Value& target,
                      const OrthancPluginHttpRequest* request)
   {
-    Json::Reader reader;
-    if (!reader.parse(reinterpret_cast<const char*>(request->body),
-                      reinterpret_cast<const char*>(request->body) + 
request->bodySize, target))
+    if (!OrthancPlugins::ReadJson(target, request->body, request->bodySize))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                       "A JSON file was expected");
@@ -287,16 +292,11 @@
 
   namespace Configuration
   {
-    // Assume Latin-1 encoding by default (as in the Orthanc core)
-    static Orthanc::Encoding defaultEncoding_ = Orthanc::Encoding_Latin1;
-    static std::unique_ptr<OrthancConfiguration> configuration_;
-
-
     void Initialize()
     {
       configuration_.reset(new OrthancConfiguration);
       
-      OrthancPlugins::OrthancConfiguration global;
+      OrthancConfiguration global;
       global.GetSection(*configuration_, "DicomWeb");
 
       std::string s;
@@ -305,10 +305,22 @@
         defaultEncoding_ = Orthanc::StringToEncoding(s.c_str());
       }
 
-      OrthancPlugins::OrthancConfiguration servers;
-      configuration_->GetSection(servers, "Servers");
-      OrthancPlugins::DicomWebServers::GetInstance().Load(servers.GetJson());
+      if (!configuration_->LookupBooleanValue(serversInDatabase_, 
"ServersInDatabase"))
+      {
+        serversInDatabase_ = false;
+      }
 
+      if (serversInDatabase_)
+      {
+        LOG(INFO) << "The DICOMweb plugin stores the DICOMweb servers in the 
Orthanc database";
+      }
+      else
+      {
+        LOG(INFO) << "The DICOMweb plugin reads the DICOMweb servers from the 
configuration file";
+      }
+
+      DicomWebServers::GetInstance().Clear();
+        
       // Check configuration during initialization
       GetMetadataMode(Orthanc::ResourceType_Study);
       GetMetadataMode(Orthanc::ResourceType_Series);
@@ -374,7 +386,7 @@
     
     std::string GetOrthancApiRoot()
     {
-      std::string root = OrthancPlugins::Configuration::GetDicomWebRoot();
+      std::string root = Configuration::GetDicomWebRoot();
       std::vector<std::string> tokens;
       Orthanc::Toolbox::TokenizeString(tokens, root, '/');
 
@@ -447,10 +459,10 @@
 
 
     static bool LookupHttpHeader2(std::string& value,
-                                  const 
OrthancPlugins::HttpClient::HttpHeaders& headers,
+                                  const HttpClient::HttpHeaders& headers,
                                   const std::string& name)
     {
-      for (OrthancPlugins::HttpClient::HttpHeaders::const_iterator
+      for (HttpClient::HttpHeaders::const_iterator
              it = headers.begin(); it != headers.end(); ++it)
       {
         if (boost::iequals(it->first, name))
@@ -464,7 +476,7 @@
     }
 
 
-    std::string GetBaseUrl(const OrthancPlugins::HttpClient::HttpHeaders& 
headers)
+    std::string GetBaseUrl(const HttpClient::HttpHeaders& headers)
     {
       assert(configuration_.get() != NULL);
       std::string host = configuration_->GetStringValue("Host", "");
@@ -524,7 +536,7 @@
 
     std::string GetBaseUrl(const OrthancPluginHttpRequest* request)
     {
-      OrthancPlugins::HttpClient::HttpHeaders headers;
+      HttpClient::HttpHeaders headers;
 
       std::string value;
       if (LookupHttpHeader(value, request, "forwarded"))
@@ -587,8 +599,8 @@
       }
       else
       {
-        OrthancPlugins::LogError("Unsupported return MIME type: " + accept +
-                                 ", will return DICOM+JSON");
+        LogError("Unsupported return MIME type: " + accept +
+                 ", will return DICOM+JSON");
         return false;
       }
     }
@@ -613,7 +625,7 @@
     {
       std::string accept;
 
-      if (OrthancPlugins::LookupHttpHeader(accept, request, "accept"))
+      if (LookupHttpHeader(accept, request, "accept"))
       {
         return IsXmlExpected(accept);
       }
@@ -712,5 +724,58 @@
           throw 
Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
       }
     }
+
+
+    void LoadDicomWebServers()
+    {
+      if (serversInDatabase_)
+      {
+        // New in DICOMweb 1.5
+        OrthancString property;
+        property.Assign(OrthancPluginGetGlobalProperty(
+                          GetGlobalContext(), GLOBAL_PROPERTY_SERVERS, "{}"));
+
+        if (property.GetContent() == NULL)
+        {
+          DicomWebServers::GetInstance().Clear();
+        }
+        else
+        {
+          try
+          {
+            
DicomWebServers::GetInstance().UnserializeGlobalProperty(property.GetContent());
+          }
+          catch (Orthanc::OrthancException&)
+          {
+            DicomWebServers::GetInstance().Clear();
+            LOG(ERROR) << "Cannot read the DICOMweb servers from the database, 
no server will be defined";
+          }
+        }
+      }
+      else
+      {
+        OrthancConfiguration servers;
+        configuration_->GetSection(servers, "Servers");
+        
DicomWebServers::GetInstance().LoadGlobalConfiguration(servers.GetJson());
+      }
+    }
+
+    
+    void SaveDicomWebServers()
+    {
+      if (serversInDatabase_)
+      {
+        // New in DICOMweb 1.5
+        std::string property;
+        DicomWebServers::GetInstance().SerializeGlobalProperty(property);
+
+        if (OrthancPluginSetGlobalProperty(
+              OrthancPlugins::GetGlobalContext(), GLOBAL_PROPERTY_SERVERS, 
property.c_str()) !=
+            OrthancPluginErrorCode_Success)
+        {
+          LOG(ERROR) << "Cannot write the DICOMweb servers into the database";
+        }
+      }
+    }
   }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/Configuration.h 
new/OrthancDicomWeb-1.5/Plugin/Configuration.h
--- old/OrthancDicomWeb-1.4/Plugin/Configuration.h      2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/Configuration.h      2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -133,5 +133,9 @@
 
     void GetExtrapolatedMetadataTags(std::set<Orthanc::DicomTag>& tags,
                                      Orthanc::ResourceType level);
+
+    void LoadDicomWebServers();
+
+    void SaveDicomWebServers();
   }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebClient.cpp 
new/OrthancDicomWeb-1.5/Plugin/DicomWebClient.cpp
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebClient.cpp   2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebClient.cpp   2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -30,7 +30,6 @@
 #include <Logging.h>
 #include <Toolbox.h>
 
-#include <json/reader.h>
 #include <list>
 #include <set>
 #include <boost/lexical_cast.hpp>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebClient.h 
new/OrthancDicomWeb-1.5/Plugin/DicomWebClient.h
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebClient.h     2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebClient.h     2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebFormatter.cpp 
new/OrthancDicomWeb-1.5/Plugin/DicomWebFormatter.cpp
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebFormatter.cpp        2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebFormatter.cpp        2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -23,8 +23,8 @@
 
 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
 
-#if !defined(NDEBUG)
-#  include <json/reader.h>
+#if !defined(NDEBUG)  // In debug mode, check that the value is actually a 
JSON string
+#  include <Toolbox.h>
 #endif
 
 
@@ -126,7 +126,7 @@
 
   DicomWebFormatter::HttpWriter::HttpWriter(OrthancPluginRestOutput* output,
                                             bool isXml) :
-    context_(OrthancPlugins::GetGlobalContext()),
+    context_(GetGlobalContext()),
     output_(output),
     isXml_(isXml),
     first_(true)
@@ -163,8 +163,7 @@
 
     std::string item;
 
-    OrthancPlugins::DicomWebFormatter::Apply(
-      item, context_, dicom, size, isXml_, mode, bulkRoot);
+    DicomWebFormatter::Apply(item, context_, dicom, size, isXml_, mode, 
bulkRoot);
    
     if (isXml_)
     {
@@ -217,10 +216,8 @@
     }
 
 #if !defined(NDEBUG)  // In debug mode, check that the value is actually a 
JSON string
-    Json::Reader reader;
     Json::Value json;
-    if (!reader.parse(reinterpret_cast<const char*>(data),
-                      reinterpret_cast<const char*>(data) + size, json))
+    if (!OrthancPlugins::ReadJson(json, data, size))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebFormatter.h 
new/OrthancDicomWeb-1.5/Plugin/DicomWebFormatter.h
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebFormatter.h  2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebFormatter.h  2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebServers.cpp 
new/OrthancDicomWeb-1.5/Plugin/DicomWebServers.cpp
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebServers.cpp  2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebServers.cpp  2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -34,12 +34,15 @@
   {
     for (Servers::iterator it = servers_.begin(); it != servers_.end(); ++it)
     {
+      assert(it->second != NULL);
       delete it->second;
     }
+
+    servers_.clear();
   }
 
 
-  void DicomWebServers::Load(const Json::Value& servers)
+  void DicomWebServers::LoadGlobalConfiguration(const Json::Value& servers)
   {
     boost::mutex::scoped_lock lock(mutex_);
 
@@ -68,8 +71,8 @@
     }
     catch (Orthanc::OrthancException& e)
     {
-      OrthancPlugins::LogError("Exception while parsing the 
\"DicomWeb.Servers\" section "
-                               "of the configuration file: " + 
std::string(e.What()));
+      LogError("Exception while parsing the \"DicomWeb.Servers\" section "
+               "of the configuration file: " + std::string(e.What()));
       throw;
     }
 
@@ -114,6 +117,7 @@
     servers.clear();
     for (Servers::const_iterator it = servers_.begin(); it != servers_.end(); 
++it)
     {
+      assert(it->second != NULL);
       servers.push_back(it->first);
     }
   }
@@ -207,7 +211,7 @@
 
 
 
-  void CallServer(OrthancPlugins::MemoryBuffer& answerBody /* out */,
+  void CallServer(MemoryBuffer& answerBody /* out */,
                   std::map<std::string, std::string>& answerHeaders /* out */,
                   const Orthanc::WebServiceParameters& server,
                   OrthancPluginHttpMethod method,
@@ -271,7 +275,7 @@
       bodySize = body.size();
     }
 
-    OrthancPluginContext* context = OrthancPlugins::GetGlobalContext();
+    OrthancPluginContext* context = GetGlobalContext();
 
     uint16_t status = 0;
     MemoryBuffer answerHeadersTmp;
@@ -370,4 +374,51 @@
       }
     }
   }
+
+
+  void DicomWebServers::SerializeGlobalProperty(std::string& target)
+  {
+    boost::mutex::scoped_lock lock(mutex_);
+
+    Json::Value json = Json::objectValue;
+
+    for (Servers::const_iterator it = servers_.begin(); it != servers_.end(); 
++it)
+    {
+      assert(it->second != NULL);
+
+      Json::Value server;
+      it->second->Serialize(server, true /* advanced format */, true /* store 
passwords */);
+      json[it->first] = server;
+    }
+
+    OrthancPlugins::WriteFastJson(target, json);
+  }
+
+
+  void DicomWebServers::UnserializeGlobalProperty(const std::string& source)
+  {
+    Json::Value json;
+    
+    if (!OrthancPlugins::ReadJson(json, source) ||
+        json.type() != Json::objectValue)
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, 
"Cannot unserialize "
+                                      "the list of DICOMweb servers from 
global properties");
+    }
+
+    Clear();
+
+    std::vector<std::string> members = json.getMemberNames();
+    
+    for (size_t i = 0; i < members.size(); i++)
+    {
+      const std::string& name = members[i];
+      
+      std::unique_ptr<Orthanc::WebServiceParameters> server(new 
Orthanc::WebServiceParameters);
+      server->Unserialize(json[name]);
+
+      assert(servers_.find(name) == servers_.end());
+      servers_[name] = server.release();
+    }
+  }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/DicomWebServers.h 
new/OrthancDicomWeb-1.5/Plugin/DicomWebServers.h
--- old/OrthancDicomWeb-1.4/Plugin/DicomWebServers.h    2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/DicomWebServers.h    2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -39,23 +39,23 @@
     boost::mutex  mutex_;
     Servers       servers_;
 
-    void Clear();
-
     DicomWebServers()  // Forbidden (singleton pattern)
     {
     }
 
   public:
+    ~DicomWebServers()
+    {
+      Clear();
+    }
+    
     static void UriEncode(std::string& uri,
                           const std::string& resource,
                           const std::map<std::string, std::string>& 
getArguments);
 
-    void Load(const Json::Value& configuration);
+    void Clear();
 
-    ~DicomWebServers()
-    {
-      Clear();
-    }
+    void LoadGlobalConfiguration(const Json::Value& configuration);
 
     static DicomWebServers& GetInstance();
 
@@ -72,10 +72,14 @@
 
     void SetServer(const std::string& name,
                    const Orthanc::WebServiceParameters& parameters);
+
+    void SerializeGlobalProperty(std::string& target);
+
+    void UnserializeGlobalProperty(const std::string& source);
   };
 
 
-  void CallServer(OrthancPlugins::MemoryBuffer& answerBody /* out */,
+  void CallServer(MemoryBuffer& answerBody /* out */,
                   std::map<std::string, std::string>& answerHeaders /* out */,
                   const Orthanc::WebServiceParameters& server,
                   OrthancPluginHttpMethod method,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/Plugin.cpp 
new/OrthancDicomWeb-1.5/Plugin/Plugin.cpp
--- old/OrthancDicomWeb-1.4/Plugin/Plugin.cpp   2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/Plugin.cpp   2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -128,6 +128,8 @@
     case OrthancPluginHttpMethod_Delete:
     {
       
OrthancPlugins::DicomWebServers::GetInstance().DeleteServer(request->groups[0]);
+      OrthancPlugins::Configuration::SaveDicomWebServers();
+
       std::string answer = "{}";
       OrthancPluginAnswerBuffer(context, output, answer.c_str(), 
answer.size(), "application/json");
       break;
@@ -141,6 +143,8 @@
       Orthanc::WebServiceParameters parameters(body);
       
       
OrthancPlugins::DicomWebServers::GetInstance().SetServer(request->groups[0], 
parameters);
+      OrthancPlugins::Configuration::SaveDicomWebServers();
+      
       std::string answer = "{}";
       OrthancPluginAnswerBuffer(context, output, answer.c_str(), 
answer.size(), "application/json");
       break;
@@ -449,6 +453,36 @@
 #endif
 
 
+static OrthancPluginErrorCode OnChangeCallback(OrthancPluginChangeType 
changeType, 
+                                               OrthancPluginResourceType 
resourceType, 
+                                               const char *resourceId)
+{
+  try
+  {
+    switch (changeType)
+    {
+      case OrthancPluginChangeType_OrthancStarted:
+        OrthancPlugins::Configuration::LoadDicomWebServers();
+        break;
+
+      default:
+        break;
+    }
+  }
+  catch (Orthanc::OrthancException& e)
+  {
+    LOG(ERROR) << "Exception: " << e.What();
+  }
+  catch (...)
+  {
+    LOG(ERROR) << "Uncatched native exception";
+  }  
+
+  return OrthancPluginErrorCode_Success;
+}
+
+
+
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* 
context)
@@ -463,6 +497,8 @@
     Orthanc::Logging::Initialize(context);
 #endif
 
+    Orthanc::Logging::EnableInfoLevel(true);
+
     /* Check the version of the Orthanc core */
     if (OrthancPluginCheckVersion(context) == 0)
     {
@@ -538,6 +574,8 @@
         OrthancPlugins::RegisterRestCallback<RetrieveInstanceRendered>(root + 
"studies/([^/]*)/series/([^/]*)/instances/([^/]*)/rendered", true);
         OrthancPlugins::RegisterRestCallback<RetrieveFrameRendered>(root + 
"studies/([^/]*)/series/([^/]*)/instances/([^/]*)/frames/([^/]*)/rendered", 
true);
 
+        OrthancPluginRegisterOnChangeCallback(context, OnChangeCallback);
+
 
         // Extend the default Orthanc Explorer with custom JavaScript for STOW 
client
         std::string explorer;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/QidoRs.cpp 
new/OrthancDicomWeb-1.5/Plugin/QidoRs.cpp
--- old/OrthancDicomWeb-1.4/Plugin/QidoRs.cpp   2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/QidoRs.cpp   2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -492,11 +492,7 @@
   LOG(INFO) << "Body of the call from QIDO-RS to /tools/find: " << 
find.toStyledString();
   
   std::string body;
-
-  {
-    Json::FastWriter writer;
-    body = writer.write(find);
-  }
+  OrthancPlugins::WriteFastJson(body, find);
   
   Json::Value resources;
   if (!OrthancPlugins::RestApiPost(resources, "/tools/find", body, false) ||
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/QidoRs.h 
new/OrthancDicomWeb-1.5/Plugin/QidoRs.h
--- old/OrthancDicomWeb-1.4/Plugin/QidoRs.h     2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/QidoRs.h     2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/StowRs.cpp 
new/OrthancDicomWeb-1.5/Plugin/StowRs.cpp
--- old/OrthancDicomWeb-1.4/Plugin/StowRs.cpp   2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/StowRs.cpp   2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/StowRs.h 
new/OrthancDicomWeb-1.5/Plugin/StowRs.h
--- old/OrthancDicomWeb-1.4/Plugin/StowRs.h     2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/StowRs.h     2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/WadoRs.cpp 
new/OrthancDicomWeb-1.5/Plugin/WadoRs.cpp
--- old/OrthancDicomWeb-1.4/Plugin/WadoRs.cpp   2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoRs.cpp   2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -57,16 +57,41 @@
 
 
 
-static bool AcceptMultipartDicom(bool& transcode,
+static void AcceptMultipartDicom(bool& transcode,
                                  Orthanc::DicomTransferSyntax& targetSyntax /* 
only if transcoding */,
                                  const OrthancPluginHttpRequest* request)
 {
-  transcode = false;
+  /**
+   * Up to release 1.4 of the DICOMweb plugin, WADO-RS
+   * RetrieveInstance, RetrieveSeries and RetrieveStudy did *NOT*
+   * transcode if no transer syntax was explicitly provided. This was
+   * because the DICOM standard didn't specify a behavior in this case
+   * up to DICOM 2016b:
+   * 
http://dicom.nema.org/medical/dicom/2016b/output/chtml/part18/sect_6.5.3.html
+   *
+   * However, starting with DICOM 2016c, it is explicitly stated that
+   * "If transfer-syntax is not specified in the dcm-parameters the
+   * origin server shall use the Explicit VR Little Endian Transfer
+   * Syntax "1.2.840.10008.1.2.1" for each Instance":
+   * 
http://dicom.nema.org/medical/dicom/2016c/output/chtml/part18/sect_6.5.3.html
+   * 
+   * As a consequence, starting with release 1.5 of the DICOMweb
+   * plugin, transcoding to "Little Endian Explicit" takes place by
+   * default. If this transcoding is not desirable, the "Accept" HTTP
+   * header can be set to
+   * "multipart/related;type=application/dicom;transfer-syntax=*" (not
+   * the asterisk "*") in order to prevent transcoding. The same
+   * convention is used by the Google Cloud Platform:
+   * https://cloud.google.com/healthcare/docs/dicom
+   **/
+  transcode = true;
+  targetSyntax = Orthanc::DicomTransferSyntax_LittleEndianExplicit;
+  
   std::string accept;
 
   if (!OrthancPlugins::LookupHttpHeader(accept, request, "accept"))
   {
-    return true;   // By default, return "multipart/related; 
type=application/dicom;"
+    return;   // By default, return "multipart/related; 
type=application/dicom;"
   }
 
   std::string application;
@@ -116,8 +141,6 @@
       }
     }
   }
-
-  return true;
 }
 
 
@@ -274,15 +297,41 @@
   {
     throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
   }
-  
+
   for (Json::Value::ArrayIndex i = 0; i < instances.size(); i++)
   {
-    std::string uri = "/instances/" + instances[i]["ID"].asString() + "/file";
+    const std::string uri = "/instances/" + instances[i]["ID"].asString();
 
+    bool transcodeThisInstance;
+    
+    std::string sourceTransferSyntax;
+    if (!transcode)
+    {
+      transcodeThisInstance = false;      
+    }
+    else if (OrthancPlugins::RestApiGetString(sourceTransferSyntax, uri + 
"/metadata/TransferSyntax", false))
+    {
+      // Avoid transcoding if the source file already uses the expected 
transfer syntax
+      Orthanc::DicomTransferSyntax syntax;
+      if (Orthanc::LookupTransferSyntax(syntax, sourceTransferSyntax))
+      {
+        transcodeThisInstance = (syntax != targetSyntax);
+      }
+      else
+      {
+        transcodeThisInstance = true;
+      }
+    }
+    else
+    {
+      // The transfer syntax of the source file is unknown, transcode it to be 
sure
+      transcodeThisInstance = true;
+    }
+    
     OrthancPlugins::MemoryBuffer dicom;
-    if (dicom.RestApiGet(uri, false))
+    if (dicom.RestApiGet(uri + "/file", false))
     {
-      if (transcode)
+      if (transcodeThisInstance)
       {
         std::unique_ptr<OrthancPlugins::DicomInstance> transcoded(
           OrthancPlugins::DicomInstance::Transcode(
@@ -907,18 +956,13 @@
 {
   bool transcode;
   Orthanc::DicomTransferSyntax targetSyntax;
+
+  AcceptMultipartDicom(transcode, targetSyntax, request);
   
-  if (!AcceptMultipartDicom(transcode, targetSyntax, request))
-  {
-    OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), 
output, 400 /* Bad request */);
-  }
-  else
+  std::string orthancId, studyInstanceUid;
+  if (LocateStudy(output, orthancId, studyInstanceUid, request))
   {
-    std::string orthancId, studyInstanceUid;
-    if (LocateStudy(output, orthancId, studyInstanceUid, request))
-    {
-      AnswerListOfDicomInstances(output, Orthanc::ResourceType_Study, 
orthancId, transcode, targetSyntax);
-    }
+    AnswerListOfDicomInstances(output, Orthanc::ResourceType_Study, orthancId, 
transcode, targetSyntax);
   }
 }
 
@@ -930,17 +974,12 @@
   bool transcode;
   Orthanc::DicomTransferSyntax targetSyntax;
   
-  if (!AcceptMultipartDicom(transcode, targetSyntax, request))
-  {
-    OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), 
output, 400 /* Bad request */);
-  }
-  else
+  AcceptMultipartDicom(transcode, targetSyntax, request);
+  
+  std::string orthancId, studyInstanceUid, seriesInstanceUid;
+  if (LocateSeries(output, orthancId, studyInstanceUid, seriesInstanceUid, 
request))
   {
-    std::string orthancId, studyInstanceUid, seriesInstanceUid;
-    if (LocateSeries(output, orthancId, studyInstanceUid, seriesInstanceUid, 
request))
-    {
-      AnswerListOfDicomInstances(output, Orthanc::ResourceType_Series, 
orthancId, transcode, targetSyntax);
-    }
+    AnswerListOfDicomInstances(output, Orthanc::ResourceType_Series, 
orthancId, transcode, targetSyntax);
   }
 }
 
@@ -953,17 +992,12 @@
   bool transcode;
   Orthanc::DicomTransferSyntax targetSyntax;
   
-  if (!AcceptMultipartDicom(transcode, targetSyntax, request))
-  {
-    OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), 
output, 400 /* Bad request */);
-  }
-  else
+  AcceptMultipartDicom(transcode, targetSyntax, request);
+  
+  std::string orthancId, studyInstanceUid, seriesInstanceUid, sopInstanceUid;
+  if (LocateInstance(output, orthancId, studyInstanceUid, seriesInstanceUid, 
sopInstanceUid, request))
   {
-    std::string orthancId, studyInstanceUid, seriesInstanceUid, sopInstanceUid;
-    if (LocateInstance(output, orthancId, studyInstanceUid, seriesInstanceUid, 
sopInstanceUid, request))
-    {
-      AnswerListOfDicomInstances(output, Orthanc::ResourceType_Instance, 
orthancId, transcode, targetSyntax);
-    }
+    AnswerListOfDicomInstances(output, Orthanc::ResourceType_Instance, 
orthancId, transcode, targetSyntax);
   }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/WadoRs.h 
new/OrthancDicomWeb-1.5/Plugin/WadoRs.h
--- old/OrthancDicomWeb-1.4/Plugin/WadoRs.h     2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoRs.h     2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/WadoRsRetrieveFrames.cpp 
new/OrthancDicomWeb-1.5/Plugin/WadoRsRetrieveFrames.cpp
--- old/OrthancDicomWeb-1.4/Plugin/WadoRsRetrieveFrames.cpp     2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoRsRetrieveFrames.cpp     2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Plugin/WadoRsRetrieveRendered.cpp 
new/OrthancDicomWeb-1.5/Plugin/WadoRsRetrieveRendered.cpp
--- old/OrthancDicomWeb-1.4/Plugin/WadoRsRetrieveRendered.cpp   2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoRsRetrieveRendered.cpp   2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/WadoUri.cpp 
new/OrthancDicomWeb-1.5/Plugin/WadoUri.cpp
--- old/OrthancDicomWeb-1.4/Plugin/WadoUri.cpp  2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoUri.cpp  2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/OrthancDicomWeb-1.4/Plugin/WadoUri.h 
new/OrthancDicomWeb-1.5/Plugin/WadoUri.h
--- old/OrthancDicomWeb-1.4/Plugin/WadoUri.h    2020-12-18 07:15:27.000000000 
+0100
+++ new/OrthancDicomWeb-1.5/Plugin/WadoUri.h    2021-01-26 19:18:58.000000000 
+0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/CMake/JavaScriptLibraries.cmake 
new/OrthancDicomWeb-1.5/Resources/CMake/JavaScriptLibraries.cmake
--- old/OrthancDicomWeb-1.4/Resources/CMake/JavaScriptLibraries.cmake   
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/CMake/JavaScriptLibraries.cmake   
2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/AutoGeneratedCode.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/AutoGeneratedCode.cmake
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/AutoGeneratedCode.cmake     
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/AutoGeneratedCode.cmake     
2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/Compiler.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/Compiler.cmake
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/Compiler.cmake      
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/Compiler.cmake      
2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake  
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake  
    2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
@@ -120,6 +120,8 @@
         set(ORTHANC_FRAMEWORK_MD5 "f8ec7554ef5d23ea4ce474b1e8214de9")
       elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.1")
         set(ORTHANC_FRAMEWORK_MD5 "db094f96399cbe8b9bbdbce34884c220")
+      elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.2")
+        set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548")
 
       # Below this point are development snapshots that were used to
       # release some plugin, before an official release of the Orthanc
@@ -137,6 +139,9 @@
       elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "4a3ba4bf4ba7")
         # PostgreSQL 3.3 (framework pre-1.8.2)
         set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde")
+      elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800")
+        # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0)
+        set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00")
       endif()
     endif()
   endif()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/DownloadPackage.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/DownloadPackage.cmake
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/DownloadPackage.cmake       
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/DownloadPackage.cmake       
2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/EmbedResources.py 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/EmbedResources.py
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/EmbedResources.py   
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/EmbedResources.py   
2021-01-26 19:18:58.000000000 +0100
@@ -3,7 +3,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake   
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake   
    2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp   
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp   
    2021-01-26 19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -24,9 +24,33 @@
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/move/unique_ptr.hpp>
 #include <boost/thread.hpp>
+
+
 #include <json/reader.h>
+#include <json/version.h>
 #include <json/writer.h>
 
+#if !defined(JSONCPP_VERSION_MAJOR) || !defined(JSONCPP_VERSION_MINOR)
+#  error Cannot access the version of JsonCpp
+#endif
+
+
+/**
+ * We use deprecated "Json::Reader", "Json::StyledWriter" and
+ * "Json::FastWriter" if JsonCpp < 1.7.0. This choice is rather
+ * arbitrary, but if Json >= 1.9.0, gcc generates explicit deprecation
+ * warnings (clang was warning in earlier versions). For reference,
+ * these classes seem to have been deprecated since JsonCpp 1.4.0 (on
+ * February 2015) by the following changeset:
+ * 
https://github.com/open-source-parsers/jsoncpp/commit/8df98f6112890d6272734975dd6d70cf8999bb22
+ **/
+#if (JSONCPP_VERSION_MAJOR >= 2 ||                                      \
+     (JSONCPP_VERSION_MAJOR == 1 && JSONCPP_VERSION_MINOR >= 8))
+#  define JSONCPP_USE_DEPRECATED 0
+#else
+#  define JSONCPP_USE_DEPRECATED 1
+#endif
+
 
 #if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 0)
 static const OrthancPluginErrorCode OrthancPluginErrorCode_NullPointer = 
OrthancPluginErrorCode_Plugin;
@@ -202,10 +226,7 @@
       ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError);
     }
 
-    const char* tmp = reinterpret_cast<const char*>(buffer_.data);
-
-    Json::Reader reader;
-    if (!reader.parse(tmp, tmp + buffer_.size, target))
+    if (!ReadJson(target, buffer_.data, buffer_.size))
     {
       LogError("Cannot convert some memory buffer to JSON");
       ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
@@ -292,12 +313,102 @@
   }
 
 
+  static bool ReadJsonInternal(Json::Value& target,
+                               const void* buffer,
+                               size_t size,
+                               bool collectComments)
+  {
+#if JSONCPP_USE_DEPRECATED == 1
+    Json::Reader reader;
+    return reader.parse(reinterpret_cast<const char*>(buffer),
+                        reinterpret_cast<const char*>(buffer) + size, target, 
collectComments);
+#else
+    Json::CharReaderBuilder builder;
+    builder.settings_["collectComments"] = collectComments;
+    
+    const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
+    assert(reader.get() != NULL);
+    
+    JSONCPP_STRING err;
+    if (reader->parse(reinterpret_cast<const char*>(buffer),
+                      reinterpret_cast<const char*>(buffer) + size, &target, 
&err))
+    {
+      return true;
+    }
+    else
+    {
+      LogError("Cannot parse JSON: " + std::string(err));
+      return false;
+    }
+#endif
+  }
+
+
+  bool ReadJson(Json::Value& target,
+                const std::string& source)
+  {
+    return ReadJson(target, source.empty() ? NULL : source.c_str(), 
source.size());
+  }
+  
+
+  bool ReadJson(Json::Value& target,
+                const void* buffer,
+                size_t size)
+  {
+    return ReadJsonInternal(target, buffer, size, true);
+  }
+  
+
+  bool ReadJsonWithoutComments(Json::Value& target,
+                               const std::string& source)
+  {
+    return ReadJsonWithoutComments(target, source.empty() ? NULL : 
source.c_str(), source.size());
+  }
+  
+
+  bool ReadJsonWithoutComments(Json::Value& target,
+                               const void* buffer,
+                               size_t size)
+  {
+    return ReadJsonInternal(target, buffer, size, false);
+  }
+
+
+  void WriteFastJson(std::string& target,
+                     const Json::Value& source)
+  {
+#if JSONCPP_USE_DEPRECATED == 1
+    Json::FastWriter writer;
+    target = writer.write(source);
+#else
+    Json::StreamWriterBuilder builder;
+    builder.settings_["indentation"] = "";
+    target = Json::writeString(builder, source);
+#endif
+  }
+  
+
+  void WriteStyledJson(std::string& target,
+                       const Json::Value& source)
+  {
+#if JSONCPP_USE_DEPRECATED == 1
+    Json::StyledWriter writer;
+    target = writer.write(source);
+#else
+    Json::StreamWriterBuilder builder;
+    builder.settings_["indentation"] = "   ";
+    target = Json::writeString(builder, source);
+#endif
+  }
+
+
   bool MemoryBuffer::RestApiPost(const std::string& uri,
                                  const Json::Value& body,
                                  bool applyPlugins)
   {
-    Json::FastWriter writer;
-    return RestApiPost(uri, writer.write(body), applyPlugins);
+    std::string s;
+    WriteFastJson(s, body);
+    return RestApiPost(uri, s, applyPlugins);
   }
 
 
@@ -305,8 +416,9 @@
                                 const Json::Value& body,
                                 bool applyPlugins)
   {
-    Json::FastWriter writer;
-    return RestApiPut(uri, writer.write(body), applyPlugins);
+    std::string s;
+    WriteFastJson(s, body);
+    return RestApiPut(uri, s, applyPlugins);
   }
 
 
@@ -315,8 +427,8 @@
   {
     Clear();
 
-    Json::FastWriter writer;
-    std::string s = writer.write(tags);
+    std::string s;
+    WriteFastJson(s, tags);
 
     Check(OrthancPluginCreateDicom(GetGlobalContext(), &buffer_, s.c_str(), 
NULL, flags));
   }
@@ -327,8 +439,8 @@
   {
     Clear();
 
-    Json::FastWriter writer;
-    std::string s = writer.write(tags);
+    std::string s;
+    WriteFastJson(s, tags);
 
     Check(OrthancPluginCreateDicom(GetGlobalContext(), &buffer_, s.c_str(), 
pixelData.GetObject(), flags));
   }
@@ -390,8 +502,7 @@
       ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError);
     }
 
-    Json::Reader reader;
-    if (!reader.parse(str_, target))
+    if (!ReadJson(target, str_))
     {
       LogError("Cannot convert some memory buffer to JSON");
       ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
@@ -1190,19 +1301,16 @@
 #endif /* HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 */
 
   void AnswerJson(const Json::Value& value,
-                  OrthancPluginRestOutput* output
-    )
+                  OrthancPluginRestOutput* output)
   {
-    Json::StyledWriter writer;
-    std::string bodyString = writer.write(value);
-
+    std::string bodyString;
+    WriteStyledJson(bodyString, value);    
     OrthancPluginAnswerBuffer(GetGlobalContext(), output, bodyString.c_str(), 
bodyString.size(), "application/json");
   }
 
   void AnswerString(const std::string& answer,
                     const char* mimeType,
-                    OrthancPluginRestOutput* output
-    )
+                    OrthancPluginRestOutput* output)
   {
     OrthancPluginAnswerBuffer(GetGlobalContext(), output, answer.c_str(), 
answer.size(), mimeType);
   }
@@ -1324,8 +1432,9 @@
                    const Json::Value& body,
                    bool applyPlugins)
   {
-    Json::FastWriter writer;
-    return RestApiPost(result, uri, writer.write(body), applyPlugins);
+    std::string s;
+    WriteFastJson(s, body);
+    return RestApiPost(result, uri, s, applyPlugins);
   }
 
 
@@ -1357,8 +1466,9 @@
                   const Json::Value& body,
                   bool applyPlugins)
   {
-    Json::FastWriter writer;
-    return RestApiPut(result, uri, writer.write(body), applyPlugins);
+    std::string s;
+    WriteFastJson(s, body);
+    return RestApiPut(result, uri, s, applyPlugins);
   }
 
 
@@ -2020,8 +2130,7 @@
     }
     else
     {
-      Json::FastWriter writer;
-      content_ = writer.write(content);
+      WriteFastJson(content_, content);
     }
   }
 
@@ -2041,8 +2150,7 @@
     }
     else
     {
-      Json::FastWriter writer;
-      serialized_ = writer.write(serialized);
+      WriteFastJson(serialized_, serialized);
       hasSerialized_ = true;
     }
   }
@@ -2902,8 +3010,7 @@
     std::string body;
     Execute(answerHeaders, body);
     
-    Json::Reader reader;
-    if (!reader.parse(body, answerBody))
+    if (!ReadJson(answerBody, body))
     {
       LogError("Cannot convert HTTP answer body to JSON");
       ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h 
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h 
2021-01-26 19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -476,6 +476,26 @@
 #endif
 
 
+  bool ReadJson(Json::Value& target,
+                const std::string& source);
+  
+  bool ReadJson(Json::Value& target,
+                const void* buffer,
+                size_t size);
+
+  bool ReadJsonWithoutComments(Json::Value& target,
+                               const std::string& source);  
+
+  bool ReadJsonWithoutComments(Json::Value& target,
+                               const void* buffer,
+                               size_t size);
+
+  void WriteFastJson(std::string& target,
+                     const Json::Value& source);
+
+  void WriteStyledJson(std::string& target,
+                       const Json::Value& source);
+
   bool RestApiGet(Json::Value& result,
                   const std::string& uri,
                   bool applyPlugins);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginException.h 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginException.h
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginException.h  
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginException.h  
2021-01-26 19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake   
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake   
    2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake
 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake
       2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake
       2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake
 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake
    2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake
 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake
--- 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake
    2020-12-18 07:15:27.000000000 +0100
+++ 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake
    2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGWToolchain.cmake 
new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGWToolchain.cmake
--- old/OrthancDicomWeb-1.4/Resources/Orthanc/Toolchains/MinGWToolchain.cmake   
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Orthanc/Toolchains/MinGWToolchain.cmake   
2021-01-26 19:18:58.000000000 +0100
@@ -1,7 +1,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Samples/JavaScript/qido-rs.js 
new/OrthancDicomWeb-1.5/Resources/Samples/JavaScript/qido-rs.js
--- old/OrthancDicomWeb-1.4/Resources/Samples/JavaScript/qido-rs.js     
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Samples/JavaScript/qido-rs.js     
2021-01-26 19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Samples/JavaScript/stow-rs.js 
new/OrthancDicomWeb-1.5/Resources/Samples/JavaScript/stow-rs.js
--- old/OrthancDicomWeb-1.4/Resources/Samples/JavaScript/stow-rs.js     
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Samples/JavaScript/stow-rs.js     
2021-01-26 19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Samples/Python/SendStow.py 
new/OrthancDicomWeb-1.5/Resources/Samples/Python/SendStow.py
--- old/OrthancDicomWeb-1.4/Resources/Samples/Python/SendStow.py        
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Samples/Python/SendStow.py        
2021-01-26 19:18:58.000000000 +0100
@@ -3,7 +3,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/Resources/Samples/Python/WadoRetrieveStudy.py 
new/OrthancDicomWeb-1.5/Resources/Samples/Python/WadoRetrieveStudy.py
--- old/OrthancDicomWeb-1.4/Resources/Samples/Python/WadoRetrieveStudy.py       
2020-12-18 07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/Resources/Samples/Python/WadoRetrieveStudy.py       
2021-01-26 19:18:58.000000000 +0100
@@ -3,7 +3,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017-2020 Osimis S.A., Belgium
+# Copyright (C) 2017-2021 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU Affero General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/OrthancDicomWeb-1.4/UnitTestsSources/UnitTestsMain.cpp 
new/OrthancDicomWeb-1.5/UnitTestsSources/UnitTestsMain.cpp
--- old/OrthancDicomWeb-1.4/UnitTestsSources/UnitTestsMain.cpp  2020-12-18 
07:15:27.000000000 +0100
+++ new/OrthancDicomWeb-1.5/UnitTestsSources/UnitTestsMain.cpp  2021-01-26 
19:18:58.000000000 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
+ * Copyright (C) 2017-2021 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU Affero General Public License
@@ -24,6 +24,7 @@
 #include <boost/algorithm/string/predicate.hpp>
 
 #include "../Plugin/Configuration.h"
+#include "../Plugin/DicomWebServers.h"
 
 using namespace OrthancPlugins;
 
@@ -61,6 +62,50 @@
 }
 
 
+TEST(DicomWebServers, Serialization)
+{
+  std::list<std::string> servers;
+  DicomWebServers::GetInstance().ListServers(servers);
+  ASSERT_TRUE(servers.empty());
+
+  {
+    std::string json;
+    DicomWebServers::GetInstance().SerializeGlobalProperty(json);
+    DicomWebServers::GetInstance().UnserializeGlobalProperty(json);
+    ASSERT_TRUE(servers.empty());
+  }
+
+  Orthanc::WebServiceParameters p;
+  p.SetUrl("http://hello/";);
+  p.SetCredentials("user", "world");
+  DicomWebServers::GetInstance().SetServer("test", p);
+
+  std::string json;
+  DicomWebServers::GetInstance().SerializeGlobalProperty(json);
+
+  p.SetUrl("http://nope/";);
+  p.ClearCredentials();
+  DicomWebServers::GetInstance().SetServer("nope", p);
+
+  DicomWebServers::GetInstance().ListServers(servers);
+  ASSERT_EQ(2u, servers.size());
+  
+  DicomWebServers::GetInstance().UnserializeGlobalProperty(json);
+
+  DicomWebServers::GetInstance().ListServers(servers);
+  ASSERT_EQ(1u, servers.size());
+
+  ASSERT_THROW(DicomWebServers::GetInstance().GetServer("nope"), 
Orthanc::OrthancException);
+  p = DicomWebServers::GetInstance().GetServer("test");
+  ASSERT_EQ("http://hello/";, p.GetUrl());
+  ASSERT_EQ("user", p.GetUsername());
+
+  DicomWebServers::GetInstance().Clear();
+  DicomWebServers::GetInstance().ListServers(servers);
+  ASSERT_TRUE(servers.empty());
+}
+
+
 int main(int argc, char **argv)
 {
   ::testing::InitGoogleTest(&argc, argv);

Reply via email to