com.actuate.activeportal.forms
Class TableRowEditorActionForm

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by com.actuate.activeportal.forms.BaseActionForm
          extended by com.actuate.activeportal.forms.TableRowEditorActionForm
All Implemented Interfaces:
java.io.Serializable

public class TableRowEditorActionForm
extends BaseActionForm

This form is used when editing/inserting a row in the table parameter. It handles the display of column names and values for each of the columns. This form is populated by the framework when the form is submitted by the browser and by the action class when the page is loaded with the initial values. The framework manages this form completely.

Author:
Actuate Corporation
See Also:
Serialized Form

Constructor Summary
TableRowEditorActionForm()
           
 
Method Summary
 void fixUTF8()
          This method is called to convert the data submitted by the browser to a java string value.
 java.lang.String getColumnName(int index)
          Returns the name of a column at a particular index
 java.lang.String[] getColumnNames()
          Returns the names of all the columns that are present in this table.
 java.lang.String[] getColumnTypeDescription()
          Returns the description that is displayed for the data type of the column along with whether it is required or not
 com.actuate.schemas.FieldDefinition[] getFieldDefinitions()
          Returns the list of all field definitions that are available in this table parameter
 com.actuate.schemas.FieldValue[] getFieldValues()
          Returns the values of all the fields in this table
 java.lang.String getMode()
          Returns the current mode i.e.
 java.lang.String getNonNullValue(int index)
          Returns the value in the field at a particular index.
 java.lang.String getTitle()
          Returns the title that is displayed in the window.
 java.lang.String getValue(int index)
          Returns the value in the field at a particular index.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          This method is called by the struts framework.
 void setColumnNames(java.lang.String[] saColumnNames)
          Sets the names of all the columns that are available in the table
 void setColumnTypeDescription(java.lang.String[] strings)
          Sets the descriptions to be displayed for all the columns
 void setFieldDefinitions(com.actuate.schemas.FieldDefinition[] definitions)
          Sets the definitions of all the fields thar are available in this table parameter
 void setFieldValues(com.actuate.schemas.FieldValue[] values)
          Sets the values of all the columns in this row.
 void setMode(java.lang.String string)
          Sets the current mode i.e.
 void setTitle(java.lang.String string)
          Sets the title to displayed in the window
 void setValue(int index, java.lang.String value)
          Sets the value of a column at a particular index.
 
Methods inherited from class com.actuate.activeportal.forms.BaseActionForm
isPostback, setPostback
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableRowEditorActionForm

public TableRowEditorActionForm()
Method Detail

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
This method is called by the struts framework. Please refer to the struts documentation for more information about this.

Overrides:
reset in class org.apache.struts.action.ActionForm
Parameters:
mapping -
request -

getMode

public java.lang.String getMode()
Returns the current mode i.e. "Insert" or "Edit".

Returns:
the current mode.

getTitle

public java.lang.String getTitle()
Returns the title that is displayed in the window.

Returns:
The window title

setMode

public void setMode(java.lang.String string)
Sets the current mode i.e. "Insert" or "Edit"

Parameters:
string - The current mode.

setTitle

public void setTitle(java.lang.String string)
Sets the title to displayed in the window

Parameters:
string - THe window title

setColumnNames

public void setColumnNames(java.lang.String[] saColumnNames)
Sets the names of all the columns that are available in the table

Parameters:
saColumnNames - An array of column names

getColumnNames

public java.lang.String[] getColumnNames()
Returns the names of all the columns that are present in this table.

Returns:
The column names

getColumnName

public java.lang.String getColumnName(int index)
Returns the name of a column at a particular index

Parameters:
index - The index of the column whose name is to be retrieved
Returns:
The name of the column. This method will throw an ArrayIndexOutOfBoundsException if an invalid index is specified.

setFieldValues

public void setFieldValues(com.actuate.schemas.FieldValue[] values)
Sets the values of all the columns in this row.

Parameters:
values - The values of all the columns

getFieldValues

public com.actuate.schemas.FieldValue[] getFieldValues()
Returns the values of all the fields in this table

Returns:
An array of FieldValue objects containing the values of the columns in the current row.

getNonNullValue

public java.lang.String getNonNullValue(int index)
Returns the value in the field at a particular index. If the value is null, it returns an empty string.

Parameters:
index - The index of the column whose value is to be retrieved
Returns:
The value of the column at the specified index. It will throw an ArrayIndexOutOfBoundsException if the index is not found.

getValue

public java.lang.String getValue(int index)
Returns the value in the field at a particular index.

Parameters:
index - The index of the column whose value is to be retrieved
Returns:
The value of the column at the specified index. It will throw an ArrayIndexOutOfBoundsException if the index is not found.

setValue

public void setValue(int index,
                     java.lang.String value)
Sets the value of a column at a particular index.

Parameters:
index - The index of the column whose value is to be set
value - The value to be set It will throw an ArrayIndexOutOfBoundsException if the index is not found.

fixUTF8

public void fixUTF8()
This method is called to convert the data submitted by the browser to a java string value.

Overrides:
fixUTF8 in class BaseActionForm

setFieldDefinitions

public void setFieldDefinitions(com.actuate.schemas.FieldDefinition[] definitions)
Sets the definitions of all the fields thar are available in this table parameter

Parameters:
definitions - The list of field definitions

getFieldDefinitions

public com.actuate.schemas.FieldDefinition[] getFieldDefinitions()
Returns the list of all field definitions that are available in this table parameter

Returns:
The list of field definitions

getColumnTypeDescription

public java.lang.String[] getColumnTypeDescription()
Returns the description that is displayed for the data type of the column along with whether it is required or not

Returns:
A string array of descriptions

setColumnTypeDescription

public void setColumnTypeDescription(java.lang.String[] strings)
Sets the descriptions to be displayed for all the columns

Parameters:
strings - The descriptions for the columns