changeset 1272:7442097b41c9

Scan of folders for plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Jan 2015 17:42:29 +0100
parents 83d8b3eacf49
children 88010d8e12cf
files NEWS Plugins/Engine/PluginsManager.cpp Resources/Configuration.json
diffstat 3 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Jan 09 17:23:02 2015 +0100
+++ b/NEWS	Mon Jan 12 17:42:29 2015 +0100
@@ -1,12 +1,20 @@
 Pending changes in the mainline
 ===============================
 
+General
+-------
+
+* Instances without PatientID are now allowed
+* Support of Tudor DICOM in Query/Retrieve
+* Fix issue 25 (AET with underscore not allowed)
+
+Plugins
+-------
+
 * Introspection of plugins
 * Plugins can extend Orthanc Explorer with custom JavaScript
 * Plugins can get/set global properties to save their configuration
-* Instances without PatientID are now allowed
-* Support of Tudor DICOM in Query/Retrieve
-* Fix issue 25 (AET with underscore not allowed)
+* Scan of folders for plugins
 
 
 Version 0.8.5 (2014/11/04)
--- a/Plugins/Engine/PluginsManager.cpp	Fri Jan 09 17:23:02 2015 +0100
+++ b/Plugins/Engine/PluginsManager.cpp	Mon Jan 12 17:42:29 2015 +0100
@@ -226,6 +226,18 @@
   
   void PluginsManager::RegisterPlugin(const std::string& path)
   {
+    if (!boost::filesystem::exists(path))
+    {
+      LOG(ERROR) << "Inexistent path to plugins: " << path;
+      return;
+    }
+
+    if (boost::filesystem::is_directory(path))
+    {
+      ScanFolderForPlugins(path, false);
+      return;
+    }
+
     std::auto_ptr<Plugin> plugin(new Plugin(path));
 
     if (!IsOrthancPlugin(plugin->GetLibrary()))
--- a/Resources/Configuration.json	Fri Jan 09 17:23:02 2015 +0100
+++ b/Resources/Configuration.json	Mon Jan 12 17:42:29 2015 +0100
@@ -35,7 +35,9 @@
 
   // List of paths to the plugins that are to be loaded into this
   // instance of Orthanc (e.g. "./libPluginTest.so" for Linux, or
-  // "./PluginTest.dll" for Windows).
+  // "./PluginTest.dll" for Windows). These paths can refer to
+  // folders, in which case they will be scanned non-recursively to
+  // find shared libraries.
   "Plugins" : [
   ],