# HG changeset patch # User Sebastien Jodogne # Date 1711114956 -3600 # Node ID 711b136e8fe8a6677ad975530075c75df8ba3515 # Parent b3876cbb93a24c489f8702e62c7c842472d5e108 sync diff -r b3876cbb93a2 -r 711b136e8fe8 Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp --- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Fri Mar 22 14:36:38 2024 +0100 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Fri Mar 22 14:42:36 2024 +0100 @@ -4026,4 +4026,48 @@ result[request->headersKeys[i]] = request->headersValues[i]; } } + +#if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) + static void SetPluginProperty(const std::string& pluginIdentifier, + _OrthancPluginProperty property, + const std::string& value) + { + _OrthancPluginSetPluginProperty params; + params.plugin = pluginIdentifier.c_str(); + params.property = property; + params.value = value.c_str(); + + GetGlobalContext()->InvokeService(GetGlobalContext(), _OrthancPluginService_SetPluginProperty, ¶ms); + } +#endif + + void SetRootUri(const std::string& pluginIdentifier, + const std::string& uri) + { +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) + OrthancPluginSetRootUri2(GetGlobalContext(), pluginIdentifier.c_str(), uri.c_str()); +#else + SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_RootUri, uri); +#endif + } + + void SetDescription(const std::string& pluginIdentifier, + const std::string& description) + { +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) + OrthancPluginSetDescription2(GetGlobalContext(), pluginIdentifier.c_str(), description.c_str()); +#else + SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_Description, description); +#endif + } + + void ExtendOrthancExplorer(const std::string& pluginIdentifier, + const std::string& javascript) + { +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 4) + OrthancPluginExtendOrthancExplorer2(GetGlobalContext(), pluginIdentifier.c_str(), javascript.c_str()); +#else + SetPluginProperty(pluginIdentifier, _OrthancPluginProperty_OrthancExplorer, javascript); +#endif + } } diff -r b3876cbb93a2 -r 711b136e8fe8 Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h --- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Fri Mar 22 14:36:38 2024 +0100 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Fri Mar 22 14:42:36 2024 +0100 @@ -1435,4 +1435,13 @@ IWebDavCollection& collection); }; #endif + + void SetRootUri(const std::string& pluginIdentifier, + const std::string& uri); + + void SetDescription(const std::string& pluginIdentifier, + const std::string& description); + + void ExtendOrthancExplorer(const std::string& pluginIdentifier, + const std::string& javascript); } diff -r b3876cbb93a2 -r 711b136e8fe8 Resources/Orthanc/Sdk-1.12.3/orthanc/OrthancDatabasePlugin.proto --- a/Resources/Orthanc/Sdk-1.12.3/orthanc/OrthancDatabasePlugin.proto Fri Mar 22 14:36:38 2024 +0100 +++ b/Resources/Orthanc/Sdk-1.12.3/orthanc/OrthancDatabasePlugin.proto Fri Mar 22 14:42:36 2024 +0100 @@ -121,7 +121,7 @@ OPERATION_START_TRANSACTION = 4; OPERATION_UPGRADE = 5; OPERATION_FINALIZE_TRANSACTION = 6; - OPERATION_MEASURE_LATENCY = 7; // New in Orthanc 1.12.3 + OPERATION_MEASURE_LATENCY = 7; // New in Orthanc 1.12.X } enum TransactionType { @@ -290,8 +290,8 @@ OPERATION_ADD_LABEL = 45; // New in Orthanc 1.12.0 OPERATION_REMOVE_LABEL = 46; // New in Orthanc 1.12.0 OPERATION_LIST_LABELS = 47; // New in Orthanc 1.12.0 - OPERATION_INCREMENT_GLOBAL_PROPERTY = 48; // New in Orthanc 1.12.3 - OPERATION_UPDATE_AND_GET_STATISTICS = 49; // New in Orthanc 1.12.3 + OPERATION_INCREMENT_GLOBAL_PROPERTY = 48; // New in Orthanc 1.12.X + OPERATION_UPDATE_AND_GET_STATISTICS = 49; // New in Orthanc 1.12.X } message Rollback {