16#ifndef ROOT7_RWebWindowWSHandler
17#define ROOT7_RWebWindowWSHandler
26using namespace std::string_literals;
29namespace Experimental {
44 if (!version.empty()) {
45 std::string search =
"jsrootsys/scripts/JSRootCore."s;
46 std::string replace = version +
"/jsrootsys/scripts/JSRootCore."s;
48 arg->ReplaceAllinContent(search, replace,
true);
49 arg->AddNoCacheHeader();
52 std::string more_args;
53 const char *ui5source =
gEnv->
GetValue(
"WebGui.openui5src",
"");
54 if (ui5source && *ui5source)
55 more_args.append(
"openui5src: \""s + ui5source +
"\","s);
56 const char *ui5libs =
gEnv->
GetValue(
"WebGui.openui5libs",
"");
57 if (ui5libs && *ui5libs)
58 more_args.append(
"openui5libs: \""s + ui5libs +
"\","s);
59 const char *ui5theme =
gEnv->
GetValue(
"WebGui.openui5theme",
"");
60 if (ui5theme && *ui5theme)
61 more_args.append(
"openui5theme: \""s + ui5theme +
"\","s);
63 if (!user_args.empty())
64 more_args =
"user_args: "s + user_args +
","s;
66 if (!more_args.empty()) {
67 std::string search =
"JSROOT.ConnectWebWindow({"s;
68 std::string replace = search + more_args;
69 arg->ReplaceAllinContent(search, replace,
true);
70 arg->AddNoCacheHeader();
just wrapper to deliver websockets call-backs to the RWebWindow class
TString GetDefaultPageContent() override
returns content of default web-page THttpWSHandler interface
RWebWindowWSHandler(RWebWindow &wind, const char *name)
constructor
Bool_t AllowMTSend() const override
Allows usage of special threads for send operations.
virtual ~RWebWindowWSHandler()=default
void CompleteWSSend(UInt_t wsid) override
React on completion of multi-threaded send operation.
Bool_t CanServeFiles() const override
returns true when window allowed to serve files relative to default page
void VerifyDefaultPageContent(std::shared_ptr< THttpCallArg > &arg) override
Method called when default page content is prepared for use By default no-cache header is provided.
RWebWindow & fWindow
! window reference
Bool_t ProcessBatchHolder(std::shared_ptr< THttpCallArg > &arg) override
Method used to accept or reject root_batch_holder.js request.
Bool_t AllowMTProcess() const override
Allow processing of WS actions in arbitrary thread.
Bool_t ProcessWS(THttpCallArg *arg) override
Process websocket request - called from THttpServer thread THttpWSHandler interface.
Represents web window, which can be shown in web browser or any other supported environment.
std::string fDefaultPage
! HTML page (or file name) returned when window URL is opened
bool ProcessWS(THttpCallArg &arg)
Processing of websockets call-backs, invoked from RWebWindowWSHandler Method invoked from http server...
bool fSendMT
! true is special threads should be used for sending data
std::string GetUserArgs() const
Returns configured user arguments for web window See SetUserArgs method for more details.
bool ProcessBatchHolder(std::shared_ptr< THttpCallArg > &arg)
Process special http request, used to hold headless browser running Such requests should not be repli...
void CompleteWSSend(unsigned wsid)
bool fProcessMT
! if window event processing performed in dedicated thread
std::string GetClientVersion() const
Returns current client version.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Bool_t IsDisabled() const
Returns true when processing of websockets is disabled, set shortly before handler need to be destroy...
static constexpr double s