updated behaviour to "Add Aministrators"

starting fix of https://support.d4science.research-infrastructures.eu/ticket/940

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@98602 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-07-14 13:59:42 +00:00
parent d686314e2b
commit a049e7313b
3 changed files with 30 additions and 9 deletions

View File

@ -5,6 +5,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.6.6-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-tree-widget-TRUNK/workspace-tree-widget-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="workspace"/>

View File

@ -97,10 +97,10 @@ import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo;
import org.gcube.portlets.user.workspace.client.view.windows.InfoDisplay;
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxConfirm;
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
import org.gcube.portlets.user.workspace.shared.SessionExpiredException;
import org.gcube.portlets.user.workspace.shared.TrashContent;
import org.gcube.portlets.user.workspace.shared.TrashOperationContent;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
import org.gcube.portlets.widgets.wsmail.client.forms.MailForm;
@ -1085,7 +1085,7 @@ public class AppController implements SubscriberInterface {
}
GWT.log("Updating ACL info for folder id: "+parentId);
AppControllerExplorer.rpcWorkspaceService.getUserACLForFolderId(parentId, new AsyncCallback<List<WorkspaceACL>>() {
AppControllerExplorer.rpcWorkspaceService.getUserACLForFolderId(parentId, new AsyncCallback<List<ExtendedWorkspaceACL>>() {
@Override
public void onFailure(Throwable arg0) {
@ -1094,14 +1094,16 @@ public class AppController implements SubscriberInterface {
}
@Override
public void onSuccess(List<WorkspaceACL> res) {
public void onSuccess(List<ExtendedWorkspaceACL> res) {
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
GWT.log("Validating correct ACL id: "+parentId +" and "+parent.getIdentifier());
if(parentId.compareTo(parent.getIdentifier())==0){
if(res!=null && res.size()>0)
if(res!=null && res.size()>0){
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
wsPortlet.getToolBarItemDetails().updateAddAdministorInfo(appContrExplorer.myLogin, res.get(0));
}
}
}
});

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
import org.gcube.portlets.user.workspace.client.event.TrashEvent;
import org.gcube.portlets.user.workspace.client.resources.Resources;
import org.gcube.portlets.user.workspace.client.util.GetPermissionIconByACL;
import org.gcube.portlets.user.workspace.shared.ExtendedWorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
@ -218,7 +219,7 @@ public class GxtBottomToolBarItem extends ToolBar{
public void updateACLInfo(WorkspaceACL acl){
setVisibleAddAdministrators(false);
// setVisibleAddAdministrators(false);
if(acl==null){
aclDivInfo.updateInfo(null, null);
@ -226,14 +227,29 @@ public class GxtBottomToolBarItem extends ToolBar{
}
AbstractImagePrototype img = GetPermissionIconByACL.getImage(acl);
if(acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
setVisibleAddAdministrators(true);
}
// if(acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
// setVisibleAddAdministrators(true);
// }
//
aclDivInfo.updateInfo(acl.getLabel(), img);
this.layout();
}
public void updateAddAdministorInfo(String loginUserLogger, ExtendedWorkspaceACL acl){
setVisibleAddAdministrators(false);
String loginOwner = acl.getLoginOwner();
if(loginOwner!=null && !loginOwner.isEmpty() && loginUserLogger!=null && !loginUserLogger.isEmpty()){
GWT.log("Comparing loginUserLogger: "+loginUserLogger +" and loginUserLogger: "+loginUserLogger +" to update AdministorInfo");
if((loginOwner.compareToIgnoreCase(loginUserLogger)==0) && acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
setVisibleAddAdministrators(true);
}
}
this.layout();
}
public void updateTrashIcon(boolean trashIsFull){
if(trashIsFull)