#include <stdexcept>
#include <iostream>
#include <stdlib.h>
#include <set>
#include "TGClient.h"
#include "TGHtml.h"
#include "TGButton.h"
#include "TGMenu.h"
#include "TGLabel.h"
#include "TGTextEntry.h"
#include "TPluginManager.h"
#include "TUrl.h"
#include "TSocket.h"
#include "TSystem.h"
#include "TVirtualX.h"
#include "TPRegexp.h"
#include "Fireworks/Core/interface/CmsShowSearchFiles.h"
#include "Fireworks/Core/interface/fwLog.h"
Go to the source code of this file.
Classes | |
class | FWHtml |
Functions | |
float | getURLResponseTime (const char *url) |
static std::string | readRemote (const char *url) |
static const std::string | s_filePrefix ("file:") |
static const std::string | s_httpPrefix ("http:") |
static const std::string | s_rootPostfix (".root") |
Variables | |
static const unsigned int | s_columns = 3 |
static const char * | s_noBrowserMessage [] |
static const char *const | s_prefixes [][s_columns] |
static const char * | s_readError [] |
float getURLResponseTime | ( | const char * | url | ) |
Definition at line 51 of file CmsShowSearchFiles.cc.
References prof2calltree::l, and AlCaHLTBitMon_ParallelJobs::p.
Referenced by CmsShowSearchFiles::CmsShowSearchFiles().
static std::string readRemote | ( | const char * | url | ) | [static] |
Definition at line 259 of file CmsShowSearchFiles.cc.
References MatrixRunner::msg, asciidump::s, and findQualityFiles::size.
Referenced by CmsShowSearchFiles::sendToWebBrowser().
{ // Read (open) remote files. char *buf = 0; TUrl fUrl(url); TString msg = "GET "; msg += fUrl.GetProtocol(); msg += "://"; msg += fUrl.GetHost(); msg += ":"; msg += fUrl.GetPort(); msg += "/"; msg += fUrl.GetFile(); msg += "\r\n"; TString uri(url); if (!uri.BeginsWith("http://")) return std::string(); TSocket s(fUrl.GetHost(), fUrl.GetPort()); if (!s.IsValid()) return std::string(); if (s.SendRaw(msg.Data(), msg.Length()) == -1) return std::string(); Int_t size = 1024*1024; buf = (char *)calloc(size, sizeof(char)); if (s.RecvRaw(buf, size) == -1) { free(buf); return std::string(); } std::string returnValue(buf); free(buf); return returnValue; }
static const std::string s_filePrefix | ( | "file:" | ) | [static] |
Referenced by CmsShowSearchFiles::showPrefixes().
static const std::string s_httpPrefix | ( | "http:" | ) | [static] |
Referenced by CmsShowSearchFiles::sendToWebBrowser(), and CmsShowSearchFiles::showPrefixes().
static const std::string s_rootPostfix | ( | ".root" | ) | [static] |
Referenced by CmsShowSearchFiles::fileEntryChanged(), and CmsShowSearchFiles::hyperlinkClicked().
const unsigned int s_columns = 3 [static] |
Definition at line 39 of file CmsShowSearchFiles.cc.
Referenced by CmsShowSearchFiles::showPrefixes().
const char* s_noBrowserMessage[] [static] |
{ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ", "<HTML><HEAD><TITLE>No Browser Available</TITLE> ", "<META http-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ", "<BODY> ", "<b>Welcome....</b><BR>", "<BR>", "<b>You may look at examples:</b><BR>", "If you are in Europe, open example data files at CERN: ", " <a href=" , s_prefixes[0][0], ">", s_prefixes[0][0], "</a><BR>", "If you are in US, open example data files at UCSD:", " <a href=" , s_prefixes[1][0], ">", s_prefixes[1][0], "</a><BR>", "<BR>" "<b>You also may load files with Choose Prefix </b><BR>" "</BODY></HTML> ", 0 }
Definition at line 71 of file CmsShowSearchFiles.cc.
Referenced by CmsShowSearchFiles::sendToWebBrowser().
const char* const s_prefixes[][s_columns] [static] |
{ {"http://fireworks.web.cern.ch/fireworks/samples-4.2/", "Pre-selected example files","t"}, {"http://uaf-2.t2.ucsd.edu/fireworks-4.2/" , "Pre-selected example files","t"}, {"http://", "Web site known by you",0}, {"file:","Local file [you must type full path name]",0}, {"dcap://","dCache [FNAL]",0}, {"rfio://","Castor [CERN]",0} }
Definition at line 40 of file CmsShowSearchFiles.cc.
Referenced by CmsShowSearchFiles::CmsShowSearchFiles(), and CmsShowSearchFiles::showPrefixes().
const char* s_readError[] [static] |
{ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ", "<HTML><HEAD><TITLE>HTTP Read Error</TITLE> ", "<META http-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ", "<BODY> ", "<P>Unknown error while trying to get file via http</P>", "</BODY></HTML> ", 0 }
Definition at line 89 of file CmsShowSearchFiles.cc.
Referenced by CmsShowSearchFiles::sendToWebBrowser().