OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
dap_html_form Namespace Reference

Functions

BaseType * basetype_to_wwwtype (BaseType *bt)
 Given a BaseType variable, return a pointer to a new variable that has the same parent types (Byte, et c.) but is now one of the WWW specializations. More...
 
DDS * dds_to_www_dds (DDS *dds)
 Given a DDS filled with variables that are one specialization of BaseType, build a second DDS which contains variables made using the WWW specialization. More...
 
string fancy_typename (BaseType *v)
 Return a string which describes the datatype of a DODS variable. More...
 
string get_fqn (BaseType *var)
 Get the Fully Qualified Name for a variable. More...
 
string name_for_js_code (const string &dods_name)
 Generate variable names to be used by the JavaScript code. More...
 
void write_html_form_interface (ostream &strm, DDS *dds, const string &url, bool html_header, bool netcdf3_file_response, bool netcdf4_file_response, const string &admin_name, const string &help_location)
 Using the stuff in WWWOutput and the hacked (specialized) print_val() methods in the WWW* classes, write out the HTML form interface. More...
 
void write_simple_variable (FILE *os, BaseType *var)
 This function is used by the Byte, ..., URL types to write their entries in the HTML Form. More...
 
void write_simple_variable (ostream &strm, BaseType *var)
 This function is used by the Byte, ..., URL types to write their entries in the HTML Form. More...
 

Variables

const string allowable
 
const string java_code
 
WWWOutputwo = 0
 

Function Documentation

BaseType * dap_html_form::basetype_to_wwwtype ( BaseType *  bt)

Given a BaseType variable, return a pointer to a new variable that has the same parent types (Byte, et c.) but is now one of the WWW specializations.

Parameters
btA BaseType such as NCArray, HDFArray, ...
Returns
A BaseType that uses the WWW specialization (e.g., WWWArray).

Definition at line 70 of file get_html_form.cc.

Referenced by dds_to_www_dds(), WWWArray::WWWArray(), WWWGrid::WWWGrid(), WWWSequence::WWWSequence(), and WWWStructure::WWWStructure().

DDS * dap_html_form::dds_to_www_dds ( DDS *  dds)

Given a DDS filled with variables that are one specialization of BaseType, build a second DDS which contains variables made using the WWW specialization.

Parameters
ddsA DDS
Returns
A DDS where each variable in dds is now a WWW* variable.

Definition at line 110 of file get_html_form.cc.

References basetype_to_wwwtype().

Referenced by BESWWWTransmit::send_basic_form().

Here is the call graph for this function:

string dap_html_form::fancy_typename ( BaseType *  v)

Return a string which describes the datatype of a DODS variable.

Parameters
vThe variable.
Returns
A string describing the variable's type.

Definition at line 365 of file get_html_form.cc.

Referenced by WWWInt16::print_val(), and write_simple_variable().

string dap_html_form::get_fqn ( BaseType *  var)

Get the Fully Qualified Name for a variable.

This function uses the BaseType name() and get_parent() methods to 'walk up' the hierarchy and build the FQN for a given variable.

Returns
The FQN for a variable
Parameters
varThe variable.

Definition at line 346 of file get_html_form.cc.

Referenced by WWWInt16::print_val(), and write_simple_variable().

string dap_html_form::name_for_js_code ( const string &  dods_name)

Generate variable names to be used by the JavaScript code.

These names must not interfere with JavaScript itself, which seems to have an always expanding set of reserved words. Maybe that's stopped now (1/25/2001 jhrg) but the set is large and includes words such as `Location' which is also a dataset variable name. By making the JS variable names `dods_' the HTML/JS page/code is still readable without stepping on JS' reserved words.

Note that this is a function and not a class member; I included it in the WWWOutput class since it seems to fit here.

Parameters
dods_nameA string that contains the name of a variable.
Returns
A name suitable for use in JavaScript code similar to the #dods_name# parameter.

Definition at line 334 of file get_html_form.cc.

Referenced by write_simple_variable().

void dap_html_form::write_html_form_interface ( ostream &  strm,
DDS *  dds,
const string &  url,
bool  html_header,
bool  netcdf3_file_response,
bool  netcdf4_file_response,
const string &  admin_name,
const string &  help_location 
)

Using the stuff in WWWOutput and the hacked (specialized) print_val() methods in the WWW* classes, write out the HTML form interface.

Todo:
Modify this code to expect a DDS whose BaseTypes are loaded with Attribute tables.
Parameters
destWrite HTML here.
ddsA DataDDS loaded with data; the BaseTypes in this must be WWW* instances,
urlThe URL that should be initially displayed in the form. The form's javascript code will update this incrementally as the user builds a constraint.
html_headerPrint a HTML header/footer for the page. True by default.
admin_name"support@opendap.org" by default; use this as the address for support printed on the form.
help_location"http://www.opendap.org/online_help_files/opendap_form_help.html" by default; otherwise, this is locataion where an HTML document that explains the page can be found.

Definition at line 269 of file get_html_form.cc.

References java_code, WWWOutput::write_disposition(), WWWOutput::write_global_attributes(), WWWOutput::write_html_header(), and WWWOutput::write_variable_entries().

Referenced by BESWWWTransmit::send_basic_form().

Here is the call graph for this function:

void dap_html_form::write_simple_variable ( FILE *  os,
BaseType *  var 
)

This function is used by the Byte, ..., URL types to write their entries in the HTML Form.

Write out the HTML for simple type variables.

More complex classes do something else. Output HTML entry for Scalars

Parameters
osWrite to this output sink.
nameThe name of the variable.
typeThe name of the variable's data type.

This is used not only for single instances of simple types, but also for those types when they appear within Structure and Sequence types.

Parameters
nameThe name of the varaible.

Definition at line 429 of file get_html_form.cc.

Referenced by WWWFloat64::print_val(), WWWInt16::print_val(), WWWUInt32::print_val(), WWWInt32::print_val(), WWWUInt16::print_val(), WWWStr::print_val(), WWWByte::print_val(), and WWWFloat32::print_val().

void dap_html_form::write_simple_variable ( ostream &  strm,
BaseType *  var 
)

This function is used by the Byte, ..., URL types to write their entries in the HTML Form.

More complex classes do something else. Output HTML entry for Scalars

Parameters
strmWrite to this output stream.
nameThe name of the variable.
typeThe name of the variable's data type.

Definition at line 446 of file get_html_form.cc.

References fancy_typename(), get_fqn(), and name_for_js_code().

Here is the call graph for this function:

Variable Documentation

const string dap_html_form::allowable
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"

Definition at line 324 of file get_html_form.cc.

const string dap_html_form::java_code

Definition at line 6 of file get_html_form.cc.

Referenced by write_html_form_interface().

WWWOutput * dap_html_form::wo = 0

Definition at line 63 of file get_html_form.cc.

Referenced by WWWStructure::print_val(), and WWWSequence::print_val().