comparison 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
comparison
equal deleted inserted replaced
992:af014624dac1 993:501880d76474
211 _OrthancPluginService_RegisterRestCallback = 1000, 211 _OrthancPluginService_RegisterRestCallback = 1000,
212 212
213 /* Sending answers to REST calls */ 213 /* Sending answers to REST calls */
214 _OrthancPluginService_AnswerBuffer = 2000, 214 _OrthancPluginService_AnswerBuffer = 2000,
215 _OrthancPluginService_CompressAndAnswerPngImage = 2001, 215 _OrthancPluginService_CompressAndAnswerPngImage = 2001,
216 _OrthancPluginService_Redirect = 2002,
216 217
217 /* Access to the Orthanc database and API */ 218 /* Access to the Orthanc database and API */
218 _OrthancPluginService_GetDicomForInstance = 3000, 219 _OrthancPluginService_GetDicomForInstance = 3000,
219 _OrthancPluginService_RestApiGet = 3001, 220 _OrthancPluginService_RestApiGet = 3001,
220 _OrthancPluginService_RestApiPost = 3002, 221 _OrthancPluginService_RestApiPost = 3002,
662 params.bodySize = bodySize; 663 params.bodySize = bodySize;
663 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params); 664 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
664 } 665 }
665 666
666 667
668 typedef struct
669 {
670 OrthancPluginRestOutput* output;
671 const char* redirection;
672 } _OrthancPluginRedirect;
673
674 /**
675 * @brief Redirect a GET request.
676 *
677 * This function answers to a REST request by redirecting the user
678 * to another URI using HTTP status 301.
679 *
680 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
681 * @param output The HTTP connection to the client application.
682 * @param redirection Where to redirect.
683 **/
684 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
685 OrthancPluginContext* context,
686 OrthancPluginRestOutput* output,
687 const char* redirection)
688 {
689 _OrthancPluginRedirect params;
690 params.output = output;
691 params.redirection = redirection;
692 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
693 }
694
695
667 #ifdef __cplusplus 696 #ifdef __cplusplus
668 } 697 }
669 #endif 698 #endif
670 699
671 700