fixed bug

changed test mode

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@111511 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-01-28 14:02:18 +00:00
parent 0d97e17c22
commit dc503adf6e
5 changed files with 13 additions and 36 deletions

View File

@ -143,7 +143,6 @@ import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTI
import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument; import org.gcube.portlets.user.workspace.client.workspace.folder.item.gcube.GWTUrlDocument;
import org.gcube.portlets.user.workspace.shared.SessionExpiredException; import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
import org.gcube.portlets.user.workspace.shared.UserBean; import org.gcube.portlets.user.workspace.shared.UserBean;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEvent; import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEvent;
import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEventHandler; import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEventHandler;
@ -2211,7 +2210,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
// GWT.log(targets.toString()); // GWT.log(targets.toString());
if(targets.size()>1 && multiDragContact.getSelectedAcl()!=null){ if(targets.size()>=1 && multiDragContact.getSelectedAcl()!=null){
final List<String> logins = new ArrayList<String>(targets.size()); final List<String> logins = new ArrayList<String>(targets.size());
@ -2225,7 +2224,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
// GWT.log("names "+names); // GWT.log("names "+names);
String msg = "Setting permission '"+multiDragContact.getSelectedAcl().getLabel() +"' for: <ul>"+names+"</ul>, confirm?"; String msg = "Setting permission '"+multiDragContact.getSelectedAcl().getLabel() +"' for: <ul>"+names+"</ul> confirm?";
MessageBoxConfirm confirm = new MessageBoxConfirm("Setting new permissions to "+file.getName() +"?", msg); MessageBoxConfirm confirm = new MessageBoxConfirm("Setting new permissions to "+file.getName() +"?", msg);
@ -2239,8 +2238,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
// doAddAdministratorToFolderId(file, logins); // doAddAdministratorToFolderId(file, logins);
setACLToFolderId(file.getIdentifier(), logins, multiDragContact.getSelectedAclID()); setACLToFolderId(file.getIdentifier(), logins, multiDragContact.getSelectedAclID());
multidrag.hide(); multidrag.hide();
} }else if(clickedButton.equals(Dialog.CANCEL)){
if(clickedButton.equals(Dialog.CANCEL)){
multidrag.hide(); multidrag.hide();
} }

View File

@ -1068,10 +1068,7 @@ public class GWTWorkspaceBuilder {
String portalLogin = item.getOwner(); String portalLogin = item.getOwner();
if(portalLogin!=null){ if(portalLogin!=null){
String fullName = portalLogin; String fullName = portalLogin;
fullName = UserUtil.getUserFullName(portalLogin);
if(!WsUtil.withoutPortal) //INTO PORTAL
fullName = UserUtil.getUserFullName(portalLogin);
fileGridModel.setOwnerFullName(fullName); fileGridModel.setOwnerFullName(fullName);
} }
} }
@ -1159,12 +1156,7 @@ public class GWTWorkspaceBuilder {
// System.out.println("++++reading owner"); // System.out.println("++++reading owner");
String portalLogin = owner.getPortalLogin(); String portalLogin = owner.getPortalLogin();
String fullName = portalLogin; String fullName = portalLogin;
fullName = UserUtil.getUserFullName(portalLogin);
if(!WsUtil.withoutPortal) //INTO PORTAL
fullName = UserUtil.getUserFullName(portalLogin);
// fileGridModel.setOwner(new InfoContactModel(item.getOwner().getId(), portalLogin, fullName));
fileGridModel.setOwnerFullName(fullName); fileGridModel.setOwnerFullName(fullName);
} }
} }

View File

@ -79,7 +79,6 @@ import org.gcube.portlets.user.workspace.shared.WorkspaceUserQuote;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField; import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
import org.gcube.portlets.user.workspaceapplicationhandler.ApplicationReaderFromGenericResource; import org.gcube.portlets.user.workspaceapplicationhandler.ApplicationReaderFromGenericResource;
import org.gcube.portlets.widgets.workspacesharingwidget.server.GWTWorkspaceSharingBuilder;
import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager;
@ -134,7 +133,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
} }
protected boolean isTestMode(){ protected boolean isTestMode(){
return WsUtil.withoutPortal; return !WsUtil.isWithinPortal();
} }
protected UrlShortener getUrlShortener() { protected UrlShortener getUrlShortener() {

View File

@ -33,7 +33,7 @@ public class UserUtil {
if(portalLogin==null) if(portalLogin==null)
return ""; return "";
if (portalLogin.compareTo(WsUtil.TEST_USER) != 0) { //skip test.user if (WsUtil.isWithinPortal()) { //INTO PORTAL
UserModel curr = null; UserModel curr = null;
@ -63,8 +63,8 @@ public class UserUtil {
} }
}else{ }else{
logger.trace("DEVELOPEMENT MODE ON");
logger.trace("Return "+WsUtil.TEST_USER_FULL_NAME +" full name for: "+portalLogin); logger.trace("Returning "+WsUtil.TEST_USER_FULL_NAME +" full name for: "+portalLogin);
return WsUtil.TEST_USER_FULL_NAME; return WsUtil.TEST_USER_FULL_NAME;
} }

View File

@ -71,13 +71,13 @@ public class WsUtil {
protected static Logger logger = Logger.getLogger(WsUtil.class); protected static Logger logger = Logger.getLogger(WsUtil.class);
public static boolean withoutPortal = false; // public static boolean withoutPortal = false;
/** /**
* *
* @return true if you're running into the portal, false if in development * @return true if you're running into the portal, false if in development
*/ */
private static boolean isWithinPortal() { public static boolean isWithinPortal() {
try { try {
UserLocalServiceUtil.getService(); UserLocalServiceUtil.getService();
return true; return true;
@ -100,7 +100,7 @@ public class WsUtil {
* COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/ * COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/
user=TEST_USER; user=TEST_USER;
if (! isWithinPortal()) { if (!isWithinPortal()) { //DEV MODE
user = "francesco.mangiacrapa"; user = "francesco.mangiacrapa";
TEST_USER_FULL_NAME = "Francesco Mangiacrapa"; TEST_USER_FULL_NAME = "Francesco Mangiacrapa";
} }
@ -122,22 +122,10 @@ public class WsUtil {
//SET HTTP SESSION ATTRIBUTE //SET HTTP SESSION ATTRIBUTE
httpSession.setAttribute(USERNAME_ATTRIBUTE, user); httpSession.setAttribute(USERNAME_ATTRIBUTE, user);
withoutPortal = true; // withoutPortal = true;
return session; return session;
}else if(user.compareToIgnoreCase(TEST_USER)==0){
withoutPortal = true;
//*** COMMENT THIS IN PRODUCTION ENVIROMENT
// }else if(user.compareToIgnoreCase("francesco.mangiacrapa")==0){
//
// withoutPortal = true;
//*** END UNCOMMENT
}else{
withoutPortal = false;
} }
return SessionManager.getInstance().getASLSession(sessionID, user); return SessionManager.getInstance().getASLSession(sessionID, user);