Style Intelligence v12.0

inetsoft.sree
Class RepletParameters

java.lang.Object
  extended by inetsoft.sree.RepletParameters
All Implemented Interfaces:
Serializable, Cloneable

public class RepletParameters
extends Object
implements Serializable, Cloneable

This is a parameter description class. It describes the parameters of a report, including name, type, and default values. A replet can declare its parameters by creating a RepletParameters object, specify the parameters, and register it by calling BasicReplet.addRepletParameters().

A parameter declaration also includes the request type. It can be one of the request types defined in RepletRequest.

See Also:
Serialized Form

Nested Class Summary
static class RepletParameters.BooleanParameter
          Boolean parameter.
static class RepletParameters.ChoiceParameter
          Choice parameter.
static class RepletParameters.DateParameter
          Date parameter.
static class RepletParameters.DateTimeParameter
          DateTime parameter.
static class RepletParameters.ListParameter
          List parameter.
static class RepletParameters.OptionParameter
          Option group parameter.
static class RepletParameters.Parameter
          Parameter base class.
static class RepletParameters.PasswordParameter
          Password parameters.
static class RepletParameters.RadioParameter
          Radio group parameter.
static class RepletParameters.SimpleParameter
          Simple parameter class.
static class RepletParameters.TextAreaParameter
          TextArea parameter.
static class RepletParameters.TimeParameter
          Time parameter.
 
Constructor Summary
RepletParameters(String name)
          Create a replet parameters object.
 
Method Summary
 RepletParameters.Parameter addBoolean(String name, boolean def)
          Add a boolean value (represented as a checkbox in request dialog).
 RepletParameters.Parameter addChoice(String name, Object def, Object[] items)
          Add a choice (represented as a combobox in request dialog).
 RepletParameters.Parameter addChoice(String name, Object def, Object[] items, Object[] values)
          Add a choice (represented as a combobox in request dialog).
 RepletParameters.Parameter addDate(String name, Date def)
          Add a date parameter
 RepletParameters.Parameter addDateTime(String name, Date def)
          Add a date and time parameter
 RepletParameters.Parameter addList(String name, Object[] def, Object[] items)
          Add a list (represented as a scrollable list in request dialog).
 RepletParameters.Parameter addList(String name, Object[] def, Object[] items, Object[] values)
          Add a list (represented as a scrollable list in request dialog).
 RepletParameters.Parameter addOption(String name, Object[] def, Object[] items)
          Add an option group (representer as a group of checkboxes).
 RepletParameters.Parameter addOption(String name, Object[] def, Object[] items, Object[] values)
          Add an option group (representer as a group of checkboxes).
 void addParameter(RepletParameters.Parameter param)
          Add a parameter to the list.
 RepletParameters.Parameter addParameter(String name, Object def, Format fmt)
          Add a text parameter.
 RepletParameters.Parameter addPassword(String name)
          Add a password field
 RepletParameters.Parameter addRadio(String name, Object def, Object[] items)
          Add a radio button group (representer as a group of radio buttons).
 RepletParameters.Parameter addRadio(String name, Object def, Object[] items, Object[] values)
          Add a radio button group (representer as a group of radio buttons).
 RepletParameters.Parameter addTextArea(String name, String def, int rows, int cols)
          Add a multi-line text parameter.
 RepletParameters.Parameter addTime(String name, Date def)
          Add a time parameter.
 void clear()
          Remove all parameters.
 Object clone()
          Make a copy of this parameter definition.
 RepletParameters clone(String name)
          Clone this parameters specification with a different request name.
 boolean containsParameter(String name)
          Test if contains the specified parameter.
 RepletParameters.Parameter getParameter(int n)
          Get the specified parameter.
 RepletParameters.Parameter getParameter(String name)
          Get the parameter with the specified name.
 int getParameterCount()
          Get the number of parameters.
 Vector getParameters()
          Get all the parameters.
 String getParameterSheet()
          Get parameter sheet.
 String getRequestDialogClass()
          Get the request dialog class name.
 String getRequestDialogHTML()
          Get the request dialog HTML resource.
 Dimension getRequestDialogHTMLSize()
          Get the request dialog HTML size, it may be null.
 String getRequestName()
          Get the request name.
 int getVisibleParameterCount()
          Get the number of visible parameters.
 Vector getVisibleParameters()
          Get the visible parameters.
 void removeParameter(String name)
          Remove a parameter from the parameter definition.
 void setAlias(String name, String alias)
          Set an alias for a parameter.
 void setParameterSheet(String psheet)
          Set parameter sheet.
 void setRequestDialogClass(String cls)
          Set the request dialog class name.
 void setRequestDialogHTML(String html)
          Set the request dialog HTML.
 void setRequestDialogHTMLSize(Dimension size)
          Set the Request Dialog size.
 void setRequestName(String name)
          Set the request name.
 void setToolTip(String name, String toolTip)
          Set the toolTip for a parameter.
 void setVisible(String name, boolean visible)
          Set the visibility of a parameter.
 String toString()
          To string.
 String toString2()
          To string.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepletParameters

public RepletParameters(String name)
Create a replet parameters object. The request name should be unique within a replet.

Parameters:
name - request name.
Method Detail

getRequestName

public String getRequestName()
Get the request name.


setRequestName

public void setRequestName(String name)
Set the request name.


setRequestDialogClass

public void setRequestDialogClass(String cls)
Set the request dialog class name. If the dialog is set, the dialog is used to prompt for parameter values in the Java report viewer. Otherwise the default request dialog is used. The class must implement the RequestDialog interface defined in inetsoft.sree.viewer package. It also must have a constructor with two parameters. The first parameter is a java.awt.Window class. The second parameter is a RepletParameters object, which contains the report parameter definitions. It is up to the dialog class to display and collect parameter values, and return them from the getRepletRequest() method.

Parameters:
cls - fully qualified class name.

getRequestDialogClass

public String getRequestDialogClass()
Get the request dialog class name.


setParameterSheet

public void setParameterSheet(String psheet)
Set parameter sheet. If parameter sheet is set, user could customize whatever he would like to be in a parameter sheet when prompt parameters for a custom ViewerAction.


getParameterSheet

public String getParameterSheet()
Get parameter sheet.


setRequestDialogHTML

public void setRequestDialogHTML(String html)
Set the request dialog HTML. The HTML can be specified in three forms. First, the string can be a resource path pointing to a HTML file. In which case the file is loaded in and used as the prompt dialog. Second, the string can contain the entire contents of the HTML. Third, the string can contain a segment of HTML. The segment is added to the bottom of the auto-generated prompt dialog. The engine checks for the presence of >body< tag to determine if a HTML string is a segment or a complete document.

If the dialog is set, the HTML is used for prompting user input when viewing reports with a browser. Otherwise, a request dialog is generated by the report engine. The HTML page must contain a form meeting the following requirements:

- the form action field must be '$(servlet.uri)' - the form target field must be '$(request.target)' - contains a hidden field with name 'ID' and value '$(replet.id)' - contains a hidden field with name 'req' and value '$(request.name)' - contains a hidden field with name 'op' and value 'Generate'. - contains fields for the parameter values, where the name of each field must match the parameter field name.

The form is responsible for closing the form window when the form is submitted. This can be done by using a onClick handler.

 
 

Parameters:
html - html file resource name.

getRequestDialogHTML

public String getRequestDialogHTML()
Get the request dialog HTML resource.


setRequestDialogHTMLSize

public void setRequestDialogHTMLSize(Dimension size)
Set the Request Dialog size. By defaut it is 500x400.

Parameters:
size - - the size of this dialog.

getRequestDialogHTMLSize

public Dimension getRequestDialogHTMLSize()
Get the request dialog HTML size, it may be null.


setAlias

public void setAlias(String name,
                     String alias)
Set an alias for a parameter. The alias is used as the field label when prompting for the parameter value. If the alias is not set, the parameter name is used as the label.

Parameters:
name - parameter name.
alias - parameter label.

setToolTip

public void setToolTip(String name,
                       String toolTip)
Set the toolTip for a parameter.

Parameters:
name - parameter name.
toolTip - parameter toolTip.

setVisible

public void setVisible(String name,
                       boolean visible)
Set the visibility of a parameter. If a parameter is hidden, the parameter is not prompted, and the default value of the parameter is always used as the parameter value.

Parameters:
name - parameter name.
visible - false to hide a parameter.

addParameter

public RepletParameters.Parameter addParameter(String name,
                                               Object def,
                                               Format fmt)
Add a text parameter. The type of the actual data is determined by the format. The value is edited in a text field. The string is then converted to an object using the format.

Parameters:
name - name of the parameter.
def - default value.
fmt - format, null to ignore.

addTextArea

public RepletParameters.Parameter addTextArea(String name,
                                              String def,
                                              int rows,
                                              int cols)
Add a multi-line text parameter.

Parameters:
name - name of the parameter.
def - default value.
rows - number of rows.
cols - number of columns.

addPassword

public RepletParameters.Parameter addPassword(String name)
Add a password field

Parameters:
name - name of the parameter.

addBoolean

public RepletParameters.Parameter addBoolean(String name,
                                             boolean def)
Add a boolean value (represented as a checkbox in request dialog).

Parameters:
name - name of the parameter.
def - default value.

addChoice

public RepletParameters.Parameter addChoice(String name,
                                            Object def,
                                            Object[] items,
                                            Object[] values)
Add a choice (represented as a combobox in request dialog).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.
values - choice values.

addChoice

public RepletParameters.Parameter addChoice(String name,
                                            Object def,
                                            Object[] items)
Add a choice (represented as a combobox in request dialog).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.

addList

public RepletParameters.Parameter addList(String name,
                                          Object[] def,
                                          Object[] items,
                                          Object[] values)
Add a list (represented as a scrollable list in request dialog).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.
values - choice values.

addList

public RepletParameters.Parameter addList(String name,
                                          Object[] def,
                                          Object[] items)
Add a list (represented as a scrollable list in request dialog).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.

addRadio

public RepletParameters.Parameter addRadio(String name,
                                           Object def,
                                           Object[] items,
                                           Object[] values)
Add a radio button group (representer as a group of radio buttons).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.
values - choice values.

addRadio

public RepletParameters.Parameter addRadio(String name,
                                           Object def,
                                           Object[] items)
Add a radio button group (representer as a group of radio buttons).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.

addOption

public RepletParameters.Parameter addOption(String name,
                                            Object[] def,
                                            Object[] items,
                                            Object[] values)
Add an option group (representer as a group of checkboxes).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.
values - choice values.

addOption

public RepletParameters.Parameter addOption(String name,
                                            Object[] def,
                                            Object[] items)
Add an option group (representer as a group of checkboxes).

Parameters:
name - name of the parameter.
def - default value.
items - choice items.

addDate

public RepletParameters.Parameter addDate(String name,
                                          Date def)
Add a date parameter

Parameters:
name - name of the parameter.
def - default value.

addDateTime

public RepletParameters.Parameter addDateTime(String name,
                                              Date def)
Add a date and time parameter

Parameters:
name - name of the parameter.
def - default value.

addTime

public RepletParameters.Parameter addTime(String name,
                                          Date def)
Add a time parameter.

Parameters:
name - name of the parameter.
def - default value.

addParameter

public void addParameter(RepletParameters.Parameter param)
Add a parameter to the list.


clear

public void clear()
Remove all parameters.


containsParameter

public boolean containsParameter(String name)
Test if contains the specified parameter.


removeParameter

public void removeParameter(String name)
Remove a parameter from the parameter definition.


getParameter

public RepletParameters.Parameter getParameter(String name)
Get the parameter with the specified name.

Parameters:
name - parameter name.
Returns:
parameter with the specified name.

getParameter

public RepletParameters.Parameter getParameter(int n)
Get the specified parameter.

Parameters:
n - parameter index.

getParameterCount

public int getParameterCount()
Get the number of parameters.


getVisibleParameterCount

public int getVisibleParameterCount()
Get the number of visible parameters.


getVisibleParameters

public Vector getVisibleParameters()
Get the visible parameters.


getParameters

public Vector getParameters()
Get all the parameters.


toString

public String toString()
To string.

Overrides:
toString in class Object

toString2

public String toString2()
To string.


clone

public RepletParameters clone(String name)
Clone this parameters specification with a different request name.


clone

public Object clone()
Make a copy of this parameter definition.

Overrides:
clone in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.