com.objectplanet.survey.plugin.api
Class QuestionMatrix

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Question
      extended by com.objectplanet.survey.plugin.api.QuestionMatrix

public class QuestionMatrix
extends Question

This class represents a matrix question. Subclasses Question, and adds functionality to create/edit/delete a matrix question. A matrix consists of cells of different types, so that users can create customized questions. Cells can be organized in cellgroups. To add a new cellgroup use addCellGroup() method. A cellgroup includes all cells in rectangular area from start cell (top-left cell) to end cell (bottom-right cell). A cellgroup cannot intersect another group.

Author:
Irina Brun
Created:
21. march 2003

Field Summary
static int CELL_CHECKBOX
          Matrix cell of type checkbox.
static int CELL_DROPDOWN
          Matrix cell of type dropdown.
static int CELL_EMPTY
          Empty matrix cell.
static int CELL_IMAGE
          Matrix cell of type image.
static int CELL_LABEL
          Matrix cell of type label.
static int CELL_NUMERIC_DEC
          Matrix cell of type numeric decimal.
static int CELL_NUMERIC_INT
          Matrix cell of type numeric integer.
static int CELL_RADIO
          Matrix cell of type radio button.
static int CELL_TEXT
          Matrix cell of type text
static int CELLGROUP_ANY_CELL
          Cellgroup type: The group contains cells of checkbox type.
static int CELLGROUP_CUSTOMIZED
          Cellgroup type: The group contains cells of different types
static int CELLGROUP_INTERSECTION
          Cellgroup type: The group contains cells of checkbox type, only one cell can be selected
static int CELLGROUP_ONE_PER_ROW
          Cellgroup type: The group contains cells of radio type, one cell per row can be selected
static int CELLGROUP_RANKING
          Cellgroup type: The group contains cells of checkbox type, one cell per column x row can be selected
 
Fields inherited from class com.objectplanet.survey.plugin.api.Question
ESSAY_FIELD_CHECKBOX, ESSAY_FIELD_DROPDOWN, ESSAY_FIELD_NUMERIC_DEC, ESSAY_FIELD_NUMERIC_INT, ESSAY_FIELD_TEXT, ESSAYFIELD_LENGTH, INTEXT_TYPE_CHECKBOX, INTEXT_TYPE_DROPDOWN, INTEXT_TYPE_NUMERIC_DEC, INTEXT_TYPE_NUMERIC_INT, INTEXT_TYPE_TEXT, QUESTION_DROPDOWN, QUESTION_MATRIX, QUESTION_MULTIPLE, QUESTION_NO_TYPE, QUESTION_NUMERIC, QUESTION_RATING, TAG_END, TAG_START, UPLOAD_IMAGE, UPLOAD_NONE
 
Method Summary
 void addCellGroup(java.lang.String cellGroupName, int groupType, int x1, int y1, int x2, int y2)
          Create a new cellgroup.
 void deleteCellGroup(java.lang.String cellGroupName)
          Delete the cellgroup.
 void deleteColumn(int pos)
          This method deletes a matrix column.
 void deleteRow(int pos)
          This method deletes a matrix row.
 java.lang.String getCellBackgroundColor(int col, int row)
          Gets the background color of the cell .
 java.lang.String getCellBackgroundColor(java.lang.String cellGroupName)
          Gets the background color of the cellgroup.
 java.lang.String[] getCellDropdownItems(int col, int row)
          Gets the dropdown items.
 java.lang.String getCellDropdownLabel(int col, int row)
          Gets the dropdown label.
 boolean getCellDropdownSortOn(int col, int row)
          Gets the dropdown sort on attribute.
 int getCellFieldSize(int col, int row)
          Gets the cell input-field size.
 int getCellGroupEndCol(java.lang.String cellGroupName)
          Gets the end column of the cellgroup.
 int getCellGroupEndRow(java.lang.String cellGroupName)
          Gets the end row of the cellgroup.
 java.lang.String getCellGroupHeading(java.lang.String cellGroupName)
          Gets the heading of the cellgroup.
 java.lang.String getCellGroupName(int col, int row)
          Gets a cellgroup by col/row position.
 java.lang.String[] getCellGroupNames()
          Gets all cellgroup names.
 int getCellGroupStartCol(java.lang.String cellGroupName)
          Gets the start column of the cellgroup.
 int getCellGroupStartRow(java.lang.String cellGroupName)
          Gets the start row of the cellgroup.
 int getCellGroupType(java.lang.String cellGroupName)
          Gets the type of the cellgroup.
 java.lang.String getCellImageRelativeURL(int col, int row)
          Gets the image url.
 java.lang.String getCellLabel(int col, int row)
          Gets the cell label.
 java.lang.String getCellLabelColor(int col, int row)
          Gets the label text color.
 int getCellType(int col, int row)
          Gets the cell type.
 int getColumnCount()
          Gets the number of matrix columns
 int getRowCount()
          Gets the number of matrix rows
 void insertColumn(int pos)
          This method insert a column before a particular column.
 void insertRow(int pos)
          This method inserts an empty row before a particular row.
 void keepBusinessObject()
          Get and keep business object.
 void releaseBusinessObject()
          Release business object.
 void setCellBackgroundColor(int col, int row, java.lang.String bgColor)
          Sets the background color of the cell.
 void setCellCheckboxType(int col, int row)
          Sets the cell of type checkbox.
 void setCellDecimalType(int col, int row, int fieldSize, java.lang.String errorMsg)
          Sets the cell of type numeric double.
 void setCellDropdownType(int col, int row, java.lang.String label, java.lang.String items, boolean sortOn)
          Sets the cell of type numeric double.
 void setCellEmpty(int col, int row)
          Sets the empty cell.
 void setCellGroupBackgroundColor(java.lang.String cellGroupName, java.lang.String bgColor)
          Sets the background color for the cellgroup
 void setCellGroupHeading(java.lang.String cellGroupName, java.lang.String heading)
          Sets the heading of the cellgroup.
 void setCellGroupName(java.lang.String cellGroupName, java.lang.String newGroupName)
          Sets the new cellgroup name.
 void setCellGroupType(java.lang.String cellGroupName, int newGroupType)
          Sets the cellgroup type.
 void setCellImageType(int col, int row, java.lang.String relativeUrl)
          Sets the cell of type image.
 void setCellIntegerType(int col, int row, int fieldSize, java.lang.String errorMsg)
          Sets the cell of type numeric integer.
 void setCellLabelType(int col, int row, java.lang.String label, java.lang.String textColor)
          Sets the cell of type label (only text, not input of type text).
 void setCellRadioType(int col, int row)
          Sets the cell of type radio button.
 void setCellTextType(int col, int row, int fieldSize)
          Sets the cell of type text.
 void setSize(int newColumnCount, int newRowCount)
          Sets the matrix size.
 
Methods inherited from class com.objectplanet.survey.plugin.api.Question
addEssayFieldCheckbox, addEssayFieldDecimal, addEssayFieldDropdown, addEssayFieldInteger, addEssayFieldText, addIntextCheckbox, addIntextDecimal, addIntextDropdown, addIntextInteger, addIntextText, deleteEssayField, deleteIntext, deleteValidator, deleteValidator, deleteValidator, deleteValidator, getAnswerRotation, getCustomId, getDisplayNo, getEssayFieldCount, getEssayFieldDropdownItems, getEssayFieldDropdownLabel, getEssayFieldDropdownSortOn, getEssayFieldSize, getEssayFieldType, getFreeTextColumns, getFreeTextLabel, getFreeTextMaxLength, getFreeTextRows, getIntextCount, getIntextDropdownItems, getIntextDropdownLabel, getIntextDropdownSortOn, getIntextIndex, getIntextName, getIntextSize, getIntextType, getQuestionId, getQuestionLayout, getQuestionText, getQuestionType, getTextAfter, getTextBefore, getUploadType, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorParameter, getValidatorParameter, getValidatorParameter, getValidatorParameter, getWeight, hasBusinessObject, isFreeTextOn, isValidatorOn, isValidatorOn, isValidatorOn, isValidatorOn, setAnswerRotation, setDisplayNo, setFreeTextColumns, setFreeTextLabel, setFreeTextMaxLength, setFreeTextOn, setFreeTextRows, setQuestionLayout, setQuestionText, setTextAfter, setTextBefore, setUploadType, setValidator, setValidator, setValidator, setValidator, setWeight, updateAttribute, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELLGROUP_ANY_CELL

public static final int CELLGROUP_ANY_CELL
Cellgroup type: The group contains cells of checkbox type.

See Also:
Constant Field Values

CELLGROUP_CUSTOMIZED

public static final int CELLGROUP_CUSTOMIZED
Cellgroup type: The group contains cells of different types

See Also:
Constant Field Values

CELLGROUP_INTERSECTION

public static final int CELLGROUP_INTERSECTION
Cellgroup type: The group contains cells of checkbox type, only one cell can be selected

See Also:
Constant Field Values

CELLGROUP_ONE_PER_ROW

public static final int CELLGROUP_ONE_PER_ROW
Cellgroup type: The group contains cells of radio type, one cell per row can be selected

See Also:
Constant Field Values

CELLGROUP_RANKING

public static final int CELLGROUP_RANKING
Cellgroup type: The group contains cells of checkbox type, one cell per column x row can be selected

See Also:
Constant Field Values

CELL_CHECKBOX

public static final int CELL_CHECKBOX
Matrix cell of type checkbox.

See Also:
Constant Field Values

CELL_DROPDOWN

public static final int CELL_DROPDOWN
Matrix cell of type dropdown.

See Also:
Constant Field Values

CELL_EMPTY

public static final int CELL_EMPTY
Empty matrix cell.

See Also:
Constant Field Values

CELL_IMAGE

public static final int CELL_IMAGE
Matrix cell of type image.

See Also:
Constant Field Values

CELL_LABEL

public static final int CELL_LABEL
Matrix cell of type label.

See Also:
Constant Field Values

CELL_NUMERIC_DEC

public static final int CELL_NUMERIC_DEC
Matrix cell of type numeric decimal.

See Also:
Constant Field Values

CELL_NUMERIC_INT

public static final int CELL_NUMERIC_INT
Matrix cell of type numeric integer.

See Also:
Constant Field Values

CELL_RADIO

public static final int CELL_RADIO
Matrix cell of type radio button.

See Also:
Constant Field Values

CELL_TEXT

public static final int CELL_TEXT
Matrix cell of type text

See Also:
Constant Field Values
Method Detail

setCellBackgroundColor

public void setCellBackgroundColor(int col,
                                   int row,
                                   java.lang.String bgColor)
                            throws java.lang.IllegalArgumentException,
                                   LockException,
                                   RespondentsExistException,
                                   SurveySecurityException,
                                   SurveySystemException
Sets the background color of the cell. Can not be applied to empty cells (IllegalArgumentException will be thrown) .

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
bgColor - The cell background color (Example: #CCCCFF)
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

setCellCheckboxType

public void setCellCheckboxType(int col,
                                int row)
                         throws LockException,
                                RespondentsExistException,
                                SurveySecurityException,
                                SurveySystemException
Sets the cell of type checkbox.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellDecimalType

public void setCellDecimalType(int col,
                               int row,
                               int fieldSize,
                               java.lang.String errorMsg)
                        throws LockException,
                               RespondentsExistException,
                               SurveySecurityException,
                               SurveySystemException
Sets the cell of type numeric double.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
fieldSize - The size of the text field
errorMsg - Error message to show to the respondent if the response is not a invalid double.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellDropdownType

public void setCellDropdownType(int col,
                                int row,
                                java.lang.String label,
                                java.lang.String items,
                                boolean sortOn)
                         throws LockException,
                                RespondentsExistException,
                                SurveySecurityException,
                                SurveySystemException
Sets the cell of type numeric double.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
label - Dropdown label
items - Dropdown items, one per line
sortOn - True if items should be alphabetically sorted.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellEmpty

public void setCellEmpty(int col,
                         int row)
                  throws java.lang.IllegalArgumentException,
                         LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException
Sets the empty cell.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

setCellGroupBackgroundColor

public void setCellGroupBackgroundColor(java.lang.String cellGroupName,
                                        java.lang.String bgColor)
                                 throws LockException,
                                        RespondentsExistException,
                                        SurveySecurityException,
                                        SurveySystemException
Sets the background color for the cellgroup

Parameters:
cellGroupName - The cellgroup to update.
bgColor - The new background color
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellGroupHeading

public void setCellGroupHeading(java.lang.String cellGroupName,
                                java.lang.String heading)
                         throws java.lang.IllegalArgumentException,
                                LockException,
                                RespondentsExistException,
                                SurveySecurityException,
                                SurveySystemException
Sets the heading of the cellgroup. Applicable only for cellgroups at the top of the matrix (with start row 0 and 1)

Parameters:
cellGroupName - The cellgroup to update.
heading - The new heading.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

setCellGroupName

public void setCellGroupName(java.lang.String cellGroupName,
                             java.lang.String newGroupName)
                      throws LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException,
                             java.lang.IllegalArgumentException
Sets the new cellgroup name. Cellgroup name must be unique.

Parameters:
cellGroupName - The cellgroup to update.
newGroupName - The new cellgroup name
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If cellgroup with newGroupName already exists.

setCellGroupType

public void setCellGroupType(java.lang.String cellGroupName,
                             int newGroupType)
                      throws LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException
Sets the cellgroup type. One of the constants above. All input fields will be changed according to the cellgroup type. i.e if you change from CELLGROUP_ONE_PER_ROW to CELLGROUP_ANY_CELL, all radio buttons will be replaced with checkboxes.

Cells of type CELL_EMPTY, CELL_IMAGE and CELL_LABEL are not affected by changing cellgroup type.

Parameters:
cellGroupName - The cellgroup to update.
newGroupType - The new cellgroup type. One of the constants above.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellImageType

public void setCellImageType(int col,
                             int row,
                             java.lang.String relativeUrl)
                      throws java.lang.IllegalArgumentException,
                             LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException
Sets the cell of type image.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
relativeUrl - Relative image url (Example: upload/images/common/myImage.gif)
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
java.lang.IllegalArgumentException - If illegal parameters.
SurveySystemException - If an error occurs in the system.

setCellIntegerType

public void setCellIntegerType(int col,
                               int row,
                               int fieldSize,
                               java.lang.String errorMsg)
                        throws LockException,
                               RespondentsExistException,
                               SurveySecurityException,
                               SurveySystemException
Sets the cell of type numeric integer.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
fieldSize - The size of the text field
errorMsg - Error message to show to the respondent if the response is not a invalid integer.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellLabelType

public void setCellLabelType(int col,
                             int row,
                             java.lang.String label,
                             java.lang.String textColor)
                      throws LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException
Sets the cell of type label (only text, not input of type text).

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
label - Cell label.
textColor - Text color for the label.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCellRadioType

public void setCellRadioType(int col,
                             int row)
                      throws java.lang.IllegalArgumentException,
                             LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException
Sets the cell of type radio button. Radio buttons MUST be insight a cellgroup. Otherwise in survey module they can be checked but never unchecked. Create cellgroup first and than set radio button-cells.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
java.lang.IllegalArgumentException - If illegal parameters.
SurveySystemException - If an error occurs in the system.

setCellTextType

public void setCellTextType(int col,
                            int row,
                            int fieldSize)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException
Sets the cell of type text.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
fieldSize - The size of the text field
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSize

public void setSize(int newColumnCount,
                    int newRowCount)
             throws java.lang.IllegalArgumentException,
                    LockException,
                    RespondentsExistException,
                    SurveySystemException,
                    SurveySecurityException
Sets the matrix size. If the matrix are set to smaller size, any cells beyond the new size will be deleted. If the new size is bigger, custom/empty cells will be created.

Parameters:
newColumnCount - The number of columns
newRowCount - The number of rows
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
java.lang.IllegalArgumentException - If illegal parameters.
SurveySystemException - If an error occurs in the system.
SurveySecurityException

getCellBackgroundColor

public java.lang.String getCellBackgroundColor(int col,
                                               int row)
                                        throws java.lang.IllegalArgumentException,
                                               SurveySystemException
Gets the background color of the cell . Applicable for all cells except CELL_EMPTY (returns null).

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The cellBackground color
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellBackgroundColor

public java.lang.String getCellBackgroundColor(java.lang.String cellGroupName)
                                        throws java.lang.IllegalArgumentException,
                                               SurveySystemException
Gets the background color of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The background color
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellDropdownItems

public java.lang.String[] getCellDropdownItems(int col,
                                               int row)
                                        throws java.lang.IllegalArgumentException,
                                               SurveySystemException
Gets the dropdown items. Applicable for cells of type CELL_DROPDOWN

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The dropdown items, one per line or null
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellDropdownLabel

public java.lang.String getCellDropdownLabel(int col,
                                             int row)
                                      throws java.lang.IllegalArgumentException,
                                             SurveySystemException
Gets the dropdown label. Applicable for cells of type CELL_DROPDOWN.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The dropdown label or null
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellDropdownSortOn

public boolean getCellDropdownSortOn(int col,
                                     int row)
                              throws java.lang.IllegalArgumentException,
                                     SurveySystemException
Gets the dropdown sort on attribute. Applicable for cells of type CELL_DROPDOWN.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The sort on value or false.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellFieldSize

public int getCellFieldSize(int col,
                            int row)
                     throws java.lang.IllegalArgumentException,
                            SurveySystemException
Gets the cell input-field size. Applicable for cells of type CELL_TEXT, CELL_NUMERIC_INT and CELL_NUMERIC_DEC

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The cell field size
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupEndCol

public int getCellGroupEndCol(java.lang.String cellGroupName)
                       throws java.lang.IllegalArgumentException,
                              SurveySystemException
Gets the end column of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The end column
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupEndRow

public int getCellGroupEndRow(java.lang.String cellGroupName)
                       throws java.lang.IllegalArgumentException,
                              SurveySystemException
Gets the end row of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The end row
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupHeading

public java.lang.String getCellGroupHeading(java.lang.String cellGroupName)
                                     throws java.lang.IllegalArgumentException,
                                            SurveySystemException
Gets the heading of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The heading of the cellgroup.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupName

public java.lang.String getCellGroupName(int col,
                                         int row)
                                  throws SurveySystemException,
                                         java.lang.IllegalArgumentException
Gets a cellgroup by col/row position. If the cell in position is inside a group, this group will be returned, otherwise null.

Parameters:
col - Column position of the cell, from 0 to column count -1
row - Row position of the cell, from 0 to row count -1
Returns:
The Cellgroup name
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal positions

getCellGroupNames

public java.lang.String[] getCellGroupNames()
                                     throws SurveySystemException
Gets all cellgroup names.

Returns:
The cellgroup names
Throws:
SurveySystemException - If an error occurs in the system.

getCellGroupStartCol

public int getCellGroupStartCol(java.lang.String cellGroupName)
                         throws java.lang.IllegalArgumentException,
                                SurveySystemException
Gets the start column of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The start column
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupStartRow

public int getCellGroupStartRow(java.lang.String cellGroupName)
                         throws java.lang.IllegalArgumentException,
                                SurveySystemException
Gets the start row of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The start row
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellGroupType

public int getCellGroupType(java.lang.String cellGroupName)
                     throws java.lang.IllegalArgumentException,
                            SurveySystemException
Gets the type of the cellgroup.

Parameters:
cellGroupName - The cellgroup name.
Returns:
The type of the cellgroup.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellImageRelativeURL

public java.lang.String getCellImageRelativeURL(int col,
                                                int row)
                                         throws java.lang.IllegalArgumentException,
                                                SurveySystemException
Gets the image url. Applicable for cells of type CELL_IMAGE.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The relative URL of the image cell
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellLabel

public java.lang.String getCellLabel(int col,
                                     int row)
                              throws java.lang.IllegalArgumentException,
                                     SurveySystemException
Gets the cell label. Applicable for cells of type CELL_LABEL

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The cell label
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellLabelColor

public java.lang.String getCellLabelColor(int col,
                                          int row)
                                   throws java.lang.IllegalArgumentException,
                                          SurveySystemException
Gets the label text color. Applicable for cells of type CELL_LABEL

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The label text color.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getCellType

public int getCellType(int col,
                       int row)
                throws java.lang.IllegalArgumentException,
                       SurveySystemException
Gets the cell type.

Parameters:
col - Column position, from 0 to column count -1
row - Row position, from 0 to row count -1
Returns:
The cell type. One of the constants above
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

getColumnCount

public int getColumnCount()
                   throws SurveySystemException
Gets the number of matrix columns

Returns:
The number of columns
Throws:
SurveySystemException - If an error occurs in the system.

getRowCount

public int getRowCount()
                throws SurveySystemException
Gets the number of matrix rows

Returns:
The number of rows
Throws:
SurveySystemException - If an error occurs in the system.

addCellGroup

public void addCellGroup(java.lang.String cellGroupName,
                         int groupType,
                         int x1,
                         int y1,
                         int x2,
                         int y2)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Create a new cellgroup.
All input fields will be changed according to the cellgroup type. i.e if you create cellgroup of type CELLGROUP_ANY_CELL, all dropdowns, text and numeric input fields will be replaced with checkboxes.

Cells of type CELL_EMPTY, CELL_IMAGE and CELL_LABEL are not affected by changing cellgroup type.

Parameters:
x1 - Start column for cellgroup (top-left cell), from 0 to column count -1
y1 - Start row (top-left cell), from 0 to row count -1
x2 - End column (bottom-right), from 0 to column count -1
y2 - End row (bottom-right), from 0 to row count -1
groupType - Cellgroup type, one of the constants above
cellGroupName - Unique cellgroup name
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If cellgroup with this name already exists or invalid positions or intersection with another group.

deleteCellGroup

public void deleteCellGroup(java.lang.String cellGroupName)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException,
                            java.lang.IllegalArgumentException
Delete the cellgroup. Radio cells (which can't exist outside a group) will be replaced by empty cells.

Parameters:
cellGroupName - The cellgroup to delete.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal parameters.

deleteColumn

public void deleteColumn(int pos)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
This method deletes a matrix column.

Parameters:
pos - The index of the column to delete, from 0 to column count-1
Throws:
java.lang.IllegalArgumentException - If illegal column
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

deleteRow

public void deleteRow(int pos)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException,
                      java.lang.IllegalArgumentException
This method deletes a matrix row.

Parameters:
pos - the index of the row to delete, from 0 to row count-1
Throws:
java.lang.IllegalArgumentException - If illegal position
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

insertColumn

public void insertColumn(int pos)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
This method insert a column before a particular column.

Parameters:
pos - The index of the column before which the new column will be inserted, from 0 to column count-1
Throws:
java.lang.IllegalArgumentException - If illegal position
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

insertRow

public void insertRow(int pos)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException,
                      java.lang.IllegalArgumentException
This method inserts an empty row before a particular row.

Parameters:
pos - The index of the row before which the new row will be inserted, from 0 to row count-1
Throws:
java.lang.IllegalArgumentException - If illegal position
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

keepBusinessObject

public void keepBusinessObject()
                        throws SurveySystemException
Get and keep business object. See ATTENTION .

Overrides:
keepBusinessObject in class Question
Throws:
SurveySystemException - If an error occurs in the system.

releaseBusinessObject

public void releaseBusinessObject()
Release business object. See ATTENTION .

Overrides:
releaseBusinessObject in class Question

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016