1 #ifndef _ots_CodeEditor_h_
2 #define _ots_CodeEditor_h_
4 #include "otsdaq/Macros/CoutMacros.h"
5 #include "otsdaq/Macros/StringMacros.h"
6 #include "otsdaq/MessageFacility/MessageFacility.h"
7 #include "otsdaq/SOAPUtilities/SOAPMessenger.h"
8 #include "xgi/Method.h"
12 #include <unordered_map>
17 class HttpXmlDocument;
27 void xmlRequest(
const std::string& option,
31 const std::string& username);
35 void getPathContent(
const std::string& basepath,
36 const std::string& path,
39 void saveFileContent(cgicc::Cgicc& cgiIn,
41 const std::string& username);
42 void build(cgicc::Cgicc& cgiIn,
HttpXmlDocument* xmlOut,
const std::string& username);
44 std::string safePathString(
const std::string& path);
45 std::string safeExtensionString(
const std::string& extension);
48 static const std::string SPECIAL_TYPE_FEInterface, SPECIAL_TYPE_DataProcessor,
49 SPECIAL_TYPE_Table, SPECIAL_TYPE_ControlsInterface, SPECIAL_TYPE_Tools,
50 SPECIAL_TYPE_UserData, SPECIAL_TYPE_OutputData;
52 static const std::string SOURCE_BASE_PATH, USER_DATA_PATH, OTSDAQ_DATA_PATH;
54 static std::map<std::string ,
55 std::set<std::string> >
58 static void readFile(
const std::string& basepath,
59 const std::string& path,
60 std::string& contents);
61 static void writeFile(
const std::string& basepath,
62 const std::string& path,
63 const std::string& contents,
64 const std::string& username,
65 const unsigned long long& insertPos = -1,
66 const std::string& insertString =
"");
68 const std::set<std::string> ALLOWED_FILE_EXTENSIONS_;