|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ccl.servlet.HTML
This class encapsulates printing of html code in a very basic way without any fancy output support.
Constructor Summary | |
HTML(javax.servlet.http.HttpServletResponse response_)
All following output goes to the given HttpServletResponse object. |
|
HTML(java.io.PrintWriter writer)
All following output goes to the given writer object. |
|
HTML(java.io.Writer writer)
All following output goes to the given writer object. |
Method Summary | |
void |
close()
This method prints a closing body and html tag. |
void |
endDataTableLine()
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
endTableLine()
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
static void |
exportCSV(javax.servlet.http.HttpServletResponse response,
java.sql.ResultSet result)
This method does not print html output but instead creates a csv file which can be used to import into a spread sheet application like Excel or StarCalc. |
static HTML |
getDummyHTML()
Create a dummy html object useful for testing. |
void |
print(java.lang.String sHTML_)
This method prints the given string unfiltered as html without any html formatting. |
void |
printBR()
Prints a tag. |
void |
printBR(java.lang.String sText)
Prints the text and adds a tag. |
void |
printDataTableHeader(java.lang.String header)
Add header entry to table. |
void |
printDataTableHeader(java.lang.String header,
java.lang.String align)
Add header entry to table. |
void |
printDataTableHeader(java.lang.String header,
java.lang.String align,
int colspan)
Add header entry to table. |
void |
printDataTableStart(java.lang.String headerBGColor,
java.lang.String secondBGColor)
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
printDataTableValue(java.lang.String value)
Add value entry to table. |
void |
printDataTableValue(java.lang.String value,
java.lang.String align)
Add value entry to table. |
void |
printDataTableValue(java.lang.String value,
java.lang.String align,
int colspan)
Add value entry to table. |
void |
printFormularHidden(java.lang.String sName_,
java.lang.String sValue_)
This method prints an input tag with hidden data. |
void |
printFormularOperationMode()
Let the user select if the formular entry should be use in "add", "change", or "delete" mode. |
void |
printFormularSelection(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String[] asValue_,
java.lang.String sDefault_)
This method prints a formular select tag with the given values. |
void |
printFormularSelection(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String[] asValue_,
java.lang.String[] asRepresentation_)
This method prints a formular select tag with the given values. |
void |
printFormularSelection(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String[] asValue_,
java.lang.String[] asRepresentation_,
java.lang.String sDefaultValue_)
This method prints a formular select tag with the given values. |
void |
printFormularSelection(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String sSqlQuery_,
java.lang.String sDefaultValue_,
java.sql.Statement statement_)
This method prints a formular select tag. |
void |
printFormularSelection(java.lang.String sMessage_,
java.lang.String sName_,
java.util.Vector vValues_,
java.util.Vector vRepresentations_,
java.lang.String sDefaultValue_)
This method prints a formular select tag with the given values. |
void |
printFormularStart(java.lang.String sMethod_,
java.lang.String sAction_)
This method prints the start tag of an html formular. |
void |
printFormularSubmit()
This method prints a submit button for use in an html formular. |
void |
printFormularSubmit(java.lang.String label)
This method prints a submit button for use in an html formular. |
void |
printFormularTextArea(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String sDefault_)
Adds a text area to the formular. |
void |
printFormularTextInput(java.lang.String sMessage_,
java.lang.String sName_)
This method prints a text input tag. |
void |
printFormularTextInput(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String sDefault_)
This method prints a text input tag. |
void |
printFormularTextInput(java.lang.String sMessage_,
java.lang.String sName_,
java.lang.String sDefault_,
int size)
This method prints a text input tag. |
void |
printLink(java.lang.String sText,
java.lang.String sURL)
Prints an html link to the page. |
void |
println(java.lang.String sLine_)
This method prints the given string unfiltered as html without any html formatting. |
void |
printP()
Prints a |
void |
printP(java.lang.String sText)
Prints the text and adds a |
void |
printResultSet(java.lang.String headerBGColor,
java.lang.String secondBGColor,
java.sql.ResultSet result)
Prints the content of a jdbc result set via a data table. |
void |
printTableEnd()
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
printTableStart()
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
printTableValue(java.lang.String value)
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
printTableValue(java.lang.String value,
java.lang.String align)
Table methods provide a service where the user can just add new value entries to the table, specify when a line is finished etc. |
void |
printTitle(java.lang.String sTitle_)
This method prints a title, closes the html head section, starts the body section, and prints an h1 section with the same text as the title. |
void |
printTitle(java.lang.String sTitle_,
java.lang.String bgcolor)
This method prints a title, closes the html head section, starts the body section, and prints an h1 section with the same text as the title. |
void |
printTitle(java.lang.String title,
java.lang.String bgcolor,
java.lang.String textcolor)
This method prints a title, closes the html head section, starts the body section, and prints an h1 section with the same text as the title. |
void |
printTitle(java.lang.String title,
java.lang.String bgcolor,
java.lang.String textcolor,
java.lang.String linkcolor,
java.lang.String vlinkcolor)
This method prints a title, closes the html head section, starts the body section, and prints an h1 section with the same text as the title. |
static java.lang.String |
spacify(java.lang.String value)
Return " " in case the given value is null or an empty string, otherwise the given value is returned. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HTML(javax.servlet.http.HttpServletResponse response_) throws java.io.IOException
java.io.IOException
- in case no print writer
could be created from the
response object.public HTML(java.io.Writer writer)
public HTML(java.io.PrintWriter writer)
Method Detail |
public static HTML getDummyHTML()
public void printTitle(java.lang.String sTitle_)
public void printTitle(java.lang.String sTitle_, java.lang.String bgcolor)
public void printTitle(java.lang.String title, java.lang.String bgcolor, java.lang.String textcolor)
title
- the title string to print.bgcolor
- the background color of the web page.
Use standard HTML syntax like "#ffffff".textcolor
- the foreground color of the web page.
Use standard HTML syntax like "#000000".public void printTitle(java.lang.String title, java.lang.String bgcolor, java.lang.String textcolor, java.lang.String linkcolor, java.lang.String vlinkcolor)
title
- the title string to print.bgcolor
- the background color of the web page.
Use standard HTML syntax like "#ffffff".textcolor
- the foreground color of the web page.
Use standard HTML syntax like "#000000".linkcolor
- the color used for new links.vlinkcolor
- the color used for visited links.public void print(java.lang.String sHTML_)
public void println(java.lang.String sLine_)
public void printBR()
public void printBR(java.lang.String sText)
public void printP()
tag.
public void printP(java.lang.String sText)
tag.
public void printFormularStart(java.lang.String sMethod_, java.lang.String sAction_)
public void printFormularHidden(java.lang.String sName_, java.lang.String sValue_)
public void printFormularTextInput(java.lang.String sMessage_, java.lang.String sName_)
public void printFormularTextArea(java.lang.String sMessage_, java.lang.String sName_, java.lang.String sDefault_)
public void printFormularTextInput(java.lang.String sMessage_, java.lang.String sName_, java.lang.String sDefault_, int size)
public void printFormularTextInput(java.lang.String sMessage_, java.lang.String sName_, java.lang.String sDefault_)
public void printFormularSelection(java.lang.String sMessage_, java.lang.String sName_, java.lang.String[] asValue_, java.lang.String sDefault_)
public void printFormularSelection(java.lang.String sMessage_, java.lang.String sName_, java.lang.String[] asValue_, java.lang.String[] asRepresentation_, java.lang.String sDefaultValue_)
public void printFormularSelection(java.lang.String sMessage_, java.lang.String sName_, java.lang.String[] asValue_, java.lang.String[] asRepresentation_)
public void printFormularSelection(java.lang.String sMessage_, java.lang.String sName_, java.util.Vector vValues_, java.util.Vector vRepresentations_, java.lang.String sDefaultValue_)
public void printFormularSelection(java.lang.String sMessage_, java.lang.String sName_, java.lang.String sSqlQuery_, java.lang.String sDefaultValue_, java.sql.Statement statement_) throws java.sql.SQLException
java.sql.SQLException
- if the db query fails.public void printFormularOperationMode()
public void printFormularSubmit()
public void printFormularSubmit(java.lang.String label)
label
- a name or label which appears on
the submit button.public void printLink(java.lang.String sText, java.lang.String sURL)
public void printTableStart()
public void printTableValue(java.lang.String value)
public void printTableValue(java.lang.String value, java.lang.String align)
public void endTableLine()
public void printTableEnd()
public void printDataTableStart(java.lang.String headerBGColor, java.lang.String secondBGColor)
public void printDataTableHeader(java.lang.String header)
public void printDataTableHeader(java.lang.String header, java.lang.String align)
public void printDataTableHeader(java.lang.String header, java.lang.String align, int colspan)
public void printDataTableValue(java.lang.String value)
public void printDataTableValue(java.lang.String value, java.lang.String align)
public void printDataTableValue(java.lang.String value, java.lang.String align, int colspan)
public void endDataTableLine()
public void printResultSet(java.lang.String headerBGColor, java.lang.String secondBGColor, java.sql.ResultSet result) throws java.sql.SQLException
headerBGColor
- HTML color scheme for background
for table header backround,
for example "#ffcc00".secondBGColor
- HTML color scheme for background
of every second data row,
for example "#c8c8c8".
java.sql.SQLException
- if accessing db meta data
fails this exception is
thrown.public void close()
public static java.lang.String spacify(java.lang.String value)
public static void exportCSV(javax.servlet.http.HttpServletResponse response, java.sql.ResultSet result) throws java.io.IOException, java.sql.SQLException
java.io.IOException
- in case anything goes wrong
writing output to the http
servlet response.
java.sql.SQLException
- in case anything goes wrong
with the database.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |