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 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
10 #include <xgi/Method.h>
11 #pragma GCC diagnostic pop
15 #include <unordered_map>
20 class HttpXmlDocument;
34 const std::string& username);
38 void getPathContent(
const std::string& basepath,
39 const std::string& path,
43 void saveFileContent(cgicc::Cgicc& cgiIn,
45 const std::string& username);
46 void build(cgicc::Cgicc& cgiIn,
HttpXmlDocument* xmlOut,
const std::string& username);
48 std::string safePathString(
const std::string& path);
49 std::string safeExtensionString(
const std::string& extension);
52 static const std::string SPECIAL_TYPE_FEInterface, SPECIAL_TYPE_DataProcessor,
53 SPECIAL_TYPE_Table, SPECIAL_TYPE_SlowControls, SPECIAL_TYPE_Tools,
54 SPECIAL_TYPE_UserData, SPECIAL_TYPE_WebPath, SPECIAL_TYPE_OutputData;
56 static const std::string SOURCE_BASE_PATH, USER_DATA_PATH, OTSDAQ_WEB_PATH,
59 static std::map<std::string ,
60 std::set<std::string> >
63 static void readFile(
const std::string& basepath,
64 const std::string& path,
65 std::string& contents,
66 bool binaryRead =
false);
67 static void writeFile(
const std::string& basepath,
68 const std::string& path,
69 const std::string& contents,
70 const std::string& username,
71 const unsigned long long& insertPos = -1,
72 const std::string& insertString =
"");
73 static std::string getFileGitURL(
const std::string& basepath,
74 const std::string& path);
76 const std::set<std::string> ALLOWED_FILE_EXTENSIONS_;
void xmlRequest(const std::string &option, bool readOnlyMode, cgicc::Cgicc &cgiIn, HttpXmlDocument *xmlOut, const std::string &username)
request are handled here