comparison OrthancServer/OrthancRestApi/OrthancRestSystem.cpp @ 1597:415dfd1d1c61

Improvements to the sample "ServeFolders" plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Aug 2015 13:47:23 +0200
parents f967bdf8534e
children ffd23c0104af
comparison
equal deleted inserted replaced
1596:f2e3d030ea59 1597:415dfd1d1c61
165 165
166 const OrthancPlugins& plugins = OrthancRestApi::GetContext(call).GetPlugins(); 166 const OrthancPlugins& plugins = OrthancRestApi::GetContext(call).GetPlugins();
167 const char *c = plugins.GetProperty(id.c_str(), _OrthancPluginProperty_RootUri); 167 const char *c = plugins.GetProperty(id.c_str(), _OrthancPluginProperty_RootUri);
168 if (c != NULL) 168 if (c != NULL)
169 { 169 {
170 v["RootUri"] = c; 170 std::string root = c;
171 if (!root.empty())
172 {
173 // Turn the root URI into a URI relative to "/app/explorer.js"
174 if (root[0] == '/')
175 {
176 root = ".." + root;
177 }
178
179 v["RootUri"] = root;
180 }
171 } 181 }
172 182
173 c = plugins.GetProperty(id.c_str(), _OrthancPluginProperty_Description); 183 c = plugins.GetProperty(id.c_str(), _OrthancPluginProperty_Description);
174 if (c != NULL) 184 if (c != NULL)
175 { 185 {