Class ParameterPage

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

public abstract class ParameterPage extends 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:
  • Field Details

  • 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

      public Parameters getParameters()
      Gets all parameters information
    • getDbInfo

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

      public String getServletName()
      Gets the name of the servlet
    • getParamPageExportFormats

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

      public String getTargetLoc()
      Gets the location of the report or chart
    • getFormat

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

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

      public String toHtmlString() throws 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:
      IOException
    • toCssHtmlString

      public String toCssHtmlString(String cssFile) throws 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:
      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 String getHeader()
      Gets the text that appears at the beginning of the Parameter page
    • setHeader

      public void setHeader(String header)
      Sets the text that appears at the beginning of the Parameter page
    • getFooter

      public String getFooter()
      Gets the text that appears at the end of the Parameter page
    • setFooter

      public void setFooter(String footer)
      Sets the text that appears at the end of the Parameter page
    • getTableBackgroundColor

      public Color getTableBackgroundColor()
      Gets the background color of the parameter table
      Returns:
      the color as a java.awt.Color object
    • setTableBackgroundColor

      public void setTableBackgroundColor(Color color)
      Sets the background color of the parameter table
      Parameters:
      color - the color as a java.awt.Color object
    • getTableBackgroundColorHex

      public 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(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 Color getTableBorderColor()
      Gets the color of the parameter table border
      Returns:
      the color as a java.awt.Color object
    • setTableBorderColor

      public void setTableBorderColor(Color color)
      Sets the color of the parameter table border
      Parameters:
      color - the color as a java.awt.Color object
    • getTableBorderColorHex

      public 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(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 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(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 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(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 String getTextFont()
      Gets the text font of the header, footer and parameter names
      Returns:
      the name of the font
    • setTextFont

      public void setTextFont(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 String getTitleText()
      Gets the text of the parameter table title
      Returns:
      the title text
    • setTitleText

      public void setTitleText(String title)
      Sets the text of the parameter table title
      Parameters:
      title - title text
    • getTitleTextColor

      public Color getTitleTextColor()
      Gets the text color of the parameter table title
      Returns:
      the color as a java.awt.Color object
    • setTitleTextColor

      public void setTitleTextColor(Color color)
      Sets the text color of the parameter table title
      Parameters:
      color - the color as a java.awt.Color object
    • getTitleTextColorHex

      public 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(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 String getTitleTextFont()
      Gets the font of the parameter table title
      Returns:
      the name of the font
    • setTitleTextFont

      public void setTitleTextFont(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 String getBackgroundImage()
      Gets the background image of the parameter page
      Returns:
      the image source
    • setBackgroundImage

      public void setBackgroundImage(String imagePath)
      Sets the background image of the parameter page
      Parameters:
      imagePath - the image source
    • getBackgroundColorHex

      public 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(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 Color getBackgroundColor()
      Gets the background color of the parameter page
      Returns:
      the color as a java.awt.Color object
    • setBackgroundColor

      public void setBackgroundColor(Color color)
      Sets the background color of the parameter page
      Parameters:
      color - the color as a java.awt.Color object
    • getDocumentTitle

      public String getDocumentTitle()
      Gets the title of the HTML document
      Returns:
      the title
    • setDocumentTitle

      public void setDocumentTitle(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(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, 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 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, 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 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(String name)
      Sets the display name of the Submit button. Default is 'Submit'
      Parameters:
      name - the resulting display name of the button
    • getSubmitDisplayName

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

      public void setResetDisplayName(String name)
      Sets the display name of the Reset button. Default is 'Reset'
      Parameters:
      name - the resulting display name of the button
    • getResetDisplayName

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

      public void setParamFormName(String paramFormName)
      Function to set the form name where the parameter dialog table will be put into.
      Parameters:
      paramFormName -
    • getParamFormName

      public String getParamFormName()
      function to obtain the form name where the parameter dialog table will be put into
      Returns:
    • getOnSubmit

      public String getOnSubmit()
      Gets custom JavaScript action that should be done before submitting parameter form
      Returns:
      custom JavaScript action
      See Also:
    • setOnSubmit

      public void setOnSubmit(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