53 #include <mime_util.h>
61 #define getpid _getpid
62 #define access _access
63 #define X_OK 00 // Simple existence
67 : d_strm(&strm), d_attr_rows(rows), d_attr_cols(cols)
76 set_mime_html(*
d_strm, unknown_type, dap_version(), x_plain);
87 <td align=\"right\">\n\
89 <a href=\"opendap_form_help.html#disposition\" target=\"help\">Action:</a></h3>\n\
91 <input type=\"button\" value=\"Get ASCII\" onclick=\"ascii_button()\">\n";
94 if (netcdf3_file_response)
95 *
d_strm <<
"<input type=\"button\" value=\"Get as NetCDF 3\" onclick=\"binary_button('nc')\">\n";
97 if (netcdf4_file_response)
98 *
d_strm <<
"<input type=\"button\" value=\"Get as NetCDF 4\" onclick=\"binary_button('nc4')\">\n";
101 "<input type=\"button\" value=\"Binary (DAP2) Object\" onclick=\"binary_button('dods')\">\n\
102 <input type=\"button\" value=\"Show Help\" onclick=\"help_button()\">\n\
105 <td align=\"right\"><h3><a href=\"opendap_form_help.html#data_url\" target=\"help\">Data URL:</a>\n\
107 <td><input name=\"url\" type=\"text\" size=\"" <<
d_attr_cols <<
"\" value=\"" << url <<
"\">\n" ;
113 for (AttrTable::Attr_iter a = attr->attr_begin(); a
114 != attr->attr_end(); ++a) {
115 if (attr->is_container(a))
117 (prefix ==
"") ? attr->get_name(a) : prefix + string(
118 ".") + attr->get_name(a));
121 *
d_strm << prefix <<
"." << attr->get_name(a) <<
": ";
123 *
d_strm << attr->get_name(a) <<
": ";
125 int num_attr = attr->get_attr_num(a) - 1;
126 for (
int i = 0; i < num_attr; ++i)
128 *
d_strm << attr->get_attr(a, i) <<
", ";
130 *
d_strm << attr->get_attr(a, num_attr) <<
"\n";
144 <td align=\"right\" valign=\"top\"><h3>\n\
145 <a href=\"opendap_form_help.html#global_attr\" target=\"help\">Global Attributes:</a></h3>\n\
150 *
d_strm <<
"</textarea><p>\n\n";
158 <td align=\"right\" valign=\"top\">\n\
159 <h3><a href=\"opendap_form_help.html#dataset_variables\" target=\"help\">Variables:</a></h3>\n\
162 for (DDS::Vars_iter p = dds.var_begin(); p != dds.var_end(); ++p) {
169 *
d_strm <<
"\n<p><p>\n\n";
170 *
d_strm <<
"<tr><td><td>\n\n";
182 switch (btp->type()) {
193 AttrTable &attr = btp->get_attr_table();
196 if (attr.get_size() == 0) {
197 DBG(cerr <<
"No Attributes for " << btp->name() << endl);
201 *
d_strm <<
"<textarea name=\"" << btp->name() <<
"_attr\" rows=\"" <<
d_attr_rows <<
"\" cols=\""
204 *
d_strm <<
"</textarea>\n\n";
208 case dods_structure_c:
209 case dods_sequence_c: {
210 AttrTable &attr = btp->get_attr_table();
213 if (attr.get_size() == 0) {
214 DBG(cerr <<
"No Attributes for " << btp->name() << endl);
218 *
d_strm <<
"<textarea name=\"" << btp->name() <<
"_attr\" rows=\"" <<
d_attr_rows <<
"\" cols=\""
221 *
d_strm <<
"</textarea>\n\n";
226 Grid &g =
dynamic_cast<Grid&
>(*btp);
229 if (attr.get_size() == 0 && array_attr.get_size() == 0) {
230 DBG(cerr <<
"No Attributes for " << btp->name() << endl);
234 *
d_strm <<
"<textarea name=\"" << btp->name() <<
"_attr\" rows=\"" <<
d_attr_rows <<
"\" cols=\""
238 for (Grid::Map_iter m = g.map_begin(); m != g.map_end(); ++m) {
239 Array &map =
dynamic_cast<Array&
>(**m);
242 *
d_strm <<
"</textarea>\n\n";
void write_global_attributes(AttrTable &attr)
Given the global attribute table, write the HTML which contains all the global attributes for this da...
void write_variable_entries(DDS &dds)
WWWOutput(ostream &strm, int rows=5, int cols=70)
Create a WWWOutput.
void write_disposition(string url, bool netcdf3_file_response, bool netcdf4_file_response)
Write the disposition section of the HTML page.
void write_variable_attributes(BaseType *btp)
Write a variable's attribute information.
void write_html_header()
Write out the header for the HTML document.
void write_attributes(AttrTable *attr, const string prefix="")