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();