com.objectplanet.survey.plugin.api
Class Survey

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Survey

public class Survey
extends java.lang.Object

ATTENTION: This class is a facade for the system business Survey. 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 allways remember to call releaseBusinessObject() as soon as you are finished using them.

This class encapsulates survey data. See the Opinio documentation get to know the different survey attributes and question types.

Author:
Irina Brun
Created:
24. march 2003

Field Summary
static int ANONYMITY_FULL
          Full response anonymity in invitations.
static int ANONYMITY_OFF
          No response anonymity in invitations.
static int ANONYMITY_PARTLY
          Partly response anonymity in invitations.
static int AUTH_NONE
          Turns survey authentication off
static int AUTH_PASSWORD_ASSIGNED
          Turns authentication on, with unique passwords per invitee.
static int AUTH_PASSWORD_FIXED
          Turns authentication on, with a fixed password (same password for all respondents).
static int DISPLAY_QUESTIONNO_DEFAULT
          Dislpay default question numbers (1, 2, 3, ..)
static int DISPLAY_QUESTIONNO_DEFINED
          Display numbers which defined in every question
static int DISPLAY_QUESTIONNO_NONE
          Do not display question numbers
static int MULTIPLE_SUBMISSIONS_CHECK_EVERY_PAGE
          Check multiple submissions on every survey page.
static int MULTIPLE_SUBMISSIONS_CHECK_START_STOP
          Check multiple submissions on survey start and completion
static int PREVENT_METHOD_COOKIES
          Use cookies to prevent multiple submissions
static int PREVENT_METHOD_COUNT
          Number of prevent methods
static int PREVENT_METHOD_INVITATION
          Use invitee id check to prevent multiple submissions (only one response per invitee)
static int PREVENT_METHOD_IP
          Use IP-address check to prevent multiple submissions
static int PROGRESS_BAR_COUNT
          Progress bar with question count label
static int PROGRESS_BAR_NO_LABEL
          Progress bar without label
static int PROGRESS_BAR_PERCENT
          Progress bar with percent completed label
static int REDIRECT_AFTER_LASTPAGE
          Redirect after the last survey page
static int REDIRECT_AFTER_THANKYOUNOTE
          Redirect after the 'thank you note'
static int REDIRECT_NONE
          Redirect is turned off (no address is entered)
static int VALIDATION_TYPE_CLIENT
          Client side responses validation
static int VALIDATION_TYPE_SERVER
          Server side responses validation
 
Method Summary
 QuestionDropdown addDropdownQuestion(java.lang.String questionText)
          Add a new question of type Question.QUESTION_DROPDOWN at the end of the survey.
 Invitation addInvitation(java.lang.String invitationName, java.lang.String fromName, java.lang.String fromEmail, java.lang.String surveyLink)
          Adds a new invitation to the survey.
 void addInvitation(User user, long surveyId, Invitation invitation)
          Adds a new invitation to the survey (persistent).
 QuestionMatrix addMatrixQuestion(java.lang.String questionText, int columnCount, int rowCount)
          Add a new question of type Question.QUESTION_MATRIX at the end of the survey.
 QuestionMultiple addMultipleQuestion(java.lang.String questionText)
          Add a new question of type Question.QUESTION_MULTIPLE at the end of the survey.
 QuestionNumeric addNumericQuestion(java.lang.String questionText, int numericType, java.lang.String errorMsg)
          Add a new question of type Question.QUESTION_NUMERIC at the end of the survey.
 Question addQuestion(java.lang.String questionText)
          Add a new question of type Question.QUESTION_NO_TYPE at the end of the survey.
 QuestionRating addRatingQuestion(java.lang.String questionText, int ratingLevel)
          Add a new question of type Question.QUESTION_RATING at the end of the survey.
 Question changeQuestionType(int questionNo, int newQuestionType)
          Change question type (rating question to multiple, matrix to dropdown and so on.) This method creates a new question of the requested type, copies all old question attributes and in-text elements and return the new question object as Question.
 void deleteAllQuestions()
          Deletes all questions in this survey.
 void deleteInvitation(long invitationId)
          Deletes an invitation.
 void deleteQuestion(int questionNo)
          Deletes a question.
 void deleteSurveyPageCustomAttribute(int pageNo, java.lang.String attributeName)
          Deleted a survey page custom attribute.
 java.lang.String getAttribute(java.lang.String attributeName)
          Gets an attribute of the Survey object
 int getAuthenticationType()
          Gets the authentication type.
 java.lang.String getBackButtonImage()
          Gets the back button image.
 boolean getBackButtonOn()
          Gets the back button.
 java.lang.String getBackButtonText()
          Gets the back button text.
 java.lang.String getBgColor()
          Gets the survey background color.
 java.lang.String getBgImage()
          Gets the survey background image.
 java.lang.String getBranchLayoutCSV()
          get a csv representation of the branching information.
 int getColumnCount()
          Gets the number of columns in the survey.
 long getCompletedRespondentCount()
          Gets the number of completed responses for this survey.
 long getCreatedBy()
          Gets the user the survey was created by.
 long getCreatedDate()
          Gets the created date
 java.lang.String getCSS_URL()
          Gets the survey CSS.
 java.lang.String getCustomId()
          Gets the custom survey id.
 int getDislpayQuestionNo()
          Gets the dislpayQuestionNo attribute.
 java.lang.String getFinishButtonImage()
          Gets the image for the 'finish'-button.
 java.lang.String getFinishButtonText()
          Gets the text on the 'finish'-button
 long getFolderId()
          Gets the folder id.
 java.lang.String getFont()
          Gets the survey text font.
 java.lang.String getFontColor()
          Gets the survey text font color.
 int getFontSize()
          Gets the survey text font size.
 java.lang.String getFooter()
          Gets the survey footer (text at the bottom of the survey).
 int getFormWidth()
          Gets the survey form width.
 java.lang.String getHeader()
          Gets the survey header (text at the top of the survey).
 void getHtmlFile()
          Gets the HTML file for the survey.
 long getInProgressRespondentCount()
          Gets the in progress respondent count
 Invitation getInvitation(long invitationId)
          Gets an invitation.
 long[] getInvitationIds()
          Gets invitation ids.
 int getInvitationsAnonymity()
          Gets the invitationsAnonymity attribute.
 Invitee getInvitee(long inviteeId)
          Gets an invitee by the invitee id.
 java.lang.String getLanguageCode()
          Gets the language code of the survey.
 int getLastQuestionNo()
          Gets the number of the last question number in the survey
 long getMaxResponses()
          Gets the maximum respondent count for this survey.
 long getMaxUploadSize()
          Gets the maximum size for uploaded files in KB.
 boolean getMultipleSubmissions()
          Gets the multiple submissions value
 int getMultipleSubmissionsCheckType()
          Gets the multiple submissions check type for the survey.
 java.lang.String getNextButtonImage()
          Gets the image for the 'next'-button.
 java.lang.String getNextButtonText()
          Gets the text on the 'next'-button
 java.lang.String getPassword()
          Gets the password.
 java.util.BitSet getPreventMethods()
          Gets the method for preventing multiple submissions.
 boolean getProgressBar()
          Gets the progress bar attribute.
 int getProgressBarLabel()
          Gets the progress bar label type (one of the types above).
 Question getQuestion(int questionNo)
          Gets a question object by question number
 int getQuestionCount()
          Gets the number of questions in this survey.
 java.lang.String getRedirectAddress()
          Gets the redirectAddress.
 int getRedirectAfter()
          Gets the redirectAfter attribute.
 boolean getSaveAndBack()
          Gets the saveAndBack attribute
 java.lang.String getSaveButtonImage()
          Gets the image for the 'save'-button.
 java.lang.String getSaveButtonText()
          Gets the text on the 'save'-button
 java.lang.String getStartButtonImage()
          Gets the image for the 'start'-button.
 java.lang.String getStartButtonText()
          Gets the text on the 'start'-button
 long getStartDate()
          Gets the survey start date
 long getStopDate()
          Gets the survey stop date
 long getStoredRespondentCount()
          Gets the stored respondent count.
 boolean getStoreOPDataOn()
          Gets the storeOPDataOn attribute.
 boolean getStorePageResponseOn()
          Gets the storePageResponseOn.
 java.lang.String getSurveyHeading()
          Gets the survey heading
 long getSurveyId()
          Gets the survey Id.
 java.lang.String getSurveyIntro()
          Gets the survey introduction.
 java.util.ArrayList getSurveyLanguages()
          Returns a list of the languages the survey supports.
 java.lang.String getSurveyName()
          Gets the survey name
 int getSurveyPageByQuestionNo(int questionNo)
          Deprecated. This method is deprecated. Use getSurveySectionByQuestionNo() instead.
 int getSurveyPageCount()
          Deprecated. This method is deprecated. Use getSurveySectionCount() instead.
 java.lang.String getSurveyPageCustomAttribute(int pageNo, java.lang.String attributeName)
          Deprecated. This method is deprecated. Use SurveySection.getCustomAttribute() instead, after getting the SurveySection from Survey.
 int getSurveyPageFirstQuestion(int pageNo)
          Deprecated. This method is deprecated. Use SurveySection.getFromQuestion() instead, after getting the SurveySection from Survey.
 int getSurveyPageLastQuestion(int pageNo)
          Deprecated. This method is deprecated. Use SurveySection.getToQuestion() instead, after getting the SurveySection from Survey.
 SurveySection getSurveySection(int sectionId)
          Gets a survey section object with the specified section id
 int getSurveySectionByQuestionNo(int questionNo)
          Gets a survey section number, by question number.
 int getSurveySectionCount()
          Gets the number of survey sections in this survey.
 java.util.ArrayList getSurveySections()
          Gets all survey sections in the survey
 java.lang.String getTemplateName()
          Sets the template name.
 java.lang.String getThankYouNote()
          Gets the thank you-note.
 java.lang.String getTitleColor()
          Gets the survey title color.
 java.lang.String getTitleFont()
          Gets the survey title.
 int getTitleFontSize()
          Gets the survey title font size in pixels.
 int getValidationType()
          Gets the validation type.
 boolean hasBusinessObject()
          Check if this question has reference to the business Survey object.
 boolean hasRespondents()
          Check if the survey has respondents.
 QuestionDropdown insertDropdownQuestion(int questionNo, java.lang.String questionText)
          Inserts a question of type Question.QUESTION_DROPDOWN at the questionNo position.
 QuestionMatrix insertMatrixQuestion(int questionNo, java.lang.String questionText, int columnCount, int rowCount)
          Inserts a question of type Question.QUESTION_MATRIX at the questionNo position.
 QuestionMultiple insertMultipleQuestion(int questionNo, java.lang.String questionText)
          Inserts a question of type Question.QUESTION_MULTIPLE at the questionNo position.
 QuestionNumeric insertNumericQuestion(int questionNo, java.lang.String questionText, int numericType, java.lang.String errorMsg)
          Inserts a question of type Question.QUESTION_NUMERIC at the questionNo position.
 Question insertQuestionNoType(int questionNo, java.lang.String questionText)
          Inserts a question of type Question.QUESTION_NO_TYPE at the questionNo position.
 QuestionRating insertRatingQuestion(int questionNo, java.lang.String questionText, int ratingLevel)
          Inserts a question of type Question.QUESTION_RATING at the questionNo position.
 boolean isLocked()
          Check if the survey is locked.
 boolean isPoll()
          Trus if survey is of type poll
 void keepBusinessObject()
          Get and keep business object.
 void moveQuestion(int oldQuestionNo, int newQuestionNo)
          Moves a question from one question number to another.
 void releaseBusinessObject()
          Release business object.
 void releaseLock()
          Release lock on survey.
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Sets an attribute of the Survey object
 void setAuthenticationType(int authenticationType)
          Sets the authentication type for the survey.
 void setBackButtonImage(java.lang.String backButtonImage)
          Sets the back button image
 void setBackButtonOn(boolean backButtonOn)
          Sets the back button on/off
 void setBackButtonText(java.lang.String backButtonText)
          Sets the back button text
 void setBgColor(java.lang.String bgColor)
          Sets the survey background color.
 void setBgImage(java.lang.String bgImage)
          Sets the survey background image
 void setColumnCount(int columnCount)
          Sets the number of columns in survey (up to 3)
 void setCSS_URL(java.lang.String mainCSS)
          Deprecated. This log method is no longer used. Use setMainCSS() instead.
 void setCustomId(java.lang.String customId)
          Sets the custom survey id.
 void setDislpayQuestionNo(int dislpayQuestionNo)
          Sets the dislpayQuestionNo attribute.
 void setFinishButtonImage(java.lang.String imageUrl)
          Sets the image to use instead of 'finish'-button.
 void setFinishButtonText(java.lang.String finishButtonText)
          Sets the text for the 'finish'-button.
 void setFolderId(long folderId)
          Sets the folder for this survey
 void setFont(java.lang.String font)
          Sets the font for texts in survey and questions.
 void setFontColor(java.lang.String fontColor)
          Sets the font color for texts in survey and questions.
 void setFontSize(int fontSize)
          Sets the font size for texts in survey and questions.
 void setFooter(java.lang.String footer)
          Sets the footer, text at the bottom of the survey (survey page)
 void setFormWidth(int formWidth)
          Sets the width of your survey in pixels
 void setHeader(java.lang.String header)
          Sets the header, text at the top of the survey
 void setHtmlFile(java.lang.String htmlFile)
          Sets the HTML file for the survey.
 void setInvitationsAnonymity(int invitationsAnonymity)
          Sets the invitation anonymity.
 void setMainCss(java.lang.String mainCSS)
          Sets the CSS for the survey.
 void setMaxResponses(int maxResponses)
          Sets the maximum responses for this survey.
 void setMaxUploadSize(long maxUploadSize)
          Sets the maximum size for uploaded files in KB.
 void setMobileHeader(java.lang.String mobileHeader)
          Sets the mobile header, text at the top of the survey
 void setMultipleSubmissions(boolean multipleSubmissions)
          Sets the multiple submissions on/off.
 void setMultipleSubmissionsCheckType(int multipleSubmissionsCheckType)
          Sets the multiple submissions check type for the survey.
 void setNextButtonImage(java.lang.String imageUrl)
          Sets the image to use instead of 'next'-button.
 void setNextButtonText(java.lang.String nextButtonText)
          Sets the text for the 'next'-button.
 void setPassword(java.lang.String password)
          Sets the password.
 void setPreventMethods(java.util.BitSet preventMethods)
          Sets the method to prevent multiple submissions.
 void setProgressBar(boolean progressBar)
          Turn the progress bar on/off
 void setProgressBarLabel(int label)
          Set the progress bar label type (one of the types above)
 void setRedirectAddress(java.lang.String redirectAddress)
          Sets the web address to go to when the respondent is completed.
 void setRedirectAfter(int redirectAfter)
          Define when to redirect: after last survey page or after the thank-you note.
 void setSaveAndBack(boolean saveAndBack)
          Sets the saveAndBack attribute.
 void setSaveButtonImage(java.lang.String imageUrl)
          Sets the image to use instead of 'save'-button.
 void setSaveButtonText(java.lang.String saveButtonText)
          Sets the text for the 'save'-button.
 void setStartButtonImage(java.lang.String imageUrl)
          Sets the image to use instead of 'start'-button.
 void setStartButtonText(java.lang.String startButtonText)
          Sets the text for the 'start'-button.
 void setStartDate(long startDate)
          Sets the start date.
 void setStopDate(long stopDate)
          Sets the stop date.
 void setStoreOPDataOn(boolean storeOPDataOn)
          Sets the storeOPDataOn attribute.
 void setStorePageResponseOn(boolean storePageResponseOn)
          Sets the storePageResponseOn attribute.
 void setSurveyHeading(java.lang.String surveyHeading)
          Sets the survey heading.
 void setSurveyIntro(java.lang.String surveyIntro)
          Sets the survey introduction.
 void setSurveyName(java.lang.String surveyName)
          Sets the survey name.
 void setSurveyPageCustomAttribute(int pageNo, java.lang.String attributeName, java.lang.String attributeValue)
          Sets (creates / updates) the survey page custom attribute.
 void setSurveyPages(int[] firstQuestions)
          Deprecated. use setSurveySections();
 void setSurveySections(int[] firstQuestions)
          Sets survey pages.
 void setTabletHeader(java.lang.String tabletHeader)
          Sets the tablet header, text at the top of the survey
 void setTemplateName(java.lang.String templateName)
          Sets the template name.
 void setThankYouNote(java.lang.String thankYouNote)
          Sets the 'thank you'-note.
 void setTitleColor(java.lang.String titleColor)
          Sets the survey font color.
 void setTitleFont(java.lang.String titleFont)
          Sets the survey title font.
 void setTitleFontSize(int titleFontSize)
          Sets the survey title font size in pixels.
 void setValidationType(int validationType)
          Sets the validationType attribute.
 void startInvitation(long invitationId)
          Start the invitation.
 void stopInvitation(long invitationId)
          Stop the invitation.
 void updateInvitation(Invitation invitation)
          Updates the invitation in the storage.
 void updateQuestion(int questionNo)
          Updates a question in the storage.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANONYMITY_FULL

public static final int ANONYMITY_FULL
Full response anonymity in invitations. No link between invitation and respondent answers will be created.

See Also:
Constant Field Values

ANONYMITY_OFF

public static final int ANONYMITY_OFF
No response anonymity in invitations. Link between invitation and respondent answers will be created and shown.

See Also:
Constant Field Values

ANONYMITY_PARTLY

public static final int ANONYMITY_PARTLY
Partly response anonymity in invitations. Link between invitation and respondent answers will be created in the storage, but not shown to the user.

See Also:
Constant Field Values

AUTH_NONE

public static final int AUTH_NONE
Turns survey authentication off

See Also:
Constant Field Values

AUTH_PASSWORD_ASSIGNED

public static final int AUTH_PASSWORD_ASSIGNED
Turns authentication on, with unique passwords per invitee. The invitation feature must be used when this authentication type is used, because the password (idKey) for the invitee will be matched against the invitee id.

See Also:
Constant Field Values

AUTH_PASSWORD_FIXED

public static final int AUTH_PASSWORD_FIXED
Turns authentication on, with a fixed password (same password for all respondents).

See Also:
Constant Field Values

DISPLAY_QUESTIONNO_DEFAULT

public static final int DISPLAY_QUESTIONNO_DEFAULT
Dislpay default question numbers (1, 2, 3, ..)

See Also:
Constant Field Values

DISPLAY_QUESTIONNO_DEFINED

public static final int DISPLAY_QUESTIONNO_DEFINED
Display numbers which defined in every question

See Also:
Constant Field Values

DISPLAY_QUESTIONNO_NONE

public static final int DISPLAY_QUESTIONNO_NONE
Do not display question numbers

See Also:
Constant Field Values

MULTIPLE_SUBMISSIONS_CHECK_EVERY_PAGE

public static final int MULTIPLE_SUBMISSIONS_CHECK_EVERY_PAGE
Check multiple submissions on every survey page.

See Also:
Constant Field Values

MULTIPLE_SUBMISSIONS_CHECK_START_STOP

public static final int MULTIPLE_SUBMISSIONS_CHECK_START_STOP
Check multiple submissions on survey start and completion

See Also:
Constant Field Values

PREVENT_METHOD_COOKIES

public static final int PREVENT_METHOD_COOKIES
Use cookies to prevent multiple submissions

See Also:
Constant Field Values

PREVENT_METHOD_IP

public static final int PREVENT_METHOD_IP
Use IP-address check to prevent multiple submissions

See Also:
Constant Field Values

PREVENT_METHOD_COUNT

public static final int PREVENT_METHOD_COUNT
Number of prevent methods

See Also:
Constant Field Values

PREVENT_METHOD_INVITATION

public static final int PREVENT_METHOD_INVITATION
Use invitee id check to prevent multiple submissions (only one response per invitee)

See Also:
Constant Field Values

PROGRESS_BAR_COUNT

public static final int PROGRESS_BAR_COUNT
Progress bar with question count label

See Also:
Constant Field Values

PROGRESS_BAR_NO_LABEL

public static final int PROGRESS_BAR_NO_LABEL
Progress bar without label

See Also:
Constant Field Values

PROGRESS_BAR_PERCENT

public static final int PROGRESS_BAR_PERCENT
Progress bar with percent completed label

See Also:
Constant Field Values

REDIRECT_AFTER_LASTPAGE

public static final int REDIRECT_AFTER_LASTPAGE
Redirect after the last survey page

See Also:
Constant Field Values

REDIRECT_AFTER_THANKYOUNOTE

public static final int REDIRECT_AFTER_THANKYOUNOTE
Redirect after the 'thank you note'

See Also:
Constant Field Values

REDIRECT_NONE

public static final int REDIRECT_NONE
Redirect is turned off (no address is entered)

See Also:
Constant Field Values

VALIDATION_TYPE_CLIENT

public static final int VALIDATION_TYPE_CLIENT
Client side responses validation

See Also:
Constant Field Values

VALIDATION_TYPE_SERVER

public static final int VALIDATION_TYPE_SERVER
Server side responses validation

See Also:
Constant Field Values
Method Detail

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
                  throws LockException,
                         SurveySecurityException,
                         SurveySystemException
Sets an attribute of the Survey object

Parameters:
String - attributeName The attribute name
String - attributeValue The attribute value
Throws:
LockException
SurveySecurityException
SurveySystemException

setAuthenticationType

public void setAuthenticationType(int authenticationType)
                           throws LockException,
                                  SurveySecurityException,
                                  SurveySystemException
Sets the authentication type for the survey. The authentication can be of the types:

Parameters:
authenticationType - The new authentication type.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setBackButtonImage

public void setBackButtonImage(java.lang.String backButtonImage)
                        throws LockException,
                               SurveySecurityException,
                               SurveySystemException
Sets the back button image

Parameters:
backButtonImage - The new back button image
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMultipleSubmissionsCheckType

public void setMultipleSubmissionsCheckType(int multipleSubmissionsCheckType)
                                     throws LockException,
                                            SurveySecurityException,
                                            SurveySystemException
Sets the multiple submissions check type for the survey. The check type can be of the types:

Parameters:
multipleSubmissionsCheckType - Check type
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setBackButtonOn

public void setBackButtonOn(boolean backButtonOn)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the back button on/off

Parameters:
backButtonOn - True if the back button is on.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setBackButtonText

public void setBackButtonText(java.lang.String backButtonText)
                       throws LockException,
                              SurveySecurityException,
                              SurveySystemException
Sets the back button text

Parameters:
backButtonText - The new back button text
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setBgColor

public void setBgColor(java.lang.String bgColor)
                throws LockException,
                       SurveySecurityException,
                       SurveySystemException
Sets the survey background color.

Parameters:
bgColor - The new background color (Example: #CCCCFF)
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setBgImage

public void setBgImage(java.lang.String bgImage)
                throws LockException,
                       SurveySecurityException,
                       SurveySystemException
Sets the survey background image

Parameters:
bgImage - The new background image (relative url)
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCSS_URL

public void setCSS_URL(java.lang.String mainCSS)
                throws LockException,
                       SurveySecurityException,
                       SurveySystemException
Deprecated. This log method is no longer used. Use setMainCSS() instead.

Sets the CSS for the survey.

Parameters:
mainCSS - The new CSS, relative url
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setHtmlFile

public void setHtmlFile(java.lang.String htmlFile)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException
Sets the HTML file for the survey. This is an HTML file with a <survey> tag in it. This tag will be replace with the actual content of the survey form. That way, it is possible to use an HTML file as a template for the survey. Just make sure that a CSS file is referenced by the HTML file, to get the right look/feel.

Parameters:
htmlFile - The new HTML file. The relative path (from opinio home folder).
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMainCss

public void setMainCss(java.lang.String mainCSS)
                throws LockException,
                       SurveySecurityException,
                       SurveySystemException
Sets the CSS for the survey.

Parameters:
mainCSS - The new CSS, relative url
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setColumnCount

public void setColumnCount(int columnCount)
                    throws LockException,
                           SurveySecurityException,
                           SurveySystemException
Sets the number of columns in survey (up to 3)

Parameters:
columnCount - The new number of columns (up to 3)
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setCustomId

public void setCustomId(java.lang.String customId)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException,
                        java.lang.IllegalArgumentException
Sets the custom survey id. Custom survey id can contain only letters (at least one) and numbers and must be unique.

Parameters:
customId - The new customId value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If invalid customId..

setDislpayQuestionNo

public void setDislpayQuestionNo(int dislpayQuestionNo)
                          throws LockException,
                                 SurveySecurityException,
                                 SurveySystemException
Sets the dislpayQuestionNo attribute. One of the constants above.

Parameters:
dislpayQuestionNo - The new dislpayQuestionNo value, one of the constants above.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFinishButtonImage

public void setFinishButtonImage(java.lang.String imageUrl)
                          throws LockException,
                                 SurveySecurityException,
                                 SurveySystemException
Sets the image to use instead of 'finish'-button.

Parameters:
imageUrl - Relative url to the image
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFinishButtonText

public void setFinishButtonText(java.lang.String finishButtonText)
                         throws LockException,
                                SurveySecurityException,
                                SurveySystemException
Sets the text for the 'finish'-button.

Parameters:
finishButtonText - The new text for the 'finish'-button.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFolderId

public void setFolderId(long folderId)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException
Sets the folder for this survey

Parameters:
folderId - The new folder id
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFont

public void setFont(java.lang.String font)
             throws LockException,
                    SurveySecurityException,
                    SurveySystemException
Sets the font for texts in survey and questions.

Parameters:
font - The new font
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFontColor

public void setFontColor(java.lang.String fontColor)
                  throws LockException,
                         SurveySecurityException,
                         SurveySystemException
Sets the font color for texts in survey and questions.

Parameters:
fontColor - The new font color (Example: #CCCCFF)
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFontSize

public void setFontSize(int fontSize)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException
Sets the font size for texts in survey and questions.

Parameters:
fontSize - The new font size in pixels.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMaxUploadSize

public void setMaxUploadSize(long maxUploadSize)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Sets the maximum size for uploaded files in KB.

Parameters:
maxUploadSize - The new size for uploaded files in KB.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setInvitationsAnonymity

public void setInvitationsAnonymity(int invitationsAnonymity)
                             throws LockException,
                                    SurveySecurityException,
                                    SurveySystemException
Sets the invitation anonymity. One of the types above.

Parameters:
invitationsAnonymity - The new invitationsAnonymity value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFooter

public void setFooter(java.lang.String footer)
               throws LockException,
                      SurveySecurityException,
                      SurveySystemException
Sets the footer, text at the bottom of the survey (survey page)

Parameters:
footer - The new footer
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setFormWidth

public void setFormWidth(int formWidth)
                  throws LockException,
                         SurveySecurityException,
                         SurveySystemException
Sets the width of your survey in pixels

Parameters:
formWidth - The new width of your survey in pixels.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setHeader

public void setHeader(java.lang.String header)
               throws LockException,
                      SurveySecurityException,
                      SurveySystemException
Sets the header, text at the top of the survey

Parameters:
header - The new header value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setTabletHeader

public void setTabletHeader(java.lang.String tabletHeader)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the tablet header, text at the top of the survey

Parameters:
tabletHeader - The new tablet header value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMobileHeader

public void setMobileHeader(java.lang.String mobileHeader)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the mobile header, text at the top of the survey

Parameters:
mobileHeader - The new mobile header value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMaxResponses

public void setMaxResponses(int maxResponses)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the maximum responses for this survey. Use 0 for unlimited. If the system is in demo version this number will be automatically set to 50.

Parameters:
maxResponses - The new maximum responses. 0 for unlimited.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setMultipleSubmissions

public void setMultipleSubmissions(boolean multipleSubmissions)
                            throws LockException,
                                   SurveySecurityException,
                                   SurveySystemException
Sets the multiple submissions on/off.

Parameters:
multipleSubmissions - The new multiple submissions value.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setNextButtonImage

public void setNextButtonImage(java.lang.String imageUrl)
                        throws LockException,
                               SurveySecurityException,
                               SurveySystemException
Sets the image to use instead of 'next'-button.

Parameters:
imageUrl - Relative url to the image
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setNextButtonText

public void setNextButtonText(java.lang.String nextButtonText)
                       throws LockException,
                              SurveySecurityException,
                              SurveySystemException
Sets the text for the 'next'-button.

Parameters:
nextButtonText - The new text for the 'next'-button.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setPassword

public void setPassword(java.lang.String password)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException
Sets the password. Used if authentication type is set to AUTH_PASSWORD_FIXED

Parameters:
password - The new password
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setPreventMethods

public void setPreventMethods(java.util.BitSet preventMethods)
                       throws LockException,
                              SurveySecurityException,
                              SurveySystemException
Sets the method to prevent multiple submissions. Use constants above. For example to prevent multiple submissions by IP check AND invitation:
BitSet preventMethods = new BitSet(PREVENT_METHOD_COUNT); preventMethods.set(PREVENT_METHOD_IP); preventMethods.set(PREVENT_METHOD_INVITATION);

Parameters:
preventMethod - The new prevent methods. Use constants above.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setProgressBar

public void setProgressBar(boolean progressBar)
                    throws LockException,
                           SurveySecurityException,
                           SurveySystemException
Turn the progress bar on/off

Parameters:
progressBar - The new progressBar value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setProgressBarLabel

public void setProgressBarLabel(int label)
                         throws LockException,
                                SurveySecurityException,
                                SurveySystemException
Set the progress bar label type (one of the types above)

Parameters:
label - The progress bar label type.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setRedirectAddress

public void setRedirectAddress(java.lang.String redirectAddress)
                        throws LockException,
                               SurveySecurityException,
                               SurveySystemException
Sets the web address to go to when the respondent is completed.

Parameters:
redirectAddress - The new redirectAddress value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setRedirectAfter

public void setRedirectAfter(int redirectAfter)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Define when to redirect: after last survey page or after the thank-you note. Use constants above. Write the full address. E.g. "Http://www.objectplanet.com".

Parameters:
redirectAfter - The new redirectAfter value. Use constants above.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSaveAndBack

public void setSaveAndBack(boolean saveAndBack)
                    throws LockException,
                           SurveySecurityException,
                           SurveySystemException
Sets the saveAndBack attribute. Allows respondent to save responses and continue later.

Parameters:
saveAndBack - True if the feature is on.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSaveButtonImage

public void setSaveButtonImage(java.lang.String imageUrl)
                        throws LockException,
                               SurveySecurityException,
                               SurveySystemException
Sets the image to use instead of 'save'-button.

Parameters:
imageUrl - Relative url to the image
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSaveButtonText

public void setSaveButtonText(java.lang.String saveButtonText)
                       throws LockException,
                              SurveySecurityException,
                              SurveySystemException
Sets the text for the 'save'-button.

Parameters:
saveButtonText - The new text for the 'save'-button.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStartButtonImage

public void setStartButtonImage(java.lang.String imageUrl)
                         throws LockException,
                                SurveySecurityException,
                                SurveySystemException
Sets the image to use instead of 'start'-button.

Parameters:
imageUrl - Relative url to the image
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStartButtonText

public void setStartButtonText(java.lang.String startButtonText)
                        throws LockException,
                               SurveySecurityException,
                               SurveySystemException
Sets the text for the 'start'-button.

Parameters:
startButtonText - The new text for the 'start'-button.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStartDate

public void setStartDate(long startDate)
                  throws LockException,
                         SurveySecurityException,
                         SurveySystemException
Sets the start date. The survey will be opened when the start date is reached.

Parameters:
startDate - The new start date
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStopDate

public void setStopDate(long stopDate)
                 throws LockException,
                        SurveySecurityException,
                        SurveySystemException
Sets the stop date. The survey will be closed when the stop date is reached.

Parameters:
stopDate - The new stop date
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStoreOPDataOn

public void setStoreOPDataOn(boolean storeOPDataOn)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Sets the storeOPDataOn attribute. If on - opdata_ parameters in the survey url are automatically stored for the respondent, if false opdata_ parameters aren't stored automatically, but they can still be stored by a plugin. Default is false

Parameters:
storeOPDataOn - The new storeOPDataOn value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setStorePageResponseOn

public void setStorePageResponseOn(boolean storePageResponseOn)
                            throws LockException,
                                   SurveySecurityException,
                                   SurveySystemException
Sets the storePageResponseOn attribute. If on - responses will be saved as the respondent goes through the survey (on every page)

Parameters:
storePageResponseOn - The new storePageResponseOn value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSurveyHeading

public void setSurveyHeading(java.lang.String surveyHeading)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Sets the survey heading.

Parameters:
surveyHeading - The new survey heading
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSurveyIntro

public void setSurveyIntro(java.lang.String surveyIntro)
                    throws LockException,
                           SurveySecurityException,
                           SurveySystemException
Sets the survey introduction.

Parameters:
surveyIntro - The new survey introduction
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSurveyName

public void setSurveyName(java.lang.String surveyName)
                   throws LockException,
                          SurveySecurityException,
                          SurveySystemException
Sets the survey name.

Parameters:
surveyName - The new survey name
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSurveySections

public void setSurveySections(int[] firstQuestions)
                       throws LockException,
                              RespondentsExistException,
                              SurveySecurityException,
                              SurveySystemException,
                              java.lang.IllegalArgumentException
Sets survey pages. Specify the first question on each page. Question numbers starts at 1. If the first survey page should contain only survey introduction, use 0. If the first page contains the first question, survey introduction will be automatically included on the page.

Examples 1:
int[] firstQuestions = {1, 4, 7};

Three survey pages will be created:
  1. survey introduction and questions 1, 2 and 3
  2. questions 4, 5 and 6
  3. questions 7, 8, ..., last question

Examples 2:
int[] firstQuestions = {0, 1, 4, 7};

Four survey pages will be created:
  1. Survey introduction
  2. questions 1, 2 and 3
  3. questions 4, 5 and 6
  4. questions 7, 8, ..., last question

Examples 3:
int[] firstQuestions = {0, 2, 4, 7};

IllegalArgumentException will be thrown.

Parameters:
firstQuestions - Array of first questions on the pages. Use 0 for survey introduction
Throws:
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.
java.lang.IllegalArgumentException - If illegal pages.

setSurveyPages

public void setSurveyPages(int[] firstQuestions)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException,
                           java.lang.IllegalArgumentException
Deprecated. use setSurveySections();

Throws:
LockException
RespondentsExistException
SurveySecurityException
SurveySystemException
java.lang.IllegalArgumentException

setTemplateName

public void setTemplateName(java.lang.String templateName)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the template name. A template is a predefined look and feel that you can set for your survey/poll

Parameters:
templateName - The new template name
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setThankYouNote

public void setThankYouNote(java.lang.String thankYouNote)
                     throws LockException,
                            SurveySecurityException,
                            SurveySystemException
Sets the 'thank you'-note.

Parameters:
thankYouNote - The new 'thank you'-note.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setTitleColor

public void setTitleColor(java.lang.String titleColor)
                   throws LockException,
                          SurveySecurityException,
                          SurveySystemException
Sets the survey font color.

Parameters:
titleColor - The new survey font color (Example: #CCCCFF)
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setTitleFont

public void setTitleFont(java.lang.String titleFont)
                  throws LockException,
                         SurveySecurityException,
                         SurveySystemException
Sets the survey title font.

Parameters:
titleFont - The new survey title font.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setSurveyPageCustomAttribute

public void setSurveyPageCustomAttribute(int pageNo,
                                         java.lang.String attributeName,
                                         java.lang.String attributeValue)
                                  throws java.lang.IllegalArgumentException,
                                         LockException,
                                         SurveySecurityException,
                                         SurveySystemException
Sets (creates / updates) the survey page custom attribute. Persisted.

Parameters:
pageNo - Page number
attributeName - Custom attribute name (the key)
attributeValue - Custom attribute value
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If invalid pageNo

deleteSurveyPageCustomAttribute

public void deleteSurveyPageCustomAttribute(int pageNo,
                                            java.lang.String attributeName)
                                     throws java.lang.IllegalArgumentException,
                                            LockException,
                                            SurveySecurityException,
                                            SurveySystemException
Deleted a survey page custom attribute. Persisted.

Parameters:
titleFont - The new survey title font.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If invalid pageNo

setTitleFontSize

public void setTitleFontSize(int titleFontSize)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Sets the survey title font size in pixels.

Parameters:
titleFontSize - The new survey title font size in pixels.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setValidationType

public void setValidationType(int validationType)
                       throws LockException,
                              SurveySecurityException,
                              SurveySystemException
Sets the validationType attribute. One of the constants above.

Parameters:
validationType - The new validationType value, one of the constants above.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
                              throws SurveySystemException
Gets an attribute of the Survey object

Parameters:
String - attributeName The attribute name
Returns:
String attributeValue The attribute value
Throws:
SurveySystemException

getAuthenticationType

public int getAuthenticationType()
                          throws SurveySystemException
Gets the authentication type. One of the constants above.

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

getBackButtonImage

public java.lang.String getBackButtonImage()
                                    throws SurveySystemException
Gets the back button image.

Returns:
The back button image.
Throws:
SurveySystemException - If an error occurs in the system.

getBackButtonOn

public boolean getBackButtonOn()
                        throws SurveySystemException
Gets the back button.

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

getBackButtonText

public java.lang.String getBackButtonText()
                                   throws SurveySystemException
Gets the back button text.

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

getBgColor

public java.lang.String getBgColor()
                            throws SurveySystemException
Gets the survey background color.

Returns:
The survey background color.
Throws:
SurveySystemException - If an error occurs in the system.

getBgImage

public java.lang.String getBgImage()
                            throws SurveySystemException
Gets the survey background image.

Returns:
The relative url to the survey background image.
Throws:
SurveySystemException - If an error occurs in the system.

getCSS_URL

public java.lang.String getCSS_URL()
                            throws SurveySystemException
Gets the survey CSS.

Returns:
The relative url to the survey CSS
Throws:
SurveySystemException - If an error occurs in the system.

getColumnCount

public int getColumnCount()
                   throws SurveySystemException
Gets the number of columns in the survey.

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

getCompletedRespondentCount

public long getCompletedRespondentCount()
                                 throws SurveySystemException
Gets the number of completed responses for this survey.

Returns:
The number of completed responses for this survey.
Throws:
SurveySystemException - If an error occurs in the system.

getCreatedDate

public long getCreatedDate()
                    throws SurveySystemException
Gets the created date

Returns:
The created date
Throws:
SurveySystemException - If an error occurs in the system.

getCreatedBy

public long getCreatedBy()
                  throws SurveySystemException
Gets the user the survey was created by.

Returns:
The user id the survey was created by.
Throws:
SurveySystemException - If an error occurs in the system.

getCustomId

public java.lang.String getCustomId()
                             throws SurveySystemException
Gets the custom survey id.

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

getDislpayQuestionNo

public int getDislpayQuestionNo()
                         throws SurveySystemException
Gets the dislpayQuestionNo attribute. One of the constants above.

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

getFinishButtonImage

public java.lang.String getFinishButtonImage()
                                      throws SurveySystemException
Gets the image for the 'finish'-button.

Returns:
The image for the 'finish'-button.
Throws:
SurveySystemException - If an error occurs in the system.

getInvitationsAnonymity

public int getInvitationsAnonymity()
                            throws SurveySystemException
Gets the invitationsAnonymity attribute. One of the types above.

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

getFinishButtonText

public java.lang.String getFinishButtonText()
                                     throws SurveySystemException
Gets the text on the 'finish'-button

Returns:
The text on the 'finish'-button
Throws:
SurveySystemException - If an error occurs in the system.

getFolderId

public long getFolderId()
                 throws SurveySystemException
Gets the folder id.

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

getFont

public java.lang.String getFont()
                         throws SurveySystemException
Gets the survey text font.

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

getFontColor

public java.lang.String getFontColor()
                              throws SurveySystemException
Gets the survey text font color.

Returns:
The survey text font color
Throws:
SurveySystemException - If an error occurs in the system.

isPoll

public boolean isPoll()
               throws SurveySystemException
Trus if survey is of type poll

Returns:
Throws:
SurveySystemException

getFontSize

public int getFontSize()
                throws SurveySystemException
Gets the survey text font size.

Returns:
The survey text font size.
Throws:
SurveySystemException - If an error occurs in the system.

getFooter

public java.lang.String getFooter()
                           throws SurveySystemException
Gets the survey footer (text at the bottom of the survey).

Returns:
The survey footer.
Throws:
SurveySystemException - If an error occurs in the system.

getFormWidth

public int getFormWidth()
                 throws SurveySystemException
Gets the survey form width.

Returns:
The survey form width
Throws:
SurveySystemException - If an error occurs in the system.

getHeader

public java.lang.String getHeader()
                           throws SurveySystemException
Gets the survey header (text at the top of the survey).

Returns:
The survey header.
Throws:
SurveySystemException - If an error occurs in the system.

getHtmlFile

public void getHtmlFile()
                 throws SurveySystemException
Gets the HTML file for the survey. This is an HTML file with a <survey> tag in it. This tag will be replace with the actual content of the survey form. That way, it is possible to use an HTML file as a template for the survey. Just make sure that a CSS file is referenced by the HTML file, to get the right look/feel.

Parameters:
htmlFile - The new HTML file. This is the relative path to the file, from the Opinio home folder.
Throws:
LockException - If survey is locked by another user
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

getInProgressRespondentCount

public long getInProgressRespondentCount()
                                  throws SurveySystemException
Gets the in progress respondent count

Returns:
The in progress respondent count
Throws:
SurveySystemException - If an error occurs in the system.

getLanguageCode

public java.lang.String getLanguageCode()
                                 throws SurveySystemException
Gets the language code of the survey.

Returns:
The language code
Throws:
SurveySystemException - If an error occurs in the system.

getLastQuestionNo

public int getLastQuestionNo()
                      throws SurveySystemException
Gets the number of the last question number in the survey

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

getMaxResponses

public long getMaxResponses()
                     throws SurveySystemException
Gets the maximum respondent count for this survey.

Returns:
The maximum respondent count
Throws:
SurveySystemException - If an error occurs in the system.

getMaxUploadSize

public long getMaxUploadSize()
                      throws SurveySystemException
Gets the maximum size for uploaded files in KB.

Returns:
The maximum size for uploaded files in KB.
Throws:
SurveySystemException - If an error occurs in the system.

getMultipleSubmissions

public boolean getMultipleSubmissions()
                               throws SurveySystemException
Gets the multiple submissions value

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

getNextButtonImage

public java.lang.String getNextButtonImage()
                                    throws SurveySystemException
Gets the image for the 'next'-button.

Returns:
The image for the 'next'-button.
Throws:
SurveySystemException - If an error occurs in the system.

getNextButtonText

public java.lang.String getNextButtonText()
                                   throws SurveySystemException
Gets the text on the 'next'-button

Returns:
The text on the 'next'-button
Throws:
SurveySystemException - If an error occurs in the system.

getPassword

public java.lang.String getPassword()
                             throws SurveySystemException
Gets the password. This is only used if authentication type is AUTH_PASSWORD_FIXED

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

getPreventMethods

public java.util.BitSet getPreventMethods()
                                   throws SurveySystemException
Gets the method for preventing multiple submissions. Use of the constants above. Example:
BitSet preventMethods = survey.getPreventMethods(); boolean preventByIP = preventMethods.get(PREVENT_METHOD_IP); boolean preventByCookies = preventMethods.get(PREVENT_METHOD_COOKIES); boolean preventByInvitations = preventMethods.get(PREVENT_METHOD_INVITATION);

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

getProgressBar

public boolean getProgressBar()
                       throws SurveySystemException
Gets the progress bar attribute.

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

getProgressBarLabel

public int getProgressBarLabel()
                        throws SurveySystemException
Gets the progress bar label type (one of the types above).

Returns:
The progress bar label type
Throws:
SurveySystemException - If an error occurs in the system.

getQuestion

public Question getQuestion(int questionNo)
                     throws SurveySystemException,
                            java.lang.IllegalArgumentException
Gets a question object by question number

Parameters:
questionNo - Question number of the question object
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal question number
SurveySystemException - If an error occurs in the system.

getQuestionCount

public int getQuestionCount()
                     throws SurveySystemException
Gets the number of questions in this survey.

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

getRedirectAddress

public java.lang.String getRedirectAddress()
                                    throws SurveySystemException
Gets the redirectAddress.

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

getRedirectAfter

public int getRedirectAfter()
                     throws SurveySystemException
Gets the redirectAfter attribute. One of the constants above.

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

getSaveAndBack

public boolean getSaveAndBack()
                       throws SurveySystemException
Gets the saveAndBack attribute

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

getSaveButtonImage

public java.lang.String getSaveButtonImage()
                                    throws SurveySystemException
Gets the image for the 'save'-button.

Returns:
The image for the 'save'-button.
Throws:
SurveySystemException - If an error occurs in the system.

getSaveButtonText

public java.lang.String getSaveButtonText()
                                   throws SurveySystemException
Gets the text on the 'save'-button

Returns:
The text on the 'save'-button
Throws:
SurveySystemException - If an error occurs in the system.

getStartButtonImage

public java.lang.String getStartButtonImage()
                                     throws SurveySystemException
Gets the image for the 'start'-button.

Returns:
The image for the 'start'-button.
Throws:
SurveySystemException - If an error occurs in the system.

getStartButtonText

public java.lang.String getStartButtonText()
                                    throws SurveySystemException
Gets the text on the 'start'-button

Returns:
The text on the 'start'-button
Throws:
SurveySystemException - If an error occurs in the system.

getStartDate

public long getStartDate()
                  throws SurveySystemException
Gets the survey start date

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

getStopDate

public long getStopDate()
                 throws SurveySystemException
Gets the survey stop date

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

getStoreOPDataOn

public boolean getStoreOPDataOn()
                         throws SurveySystemException
Gets the storeOPDataOn attribute. True if opdata_ parameters in the survey url are automatically stored for the respondent.

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

getStorePageResponseOn

public boolean getStorePageResponseOn()
                               throws SurveySystemException
Gets the storePageResponseOn. True if responses are stored on every page.

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

getStoredRespondentCount

public long getStoredRespondentCount()
                              throws SurveySystemException
Gets the stored respondent count.

Returns:
The stored respondent count
Throws:
SurveySystemException - If an error occurs in the system.

getSurveyHeading

public java.lang.String getSurveyHeading()
                                  throws SurveySystemException
Gets the survey heading

Returns:
The survey header
Throws:
SurveySystemException - If an error occurs in the system.

getSurveyId

public long getSurveyId()
                 throws SurveySystemException
Gets the survey Id.

Returns:
The survey Id
Throws:
SurveySystemException - If an error occurs in the system.

getSurveyIntro

public java.lang.String getSurveyIntro()
                                throws SurveySystemException
Gets the survey introduction.

Returns:
The the survey introduction
Throws:
SurveySystemException - If an error occurs in the system.

getSurveyLanguages

public java.util.ArrayList getSurveyLanguages()
                                       throws SurveySystemException
Returns a list of the languages the survey supports.

Returns:
The supported languages
Throws:
SurveySystemException - If an error occurs in the system.

getSurveyName

public java.lang.String getSurveyName()
                               throws SurveySystemException
Gets the survey name

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

getSurveyPageByQuestionNo

public int getSurveyPageByQuestionNo(int questionNo)
                              throws SurveySystemException,
                                     java.lang.IllegalArgumentException
Deprecated. This method is deprecated. Use getSurveySectionByQuestionNo() instead.

Gets a survey page number, by question number. The question number is the question sequence number, and not the display number.

Parameters:
questionNo - The question number used as key to find page. From 1 to question count.
Returns:
Survey page number of page containing question number Returns -1 if page not found. Page number can be from 1 to page count.
Throws:
java.lang.IllegalArgumentException - If illegal question number
SurveySystemException - If an error occurs in the system.

getSurveyPageCustomAttribute

public java.lang.String getSurveyPageCustomAttribute(int pageNo,
                                                     java.lang.String attributeName)
                                              throws java.lang.IllegalArgumentException,
                                                     SurveySystemException
Deprecated. This method is deprecated. Use SurveySection.getCustomAttribute() instead, after getting the SurveySection from Survey.

Gets a survey page custom attribute.

Parameters:
titleFont - The new survey title font.
Throws:
SurveySystemException - If an error occurs in the system.
java.lang.IllegalArgumentException - If invalid pageNo

getSurveyPageCount

public int getSurveyPageCount()
                       throws SurveySystemException
Deprecated. This method is deprecated. Use getSurveySectionCount() instead.

Gets the number of survey pages in this survey.

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

getSurveyPageFirstQuestion

public int getSurveyPageFirstQuestion(int pageNo)
                               throws SurveySystemException,
                                      java.lang.IllegalArgumentException
Deprecated. This method is deprecated. Use SurveySection.getFromQuestion() instead, after getting the SurveySection from Survey.

Gets a first question on the page

Parameters:
pageNo - Page number, from 1 to page count
Returns:
The number of the first question on the page
Throws:
java.lang.IllegalArgumentException - If illegal page number
SurveySystemException - If an error occurs in the system.

getSurveyPageLastQuestion

public int getSurveyPageLastQuestion(int pageNo)
                              throws SurveySystemException,
                                     java.lang.IllegalArgumentException
Deprecated. This method is deprecated. Use SurveySection.getToQuestion() instead, after getting the SurveySection from Survey.

Gets a last question on the page

Parameters:
pageNo - Page number, from 1 to page count
Returns:
The number of the last question on the page
Throws:
java.lang.IllegalArgumentException - If illegal page number
SurveySystemException - If an error occurs in the system.

getSurveySectionByQuestionNo

public int getSurveySectionByQuestionNo(int questionNo)
                                 throws SurveySystemException,
                                        java.lang.IllegalArgumentException
Gets a survey section number, by question number. The question number is the question sequence number, and not the display number.

Parameters:
questionNo - The question number used as key to find the section. From 1 to question count.
Returns:
Survey section number of section containing question number Returns -1 if page not found. section number can be from 1 to section count.
Throws:
java.lang.IllegalArgumentException - If illegal question number
SurveySystemException - If an error occurs in the system.

getSurveySectionCount

public int getSurveySectionCount()
                          throws SurveySystemException
Gets the number of survey sections in this survey.

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

getSurveySection

public SurveySection getSurveySection(int sectionId)
                               throws SurveySystemException,
                                      java.lang.IllegalArgumentException
Gets a survey section object with the specified section id

Parameters:
sectionId - Section id, from 1 to page count
Returns:
The SurveySection object
Throws:
java.lang.IllegalArgumentException - If illegal section id
SurveySystemException - If an error occurs in the system.

getSurveySections

public java.util.ArrayList getSurveySections()
                                      throws SurveySystemException,
                                             java.lang.IllegalArgumentException
Gets all survey sections in the survey

Returns:
The number of the last question in the section
Throws:
java.lang.IllegalArgumentException - If illegal section id
SurveySystemException - If an error occurs in the system.

getTemplateName

public java.lang.String getTemplateName()
                                 throws SurveySystemException
Sets the template name. A template is a predefined look and feel that you can set for your survey/poll

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

getThankYouNote

public java.lang.String getThankYouNote()
                                 throws SurveySystemException
Gets the thank you-note.

Returns:
The thank you-note.
Throws:
SurveySystemException - If an error occurs in the system.

getTitleColor

public java.lang.String getTitleColor()
                               throws SurveySystemException
Gets the survey title color.

Returns:
The survey title color.
Throws:
SurveySystemException - If an error occurs in the system.

getTitleFont

public java.lang.String getTitleFont()
                              throws SurveySystemException
Gets the survey title.

Returns:
The survey title.
Throws:
SurveySystemException - If an error occurs in the system.

getMultipleSubmissionsCheckType

public int getMultipleSubmissionsCheckType()
                                    throws SurveySystemException
Gets the multiple submissions check type for the survey. The check type can be of the types:

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

getTitleFontSize

public int getTitleFontSize()
                     throws SurveySystemException
Gets the survey title font size in pixels.

Returns:
The the survey title font size in pixels.
Throws:
SurveySystemException - If an error occurs in the system.

getValidationType

public int getValidationType()
                      throws SurveySystemException
Gets the validation type. One of the constants above.

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

isLocked

public boolean isLocked()
                 throws SurveySystemException
Check if the survey is locked.

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

addDropdownQuestion

public QuestionDropdown addDropdownQuestion(java.lang.String questionText)
                                     throws LockException,
                                            RespondentsExistException,
                                            SurveySecurityException,
                                            SurveySystemException,
                                            java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_DROPDOWN at the end of the survey.
  1. Call addDropdownQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

addMatrixQuestion

public QuestionMatrix addMatrixQuestion(java.lang.String questionText,
                                        int columnCount,
                                        int rowCount)
                                 throws LockException,
                                        RespondentsExistException,
                                        SurveySecurityException,
                                        SurveySystemException,
                                        java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_MATRIX at the end of the survey.
  1. Call addMatrixQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
columnCount - Number of columns in the matrix
rowCount - Number of rows in the matrix
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

addMultipleQuestion

public QuestionMultiple addMultipleQuestion(java.lang.String questionText)
                                     throws LockException,
                                            RespondentsExistException,
                                            SurveySecurityException,
                                            SurveySystemException,
                                            java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_MULTIPLE at the end of the survey.
  1. Call addMultipleQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

addNumericQuestion

public QuestionNumeric addNumericQuestion(java.lang.String questionText,
                                          int numericType,
                                          java.lang.String errorMsg)
                                   throws LockException,
                                          RespondentsExistException,
                                          SurveySecurityException,
                                          SurveySystemException,
                                          java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_NUMERIC at the end of the survey.
  1. Call addNumericQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
numericType - Numeric type (integer or decimal). One of the constants in QuestionNumeric
errorMsg - Error message to show if response is not a number/invalid number
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

addQuestion

public Question addQuestion(java.lang.String questionText)
                     throws LockException,
                            RespondentsExistException,
                            SurveySecurityException,
                            SurveySystemException,
                            java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_NO_TYPE at the end of the survey.
  1. Call addQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

addRatingQuestion

public QuestionRating addRatingQuestion(java.lang.String questionText,
                                        int ratingLevel)
                                 throws LockException,
                                        RespondentsExistException,
                                        SurveySecurityException,
                                        SurveySystemException,
                                        java.lang.IllegalArgumentException
Add a new question of type Question.QUESTION_RATING at the end of the survey.
  1. Call addRatingQuestion()
  2. set question properties
  3. call updateQuestion()

Parameters:
questionText - Question text
ratingLevel - Number of ration options.
Returns:
Question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

changeQuestionType

public Question changeQuestionType(int questionNo,
                                   int newQuestionType)
                            throws LockException,
                                   RespondentsExistException,
                                   SurveySecurityException,
                                   SurveySystemException,
                                   java.lang.IllegalArgumentException
Change question type (rating question to multiple, matrix to dropdown and so on.) This method creates a new question of the requested type, copies all old question attributes and in-text elements and return the new question object as Question. Cast then question to the right type and set all question -type specific attributes.

Example: You want to change multiple question No.5 to dropdown question:
 Question updatedQuestion = survey.changeQuestionType(5, Question.QUESTION_DROPDOWN);
 QuestionDropdown dropdownQuestion = (QuestionDropdown) updatedQuestion;
 dropdownQuestion.setLabel("Select an option");
 String dropdownItems = "Good\nBad\nNot sure";
 dropdownQuestion.setItems(dropdownItems);
 survey.updateQuestion(5); // update the question in the database.
 
When changing type to QUESTION_NUMERIC remember to set validator of type ValidatorType.NUMERIC_QUESTION_IS_NUMBER .

Parameters:
questionNo - The number of question to be changed
newQuestionType - New question type. One of the constants in Question
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

deleteAllQuestions

public void deleteAllQuestions()
                        throws LockException,
                               RespondentsExistException,
                               SurveySecurityException,
                               SurveySystemException
Deletes all questions in this survey.

Throws:
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

deleteQuestion

public void deleteQuestion(int questionNo)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException,
                           java.lang.IllegalArgumentException
Deletes a question. The other question numbers will be repositioned accordingly. For example, if the deleted question number is 10, 11 will be moved to 10, 12 will be moved to 11, etc.

Parameters:
questionNo - Question number to be deleted
Throws:
java.lang.IllegalArgumentException - If illegal question number
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

hasBusinessObject

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

Returns:
True/false

hasRespondents

public boolean hasRespondents()
                       throws SurveySystemException
Check if the survey has respondents.

Returns:
True if respondents exists
Throws:
SurveySystemException - If an error occurs in the system.

insertDropdownQuestion

public QuestionDropdown insertDropdownQuestion(int questionNo,
                                               java.lang.String questionText)
                                        throws LockException,
                                               RespondentsExistException,
                                               SurveySecurityException,
                                               SurveySystemException,
                                               java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_DROPDOWN at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertDropdownQuestion()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionText - The question text
questionNo - The question number to be created
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

insertMatrixQuestion

public QuestionMatrix insertMatrixQuestion(int questionNo,
                                           java.lang.String questionText,
                                           int columnCount,
                                           int rowCount)
                                    throws LockException,
                                           RespondentsExistException,
                                           SurveySecurityException,
                                           SurveySystemException,
                                           java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_MATRIX at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertMatrixQuestion()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionText - The question text.
questionNo - The question number to be created.
columnCount - Number of columns in the matrix.
rowCount - Number of rows in the matrix.
Returns:
The question object.
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

insertMultipleQuestion

public QuestionMultiple insertMultipleQuestion(int questionNo,
                                               java.lang.String questionText)
                                        throws LockException,
                                               RespondentsExistException,
                                               SurveySecurityException,
                                               SurveySystemException,
                                               java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_MULTIPLE at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertMultipleQuestion()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionText - The question text
questionNo - The question number to be created
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

insertNumericQuestion

public QuestionNumeric insertNumericQuestion(int questionNo,
                                             java.lang.String questionText,
                                             int numericType,
                                             java.lang.String errorMsg)
                                      throws LockException,
                                             RespondentsExistException,
                                             SurveySecurityException,
                                             SurveySystemException,
                                             java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_NUMERIC at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertNumericQuestion()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionText - The question text
questionNo - The question number to be created
numericType - Numeric type (integer or decimal). One of the constants in QuestionNumeric
errorMsg - Error message to show if response is not a number/invalid number
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

insertQuestionNoType

public Question insertQuestionNoType(int questionNo,
                                     java.lang.String questionText)
                              throws LockException,
                                     RespondentsExistException,
                                     SurveySecurityException,
                                     SurveySystemException,
                                     java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_NO_TYPE at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertQuestionNoType()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionNo - The question number to be created
questionText - Question text
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

insertRatingQuestion

public QuestionRating insertRatingQuestion(int questionNo,
                                           java.lang.String questionText,
                                           int ratingLevel)
                                    throws LockException,
                                           RespondentsExistException,
                                           SurveySecurityException,
                                           SurveySystemException,
                                           java.lang.IllegalArgumentException
Inserts a question of type Question.QUESTION_RATING at the questionNo position. Returns an empty question object, with question number set. updateQuestion() should be called subsequently, to save the intended values in the object. The procedure should be this:
  1. Call insertRatingQuestion()
  2. set question attributes
  3. call updateQuestion()

Parameters:
questionText - The question text
questionNo - The question number to be created
ratingLevel - Number of ration options.
Returns:
The question object
Throws:
java.lang.IllegalArgumentException - If illegal parameters.
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

keepBusinessObject

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

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

moveQuestion

public void moveQuestion(int oldQuestionNo,
                         int newQuestionNo)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException,
                         java.lang.IllegalArgumentException
Moves a question from one question number to another. The other question numbers will be repositioned accordingly. For example, if the new question number is 10, the "old" 10 will be moved to 11, 11 will be moved to 12, etc.

Parameters:
oldQuestionNo - The old question number
newQuestionNo - The new question number
Throws:
java.lang.IllegalArgumentException - If illegal question numbers
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

releaseBusinessObject

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


releaseLock

public void releaseLock()
                 throws SurveySecurityException,
                        SurveySystemException
Release lock on survey. Only the user who locked the survey can release the lock, otherwise SurveySecurityException will be thrown.

Throws:
SurveySecurityException - Thrown if the user try to unlock the survey when it is locked by another user.
SurveySystemException - Thrown if an error occurs in the system.

updateQuestion

public void updateQuestion(int questionNo)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException,
                           java.lang.IllegalArgumentException
Updates a question in the storage.

Parameters:
questionNo - Number of question to be updated
Throws:
java.lang.IllegalArgumentException - If illegal question number
LockException - Thrown if the survey is locked by another user.
RespondentsExistException - Thrown if the survey has responses and can't be edited.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - Thrown if an error occurs in the system.

getBranchLayoutCSV

public java.lang.String getBranchLayoutCSV()
                                    throws SurveySystemException
get a csv representation of the branching information. This is used for debugging to get a complete picture of all branching, especially useful if there are 100s of questions. Can be copied and pasted into Excel, for example.

Returns:
The branching layout, similar to the layout screen, only pure text, comma separated.
Throws:
SurveySystemException

addInvitation

public Invitation addInvitation(java.lang.String invitationName,
                                java.lang.String fromName,
                                java.lang.String fromEmail,
                                java.lang.String surveyLink)
                         throws java.lang.IllegalArgumentException,
                                LockException,
                                SurveySecurityException,
                                SurveySystemException
Adds a new invitation to the survey. The invitation is empty.
1) call survey.addInvitation()
2) set invitation parameters
4) call invitation.addInvitees()
5) call survey.startInvitation()
The invitees are never stored in the invitation object (due to the fact that they can be in the 1000s.

Parameters:
invitationName - Invitation name. Not null.
fromName - Who sends the email, name. Not null.
fromEmail - Who sends the email, email address. Not null.
surveyLink - Url to the survey. Use PluginUtil.getSurveyUrl() to get it if you don't know the url. usually looks like http://server-address/opinio/s?s=surveyId (or customId)
Returns:
New invitation object
Throws:
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 by another user
java.lang.IllegalArgumentException - If illegal parameters.
SurveySystemException - if error occurred

addInvitation

public void addInvitation(User user,
                          long surveyId,
                          Invitation invitation)
                   throws java.lang.IllegalArgumentException,
                          LockException,
                          SurveySecurityException,
                          SurveySystemException
Adds a new invitation to the survey (persistent). After this method you can start adding invitees to the invitation

Parameters:
invitation - New invitation object
Throws:
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 by another user
SurveySystemException - if error occurred
java.lang.IllegalArgumentException

getInvitation

public Invitation getInvitation(long invitationId)
                         throws SurveySecurityException,
                                SurveySystemException
Gets an invitation. The invitation object will not contain the invitees. The invitation object itself must be called to get the invitees, which will in turn call the storage to retrieve them every time requested.

Parameters:
invitationId - Id of the invitation to get
Returns:
The invitation object, null if not found
Throws:
SurveySecurityException - Thrown if the user is not authorized to access invitations.
SurveySystemException - If an error occurs in the system.

getInvitee

public Invitee getInvitee(long inviteeId)
                   throws SurveySecurityException,
                          SurveySystemException
Gets an invitee by the invitee id. Only invitee that belongs to the current survey will be returned.

Parameters:
inviteeId - Id of the invitee to get
Returns:
The invitee object, null if not found
Throws:
SurveySecurityException - Thrown if the user is not authorized to access invitations or invitees.
SurveySystemException - If an error occurs in the system.

getInvitationIds

public long[] getInvitationIds()
                        throws SurveySecurityException,
                               SurveySystemException
Gets invitation ids. Returns array of invitation ids for this survey.

Returns:
Array of invitation ids
Throws:
SurveySecurityException - Thrown if the user is not authorized to access invitations.
SurveySystemException - If an error occurs in the system.

deleteInvitation

public void deleteInvitation(long invitationId)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException
Deletes an invitation. The invitees are deleted from the database, along with the invitation itself.

This method is persistent.

Parameters:
invitationId - Id of invitation to delete.
Throws:
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 by another user

startInvitation

public void startInvitation(long invitationId)
                     throws SurveySystemException,
                            SurveySecurityException
Start the invitation.

Parameters:
invitationId - Invitation id
Throws:
SurveySystemException - If an error occurs in the system.
SurveySecurityException - Thrown if the survey is locked by another user

stopInvitation

public void stopInvitation(long invitationId)
                    throws SurveySystemException,
                           SurveySecurityException
Stop the invitation.

Parameters:
invitationId - Invitation id
Throws:
SurveySystemException - If an error occurs in the system.
SurveySecurityException - Thrown if the survey is locked by another user

updateInvitation

public void updateInvitation(Invitation invitation)
                      throws LockException,
                             SurveySecurityException,
                             SurveySystemException,
                             java.lang.IllegalAccessException
Updates the invitation in the storage. Only the invitation info is updated, not the invitees.
NOTE: active invitations must be stopped before updating. If invitation is running, IllegalAccessException will be thrown.

Parameters:
surveyId - Invitation id
Throws:
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 by another user
java.lang.IllegalAccessException
java.lang.IllegalAccessException - if invitation is active (running)

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016