00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "DQM/SiStripHistoricInfoClient/interface/SiStripHistoricInfoWebInterface.h"
00015
00016 #include "DQMServices/WebComponents/interface/Button.h"
00017 #include "DQMServices/WebComponents/interface/CgiWriter.h"
00018 #include "DQMServices/WebComponents/interface/CgiReader.h"
00019 #include "DQMServices/WebComponents/interface/ConfigBox.h"
00020 #include "DQMServices/WebComponents/interface/Navigator.h"
00021 #include "DQMServices/WebComponents/interface/ContentViewer.h"
00022 #include "DQMServices/WebComponents/interface/GifDisplay.h"
00023
00024
00025
00026
00027 SiStripHistoricInfoWebInterface::SiStripHistoricInfoWebInterface(std::string theContextURL, std::string theApplicationURL, DQMOldReceiver ** _mui_p)
00028 : WebInterface(theContextURL, theApplicationURL, _mui_p)
00029 {
00030
00031
00032
00033 ContentViewer * cont = new ContentViewer(getApplicationURL(), "20px", "10px");
00034
00035 Button * saveBut = new Button(getApplicationURL(), "300px", "10px", "SaveToFile", "Save To File");
00036
00037 GifDisplay * dis = new GifDisplay(getApplicationURL(), "20px","200px", "500px", "700px", "MyGifDisplay");
00038
00039 page_p = new WebPage(getApplicationURL());
00040
00041
00042 page_p->add("contentViewer", cont);
00043 page_p->add("SvButton", saveBut);
00044 page_p->add("gifDisplay", dis);
00045 }
00046
00047
00048
00049
00050
00051
00052 void SiStripHistoricInfoWebInterface::handleCustomRequest(xgi::Input * in, xgi::Output * out ) throw (xgi::exception::Exception)
00053 {
00054
00055 std::multimap<std::string, std::string> request_multimap;
00056 CgiReader reader(in);
00057 reader.read_form(request_multimap);
00058 std::string requestID = get_from_multimap(request_multimap, "RequestID");
00059
00060
00061 if (requestID == "SaveToFile") saveToFile(in, out);
00062 }
00063 void SiStripHistoricInfoWebInterface::saveToFile(xgi::Input * in, xgi::Output *out) throw (xgi::exception::Exception) {
00064 if(!getSaveToFile()){
00065 std::cout << "SiStripHistoricInfoWebInterface::saveToFile: put request for saving Monitoring Elements in file." << std::endl;
00066 setSaveToFile(true);
00067 }
00068 return;
00069 }
00070