35 #include "BESXMLUtils.h" 37 #include "BESSyntaxUserError.h" 40 #include "SampleSayXMLCommand.h" 41 #include "SampleResponseNames.h" 58 map<string, string> props;
60 if (name != SAY_RESPONSE) {
61 string err =
"The specified command " + name +
" is not a say command";
66 string err = name +
" command: should not have xml element values";
72 map<string, string> child_props;
75 string err = name +
" command: should not have child elements";
79 d_xmlcmd_dhi.
data[SAY_WHAT] = props[
"what"];
80 if (d_xmlcmd_dhi.
data[SAY_WHAT].empty()) {
81 string err = name +
" command: Must specify to whom to say";
85 d_xmlcmd_dhi.
data[SAY_TO] = props[
"to"];
86 if (d_xmlcmd_dhi.
data[SAY_WHAT].empty()) {
87 string err = name +
" command: Must specify what to say";
91 d_xmlcmd_dhi.
action = SAY_RESPONSE;
110 strm << BESIndent::LMarg <<
"SampleSayXMLCommand::dump - (" << (
void *)
this <<
")" << endl;
113 BESIndent::UnIndent();
static xmlNode * GetFirstChild(xmlNode *node, string &child_name, string &child_value, map< string, string > &child_props)
get the first element child node for the given node
virtual void dump(ostream &strm) const
dumps information about this object
static void GetNodeInfo(xmlNode *node, string &name, string &value, map< string, string > &props)
get the name, value if any, and any properties for the specified node
virtual void dump(ostream &strm) const
dumps information about this object
error thrown if there is a user syntax error in the request or any other user error ...
virtual void prep_request()
Prepare any information needed to execute the request of this command.
virtual void set_response()
The request has been parsed, use the command action name to set the response handler.
Structure storing information used by the BES to handle the request.
map< string, string > data
the map of string data that will be required for the current request.
virtual void parse_request(xmlNode *node)
parse a show command. No properties or children elements
string action
the response object requested, e.g. das, dds