33 #include "SampleSayXMLCommand.h" 34 #include "BESXMLUtils.h" 36 #include "BESSyntaxUserError.h" 38 #include "SampleResponseNames.h" 56 map<string, string> props ;
58 if( name != SAY_RESPONSE )
60 string err =
"The specified command " + name
61 +
" is not a say command" ;
67 string err = name +
" command: should not have xml element values" ;
73 map<string,string> child_props ;
78 string err = name +
" command: should not have child elements" ;
82 _dhi.
data[SAY_WHAT] = props[
"what"] ;
83 if( _dhi.
data[SAY_WHAT].empty() )
85 string err = name +
" command: Must specify to whom to say" ;
89 _dhi.
data[SAY_TO] = props[
"to"] ;
90 if( _dhi.
data[SAY_WHAT].empty() )
92 string err = name +
" command: Must specify what to say" ;
96 _dhi.
action = SAY_RESPONSE ;
117 strm << BESIndent::LMarg <<
"SampleSayXMLCommand::dump - (" 118 << (
void *)
this <<
")" << endl ;
119 BESIndent::Indent() ;
121 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