minor fixes

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@134071 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-10 22:14:36 +00:00
parent 120ac4a0d7
commit 0f9b1c2d42
3 changed files with 12 additions and 12 deletions

View File

@ -46,9 +46,9 @@ public class ServerUtils {
if (user == null) {
logger.warn("USER IS NULL setting " + UserStatisticsServiceImpl.defaultUserId + " and Running OUTSIDE PORTAL");
logger.warn("USER IS NULL setting " + UserStatisticsServiceImpl.TEST_USER + " and Running OUTSIDE PORTAL");
user = getDevelopmentUser();
SessionManager.getInstance().getASLSession(sessionID, user).setScope(UserStatisticsServiceImpl.vreID);
SessionManager.getInstance().getASLSession(sessionID, user).setScope(UserStatisticsServiceImpl.TEST_CONTEXT);
}
@ -60,7 +60,7 @@ public class ServerUtils {
* @return .
*/
public static String getDevelopmentUser() {
String user = UserStatisticsServiceImpl.defaultUserId;
String user = UserStatisticsServiceImpl.TEST_USER;
// user = "costantino.perciante";
return user;
}

View File

@ -40,8 +40,8 @@ import com.liferay.portal.service.UserLocalServiceUtil;
public class UserStatisticsServiceImpl extends RemoteServiceServlet implements UserStatisticsService {
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(UserStatisticsServiceImpl.class);
public static final String defaultUserId = "test.user";
public static final String vreID = "/gcube/devsec/devVRE";
public static final String TEST_USER = "test.user";
public static final String TEST_CONTEXT = "/gcube/devsec/devVRE";
private DatabookStore store;
private static final String CUSTOM_FIELD_NAME_USER_STATISTICS_VISIBILITY = "show_user_statistics_other_people";
private UserManager userManager = new LiferayUserManager();
@ -70,7 +70,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
if(userid != null && !userid.equals(userName))
statisticsOfUsername = userid;
if (userName.compareTo(defaultUserId) == 0) {
if (userName.compareTo(TEST_USER) == 0) {
logger.debug("Found " + userName + " returning nothing");
return null;
}else{
@ -105,7 +105,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
if(userid != null && !userid.equals(userName))
statisticsOfUsername = userid;
if (userName.compareTo(defaultUserId) == 0) {
if (userName.compareTo(TEST_USER) == 0) {
logger.debug("Found " + userName + " returning nothing");
return profileStrenght;
}else{
@ -143,7 +143,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
logger.info("Is profile showable for user " + userid + " " + isProfileShowable);
}
if (userName.compareTo(defaultUserId) == 0) {
if (userName.compareTo(TEST_USER) == 0) {
logger.debug("Found " + userName + " returning nothing");
return null;
}
@ -172,7 +172,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
return bean;
}
else
return new UserInformation(true, null, userName, vreID, true, true);
return new UserInformation(true, null, userName, TEST_CONTEXT, true, true);
}
/**
@ -202,7 +202,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
String userName = session.getUsername();
String scope = session.getScope();
if (userName.compareTo(defaultUserId) == 0) {
if (userName.compareTo(TEST_USER) == 0) {
logger.debug("Found " + userName + " returning nothing");
return null;
}
@ -283,7 +283,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
if(ServerUtils.isWithinPortal()){
ASLSession session = ServerUtils.getASLSession(this.getThreadLocalRequest().getSession());
String username = session.getUsername();
if (username.compareTo(defaultUserId) == 0) {
if (username.compareTo(TEST_USER) == 0) {
logger.debug("Found " + username + " returning nothing");
return;
}

View File

@ -12,7 +12,7 @@ public class TestForDeploy {
public void testUserIsTestUser() {
String username = ServerUtils.getDevelopmentUser();
System.out.println("username for deploy is: " + username);
assertTrue(username.compareTo(UserStatisticsServiceImpl.defaultUserId) == 0);
assertTrue(username.compareTo(UserStatisticsServiceImpl.TEST_USER) == 0);
System.out.println("Test OK!");
}