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:
parent
3d64f79a4b
commit
42789bb5e7
|
@ -3,6 +3,6 @@
|
||||||
>>>>>>>=.r93212
|
>>>>>>>=.r93212
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
jarsExcludedFromWebInfLib=
|
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
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
|
@ -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">
|
<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>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</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="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="workspace"/>
|
<property name="context-root" value="workspace"/>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -11,7 +11,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>workspace</artifactId>
|
<artifactId>workspace</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>6.9.0-SNAPSHOT</version>
|
<version>6.10.0-SNAPSHOT</version>
|
||||||
<name>gCube Workspace Portlet</name>
|
<name>gCube Workspace Portlet</name>
|
||||||
<description>
|
<description>
|
||||||
gcube Workspace Portlet is a portlet for users workspace management
|
gcube Workspace Portlet is a portlet for users workspace management
|
||||||
|
|
|
@ -1091,6 +1091,8 @@ public class AppController implements SubscriberInterface {
|
||||||
GWT.log("Updated Breadcrumb for : "+parent);
|
GWT.log("Updated Breadcrumb for : "+parent);
|
||||||
|
|
||||||
if(parent!=null){
|
if(parent!=null){
|
||||||
|
wsPortlet.getBorderLayoutContainer().updateParentId(parent.getIdentifier());
|
||||||
|
|
||||||
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB
|
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB
|
||||||
setACLInfo(parent.getIdentifier());
|
setACLInfo(parent.getIdentifier());
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
|
||||||
|
@ -1102,9 +1104,10 @@ public class AppController implements SubscriberInterface {
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
|
||||||
setACLInfo(null); //IS NOT A SHARE FOLDER DOSN'T DISPLAY ACL INFO
|
setACLInfo(null); //IS NOT A SHARE FOLDER DOSN'T DISPLAY ACL INFO
|
||||||
}
|
}
|
||||||
}else
|
}else{
|
||||||
|
wsPortlet.getBorderLayoutContainer().updateParentId(null);
|
||||||
setACLInfo(null);
|
setACLInfo(null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.NumericFilter;
|
||||||
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
|
import com.extjs.gxt.ui.client.widget.grid.filters.StringFilter;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
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.DateTimeFormat;
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
import com.google.gwt.i18n.client.NumberFormat;
|
||||||
|
import com.google.gwt.user.client.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
@ -70,7 +72,8 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
private final Grid<FileGridModel> grid;
|
private final Grid<FileGridModel> grid;
|
||||||
|
|
||||||
public GxtGridFilterGroupPanel(boolean group) {
|
public GxtGridFilterGroupPanel(boolean group) {
|
||||||
setLayout(new FitLayout());
|
// setLayout(new FitLayout());
|
||||||
|
setId("GxtGridFilterGroupPanel "+Random.nextInt());
|
||||||
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
|
ColumnConfig icon = new ColumnConfig(ConstantsExplorer.ICON, "", 25);
|
||||||
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 300);
|
ColumnConfig name = new ColumnConfig(ConstantsExplorer.NAME, ConstantsExplorer.NAME, 300);
|
||||||
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 50);
|
ColumnConfig type = new ColumnConfig(ConstantsExplorer.TYPE, ConstantsExplorer.TYPE, 50);
|
||||||
|
@ -559,4 +562,19 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
return -1;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -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.ConstantsPortlet;
|
||||||
import org.gcube.portlets.user.workspace.client.view.ExplorerPanel;
|
import org.gcube.portlets.user.workspace.client.view.ExplorerPanel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtBottomToolBarItem;
|
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.LayoutRegion;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
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.BoxComponentEvent;
|
||||||
import com.extjs.gxt.ui.client.event.Events;
|
import com.extjs.gxt.ui.client.event.Events;
|
||||||
import com.extjs.gxt.ui.client.event.Listener;
|
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.BorderLayout;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||||
|
import com.google.gwt.core.shared.GWT;
|
||||||
|
import com.google.gwt.user.client.Random;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,6 +37,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
private GxtSeachAndFilterPanel searchAndFilterContainer;
|
private GxtSeachAndFilterPanel searchAndFilterContainer;
|
||||||
private GxtCardLayoutResultPanel gxtCardLayoutResultPanel;
|
private GxtCardLayoutResultPanel gxtCardLayoutResultPanel;
|
||||||
|
|
||||||
|
private DNDFileReader dnd = new DNDFileReader();
|
||||||
|
|
||||||
|
|
||||||
public GxtBorderLayoutPanel(
|
public GxtBorderLayoutPanel(
|
||||||
GxtSeachAndFilterPanel searchAndFilterContainer2,
|
GxtSeachAndFilterPanel searchAndFilterContainer2,
|
||||||
|
@ -45,6 +53,36 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
|
|
||||||
this.initLayout();
|
this.initLayout();
|
||||||
this.createLayouts();
|
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(){
|
private void initLayout(){
|
||||||
|
@ -134,12 +172,34 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
public void handleEvent(BoxComponentEvent be) {
|
public void handleEvent(BoxComponentEvent be) {
|
||||||
|
|
||||||
toolBarItemDetails.refreshSize();
|
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.toolbarContainer);
|
||||||
|
|
||||||
center.add(this.gxtCardLayoutResultPanel);
|
center.setId("Center Panel "+Random.nextInt());
|
||||||
|
dnd.addUniqueContainer(this.gxtCardLayoutResultPanel);
|
||||||
|
center.add(dnd);
|
||||||
|
|
||||||
// south.add(this.toolBarItemDetails);
|
// south.add(this.toolBarItemDetails);
|
||||||
|
|
||||||
|
@ -163,4 +223,9 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
add(east, eastData);
|
add(east, eastData);
|
||||||
// add(south, southData);
|
// add(south, southData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateParentId(String parentId){
|
||||||
|
dnd.setParameters(parentId, UPLOAD_TYPE.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.CardLayout;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||||
import com.google.gwt.user.client.Element;
|
import com.google.gwt.user.client.Element;
|
||||||
|
import com.google.gwt.user.client.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
@ -22,6 +23,7 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
|
||||||
private GxtItemsPanel itemPanel;
|
private GxtItemsPanel itemPanel;
|
||||||
private GxtListView iconsViewContainer;
|
private GxtListView iconsViewContainer;
|
||||||
private GxtGridFilterGroupPanel gridGroupViewContainer;
|
private GxtGridFilterGroupPanel gridGroupViewContainer;
|
||||||
|
|
||||||
private ContentPanel activePanel = null;
|
private ContentPanel activePanel = null;
|
||||||
private GxtToolBarItemFunctionality toolBarItemFunct;
|
private GxtToolBarItemFunctionality toolBarItemFunct;
|
||||||
private GxtBottomToolBarItem toolBarItemDetails;
|
private GxtBottomToolBarItem toolBarItemDetails;
|
||||||
|
@ -49,11 +51,16 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
|
||||||
super.onRender(parent, pos);
|
super.onRender(parent, pos);
|
||||||
setLayout(new FitLayout());
|
setLayout(new FitLayout());
|
||||||
|
|
||||||
|
setId("GxtCardLayoutResultPanel "+Random.nextInt());
|
||||||
|
setHeight("auto");
|
||||||
|
|
||||||
ContentPanel cp = new ContentPanel();
|
ContentPanel cp = new ContentPanel();
|
||||||
cp.setHeaderVisible(false);
|
cp.setHeaderVisible(false);
|
||||||
cp.setLayout(cardLayout);
|
cp.setLayout(cardLayout);
|
||||||
|
cp.setHeight("auto");
|
||||||
|
cp.setId("GxtCardLayoutResultPanel Content Panel "+Random.nextInt());
|
||||||
cp.add(itemPanel);
|
cp.add(itemPanel);
|
||||||
|
cp.setHeight("auto");
|
||||||
|
|
||||||
cardLayout.setActiveItem(itemPanel);
|
cardLayout.setActiveItem(itemPanel);
|
||||||
activePanel = itemPanel;
|
activePanel = itemPanel;
|
||||||
|
@ -64,13 +71,10 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
|
||||||
|
|
||||||
public void setActivePanel(ViewSwitchTypeInResult type){
|
public void setActivePanel(ViewSwitchTypeInResult type){
|
||||||
|
|
||||||
|
|
||||||
if(type.equals(ViewSwitchTypeInResult.Group) ){
|
if(type.equals(ViewSwitchTypeInResult.Group) ){
|
||||||
cardLayout.setActiveItem(itemPanel);
|
cardLayout.setActiveItem(itemPanel);
|
||||||
activePanel = itemPanel;
|
activePanel = itemPanel;
|
||||||
// toolBar.setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
|
// public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
|
||||||
|
@ -98,4 +102,11 @@ public class GxtCardLayoutResultPanel extends LayoutContainer{
|
||||||
return toolBarItemDetails;
|
return toolBarItemDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the gridGroupViewContainer
|
||||||
|
*/
|
||||||
|
public GxtGridFilterGroupPanel getGridGroupViewContainer() {
|
||||||
|
return gridGroupViewContainer;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.ContentPanel;
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||||
|
import com.google.gwt.user.client.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
@ -24,6 +25,7 @@ public class GxtItemsPanel extends ContentPanel{
|
||||||
this.gridGroupViewContainer = gridGroupViewContainer;
|
this.gridGroupViewContainer = gridGroupViewContainer;
|
||||||
this.toolBarItemFunct = toolBarItem;
|
this.toolBarItemFunct = toolBarItem;
|
||||||
this.toolBarItemDetails = toolBarItemDetails;
|
this.toolBarItemDetails = toolBarItemDetails;
|
||||||
|
this.setId("GxtItemsPanel "+Random.nextInt());
|
||||||
setBorders(false);
|
setBorders(false);
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
|
|
||||||
<inherits name='org.gcube.portlets.widgets.fileupload.FileUpload' />
|
<inherits name='org.gcube.portlets.widgets.fileupload.FileUpload' />
|
||||||
<inherits name='org.gcube.portlets.widgets.sessionchecker.SessionChecker' />
|
<inherits name='org.gcube.portlets.widgets.sessionchecker.SessionChecker' />
|
||||||
|
|
||||||
|
<inherits name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader"></inherits>
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<entry-point
|
<entry-point
|
||||||
class='org.gcube.portlets.user.workspace.client.WorkspacePortlet' />
|
class='org.gcube.portlets.user.workspace.client.WorkspacePortlet' />
|
||||||
|
|
Loading…
Reference in New Issue