39 #include "GlobalMetadataStore.h" 40 #include "BESDDXResponseHandler.h" 41 #include "BESDDSResponse.h" 42 #include "BESDapNames.h" 43 #include "BESTransmitter.h" 44 #include "BESRequestHandlerList.h" 51 BESDDXResponseHandler::BESDDXResponseHandler(
const string &name) :
56 BESDDXResponseHandler::~BESDDXResponseHandler()
72 static bool function_in_ce(
const string &ce)
75 return ce.find(
"(") != string::npos || ce.find(
"%28") != string::npos;
94 BESDEBUG(
"dap",
"Entering BESDDXResponseHandler::execute" << endl);
96 dhi.action_name = DDX_RESPONSE_STR;
113 d_response_object = bdds;
118 DDS *dds =
new DDS(NULL,
"virtual");
121 d_response_name = DDS_RESPONSE;
122 dhi.
action = DDS_RESPONSE;
126 d_response_object = bdds;
132 #if ANNOTATION_SYSTEM 134 if (!d_annotation_service_url.empty()) {
136 BESDDSResponse *resp_dds = static_cast<BESDDSResponse*>(d_response_object);
139 AttrTable *dods_extra = resp_dds->
get_dds()->get_attr_table().find_container(DODS_EXTRA_ATTR_TABLE);
141 dods_extra->append_attr(DODS_EXTRA_ANNOTATION_ATTR,
"String", d_annotation_service_url);
143 auto_ptr<AttrTable> new_dods_extra(
new AttrTable);
144 new_dods_extra->append_attr(DODS_EXTRA_ANNOTATION_ATTR,
"String", d_annotation_service_url);
145 resp_dds->
get_dds()->get_attr_table().append_container(new_dods_extra.release(), DODS_EXTRA_ATTR_TABLE);
158 d_response_object = bdds;
159 d_response_name = DDS_RESPONSE;
160 dhi.
action = DDS_RESPONSE;
162 BESDEBUG(
"bes",
"about to set dap version to: " << bdds->get_dap_client_protocol() << endl);
163 BESDEBUG(
"bes",
"about to set xml:base to: " << bdds->get_request_xml_base() << endl);
165 if (!bdds->get_dap_client_protocol().empty()) {
166 dds->set_dap_version(bdds->get_dap_client_protocol());
169 dds->set_request_xml_base(bdds->get_request_xml_base());
173 dhi.
action = DDX_RESPONSE;
174 d_response_object = bdds;
177 BESDEBUG(
"dap",
"Leaving BESDDXResponseHandler::execute" << endl);
194 if (d_response_object) {
195 transmitter->send_response(DDX_SERVICE, d_response_object, dhi);
207 strm << BESIndent::LMarg <<
"BESDDXResponseHandler::dump - (" << (
void *)
this <<
")" << endl;
210 BESIndent::UnIndent();
214 BESDDXResponseHandler::DDXResponseBuilder(
const string &name)
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command
std::string get_relative_name() const
Get the relative name of the object in this container.
Holds a DDS object within the BES.
virtual void dump(ostream &strm) const
dumps information about this object
handler object that knows how to create a specific response object
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request
virtual void clear_container()
clear the container in the DAP response object
Structure storing information used by the BES to handle the request.
string get_constraint() const
retrieve the constraint expression for this container
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get ddx for def_name;'
string get_request_xml_base() const
Return the xml:base URL for this request.
void first_container()
set the container pointer to the first container in the containers list
virtual void dump(std::ostream &strm) const
dumps information about this object
response handler that builds an OPeNDAP DDX object
string action
the response object requested, e.g. das, dds
BESContainer * container
pointer to current container in this interface