Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Hal::HtmlCore Class Reference
Inheritance diagram for Hal::HtmlCore:

Public Member Functions

 HtmlCore ()
 
virtual Bool_t CanBeTableElement (TObject *obj)
 

Static Public Member Functions

static HtmlCoreInstance ()
 
static TString GetJsDiv (TString root_file, TString object_name, TString draw_opt="colz", TString draw_div_name="drawing")
 
static TString GetUrl (TString adress, TString text)
 
static TString ClickablePic (TString id_name, TObjArray *strings, Int_t width=796, Int_t height=572)
 
static TString GetLinkToHistogram (TH1 *h, Int_t no, TString path)
 
static TString GetRelativePath (TString path)
 
static TString GetHideButtonTable (TString tableName, TString text)
 
static TString GetHideButtonRow (TString listName, TString text)
 
static void FixAddress (TString &address)
 
static Bool_t IsOnline ()
 
static TString CheckBr (TString text)
 
static TString GetLastDir (TString name, Int_t cut=1)
 
static void SetOnline (Bool_t online)
 
static void SetMainDir (TString name)
 
static void SetMainDirAndExtract (TString name)
 
static void ResetMainDir ()
 
static void CopyCss (TString dir, TString css_name="table.css")
 
static void CopyJs (TString dir)
 
static TString HTMLExtract (TObject *obj, Int_t no, TString dir="")
 
static void HTMLExtractIntoTable (TObject *obj, Int_t no, HtmlTable &table, TString dir="", TString rel_dir="")
 

Detailed Description

Definition at line 23 of file HtmlCore.h.

Constructor & Destructor Documentation

◆ HtmlCore()

Hal::HtmlCore::HtmlCore ( )

default constructor, that is not used already

Definition at line 71 of file HtmlCore.cxx.

◆ ~HtmlCore()

virtual Hal::HtmlCore::~HtmlCore ( )
inlinevirtual

Definition at line 176 of file HtmlCore.h.

Member Function Documentation

◆ CanBeTableElement()

Bool_t Hal::HtmlCore::CanBeTableElement ( TObject * obj)
virtual

TODO

Parameters
obj
Returns
true of object can be table element

Definition at line 162 of file HtmlCore.cxx.

◆ CheckBr()

TString Hal::HtmlCore::CheckBr ( TString text)
static

check if text contains new line character if yes then add

 tags
Parameters
text
Returns

Definition at line 202 of file HtmlCore.cxx.

◆ ClickablePic()

TString Hal::HtmlCore::ClickablePic ( TString id_name,
TObjArray * strings,
Int_t width = 796,
Int_t height = 572 )
static

Create clickable pictures, after each clicking one picture wiil be replaced by next picture.

Parameters
id_namename of ocject (shoul be unique on each page)
strings- array with names of the pictures in TObjString objects, first object will be displayed by default
widthwidth of picture, if <=0 not used
heightheight of picture, if <=0 not used
Returns
line of code that should be included into HTML file

Definition at line 166 of file HtmlCore.cxx.

◆ CopyCss()

void Hal::HtmlCore::CopyCss ( TString dir,
TString css_name = "table.css" )
static

copy css file into specified place

Parameters
dirtarget place
css_namename of table with template, currently default value should be used

Definition at line 33 of file HtmlCore.cxx.

◆ CopyJs()

void Hal::HtmlCore::CopyJs ( TString dir)
static

copy Javascript files to given directory

Parameters
dir

Definition at line 41 of file HtmlCore.cxx.

◆ FixAddress()

void Hal::HtmlCore::FixAddress ( TString & address)
static

fix HTML adress by removing double slashes and add shlash at the end of adress if not present

Parameters
address

Definition at line 101 of file HtmlCore.cxx.

◆ GetHideButtonRow()

TString Hal::HtmlCore::GetHideButtonRow ( TString listName,
TString text )
static

returns button tag for hidding list

Parameters
listNameid of list
texttext on button
Returns

Definition at line 253 of file HtmlCore.cxx.

◆ GetHideButtonTable()

TString Hal::HtmlCore::GetHideButtonTable ( TString tableName,
TString text )
static

returns button tag for hiding table

Parameters
tableNameid of table to hide
texttext on button
Returns

Definition at line 249 of file HtmlCore.cxx.

◆ GetJsDiv()

TString Hal::HtmlCore::GetJsDiv ( TString root_file,
TString object_name,
TString draw_opt = "colz",
TString draw_div_name = "drawing" )
static
Parameters
root_filepath to root file
object_namename of displayed object (take care about ;1!)
draw_optdrawing option
draw_div_namename of div where plot will be painted (should be unique)

Definition at line 226 of file HtmlCore.cxx.

◆ GetLastDir()

TString Hal::HtmlCore::GetLastDir ( TString name,
Int_t cut = 1 )
static

Definition at line 210 of file HtmlCore.cxx.

◆ GetLinkToHistogram()

TString Hal::HtmlCore::GetLinkToHistogram ( TH1 * h,
Int_t no,
TString path )
static
Parameters
hhistogram to show
nonumber of histogram (avoid overwriting histogram)
pathpath to histogram
Returns

Definition at line 257 of file HtmlCore.cxx.

◆ GetRelativePath()

TString Hal::HtmlCore::GetRelativePath ( TString path)
static
Parameters
pathpath from "core directory" to "this directory"
Returns
relative path to "core directory"

Definition at line 184 of file HtmlCore.cxx.

◆ GetUrl()

TString Hal::HtmlCore::GetUrl ( TString adress,
TString text )
static

return URL to file

Parameters
adressadress of file
textname of URL
Returns

Definition at line 164 of file HtmlCore.cxx.

◆ HTMLExtract()

TString Hal::HtmlCore::HTMLExtract ( TObject * obj,
Int_t no,
TString dir = "" )
static

extract this object into HTML

Parameters
objobject to export
no(used to numbering directories to avoid name conflicts)
dirdirectory where object should be extracted
Returns
value or Url to html with report

Definition at line 282 of file HtmlCore.cxx.

◆ HTMLExtractIntoTable()

void Hal::HtmlCore::HTMLExtractIntoTable ( TObject * obj,
Int_t no,
HtmlTable & table,
TString dir = "",
TString rel_dir = "" )
static

extract this object into html table table, currently this function is not used

Parameters
objobject to extract
noobject number
tabletable to extract this object
dirdirectory to extract the strucuture of object
rel_dirrelative path from this to dir

TODO if (dynamic_cast<TList*>(obj)) { TList* list = static_cast<TList*>(obj); HalHtmlRow row; row.SetClass(HalHtmlTableRowStyles::DefStyle()); HalHtmlCell cell1(Form("%i", no)); cell1.SetColSpan(2); row.AddContent(cell1); row.AddContent(HalHtmlCell("TList")); row.AddContent(HalHtmlCell(list->GetName())); TString rowButton = HalHtmlCore::GetHideButtonRow(Form("list_%i", no), "Show/Hide"); row.AddContent(HalHtmlCell(rowButton)); table.AddContent(row); TString list_path = Form("%s/list_%i", dir.Data(), no); gSystem->mkdir(list_path); TString list_dir = Form("list_%i/", no); TString list_dir2 = Form("list_%i/", no); auto addToUrl = [](TString add_dir, TString url) { if (!url.Contains("href")) { return url; } Int_t start_url = url.First("=") + 2; TString first = url(0, start_url); TString end = url(start_url, url.Length()); TString output = Form("%s%s%s", first.Data(), add_dir.Data(), end.Data()); output.ReplaceAll("//", "/"); return output; }; list_dir2 = Form("%s/list_%i/", path_url.Data(), no); for (int i = 0; i < list->GetEntries(); i++) { TObject* obj = list->At(i); TString name = obj->GetName(); TString classname = obj->ClassName(); TString temp_classes = Form("%s list_%i", HalHtmlTableRowStyles::DefStyle().Data(), no); HalHtmlRow rowElement("", temp_classes, "display:none"); rowElement.AddContent(HalHtmlCell()); rowElement.AddContent(HalHtmlCell(Form("%i", i))); rowElement.AddContent(HalHtmlCell(obj->ClassName())); if (classname == "HalPackage") { classname = Form("HalPackage [%s] ", ((HalPackage*) obj)->GetName()); // rowElement.AddContent(HalHtmlCell(classname)); } else { rowElement.AddContent(HalHtmlCell(obj->GetName())); } rowElement.AddContent(HalHtmlCell(addToUrl(rel_dir, HalHtmlCore::HTMLExtract(obj, i, list_path)))); table.AddContent(rowElement); } }

Definition at line 110 of file HtmlCore.cxx.

◆ Instance()

HtmlCore * Hal::HtmlCore::Instance ( )
static
Returns
instance of this class

Definition at line 81 of file HtmlCore.cxx.

◆ IsOnline()

static Bool_t Hal::HtmlCore::IsOnline ( )
inlinestatic
Returns
true if online mode is present

Definition at line 108 of file HtmlCore.h.

◆ ResetMainDir()

static void Hal::HtmlCore::ResetMainDir ( )
inlinestatic

Definition at line 139 of file HtmlCore.h.

◆ SetMainDir()

void Hal::HtmlCore::SetMainDir ( TString name)
static

set main diretory. It's place where first CSS file and javascritp files are created. So it should be set only once per one exporting of file/object/taks into HTML. Other objects are inside of main dir - so setting value for them is not necessary

only once - and after extraction of data this value shold be resteed.

Parameters
name

Definition at line 89 of file HtmlCore.cxx.

◆ SetMainDirAndExtract()

void Hal::HtmlCore::SetMainDirAndExtract ( TString name)
static

set this directory as a main and extract there Jss and css files, should be used together with HTMLEXtract for single objects

Parameters
name

Definition at line 95 of file HtmlCore.cxx.

◆ SetOnline()

static void Hal::HtmlCore::SetOnline ( Bool_t online)
inlinestatic
Parameters
onlineif true - use url from JSroot page, don;t use own JS files

Definition at line 120 of file HtmlCore.h.


The documentation for this class was generated from the following files: