EspressReport 6.6

quadbase.common.param
Class ParameterPage

java.lang.Object
  extended by quadbase.common.param.ParameterPage
Direct Known Subclasses:
ChartParameterPage, ReportParameterPage

public abstract class ParameterPage
extends java.lang.Object

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:
ParameterPageWriter

Field Summary
static int ALIGNMENT_CENTER
           
static int ALIGNMENT_LEFT
           
static int ALIGNMENT_RIGHT
           
protected  Parameters params
           
static int TABLE_LAYOUT_HORIZONTAL
           
static int TABLE_LAYOUT_VERTICAL
           
 
Constructor Summary
ParameterPage(Parameters params, quadbase.common.util.IQueryFileInfo dbInfo, java.lang.String servletName, java.lang.String[] paramPageExportFormats, java.lang.String targetLoc, int format, boolean paramPageResetEnabled, int paramPageLayout, java.lang.String extraFormContent)
          Allocates a new ParameterPage that represents a parameter page object.
 
Method Summary
 int getAlignment()
          Gets the horizontal alignment of the parameter page
 java.awt.Color getBackgroundColor()
          Gets the background color of the parameter page
 java.lang.String getBackgroundColorHex()
          Gets the background color of the parameter page
 java.lang.String getBackgroundImage()
          Gets the background image of the parameter page
 boolean getDateParameterCalendar()
          Gets the state to use a pop-up calendar to choose a date for date parameters
 java.lang.String getDateParameterCalendarDatepicker()
          Gets the path to the javascript and images of the pop-up calendar
 boolean getDateParameterSelection()
          Gets the state to use a select drop down list to choose a date for date parameters
 boolean getDateVariable()
          Gets the state to use a pop-up date calculater to choose a date for date parameters
 java.lang.String getDateVariableDatepicker()
          Gets the path to the javascript and images of the pop-up date calculater
 quadbase.common.util.IQueryFileInfo getDbInfo()
          internal use only.
 java.lang.String getDocumentTitle()
          Gets the title of the HTML document
 java.lang.String getExtraFormContent()
          internal use only.
 java.lang.String getFooter()
          Gets the text that appears at the end of the Parameter page
 int getFormat()
          Gets the only exporting report or chart format
 java.lang.String getHeader()
          Gets the text that appears at the beginning of the Parameter page
 java.lang.String getOnSubmit()
          Gets custom JavaScript action that should be done before submitting parameter form
 Parameters getParameters()
          Gets all parameters information
 java.lang.String getParamFormName()
          function to obtain the form name where the parameter dialog table will be put into
 java.lang.String[] getParamPageExportFormats()
          internal use only.
 java.lang.String getResetDisplayName()
          Gets the display name of the Reset button.
 boolean getResetEnabled()
          Gets the visibility of the HTML Reset form button
 java.lang.String getServletName()
          Gets the name of the servlet
 java.lang.String getSubmitDisplayName()
          Gets the display name of the Submit button.
 java.awt.Color getTableBackgroundColor()
          Gets the background color of the parameter table
 java.lang.String getTableBackgroundColorHex()
          Gets the background color of the parameter table
 java.awt.Color getTableBorderColor()
          Gets the color of the parameter table border
 java.lang.String getTableBorderColorHex()
          Gets the color of the parameter table border
 int getTableBorderThickness()
          Gets the thickness of the parameter table border
 int getTableLayout()
          Gets the parameter table Layout (VERTICAL or HORIZONTAL)
 boolean getTableOuterBorderOnly()
          Gets whether only the outer border of the parameter table will be displayed.
 java.lang.String getTargetLoc()
          Gets the location of the report or chart
 java.awt.Color getTextColor()
          Gets the text color of the header, footer and parameter names
 java.lang.String getTextColorHex()
          Gets the text color of the header, footer and parameter names
 java.lang.String getTextFont()
          Gets the text font of the header, footer and parameter names
 int getTextSize()
          Gets the text size of the header, footer and parameter names
 int getTextStyle()
          Gets the text style of the header, footer and parameter names
 java.lang.String getTitleText()
          Gets the text of the parameter table title
 java.awt.Color getTitleTextColor()
          Gets the text color of the parameter table title
 java.lang.String getTitleTextColorHex()
          Gets the text color of the parameter table title
 java.lang.String getTitleTextFont()
          Gets the font of the parameter table title
 int getTitleTextSize()
          Gets the text size of the parameter table title
 int getTitleTextStyle()
          Gets the text style of the parameter table title
 void setAlignment(int alignment)
          Sets the horizontal alignment of the parameter page
 void setBackgroundColor(java.awt.Color color)
          Sets the background color of the parameter page
 void setBackgroundColor(java.lang.String htmlHex)
          Sets the background color of the parameter page
 void setBackgroundImage(java.lang.String imagePath)
          Sets the background image of the parameter page
 void setDateParameterCalendar(boolean state, java.lang.String datepicker)
          Sets the state to use a pop-up calendar to choose a date for date parameters.
 void setDateParameterSelection(boolean state)
          Sets the state to use a select drop down list to choose a date for date parameters
 void setDateVariable(boolean state, java.lang.String datepicker)
          Sets the state to use a pop-up date calculater to choose a date for date parameters.
 void setDocumentTitle(java.lang.String docTitle)
          Sets the title of the HTML document
 void setFooter(java.lang.String footer)
          Sets the text that appears at the end of the Parameter page
 void setHeader(java.lang.String header)
          Sets the text that appears at the beginning of the Parameter page
 void setJavaScriptLibPath(java.lang.String javaScriptLibPath)
          Sets path to the lib/javascript folder that contains common javascript files such as DataTypeValidator.js, etc.
 void setOnSubmit(java.lang.String onSubmit)
          Sets custom JavaScript action that should be done before submitting parameter form.
 void setParamFormName(java.lang.String paramFormName)
          Function to set the form name where the parameter dialog table will be put into.
 void setResetDisplayName(java.lang.String name)
          Sets the display name of the Reset button.
 void setResetEnabled(boolean state)
          Sets the visibility of the HTML Reset form button
 void setSubmitDisplayName(java.lang.String name)
          Sets the display name of the Submit button.
 void setTableBackgroundColor(java.awt.Color color)
          Sets the background color of the parameter table
 void setTableBackgroundColor(java.lang.String htmlHex)
          Sets the background color of the parameter table
 void setTableBorderColor(java.awt.Color color)
          Sets the color of the parameter table border
 void setTableBorderColor(java.lang.String htmlHex)
          Sets the color of the parameter table border
 void setTableBorderThickness(int thickness)
          Sets the thickness of the parameter table border
 void setTableLayout(int layout)
          Sets the parameter table Layout (VERTICAL or HORIZONTAL)
 void setTableOuterBorderOnly(boolean state)
          Sets whether only the outer border of the parameter table will be displayed.
 void setTextColor(java.awt.Color color)
          Sets the text color of the header, footer and parameter names
 void setTextColor(java.lang.String htmlHex)
          Sets the text color of the header, footer and parameter names
 void setTextFont(java.lang.String fontName)
          Sets the text font of the header, footer and parameter names
 void setTextSize(int size)
          Sets the text size of the header, footer and parameter names
 void setTextStyle(int style)
          Sets the text style of the header, footer and parameter names
 void setTitleText(java.lang.String title)
          Sets the text of the parameter table title
 void setTitleTextColor(java.awt.Color color)
          Sets the text color of the parameter table title
 void setTitleTextColor(java.lang.String htmlHex)
          Sets the text color of the parameter table title
 void setTitleTextFont(java.lang.String fontName)
          Sets the font of the parameter table title
 void setTitleTextSize(int size)
          Sets the text size of the parameter table title
 void setTitleTextStyle(int style)
          Sets the text style of the parameter table title
 java.lang.String toCssHtmlString(java.lang.String cssFile)
          Returns an HTML with embedded CSS classes representation of the parameter page as a String.
 java.lang.String toHtmlString()
          Returns an HTML representation of the parameter page as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_LAYOUT_HORIZONTAL

public static final int TABLE_LAYOUT_HORIZONTAL
See Also:
Constant Field Values

TABLE_LAYOUT_VERTICAL

public static final int TABLE_LAYOUT_VERTICAL
See Also:
Constant Field Values

ALIGNMENT_CENTER

public static final int ALIGNMENT_CENTER
See Also:
Constant Field Values

ALIGNMENT_LEFT

public static final int ALIGNMENT_LEFT
See Also:
Constant Field Values

ALIGNMENT_RIGHT

public static final int ALIGNMENT_RIGHT
See Also:
Constant Field Values

params

protected Parameters params
Constructor Detail

ParameterPage

public ParameterPage(Parameters params,
                     quadbase.common.util.IQueryFileInfo dbInfo,
                     java.lang.String servletName,
                     java.lang.String[] paramPageExportFormats,
                     java.lang.String targetLoc,
                     int format,
                     boolean paramPageResetEnabled,
                     int paramPageLayout,
                     java.lang.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 Detail

getParameters

public Parameters getParameters()
Gets all parameters information


getDbInfo

public quadbase.common.util.IQueryFileInfo getDbInfo()
internal use only. Gets the database information


getServletName

public java.lang.String getServletName()
Gets the name of the servlet


getParamPageExportFormats

public java.lang.String[] getParamPageExportFormats()
internal use only. Gets the exporting formats. Used for ERES only.


getTargetLoc

public java.lang.String getTargetLoc()
Gets the location of the report or chart


getFormat

public int getFormat()
Gets the only exporting report or chart format


getExtraFormContent

public java.lang.String getExtraFormContent()
internal use only. Gets any extra contents for the parameter page form


toHtmlString

public java.lang.String toHtmlString()
                              throws java.io.IOException
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:
java.io.IOException

toCssHtmlString

public java.lang.String toCssHtmlString(java.lang.String cssFile)
                                 throws java.io.IOException
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:
java.io.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

public java.lang.String getHeader()
Gets the text that appears at the beginning of the Parameter page


setHeader

public void setHeader(java.lang.String header)
Sets the text that appears at the beginning of the Parameter page


getFooter

public java.lang.String getFooter()
Gets the text that appears at the end of the Parameter page


setFooter

public void setFooter(java.lang.String footer)
Sets the text that appears at the end of the Parameter page


getTableBackgroundColor

public java.awt.Color getTableBackgroundColor()
Gets the background color of the parameter table

Returns:
the color as a java.awt.Color object

setTableBackgroundColor

public void setTableBackgroundColor(java.awt.Color color)
Sets the background color of the parameter table

Parameters:
color - the color as a java.awt.Color object

getTableBackgroundColorHex

public java.lang.String 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

public void setTableBackgroundColor(java.lang.String htmlHex)
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

public java.awt.Color getTableBorderColor()
Gets the color of the parameter table border

Returns:
the color as a java.awt.Color object

setTableBorderColor

public void setTableBorderColor(java.awt.Color color)
Sets the color of the parameter table border

Parameters:
color - the color as a java.awt.Color object

getTableBorderColorHex

public java.lang.String 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

public void setTableBorderColor(java.lang.String htmlHex)
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

public java.lang.String 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

public void setTextColor(java.lang.String htmlHex)
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

public java.awt.Color getTextColor()
Gets the text color of the header, footer and parameter names

Returns:
the color as a java.awt.Color object

setTextColor

public void setTextColor(java.awt.Color color)
Sets the text color of the header, footer and parameter names

Parameters:
color - the color as a java.awt.Color object

getTextFont

public java.lang.String getTextFont()
Gets the text font of the header, footer and parameter names

Returns:
the name of the font

setTextFont

public void setTextFont(java.lang.String fontName)
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

public java.lang.String getTitleText()
Gets the text of the parameter table title

Returns:
the title text

setTitleText

public void setTitleText(java.lang.String title)
Sets the text of the parameter table title

Parameters:
title - title text

getTitleTextColor

public java.awt.Color getTitleTextColor()
Gets the text color of the parameter table title

Returns:
the color as a java.awt.Color object

setTitleTextColor

public void setTitleTextColor(java.awt.Color color)
Sets the text color of the parameter table title

Parameters:
color - the color as a java.awt.Color object

getTitleTextColorHex

public java.lang.String 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

public void setTitleTextColor(java.lang.String htmlHex)
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

public java.lang.String getTitleTextFont()
Gets the font of the parameter table title

Returns:
the name of the font

setTitleTextFont

public void setTitleTextFont(java.lang.String fontName)
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

public java.lang.String getBackgroundImage()
Gets the background image of the parameter page

Returns:
the image source

setBackgroundImage

public void setBackgroundImage(java.lang.String imagePath)
Sets the background image of the parameter page

Parameters:
imagePath - the image source

getBackgroundColorHex

public java.lang.String 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

public void setBackgroundColor(java.lang.String htmlHex)
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

public java.awt.Color getBackgroundColor()
Gets the background color of the parameter page

Returns:
the color as a java.awt.Color object

setBackgroundColor

public void setBackgroundColor(java.awt.Color color)
Sets the background color of the parameter page

Parameters:
color - the color as a java.awt.Color object

getDocumentTitle

public java.lang.String getDocumentTitle()
Gets the title of the HTML document

Returns:
the title

setDocumentTitle

public void setDocumentTitle(java.lang.String docTitle)
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

public void setJavaScriptLibPath(java.lang.String javaScriptLibPath)
Sets path to the lib/javascript folder that contains common javascript files such as DataTypeValidator.js, etc.

Parameters:
javaScriptLibPath -

setDateParameterCalendar

public void setDateParameterCalendar(boolean state,
                                     java.lang.String datepicker)
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 using parameterPage.setDateParameterCalendar(true, "../datepicker"); ,assuming your web root URL is one directory down from your servlet that generates the parameter page.

Parameters:
state - the state
datepicker - 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

public java.lang.String 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

public void setDateVariable(boolean state,
                            java.lang.String datepicker)
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 state
datepicker - 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

public java.lang.String 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

public void setSubmitDisplayName(java.lang.String name)
Sets the display name of the Submit button. Default is 'Submit'

Parameters:
name - the resulting display name of the button

getSubmitDisplayName

public java.lang.String getSubmitDisplayName()
Gets the display name of the Submit button. Default is 'Submit'


setResetDisplayName

public void setResetDisplayName(java.lang.String name)
Sets the display name of the Reset button. Default is 'Reset'

Parameters:
name - the resulting display name of the button

getResetDisplayName

public java.lang.String getResetDisplayName()
Gets the display name of the Reset button. Default is 'Reset'


setParamFormName

public void setParamFormName(java.lang.String paramFormName)
Function to set the form name where the parameter dialog table will be put into.

Parameters:
paramFormName -

getParamFormName

public java.lang.String getParamFormName()
function to obtain the form name where the parameter dialog table will be put into

Returns:

getOnSubmit

public java.lang.String getOnSubmit()
Gets custom JavaScript action that should be done before submitting parameter form

Returns:
custom JavaScript action
See Also:
setOnSubmit(String)

setOnSubmit

public void setOnSubmit(java.lang.String onSubmit)
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

EspressReport 6.6