changeset 746:a760a8b2c64c

DicomWebStowClient: populate Content.Resources and Content.Server fields at creation
author Alain Mazy <am@orthanc.team>
date Wed, 18 Mar 2026 21:23:29 +0100
parents b4f6c00c343f
children 6fd8630f295a
files CMakeLists.txt NEWS Plugin/DicomWebClient.cpp
diffstat 3 files changed, 9 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Mar 13 18:02:12 2026 +0100
+++ b/CMakeLists.txt	Wed Mar 18 21:23:29 2026 +0100
@@ -29,7 +29,7 @@
   set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline")
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
 else()
-  set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "e0979326ac53")  # while waiting for 1.12.11
+  set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "71400f1c6143")  # while waiting for 1.12.11
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
 endif()
 
--- a/NEWS	Fri Mar 13 18:02:12 2026 +0100
+++ b/NEWS	Wed Mar 18 21:23:29 2026 +0100
@@ -11,6 +11,8 @@
   - orthanc_dicomweb_wadors_total_bytes_transferred counts the number of bytes that have
     been returned by any WADO-RS route to retrieve instances, series or studies.  This is updated
     while the response is returned.
+* "DicomWebStowClient" jobs now have their "Content.Resources" and "Content.Server" fields populated
+  as soon as they are created and not only when they start being executed.
 
 
 Version 1.22 (2025-12-02)
--- a/Plugin/DicomWebClient.cpp	Fri Mar 13 18:02:12 2026 +0100
+++ b/Plugin/DicomWebClient.cpp	Wed Mar 18 21:23:29 2026 +0100
@@ -168,14 +168,7 @@
     }
   }
 
-  // void SetContent(const std::string& key,
-  //                 const std::string& value)
-  // {
-  //   boost::mutex::scoped_lock lock(mutex_);
-  //   content_[key] = value;
-  //   UpdateContent(content_);
-  // }
-
+protected:
   void SetContent(const std::string& key,
                   const Json::Value& value)
   {
@@ -184,6 +177,7 @@
     UpdateContent(content_);
   }
 
+private:
   static void Worker(SingleFunctionJob* job,
                      IFunctionFactory* factory)
   {
@@ -594,7 +588,6 @@
   Action                       action_;
   size_t                       networkSize_;
   bool                         debug_;
-  Json::Value                  resourcesForJobContent_;
 
   bool ReadNextInstance(std::string& dicom,
                         JobContext& context)
@@ -713,8 +706,6 @@
       {
         boost::mutex::scoped_lock lock(that_.mutex_);
         context.SetContent("InstancesCount", boost::lexical_cast<std::string>(that_.instances_.size()));
-        context.SetContent("Resources", that_.GetResourcesForJobContent());
-        context.SetContent("Server", that_.GetServerName());
         serverName = that_.serverName_;
         
         startPosition = that_.position_;        
@@ -817,9 +808,11 @@
     position_(0),
     action_(Action_None),
     networkSize_(0),
-    debug_(false),
-    resourcesForJobContent_(resourcesForJobContent)
+    debug_(false)
   {
+    SetContent("Resources", resourcesForJobContent);
+    SetContent("Server", serverName_);
+
     SetFactory(*this);
 
     instances_.reserve(instances.size());
@@ -855,15 +848,6 @@
     debug_ = debug;
   }
 
-  const Json::Value& GetResourcesForJobContent()
-  {
-    return resourcesForJobContent_;
-  }
-
-  const std::string& GetServerName()
-  {
-    return serverName_;
-  }
 };