diff Plugins/OrthancCPlugin/OrthancCPlugin.h @ 993:501880d76474 plugins

improvements to GDCM plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Jul 2014 14:41:57 +0200
parents 3e43de893d88
children ab6a51f075fd
line wrap: on
line diff
--- a/Plugins/OrthancCPlugin/OrthancCPlugin.h	Wed Jul 02 13:53:56 2014 +0200
+++ b/Plugins/OrthancCPlugin/OrthancCPlugin.h	Wed Jul 02 14:41:57 2014 +0200
@@ -213,6 +213,7 @@
     /* Sending answers to REST calls */
     _OrthancPluginService_AnswerBuffer = 2000,
     _OrthancPluginService_CompressAndAnswerPngImage = 2001,
+    _OrthancPluginService_Redirect = 2002,
 
     /* Access to the Orthanc database and API */
     _OrthancPluginService_GetDicomForInstance = 3000,
@@ -664,6 +665,34 @@
   }
 
 
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const char*              redirection;
+  } _OrthancPluginRedirect;
+
+  /**
+   * @brief Redirect a GET request.
+   *
+   * This function answers to a REST request by redirecting the user
+   * to another URI using HTTP status 301.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param redirection Where to redirect.
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              redirection)
+  {
+    _OrthancPluginRedirect params;
+    params.output = output;
+    params.redirection = redirection;
+    context->InvokeService(context, _OrthancPluginService_Redirect, &params);
+  }
+
+
 #ifdef  __cplusplus
 }
 #endif