553: Workspace: Drag Files Into the Workspace from the Desktop

Task-Url: https://support.d4science.org/issues/553

Workspace Portlet has been integrated with DND (workspace-uploader)

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@119985 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-10-22 16:52:12 +00:00
parent 3d64f79a4b
commit 42789bb5e7
9 changed files with 117 additions and 12 deletions

View File

@ -3,6 +3,6 @@
>>>>>>>=.r93212
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/francesco-mangiacrapa/wseclipse/workspace(trunk)/target/workspace-6.7.1-SNAPSHOT
lastWarOutDir=/home/francesco-mangiacrapa/wseclipseluna/workspace-TRUNK/target/workspace-6.9.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -8,6 +8,9 @@
<dependent-module archiveName="workspace-tree-widget-6.9.0-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-uploader-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-uploader-PRIVATE-1.0.0-SNAPSHOT/workspace-uploader-PRIVATE-1.0.0-SNAPSHOT">
<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

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId>
<packaging>war</packaging>
<version>6.9.0-SNAPSHOT</version>
<version>6.10.0-SNAPSHOT</version>
<name>gCube Workspace Portlet</name>
<description>
gcube Workspace Portlet is a portlet for users workspace management

View File

@ -1091,6 +1091,8 @@ public class AppController implements SubscriberInterface {
GWT.log("Updated Breadcrumb for : "+parent);
if(parent!=null){
wsPortlet.getBorderLayoutContainer().updateParentId(parent.getIdentifier());
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB
setACLInfo(parent.getIdentifier());
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
@ -1102,9 +1104,10 @@ public class AppController implements SubscriberInterface {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
setACLInfo(null); //IS NOT A SHARE FOLDER DOSN'T DISPLAY ACL INFO
}
}else
}else{
wsPortlet.getBorderLayoutContainer().updateParentId(null);
setACLInfo(null);
}
}

View File

@ -50,8 +50,10 @@ import com.extjs.gxt.ui.client.widget.grid.filters.GridFilters;
import com.extjs.gxt.ui.client.widget.grid.filters.NumericFilter;
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Random;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
@ -70,7 +72,8 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
private final Grid<FileGridModel> grid;
public GxtGridFilterGroupPanel(boolean group) {
setLayout(new FitLayout());
// setLayout(new FitLayout());
setId("GxtGridFilterGroupPanel "+Random.nextInt());
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 300);
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 50);
@ -558,5 +561,20 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
return -1;
}
/**
*
*/
public void refreshSize(String width, String height) {
// if(this.isRendered()){
// GWT.log("refresh size grid "+height);
// this.setHeight(height);
// }
GWT.log("refresh size grid "+width +"; heigth: "+height);
this.setSize(width, height);
cp.setSize(width, height);
grid.setSize(width, height);
}
}

View File

@ -3,9 +3,13 @@ package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.view.ExplorerPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtBottomToolBarItem;
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.DNDFileReader;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.BoxComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
@ -14,6 +18,8 @@ import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.Random;
/**
@ -30,6 +36,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
private ExplorerPanel expPanel = null; //TODO change position
private GxtSeachAndFilterPanel searchAndFilterContainer;
private GxtCardLayoutResultPanel gxtCardLayoutResultPanel;
private DNDFileReader dnd = new DNDFileReader();
public GxtBorderLayoutPanel(
@ -45,6 +53,36 @@ public class GxtBorderLayoutPanel extends ContentPanel {
this.initLayout();
this.createLayouts();
WorskpaceUploadNotificationListener listener = new WorskpaceUploadNotificationListener() {
@Override
public void onUploadCompleted(String parentId, String itemId) {
// TODO Auto-generated method stub
}
@Override
public void onUploadAborted(String parentId, String itemId) {
// TODO Auto-generated method stub
}
@Override
public void onOverwriteCompleted(String parentId, String itemId) {
// TODO Auto-generated method stub
}
@Override
public void onError(String parentId, String itemId, Throwable throwable) {
// TODO Auto-generated method stub
}
};
dnd.addWorkspaceUploadNotificationListener(listener);
}
private void initLayout(){
@ -134,12 +172,34 @@ public class GxtBorderLayoutPanel extends ContentPanel {
public void handleEvent(BoxComponentEvent be) {
toolBarItemDetails.refreshSize();
gxtCardLayoutResultPanel.setSize(center.getWidth()-2, center.getHeight());
// GWT.log("gxtCardLayoutResultPanel new width "+newHeight);
gxtCardLayoutResultPanel.getGridGroupViewContainer().refreshSize((center.getWidth()-2)+"px", (center.getHeight()-50)+"px");
}
});
gxtCardLayoutResultPanel.addListener(Events.Render, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
gxtCardLayoutResultPanel.setSize(center.getWidth(), center.getHeight());
}
});
gxtCardLayoutResultPanel.getGridGroupViewContainer().addListener(Events.Render, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
GWT.log("gxtCardLayoutResultPanel render");
gxtCardLayoutResultPanel.getGridGroupViewContainer().refreshSize((center.getWidth()-2)+"px", (center.getHeight()-50)+"px");
}
});
// center.add(this.toolbarContainer);
center.add(this.gxtCardLayoutResultPanel);
center.setId("Center Panel "+Random.nextInt());
dnd.addUniqueContainer(this.gxtCardLayoutResultPanel);
center.add(dnd);
// south.add(this.toolBarItemDetails);
@ -163,4 +223,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
add(east, eastData);
// add(south, southData);
}
public void updateParentId(String parentId){
dnd.setParameters(parentId, UPLOAD_TYPE.File);
}
}

View File

@ -11,6 +11,7 @@ import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.CardLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Random;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
@ -22,6 +23,7 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
private GxtItemsPanel itemPanel;
private GxtListView iconsViewContainer;
private GxtGridFilterGroupPanel gridGroupViewContainer;
private ContentPanel activePanel = null;
private GxtToolBarItemFunctionality toolBarItemFunct;
private GxtBottomToolBarItem toolBarItemDetails;
@ -48,12 +50,17 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
setLayout(new FitLayout());
setId("GxtCardLayoutResultPanel "+Random.nextInt());
setHeight("auto");
ContentPanel cp = new ContentPanel();
cp.setHeaderVisible(false);
cp.setLayout(cardLayout);
cp.setHeight("auto");
cp.setId("GxtCardLayoutResultPanel Content Panel "+Random.nextInt());
cp.add(itemPanel);
cp.setHeight("auto");
cardLayout.setActiveItem(itemPanel);
activePanel = itemPanel;
@ -63,14 +70,11 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
};
public void setActivePanel(ViewSwitchTypeInResult type){
if(type.equals(ViewSwitchTypeInResult.Group) ){
cardLayout.setActiveItem(itemPanel);
activePanel = itemPanel;
// toolBar.setEnabled(true);
}
}
// public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
@ -97,5 +101,12 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
public GxtBottomToolBarItem getToolBarItemDetails() {
return toolBarItemDetails;
}
/**
* @return the gridGroupViewContainer
*/
public GxtGridFilterGroupPanel getGridGroupViewContainer() {
return gridGroupViewContainer;
}
}

View File

@ -7,6 +7,7 @@ import org.gcube.portlets.user.workspace.client.view.toolbars.GxtToolBarItemFunc
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.Random;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
@ -24,6 +25,7 @@ public class GxtItemsPanel extends ContentPanel{
this.gridGroupViewContainer = gridGroupViewContainer;
this.toolBarItemFunct = toolBarItem;
this.toolBarItemDetails = toolBarItemDetails;
this.setId("GxtItemsPanel "+Random.nextInt());
setBorders(false);
setBodyBorder(false);
setHeaderVisible(false);

View File

@ -25,6 +25,9 @@
<inherits name='org.gcube.portlets.widgets.fileupload.FileUpload' />
<inherits name='org.gcube.portlets.widgets.sessionchecker.SessionChecker' />
<inherits name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader"></inherits>
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.user.workspace.client.WorkspacePortlet' />