|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.directory.utils.JSONUtils
public final class JSONUtils
JSONUtils
Method Summary | |
---|---|
static void |
buildJsonError(net.sf.json.JSONObject json,
java.lang.String strMessage)
Builds a json object with the error message. |
static net.sf.json.JSONObject |
buildJsonError(java.lang.String strMessage)
Builds a json object with the error message. |
static void |
buildJsonSuccess(java.lang.String strFieldName,
net.sf.json.JSONObject json)
Build the json form success removing file |
static net.sf.json.JSONObject |
buildJsonSuccess(java.lang.String strIdEntry,
java.lang.String strSessionId)
Build the json form success removing file |
static net.sf.json.JSONObject |
getUploadedFileJSON(java.util.List<org.apache.commons.fileupload.FileItem> listFileItem)
Builds a json object for the file item list. |
static java.util.Map<java.lang.String,java.lang.String> |
getUserInfos(java.lang.String strJSON)
Get the user infos. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static net.sf.json.JSONObject buildJsonError(java.lang.String strMessage)
strMessage
- the error message
public static void buildJsonError(net.sf.json.JSONObject json, java.lang.String strMessage)
json
- the JSONstrMessage
- the error messagepublic static net.sf.json.JSONObject buildJsonSuccess(java.lang.String strIdEntry, java.lang.String strSessionId)
strIdEntry
- the id entrystrSessionId
- the session id
public static void buildJsonSuccess(java.lang.String strFieldName, net.sf.json.JSONObject json)
strFieldName
- the field name (WARNING : it is not the id entry, it is 'directory_strSessionId
- the session idjson
- the jsonpublic static net.sf.json.JSONObject getUploadedFileJSON(java.util.List<org.apache.commons.fileupload.FileItem> listFileItem)
#JSON_UPLOADED_FILES
, value is the array of uploaded file.
listFileItem
- the fileItem list
public static java.util.Map<java.lang.String,java.lang.String> getUserInfos(java.lang.String strJSON)
{ "user-attributes": [
{ "user-attribute-key": "user.name.family", "user-attribute-value": "FAMILYNAME" },
{ "user-attribute-key": "user.home-info.online.email", "user-attribute-value": "EMAIL@EMAIL.EMAIL"}
] }
strJSON
- the json
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |