Mercurial > hg > orthanc
comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 4627:f7d5372b59b3 db-changes
handling revisions of attachments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 20 Apr 2021 15:11:59 +0200 |
parents | 95ffe3b6ef7c |
children | 66109d24d26e |
comparison
equal
deleted
inserted
replaced
4626:686f189a903d | 4627:f7d5372b59b3 |
---|---|
238 { | 238 { |
239 transaction_.ListAvailableAttachments(target, id); | 239 transaction_.ListAvailableAttachments(target, id); |
240 } | 240 } |
241 | 241 |
242 bool LookupAttachment(FileInfo& attachment, | 242 bool LookupAttachment(FileInfo& attachment, |
243 int64_t& revision, | |
243 int64_t id, | 244 int64_t id, |
244 FileContentType contentType) | 245 FileContentType contentType) |
245 { | 246 { |
246 return transaction_.LookupAttachment(attachment, id, contentType); | 247 return transaction_.LookupAttachment(attachment, revision, id, contentType); |
247 } | 248 } |
248 | 249 |
249 bool LookupGlobalProperty(std::string& target, | 250 bool LookupGlobalProperty(std::string& target, |
250 GlobalProperty property, | 251 GlobalProperty property, |
251 bool shared) | 252 bool shared) |
292 ReadOnlyTransaction(transaction, context) | 293 ReadOnlyTransaction(transaction, context) |
293 { | 294 { |
294 } | 295 } |
295 | 296 |
296 void AddAttachment(int64_t id, | 297 void AddAttachment(int64_t id, |
297 const FileInfo& attachment) | 298 const FileInfo& attachment, |
298 { | 299 int64_t revision) |
299 transaction_.AddAttachment(id, attachment); | 300 { |
301 transaction_.AddAttachment(id, attachment, revision); | |
300 } | 302 } |
301 | 303 |
302 void ClearChanges() | 304 void ClearChanges() |
303 { | 305 { |
304 transaction_.ClearChanges(); | 306 transaction_.ClearChanges(); |
479 /* out */ uint64_t& countStudies, | 481 /* out */ uint64_t& countStudies, |
480 /* out */ uint64_t& countSeries, | 482 /* out */ uint64_t& countSeries, |
481 /* out */ uint64_t& countInstances); | 483 /* out */ uint64_t& countInstances); |
482 | 484 |
483 bool LookupAttachment(FileInfo& attachment, | 485 bool LookupAttachment(FileInfo& attachment, |
486 int64_t& revision, | |
484 const std::string& instancePublicId, | 487 const std::string& instancePublicId, |
485 FileContentType contentType); | 488 FileContentType contentType); |
486 | 489 |
487 void GetChanges(Json::Value& target, | 490 void GetChanges(Json::Value& target, |
488 int64_t since, | 491 int64_t since, |
598 | 601 |
599 void SetGlobalProperty(GlobalProperty property, | 602 void SetGlobalProperty(GlobalProperty property, |
600 bool shared, | 603 bool shared, |
601 const std::string& value); | 604 const std::string& value); |
602 | 605 |
603 void DeleteAttachment(const std::string& publicId, | 606 bool DeleteAttachment(const std::string& publicId, |
604 FileContentType type); | 607 FileContentType type, |
608 bool hasRevision, | |
609 int64_t revision); | |
605 | 610 |
606 void LogChange(int64_t internalId, | 611 void LogChange(int64_t internalId, |
607 ChangeType changeType, | 612 ChangeType changeType, |
608 const std::string& publicId, | 613 const std::string& publicId, |
609 ResourceType level); | 614 ResourceType level); |
621 bool hasPixelDataOffset, | 626 bool hasPixelDataOffset, |
622 uint64_t pixelDataOffset, | 627 uint64_t pixelDataOffset, |
623 uint64_t maximumStorageSize, | 628 uint64_t maximumStorageSize, |
624 unsigned int maximumPatients); | 629 unsigned int maximumPatients); |
625 | 630 |
626 StoreStatus AddAttachment(const FileInfo& attachment, | 631 StoreStatus AddAttachment(int64_t& newRevision /*out*/, |
632 const FileInfo& attachment, | |
627 const std::string& publicId, | 633 const std::string& publicId, |
628 uint64_t maximumStorageSize, | 634 uint64_t maximumStorageSize, |
629 unsigned int maximumPatients); | 635 unsigned int maximumPatients, |
636 bool hasOldRevision, | |
637 int64_t oldRevision); | |
630 }; | 638 }; |
631 } | 639 } |