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:
parent
0d97e17c22
commit
dc503adf6e
|
@ -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.shared.SessionExpiredException;
|
||||
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.widgets.fileupload.client.events.FileUploadCompleteEvent;
|
||||
import org.gcube.portlets.widgets.fileupload.client.events.FileUploadCompleteEventHandler;
|
||||
|
@ -2211,7 +2210,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
// 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());
|
||||
|
||||
|
@ -2225,7 +2224,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
// 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);
|
||||
|
||||
|
@ -2239,8 +2238,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
// doAddAdministratorToFolderId(file, logins);
|
||||
setACLToFolderId(file.getIdentifier(), logins, multiDragContact.getSelectedAclID());
|
||||
multidrag.hide();
|
||||
}
|
||||
if(clickedButton.equals(Dialog.CANCEL)){
|
||||
}else if(clickedButton.equals(Dialog.CANCEL)){
|
||||
multidrag.hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -1068,10 +1068,7 @@ public class GWTWorkspaceBuilder {
|
|||
String portalLogin = item.getOwner();
|
||||
if(portalLogin!=null){
|
||||
String fullName = portalLogin;
|
||||
|
||||
if(!WsUtil.withoutPortal) //INTO PORTAL
|
||||
fullName = UserUtil.getUserFullName(portalLogin);
|
||||
|
||||
fullName = UserUtil.getUserFullName(portalLogin);
|
||||
fileGridModel.setOwnerFullName(fullName);
|
||||
}
|
||||
}
|
||||
|
@ -1159,12 +1156,7 @@ public class GWTWorkspaceBuilder {
|
|||
// System.out.println("++++reading owner");
|
||||
String portalLogin = owner.getPortalLogin();
|
||||
String fullName = portalLogin;
|
||||
|
||||
if(!WsUtil.withoutPortal) //INTO PORTAL
|
||||
fullName = UserUtil.getUserFullName(portalLogin);
|
||||
|
||||
// fileGridModel.setOwner(new InfoContactModel(item.getOwner().getId(), portalLogin, fullName));
|
||||
|
||||
fullName = UserUtil.getUserFullName(portalLogin);
|
||||
fileGridModel.setOwnerFullName(fullName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.GxtAccountingField;
|
||||
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.UserManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager;
|
||||
|
@ -134,7 +133,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
}
|
||||
|
||||
protected boolean isTestMode(){
|
||||
return WsUtil.withoutPortal;
|
||||
return !WsUtil.isWithinPortal();
|
||||
}
|
||||
|
||||
protected UrlShortener getUrlShortener() {
|
||||
|
|
|
@ -33,7 +33,7 @@ public class UserUtil {
|
|||
if(portalLogin==null)
|
||||
return "";
|
||||
|
||||
if (portalLogin.compareTo(WsUtil.TEST_USER) != 0) { //skip test.user
|
||||
if (WsUtil.isWithinPortal()) { //INTO PORTAL
|
||||
|
||||
UserModel curr = null;
|
||||
|
||||
|
@ -63,8 +63,8 @@ public class UserUtil {
|
|||
|
||||
}
|
||||
}else{
|
||||
|
||||
logger.trace("Return "+WsUtil.TEST_USER_FULL_NAME +" full name for: "+portalLogin);
|
||||
logger.trace("DEVELOPEMENT MODE ON");
|
||||
logger.trace("Returning "+WsUtil.TEST_USER_FULL_NAME +" full name for: "+portalLogin);
|
||||
return WsUtil.TEST_USER_FULL_NAME;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,13 +71,13 @@ public class WsUtil {
|
|||
|
||||
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
|
||||
*/
|
||||
private static boolean isWithinPortal() {
|
||||
public static boolean isWithinPortal() {
|
||||
try {
|
||||
UserLocalServiceUtil.getService();
|
||||
return true;
|
||||
|
@ -100,7 +100,7 @@ public class WsUtil {
|
|||
* COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/
|
||||
user=TEST_USER;
|
||||
|
||||
if (! isWithinPortal()) {
|
||||
if (!isWithinPortal()) { //DEV MODE
|
||||
user = "francesco.mangiacrapa";
|
||||
TEST_USER_FULL_NAME = "Francesco Mangiacrapa";
|
||||
}
|
||||
|
@ -122,22 +122,10 @@ public class WsUtil {
|
|||
//SET HTTP SESSION ATTRIBUTE
|
||||
httpSession.setAttribute(USERNAME_ATTRIBUTE, user);
|
||||
|
||||
withoutPortal = true;
|
||||
// withoutPortal = true;
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue