$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/CodeEditor/CodeEditorSupervisor.h" 00002 00003 using namespace ots; 00004 00005 XDAQ_INSTANTIATOR_IMPL(CodeEditorSupervisor) 00006 00007 //======================================================================================================================== 00008 CodeEditorSupervisor::CodeEditorSupervisor(xdaq::ApplicationStub* s) 00009 : CoreSupervisorBase(s) 00010 { 00011 __SUP_COUT__ << "Constructed." << __E__; 00012 } // end constructor 00013 00014 //======================================================================================================================== 00015 CodeEditorSupervisor::~CodeEditorSupervisor(void) 00016 { 00017 __SUP_COUT__ << "Destroying..." << __E__; 00018 // theStateMachineImplementation_ is reset and the object it points to deleted in 00019 // ~CoreSupervisorBase() 00020 } // end destructor 00021 00022 //======================================================================================================================== 00023 void CodeEditorSupervisor::defaultPage(xgi::Input* in, xgi::Output* out) 00024 { 00025 __SUP_COUT__ << "ApplicationDescriptor LID=" 00026 << getApplicationDescriptor()->getLocalId() << __E__; 00027 *out << "<!DOCTYPE HTML><html lang='en'><frameset col='100%' row='100%'><frame " 00028 "src='/WebPath/html/CodeEditor.html?urn=" 00029 << getApplicationDescriptor()->getLocalId() << "'></frameset></html>"; 00030 } // end defaultPage() 00031 00032 //======================================================================================================================== 00033 // setSupervisorPropertyDefaults 00034 // override to set defaults for supervisor property values (before user settings 00035 // override) 00036 void CodeEditorSupervisor::setSupervisorPropertyDefaults() 00037 { 00038 CorePropertySupervisorBase::setSupervisorProperty( 00039 CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.UserPermissionsThreshold, 00040 std::string() + "*=1 | codeEditor=-1"); 00041 00042 } // end setSupervisorPropertyDefaults() 00043 00044 //======================================================================================================================== 00045 // forceSupervisorPropertyValues 00046 // override to force supervisor property values (and ignore user settings) 00047 void CodeEditorSupervisor::forceSupervisorPropertyValues() 00048 { 00049 CorePropertySupervisorBase::setSupervisorProperty( 00050 CorePropertySupervisorBase::SUPERVISOR_PROPERTIES.RequireUserLockRequestTypes, 00051 "codeEditor"); 00052 00053 } // end forceSupervisorPropertyValues() 00054 00055 //======================================================================================================================== 00056 // Request 00057 // Handles Web Interface requests to Console supervisor. 00058 // Does not refresh cookie for automatic update checks. 00059 void CodeEditorSupervisor::request(const std::string& requestType, 00060 cgicc::Cgicc& cgiIn, 00061 HttpXmlDocument& xmlOut, 00062 const WebUsers::RequestUserInfo& userInfo) 00063 { 00064 // Commands: 00065 // codeEditor 00066 00067 if(requestType == "codeEditor") 00068 { 00069 __SUP_COUT__ << "Code Editor" << __E__; 00070 00071 codeEditor_.xmlRequest(CgiDataUtilities::getData(cgiIn, "option"), 00072 cgiIn, 00073 &xmlOut, 00074 userInfo.username_); 00075 } 00076 else 00077 { 00078 __SUP_SS__ << "requestType Request, " << requestType << ", not recognized." 00079 << __E__; 00080 __SUP_SS_THROW__; 00081 } 00082 } // end request()