Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.cpp @ 1232:f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Dec 2014 17:04:40 +0100 |
parents | 1169528a9a5f |
children | 32fcc5dc7562 |
comparison
equal
deleted
inserted
replaced
1231:703fcd797186 | 1232:f1c01451a8ee |
---|---|
75 index_(*this, indexPath.string()), | 75 index_(*this, indexPath.string()), |
76 compressionEnabled_(false), | 76 compressionEnabled_(false), |
77 provider_(*this), | 77 provider_(*this), |
78 dicomCache_(provider_, DICOM_CACHE_SIZE), | 78 dicomCache_(provider_, DICOM_CACHE_SIZE), |
79 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)), | 79 scheduler_(Configuration::GetGlobalIntegerParameter("LimitJobs", 10)), |
80 plugins_(NULL) | 80 plugins_(NULL), |
81 pluginsManager_(NULL) | |
81 { | 82 { |
82 scu_.SetLocalApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); | 83 scu_.SetLocalApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); |
83 //scu_.SetMillisecondsBeforeClose(1); // The connection is always released | 84 //scu_.SetMillisecondsBeforeClose(1); // The connection is always released |
84 | 85 |
85 lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX); | 86 lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX); |
534 { | 535 { |
535 LOG(ERROR) << "Error in OnChangeCallback (plugins): " << e.What(); | 536 LOG(ERROR) << "Error in OnChangeCallback (plugins): " << e.What(); |
536 } | 537 } |
537 } | 538 } |
538 } | 539 } |
540 | |
541 | |
542 bool ServerContext::HasPlugins() const | |
543 { | |
544 return (pluginsManager_ && plugins_); | |
545 } | |
546 | |
547 | |
548 const PluginsManager& ServerContext::GetPluginsManager() const | |
549 { | |
550 if (HasPlugins()) | |
551 { | |
552 return *pluginsManager_; | |
553 } | |
554 else | |
555 { | |
556 throw OrthancException(ErrorCode_InternalError); | |
557 } | |
558 } | |
559 | |
560 | |
561 const OrthancPlugins& ServerContext::GetOrthancPlugins() const | |
562 { | |
563 if (HasPlugins()) | |
564 { | |
565 return *plugins_; | |
566 } | |
567 else | |
568 { | |
569 throw OrthancException(ErrorCode_InternalError); | |
570 } | |
571 } | |
539 } | 572 } |