fixed bug on retrieving user for sharing

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@91422 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-02-11 18:18:14 +00:00
parent c552fa334a
commit d3d0a39cbd
5 changed files with 31 additions and 10 deletions

View File

@ -5,6 +5,9 @@ import java.util.List;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL; import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE; import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.Radio; import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup; import com.extjs.gxt.ui.client.widget.form.RadioGroup;
@ -43,7 +46,7 @@ public class PanelPermission extends LayoutContainer {
radio.setBoxLabel(acl.getLabel()); radio.setBoxLabel(acl.getLabel());
radio.setValueAttribute(acl.getLabel()); radio.setValueAttribute(acl.getLabel());
radio.setData(WORKSPACEACL, acl); radio.setData(WORKSPACEACL, acl);
radio.setToolTip(new ToolTipConfig(acl.getLabel())); radio.setToolTip(new ToolTipConfig(acl.getDescription()));
radio.setValue(acl.getDefaultValue()); radio.setValue(acl.getDefaultValue());
return radio; return radio;

View File

@ -17,7 +17,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
*/ */
public class UserStore implements ContactFetcher{ public class UserStore implements ContactFetcher{
public List<InfoContactModel> listAllContact = new ArrayList<InfoContactModel>(); public static List<InfoContactModel> listAllContact = null;
// public boolean syncronizeCleanSharedUser = false; // public boolean syncronizeCleanSharedUser = false;

View File

@ -2505,21 +2505,21 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
switch (acl) { switch (acl) {
case ADMINISTRATOR: case ADMINISTRATOR:
acls.add(new WorkspaceACL(acl.toString(), acl.toString(), false, USER_TYPE.ADMINISTRATOR)); acls.add(new WorkspaceACL(acl.toString(), acl.toString(), false, USER_TYPE.ADMINISTRATOR,""));
break; break;
case READ_ONLY: case READ_ONLY:
acls.add(new WorkspaceACL(acl.toString(), "Read Only", false, USER_TYPE.OTHER)); acls.add(new WorkspaceACL(acl.toString(), "Read Only", false, USER_TYPE.OTHER, "Users can read any file but cannot update/delete"));
break; break;
case WRITE_OWNER: case WRITE_OWNER:
acls.add(new WorkspaceACL(acl.toString(), "Write Owner", true, USER_TYPE.OTHER)); acls.add(new WorkspaceACL(acl.toString(), "Write Own", true, USER_TYPE.OTHER, "Users can update/delete only their files"));
break; break;
case WRITE_ALL: case WRITE_ALL:
acls.add(new WorkspaceACL(acl.toString(), "Write All", false, USER_TYPE.OTHER)); acls.add(new WorkspaceACL(acl.toString(), "Write Any", false, USER_TYPE.OTHER,"Any user can update/delete any file"));
break; break;
default: default:
acls.add(new WorkspaceACL(acl.toString(), acl.toString(), false, USER_TYPE.OTHER)); acls.add(new WorkspaceACL(acl.toString(), acl.toString(), false, USER_TYPE.OTHER, ""));
break; break;
} }
} }

View File

@ -74,10 +74,10 @@ public class WsUtil {
/*USE ANOTHER ACCOUNT (OTHERWHISE BY TEST_USER) FOR RUNNING /*USE ANOTHER ACCOUNT (OTHERWHISE BY TEST_USER) FOR RUNNING
* COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/ * COMMENT THIS IN DEVELOP ENVIROMENT (UNCOMMENT IN PRODUCTION)*/
// user=TEST_USER; user=TEST_USER;
//UNCOMMENT THIS IN DEVELOP ENVIROMENT //UNCOMMENT THIS IN DEVELOP ENVIROMENT
user = "francesco.mangiacrapa"; // user = "francesco.mangiacrapa";
logger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:"); logger.warn("WORKSPACE PORTLET STARTING IN TEST MODE - NO USER FOUND - PORTLETS STARTING WITH FOLLOWING SETTINGS:");
logger.warn("session id: "+sessionID); logger.warn("session id: "+sessionID);
@ -103,6 +103,9 @@ public class WsUtil {
}else if(user.compareToIgnoreCase(TEST_USER)==0){ }else if(user.compareToIgnoreCase(TEST_USER)==0){
withoutPortal = true; withoutPortal = true;
}else if(user.compareToIgnoreCase("francesco.mangiacrapa")==0){
withoutPortal = true;
}else{ }else{

View File

@ -19,14 +19,17 @@ public class WorkspaceACL implements Serializable{
private boolean defaultValue; private boolean defaultValue;
private USER_TYPE userType; private USER_TYPE userType;
private String description;
public enum USER_TYPE{ADMINISTRATOR, GROUP, OWNER, OTHER}; public enum USER_TYPE{ADMINISTRATOR, GROUP, OWNER, OTHER};
public WorkspaceACL(String id, String label, boolean defaultValue, USER_TYPE userType) { public WorkspaceACL(String id, String label, boolean defaultValue, USER_TYPE userType, String description) {
super(); super();
this.id = id; this.id = id;
this.label = label; this.label = label;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
this.userType = userType; this.userType = userType;
this.description = description;
} }
@ -68,6 +71,13 @@ public class WorkspaceACL implements Serializable{
} }
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override @Override
public String toString() { public String toString() {
@ -80,7 +90,12 @@ public class WorkspaceACL implements Serializable{
builder.append(defaultValue); builder.append(defaultValue);
builder.append(", userType="); builder.append(", userType=");
builder.append(userType); builder.append(userType);
builder.append(", description=");
builder.append(description);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
} }