|
||||||||||
| 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_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
|
| Method Summary | |
|---|---|
static fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError |
buildFormError(String strJson)
Builds GenericAttributeError from json string |
static String |
buildJson(fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError formError)
Builds json form GenericAttributeError |
static String |
buildJson(Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> mapResponse,
int nIdForm,
String strSessionId)
Builds the json string for the response map |
static net.sf.json.JSONObject |
buildJson(fr.paris.lutece.plugins.genericattributes.business.Response response,
String strSessionId)
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<fr.paris.lutece.plugins.genericattributes.business.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)
Get the list of blob id from a JSON string |
static List<String> |
getBlobIds(String strJSON,
int nIdEntry)
Get the list of blob id from a JSON string |
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 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_SUCCESS
| Method Detail |
|---|
public static String buildJson(Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> mapResponse,
int nIdForm,
String strSessionId)
mapResponse - the response mapnIdForm - the id formstrSessionId - the session id
public static Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.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(fr.paris.lutece.plugins.genericattributes.business.Response response,
String strSessionId)
Response
response - the responsestrSessionId - The session id
public static String buildJson(fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError formError)
GenericAttributeError
formError - GenericAttributeError
public static fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError buildFormError(String strJson)
GenericAttributeError from json string
strJson - json string
GenericAttributeErrorpublic static net.sf.json.JSONObject getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
JSON_KEY_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)
strJSON - The JSON to get blob id from
public static List<String> getBlobIds(String strJSON,
int nIdEntry)
strJSON - The JSON to get blob id fromnIdEntry - The id of the entry to get blob id from, or
FormUtils#CONSTANT_ID_NULL to get blob id from any
entry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||