comparison OrthancServer/Sources/OrthancWebDav.h @ 4242:5cfa6ba75dfc

deleting resources from Orthanc WebDAV
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Oct 2020 17:51:06 +0200
parents 799c0c527ced
children 64f57c9d5f79
comparison
equal deleted inserted replaced
4241:3510da0e260c 4242:5cfa6ba75dfc
45 class OrthancWebDav : public IWebDavBucket 45 class OrthancWebDav : public IWebDavBucket
46 { 46 {
47 private: 47 private:
48 typedef std::map<ResourceType, std::string> Templates; 48 typedef std::map<ResourceType, std::string> Templates;
49 49
50 class DicomDeleteVisitor;
51 class DicomFileVisitor;
50 class DicomIdentifiersVisitor; 52 class DicomIdentifiersVisitor;
51 class DicomFileVisitor;
52 class OrthancJsonVisitor;
53 class InstancesOfSeries; 53 class InstancesOfSeries;
54 class InternalNode; 54 class InternalNode;
55 class ListOfResources; 55 class ListOfResources;
56 class ListOfStudiesByDate; 56 class ListOfStudiesByDate;
57 class ListOfStudiesByMonth; 57 class ListOfStudiesByMonth;
58 class ListOfStudiesByYear; 58 class ListOfStudiesByYear;
59 class OrthancJsonVisitor;
59 class ResourcesIndex; 60 class ResourcesIndex;
60 class RootNode; 61 class RootNode;
61 class SingleDicomResource; 62 class SingleDicomResource;
62 63
63 class INode : public boost::noncopyable 64 class INode : public boost::noncopyable
64 { 65 {
65 public: 66 public:
66 virtual ~INode() 67 virtual ~INode()
67 { 68 {
72 73
73 virtual bool GetFileContent(MimeType& mime, 74 virtual bool GetFileContent(MimeType& mime,
74 std::string& content, 75 std::string& content,
75 boost::posix_time::ptime& time, 76 boost::posix_time::ptime& time,
76 const UriComponents& path) = 0; 77 const UriComponents& path) = 0;
78
79 virtual bool DeleteItem(const UriComponents& path) = 0;
77 }; 80 };
78 81
79 82
80 void AddVirtualFile(Collection& collection, 83 void AddVirtualFile(Collection& collection,
81 const UriComponents& path, 84 const UriComponents& path,
82 const std::string& filename); 85 const std::string& filename);
83 86
84 static void UploadWorker(OrthancWebDav* that); 87 static void UploadWorker(OrthancWebDav* that);
85 88
86 void Upload(const std::string& path); 89 void Upload(const std::string& path);
90
91 INode& GetRootNode(const std::string& rootPath);
87 92
88 ServerContext& context_; 93 ServerContext& context_;
94 bool allowDicomDelete_;
89 std::unique_ptr<INode> patients_; 95 std::unique_ptr<INode> patients_;
90 std::unique_ptr<INode> studies_; 96 std::unique_ptr<INode> studies_;
91 std::unique_ptr<INode> dates_; 97 std::unique_ptr<INode> dates_;
92 Templates patientsTemplates_; 98 Templates patientsTemplates_;
93 Templates studiesTemplates_; 99 Templates studiesTemplates_;
95 SharedMessageQueue uploadQueue_; 101 SharedMessageQueue uploadQueue_;
96 boost::thread uploadThread_; 102 boost::thread uploadThread_;
97 bool running_; 103 bool running_;
98 104
99 public: 105 public:
100 OrthancWebDav(ServerContext& context); 106 OrthancWebDav(ServerContext& context,
107 bool allowDicomDelete);
101 108
102 virtual ~OrthancWebDav() 109 virtual ~OrthancWebDav()
103 { 110 {
104 Stop(); 111 Stop();
105 } 112 }