Integred with Task Executor Widget

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@168969 82a268e6-3cf1-43bd-a215-b396298e98cf
task/19600
Francesco Mangiacrapa 6 years ago
parent a34ae883a9
commit 34307c8ccf

@ -1,13 +1,19 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-21-0"
date="2018-06-07">
<Change>Integrated with Task Executor Widget</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-20-1"
date="2018-04-19">
<Change>Managed case of Exception in order to avoid failure on checkItemLocked</Change>
<Change>Managed case of Exception in order to avoid failure on
checkItemLocked</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-20-0"
date="2018-03-01">
<Change>[Task #11127] Porting to new ws-thredds engine</Change>
<Change>[Feature #11325] Workspace: add New URL feature in the context
menu of right pane</Change>
menu of right pane
</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.workspace-portlet-tree.6-19-0"
date="2018-01-09">

@ -10,7 +10,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace-tree-widget</artifactId>
<version>6.20.1-SNAPSHOT</version>
<version>6.21.0-SNAPSHOT</version>
<name>gCube Workspace Tree Widget</name>
<description>
gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace
@ -203,6 +203,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ws-task-executor-widget</artifactId>
<version>[0.0.1-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>

@ -32,6 +32,10 @@
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<inherits name='org.gcube.portlets.widgets.wsthreddssync.WsThreddsWidget' />
<inherits
name="org.gcube.portlets.widgets.wstaskexecutor.WsTaskExecutorWidget" />
<!-- Specify the application specific style sheet. -->
<stylesheet src='workspacetree.css' />

@ -35,6 +35,8 @@ import org.gcube.portlets.user.workspace.client.event.DeleteSmartFolderEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteSmartFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.EditUserPermissionEvent;
import org.gcube.portlets.user.workspace.client.event.EditUserPermissionEventHandler;
import org.gcube.portlets.user.workspace.client.event.ExecuteDataMinerTaskEvent;
import org.gcube.portlets.user.workspace.client.event.ExecuteDataMinerTaskEventHandler;
import org.gcube.portlets.user.workspace.client.event.ExpandFolderEvent;
import org.gcube.portlets.user.workspace.client.event.ExpandFolderEventHandler;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
@ -154,6 +156,8 @@ import org.gcube.portlets.widgets.workspacesharingwidget.client.view.sharing.mul
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.MultipleDilaogUpload;
import org.gcube.portlets.widgets.wstaskexecutor.client.WsTaskExecutorWidget;
import org.gcube.portlets.widgets.wstaskexecutor.shared.WSItem;
import org.gcube.portlets.widgets.wsthreddssync.client.SyncCompletedNotification.SyncCompletedNotificationListner;
import org.gcube.portlets.widgets.wsthreddssync.client.WsThreddsWidget;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsFolder;
@ -201,6 +205,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
private Map<String, String> msgFolderSynched = new HashMap<String,String>();
private WsThreddsWidget wsThreddsWidget = new WsThreddsWidget();
private WsTaskExecutorWidget taskExecutor = new WsTaskExecutorWidget();
/**
* Instantiates a new app controller explorer.
@ -437,6 +442,24 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
});
eventBus.addHandler(ExecuteDataMinerTaskEvent.TYPE, new ExecuteDataMinerTaskEventHandler() {
@Override
public void onExecuteDMTask(ExecuteDataMinerTaskEvent executeDataMinerTaskEvent) {
if(executeDataMinerTaskEvent.getTargetFileModel()!=null){
WSItem wsItem = new WSItem(executeDataMinerTaskEvent.getTargetFileModel().getIdentifier(), executeDataMinerTaskEvent.getTargetFileModel().getName());
try {
taskExecutor.showTaskConfigurations(wsItem);
}
catch (Exception e) {
Window.alert(e.getMessage());
}
}
}
});
eventBus.addHandler(UpdateWorkspaceSizeEvent.TYPE, new UpdateWorkspaceSizeEventHandler() {
@Override

@ -72,6 +72,7 @@ public class ConstantsExplorer {
public static final String MESSAGE_ADD_SUBJECT = "Add Subject";
public static final String HISTORY = "History";
public static final String ACCREAD = "Read";
public static final String MESSAGE_EXECUTE_DM_TASK = "Execute DM Task";
public static final String MESSAGE_ERROR_OCCURED = "Sorry an error has occurred while processing your request";
public static final String INFO = "Info";
public static final String MESSAGE_SEND_TO_OK = "Your message has been successfully delivered";
@ -259,6 +260,7 @@ public static enum WS_UPLOAD_TYPE {File, Archive};
public static final String MSG_FOLDER_LOCKED_BY_SYNC= "is under synchronization process.\nPlease be aware that some operations are not currently available and that the content might change during this process.";
/**
* Log.
*

@ -1,63 +1,62 @@
package org.gcube.portlets.user.workspace.client.constant;
public enum WorkspaceOperation {
INSERT_FOLDER("INS", "INS"), // Insert Folder
ADD_ITEM("ADD", "ADD"), // Add Folder
REMOVE("REM", "REM"),
UPLOAD_FILE("UPL", "UPL"),
DOWNLOAD("DWL", "DWL"),
PREVIEW("PRW", "PRW"),
RENAME("RNM", "RNM"),
INSERT_SHARED_FOLDER("ISHF", "ASHF"), // Insert shared Folder
PUBLISH_ON_DATA_CATALOGUE("PODC", "PODC"),
PUBLISH_ON_THREDDS("POTD", "POTD"),
SHARE("SHR", "SHR"), // SHARE
UNSHARE("USHR", "USHR"), // UNSHARE
UPLOAD_ARCHIVE("UPA", "UPA"), // Upload Archive
LINK("LNK", "LNK"),
SHOW("SHW", "SHW"), // SHOW
ADD_URL("CLK", "CLK"), // Add Url
// OPEN_REPORT_TEMPLATE("ORT", "ORT"), // Open report template
// OPEN_REPORT("ORP", "ORP"), // Open report
SENDTO("SDT", "SDT"), // Send to
GET_NEW_MESSAGES("DWM", "DWM"), // Get all new messages
CREATE_NEW_MESSAGE("CNM", "CNM"), // Create new message
MARK_AS_READ("MKR", "MKR"), // Mark as read
MARK_AS_UNREAD("MKNR", "MKNR"), // Mark as not read
DELETE_MESSAGE("DLM", "DLM"), // Delete message
FORWARD_MESSAGE("FWM", "FWM"), // Forward message
COPY("CPI", "CPI"), // copy item
PASTE("PSI", "PSI"), // paste
REFRESH_FOLDER("RFH", "RFH"), // Refresh
WEBDAV_URL("WDV", "WDV"), // WebDav
GET_INFO("GTI", "GTI"), // GET INFO
HISTORY("HST", "HST"), //HISTORY
ACCREAD("ACR", "ACR"), //ACCOUNTING READ
SHARE_LINK("SLK", "SLK"), //SHARE URL LINK
PUBLIC_LINK("PLK", "PLK"), //PUBLIC LINK
// ADD_ADMINISTRATOR("AAD", "AAD"), // ADD_ADMINISTRATOR
VRE_CHANGE_PERIMISSIONS("CHP", "CHP"),
EDIT_PERMISSIONS("EDP", "EDP"), //EDIT PERMISSIONS
FOLDER_LINK("FRL", "FRL"), //FOLDER LINK
FOLDER_LINK_REMOVE("FPR","FPR"),
VERSIONING("VRN", "VRN"); //VERSIONING
INSERT_FOLDER("INS", "INS"), // Insert Folder
ADD_ITEM("ADD", "ADD"), // Add Folder
REMOVE("REM", "REM"), UPLOAD_FILE("UPL", "UPL"),
DOWNLOAD("DWL", "DWL"), PREVIEW("PRW", "PRW"), RENAME("RNM", "RNM"),
INSERT_SHARED_FOLDER("ISHF", "ASHF"), // Insert shared Folder
PUBLISH_ON_DATA_CATALOGUE("PODC", "PODC"),
PUBLISH_ON_THREDDS("POTD", "POTD"),
SHARE("SHR", "SHR"), // SHARE
UNSHARE("USHR", "USHR"), // UNSHARE
UPLOAD_ARCHIVE("UPA", "UPA"), // Upload Archive
LINK("LNK", "LNK"),
SHOW("SHW", "SHW"), // SHOW
ADD_URL("CLK", "CLK"), // Add Url
// OPEN_REPORT_TEMPLATE("ORT", "ORT"), // Open report template
// OPEN_REPORT("ORP", "ORP"), // Open report
SENDTO("SDT", "SDT"), // Send to
GET_NEW_MESSAGES("DWM", "DWM"), // Get all new messages
CREATE_NEW_MESSAGE("CNM", "CNM"), // Create new message
MARK_AS_READ("MKR", "MKR"), // Mark as read
MARK_AS_UNREAD("MKNR", "MKNR"), // Mark as not read
DELETE_MESSAGE("DLM", "DLM"), // Delete message
FORWARD_MESSAGE("FWM", "FWM"), // Forward message
COPY("CPI", "CPI"), // copy item
PASTE("PSI", "PSI"), // paste
REFRESH_FOLDER("RFH", "RFH"), // Refresh
WEBDAV_URL("WDV", "WDV"), // WebDav
GET_INFO("GTI", "GTI"), // GET INFO
HISTORY("HST", "HST"), // HISTORY
ACCREAD("ACR", "ACR"), // ACCOUNTING READ
SHARE_LINK("SLK", "SLK"), // SHARE URL LINK
PUBLIC_LINK("PLK", "PLK"), // PUBLIC LINK
// ADD_ADMINISTRATOR("AAD", "AAD"), // ADD_ADMINISTRATOR
VRE_CHANGE_PERIMISSIONS("CHP", "CHP"),
EDIT_PERMISSIONS("EDP", "EDP"), // EDIT PERMISSIONS
FOLDER_LINK("FRL", "FRL"), // FOLDER LINK
FOLDER_LINK_REMOVE("FPR", "FPR"),
VERSIONING("VRN", "VRN"), // VERSIONING
EXECUTE_DM_TASK("EDT", "EDT"); //EXECUTE DM TASK
private String id; // ID CONTEXT MENU
private String name;
WorkspaceOperation(String id, String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
}

@ -0,0 +1,63 @@
package org.gcube.portlets.user.workspace.client.event;
import org.gcube.portlets.user.workspace.client.model.FileModel;
import com.google.gwt.event.shared.GwtEvent;
/**
* The Class ExecuteDataMinerTaskEvent.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 25, 2018
*/
public class ExecuteDataMinerTaskEvent extends
GwtEvent<ExecuteDataMinerTaskEventHandler> {
public static Type<ExecuteDataMinerTaskEventHandler> TYPE = new Type<ExecuteDataMinerTaskEventHandler>();
private FileModel targetFileModel;
/**
* Instantiates a new execute data miner task event.
*
* @param target the target
*/
public ExecuteDataMinerTaskEvent(FileModel target) {
this.setTargetFileModel(target);
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
*/
@Override
public Type<ExecuteDataMinerTaskEventHandler> getAssociatedType() {
return TYPE;
}
/* (non-Javadoc)
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
*/
@Override
protected void dispatch(ExecuteDataMinerTaskEventHandler handler) {
handler.onExecuteDMTask(this);
}
/**
* Gets the target file model.
*
* @return the targetFileModel
*/
public FileModel getTargetFileModel() {
return targetFileModel;
}
/**
* Sets the target file model.
*
* @param targetFileModel the targetFileModel to set
*/
public void setTargetFileModel(FileModel targetFileModel) {
this.targetFileModel = targetFileModel;
}
}

@ -0,0 +1,20 @@
package org.gcube.portlets.user.workspace.client.event;
import com.google.gwt.event.shared.EventHandler;
/**
* The Interface ExecuteDataMinerTaskEventHandler.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* May 25, 2018
*/
public interface ExecuteDataMinerTaskEventHandler extends EventHandler {
/**
* On execute dm task.
*
* @param executeDataMinerTaskEvent the execute data miner task event
*/
void onExecuteDMTask(ExecuteDataMinerTaskEvent executeDataMinerTaskEvent);
}

@ -16,6 +16,7 @@ import org.gcube.portlets.user.workspace.client.event.CreateSharedFolderEvent;
import org.gcube.portlets.user.workspace.client.event.CreateUrlEvent;
import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
import org.gcube.portlets.user.workspace.client.event.EditUserPermissionEvent;
import org.gcube.portlets.user.workspace.client.event.ExecuteDataMinerTaskEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
@ -391,6 +392,24 @@ public class ContextMenuTree {
publishOnThredds.setVisible(false);
contextMenu.add(publishOnThredds);
// publish on data catalogue
MenuItem executeDMTask = new MenuItem();
executeDMTask.setId(WorkspaceOperation.EXECUTE_DM_TASK.getId());
executeDMTask.setText(ConstantsExplorer.MESSAGE_EXECUTE_DM_TASK);
executeDMTask.setIcon(Resources.getIconShell());
executeDMTask.addSelectionListener(new SelectionListener<MenuEvent>() {
public void componentSelected(MenuEvent ce) {
FileModel sourceFileModel = listSelectedItems.get(0);
if (sourceFileModel != null) {
eventBus.fireEvent(new ExecuteDataMinerTaskEvent(sourceFileModel));
}
}
});
executeDMTask.setVisible(false);
contextMenu.add(executeDMTask);
MenuItem editPermissions = new MenuItem();
editPermissions.setId(WorkspaceOperation.EDIT_PERMISSIONS.getId());
@ -834,6 +853,7 @@ public class ContextMenuTree {
contextMenu.getItemByItemId(WorkspaceOperation.SENDTO.getId()).setVisible(true); //send to
contextMenu.getItemByItemId(WorkspaceOperation.DOWNLOAD.getId()).setVisible(true); //DOWNLOAD
contextMenu.getItemByItemId(WorkspaceOperation.COPY.getId()).setEnabled(true);
contextMenu.getItemByItemId(WorkspaceOperation.EXECUTE_DM_TASK.getId()).setVisible(false);
contextMenu.getItemByItemId(WorkspaceOperation.PREVIEW.getId()).setVisible(false); //preview image
contextMenu.getItemByItemId(WorkspaceOperation.LINK.getId()).setVisible(false); //open link
@ -933,6 +953,7 @@ public class ContextMenuTree {
}
else{
contextMenu.getItemByItemId(WorkspaceOperation.SHOW.getId()).setVisible(true);
contextMenu.getItemByItemId(WorkspaceOperation.EXECUTE_DM_TASK.getId()).setVisible(true);
switch(selectedItem.getGXTFolderItemType()){

@ -32,6 +32,10 @@
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<inherits name='org.gcube.portlets.widgets.wsthreddssync.WsThreddsWidget' />
<inherits
name="org.gcube.portlets.widgets.wstaskexecutor.WsTaskExecutorWidget" />
<!-- Specify the application specific style sheet. -->
<stylesheet src='workspacetree.css' />

Loading…
Cancel
Save