annotate Framework/Plugins/PluginInitialization.cpp @ 490:b3876cbb93a2

Fix check of Orthanc runtime version
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 14:36:38 +0100
parents ecd0b719cff5
children af6998ed73dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
459
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 389
diff changeset
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 389
diff changeset
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Affero General Public License
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Affero General Public License for more details.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Affero General Public License
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "PluginInitialization.h"
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
25 #include "../Common/ImplicitTransaction.h"
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
26 #include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
27
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
28 #include <Logging.h>
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
29 #include <Toolbox.h>
62
eedd082355f9 fix for compatibility with simplified OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
30
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace OrthancDatabases
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
34 static bool DisplayPerformanceWarning(const std::string& dbms,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
35 bool isIndex)
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 (void) DisplayPerformanceWarning; // Disable warning about unused function
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
38 LOG(WARNING) << "Performance warning in " << dbms
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
39 << (isIndex ? " index" : " storage area")
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
40 << ": Non-release build, runtime debug assertions are turned on";
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 return true;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 bool InitializePlugin(OrthancPluginContext* context,
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
46 const std::string& dbms,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
47 bool isIndex)
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
168
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 153
diff changeset
49 #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 7, 2)
149
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
50 Orthanc::Logging::InitializePluginContext(context);
151
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
51 #else
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
52 Orthanc::Logging::Initialize(context);
6c58af430ba0 improved Orthanc::Logging::Initialize()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
53 #endif
260
793bbbe11287 IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 193
diff changeset
54
793bbbe11287 IDatabaseBackend::HasRevisionsSupport()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 193
diff changeset
55 Orthanc::Logging::EnableInfoLevel(true);
62
eedd082355f9 fix for compatibility with simplified OrthancPluginCppWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
56 OrthancPlugins::SetGlobalContext(context);
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
57 ImplicitTransaction::SetErrorOnDoubleExecution(false);
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
59 assert(DisplayPerformanceWarning(dbms, isIndex));
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 /* Check the version of the Orthanc core */
490
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
62 if (OrthancPluginCheckVersion(context) == 0)
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
63 {
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
64 LOG(ERROR) << "Your version of Orthanc ("
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
65 << context->orthancVersion << ") must be above "
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
66 << ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER << "."
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
67 << ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER << "."
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
68 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
69 << " to run this plugin";
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
70 return false;
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
71 }
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
72
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
73
b3876cbb93a2 Fix check of Orthanc runtime version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
74 /* Warn the user if the Orthanc runtime has not an optimal version */
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 bool useFallback = true;
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
77 bool isOptimal = false;
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in Orthanc 1.3.1
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0)
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 if (OrthancPluginCheckVersionAdvanced(context, 0, 9, 5) == 0)
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 LOG(ERROR) << "Your version of Orthanc (" << context->orthancVersion
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 << ") must be above 0.9.5 to run this plugin";
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 return false;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
88 if (OrthancPluginCheckVersionAdvanced(context, 1, 4, 0) == 1)
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
89 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
90 ImplicitTransaction::SetErrorOnDoubleExecution(true);
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
91 }
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
92
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
93 if (OrthancPluginCheckVersionAdvanced(context,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
94 ORTHANC_OPTIMAL_VERSION_MAJOR,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
95 ORTHANC_OPTIMAL_VERSION_MINOR,
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
96 ORTHANC_OPTIMAL_VERSION_REVISION) == 1)
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
97 {
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
98 isOptimal = true;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
99 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
100
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 useFallback = false;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 # endif
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 #endif
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
64
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
105 if (useFallback)
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
106 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
107 std::string v(context->orthancVersion);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
108
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
109 if (v == "mainline")
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
110 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
111 isOptimal = true;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
112 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
113 else
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
114 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
115 std::vector<std::string> tokens;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
116 Orthanc::Toolbox::TokenizeString(tokens, v, '.');
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
117
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
118 if (tokens.size() != 3)
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
119 {
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
120 LOG(ERROR) << "Bad version of Orthanc: " << v;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
121 return false;
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
122 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
123
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
124 int major = boost::lexical_cast<int>(tokens[0]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
125 int minor = boost::lexical_cast<int>(tokens[1]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
126 int revision = boost::lexical_cast<int>(tokens[2]);
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
127
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
128 isOptimal = (major > ORTHANC_OPTIMAL_VERSION_MAJOR ||
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
129 (major == ORTHANC_OPTIMAL_VERSION_MAJOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
130 minor > ORTHANC_OPTIMAL_VERSION_MINOR) ||
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
131 (major == ORTHANC_OPTIMAL_VERSION_MAJOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
132 minor == ORTHANC_OPTIMAL_VERSION_MINOR &&
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
133 revision >= ORTHANC_OPTIMAL_VERSION_REVISION));
64
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
134 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
135 }
e39c1ebb7a0e fix in backwards compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 62
diff changeset
136
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
137 if (!isOptimal &&
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
138 isIndex)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
139 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
140 LOG(WARNING) << "Performance warning in " << dbms
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
141 << " index: Your version of Orthanc ("
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
142 << context->orthancVersion << ") should be upgraded to "
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
143 << ORTHANC_OPTIMAL_VERSION_MAJOR << "."
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
144 << ORTHANC_OPTIMAL_VERSION_MINOR << "."
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
145 << ORTHANC_OPTIMAL_VERSION_REVISION
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 127
diff changeset
146 << " to benefit from best performance";
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
147 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
148
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
149
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
150 std::string description = ("Stores the Orthanc " +
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
151 std::string(isIndex ? "index" : "storage area") +
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
152 " into a " + dbms + " database");
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 24
diff changeset
153
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 OrthancPluginSetDescription(context, description.c_str());
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 return true;
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 }