OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESHTMLInfo Class Reference

represents an html formatted response object More...

#include <BESHTMLInfo.h>

Inheritance diagram for BESHTMLInfo:
Inheritance graph
Collaboration diagram for BESHTMLInfo:
Collaboration graph

Public Member Functions

virtual void add_break (unsigned long num_breaks)
 add a line break to the information More...
 
virtual void add_data (const string &s)
 add data to this informational object. More...
 
virtual void add_data_from_file (const string &key, const string &name)
 add data from a file to the informational object More...
 
virtual void add_exception (BESError &e, const string &admin)
 add exception information to this informational object More...
 
virtual void add_space (unsigned long num_spaces)
 add a space to the informational response More...
 
virtual void add_tag (const string &tag_name, const string &tag_data, map< string, string > *attrs=0)
 add tagged information to the inforamtional response More...
 
virtual void begin_response (const string &response_name, BESDataHandlerInterface &dhi)
 begin the informational response More...
 
virtual void begin_tag (const string &tag_name, map< string, string > *attrs=0)
 begin a tagged part of the information, information to follow More...
 
 BESHTMLInfo ()
 constructs an html formatted information response object. More...
 
 BESHTMLInfo (const string &key, ostream *strm, bool strm_owned)
 constructs a basic text information response object. More...
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual void end_response ()
 end the response More...
 
virtual void end_tag (const string &tag_name)
 end a tagged part of the informational response More...
 
virtual bool is_buffered ()
 return whether the information is to be buffered or not. More...
 
virtual void print (ostream &strm)
 print the information from this informational object to the specified stream More...
 
virtual void transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
 transmit the text information as text More...
 
virtual ~BESHTMLInfo ()
 

Static Public Member Functions

static BESInfoBuildHTMLInfo (const string &info_type)
 

Protected Attributes

bool _buffered
 
string _response_name
 
bool _response_started
 
ostream * _strm
 
bool _strm_owned
 
stack< string > _tags
 

Detailed Description

represents an html formatted response object

Uses the default add_data method, but overwrites print method in order to set the mime type to html.

See also
BESInfo
BESResponseObject

Definition at line 46 of file BESHTMLInfo.h.

Constructor & Destructor Documentation

BESHTMLInfo::BESHTMLInfo ( )

constructs an html formatted information response object.

See also
BESInfo
BESResponseObject

Definition at line 50 of file BESHTMLInfo.cc.

Referenced by BuildHTMLInfo().

BESHTMLInfo::BESHTMLInfo ( const string &  key,
ostream *  strm,
bool  strm_owned 
)

constructs a basic text information response object.

Uses the default specified key in the bes configuration file to determine whether the information should be buffered or not.

See also
BESInfo
BESResponseObject

Definition at line 65 of file BESHTMLInfo.cc.

BESHTMLInfo::~BESHTMLInfo ( )
virtual

Definition at line 72 of file BESHTMLInfo.cc.

Member Function Documentation

void BESHTMLInfo::add_break ( unsigned long  num_breaks)
virtual

add a line break to the information

Parameters
num_breaksthe number of line breaks to add to the information

Implements BESInfo.

Definition at line 205 of file BESHTMLInfo.cc.

References add_data().

Here is the call graph for this function:

void BESHTMLInfo::add_data ( const string &  s)
virtual

add data to this informational object.

If buffering is not set then the information is output directly to the output stream.

Formatting is up to the user

Parameters
sinformation to be added to this response object

Reimplemented from BESInfo.

Definition at line 227 of file BESHTMLInfo.cc.

References BESInfo::_buffered, BESInfo::_strm, BESInfo::add_data(), and BESUtil::set_mime_html().

Referenced by add_break(), add_space(), add_tag(), begin_response(), begin_tag(), and end_response().

Here is the call graph for this function:

void BESHTMLInfo::add_data_from_file ( const string &  key,
const string &  name 
)
virtual

add data from a file to the informational object

This method simply adds a .HTML to the end of the key and passes the request on up to the BESInfo parent class.

Parameters
keyKey from the initialization file specifying the file to be
nameA description of what is the information being loaded

Reimplemented from BESInfo.

Definition at line 250 of file BESHTMLInfo.cc.

References BESInfo::add_data_from_file().

Here is the call graph for this function:

void BESInfo::add_exception ( BESError e,
const string &  admin 
)
virtualinherited

add exception information to this informational object

Exception information is added differently to different informational objects, such as html, xml, plain text. But, using the other methods of this class we can take care of exceptions here.

Parameters
eThe exception to add to the informational response object
adminThe contact information for the person responsible for this error

Reimplemented in BESVersionInfo, BESDapErrorInfo, and BESSilentInfo.

Definition at line 255 of file BESInfo.cc.

References BESInfo::add_tag(), BESInfo::begin_tag(), BESInfo::end_tag(), BESError::get_error_type(), BESError::get_file(), BESError::get_line(), and BESError::get_message().

Referenced by BESVersionInfo::add_exception(), and BESExceptionManager::handle_exception().

Here is the call graph for this function:

void BESHTMLInfo::add_space ( unsigned long  num_spaces)
virtual

add a space to the informational response

Parameters
num_spacesthe number of spaces to add to the information

Implements BESInfo.

Definition at line 189 of file BESHTMLInfo.cc.

References add_data().

Here is the call graph for this function:

void BESHTMLInfo::add_tag ( const string &  tag_name,
const string &  tag_data,
map< string, string > *  attrs = 0 
)
virtual

add tagged information to the inforamtional response

Parameters
tag_namename of the tag to be added to the response
tag_datainformation describing the tag
attrsmap of attributes to add to the tag

Implements BESInfo.

Definition at line 125 of file BESHTMLInfo.cc.

References add_data(), and BESInfo::add_data().

Here is the call graph for this function:

void BESHTMLInfo::begin_response ( const string &  response_name,
BESDataHandlerInterface dhi 
)
virtual

begin the informational response

Because this is text informational object, no begin tags are needed

Parameters
response_namename of the response this information represents
dhiinformation about the request and response

Reimplemented from BESInfo.

Definition at line 84 of file BESHTMLInfo.cc.

References add_data(), and BESInfo::begin_response().

Here is the call graph for this function:

void BESHTMLInfo::begin_tag ( const string &  tag_name,
map< string, string > *  attrs = 0 
)
virtual

begin a tagged part of the information, information to follow

Parameters
tag_namename of the tag to begin
attrsmap of attributes to begin the tag with

Reimplemented from BESInfo.

Definition at line 150 of file BESHTMLInfo.cc.

References add_data(), BESInfo::add_data(), and BESInfo::begin_tag().

Here is the call graph for this function:

BESInfo * BESHTMLInfo::BuildHTMLInfo ( const string &  info_type)
static

Definition at line 292 of file BESHTMLInfo.cc.

References BESHTMLInfo().

Referenced by BESDefaultModule::initialize().

Here is the call graph for this function:

void BESHTMLInfo::dump ( ostream &  strm) const
virtual

dumps information about this object

Displays the pointer value of this instance along with values of private data members.

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from BESInfo.

Definition at line 279 of file BESHTMLInfo.cc.

References BESInfo::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Here is the call graph for this function:

void BESHTMLInfo::end_response ( )
virtual

end the response

Add the terminating tags for the response and for the response name. If there are still tags that have not been closed then an exception is thrown.

Reimplemented from BESInfo.

Definition at line 108 of file BESHTMLInfo.cc.

References add_data().

Here is the call graph for this function:

void BESHTMLInfo::end_tag ( const string &  tag_name)
virtual

end a tagged part of the informational response

If the named tag is not the current tag then an error is thrown.

Parameters
tag_namename of the tag to end

Reimplemented from BESInfo.

Definition at line 177 of file BESHTMLInfo.cc.

References BESInfo::end_tag().

Here is the call graph for this function:

virtual bool BESInfo::is_buffered ( )
inlinevirtualinherited

return whether the information is to be buffered or not.

Returns
true if information is buffered, false if not

Definition at line 123 of file BESInfo.h.

References BESInfo::_buffered.

Referenced by BESBasicHttpTransmitter::send_html(), BESBasicTransmitter::send_html(), BESBasicTransmitter::send_text(), and BESBasicHttpTransmitter::send_text().

void BESInfo::print ( ostream &  strm)
virtualinherited

print the information from this informational object to the specified stream

If the information was not buffered then this method does nothing, otherwise the information is output to the specified ostream.

Parameters
strmoutput to this file descriptor if information buffered.

Reimplemented in BESVersionInfo, BESXMLInfo, BESDapErrorInfo, and BESSilentInfo.

Definition at line 283 of file BESInfo.cc.

References BESInfo::_buffered, and BESInfo::_strm.

Referenced by BESInterface::finish(), BESVersionInfo::print(), BESBasicTransmitter::send_html(), BESBasicTransmitter::send_text(), and BESInterface::transmit_data().

void BESHTMLInfo::transmit ( BESTransmitter transmitter,
BESDataHandlerInterface dhi 
)
virtual

transmit the text information as text

use the send_html method on the transmitter to transmit the html formatted information back to the client

Parameters
transmitterThe type of transmitter to use to transmit the info
dhiinformation to help with the transmission

Implements BESInfo.

Definition at line 265 of file BESHTMLInfo.cc.

References BESTransmitter::send_html().

Here is the call graph for this function:

Member Data Documentation

bool BESInfo::_buffered
protectedinherited
bool BESInfo::_response_started
protectedinherited

Definition at line 74 of file BESInfo.h.

Referenced by BESInfo::begin_response(), BESInfo::dump(), and BESInfo::end_response().

ostream* BESInfo::_strm
protectedinherited
bool BESInfo::_strm_owned
protectedinherited

Definition at line 72 of file BESInfo.h.

Referenced by BESInfo::BESInfo(), and BESInfo::~BESInfo().

stack<string> BESInfo::_tags
protectedinherited

The documentation for this class was generated from the following files: