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 org.gcube.application.framework.core.session.ASLSession |
getASLSession(javax.servlet.http.HttpSession session)
the current ASLSession
|
static String |
getDevelopmentUser()
when packaging test will fail if the user is not set to test.user
|
static String |
getSummary(com.liferay.portal.model.User user)
get the user's comment
|
static boolean |
isInfrastructureScope(String userid,
javax.servlet.http.HttpSession session)
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.application.framework.core.session.ASLSession getASLSession(javax.servlet.http.HttpSession session)
public static String getDevelopmentUser()
public static boolean isInfrastructureScope(String userid, javax.servlet.http.HttpSession session)
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 © 2016. All Rights Reserved.