# HG changeset patch # User Sebastien Jodogne # Date 1755786577 -7200 # Node ID e673eadccf7d851ec412008523d789d464cdf627 # Parent dcd69fbcc34b1bda466bc1f26df23b6789cb9e4b wrapping OrthancPluginSetStableStatus diff -r dcd69fbcc34b -r e673eadccf7d CodeGeneration/CustomFunctions.json --- a/CodeGeneration/CustomFunctions.json Thu Aug 21 16:16:46 2025 +0200 +++ b/CodeGeneration/CustomFunctions.json Thu Aug 21 16:29:37 2025 +0200 @@ -75,5 +75,33 @@ "return_sdk_class" : "byte[]", "return_sdk_signature" : "[B", "since_sdk" : [ 1, 12, 8 ] + }, + + { + "comment" : "New in release 2.0", + "c_function" : "OrthancPluginCustom_SetStableStatus", + "sdk_functions" : [ "OrthancPluginSetStableStatus" ], + "documentation" : { + "description" : [ "Change the Stable status of a resource" ], + "args" : { + "resourceId" : "The identifier of the resource.", + "stableStatus" : "The new stable status." + }, + "return" : "A Boolean indicating whether the status has changed (true) or not (false) during the execution of this command." + }, + "args" : [ + { + "sdk_name" : "resourceId", + "sdk_type" : "const char *" + }, + { + "sdk_name" : "stableStatus", + "sdk_type" : "enumeration", + "sdk_enumeration" : "OrthancPluginStableStatus" + } + ], + "return_sdk_type" : "bool", + "since_sdk" : [ 1, 12, 9 ] } + ] diff -r dcd69fbcc34b -r e673eadccf7d Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Thu Aug 21 16:16:46 2025 +0200 +++ b/Plugin/Plugin.cpp Thu Aug 21 16:29:37 2025 +0200 @@ -535,6 +535,26 @@ #endif +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 9) +bool OrthancPluginCustom_SetStableStatus(OrthancPluginContext* context, + const char* resourceId, + OrthancPluginStableStatus stableStatus) +{ + uint8_t statusHasChanged = false; + OrthancPluginErrorCode code = OrthancPluginSetStableStatus(context, &statusHasChanged, resourceId, stableStatus); + + if (code == OrthancPluginErrorCode_Success) + { + return statusHasChanged; + } + else + { + throw std::runtime_error(JavaEnvironment::GetRuntimeErrorMessage(context, code)); + } +} +#endif + + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)