CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/EventFilter/Utilities/src/ModuleWeb.cc

Go to the documentation of this file.
00001 #include "EventFilter/Utilities/interface/ModuleWeb.h"
00002 #include "EventFilter/Utilities/interface/ModuleWebRegistry.h"
00003 #include "FWCore/ServiceRegistry/interface/Service.h"
00004 
00005 #include "xgi/Input.h"
00006 #include "xgi/Output.h"
00007 #include "xgi/Utils.h"
00008 
00009 #include <string>
00010 
00011 
00012 namespace evf{
00013 
00014 
00015 ModuleWeb::ModuleWeb(const std::string &moduleName) : moduleName_(moduleName)
00016 {
00017   if(edm::Service<ModuleWebRegistry>())
00018     edm::Service<ModuleWebRegistry>()->registerWeb(moduleName_, this);
00019 }
00020 
00021 void ModuleWeb::publishForkInfo(moduleweb::ForkInfoObj * forkInfoObj)
00022 {
00023   return;
00024 }
00025 
00026 
00027 void ModuleWeb::defaultWebPage(xgi::Input *in, xgi::Output *out)
00028 {
00029   using std::endl;
00030   std::string path;
00031   std::string urn;
00032   std::string mname;
00033   try 
00034     {
00035       cgicc::Cgicc cgi(in);
00036       if ( xgi::Utils::hasFormElement(cgi,"module") )
00037         mname = xgi::Utils::getFormElement(cgi, "module")->getValue();
00038       cgicc::CgiEnvironment cgie(in);
00039       urn = cgie.getReferrer();
00040       path = cgie.getPathInfo() + "?" + cgie.getQueryString();
00041       
00042     }
00043   catch (const std::exception & e) 
00044     {
00045       // don't care if it did not work
00046     }
00047   
00048 
00049   *out << "<html>"                                                   << endl;
00050   *out << "<head>"                                                   << endl;
00051 
00052   *out << "<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> "
00053        << endl; 
00054   *out << "<link type=\"text/css\" rel=\"stylesheet\"";
00055   *out << " href=\"/" <<  urn
00056        << "/styles.css\"/>"                   << endl;
00057 
00058   *out << "<title>" << moduleName_
00059        << " MAIN</title>"                                            << endl;
00060 
00061   *out << "</head>"                                                  << endl;
00062   *out << "<body onload=\"loadXMLDoc()\">"                           << endl;
00063   *out << "<table border=\"0\" width=\"100%\">"                      << endl;
00064   *out << "<tr>"                                                     << endl;
00065   *out << "  <td align=\"left\">"                                    << endl;
00066   *out << "    <img"                                                 << endl;
00067   *out << "     align=\"middle\""                                    << endl;
00068   *out << "     src=\"/evf/images/epicon.jpg\""                      << endl;
00069   *out << "     alt=\"main\""                                        << endl;
00070   *out << "     width=\"64\""                                        << endl;
00071   *out << "     height=\"64\""                                       << endl;
00072   *out << "     border=\"\"/>"                                       << endl;
00073   *out << "    <b>"                                                  << endl;
00074   *out << "<title>" << moduleName_
00075        << " MAIN</title>"                                            << endl;
00076   *out << "    </b>"                                                 << endl;
00077   *out << "  </td>"                                                  << endl;
00078   *out << "  <td width=\"32\">"                                      << endl;
00079   *out << "    <a href=\"/urn:xdaq-application:lid=3\">"             << endl;
00080   *out << "      <img"                                               << endl;
00081   *out << "       align=\"middle\""                                  << endl;
00082   *out << "       src=\"/hyperdaq/images/HyperDAQ.jpg\""             << endl;
00083   *out << "       alt=\"HyperDAQ\""                                  << endl;
00084   *out << "       width=\"32\""                                      << endl;
00085   *out << "       height=\"32\""                                     << endl;
00086   *out << "       border=\"\"/>"                                     << endl;
00087   *out << "    </a>"                                                 << endl;
00088   *out << "  </td>"                                                  << endl;
00089   *out << "  <td width=\"32\">"                                      << endl;
00090   *out << "  </td>"                                                  << endl;
00091   *out << "  <td width=\"32\">"                                      << endl;
00092   *out << "    <a href=\"/" << urn 
00093        << "\">"                                                      << endl;
00094   *out << "      <img"                                               << endl;
00095   *out << "       align=\"middle\""                                  << endl;
00096   *out << "       src=\"/evf/images/epicon.jpg\""                    << endl;
00097   *out << "       alt=\"main\""                                      << endl;
00098   *out << "       width=\"32\""                                      << endl;
00099   *out << "       height=\"32\""                                     << endl;
00100   *out << "       border=\"\"/>"                                     << endl;
00101   *out << "    </a>"                                                 << endl;
00102   *out << "  </td>"                                                  << endl;
00103   *out << "</tr>"                                                    << endl;
00104   *out << "</table>"                                                 << endl;
00105 
00106   *out << "<hr/>"                                                    << endl;
00107 
00108   *out << "</body>"                                                  << endl;
00109   *out << "</html>"                                                  << endl;
00110 }
00111 } //end namespace evf