Warning, /OnlMon/html/README is written in an unsupported language. File is not indexed.
0001 This is a description of the new online monitoring html output scheme.
0002
0003 As before, the html output stuff is a 2 steps process :
0004
0005 1) The OnlMonDraw children, by their MakeHtml method, produces some html and/or gif files for a given run.
0006
0007 2) A web server uses the mon.cgi script, located in this directory, to browse the html outputs. The main advantage of this script above the old scheme is that it will output a navigation menu on the left part of the browser window.
0008
0009 The "communication" between 1) and 2) is possible thanks to a certain directory structure and one file per run, named "menu" (and possibly "menu.html" for browser w/o JavaScript). The top directory is specified through the environment variable ONLMON_HTMLDIR (note that ONLMON_HTMLSUBDIR is no longer used).
0010
0011 runtype
0012 |
0013 +--run_XXXXXXXXXX_YYYYYYYYYY
0014 |
0015 +---AAAAA
0016 | |
0017 | +--menu
0018 | +--menu.html
0019 | +--every other html or gif files for run AAAAA.
0020 |
0021 +---BBBBB
0022
0023 where runtype=eventdata or calibdata or junkdata or unknowndata
0024
0025 XXXXXXXXX and YYY... are 10 digits (padded with 0 in the front) run numbers.
0026
0027 Both the menu and menu.html (which is only used if JavaScript is not
0028 available on a browser) are generated by the online monitoring stuff
0029 (see OnlMonDraw::MakeHTML and OnlMonClient::htmlXXX methods)
0030
0031 The "menu" file has the following structure :
0032
0033 SUBSYSTEM/SUBDIR/SUBSUBDIR/TITLE/link
0034
0035 Any level of subdir is possible (but should be reasonably low to
0036 fit on screen ;-) ).
0037 As an example, the following "menu" file :
0038
0039 DAQMON/Monitor/DAQMON_92444.gif
0040 DAQMON/PacketSummary/DAQMON_PacketSummary_92444.html
0041 DAQMON/Status/BBC/DAQMON_BBC_92444.gif
0042 DAQMON/Status/DCHEAST/DAQMON_DCHEAST_92444.gif
0043 DAQMON/Status/DCHWEST/DAQMON_DCHWEST_92444.gif
0044
0045 will produce on screen a tree menu as :
0046
0047 DAQMON
0048 |
0049 +--Monitor
0050 +--PacketSummary
0051 +--Status
0052 |
0053 +--BBC
0054 +--DCHEAST
0055 +--DCHWEST
0056
0057 and a click on e.g. DAQMON/Monitor will show DAQMON_92444.gif file on the
0058 right part of the browser window.
0059
0060 This "menu" file is created by the OnlMonDraw::MakeHtml methods, in the following way (see subsystems/Example/MyMonDraw.C).
0061
0062 Assume the MyMonDraw class (deriving from OnlMonDraw) has 2 canvases, TC[0] and TC[1]. Each one will be output as a gif file. Also, some expert html pages, log and status will be produced. One would like to have the following navigation menu for those (*)
0063
0064 MYMON
0065 |
0066 +--First Canvas
0067 +--Second Canvas
0068 +--For EXPERTS
0069 |
0070 +--Log
0071 +--Status
0072
0073 The way to do it is to use the OnlMonClient::htmlRegisterPage method.
0074
0075 int MyMonDraw::MakeHtml(const char *what)
0076 {
0077 int iret = Draw(what);
0078 if (iret) // on error no html output please
0079 {
0080 return iret;
0081 }
0082
0083 OnlMonClient *cl = OnlMonClient::instance();
0084
0085 string giffile = cl->htmlRegisterPage(*this,"First Canvas","1","gif");
0086 // This will append the line
0087 // MYMON/First Canvas/MYMON_1_#####.gif (where ##### is the run number)
0088 // to the menu file in the directory for the current run,
0089 // AND will return the full path (in giffile) to the gif file.
0090 // The creation of the gif file itself is left to you :
0091 TC[0]->Print(giffile.c_str());
0092
0093 // idem for TC[1] ...
0094
0095 // Same story for experts html pages for instance :
0096 string logfile = cl->htmlRegisterPage(*this,"For EXPERTS/Log","log","html");
0097 // Will append to menu file :
0098 // MYMON/For EXPERTS/Log/MYMON_log_#####.html
0099 // and then you have to create the html file itself:
0100 ofstream out(logfile.c_str());
0101 out << "<HTML>bla bla</HTML>" << endl;
0102 out.close();
0103
0104 // idem for status html page...
0105 }
0106
0107 At the end of this method execution for e.g. run 92252, the menu file will (at least) contain the lines :
0108
0109 MYMON/First Canvas/MYMON_1_92252.gif
0110 MYMON/For EXPERTS/Log/MYMON_log_92252.html
0111 MYMON/For EXPERTS/Status/MYMON_status_92252.html
0112 MYMON/Second Canvas/MYMON_2_92252.gif
0113
0114 which will be used by the mon.cgi script to produced the desired menu above (*)
0115
0116 Note that you may want to get the full path to a file that you don't want to register to the menu. Then you'll simply have to use the OnlMonClient::htmlNamer method.
0117
0118 Enjoy !
0119
0120 L. Aphecetche
0121 November 2003
0122 aphecetc@in2p3.fr