CMS 3D CMS Logo

SiStripHistoricInfoWebInterface.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     SiStripHistoricInfoClient
00004 // Class  :     SiStripHistoricInfoWebInterface
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  
00010 //         Created:  Thu Jun 15 09:40:22 CEST 2006
00011 // $Id: SiStripHistoricInfoWebInterface.cc,v 1.3 2008/03/02 00:07:43 dutta Exp $
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   Create your widgets in the constructor of your web interface
00026 */
00027 SiStripHistoricInfoWebInterface::SiStripHistoricInfoWebInterface(std::string theContextURL, std::string theApplicationURL, DQMOldReceiver ** _mui_p)
00028   : WebInterface(theContextURL, theApplicationURL, _mui_p)
00029 {
00030   // a navigator allows you to make subscriptions:
00031 //  Navigator * nav = new Navigator(getApplicationURL(), "20px", "10px");
00032   // a content viewer allows you to select ME's to draw:
00033   ContentViewer * cont = new ContentViewer(getApplicationURL(), "20px", "10px");
00034   //
00035   Button * saveBut = new Button(getApplicationURL(), "300px", "10px", "SaveToFile", "Save To File");
00036   // two inline frames that display plots:
00037   GifDisplay * dis = new GifDisplay(getApplicationURL(), "20px","200px", "500px", "700px", "MyGifDisplay");
00038   // every web interface needs to instantiate a WebPage...
00039   page_p = new WebPage(getApplicationURL());
00040   // ...and add its widgets to it:
00041 //  page_p->add("navigator", nav); // maybe this client does not need a navigator
00042   page_p->add("contentViewer", cont);
00043   page_p->add("SvButton", saveBut);
00044   page_p->add("gifDisplay", dis);
00045 }
00046 
00047 /*
00048   Only implement the handleCustomRequest function if you have widgets that invoke 
00049   custom-made methods defined in your client. In this example we have created a 
00050   Button that makes custom requests, therefore we need to implement it.
00051 */
00052 void SiStripHistoricInfoWebInterface::handleCustomRequest(xgi::Input * in, xgi::Output * out ) throw (xgi::exception::Exception)
00053 {
00054   // this is the way to get the string that identifies the request:
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   // if you have more than one custom requests, add 'if' statements accordingly:
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()){ // set to true if not already true
00065     std::cout << "SiStripHistoricInfoWebInterface::saveToFile: put request for saving Monitoring Elements in file." << std::endl;
00066      setSaveToFile(true);
00067   }
00068   return;
00069 }
00070 

Generated on Tue Jun 9 17:33:34 2009 for CMSSW by  doxygen 1.5.4