31#include "BESDataHandlerInterface.h"
32#include "BESCatalog.h"
33#include "BESCatalogList.h"
35#include "BESXMLUtils.h"
36#include "BESSyntaxUserError.h"
40#include "SiteMapCommand.h"
63 map<string, string> props;
65 if (name != SITE_MAP_RESPONSE_STR) {
66 throw BESSyntaxUserError(
string(
"The specified command ") + name +
" is not a build site map command", __FILE__, __LINE__);
69 d_xmlcmd_dhi.data[SITE_MAP_RESPONSE] = SITE_MAP_RESPONSE;
71 if (props[PREFIX].empty() || (props[NODE_SUFFIX].empty() && props[LEAF_SUFFIX].empty()))
72 throw BESSyntaxUserError(
"Build site map must include the prefix and at least one of the nodeSuffix or leafSuffix attributes.", __FILE__, __LINE__);
74 d_xmlcmd_dhi.data[PREFIX] = props[PREFIX];
75 d_xmlcmd_dhi.data[NODE_SUFFIX] = props[NODE_SUFFIX];
76 d_xmlcmd_dhi.data[LEAF_SUFFIX] = props[LEAF_SUFFIX];
78 d_xmlcmd_dhi.data[CATALOG] = props[CATALOG];
82 if (props[CATALOG].empty())
83 d_cmd_log_info = string(
"show siteMap: build site map for all catalogs.");
85 d_cmd_log_info = string(
"show siteMap: build site map for catalog '").append(props[CATALOG]).append(
"'.");
89 d_xmlcmd_dhi.action_name = SITE_MAP_RESPONSE_STR;
90 d_xmlcmd_dhi.action = SITE_MAP_RESPONSE;
107 strm << BESIndent::LMarg <<
"SiteMapCommand::dump - (" << (
void *)
this <<
")" << endl;
110 BESIndent::UnIndent();
122 return new SiteMapCommand(base_dhi);
Structure storing information used by the BES to handle the request.
error thrown if there is a user syntax error in the request or any other user error
Base class for the BES's commands.
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void set_response()
The request has been parsed, use the command action name to set the response handler.
std::string d_cmd_log_info
Used only for the log.
static void GetNodeInfo(xmlNode *node, std::string &name, std::string &value, std::map< std::string, std::string > &props)
get the name, value if any, and any properties for the specified node
virtual void parse_request(xmlNode *node)
Parse the build site map command.
virtual void dump(std::ostream &strm) const
dumps information about this object
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
Factory for the SiteMapCommand.