14 std::cout <<
"created a WebInterface for the DQMClient, the url = " <<
appURL << std::endl;
23 std::multimap<std::string, std::string>::iterator it;
25 if (it != mymap.end())
34 handleStandardRequest(
in,
out);
35 handleCustomRequest(
in,
out);
38 if (msg_dispatcher.hasAnyMessages()) msg_dispatcher.dispatchMessages(
out);
46 page_p->printHTML(
out);
57 std::multimap<std::string, std::string> request_multimap;
64 if (requestID ==
"Configure") Configure(
in,
out);
65 if (requestID ==
"Open") Open(
in,
out);
68 if (requestID ==
"ContentsOpen") ContentsOpen(
in,
out);
69 if (requestID ==
"Draw") DrawGif(
in,
out);
85 std::multimap<std::string, std::string> nav_map;
103 to_open = current +
"/" + to_open;
109 std::cout <<
"will try to open " << to_open << std::endl;
112 if (to_open ==
"top")
114 dqmStore_->setCurrentFolder(
"/");
116 else if (to_open ==
"..")
122 dqmStore_->setCurrentFolder(to_open);
124 printNavigatorXML(dqmStore_->pwd(),
out);
128 std::cout <<
"no DQMStore object, subscription to " << to_open <<
" failed!" << std::endl;
141 out->getHTTPResponseHeader().addHeader(
"Content-Type",
"text/xml");
143 *out <<
"<?xml version=\"1.0\" ?>" << std::endl;
145 *out <<
"<navigator>" << std::endl;
147 *out <<
"<current>" << current <<
"</current>" << std::endl;
151 std::list<std::string>::iterator it;
153 std::list<std::string> open_l;
155 for (it = open_l.begin(); it != open_l.end(); it++)
156 *out <<
"<open>" << *it <<
"</open>" << std::endl;
158 std::list<std::string> subscribe_l;
159 reader.
give_files(current, subscribe_l,
false);
160 for (it = subscribe_l.begin(); it != subscribe_l.end(); it++)
161 *out <<
"<subscribe>" << *it <<
"</subscribe>" << std::endl;
163 std::list<std::string> unsubscribe_l;
164 reader.
give_files(current, unsubscribe_l,
true);
165 for (it = unsubscribe_l.begin(); it != unsubscribe_l.end(); it++)
166 *out <<
"<unsubscribe>" << *it <<
"</unsubscribe>" << std::endl;
168 *out <<
"</navigator>" << std::endl;
171 std::cout <<
"<?xml version=\"1.0\" ?>" << std::endl;
175 std::cout <<
"<current>" << current <<
"</current>" << std::endl;
177 for (it = open_l.begin(); it != open_l.end(); it++)
178 std::cout <<
"<open>" << *it <<
"</open>" << std::endl;
180 for (it = subscribe_l.begin(); it != subscribe_l.end(); it++)
181 std::cout <<
"<subscribe>" << *it <<
"</subscribe>" << std::endl;
183 for (it = unsubscribe_l.begin(); it != unsubscribe_l.end(); it++)
184 std::cout <<
"<unsubscribe>" << *it <<
"</unsubscribe>" << std::endl;
186 std::cout <<
"</navigator>" << std::endl;
192 std::multimap<std::string, std::string> nav_map;
201 if (to_open !=
"top")
204 if (current !=
"top")
210 to_open = current +
"/" + to_open;
216 std::cout <<
"will try to open " << to_open << std::endl;
219 if (to_open ==
"top")
223 else if (to_open ==
"..")
229 dqmStore_->setCurrentFolder(to_open);
231 printContentViewerXML(dqmStore_->pwd(),
out);
235 std::cout <<
"no DQMStore object, subscription to " << to_open <<
" failed!" << std::endl;
247 out->getHTTPResponseHeader().addHeader(
"Content-Type",
"text/xml");
249 *out <<
"<?xml version=\"1.0\" ?>" << std::endl;
251 *out <<
"<contentViewer>" << std::endl;
253 *out <<
"<current>" << current <<
"</current>" << std::endl;
257 std::list<std::string>::iterator it;
259 std::list<std::string> open_l;
261 for (it = open_l.begin(); it != open_l.end(); it++)
262 *out <<
"<open>" << *it <<
"</open>" << std::endl;
264 std::list<std::string> view_l;
266 for (it = view_l.begin(); it != view_l.end(); it++)
267 *out <<
"<view>" << *it <<
"</view>" << std::endl;
269 *out <<
"</contentViewer>" << std::endl;
275 std::multimap<std::string, std::string> view_multimap;
286 std::cout <<
"The DQMStore pointer is empty!" << std::endl;
291 std::multimap<std::string,std::string>::iterator lower = view_multimap.lower_bound(
"View");
292 std::multimap<std::string,std::string>::iterator
upper = view_multimap.upper_bound(
"View");
293 std::multimap<std::string,std::string>::iterator it;
294 for (it = lower; it !=
upper; it++)
296 std::string
name = it->second;
300 view_map.
add(name, pointer);
301 std::cout <<
"ADDING " << name <<
" TO view_map!!!" << std::endl;
307 std::cout <<
"will try to print " <<
id << std::endl;
310 out->getHTTPResponseHeader().addHeader(
"Content-Type",
"text/xml");
311 *
out <<
"<?xml version=\"1.0\" ?>" << std::endl;
312 *
out <<
"<fileURL>" << std::endl;
313 *
out << getContextURL() +
"/temporary/" +
id +
".gif" << std::endl;
314 *
out <<
"</fileURL>" << std::endl;
void printContentViewerXML(std::string current, xgi::Output *out)
std::string get_from_multimap(std::multimap< string, string > &mymap, std::string key)
void give_files(std::string dir, std::list< std::string > &files, bool only_contents)
void print(std::string name)
print the map into a gif named "name"
virtual void Default(xgi::Input *in, xgi::Output *out)
Answers requests by sending the webpage of the application.
void add(std::string name, MonitorElement *me_p)
add the ME named "name" to the map
void Open(xgi::Input *in, xgi::Output *out)
Answer navigator requests.
void add(std::string, WebElement *)
void sendMessage(std::string the_title, std::string the_text, MessageType the_type)
Adds messages to the message dispatcher.
void DrawGif(xgi::Input *in, xgi::Output *out)
Answers viewer requests.
void read_form(std::multimap< std::string, std::string > &form_info)
MonitorElement * give_ME(std::string filename)
void add(Message *new_message)
WebInterface(std::string _exeURL, std::string _appURL)
void printMap(ME_MAP view_map, std::string id)
void give_subdirs(std::string dir, std::list< std::string > &subdirs, std::string mode)
std::string get_from_multimap(std::multimap< std::string, std::string > &mymap, std::string key)
void handleStandardRequest(xgi::Input *in, xgi::Output *out)
void Configure(xgi::Input *in, xgi::Output *out)
Answers connection configuration requests.
void add(std::string, WebElement *)
Adds widgets to the page.
void printNavigatorXML(std::string directory, xgi::Output *out)
Outputs the subdirectories and files of "directory". Called by any of the above three.
void handleRequest(xgi::Input *in, xgi::Output *out)
void ContentsOpen(xgi::Input *in, xgi::Output *out)
Answers ContentViewer requests.
MessageDispatcher msg_dispatcher