public class HtmlUtils
extends java.lang.Object
Constructor and Description |
---|
HtmlUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDropdownInputName(int qNo)
Gets the HTML input name for a dropdown input field for a question.
|
static java.lang.String |
getEssayInputName(int qNo,
int index)
Deprecated.
use getIntextName((int qNo, int index)
|
static java.lang.String |
getFreeTextInputName(int qNo)
Gets the HTML input name for a free text input field for a question.
|
static java.lang.String |
getIntextName(int qNo,
int index)
Gets the HTML input field name for an in-text element for a question at the specific index.
|
static java.lang.String |
getMatrixGroupIntersectionInputName(int qNo,
int startX,
int startY)
Gets the HTML input name for a matrix group of type Intersection for a question.
|
static java.lang.String |
getMatrixGroupOnePerRowInputName(int qNo,
int startX,
int startY,
int row)
Gets the HTML input name for a matrix group of type OnePerRow for a question.
|
static java.lang.String |
getMatrixInputName(int qNo,
int col,
int row)
Gets the HTML input name for a matrix input field for a certain cell in a matrix question.
|
static java.lang.String |
getMultipleInputName(int qNo,
int index)
Gets the HTML input name for a multiple input field for a question at a specific index, where
more than one selections are allowed.
|
static java.lang.String |
getMultipleOneSelectionInputName(int qNo)
Gets the HTML input name for a multiple input field for a question, where only one selection
is allowed.
|
static java.lang.String |
getMultipleOtherInputName(int qNo)
Gets the HTML input name for a multiple other input field for a question
|
static java.lang.String |
getNumericInputName(int qNo)
Gets the HTML input name for a numeric input field for a question.
|
static java.lang.String |
getQuestionHTML(User user,
long surveyId,
int questionNo,
javax.servlet.http.HttpServletRequest request)
Gets the HTML code for a question.
|
static java.lang.String |
getQuestionHTML(User user,
long surveyId,
int questionNo,
javax.servlet.http.HttpServletRequest request,
PipingSource pipingSource)
Gets the HTML code for a question.
|
static java.lang.String |
getRatingInputName(int qNo)
Gets the html input name for a rating input field for a question.
|
static java.util.ArrayList |
getResponseList(User user,
long surveyId,
long respondentId,
java.lang.String language)
Gets a list of response html, each item in the list contains a label/value pair where label
is question text(with essay responses) and value is html for a question response.
|
static java.lang.String |
getSingleResponse(User user,
long surveyId,
long respondentId,
java.lang.String language)
Gets a string representation of a single response
|
static java.lang.String |
htmlEncode(java.lang.String text)
HTML Encodes a string.
|
static java.lang.String |
removeHTMLTags(java.lang.String orig)
Returns a string without HTML tags in it.
|
public static java.lang.String getQuestionHTML(User user, long surveyId, int questionNo, javax.servlet.http.HttpServletRequest request) throws SurveySystemException, SurveySecurityException
user
- The user objectsurveyId
- Survey idquestionNo
- Question numberrequest
- The request objectSurveySystemException
- Description of the ExceptionSurveySecurityException
- Description of the Exceptionpublic static java.lang.String getQuestionHTML(User user, long surveyId, int questionNo, javax.servlet.http.HttpServletRequest request, PipingSource pipingSource) throws SurveySystemException, SurveySecurityException
user
- The user objectsurveyId
- Survey idquestionNo
- Question numberrequest
- The request objectSurveySystemException
- Description of the ExceptionSurveySecurityException
- Description of the Exceptionpublic static java.lang.String getSingleResponse(User user, long surveyId, long respondentId, java.lang.String language) throws SurveySystemException
user
- The user objectsurveyId
- Survey idrespondentId
- Respondent idlanguage
- The selected languageSurveySystemException
- Description of the Exceptionpublic static java.util.ArrayList getResponseList(User user, long surveyId, long respondentId, java.lang.String language) throws SurveySystemException
user
- The user objectsurveyId
- Survey idrespondentId
- Respondent idlanguage
- The selected languageSurveySystemException
public static java.lang.String getEssayInputName(int qNo, int index)
qNo
- Question numberindex
- The essay input field indexpublic static java.lang.String getIntextName(int qNo, int index)
qNo
- Question numberindex
- The in-text element index in the questionpublic static java.lang.String getRatingInputName(int qNo)
qNo
- Question numberpublic static java.lang.String getMultipleOneSelectionInputName(int qNo)
qNo
- Question numberpublic static java.lang.String getMultipleInputName(int qNo, int index)
qNo
- Question numberindex
- The multiple input field indexpublic static java.lang.String getMultipleOtherInputName(int qNo)
qNo
- Question numberpublic static java.lang.String getNumericInputName(int qNo)
qNo
- Question numberpublic static java.lang.String getDropdownInputName(int qNo)
qNo
- Question numberpublic static java.lang.String getMatrixInputName(int qNo, int col, int row)
qNo
- Question numbercol
- The column numberrow
- The row numberpublic static java.lang.String getMatrixGroupIntersectionInputName(int qNo, int startX, int startY)
qNo
- Question numberstartX
- The matrix group's startY valuestartY
- The matrix group's startY valuepublic static java.lang.String getMatrixGroupOnePerRowInputName(int qNo, int startX, int startY, int row)
qNo
- Question numberstartX
- The matrix group's startY valuestartY
- The matrix group's startY valuerow
- The row numberpublic static java.lang.String getFreeTextInputName(int qNo)
qNo
- Question numberpublic static java.lang.String htmlEncode(java.lang.String text)
value
- text to be encodedpublic static java.lang.String removeHTMLTags(java.lang.String orig)
orig
- the original stringBuilt on September 5 2019