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,
44 void saveFileContent(cgicc::Cgicc& cgiIn,
46 const std::string& username);
47 void build(cgicc::Cgicc& cgiIn,
HttpXmlDocument* xmlOut,
const std::string& username);
49 std::string safePathString(
const std::string& path);
50 std::string safeExtensionString(
const std::string& extension);
53 static const std::string SPECIAL_TYPE_FEInterface, SPECIAL_TYPE_DataProcessor,
54 SPECIAL_TYPE_Table, SPECIAL_TYPE_SlowControls, SPECIAL_TYPE_Tools,
55 SPECIAL_TYPE_UserData, SPECIAL_TYPE_WebPath, SPECIAL_TYPE_OutputData;
57 static const std::string SOURCE_BASE_PATH, USER_DATA_PATH, OTSDAQ_WEB_PATH,
60 static std::map<std::string ,
61 std::set<std::string> >
64 static void readFile(
const std::string& basepath,
65 const std::string& path,
66 std::string& contents,
67 bool binaryRead =
false);
68 static void writeFile(
const std::string& basepath,
69 const std::string& path,
70 const std::string& contents,
71 const std::string& username,
72 const unsigned long long& insertPos = -1,
73 const std::string& insertString =
"");
74 static std::string getFileGitURL(
const std::string& basepath,
75 const std::string& path);
77 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
defines used also by OtsConfigurationWizardSupervisor