comparison OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp @ 5809:023a99146dd0 attach-custom-data

merged find-refactoring -> attach-custom-data
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 12:53:43 +0200
parents 56352ae88120
children
comparison
equal deleted inserted replaced
5808:63c025cf6958 5809:023a99146dd0
90 static const char* const MAXIMUM_STORAGE_SIZE = "MaximumStorageSize"; 90 static const char* const MAXIMUM_STORAGE_SIZE = "MaximumStorageSize";
91 static const char* const MAXIMUM_PATIENT_COUNT = "MaximumPatientCount"; 91 static const char* const MAXIMUM_PATIENT_COUNT = "MaximumPatientCount";
92 static const char* const MAXIMUM_STORAGE_MODE = "MaximumStorageMode"; 92 static const char* const MAXIMUM_STORAGE_MODE = "MaximumStorageMode";
93 static const char* const USER_METADATA = "UserMetadata"; 93 static const char* const USER_METADATA = "UserMetadata";
94 static const char* const HAS_LABELS = "HasLabels"; 94 static const char* const HAS_LABELS = "HasLabels";
95 static const char* const CAPABILITIES = "Capabilities";
96 static const char* const HAS_EXTENDED_CHANGES = "HasExtendedChanges";
97 static const char* const HAS_EXTENDED_FIND = "HasExtendedFind";
98 static const char* const READ_ONLY = "ReadOnly";
95 99
96 if (call.IsDocumentation()) 100 if (call.IsDocumentation())
97 { 101 {
98 call.GetDocumentation() 102 call.GetDocumentation()
99 .SetTag("System") 103 .SetTag("System")
136 "The configured MaximumStorageMode (new in Orthanc 1.11.3)") 140 "The configured MaximumStorageMode (new in Orthanc 1.11.3)")
137 .SetAnswerField(USER_METADATA, RestApiCallDocumentation::Type_JsonObject, 141 .SetAnswerField(USER_METADATA, RestApiCallDocumentation::Type_JsonObject,
138 "The configured UserMetadata (new in Orthanc 1.12.0)") 142 "The configured UserMetadata (new in Orthanc 1.12.0)")
139 .SetAnswerField(HAS_LABELS, RestApiCallDocumentation::Type_Boolean, 143 .SetAnswerField(HAS_LABELS, RestApiCallDocumentation::Type_Boolean,
140 "Whether the database back-end supports labels (new in Orthanc 1.12.0)") 144 "Whether the database back-end supports labels (new in Orthanc 1.12.0)")
145 .SetAnswerField(CAPABILITIES, RestApiCallDocumentation::Type_JsonObject,
146 "Whether the back-end supports optional features like 'HasExtendedChanges', 'HasExtendedFind' (new in Orthanc 1.12.5) ")
147 .SetAnswerField(READ_ONLY, RestApiCallDocumentation::Type_Boolean,
148 "Whether Orthanc is running in read only mode (new in Orthanc 1.12.5)")
141 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/system", true); 149 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/system", true);
142 return; 150 return;
143 } 151 }
144 152
145 ServerContext& context = OrthancRestApi::GetContext(call); 153 ServerContext& context = OrthancRestApi::GetContext(call);
167 result[MAXIMUM_STORAGE_MODE] = lock.GetConfiguration().GetStringParameter(MAXIMUM_STORAGE_MODE, "Recycle"); // New in Orthanc 1.11.3 175 result[MAXIMUM_STORAGE_MODE] = lock.GetConfiguration().GetStringParameter(MAXIMUM_STORAGE_MODE, "Recycle"); // New in Orthanc 1.11.3
168 } 176 }
169 177
170 result[STORAGE_AREA_PLUGIN] = Json::nullValue; 178 result[STORAGE_AREA_PLUGIN] = Json::nullValue;
171 result[DATABASE_BACKEND_PLUGIN] = Json::nullValue; 179 result[DATABASE_BACKEND_PLUGIN] = Json::nullValue;
180 result[READ_ONLY] = context.IsReadOnly();
172 181
173 #if ORTHANC_ENABLE_PLUGINS == 1 182 #if ORTHANC_ENABLE_PLUGINS == 1
174 result[PLUGINS_ENABLED] = true; 183 result[PLUGINS_ENABLED] = true;
175 const OrthancPlugins& plugins = context.GetPlugins(); 184 const OrthancPlugins& plugins = context.GetPlugins();
176 185
194 203
195 result[USER_METADATA] = Json::objectValue; 204 result[USER_METADATA] = Json::objectValue;
196 GetUserMetadataConfiguration(result[USER_METADATA]); 205 GetUserMetadataConfiguration(result[USER_METADATA]);
197 206
198 result[HAS_LABELS] = OrthancRestApi::GetIndex(call).HasLabelsSupport(); 207 result[HAS_LABELS] = OrthancRestApi::GetIndex(call).HasLabelsSupport();
208 result[CAPABILITIES] = Json::objectValue;
209 result[CAPABILITIES][HAS_EXTENDED_CHANGES] = OrthancRestApi::GetIndex(call).HasExtendedChanges();
210 result[CAPABILITIES][HAS_EXTENDED_FIND] = OrthancRestApi::GetIndex(call).HasFindSupport();
199 211
200 call.GetOutput().AnswerJson(result); 212 call.GetOutput().AnswerJson(result);
201 } 213 }
202 214
203 static void GetStatistics(RestApiGetCall& call) 215 static void GetStatistics(RestApiGetCall& call)