36 #include <D4BaseTypeFactory.h>
37 #include <Ancillary.h>
39 #include <InternalErr.h>
40 #include <mime_util.h>
77 bool FFRequestHandler::d_RSS_format_support =
false;
78 string FFRequestHandler::d_RSS_format_files =
"";
95 bool key_found =
false;
100 if (doset ==
"true" || doset ==
"yes")
101 FFRequestHandler::d_RSS_format_support =
true;
103 FFRequestHandler::d_RSS_format_support =
false;
106 FFRequestHandler::d_RSS_format_support =
false;
112 FFRequestHandler::d_RSS_format_files = path;
114 FFRequestHandler::d_RSS_format_files =
"";
116 BESDEBUG(
"ff",
"d_RSS_format_support: " << d_RSS_format_support << endl);
117 BESDEBUG(
"ff",
"d_RSS_format_files: " << d_RSS_format_files << endl);
143 name = Ancillary::find_ancillary_file(accessed,
"das",
"",
"");
147 if (!name.empty() && (stat(name.c_str(), &st) == 0)) {
152 }
catch (InternalErr & e) {
153 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
155 }
catch (
Error & e) {
156 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
177 dds->filename(accessed);
179 BESDEBUG(
"ff",
"FFRequestHandler::ff_build_dds, accessed: " << accessed << endl);
183 BESDEBUG(
"ff",
"FFRequestHandler::ff_build_dds, reading attributes" << endl);
189 Ancillary::read_ancillary_das(*das, accessed);
191 BESDEBUG(
"ff",
"FFRequestHandler::ff_build_dds, transferring attributes" << endl);
193 dds->transfer_attributes(das);
199 }
catch (InternalErr & e) {
200 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
202 }
catch (
Error & e) {
203 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
226 DataDDS *dds = bdds->
get_dds();
228 dds->filename(accessed);
230 Ancillary::read_ancillary_dds(*dds, accessed);
236 Ancillary::read_ancillary_das(*das, accessed);
238 dds->transfer_attributes(das);
243 }
catch (InternalErr & e) {
244 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
246 }
catch (
Error & e) {
247 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
277 BaseTypeFactory factory;
278 DDS dds(&factory, name_path(data_path),
"3.2");
279 dds.filename(data_path);
288 Ancillary::read_ancillary_das(das, data_path);
289 dds.transfer_attributes(&das);
291 catch (InternalErr &e) {
292 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
295 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
298 throw BESDapError(
"Caught unknown error build FF DMR response",
true, unknown_error, __FILE__, __LINE__);
309 dmr->set_factory(
new D4BaseTypeFactory);
310 dmr->build_using_dds(dds);
331 map < string, string > attrs;
332 attrs[
"name"] = MODULE_NAME ;
333 attrs[
"version"] = MODULE_VERSION ;
338 list < string > services;
340 if (services.size() > 0) {
342 attrs[
"handles"] = handles;
360 info->
add_module(MODULE_NAME, MODULE_VERSION);
brief represents simple text information in a response object, such as version and help inforamtion...
#define DAP4DATA_RESPONSE
static bool ff_build_dmr(BESDataHandlerInterface &dhi)
Build the DMR object.
exception thrown if an internal error is found and is fatal to the BES
exception thrown if inernal error encountered
string get_symbolic_name() const
retrieve the symbolic name for this container
static string lowercase(const string &s)
Convert a string to all lower case.
Represents an OPeNDAP DDS DAP2 data object within the BES.
virtual void clear_container()
clear the container in the DAP response object
static bool ff_build_help(BESDataHandlerInterface &dhi)
void ff_read_descriptors(DDS &dds, const string &filename)
virtual void set_dap4_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
void ff_get_attributes(DAS &das, string filename)
virtual string access()=0
returns the true name of this container
virtual void clear_container()
clear the container in the DAP response object
virtual void set_dap4_function(BESDataHandlerInterface &dhi)
set the constraint depending on the context
informational response object
static string implode(const list< string > &values, char delim)
implode a list of values into a single string delimited by delim
virtual BESResponseObject * get_response_object()
return the current response object
static BESServiceRegistry * TheRegistry()
BESResponseHandler * response_handler
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void begin_tag(const string &tag_name, map< string, string > *attrs=0)
Represents an OPeNDAP DMR DAP4 data object within the BES.
virtual void set_container(const string &cn)
set the container in the DAP response object
error object created from libdap error objects and can handle those errors
virtual ~FFRequestHandler(void)
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
static bool ff_build_dds(BESDataHandlerInterface &dhi)
virtual void clear_container()
clear the container in the DAP response object
Represents a specific data type request handler.
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
Structure storing information used by the BES to handle the request.
static bool ff_build_data(BESDataHandlerInterface &dhi)
void ff_register_functions()
static bool ff_build_version(BESDataHandlerInterface &dhi)
virtual void set_container(const string &cn)
set the container in the DAP response object
virtual bool add_handler(const string &handler_name, p_request_handler handler_method)
add a handler method to the request handler that knows how to fill in a specific response object ...
Represents an OPeNDAP DAS DAP2 data object within the BES.
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
static BESKeys * TheKeys()
virtual void set_container(const string &cn)
set the container in the DAP response object
static bool ff_build_das(BESDataHandlerInterface &dhi)
virtual void add_module(const string &n, const string &v)
Abstract base class representing a specific set of information in response to a request to the BES...
FFRequestHandler(const string &name)
BESContainer * container
pointer to current container in this interface
virtual void end_tag(const string &tag_name)
static bool get_RSS_format_support()
const string find_ancillary_rss_das(const string &dataset, const string &, const string &)
Find the RSS (Remote Sensing Systems) format file using their naming convention.
virtual void services_handled(const string &handler, list< string > &services)
returns the list of servies provided by the handler in question