|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.form.utils.JSONUtils
public final class JSONUtils
Provides json utility methods for forms
| Field Summary | |
|---|---|
static String |
JSON_KEY_ERROR_MESSAGE
|
static String |
JSON_KEY_FIELD
|
static String |
JSON_KEY_FIELD_NAME
|
static String |
JSON_KEY_FILE_COUNT
|
static String |
JSON_KEY_FILE_EXTENSION
|
static String |
JSON_KEY_FILE_NAME
|
static String |
JSON_KEY_FORM_ERROR
|
static String |
JSON_KEY_ID_ENTRY
|
static String |
JSON_KEY_ID_FIELD
|
static String |
JSON_KEY_ID_FORM
|
static String |
JSON_KEY_ID_RESPONSE
|
static String |
JSON_KEY_MANDATORY_ERROR
|
static String |
JSON_KEY_MIME_TYPE
|
static String |
JSON_KEY_RESPONSE
|
static String |
JSON_KEY_SUCCESS
|
static String |
JSON_KEY_TITLE_QUESTION
|
static String |
JSON_KEY_UPLOADED_FILES
|
static String |
JSON_KEY_VALUE_RESPONSE
|
static String |
MESSAGE_DATA_NOT_FOUND
|
static String |
TAG_ID_BLOB
|
| Method Summary | |
|---|---|
static FormError |
buildFormError(String strJson)
Builds FormError from json string |
static String |
buildJson(FormError formError)
Builds json form FormError |
static String |
buildJson(Map<Integer,List<Response>> mapResponse,
int nIdForm,
javax.servlet.http.HttpSession session)
Builds the json string for the response map |
static net.sf.json.JSONObject |
buildJson(Response response,
javax.servlet.http.HttpSession session)
Builds the json string for the Response |
static void |
buildJsonError(net.sf.json.JSONObject json,
String strMessage)
Builds a json object with the error message. |
static net.sf.json.JSONObject |
buildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)
Builds a json object with the error message. |
static Map<Integer,List<Response>> |
buildListResponses(String strJSON,
Locale locale,
javax.servlet.http.HttpSession session)
Builds the responses list - null if JSON_KEY_RESPONSE is missing. |
static List<String> |
getBlobIds(String strJSON)
|
static List<String> |
getBlobIds(String strJSON,
int nIdEntry)
|
static net.sf.json.JSONObject |
getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
Builds a json object for the file item list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TAG_ID_BLOB
public static final String MESSAGE_DATA_NOT_FOUND
public static final String JSON_KEY_ID_FORM
public static final String JSON_KEY_RESPONSE
public static final String JSON_KEY_ID_ENTRY
public static final String JSON_KEY_ID_RESPONSE
public static final String JSON_KEY_ID_FIELD
public static final String JSON_KEY_VALUE_RESPONSE
public static final String JSON_KEY_FILE_NAME
public static final String JSON_KEY_FILE_EXTENSION
public static final String JSON_KEY_ERROR_MESSAGE
public static final String JSON_KEY_MANDATORY_ERROR
public static final String JSON_KEY_TITLE_QUESTION
public static final String JSON_KEY_FORM_ERROR
public static final String JSON_KEY_FIELD_NAME
public static final String JSON_KEY_MIME_TYPE
public static final String JSON_KEY_UPLOADED_FILES
public static final String JSON_KEY_FILE_COUNT
public static final String JSON_KEY_FIELD
public static final String JSON_KEY_SUCCESS
| Method Detail |
|---|
public static String buildJson(Map<Integer,List<Response>> mapResponse,
int nIdForm,
javax.servlet.http.HttpSession session)
mapResponse - the response mapnIdForm - the id formsession - the session
public static Map<Integer,List<Response>> buildListResponses(String strJSON,
Locale locale,
javax.servlet.http.HttpSession session)
JSON_KEY_RESPONSE is missing.
strJSON - the jsonlocale - the localesession - the session
JSON_KEY_RESPONSE is missing
public static net.sf.json.JSONObject buildJson(Response response,
javax.servlet.http.HttpSession session)
Response
response - the responsesession - the session
public static String buildJson(FormError formError)
FormError
formError - FormError
public static FormError buildFormError(String strJson)
FormError from json string
strJson - json string
FormErrorpublic static net.sf.json.JSONObject getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
#JSON_UPLOADED_FILES, value is the array of uploaded file.
listFileItem - the fileItem list
public static net.sf.json.JSONObject buildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)
request - the request
public static void buildJsonError(net.sf.json.JSONObject json,
String strMessage)
json - the JSONstrMessage - the error messagepublic static List<String> getBlobIds(String strJSON)
public static List<String> getBlobIds(String strJSON,
int nIdEntry)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||