37#include <libdap/DDS.h>
39#include "GlobalMetadataStore.h"
40#include "BESDDXResponseHandler.h"
41#include "BESDDSResponse.h"
42#include "BESDapNames.h"
43#include "BESTransmitter.h"
44#include "BESRequestHandlerList.h"
51BESDDXResponseHandler::BESDDXResponseHandler(
const string &name) :
56BESDDXResponseHandler::~BESDDXResponseHandler()
72static 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;
128 BESRequestHandlerList::TheList()->execute_each(dhi);
134 if (!d_annotation_service_url.empty()) {
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);
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());
171 BESRequestHandlerList::TheList()->execute_each(dhi);
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();
214BESDDXResponseHandler::DDXResponseBuilder(
const string &name)
std::string get_relative_name() const
Get the relative name of the object in this container.
std::string get_constraint() const
retrieve the constraint expression for this container
Holds a DDS object within the BES.
virtual void clear_container()
clear the container in the DAP response object
response handler that builds an OPeNDAP DDX object
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get ddx for def_name;'
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
std::string get_request_xml_base() const
Return the xml:base URL for this request.
Structure storing information used by the BES to handle the request.
std::string action
the response object requested, e.g. das, dds
void first_container()
set the container pointer to the first container in the containers list
BESContainer * container
pointer to current container in this interface
handler object that knows how to create a specific response object
void dump(std::ostream &strm) const override
dumps information about this object