Package quadbase.common.param
Class ParameterPage
java.lang.Object
quadbase.common.param.ParameterPage
- Direct Known Subclasses:
ChartParameterPage,ReportParameterPage
A page that user specifies parameters for a parameterized report or parameterized chart.
Typically, the use of a ParameterPage involves a ParameterPageWriter and the code is as
follows:
ParameterPage paramPage = ...; //QbReport.getParameterPage() or QbChart.getParameterPage()
Writer writer = new PrintWriter(out);
HtmlParameterPageWriter paramPageWriter =
new HtmlParameterPageWriter(paramPage, writer);
paramPageWriter.writePage();
writer.flush();
writer.close();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intprotected Parametersstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionParameterPage(Parameters params, quadbase.common.util.IQueryFileInfo dbInfo, String servletName, String[] paramPageExportFormats, String targetLoc, int format, boolean paramPageResetEnabled, int paramPageLayout, String extraFormContent) Allocates a new ParameterPage that represents a parameter page object. -
Method Summary
Modifier and TypeMethodDescriptionintGets the horizontal alignment of the parameter pageGets the background color of the parameter pageGets the background color of the parameter pageGets the background image of the parameter pagebooleanGets the state to use a pop-up calendar to choose a date for date parametersGets the path to the javascript and images of the pop-up calendarbooleanGets the state to use a select drop down list to choose a date for date parametersbooleanGets the state to use a pop-up date calculater to choose a date for date parametersGets the path to the javascript and images of the pop-up date calculaterquadbase.common.util.IQueryFileInfointernal use only.Gets the title of the HTML documentinternal use only.Gets the text that appears at the end of the Parameter pageintGets the only exporting report or chart formatGets the text that appears at the beginning of the Parameter pageGets custom JavaScript action that should be done before submitting parameter formGets all parameters informationfunction to obtain the form name where the parameter dialog table will be put intoString[]internal use only.Gets the display name of the Reset button.booleanGets the visibility of the HTML Reset form buttonGets the name of the servletGets the display name of the Submit button.Gets the background color of the parameter tableGets the background color of the parameter tableGets the color of the parameter table borderGets the color of the parameter table borderintGets the thickness of the parameter table borderintGets the parameter table Layout (VERTICAL or HORIZONTAL)booleanGets whether only the outer border of the parameter table will be displayed.Gets the location of the report or chartGets the text color of the header, footer and parameter namesGets the text color of the header, footer and parameter namesGets the text font of the header, footer and parameter namesintGets the text size of the header, footer and parameter namesintGets the text style of the header, footer and parameter namesGets the text of the parameter table titleGets the text color of the parameter table titleGets the text color of the parameter table titleGets the font of the parameter table titleintGets the text size of the parameter table titleintGets the text style of the parameter table titlevoidsetAlignment(int alignment) Sets the horizontal alignment of the parameter pagevoidsetBackgroundColor(Color color) Sets the background color of the parameter pagevoidsetBackgroundColor(String htmlHex) Sets the background color of the parameter pagevoidsetBackgroundImage(String imagePath) Sets the background image of the parameter pagevoidsetDateParameterCalendar(boolean state, String datepicker) Sets the state to use a pop-up calendar to choose a date for date parameters.voidsetDateParameterSelection(boolean state) Sets the state to use a select drop down list to choose a date for date parametersvoidsetDateVariable(boolean state, String datepicker) Sets the state to use a pop-up date calculater to choose a date for date parameters.voidsetDocumentTitle(String docTitle) Sets the title of the HTML documentvoidSets the text that appears at the end of the Parameter pagevoidSets the text that appears at the beginning of the Parameter pagevoidsetJavaScriptLibPath(String javaScriptLibPath) Sets path to the lib/javascript folder that contains common javascript files such as DataTypeValidator.js, etc.voidsetOnSubmit(String onSubmit) Sets custom JavaScript action that should be done before submitting parameter form.voidsetParamFormName(String paramFormName) Function to set the form name where the parameter dialog table will be put into.voidsetResetDisplayName(String name) Sets the display name of the Reset button.voidsetResetEnabled(boolean state) Sets the visibility of the HTML Reset form buttonvoidsetSubmitDisplayName(String name) Sets the display name of the Submit button.voidsetTableBackgroundColor(Color color) Sets the background color of the parameter tablevoidsetTableBackgroundColor(String htmlHex) Sets the background color of the parameter tablevoidsetTableBorderColor(Color color) Sets the color of the parameter table bordervoidsetTableBorderColor(String htmlHex) Sets the color of the parameter table bordervoidsetTableBorderThickness(int thickness) Sets the thickness of the parameter table bordervoidsetTableLayout(int layout) Sets the parameter table Layout (VERTICAL or HORIZONTAL)voidsetTableOuterBorderOnly(boolean state) Sets whether only the outer border of the parameter table will be displayed.voidsetTextColor(Color color) Sets the text color of the header, footer and parameter namesvoidsetTextColor(String htmlHex) Sets the text color of the header, footer and parameter namesvoidsetTextFont(String fontName) Sets the text font of the header, footer and parameter namesvoidsetTextSize(int size) Sets the text size of the header, footer and parameter namesvoidsetTextStyle(int style) Sets the text style of the header, footer and parameter namesvoidsetTitleText(String title) Sets the text of the parameter table titlevoidsetTitleTextColor(Color color) Sets the text color of the parameter table titlevoidsetTitleTextColor(String htmlHex) Sets the text color of the parameter table titlevoidsetTitleTextFont(String fontName) Sets the font of the parameter table titlevoidsetTitleTextSize(int size) Sets the text size of the parameter table titlevoidsetTitleTextStyle(int style) Sets the text style of the parameter table titletoCssHtmlString(String cssFile) Returns an HTML with embedded CSS classes representation of the parameter page as a String.Returns an HTML representation of the parameter page as a String.
-
Field Details
-
TABLE_LAYOUT_HORIZONTAL
public static final int TABLE_LAYOUT_HORIZONTAL- See Also:
-
TABLE_LAYOUT_VERTICAL
public static final int TABLE_LAYOUT_VERTICAL- See Also:
-
ALIGNMENT_CENTER
public static final int ALIGNMENT_CENTER- See Also:
-
ALIGNMENT_LEFT
public static final int ALIGNMENT_LEFT- See Also:
-
ALIGNMENT_RIGHT
public static final int ALIGNMENT_RIGHT- See Also:
-
params
-
-
Constructor Details
-
ParameterPage
public ParameterPage(Parameters params, quadbase.common.util.IQueryFileInfo dbInfo, String servletName, String[] paramPageExportFormats, String targetLoc, int format, boolean paramPageResetEnabled, int paramPageLayout, String extraFormContent) Allocates a new ParameterPage that represents a parameter page object. This constructor is called internally. Use QbReport.getParameterPage() or QbChart.getParameterPage() to get an instance of a ParameterPage.
-
-
Method Details
-
getParameters
Gets all parameters information -
getDbInfo
public quadbase.common.util.IQueryFileInfo getDbInfo()internal use only. Gets the database information -
getServletName
Gets the name of the servlet -
getParamPageExportFormats
internal use only. Gets the exporting formats. Used for ERES only. -
getTargetLoc
Gets the location of the report or chart -
getFormat
public int getFormat()Gets the only exporting report or chart format -
getExtraFormContent
internal use only. Gets any extra contents for the parameter page form -
toHtmlString
Returns an HTML representation of the parameter page as a String. This method is a shorthand for:-
StringWriter str = new StringWriter();
HtmlParameterPageWriter html = new HtmlParameterPageWriter(this, str);
html.writePage();
return str.toString();- Throws:
IOException
-
toCssHtmlString
Returns an HTML with embedded CSS classes representation of the parameter page as a String. This method is a shorthand for:-
StringWriter str = new StringWriter();
CssHtmlParameterPageWriter css = new CssHtmlParameterPageWriter(this, str);
css.setCssFile(cssFile);
css.writePage();
return str.toString();- Throws:
IOException
-
getAlignment
public int getAlignment()Gets the horizontal alignment of the parameter page- Returns:
- alignment ParameterPage.ALIGNMENT_LEFT, ParameterPage.ALIGNMENT_CENTER or ParameterPage.ALIGNMENT_RIGHT
-
setAlignment
public void setAlignment(int alignment) Sets the horizontal alignment of the parameter page- Parameters:
alignment- ParameterPage.ALIGNMENT_LEFT, ParameterPage.ALIGNMENT_CENTER or ParameterPage.ALIGNMENT_.RIGHT
-
getHeader
Gets the text that appears at the beginning of the Parameter page -
setHeader
Sets the text that appears at the beginning of the Parameter page -
getTableBackgroundColor
Gets the background color of the parameter table- Returns:
- the color as a java.awt.Color object
-
setTableBackgroundColor
Sets the background color of the parameter table- Parameters:
color- the color as a java.awt.Color object
-
getTableBackgroundColorHex
Gets the background color of the parameter table- Returns:
- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
setTableBackgroundColor
Sets the background color of the parameter table- Parameters:
htmlHex- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
getTableBorderColor
Gets the color of the parameter table border- Returns:
- the color as a java.awt.Color object
-
setTableBorderColor
Sets the color of the parameter table border- Parameters:
color- the color as a java.awt.Color object
-
getTableBorderColorHex
Gets the color of the parameter table border- Returns:
- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
setTableBorderColor
Sets the color of the parameter table border- Parameters:
htmlHex- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
getTableBorderThickness
public int getTableBorderThickness()Gets the thickness of the parameter table border- Returns:
- thickness in pixel
-
setTableBorderThickness
public void setTableBorderThickness(int thickness) Sets the thickness of the parameter table border- Parameters:
thickness- thickness in pixel
-
getTableLayout
public int getTableLayout()Gets the parameter table Layout (VERTICAL or HORIZONTAL)- Returns:
- layout [ParameterPage.TABLE_LAYOUT_HORIZONTAL | ParameterPage.TABLE_LAYOUT.VERTICAL]
-
setTableLayout
public void setTableLayout(int layout) Sets the parameter table Layout (VERTICAL or HORIZONTAL)- Parameters:
layout- [ParameterPage.TABLE_LAYOUT_HORIZONTAL | ParameterPage.TABLE_LAYOUT.VERTICAL]
-
getTableOuterBorderOnly
public boolean getTableOuterBorderOnly()Gets whether only the outer border of the parameter table will be displayed.- Returns:
- the state
-
setTableOuterBorderOnly
public void setTableOuterBorderOnly(boolean state) Sets whether only the outer border of the parameter table will be displayed.- Parameters:
state- the state
-
getResetEnabled
public boolean getResetEnabled()Gets the visibility of the HTML Reset form button- Returns:
- the state
-
setResetEnabled
public void setResetEnabled(boolean state) Sets the visibility of the HTML Reset form button- Parameters:
state- the state
-
getTextColorHex
Gets the text color of the header, footer and parameter names- Returns:
- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
setTextColor
Sets the text color of the header, footer and parameter names- Parameters:
htmlHex- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
getTextColor
Gets the text color of the header, footer and parameter names- Returns:
- the color as a java.awt.Color object
-
setTextColor
Sets the text color of the header, footer and parameter names- Parameters:
color- the color as a java.awt.Color object
-
getTextFont
Gets the text font of the header, footer and parameter names- Returns:
- the name of the font
-
setTextFont
Sets the text font of the header, footer and parameter names- Parameters:
fontName- the name of the font
-
getTextSize
public int getTextSize()Gets the text size of the header, footer and parameter names- Returns:
- size of the text
-
setTextSize
public void setTextSize(int size) Sets the text size of the header, footer and parameter names- Parameters:
size- size of the text
-
getTextStyle
public int getTextStyle()Gets the text style of the header, footer and parameter names- Returns:
- style [java.awt.Font.BOLD | java.awt.Font.ITALIC]
-
setTextStyle
public void setTextStyle(int style) Sets the text style of the header, footer and parameter names- Parameters:
style- [java.awt.Font.BOLD | java.awt.Font.ITALIC]
-
getTitleText
Gets the text of the parameter table title- Returns:
- the title text
-
setTitleText
Sets the text of the parameter table title- Parameters:
title- title text
-
getTitleTextColor
Gets the text color of the parameter table title- Returns:
- the color as a java.awt.Color object
-
setTitleTextColor
Sets the text color of the parameter table title- Parameters:
color- the color as a java.awt.Color object
-
getTitleTextColorHex
Gets the text color of the parameter table title- Returns:
- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
setTitleTextColor
Sets the text color of the parameter table title- Parameters:
htmlHex- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
getTitleTextFont
Gets the font of the parameter table title- Returns:
- the name of the font
-
setTitleTextFont
Sets the font of the parameter table title- Parameters:
fontName- the name of the font
-
getTitleTextSize
public int getTitleTextSize()Gets the text size of the parameter table title- Returns:
- the text size
-
setTitleTextSize
public void setTitleTextSize(int size) Sets the text size of the parameter table title- Parameters:
size- the text size
-
getTitleTextStyle
public int getTitleTextStyle()Gets the text style of the parameter table title- Returns:
- style [java.awt.Font.BOLD | java.awt.Font.ITALIC]
-
setTitleTextStyle
public void setTitleTextStyle(int style) Sets the text style of the parameter table title- Parameters:
style- [java.awt.Font.BOLD | java.awt.Font.ITALIC]
-
getBackgroundImage
Gets the background image of the parameter page- Returns:
- the image source
-
setBackgroundImage
Sets the background image of the parameter page- Parameters:
imagePath- the image source
-
getBackgroundColorHex
Gets the background color of the parameter page- Returns:
- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
setBackgroundColor
Sets the background color of the parameter page- Parameters:
htmlHex- the color in HTML hexadecimal RGB format (RRGGBB = red, green blue). Example: #ffffff = WHITE
-
getBackgroundColor
Gets the background color of the parameter page- Returns:
- the color as a java.awt.Color object
-
setBackgroundColor
Sets the background color of the parameter page- Parameters:
color- the color as a java.awt.Color object
-
getDocumentTitle
Gets the title of the HTML document- Returns:
- the title
-
setDocumentTitle
Sets the title of the HTML document- Parameters:
docTitle- the title
-
setDateParameterSelection
public void setDateParameterSelection(boolean state) Sets the state to use a select drop down list to choose a date for date parameters- Parameters:
state- the state
-
getDateParameterSelection
public boolean getDateParameterSelection()Gets the state to use a select drop down list to choose a date for date parameters- Returns:
- the state
-
setJavaScriptLibPath
Sets path to the lib/javascript folder that contains common javascript files such as DataTypeValidator.js, etc.- Parameters:
javaScriptLibPath-
-
setDateParameterCalendar
Sets the state to use a pop-up calendar to choose a date for date parameters. The datapicker javascript folder can be found in <espress-report-install>/lib/javascript/datepicker or <espress-chart-install>/lib/javascript/datepicker. To use it, copy it to a folder under your web server's root folder and then call this method usingparameterPage.setDateParameterCalendar(true, "../datepicker");,assuming your web root URL is one directory down from your servlet that generates the parameter page.- Parameters:
state- the statedatepicker- the path to the datepicker folder that contains the javascript and images for the data picker javascript pop-up calendar
-
getDateParameterCalendar
public boolean getDateParameterCalendar()Gets the state to use a pop-up calendar to choose a date for date parameters- Returns:
- the state
-
getDateParameterCalendarDatepicker
Gets the path to the javascript and images of the pop-up calendar- Parameters:
datepicker- the path to the datepicker folder that contains the javascript and images
-
setDateVariable
Sets the state to use a pop-up date calculater to choose a date for date parameters. The datapicker javascript folder can be found in one of the following locations:
<espress-report-install>/lib/javascript/datepicker
<espress-chart-install>/lib/javascript/datepicker
<ERES-install>/lib/javascript/datepicker- Parameters:
state- the statedatepicker- the path to the datepicker folder that contains the javascript and images for the data picker javascript pop-up date calculater
-
getDateVariable
public boolean getDateVariable()Gets the state to use a pop-up date calculater to choose a date for date parameters- Returns:
- the state
-
getDateVariableDatepicker
Gets the path to the javascript and images of the pop-up date calculater- Parameters:
datepicker- the path to the datepicker folder that contains the javascript and images
-
setSubmitDisplayName
Sets the display name of the Submit button. Default is 'Submit'- Parameters:
name- the resulting display name of the button
-
getSubmitDisplayName
Gets the display name of the Submit button. Default is 'Submit' -
setResetDisplayName
Sets the display name of the Reset button. Default is 'Reset'- Parameters:
name- the resulting display name of the button
-
getResetDisplayName
Gets the display name of the Reset button. Default is 'Reset' -
setParamFormName
Function to set the form name where the parameter dialog table will be put into.- Parameters:
paramFormName-
-
getParamFormName
function to obtain the form name where the parameter dialog table will be put into- Returns:
-
getOnSubmit
Gets custom JavaScript action that should be done before submitting parameter form- Returns:
- custom JavaScript action
- See Also:
-
setOnSubmit
Sets custom JavaScript action that should be done before submitting parameter form. This action is done just after the validation, but before the parameter form is submitted.- Parameters:
onSubmit- custom JavaScript action
-