user was managed from usermanagement-core

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@82279 82a268e6-3cf1-43bd-a215-b396298e98cf
task/19600
Francesco Mangiacrapa 11 years ago
parent 1fe16706dc
commit 1566ad12ad

@ -78,6 +78,13 @@
<artifactId>gcf</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
@ -131,6 +138,7 @@
<artifactId>commons-fileupload</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>

@ -92,6 +92,8 @@ import org.gcube.portlets.user.workspace.server.util.UserUtil;
import org.gcube.portlets.user.workspace.server.util.WsUtil;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.vomanagement.usermanagement.model.UserModel;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
@ -1568,18 +1570,28 @@ public class GWTWorkspaceBuilder {
}
public List<InfoContactModel> buildGXTListContactsModel(List<User> listUsers) throws InternalErrorException {
public List<InfoContactModel> buildGXTListContactsModel(List<UserModel> listUsers) throws InternalErrorException {
List<InfoContactModel> listContactsModel = new ArrayList<InfoContactModel>();
for(User user: listUsers){
String fullName = UserUtil.getUserFullName(user.getPortalLogin());
for (UserModel userModel : listUsers) {
String fullName = UserUtil.getUserFullName(userModel.getFullname());
if(fullName!=null && !fullName.isEmpty())
listContactsModel.add(new InfoContactModel(user.getId(), user.getPortalLogin(), fullName));
listContactsModel.add(new InfoContactModel(userModel.getUserId()+"", userModel.getScreenName(), fullName));
else
logger.trace("buildGXTListContactsModel doesn't return user: "+user.getPortalLogin()+ "because name is null or empty");
logger.trace("buildGXTListContactsModel doesn't return user: "+userModel.getScreenName()+ "because name is null or empty");
}
// for(User user: listUsers){
// String fullName = UserUtil.getUserFullName(user.getPortalLogin());
//
// if(fullName!=null && !fullName.isEmpty())
// listContactsModel.add(new InfoContactModel(user.getId(), user.getPortalLogin(), fullName));
// else
// logger.trace("buildGXTListContactsModel doesn't return user: "+user.getPortalLogin()+ "because name is null or empty");
// }
return listContactsModel;
}

@ -62,6 +62,8 @@ import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.user.workspaceapplicationhandler.ApplicationReaderFromGenericResource;
import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@ -1257,7 +1259,8 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
}
return builder.buildGXTListContactsModel(workspace.getHome().getHomeManager().getUsers()); //TODO passare list items
UserManager userManag = new LiferayUserManager();
return builder.buildGXTListContactsModel(userManag.listUsers());
} catch (Exception e) {
workspaceLogger.error("Error in server get all contacts ", e);
@ -2333,7 +2336,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
//READING USERNAME FROM ASL SESSION
String userUsername = WsUtil.getAslSession(this.getThreadLocalRequest().getSession()).getUsername();
if(userUsername.compareTo(WsUtil.TEST_USER)==0){
if(userUsername.compareTo(WsUtil.TEST_USER)==0 && !isTestMode()){
workspaceLogger.error("workspace session is expired! username is: "+WsUtil.TEST_USER);
return true; //is TEST_USER, session is expired
}

@ -273,6 +273,10 @@ public class UploadServlet extends HttpServlet {
logger.error("Error creating elements", e);
sendError(response, "Internal error: An item with that name already exists");
return;
}catch (Exception e) {
logger.error("Error creating elements", e);
sendError(response, "Internal error: An error occurred on uploading the file, try again later");
return;
}
}

@ -54,10 +54,10 @@ public class WsUtil {
// public static final String TEST_USER = "federico.defaveri";
// public static final String TEST_USER = "massimiliano.assante";
// public static final String TEST_USER = "pasquale.pagano";
// public static final String TEST_USER = "francesco.mangiacrapa";
public static final String TEST_USER = "francesco.mangiacrapa";
// public static final String TEST_USER_FULL_NAME = "Francesco Mangiacrapa";
// public static final String TEST_USER = "aureliano.gentile";
public static final String TEST_USER = "test.user";
// public static final String TEST_USER = "test.user";
// public static final String TEST_USER = "antonio.gioia";
public static final String TEST_USER_FULL_NAME = "Test User";
@ -78,10 +78,10 @@ public class WsUtil {
/*USE ANOTHER ACCOUNT (OTHERWHISE BY TEST_USER) FOR RUNNING
* COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/
// user=TEST_USER;
user=TEST_USER;
//UNCOMMENT THIS IN DEVELOP ENVIROMENT
user = "francesco.mangiacrapa";
// user = "francesco.mangiacrapa";
defaultLogger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
defaultLogger.warn("session id: "+sessionID);

Loading…
Cancel
Save