100 string clTRID = _command->get_clTRID();
101 map < string, string, less<string> > to_parse;
106 to_parse[
"clTRID"] =
"";
113 if (_response->get_result_lang() !=
"en") {
114 lang =
" lang=\"" + su.
esc_xml_markup(_response->get_result_lang()) +
118 map <Response::ResultCode, Response::ResultInfo> results;
119 map <Response::ResultCode, Response::ResultInfo>::const_iterator it;
120 list<Response::ResultExtValue>::const_iterator ev_it;
121 results = _response->get_result_list();
122 to_parse[
"result"] =
"";
123 for (it = results.begin(); it != results.end(); it++) {
124 to_parse[
"result"] +=
"<result code=\"" +
126 "<msg" + lang +
">" + su.
esc_xml_markup(it->second.msg) +
"</msg>";
127 for (ev_it = it->second.ext_values.begin();
128 ev_it != it->second.ext_values.end(); ev_it++) {
131 if (ev_it->reason ==
"") {
132 to_parse[
"result"] +=
"<value " + ev_it->xmlns +
">" +
133 ev_it->value +
"</value>";
135 to_parse[
"result"] +=
"<extValue><value " + ev_it->xmlns +
">" +
136 ev_it->value +
"</value><reason" + lang +
">" +
140 to_parse[
"result"] +=
"</result>";
152 #endif //__ACTION_H__
Action(const ActionType &type)
Constructor that forces childs to set their types.
Definition: Action.H:91
StrUtil Class: String Manipulation Utilities.
Definition: StrUtil.H:26
static string to_string(const char *format, const kind &number)
Convert number to string where the format string looks like printf format.
Definition: StrUtil.H:57
string get_xml()
Returns XML.
Definition: Action.H:41
EPP Response Class.
Definition: Response.H:24
virtual void set_xml_template(const string &xml_template)=0
Sets the xml template and parses the tags (pure virtual)
EPP DomParser Class.
Definition: DomParser.H:62
EPP Action Class.
Definition: Action.H:24
static string parse(const string &text, const map< string, string, less< string > > &to_parse, string tag_begin, string tag_end)
Used for parsing XML Templates.
auto_ptr< Response > _response
Generic response.
Definition: Action.H:79
Response * get_response()
Returns raw pointer to the response.
Definition: Action.H:60
ActionType who_am_i()
Returns Action type.
Definition: Action.H:47
static string esc_xml_markup(const string &input_txt)
Escape &'><" characters.
Command * get_command()
Returns raw pointer to the command.
Definition: Action.H:69
auto_ptr< Command > _command
Generic command.
Definition: Action.H:76
ActionType
Action Types.
Definition: CommonData.H:23
ActionType _type
Action type.
Definition: Action.H:82
EPP Command Class.
Definition: Command.H:18
virtual void set_response(const string &xml_payload, DomParser *parser)=0
Pure virtual method to set response from a XML document.
virtual ~Action()
virtual destructor
Definition: Action.H:28
string _xml
XML command.
Definition: Action.H:85
void set_xml_template_common(const string &xml_template)
Sets the xml template and parses the tags (protected)
Definition: Action.H:97