comparison OrthancServer/ServerContext.cpp @ 2808:37583cd183ed

primitives to create jobs from plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Sep 2018 17:57:06 +0200
parents 3a55b77339ff
children 925d8dc03a23
comparison
equal deleted inserted replaced
2807:6356e2ceb493 2808:37583cd183ed
163 { 163 {
164 std::string serialized; 164 std::string serialized;
165 if (index_.LookupGlobalProperty(serialized, GlobalProperty_JobsRegistry)) 165 if (index_.LookupGlobalProperty(serialized, GlobalProperty_JobsRegistry))
166 { 166 {
167 LOG(WARNING) << "Reloading the jobs from the last execution of Orthanc"; 167 LOG(WARNING) << "Reloading the jobs from the last execution of Orthanc";
168 OrthancJobUnserializer unserializer(*this);
169 168
170 try 169 try
171 { 170 {
172 jobsEngine_.LoadRegistryFromString(unserializer, serialized); 171 bool plugin = false;
172
173 #if ORTHANC_ENABLE_PLUGINS == 1
174 if (HasPlugins() &&
175 plugins_->UnserializeJob(serialized))
176 {
177 plugin = true;
178 }
179 #endif
180
181 if (!plugin)
182 {
183 OrthancJobUnserializer unserializer(*this);
184 jobsEngine_.LoadRegistryFromString(unserializer, serialized);
185 }
173 } 186 }
174 catch (OrthancException& e) 187 catch (OrthancException& e)
175 { 188 {
176 LOG(ERROR) << "Cannot unserialize the jobs engine: " << e.What(); 189 LOG(ERROR) << "Cannot unserialize the jobs engine: " << e.What();
177 throw; 190 throw;