428: TDM - Support the new Workspace Explorer
Task-Url: https://support.d4science.org/issues/428 Updated support to workspace explorer git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@117639 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ea6c56c885
commit
457ecb5d60
17
pom.xml
17
pom.xml
|
@ -42,13 +42,13 @@
|
||||||
<templatesDirectory>templates</templatesDirectory>
|
<templatesDirectory>templates</templatesDirectory>
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<configDirectory>config</configDirectory>
|
<configDirectory>config</configDirectory>
|
||||||
|
|
||||||
<!-- Next -->
|
<!-- Next -->
|
||||||
<gwtVersion>2.6.1</gwtVersion>
|
<gwtVersion>2.6.1</gwtVersion>
|
||||||
<gwtLogVersion>3.3.2</gwtLogVersion>
|
<gwtLogVersion>3.3.2</gwtLogVersion>
|
||||||
<gxtVersion>3.1.1</gxtVersion>
|
<gxtVersion>3.1.1</gxtVersion>
|
||||||
|
|
||||||
|
|
||||||
<KEYS>${env.KEYS}</KEYS>
|
<KEYS>${env.KEYS}</KEYS>
|
||||||
<!-- GWT needs at least java 1.5 -->
|
<!-- GWT needs at least java 1.5 -->
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- tabular-data-monitor-widget -->
|
<!-- tabular-data-monitor-widget -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
@ -131,10 +131,11 @@
|
||||||
<!-- WSLT dependencies -->
|
<!-- WSLT dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>workspace-light-tree</artifactId>
|
<artifactId>workspace-explorer</artifactId>
|
||||||
<version>[2.13.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>home-library</artifactId>
|
<artifactId>home-library</artifactId>
|
||||||
|
|
|
@ -11,16 +11,19 @@ import com.google.web.bindery.event.shared.EventBus;
|
||||||
public class CSVExportWizardTD extends WizardWindow {
|
public class CSVExportWizardTD extends WizardWindow {
|
||||||
|
|
||||||
protected CSVExportSession exportSession;
|
protected CSVExportSession exportSession;
|
||||||
|
protected String WIZARDWIDTH = "844px";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The id of the {@link CSVTarget} to use.
|
|
||||||
*
|
*
|
||||||
* @param targetId
|
* @param title
|
||||||
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public CSVExportWizardTD(String title, EventBus eventBus) {
|
public CSVExportWizardTD(String title, EventBus eventBus) {
|
||||||
super(title, eventBus);
|
super(title, eventBus);
|
||||||
|
setWidth(WIZARDWIDTH);
|
||||||
|
|
||||||
|
|
||||||
exportSession = new CSVExportSession();
|
exportSession = new CSVExportSession();
|
||||||
|
|
||||||
CSVExportConfigCard csvExportConfigCard = new CSVExportConfigCard(
|
CSVExportConfigCard csvExportConfigCard = new CSVExportConfigCard(
|
||||||
|
|
|
@ -6,13 +6,12 @@ package org.gcube.portlets.user.td.csvexportwidget.client;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.csvexportwidget.client.workspace.WorkspacePanel;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.widgets.lighttree.client.Item;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.lighttree.client.ItemType;
|
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectPanel;
|
||||||
import org.gcube.portlets.widgets.lighttree.client.event.ItemSelectionEvent;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
import org.gcube.portlets.widgets.lighttree.client.event.ItemSelectionHandler;
|
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
|
@ -34,15 +33,14 @@ import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
|
||||||
*/
|
*/
|
||||||
public class CSVWorkSpaceSelectionCard extends WizardCard {
|
public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
|
|
||||||
protected CSVExportSession exportSession;
|
private CSVExportSession exportSession;
|
||||||
protected CSVWorkSpaceSelectionCard thisCard;
|
private CSVWorkSpaceSelectionCard thisCard;
|
||||||
protected TextField fileName;
|
private TextField fileName;
|
||||||
protected TextField fileDescription;
|
private TextField fileDescription;
|
||||||
|
|
||||||
protected Item item;
|
private VerticalLayoutContainer p;
|
||||||
protected VerticalLayoutContainer p;
|
private WorkspaceExplorerSelectPanel wpanel;
|
||||||
protected WorkspacePanel wpanel;
|
|
||||||
|
|
||||||
public CSVWorkSpaceSelectionCard(final CSVExportSession exportSession) {
|
public CSVWorkSpaceSelectionCard(final CSVExportSession exportSession) {
|
||||||
super("CSV Export in Workspace", "");
|
super("CSV Export in Workspace", "");
|
||||||
|
|
||||||
|
@ -67,7 +65,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
fileName.setAllowBlank(false);
|
fileName.setAllowBlank(false);
|
||||||
fileName.setWidth("410px");
|
fileName.setWidth("410px");
|
||||||
fileName.setValue(fileN);
|
fileName.setValue(fileN);
|
||||||
p.add(new FieldLabel(fileName, "Name"), new VerticalLayoutData(-1,
|
p.add(new FieldLabel(fileName, "Name"), new VerticalLayoutData(1,
|
||||||
-1));
|
-1));
|
||||||
|
|
||||||
fileDescription = new TextField();
|
fileDescription = new TextField();
|
||||||
|
@ -76,33 +74,52 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
fileDescription.setWidth("410px");
|
fileDescription.setWidth("410px");
|
||||||
fileDescription.setValue("csv");
|
fileDescription.setValue("csv");
|
||||||
p.add(new FieldLabel(fileDescription, "Description"),
|
p.add(new FieldLabel(fileDescription, "Description"),
|
||||||
new VerticalLayoutData(-1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
Log.debug("Set Workspace Panel");
|
Log.debug("Set Workspace Panel");
|
||||||
wpanel = new WorkspacePanel();
|
List<ItemType> selectableTypes = new ArrayList<ItemType>();
|
||||||
wpanel.setSpWidth("410px");
|
selectableTypes.add(ItemType.FOLDER);
|
||||||
wpanel.setSpHeight("330px");
|
List<ItemType> showableTypes = new ArrayList<ItemType>();
|
||||||
List<ItemType> lItemType = new ArrayList<ItemType>();
|
showableTypes.add(ItemType.FOLDER);
|
||||||
lItemType.add(ItemType.ROOT);
|
|
||||||
lItemType.add(ItemType.FOLDER);
|
wpanel = new WorkspaceExplorerSelectPanel(new String(
|
||||||
wpanel.setShowableTypes(lItemType);
|
"Workspace Selection"),selectableTypes, showableTypes);
|
||||||
wpanel.setSelectableTypes(lItemType);
|
|
||||||
wpanel.addSelectionHandler(new ItemSelectionHandler() {
|
|
||||||
|
|
||||||
public void onSelection(ItemSelectionEvent event) {
|
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
item = event.getSelectedItem();
|
|
||||||
|
@Override
|
||||||
|
public void onSelectedItem(Item item) {
|
||||||
Log.debug("Selected Item:" + item);
|
Log.debug("Selected Item:" + item);
|
||||||
if (item.getType() == ItemType.FOLDER
|
if (item.getType() == ItemType.FOLDER) {
|
||||||
|| item.getType() == ItemType.ROOT) {
|
|
||||||
thisCard.exportSession.setItemId(item.getId());
|
thisCard.exportSession.setItemId(item.getId());
|
||||||
} else {
|
} else {
|
||||||
thisCard.exportSession.setItemId(null);
|
thisCard.exportSession.setItemId(null);
|
||||||
Log.debug("Item type:" + item.getType());
|
Log.debug("Item type:" + item.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
p.add(new FieldLabel(wpanel, "Folder"), new VerticalLayoutData(-1, -1));
|
@Override
|
||||||
wpanel.loadTree();
|
public void onFailed(Throwable throwable) {
|
||||||
|
Log.error("Error in workspaceExplorer: "
|
||||||
|
+ throwable.getLocalizedMessage());
|
||||||
|
throwable.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAborted() {
|
||||||
|
Log.debug("WorkspaceExplorer Aborted");
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
wpanel.addWorkspaceExplorerSelectNotificationListener(handler);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
p.add(new FieldLabel(wpanel, "Folder"), new VerticalLayoutData(1, 1));
|
||||||
setContent(formPanel);
|
setContent(formPanel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -110,7 +127,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
protected void checkExportData() {
|
protected void checkExportData() {
|
||||||
Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: "
|
Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: "
|
||||||
+ exportSession.getItemId());
|
+ exportSession.getItemId());
|
||||||
wpanel.disable();
|
|
||||||
fileName.disable();
|
fileName.disable();
|
||||||
getWizardWindow().setEnableNextButton(false);
|
getWizardWindow().setEnableNextButton(false);
|
||||||
getWizardWindow().setEnableBackButton(false);
|
getWizardWindow().setEnableBackButton(false);
|
||||||
|
@ -118,7 +134,6 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
HideHandler hideHandler = new HideHandler() {
|
HideHandler hideHandler = new HideHandler() {
|
||||||
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
wpanel.enable();
|
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
getWizardWindow().setEnableBackButton(true);
|
getWizardWindow().setEnableBackButton(true);
|
||||||
fileName.enable();
|
fileName.enable();
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.csvexportwidget.client.workspace;
|
|
||||||
|
|
||||||
import org.gcube.portlets.widgets.lighttree.client.WorkspaceLightTreePanel;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
|
||||||
import com.sencha.gxt.widget.core.client.box.AutoProgressMessageBox;
|
|
||||||
import com.sencha.gxt.widget.core.client.event.DisableEvent;
|
|
||||||
import com.sencha.gxt.widget.core.client.event.EnableEvent;
|
|
||||||
|
|
||||||
public class WorkspacePanel extends WorkspaceLightTreePanel {
|
|
||||||
|
|
||||||
AutoProgressMessageBox box;
|
|
||||||
|
|
||||||
public void setSpWidth(String w) {
|
|
||||||
sp.setWidth(w);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpHeight(String h) {
|
|
||||||
sp.setHeight(h);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void disable() {
|
|
||||||
Log.debug("WorkspacePanel Disable");
|
|
||||||
fireEvent(new DisableEvent());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void enable() {
|
|
||||||
Log.debug("WorkspacePanel Enable");
|
|
||||||
fireEvent(new EnableEvent());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void startWaiting() {
|
|
||||||
box= new AutoProgressMessageBox("Loading",
|
|
||||||
"Retriving data from workspace, please wait...");
|
|
||||||
box.setProgressText("Loading...");
|
|
||||||
box.setModal(false);
|
|
||||||
box.auto();
|
|
||||||
box.show();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void endWaiting() {
|
|
||||||
box.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -21,6 +21,7 @@
|
||||||
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
||||||
|
|
||||||
|
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry' /> -->
|
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry' /> -->
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- Consider inlining CSS to reduce the number of requested files -->
|
<!-- Consider inlining CSS to reduce the number of requested files -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<link type="text/css" rel="stylesheet" href="SDMXImportWizardTD.css">
|
<link type="text/css" rel="stylesheet" href="CSVExportWizardTD.css">
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- Any title is fine -->
|
<!-- Any title is fine -->
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<!-- If you add any GWT meta tags, they must -->
|
<!-- If you add any GWT meta tags, they must -->
|
||||||
<!-- be added before this line. -->
|
<!-- be added before this line. -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<script type="text/javascript" language="javascript" src="SDMXImportWizardTD/SDMXImportWizardTD.nocache.js"></script>
|
<script type="text/javascript" language="javascript" src="CSVExportWizardTD/CSVExportWizardTD.nocache.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
|
@ -15,20 +15,33 @@
|
||||||
<servlet-name>jUnitHostImpl</servlet-name>
|
<servlet-name>jUnitHostImpl</servlet-name>
|
||||||
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
|
<servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>workspaceExplorer</servlet-name>
|
||||||
|
<servlet-class>org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
|
||||||
<!-- Servlets Mapping -->
|
<!-- Servlets Mapping -->
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>TDGWTService</servlet-name>
|
<servlet-name>TDGWTService</servlet-name>
|
||||||
<url-pattern>tdgwtservice/TDGWTService</url-pattern>
|
<url-pattern>/CSVExportWizardTD/TDGWTService</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>jUnitHostImpl</servlet-name>
|
<servlet-name>jUnitHostImpl</servlet-name>
|
||||||
<url-pattern>CSVImportWizardTDManagerWidgets/junithost/*</url-pattern>
|
<url-pattern>/CSVExportWizardTD/junithost/*</url-pattern>
|
||||||
|
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>workspaceExplorer</servlet-name>
|
||||||
|
<url-pattern>/CSVExportWizardTD/WorkspaceExplorerService</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Default page to serve -->
|
<!-- Default page to serve -->
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>CSVImportWizardTD.html</welcome-file>
|
<welcome-file>CSVExportWizardTD.html</welcome-file>
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
Loading…
Reference in New Issue