changeset 3092:fc57988dbfd8 db-changes

new extension for database plugin SDK: getChildrenMetadata
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 05 Jan 2019 15:50:55 +0100
parents 476cba12c2b0
children 2e1808b6146a
files Plugins/Engine/OrthancPluginDatabase.cpp Plugins/Include/orthanc/OrthancCDatabasePlugin.h
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPluginDatabase.cpp	Sat Jan 05 15:08:53 2019 +0100
+++ b/Plugins/Engine/OrthancPluginDatabase.cpp	Sat Jan 05 15:50:55 2019 +0100
@@ -1313,7 +1313,16 @@
                                                   int64_t resourceId,
                                                   MetadataType metadata)
   {
-    // TODO
-    IGetChildrenMetadata::Apply(*this, target, resourceId, metadata);
+    if (extensions_.getChildrenMetadata == NULL)
+    {
+      IGetChildrenMetadata::Apply(*this, target, resourceId, metadata);
+    }
+    else
+    {
+      ResetAnswers();
+      CheckSuccess(extensions_.getChildrenMetadata
+                   (GetContext(), payload_, resourceId, static_cast<int32_t>(metadata)));
+      ForwardAnswers(target);
+    }
   }
 }
--- a/Plugins/Include/orthanc/OrthancCDatabasePlugin.h	Sat Jan 05 15:08:53 2019 +0100
+++ b/Plugins/Include/orthanc/OrthancCDatabasePlugin.h	Sat Jan 05 15:50:55 2019 +0100
@@ -795,6 +795,15 @@
       uint32_t countMetadata,
       const OrthancPluginResourcesContentMetadata* metadata);
 
+    /* Ouput: Use OrthancPluginDatabaseAnswerString */
+    OrthancPluginErrorCode  (*getChildrenMetadata) (
+      /* outputs */
+      OrthancPluginDatabaseContext* context,
+      /* inputs */
+      void* payload,
+      int64_t resourceId,
+      int32_t metadata);
+
   } OrthancPluginDatabaseExtensions;
 
 /*<! @endcond */