comparison Framework/Plugins/DatabaseBackendAdapterV2.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 821d4ba83dc3
children c8e06b41feec
comparison
equal deleted inserted replaced
220:492aa3edf572 221:73cc85f3d9c1
19 **/ 19 **/
20 20
21 21
22 22
23 #include "DatabaseBackendAdapterV2.h" 23 #include "DatabaseBackendAdapterV2.h"
24 #include "GlobalProperties.h"
24 25
25 #include <OrthancException.h> 26 #include <OrthancException.h>
26 27
27 #include <stdexcept> 28 #include <stdexcept>
28 #include <list> 29 #include <list>
847 output->SetAllowedAnswers(DatabaseBackendAdapterV2::Output::AllowedAnswers_None); 848 output->SetAllowedAnswers(DatabaseBackendAdapterV2::Output::AllowedAnswers_None);
848 849
849 try 850 try
850 { 851 {
851 std::string s; 852 std::string s;
852 if (backend->LookupGlobalProperty(s, property)) 853 if (backend->LookupGlobalProperty(s, MISSING_SERVER_IDENTIFIER, property))
853 { 854 {
854 OrthancPluginDatabaseAnswerString(backend->GetContext(), 855 OrthancPluginDatabaseAnswerString(backend->GetContext(),
855 output->GetDatabase(), 856 output->GetDatabase(),
856 s.c_str()); 857 s.c_str());
857 } 858 }
1043 { 1044 {
1044 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload); 1045 IDatabaseBackend* backend = reinterpret_cast<IDatabaseBackend*>(payload);
1045 1046
1046 try 1047 try
1047 { 1048 {
1048 backend->SetGlobalProperty(property, value); 1049 backend->SetGlobalProperty(MISSING_SERVER_IDENTIFIER, property, value);
1049 return OrthancPluginErrorCode_Success; 1050 return OrthancPluginErrorCode_Success;
1050 } 1051 }
1051 ORTHANC_PLUGINS_DATABASE_CATCH; 1052 ORTHANC_PLUGINS_DATABASE_CATCH;
1052 } 1053 }
1053 1054