# HG changeset patch # User amazy # Date 1520538147 -3600 # Node ID 544732bbd87b4f7cabeec30df285d0e050e2fc5d # Parent a2e3e7cd380e74e0ae75ecd85eda055c8e0a73ff added support for Osimis Web Viewer diff -r a2e3e7cd380e -r 544732bbd87b Plugin/DefaultAuthorizationParser.cpp --- a/Plugin/DefaultAuthorizationParser.cpp Mon Sep 11 14:32:58 2017 +0200 +++ b/Plugin/DefaultAuthorizationParser.cpp Thu Mar 08 20:42:27 2018 +0100 @@ -28,7 +28,10 @@ AuthorizationParserBase(context, factory), resourcesPattern_("^/(patients|studies|series|instances)/([a-f0-9-]+)(|/.*)$"), seriesPattern_("^/(web-viewer/series|web-viewer/is-stable-series|wsi/pyramids|wsi/tiles)/([a-f0-9-]+)(|/.*)$"), - instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$") + instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$"), + osimisViewerSeries_("^/osimis-viewer/series/([a-f0-9-]+)(|/.*)$"), + osimisViewerImages_("^/osimis-viewer/images/([a-f0-9-]+)(|/.*)$"), + osimisViewerStudies_("^/osimis-viewer/studies/([a-f0-9-]+)(|/.*)$") { std::string tmp = dicomWebRoot; while (!tmp.empty() && @@ -110,6 +113,21 @@ AddDicomInstance(target, what[1], what[2], what[3]); return true; } + else if (boost::regex_match(uri, what, osimisViewerSeries_)) + { + AddOrthancSeries(target, what[1]); + return true; + } + else if (boost::regex_match(uri, what, osimisViewerStudies_)) + { + AddOrthancStudy(target, what[1]); + return true; + } + else if (boost::regex_match(uri, what, osimisViewerImages_)) + { + AddOrthancInstance(target, what[1]); + return true; + } else { // Unknown type of resource: Consider it as a system access diff -r a2e3e7cd380e -r 544732bbd87b Plugin/DefaultAuthorizationParser.h --- a/Plugin/DefaultAuthorizationParser.h Mon Sep 11 14:32:58 2017 +0200 +++ b/Plugin/DefaultAuthorizationParser.h Thu Mar 08 20:42:27 2018 +0100 @@ -36,6 +36,10 @@ boost::regex dicomWebSeries_; boost::regex dicomWebInstances_; + boost::regex osimisViewerSeries_; + boost::regex osimisViewerImages_; + boost::regex osimisViewerStudies_; + public: DefaultAuthorizationParser(OrthancPluginContext* context, ICacheFactory& factory,