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:
parent
120ac4a0d7
commit
0f9b1c2d42
|
@ -46,9 +46,9 @@ public class ServerUtils {
|
||||||
|
|
||||||
if (user == null) {
|
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();
|
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 .
|
* @return .
|
||||||
*/
|
*/
|
||||||
public static String getDevelopmentUser() {
|
public static String getDevelopmentUser() {
|
||||||
String user = UserStatisticsServiceImpl.defaultUserId;
|
String user = UserStatisticsServiceImpl.TEST_USER;
|
||||||
// user = "costantino.perciante";
|
// user = "costantino.perciante";
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ import com.liferay.portal.service.UserLocalServiceUtil;
|
||||||
public class UserStatisticsServiceImpl extends RemoteServiceServlet implements UserStatisticsService {
|
public class UserStatisticsServiceImpl extends RemoteServiceServlet implements UserStatisticsService {
|
||||||
|
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(UserStatisticsServiceImpl.class);
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(UserStatisticsServiceImpl.class);
|
||||||
public static final String defaultUserId = "test.user";
|
public static final String TEST_USER = "test.user";
|
||||||
public static final String vreID = "/gcube/devsec/devVRE";
|
public static final String TEST_CONTEXT = "/gcube/devsec/devVRE";
|
||||||
private DatabookStore store;
|
private DatabookStore store;
|
||||||
private static final String CUSTOM_FIELD_NAME_USER_STATISTICS_VISIBILITY = "show_user_statistics_other_people";
|
private static final String CUSTOM_FIELD_NAME_USER_STATISTICS_VISIBILITY = "show_user_statistics_other_people";
|
||||||
private UserManager userManager = new LiferayUserManager();
|
private UserManager userManager = new LiferayUserManager();
|
||||||
|
@ -70,7 +70,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
if(userid != null && !userid.equals(userName))
|
if(userid != null && !userid.equals(userName))
|
||||||
statisticsOfUsername = userid;
|
statisticsOfUsername = userid;
|
||||||
|
|
||||||
if (userName.compareTo(defaultUserId) == 0) {
|
if (userName.compareTo(TEST_USER) == 0) {
|
||||||
logger.debug("Found " + userName + " returning nothing");
|
logger.debug("Found " + userName + " returning nothing");
|
||||||
return null;
|
return null;
|
||||||
}else{
|
}else{
|
||||||
|
@ -105,7 +105,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
if(userid != null && !userid.equals(userName))
|
if(userid != null && !userid.equals(userName))
|
||||||
statisticsOfUsername = userid;
|
statisticsOfUsername = userid;
|
||||||
|
|
||||||
if (userName.compareTo(defaultUserId) == 0) {
|
if (userName.compareTo(TEST_USER) == 0) {
|
||||||
logger.debug("Found " + userName + " returning nothing");
|
logger.debug("Found " + userName + " returning nothing");
|
||||||
return profileStrenght;
|
return profileStrenght;
|
||||||
}else{
|
}else{
|
||||||
|
@ -143,7 +143,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
logger.info("Is profile showable for user " + userid + " " + isProfileShowable);
|
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");
|
logger.debug("Found " + userName + " returning nothing");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
else
|
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 userName = session.getUsername();
|
||||||
String scope = session.getScope();
|
String scope = session.getScope();
|
||||||
|
|
||||||
if (userName.compareTo(defaultUserId) == 0) {
|
if (userName.compareTo(TEST_USER) == 0) {
|
||||||
logger.debug("Found " + userName + " returning nothing");
|
logger.debug("Found " + userName + " returning nothing");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
if(ServerUtils.isWithinPortal()){
|
if(ServerUtils.isWithinPortal()){
|
||||||
ASLSession session = ServerUtils.getASLSession(this.getThreadLocalRequest().getSession());
|
ASLSession session = ServerUtils.getASLSession(this.getThreadLocalRequest().getSession());
|
||||||
String username = session.getUsername();
|
String username = session.getUsername();
|
||||||
if (username.compareTo(defaultUserId) == 0) {
|
if (username.compareTo(TEST_USER) == 0) {
|
||||||
logger.debug("Found " + username + " returning nothing");
|
logger.debug("Found " + username + " returning nothing");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class TestForDeploy {
|
||||||
public void testUserIsTestUser() {
|
public void testUserIsTestUser() {
|
||||||
String username = ServerUtils.getDevelopmentUser();
|
String username = ServerUtils.getDevelopmentUser();
|
||||||
System.out.println("username for deploy is: " + username);
|
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!");
|
System.out.println("Test OK!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue