# HG changeset patch # User Sebastien Jodogne # Date 1711117354 -3600 # Node ID 6f410277e485ca63505c1034f9c16b492766f15b # Parent bad56897cc1ff8ff8270edec702d12e1fdde1f67 fix deprecated calls diff -r bad56897cc1f -r 6f410277e485 Resources/Orthanc/CMake/DownloadOrthancFramework.cmake --- a/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Tue Jan 30 21:03:13 2024 +0100 +++ b/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake Fri Mar 22 15:22:34 2024 +0100 @@ -160,6 +160,8 @@ set(ORTHANC_FRAMEWORK_MD5 "8a435140efc8ff4a01d8242f092f21de") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.2") set(ORTHANC_FRAMEWORK_MD5 "d2476b9e796e339ac320b5333489bdb3") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.12.3") + set(ORTHANC_FRAMEWORK_MD5 "975f5bf2142c22cb1777b4f6a0a614c5") # Below this point are development snapshots that were used to # release some plugin, before an official release of the Orthanc diff -r bad56897cc1f -r 6f410277e485 Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp --- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Tue Jan 30 21:03:13 2024 +0100 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp Fri Mar 22 15:22:34 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 bad56897cc1f -r 6f410277e485 Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h --- a/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Tue Jan 30 21:03:13 2024 +0100 +++ b/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h Fri Mar 22 15:22:34 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 bad56897cc1f -r 6f410277e485 Sources/Plugin/Plugin.cpp --- a/Sources/Plugin/Plugin.cpp Tue Jan 30 21:03:13 2024 +0100 +++ b/Sources/Plugin/Plugin.cpp Fri Mar 22 15:22:34 2024 +0100 @@ -27,6 +27,8 @@ #include #include +#define ORTHANC_PLUGIN_NAME "neuro" + static void CreateNifti(std::string& target, const Neuro::DicomInstancesCollection& collection, @@ -283,7 +285,7 @@ return -1; } - OrthancPluginSetDescription(context, "Add support for NIfTI in Orthanc."); + OrthancPlugins::SetDescription(ORTHANC_PLUGIN_NAME, "Add support for NIfTI in Orthanc."); OrthancPlugins::RegisterRestCallback("/series/(.*)/nifti", true /* thread safe */); OrthancPlugins::RegisterRestCallback("/instances/(.*)/nifti", true /* thread safe */); @@ -292,7 +294,7 @@ std::string explorer; Orthanc::EmbeddedResources::GetFileResource( explorer, Orthanc::EmbeddedResources::ORTHANC_EXPLORER); - OrthancPluginExtendOrthancExplorer(context, explorer.c_str()); + OrthancPlugins::ExtendOrthancExplorer(ORTHANC_PLUGIN_NAME, explorer.c_str()); } return 0; @@ -306,7 +308,7 @@ ORTHANC_PLUGINS_API const char* OrthancPluginGetName() { - return "neuro"; + return ORTHANC_PLUGIN_NAME; }