public class ServerUtils extends Object
| Constructor and Description |
|---|
ServerUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createUserCustomField(String customFieldNameUserStatisticsVisibility,
boolean startingValue)
On servlet instanciation, create the custom field and set it to startingValue
|
static String |
escapeHtml(String html)
Escape an html string.
|
static int |
evaluateContactScore(com.liferay.portal.model.User user)
Evaluates user's contact information
|
static int |
evaluateInformationScore(com.liferay.portal.model.User user,
boolean imageIsPresent)
Evaluates a score according to the information of the user such as job, organization, comments
|
static int |
evaluateProfileStrenght(com.liferay.portal.model.User user,
boolean imageIsPresent)
Evaluates the profile strenght of the user
|
static String |
formatFileSize(long size)
returns dynamically the formated size.
|
static String |
getCurrentContext(javax.servlet.http.HttpServletRequest request,
boolean setInThread)
Retrieve the current scope by using the portal manager
|
static String |
getCurrentSecurityToken(javax.servlet.http.HttpServletRequest request,
boolean setInThread)
Get current user token
|
static org.gcube.vomanagement.usermanagement.model.GCubeUser |
getCurrentUser(javax.servlet.http.HttpServletRequest request)
Retrieve the current user by using the portal manager
|
static String |
getSummary(com.liferay.portal.model.User user)
get the user's comment
|
static boolean |
isInfrastructureScope(String userid,
javax.servlet.http.HttpServletRequest request)
Indicates whether the scope is the whole infrastructure.
|
static boolean |
isWithinPortal()
Online or in development mode?
|
static void |
setPermissionChecker()
Set the permission checker to set/get custom fields into liferay
|
public static org.gcube.vomanagement.usermanagement.model.GCubeUser getCurrentUser(javax.servlet.http.HttpServletRequest request)
public static String getCurrentContext(javax.servlet.http.HttpServletRequest request, boolean setInThread)
b - public static String getCurrentSecurityToken(javax.servlet.http.HttpServletRequest request, boolean setInThread)
request - setInThread - public static boolean isInfrastructureScope(String userid, javax.servlet.http.HttpServletRequest request)
userid - in case userid is not null, the user is visiting a profile page and
the statistics to return are the ones available in the whole infrastructuretrue if it is, false otherwise.public static boolean isWithinPortal()
public static String formatFileSize(long size)
size - the sizepublic static int evaluateProfileStrenght(com.liferay.portal.model.User user,
boolean imageIsPresent)
user - public static int evaluateInformationScore(com.liferay.portal.model.User user,
boolean imageIsPresent)
user - public static String getSummary(com.liferay.portal.model.User user)
user - public static String escapeHtml(String html)
html - the html string to escapepublic static int evaluateContactScore(com.liferay.portal.model.User user)
user - public static void setPermissionChecker()
public static void createUserCustomField(String customFieldNameUserStatisticsVisibility, boolean startingValue)
customFieldNameUserStatisticsVisibility - b - Copyright © 2017. All Rights Reserved.