4 #ifndef ROOT_THttpServer
5 #define ROOT_THttpServer
19 #ifndef ROOT_THttpCallArg
88 return fTopName.
Data();
93 void AddLocation(
const char *prefix,
const char *path);
117 void Restrict(
const char *path,
const char* options);
TRootSniffer * GetSniffer() const
const char * GetItemField(const char *fullname, const char *name)
static const char * filename()
TString fTopName
location of local JSROOT files
void ProcessRequests()
Process submitted requests, must be called from main thread.
Bool_t CreateItem(const char *fullname, const char *title)
const char * Data() const
TRootSniffer * fSniffer
timer used to access main thread
THttpServer(const char *engine="civetweb:8080")
#define ClassDef(name, id)
The TNamed class is the base class for all named ROOT classes.
THttpTimer * fTimer
engines which runs http server
void SetTimer(Long_t milliSec=100, Bool_t mode=kTRUE)
create timer which will invoke ProcessRequests() function periodically Timer is required to perform a...
TList fLocations
location of external JSROOT files
TString fJSROOTSYS
id of the main ROOT process
Bool_t Register(const char *subfolder, TObject *obj)
Register object in subfolder.
void SetReadOnly(Bool_t readonly)
Set read-only mode for the server (default on) In read-only server is not allowed to change any ROOT ...
Bool_t CreateEngine(const char *engine)
factory method to create different http engines At the moment two engine kinds are supported: civetwe...
virtual ~THttpServer()
destructor delete all http engines and sniffer
Bool_t IsFileRequested(const char *uri, TString &res) const
Check if file is requested, thread safe.
TString fDefaultPage
list of local directories, which could be accessed via server
Bool_t IsReadOnly() const
returns read-only mode
void SetSniffer(TRootSniffer *sniff)
Set TRootSniffer to the server Server takes ownership over sniffer.
Bool_t ExecuteHttp(THttpCallArg *arg)
Execute HTTP request.
TString fDrawPage
content of the file content
void AddLocation(const char *prefix, const char *path)
add files location, which could be used in the server one could map some system folder to the server ...
virtual Int_t GetSize() const
Bool_t Hide(const char *fullname, Bool_t hide=kTRUE)
hides folder or element from web gui
virtual void ProcessRequest(THttpCallArg *arg)
submitted arguments
TString fDrawPageCont
file name for drawing of single element
TString fDefaultPageCont
file name for default page name
Bool_t RegisterCommand(const char *cmdname, const char *method, const char *icon=0)
Register command which can be executed from web interface.
Mother of all ROOT objects.
static const char * GetMimeType(const char *path)
Guess mime type base on file extension.
Bool_t Unregister(TObject *obj)
Unregister object.
Long_t fMainThrdId
sniffer provides access to ROOT objects hierarchy
static char * ReadFileContent(const char *filename, Int_t &len)
Reads content of file from the disk.
const char * GetTopName() const
Bool_t SetIcon(const char *fullname, const char *iconname)
set name of icon, used in browser together with the item
TList fCallArgs
mutex to protect list with arguments
static Bool_t VerifyFilePath(const char *fname)
Checked that filename does not contains relative path below current directory Used to prevent access ...
TString fJSROOT
name of top folder, default - "ROOT"
void SetDrawPage(const char *filename)
Set file name of HTML page, delivered by the server when objects drawing page is requested from the b...
Bool_t SetItemField(const char *fullname, const char *name, const char *value)
TMutex fMutex
content of draw page
void Restrict(const char *path, const char *options)
Restrict access to specified object.
Bool_t IsAnyEngine() const
void SetDefaultPage(const char *filename)
Set file name of HTML page, delivered by the server when http address is opened in the browser...
void SetTopName(const char *top)
void SetJSROOT(const char *location)
Set location of JSROOT to use with the server One could specify address like: https://root.cern.ch/js/3.3/ http://web-docs.gsi.de/~linev/js/3.3/ This allows to get new JSROOT features with old server, reduce load on THttpServer instance, also startup time can be improved When empty string specified (default), local copy of JSROOT is used (distributed with ROOT)