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 "otsdaq-core/Macros/XDAQApplicationMacros.h"
00008 #include <xgi/Method.h>
00009
00010 #include <xoap/SOAPEnvelope.h>
00011 #include <xoap/SOAPBody.h>
00012 #include <xoap/domutils.h>
00013 #include <xoap/Method.h>
00014
00015 #include <cgicc/HTMLClasses.h>
00016 #include <cgicc/HTTPCookie.h>
00017 #include <cgicc/HTMLDoctype.h>
00018 #include <cgicc/HTTPHeader.h>
00019
00020 #include <string>
00021 #include <map>
00022
00023 #include "otsdaq-core/SupervisorInfo/AllSupervisorInfo.h"
00024
00025 namespace ots
00026 {
00027
00028 class HttpXmlDocument;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class WizardSupervisor: public xdaq::Application, public SOAPMessenger
00039 {
00040
00041 public:
00042
00043 XDAQ_INSTANTIATOR();
00044
00045 WizardSupervisor (xdaq::ApplicationStub *) throw (xdaq::exception::Exception);
00046 virtual ~WizardSupervisor (void);
00047
00048
00049 void init (void);
00050 void destroy (void);
00051
00052 void generateURL (void);
00053 static void printURL (WizardSupervisor *ptr, std::string securityCode);
00054
00055 void Default (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00056 void verification (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00057 void requestIcons (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00058
00059 void editSecurity (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00060 void UserSettings (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00061 void tooltipRequest (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00062 void toggleSecurityCodeGeneration (xgi::Input* in, xgi::Output* out) throw (xgi::exception::Exception);
00063 std::string validateUploadFileType (const std::string fileType);
00064 void cleanUpPreviews ();
00065 void savePostPreview (std::string &subject, std::string &text, const std::vector<cgicc::FormFile> &files, std::string creator, HttpXmlDocument *xmldoc = nullptr);
00066 std::string exec (const char* cmd);
00067
00068
00069 xoap::MessageReference supervisorSequenceCheck (xoap::MessageReference msg) throw (xoap::exception::Exception);
00070 xoap::MessageReference supervisorLastConfigGroupRequest (xoap::MessageReference msg) throw (xoap::exception::Exception);
00071
00072 private:
00073 std::string securityCode_;
00074 bool defaultSequence_;
00075 std::vector<std::string> allowedFileUploadTypes_, matchingFileUploadTypes_;
00076
00077
00078 std::string supervisorClass_;
00079 std::string supervisorClassNoNamespace_;
00080
00081 enum {
00082 ADMIN_PERMISSIONS_THRESHOLD = 255,
00083 EXPERIMENT_NAME_MIN_LENTH = 3,
00084 EXPERIMENT_NAME_MAX_LENTH = 25,
00085 USER_DATA_EXPIRATION_TIME = 60*20,
00086 };
00087
00088 };
00089
00090 }
00091
00092 #endif