Package quadbase.common.param
Class HtmlParameterPageWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
quadbase.common.param.ParameterPageWriter
quadbase.common.param.HtmlParameterPageWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
CssHtmlParameterPageWriter
Writer that writes ParameterPage in HTML format. The entire HTML parameter page can be written by
the method writePage(). Further, sub-components of the entire HTML parameter page can also be
written by using the writeBody(), writeHead(), writeXXX methods.
The following is an outline for the parameter page generated: <head> // generated through the writeHead() method <link> // points to the location of the style sheet </head> <body> // generated through the writeBody() method <div> // generated through the writeTableTitle() method </div> <form> // generated through the writeBodyBody() method in the superclass <table> <td> // display parameter titles, </td> <td> <div> // display parameter values or inputbox, </div> </td> // ... Repeat for each parameter </table> <input type="submit"> // button to submit the form <input type="reset"> // button to reset the form </form> </body>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected quadbase.common.param.HtmlWriterthe underlying HTML writerprotected Stringname of the serverprotected Stringpath to the servlet classes (ex.protected Stringname of the servletprotected intthe port the servlets container is running onFields inherited from class quadbase.common.param.ParameterPageWriter
alignment, backgroundColor, backgroundImage, dateParameterCalendar, dateParameterCalendarDatepicker, dateParameterSelection, dateVariable, dateVariableDatepicker, dbInfo, docTitle, extraFormContent, footer, format, header, page, paramDateFormat, paramNameArr, paramPageExportFormats, paramPageLayout, paramPageResetEnabled, paramValueArr, securityLevel, tableBackgroundColor, tableBorderColor, tableBorderThickness, tableOuterBorderOnly, targetLoc, textColor, textFont, textSize, textStyle, titleText, titleTextColor, titleTextFont, titleTextSize, titleTextStyleFields inherited from class java.io.PrintWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionHtmlParameterPageWriter(ParameterPage page, Writer out) Allocates a HtmlParameterPageWriter writing to a specified output with specified ParameterPage content. -
Method Summary
Modifier and TypeMethodDescriptionboolean[]Gets whether each parameter is a hidden parameter with value of the parameter's default value.protected quadbase.common.param.HtmlWriterGets the underlying HTML Writer.String[]Gets the array of parameter display names.protected StringGets the full address of the servlet extracted from the ParameterPage.protected voidprintCalendarJavascript(String name, Param param) protected voidvoidsetHiddenParameters(boolean[] state) Sets whether each parameter is a hidden parameter with value of the parameter's default value.voidsetHiddenParameterValues(Object[] val) Sets whether each parameter is a hidden parameter with specific value The order of the Object[] is according to getParamDisplayNames, or the order in which the parameters appear when using report.getAllParameters().get(i).voidsetJavaScriptLibPath(String javaScriptLibPath) voidsetParamDisplayNames(String[] names) Sets the array of parameter display names.voidWrites the content between the <body> and </body> tags (writes tags as well) of the HTML parameter page and centers it on the page.voidWrites only the main components (table title, form, parameter table, form buttons) of the contents inside the <body> and </body> tags (does not write tags) of the HTML parameter page.protected voidWrites the conclusion/footer component (the String footer that is set using ParameterPage.setFooter()) of the contents inside the <body> and </body> tags of the HTML parameter page.protected voidWrites the preface/header component (the String header that is set using ParameterPage.setHeader()) of the contents inside the <body> and </body> tags of the HTML parameter page.protected voidWrites the form buttons (submit and reset).voidWrites only the content between the <head> and </head> tags of the parameter page.protected voidprotected voidwriteHiddenParamValue(String name, String value) Writes a hidden parameter value component.voidWrites the entire parameter page to the output writer in HTML format.protected voidWrites the page exporting formats selection list.protected voidwriteParamName(String paramName) Writes a parameter name component inside the parameter table.voidWrites the HTML code for the parameter table.voidwriteParamTable(boolean getDistinctValue) protected voidwriteParamTableCategory(String paramName, String tdAttributes) Writes a parameter table category component inside the parameter table enclosed in <TD> and </TD> tags.protected voidWrites the </TABLE> tag for the parameter table.protected voidwriteParamTableMain(String tableDataBorderColorStr, boolean getDistinctValue) Writes a part of the parameter table for main report parameters.protected voidWrites the <TABLE> tag for the parameter table.protected voidwriteParamTableValue(String name, String value, String tdAttributes) Writes a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags.protected voidwriteParamTableValue(String name, String value, String tdAttributes, Param param) Writes a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags.protected voidwriteParamTableValues(String name, String selectAttributes, Vector values, String paramValue, String tdAttributes) Writes a parameter table values component inside the parameter table enclosed in <TD> and </TD> tags.protected voidwriteParamValue(String name, String value) Writes a parameter value component.protected voidwriteParamValue(String name, String value, Param param) Writes a parameter value component.protected voidwriteParamValueDate(String name, String value, Param param) Writes the parameter value component.protected voidwriteParamValues(String name, String attributes, Vector values, String paramValue) Writes a parameter values component.protected voidwriteParamValuesOptions(Vector values, String paramValue) protected quadbase.common.param.CompleteParamPromptwriteParamValuesOptionsYUI(Vector values, String paramValue) protected voidWrites the reset button.protected voidWrites the submit button.voidWrites the title of the parameter table.Methods inherited from class quadbase.common.param.ParameterPageWriter
refreshMethods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, writeMethods inherited from class java.io.Writer
nullWriter
-
Field Details
-
DEFAULT_TIMESTAMP_FORMAT
- See Also:
-
DEFAULT_DATE_FORMAT
- See Also:
-
servletName
name of the servlet -
serverName
name of the server -
servletDirectory
path to the servlet classes (ex. servlet/) -
servletRunnerPort
protected int servletRunnerPortthe port the servlets container is running on -
html
protected quadbase.common.param.HtmlWriter htmlthe underlying HTML writer
-
-
Constructor Details
-
HtmlParameterPageWriter
Allocates a HtmlParameterPageWriter writing to a specified output with specified ParameterPage content.- Parameters:
page- the ParameterPage to writeout- the output to write to
-
-
Method Details
-
writePage
Writes the entire parameter page to the output writer in HTML format.- Specified by:
writePagein classParameterPageWriter- Throws:
IOException
-
writeBody
public void writeBody()Writes the content between the <body> and </body> tags (writes tags as well) of the HTML parameter page and centers it on the page. This includes the table title, form, parameter table and form buttons. -
writeBodyBody
public void writeBodyBody()Writes only the main components (table title, form, parameter table, form buttons) of the contents inside the <body> and </body> tags (does not write tags) of the HTML parameter page. If using CssHtmlParameterPageWriter, the following CSS Tags are used:-
<table class="paramTable"invalid input: '>'
<td class="paramTableCategory">
<td class="paramTableValues">
<div class="paramValue_X"> // X represents the index of the parameter
<select class="paramValue_X_input"> // X represents the index of the parameter
<input class="submitButton">
<input class="resetButton"> -
writeTableTitle
public void writeTableTitle()Writes the title of the parameter table. -
writeHead
public void writeHead()Writes only the content between the <head> and </head> tags of the parameter page. -
writeParamTable
public void writeParamTable()Writes the HTML code for the parameter table. -
writeParamTable
public void writeParamTable(boolean getDistinctValue) -
writeParamTableMain
Writes a part of the parameter table for main report parameters. -
writeBodyHeader
protected void writeBodyHeader()Writes the preface/header component (the String header that is set using ParameterPage.setHeader()) of the contents inside the <body> and </body> tags of the HTML parameter page. -
writeParamTableOpenTag
protected void writeParamTableOpenTag()Writes the <TABLE> tag for the parameter table. -
writeParamTableCloseTag
protected void writeParamTableCloseTag()Writes the </TABLE> tag for the parameter table. -
writeParamTableCategory
Writes a parameter table category component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table category is a generalized component for all parameter names.- Parameters:
paramName- the name of the parametertdAttributes- the attributes for the <TD> tag
-
writeParamName
Writes a parameter name component inside the parameter table. A parameter name is the name of the parameter that is shown to identify a parameter.- Parameters:
paramName- the name of the parameter
-
writeParamTableValues
protected void writeParamTableValues(String name, String selectAttributes, Vector values, String paramValue, String tdAttributes) Writes a parameter table values component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table values component is a generalized component for all parameter values components.- Parameters:
name- the name of the INPUT elementselectAttributes- the attributes for the selection listvalues- the list of possible values that the parameter can takeparamValue- the selected parameter valuetdAttributes- the attributes for the <TD> tag
-
writeParamTableValue
Writes a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table value component is a generalized component for all parameter value components.- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxtdAttributes- the attributes for the <TD> tag
-
writeParamTableValue
Writes a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table value component is a generalized component for all parameter value components.- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxtdAttributes- the attributes for the <TD> tagparam- the Param object that represents a parameter
-
writeParamValue
Writes a parameter value component. A parameter value component is an input text box for inputting a parameter value for a parameter.- Parameters:
name- the name of the INPUT elementvalue- the default value of the text box
-
writeHiddenParamValue
Writes a hidden parameter value component. A parameter value component is an hidden input box with value from the default value of the parameter.- Parameters:
name- the name of the INPUT elementvalue- the default value of the parameter
-
writeParamValueDate
Writes the parameter value component. If it is a date and date parameter selection is OFF and date parameter calendar is ON, prints the calendar javascript image and function call.- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxparam- the parameter that holds information about custom date format if applicable.
-
writeParamValue
Writes a parameter value component. A parameter value component is an input text box for inputting a parameter value for a parameter.- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxparam- the Param object that represents a query parameter
-
writeParamValues
Writes a parameter values component. A parameter values component is a select list for choosing the parameter value for a parameter.- Parameters:
name- the name of the SELECT elementattributes- the String of attributes to be included in the SELECT element (ex. <SELECT attributes></SELECT>values- a vector of values to be included in the options of the select listparamValue- the value to be selected, if it exists in the VALUES argument
-
writeParamValuesOptions
-
writeParamValuesOptionsYUI
-
writePageExportFormats
protected void writePageExportFormats()Writes the page exporting formats selection list. -
writeFormButtons
protected void writeFormButtons()Writes the form buttons (submit and reset). -
writeSubmitButton
protected void writeSubmitButton()Writes the submit button. -
writeResetButton
protected void writeResetButton()Writes the reset button. -
printDateVariableJavascript
-
printCalendarJavascript
-
writeHeadJavascript
protected void writeHeadJavascript() -
getParamDisplayNames
Gets the array of parameter display names. -
setParamDisplayNames
Sets the array of parameter display names. Can be used to change the final display name of the parameter when written in HTML. -
setJavaScriptLibPath
-
setHiddenParameterValues
Sets whether each parameter is a hidden parameter with specific value The order of the Object[] is according to getParamDisplayNames, or the order in which the parameters appear when using report.getAllParameters().get(i).- Parameters:
the- i'th parameter value
-
getServletName
Gets the full address of the servlet extracted from the ParameterPage. For example, http://<ip>:<port>/<servlet-dir>/ParamReportGeneratorServlet -
getHtmlWriter
protected quadbase.common.param.HtmlWriter getHtmlWriter()Gets the underlying HTML Writer. Use this to add HTML Tags to the parameter page. -
getHiddenParameters
public boolean[] getHiddenParameters()Gets whether each parameter is a hidden parameter with value of the parameter's default value. Please see setHiddenParameters(boolean[]) for more detail. Default is all false (nothing is hidden) -
setHiddenParameters
public void setHiddenParameters(boolean[] state) Sets whether each parameter is a hidden parameter with value of the parameter's default value. The order of the boolean[] is according to getParamDisplayNames, or the order in which the parameters appear when using report.getAllParameters().get(i).- Parameters:
the- i'th parameter is hidden if state[i] = true
-