Mercurial > hg > orthanc
annotate Plugins/Samples/WebSkeleton/Framework/Plugin.cpp @ 1318:6e275e35d01c Orthanc-0.8.6
set version
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Feb 2015 14:47:38 +0100 |
parents | 6e7e5ed91c2d |
children | 3d76e26b3865 |
rev | line source |
---|---|
1181
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1181
diff
changeset
|
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1181
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
1181
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Permission is hereby granted, free of charge, to any person |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * obtaining a copy of this software and associated documentation |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * files (the "Software"), to deal in the Software without |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * restriction, including without limitation the rights to use, copy, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify, merge, publish, distribute, sublicense, and/or sell copies |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * of the Software, and to permit persons to whom the Software is |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * furnished to do so, subject to the following conditions: |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * The above copyright notice and this permission notice shall be |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * included in all copies or substantial portions of the Software. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * SOFTWARE. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 **/ |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include "../Configuration.h" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 #include <OrthancCPlugin.h> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 #include <string> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 #include <stdexcept> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 #include <algorithm> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #include <sys/stat.h> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 #if ORTHANC_PLUGIN_STANDALONE == 1 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 // This is an auto-generated file for standalone builds |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 #include <EmbeddedResources.h> |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 #endif |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 static OrthancPluginContext* context = NULL; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 static const char* GetMimeType(const std::string& path) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 size_t dot = path.find_last_of('.'); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 std::string extension = (dot == std::string::npos) ? "" : path.substr(dot); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 std::transform(extension.begin(), extension.end(), extension.begin(), tolower); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 if (extension == ".html") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 return "text/html"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 else if (extension == ".css") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 return "text/css"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 else if (extension == ".js") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 return "application/javascript"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 else if (extension == ".gif") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 return "image/gif"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 else if (extension == ".json") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 return "application/json"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 else if (extension == ".xml") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 return "application/xml"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 else if (extension == ".png") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 return "image/png"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 else if (extension == ".jpg" || extension == ".jpeg") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 return "image/jpeg"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 else |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 std::string s = "Unknown MIME type for extension: " + extension; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 OrthancPluginLogWarning(context, s.c_str()); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 return "application/octet-stream"; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 static bool ReadFile(std::string& content, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 const std::string& path) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 struct stat s; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 if (stat(path.c_str(), &s) != 0 || |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 !(s.st_mode & S_IFREG)) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 // Either the path does not exist, or it is not a regular file |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 return false; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 FILE* fp = fopen(path.c_str(), "rb"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 if (fp == NULL) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 return false; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 long size; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 if (fseek(fp, 0, SEEK_END) == -1 || |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 (size = ftell(fp)) < 0) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 fclose(fp); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 return false; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 content.resize(size); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 if (fseek(fp, 0, SEEK_SET) == -1) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 fclose(fp); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 return false; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 bool ok = true; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 if (size > 0 && |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 fread(&content[0], size, 1, fp) != 1) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 ok = false; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 fclose(fp); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 return ok; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 #if ORTHANC_PLUGIN_STANDALONE == 1 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 static int32_t ServeStaticResource(OrthancPluginRestOutput* output, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 const char* url, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 const OrthancPluginHttpRequest* request) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 if (request->method != OrthancPluginHttpMethod_Get) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 OrthancPluginSendMethodNotAllowed(context, output, "GET"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 std::string path = "/" + std::string(request->groups[0]); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 const char* mime = GetMimeType(path); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 try |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 std::string s; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 Orthanc::EmbeddedResources::GetDirectoryResource |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 (s, Orthanc::EmbeddedResources::STATIC_RESOURCES, path.c_str()); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 const char* resource = s.size() ? s.c_str() : NULL; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 OrthancPluginAnswerBuffer(context, output, resource, s.size(), mime); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 catch (std::runtime_error&) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 std::string s = "Unknown static resource in plugin: " + std::string(request->groups[0]); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 OrthancPluginLogError(context, s.c_str()); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 OrthancPluginSendHttpStatusCode(context, output, 404); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 #endif |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 #if ORTHANC_PLUGIN_STANDALONE == 0 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 static int32_t ServeFolder(OrthancPluginRestOutput* output, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 const char* url, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 const OrthancPluginHttpRequest* request) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 if (request->method != OrthancPluginHttpMethod_Get) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 OrthancPluginSendMethodNotAllowed(context, output, "GET"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 std::string path = ORTHANC_PLUGIN_RESOURCES_ROOT "/" + std::string(request->groups[0]); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 const char* mime = GetMimeType(path); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 std::string s; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 if (ReadFile(s, path)) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 const char* resource = s.size() ? s.c_str() : NULL; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 OrthancPluginAnswerBuffer(context, output, resource, s.size(), mime); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 else |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 std::string s = "Unknown static resource in plugin: " + std::string(request->groups[0]); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 OrthancPluginLogError(context, s.c_str()); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 OrthancPluginSendHttpStatusCode(context, output, 404); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 #endif |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 static int32_t RedirectRoot(OrthancPluginRestOutput* output, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 const char* url, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 const OrthancPluginHttpRequest* request) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 if (request->method != OrthancPluginHttpMethod_Get) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 OrthancPluginSendMethodNotAllowed(context, output, "GET"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 else |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 OrthancPluginRedirect(context, output, ORTHANC_PLUGIN_WEB_ROOT "index.html"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 extern "C" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 context = c; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 /* Check the version of the Orthanc core */ |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 if (OrthancPluginCheckVersion(c) == 0) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 char info[256]; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin", |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 c->orthancVersion, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER, |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 OrthancPluginLogError(context, info); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 return -1; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 /* Register the callbacks */ |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 #if ORTHANC_PLUGIN_STANDALONE == 1 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 OrthancPluginLogInfo(context, "Serving static resources (standalone build)"); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 OrthancPluginRegisterRestCallback(context, ORTHANC_PLUGIN_WEB_ROOT "(.*)", ServeStaticResource); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 #else |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 OrthancPluginLogInfo(context, "Serving resources from folder: " ORTHANC_PLUGIN_RESOURCES_ROOT); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 OrthancPluginRegisterRestCallback(context, ORTHANC_PLUGIN_WEB_ROOT "(.*)", ServeFolder); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 #endif |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 OrthancPluginRegisterRestCallback(context, "/", RedirectRoot); |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 return 0; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 ORTHANC_PLUGINS_API void OrthancPluginFinalize() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 return ORTHANC_PLUGIN_NAME; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 { |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 return ORTHANC_PLUGIN_VERSION; |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 } |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 } |