Mercurial > hg > orthanc
annotate OrthancServer/Plugins/Engine/PluginsJob.h @ 4831:7053502fbf97
added copyright UCLouvain
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Nov 2021 19:01:11 +0100 |
parents | 0a38000b086d |
children | 2e71a08eea15 43e613a7756b |
rev | line source |
---|---|
2810 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4204
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
4831
7053502fbf97
added copyright UCLouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4805
diff
changeset
|
6 * Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
2810 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * In addition, as a special exception, the copyright holders of this | |
14 * program give permission to link the code of its release with the | |
15 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
16 * that use the same license as the "OpenSSL" library), and distribute | |
17 * the linked executables. You must obey the GNU General Public License | |
18 * in all respects for all of the code used other than "OpenSSL". If you | |
19 * modify file(s) with this exception, you may extend this exception to | |
20 * your version of the file(s), but you are not obligated to do so. If | |
21 * you do not wish to do so, delete this exception statement from your | |
22 * version. If you delete this exception statement from all source files | |
23 * in the program, then also delete it here. | |
24 * | |
25 * This program is distributed in the hope that it will be useful, but | |
26 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
28 * General Public License for more details. | |
29 * | |
30 * You should have received a copy of the GNU General Public License | |
31 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
32 **/ | |
33 | |
34 | |
35 #pragma once | |
36 | |
37 #if ORTHANC_ENABLE_PLUGINS == 1 | |
38 | |
4202
2007ab69ac16
moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
39 #include "../../../OrthancFramework/Sources/Compatibility.h" // For ORTHANC_OVERRIDE |
4045 | 40 #include "../../../OrthancFramework/Sources/JobsEngine/IJob.h" |
2810 | 41 #include "../Include/orthanc/OrthancCPlugin.h" |
42 | |
43 namespace Orthanc | |
44 { | |
45 class PluginsJob : public IJob | |
46 { | |
47 private: | |
2815
925d8dc03a23
unserialization of jobs from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2814
diff
changeset
|
48 _OrthancPluginCreateJob parameters_; |
2814
7d1d3136f6cf
more generic handling of content and serialization in plugin jobs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2812
diff
changeset
|
49 std::string type_; |
2810 | 50 |
51 public: | |
4204 | 52 explicit PluginsJob(const _OrthancPluginCreateJob& parameters); |
2810 | 53 |
54 virtual ~PluginsJob(); | |
55 | |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
56 virtual void Start() ORTHANC_OVERRIDE |
2810 | 57 { |
58 } | |
59 | |
3658
2d90dd30858c
providing job ID to the IJob::Step() methods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3640
diff
changeset
|
60 virtual JobStepResult Step(const std::string& jobId) ORTHANC_OVERRIDE; |
2810 | 61 |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
62 virtual void Reset() ORTHANC_OVERRIDE; |
2810 | 63 |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
64 virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE; |
2810 | 65 |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
66 virtual float GetProgress() ORTHANC_OVERRIDE; |
2810 | 67 |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
68 virtual void GetJobType(std::string& target) ORTHANC_OVERRIDE |
2810 | 69 { |
70 target = type_; | |
71 } | |
72 | |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
73 virtual void GetPublicContent(Json::Value& value) ORTHANC_OVERRIDE; |
2810 | 74 |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
75 virtual bool Serialize(Json::Value& value) ORTHANC_OVERRIDE; |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
76 |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
77 virtual bool GetOutput(std::string& output, |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
78 MimeType& mime, |
4805
0a38000b086d
Archive jobs response now contains a header Content-Disposition:filename='archive.zip'
Alain Mazy <am@osimis.io>
parents:
4437
diff
changeset
|
79 std::string& filename, |
3763
5ff5d5a0fd28
adding missing ORTHANC_OVERRIDE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3658
diff
changeset
|
80 const std::string& key) ORTHANC_OVERRIDE |
2976
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
81 { |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
82 // TODO |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
83 return false; |
cb5d75143da0
Asynchronous generation of ZIP archives and DICOM medias
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2815
diff
changeset
|
84 } |
2810 | 85 }; |
86 } | |
87 | |
88 #endif |