comparison Plugin/DefaultAuthorizationParser.cpp @ 11:544732bbd87b

added support for Osimis Web Viewer
author amazy
date Thu, 08 Mar 2018 20:42:27 +0100
parents d5d3cb00556a
children c44013681a51
comparison
equal deleted inserted replaced
10:a2e3e7cd380e 11:544732bbd87b
26 ICacheFactory& factory, 26 ICacheFactory& factory,
27 const std::string& dicomWebRoot) : 27 const std::string& dicomWebRoot) :
28 AuthorizationParserBase(context, factory), 28 AuthorizationParserBase(context, factory),
29 resourcesPattern_("^/(patients|studies|series|instances)/([a-f0-9-]+)(|/.*)$"), 29 resourcesPattern_("^/(patients|studies|series|instances)/([a-f0-9-]+)(|/.*)$"),
30 seriesPattern_("^/(web-viewer/series|web-viewer/is-stable-series|wsi/pyramids|wsi/tiles)/([a-f0-9-]+)(|/.*)$"), 30 seriesPattern_("^/(web-viewer/series|web-viewer/is-stable-series|wsi/pyramids|wsi/tiles)/([a-f0-9-]+)(|/.*)$"),
31 instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$") 31 instancesPattern_("^/web-viewer/instances/[a-z0-9]+-([a-f0-9-]+)_[0-9]+$"),
32 osimisViewerSeries_("^/osimis-viewer/series/([a-f0-9-]+)(|/.*)$"),
33 osimisViewerImages_("^/osimis-viewer/images/([a-f0-9-]+)(|/.*)$"),
34 osimisViewerStudies_("^/osimis-viewer/studies/([a-f0-9-]+)(|/.*)$")
32 { 35 {
33 std::string tmp = dicomWebRoot; 36 std::string tmp = dicomWebRoot;
34 while (!tmp.empty() && 37 while (!tmp.empty() &&
35 tmp[tmp.size() - 1] == '/') 38 tmp[tmp.size() - 1] == '/')
36 { 39 {
108 else if (boost::regex_match(uri, what, dicomWebInstances_)) 111 else if (boost::regex_match(uri, what, dicomWebInstances_))
109 { 112 {
110 AddDicomInstance(target, what[1], what[2], what[3]); 113 AddDicomInstance(target, what[1], what[2], what[3]);
111 return true; 114 return true;
112 } 115 }
116 else if (boost::regex_match(uri, what, osimisViewerSeries_))
117 {
118 AddOrthancSeries(target, what[1]);
119 return true;
120 }
121 else if (boost::regex_match(uri, what, osimisViewerStudies_))
122 {
123 AddOrthancStudy(target, what[1]);
124 return true;
125 }
126 else if (boost::regex_match(uri, what, osimisViewerImages_))
127 {
128 AddOrthancInstance(target, what[1]);
129 return true;
130 }
113 else 131 else
114 { 132 {
115 // Unknown type of resource: Consider it as a system access 133 // Unknown type of resource: Consider it as a system access
116 134
117 // Remove the trailing slashes if need be 135 // Remove the trailing slashes if need be