# HG changeset patch # User Sebastien Jodogne # Date 1618843515 -7200 # Node ID 793bbbe11287383a59294f9a5b886c6a9041e64f # Parent 93a6efd7d8e5cab245d6e9a5888204ce83325c2f IDatabaseBackend::HasRevisionsSupport() diff -r 93a6efd7d8e5 -r 793bbbe11287 Framework/Plugins/DatabaseBackendAdapterV3.cpp --- a/Framework/Plugins/DatabaseBackendAdapterV3.cpp Fri Apr 16 17:49:29 2021 +0200 +++ b/Framework/Plugins/DatabaseBackendAdapterV3.cpp Mon Apr 19 16:45:15 2021 +0200 @@ -24,8 +24,8 @@ #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in Orthanc 1.3.1 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 2) +#include #include - #include #include @@ -2061,6 +2061,15 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Unable to register the database backend"); } + if (backend->HasRevisionsSupport()) + { + LOG(INFO) << "The database backend *has* support for revisions of metadata and attachments"; + } + else + { + LOG(WARNING) << "The database backend has *no* support for revisions of metadata and attachments"; + } + backend->SetOutputFactory(new Factory); isBackendInUse_ = true; diff -r 93a6efd7d8e5 -r 793bbbe11287 Framework/Plugins/IDatabaseBackend.h --- a/Framework/Plugins/IDatabaseBackend.h Fri Apr 16 17:49:29 2021 +0200 +++ b/Framework/Plugins/IDatabaseBackend.h Mon Apr 19 16:45:15 2021 +0200 @@ -48,6 +48,8 @@ virtual IDatabaseBackendOutput* CreateOutput() = 0; + virtual bool HasRevisionsSupport() const = 0; + virtual void AddAttachment(DatabaseManager& manager, int64_t id, const OrthancPluginAttachment& attachment) = 0; diff -r 93a6efd7d8e5 -r 793bbbe11287 Framework/Plugins/PluginInitialization.cpp --- a/Framework/Plugins/PluginInitialization.cpp Fri Apr 16 17:49:29 2021 +0200 +++ b/Framework/Plugins/PluginInitialization.cpp Mon Apr 19 16:45:15 2021 +0200 @@ -50,7 +50,8 @@ #else Orthanc::Logging::Initialize(context); #endif - + + Orthanc::Logging::EnableInfoLevel(true); OrthancPlugins::SetGlobalContext(context); ImplicitTransaction::SetErrorOnDoubleExecution(false); diff -r 93a6efd7d8e5 -r 793bbbe11287 MySQL/Plugins/MySQLIndex.h --- a/MySQL/Plugins/MySQLIndex.h Fri Apr 16 17:49:29 2021 +0200 +++ b/MySQL/Plugins/MySQLIndex.h Mon Apr 19 16:45:15 2021 +0200 @@ -45,6 +45,11 @@ virtual void ConfigureDatabase(DatabaseManager& database) ORTHANC_OVERRIDE; + virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE + { + return false; // TODO - REVISIONS + } + virtual int64_t CreateResource(DatabaseManager& manager, const char* publicId, OrthancPluginResourceType type) diff -r 93a6efd7d8e5 -r 793bbbe11287 PostgreSQL/Plugins/PostgreSQLIndex.h --- a/PostgreSQL/Plugins/PostgreSQLIndex.h Fri Apr 16 17:49:29 2021 +0200 +++ b/PostgreSQL/Plugins/PostgreSQLIndex.h Mon Apr 19 16:45:15 2021 +0200 @@ -45,6 +45,11 @@ virtual void ConfigureDatabase(DatabaseManager& manager) ORTHANC_OVERRIDE; + virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE + { + return false; // TODO - REVISIONS + } + virtual int64_t CreateResource(DatabaseManager& manager, const char* publicId, OrthancPluginResourceType type) diff -r 93a6efd7d8e5 -r 793bbbe11287 SQLite/Plugins/SQLiteIndex.h --- a/SQLite/Plugins/SQLiteIndex.h Fri Apr 16 17:49:29 2021 +0200 +++ b/SQLite/Plugins/SQLiteIndex.h Mon Apr 19 16:45:15 2021 +0200 @@ -46,6 +46,11 @@ virtual void ConfigureDatabase(DatabaseManager& manager) ORTHANC_OVERRIDE; + virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE + { + return true; + } + virtual int64_t CreateResource(DatabaseManager& manager, const char* publicId, OrthancPluginResourceType type) ORTHANC_OVERRIDE;