comparison Framework/Plugins/IndexBackend.cpp @ 577:991b9b285e1a attach-custom-data tip

fix custom-data handling
author Alain Mazy <am@orthanc.team>
date Wed, 02 Oct 2024 09:40:20 +0200
parents f18e46d7dbf8
children
comparison
equal deleted inserted replaced
576:b0533b703c2c 577:991b9b285e1a
398 assert(HasRevisionsSupport() && HasAttachmentCustomDataSupport()); // all plugins supports these features now 398 assert(HasRevisionsSupport() && HasAttachmentCustomDataSupport()); // all plugins supports these features now
399 ExecuteAddAttachment(manager, id, attachment.uuid, attachment.contentType, attachment.uncompressedSize, attachment.uncompressedHash, 399 ExecuteAddAttachment(manager, id, attachment.uuid, attachment.contentType, attachment.uncompressedSize, attachment.uncompressedHash,
400 attachment.compressionType, attachment.compressedSize, attachment.compressedHash, "", revision); 400 attachment.compressionType, attachment.compressedSize, attachment.compressedHash, "", revision);
401 } 401 }
402 402
403 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 0) 403 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 6)
404 void IndexBackend::AddAttachment2(DatabaseManager& manager, 404 void IndexBackend::AddAttachment(Orthanc::DatabasePluginMessages::TransactionResponse& response,
405 int64_t id, 405 DatabaseManager& manager,
406 const OrthancPluginAttachment2& attachment, 406 const Orthanc::DatabasePluginMessages::AddAttachment_Request& request)
407 int64_t revision)
408 { 407 {
409 assert(HasRevisionsSupport() && HasAttachmentCustomDataSupport()); // all plugins supports these features now 408 assert(HasRevisionsSupport() && HasAttachmentCustomDataSupport()); // all plugins supports these features now
410 ExecuteAddAttachment(manager, id, attachment.uuid, attachment.contentType, attachment.uncompressedSize, attachment.uncompressedHash, 409 ExecuteAddAttachment(manager,
411 attachment.compressionType, attachment.compressedSize, attachment.compressedHash, attachment.customData, revision); 410 request.id(),
411 request.attachment().uuid().c_str(),
412 request.attachment().content_type(),
413 request.attachment().uncompressed_size(),
414 request.attachment().uncompressed_hash().c_str(),
415 request.attachment().compression_type(),
416 request.attachment().compressed_size(),
417 request.attachment().compressed_hash().c_str(),
418 request.attachment().custom_data().c_str(),
419 request.revision());
412 } 420 }
413 #endif 421 #endif
422
423
424 // #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 6)
425 // void IndexBackend::AddAttachment2(DatabaseManager& manager,
426 // int64_t id,
427 // const OrthancPluginAttachment2& attachment,
428 // int64_t revision)
429 // {
430 // assert(HasRevisionsSupport() && HasAttachmentCustomDataSupport()); // all plugins supports these features now
431 // ExecuteAddAttachment(manager, id, attachment.uuid, attachment.contentType, attachment.uncompressedSize, attachment.uncompressedHash,
432 // attachment.compressionType, attachment.compressedSize, attachment.compressedHash, attachment.customData, revision);
433 // }
434 // #endif
414 435
415 void IndexBackend::AttachChild(DatabaseManager& manager, 436 void IndexBackend::AttachChild(DatabaseManager& manager,
416 int64_t parent, 437 int64_t parent,
417 int64_t child) 438 int64_t child)
418 { 439 {