updated to manage "Add Administrators" https://support.social.isti.cnr.it/ticket/126

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@98507 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-07-08 16:42:22 +00:00
parent 7d87ea6c92
commit 70703a186e
6 changed files with 71 additions and 20 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/workspace-6.6.5-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/workspace-6.6.7-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -25,5 +25,5 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/workspace-6.6.5-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/workspace-6.6.7-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -3,6 +3,6 @@
>>>>>>>=.r93212
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francesco-mangiacrapa/wseclipse/workspace-TRUNK/target/workspace-6.6.5-SNAPSHOT
lastWarOutDir=/home/francesco-mangiacrapa/wseclipse/workspace-TRUNK/target/workspace-6.6.7-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -5,7 +5,10 @@
<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-BRANCH-6.6.6-SNAPSHOT/workspace-tree-widget-BRANCH-6.6.6-SNAPSHOT">
<dependent-module archiveName="workspace-tree-widget-6.6.7-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>
<dependent-module archiveName="workspace-sharing-widget-1.1.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-sharing-widget-TRUNK/workspace-sharing-widget-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>

View File

@ -14,6 +14,8 @@ import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEventHandler;
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingView;
import org.gcube.portlets.user.workspace.client.event.ActiveGroupingViewHandler;
import org.gcube.portlets.user.workspace.client.event.AddAdministratorEvent;
import org.gcube.portlets.user.workspace.client.event.AddAdministratorEventHandler;
import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
import org.gcube.portlets.user.workspace.client.event.AddFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.AddSmartFolderEvent;
@ -184,6 +186,18 @@ public class AppController implements SubscriberInterface {
}
});
eventBus.addHandler(AddAdministratorEvent.TYPE, new AddAdministratorEventHandler() {
@Override
public void onAddAdministrator(AddAdministratorEvent addAdministratorEvent) {
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
if(parent!=null)
AppControllerExplorer.getEventBus().fireEvent(new AddAdministratorEvent(parent));
}
});
eventBus.addHandler(TrashEvent.TYPE, new TrashEventHandler() {
@Override

View File

@ -3,12 +3,14 @@ package org.gcube.portlets.user.workspace.client.view.toolbars;
import org.gcube.portlets.user.workspace.client.AppController;
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
import org.gcube.portlets.user.workspace.client.event.AddAdministratorEvent;
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.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
import org.gcube.portlets.user.workspace.shared.WorkspaceACL.USER_TYPE;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.BaseEvent;
@ -44,6 +46,8 @@ public class GxtBottomToolBarItem extends ToolBar{
*
*/
protected static final String HISTORY = "History";
private static final String ADD_ADMINISTRATOR = "Add Admnistrator/s";
private TextField<String> txfName = new TextField<String>();
private Text txtOwner = new Text("Empty");
private Text txtCreationTime = new Text("Empty");
@ -56,6 +60,7 @@ public class GxtBottomToolBarItem extends ToolBar{
private ACLDivInfo aclDivInfo;
private Label labelItemsNumber = new Label();
private HorizontalPanel hpItemsNumber;
private Button btnAddAdmin;
public GxtBottomToolBarItem(){
super();
@ -114,6 +119,20 @@ public class GxtBottomToolBarItem extends ToolBar{
}
});
btnAddAdmin = new Button(ADD_ADMINISTRATOR);
btnAddAdmin.setIcon(Resources.getIconAddAdministrator());
btnAddAdmin.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
AppController.getEventBus().fireEvent(new AddAdministratorEvent(null));
}
});
setVisibleAddAdministrators(false);
aclDivInfo = new ACLDivInfo("", null);
//COMMENTED AT 29/08/2013
@ -148,12 +167,17 @@ public class GxtBottomToolBarItem extends ToolBar{
FillToolItem filler = new FillToolItem();
filler.setId("filler-item");
add(filler);
add(btnAddAdmin);
add(aclDivInfo);
enableInfoHistoryButtons(false);
}
private void setVisibleAddAdministrators(boolean bool){
btnAddAdmin.setVisible(bool);
}
public void resetDetails(){
@ -194,12 +218,18 @@ public class GxtBottomToolBarItem extends ToolBar{
public void updateACLInfo(WorkspaceACL acl){
setVisibleAddAdministrators(false);
if(acl==null){
aclDivInfo.updateInfo(null, null);
return;
}
AbstractImagePrototype img = GetPermissionIconByACL.getImage(acl);
if(acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
setVisibleAddAdministrators(true);
}
aclDivInfo.updateInfo(acl.getLabel(), img);
this.layout();
}

View File

@ -34,6 +34,11 @@
<url-pattern>/FileUpload/upload</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>workspacesharing</servlet-name>
<servlet-class>org.gcube.portlets.widgets.workspacesharingwidget.server.WorkspaceSharingServiceImpl</servlet-class>
</servlet>
<!-- END DO NOT CHANGE -->
<servlet>
@ -46,21 +51,20 @@
<url-pattern>/workspace/UploadService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LocalUploadService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.LocalUploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>workspacesharing</servlet-name>
<url-pattern>/workspace/workspacesharing</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LocalUploadService</servlet-name>
<url-pattern>/workspace/LocalUploadService</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>LocalUploadService</servlet-name>
<servlet-class>org.gcube.portlets.user.workspace.server.LocalUploadServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>DownloadService</servlet-name>