com.objectplanet.survey.plugin.api
Class Question

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Question
Direct Known Subclasses:
QuestionDropdown, QuestionMatrix, QuestionMultiple, QuestionNumeric, QuestionRating

public class Question
extends java.lang.Object

ATTENTION: This class is a facade for the system business Question. To improve performance you can force it to keep the reference to the business object by calling keepBusinessObject() . Keeping references to objects may cause inconsistencies in the system, so always remember to call releaseBusinessObject() as soon as you are finished using them.

Class Question encapsulates question data.
Question types implemented as subclasses of Question. A question can be one of the following types:


In addition to type input, a question can have other forms of input:
Input from respondents must be validated. Method validate() performs this operation and should be called after each response.

Plugin api for branch conditions is not yet implemented.

Author:
Irina Brun
Created:
21. march 2003

Field Summary
static int ESSAY_FIELD_CHECKBOX
          Checkbox in-text field type
static int ESSAY_FIELD_DROPDOWN
          Dropdown in-text field type
static int ESSAY_FIELD_NUMERIC_DEC
          Numeric decimal in-text field type
static int ESSAY_FIELD_NUMERIC_INT
          Numeric integer in-text field type
static int ESSAY_FIELD_TEXT
          Text input in-text field type
static int ESSAYFIELD_LENGTH
          Essay field total length
static int INTEXT_TYPE_CHECKBOX
          In-text element of type checkbox
static int INTEXT_TYPE_DROPDOWN
          In-text element of type dropdown
static int INTEXT_TYPE_NUMERIC_DEC
          In-text element of type numeric decimal
static int INTEXT_TYPE_NUMERIC_INT
          In-text element of type numeric integer
static int INTEXT_TYPE_TEXT
          In-text element of type text
static int QUESTION_DROPDOWN
          Dropdown question type
static int QUESTION_MATRIX
          Matrix question type
static int QUESTION_MULTIPLE
          Multiple choice question type
static int QUESTION_NO_TYPE
          No question type (in-text elements or free text is usually used for input)
static int QUESTION_NUMERIC
          Numeric question type
static int QUESTION_RATING
          Rating question type
static java.lang.String TAG_END
          In-text element end tag
static java.lang.String TAG_START
          In-text element start tag
static int UPLOAD_IMAGE
          Upload allowed, type images
static int UPLOAD_NONE
          No upload allowed
 
Method Summary
 void addEssayFieldCheckbox(int posInQuestionText)
          Deprecated. Use addIntextCheckbox(int posInQuestionText, String intextName).
 void addEssayFieldDecimal(int posInQuestionText, int fieldSize, java.lang.String errorMsg)
          Deprecated. Use addIntextDecimal(int posInQuestionText, String intextName, int fieldSize, String errorMsg).
 void addEssayFieldDropdown(int posInQuestionText, java.lang.String label, java.lang.String items, boolean sortOn)
          Deprecated. Use addIntextDropdown(int posInQuestionText, String intextName, String label, String items, boolean sortOn).
 void addEssayFieldInteger(int posInQuestionText, int fieldSize, java.lang.String errorMsg)
          Deprecated. Use addIntextInteger(int posInQuestionText, String intextName, int fieldSize, String errorMsg).
 void addEssayFieldText(int posInQuestionText, int fieldSize)
          Deprecated. Use addEssayFieldText(int posInQuestionText, String intextName, int fieldSize).
 void addIntextCheckbox(int posInQuestionText, java.lang.String intextName)
          Adds an in-text element of type checkbox to the question.
 void addIntextDecimal(int posInQuestionText, java.lang.String intextName, int fieldSize, java.lang.String errorMsg)
          Adds an in-text element of type numeric decimal to the question.
 void addIntextDropdown(int posInQuestionText, java.lang.String intextName, java.lang.String label, java.lang.String items, boolean sortOn)
          Adds an in-text element of type dropdown to the question.
 void addIntextInteger(int posInQuestionText, java.lang.String intextName, int fieldSize, java.lang.String errorMsg)
          Adds an in-text element of type numeric integer to the question.
 void addIntextText(int posInQuestionText, java.lang.String intextName, int fieldSize)
          Adds an in-text element of type text to the question.
 void deleteEssayField(int inTextFieldIndex)
          Deprecated. use deleteIntext(intextIndex)
 void deleteIntext(int intextIndex)
          Delete in-text element from the question.
 void deleteValidator(int type)
          Delete validator.
 void deleteValidator(int type, int intextIndex)
          Deprecated. use deleteValidator(int type, String intextTagId)
 void deleteValidator(int type, int columnPosition, int rowPosition)
          Delete matrix cell validator.
 void deleteValidator(int type, java.lang.String intextTagId)
          Delete in-text element validator.
 boolean getAnswerRotation()
          Gets the answer rotation attribute
 java.lang.String getCustomId()
          Gets the customId of the Question object.
 java.lang.String getDisplayNo()
          Gets the display number attribute of the question.
 int getEssayFieldCount()
          Deprecated. use getIntextCount()
 java.lang.String[] getEssayFieldDropdownItems(int inTextFieldIndex)
          Deprecated. use getIntextDropdownItems(intextIndex)
 java.lang.String getEssayFieldDropdownLabel(int inTextFieldIndex)
          Deprecated. use getIntextDropdownLabel(int intextIndex)
 boolean getEssayFieldDropdownSortOn(int inTextFieldIndex)
          Deprecated. use getIntextDropdownSortOn(int intextIntext);
 int getEssayFieldSize(int inTextFieldIndex)
          Deprecated. use getIntextSize(int intextIndex)
 int getEssayFieldType(int inTextFieldIndex)
          Deprecated. use getIntextType(int intextIndex)
 int getFreeTextColumns()
          Gets the number of columns in the free-text field
 java.lang.String getFreeTextLabel()
          Gets the label of the free-text field
 int getFreeTextMaxLength()
          Gets the max allowed length (to type in) of the free-text field.
 int getFreeTextRows()
          Gets the number of rows in the free-text field
 int getIntextCount()
          Gets the number of in-text elements in this question
 java.lang.String[] getIntextDropdownItems(int intextIndex)
          Get dropdown items of in-text element, one per line.
 java.lang.String getIntextDropdownLabel(int intextIndex)
          Get dropdown label of in-text element.
 boolean getIntextDropdownSortOn(int intextIntext)
          Get dropdown in-text element sortOn attribute .
 int getIntextIndex(java.lang.String intextName)
          Get in-text element index by name.
 java.lang.String getIntextName(int intextIndex)
          Get in-text element name.
 int getIntextSize(int intextIndex)
          Get in-text element size.
 int getIntextType(int intextIndex)
          Get in-text element type.
 long getQuestionId()
          Gets the question Id.
 java.lang.String getQuestionLayout()
          Gets the question layout.
 java.lang.String getQuestionText()
          Gets the question text.
 int getQuestionType()
          Gets the questionType attribute of the Question.
 java.lang.String getTextAfter()
          Gets the textAfter attribute of the Question.
 java.lang.String getTextBefore()
          Gets the text-before attribute of the question.
 int getUploadType()
          Gets the upload type, currently supported: UPLOAD_NONE and UPLOAD_IMAGE
 java.lang.String getValidatorErrorMessage(int type)
          Gets error message for validator.
 java.lang.String getValidatorErrorMessage(int type, int intextIndex)
          Deprecated. getValidatorErrorMessage(int, String)
 java.lang.String getValidatorErrorMessage(int type, int columnPosition, int rowPosition)
          Gets error message for matrix cell validator.
 java.lang.String getValidatorErrorMessage(int type, java.lang.String intextTagId)
          Gets error message for in-text element validator.
 java.lang.String getValidatorParameter(int type)
          Gets the validator parameter.
 java.lang.String getValidatorParameter(int type, int intextIndex)
          Deprecated. use getValidatorParameter(int type, String intextTagId)
 java.lang.String getValidatorParameter(int type, int columnPosition, int rowPosition)
          Gets the matrix cell validator parameter.
 java.lang.String getValidatorParameter(int type, java.lang.String intextTagId)
          Gets the in-text element validator parameter.
 int getWeight()
          Gets the weight of this question
 boolean hasBusinessObject()
          Check if this question has reference to the business Question object.
 boolean isFreeTextOn()
          Gets the freeTextOn attribute of the question
 boolean isValidatorOn(int type)
          Check if validator is on.
 boolean isValidatorOn(int type, int intextIndex)
          Deprecated. use isValidatorOn(int type, String intextTagId)
 boolean isValidatorOn(int type, int columnPosition, int rowPosition)
          Check if matrix cell validator is on.
 boolean isValidatorOn(int type, java.lang.String intextTagId)
          Check if in-text element validator is on.
 void keepBusinessObject()
          Get and keep business object.
 void releaseBusinessObject()
          Release business object.
 void setAnswerRotation(boolean answerRotation)
          The answer rotation attribute.
 void setDisplayNo(java.lang.String displayNo)
          The display number is specified by survey creator/admin.
 void setFreeTextColumns(int freeTextCols)
          Sets the number of columns in the free-text field
 void setFreeTextLabel(java.lang.String freeTextLabel)
          Sets the label for the free-text field
 void setFreeTextMaxLength(int freeTextMaxLength)
          Sets the max length allowed to type in the free text field.
 void setFreeTextOn(boolean freeTextOn)
          Sets the freeTextOn attribute of the question
 void setFreeTextRows(int freeTextRows)
          Sets the number of rows in the free-text field
 void setQuestionLayout(java.lang.String questionLayout)
          Sets the question layout attribute of the question.
 void setQuestionText(java.lang.String questionText)
          Sets the question text.
 void setTextAfter(java.lang.String textAfter)
          Sets the text-after attribute of the question.
 void setTextBefore(java.lang.String setTextBefore)
          Sets the text-before attribute of the question.
 void setUploadType(int uploadType)
          Set the upload type.
 void setValidator(int type, java.lang.String errorMessage, java.lang.String parameter)
          Sets the validator.
 void setValidator(int type, java.lang.String errorMessage, java.lang.String parameter, int intextIndex)
          Deprecated. Use setValidator(int type, String errorMessage, String parameter, String intextTagId)
 void setValidator(int type, java.lang.String errorMessage, java.lang.String parameter, int columnPosition, int rowPosition)
          Sets the matrix cell validator.
 void setValidator(int type, java.lang.String errorMessage, java.lang.String parameter, java.lang.String intextTagId)
          Sets the in-text element validator.
 void setWeight(int weight)
          The weight of this question
 void updateAttribute(java.lang.String attritbuteDbName)
          Update question attribute in the storage.
 boolean validate(Response response)
          Validates a response.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTEXT_TYPE_CHECKBOX

public static final int INTEXT_TYPE_CHECKBOX
In-text element of type checkbox

See Also:
Constant Field Values

INTEXT_TYPE_DROPDOWN

public static final int INTEXT_TYPE_DROPDOWN
In-text element of type dropdown

See Also:
Constant Field Values

INTEXT_TYPE_NUMERIC_DEC

public static final int INTEXT_TYPE_NUMERIC_DEC
In-text element of type numeric decimal

See Also:
Constant Field Values

INTEXT_TYPE_NUMERIC_INT

public static final int INTEXT_TYPE_NUMERIC_INT
In-text element of type numeric integer

See Also:
Constant Field Values

INTEXT_TYPE_TEXT

public static final int INTEXT_TYPE_TEXT
In-text element of type text

See Also:
Constant Field Values

QUESTION_DROPDOWN

public static final int QUESTION_DROPDOWN
Dropdown question type

See Also:
Constant Field Values

QUESTION_MATRIX

public static final int QUESTION_MATRIX
Matrix question type

See Also:
Constant Field Values

QUESTION_MULTIPLE

public static final int QUESTION_MULTIPLE
Multiple choice question type

See Also:
Constant Field Values

QUESTION_NO_TYPE

public static final int QUESTION_NO_TYPE
No question type (in-text elements or free text is usually used for input)

See Also:
Constant Field Values

QUESTION_NUMERIC

public static final int QUESTION_NUMERIC
Numeric question type

See Also:
Constant Field Values

QUESTION_RATING

public static final int QUESTION_RATING
Rating question type

See Also:
Constant Field Values

TAG_END

public static final java.lang.String TAG_END
In-text element end tag

See Also:
Constant Field Values

UPLOAD_NONE

public static final int UPLOAD_NONE
No upload allowed

See Also:
Constant Field Values

UPLOAD_IMAGE

public static final int UPLOAD_IMAGE
Upload allowed, type images

See Also:
Constant Field Values

TAG_START

public static final java.lang.String TAG_START
In-text element start tag

See Also:
Constant Field Values

ESSAYFIELD_LENGTH

public static final int ESSAYFIELD_LENGTH
Essay field total length

See Also:
Constant Field Values

ESSAY_FIELD_CHECKBOX

public static final int ESSAY_FIELD_CHECKBOX
Checkbox in-text field type

See Also:
Constant Field Values

ESSAY_FIELD_DROPDOWN

public static final int ESSAY_FIELD_DROPDOWN
Dropdown in-text field type

See Also:
Constant Field Values

ESSAY_FIELD_NUMERIC_DEC

public static final int ESSAY_FIELD_NUMERIC_DEC
Numeric decimal in-text field type

See Also:
Constant Field Values

ESSAY_FIELD_NUMERIC_INT

public static final int ESSAY_FIELD_NUMERIC_INT
Numeric integer in-text field type

See Also:
Constant Field Values

ESSAY_FIELD_TEXT

public static final int ESSAY_FIELD_TEXT
Text input in-text field type

See Also:
Constant Field Values
Method Detail

setWeight

public void setWeight(int weight)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException
The weight of this question

Parameters:
weight - The new weight
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.

setAnswerRotation

public void setAnswerRotation(boolean answerRotation)
                       throws LockException,
                              RespondentsExistException,
                              SurveySecurityException,
                              SurveySystemException
The answer rotation attribute.

Parameters:
answerRotation - True if answer rotation is on.
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.

setDisplayNo

public void setDisplayNo(java.lang.String displayNo)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException
The display number is specified by survey creator/admin. This attribute is displayed instead of the question number, if Survey attribute dislpayQuestionNo is set to DISPLAY_QUESTIONNO_DEFINED

Parameters:
displayNo - The new display number
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.

setUploadType

public void setUploadType(int uploadType)
                   throws LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Set the upload type. Currently supported: UPLOAD_NONE and UPLOAD_IMAGE

Parameters:
uploadType - The new upload type
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.

updateAttribute

public void updateAttribute(java.lang.String attritbuteDbName)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Update question attribute in the storage. The attribute value must be set to the object before calling this method. For example: question.setWeight(25); question.updateAttribute("weight");

Parameters:
attritbuteDbName - Attribute name used in the storage.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFreeTextColumns

public void setFreeTextColumns(int freeTextCols)
                        throws LockException,
                               RespondentsExistException,
                               SurveySecurityException,
                               SurveySystemException
Sets the number of columns in the free-text field

Parameters:
freeTextCols - The number of columns
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.

setFreeTextLabel

public void setFreeTextLabel(java.lang.String freeTextLabel)
                      throws LockException,
                             RespondentsExistException,
                             SurveySecurityException,
                             SurveySystemException
Sets the label for the free-text field

Parameters:
freeTextLabel - The new free-text 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.

setFreeTextMaxLength

public void setFreeTextMaxLength(int freeTextMaxLength)
                          throws LockException,
                                 RespondentsExistException,
                                 SurveySecurityException,
                                 SurveySystemException
Sets the max length allowed to type in the free text field.

Parameters:
freeTextMaxLength - The max length of free-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.

setFreeTextOn

public void setFreeTextOn(boolean freeTextOn)
                   throws LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Sets the freeTextOn attribute of the question

Parameters:
freeTextOn - The new freeTextOn value
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.

setFreeTextRows

public void setFreeTextRows(int freeTextRows)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException
Sets the number of rows in the free-text field

Parameters:
freeTextRows - The new number of free text 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.
SurveySystemException - If an error occurs in the system.

setQuestionLayout

public void setQuestionLayout(java.lang.String questionLayout)
                       throws LockException,
                              RespondentsExistException,
                              SurveySecurityException,
                              SurveySystemException
Sets the question layout attribute of the question. Question text may be placed above or to the left of question input fields.

Parameters:
questionLayout - The new questionLayout value. "horizontal" / "vertical"
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.

setQuestionText

public void setQuestionText(java.lang.String questionText)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException
Sets the question text.

Parameters:
questionText - The new question text
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.

setTextAfter

public void setTextAfter(java.lang.String textAfter)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException
Sets the text-after attribute of the question. Makes it possible to have section-headings, footnotes, separators etc between questions.

Parameters:
textAfter - The new textAfter
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.

setTextBefore

public void setTextBefore(java.lang.String setTextBefore)
                   throws LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Sets the text-before attribute of the question. For inserting section-headings between questions, horizontal lines etc.

Parameters:
setTextBefore - The new textBefore value
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.

setValidator

public void setValidator(int type,
                         java.lang.String errorMessage,
                         java.lang.String parameter)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Sets the validator. Use this method for all validator types except in-text elements and matrix cell validators.

Parameters:
type - Validator type. See ValidatorType
errorMessage - Error message to show to the respondent if the input is incorrect.
parameter - Validator parameter. See comment for the validator type.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
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.

setValidator

public void setValidator(int type,
                         java.lang.String errorMessage,
                         java.lang.String parameter,
                         int intextIndex)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Deprecated. Use setValidator(int type, String errorMessage, String parameter, String intextTagId)

Sets the in-text element validator.

Parameters:
type - in-text element validator type. See ValidatorType
errorMessage - Error message to show to the respondent if the input is incorrect.
parameter - Validator parameter. See comment for the validator type.
intextIndex - in-text element index in the question, starts at 0.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
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.

setValidator

public void setValidator(int type,
                         java.lang.String errorMessage,
                         java.lang.String parameter,
                         java.lang.String intextTagId)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Sets the in-text element validator.

Parameters:
type - in-text element validator type. See ValidatorType
errorMessage - Error message to show to the respondent if the input is incorrect.
parameter - Validator parameter. See comment for the validator type.
intextTagId - in-text element tagId (name of the intext element)
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
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.

setValidator

public void setValidator(int type,
                         java.lang.String errorMessage,
                         java.lang.String parameter,
                         int columnPosition,
                         int rowPosition)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Sets the matrix cell validator.

Parameters:
type - Matrix cell validator type. See ValidatorType
errorMessage - Error message to show to the respondent if the input is incorrect.
parameter - Validator parameter. See comment for the validator type.
columnPosition - Matrix cell column position.
rowPosition - Matrix cell row position.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
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.

getDisplayNo

public java.lang.String getDisplayNo()
                              throws SurveySystemException
Gets the display number attribute of the question. Survey administrator can specify what question number to be displayed, instead of the sequential questionNo.

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

getIntextCount

public int getIntextCount()
                   throws SurveySystemException
Gets the number of in-text elements in this question

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

getIntextDropdownItems

public java.lang.String[] getIntextDropdownItems(int intextIndex)
                                          throws SurveySystemException
Get dropdown items of in-text element, one per line. Applicable for in-text elements of type INTEXT_DROPDOWN.

Parameters:
intextIndex - Index of the in-text element. Starts at 0
Returns:
The dropdown items
Throws:
SurveySystemException - If an error occurs in the system.

getIntextDropdownLabel

public java.lang.String getIntextDropdownLabel(int intextIndex)
                                        throws SurveySystemException
Get dropdown label of in-text element. Applicable for in-text elements of type INTEXT_DROPDOWN.

Parameters:
intextIndex - Index of the in-text element. Starts at 0
Returns:
The dropdown label f
Throws:
SurveySystemException - If an error occurs in the system.

getIntextDropdownSortOn

public boolean getIntextDropdownSortOn(int intextIntext)
                                throws SurveySystemException
Get dropdown in-text element sortOn attribute . Applicable for in-text elements of type INTEXT_DROPDOWN.

Parameters:
intextIndex - Index of the in-text element. Starts at 0
Returns:
The dropdown sort on attribute or false.
Throws:
SurveySystemException - If an error occurs in the system.

getIntextSize

public int getIntextSize(int intextIndex)
                  throws SurveySystemException
Get in-text element size. Applicable for in-text elements of type INTEXT_TEXT, INTEXT_NUMERIC_INT and INTEXT_NUMERIC_DEC.

Parameters:
intextIndex - Index of the in-text element. Starts at 0.
Returns:
The in-text element size.
Throws:
SurveySystemException - If an error occurs in the system.

getIntextType

public int getIntextType(int intextIndex)
                  throws SurveySystemException
Get in-text element type.

Parameters:
intextIndex - Index of the in-text element, starts at 0
Returns:
The in-text element type. One of the constants above.
Throws:
SurveySystemException - If an error occurs in the system.

getIntextIndex

public int getIntextIndex(java.lang.String intextName)
                   throws SurveySystemException
Get in-text element index by name.

Parameters:
intextName - Name of the in-text field
Returns:
The in-text element index. The first in-text element has an index of 0. Returns -1 if in-text field is not found.
Throws:
SurveySystemException - If an error occurs in the system.

getIntextName

public java.lang.String getIntextName(int intextIndex)
                               throws SurveySystemException
Get in-text element name.

Parameters:
intextIndex - Index of the in-text element, starts at 0
Returns:
The in-text element name.
Throws:
SurveySystemException - If an error occurs in the system.

getFreeTextColumns

public int getFreeTextColumns()
                       throws SurveySystemException
Gets the number of columns in the free-text field

Returns:
The free-text field column count
Throws:
SurveySystemException - If an error occurs in the system.

getFreeTextLabel

public java.lang.String getFreeTextLabel()
                                  throws SurveySystemException
Gets the label of the free-text field

Returns:
The free-text field label
Throws:
SurveySystemException - If an error occurs in the system.

getWeight

public int getWeight()
              throws SurveySystemException
Gets the weight of this question

Returns:
The weight of this question
Throws:
SurveySystemException - If an error occurs in the system.

getAnswerRotation

public boolean getAnswerRotation()
                          throws SurveySystemException
Gets the answer rotation attribute

Returns:
True if answer rotation is on
Throws:
SurveySystemException - If an error occurs in the system.

getFreeTextMaxLength

public int getFreeTextMaxLength()
                         throws SurveySystemException
Gets the max allowed length (to type in) of the free-text field.

Returns:
The max length
Throws:
SurveySystemException - If an error occurs in the system.

getFreeTextRows

public int getFreeTextRows()
                    throws SurveySystemException
Gets the number of rows in the free-text field

Returns:
The free-text field row count
Throws:
SurveySystemException - If an error occurs in the system.

getQuestionId

public long getQuestionId()
                   throws SurveySystemException
Gets the question Id. The question id is the same unique value as stored in the database.

Returns:
The question id
Throws:
SurveySystemException - If an error occurs in the system.

getCustomId

public java.lang.String getCustomId()
                             throws SurveySystemException
Gets the customId of the Question object. Survey administrator can specify a custom id for the question.

Returns:
The customId
Throws:
SurveySystemException

getQuestionLayout

public java.lang.String getQuestionLayout()
                                   throws SurveySystemException
Gets the question layout. Question text may be placed above or to the left of question input fields.

Returns:
The question layout. "horizontal" / "vertical"
Throws:
SurveySystemException - If an error occurs in the system.

getQuestionText

public java.lang.String getQuestionText()
                                 throws SurveySystemException
Gets the question text.

Returns:
The question text
Throws:
SurveySystemException - If an error occurs in the system.

getQuestionType

public int getQuestionType()
                    throws SurveySystemException
Gets the questionType attribute of the Question. Question type is "rating", "numeric" etc.

Returns:
The question type. One of the constants above
Throws:
SurveySystemException - If an error occurs in the system.

getTextAfter

public java.lang.String getTextAfter()
                              throws SurveySystemException
Gets the textAfter attribute of the Question. For making section headers, separators etc.

Returns:
The text after
Throws:
SurveySystemException - If an error occurs in the system.

getUploadType

public int getUploadType()
                  throws SurveySystemException
Gets the upload type, currently supported: UPLOAD_NONE and UPLOAD_IMAGE

Returns:
The upload type
Throws:
SurveySystemException - If an error occurs in the system.

getTextBefore

public java.lang.String getTextBefore()
                               throws SurveySystemException
Gets the text-before attribute of the question. For making section headers, separators etc.

Returns:
The text before
Throws:
SurveySystemException - If an error occurs in the system.

getValidatorErrorMessage

public java.lang.String getValidatorErrorMessage(int type)
                                          throws SurveySystemException,
                                                 java.lang.IllegalArgumentException
Gets error message for validator. Use this method for all validator types except in-text element and matrix cell validators.

Parameters:
type - Validator type. See ValidatorType
Returns:
The error message or null if no validator of this type is found.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

getValidatorErrorMessage

public java.lang.String getValidatorErrorMessage(int type,
                                                 int intextIndex)
                                          throws SurveySystemException,
                                                 java.lang.IllegalArgumentException
Deprecated. getValidatorErrorMessage(int, String)

Gets error message for in-text element validator.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - Position of the in-text element Starts at 0.
Returns:
The error message or null if no validator of this type is found for the in-text element
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

getValidatorErrorMessage

public java.lang.String getValidatorErrorMessage(int type,
                                                 java.lang.String intextTagId)
                                          throws SurveySystemException,
                                                 java.lang.IllegalArgumentException
Gets error message for in-text element validator.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - Position of the in-text element Starts at 0.
Returns:
The error message or null if no validator of this type is found for the in-text element
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

getValidatorErrorMessage

public java.lang.String getValidatorErrorMessage(int type,
                                                 int columnPosition,
                                                 int rowPosition)
                                          throws SurveySystemException,
                                                 java.lang.IllegalArgumentException
Gets error message for matrix cell validator.

Parameters:
type - Matrix cell validator type. See ValidatorType
columnPosition - Matrix cell column position.
rowPosition - Matrix cell row position.
Returns:
The error message or null if no validator of this type is found for the cell
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

getValidatorParameter

public java.lang.String getValidatorParameter(int type)
                                       throws SurveySystemException,
                                              java.lang.IllegalArgumentException
Gets the validator parameter. Use this method for all validator types except in-text element and matrix cell validators.

Parameters:
type - Validator type. See ValidatorType
Returns:
The validator parameter or null if no parameter exists.
Throws:
java.lang.IllegalArgumentException - If invalid type.
SurveySystemException - If an error occurs in the system.

getValidatorParameter

public java.lang.String getValidatorParameter(int type,
                                              int intextIndex)
                                       throws SurveySystemException,
                                              java.lang.IllegalArgumentException
Deprecated. use getValidatorParameter(int type, String intextTagId)

Gets the in-text element validator parameter.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - Position of the in-text element
Returns:
The validator parameter or null if no parameter of this type exists for the in-text element
Throws:
java.lang.IllegalArgumentException - If invalid type/position.
SurveySystemException - If an error occurs in the system.

getValidatorParameter

public java.lang.String getValidatorParameter(int type,
                                              java.lang.String intextTagId)
                                       throws SurveySystemException,
                                              java.lang.IllegalArgumentException
Gets the in-text element validator parameter.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - Position of the in-text element
Returns:
The validator parameter or null if no parameter of this type exists for the in-text element
Throws:
java.lang.IllegalArgumentException - If invalid type/position.
SurveySystemException - If an error occurs in the system.

getValidatorParameter

public java.lang.String getValidatorParameter(int type,
                                              int columnPosition,
                                              int rowPosition)
                                       throws SurveySystemException,
                                              java.lang.IllegalArgumentException
Gets the matrix cell validator parameter.

Parameters:
type - Matrix cell validator type. See ValidatorType
columnPosition - Matrix cell column position
rowPosition - Matrix row column position
Returns:
The validator parameter or null if no parameter of this type exists for the matrix cell.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

isFreeTextOn

public boolean isFreeTextOn()
                     throws SurveySystemException
Gets the freeTextOn attribute of the question

Returns:
The freeTextOn value
Throws:
SurveySystemException - If an error occurs in the system.

isValidatorOn

public boolean isValidatorOn(int type)
                      throws SurveySystemException,
                             java.lang.IllegalArgumentException
Check if validator is on. Use this method for all validator types except in-text element and matrix cell validators.

Parameters:
type - Validator type. See ValidatorType
Returns:
The validatorOn value
Throws:
java.lang.IllegalArgumentException - If invalid validator type.
SurveySystemException - If an error occurs in the system.

isValidatorOn

public boolean isValidatorOn(int type,
                             int intextIndex)
                      throws SurveySystemException,
                             java.lang.IllegalArgumentException
Deprecated. use isValidatorOn(int type, String intextTagId)

Check if in-text element validator is on.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - in-text element index (starts at 0)
Returns:
The validatorOn value
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

isValidatorOn

public boolean isValidatorOn(int type,
                             java.lang.String intextTagId)
                      throws SurveySystemException,
                             java.lang.IllegalArgumentException
Check if in-text element validator is on.

Parameters:
type - in-text element validator type. See ValidatorType
intextIndex - in-text element index (starts at 0)
Returns:
The validatorOn value
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

isValidatorOn

public boolean isValidatorOn(int type,
                             int columnPosition,
                             int rowPosition)
                      throws SurveySystemException,
                             java.lang.IllegalArgumentException
Check if matrix cell validator is on.

Parameters:
type - Matrix cell validator type. See ValidatorType
columnPosition - Matrix cell column position, starts at 0
rowPosition - Matrix cell row position, starts at 0
Returns:
The validatorOn value
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.

addIntextCheckbox

public void addIntextCheckbox(int posInQuestionText,
                              java.lang.String intextName)
                       throws LockException,
                              SurveySystemException,
                              SurveySecurityException,
                              RespondentsExistException,
                              java.lang.IllegalArgumentException
Adds an in-text element of type checkbox to the question. Read about in-text elements. .

Parameters:
posInQuestionText - Position in the question text where the in-text element will be inserted.
intextName. - Name of the in-text element. Any descriptive name for the element. Must be unique within the question.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addIntextDecimal

public void addIntextDecimal(int posInQuestionText,
                             java.lang.String intextName,
                             int fieldSize,
                             java.lang.String errorMsg)
                      throws LockException,
                             SurveySystemException,
                             SurveySecurityException,
                             RespondentsExistException,
                             java.lang.IllegalArgumentException
Adds an in-text element of type numeric decimal to the question. Read about in-text elements. .

Parameters:
posInQuestionText - Position in the question text where the in-text element will be inserted.
intextName. - Name of the in-text element. Any descriptive name for the element. Must be unique within the question.
fieldSize - The size of the input field.
errorMsg - Error message to show to the respondent if the response is not a invalid double.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index or errorMsg is null or empty.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addIntextDropdown

public void addIntextDropdown(int posInQuestionText,
                              java.lang.String intextName,
                              java.lang.String label,
                              java.lang.String items,
                              boolean sortOn)
                       throws LockException,
                              SurveySecurityException,
                              RespondentsExistException,
                              SurveySystemException
Adds an in-text element of type dropdown to the question. Read about in-text elements. .

Parameters:
posInQuestionText - Position in the question text where the in-text element will be inserted.
intextName. - Name of the in-text element. Any descriptive name for the element. Must be unique within the question.
label - The displayed label of the dropdown list when no items are selected.
items - Dropdown items as String one per line. (separated by /n/r)
sortOn - True if items should be alphabetically sorted.
Throws:
SurveySystemException - If an error occurs in the system.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addIntextInteger

public void addIntextInteger(int posInQuestionText,
                             java.lang.String intextName,
                             int fieldSize,
                             java.lang.String errorMsg)
                      throws LockException,
                             SurveySecurityException,
                             RespondentsExistException,
                             SurveySystemException,
                             java.lang.IllegalArgumentException
Adds an in-text element of type numeric integer to the question. Read about in-text elements. .

Parameters:
posInQuestionText - Position in the question text where the in-text element will be inserted.
intextName. - Name of the in-text element. Any descriptive name for the element. Must be unique within the question.
fieldSize - The size of the input field.
errorMsg - Error message to show to the respondent if the response is not a invalid integer.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index or errorMsg is null or empty.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addIntextText

public void addIntextText(int posInQuestionText,
                          java.lang.String intextName,
                          int fieldSize)
                   throws LockException,
                          SurveySecurityException,
                          RespondentsExistException,
                          SurveySystemException,
                          java.lang.IllegalArgumentException
Adds an in-text element of type text to the question. Read about in-text elements. .

Parameters:
posInQuestionText - Position in the question text where the in-text element will be inserted.
intextName. - Name of the in-text element. Any descriptive name for the element. Must be unique within the question.
fieldSize - The size of the text field.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

deleteIntext

public void deleteIntext(int intextIndex)
                  throws LockException,
                         SurveySecurityException,
                         RespondentsExistException,
                         SurveySystemException
Delete in-text element from the question. Validators for the field will be automatically deleted.

Parameters:
intextIndex - Index of the in-text element. (If you have 5 in-text elements, intextIndex can be from 0 to 4)
Throws:
SurveySystemException - If an error occurs in the system.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

deleteValidator

public void deleteValidator(int type)
                     throws LockException,
                            RespondentsExistException,
                            SurveySystemException,
                            SurveySecurityException,
                            java.lang.IllegalArgumentException
Delete validator. Use this method for all validator types except in-text element and matrix cell validators.

Parameters:
type - Validator type. See ValidatorType
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.
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.

deleteValidator

public void deleteValidator(int type,
                            int intextIndex)
                     throws LockException,
                            RespondentsExistException,
                            SurveySystemException,
                            SurveySecurityException,
                            java.lang.IllegalArgumentException
Deprecated. use deleteValidator(int type, String intextTagId)

Delete in-text element validator.

Parameters:
type - In-text element validator type. See ValidatorType
intextIndex - Position of the in-text element. Starts at 0.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.
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.

deleteValidator

public void deleteValidator(int type,
                            java.lang.String intextTagId)
                     throws LockException,
                            RespondentsExistException,
                            SurveySystemException,
                            SurveySecurityException,
                            java.lang.IllegalArgumentException
Delete in-text element validator.

Parameters:
type - In-text element validator type. See ValidatorType
intextIndex - Position of the in-text element. Starts at 0.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.
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.

deleteValidator

public void deleteValidator(int type,
                            int columnPosition,
                            int rowPosition)
                     throws LockException,
                            RespondentsExistException,
                            SurveySystemException,
                            SurveySecurityException,
                            java.lang.IllegalArgumentException
Delete matrix cell validator.

Parameters:
type - Matrix cell validator type. See ValidatorType
columnPosition - Matrix cell column position.
rowPosition - Matrix cell row position.
Throws:
java.lang.IllegalArgumentException - If invalid parameters.
SurveySystemException - If an error occurs in the system.
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.

hasBusinessObject

public boolean hasBusinessObject()
Check if this question has reference to the business Question object. See ATTENTION .

Returns:
True/false

keepBusinessObject

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

Throws:
SurveySystemException - If an error occurs in the system.

releaseBusinessObject

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


validate

public boolean validate(Response response)
                 throws SurveySystemException
Validates a response. This method MUST be called after each response. Returns true if all values in the response object are valid.

Parameters:
response - Response to this question that should be validated.
Returns:
Returns true if all values in the response object are valid.
Throws:
SurveySystemException - If an error occurs in the system.

getEssayFieldCount

public int getEssayFieldCount()
                       throws SurveySystemException
Deprecated. use getIntextCount()

Gets the number of in-text fields

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

getEssayFieldDropdownItems

public java.lang.String[] getEssayFieldDropdownItems(int inTextFieldIndex)
                                              throws SurveySystemException
Deprecated. use getIntextDropdownItems(intextIndex)

Get dropdown items of in-text field, one per line. Applicable for in-text fields of type ESSAY_FIELD_DROPDOWN.

Parameters:
inTextFieldIndex - Index of the in-text field. (If you have 5 in-text fields, inTextFieldIndex can be from 0 to 4)
Returns:
The dropdown items for in-text field or null.
Throws:
SurveySystemException - If an error occurs in the system.

getEssayFieldDropdownLabel

public java.lang.String getEssayFieldDropdownLabel(int inTextFieldIndex)
                                            throws SurveySystemException
Deprecated. use getIntextDropdownLabel(int intextIndex)

Get dropdown label of in-text field. Applicable for in-text fields of type ESSAY_FIELD_DROPDOWN.

Parameters:
inTextFieldIndex - Index of the in-text field. (If you have 5 in-text fields, inTextFieldIndex can be from 0 to 4)
Returns:
The dropdown label for in-text field or null.
Throws:
SurveySystemException - If an error occurs in the system.

addEssayFieldDecimal

public void addEssayFieldDecimal(int posInQuestionText,
                                 int fieldSize,
                                 java.lang.String errorMsg)
                          throws LockException,
                                 SurveySystemException,
                                 SurveySecurityException,
                                 RespondentsExistException,
                                 java.lang.IllegalArgumentException
Deprecated. Use addIntextDecimal(int posInQuestionText, String intextName, int fieldSize, String errorMsg).

Adds an in-text field of type numeric decimal. Read about in-text fields .

Parameters:
posInQuestionText - Position in the question text where the in-text field will be inserted.
fieldSize - The size of the text field.
errorMsg - Error message to show to the respondent if the response is not a invalid double.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index or errorMsg is null or empty.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addEssayFieldCheckbox

public void addEssayFieldCheckbox(int posInQuestionText)
                           throws LockException,
                                  SurveySystemException,
                                  SurveySecurityException,
                                  RespondentsExistException,
                                  java.lang.IllegalArgumentException
Deprecated. Use addIntextCheckbox(int posInQuestionText, String intextName).

Adds an in-text field of type checkbox.

Parameters:
posInQuestionText - Position in the question text where the in-text field will be inserted.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

getEssayFieldDropdownSortOn

public boolean getEssayFieldDropdownSortOn(int inTextFieldIndex)
                                    throws SurveySystemException
Deprecated. use getIntextDropdownSortOn(int intextIntext);

Get dropdown in-text field sortOn attribute . Applicable for in-text fields of type ESSAY_FIELD_DROPDOWN.

Parameters:
inTextFieldIndex - Index of the in-text field. (If you have 5 in-text fields, inTextFieldIndex can be from 0 to 4)
Returns:
The dropdown sort on attribute or false.
Throws:
SurveySystemException - If an error occurs in the system.

getEssayFieldSize

public int getEssayFieldSize(int inTextFieldIndex)
                      throws SurveySystemException
Deprecated. use getIntextSize(int intextIndex)

Get in-text field size. Applicable for in-text fields of type ESSAY_FIELD_TEXT, ESSAY_FIELD_NUMERIC_INT and ESSAY_FIELD_NUMERIC_DEC.

Parameters:
inTextFieldIndex - Index of the in-text field. (If you have 5 in-text fields, inTextFieldIndex can be from 0 to 4)
Returns:
The in-text field size.
Throws:
SurveySystemException - If an error occurs in the system.

getEssayFieldType

public int getEssayFieldType(int inTextFieldIndex)
                      throws SurveySystemException
Deprecated. use getIntextType(int intextIndex)

Get in-text field type..

Parameters:
inTextFieldIndex - Index of the in-text field. (If you have 5 in-text fields, inTextFieldIndex can be from 0 to 4)
Returns:
The in-text field type. One of the constants above.
Throws:
SurveySystemException - If an error occurs in the system.

addEssayFieldDropdown

public void addEssayFieldDropdown(int posInQuestionText,
                                  java.lang.String label,
                                  java.lang.String items,
                                  boolean sortOn)
                           throws LockException,
                                  SurveySecurityException,
                                  RespondentsExistException,
                                  SurveySystemException
Deprecated. Use addIntextDropdown(int posInQuestionText, String intextName, String label, String items, boolean sortOn).

Adds an in-text field of type dropdown. Read about in-text fields .

Parameters:
posInQuestionText - Position in the question text where the in-text field will be inserted.
label - The displayed label of the dropdown list when no items are selected.
items - Dropdown items as String one per line. (separated by /n/r)
sortOn - True if items should be alphabetically sorted.
Throws:
SurveySystemException - If an error occurs in the system.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addEssayFieldInteger

public void addEssayFieldInteger(int posInQuestionText,
                                 int fieldSize,
                                 java.lang.String errorMsg)
                          throws LockException,
                                 SurveySecurityException,
                                 RespondentsExistException,
                                 SurveySystemException,
                                 java.lang.IllegalArgumentException
Deprecated. Use addIntextInteger(int posInQuestionText, String intextName, int fieldSize, String errorMsg).

Adds an in-text field of type numeric integer. Read about in-text fields .

Parameters:
posInQuestionText - Position in the question text where the in-text field will be inserted.
fieldSize - The size of the text field.
errorMsg - Error message to show to the respondent if the response is not a invalid integer.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index or errorMsg is null or empty.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

addEssayFieldText

public void addEssayFieldText(int posInQuestionText,
                              int fieldSize)
                       throws LockException,
                              SurveySecurityException,
                              RespondentsExistException,
                              SurveySystemException,
                              java.lang.IllegalArgumentException
Deprecated. Use addEssayFieldText(int posInQuestionText, String intextName, int fieldSize).

Adds an in-text field of type text. Read about in-text fields .

Parameters:
posInQuestionText - Position in the question text where the in-text field will be inserted.
fieldSize - The size of the text field.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If illegal index.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

deleteEssayField

public void deleteEssayField(int inTextFieldIndex)
                      throws LockException,
                             SurveySecurityException,
                             RespondentsExistException,
                             SurveySystemException
Deprecated. use deleteIntext(intextIndex)

Delete in-text field from the question. Validators for the field will be automatically deleted.

Parameters:
inTextFieldIndex - Index of the in-text field.
Throws:
SurveySystemException - If an error occurs in the system.
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.
SurveySecurityException - Thrown if the user is not authorized to call this method.
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.

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016