$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_WizardSupervisor_h 00002 #define _ots_WizardSupervisor_h 00003 00004 #include "otsdaq-core/SOAPUtilities/SOAPMessenger.h" 00005 00006 #include <xdaq/Application.h> 00007 #include <xgi/Method.h> 00008 #include "otsdaq-core/Macros/XDAQApplicationMacros.h" 00009 00010 #include <xoap/Method.h> 00011 #include <xoap/SOAPBody.h> 00012 #include <xoap/SOAPEnvelope.h> 00013 #include <xoap/domutils.h> 00014 00015 #include <cgicc/HTMLClasses.h> 00016 #include <cgicc/HTMLDoctype.h> 00017 #include <cgicc/HTTPCookie.h> 00018 #include <cgicc/HTTPHeader.h> 00019 00020 #include <map> 00021 #include <string> 00022 00023 #include "otsdaq-core/CodeEditor/CodeEditor.h" 00024 #include "otsdaq-core/SupervisorInfo/AllSupervisorInfo.h" 00025 00026 namespace ots 00027 { 00028 class HttpXmlDocument; 00029 00030 // WizardSupervisor 00031 // This class is a xdaq application. 00032 // 00033 // It is instantiated by the xdaq context when otsdaq is in "Wiz Mode." 00034 // 00035 // It is different from the "Normal Mode" Gateway Supervisor in that 00036 // it does not have a state machine and does not inherit properties 00037 // from CorePropertySupervisorBase. The assumption is that only admins 00038 // have access to wiz mode, and they have access to all features of it. 00039 class WizardSupervisor : public xdaq::Application, public SOAPMessenger 00040 { 00041 public: 00042 XDAQ_INSTANTIATOR(); 00043 00044 WizardSupervisor(xdaq::ApplicationStub*) throw(xdaq::exception::Exception); 00045 virtual ~WizardSupervisor(void); 00046 00047 void init(void); 00048 void destroy(void); 00049 00050 void generateURL(void); 00051 static void printURL(WizardSupervisor* ptr, std::string securityCode); 00052 00053 void Default(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00054 void verification(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00055 void request(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00056 void requestIcons(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00057 00058 void editSecurity(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00059 void UserSettings(xgi::Input* in, xgi::Output* out) throw(xgi::exception::Exception); 00060 void tooltipRequest(xgi::Input* in, 00061 xgi::Output* out) throw(xgi::exception::Exception); 00062 void toggleSecurityCodeGeneration(xgi::Input* in, 00063 xgi::Output* out) throw(xgi::exception::Exception); 00064 std::string validateUploadFileType(const std::string fileType); 00065 void cleanUpPreviews(); 00066 void savePostPreview(std::string& subject, 00067 std::string& text, 00068 const std::vector<cgicc::FormFile>& files, 00069 std::string creator, 00070 HttpXmlDocument* xmldoc = nullptr); 00071 00072 // External Supervisor XOAP handlers 00073 xoap::MessageReference supervisorSequenceCheck(xoap::MessageReference msg) throw( 00074 xoap::exception::Exception); 00075 xoap::MessageReference supervisorLastConfigGroupRequest( 00076 xoap::MessageReference msg) throw(xoap::exception::Exception); 00077 00078 private: 00079 std::string securityCode_; 00080 bool defaultSequence_; 00081 std::vector<std::string> allowedFileUploadTypes_, matchingFileUploadTypes_; 00082 00083 std::string supervisorClass_; 00084 std::string supervisorClassNoNamespace_; 00085 00086 enum 00087 { 00088 ADMIN_PERMISSIONS_THRESHOLD = 255, 00089 EXPERIMENT_NAME_MIN_LENTH = 3, 00090 EXPERIMENT_NAME_MAX_LENTH = 25, 00091 USER_DATA_EXPIRATION_TIME = 60 * 20, // 20 minutes 00092 }; 00093 }; 00094 00095 } // namespace ots 00096 00097 #endif