public class UserSearchHelper extends Object
Modifier and Type | Method and Description |
---|---|
static org.codehaus.jackson.node.ArrayNode |
createEntitySearchJSONResult(PageableList<CommunoteEntityData> list,
boolean addSummary,
ImageSizeType imageSize)
Creates an array of JSON objects which hold details about the found users or groups.
|
static org.codehaus.jackson.node.ObjectNode |
createSearchSummaryStatement(PageableList<?> results)
Creates a JSON Object that holds details about the number of items returned and whether there
are more results
|
static org.codehaus.jackson.node.ObjectNode |
createUserSearchJSONResult(Long userId,
String shortName,
String longName,
String imagePath,
String alias)
Creates a JSON Object with key value pairs from the parameters passed to this method.
|
static <T extends UserData> |
createUserSearchJSONResult(PageableList<T> results,
boolean addSummary,
ImageSizeType imageSize)
Creates an array of JSON objects which hold details about the found users.
|
static org.codehaus.jackson.node.ObjectNode |
createUserSearchJSONResult(UserData item,
ImageSizeType imageSize)
Creates a JSON object describing a user.
|
public static org.codehaus.jackson.node.ArrayNode createEntitySearchJSONResult(PageableList<CommunoteEntityData> list, boolean addSummary, ImageSizeType imageSize)
list
- the search result to processaddSummary
- if true a summary JSON object will be added to the top of the array. The JSON
object will be created with createSearchSummaryStatement(PageableList)
.imageSize
- the size of the user logo to include in the image path, can be null to not include
the image path into the JSON object. For groups no image will be included.public static org.codehaus.jackson.node.ObjectNode createSearchSummaryStatement(PageableList<?> results)
results
- the result of a searchpublic static org.codehaus.jackson.node.ObjectNode createUserSearchJSONResult(Long userId, String shortName, String longName, String imagePath, String alias)
userId
- the ID of the user, if null this information is not added to the JSON objectshortName
- a short version of the user name, if null this information is not added to the
JSON objectlongName
- a long version of the user name, if null this information is not added to the JSON
objectimagePath
- the path to the user image, if null this information is not added to the JSON
objectalias
- the alias of the user, if null this information is not added to the JSON objectpublic static <T extends UserData> org.codehaus.jackson.node.ArrayNode createUserSearchJSONResult(PageableList<T> results, boolean addSummary, ImageSizeType imageSize)
T
- the type of the result itemsresults
- the search result to processaddSummary
- if true a summary JSONObject will be added to the top of the array. The JSONObject
will be created with createSearchSummaryStatement(PageableList)
.imageSize
- the size of the user logo to include in the image path, can be null to not include
the image path into the JSON objectpublic static org.codehaus.jackson.node.ObjectNode createUserSearchJSONResult(UserData item, ImageSizeType imageSize)
createUserSearchJSONResult(Long, String, String, String, String)
. If imageSize
is null the imagePath will not be included.item
- the item from which the user information will be extractedimageSize
- the size of the user logo to include in the image path, can be null to not include
the image path into the JSON objectCopyright © 2019 Communote team. All rights reserved.