40 #include <BaseTypeFactory.h> 41 #include <Ancillary.h> 44 #include <D4BaseTypeFactory.h> 45 #include <mime_util.h> 46 #include <InternalErr.h> 48 #include <BESDASResponse.h> 49 #include <BESDDSResponse.h> 50 #include <BESDataDDSResponse.h> 51 #include <BESDMRResponse.h> 54 #include <BESContainer.h> 55 #include <BESVersionInfo.h> 56 #include <BESDataNames.h> 57 #include <BESDapNames.h> 58 #include <BESResponseHandler.h> 59 #include <BESResponseNames.h> 60 #include <BESVersionInfo.h> 61 #include <BESTextInfo.h> 62 #include <BESConstraintFuncs.h> 63 #include <BESDapError.h> 68 #include "CSVRequestHandler.h" 72 CSVRequestHandler::CSVRequestHandler(
string name) :
75 add_method(DAS_RESPONSE, CSVRequestHandler::csv_build_das);
76 add_method(DDS_RESPONSE, CSVRequestHandler::csv_build_dds);
77 add_method(DATA_RESPONSE, CSVRequestHandler::csv_build_data);
84 add_method(VERS_RESPONSE, CSVRequestHandler::csv_build_vers);
85 add_method(HELP_RESPONSE, CSVRequestHandler::csv_build_help);
88 CSVRequestHandler::~CSVRequestHandler()
100 das = bdas->get_das();
106 csv_read_attributes(*das, accessed);
107 Ancillary::read_ancillary_das(*das, accessed);
110 catch (InternalErr &e) {
111 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
114 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
117 throw BESDapError(
"Caught unknown error build CSV DAS response",
true, unknown_error, __FILE__, __LINE__);
132 BaseTypeFactory *factory =
new BaseTypeFactory;
133 dds->set_factory(factory);
137 dds->filename(accessed);
138 csv_read_descriptors(*dds, accessed);
139 Ancillary::read_ancillary_dds(*dds, accessed);
142 csv_read_attributes(das, accessed);
143 Ancillary::read_ancillary_das(das, accessed);
144 dds->transfer_attributes(&das);
149 catch (InternalErr &e) {
150 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
153 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
156 throw BESDapError(
"Caught unknown error build CSV DDS response",
true, unknown_error, __FILE__, __LINE__);
167 dds = bdds->get_dds();
171 BaseTypeFactory *factory =
new BaseTypeFactory;
172 dds->set_factory(factory);
176 dds->filename(accessed);
177 csv_read_descriptors(*dds, accessed);
178 Ancillary::read_ancillary_dds(*dds, accessed);
181 csv_read_attributes(das, accessed);
182 Ancillary::read_ancillary_das(das, accessed);
183 dds->transfer_attributes(&das);
188 catch (InternalErr &e) {
189 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
192 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
195 throw BESDapError(
"Caught unknown error build CSV DataDDS response",
true, unknown_error, __FILE__, __LINE__);
214 BaseTypeFactory factory;
215 DDS dds(&factory, name_path(data_path),
"3.2");
216 dds.filename(data_path);
219 csv_read_descriptors(dds, data_path);
224 csv_read_attributes(das, data_path);
225 Ancillary::read_ancillary_das(das, data_path);
226 dds.transfer_attributes(&das);
228 catch (InternalErr &e) {
229 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
232 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
235 throw BESDapError(
"Caught unknown error build CSV DMR response",
true, unknown_error, __FILE__, __LINE__);
247 DMR *dmr = bdmr.get_dmr();
248 dmr->set_factory(
new D4BaseTypeFactory);
249 dmr->build_using_dds(dds);
271 info->add_module(MODULE_NAME, MODULE_VERSION);
281 map<string, string> attrs;
282 attrs[
"name"] = PACKAGE_NAME;
283 attrs[
"version"] = PACKAGE_VERSION;
284 string handles = (string) DAS_RESPONSE +
"," + DDS_RESPONSE +
"," + DATA_RESPONSE +
"," + HELP_RESPONSE +
"," 286 attrs[
"handles"] = handles;
287 info->begin_tag(
"module", &attrs);
288 info->end_tag(
"module");
295 strm << BESIndent::LMarg <<
"CSVRequestHandler::dump - (" << (
void *)
this <<
")" << endl;
298 BESIndent::UnIndent();
exception thrown if inernal error encountered
Holds a DDS object within the BES.
virtual void dump(ostream &strm) const
dumps information about this object
virtual void set_dap4_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual string access()=0
returns the true name of this container
virtual void set_dap4_function(BESDataHandlerInterface &dhi)
set the constraint depending on the context
informational response object
virtual BESResponseObject * get_response_object()
return the current response object
static bool csv_build_dmr(BESDataHandlerInterface &dhi)
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
Represents an OPeNDAP DMR DAP4 data object within the BES.
error object created from libdap error objects and can handle those errors
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
Represents a specific data type request handler.
virtual void dump(ostream &strm) const
dumps information about this object
Structure storing information used by the BES to handle the request.
Represents an OPeNDAP DAS DAP2 data object within the BES.
Abstract base class representing a specific set of information in response to a request to the BES.
BESContainer * container
pointer to current container in this interface